Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: iwlist wlan0 scan disrupts communications
From: Johannes Berg @ 2009-10-28 14:54 UTC (permalink / raw)
  To: Charles Gordon; +Cc: linux-wireless
In-Reply-To: <86201b3f0910280747q557a6153oec929e8235459c8f@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 515 bytes --]

On Wed, 2009-10-28 at 10:47 -0400, Charles Gordon wrote:

> Thanks for the information.  After doing some more testing I found
> that the association to the AP is sometimes lost and that mac80211
> does not recover automatically.  You have to type the command "wpa_cli
> reassociate" to trigger the stack to reassociate with the AP.  Is this
> one of the things that is, or will be, fixed in later releases?

I don't know. Normally, wpa_supplicant should notice this and re-connect
by itself.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* Re: iwlist wlan0 scan disrupts communications
From: Charles Gordon @ 2009-10-28 14:47 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <1256676190.4237.27.camel@johannes.local>

On Tue, Oct 27, 2009 at 4:43 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2009-10-27 at 16:40 -0400, Charles Gordon wrote:
>> Hi,
>>
>> I am using version 2.6.28 of the kernel and version 0.9.11-nogit of
>> iw.  Communications are disrupted and the device stops responding to
>> ping when I use the command "iwlist wlan0 scan".  Communications are
>> restored when the command completes.  Is this behavior expected?  Has
>> it been fixed in a later release?
>
> Yes and yes, but I don't remember whether it's better in 2.6.31 or only
> will be in 32.
>
> johannes
>
Thanks for the information.  After doing some more testing I found
that the association to the AP is sometimes lost and that mac80211
does not recover automatically.  You have to type the command "wpa_cli
reassociate" to trigger the stack to reassociate with the AP.  Is this
one of the things that is, or will be, fixed in later releases?

^ permalink raw reply

* Re: BUG at workqueue.c:192, debian 2.6.30 AND compat-wireless-2009-10-28
From: Konstantin Kletschke @ 2009-10-28 14:12 UTC (permalink / raw)
  To: linux-wireless
In-Reply-To: <43e72e890910280651h4e91819n20e55cae48474533@mail.gmail.com>

"Luis R. Rodriguez" <mcgrof@gmail.com>
writes:

> What kernel are you on?

I am on debian vanilla 2.6.30. debian names this package
"linux-image-2.6.30-2-686", uname -a says:

Linux muschimaus 2.6.30-2-686 #1 SMP Sat Sep 26 01:16:22 UTC 2009 i686 GNU/Linux

Regards, Konsti


^ permalink raw reply

* [PATCH resend] mac80211: fix BSS leak
From: Johannes Berg @ 2009-10-28 14:12 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless
In-Reply-To: <1254262165.30589.25.camel@johannes.local>

The IBSS code leaks a BSS struct after telling
cfg80211 about a given BSS by passing a frame.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/ibss.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- wireless-testing.orig/net/mac80211/ibss.c	2009-10-27 09:16:01.000000000 +0100
+++ wireless-testing/net/mac80211/ibss.c	2009-10-27 09:42:06.000000000 +0100
@@ -73,6 +73,7 @@ static void __ieee80211_sta_join_ibss(st
 	struct ieee80211_mgmt *mgmt;
 	u8 *pos;
 	struct ieee80211_supported_band *sband;
+	struct cfg80211_bss *bss;
 	u32 bss_change;
 	u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
 
@@ -177,8 +178,9 @@ static void __ieee80211_sta_join_ibss(st
 	mod_timer(&ifibss->timer,
 		  round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));
 
-	cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel,
-				  mgmt, skb->len, 0, GFP_KERNEL);
+	bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel,
+					mgmt, skb->len, 0, GFP_KERNEL);
+	cfg80211_put_bss(bss);
 	cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
 }
 



^ permalink raw reply

* Re: BUG at workqueue.c:192, debian 2.6.30 AND compat-wireless-2009-10-28
From: Luis R. Rodriguez @ 2009-10-28 13:51 UTC (permalink / raw)
  To: Konstantin Kletschke; +Cc: linux-wireless
In-Reply-To: <20091028111847.GA25553@punzenstreichler.doom>

On Wed, Oct 28, 2009 at 4:18 AM, Konstantin Kletschke <konsti@ku-gbr.de> wrote:
> Hi Folks!
>
> I use an ath9k in an Asus eeePC 1101HA.
>
> Actually regardeless which stable Kernel I use, I get many disconnects from
> my AP and receive strength is very low (-106dB) or I get no scan results.
>
> The Problem was solved with Kernel 2.6.32-rc3 but I need to use an vanilla
> debian Kernel and put a compat-wireless packages among it.
>
> With this, regardeless if compat-wireless-2009-10-28 or
> compat-wireless-2.6.32-rc5.tar.bz2 I get this while booting:
>
> [    6.287660] kernel BUG at /build/buildd-linux-2.6_2.6.30-8-i386-Tm0Lt9/linux-2.6-2.6.30/debian/build/source_i386_none/kernel/workqueue.c:192!
> [    6.287778] invalid opcode: 0000 [#1] SMP
> [    6.287939] last sysfs file: /sys/devices/pci0000:00/0000:00:1b.0/sound/card0/pcmC0D0p/pcm_class
> [    6.288005] Modules linked in: ath9k(+) snd_hda_codec_realtek ath9k_hw
> mac80211 snd_hda_intel ath snd_hda_codec snd_hwdep snd_pcm joydev snd_seq
> cfg80211 snd_timer rfkill_backport snd_seq_device i2c_isch uvcvideo
> serio_raw snd eeepc_laptop videodev v4l1_compat led_class i2c_core psmouse
> evdev atl1c wmi rfkill soundcore ac battery processor snd_page_alloc button
> ext4 mbcache jbd2 crc16 usbhid hid sd_mod crc_t10dif ide_pci_generic
> ide_core ata_generic pata_sch libata uhci_hcd video output scsi_mod
> ehci_hcd usbcore thermal fan thermal_sys [last unloaded: scsi_wait_scan]
> [    6.288005]
> [    6.288005] Pid: 721, comm: modprobe Not tainted (2.6.30-2-686 #1) 1101HA
> [    6.288005] EIP: 0060:[<c0134552>] EFLAGS: 00010213 CPU: 0
> [    6.288005] EIP is at queue_work_on+0x1b/0x44
> [    6.288005] EAX: ef507308 EBX: 00000000 ECX: ef507304 EDX: 00000000
> [    6.288005] ESI: f7001d60 EDI: f71f9101 EBP: f71f89f4 ESP: ef7afe74
> [    6.288005]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
> [    6.288005] Process modprobe (pid: 721, ti=ef7ae000 task=f70d2140 task.ti=ef7ae000)
> [    6.288005] Stack:
> [    6.288005]  f71f92ec 00000000 f883475c ef088000 ef088030 f71f8220 00000000 00000008
> [    6.288005]  f8840f70 f71ee000 f71f89f4 dbc30001 f883a66c f883c978 ef7afec8 f71ee058
> [    6.288005]  00000000 f8860000 f71f8220 c01ca4d0 dbc35001 081e1089 f8840ea8 f71ee000
> [    6.288005] Call Trace:
> [    6.288005]  [<f883475c>] ? ath_init_device+0x96e/0x9f2 [ath9k]
> [    6.288005]  [<f883a66c>] ? ath_pci_probe+0x1e1/0x2e7 [ath9k]
> [    6.288005]  [<c01ca4d0>] ? sysfs_do_create_link+0xab/0xed
> [    6.288005]  [<c020f87d>] ? local_pci_probe+0xb/0xc
> [    6.288005]  [<c02101f3>] ? pci_device_probe+0x41/0x63
> [    6.288005]  [<c026d40a>] ? driver_probe_device+0x76/0xfe
> [    6.288005]  [<c026d4d2>] ? __driver_attach+0x40/0x5b
> [    6.288005]  [<c026ced6>] ? bus_for_each_dev+0x37/0x5f
> [    6.288005]  [<c026d2f1>] ? driver_attach+0x11/0x13
> [    6.288005]  [<c026d492>] ? __driver_attach+0x0/0x5b
> [    6.288005]  [<c026c99b>] ? bus_add_driver+0x99/0x1bf
> [    6.288005]  [<c026d6eb>] ? driver_register+0x87/0xe0
> [    6.288005]  [<c0210528>] ? __pci_register_driver+0x33/0x8b
> [    6.288005]  [<f8844000>] ? ath9k_init+0x0/0x3d [ath9k]
> [    6.288005]  [<f8844020>] ? ath9k_init+0x20/0x3d [ath9k]
> [    6.288005]  [<c010113e>] ? do_one_initcall+0x55/0x155
> [    6.288005]  [<c0147311>] ? sys_init_module+0x87/0x187
> [    6.288005]  [<c0102ff4>] ? sysenter_do_call+0x12/0x28
> [    6.288005] Code: 0d 34 cf 43 c0 8b 00 03 04 8d 60 cd 43 c0 eb b2 56 89
> d6 53 89 c3 f0 0f ba 29 00 19 c0 31 d2 85 c0 75 2c 8d 41 04 39 41 04 74 04
> <0f> 0b eb fe 83 7e 10 00 89 ca 0f 45 1d 34 cf 43 c0 8b 06 03 04
> [    6.288005] EIP: [<c0134552>] queue_work_on+0x1b/0x44 SS:ESP
> 0068:ef7afe74
> [    6.299736] ---[ end trace 165efc44446b5942 ]---
>
> What am I supposed to to now, to get this working?

What kernel are you on?

  Luis

^ permalink raw reply

* BUG at workqueue.c:192, debian 2.6.30 AND compat-wireless-2009-10-28
From: Konstantin Kletschke @ 2009-10-28 11:18 UTC (permalink / raw)
  To: linux-wireless

Hi Folks!

I use an ath9k in an Asus eeePC 1101HA.

Actually regardeless which stable Kernel I use, I get many disconnects from
my AP and receive strength is very low (-106dB) or I get no scan results. 

The Problem was solved with Kernel 2.6.32-rc3 but I need to use an vanilla
debian Kernel and put a compat-wireless packages among it. 

With this, regardeless if compat-wireless-2009-10-28 or
compat-wireless-2.6.32-rc5.tar.bz2 I get this while booting:

[    6.287660] kernel BUG at /build/buildd-linux-2.6_2.6.30-8-i386-Tm0Lt9/linux-2.6-2.6.30/debian/build/source_i386_none/kernel/workqueue.c:192!
[    6.287778] invalid opcode: 0000 [#1] SMP
[    6.287939] last sysfs file: /sys/devices/pci0000:00/0000:00:1b.0/sound/card0/pcmC0D0p/pcm_class
[    6.288005] Modules linked in: ath9k(+) snd_hda_codec_realtek ath9k_hw
mac80211 snd_hda_intel ath snd_hda_codec snd_hwdep snd_pcm joydev snd_seq
cfg80211 snd_timer rfkill_backport snd_seq_device i2c_isch uvcvideo
serio_raw snd eeepc_laptop videodev v4l1_compat led_class i2c_core psmouse
evdev atl1c wmi rfkill soundcore ac battery processor snd_page_alloc button
ext4 mbcache jbd2 crc16 usbhid hid sd_mod crc_t10dif ide_pci_generic
ide_core ata_generic pata_sch libata uhci_hcd video output scsi_mod
ehci_hcd usbcore thermal fan thermal_sys [last unloaded: scsi_wait_scan]
[    6.288005]
[    6.288005] Pid: 721, comm: modprobe Not tainted (2.6.30-2-686 #1) 1101HA
[    6.288005] EIP: 0060:[<c0134552>] EFLAGS: 00010213 CPU: 0
[    6.288005] EIP is at queue_work_on+0x1b/0x44
[    6.288005] EAX: ef507308 EBX: 00000000 ECX: ef507304 EDX: 00000000
[    6.288005] ESI: f7001d60 EDI: f71f9101 EBP: f71f89f4 ESP: ef7afe74
[    6.288005]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[    6.288005] Process modprobe (pid: 721, ti=ef7ae000 task=f70d2140 task.ti=ef7ae000)
[    6.288005] Stack:
[    6.288005]  f71f92ec 00000000 f883475c ef088000 ef088030 f71f8220 00000000 00000008
[    6.288005]  f8840f70 f71ee000 f71f89f4 dbc30001 f883a66c f883c978 ef7afec8 f71ee058
[    6.288005]  00000000 f8860000 f71f8220 c01ca4d0 dbc35001 081e1089 f8840ea8 f71ee000
[    6.288005] Call Trace:
[    6.288005]  [<f883475c>] ? ath_init_device+0x96e/0x9f2 [ath9k]
[    6.288005]  [<f883a66c>] ? ath_pci_probe+0x1e1/0x2e7 [ath9k]
[    6.288005]  [<c01ca4d0>] ? sysfs_do_create_link+0xab/0xed
[    6.288005]  [<c020f87d>] ? local_pci_probe+0xb/0xc
[    6.288005]  [<c02101f3>] ? pci_device_probe+0x41/0x63
[    6.288005]  [<c026d40a>] ? driver_probe_device+0x76/0xfe
[    6.288005]  [<c026d4d2>] ? __driver_attach+0x40/0x5b
[    6.288005]  [<c026ced6>] ? bus_for_each_dev+0x37/0x5f
[    6.288005]  [<c026d2f1>] ? driver_attach+0x11/0x13
[    6.288005]  [<c026d492>] ? __driver_attach+0x0/0x5b
[    6.288005]  [<c026c99b>] ? bus_add_driver+0x99/0x1bf
[    6.288005]  [<c026d6eb>] ? driver_register+0x87/0xe0
[    6.288005]  [<c0210528>] ? __pci_register_driver+0x33/0x8b
[    6.288005]  [<f8844000>] ? ath9k_init+0x0/0x3d [ath9k]
[    6.288005]  [<f8844020>] ? ath9k_init+0x20/0x3d [ath9k]
[    6.288005]  [<c010113e>] ? do_one_initcall+0x55/0x155
[    6.288005]  [<c0147311>] ? sys_init_module+0x87/0x187
[    6.288005]  [<c0102ff4>] ? sysenter_do_call+0x12/0x28
[    6.288005] Code: 0d 34 cf 43 c0 8b 00 03 04 8d 60 cd 43 c0 eb b2 56 89
d6 53 89 c3 f0 0f ba 29 00 19 c0 31 d2 85 c0 75 2c 8d 41 04 39 41 04 74 04
<0f> 0b eb fe 83 7e 10 00 89 ca 0f 45 1d 34 cf 43 c0 8b 06 03 04
[    6.288005] EIP: [<c0134552>] queue_work_on+0x1b/0x44 SS:ESP
0068:ef7afe74
[    6.299736] ---[ end trace 165efc44446b5942 ]---

What am I supposed to to now, to get this working?

Kind Regards, Konsti

-- 
GPG KeyID EF62FCEF
Fingerprint: 13C9 B16B 9844 EC15 CC2E  A080 1E69 3FDA EF62 FCEF

^ permalink raw reply

* [PATCH] mac80211: remove RX_FLAG_RADIOTAP
From: Johannes Berg @ 2009-10-28  9:03 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Jouni Malinen

While there may be a case for a driver adding its
own bits of radiotap information, none currently
does. Also, drivers would have to copy the code
to generate the radiotap bits that now mac80211
generates. If some driver in the future needs to
add some driver-specific information I'd expect
that to be in a radiotap vendor namespace and we
can add a different way of passing such data up
and having mac80211 include it.

Additionally, rename IEEE80211_CONF_RADIOTAP to
IEEE80211_CONF_MONITOR since it's still used by
b43(legacy) to obtain per-frame timestamps.

The purpose of this patch is to simplify the RX
code in mac80211 to make it easier to add paged
skb support.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 drivers/net/wireless/b43/main.c       |    2 +-
 drivers/net/wireless/b43legacy/main.c |    2 +-
 include/net/mac80211.h                |   15 +++++++--------
 net/mac80211/iface.c                  |    8 ++++----
 net/mac80211/rx.c                     |   33 ++++++++++++---------------------
 5 files changed, 25 insertions(+), 35 deletions(-)

--- wireless-testing.orig/drivers/net/wireless/b43/main.c	2009-10-28 09:43:07.000000000 +0100
+++ wireless-testing/drivers/net/wireless/b43/main.c	2009-10-28 09:43:30.000000000 +0100
@@ -3573,7 +3573,7 @@ static int b43_op_config(struct ieee8021
 	if (conf->channel->hw_value != phy->channel)
 		b43_switch_channel(dev, conf->channel->hw_value);
 
-	dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_RADIOTAP);
+	dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_MONITOR);
 
 	/* Adjust the desired TX power level. */
 	if (conf->power_level != 0) {
--- wireless-testing.orig/drivers/net/wireless/b43legacy/main.c	2009-10-28 09:43:08.000000000 +0100
+++ wireless-testing/drivers/net/wireless/b43legacy/main.c	2009-10-28 09:43:35.000000000 +0100
@@ -2677,7 +2677,7 @@ static int b43legacy_op_dev_config(struc
 	if (conf->channel->hw_value != phy->channel)
 		b43legacy_radio_selectchannel(dev, conf->channel->hw_value, 0);
 
-	dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_RADIOTAP);
+	dev->wl->radiotap_enabled = !!(conf->flags & IEEE80211_CONF_MONITOR);
 
 	/* Adjust the desired TX power level. */
 	if (conf->power_level != 0) {
--- wireless-testing.orig/include/net/mac80211.h	2009-10-28 09:41:17.000000000 +0100
+++ wireless-testing/include/net/mac80211.h	2009-10-28 09:44:19.000000000 +0100
@@ -494,7 +494,6 @@ ieee80211_tx_info_clear_status(struct ie
  * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame.
  *	Use together with %RX_FLAG_MMIC_STRIPPED.
  * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware.
- * @RX_FLAG_RADIOTAP: This frame starts with a radiotap header.
  * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame,
  *	verification has been done by the hardware.
  * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame.
@@ -515,7 +514,6 @@ ieee80211_tx_info_clear_status(struct ie
 enum mac80211_rx_flags {
 	RX_FLAG_MMIC_ERROR	= 1<<0,
 	RX_FLAG_DECRYPTED	= 1<<1,
-	RX_FLAG_RADIOTAP	= 1<<2,
 	RX_FLAG_MMIC_STRIPPED	= 1<<3,
 	RX_FLAG_IV_STRIPPED	= 1<<4,
 	RX_FLAG_FAILED_FCS_CRC	= 1<<5,
@@ -565,7 +563,9 @@ struct ieee80211_rx_status {
  *
  * Flags to define PHY configuration options
  *
- * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
+ * @IEEE80211_CONF_MONITOR: there's a monitor interface present -- use this
+ *	to determine for example whether to calculate timestamps for packets
+ *	or not, do not use instead of filter flags!
  * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only)
  * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set
  *	the driver should be prepared to handle configuration requests but
@@ -574,7 +574,7 @@ struct ieee80211_rx_status {
  *	it can also be unset in that case when monitor interfaces are active.
  */
 enum ieee80211_conf_flags {
-	IEEE80211_CONF_RADIOTAP		= (1<<0),
+	IEEE80211_CONF_MONITOR		= (1<<0),
 	IEEE80211_CONF_PS		= (1<<1),
 	IEEE80211_CONF_IDLE		= (1<<2),
 };
@@ -584,7 +584,7 @@ enum ieee80211_conf_flags {
  * enum ieee80211_conf_changed - denotes which configuration changed
  *
  * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
- * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
+ * @IEEE80211_CONF_CHANGE_MONITOR: the monitor flag changed
  * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed
  * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
  * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed
@@ -593,7 +593,7 @@ enum ieee80211_conf_flags {
  */
 enum ieee80211_conf_changed {
 	IEEE80211_CONF_CHANGE_LISTEN_INTERVAL	= BIT(2),
-	IEEE80211_CONF_CHANGE_RADIOTAP		= BIT(3),
+	IEEE80211_CONF_CHANGE_MONITOR		= BIT(3),
 	IEEE80211_CONF_CHANGE_PS		= BIT(4),
 	IEEE80211_CONF_CHANGE_POWER		= BIT(5),
 	IEEE80211_CONF_CHANGE_CHANNEL		= BIT(6),
@@ -1661,8 +1661,7 @@ void ieee80211_restart_hw(struct ieee802
  * ieee80211_rx - receive frame
  *
  * Use this function to hand received frames to mac80211. The receive
- * buffer in @skb must start with an IEEE 802.11 header or a radiotap
- * header if %RX_FLAG_RADIOTAP is set in the @status flags.
+ * buffer in @skb must start with an IEEE 802.11 header.
  *
  * This function may not be called in IRQ context. Calls to this function
  * for a single hardware must be synchronized against each other. Calls to
--- wireless-testing.orig/net/mac80211/iface.c	2009-10-28 09:42:16.000000000 +0100
+++ wireless-testing/net/mac80211/iface.c	2009-10-28 09:42:26.000000000 +0100
@@ -214,8 +214,8 @@ static int ieee80211_open(struct net_dev
 		/* must be before the call to ieee80211_configure_filter */
 		local->monitors++;
 		if (local->monitors == 1) {
-			local->hw.conf.flags |= IEEE80211_CONF_RADIOTAP;
-			hw_reconf_flags |= IEEE80211_CONF_CHANGE_RADIOTAP;
+			local->hw.conf.flags |= IEEE80211_CONF_MONITOR;
+			hw_reconf_flags |= IEEE80211_CONF_CHANGE_MONITOR;
 		}
 
 		if (sdata->u.mntr_flags & MONITOR_FLAG_FCSFAIL)
@@ -435,8 +435,8 @@ static int ieee80211_stop(struct net_dev
 
 		local->monitors--;
 		if (local->monitors == 0) {
-			local->hw.conf.flags &= ~IEEE80211_CONF_RADIOTAP;
-			hw_reconf_flags |= IEEE80211_CONF_CHANGE_RADIOTAP;
+			local->hw.conf.flags &= ~IEEE80211_CONF_MONITOR;
+			hw_reconf_flags |= IEEE80211_CONF_CHANGE_MONITOR;
 		}
 
 		if (sdata->u.mntr_flags & MONITOR_FLAG_FCSFAIL)
--- wireless-testing.orig/net/mac80211/rx.c	2009-10-28 09:44:36.000000000 +0100
+++ wireless-testing/net/mac80211/rx.c	2009-10-28 09:46:28.000000000 +0100
@@ -39,11 +39,8 @@ static u8 ieee80211_sta_manage_reorder_b
  * only useful for monitoring.
  */
 static struct sk_buff *remove_monitor_info(struct ieee80211_local *local,
-					   struct sk_buff *skb,
-					   int rtap_len)
+					   struct sk_buff *skb)
 {
-	skb_pull(skb, rtap_len);
-
 	if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS) {
 		if (likely(skb->len > FCS_LEN))
 			skb_trim(skb, skb->len - FCS_LEN);
@@ -59,15 +56,14 @@ static struct sk_buff *remove_monitor_in
 }
 
 static inline int should_drop_frame(struct sk_buff *skb,
-				    int present_fcs_len,
-				    int radiotap_len)
+				    int present_fcs_len)
 {
 	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 
 	if (status->flag & (RX_FLAG_FAILED_FCS_CRC | RX_FLAG_FAILED_PLCP_CRC))
 		return 1;
-	if (unlikely(skb->len < 16 + present_fcs_len + radiotap_len))
+	if (unlikely(skb->len < 16 + present_fcs_len))
 		return 1;
 	if (ieee80211_is_ctl(hdr->frame_control) &&
 	    !ieee80211_is_pspoll(hdr->frame_control) &&
@@ -225,7 +221,6 @@ ieee80211_rx_monitor(struct ieee80211_lo
 	struct sk_buff *skb, *skb2;
 	struct net_device *prev_dev = NULL;
 	int present_fcs_len = 0;
-	int rtap_len = 0;
 
 	/*
 	 * First, we may need to make a copy of the skb because
@@ -235,25 +230,23 @@ ieee80211_rx_monitor(struct ieee80211_lo
 	 * We don't need to, of course, if we aren't going to return
 	 * the SKB because it has a bad FCS/PLCP checksum.
 	 */
-	if (status->flag & RX_FLAG_RADIOTAP)
-		rtap_len = ieee80211_get_radiotap_len(origskb->data);
-	else
-		/* room for the radiotap header based on driver features */
-		needed_headroom = ieee80211_rx_radiotap_len(local, status);
+
+	/* room for the radiotap header based on driver features */
+	needed_headroom = ieee80211_rx_radiotap_len(local, status);
 
 	if (local->hw.flags & IEEE80211_HW_RX_INCLUDES_FCS)
 		present_fcs_len = FCS_LEN;
 
 	if (!local->monitors) {
-		if (should_drop_frame(origskb, present_fcs_len, rtap_len)) {
+		if (should_drop_frame(origskb, present_fcs_len)) {
 			dev_kfree_skb(origskb);
 			return NULL;
 		}
 
-		return remove_monitor_info(local, origskb, rtap_len);
+		return remove_monitor_info(local, origskb);
 	}
 
-	if (should_drop_frame(origskb, present_fcs_len, rtap_len)) {
+	if (should_drop_frame(origskb, present_fcs_len)) {
 		/* only need to expand headroom if necessary */
 		skb = origskb;
 		origskb = NULL;
@@ -277,16 +270,14 @@ ieee80211_rx_monitor(struct ieee80211_lo
 		 */
 		skb = skb_copy_expand(origskb, needed_headroom, 0, GFP_ATOMIC);
 
-		origskb = remove_monitor_info(local, origskb, rtap_len);
+		origskb = remove_monitor_info(local, origskb);
 
 		if (!skb)
 			return origskb;
 	}
 
-	/* if necessary, prepend radiotap information */
-	if (!(status->flag & RX_FLAG_RADIOTAP))
-		ieee80211_add_rx_radiotap_header(local, skb, rate,
-						 needed_headroom);
+	/* prepend radiotap information */
+	ieee80211_add_rx_radiotap_header(local, skb, rate, needed_headroom);
 
 	skb_reset_mac_header(skb);
 	skb->ip_summed = CHECKSUM_UNNECESSARY;



^ permalink raw reply

* [PATCH] mac80211: fix radiotap header generation
From: Johannes Berg @ 2009-10-28  8:58 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Bruno Randolf

In

  commit 601ae7f25aea58f208a7f640f6174aac0652403a
  Author: Bruno Randolf <br1@einfach.org>
  Date:   Thu May 8 19:22:43 2008 +0200

      mac80211: make rx radiotap header more flexible

code was added that tried to align the radiotap header
position in memory based on the radiotap header length.
Quite obviously, that is completely useless.

Instead of trying to do that, use unaligned accesses
to generate the radiotap header. To properly do that,
we also need to mark struct ieee80211_radiotap_header
packed, but that is fine since it's already packed
(and it should be marked packed anyway since its a
wire format).

Cc: Bruno Randolf <br1@einfach.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
I'm not sure it should be sent to stable, it only affects platforms that
don't do unaligned accesses well.

 include/net/ieee80211_radiotap.h |    2 +-
 net/mac80211/rx.c                |   26 ++++++++++++--------------
 2 files changed, 13 insertions(+), 15 deletions(-)

--- wireless-testing.orig/net/mac80211/rx.c	2009-10-28 08:43:27.000000000 +0100
+++ wireless-testing/net/mac80211/rx.c	2009-10-28 08:58:24.000000000 +0100
@@ -95,10 +95,6 @@ ieee80211_rx_radiotap_len(struct ieee802
 	if (len & 1) /* padding for RX_FLAGS if necessary */
 		len++;
 
-	/* make sure radiotap starts at a naturally aligned address */
-	if (len % 8)
-		len = roundup(len, 8);
-
 	return len;
 }
 
@@ -116,6 +112,7 @@ ieee80211_add_rx_radiotap_header(struct 
 	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
 	struct ieee80211_radiotap_header *rthdr;
 	unsigned char *pos;
+	u16 rx_flags = 0;
 
 	rthdr = (struct ieee80211_radiotap_header *)skb_push(skb, rtap_len);
 	memset(rthdr, 0, rtap_len);
@@ -134,7 +131,7 @@ ieee80211_add_rx_radiotap_header(struct 
 
 	/* IEEE80211_RADIOTAP_TSFT */
 	if (status->flag & RX_FLAG_TSFT) {
-		*(__le64 *)pos = cpu_to_le64(status->mactime);
+		put_unaligned_le64(status->mactime, pos);
 		rthdr->it_present |=
 			cpu_to_le32(1 << IEEE80211_RADIOTAP_TSFT);
 		pos += 8;
@@ -166,17 +163,17 @@ ieee80211_add_rx_radiotap_header(struct 
 	pos++;
 
 	/* IEEE80211_RADIOTAP_CHANNEL */
-	*(__le16 *)pos = cpu_to_le16(status->freq);
+	put_unaligned_le16(status->freq, pos);
 	pos += 2;
 	if (status->band == IEEE80211_BAND_5GHZ)
-		*(__le16 *)pos = cpu_to_le16(IEEE80211_CHAN_OFDM |
-					     IEEE80211_CHAN_5GHZ);
+		put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ,
+				   pos);
 	else if (rate->flags & IEEE80211_RATE_ERP_G)
-		*(__le16 *)pos = cpu_to_le16(IEEE80211_CHAN_OFDM |
-					     IEEE80211_CHAN_2GHZ);
+		put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ,
+				   pos);
 	else
-		*(__le16 *)pos = cpu_to_le16(IEEE80211_CHAN_CCK |
-					     IEEE80211_CHAN_2GHZ);
+		put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ,
+				   pos);
 	pos += 2;
 
 	/* IEEE80211_RADIOTAP_DBM_ANTSIGNAL */
@@ -205,10 +202,11 @@ ieee80211_add_rx_radiotap_header(struct 
 
 	/* IEEE80211_RADIOTAP_RX_FLAGS */
 	/* ensure 2 byte alignment for the 2 byte field as required */
-	if ((pos - (unsigned char *)rthdr) & 1)
+	if ((pos - (u8 *)rthdr) & 1)
 		pos++;
 	if (status->flag & RX_FLAG_FAILED_PLCP_CRC)
-		*(__le16 *)pos |= cpu_to_le16(IEEE80211_RADIOTAP_F_RX_BADPLCP);
+		rx_flags |= IEEE80211_RADIOTAP_F_RX_BADPLCP;
+	put_unaligned_le16(rx_flags, pos);
 	pos += 2;
 }
 
--- wireless-testing.orig/include/net/ieee80211_radiotap.h	2009-10-28 08:46:35.000000000 +0100
+++ wireless-testing/include/net/ieee80211_radiotap.h	2009-10-28 08:51:49.000000000 +0100
@@ -80,7 +80,7 @@ struct ieee80211_radiotap_header {
 				 * Additional extensions are made
 				 * by setting bit 31.
 				 */
-};
+} __packed;
 
 /* Name                                 Data type    Units
  * ----                                 ---------    -----



^ permalink raw reply

* Re: [ath5k-devel] ath5k, too high output power?
From: Bob Copeland @ 2009-10-28  4:16 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Denys Fedoryschenko, ath5k-devel, linux-wireless
In-Reply-To: <43e72e890910261959s6490b900xebb365d288c03f@mail.gmail.com>

On Mon, Oct 26, 2009 at 10:59 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
>> I mean A or B :-) AUX or MAIN :-)
>> Sorry for my ugly English.
>> In madwifi, as i remember i was possible to do that or over sysctl or over
>> module parameter, i dont remember exactly where.
>
> You mean can you do antenna diversity and select this manually ? I am
> not sure, but I doubt it, should be easy to add though.

The code's already there in the driver, there's just not any interface
to do it from cfg80211 yet.  If you want to hack the driver just look
for the antenna-related defines :)

-- 
Bob Copeland %% www.bobcopeland.com

^ permalink raw reply

* [PATCH] libertas: remove internal buffers from GSPI driver
From: Andrey Yurovsky @ 2009-10-27 23:51 UTC (permalink / raw)
  To: linux-wireless; +Cc: libertas-dev, sebatian, dcbw, Andrey Yurovsky

This patch removes the internal command and data buffers that the GSPI driver
maintained and instead relies on the Libertas core to synchronize access
to the command and data ports as with the other interface drivers.  This
cleanup reduces the GSPI driver's memory footprint and should improve
performance by removing the need to copy to these internal buffers.
This also simplifies the bottom half of the interrupt handler.

This is an incremental cleanup: after removing the redundant buffers, we
can further improve the driver to use a threaded IRQ handler instead of
maintaining its own thread.  However I would like a few folks to test
the buffer removal first and make sure that I'm not introducing
regressions.

Tested on Blackfin BF527 with DMA disabled due to an issue with the SPI
host controller driver in the current bleeding-edge Blackfin kernel.  I
would appreciate it if someone with working DMA could test this patch
and provide feedback.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
---
 drivers/net/wireless/libertas/if_spi.c |  136 ++------------------------------
 1 files changed, 6 insertions(+), 130 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
index 06df2e1..9e0096d 100644
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -32,12 +32,6 @@
 #include "dev.h"
 #include "if_spi.h"
 
-struct if_spi_packet {
-	struct list_head		list;
-	u16				blen;
-	u8				buffer[0] __attribute__((aligned(4)));
-};
-
 struct if_spi_card {
 	struct spi_device		*spi;
 	struct lbs_private		*priv;
@@ -66,33 +60,10 @@ struct if_spi_card {
 	struct semaphore		spi_thread_terminated;
 
 	u8				cmd_buffer[IF_SPI_CMD_BUF_SIZE];
-
-	/* A buffer of incoming packets from libertas core.
-	 * Since we can't sleep in hw_host_to_card, we have to buffer
-	 * them. */
-	struct list_head		cmd_packet_list;
-	struct list_head		data_packet_list;
-
-	/* Protects cmd_packet_list and data_packet_list */
-	spinlock_t			buffer_lock;
 };
 
 static void free_if_spi_card(struct if_spi_card *card)
 {
-	struct list_head *cursor, *next;
-	struct if_spi_packet *packet;
-
-	BUG_ON(card->run_thread);
-	list_for_each_safe(cursor, next, &card->cmd_packet_list) {
-		packet = container_of(cursor, struct if_spi_packet, list);
-		list_del(&packet->list);
-		kfree(packet);
-	}
-	list_for_each_safe(cursor, next, &card->data_packet_list) {
-		packet = container_of(cursor, struct if_spi_packet, list);
-		list_del(&packet->list);
-		kfree(packet);
-	}
 	spi_set_drvdata(card->spi, NULL);
 	kfree(card);
 }
@@ -774,40 +745,6 @@ out:
 	return err;
 }
 
-/* Move data or a command from the host to the card. */
-static void if_spi_h2c(struct if_spi_card *card,
-			struct if_spi_packet *packet, int type)
-{
-	int err = 0;
-	u16 int_type, port_reg;
-
-	switch (type) {
-	case MVMS_DAT:
-		int_type = IF_SPI_CIC_TX_DOWNLOAD_OVER;
-		port_reg = IF_SPI_DATA_RDWRPORT_REG;
-		break;
-	case MVMS_CMD:
-		int_type = IF_SPI_CIC_CMD_DOWNLOAD_OVER;
-		port_reg = IF_SPI_CMD_RDWRPORT_REG;
-		break;
-	default:
-		lbs_pr_err("can't transfer buffer of type %d\n", type);
-		err = -EINVAL;
-		goto out;
-	}
-
-	/* Write the data to the card */
-	err = spu_write(card, port_reg, packet->buffer, packet->blen);
-	if (err)
-		goto out;
-
-out:
-	kfree(packet);
-
-	if (err)
-		lbs_pr_err("%s: error %d\n", __func__, err);
-}
-
 /* Inform the host about a card event */
 static void if_spi_e2h(struct if_spi_card *card)
 {
@@ -837,8 +774,6 @@ static int lbs_spi_thread(void *data)
 	int err;
 	struct if_spi_card *card = data;
 	u16 hiStatus;
-	unsigned long flags;
-	struct if_spi_packet *packet;
 
 	while (1) {
 		/* Wait to be woken up by one of two things.  First, our ISR
@@ -877,43 +812,9 @@ static int lbs_spi_thread(void *data)
 		if (hiStatus & IF_SPI_HIST_CMD_DOWNLOAD_RDY ||
 		   (card->priv->psstate != PS_STATE_FULL_POWER &&
 		    (hiStatus & IF_SPI_HIST_TX_DOWNLOAD_RDY))) {
-			/* This means two things. First of all,
-			 * if there was a previous command sent, the card has
-			 * successfully received it.
-			 * Secondly, it is now ready to download another
-			 * command.
-			 */
 			lbs_host_to_card_done(card->priv);
-
-			/* Do we have any command packets from the host to
-			 * send? */
-			packet = NULL;
-			spin_lock_irqsave(&card->buffer_lock, flags);
-			if (!list_empty(&card->cmd_packet_list)) {
-				packet = (struct if_spi_packet *)(card->
-						cmd_packet_list.next);
-				list_del(&packet->list);
-			}
-			spin_unlock_irqrestore(&card->buffer_lock, flags);
-
-			if (packet)
-				if_spi_h2c(card, packet, MVMS_CMD);
 		}
-		if (hiStatus & IF_SPI_HIST_TX_DOWNLOAD_RDY) {
-			/* Do we have any data packets from the host to
-			 * send? */
-			packet = NULL;
-			spin_lock_irqsave(&card->buffer_lock, flags);
-			if (!list_empty(&card->data_packet_list)) {
-				packet = (struct if_spi_packet *)(card->
-						data_packet_list.next);
-				list_del(&packet->list);
-			}
-			spin_unlock_irqrestore(&card->buffer_lock, flags);
 
-			if (packet)
-				if_spi_h2c(card, packet, MVMS_DAT);
-		}
 		if (hiStatus & IF_SPI_HIST_CARD_EVENT)
 			if_spi_e2h(card);
 
@@ -942,40 +843,18 @@ static int if_spi_host_to_card(struct lbs_private *priv,
 				u8 type, u8 *buf, u16 nb)
 {
 	int err = 0;
-	unsigned long flags;
 	struct if_spi_card *card = priv->card;
-	struct if_spi_packet *packet;
-	u16 blen;
 
 	lbs_deb_enter_args(LBS_DEB_SPI, "type %d, bytes %d", type, nb);
 
-	if (nb == 0) {
-		lbs_pr_err("%s: invalid size requested: %d\n", __func__, nb);
-		err = -EINVAL;
-		goto out;
-	}
-	blen = ALIGN(nb, 4);
-	packet = kzalloc(sizeof(struct if_spi_packet) + blen, GFP_ATOMIC);
-	if (!packet) {
-		err = -ENOMEM;
-		goto out;
-	}
-	packet->blen = blen;
-	memcpy(packet->buffer, buf, nb);
-	memset(packet->buffer + nb, 0, blen - nb);
+	nb = ALIGN(nb, 4);
 
 	switch (type) {
 	case MVMS_CMD:
-		priv->dnld_sent = DNLD_CMD_SENT;
-		spin_lock_irqsave(&card->buffer_lock, flags);
-		list_add_tail(&packet->list, &card->cmd_packet_list);
-		spin_unlock_irqrestore(&card->buffer_lock, flags);
+		err = spu_write(card, IF_SPI_CMD_RDWRPORT_REG, buf, nb);
 		break;
 	case MVMS_DAT:
-		priv->dnld_sent = DNLD_DATA_SENT;
-		spin_lock_irqsave(&card->buffer_lock, flags);
-		list_add_tail(&packet->list, &card->data_packet_list);
-		spin_unlock_irqrestore(&card->buffer_lock, flags);
+		err = spu_write(card, IF_SPI_DATA_RDWRPORT_REG, buf, nb);
 		break;
 	default:
 		lbs_pr_err("can't transfer buffer of type %d", type);
@@ -983,9 +862,6 @@ static int if_spi_host_to_card(struct lbs_private *priv,
 		break;
 	}
 
-	/* Wake up the spi thread */
-	up(&card->spi_ready);
-out:
 	lbs_deb_leave_args(LBS_DEB_SPI, "err=%d", err);
 	return err;
 }
@@ -1062,9 +938,6 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 
 	sema_init(&card->spi_ready, 0);
 	sema_init(&card->spi_thread_terminated, 0);
-	INIT_LIST_HEAD(&card->cmd_packet_list);
-	INIT_LIST_HEAD(&card->data_packet_list);
-	spin_lock_init(&card->buffer_lock);
 
 	/* Initialize the SPI Interface Unit */
 	err = spu_init(card, pdata->use_dummy_writes);
@@ -1141,6 +1014,9 @@ static int __devinit if_spi_probe(struct spi_device *spi)
 		goto terminate_thread;
 	}
 
+	/* poke the IRQ handler so that we don't miss the first interrupt */
+	up(&card->spi_ready);
+
 	/* Start the card.
 	 * This will call register_netdev, and we'll start
 	 * getting interrupts... */
-- 
1.5.6.3


^ permalink raw reply related

* Re: iwlist wlan0 scan disrupts communications
From: John W. Linville @ 2009-10-27 20:59 UTC (permalink / raw)
  To: Charles Gordon; +Cc: linux-wireless
In-Reply-To: <86201b3f0910271340t51aa6c0bgff43e6e7211a0dee@mail.gmail.com>

On Tue, Oct 27, 2009 at 04:40:46PM -0400, Charles Gordon wrote:

> I am using version 2.6.28 of the kernel and version 0.9.11-nogit of
> iw.  Communications are disrupted and the device stops responding to
> ping when I use the command "iwlist wlan0 scan".  Communications are
> restored when the command completes.  Is this behavior expected?  Has
> it been fixed in a later release?

The device has to change frequencies to conduct the scan.  Kinda like
missing part of a show while you are flipping channels... :-)

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: iwlist wlan0 scan disrupts communications
From: Johannes Berg @ 2009-10-27 20:43 UTC (permalink / raw)
  To: Charles Gordon; +Cc: linux-wireless
In-Reply-To: <86201b3f0910271340t51aa6c0bgff43e6e7211a0dee@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

On Tue, 2009-10-27 at 16:40 -0400, Charles Gordon wrote:
> Hi,
> 
> I am using version 2.6.28 of the kernel and version 0.9.11-nogit of
> iw.  Communications are disrupted and the device stops responding to
> ping when I use the command "iwlist wlan0 scan".  Communications are
> restored when the command completes.  Is this behavior expected?  Has
> it been fixed in a later release?

Yes and yes, but I don't remember whether it's better in 2.6.31 or only
will be in 32.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* iwlist wlan0 scan disrupts communications
From: Charles Gordon @ 2009-10-27 20:40 UTC (permalink / raw)
  To: linux-wireless

Hi,

I am using version 2.6.28 of the kernel and version 0.9.11-nogit of
iw.  Communications are disrupted and the device stops responding to
ping when I use the command "iwlist wlan0 scan".  Communications are
restored when the command completes.  Is this behavior expected?  Has
it been fixed in a later release?

Thanks for your help.

^ permalink raw reply

* Re: [PATCH 2.6.32] mac80211: split hardware scan by band
From: Johannes Berg @ 2009-10-27 20:24 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, Luciano Coelho
In-Reply-To: <1256673595.4237.24.camel@johannes.local>

[-- Attachment #1: Type: text/plain, Size: 548 bytes --]

On Tue, 2009-10-27 at 20:59 +0100, Johannes Berg wrote:

> Fix this by splitting up cfg80211 scan requests by
> band -- recalculating the IEs every time -- and
> requesting only per-band scans from the driver.

Incidentally, this means that dual-band drivers now absolutely need to
take a look at the scan channel list that is provided since if they
ignore it they will end up doing two full scans instead of one. Since
wl1271 is the only driver this affects right now, and its 5ghz support
is disabled, this seems ok to me.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply

* [PATCH 2.6.32] mac80211: split hardware scan by band
From: Johannes Berg @ 2009-10-27 19:59 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

There's currently a very odd bug in mac80211 -- a
hardware scan that is done while the hardware is
really operating on 2.4 GHz will include CCK rates
in the probe request frame, even on 5 GHz (if the
driver uses the mac80211 IEs). Vice versa, if the
hardware is operating on 5 GHz the 2.4 GHz probe
requests will not include CCK rates even though
they should.

Fix this by splitting up cfg80211 scan requests by
band -- recalculating the IEs every time -- and
requesting only per-band scans from the driver.

Apparently this bug hasn't been a problem yet, but
it is imaginable that some older access points get
confused if confronted with such behaviour.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/ieee80211_i.h |    8 +--
 net/mac80211/scan.c        |   96 +++++++++++++++++++++++++++++++++------------
 net/mac80211/util.c        |    8 ++-
 3 files changed, 80 insertions(+), 32 deletions(-)

--- wireless-testing.orig/net/mac80211/ieee80211_i.h	2009-10-27 20:53:00.000000000 +0100
+++ wireless-testing/net/mac80211/ieee80211_i.h	2009-10-27 20:54:01.000000000 +0100
@@ -667,10 +667,9 @@ struct ieee80211_local {
 	unsigned long scanning;
 	struct cfg80211_ssid scan_ssid;
 	struct cfg80211_scan_request *int_scan_req;
-	struct cfg80211_scan_request *scan_req;
+	struct cfg80211_scan_request *scan_req, *hw_scan_req;
 	struct ieee80211_channel *scan_channel;
-	const u8 *orig_ies;
-	int orig_ies_len;
+	enum ieee80211_band hw_scan_band;
 	int scan_channel_idx;
 	int scan_ies_len;
 
@@ -1050,7 +1049,8 @@ void ieee80211_send_auth(struct ieee8021
 			 u8 *extra, size_t extra_len, const u8 *bssid,
 			 const u8 *key, u8 key_len, u8 key_idx);
 int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
-			     const u8 *ie, size_t ie_len);
+			     const u8 *ie, size_t ie_len,
+			     enum ieee80211_band band);
 void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
 			      const u8 *ssid, size_t ssid_len,
 			      const u8 *ie, size_t ie_len);
--- wireless-testing.orig/net/mac80211/scan.c	2009-10-27 20:53:00.000000000 +0100
+++ wireless-testing/net/mac80211/scan.c	2009-10-27 20:54:01.000000000 +0100
@@ -187,6 +187,39 @@ ieee80211_scan_rx(struct ieee80211_sub_i
 	return RX_QUEUED;
 }
 
+/* return false if no more work */
+static bool ieee80211_prep_hw_scan(struct ieee80211_local *local)
+{
+	struct cfg80211_scan_request *req = local->scan_req;
+	enum ieee80211_band band;
+	int i, ielen, n_chans;
+
+	do {
+		if (local->hw_scan_band == IEEE80211_NUM_BANDS)
+			return false;
+
+		band = local->hw_scan_band;
+		n_chans = 0;
+		for (i = 0; i < req->n_channels; i++) {
+			if (req->channels[i]->band == band) {
+				local->hw_scan_req->channels[n_chans] =
+							req->channels[i];
+				n_chans++;
+			}
+		}
+
+		local->hw_scan_band++;
+	} while (!n_chans);
+
+	local->hw_scan_req->n_channels = n_chans;
+
+	ielen = ieee80211_build_preq_ies(local, (u8 *)local->hw_scan_req->ie,
+					 req->ie, req->ie_len, band);
+	local->hw_scan_req->ie_len = ielen;
+
+	return true;
+}
+
 /*
  * inform AP that we will go to sleep so that it will buffer the frames
  * while we scan
@@ -247,13 +280,6 @@ static void ieee80211_scan_ps_disable(st
 	}
 }
 
-static void ieee80211_restore_scan_ies(struct ieee80211_local *local)
-{
-	kfree(local->scan_req->ie);
-	local->scan_req->ie = local->orig_ies;
-	local->scan_req->ie_len = local->orig_ies_len;
-}
-
 void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted)
 {
 	struct ieee80211_local *local = hw_to_local(hw);
@@ -272,15 +298,22 @@ void ieee80211_scan_completed(struct iee
 		return;
 	}
 
-	if (test_bit(SCAN_HW_SCANNING, &local->scanning))
-		ieee80211_restore_scan_ies(local);
+	was_hw_scan = test_bit(SCAN_HW_SCANNING, &local->scanning);
+	if (was_hw_scan && !aborted && ieee80211_prep_hw_scan(local)) {
+		ieee80211_queue_delayed_work(&local->hw,
+					     &local->scan_work, 0);
+		mutex_unlock(&local->scan_mtx);
+		return;
+	}
+
+	kfree(local->hw_scan_req);
+	local->hw_scan_req = NULL;
 
 	if (local->scan_req != local->int_scan_req)
 		cfg80211_scan_done(local->scan_req, aborted);
 	local->scan_req = NULL;
 	local->scan_sdata = NULL;
 
-	was_hw_scan = test_bit(SCAN_HW_SCANNING, &local->scanning);
 	local->scanning = 0;
 	local->scan_channel = NULL;
 
@@ -392,19 +425,23 @@ static int __ieee80211_start_scan(struct
 
 	if (local->ops->hw_scan) {
 		u8 *ies;
-		int ielen;
 
-		ies = kmalloc(2 + IEEE80211_MAX_SSID_LEN +
-			      local->scan_ies_len + req->ie_len, GFP_KERNEL);
-		if (!ies)
+		local->hw_scan_req = kmalloc(
+				sizeof(*local->hw_scan_req) +
+				req->n_channels * sizeof(req->channels[0]) +
+				2 + IEEE80211_MAX_SSID_LEN + local->scan_ies_len +
+				req->ie_len, GFP_KERNEL);
+		if (!local->hw_scan_req)
 			return -ENOMEM;
 
-		ielen = ieee80211_build_preq_ies(local, ies,
-						 req->ie, req->ie_len);
-		local->orig_ies = req->ie;
-		local->orig_ies_len = req->ie_len;
-		req->ie = ies;
-		req->ie_len = ielen;
+		local->hw_scan_req->ssids = req->ssids;
+		local->hw_scan_req->n_ssids = req->n_ssids;
+		ies = (u8 *)local->hw_scan_req +
+			sizeof(*local->hw_scan_req) +
+			req->n_channels * sizeof(req->channels[0]);
+		local->hw_scan_req->ie = ies;
+
+		local->hw_scan_band = 0;
 	}
 
 	local->scan_req = req;
@@ -436,16 +473,17 @@ static int __ieee80211_start_scan(struct
 	ieee80211_recalc_idle(local);
 	mutex_unlock(&local->scan_mtx);
 
-	if (local->ops->hw_scan)
-		rc = drv_hw_scan(local, local->scan_req);
-	else
+	if (local->ops->hw_scan) {
+		WARN_ON(!ieee80211_prep_hw_scan(local));
+		rc = drv_hw_scan(local, local->hw_scan_req);
+	} else
 		rc = ieee80211_start_sw_scan(local);
 
 	mutex_lock(&local->scan_mtx);
 
 	if (rc) {
-		if (local->ops->hw_scan)
-			ieee80211_restore_scan_ies(local);
+		kfree(local->hw_scan_req);
+		local->hw_scan_req = NULL;
 		local->scanning = 0;
 
 		ieee80211_recalc_idle(local);
@@ -654,6 +692,14 @@ void ieee80211_scan_work(struct work_str
 		return;
 	}
 
+	if (local->hw_scan_req) {
+		int rc = drv_hw_scan(local, local->hw_scan_req);
+		mutex_unlock(&local->scan_mtx);
+		if (rc)
+			ieee80211_scan_completed(&local->hw, true);
+		return;
+	}
+
 	if (local->scan_req && !local->scanning) {
 		struct cfg80211_scan_request *req = local->scan_req;
 		int rc;
--- wireless-testing.orig/net/mac80211/util.c	2009-10-27 20:53:00.000000000 +0100
+++ wireless-testing/net/mac80211/util.c	2009-10-27 20:54:01.000000000 +0100
@@ -872,13 +872,14 @@ void ieee80211_send_auth(struct ieee8021
 }
 
 int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer,
-			     const u8 *ie, size_t ie_len)
+			     const u8 *ie, size_t ie_len,
+			     enum ieee80211_band band)
 {
 	struct ieee80211_supported_band *sband;
 	u8 *pos, *supp_rates_len, *esupp_rates_len = NULL;
 	int i;
 
-	sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
+	sband = local->hw.wiphy->bands[band];
 
 	pos = buffer;
 
@@ -966,7 +967,8 @@ void ieee80211_send_probe_req(struct iee
 	memcpy(pos, ssid, ssid_len);
 	pos += ssid_len;
 
-	skb_put(skb, ieee80211_build_preq_ies(local, pos, ie, ie_len));
+	skb_put(skb, ieee80211_build_preq_ies(local, pos, ie, ie_len,
+					      local->hw.conf.channel->band));
 
 	ieee80211_tx_skb(sdata, skb, 0);
 }



^ permalink raw reply

* [PATCH] mac80211: remove outdated comment
From: Johannes Berg @ 2009-10-27 19:56 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

This comment hasn't been a real TODO item for a long
time now since we fixed that quite a while ago.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/scan.c |    2 --
 1 file changed, 2 deletions(-)

--- wireless-testing.orig/net/mac80211/scan.c	2009-10-27 17:12:54.000000000 +0100
+++ wireless-testing/net/mac80211/scan.c	2009-10-27 17:19:16.000000000 +0100
@@ -12,8 +12,6 @@
  * published by the Free Software Foundation.
  */
 
-/* TODO: figure out how to avoid that the "current BSS" expires */
-
 #include <linux/wireless.h>
 #include <linux/if_arp.h>
 #include <linux/rtnetlink.h>



^ permalink raw reply

* [PATCH] mac80211_hwsim: don't register CCK rates on 5ghz
From: Johannes Berg @ 2009-10-27 19:53 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

This buglet confused me a lot just now ...

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 drivers/net/wireless/mac80211_hwsim.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

--- wireless-testing.orig/drivers/net/wireless/mac80211_hwsim.c	2009-10-27 20:52:53.000000000 +0100
+++ wireless-testing/drivers/net/wireless/mac80211_hwsim.c	2009-10-27 20:52:56.000000000 +0100
@@ -1045,19 +1045,20 @@ static int __init init_mac80211_hwsim(vo
 				sband->channels = data->channels_2ghz;
 				sband->n_channels =
 					ARRAY_SIZE(hwsim_channels_2ghz);
+				sband->bitrates = data->rates;
+				sband->n_bitrates = ARRAY_SIZE(hwsim_rates);
 				break;
 			case IEEE80211_BAND_5GHZ:
 				sband->channels = data->channels_5ghz;
 				sband->n_channels =
 					ARRAY_SIZE(hwsim_channels_5ghz);
+				sband->bitrates = data->rates + 4;
+				sband->n_bitrates = ARRAY_SIZE(hwsim_rates) - 4;
 				break;
 			default:
 				break;
 			}
 
-			sband->bitrates = data->rates;
-			sband->n_bitrates = ARRAY_SIZE(hwsim_rates);
-
 			sband->ht_cap.ht_supported = true;
 			sband->ht_cap.cap = IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
 				IEEE80211_HT_CAP_GRN_FLD |



^ permalink raw reply

* Re: [PATCH] wl1251: re-disable PG10 chips
From: Kalle Valo @ 2009-10-27 19:39 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless
In-Reply-To: <1256671025-26126-1-git-send-email-linville@tuxdriver.com>

"John W. Linville" <linville@tuxdriver.com> writes:

> "wl1251: add support for PG11 chips." accidentally enabled PG10 chips as
> well...
>
> Reported-by: Kalle Valo <kalle.valo@iki.fi>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>

Thanks, looks good.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH 3/9] pcmcia: use pcmcia_loop_config in misc pcmcia drivers
From: John W. Linville @ 2009-10-27 19:28 UTC (permalink / raw)
  To: Dominik Brodowski
  Cc: linux-pcmcia, David S. Miller, Jiri Kosina, David Sterba, netdev,
	linux-wireless
In-Reply-To: <1255907255-28297-3-git-send-email-linux@dominikbrodowski.net>

On Mon, Oct 19, 2009 at 01:07:29AM +0200, Dominik Brodowski wrote:
> Use pcmcia_loop_config() in a few drivers missed during the first
> round. On fmvj18x_cs.c it -- strangely -- only requries us to set
> conf.ConfigIndex, which is done by the core, so include an empty
> loop function which returns 0 unconditionally.
> 
> CC: David S. Miller <davem@davemloft.net>
> CC: John W. Linville <linville@tuxdriver.com>
> CC: Jiri Kosina <jkosina@suse.cz>
> CC: David Sterba <dsterba@suse.cz>
> CC: netdev@vger.kernel.org
> CC: linux-wireless@vger.kernel.org
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

Acked-by: John W. Linville <linville@tuxdriver.com>

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* Re: [PATCH 2/9] pcmcia: use pre-determined values
From: John W. Linville @ 2009-10-27 19:28 UTC (permalink / raw)
  To: Dominik Brodowski; +Cc: linux-pcmcia, David S. Miller, netdev, linux-wireless
In-Reply-To: <1255907255-28297-2-git-send-email-linux@dominikbrodowski.net>

On Mon, Oct 19, 2009 at 01:07:28AM +0200, Dominik Brodowski wrote:
> A few PCMCIA network drivers can make use of values provided by the pcmcia
> core, instead of tedious, independent CIS parsing.
> 
> xirc32ps_cs.c: manf_id
> 
> hostap_cs.c: multifunction count
> 
> b43/pcmcia.c: ConfigBase address and "Present"
> 
> smc91c92_cs.c:  By default, mhz_setup() can use VERS_1 as it is stored
> in struct pcmcia_device. Only some cards require workarounds, such as
> reading out VERS_1 twice.
> 
> CC: David S. Miller <davem@davemloft.net>
> CC: John W. Linville <linville@tuxdriver.com>
> CC: netdev@vger.kernel.org
> CC: linux-wireless@vger.kernel.org
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

Acked-by: John W. Linville <linville@tuxdriver.com>

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* [PATCH] wl1251: re-disable PG10 chips
From: John W. Linville @ 2009-10-27 19:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: Kalle Valo, John W. Linville

"wl1251: add support for PG11 chips." accidentally enabled PG10 chips as
well...

Reported-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/wl12xx/wl1251_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index ec01e9d..48b0bfd 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -183,11 +183,11 @@ static int wl1251_chip_wakeup(struct wl1251 *wl)
 		wl1251_debug(DEBUG_BOOT, "chip id 0x%x (1251 PG12)",
 			     wl->chip_id);
 		break;
-	case CHIP_ID_1251_PG10:
 	case CHIP_ID_1251_PG11:
 		wl1251_debug(DEBUG_BOOT, "chip id 0x%x (1251 PG11)",
 			     wl->chip_id);
 		break;
+	case CHIP_ID_1251_PG10:
 	default:
 		wl1251_error("unsupported chip id: 0x%x", wl->chip_id);
 		ret = -ENODEV;
-- 
1.6.2.5


^ permalink raw reply related

* Re: Prism54/p54pci
From: Luis R. Rodriguez @ 2009-10-27 18:37 UTC (permalink / raw)
  To: Larry Finger, John W. Linville; +Cc: James Grossmann, linux-wireless
In-Reply-To: <4ACE131E.3080908@lwfinger.net>

On Thu, Oct 8, 2009 at 9:28 AM, Larry Finger <Larry.Finger@lwfinger.net> wrote:
> On 10/07/2009 04:00 PM, James Grossmann wrote:
>>
>> I have the gigafast WF728-AEX, which doesn't seem to work with the
>> p54pci drivers, I was previously using it with my Thinkpad T23 under
>> Gentoo (gentoo kernels 2.6.29 and 2.6.30), and could only use the
>> 1.0.4.3 firmware, now, I am using it under Ubuntu 9.04
>> (2.6.28-15-generic kernel) on the same computer, and find that I have
>> to load the prism54 driver to make it work.
>> I noticed that you were considering this to be depricated, I hope that
>> you can help me to make p54pci work!
>
> As it works with 2.6.29 and 2.6.30 kernels, but not with 2.6.28, it seems
> likely that you need a later version of the driver. Does Ubuntu have a
> package for compat-wireless? If so, install it. If not, you will need to
> install from source.

James, please do test with a new driver and appropriate firmware and
let us know if it worked or not.

  Luis

^ permalink raw reply

* [PATCH 2/5] ath9k_hw: distinguish single-chip solutions on initial probe print
From: Luis R. Rodriguez @ 2009-10-27 16:59 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez
In-Reply-To: <1256662777-20469-1-git-send-email-lrodriguez@atheros.com>

Devices with external radios have revisions which we can count on.
On single chip solutions these EEPROM values for these radio revision
also exist but are not meaningful as the radios are embedded onto the
same chip. Each single-chip device evolves together as one device.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ahb.c |   11 ++++-------
 drivers/net/wireless/ath/ath9k/hw.c  |   31 +++++++++++++++++++++++++++----
 drivers/net/wireless/ath/ath9k/hw.h  |    3 +--
 drivers/net/wireless/ath/ath9k/pci.c |   11 ++++-------
 4 files changed, 36 insertions(+), 20 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 41422c4..329e6bc 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -69,6 +69,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
 	int irq;
 	int ret = 0;
 	struct ath_hw *ah;
+	char hw_name[64];
 
 	if (!pdev->dev.platform_data) {
 		dev_err(&pdev->dev, "no platform data specified\n");
@@ -133,15 +134,11 @@ static int ath_ahb_probe(struct platform_device *pdev)
 	}
 
 	ah = sc->sc_ah;
+	ath9k_hw_name(ah, hw_name, sizeof(hw_name));
 	printk(KERN_INFO
-	       "%s: Atheros AR%s MAC/BB Rev:%x, "
-	       "AR%s RF Rev:%x, mem=0x%lx, irq=%d\n",
+	       "%s: %s mem=0x%lx, irq=%d\n",
 	       wiphy_name(hw->wiphy),
-	       ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
-	       ah->hw_version.macRev,
-	       ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
-				 AR_RADIO_SREV_MAJOR)),
-	       ah->hw_version.phyRev,
+	       hw_name,
 	       (unsigned long)mem, irq);
 
 	return 0;
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index cf543e3..dedffb8 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -3959,7 +3959,7 @@ static struct {
 /*
  * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown.
  */
-const char *ath9k_hw_mac_bb_name(u32 mac_bb_version)
+static const char *ath9k_hw_mac_bb_name(u32 mac_bb_version)
 {
 	int i;
 
@@ -3971,13 +3971,12 @@ const char *ath9k_hw_mac_bb_name(u32 mac_bb_version)
 
 	return "????";
 }
-EXPORT_SYMBOL(ath9k_hw_mac_bb_name);
 
 /*
  * Return the RF name. "????" is returned if the RF is unknown.
  * Used for devices with external radios.
  */
-const char *ath9k_hw_rf_name(u16 rf_version)
+static const char *ath9k_hw_rf_name(u16 rf_version)
 {
 	int i;
 
@@ -3989,4 +3988,28 @@ const char *ath9k_hw_rf_name(u16 rf_version)
 
 	return "????";
 }
-EXPORT_SYMBOL(ath9k_hw_rf_name);
+
+void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len)
+{
+	int used;
+
+	/* chipsets >= AR9280 are single-chip */
+	if (AR_SREV_9280_10_OR_LATER(ah)) {
+		used = snprintf(hw_name, len,
+			       "Atheros AR%s Rev:%x",
+			       ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
+			       ah->hw_version.macRev);
+	}
+	else {
+		used = snprintf(hw_name, len,
+			       "Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x",
+			       ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
+			       ah->hw_version.macRev,
+			       ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
+						AR_RADIO_SREV_MAJOR)),
+			       ah->hw_version.phyRev);
+	}
+
+	hw_name[used] = '\0';
+}
+EXPORT_SYMBOL(ath9k_hw_name);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 100fcba..c7b0c4d 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -720,8 +720,7 @@ void ath_gen_timer_free(struct ath_hw *ah, struct ath_gen_timer *timer);
 void ath_gen_timer_isr(struct ath_hw *hw);
 u32 ath9k_hw_gettsf32(struct ath_hw *ah);
 
-const char *ath9k_hw_mac_bb_name(u32 mac_bb_version);
-const char *ath9k_hw_rf_name(u16 rf_version);
+void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len);
 
 #define ATH_PCIE_CAP_LINK_CTRL	0x70
 #define ATH_PCIE_CAP_LINK_L0S	1
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 76f3890..5321f73 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -114,6 +114,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	u32 val;
 	int ret = 0;
 	struct ath_hw *ah;
+	char hw_name[64];
 
 	if (pci_enable_device(pdev))
 		return -EIO;
@@ -218,15 +219,11 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	sc->irq = pdev->irq;
 
 	ah = sc->sc_ah;
+	ath9k_hw_name(ah, hw_name, sizeof(hw_name));
 	printk(KERN_INFO
-	       "%s: Atheros AR%s MAC/BB Rev:%x "
-	       "AR%s RF Rev:%x: mem=0x%lx, irq=%d\n",
+	       "%s: %s mem=0x%lx, irq=%d\n",
 	       wiphy_name(hw->wiphy),
-	       ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
-	       ah->hw_version.macRev,
-	       ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
-				 AR_RADIO_SREV_MAJOR)),
-	       ah->hw_version.phyRev,
+	       hw_name,
 	       (unsigned long)mem, pdev->irq);
 
 	return 0;
-- 
1.6.0.4


^ permalink raw reply related

* [PATCH 1/5] ath9k_hw: move mac name and rf name helpers to hw code
From: Luis R. Rodriguez @ 2009-10-27 16:59 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez
In-Reply-To: <1256662777-20469-1-git-send-email-lrodriguez@atheros.com>

These are shared between ath9k and the future ath9k_htc driver.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/ahb.c  |    5 ++-
 drivers/net/wireless/ath/ath9k/hw.c   |   62 +++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath9k/hw.h   |    3 ++
 drivers/net/wireless/ath/ath9k/main.c |   58 ------------------------------
 drivers/net/wireless/ath/ath9k/pci.c  |    5 ++-
 5 files changed, 71 insertions(+), 62 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 25531f2..41422c4 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -137,9 +137,10 @@ static int ath_ahb_probe(struct platform_device *pdev)
 	       "%s: Atheros AR%s MAC/BB Rev:%x, "
 	       "AR%s RF Rev:%x, mem=0x%lx, irq=%d\n",
 	       wiphy_name(hw->wiphy),
-	       ath_mac_bb_name(ah->hw_version.macVersion),
+	       ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
 	       ah->hw_version.macRev,
-	       ath_rf_name((ah->hw_version.analog5GhzRev & AR_RADIO_SREV_MAJOR)),
+	       ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
+				 AR_RADIO_SREV_MAJOR)),
 	       ah->hw_version.phyRev,
 	       (unsigned long)mem, irq);
 
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index db95876..cf543e3 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -3928,3 +3928,65 @@ void ath_gen_timer_isr(struct ath_hw *ah)
 	}
 }
 EXPORT_SYMBOL(ath_gen_timer_isr);
+
+static struct {
+	u32 version;
+	const char * name;
+} ath_mac_bb_names[] = {
+	/* Devices with external radios */
+	{ AR_SREV_VERSION_5416_PCI,	"5416" },
+	{ AR_SREV_VERSION_5416_PCIE,	"5418" },
+	{ AR_SREV_VERSION_9100,		"9100" },
+	{ AR_SREV_VERSION_9160,		"9160" },
+	/* Single-chip solutions */
+	{ AR_SREV_VERSION_9280,		"9280" },
+	{ AR_SREV_VERSION_9285,		"9285" },
+	{ AR_SREV_VERSION_9287,         "9287" }
+};
+
+/* For devices with external radios */
+static struct {
+	u16 version;
+	const char * name;
+} ath_rf_names[] = {
+	{ 0,				"5133" },
+	{ AR_RAD5133_SREV_MAJOR,	"5133" },
+	{ AR_RAD5122_SREV_MAJOR,	"5122" },
+	{ AR_RAD2133_SREV_MAJOR,	"2133" },
+	{ AR_RAD2122_SREV_MAJOR,	"2122" }
+};
+
+/*
+ * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown.
+ */
+const char *ath9k_hw_mac_bb_name(u32 mac_bb_version)
+{
+	int i;
+
+	for (i=0; i<ARRAY_SIZE(ath_mac_bb_names); i++) {
+		if (ath_mac_bb_names[i].version == mac_bb_version) {
+			return ath_mac_bb_names[i].name;
+		}
+	}
+
+	return "????";
+}
+EXPORT_SYMBOL(ath9k_hw_mac_bb_name);
+
+/*
+ * Return the RF name. "????" is returned if the RF is unknown.
+ * Used for devices with external radios.
+ */
+const char *ath9k_hw_rf_name(u16 rf_version)
+{
+	int i;
+
+	for (i=0; i<ARRAY_SIZE(ath_rf_names); i++) {
+		if (ath_rf_names[i].version == rf_version) {
+			return ath_rf_names[i].name;
+		}
+	}
+
+	return "????";
+}
+EXPORT_SYMBOL(ath9k_hw_rf_name);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 936ef5b..100fcba 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -720,6 +720,9 @@ void ath_gen_timer_free(struct ath_hw *ah, struct ath_gen_timer *timer);
 void ath_gen_timer_isr(struct ath_hw *hw);
 u32 ath9k_hw_gettsf32(struct ath_hw *ah);
 
+const char *ath9k_hw_mac_bb_name(u32 mac_bb_version);
+const char *ath9k_hw_rf_name(u16 rf_version);
+
 #define ATH_PCIE_CAP_LINK_CTRL	0x70
 #define ATH_PCIE_CAP_LINK_L0S	1
 #define ATH_PCIE_CAP_LINK_L1	2
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 69cf702..9fefc51 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -3191,64 +3191,6 @@ struct ieee80211_ops ath9k_ops = {
 	.rfkill_poll        = ath9k_rfkill_poll_state,
 };
 
-static struct {
-	u32 version;
-	const char * name;
-} ath_mac_bb_names[] = {
-	{ AR_SREV_VERSION_5416_PCI,	"5416" },
-	{ AR_SREV_VERSION_5416_PCIE,	"5418" },
-	{ AR_SREV_VERSION_9100,		"9100" },
-	{ AR_SREV_VERSION_9160,		"9160" },
-	{ AR_SREV_VERSION_9280,		"9280" },
-	{ AR_SREV_VERSION_9285,		"9285" },
-	{ AR_SREV_VERSION_9287,         "9287" }
-};
-
-static struct {
-	u16 version;
-	const char * name;
-} ath_rf_names[] = {
-	{ 0,				"5133" },
-	{ AR_RAD5133_SREV_MAJOR,	"5133" },
-	{ AR_RAD5122_SREV_MAJOR,	"5122" },
-	{ AR_RAD2133_SREV_MAJOR,	"2133" },
-	{ AR_RAD2122_SREV_MAJOR,	"2122" }
-};
-
-/*
- * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown.
- */
-const char *
-ath_mac_bb_name(u32 mac_bb_version)
-{
-	int i;
-
-	for (i=0; i<ARRAY_SIZE(ath_mac_bb_names); i++) {
-		if (ath_mac_bb_names[i].version == mac_bb_version) {
-			return ath_mac_bb_names[i].name;
-		}
-	}
-
-	return "????";
-}
-
-/*
- * Return the RF name. "????" is returned if the RF is unknown.
- */
-const char *
-ath_rf_name(u16 rf_version)
-{
-	int i;
-
-	for (i=0; i<ARRAY_SIZE(ath_rf_names); i++) {
-		if (ath_rf_names[i].version == rf_version) {
-			return ath_rf_names[i].name;
-		}
-	}
-
-	return "????";
-}
-
 static int __init ath9k_init(void)
 {
 	int error;
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 63059b6..76f3890 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -222,9 +222,10 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	       "%s: Atheros AR%s MAC/BB Rev:%x "
 	       "AR%s RF Rev:%x: mem=0x%lx, irq=%d\n",
 	       wiphy_name(hw->wiphy),
-	       ath_mac_bb_name(ah->hw_version.macVersion),
+	       ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
 	       ah->hw_version.macRev,
-	       ath_rf_name((ah->hw_version.analog5GhzRev & AR_RADIO_SREV_MAJOR)),
+	       ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
+				 AR_RADIO_SREV_MAJOR)),
 	       ah->hw_version.phyRev,
 	       (unsigned long)mem, pdev->irq);
 
-- 
1.6.0.4


^ permalink raw reply related

* [PATCH 0/5] ath9k_hw: name fixes and reset fix
From: Luis R. Rodriguez @ 2009-10-27 16:59 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, ath9k-devel, Luis R. Rodriguez

John here this series has the name fix plus two more fixes I made
yesterday to get ar9271 to reset the hw properly.

Luis R. Rodriguez (5):
  ath9k_hw: move mac name and rf name helpers to hw code
  ath9k_hw: distinguish single-chip solutions on initial probe print
  ath9k_hw: add AR9271 single chip name mapping
  ath9k_hw: correct AR_PHY_SPECTRAL_SCAN register offset
  ath9k_hw: remove bogus register write on ath9k_hw_9271_pa_cal()

 drivers/net/wireless/ath/ath9k/ahb.c   |   10 ++--
 drivers/net/wireless/ath/ath9k/calib.c |    2 +-
 drivers/net/wireless/ath/ath9k/hw.c    |   89 +++++++++++++++++++++++++++++++-
 drivers/net/wireless/ath/ath9k/hw.h    |    2 +
 drivers/net/wireless/ath/ath9k/main.c  |   58 ---------------------
 drivers/net/wireless/ath/ath9k/pci.c   |   10 ++--
 drivers/net/wireless/ath/ath9k/phy.h   |   16 +++++-
 7 files changed, 113 insertions(+), 74 deletions(-)


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox