* Re: [PATCH] ar9170: implement frequency calibration for one-stage/openfw
From: Christian Lamparter @ 2009-09-28 19:45 UTC (permalink / raw)
To: John W. Linville
Cc: Joerg Albert, Andrew Morton, linux-wireless, David S. Miller
In-Reply-To: <20090928184111.GB4737@tuxdriver.com>
2009/9/28 John W. Linville <linville@tuxdriver.com>:
> On Sat, Sep 19, 2009 at 02:21:36PM +0200, Joerg Albert wrote:
>> On 09/19/2009 02:02 AM, Andrew Morton wrote:
>> > On Thu, 3 Sep 2009 20:25:31 +0200
>> > Christian Lamparter <chunkeey@googlemail.com> wrote:
>> >
>> >> This patch ports some code from the vendor driver, which is
>> >> supposed to upload the right calibration values for the
>> >> chosen frequency.
>> >>
>> >> In theory, this should give a better range and throughput
>> >> for all users with the open, or one-stage firmware.
>> >>
>> >> ...
>> >>
>> >> + for (i = 0; i < 76; i++) {
>> >> + u32 phy_data;
>> >> + u8 tmp;
>> >> +
>> >> + if (i < 25) {
>> >> + tmp = ar9170_interpolate_val(i, &pwrs[0][0],
>> >> + &vpds[0][0]);
>> >> + } else {
>> >> + tmp = ar9170_interpolate_val(i - 12,
>> >> + &pwrs[1][0],
>> >> + &vpds[1][0]);
>> >> + }
>> >> +
>> >> + phy_data |= tmp << ((i & 3) << 3);
>> >
>> > Clearly buggy and the compiler warns. The value of phy_data is unknown
>> > here.
>> >
>> > How did this get all the way into mainline?
>>
>> Strangely it compiles without any warning for me with the latest linux-wireless:
>
> That is strange -- no warning here (F-11) either...
>
> Christian, care to propose a patch? Or maybe just something like this?
>
> diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c
> index b3e5cf3..49c10cb 100644
> --- a/drivers/net/wireless/ath/ar9170/phy.c
> +++ b/drivers/net/wireless/ath/ar9170/phy.c
> @@ -1220,7 +1220,7 @@ static int ar9170_set_freq_cal_data(struct ar9170 *ar,
> &vpds[1][0]);
> }
>
> - phy_data |= tmp << ((i & 3) << 3);
> + phy_data = tmp << ((i & 3) << 3);
> if ((i & 3) == 3) {
> ar9170_regwrite(0x1c6280 + chain * 0x1000 +
> (i & ~3), phy_data);
>
> John
no? Andrew Morton's mail included a tiny patch which initializes the
phy_data to 0. I assumed you would pick it up right away...
Or is there something which would prevent it from including?
Regards,
Chr
^ permalink raw reply
* Re: [ath9k-devel] Makefile ref to non-existent CONFIG_ATHEROS_AR71XX
From: Imre Kaloz @ 2009-09-28 19:33 UTC (permalink / raw)
To: John W. Linville, Florian Fainelli
Cc: ath9k-devel, Robert P. J. Day, linux-wireless
In-Reply-To: <20090928182944.GA4737@tuxdriver.com>
On 2009.09.28. 20:29:45 John W. Linville <linville@tuxdriver.com> wrote:
> On Fri, Sep 18, 2009 at 08:04:51PM +0200, Florian Fainelli wrote:
>> Hi Robert,
>>
>> Le vendredi 18 septembre 2009 16:01:25, Robert P. J. Day a écrit :
>> > searching for Makefile references to Kconfig variables that don't
>> > exist, and i find:
>> >
>> > ===== ATHEROS_AR71XX =====
>> > ./drivers/net/wireless/ath/ath9k/Makefile:ath9k-$(CONFIG_ATHEROS_AR71XX) +=
>> > ahb.o
>>
>> We need it in OpenWrt and plan to send Atheros AR71xx SoC support soon, do not
>> consider this for removal. Thanks
>
> Sure, fine...estimate when it will arrive?
>
> John
When we got access to some more info on the AR7240 so we can finish the support for it.
Imre
^ permalink raw reply
* Re: [ath9k-devel] Makefile ref to non-existent CONFIG_ATHEROS_AR71XX
From: Robert P. J. Day @ 2009-09-28 19:37 UTC (permalink / raw)
To: Imre Kaloz
Cc: John W. Linville, Florian Fainelli, ath9k-devel, linux-wireless
In-Reply-To: <op.u0zfaoao2s3iss@richese>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1466 bytes --]
On Mon, 28 Sep 2009, Imre Kaloz wrote:
> On 2009.09.28. 20:29:45 John W. Linville <linville@tuxdriver.com> wrote:
>
> > On Fri, Sep 18, 2009 at 08:04:51PM +0200, Florian Fainelli wrote:
> > > Hi Robert,
> > >
> > > Le vendredi 18 septembre 2009 16:01:25, Robert P. J. Day a écrit :
> > > > searching for Makefile references to Kconfig variables that don't
> > > > exist, and i find:
> > > >
> > > > ===== ATHEROS_AR71XX =====
> > > > ./drivers/net/wireless/ath/ath9k/Makefile:ath9k-$(CONFIG_ATHEROS_AR71XX)
> > > > +=
> > > > ahb.o
> > >
> > > We need it in OpenWrt and plan to send Atheros AR71xx SoC
> > > support soon, do not consider this for removal. Thanks
> >
> > Sure, fine...estimate when it will arrive?
> >
> > John
>
> When we got access to some more info on the AR7240 so we can finish
> the support for it.
just FYI, i wasn't pushing to have it taken out, just pointing out
its current lack of use. what someone decides to do about it is
entirely in their hands.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Annoying Kernel Pedantry.
Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================
^ permalink raw reply
* Re: Problems with "cfg80211: fix SME connect" commit
From: Hin-Tak Leung @ 2009-09-28 19:22 UTC (permalink / raw)
To: Johannes Berg; +Cc: Albert Herranz, Holger Schurig, linville, linux-wireless
In-Reply-To: <1254164123.3151.10.camel@johannes.local>
On Mon, Sep 28, 2009 at 7:55 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2009-09-28 at 11:04 -0700, Albert Herranz wrote:
>
>> [ 15.624121] wlan1: starting authentication with 00:12:17:15:e7:79
>> [ 15.630717] wlan1: deauthenticating from 00:12:17:15:e7:79 by local choice (reason=3)
>> [ 15.645151] wlan1: starting authentication with 00:12:17:15:e7:79
>
>> I'm using wpa_supplicant _without_ NM.
>
> Yeah, I since figured out why that's happening, and it's not so strange
> after all. Shouldn't be a big deal. At least I see you're getting
> connected too now.
>
> johannes
>
Yes, it looks like it is similar/same as my situation - the difference
being that I had wpa_supplicant talking to NM via D-bus and get the
extra user-prompt (not anymore with the latest patches) when the first
try from wpa_supplicant fails. When wpa_supplicant is run without -u
(the d-bus/NM option) it probably tries a bit harder on its own?
Hin-Tak
^ permalink raw reply
* [PATCH] compat-2.6: adding notes on installing to non-running kernel
From: Hin-Tak Leung @ 2009-09-28 19:08 UTC (permalink / raw)
To: linux-wireless, lrodriguez; +Cc: Hin-Tak Leung, Hin-Tak Leung
adding notes on installing to non-running kernel
Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
---
README | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/README b/README
index 7c6c2cd..380fc5a 100644
--- a/README
+++ b/README
@@ -142,6 +142,15 @@ compat-wireless-2.6 drivers for it you can use this syntax:
make KLIB=/home/mcgrof/kernels/linux-2.6.23.9 KLIB_BUILD=/home/mcgrof/kernels/linux-2.6.23.9
+If you have a kernel installed, which is not your currently running kernel (e.g. via
+distro updates; plus its corresponding kernel-dev package), you can use this syntax:
+
+make KLIB=/lib/modules/2.6.30.6-53.fc11.x86_64
+
+ and to install to your system's root path for the non-running kernel:
+
+make KLIB=/lib/modules/2.6.30.6-53.fc11.x86_64 KMODPATH_ARG='INSTALL_MOD_PATH=' install
+
Bugs
-----
--
1.6.2.5
^ permalink raw reply related
* [PATCH] compat-2.6: adding driver-select script support for rtl818x
From: Hin-Tak Leung @ 2009-09-28 19:08 UTC (permalink / raw)
To: linux-wireless, lrodriguez; +Cc: Hin-Tak Leung, Hin-Tak Leung
adding driver-select script support for rtl818x
Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
---
scripts/driver-select | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/scripts/driver-select b/scripts/driver-select
index e0d7305..dcb777c 100755
--- a/scripts/driver-select
+++ b/scripts/driver-select
@@ -44,6 +44,7 @@ function usage {
echo -e "\t${CYAN}ath${NORMAL} < ${PURPLE} ath5k ath9k ar9170 ${NORMAL}>"
echo -e "\t${CYAN}intel${NORMAL} < ${PURPLE} iwl3945 iwlagn ipw2100 ipw2200 ${NORMAL}>"
echo -e "\t${CYAN}iwlwifi${NORMAL} < ${PURPLE} iwl3945 iwlagn ${NORMAL}>"
+ echo -e "\t${CYAN}rtl818x${NORMAL} < ${PURPLE} rtl8180 rtl8187 ${NORMAL}>"
echo -e "\t${CYAN}wl12xx${NORMAL} < ${PURPLE} wl1251 (SPI and SDIO) wl1271 ${NORMAL}>"
echo -e "Restoring compat-wireless:"
@@ -127,6 +128,13 @@ function disable_var_01 {
disable_var
}
+function disable_var_02 {
+ #var_01 with eeprom not disabled
+ disable_lib80211
+ disable_ssb
+ disable_usbnet
+}
+
function select_ath_driver
{
backup_file $ATH_MAKEFILE
@@ -227,6 +235,10 @@ case $1 in
select_driver CONFIG_ATH_COMMON
select_ath_driver CONFIG_AR9170_USB
;;
+ rtl818x)
+ select_drivers CONFIG_RTL8180 CONFIG_RTL8187
+ disable_var_02
+ ;;
zd1211rw)
select_driver CONFIG_ZD1211RW
disable_var_01
--
1.6.2.5
^ permalink raw reply related
* Re: Problems with "cfg80211: fix SME connect" commit
From: Johannes Berg @ 2009-09-28 18:55 UTC (permalink / raw)
To: Albert Herranz; +Cc: Holger Schurig, linville, linux-wireless
In-Reply-To: <29413.68229.qm@web28307.mail.ukl.yahoo.com>
[-- Attachment #1: Type: text/plain, Size: 514 bytes --]
On Mon, 2009-09-28 at 11:04 -0700, Albert Herranz wrote:
> [ 15.624121] wlan1: starting authentication with 00:12:17:15:e7:79
> [ 15.630717] wlan1: deauthenticating from 00:12:17:15:e7:79 by local choice (reason=3)
> [ 15.645151] wlan1: starting authentication with 00:12:17:15:e7:79
> I'm using wpa_supplicant _without_ NM.
Yeah, I since figured out why that's happening, and it's not so strange
after all. Shouldn't be a big deal. At least I see you're getting
connected too now.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH] ar9170: implement frequency calibration for one-stage/openfw
From: John W. Linville @ 2009-09-28 18:41 UTC (permalink / raw)
To: Joerg Albert
Cc: Andrew Morton, Christian Lamparter, linux-wireless,
David S. Miller
In-Reply-To: <4AB4CCD0.5080003@gmx.de>
On Sat, Sep 19, 2009 at 02:21:36PM +0200, Joerg Albert wrote:
> On 09/19/2009 02:02 AM, Andrew Morton wrote:
> > On Thu, 3 Sep 2009 20:25:31 +0200
> > Christian Lamparter <chunkeey@googlemail.com> wrote:
> >
> >> This patch ports some code from the vendor driver, which is
> >> supposed to upload the right calibration values for the
> >> chosen frequency.
> >>
> >> In theory, this should give a better range and throughput
> >> for all users with the open, or one-stage firmware.
> >>
> >> ...
> >>
> >> + for (i = 0; i < 76; i++) {
> >> + u32 phy_data;
> >> + u8 tmp;
> >> +
> >> + if (i < 25) {
> >> + tmp = ar9170_interpolate_val(i, &pwrs[0][0],
> >> + &vpds[0][0]);
> >> + } else {
> >> + tmp = ar9170_interpolate_val(i - 12,
> >> + &pwrs[1][0],
> >> + &vpds[1][0]);
> >> + }
> >> +
> >> + phy_data |= tmp << ((i & 3) << 3);
> >
> > Clearly buggy and the compiler warns. The value of phy_data is unknown
> > here.
> >
> > How did this get all the way into mainline?
>
> Strangely it compiles without any warning for me with the latest linux-wireless:
That is strange -- no warning here (F-11) either...
Christian, care to propose a patch? Or maybe just something like this?
diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c
index b3e5cf3..49c10cb 100644
--- a/drivers/net/wireless/ath/ar9170/phy.c
+++ b/drivers/net/wireless/ath/ar9170/phy.c
@@ -1220,7 +1220,7 @@ static int ar9170_set_freq_cal_data(struct ar9170 *ar,
&vpds[1][0]);
}
- phy_data |= tmp << ((i & 3) << 3);
+ phy_data = tmp << ((i & 3) << 3);
if ((i & 3) == 3) {
ar9170_regwrite(0x1c6280 + chain * 0x1000 +
(i & ~3), phy_data);
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 related
* Re: Makefile ref to non-existent CONFIG_ATHEROS_AR71XX
From: John W. Linville @ 2009-09-28 18:29 UTC (permalink / raw)
To: Florian Fainelli; +Cc: Robert P. J. Day, linux-wireless, ath9k-devel
In-Reply-To: <200909182004.54398.florian@openwrt.org>
On Fri, Sep 18, 2009 at 08:04:51PM +0200, Florian Fainelli wrote:
> Hi Robert,
>
> Le vendredi 18 septembre 2009 16:01:25, Robert P. J. Day a écrit :
> > searching for Makefile references to Kconfig variables that don't
> > exist, and i find:
> >
> > ===== ATHEROS_AR71XX =====
> > ./drivers/net/wireless/ath/ath9k/Makefile:ath9k-$(CONFIG_ATHEROS_AR71XX) +=
> > ahb.o
>
> We need it in OpenWrt and plan to send Atheros AR71xx SoC support soon, do not
> consider this for removal. Thanks
Sure, fine...estimate when it will arrive?
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
* Re: Problems with "cfg80211: fix SME connect" commit
From: Albert Herranz @ 2009-09-28 18:04 UTC (permalink / raw)
To: Johannes Berg; +Cc: Holger Schurig, linville, linux-wireless
In-Reply-To: <1253779538.3868.14.camel@johannes.local>
Johannes Berg wrote:
> On Mon, 2009-09-21 at 18:11 +0200, Albert Herranz wrote:
>
>> Adding back "cfg80211: fix SME connect" and applying "cfg80211: don't
>> overwrite privacy setting" fixes the connection issue, but with a
>> introduces a small difference vs the previous working version.
>> There is now an extra "deauthenticating by local choice (reason=3)"
>> message in the logs.
>
>> [ 13.969153] b43-phy0 debug: Adding Interface type 2
>> [ 16.679249] wlan1: direct probe to AP 00:12:17:15:e7:79 (try 1)
>
>> * master-20090916 + "cfg80211: don't overwrite privacy setting"
>
>> [ 13.218613] b43-phy0 debug: Adding Interface type 2
>> [ 15.832582] wlan1: deauthenticating by local choice (reason=3)
>> [ 16.131599] wlan1: direct probe to AP 00:12:17:15:e7:79 (try 1)
>
> Very odd. Can you edit the deauthenticating message to show the
> BSSID/MAC address?
>
> johannes
Hi,
Sorry if this comes too late (I was on vacation).
Here's the output showing the BSSID/MAC address for completeness.
[ 1.307985] b43-sdio mmc1:0001:1: Chip ID 14e4:4318
[ 1.344244] b43-phy0: Broadcom 4318 WLAN found (core revision 9)
[ 1.372627] b43-phy0 debug: Found PHY: Analog 3, Type 2, Revision 7
[ 1.377416] b43-phy0 debug: Found Radio: Manuf 0x17F, Version 0x2050, Revision 8
[ 1.417302] phy0: Selected rate control algorithm 'minstrel'
[ 4.462416] udev: renamed network interface wlan0 to wlan1
[ 11.064949] b43 ssb0:0: firmware: requesting b43/ucode5.fw
[ 11.118177] b43 ssb0:0: firmware: requesting b43-open/ucode5.fw
[ 11.197385] b43 ssb0:0: firmware: requesting b43-open/pcm5.fw
[ 11.268949] b43 ssb0:0: firmware: requesting b43-open/b0g0initvals5.fw
[ 11.347623] b43 ssb0:0: firmware: requesting b43-open/b0g0bsinitvals5.fw
[ 12.353406] b43-phy0: Loading OpenSource firmware version 410.31754
[ 12.359142] b43-phy0: Hardware crypto acceleration not supported by firmware
[ 12.369827] b43-phy0: QoS not supported by firmware
[ 12.741767] b43-phy0 debug: Chip initialized
[ 12.757540] b43-phy0 debug: PIO initialized
[ 12.764455] b43-phy0 debug: QoS disabled
[ 12.945116] b43-phy0 debug: Wireless interface started
[ 13.053151] b43-phy0 debug: Adding Interface type 2
[ 15.624121] wlan1: starting authentication with 00:12:17:15:e7:79
[ 15.630717] wlan1: deauthenticating from 00:12:17:15:e7:79 by local choice (reason=3)
[ 15.645151] wlan1: starting authentication with 00:12:17:15:e7:79
[ 15.665811] wlan1: direct probe to AP 00:12:17:15:e7:79 (try 1)
[ 15.681132] wlan1: direct probe responded
[ 15.687261] wlan1: authenticate with AP 00:12:17:15:e7:79 (try 1)
[ 15.701105] wlan1: authenticated
[ 15.707860] wlan1: starting association with 00:12:17:15:e7:79
[ 15.713877] wlan1: associate with AP 00:12:17:15:e7:79 (try 1)
[ 15.726949] wlan1: RX AssocResp from 00:12:17:15:e7:79 (capab=0x431 status=0 aid=1)
[ 15.740953] wlan1: associated
I'm using wpa_supplicant _without_ NM.
Cheers,
Albert
^ permalink raw reply
* Re: [RFC] libertas: first stab at cfg80211 support
From: Holger Schurig @ 2009-09-28 15:24 UTC (permalink / raw)
To: libertas-dev; +Cc: linux-wireless, Dan Williams
In-Reply-To: <200909281321.21600.h.schurig@mn-solutions.de>
Hmm, I see two problems with my code:
> +struct wireless_dev *lbs_wdev_alloc(int sizeof_priv, struct
device *dev)
> +{
...
> + wdev->wiphy = wiphy_new(&lbs_cfg80211_ops,
> + sizeof(struct lbs_private) + sizeof_priv);
...
and later:
> + wdev = lbs_wdev_alloc(sizeof(struct lbs_private), dmdev);
That's rubbish, I now allocate "sizeof(lbs_private)" bytes twice.
Another thing is that it might be necessary to unbundle the
call of "wiphy_new()" and wiphy_register().
I need lbs_private allocated and usable, e.g. in
lbs_start_card().
Later, in lbs_start_card(), when I query the firmware about it's
capabilites I know enought to populate wiphy->bands. Only then
should I call wiphy_register().
--
http://www.holgerschurig.de
^ permalink raw reply
* Re: [RFC] libertas: first stab at cfg80211 support
From: Holger Schurig @ 2009-09-28 15:07 UTC (permalink / raw)
To: Johannes Berg; +Cc: libertas-dev, linux-wireless, Dan Williams
In-Reply-To: <1254149857.3151.5.camel@johannes.local>
> It might make sense to support adding interfaces with nl80211,
> since apparently it has mesh and monitor interfaces.
Yes, this will eventually be added.
In the end I'd like to have all WEXT code in it's own file or
#ifdef'd and I'd like to have a working libertas_cs and
libertas_usb that don't need WEXT at all. But that will take
considerable time :-) One step towards this goal will be
monitor mode via NL80211.
Mesh-support via NL80211 must be done by someone else, I don't
have neither the knowledge, mesh nodes nor a mesh-capable
firmware. And I don't really care about mesh. So if no one else
does it, the CFG80211-only libertas-driver won't have mesh at
all.
--
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
* Re: [RFC] libertas: first stab at cfg80211 support
From: Johannes Berg @ 2009-09-28 14:57 UTC (permalink / raw)
To: Holger Schurig; +Cc: libertas-dev, linux-wireless, Dan Williams
In-Reply-To: <200909281654.08859.h.schurig@mn-solutions.de>
[-- Attachment #1: Type: text/plain, Size: 1794 bytes --]
On Mon, 2009-09-28 at 16:54 +0200, Holger Schurig wrote:
> Yes, it has three netdevs, but they aren't all setup at
> card-initialization time.
>
>
> Some details: "struct private" contains:
>
> struct net_device *dev;
> struct net_device *mesh_dev; /* Virtual device */
> struct net_device *rtap_net_dev;
>
> The old code did have an
>
> dev = alloc_etherdev(sizeof(struct lbs_private));"
>
> and the other two netdevs got initialized at some other location:
>
> * priv->lbs_add_mesh() in lbs_add_mesh()
> via "alloc_netdev(0, "msh%d", ether_setup)". And lbs_add_mesh()
> is called only when the hardware supports this.
> * rtap_net_dev is created in lbs_add_rtap() and again I haven't
> change the creation of this thingy.
>
> Please note that when I'm using the card in station mode, both
> mesh_dev and rtap_net_dev are NULL. My firmware doesn't have
> mesh code, and only when I set the card into monitor mode will
> the rtap_net_dev created.
>
>
> I kept this behavior for now: at initialzation I call:
>
> wdev = lbs_wdev_alloc(sizeof(struct lbs_private), dmdev);
> wdev->xyz = initialization;
> ...
> dev = alloc_netdev()
>
>
> For me it's not clear if I should create wdev's for mesh_dev and
> rtap_net_dev as well. However, I'm not able to check the mesh
> code anyway: my firmware doesn't support this. And for
> rtap_net_dev I'm not sure if this shouldn't be handled
> differently in a cfg80211 scenario, e.g. via
> lbs_cfg80211_change_iface().
Interesting.
> A hint of what I should then would be most welcome :-)
It might make sense to support adding interfaces with nl80211, since
apparently it has mesh and monitor interfaces.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [RFC] libertas: first stab at cfg80211 support
From: Holger Schurig @ 2009-09-28 14:54 UTC (permalink / raw)
To: Johannes Berg; +Cc: libertas-dev, linux-wireless, Dan Williams
In-Reply-To: <1254144714.3151.1.camel@johannes.local>
> This seems wrong -- doesn't libertas have multiple netdevs?
> You're treating wdev == wiphy it seems here, rather than wdev
> == netdev.
Yes, it has three netdevs, but they aren't all setup at
card-initialization time.
Some details: "struct private" contains:
struct net_device *dev;
struct net_device *mesh_dev; /* Virtual device */
struct net_device *rtap_net_dev;
The old code did have an
dev = alloc_etherdev(sizeof(struct lbs_private));"
and the other two netdevs got initialized at some other location:
* priv->lbs_add_mesh() in lbs_add_mesh()
via "alloc_netdev(0, "msh%d", ether_setup)". And lbs_add_mesh()
is called only when the hardware supports this.
* rtap_net_dev is created in lbs_add_rtap() and again I haven't
change the creation of this thingy.
Please note that when I'm using the card in station mode, both
mesh_dev and rtap_net_dev are NULL. My firmware doesn't have
mesh code, and only when I set the card into monitor mode will
the rtap_net_dev created.
I kept this behavior for now: at initialzation I call:
wdev = lbs_wdev_alloc(sizeof(struct lbs_private), dmdev);
wdev->xyz = initialization;
...
dev = alloc_netdev()
For me it's not clear if I should create wdev's for mesh_dev and
rtap_net_dev as well. However, I'm not able to check the mesh
code anyway: my firmware doesn't support this. And for
rtap_net_dev I'm not sure if this shouldn't be handled
differently in a cfg80211 scenario, e.g. via
lbs_cfg80211_change_iface().
A hint of what I should then would be most welcome :-)
--
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
* Re: Problems with "cfg80211: fix SME connect" commit
From: Johannes Berg @ 2009-09-28 14:41 UTC (permalink / raw)
To: Hin-Tak Leung; +Cc: Albert Herranz, Holger Schurig, linville, linux-wireless
In-Reply-To: <3ace41890909261657s53b38a2fl7939740fc53dd594@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 848 bytes --]
On Sun, 2009-09-27 at 00:57 +0100, Hin-Tak Leung wrote:
> I suppose (together with some of the newly added printk you mentioned
> could be removed in the final version) the dmesg messages are somewhat
> confusing, because as a user, I would rather have a deauth message
> that's actually associated with a user action (e.g. if I switch AP or
> rfkill). Is it possible to distinguish situation where a user action
> is involved versus one that isn't? or is the distinction between any
> consequence of 'user-action' vs wpa_supplicant doing-it-on-its-own too
> much buried down in the layers?
Yeah, it'd be nice to avoid that completely. Or even just avoid telling
the driver, maybe with some delay akin iwcommit. Alas, I haven't looked
at it yet and right now it seems to just be a message (and possibly a
deauth frame)
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [bisected] Wireless regression in 2.6.32-git
From: John W. Linville @ 2009-09-28 13:59 UTC (permalink / raw)
To: Johannes Berg
Cc: Arjan van de Ven, Hugh Dickins, netdev, linux-kernel,
linux-wireless
In-Reply-To: <1254077199.6583.8.camel@johannes.local>
On Sun, Sep 27, 2009 at 08:46:39PM +0200, Johannes Berg wrote:
> On Sun, 2009-09-27 at 20:45 +0200, Arjan van de Ven wrote:
>
> > > Subject: cfg80211: don't set privacy w/o key
> > >
> > > When wpa_supplicant is used to connect to open networks,
> > > it causes the wdev->wext.keys to point to key memory, but
> > > that key memory is all empty. Only use privacy when there
> > > is a default key to be used.
> >
> >
> > indeed it does
> >
> > can we get this into mainline soon ?
>
> John's on his way home I suppose.
Yes, I'll get to it today -- sorry for the delays related to my travel!
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
* Re: [RFC] libertas: first stab at cfg80211 support
From: Johannes Berg @ 2009-09-28 13:31 UTC (permalink / raw)
To: Holger Schurig; +Cc: libertas-dev, linux-wireless, Dan Williams
In-Reply-To: <200909281321.21600.h.schurig@mn-solutions.de>
[-- Attachment #1: Type: text/plain, Size: 2068 bytes --]
On Mon, 2009-09-28 at 13:21 +0200, Holger Schurig wrote:
> Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
>
> ---
>
> This patch currently just create a wdev, so you can do "iw list".
>
> I'd like to get comments if the position where I create/destroy
> the wdev makes sense.
>
> Index: linux-wl/drivers/net/wireless/Kconfig
> ===================================================================
> --- linux-wl.orig/drivers/net/wireless/Kconfig 2009-09-28 12:06:02.000000000 +0200
> +++ linux-wl/drivers/net/wireless/Kconfig 2009-09-28 12:06:30.000000000 +0200
> @@ -138,6 +138,7 @@ config LIBERTAS
> depends on WLAN_80211
> select WIRELESS_EXT
> select LIB80211
> + select CFG80211
> select FW_LOADER
> ---help---
> A library for Marvell Libertas 8xxx devices.
> Index: linux-wl/drivers/net/wireless/libertas/Makefile
> ===================================================================
> --- linux-wl.orig/drivers/net/wireless/libertas/Makefile 2009-09-28 12:06:02.000000000 +0200
> +++ linux-wl/drivers/net/wireless/libertas/Makefile 2009-09-28 12:06:30.000000000 +0200
> @@ -1,5 +1,5 @@
> libertas-objs := main.o wext.o rx.o tx.o cmd.o cmdresp.o scan.o 11d.o \
> - debugfs.o persistcfg.o ethtool.o assoc.o
> + debugfs.o persistcfg.o ethtool.o assoc.o cfg.o
>
> usb8xxx-objs += if_usb.o
> libertas_cs-objs += if_cs.o
> Index: linux-wl/drivers/net/wireless/libertas/dev.h
> ===================================================================
> --- linux-wl.orig/drivers/net/wireless/libertas/dev.h 2009-09-28 12:06:02.000000000 +0200
> +++ linux-wl/drivers/net/wireless/libertas/dev.h 2009-09-28 12:06:30.000000000 +0200
> @@ -100,6 +100,7 @@ struct lbs_mesh_stats {
>
> /** Private structure for the MV device */
> struct lbs_private {
> + struct wireless_dev *wdev;
> int mesh_open;
> int mesh_fw_ver;
> int infra_open;
This seems wrong -- doesn't libertas have multiple netdevs? You're
treating wdev == wiphy it seems here, rather than wdev == netdev.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* [PATCH v2] wext: add back wireless/ dir in sysfs for cfg80211 interfaces
From: Johannes Berg @ 2009-09-28 13:26 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, Hugh Dickins
In-Reply-To: <1254130453.6583.22.camel@johannes.local>
The move away from having drivers assign wireless handlers,
in favour of making cfg80211 assign them, broke the sysfs
registration (the wireless/ dir went missing) because the
handlers are now assigned only after registration, which is
too late.
Fix this by special-casing cfg80211-based devices, all
of which are required to have an ieee80211_ptr, in the
sysfs code, and also using get_wireless_stats() to have
the same values reported as in procfs.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reported-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Tested-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
---
v2: reworded commit log
include/net/wext.h | 1 +
net/core/net-sysfs.c | 12 +++++-------
net/wireless/wext.c | 2 +-
3 files changed, 7 insertions(+), 8 deletions(-)
--- wireless-testing.orig/net/core/net-sysfs.c 2009-09-28 10:41:50.000000000 +0200
+++ wireless-testing/net/core/net-sysfs.c 2009-09-28 11:24:12.000000000 +0200
@@ -16,7 +16,7 @@
#include <net/sock.h>
#include <linux/rtnetlink.h>
#include <linux/wireless.h>
-#include <net/iw_handler.h>
+#include <net/wext.h>
#include "net-sysfs.h"
@@ -363,15 +363,13 @@ static ssize_t wireless_show(struct devi
char *))
{
struct net_device *dev = to_net_dev(d);
- const struct iw_statistics *iw = NULL;
+ const struct iw_statistics *iw;
ssize_t ret = -EINVAL;
read_lock(&dev_base_lock);
if (dev_isalive(dev)) {
- if (dev->wireless_handlers &&
- dev->wireless_handlers->get_wireless_stats)
- iw = dev->wireless_handlers->get_wireless_stats(dev);
- if (iw != NULL)
+ iw = get_wireless_stats(dev);
+ if (iw)
ret = (*format)(iw, buf);
}
read_unlock(&dev_base_lock);
@@ -505,7 +503,7 @@ int netdev_register_kobject(struct net_d
*groups++ = &netstat_group;
#ifdef CONFIG_WIRELESS_EXT_SYSFS
- if (net->wireless_handlers && net->wireless_handlers->get_wireless_stats)
+ if (net->wireless_handlers || net->ieee80211_ptr)
*groups++ = &wireless_group;
#endif
#endif /* CONFIG_SYSFS */
--- wireless-testing.orig/include/net/wext.h 2009-09-28 10:41:50.000000000 +0200
+++ wireless-testing/include/net/wext.h 2009-09-28 11:09:06.000000000 +0200
@@ -14,6 +14,7 @@ extern int wext_handle_ioctl(struct net
void __user *arg);
extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
unsigned long arg);
+extern struct iw_statistics *get_wireless_stats(struct net_device *dev);
#else
static inline int wext_proc_init(struct net *net)
{
--- wireless-testing.orig/net/wireless/wext.c 2009-09-28 10:41:50.000000000 +0200
+++ wireless-testing/net/wireless/wext.c 2009-09-28 11:09:07.000000000 +0200
@@ -470,7 +470,7 @@ static iw_handler get_handler(struct net
/*
* Get statistics out of the driver
*/
-static struct iw_statistics *get_wireless_stats(struct net_device *dev)
+struct iw_statistics *get_wireless_stats(struct net_device *dev)
{
/* New location */
if ((dev->wireless_handlers != NULL) &&
^ permalink raw reply
* [RFC] libertas: first stab at cfg80211 support
From: Holger Schurig @ 2009-09-28 11:21 UTC (permalink / raw)
To: libertas-dev; +Cc: linux-wireless, Dan Williams
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
---
This patch currently just create a wdev, so you can do "iw list".
I'd like to get comments if the position where I create/destroy
the wdev makes sense.
Index: linux-wl/drivers/net/wireless/Kconfig
===================================================================
--- linux-wl.orig/drivers/net/wireless/Kconfig 2009-09-28 12:06:02.000000000 +0200
+++ linux-wl/drivers/net/wireless/Kconfig 2009-09-28 12:06:30.000000000 +0200
@@ -138,6 +138,7 @@ config LIBERTAS
depends on WLAN_80211
select WIRELESS_EXT
select LIB80211
+ select CFG80211
select FW_LOADER
---help---
A library for Marvell Libertas 8xxx devices.
Index: linux-wl/drivers/net/wireless/libertas/Makefile
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/Makefile 2009-09-28 12:06:02.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/Makefile 2009-09-28 12:06:30.000000000 +0200
@@ -1,5 +1,5 @@
libertas-objs := main.o wext.o rx.o tx.o cmd.o cmdresp.o scan.o 11d.o \
- debugfs.o persistcfg.o ethtool.o assoc.o
+ debugfs.o persistcfg.o ethtool.o assoc.o cfg.o
usb8xxx-objs += if_usb.o
libertas_cs-objs += if_cs.o
Index: linux-wl/drivers/net/wireless/libertas/dev.h
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/dev.h 2009-09-28 12:06:02.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/dev.h 2009-09-28 12:06:30.000000000 +0200
@@ -100,6 +100,7 @@ struct lbs_mesh_stats {
/** Private structure for the MV device */
struct lbs_private {
+ struct wireless_dev *wdev;
int mesh_open;
int mesh_fw_ver;
int infra_open;
Index: linux-wl/drivers/net/wireless/libertas/cfg.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-wl/drivers/net/wireless/libertas/cfg.h 2009-09-28 12:07:23.000000000 +0200
@@ -0,0 +1,9 @@
+#ifndef __LBS_CFG80211_H__
+#define __LBS_CFG80211_H__
+
+#include "dev.h"
+
+struct wireless_dev *lbs_wdev_alloc(int sizeof_priv, struct device *dev);
+void lbs_wdev_free(struct lbs_private *lbs);
+
+#endif
Index: linux-wl/drivers/net/wireless/libertas/cfg.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-wl/drivers/net/wireless/libertas/cfg.c 2009-09-28 12:09:06.000000000 +0200
@@ -0,0 +1,160 @@
+/*
+ * Implement cfg80211 ("iw") support.
+ *
+ * Copyright (C) 2009 M&N Solutions GmbH, 61191 Rosbach, Germany
+ * Holger Schurig <hs4233@mail.mn-solutions.de>
+ *
+ * Based on cfg80211.h:
+ * Copyright (C) 2009 Intel Corporation <ilw@linux.intel.com>
+ * Samuel Ortiz <samuel.ortiz@intel.com>
+ * Zhu Yi <yi.zhu@intel.com>
+ */
+
+#include <net/cfg80211.h>
+
+#include "cfg.h"
+
+
+#define CHAN2G(_channel, _freq, _flags) { \
+ .band = IEEE80211_BAND_2GHZ, \
+ .center_freq = (_freq), \
+ .hw_value = (_channel), \
+ .flags = (_flags), \
+ .max_antenna_gain = 0, \
+ .max_power = 30, \
+}
+
+static struct ieee80211_channel lbs_2ghz_channels[] = {
+ CHAN2G(1, 2412, 0),
+ CHAN2G(2, 2417, 0),
+ CHAN2G(3, 2422, 0),
+ CHAN2G(4, 2427, 0),
+ CHAN2G(5, 2432, 0),
+ CHAN2G(6, 2437, 0),
+ CHAN2G(7, 2442, 0),
+ CHAN2G(8, 2447, 0),
+ CHAN2G(9, 2452, 0),
+ CHAN2G(10, 2457, 0),
+ CHAN2G(11, 2462, 0),
+ CHAN2G(12, 2467, 0),
+ CHAN2G(13, 2472, 0),
+ CHAN2G(14, 2484, 0),
+};
+
+#define RATETAB_ENT(_rate, _rateid, _flags) \
+ { \
+ .bitrate = (_rate), \
+ .hw_value = (_rateid), \
+ .flags = (_flags), \
+ }
+
+
+static struct ieee80211_rate lbs_rates[] = {
+ RATETAB_ENT(10, 0x1, 0),
+ RATETAB_ENT(20, 0x2, 0),
+ RATETAB_ENT(55, 0x4, 0),
+ RATETAB_ENT(110, 0x8, 0),
+ RATETAB_ENT(60, 0x10, 0),
+ RATETAB_ENT(90, 0x20, 0),
+ RATETAB_ENT(120, 0x40, 0),
+ RATETAB_ENT(180, 0x80, 0),
+ RATETAB_ENT(240, 0x100, 0),
+ RATETAB_ENT(360, 0x200, 0),
+ RATETAB_ENT(480, 0x400, 0),
+ RATETAB_ENT(540, 0x800, 0),
+};
+
+static struct ieee80211_supported_band lbs_band_2ghz = {
+ .channels = lbs_2ghz_channels,
+ .n_channels = ARRAY_SIZE(lbs_2ghz_channels),
+ .bitrates = lbs_rates,
+ .n_bitrates = ARRAY_SIZE(lbs_rates),
+};
+
+
+static const u32 cipher_suites[] = {
+ WLAN_CIPHER_SUITE_WEP40,
+ WLAN_CIPHER_SUITE_WEP104,
+ WLAN_CIPHER_SUITE_TKIP,
+ WLAN_CIPHER_SUITE_CCMP,
+};
+
+
+
+static struct cfg80211_ops lbs_cfg80211_ops = {
+/* TODO
+ .change_virtual_intf = iwm_cfg80211_change_iface,
+ .add_key = iwm_cfg80211_add_key,
+ .get_key = iwm_cfg80211_get_key,
+ .del_key = iwm_cfg80211_del_key,
+ .set_default_key = iwm_cfg80211_set_default_key,
+ .get_station = iwm_cfg80211_get_station,
+ .scan = iwm_cfg80211_scan,
+ .set_wiphy_params = iwm_cfg80211_set_wiphy_params,
+ .connect = iwm_cfg80211_connect,
+ .disconnect = iwm_cfg80211_disconnect,
+ .join_ibss = iwm_cfg80211_join_ibss,
+ .leave_ibss = iwm_cfg80211_leave_ibss,
+ .set_tx_power = iwm_cfg80211_set_txpower,
+ .get_tx_power = iwm_cfg80211_get_txpower,
+ .set_power_mgmt = iwm_cfg80211_set_power_mgmt,
+*/
+};
+
+struct wireless_dev *lbs_wdev_alloc(int sizeof_priv, struct device *dev)
+{
+ int ret = 0;
+ struct wireless_dev *wdev;
+
+ wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
+ if (!wdev) {
+ dev_err(dev, "Couldn't allocate wireless device\n");
+ return ERR_PTR(-ENOMEM);
+ }
+
+ wdev->wiphy = wiphy_new(&lbs_cfg80211_ops,
+ sizeof(struct lbs_private) + sizeof_priv);
+ if (!wdev->wiphy) {
+ dev_err(dev, "Couldn't allocate wiphy device\n");
+ ret = -ENOMEM;
+ goto out_err_new;
+ }
+
+ set_wiphy_dev(wdev->wiphy, dev);
+ wdev->wiphy->max_scan_ssids = 1; /* TODO */
+ wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
+ BIT(NL80211_IFTYPE_ADHOC);
+ wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &lbs_band_2ghz;
+ wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
+ wdev->wiphy->cipher_suites = cipher_suites;
+ wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
+
+ ret = wiphy_register(wdev->wiphy);
+ if (ret < 0) {
+ dev_err(dev, "Couldn't register wiphy device\n");
+ goto out_err_register;
+ }
+
+ return wdev;
+
+ out_err_register:
+ wiphy_free(wdev->wiphy);
+
+ out_err_new:
+ kfree(wdev);
+
+ return ERR_PTR(ret);
+}
+
+
+void lbs_wdev_free(struct lbs_private *lbs)
+{
+ struct wireless_dev *wdev = lbs->wdev;
+
+ if (!wdev)
+ return;
+
+ wiphy_unregister(wdev->wiphy);
+ wiphy_free(wdev->wiphy);
+ kfree(wdev);
+}
Index: linux-wl/drivers/net/wireless/libertas/main.c
===================================================================
--- linux-wl.orig/drivers/net/wireless/libertas/main.c 2009-09-28 12:06:02.000000000 +0200
+++ linux-wl/drivers/net/wireless/libertas/main.c 2009-09-28 12:11:22.000000000 +0200
@@ -14,11 +14,13 @@
#include <linux/stddef.h>
#include <linux/ieee80211.h>
#include <net/iw_handler.h>
+#include <net/cfg80211.h>
#include "host.h"
#include "decl.h"
#include "dev.h"
#include "wext.h"
+#include "cfg.h"
#include "debugfs.h"
#include "scan.h"
#include "assoc.h"
@@ -1168,31 +1170,42 @@ static const struct net_device_ops lbs_n
*/
struct lbs_private *lbs_add_card(void *card, struct device *dmdev)
{
- struct net_device *dev = NULL;
+ struct net_device *dev;
+ struct wireless_dev *wdev;
struct lbs_private *priv = NULL;
lbs_deb_enter(LBS_DEB_MAIN);
/* Allocate an Ethernet device and register it */
- dev = alloc_etherdev(sizeof(struct lbs_private));
- if (!dev) {
+ wdev = lbs_wdev_alloc(sizeof(struct lbs_private), dmdev);
+ if (IS_ERR(wdev)) {
lbs_pr_err("init wlanX device failed\n");
goto done;
}
- priv = netdev_priv(dev);
- dev->ml_priv = priv;
+ /* TODO? */
+ wdev->iftype = NL80211_IFTYPE_STATION;
+ priv = wdev_priv(wdev);
+ priv->wdev = wdev;
if (lbs_init_adapter(priv)) {
lbs_pr_err("failed to initialize adapter structure.\n");
- goto err_init_adapter;
+ goto err_wdev;
+ }
+
+ //TODO? dev = alloc_netdev_mq(0, "wlan%d", ether_setup, IWM_TX_QUEUES);
+ dev = alloc_netdev(0, "wlan%d", ether_setup);
+ if (!dev) {
+ dev_err(dmdev, "no memory for network device instance\n");
+ goto err_adapter;
}
+ dev->netdev_ops = &lbs_netdev_ops;
+ dev->ieee80211_ptr = wdev;
+ dev->ml_priv = priv;
+ SET_NETDEV_DEV(dev, dmdev);
+ wdev->netdev = dev;
priv->dev = dev;
- priv->card = card;
- priv->mesh_open = 0;
- priv->infra_open = 0;
- /* Setup the OS Interface to our functions */
dev->netdev_ops = &lbs_netdev_ops;
dev->watchdog_timeo = 5 * HZ;
dev->ethtool_ops = &lbs_ethtool_ops;
@@ -1201,7 +1214,14 @@ struct lbs_private *lbs_add_card(void *c
#endif
dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
- SET_NETDEV_DEV(dev, dmdev);
+
+ // TODO: kzalloc + iwm_init_default_profile(iwm, iwm->umac_profile); ??
+
+
+ priv->card = card;
+ priv->mesh_open = 0;
+ priv->infra_open = 0;
+
priv->rtap_net_dev = NULL;
strcpy(dev->name, "wlan%d");
@@ -1211,7 +1231,7 @@ struct lbs_private *lbs_add_card(void *c
priv->main_thread = kthread_run(lbs_thread, dev, "lbs_main");
if (IS_ERR(priv->main_thread)) {
lbs_deb_thread("Error creating main thread.\n");
- goto err_init_adapter;
+ goto err_ndev;
}
priv->work_thread = create_singlethread_workqueue("lbs_worker");
@@ -1228,9 +1248,15 @@ struct lbs_private *lbs_add_card(void *c
goto done;
-err_init_adapter:
- lbs_free_adapter(priv);
+ err_ndev:
free_netdev(dev);
+
+ err_adapter:
+ lbs_free_adapter(priv);
+
+ err_wdev:
+ lbs_wdev_free(priv);
+
priv = NULL;
done:
@@ -1277,6 +1303,7 @@ void lbs_remove_card(struct lbs_private
kthread_stop(priv->main_thread);
lbs_free_adapter(priv);
+ lbs_wdev_free(priv);
priv->dev = NULL;
free_netdev(dev);
--
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
* Re: [PATCH] wext: add back wireless/ dir in sysfs for cfg80211 interfaces
From: Hugh Dickins @ 2009-09-28 11:06 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
In-Reply-To: <1254130453.6583.22.camel@johannes.local>
On Mon, 28 Sep 2009, Johannes Berg wrote:
> The move away from wireless handlers the drivers assign
> to wireless handlers being assigned by cfg80211 broke
> the sysfs registration (the wireless/ dir went missing)
> because the handlers were assigned only after sysfs
> registration and thus the registration never noticed a
> device was wireless.
I couldn't make much sense of that: too much assigning!
>
> Fix this by special-casing cfg80211-based devices, all
> of which are required to have an ieee80211_ptr, in the
> sysfs code, and also using get_wireless_stats() to have
> the same values reported as in procfs.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> Reported-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
I confirm this works for me too: I won't venture an ignorant opinion
on which is the right solution; but my failed boots do suggest that
keeping away from the notifier infrastructure may make a wiser fix.
Thanks a lot for all your efforts on this, Johannes.
Hugh
^ permalink raw reply
* [PATCH] wext: add back wireless/ dir in sysfs for cfg80211 interfaces
From: Johannes Berg @ 2009-09-28 9:34 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, Hugh Dickins
The move away from wireless handlers the drivers assign
to wireless handlers being assigned by cfg80211 broke
the sysfs registration (the wireless/ dir went missing)
because the handlers were assigned only after sysfs
registration and thus the registration never noticed a
device was wireless.
Fix this by special-casing cfg80211-based devices, all
of which are required to have an ieee80211_ptr, in the
sysfs code, and also using get_wireless_stats() to have
the same values reported as in procfs.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reported-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
---
include/net/wext.h | 1 +
net/core/net-sysfs.c | 12 +++++-------
net/wireless/wext.c | 2 +-
3 files changed, 7 insertions(+), 8 deletions(-)
--- wireless-testing.orig/net/core/net-sysfs.c 2009-09-28 10:41:50.000000000 +0200
+++ wireless-testing/net/core/net-sysfs.c 2009-09-28 11:24:12.000000000 +0200
@@ -16,7 +16,7 @@
#include <net/sock.h>
#include <linux/rtnetlink.h>
#include <linux/wireless.h>
-#include <net/iw_handler.h>
+#include <net/wext.h>
#include "net-sysfs.h"
@@ -363,15 +363,13 @@ static ssize_t wireless_show(struct devi
char *))
{
struct net_device *dev = to_net_dev(d);
- const struct iw_statistics *iw = NULL;
+ const struct iw_statistics *iw;
ssize_t ret = -EINVAL;
read_lock(&dev_base_lock);
if (dev_isalive(dev)) {
- if (dev->wireless_handlers &&
- dev->wireless_handlers->get_wireless_stats)
- iw = dev->wireless_handlers->get_wireless_stats(dev);
- if (iw != NULL)
+ iw = get_wireless_stats(dev);
+ if (iw)
ret = (*format)(iw, buf);
}
read_unlock(&dev_base_lock);
@@ -505,7 +503,7 @@ int netdev_register_kobject(struct net_d
*groups++ = &netstat_group;
#ifdef CONFIG_WIRELESS_EXT_SYSFS
- if (net->wireless_handlers && net->wireless_handlers->get_wireless_stats)
+ if (net->wireless_handlers || net->ieee80211_ptr)
*groups++ = &wireless_group;
#endif
#endif /* CONFIG_SYSFS */
--- wireless-testing.orig/include/net/wext.h 2009-09-28 10:41:50.000000000 +0200
+++ wireless-testing/include/net/wext.h 2009-09-28 11:09:06.000000000 +0200
@@ -14,6 +14,7 @@ extern int wext_handle_ioctl(struct net
void __user *arg);
extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
unsigned long arg);
+extern struct iw_statistics *get_wireless_stats(struct net_device *dev);
#else
static inline int wext_proc_init(struct net *net)
{
--- wireless-testing.orig/net/wireless/wext.c 2009-09-28 10:41:50.000000000 +0200
+++ wireless-testing/net/wireless/wext.c 2009-09-28 11:09:07.000000000 +0200
@@ -470,7 +470,7 @@ static iw_handler get_handler(struct net
/*
* Get statistics out of the driver
*/
-static struct iw_statistics *get_wireless_stats(struct net_device *dev)
+struct iw_statistics *get_wireless_stats(struct net_device *dev)
{
/* New location */
if ((dev->wireless_handlers != NULL) &&
^ permalink raw reply
* Re: [PATCH 2/2] cfg80211: fix wireless handlers assignment
From: Johannes Berg @ 2009-09-28 9:29 UTC (permalink / raw)
To: netdev; +Cc: Hugh Dickins, linux-wireless
In-Reply-To: <1254126117.6583.19.camel@johannes.local>
[-- Attachment #1: Type: text/plain, Size: 456 bytes --]
On Mon, 2009-09-28 at 10:21 +0200, Johannes Berg wrote:
> The point we assign dev->wireless_handlers at is too
> late, we need to do that before netdev_register_kobject()
> gets called, so use the new NETDEV_PRE_INIT notifier.
> The result of adding wireless_handlers too late is the
> disappearance of /sys/class/net/wlan0/wireless which a
> bunch of distro scripts still require.
Ignore please, I have a better, self-contained fix.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] net: introduce NETDEV_POST_INIT notifier
From: Johannes Berg @ 2009-09-28 9:29 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, Hugh Dickins, Marcel Holtmann
In-Reply-To: <1254126089.6583.18.camel@johannes.local>
[-- Attachment #1: Type: text/plain, Size: 668 bytes --]
On Mon, 2009-09-28 at 10:21 +0200, Johannes Berg wrote:
> For various purposes including a wireless extensions
> bugfix, we need to hook into the netdev creation before
> before netdev_register_kobject(). This will also ease
> doing the dev type assignment that Marcel was working
> on for cfg80211 drivers w/o touching them all.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> ---
> I decided that it doesn't make a lot of sense to be after ndo_init but
> before the other name/... checks.
Ignore this patch please, I have something better. Marcel, feel free to
pick this up once you continue working on your devtype thing.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* [PATCH 2/2] cfg80211: fix wireless handlers assignment
From: Johannes Berg @ 2009-09-28 8:21 UTC (permalink / raw)
To: netdev; +Cc: Hugh Dickins, linux-wireless
The point we assign dev->wireless_handlers at is too
late, we need to do that before netdev_register_kobject()
gets called, so use the new NETDEV_PRE_INIT notifier.
The result of adding wireless_handlers too late is the
disappearance of /sys/class/net/wlan0/wireless which a
bunch of distro scripts still require.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/wireless/core.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- wireless-testing.orig/net/wireless/core.c 2009-09-28 09:54:52.000000000 +0200
+++ wireless-testing/net/wireless/core.c 2009-09-28 10:18:47.000000000 +0200
@@ -641,6 +641,12 @@ static int cfg80211_netdev_notifier_call
WARN_ON(wdev->iftype == NL80211_IFTYPE_UNSPECIFIED);
switch (state) {
+ case NETDEV_POST_INIT:
+#ifdef CONFIG_WIRELESS_EXT
+ if (!dev->wireless_handlers)
+ dev->wireless_handlers = &cfg80211_wext_handler;
+#endif
+ break;
case NETDEV_REGISTER:
/*
* NB: cannot take rdev->mtx here because this may be
@@ -666,8 +672,6 @@ static int cfg80211_netdev_notifier_call
wdev->sme_state = CFG80211_SME_IDLE;
mutex_unlock(&rdev->devlist_mtx);
#ifdef CONFIG_WIRELESS_EXT
- if (!dev->wireless_handlers)
- dev->wireless_handlers = &cfg80211_wext_handler;
wdev->wext.default_key = -1;
wdev->wext.default_mgmt_key = -1;
wdev->wext.connect.auth_type = NL80211_AUTHTYPE_AUTOMATIC;
^ permalink raw reply
* [PATCH 1/2] net: introduce NETDEV_POST_INIT notifier
From: Johannes Berg @ 2009-09-28 8:21 UTC (permalink / raw)
To: netdev; +Cc: linux-wireless, Hugh Dickins
For various purposes including a wireless extensions
bugfix, we need to hook into the netdev creation before
before netdev_register_kobject(). This will also ease
doing the dev type assignment that Marcel was working
on for cfg80211 drivers w/o touching them all.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
I decided that it doesn't make a lot of sense to be after ndo_init but
before the other name/... checks.
include/linux/notifier.h | 1 +
net/core/dev.c | 5 +++++
2 files changed, 6 insertions(+)
--- wireless-testing.orig/include/linux/notifier.h 2009-09-28 10:14:54.000000000 +0200
+++ wireless-testing/include/linux/notifier.h 2009-09-28 10:16:07.000000000 +0200
@@ -201,6 +201,7 @@ static inline int notifier_to_errno(int
#define NETDEV_PRE_UP 0x000D
#define NETDEV_BONDING_OLDTYPE 0x000E
#define NETDEV_BONDING_NEWTYPE 0x000F
+#define NETDEV_POST_INIT 0x0010
#define SYS_DOWN 0x0001 /* Notify of system down */
#define SYS_RESTART SYS_DOWN
--- wireless-testing.orig/net/core/dev.c 2009-09-28 10:14:54.000000000 +0200
+++ wireless-testing/net/core/dev.c 2009-09-28 10:20:46.000000000 +0200
@@ -4785,6 +4785,11 @@ int register_netdevice(struct net_device
if (dev->features & NETIF_F_SG)
dev->features |= NETIF_F_GSO;
+ ret = call_netdevice_notifiers(NETDEV_POST_INIT, dev);
+ ret = notifier_to_errno(ret);
+ if (ret)
+ goto err_uninit;
+
netdev_initialize_kobject(dev);
ret = netdev_register_kobject(dev);
if (ret)
^ permalink raw reply
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