* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Luis R. Rodriguez @ 2009-10-07 15:22 UTC (permalink / raw)
To: John W. Linville; +Cc: Hin-Tak Leung, linux-wireless, Hin-Tak Leung
In-Reply-To: <20091007144502.GA22394@tuxdriver.com>
On Wed, Oct 7, 2009 at 10:45 AM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Wed, Oct 07, 2009 at 01:40:04AM -0400, Luis R. Rodriguez wrote:
>> On Tue, Oct 6, 2009 at 11:39 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:
>> > Between 2.6.30 and 2.6.31, linux/netdevice.h started
>> > to include linux/ethtool.h (commit b1b67dd45a6b629eb41553856805aaa1614fbb83,
>> > "net: factor out ethtool invocation of vlan/macvlan drivers"),
>> > and commit 7508e486965b0af13984bc6d9da62a8d8f0dc5f9,
>> > "cfg80211: add firmware and hardware version to wiphy", introduces
>> > dependency of ETHTOOL_BUSINFO_LEN from linux/ethtool.h
>> > to net/cfg80211.h .
>>
>> John's patch titled "cfg80211: fix compile error from missing
>> ethtool.h" seems to address this upstream. I'll wait until he applies
>> that to the tree.
>
> As Hin-Tak points-out, linux/netdevice.h is alreadying "doing the needful". :-)
>
> I'll just drop my patch and let this get sorted in compat-wireless.
Heh ok applied, thanks.
Luis
^ permalink raw reply
* [PATCH] b43: Fix locking problem when stopping rfkill polling
From: Larry Finger @ 2009-10-07 15:06 UTC (permalink / raw)
To: John W Linville; +Cc: linux-wireless
In commit 26e5ab35b4c7b1d4cb487a11084520aed9a8d05e entitled "b43: Fix PPC
crash in rfkill polling on unload", the call to stop polling should not have
been placed inside the wl->mutex. The result was incorrect locking messages.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
John,
I had not intended for the previous patch to be applied as I was waiting for
the Bugzilla OP to test. He promised to do that today. In any case, that patch
introduced a locking problem that needs to be fixed.
Why do the one-liners cause so many problems?
Larry
---
Index: wireless-testing/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/b43/main.c
+++ wireless-testing/drivers/net/wireless/b43/main.c
@@ -4501,8 +4501,8 @@ static void b43_op_stop(struct ieee80211
cancel_work_sync(&(wl->beacon_update_trigger));
- mutex_lock(&wl->mutex);
wiphy_rfkill_stop_polling(hw->wiphy);
+ mutex_lock(&wl->mutex);
if (b43_status(dev) >= B43_STAT_STARTED) {
dev = b43_wireless_core_stop(dev);
if (!dev)
^ permalink raw reply
* [PATCH] net/wireless/ethtool.h: drop unnecessary include of linux/ethtool.h
From: John W. Linville @ 2009-10-07 14:52 UTC (permalink / raw)
To: linux-wireless; +Cc: John W. Linville
Everything including this header includes net/cfg80211.h, which
includes linux/netdevice.h, which includes linux/ethtool.h already. Why
slow-down the build, even a little bit?
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
net/wireless/ethtool.h | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/net/wireless/ethtool.h b/net/wireless/ethtool.h
index 70cbee1..695ecad 100644
--- a/net/wireless/ethtool.h
+++ b/net/wireless/ethtool.h
@@ -1,8 +1,6 @@
#ifndef __CFG80211_ETHTOOL__
#define __CFG80211_ETHTOOL__
-#include <linux/ethtool.h>
-
extern const struct ethtool_ops cfg80211_ethtool_ops;
#endif /* __CFG80211_ETHTOOL__ */
--
1.6.2.5
^ permalink raw reply related
* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: John W. Linville @ 2009-10-07 14:45 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: Hin-Tak Leung, linux-wireless, Hin-Tak Leung
In-Reply-To: <43e72e890910062240w7b4f0895t7f009b99da8fac40@mail.gmail.com>
On Wed, Oct 07, 2009 at 01:40:04AM -0400, Luis R. Rodriguez wrote:
> On Tue, Oct 6, 2009 at 11:39 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:
> > Between 2.6.30 and 2.6.31, linux/netdevice.h started
> > to include linux/ethtool.h (commit b1b67dd45a6b629eb41553856805aaa1614fbb83,
> > "net: factor out ethtool invocation of vlan/macvlan drivers"),
> > and commit 7508e486965b0af13984bc6d9da62a8d8f0dc5f9,
> > "cfg80211: add firmware and hardware version to wiphy", introduces
> > dependency of ETHTOOL_BUSINFO_LEN from linux/ethtool.h
> > to net/cfg80211.h .
>
> John's patch titled "cfg80211: fix compile error from missing
> ethtool.h" seems to address this upstream. I'll wait until he applies
> that to the tree.
As Hin-Tak points-out, linux/netdevice.h is alreadying "doing the needful". :-)
I'll just drop my patch and let this get sorted in compat-wireless.
John
--
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
* [2.6.32-rc3] iwlagn lost connection after s2ram (with warnings)
From: Carlos R. Mafra @ 2009-10-07 14:20 UTC (permalink / raw)
To: linux-wireless; +Cc: linux-kernel
I just got these warnings after resuming from a suspend to RAM, and
the wireless connection was not resumed (now I am connected via eth0).
This is the first time I had a failed wireless resume since 2.6.32-rc1.
The full dmesg is here: http://www.aei.mpg.de/~crmafra/dmesg-2.6.32-rc3-wifi.txt
[ 3427.570113] Restarting tasks ...
[ 3427.585827] wlan0: deauthenticated from 00:0b:86:26:36:f1 (Reason: 6)
[ 3427.589451] done.
[ 3428.503203] input: PS/2 Mouse as /devices/platform/i8042/serio4/input/input15
[ 3428.521064] input: AlpsPS/2 ALPS GlidePoint as /devices/platform/i8042/serio4/input/input16
[ 3434.504175] wlan0: direct probe to AP 00:0b:86:26:36:f1 (try 1)
[ 3434.507058] wlan0: direct probe responded
[ 3434.507062] wlan0: authenticate with AP 00:0b:86:26:36:f1 (try 1)
[ 3434.509000] wlan0: authenticated
[ 3434.509022] wlan0: associate with AP 00:0b:86:26:36:f1 (try 1)
[ 3434.512778] wlan0: RX ReassocResp from 00:0b:86:26:36:f1 (capab=0x431 status=0 aid=2)
[ 3434.512782] wlan0: associated
[ 3434.563942] wlan0: deauthenticating from 00:0b:86:26:36:f1 by local choice (reason=3)
[ 3434.564023] ------------[ cut here ]------------
[ 3434.564039] WARNING: at net/wireless/mlme.c:96 cfg80211_send_rx_assoc+0x193/0x230()
[ 3434.564045] Hardware name: VGN-FZ240E
[ 3434.564049] Modules linked in: usbhid nvram dvb_usb_dib0700 dib7000p dib7000m dib0070 dvb_usb dib3000mc dib8000 dibx000_common snd_hda_codec_idt uvcvideo snd_hda_intel snd_hda_codec ehci_hcd sg uhci_hcd snd_hwdep sky2 iwlagn i2c_i801 sr_mod evdev ata_piix ahci libata sd_mod scsi_mod
[ 3434.564104] Pid: 2319, comm: phy0 Not tainted 2.6.32-rc3 #204
[ 3434.564109] Call Trace:
[ 3434.564119] [<ffffffff81420dd3>] ? cfg80211_send_rx_assoc+0x193/0x230
[ 3434.564131] [<ffffffff81047cb8>] warn_slowpath_common+0x78/0xd0
[ 3434.564139] [<ffffffff81047d1f>] warn_slowpath_null+0xf/0x20
[ 3434.564147] [<ffffffff81420dd3>] cfg80211_send_rx_assoc+0x193/0x230
[ 3434.564156] [<ffffffff814316cb>] ieee80211_sta_work+0x2fb/0x1100
[ 3434.564166] [<ffffffff81453b1f>] ? _spin_unlock_bh+0xf/0x20
[ 3434.564175] [<ffffffff8142802a>] ? ieee80211_configure_filter+0x11a/0x170
[ 3434.564183] [<ffffffff814313d0>] ? ieee80211_sta_work+0x0/0x1100
[ 3434.564193] [<ffffffff8105e9e2>] worker_thread+0x182/0x260
[ 3434.564203] [<ffffffff81063320>] ? autoremove_wake_function+0x0/0x40
[ 3434.564211] [<ffffffff8105e860>] ? worker_thread+0x0/0x260
[ 3434.564219] [<ffffffff81062f06>] kthread+0x96/0xb0
[ 3434.564229] [<ffffffff8100cd1a>] child_rip+0xa/0x20
[ 3434.564237] [<ffffffff81062e70>] ? kthread+0x0/0xb0
[ 3434.564245] [<ffffffff8100cd10>] ? child_rip+0x0/0x20
[ 3434.564250] ---[ end trace 99d6122abfa316f7 ]---
[ 3434.564272] ------------[ cut here ]------------
[ 3434.564280] WARNING: at net/wireless/sme.c:417 __cfg80211_connect_result+0x343/0x380()
[ 3434.564285] Hardware name: VGN-FZ240E
[ 3434.564289] Modules linked in: usbhid nvram dvb_usb_dib0700 dib7000p dib7000m dib0070 dvb_usb dib3000mc dib8000 dibx000_common snd_hda_codec_idt uvcvideo snd_hda_intel snd_hda_codec ehci_hcd sg uhci_hcd snd_hwdep sky2 iwlagn i2c_i801 sr_mod evdev ata_piix ahci libata sd_mod scsi_mod
[ 3434.564335] Pid: 2319, comm: phy0 Tainted: G W 2.6.32-rc3 #204
[ 3434.564340] Call Trace:
[ 3434.564347] [<ffffffff81453b1f>] ? _spin_unlock_bh+0xf/0x20
[ 3434.564355] [<ffffffff814236e3>] ? __cfg80211_connect_result+0x343/0x380
[ 3434.564364] [<ffffffff81047cb8>] warn_slowpath_common+0x78/0xd0
[ 3434.564373] [<ffffffff81047d1f>] warn_slowpath_null+0xf/0x20
[ 3434.564381] [<ffffffff814236e3>] __cfg80211_connect_result+0x343/0x380
[ 3434.564389] [<ffffffff814509a2>] ? dump_stack+0x72/0x7b
[ 3434.564397] [<ffffffff81420e10>] cfg80211_send_rx_assoc+0x1d0/0x230
[ 3434.564405] [<ffffffff814316cb>] ieee80211_sta_work+0x2fb/0x1100
[ 3434.564413] [<ffffffff81453b1f>] ? _spin_unlock_bh+0xf/0x20
[ 3434.564421] [<ffffffff8142802a>] ? ieee80211_configure_filter+0x11a/0x170
[ 3434.564429] [<ffffffff814313d0>] ? ieee80211_sta_work+0x0/0x1100
[ 3434.564438] [<ffffffff8105e9e2>] worker_thread+0x182/0x260
[ 3434.564447] [<ffffffff81063320>] ? autoremove_wake_function+0x0/0x40
[ 3434.564455] [<ffffffff8105e860>] ? worker_thread+0x0/0x260
[ 3434.564463] [<ffffffff81062f06>] kthread+0x96/0xb0
[ 3434.564471] [<ffffffff8100cd1a>] child_rip+0xa/0x20
[ 3434.564479] [<ffffffff81062e70>] ? kthread+0x0/0xb0
[ 3434.564487] [<ffffffff8100cd10>] ? child_rip+0x0/0x20
[ 3434.564492] ---[ end trace 99d6122abfa316f8 ]---
[ 3434.962611] Registered led device: iwl-phy0::radio
[ 3434.962629] Registered led device: iwl-phy0::assoc
[ 3434.962645] Registered led device: iwl-phy0::RX
[ 3434.962661] Registered led device: iwl-phy0::TX
[ 3435.000526] ADDRCONF(NETDEV_UP): wlan0: link is not ready
^ permalink raw reply
* Re: Linux wifi development board
From: David Acker @ 2009-10-07 12:31 UTC (permalink / raw)
To: Ahmed A; +Cc: linux-wireless
In-Reply-To: <911923.95402.qm@web32505.mail.mud.yahoo.com>
Ahmed A wrote:
> Hi David,
>
> Thank you for your response. I would like to explain what I am trying to setup, and would appreciate your feedback please. My setup would comprise of two parts. One part would be the wifi router (base station), on which I load linux image bundled with my special app onto it. The other part would be the wifi client (CPE), that would connect to the router. I would also like to be able to load my own kernel image bundled with my special app.
>
> I am guessing from your email, I would have to get a board from gateworks, hook up an antenna to it from ubnt, load image from OpenWRT, that would be my wifi router. Is that right? Which product would you recommend, the Avilla platform? Which antenna from ubnt? Would there be issues getting these to work? How about the components on the client side, same deal?
>
> I have done some work/programming on the IXP, but I do prefer a board with non-IXP CPU, like PowerPC or XScale.
>
> Is there any solution out there, where the dev board and antenna come bundled, so I don't have to muck around getting them to work?
>
> Any decent alternate board supplier, the prices of boards from gateworks are a bit pricey for me.
As someone else noted, the RouterStation Pro from Ubiquiti
http://ubnt.com/products/rspro.php is a pretty good deal. $80 gets you
quite the system. You could add in any of Ubiquiti's atheros based
miniPCI radios. They have 802.11b/g, 802.11a, and 802.11N in both 2.4
and 5 GHz. They also have several other frequencies like 2.3, 2.6, 4,
900 MHz, and 700 MHz. All of their radios are supported by either
madwifi/ath5k or ath9k.
For all in one less expensive systems, I would look for an off the shelf
wifi router that is supported by OpenWRT. They have a nice list of
supported routers.
-ack
^ permalink raw reply
* Bug: AR928x not working on 2.6.31.x
From: berndl81 @ 2009-10-07 11:59 UTC (permalink / raw)
To: linux-wireless
I am using Archlinux on my Acer Extensa 7630EZ and realize that my wireless-device which is an
Atheros Communications Inc. AR928X Wireless Network Adapter (PCI-Express) (rev 01)
according to lspci works very well using arch-stock kernel 2.6.30 and is not working any longer when using the 2.6.31.1 or 2.6.31.2 kernel from Arch's testing repository.
When using the 2.6.30 kernel (wlan is working very well), I get the following dmesg-output:
[bernhard@wallaby ~]$ dmesg |grep ath
ath9k 0000:05:00.0: enabling device (0000 -> 0002)
ath9k 0000:05:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
ath9k 0000:05:00.0: setting latency timer to 64
phy0: Selected rate control algorithm 'ath9k_rate_control'
Registered led device: ath9k-phy0::radio
Registered led device: ath9k-phy0::assoc
Registered led device: ath9k-phy0::tx
Registered led device: ath9k-phy0::rx
When upgrading to 2.6.31.x, i receive the following output:
[bernhard@wallaby ~]$ dmesg |grep ath
ath9k 0000:05:00.0: enabling device (0000 -> 0002)
ath9k 0000:05:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
ath9k 0000:05:00.0: setting latency timer to 64
ath9k 0000:05:00.0: PCI INT A disabled
As I see it, the device is recognized and instantly disabled again. The device cannot be brought up too using ifconfig.
I am quite clueless what do do aside from reporting the bug here as suggested in the original Arch-bugreport (http://bugs.archlinux.org/task/16413)
If any further information is helpful, I will of course happily try to provide it.
Bernhard
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
^ permalink raw reply
* Re: [WIP, RFC] libertas: allow scanning via "iw"
From: Holger Schurig @ 2009-10-07 9:38 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-wireless
In-Reply-To: <1254869377.8034.8.camel@localhost.localdomain>
> > * signal isn't reported in dBm or mBm. The scan response from
> > the firmware tells me some "RSSI" value.
>
> #define MRVDRV_NF_DEFAULT_SCAN_VALUE (-96)
> #define SCAN_RSSI(RSSI) (0x100 - ((u8)
(RSSI)))
>
> iwe.u.qual.level = SCAN_RSSI(bss->rssi);
>
> rssi = iwe.u.qual.level - MRVDRV_NF_DEFAULT_SCAN_VALUE;
>
> so it's more or less dBm.
I'm not that sure about that. I made a test and moved with my
laptop away from an access-point. In the table below you find
the signal from ipw2200/iwconfig. And in the second column the
raw "u8 rssi" from libertas' scan response:
ipw2200 libertas
signal rssi
-28 38
-36 42
-42 44
-32 46
-38 47
-41 42
-49 47
-49 48
-49 49
-49 48
-47 59
-49 65
-52 54
-55 57
-43 73
So, it's everything but an RSSI, because an RSSI would be high in
the vincinity of the AP and decrease when farther away. The name
is bogus, don't put too much value in it :-)
SCAN_RSSI(rssi) = 0x100 - rssi = 218. That doesn't look like a
dBm either.
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [WIP, RFC] libertas: allow scanning via "iw"
From: Gábor Stefanik @ 2009-10-07 9:37 UTC (permalink / raw)
To: Holger Schurig; +Cc: Dan Williams, linux-wireless
In-Reply-To: <200910071134.49515.hs4233@mail.mn-solutions.de>
On Wed, Oct 7, 2009 at 11:34 AM, Holger Schurig
<hs4233@mail.mn-solutions.de> wrote:
>> > * signal isn't reported in dBm or mBm. The scan response from
>> > the firmware tells me some "RSSI" value.
>>
>> #define MRVDRV_NF_DEFAULT_SCAN_VALUE (-96)
>> #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI)))
>>
>> iwe.u.qual.level = SCAN_RSSI(bss->rssi);
>>
>> rssi = iwe.u.qual.level - MRVDRV_NF_DEFAULT_SCAN_VALUE;
>>
>> so it's more or less dBm.
>
> I'm not that sure about that. I made a test and moved with my
> laptop away from an access-point. In the table below you find
> the signal from ipw2200/iwconfig. And in the second column the
> raw "u8 rssi" from libertas' scan response:
What table? Your message ends here...
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
^ permalink raw reply
* Re: [WIP, RFC] libertas: allow scanning via "iw"
From: Holger Schurig @ 2009-10-07 9:34 UTC (permalink / raw)
To: Dan Williams; +Cc: linux-wireless
In-Reply-To: <1254869377.8034.8.camel@localhost.localdomain>
> > * signal isn't reported in dBm or mBm. The scan response from
> > the firmware tells me some "RSSI" value.
>
> #define MRVDRV_NF_DEFAULT_SCAN_VALUE (-96)
> #define SCAN_RSSI(RSSI) (0x100 - ((u8)(RSSI)))
>
> iwe.u.qual.level = SCAN_RSSI(bss->rssi);
>
> rssi = iwe.u.qual.level - MRVDRV_NF_DEFAULT_SCAN_VALUE;
>
> so it's more or less dBm.
I'm not that sure about that. I made a test and moved with my
laptop away from an access-point. In the table below you find
the signal from ipw2200/iwconfig. And in the second column the
raw "u8 rssi" from libertas' scan response:
^ permalink raw reply
* Question regarding netif_stop/wake queue and libertas
From: Holger Schurig @ 2009-10-07 7:50 UTC (permalink / raw)
To: linux-wireless
Hi !
In the libertas driver, we did the following before scanning:
netif_stop_queue(priv->dev);
netif_carrier_off(priv->dev);
if (priv->mesh_dev) {
netif_stop_queue(priv->mesh_dev);
netif_carrier_off(priv->mesh_dev);
}
and then, after scanning, we started the queues and carrier
again *IF* connected:
if (priv->connect_status == LBS_CONNECTED) {
netif_carrier_on(priv->dev);
if (!priv->tx_pending_len)
netif_wake_queue(priv->dev);
}
if (priv->mesh_dev && (priv->mesh_connect_status == LBS_CONNECTED)) {
netif_carrier_on(priv->mesh_dev);
if (!priv->tx_pending_len)
netif_wake_queue(priv->mesh_dev);
}
How should I do this in my CFG80211-based scanning? As I want
to move away from libertas' own association logic in assoc.c,
there will in future be no priv->connect_status.
I now plan to remember the running/carrier state of both the
"normal" and the "mesh" device:
int running;
int carrier;
int mesh_running = false;
int mesh_carrier = false;
running = !netif_queue_stopped(priv->dev);
carrier = netif_carrier_ok(priv->dev);
if (running)
netif_stop_queue(priv->dev);
if (carrier)
netif_carrier_off(priv->dev);
if (priv->mesh_dev) {
mesh_running = !netif_queue_stopped(priv->mesh_dev);
mesh_carrier = netif_carrier_ok(priv->mesh_dev);
if (mesh_running)
netif_stop_queue(priv->mesh_dev);
if (mesh_carrier)
netif_carrier_off(priv->mesh_dev);
}
And after scanning my four channels, I plan to turn them
on again (e.g. this can be 440 ms later when doing a passive
scan):
if (carrier)
netif_carrier_on(priv->dev);
if (running && !priv->tx_pending_len)
netif_wake_queue(priv->dev);
if (mesh_carrier)
netif_carrier_on(priv->mesh_dev);
if (mesh_running %% !priv->tx_pending_len)
netif_wake_queue(priv->mesh_dev)
Would I need some kind of locking ?
--
M&N Solutions GmbH Ein Unternehmen der Datagroup AG
Holger Schurig
Raiffeisenstr. 10
61191 Rosbach
Tel: 06003/9141-15 Fax 06003/9141-49
http://www.mn-solutions.de/
Handelsregister Friedberg, HRB 5903
Geschäftsführer: P.Schrittenlocher
^ permalink raw reply
* [PATCH] libertas: remove extraneous select FW_LOADER
From: Holger Schurig @ 2009-10-07 7:10 UTC (permalink / raw)
To: John W Linville; +Cc: Dan Williams, linux-wireless
As kindly pointed out by Andrey Yurovsky, CONFIG_LIBERTAS already
selects FW_LOADER.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Index: linux-wl/drivers/net/wireless/libertas/Kconfig
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/Kconfig
2009-10-07 08:00:25.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/Kconfig 2009-10-07
08:00:30.000000000 +0200
@@ -17,7 +17,6 @@ config LIBERTAS_USB
config LIBERTAS_CS
tristate "Marvell Libertas 8385 CompactFlash 802.11b/g cards"
depends on LIBERTAS && PCMCIA
- select FW_LOADER
---help---
A driver for Marvell Libertas 8385 CompactFlash devices.
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Luis R. Rodriguez @ 2009-10-07 6:30 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: Hin-Tak Leung, linux-wireless, Rafael J. Wysocki
In-Reply-To: <43e72e890910062241k3c4660eaobbcee4456485be93@mail.gmail.com>
On Wed, Oct 07, 2009 at 01:41:08AM -0400, Luis R. Rodriguez wrote:
> On Tue, Oct 6, 2009 at 11:45 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:
>
> > warning: type defaults to ‘int’ in declaration of ‘SIMPLE_DEV_PM_OPS’
>
> Yeah we need to backport this stuff, it seems all drivers are intended
> to be moved to use these simple dev pm ops so we might as well.
OK I just committed this patch as a quick attempt to backport this. Testers
welcomed. You'll need the ethtool patch from Hin-Tak as John hasn't yet applied
his own on wireless-testing.
From: Luis R. Rodriguez <lrodriguez@atheros.com>
Subject: [PATCH] compat-2.6: backport dev_pm_ops stuff and SIMPLE_DEV_PM_OPS
The 2.6.29 kernel has new struct dev_pm_ops [1] which are used
on the pci device to distinguish power management hooks for suspend
to RAM and hibernation. Older kernels don't have these so we need
to resort back to the good ol' suspend/resume. Fortunately the calls
are not so different so it should be possible to resuse the same
calls on compat code with only slight modifications.
The SIMPLE_DEV_PM_OPS macro is used as a helper to make the regular
suspend/resume calls be linked to the equivalent hibernation calls
as that is the same behaviour in older kernels. We backport
SIMPLE_DEV_PM_OPS only for kernels 2.6.29..2.6.31 and for older
kernels this is a no-op.
[1] http://lxr.linux.no/#linux+v2.6.29/include/linux/pm.h#L170
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
compat/compat-2.6.32.h | 26 ++++++++++++++++
compat/patches/11-dev-pm-ops.patch | 57 ++++++++++++++++++++++++++++++++++++
2 files changed, 83 insertions(+), 0 deletions(-)
create mode 100644 compat/patches/11-dev-pm-ops.patch
diff --git a/compat/compat-2.6.32.h b/compat/compat-2.6.32.h
index 418b521..9c2dba9 100644
--- a/compat/compat-2.6.32.h
+++ b/compat/compat-2.6.32.h
@@ -8,6 +8,7 @@
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32))
#include <linux/netdevice.h>
+#include <linux/pm.h>
#define SDIO_VENDOR_ID_INTEL 0x0089
#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402
@@ -43,6 +44,31 @@ enum netdev_tx {
typedef enum netdev_tx netdev_tx_t;
#endif /* __KERNEL__ */
+
+/*
+ * dev_pm_ops is only available on kernels >= 2.6.29, for
+ * older kernels we rely on reverting the work to old
+ * power management style stuff.
+ */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+/*
+ * Use this if you want to use the same suspend and resume callbacks for suspend
+ * to RAM and hibernation.
+ */
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
+struct dev_pm_ops name = { \
+ .suspend = suspend_fn, \
+ .resume = resume_fn, \
+ .freeze = suspend_fn, \
+ .thaw = resume_fn, \
+ .poweroff = suspend_fn, \
+ .restore = resume_fn, \
+}
+#else
+#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn)
+#endif /* >= 2.6.29 */
+
+
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)) */
#endif /* LINUX_26_32_COMPAT_H */
diff --git a/compat/patches/11-dev-pm-ops.patch b/compat/patches/11-dev-pm-ops.patch
new file mode 100644
index 0000000..e01eafc
--- /dev/null
+++ b/compat/patches/11-dev-pm-ops.patch
@@ -0,0 +1,57 @@
+The 2.6.29 kernel has new struct dev_pm_ops [1] which are used
+on the pci device to distinguish power management hooks for suspend
+to RAM and hibernation. Older kernels don't have these so we need
+to resort back to the good ol' suspend/resume. Fortunately the calls
+are not so different so it should be possible to resuse the same
+calls on compat code with only slight modifications.
+
+[1] http://lxr.linux.no/#linux+v2.6.29/include/linux/pm.h#L170
+
+--- a/drivers/net/wireless/ath/ath5k/base.c 2009-10-07 01:58:19.000000000 -0400
++++ b/drivers/net/wireless/ath/ath5k/base.c 2009-10-07 02:19:58.000000000 -0400
+@@ -197,6 +197,32 @@
+ #ifdef CONFIG_PM
+ static int ath5k_pci_suspend(struct device *dev);
+ static int ath5k_pci_resume(struct device *dev);
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29))
++#endif
++static int ath5k_pci_suspend_compat(struct pci_dev *pdev, pm_message_t state)
++{
++ int r;
++
++ r = ath5k_pci_suspend(pdev->dev);
++ if (r)
++ return r;
++
++ pci_save_state(pdev);
++ pci_disable_device(pdev);
++ pci_set_power_state(pdev, PCI_D3hot);
++}
++
++static int ath5k_pci_resume_compat(struct pci_dev *pdev)
++{
++ int r;
++
++ pci_restore_state(pdev);
++ r = pci_enable_device(pdev);
++ if (r)
++ return r;
++
++ return ath5k_pci_resume(pdev->dev);
++}
+
+ SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume);
+ #define ATH5K_PM_OPS (&ath5k_pm_ops)
+@@ -209,7 +235,12 @@
+ .id_table = ath5k_pci_id_table,
+ .probe = ath5k_pci_probe,
+ .remove = __devexit_p(ath5k_pci_remove),
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
+ .driver.pm = ATH5K_PM_OPS,
++#else
++ .suspend = ath5k_pci_suspend_compat,
++ .resume = ath5k_pci_resume_compat,
++#endif
+ };
+
+
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Luis R. Rodriguez @ 2009-10-07 5:41 UTC (permalink / raw)
To: Hin-Tak Leung; +Cc: linux-wireless
In-Reply-To: <3ace41890910062045s626777dew4b47fe18bc8d9aee@mail.gmail.com>
On Tue, Oct 6, 2009 at 11:45 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:
> warning: type defaults to ‘int’ in declaration of ‘SIMPLE_DEV_PM_OPS’
Yeah we need to backport this stuff, it seems all drivers are intended
to be moved to use these simple dev pm ops so we might as well.
Luis
^ permalink raw reply
* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Luis R. Rodriguez @ 2009-10-07 5:40 UTC (permalink / raw)
To: Hin-Tak Leung; +Cc: linux-wireless, Hin-Tak Leung
In-Reply-To: <1254886762-17211-1-git-send-email-HinTak.Leung@gmail.com>
On Tue, Oct 6, 2009 at 11:39 PM, Hin-Tak Leung <hintak.leung@gmail.com> wrote:
> Between 2.6.30 and 2.6.31, linux/netdevice.h started
> to include linux/ethtool.h (commit b1b67dd45a6b629eb41553856805aaa1614fbb83,
> "net: factor out ethtool invocation of vlan/macvlan drivers"),
> and commit 7508e486965b0af13984bc6d9da62a8d8f0dc5f9,
> "cfg80211: add firmware and hardware version to wiphy", introduces
> dependency of ETHTOOL_BUSINFO_LEN from linux/ethtool.h
> to net/cfg80211.h .
John's patch titled "cfg80211: fix compile error from missing
ethtool.h" seems to address this upstream. I'll wait until he applies
that to the tree.
Luis
^ permalink raw reply
* Re: [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Hin-Tak Leung @ 2009-10-07 3:45 UTC (permalink / raw)
To: linux-wireless, lrodriguez
In-Reply-To: <1254886762-17211-1-git-send-email-HinTak.Leung@gmail.com>
After 'compat-2.6: adjusting 01-netdev.patch for libertas cfg80211
support' (which fixes the patches), and 'compat-2.6: adding ethtool.h
to compat-2.6.31.h' (which fixes the cfg80211.h header), the next
error is ath5k_pm_ops type missing:
----------------
CC [M] /home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.o
/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.c:201:
warning: data definition has no type or storage class
/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.c:201:
warning: type defaults to ‘int’ in declaration of ‘SIMPLE_DEV_PM_OPS’
/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.c:201:
warning: parameter names (without types) in function declaration
/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.c:212:
error: ‘ath5k_pm_ops’ undeclared here (not in a function)
make[5]: *** [/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k/base.o]
Error 1
make[4]: *** [/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath/ath5k]
Error 2
make[3]: *** [/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless/ath]
Error 2
make[2]: *** [/home/Hin-Tak/tmp-git/compat-wireless-2.6/drivers/net/wireless]
Error 2
make[1]: *** [_module_/home/Hin-Tak/tmp-git/compat-wireless-2.6] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.30.8-67.fc11.x86_64'
make: *** [modules] Error 2
---------------
Since this is slightly outside my interest (I am mostly just tracking
rtl818x and to a lesser extent zd1211rw), I'll let others carry on
fixing compat-wireless against current wireless-testing... apologies.
^ permalink raw reply
* [PATCH] compat-2.6: adding ethtool.h to compat-2.6.31.h
From: Hin-Tak Leung @ 2009-10-07 3:39 UTC (permalink / raw)
To: linux-wireless, lrodriguez; +Cc: Hin-Tak Leung, Hin-Tak Leung
Between 2.6.30 and 2.6.31, linux/netdevice.h started
to include linux/ethtool.h (commit b1b67dd45a6b629eb41553856805aaa1614fbb83,
"net: factor out ethtool invocation of vlan/macvlan drivers"),
and commit 7508e486965b0af13984bc6d9da62a8d8f0dc5f9,
"cfg80211: add firmware and hardware version to wiphy", introduces
dependency of ETHTOOL_BUSINFO_LEN from linux/ethtool.h
to net/cfg80211.h .
Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
---
compat/compat-2.6.31.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/compat/compat-2.6.31.h b/compat/compat-2.6.31.h
index 154209c..e46334a 100644
--- a/compat/compat-2.6.31.h
+++ b/compat/compat-2.6.31.h
@@ -12,6 +12,7 @@
#include <linux/interrupt.h>
#include <net/dst.h>
#include <net/genetlink.h>
+#include <linux/ethtool.h>
/*
* These macros allow us to backport rfkill without any
--
1.6.5.rc2
^ permalink raw reply related
* [PATCH] compat-2.6: adjusting 01-netdev.patch for libertas cfg80211 support
From: Hin-Tak Leung @ 2009-10-07 2:50 UTC (permalink / raw)
To: linux-wireless, lrodriguez; +Cc: Hin-Tak Leung, Hin-Tak Leung
Adjusting the netdev patch slightly to cope with recent change
in libertas regarding cfg80211 support:
commit 6c65edc7a3e9452509a898cc9bbc210b0121617f
Author: Holger Schurig <hs4233@mail.mn-solutions.de>
Date: Tue Oct 6 16:31:54 2009 +0200
libertas: first stab at cfg80211 support
Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
---
compat/patches/01-netdev.patch | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/compat/patches/01-netdev.patch b/compat/patches/01-netdev.patch
index 141f80b..f6bca3e 100644
--- a/compat/patches/01-netdev.patch
+++ b/compat/patches/01-netdev.patch
@@ -416,9 +416,9 @@ without creating a headache on maintenance of the pathes.
/**
* @brief This function adds the card. it will probe the
@@ -1270,7 +1272,16 @@
- priv->infra_open = 0;
+ wdev->netdev = dev;
+ priv->dev = dev;
- /* Setup the OS Interface to our functions */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
dev->netdev_ops = &lbs_netdev_ops;
+#else
--
1.6.5.rc2
^ permalink raw reply related
* Re: [ath5k-devel] Regarding changing channel widthlin
From: Aditya Bhave @ 2009-10-07 2:08 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: Nick Kossifidis, ath5k-devel, linux-wireless
In-Reply-To: <43e72e890910061721o5f78f82cvfaa216a4d887e4f8@mail.gmail.com>
Is there any detailed documentation on the internals of ath5k code?
1. Description of the data structures
2. Flow-diagram of function calls
3. What register is used for what aspect of WiFi etc etc
Thanks
--Aditya
Luis R. Rodriguez wrote:
> On Tue, Oct 6, 2009 at 5:17 PM, Nick Kossifidis <mickflemm@gmail.com> wrote:
>
>> Until we have a
>> clean way to set this through cfg80211/nl80211 (which is an ongoing
>> discussion) we wont support 5/10Mhz operation but you can try and let
>> us know.
>>
>
> I believe the cfg80211/nl80211 changes is probably the bulk of the
> work that does need to get done. Someone motivated just needs to do
> it.
>
> Luis
>
>
^ permalink raw reply
* Re: Linux wifi development board
From: Ahmed A @ 2009-10-07 2:06 UTC (permalink / raw)
To: David Acker; +Cc: linux-wireless
In-Reply-To: <4ACB42CB.7010403@roinet.com>
--- On Tue, 10/6/09, David Acker <dacker@roinet.com> wrote:
> From: David Acker <dacker@roinet.com>
> Subject: Re: Linux wifi development board
> To: "Ahmed A" <ahmedcali@yahoo.com>
> Cc: linux-wireless@vger.kernel.org
> Date: Tuesday, October 6, 2009, 6:14 AM
> Ahmed A wrote:
> > Hello,
> >
> > I have been looking online for a Linux wifi
> development board. I have come across a few from small
> companies (reasonably priced), but most of those companies
> seem to be out of business. I would appreciate
> suggestions from anyone that may have used one recently, or
> suggest a link where I can more info some popular ones.
> >
> > I am mostly interested in doing some software
> development, prototyping on the "application processor", not
> on the "baseband processor" (radio part).
> >
> > If there is an alternate mailing list I can post my
> question, I would appreciate that also.
>
> I have had good luck with boards from Gateworks, http://www.gateworks.com/ and radios from Ubiquiti, http://ubnt.com/
> . All of it is supported by OpenWRT, although I believe that
> the gw2348-4 (avila) has mainline support.
> -ack
>
Hi David,
Thank you for your response. I would like to explain what I am trying to setup, and would appreciate your feedback please. My setup would comprise of two parts. One part would be the wifi router (base station), on which I load linux image bundled with my special app onto it. The other part would be the wifi client (CPE), that would connect to the router. I would also like to be able to load my own kernel image bundled with my special app.
I am guessing from your email, I would have to get a board from gateworks, hook up an antenna to it from ubnt, load image from OpenWRT, that would be my wifi router. Is that right? Which product would you recommend, the Avilla platform? Which antenna from ubnt? Would there be issues getting these to work? How about the components on the client side, same deal?
I have done some work/programming on the IXP, but I do prefer a board with non-IXP CPU, like PowerPC or XScale.
Is there any solution out there, where the dev board and antenna come bundled, so I don't have to muck around getting them to work?
Any decent alternate board supplier, the prices of boards from gateworks are a bit pricey for me.
Thank you,
Ahmed A.
^ permalink raw reply
* [PATCH v2] libertas: Use lbs_is_cmd_allowed() check in command handling routines.
From: Bing Zhao @ 2009-10-07 2:20 UTC (permalink / raw)
To: libertas-dev; +Cc: linux-wireless, Bing Zhao, Amitkumar Karwar
From: Amitkumar Karwar <akarwar@marvell.com>
lbs_is_cmd_allowed() check is added in __lbs_cmd_async() and
lbs_prepare_and_send_command(). The check is removed from other places.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/libertas/cmd.c | 34 ++++++++
drivers/net/wireless/libertas/debugfs.c | 46 -----------
drivers/net/wireless/libertas/decl.h | 1 -
drivers/net/wireless/libertas/scan.c | 11 ---
drivers/net/wireless/libertas/wext.c | 133 -------------------------------
5 files changed, 34 insertions(+), 191 deletions(-)
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 3a3e894..0fb3125 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -75,6 +75,30 @@ static u8 is_command_allowed_in_ps(u16 cmd)
}
/**
+ * @brief This function checks if the command is allowed.
+ *
+ * @param priv A pointer to lbs_private structure
+ * @return allowed or not allowed.
+ */
+
+static int lbs_is_cmd_allowed(struct lbs_private *priv)
+{
+ int ret = 1;
+
+ lbs_deb_enter(LBS_DEB_CMD);
+
+ if (!priv->is_auto_deep_sleep_enabled) {
+ if (priv->is_deep_sleep) {
+ lbs_deb_cmd("command not allowed in deep sleep\n");
+ ret = 0;
+ }
+ }
+
+ lbs_deb_leave(LBS_DEB_CMD);
+ return ret;
+}
+
+/**
* @brief Updates the hardware details like MAC address and regulatory region
*
* @param priv A pointer to struct lbs_private structure
@@ -1452,6 +1476,11 @@ int lbs_prepare_and_send_command(struct lbs_private *priv,
goto done;
}
+ if (!lbs_is_cmd_allowed(priv)) {
+ ret = -EBUSY;
+ goto done;
+ }
+
cmdnode = lbs_get_cmd_ctrl_node(priv);
if (cmdnode == NULL) {
@@ -2104,6 +2133,11 @@ static struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv,
goto done;
}
+ if (!lbs_is_cmd_allowed(priv)) {
+ cmdnode = ERR_PTR(-EBUSY);
+ goto done;
+ }
+
cmdnode = lbs_get_cmd_ctrl_node(priv);
if (cmdnode == NULL) {
lbs_deb_host("PREP_CMD: cmdnode is NULL\n");
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 8a7e931..893a55c 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -117,11 +117,6 @@ static ssize_t lbs_sleepparams_write(struct file *file,
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out_unlock;
- }
-
buf_size = min(count, len - 1);
if (copy_from_user(buf, user_buf, buf_size)) {
ret = -EFAULT;
@@ -162,11 +157,6 @@ static ssize_t lbs_sleepparams_read(struct file *file, char __user *userbuf,
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out_unlock;
- }
-
ret = lbs_cmd_802_11_sleep_params(priv, CMD_ACT_GET, &sp);
if (ret)
goto out_unlock;
@@ -233,9 +223,6 @@ static ssize_t lbs_threshold_read(uint16_t tlv_type, uint16_t event_mask,
u8 freq;
int events = 0;
- if (!lbs_is_cmd_allowed(priv))
- return -EBUSY;
-
buf = (char *)get_zeroed_page(GFP_KERNEL);
if (!buf)
return -ENOMEM;
@@ -288,9 +275,6 @@ static ssize_t lbs_threshold_write(uint16_t tlv_type, uint16_t event_mask,
char *buf;
int ret;
- if (!lbs_is_cmd_allowed(priv))
- return -EBUSY;
-
buf = (char *)get_zeroed_page(GFP_KERNEL);
if (!buf)
return -ENOMEM;
@@ -460,11 +444,6 @@ static ssize_t lbs_rdmac_read(struct file *file, char __user *userbuf,
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- free_page(addr);
- return -EBUSY;
- }
-
offval.offset = priv->mac_offset;
offval.value = 0;
@@ -517,11 +496,6 @@ static ssize_t lbs_wrmac_write(struct file *file,
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- res = -EBUSY;
- goto out_unlock;
- }
-
buf_size = min(count, len - 1);
if (copy_from_user(buf, userbuf, buf_size)) {
res = -EFAULT;
@@ -558,11 +532,6 @@ static ssize_t lbs_rdbbp_read(struct file *file, char __user *userbuf,
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- free_page(addr);
- return -EBUSY;
- }
-
offval.offset = priv->bbp_offset;
offval.value = 0;
@@ -616,11 +585,6 @@ static ssize_t lbs_wrbbp_write(struct file *file,
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- res = -EBUSY;
- goto out_unlock;
- }
-
buf_size = min(count, len - 1);
if (copy_from_user(buf, userbuf, buf_size)) {
res = -EFAULT;
@@ -657,11 +621,6 @@ static ssize_t lbs_rdrf_read(struct file *file, char __user *userbuf,
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- free_page(addr);
- return -EBUSY;
- }
-
offval.offset = priv->rf_offset;
offval.value = 0;
@@ -715,11 +674,6 @@ static ssize_t lbs_wrrf_write(struct file *file,
if (!buf)
return -ENOMEM;
- if (!lbs_is_cmd_allowed(priv)) {
- res = -EBUSY;
- goto out_unlock;
- }
-
buf_size = min(count, len - 1);
if (copy_from_user(buf, userbuf, buf_size)) {
res = -EFAULT;
diff --git a/drivers/net/wireless/libertas/decl.h b/drivers/net/wireless/libertas/decl.h
index 44f0b24..fb91c36 100644
--- a/drivers/net/wireless/libertas/decl.h
+++ b/drivers/net/wireless/libertas/decl.h
@@ -34,7 +34,6 @@ int lbs_process_event(struct lbs_private *priv, u32 event);
void lbs_queue_event(struct lbs_private *priv, u32 event);
void lbs_notify_command_response(struct lbs_private *priv, u8 resp_idx);
int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep);
-int lbs_is_cmd_allowed(struct lbs_private *priv);
int lbs_enter_auto_deep_sleep(struct lbs_private *priv);
int lbs_exit_auto_deep_sleep(struct lbs_private *priv);
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index e468e15..6c95af3 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -950,11 +950,6 @@ int lbs_set_scan(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
if (!priv->radio_on) {
ret = -EINVAL;
goto out;
@@ -1022,12 +1017,6 @@ int lbs_get_scan(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- err = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", err);
- return err;
- }
-
/* iwlist should wait until the current scan is finished */
if (priv->scan_channel)
return -EAGAIN;
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 38a451e..69dd19b 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -46,32 +46,6 @@ static inline void lbs_cancel_association_work(struct lbs_private *priv)
}
/**
- * @brief This function checks if the command is allowed.
- *
- * @param priv A pointer to lbs_private structure
- * @return allowed or not allowed.
- */
-
-int lbs_is_cmd_allowed(struct lbs_private *priv)
-{
- int ret = 1;
-
- lbs_deb_enter(LBS_DEB_WEXT);
-
- if (!priv->is_auto_deep_sleep_enabled) {
- if (priv->is_deep_sleep) {
- lbs_deb_wext("IOCTLS called when station"
- "is in deep sleep\n");
- ret = 0;
- }
- }
-
- lbs_deb_leave(LBS_DEB_WEXT);
- return ret;
-}
-
-
-/**
* @brief Find the channel frequency power info with specific channel
*
* @param priv A pointer to struct lbs_private structure
@@ -193,11 +167,6 @@ static int lbs_get_freq(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- lbs_deb_leave(LBS_DEB_WEXT);
- return -EBUSY;
- }
-
cfp = lbs_find_cfp_by_band_and_channel(priv, 0,
priv->curbssparams.channel);
@@ -308,12 +277,6 @@ static int lbs_set_rts(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
if (vwrq->disabled)
val = MRVDRV_RTS_MAX_VALUE;
@@ -335,11 +298,6 @@ static int lbs_get_rts(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, &val);
if (ret)
goto out;
@@ -362,12 +320,6 @@ static int lbs_set_frag(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
if (vwrq->disabled)
val = MRVDRV_FRAG_MAX_VALUE;
@@ -389,11 +341,6 @@ static int lbs_get_frag(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
ret = lbs_get_snmp_mib(priv, SNMP_MIB_OID_FRAG_THRESHOLD, &val);
if (ret)
goto out;
@@ -443,11 +390,6 @@ static int lbs_get_txpow(struct net_device *dev,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
if (!priv->radio_on) {
lbs_deb_wext("tx power off\n");
vwrq->value = 0;
@@ -481,11 +423,6 @@ static int lbs_set_retry(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
if ((vwrq->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
return -EOPNOTSUPP;
@@ -534,11 +471,6 @@ static int lbs_get_retry(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
vwrq->disabled = 0;
if (vwrq->flags & IW_RETRY_LONG) {
@@ -907,9 +839,6 @@ static struct iw_statistics *lbs_get_wireless_stats(struct net_device *dev)
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv))
- return NULL;
-
priv->wstats.status = priv->mode;
/* If we're not associated, all quality values are meaningless */
@@ -1010,12 +939,6 @@ static int lbs_set_freq(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
mutex_lock(&priv->lock);
assoc_req = lbs_get_association_request(priv);
if (!assoc_req) {
@@ -1125,11 +1048,6 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
lbs_deb_wext("vwrq->value %d\n", vwrq->value);
lbs_deb_wext("vwrq->fixed %d\n", vwrq->fixed);
@@ -1188,11 +1106,6 @@ static int lbs_get_rate(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- lbs_deb_leave(LBS_DEB_WEXT);
- return -EBUSY;
- }
-
if (priv->connect_status == LBS_CONNECTED) {
vwrq->value = priv->cur_rate * 500000;
@@ -1219,11 +1132,6 @@ static int lbs_set_mode(struct net_device *dev,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
if ( (*uwrq != IW_MODE_ADHOC)
&& (*uwrq != IW_MODE_INFRA)
&& (*uwrq != IW_MODE_AUTO)) {
@@ -1465,12 +1373,6 @@ static int lbs_set_encode(struct net_device *dev,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
mutex_lock(&priv->lock);
assoc_req = lbs_get_association_request(priv);
if (!assoc_req) {
@@ -1654,12 +1556,6 @@ static int lbs_set_encodeext(struct net_device *dev,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
mutex_lock(&priv->lock);
assoc_req = lbs_get_association_request(priv);
if (!assoc_req) {
@@ -1872,12 +1768,6 @@ static int lbs_set_auth(struct net_device *dev,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
mutex_lock(&priv->lock);
assoc_req = lbs_get_association_request(priv);
if (!assoc_req) {
@@ -1980,12 +1870,6 @@ static int lbs_get_auth(struct net_device *dev,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
switch (dwrq->flags & IW_AUTH_INDEX) {
case IW_AUTH_KEY_MGMT:
dwrq->value = priv->secinfo.key_mgmt;
@@ -2028,11 +1912,6 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- goto out;
- }
-
if (vwrq->disabled) {
lbs_set_radio(priv, RADIO_PREAMBLE_AUTO, 0);
goto out;
@@ -2152,12 +2031,6 @@ static int lbs_set_essid(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
if (!priv->radio_on) {
ret = -EINVAL;
goto out;
@@ -2285,12 +2158,6 @@ static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info,
lbs_deb_enter(LBS_DEB_WEXT);
- if (!lbs_is_cmd_allowed(priv)) {
- ret = -EBUSY;
- lbs_deb_leave_args(LBS_DEB_WEXT, "ret %d", ret);
- return ret;
- }
-
if (!priv->radio_on)
return -EINVAL;
--
1.5.4.3
^ permalink raw reply related
* [PATCH 3/6] ath9k: add helper to un-init the hw properly
From: Luis R. Rodriguez @ 2009-10-07 1:19 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, vasanth, Luis R. Rodriguez
In-Reply-To: <1254878351-32433-1-git-send-email-lrodriguez@atheros.com>
This is used in several places, ensure we do it right in all
callers by using a helper.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/main.c | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 0fe915a..e6842dd 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1325,6 +1325,17 @@ void ath_cleanup(struct ath_softc *sc)
ieee80211_free_hw(sc->hw);
}
+static void ath9k_uninit_hw(struct ath_softc *sc)
+{
+ struct ath_hw *ah = sc->sc_ah;
+
+ BUG_ON(!ah);
+
+ ath9k_exit_debug(ah);
+ ath9k_hw_detach(ah);
+ sc->sc_ah = NULL;
+}
+
void ath_detach(struct ath_softc *sc)
{
struct ieee80211_hw *hw = sc->hw;
@@ -1365,9 +1376,7 @@ void ath_detach(struct ath_softc *sc)
ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
ath_gen_timer_free(ah, sc->btcoex.no_stomp_timer);
- ath9k_exit_debug(ah);
- ath9k_hw_detach(ah);
- sc->sc_ah = NULL;
+ ath9k_uninit_hw(sc);
}
static int ath9k_reg_notifier(struct wiphy *wiphy,
@@ -1850,10 +1859,8 @@ bad2:
if (ATH_TXQ_SETUP(sc, i))
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
- ath9k_exit_debug(ah);
bad_free_hw:
- ath9k_hw_detach(ah);
- sc->sc_ah = NULL;
+ ath9k_uninit_hw(sc);
return r;
}
@@ -1966,9 +1973,7 @@ error_attach:
if (ATH_TXQ_SETUP(sc, i))
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
- ath9k_exit_debug(ah);
- ath9k_hw_detach(ah);
- sc->sc_ah = NULL;
+ ath9k_uninit_hw(sc);
return error;
}
--
1.6.0.4
^ permalink raw reply related
* [PATCH 1/6] ath9k: move common->debug_mask setting to ath_init_softc()
From: Luis R. Rodriguez @ 2009-10-07 1:19 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, vasanth, Luis R. Rodriguez
In-Reply-To: <1254878351-32433-1-git-send-email-lrodriguez@atheros.com>
What this means is we can enable now debug prints without
requiring CONFIG_ATH9K_DEBUG.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/debug.c | 5 -----
drivers/net/wireless/ath/ath9k/main.c | 5 +++++
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 25ae88e..84f4426 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -23,9 +23,6 @@
#define REG_READ_D(_ah, _reg) \
ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
-static unsigned int ath9k_debug = ATH_DBG_DEFAULT;
-module_param_named(debug, ath9k_debug, uint, 0);
-
static struct dentry *ath9k_debugfs_root;
static int ath9k_debugfs_open(struct inode *inode, struct file *file)
@@ -565,8 +562,6 @@ int ath9k_init_debug(struct ath_hw *ah)
struct ath_common *common = ath9k_hw_common(ah);
struct ath_softc *sc = (struct ath_softc *) common->priv;
- common->debug_mask = ath9k_debug;
-
if (!ath9k_debugfs_root)
return -ENOENT;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 86374ad..7f90cb8 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -29,6 +29,10 @@ static int modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
+static unsigned int ath9k_debug = ATH_DBG_DEFAULT;
+module_param_named(debug, ath9k_debug, uint, 0);
+MODULE_PARM_DESC(ath9k_debug, "Debugging mask");
+
/* We use the hw_value as an index into our private channel structure */
#define CHAN2G(_freq, _idx) { \
@@ -1637,6 +1641,7 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
common->ah = ah;
common->hw = sc->hw;
common->priv = sc;
+ common->debug_mask = ath9k_debug;
/*
* Cache line size is used to size and align various
--
1.6.0.4
^ permalink raw reply related
* [PATCH 5/6] ath9k: move ath_cleanup() below helpers to avoid forward declarations
From: Luis R. Rodriguez @ 2009-10-07 1:19 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, vasanth, Luis R. Rodriguez
In-Reply-To: <1254878351-32433-1-git-send-email-lrodriguez@atheros.com>
This should fix the oops which occurs during module unload
due to the dereferencig of ah upon debugfs exit.
IP: [<46412d6b>] 0x46412d6b
*pde = 00000000
Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
last sysfs file: /sys/class/power_supply/BAT0/energy_full
Modules linked in: ath9k(-) ath9k_hw mac80211 ath cfg80211 <bleh>
Pid: 3112, comm: rmmod Not tainted (2.6.32-rc2-wl #101) 9461DUU
EIP: 0060:[<46412d6b>] EFLAGS: 00010246 CPU: 0
EIP is at 0x46412d6b
EAX: f5870004 EBX: f6700d94 ECX: 00000000 EDX: c14313a7
ESI: f5870000 EDI: fb58ce70 EBP: f6661eb4 ESP: f6661ea8
DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process rmmod (pid: 3112, ti=f6660000 task=f6579380 task.ti=f6660000)
Stack:
fb57e5e5 f5ca5d50 fb58ce70 f6661ebc fb58629a f6661ec8 c11b715e f5ca5da8
<0> f6661ed8 c1223d98 f5ca5da8 f5ca5ddc f6661eec c1223e6f fb58ce70 fb58ce70
<0> c14958a0 f6661f00 c1222edb fb58ce70 fb58ce70 fb58cebc f6661f1c c12243c9
Call Trace:
[<fb57e5e5>] ? ath_cleanup+0x35/0x50 [ath9k]
[<fb58629a>] ? ath_pci_remove+0x1a/0x20 [ath9k]
[<c11b715e>] ? pci_device_remove+0x1e/0x40
[<c1223d98>] ? __device_release_driver+0x58/0xa0
[<c1223e6f>] ? driver_detach+0x8f/0xa0
[<c1222edb>] ? bus_remove_driver+0x7b/0xb0
[<c12243c9>] ? driver_unregister+0x49/0x80
[<c1158cf2>] ? sysfs_remove_file+0x12/0x20
[<c11b73b5>] ? pci_unregister_driver+0x35/0x90
[<fb586172>] ? ath_pci_exit+0x12/0x20 [ath9k]
[<fb5883ec>] ? ath9k_exit+0x10/0x3d [ath9k]
[<c131971d>] ? mutex_unlock+0xd/0x10
[<c1088c0f>] ? sys_delete_module+0x16f/0x220
[<c10e3d5d>] ? do_munmap+0x23d/0x290
[<c11a629c>] ? trace_hardirqs_off_thunk+0xc/0x10
[<c11a628c>] ? trace_hardirqs_on_thunk+0xc/0x10
[<c1003b41>] ? sysenter_exit+0xf/0x1a
[<c1003b08>] ? sysenter_do_call+0x12/0x3c
Code: Bad EIP value.
EIP: [<46412d6b>] 0x46412d6b SS:ESP 0068:f6661ea8
CR2: 0000000046412d6b
---[ end trace 847f3b05ff3dcb19 ]---
Reported-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath9k/main.c | 31 ++++++++++++++-----------------
1 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 39b2780..c541516 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1313,23 +1313,6 @@ static void ath_start_rfkill_poll(struct ath_softc *sc)
wiphy_rfkill_start_polling(sc->hw->wiphy);
}
-static void ath_clean_core(struct ath_softc *sc);
-static void ath9k_uninit_hw(struct ath_softc *sc);
-
-void ath_cleanup(struct ath_softc *sc)
-{
- struct ath_hw *ah = sc->sc_ah;
- struct ath_common *common = ath9k_hw_common(ah);
-
- ath_clean_core(sc);
- free_irq(sc->irq, sc);
- ath_bus_cleanup(common);
- kfree(sc->sec_wiphy);
- ieee80211_free_hw(sc->hw);
-
- ath9k_uninit_hw(sc);
-}
-
static void ath9k_uninit_hw(struct ath_softc *sc)
{
struct ath_hw *ah = sc->sc_ah;
@@ -1388,6 +1371,20 @@ void ath_detach(struct ath_softc *sc)
ath9k_uninit_hw(sc);
}
+void ath_cleanup(struct ath_softc *sc)
+{
+ struct ath_hw *ah = sc->sc_ah;
+ struct ath_common *common = ath9k_hw_common(ah);
+
+ ath_clean_core(sc);
+ free_irq(sc->irq, sc);
+ ath_bus_cleanup(common);
+ kfree(sc->sec_wiphy);
+ ieee80211_free_hw(sc->hw);
+
+ ath9k_uninit_hw(sc);
+}
+
static int ath9k_reg_notifier(struct wiphy *wiphy,
struct regulatory_request *request)
{
--
1.6.0.4
^ permalink raw reply related
* [PATCH 2/6] ath9k: initialize hw prior to debugfs
From: Luis R. Rodriguez @ 2009-10-07 1:19 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, vasanth, Luis R. Rodriguez
In-Reply-To: <1254878351-32433-1-git-send-email-lrodriguez@atheros.com>
debugfs uses the hardware for several debugfs files as such the
hardware must be initialized and available prior to its usage. The
same applies to when we free the hw structs -- free debufs file
entries prior to free'ing the hardware.
Reported-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
drivers/net/wireless/ath/ath.h | 6 ++++++
drivers/net/wireless/ath/ath9k/hw.c | 11 ++++++++++-
drivers/net/wireless/ath/ath9k/main.c | 28 ++++++++++++++--------------
3 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
index b6cd752..5e19a73 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
@@ -23,6 +23,11 @@
static const u8 ath_bcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+enum ath_device_state {
+ ATH_HW_UNAVAILABLE,
+ ATH_HW_INITIALIZED,
+};
+
struct reg_dmn_pair_mapping {
u16 regDmnEnum;
u16 reg_5ghz_ctl;
@@ -59,6 +64,7 @@ struct ath_common {
void *priv;
struct ieee80211_hw *hw;
int debug_mask;
+ enum ath_device_state state;
u16 cachelsz;
u16 curaid;
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 692fd1d..cab17c6 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -999,6 +999,8 @@ int ath9k_hw_init(struct ath_hw *ah)
ath9k_init_nfcal_hist_buffer(ah);
+ common->state = ATH_HW_INITIALIZED;
+
return 0;
}
@@ -1239,11 +1241,18 @@ const char *ath9k_hw_probe(u16 vendorid, u16 devid)
void ath9k_hw_detach(struct ath_hw *ah)
{
+ struct ath_common *common = ath9k_hw_common(ah);
+
+ if (common->state <= ATH_HW_INITIALIZED)
+ goto free_hw;
+
if (!AR_SREV_9100(ah))
ath9k_hw_ani_disable(ah);
- ath9k_hw_rf_free(ah);
ath9k_hw_setpower(ah, ATH9K_PM_FULL_SLEEP);
+
+free_hw:
+ ath9k_hw_rf_free(ah);
kfree(ah);
ah = NULL;
}
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 7f90cb8..0fe915a 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1365,8 +1365,8 @@ void ath_detach(struct ath_softc *sc)
ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
ath_gen_timer_free(ah, sc->btcoex.no_stomp_timer);
- ath9k_hw_detach(ah);
ath9k_exit_debug(ah);
+ ath9k_hw_detach(ah);
sc->sc_ah = NULL;
}
@@ -1626,10 +1626,8 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
(unsigned long)sc);
ah = kzalloc(sizeof(struct ath_hw), GFP_KERNEL);
- if (!ah) {
- r = -ENOMEM;
- goto bad_no_ah;
- }
+ if (!ah)
+ return -ENOMEM;
ah->hw_version.devid = devid;
ah->hw_version.subsysid = subsysid;
@@ -1651,15 +1649,18 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid,
/* XXX assert csz is non-zero */
common->cachelsz = csz << 2; /* convert to bytes */
- if (ath9k_init_debug(ah) < 0)
- dev_err(sc->dev, "Unable to create debugfs files\n");
-
r = ath9k_hw_init(ah);
if (r) {
ath_print(common, ATH_DBG_FATAL,
"Unable to initialize hardware; "
"initialization status: %d\n", r);
- goto bad;
+ goto bad_free_hw;
+ }
+
+ if (ath9k_init_debug(ah) < 0) {
+ ath_print(common, ATH_DBG_FATAL,
+ "Unable to create debugfs files\n");
+ goto bad_free_hw;
}
/* Get the hardware key cache size. */
@@ -1848,12 +1849,11 @@ bad2:
for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
if (ATH_TXQ_SETUP(sc, i))
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
-bad:
+
+ ath9k_exit_debug(ah);
+bad_free_hw:
ath9k_hw_detach(ah);
-bad_no_ah:
- ath9k_exit_debug(sc->sc_ah);
sc->sc_ah = NULL;
-
return r;
}
@@ -1966,8 +1966,8 @@ error_attach:
if (ATH_TXQ_SETUP(sc, i))
ath_tx_cleanupq(sc, &sc->tx.txq[i]);
- ath9k_hw_detach(ah);
ath9k_exit_debug(ah);
+ ath9k_hw_detach(ah);
sc->sc_ah = NULL;
return error;
--
1.6.0.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox