2008-07-20 23:40:22

by Tomas Winkler

[permalink] [raw]
Subject: [PATCH 0/3] Introducing IWLAGN

This series of patches renames iwl4965 driver to iwlagn driver
The driver supports both 4965AGN NIC and 5000AGN NICs family

The driver binary module meanwhile retains its original iwl4965.ko name
for not breaking the old stuff but it will be eventually renamed
for the upcoming linux stable version to iwlagn.ko.
Any suggestions on timing this are welcome.

Thanks
Tomas


---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



2008-07-21 14:23:43

by Dan Williams

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introducing IWLAGN

On Mon, 2008-07-21 at 16:29 +0300, Tomas Winkler wrote:
> On Mon, Jul 21, 2008 at 4:04 PM, drago01 <[email protected]> wrote:
> > On Mon, Jul 21, 2008 at 2:37 PM, Tomas Winkler <[email protected]> wrote:
> >> On Mon, Jul 21, 2008 at 10:18 AM, Tomas Winkler <[email protected]> wrote:
> >>> On Mon, Jul 21, 2008 at 4:25 AM, Henrique de Moraes Holschuh
> >>> <[email protected]> wrote:
> >>>> On Mon, 21 Jul 2008, Tomas Winkler wrote:
> >>>>> This series of patches renames iwl4965 driver to iwlagn driver
> >>>>
> >>>> Maybe MODULE_ALIAS with the old name would be a good idea?
> >>>
> >>> I wasn't aware of this one I'll give it a try. Thanks
> >>
> >> It doesn't work much
> >> if I rename the module name to iwlagn.ko and just add
> >> MODULE_ALIAS("iwl4965") or alias line in /etc/modprobe.conf. I've
> >> checked modules.alias it's updated.
> >> Still modprobe iwl4965 cannot catch it.
> >> So it's still will create mess when switching between to version of the kernel.
> >
> > thats odd ... just tested it with a webcam driver (m5602 added
> > MODULE_ALIAS("bisoncam") and it worked)
> > does modinfo iwlagn list the alias?
>
> yes it does show the alias but modprobe fails with Module iwl4965 not
> found. I did strace it's really reads the modules.alias but found
> nothing
> Hope I'm wasting my time on some stupid typo...just cannot find it :)

You did re-run depmod, right? Just a quick thought.

Dan



Subject: Re: [PATCH 0/3] Introducing IWLAGN

On Mon, 21 Jul 2008, Tomas Winkler wrote:
> This series of patches renames iwl4965 driver to iwlagn driver

Maybe MODULE_ALIAS with the old name would be a good idea?

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh

2008-07-20 23:40:23

by Tomas Winkler

[permalink] [raw]
Subject: [PATCH 1/3] iwlwifi: rename iwl4965-base.c to iwl-agn.c

This patch renames iwl4965-base.c to iwl-agn.c

Signed-off-by: Tomas Winkler <[email protected]>
---
drivers/net/wireless/iwlwifi/Makefile | 6 ++----
.../wireless/iwlwifi/{iwl4965-base.c => iwl-agn.c} | 0
2 files changed, 2 insertions(+), 4 deletions(-)
rename drivers/net/wireless/iwlwifi/{iwl4965-base.c => iwl-agn.c} (100%)

diff --git a/drivers/net/wireless/iwlwifi/Makefile b/drivers/net/wireless/iwlwifi/Makefile
index f50d2f8..6bf3998 100644
--- a/drivers/net/wireless/iwlwifi/Makefile
+++ b/drivers/net/wireless/iwlwifi/Makefile
@@ -11,10 +11,8 @@ iwl3945-objs := iwl3945-base.o iwl-3945.o iwl-3945-rs.o
iwl3945-$(CONFIG_IWL3945_LEDS) += iwl-3945-led.o

obj-$(CONFIG_IWL4965) += iwl4965.o
-iwl4965-objs := iwl4965-base.o iwl-4965.o iwl-agn-rs.o
+iwl4965-objs := iwl-agn.o iwl-4965.o iwl-agn-rs.o

-ifeq ($(CONFIG_IWL5000),y)
- iwl4965-objs += iwl-5000.o
-endif
+iwl4965-$(CONFIG_IWL5000) += iwl-5000.o


diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
similarity index 100%
rename from drivers/net/wireless/iwlwifi/iwl4965-base.c
rename to drivers/net/wireless/iwlwifi/iwl-agn.c
--
1.5.4.1

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


2008-07-21 12:37:22

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introducing IWLAGN

On Mon, Jul 21, 2008 at 10:18 AM, Tomas Winkler <[email protected]> wrote:
> On Mon, Jul 21, 2008 at 4:25 AM, Henrique de Moraes Holschuh
> <[email protected]> wrote:
>> On Mon, 21 Jul 2008, Tomas Winkler wrote:
>>> This series of patches renames iwl4965 driver to iwlagn driver
>>
>> Maybe MODULE_ALIAS with the old name would be a good idea?
>
> I wasn't aware of this one I'll give it a try. Thanks

It doesn't work much
if I rename the module name to iwlagn.ko and just add
MODULE_ALIAS("iwl4965") or alias line in /etc/modprobe.conf. I've
checked modules.alias it's updated.
Still modprobe iwl4965 cannot catch it.
So it's still will create mess when switching between to version of the kernel.

If someone have more insight into this networks scripting I will be greatfull
Thanks
Tomas

2008-07-20 23:40:24

by Tomas Winkler

[permalink] [raw]
Subject: [PATCH 3/3] iwlwifi: rename 4965 to AGN

This patch renames driver name from 4965 to AGN
The driver supports both 4965AGN and 5000AGN family

The driver binary module meanwhile retains it's original iwl4965.ko
name mainly because of usage in compat-wireless on platforms that already
has 4965 udev/hal settings.

This patch also cleanups iwlwifi Kconfig.

Signed-off-by: Tomas Winkler <[email protected]>
---
drivers/net/wireless/iwlwifi/Kconfig | 98 ++++++++++++++++---------------
drivers/net/wireless/iwlwifi/Makefile | 11 ++--
drivers/net/wireless/iwlwifi/iwl-agn.c | 14 +++--
drivers/net/wireless/iwlwifi/iwl-dev.h | 7 +--
4 files changed, 67 insertions(+), 63 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig
index 82b66a3..b0ac0ce 100644
--- a/drivers/net/wireless/iwlwifi/Kconfig
+++ b/drivers/net/wireless/iwlwifi/Kconfig
@@ -14,18 +14,49 @@ config IWLWIFI_LEDS
default n

config IWLWIFI_RFKILL
- boolean "IWLWIFI RF kill support"
+ boolean "Iwlwifi RF kill support"
depends on IWLCORE

-config IWL4965
- tristate "Intel Wireless WiFi 4965AGN"
+config IWLWIFI_DEBUG
+ bool "Enable full debugging output in iwlagn driver"
+ depends on IWLCORE
+ ---help---
+ This option will enable debug tracing output for the iwlwifi drivers
+
+ This will result in the kernel module being ~100k larger. You can
+ control which debug output is sent to the kernel log by setting the
+ value in
+
+ /sys/class/net/wlan0/device/debug_level
+
+ This entry will only exist if this option is enabled.
+
+ To set a value, simply echo an 8-byte hex value to the same file:
+
+ % echo 0x43fff > /sys/class/net/wlan0/device/debug_level
+
+ You can find the list of debug mask values in:
+ drivers/net/wireless/iwlwifi/iwl-debug.h
+
+ If this is your first time using this driver, you should say Y here
+ as the debug information can assist others in helping you resolve
+ any problems you may encounter.
+
+config IWLWIFI_DEBUGFS
+ bool "Iwlwifi debugfs support"
+ depends on IWLCORE && IWLWIFI_DEBUG && MAC80211_DEBUGFS
+ ---help---
+ Enable creation of debugfs files for the iwlwifi drivers.
+
+config IWLAGN
+ tristate "Intel Wireless WiFi Next Gen AGN"
depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL
select FW_LOADER
select IWLCORE
---help---
Select to build the driver supporting the:

- Intel Wireless WiFi Link 4965AGN
+ Intel Wireless WiFi Link Next-Gen AGN

This driver uses the kernel's mac80211 subsystem.

@@ -42,60 +73,33 @@ config IWL4965
If you want to compile the driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
say M here and read <file:Documentation/kbuild/modules.txt>. The
- module will be called iwl4965.ko.
-
-config IWL4965_LEDS
- bool "Enable LEDS features in iwl4965 driver"
- depends on IWL4965
- select IWLWIFI_LEDS
- ---help---
- This option enables LEDS for the iwlwifi drivers
+ module will be called iwlagn.ko.

-
-config IWL4965_SPECTRUM_MEASUREMENT
- bool "Enable Spectrum Measurement in iwl4965 driver"
- depends on IWL4965
+config IWLAGN_SPECTRUM_MEASUREMENT
+ bool "Enable Spectrum Measurement in iwlagn driver"
+ depends on IWLAGN
---help---
- This option will enable spectrum measurement for the iwl4965 driver.
+ This option will enable spectrum measurement for the iwlagn driver.

-config IWLWIFI_DEBUG
- bool "Enable full debugging output in iwl4965 driver"
- depends on IWL4965
+config IWLAGN_LEDS
+ bool "Enable LEDS features in iwlagn driver"
+ depends on IWLAGN
+ select IWLWIFI_LEDS
---help---
- This option will enable debug tracing output for the iwl4965
- driver.
-
- This will result in the kernel module being ~100k larger. You can
- control which debug output is sent to the kernel log by setting the
- value in
-
- /sys/class/net/wlan0/device/debug_level
-
- This entry will only exist if this option is enabled.
-
- To set a value, simply echo an 8-byte hex value to the same file:
-
- % echo 0x43fff > /sys/class/net/wlan0/device/debug_level
+ This option enables LEDS for the iwlagn drivers

- You can find the list of debug mask values in:
- drivers/net/wireless/iwlwifi/iwl-4965-debug.h

- If this is your first time using this driver, you should say Y here
- as the debug information can assist others in helping you resolve
- any problems you may encounter.
+config IWL4965
+ bool "Intel Wireless WiFi 4965AGN"
+ depends on IWLAGN
+ ---help---
+ This option enables support for Intel Wireless WiFi Link 4965AGN

config IWL5000
bool "Intel Wireless WiFi 5000AGN"
- depends on IWL4965
+ depends on IWLAGN
---help---
This option enables support for Intel Wireless WiFi Link 5000AGN Family
- Dependency on 4965 is temporary
-
-config IWLWIFI_DEBUGFS
- bool "Iwlwifi debugfs support"
- depends on IWLCORE && IWLWIFI_DEBUG && MAC80211_DEBUGFS
- ---help---
- Enable creation of debugfs files for the iwlwifi drivers.

config IWL3945
tristate "Intel PRO/Wireless 3945ABG/BG Network Connection"
diff --git a/drivers/net/wireless/iwlwifi/Makefile b/drivers/net/wireless/iwlwifi/Makefile
index 6bf3998..e7bbcca 100644
--- a/drivers/net/wireless/iwlwifi/Makefile
+++ b/drivers/net/wireless/iwlwifi/Makefile
@@ -6,13 +6,14 @@ iwlcore-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-debugfs.o
iwlcore-$(CONFIG_IWLWIFI_LEDS) += iwl-led.o
iwlcore-$(CONFIG_IWLWIFI_RFKILL) += iwl-rfkill.o

+obj-$(CONFIG_IWLAGN) += iwl4965.o
+iwl4965-objs := iwl-agn.o iwl-agn-rs.o
+
+iwl4965-$(CONFIG_IWL4965) += iwl-4965.o
+iwl4965-$(CONFIG_IWL5000) += iwl-5000.o
+
obj-$(CONFIG_IWL3945) += iwl3945.o
iwl3945-objs := iwl3945-base.o iwl-3945.o iwl-3945-rs.o
iwl3945-$(CONFIG_IWL3945_LEDS) += iwl-3945-led.o

-obj-$(CONFIG_IWL4965) += iwl4965.o
-iwl4965-objs := iwl-agn.o iwl-4965.o iwl-agn-rs.o
-
-iwl4965-$(CONFIG_IWL5000) += iwl-5000.o
-

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 3639607..c62f7b7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -73,7 +73,7 @@
#define VD
#endif

-#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
+#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT
#define VS "s"
#else
#define VS
@@ -884,7 +884,7 @@ static void iwl4965_set_rate(struct iwl_priv *priv)
(IWL_OFDM_BASIC_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
}

-#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
+#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT

#include "iwl-spectrum.h"

@@ -1088,7 +1088,7 @@ static void iwl4965_rx_csa(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb)
static void iwl4965_rx_spectrum_measure_notif(struct iwl_priv *priv,
struct iwl_rx_mem_buffer *rxb)
{
-#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
+#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT
struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
struct iwl4965_spectrum_notification *report = &(pkt->u.spectrum_notif);

@@ -3773,7 +3773,7 @@ static ssize_t store_filter_flags(struct device *d,
static DEVICE_ATTR(filter_flags, S_IWUSR | S_IRUGO, show_filter_flags,
store_filter_flags);

-#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
+#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT

static ssize_t show_measurement(struct device *d,
struct device_attribute *attr, char *buf)
@@ -3844,7 +3844,7 @@ static ssize_t store_measurement(struct device *d,

static DEVICE_ATTR(measurement, S_IRUSR | S_IWUSR,
show_measurement, store_measurement);
-#endif /* CONFIG_IWL4965_SPECTRUM_MEASUREMENT */
+#endif /* CONFIG_IWLAGN_SPECTRUM_MEASUREMENT */

static ssize_t store_retry_rate(struct device *d,
struct device_attribute *attr,
@@ -4092,7 +4092,7 @@ static struct attribute *iwl4965_sysfs_entries[] = {
&dev_attr_channels.attr,
&dev_attr_flags.attr,
&dev_attr_filter_flags.attr,
-#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
+#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT
&dev_attr_measurement.attr,
#endif
&dev_attr_power_level.attr,
@@ -4445,8 +4445,10 @@ static int iwl4965_pci_resume(struct pci_dev *pdev)

/* Hardware specific file defines the PCI IDs table for that hardware module */
static struct pci_device_id iwl_hw_card_ids[] = {
+#ifdef CONFIG_IWL4965
{IWL_PCI_DEVICE(0x4229, PCI_ANY_ID, iwl4965_agn_cfg)},
{IWL_PCI_DEVICE(0x4230, PCI_ANY_ID, iwl4965_agn_cfg)},
+#endif /* CONFIG_IWL4965 */
#ifdef CONFIG_IWL5000
{IWL_PCI_DEVICE(0x4232, 0x1205, iwl5100_bg_cfg)},
{IWL_PCI_DEVICE(0x4232, 0x1305, iwl5100_bg_cfg)},
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 7ac56b1..848786a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -36,7 +36,7 @@
#include <linux/kernel.h>
#include <net/ieee80211_radiotap.h>

-#define DRV_NAME "iwl4965"
+#define DRV_NAME "iwlagn"
#include "iwl-rfkill.h"
#include "iwl-eeprom.h"
#include "iwl-4965-hw.h"
@@ -808,14 +808,11 @@ struct iwl_chain_noise_data {
#define EEPROM_SEM_RETRY_LIMIT 1000 /* number of attempts (not time) */


-#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
-
enum {
MEASUREMENT_READY = (1 << 0),
MEASUREMENT_ACTIVE = (1 << 1),
};

-#endif

#define IWL_MAX_NUM_QUEUES 20 /* FIXME: do dynamic allocation */

@@ -840,7 +837,7 @@ struct iwl_priv {

struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];

-#ifdef CONFIG_IWL4965_SPECTRUM_MEASUREMENT
+#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT
/* spectrum measurement report caching */
struct iwl4965_spectrum_notification measure_report;
u8 measurement_status;
--
1.5.4.1

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


Subject: Re: [PATCH 0/3] Introducing IWLAGN

On Mon, 21 Jul 2008, Tomas Winkler wrote:
> On Mon, Jul 21, 2008 at 10:18 AM, Tomas Winkler <[email protected]> wrote:
> > On Mon, Jul 21, 2008 at 4:25 AM, Henrique de Moraes Holschuh
> > <[email protected]> wrote:
> >> On Mon, 21 Jul 2008, Tomas Winkler wrote:
> >>> This series of patches renames iwl4965 driver to iwlagn driver
> >>
> >> Maybe MODULE_ALIAS with the old name would be a good idea?
> >
> > I wasn't aware of this one I'll give it a try. Thanks
>
> It doesn't work much
> if I rename the module name to iwlagn.ko and just add
> MODULE_ALIAS("iwl4965") or alias line in /etc/modprobe.conf. I've
> checked modules.alias it's updated.
> Still modprobe iwl4965 cannot catch it.

Weird, it certainly worked for thinkpad-acpi when I added a
MODULE_ALIAS("ibm_acpi") to it, sometime ago. Might be userspace breakage.
Note that I did rename everything in the filesystem to thinkpad_acpi.*, and
the only ibm_acpi left was the one in MODULE_ALIAS.

> If someone have more insight into this networks scripting I will be greatfull

I am curious as to why it failed, as well.

--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh

2008-07-21 13:45:20

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introducing IWLAGN

On Mon, Jul 21, 2008 at 4:29 PM, Tomas Winkler <[email protected]> wrote:
> On Mon, Jul 21, 2008 at 4:04 PM, drago01 <[email protected]> wrote:
>> On Mon, Jul 21, 2008 at 2:37 PM, Tomas Winkler <[email protected]> wrote:
>>> On Mon, Jul 21, 2008 at 10:18 AM, Tomas Winkler <[email protected]> wrote:
>>>> On Mon, Jul 21, 2008 at 4:25 AM, Henrique de Moraes Holschuh
>>>> <[email protected]> wrote:
>>>>> On Mon, 21 Jul 2008, Tomas Winkler wrote:
>>>>>> This series of patches renames iwl4965 driver to iwlagn driver
>>>>>
>>>>> Maybe MODULE_ALIAS with the old name would be a good idea?
>>>>
>>>> I wasn't aware of this one I'll give it a try. Thanks
>>>
>>> It doesn't work much
>>> if I rename the module name to iwlagn.ko and just add
>>> MODULE_ALIAS("iwl4965") or alias line in /etc/modprobe.conf. I've
>>> checked modules.alias it's updated.
>>> Still modprobe iwl4965 cannot catch it.
>>> So it's still will create mess when switching between to version of the kernel.
>>
>> thats odd ... just tested it with a webcam driver (m5602 added
>> MODULE_ALIAS("bisoncam") and it worked)
>> does modinfo iwlagn list the alias?
>
> yes it does show the alias but modprobe fails with Module iwl4965 not
> found. I did strace it's really reads the modules.alias but found
> nothing
> Hope I'm wasting my time on some stupid typo...just cannot find it :)
>
> Tomas

Okay I resolved the problem. I put iwlagn to blacklist as a little
hack for development so it won't be loaded during boot. While for not
aliases modprobe works even if the modules is in blacklist this is not
the case for aliases.

Thanks for the help. Now I can release the 3rd patch with rename.
Tomas

>

2008-07-21 13:30:00

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introducing IWLAGN

On Mon, Jul 21, 2008 at 4:04 PM, drago01 <[email protected]> wrote:
> On Mon, Jul 21, 2008 at 2:37 PM, Tomas Winkler <[email protected]> wrote:
>> On Mon, Jul 21, 2008 at 10:18 AM, Tomas Winkler <[email protected]> wrote:
>>> On Mon, Jul 21, 2008 at 4:25 AM, Henrique de Moraes Holschuh
>>> <[email protected]> wrote:
>>>> On Mon, 21 Jul 2008, Tomas Winkler wrote:
>>>>> This series of patches renames iwl4965 driver to iwlagn driver
>>>>
>>>> Maybe MODULE_ALIAS with the old name would be a good idea?
>>>
>>> I wasn't aware of this one I'll give it a try. Thanks
>>
>> It doesn't work much
>> if I rename the module name to iwlagn.ko and just add
>> MODULE_ALIAS("iwl4965") or alias line in /etc/modprobe.conf. I've
>> checked modules.alias it's updated.
>> Still modprobe iwl4965 cannot catch it.
>> So it's still will create mess when switching between to version of the kernel.
>
> thats odd ... just tested it with a webcam driver (m5602 added
> MODULE_ALIAS("bisoncam") and it worked)
> does modinfo iwlagn list the alias?

yes it does show the alias but modprobe fails with Module iwl4965 not
found. I did strace it's really reads the modules.alias but found
nothing
Hope I'm wasting my time on some stupid typo...just cannot find it :)

Tomas

> And modprobe.conf should just work (modules.alias is not involved here).

2008-07-21 07:18:24

by Tomas Winkler

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introducing IWLAGN

On Mon, Jul 21, 2008 at 4:25 AM, Henrique de Moraes Holschuh
<[email protected]> wrote:
> On Mon, 21 Jul 2008, Tomas Winkler wrote:
>> This series of patches renames iwl4965 driver to iwlagn driver
>
> Maybe MODULE_ALIAS with the old name would be a good idea?

I wasn't aware of this one I'll give it a try. Thanks
Tomas

2008-07-21 13:04:18

by drago01

[permalink] [raw]
Subject: Re: [PATCH 0/3] Introducing IWLAGN

On Mon, Jul 21, 2008 at 2:37 PM, Tomas Winkler <[email protected]> wrote:
> On Mon, Jul 21, 2008 at 10:18 AM, Tomas Winkler <[email protected]> wrote:
>> On Mon, Jul 21, 2008 at 4:25 AM, Henrique de Moraes Holschuh
>> <[email protected]> wrote:
>>> On Mon, 21 Jul 2008, Tomas Winkler wrote:
>>>> This series of patches renames iwl4965 driver to iwlagn driver
>>>
>>> Maybe MODULE_ALIAS with the old name would be a good idea?
>>
>> I wasn't aware of this one I'll give it a try. Thanks
>
> It doesn't work much
> if I rename the module name to iwlagn.ko and just add
> MODULE_ALIAS("iwl4965") or alias line in /etc/modprobe.conf. I've
> checked modules.alias it's updated.
> Still modprobe iwl4965 cannot catch it.
> So it's still will create mess when switching between to version of the kernel.

thats odd ... just tested it with a webcam driver (m5602 added
MODULE_ALIAS("bisoncam") and it worked)
does modinfo iwlagn list the alias?
And modprobe.conf should just work (modules.alias is not involved here).

2008-07-20 23:40:23

by Tomas Winkler

[permalink] [raw]
Subject: [PATCH 2/3] iwlwifi: fix checkpatch.pl errors

This patch fixes errors reported by checkpatch in iwlwifi drivers

Signed-off-by: Tomas Winkler <[email protected]>
---
drivers/net/wireless/iwlwifi/iwl-3945.c | 7 ++--
drivers/net/wireless/iwlwifi/iwl-4965.c | 4 +-
drivers/net/wireless/iwlwifi/iwl-5000.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 16 ++++----
drivers/net/wireless/iwlwifi/iwl-agn.c | 10 +++---
drivers/net/wireless/iwlwifi/iwl-core.c | 4 +-
drivers/net/wireless/iwlwifi/iwl-debug.h | 4 +-
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 11 ++++--
drivers/net/wireless/iwlwifi/iwl-eeprom.c | 3 +-
drivers/net/wireless/iwlwifi/iwl-sta.c | 2 +-
drivers/net/wireless/iwlwifi/iwl3945-base.c | 52 ++++++++++++---------------
11 files changed, 55 insertions(+), 60 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index c2a7678..cab1f4b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -791,8 +791,7 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
struct ieee80211_mgmt *mgmt =
(struct ieee80211_mgmt *)header;
__le32 *pos;
- pos =
- (__le32 *) & mgmt->u.beacon.
+ pos = (__le32 *)&mgmt->u.beacon.
timestamp;
priv->timestamp0 = le32_to_cpu(pos[0]);
priv->timestamp1 = le32_to_cpu(pos[1]);
@@ -1505,7 +1504,7 @@ static int iwl3945_hw_reg_adjust_power_by_temp(int new_reading, int old_reading)
*/
static inline int iwl3945_hw_reg_temp_out_of_range(int temperature)
{
- return (((temperature < -260) || (temperature > 25)) ? 1 : 0);
+ return ((temperature < -260) || (temperature > 25)) ? 1 : 0;
}

int iwl3945_hw_get_temperature(struct iwl3945_priv *priv)
@@ -2626,7 +2625,7 @@ unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv,
tx_beacon_cmd->tx.supp_rates[1] =
(IWL_CCK_BASIC_RATES_MASK & 0xF);

- return (sizeof(struct iwl3945_tx_beacon_cmd) + frame_size);
+ return sizeof(struct iwl3945_tx_beacon_cmd) + frame_size;
}

void iwl3945_hw_rx_handler_setup(struct iwl3945_priv *priv)
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index ee31c24..e261bc9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -1515,11 +1515,11 @@ static int iwl4965_fill_txpower_tbl(struct iwl_priv *priv, u8 band, u16 channel,
c, atten_value, power_index,
tx_power.s.radio_tx_gain[c],
tx_power.s.dsp_predis_atten[c]);
- }/* for each chain */
+ } /* for each chain */

tx_power_tbl->power_tbl[i].dw = cpu_to_le32(tx_power.dw);

- }/* for each rate */
+ } /* for each rate */

return 0;
}
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 076d356..f7bbd12 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -1131,7 +1131,7 @@ static void iwl5000_txq_set_sched(struct iwl_priv *priv, u32 mask)

static inline u32 iwl5000_get_scd_ssn(struct iwl5000_tx_resp *tx_resp)
{
- return le32_to_cpup((__le32*)&tx_resp->status +
+ return le32_to_cpup((__le32 *)&tx_resp->status +
tx_resp->frame_count) & MAX_SN;
}

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 0e8100e..a8bf5a9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -245,7 +245,7 @@ static void rs_rate_scale_clear_window(struct iwl_rate_scale_data *window)

static inline u8 rs_is_valid_ant(u8 valid_antenna, u8 ant_type)
{
- return ((ant_type & valid_antenna) == ant_type);
+ return (ant_type & valid_antenna) == ant_type;
}

/*
@@ -384,9 +384,9 @@ static void rs_tl_turn_on_agg(struct iwl_priv *priv, u8 tid,

static inline int get_num_of_ant_from_rate(u32 rate_n_flags)
{
- return (!!(rate_n_flags & RATE_MCS_ANT_A_MSK) +
- !!(rate_n_flags & RATE_MCS_ANT_B_MSK) +
- !!(rate_n_flags & RATE_MCS_ANT_C_MSK));
+ return !!(rate_n_flags & RATE_MCS_ANT_A_MSK) +
+ !!(rate_n_flags & RATE_MCS_ANT_B_MSK) +
+ !!(rate_n_flags & RATE_MCS_ANT_C_MSK);
}

/**
@@ -620,9 +620,9 @@ static int rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags,
#if 0
static inline u8 rs_use_green(struct iwl_priv *priv, struct ieee80211_conf *conf)
{
- return ((conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) &&
+ return (conf->flags & IEEE80211_CONF_SUPPORT_HT_MODE) &&
priv->current_ht_config.is_green_field &&
- !priv->current_ht_config.non_GF_STA_present);
+ !priv->current_ht_config.non_GF_STA_present;
}
#endif
static inline u8 rs_use_green(struct iwl_priv *priv, struct ieee80211_conf *conf)
@@ -2157,7 +2157,7 @@ static void *rs_alloc_sta(void *priv_rate, gfp_t gfp)

for (j = 0; j < LQ_SIZE; j++)
for (i = 0; i < IWL_RATE_COUNT; i++)
- rs_rate_scale_clear_window(&(lq_sta->lq_info[j].win[i]));
+ rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);

return lq_sta;
}
@@ -2179,7 +2179,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
sta->txrate_idx = 3;
for (j = 0; j < LQ_SIZE; j++)
for (i = 0; i < IWL_RATE_COUNT; i++)
- rs_rate_scale_clear_window(&(lq_sta->lq_info[j].win[i]));
+ rs_rate_scale_clear_window(&lq_sta->lq_info[j].win[i]);

IWL_DEBUG_RATE("LQ: *** rate scale global init ***\n");
/* TODO: what is a good starting rate for STA? About middle? Maybe not
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 3ebe90a..3639607 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2477,7 +2477,7 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
unsigned long flags;

if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
- IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__);
+ IWL_ERROR("%s Should not be called in AP mode\n", __func__);
return;
}

@@ -2553,7 +2553,7 @@ static void iwl4965_post_associate(struct iwl_priv *priv)

default:
IWL_ERROR("%s Should not be called in %d mode\n",
- __FUNCTION__, priv->iw_mode);
+ __func__, priv->iw_mode);
break;
}

@@ -3781,7 +3781,7 @@ static ssize_t show_measurement(struct device *d,
struct iwl_priv *priv = dev_get_drvdata(d);
struct iwl4965_spectrum_notification measure_report;
u32 size = sizeof(measure_report), len = 0, ofs = 0;
- u8 *data = (u8 *) & measure_report;
+ u8 *data = (u8 *)&measure_report;
unsigned long flags;

spin_lock_irqsave(&priv->lock, flags);
@@ -3921,7 +3921,7 @@ static ssize_t show_power_level(struct device *d,
p += sprintf(p, "\tMODE:%s", (mode < IWL_POWER_AUTO)?"fixed":"auto");
p += sprintf(p, "\tINDEX:%d", level);
p += sprintf(p, "\n");
- return (p - buf + 1);
+ return p - buf + 1;
}

static DEVICE_ATTR(power_level, S_IWUSR | S_IRUSR, show_power_level,
@@ -3996,7 +3996,7 @@ static ssize_t show_statistics(struct device *d,
struct iwl_priv *priv = dev_get_drvdata(d);
u32 size = sizeof(struct iwl_notif_statistics);
u32 len = 0, ofs = 0;
- u8 *data = (u8 *) & priv->statistics;
+ u8 *data = (u8 *)&priv->statistics;
int rc = 0;

if (!iwl_is_alive(priv))
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 5cd990b..f55d7eb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -383,8 +383,8 @@ void iwl_reset_qos(struct iwl_priv *priv)
}
EXPORT_SYMBOL(iwl_reset_qos);

-#define MAX_BIT_RATE_40_MHZ 0x96; /* 150 Mbps */
-#define MAX_BIT_RATE_20_MHZ 0x48; /* 72 Mbps */
+#define MAX_BIT_RATE_40_MHZ 0x96 /* 150 Mbps */
+#define MAX_BIT_RATE_20_MHZ 0x48 /* 72 Mbps */
static void iwlcore_init_ht_hw_capab(const struct iwl_priv *priv,
struct ieee80211_ht_info *ht_info,
enum ieee80211_band band)
diff --git a/drivers/net/wireless/iwlwifi/iwl-debug.h b/drivers/net/wireless/iwlwifi/iwl-debug.h
index 5838480..097a72f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debug.h
+++ b/drivers/net/wireless/iwlwifi/iwl-debug.h
@@ -33,12 +33,12 @@
#define IWL_DEBUG(level, fmt, args...) \
do { if (priv->debug_level & (level)) \
dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \
- in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
+ in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0)

#define IWL_DEBUG_LIMIT(level, fmt, args...) \
do { if ((priv->debug_level & (level)) && net_ratelimit()) \
dev_printk(KERN_ERR, &(priv->hw->wiphy->dev), "%c %s " fmt, \
- in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
+ in_interrupt() ? 'I' : 'U', __func__ , ## args); } while (0)

#ifdef CONFIG_IWLWIFI_DEBUGFS
struct iwl_debugfs {
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index ed948dc..20db0eb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -231,7 +231,7 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf,
DECLARE_MAC_BUF(mac);

buf = kmalloc(bufsz, GFP_KERNEL);
- if(!buf)
+ if (!buf)
return -ENOMEM;

pos += scnprintf(buf + pos, bufsz - pos, "num of stations: %d\n\n",
@@ -364,16 +364,19 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
{
struct iwl_debugfs *dbgfs;
struct dentry *phyd = priv->hw->wiphy->debugfsdir;
+ int ret = 0;

dbgfs = kzalloc(sizeof(struct iwl_debugfs), GFP_KERNEL);
if (!dbgfs) {
+ ret = -ENOMEM;
goto err;
}

priv->dbgfs = dbgfs;
dbgfs->name = name;
dbgfs->dir_drv = debugfs_create_dir(name, phyd);
- if (!dbgfs->dir_drv || IS_ERR(dbgfs->dir_drv)){
+ if (!dbgfs->dir_drv || IS_ERR(dbgfs->dir_drv)) {
+ ret = -ENOENT;
goto err;
}

@@ -394,7 +397,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
err:
IWL_ERROR("Can't open the debugfs directory\n");
iwl_dbgfs_unregister(priv);
- return -ENOENT;
+ return ret;
}
EXPORT_SYMBOL(iwl_dbgfs_register);

@@ -404,7 +407,7 @@ EXPORT_SYMBOL(iwl_dbgfs_register);
*/
void iwl_dbgfs_unregister(struct iwl_priv *priv)
{
- if (!(priv->dbgfs))
+ if (!priv->dbgfs)
return;

DEBUGFS_REMOVE(priv->dbgfs->dbgfs_data_files.file_eeprom);
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index 4a08a1b..bce5383 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -273,8 +273,7 @@ EXPORT_SYMBOL(iwl_eeprom_init);

void iwl_eeprom_free(struct iwl_priv *priv)
{
- if(priv->eeprom)
- kfree(priv->eeprom);
+ kfree(priv->eeprom);
priv->eeprom = NULL;
}
EXPORT_SYMBOL(iwl_eeprom_free);
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 10af821..60a6e01 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -823,7 +823,7 @@ int iwl_send_lq_cmd(struct iwl_priv *priv,
if (lq->sta_id == 0xFF)
lq->sta_id = IWL_AP_ID;

- iwl_dump_lq_cmd(priv,lq);
+ iwl_dump_lq_cmd(priv, lq);

if (iwl_is_associated(priv) && priv->assoc_station_added)
return iwl_send_cmd(priv, &cmd);
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index ae81072..27e6cb1 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -275,10 +275,8 @@ static int iwl3945_tx_queue_alloc(struct iwl3945_priv *priv,
return 0;

error:
- if (txq->txb) {
- kfree(txq->txb);
- txq->txb = NULL;
- }
+ kfree(txq->txb);
+ txq->txb = NULL;

return -ENOMEM;
}
@@ -365,10 +363,8 @@ void iwl3945_tx_queue_free(struct iwl3945_priv *priv, struct iwl3945_tx_queue *t
txq->q.n_bd, txq->bd, txq->q.dma_addr);

/* De-alloc array of per-TFD driver data */
- if (txq->txb) {
- kfree(txq->txb);
- txq->txb = NULL;
- }
+ kfree(txq->txb);
+ txq->txb = NULL;

/* 0-fill queue descriptor structure */
memset(txq, 0, sizeof(*txq));
@@ -2703,9 +2699,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)

if (!ieee80211_has_morefrags(hdr->frame_control)) {
txq->need_update = 1;
- if (qc) {
+ if (qc)
priv->stations[sta_id].tid[tid].seq_number = seq_number;
- }
} else {
wait_write_ptr = 1;
txq->need_update = 0;
@@ -3813,7 +3808,7 @@ int iwl3945_calc_db_from_ratio(int sig_ratio)
/* 100:1 or higher, divide by 10 and use table,
* add 20 dB to make up for divide by 10 */
if (sig_ratio >= 100)
- return (20 + (int)ratio2dB[sig_ratio/10]);
+ return 20 + (int)ratio2dB[sig_ratio/10];

/* We shouldn't see this */
if (sig_ratio < 1)
@@ -5088,7 +5083,7 @@ static void iwl3945_dealloc_ucode_pci(struct iwl3945_priv *priv)
* iwl3945_verify_inst_full - verify runtime uCode image in card vs. host,
* looking at all data.
*/
-static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 * image, u32 len)
+static int iwl3945_verify_inst_full(struct iwl3945_priv *priv, __le32 *image, u32 len)
{
u32 val;
u32 save_len = len;
@@ -5237,7 +5232,7 @@ static int iwl3945_verify_bsm(struct iwl3945_priv *priv)
val = iwl3945_read_prph(priv, BSM_WR_DWCOUNT_REG);
for (reg = BSM_SRAM_LOWER_BOUND;
reg < BSM_SRAM_LOWER_BOUND + len;
- reg += sizeof(u32), image ++) {
+ reg += sizeof(u32), image++) {
val = iwl3945_read_prph(priv, reg);
if (val != le32_to_cpu(*image)) {
IWL_ERROR("BSM uCode verification failed at "
@@ -6336,7 +6331,7 @@ static void iwl3945_bg_post_associate(struct work_struct *data)
DECLARE_MAC_BUF(mac);

if (priv->iw_mode == IEEE80211_IF_TYPE_AP) {
- IWL_ERROR("%s Should not be called in AP mode\n", __FUNCTION__);
+ IWL_ERROR("%s Should not be called in AP mode\n", __func__);
return;
}

@@ -6417,7 +6412,7 @@ static void iwl3945_bg_post_associate(struct work_struct *data)

default:
IWL_ERROR("%s Should not be called in %d mode\n",
- __FUNCTION__, priv->iw_mode);
+ __func__, priv->iw_mode);
break;
}

@@ -7436,7 +7431,7 @@ static ssize_t show_measurement(struct device *d,
struct iwl3945_priv *priv = dev_get_drvdata(d);
struct iwl3945_spectrum_notification measure_report;
u32 size = sizeof(measure_report), len = 0, ofs = 0;
- u8 *data = (u8 *) & measure_report;
+ u8 *data = (u8 *)&measure_report;
unsigned long flags;

spin_lock_irqsave(&priv->lock, flags);
@@ -7607,7 +7602,7 @@ static ssize_t show_power_level(struct device *d,
else
p += sprintf(p, " \n");

- return (p - buf + 1);
+ return p - buf + 1;

}

@@ -7629,7 +7624,7 @@ static ssize_t show_statistics(struct device *d,
struct iwl3945_priv *priv = dev_get_drvdata(d);
u32 size = sizeof(struct iwl3945_notif_statistics);
u32 len = 0, ofs = 0;
- u8 *data = (u8 *) & priv->statistics;
+ u8 *data = (u8 *)&priv->statistics;
int rc = 0;

if (!iwl3945_is_alive(priv))
@@ -7985,16 +7980,16 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e

/* nic init */
iwl3945_set_bit(priv, CSR_GIO_CHICKEN_BITS,
- CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER);
-
- iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
- err = iwl3945_poll_bit(priv, CSR_GP_CNTRL,
- CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
- CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
- if (err < 0) {
- IWL_DEBUG_INFO("Failed to init the card\n");
+ CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER);
+
+ iwl3945_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
+ err = iwl3945_poll_bit(priv, CSR_GP_CNTRL,
+ CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
+ CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
+ if (err < 0) {
+ IWL_DEBUG_INFO("Failed to init the card\n");
goto out_remove_sysfs;
- }
+ }
/* Read the EEPROM */
err = iwl3945_eeprom_init(priv);
if (err) {
@@ -8096,9 +8091,8 @@ static void __devexit iwl3945_pci_remove(struct pci_dev *pdev)
iwl3945_unset_hw_setting(priv);
iwl3945_clear_stations_table(priv);

- if (priv->mac80211_registered) {
+ if (priv->mac80211_registered)
ieee80211_unregister_hw(priv->hw);
- }

/*netif_stop_queue(dev); */
flush_workqueue(priv->workqueue);
--
1.5.4.1

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.