Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] ath9k_htc: Fix suspend/resume
From: John W. Linville @ 2010-12-07 19:46 UTC (permalink / raw)
  To: Sujith; +Cc: Luis R. Rodriguez, linux-wireless
In-Reply-To: <19709.45926.38551.25130@gargle.gargle.HOWL>

On Tue, Dec 07, 2010 at 09:39:10AM +0530, Sujith wrote:
> Luis R. Rodriguez wrote:
> > Just curious, if you revert this patch and apply the ones I just
> > posted, does it fix it, or is this patch required either way?
> 
> Well, I don't see this patch in -testing, -next-2.6 or -2.6.
> Maybe Linville overlooked this patch.

Obviously I didn't overlook it, or I wouldn't have asked about whether
or not it should go to 2.6.37...

> Applying 4/5 and 5/5 from your series seems to fix the issue though.
> I am able to suspend/resume without hiccups with UB95.

But now this begs the question of whether this should be applied at all?

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: [PATCH] mac80211: Fix BUG in pskb_expand_head when transmitting shared skbs
From: John W. Linville @ 2010-12-07 19:49 UTC (permalink / raw)
  To: Helmut Schaa; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <1291311849-13086-1-git-send-email-helmut.schaa@googlemail.com>

On Thu, Dec 02, 2010 at 06:44:09PM +0100, Helmut Schaa wrote:
> mac80211 doesn't handle shared skbs correctly at the moment. As a result
> a possible resize can trigger a BUG in pskb_expand_head.
> 
> [  676.030000] Kernel bug detected[#1]:
> [  676.030000] Cpu 0
> [  676.030000] $ 0   : 00000000 00000000 819662ff 00000002
> [  676.030000] $ 4   : 81966200 00000020 00000000 00000020
> [  676.030000] $ 8   : 819662e0 800043c0 00000002 00020000
> [  676.030000] $12   : 3b9aca00 00000000 00000000 00470000
> [  676.030000] $16   : 80ea2000 00000000 00000000 00000000
> [  676.030000] $20   : 818aa200 80ea2018 80ea2000 00000008
> [  676.030000] $24   : 00000002 800ace5c                  
> [  676.030000] $28   : 8199a000 8199bd20 81938f88 80f180d4
> [  676.030000] Hi    : 0000026e
> [  676.030000] Lo    : 0000757e
> [  676.030000] epc   : 801245e4 pskb_expand_head+0x44/0x1d8
> [  676.030000]     Not tainted
> [  676.030000] ra    : 80f180d4 ieee80211_skb_resize+0xb0/0x114 [mac80211]
> [  676.030000] Status: 1000a403    KERNEL EXL IE 
> [  676.030000] Cause : 10800024
> [  676.030000] PrId  : 0001964c (MIPS 24Kc)
> [  676.030000] Modules linked in: mac80211_hwsim rt2800lib rt2x00soc rt2x00pci rt2x00lib mac80211 crc_itu_t crc_ccitt cfg80211 compat arc4 aes_generic deflate ecb cbc [last unloaded: rt2800pci]
> [  676.030000] Process kpktgend_0 (pid: 97, threadinfo=8199a000, task=81879f48, tls=00000000)
> [  676.030000] Stack : ffffffff 00000000 00000000 00000014 00000004 80ea2000 00000000 00000000
> [  676.030000]         818aa200 80f180d4 ffffffff 0000000a 81879f78 81879f48 81879f48 00000018
> [  676.030000]         81966246 80ea2000 818432e0 80f1a420 80203050 81814d98 00000001 81879f48
> [  676.030000]         81879f48 00000018 81966246 818432e0 0000001a 8199bdd4 0000001c 80f1b72c
> [  676.030000]         80203020 8001292c 80ef4aa2 7f10b55d 801ab5b8 81879f48 00000188 80005c90
> [  676.030000]         ...
> [  676.030000] Call Trace:
> [  676.030000] [<801245e4>] pskb_expand_head+0x44/0x1d8
> [  676.030000] [<80f180d4>] ieee80211_skb_resize+0xb0/0x114 [mac80211]
> [  676.030000] [<80f1a420>] ieee80211_xmit+0x150/0x22c [mac80211]
> [  676.030000] [<80f1b72c>] ieee80211_subif_start_xmit+0x6f4/0x73c [mac80211]
> [  676.030000] [<8014361c>] pktgen_thread_worker+0xfac/0x16f8
> [  676.030000] [<8002ebe8>] kthread+0x7c/0x88
> [  676.030000] [<80008e0c>] kernel_thread_helper+0x10/0x18
> [  676.030000] 
> [  676.030000] 
> [  676.030000] Code: 24020001  10620005  2502001f <0200000d> 0804917a  00000000  2502001f  00441023  00531021 
> 
> Fix this by making a local copy of shared skbs prior to mangeling them.
> To avoid copying the skb unnecessarily move the skb_copy call below the
> checks that don't need write access to the skb.
> 
> Also, move the assignment of nh_pos and h_pos below the skb_copy to point
> to the correct skb.
> 
> It would be possible to avoid another resize of the copied skb by using
> skb_copy_expand instead of skb_copy but that would make the patch more
> complex. Also, shared skbs are a corner case right now, so the resize
> shouldn't matter much.
> 
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

Is this intended for 2.6.37?  It looks like it would apply there.

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: [PATCH 1/4] b43: N-PHY: update init tables
From: ikorot @ 2010-12-07 19:49 UTC (permalink / raw)
  To: Larry Finger, Hauke Mehrtens; +Cc: linux-wireless, b43-dev

Hi, ALL,


-----Original Message-----
>From: Larry Finger <Larry.Finger@lwfinger.net>
>Sent: Dec 7, 2010 11:19 AM
>To: Hauke Mehrtens <hauke@hauke-m.de>
>Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org
>Subject: Re: [PATCH 1/4] b43: N-PHY: update init tables
>
>On 12/07/2010 01:08 PM, Hauke Mehrtens wrote:
>> On 12/07/2010 09:42 AM, Rafał Miłecki wrote:
>>> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
>>> ---
>>>  drivers/net/wireless/b43/tables_nphy.c |  212 ++++++++++++++++----------------
>>>  1 files changed, 106 insertions(+), 106 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
>>> index d60db07..46f0a7a 100644
>>> --- a/drivers/net/wireless/b43/tables_nphy.c
>>> +++ b/drivers/net/wireless/b43/tables_nphy.c
>>> @@ -28,41 +28,41 @@
>>>  #include "phy_n.h"
>>>  
>>>  static const u8 b43_ntab_adjustpower0[] = {
>>> -	0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
>>> -	0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
>>> -	0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
>>> -	0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
>>> -	0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
>>> -	0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
>>> -	0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
>>> -	0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
>>> -	0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
>>> -	0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
>>> -	0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
>>> -	0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
>>> -	0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
>>> -	0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
>>> -	0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
>>> -	0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>>  };
>> Why do you have this table when it only contains 0x00? If it is correct
>> there will be a better way to define such a table.
>> 
>>>  
>>>  static const u8 b43_ntab_adjustpower1[] = {
>>> -	0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
>>> -	0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
>>> -	0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
>>> -	0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
>>> -	0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
>>> -	0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
>>> -	0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
>>> -	0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
>>> -	0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
>>> -	0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
>>> -	0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
>>> -	0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
>>> -	0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
>>> -	0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
>>> -	0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
>>> -	0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>>  };
>> Same here.
>
>One reason is that these tables changed from non-zero to zero values between
>Broadcom driver 4.174.64.19 and 5.10.56.46. As they might change again, I think
>we should retain the full version.

Is there a way to check for version of the driver?
This way whoever uses old one won't be screwed...

Thank you.

>
>Larry
>
>
>
>_______________________________________________
>b43-dev mailing list
>b43-dev@lists.infradead.org
>http://lists.infradead.org/mailman/listinfo/b43-dev


^ permalink raw reply

* Re: [PATCH 2/3] iwlagn: implement layout-agnostic EEPROM reading
From: Guy, Wey-Yi @ 2010-12-07 19:45 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net, Berg, Johannes
In-Reply-To: <20101207192806.GF2700@tuxdriver.com>

Hi John,

On Tue, 2010-12-07 at 11:28 -0800, John W. Linville wrote:
> On Tue, Dec 07, 2010 at 09:37:07AM -0800, Wey-Yi Guy wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> > 
> > The current EEPROM reading code has some layout
> > assumptions that now turned out to be false with
> > some newer versions of the EEPROM. Luckily, we
> > can avoid all such assumptions by using data in
> > the EEPROM itself, so implement using that.
> > 
> > Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> > Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> 
> Is rewriting the EEPROM code really necessary for 2.6.37?  This seems
> like a lot of code to potentially get wrong...
> 

I agree it is a lot of changes. It is necessary for 6005 and 6030
devices. I understand the Hardware is not out yet; but both devices is
already supported by .37; without this changes, the regulatory will have
issues.

Yes, you are correct, this changes will also impact the older devices
(6000, 6050, 1000). 

So it is really judgment call, we plan to release both 6005 and 6030
uCode in the next few weeks and hardware should be on the market early
next year. If by the time when hardware become available, distro already
move to .38, then I am ok with it. What you think?

Thanks

Wey


^ permalink raw reply

* RE: [PATCH] mwifiex: remove some element ID's definitions
From: Johannes Berg @ 2010-12-07 19:42 UTC (permalink / raw)
  To: Bing Zhao
  Cc: linux-wireless@vger.kernel.org, John W. Linville,
	Amitkumar Karwar, Kiran Divekar, Frank Huang
In-Reply-To: <477F20668A386D41ADCC57781B1F704307D5C10021@SC-VEXCH1.marvell.com>

On Tue, 2010-12-07 at 11:32 -0800, Bing Zhao wrote:

> Thanks for your comments. I will resend the patch to incorporate all of above.

FWIW, I have no issues with it being a separate patch either, just
commenting.

johannes


^ permalink raw reply

* RE: [PATCH] mwifiex: remove some element ID's definitions
From: Bing Zhao @ 2010-12-07 19:32 UTC (permalink / raw)
  To: Johannes Berg
  Cc: linux-wireless@vger.kernel.org, John W. Linville,
	Amitkumar Karwar, Kiran Divekar, Frank Huang
In-Reply-To: <1291714911.3607.6.camel@jlt3.sipsolutions.net>

SGkgSm9oYW5uZXMsDQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogSm9o
YW5uZXMgQmVyZyBbbWFpbHRvOmpvaGFubmVzQHNpcHNvbHV0aW9ucy5uZXRdDQo+IFNlbnQ6IFR1
ZXNkYXksIERlY2VtYmVyIDA3LCAyMDEwIDE6NDIgQU0NCj4gVG86IEJpbmcgWmhhbw0KPiBDYzog
bGludXgtd2lyZWxlc3NAdmdlci5rZXJuZWwub3JnOyBKb2huIFcuIExpbnZpbGxlOyBBbWl0a3Vt
YXIgS2Fyd2FyOyBLaXJhbiBEaXZla2FyOyBGcmFuayBIdWFuZw0KPiBTdWJqZWN0OiBSZTogW1BB
VENIXSBtd2lmaWV4OiByZW1vdmUgc29tZSBlbGVtZW50IElEJ3MgZGVmaW5pdGlvbnMNCj4gDQo+
IE9uIE1vbiwgMjAxMC0xMi0wNiBhdCAyMjoxNiAtMDgwMCwgQmluZyBaaGFvIHdyb3RlOg0KPiA+
IEZyb206IEFtaXRrdW1hciBLYXJ3YXIgPGFrYXJ3YXJAbWFydmVsbC5jb20+DQo+ID4NCj4gPiBU
aG9zZSBhcmUgYWxyZWFkeSBkZWZpbmVkIGluIGluY2x1ZGUvbGludXgvaWVlZTgwMjExLmgNCj4g
PiB1bmRlciAiZW51bSBpZWVlODAyMTFfZWlkIi4NCj4gDQo+IEdvb2QgcGF0Y2ggOikNCj4gDQo+
ID4gLQllbnVtIGllZWVfdHlwZXNfZWxlbWVudGlkX2UgZWxlbWVudF9pZDsNCj4gPiArCWVudW0g
aWVlZTgwMjExX2VpZCBlbGVtZW50X2lkOw0KPiANCj4gWW91IHNob3VsZCBwcm9iYWJseSBqdXN0
IHVzZSBhIHU4LCBzaW5jZSB0aGF0J2xsIG1hdGNoIGJldHRlciB3aGF0IHRoZQ0KPiB2YWx1ZSBy
ZWFsbHkgaXMsIGl0IGNhbid0IGhhdmUgYW55IG1vcmUgdmFsdWVzIHRoYW4gdGhhdCBhbmQgYW4g
ZW51bQ0KPiByZWFsbHkgaXMgYW4gImludCIgbm90IGEgInU4Ii4gQWxzbyBsZXRzIHlvdSByZW1v
dmUgdGhlIHR5cGVjYXN0cyAodGhhdA0KPiBJIGRvbid0IHRoaW5rIGFyZSBuZWNlc3NhcnkgdG8g
c3RhcnQgd2l0aCkNCj4gDQo+ID4gIGVudW0gaWVlZV90eXBlc19lbGVtZW50aWRfZSB7DQo+IA0K
PiA+ICAJQlNTQ09fMjA0MCA9IDcyLA0KPiA+ICAJT1ZFUkxBUF9CU1NfU0NBTl9QQVJBTSA9IDc0
LA0KPiA+ICAJRVhUX0NBUEFCSUxJVFkgPSAxMjcsDQo+IA0KPiBJIHRoaW5rIHlvdSBzaG91bGQg
YWRkIHRoZXNlIHJlbWFpbmluZyBvbmVzIGludG8gdGhlIFdMQU5fRUlEXyBuYW1lc3BhY2UNCj4g
aW5zdGVhZCBvZiBrZWVwaW5nIHRoZW0uDQo+IA0KPiA+ICsJV1BTX0lFID0gV0xBTl9FSURfVkVO
RE9SX1NQRUNJRklDLA0KPiA+ICsJV01NX0lFID0gV0xBTl9FSURfVkVORE9SX1NQRUNJRklDLA0K
PiANCj4gQW5kIHRoZXNlIHNlZW0ganVzdCBwbGFpbiBtaXNsZWFkaW5nIHNpbmNlIHRoZXkgZG9u
J3QgaWRlbnRpZnkNCj4gYW55dGhpbmcgLi4uIG9uZSBjb3VsZCBiZSB0ZW1wdGVkIHRvIHVzZSBi
b3RoIGluIGEgc3dpdGNoKCkgc3RhdGVtZW50DQo+IGZvciBleGFtcGxlLiBJJ2QgcmVwbGFjZSB0
aGVpciB1c2Ugd2l0aCBqdXN0IHZlbmRvci1zcGVjaWZpYyBJIHRoaW5rDQo+IChhbHRob3VnaCBJ
J20gYXdhcmUgdGhhdCBzb21lIG9sZGVyIGNvZGUgd2UgaGF2ZSBpbiB0aGUgc3RhY2sgZG9lcyB0
aGlzDQo+IGFzIHdlbGwsIElJUkMpDQoNClRoYW5rcyBmb3IgeW91ciBjb21tZW50cy4gSSB3aWxs
IHJlc2VuZCB0aGUgcGF0Y2ggdG8gaW5jb3Jwb3JhdGUgYWxsIG9mIGFib3ZlLg0KDQpSZWdhcmRz
LA0KDQpCaW5nDQoNCj4gDQo+IGpvaGFubmVzDQoNCg==

^ permalink raw reply

* Re: [PATCH 2/3] iwlagn: implement layout-agnostic EEPROM reading
From: John W. Linville @ 2010-12-07 19:28 UTC (permalink / raw)
  To: Wey-Yi Guy; +Cc: linux-wireless, ipw3945-devel, Johannes Berg
In-Reply-To: <1291743428-19642-3-git-send-email-wey-yi.w.guy@intel.com>

On Tue, Dec 07, 2010 at 09:37:07AM -0800, Wey-Yi Guy wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> The current EEPROM reading code has some layout
> assumptions that now turned out to be false with
> some newer versions of the EEPROM. Luckily, we
> can avoid all such assumptions by using data in
> the EEPROM itself, so implement using that.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>

Is rewriting the EEPROM code really necessary for 2.6.37?  This seems
like a lot of code to potentially get wrong...

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

* [PATCH] mac80211: Show max number of probe tries in debug message.
From: greearb @ 2010-12-07 19:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 2b5c3f2... de43753... M	net/mac80211/work.c
 net/mac80211/work.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 2b5c3f2..de43753 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -458,8 +458,9 @@ ieee80211_direct_probe(struct ieee80211_work *wk)
 		return WORK_ACT_TIMEOUT;
 	}
 
-	printk(KERN_DEBUG "%s: direct probe to %pM (try %d)\n",
-			sdata->name, wk->filter_ta, wk->probe_auth.tries);
+	printk(KERN_DEBUG "%s: direct probe to %pM (try %d/%i)\n",
+	       sdata->name, wk->filter_ta, wk->probe_auth.tries,
+	       IEEE80211_AUTH_MAX_TRIES);
 
 	/*
 	 * Direct probe is sent to broadcast address as some APs
-- 
1.7.2.3


^ permalink raw reply related

* Re: [PATCH 0/4] ath: logging message conversion
From: Luis R. Rodriguez @ 2010-12-07 19:26 UTC (permalink / raw)
  To: John W. Linville
  Cc: Joe Perches, Luis Rodriguez, linux-wireless@vger.kernel.org,
	ath5k-devel@venema.h4ckr.net, ath9k-devel@venema.h4ckr.net,
	Peter Stuge, Felix Fietkau, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
In-Reply-To: <20101207190528.GD2700@tuxdriver.com>

On Tue, Dec 07, 2010 at 11:05:28AM -0800, John W. Linville wrote:
> On Thu, Dec 02, 2010 at 07:12:34PM -0800, Joe Perches wrote:
> > ath_print is misleading as it's only used with CONFIG_ATH_DEBUG.
> > 
> > Add and use the more normal <subsystem>_printk and <subsystem>_<level>
> > printk equivalents. (ath_printk and ath_<level>)
> > 
> > Fix various defects in the current uses of ath_print formats
> > and arguments: Unnecessary casts, missing newlines, multiple
> > prints, and 1 loop which can exceed array bounds.
> > 
> > Bundled and integrated the individual patches into a single patch series.
> > 
> > Joe Perches (4):
> >   ath: Add and use ath_printk and ath_<level>
> >   ath: Convert ath_print(.., ATH_DBG_FATAL to ath_err
> >   ath: Convert ath_print to ath_dbg
> >   ath: Fix ath_dbg access beyond array bound
> 
> Is the Atheros crew happy with this series?  They didn't seem to like
> the original patches very much...

Its fine now that Joe has addressed some more important items.
But I'd like for the patches to be applied last of all pending
patches :)

  Luis

^ permalink raw reply

* Re: [PATCH 1/4] b43: N-PHY: update init tables
From: Larry Finger @ 2010-12-07 19:19 UTC (permalink / raw)
  To: Hauke Mehrtens
  Cc: Rafał Miłecki, linux-wireless, John W. Linville,
	b43-dev
In-Reply-To: <4CFE863A.30203@hauke-m.de>

On 12/07/2010 01:08 PM, Hauke Mehrtens wrote:
> On 12/07/2010 09:42 AM, Rafał Miłecki wrote:
>> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
>> ---
>>  drivers/net/wireless/b43/tables_nphy.c |  212 ++++++++++++++++----------------
>>  1 files changed, 106 insertions(+), 106 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
>> index d60db07..46f0a7a 100644
>> --- a/drivers/net/wireless/b43/tables_nphy.c
>> +++ b/drivers/net/wireless/b43/tables_nphy.c
>> @@ -28,41 +28,41 @@
>>  #include "phy_n.h"
>>  
>>  static const u8 b43_ntab_adjustpower0[] = {
>> -	0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
>> -	0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
>> -	0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
>> -	0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
>> -	0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
>> -	0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
>> -	0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
>> -	0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
>> -	0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
>> -	0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
>> -	0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
>> -	0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
>> -	0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
>> -	0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
>> -	0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
>> -	0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>  };
> Why do you have this table when it only contains 0x00? If it is correct
> there will be a better way to define such a table.
> 
>>  
>>  static const u8 b43_ntab_adjustpower1[] = {
>> -	0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
>> -	0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
>> -	0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
>> -	0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
>> -	0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
>> -	0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
>> -	0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
>> -	0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
>> -	0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
>> -	0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
>> -	0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
>> -	0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
>> -	0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
>> -	0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
>> -	0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
>> -	0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>>  };
> Same here.

One reason is that these tables changed from non-zero to zero values between
Broadcom driver 4.174.64.19 and 5.10.56.46. As they might change again, I think
we should retain the full version.

Larry



^ permalink raw reply

* Re: [PATCH 3/3] nl80211/mac80211: Report signal average
From: Johannes Berg @ 2010-12-07 19:17 UTC (permalink / raw)
  To: John W. Linville
  Cc: Bruno Randolf, randy.dunlap, br1, peterz, blp, linux-wireless,
	linux-kernel, Lars_Ericsson, j, stefanr, kosaki.motohiro, akpm,
	kevin.granade
In-Reply-To: <20101207190631.GE2700@tuxdriver.com>

On Tue, 2010-12-07 at 14:06 -0500, John W. Linville wrote:
> On Thu, Dec 02, 2010 at 07:12:43PM +0900, Bruno Randolf wrote:
> > Extend nl80211 to report an exponential weighted moving average (EWMA) of the
> > signal value. Since the signal value usually fluctuates between different
> > packets, an average can be more useful than the value of the last packet.
> > 
> > This uses the recently added generic EWMA library function.
> > 
> > --
> > v2:	fix ABI breakage and change factor to be a power of 2.
> > 
> > Signed-off-by: Bruno Randolf <br1@einfach.org>
> 
> Jouni and Johannes, are you satisfied with this version?

Yeah, I think with the v2 of the lib improvement it should be fine.

johannes


^ permalink raw reply

* Re: [PATCH 3/3] nl80211/mac80211: Report signal average
From: John W. Linville @ 2010-12-07 19:06 UTC (permalink / raw)
  To: Bruno Randolf
  Cc: randy.dunlap, br1, peterz, blp, linux-wireless, linux-kernel,
	Lars_Ericsson, j, stefanr, kosaki.motohiro, akpm, kevin.granade,
	johannes
In-Reply-To: <20101202101242.22988.56087.stgit@localhost6.localdomain6>

On Thu, Dec 02, 2010 at 07:12:43PM +0900, Bruno Randolf wrote:
> Extend nl80211 to report an exponential weighted moving average (EWMA) of the
> signal value. Since the signal value usually fluctuates between different
> packets, an average can be more useful than the value of the last packet.
> 
> This uses the recently added generic EWMA library function.
> 
> --
> v2:	fix ABI breakage and change factor to be a power of 2.
> 
> Signed-off-by: Bruno Randolf <br1@einfach.org>

Jouni and Johannes, are you satisfied with this version?

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: [PATCH 0/4] ath: logging message conversion
From: John W. Linville @ 2010-12-07 19:05 UTC (permalink / raw)
  To: Joe Perches
  Cc: Luis R. Rodriguez, linux-wireless, ath5k-devel, ath9k-devel,
	Peter Stuge, Felix Fietkau, linux-kernel, netdev
In-Reply-To: <cover.1291333543.git.joe@perches.com>

On Thu, Dec 02, 2010 at 07:12:34PM -0800, Joe Perches wrote:
> ath_print is misleading as it's only used with CONFIG_ATH_DEBUG.
> 
> Add and use the more normal <subsystem>_printk and <subsystem>_<level>
> printk equivalents. (ath_printk and ath_<level>)
> 
> Fix various defects in the current uses of ath_print formats
> and arguments: Unnecessary casts, missing newlines, multiple
> prints, and 1 loop which can exceed array bounds.
> 
> Bundled and integrated the individual patches into a single patch series.
> 
> Joe Perches (4):
>   ath: Add and use ath_printk and ath_<level>
>   ath: Convert ath_print(.., ATH_DBG_FATAL to ath_err
>   ath: Convert ath_print to ath_dbg
>   ath: Fix ath_dbg access beyond array bound

Is the Atheros crew happy with this series?  They didn't seem to like
the original patches very much...

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

* [PATCH] ath5k: remove MODULE_VERSION
From: John W. Linville @ 2010-12-07 19:13 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville
In-Reply-To: <20101203041109.GE2988@makis.mantri>

Since this is updated manually and sporadically, it is fairly useless
anyway.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/ath/ath5k/base.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 380ff2f..15d6b6c 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -76,7 +76,6 @@ MODULE_AUTHOR("Nick Kossifidis");
 MODULE_DESCRIPTION("Support for 5xxx series of Atheros 802.11 wireless LAN cards.");
 MODULE_SUPPORTED_DEVICE("Atheros 5xxx WLAN cards");
 MODULE_LICENSE("Dual BSD/GPL");
-MODULE_VERSION("0.6.0 (EXPERIMENTAL)");
 
 static int ath5k_init(struct ieee80211_hw *hw);
 static int ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
-- 
1.7.3.2


^ permalink raw reply related

* Re: ath5k: Fixes for mesh operation
From: Javier Cardona @ 2010-12-07 19:12 UTC (permalink / raw)
  To: John W. Linville
  Cc: Steve Derosier, devel, linux-wireless, Jiri Slaby,
	Nick Kossifidis, Luis R. Rodriguez, Bob Copeland
In-Reply-To: <1291169919-3867-1-git-send-email-javier@cozybit.com>

John,

Are you waiting for acks from ath5k maintainers to apply this series?

https://patchwork.kernel.org/patch/369461/
https://patchwork.kernel.org/patch/369471/
https://patchwork.kernel.org/patch/369481/

Thanks!

Javier

On Tue, Nov 30, 2010 at 6:18 PM, Javier Cardona <javier@cozybit.com> wrote:
> After applying these fixes we were able to successfully bring up mesh
> interfaces and establish peer links with ath9k devices.
>
> One issue still looms with both athX drivers:  you have to issue a scan to get
> mesh beaconing started.  Keep that in mind if you try and test these fixes.
>
>



-- 
Javier Cardona
cozybit Inc.
http://www.cozybit.com

^ permalink raw reply

* Re: [PATCH 1/4] b43: N-PHY: update init tables
From: Hauke Mehrtens @ 2010-12-07 19:08 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: linux-wireless, John W. Linville, b43-dev
In-Reply-To: <1291711327-4690-1-git-send-email-zajec5@gmail.com>

On 12/07/2010 09:42 AM, Rafał Miłecki wrote:
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
>  drivers/net/wireless/b43/tables_nphy.c |  212 ++++++++++++++++----------------
>  1 files changed, 106 insertions(+), 106 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
> index d60db07..46f0a7a 100644
> --- a/drivers/net/wireless/b43/tables_nphy.c
> +++ b/drivers/net/wireless/b43/tables_nphy.c
> @@ -28,41 +28,41 @@
>  #include "phy_n.h"
>  
>  static const u8 b43_ntab_adjustpower0[] = {
> -	0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
> -	0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
> -	0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
> -	0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
> -	0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
> -	0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
> -	0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
> -	0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
> -	0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
> -	0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
> -	0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
> -	0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
> -	0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
> -	0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
> -	0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
> -	0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>  };
Why do you have this table when it only contains 0x00? If it is correct
there will be a better way to define such a table.

>  
>  static const u8 b43_ntab_adjustpower1[] = {
> -	0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
> -	0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03,
> -	0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05,
> -	0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07,
> -	0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09,
> -	0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B,
> -	0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D,
> -	0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F,
> -	0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11,
> -	0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13,
> -	0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15,
> -	0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17,
> -	0x18, 0x18, 0x18, 0x18, 0x19, 0x19, 0x19, 0x19,
> -	0x1A, 0x1A, 0x1A, 0x1A, 0x1B, 0x1B, 0x1B, 0x1B,
> -	0x1C, 0x1C, 0x1C, 0x1C, 0x1D, 0x1D, 0x1D, 0x1D,
> -	0x1E, 0x1E, 0x1E, 0x1E, 0x1F, 0x1F, 0x1F, 0x1F,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> +	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
>  };
Same here.

Hauke

^ permalink raw reply

* [PATCH] orinoco: initialise priv->hw before assigning the interrupt
From: David Kilroy @ 2010-12-07 18:50 UTC (permalink / raw)
  To: linux-wireless; +Cc: Matt_Domsch, David Kilroy

The interrupt handler takes a lock - but since commit bcad6e80f3f this
lock goes through an indirection specified in the hermes_t structure.
We must therefore initialise the structure before setting up the
interrupt handler.

Fix orinoco_cs and spectrum_cs

<https://bugzilla.kernel.org/show_bug.cgi?id=23932>

Bisected by: Matt Domsch <Matt_Domsch@dell.com>
Signed-off by: David Kilroy <kilroyd@googlemail.com>
---

This patch is based on wireless-testing.

Matt has tested the equivalent fix based on v2.6.35. There have been
other changes in this area due to pcmcia refactorring.

John, let me know if you'd like a separate version targetted at v2.6.37.

---
 drivers/net/wireless/orinoco/orinoco_cs.c  |   14 +++++++-------
 drivers/net/wireless/orinoco/spectrum_cs.c |   14 +++++++-------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
index 71b3d68..32954c4 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
@@ -151,20 +151,20 @@ orinoco_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	ret = pcmcia_request_irq(link, orinoco_interrupt);
-	if (ret)
-		goto failed;
-
-	/* We initialize the hermes structure before completing PCMCIA
-	 * configuration just in case the interrupt handler gets
-	 * called. */
 	mem = ioport_map(link->resource[0]->start,
 			resource_size(link->resource[0]));
 	if (!mem)
 		goto failed;
 
+	/* We initialize the hermes structure before completing PCMCIA
+	 * configuration just in case the interrupt handler gets
+	 * called. */
 	hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
 
+	ret = pcmcia_request_irq(link, orinoco_interrupt);
+	if (ret)
+		goto failed;
+
 	ret = pcmcia_enable_device(link);
 	if (ret)
 		goto failed;
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
index fb859a5..db34c28 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
@@ -214,21 +214,21 @@ spectrum_cs_config(struct pcmcia_device *link)
 		goto failed;
 	}
 
-	ret = pcmcia_request_irq(link, orinoco_interrupt);
-	if (ret)
-		goto failed;
-
-	/* We initialize the hermes structure before completing PCMCIA
-	 * configuration just in case the interrupt handler gets
-	 * called. */
 	mem = ioport_map(link->resource[0]->start,
 			resource_size(link->resource[0]));
 	if (!mem)
 		goto failed;
 
+	/* We initialize the hermes structure before completing PCMCIA
+	 * configuration just in case the interrupt handler gets
+	 * called. */
 	hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);
 	hw->eeprom_pda = true;
 
+	ret = pcmcia_request_irq(link, orinoco_interrupt);
+	if (ret)
+		goto failed;
+
 	ret = pcmcia_enable_device(link);
 	if (ret)
 		goto failed;
-- 
1.7.2.2


^ permalink raw reply related

* Crash when deleting lots of VIFS, wireless-testing.
From: Ben Greear @ 2010-12-07 18:47 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org

I think this started happening in the last few days.  I see all sorts
of corruptions, often in timers and lists.  I'm using ath9k on these
systems, but not sure that matters.  Might have something to do with
deleting interfaces while scanning.

I'll be digging more..but if anyone has ideas, they are welcome!

------------[ cut here ]------------
WARNING: at /home/greearb/git/linux.wireless-testing/lib/list_debug.c:30 __list_add+0x6c/0x7f()
Hardware name: PDSBM
list_add corruption. prev->next should be next (78a3c434), but was 6b6b6b6b. (prev=e27c39a4).
Modules linked in: aes_i586 aes_generic 8021q garp stp llc michael_mic fuse macvlan pktgen nfs lockd fscache nfs_acl auth_rpcgss sunrpc ipv6 uinput ar]
Pid: 9567, comm: kworker/u:2 Tainted: P            2.6.37-rc4-wl+ #57
Call Trace:
  [<78436fbd>] warn_slowpath_common+0x77/0x8c
  [<785a5bb1>] ? __list_add+0x6c/0x7f
  [<785a5bb1>] ? __list_add+0x6c/0x7f
  [<7843704e>] warn_slowpath_fmt+0x2e/0x30
  [<785a5bb1>] __list_add+0x6c/0x7f
  [<784402fb>] internal_add_timer+0x8e/0x92
  [<784407c5>] __mod_timer+0xed/0x101
  [<78440d36>] mod_timer+0x70/0x76
  [<f919dd6e>] ieee80211_sta_reset_conn_monitor+0x2e/0x3b [mac80211]
  [<f919a146>] ieee80211_offchannel_return+0xce/0x16e [mac80211]
  [<f919931e>] __ieee80211_scan_completed_finish+0x50/0x93 [mac80211]
  [<f919a066>] ieee80211_scan_work+0x3e5/0x3f7 [mac80211]
  [<78446f63>] ? process_one_work+0x13e/0x2bf
  [<78446fd4>] process_one_work+0x1af/0x2bf
  [<78446f63>] ? process_one_work+0x13e/0x2bf
  [<f9199c81>] ? ieee80211_scan_work+0x0/0x3f7 [mac80211]
  [<78448722>] worker_thread+0xf9/0x1bf
  [<78448629>] ? worker_thread+0x0/0x1bf
  [<7844b252>] kthread+0x62/0x67
  [<7844b1f0>] ? kthread+0x0/0x67
  [<784036c6>] kernel_thread_helper+0x6/0x1a
---[ end trace 4a96cef9c907ea7c ]---
start_sw_scan: running-other-vifs: 0  running-station-vifs: 69, associated-stations: 68 scanning current channel: 2437 MHz
BUG: unable to handle kernel paging request at df47b9a4
IP: [<78440843>] try_to_del_timer_sync+0x28/0x65
*pde = 01397067 *pte = 6747b160
Oops: 0002 [#1] SMP DEBUG_PAGEALLOC
last sysfs file: /sys/devices/pci0000:00/0000:00:1e.0/0000:08:01.0/class
Modules linked in: aes_i586 aes_generic 8021q garp stp llc michael_mic fuse macvlan pktgen nfs lockd fscache nfs_acl auth_rpcgss sunrpc ipv6 uinput ar]

Pid: 38, comm: kworker/u:1 Tainted: P        W   2.6.37-rc4-wl+ #57 PDSBM/PDSBM
EIP: 0060:[<78440843>] EFLAGS: 00010086 CPU: 0
EIP is at try_to_del_timer_sync+0x28/0x65
EAX: 78a3b980 EBX: f2c49944 ECX: df47b9a4 EDX: f4abea24
ESI: 00000000 EDI: 00000286 EBP: f39f7e98 ESP: f39f7e8c
  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
Process kworker/u:1 (pid: 38, ti=f39f6000 task=f3a00a70 task.ti=f39f6000)
Stack:
  00000282 f2c49960 f2c49944 f39f7ebc 78440c47 00000000 00000002 00000000
  78440bc0 f2c49540 f4214460 f4214c3c f39f7ed4 f919a35c f4214c34 f4214460
  e26c0240 00000064 f39f7f2c f9199fbb f39f7f68 f39f7f10 00000046 00000000
Call Trace:
  [<78440c47>] ? del_timer_sync+0x87/0x97
  [<78440bc0>] ? del_timer_sync+0x0/0x97
  [<f919a35c>] ? ieee80211_offchannel_stop_station+0x96/0xfa [mac80211]
  [<f9199fbb>] ? ieee80211_scan_work+0x33a/0x3f7 [mac80211]
  [<78446fd4>] ? process_one_work+0x1af/0x2bf
  [<78446f63>] ? process_one_work+0x13e/0x2bf
  [<f9199c81>] ? ieee80211_scan_work+0x0/0x3f7 [mac80211]
  [<78448722>] ? worker_thread+0xf9/0x1bf
  [<78448629>] ? worker_thread+0x0/0x1bf
  [<7844b252>] ? kthread+0x62/0x67
  [<7844b1f0>] ? kthread+0x0/0x67
  [<784036c6>] ? kernel_thread_helper+0x6/0x1a
Code: ff c9 c3 55 89 e5 56 83 ce ff 53 89 c3 83 ec 04 8d 55 f4 e8 68 fe ff ff 39 58 20 74 3c 8b 13 31 f6 85 d2 74 34 8b 4b 04 89 4a 04 <89> 11 8b 53 0
EIP: [<78440843>] try_to_del_timer_sync+0x28/0x65 SS:ESP 0068:f39f7e8c
CR2: 00000000df47b9a4

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply

* [PATCH] mac80211: Fix compilation error when mesh is disabled
From: Javier Cardona @ 2010-12-07 18:41 UTC (permalink / raw)
  To: John W. Linville
  Cc: Bruno Randolf, Larry Finger, Stephen Rothwell, Javier Cardona,
	Steve Derosier, devel, Johannes Berg, linux-wireless
In-Reply-To: <1291746592.3607.53.camel@jlt3.sipsolutions.net>

Wrap mesh sections inside CONFIG_MAC80211_MESH to fix compilation
problems reported by Stephen Rothwell, Larry Finger and Bruno Randolf.
---
 net/mac80211/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 2de6976..973fee9 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -245,10 +245,12 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
 				sdata->vif.bss_conf.enable_beacon =
 					!!sdata->u.ibss.presp;
 				break;
+#ifdef CONFIG_MAC80211_MESH
 			case NL80211_IFTYPE_MESH_POINT:
 				sdata->vif.bss_conf.enable_beacon =
 					!!sdata->u.mesh.mesh_id_len;
 				break;
+#endif
 			default:
 				/* not reached */
 				WARN_ON(1);
-- 
1.7.1


^ permalink raw reply related

* [PATCH] cfg80211/mac80211: fix-up mesh join/leave build breakage
From: John W. Linville @ 2010-12-07 18:38 UTC (permalink / raw)
  To: linux-wireless
  Cc: Javier Cardona, Bruno Randolf, Larry Finger, Stephen Rothwell,
	Steve Derosier, devel, John W. Linville
In-Reply-To: <1291746592.3607.53.camel@jlt3.sipsolutions.net>

From: Javier Cardona <javier@cozybit.com>

Fix-up build breakage from "cfg80211/mac80211: add mesh join/leave
commands" (commit 29cbe68c516a48a9a88b3226878570c6cbd83c02).

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 net/mac80211/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 2de6976..973fee9 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -245,10 +245,12 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
 				sdata->vif.bss_conf.enable_beacon =
 					!!sdata->u.ibss.presp;
 				break;
+#ifdef CONFIG_MAC80211_MESH
 			case NL80211_IFTYPE_MESH_POINT:
 				sdata->vif.bss_conf.enable_beacon =
 					!!sdata->u.mesh.mesh_id_len;
 				break;
+#endif
 			default:
 				/* not reached */
 				WARN_ON(1);
-- 
1.7.3.2


^ permalink raw reply related

* Re: [PATCH v4] cfg80211/mac80211: add mesh join/leave commands
From: Javier Cardona @ 2010-12-07 18:35 UTC (permalink / raw)
  To: Johannes Berg
  Cc: John W. Linville, Bruno Randolf, Larry Finger, Stephen Rothwell,
	Steve Derosier, devel, linux-wireless
In-Reply-To: <1291746592.3607.53.camel@jlt3.sipsolutions.net>

Johannes,

On Tue, Dec 7, 2010 at 10:29 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2010-12-07 at 10:22 -0800, Javier Cardona wrote:
>
>> v4: - wrap mesh sections inside CONFIG_MAC80211_MESH to
>>       fix compilation problems reported by Stephen Rothwell,
>>       Larry Finger and Bruno Randolf.
>
> Thanks, but since it was already applied we probably need a follow-on
> fixup patch?

Stephen did not apply it so I wasn't sure if John was going to revert
it as well.

I'll send a fixup patch and let them choose.

Cheers,

Javier

-- 
Javier Cardona
cozybit Inc.
http://www.cozybit.com

^ permalink raw reply

* Re: [PATCH v4] cfg80211/mac80211: add mesh join/leave commands
From: Johannes Berg @ 2010-12-07 18:29 UTC (permalink / raw)
  To: Javier Cardona
  Cc: John W. Linville, Bruno Randolf, Larry Finger, Stephen Rothwell,
	Steve Derosier, devel, linux-wireless
In-Reply-To: <1291746157-14628-1-git-send-email-javier@cozybit.com>

On Tue, 2010-12-07 at 10:22 -0800, Javier Cardona wrote:

> v4: - wrap mesh sections inside CONFIG_MAC80211_MESH to 
>       fix compilation problems reported by Stephen Rothwell,
>       Larry Finger and Bruno Randolf.

Thanks, but since it was already applied we probably need a follow-on
fixup patch?

johannes


^ permalink raw reply

* [PATCH v4] cfg80211/mac80211: add mesh join/leave commands
From: Javier Cardona @ 2010-12-07 18:22 UTC (permalink / raw)
  To: John W. Linville
  Cc: Bruno Randolf, Larry Finger, Stephen Rothwell, Johannes Berg,
	Javier Cardona, Steve Derosier, devel, Johannes Berg,
	linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

Instead of tying mesh activity to interface up,
add join and leave commands for mesh. Since we
must be backward compatible, let cfg80211 handle
joining a mesh if a mesh ID was pre-configured
when the device goes up.

Note that this therefore must modify mac80211 as
well since mac80211 needs to lose the logic to
start the mesh on interface up.

We now allow querying mesh parameters before the
mesh is connected, which simply returns defaults.
Setting them (internally renamed to "update") is
only allowed while connected. Specify them with
the new mesh join command instead where needed.

In mac80211, beaconing must now also follow the
mesh enabled/not enabled state, which is done
by testing the mesh ID.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
v2: - fix join on netdev up (pointed out by Javier)
    - only require mesh ID (pointed out by Javier)
    - more sanity checking around get/set_mesh_params
    - rename set_mesh_params to update_mesh_params,
      disallow calling it before connected to mesh
    - add some mesh interface type checks
    - introduce mesh_setup struct for static config
v3: - fold in Javier's beaconing patch
v4: - wrap mesh sections inside CONFIG_MAC80211_MESH to 
      fix compilation problems reported by Stephen Rothwell,
      Larry Finger and Bruno Randolf.

 include/linux/nl80211.h    |    8 +++
 include/net/cfg80211.h     |   38 +++++++++---
 net/mac80211/cfg.c         |   39 +++++++++---
 net/mac80211/ieee80211_i.h |   13 ----
 net/mac80211/iface.c       |   14 +----
 net/mac80211/main.c        |    5 +-
 net/mac80211/mesh.c        |   26 ++-------
 net/mac80211/mesh.h        |   25 --------
 net/wireless/Makefile      |    2 +-
 net/wireless/core.c        |   15 ++++-
 net/wireless/core.h        |   13 ++++
 net/wireless/mesh.c        |  140 ++++++++++++++++++++++++++++++++++++++++++++
 net/wireless/nl80211.c     |  137 ++++++++++++++++++++++++++++++++++++-------
 net/wireless/util.c        |    1 +
 14 files changed, 361 insertions(+), 115 deletions(-)
 create mode 100644 net/wireless/mesh.c

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 9e54145..410a06e 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -394,6 +394,11 @@
  *
  * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
  *
+ * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial
+ *	mesh config parameters may be given.
+ * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the
+ *	network is determined by the network interface.
+ *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
  */
@@ -500,6 +505,9 @@ enum nl80211_commands {
 
 	NL80211_CMD_FRAME_WAIT_CANCEL,
 
+	NL80211_CMD_JOIN_MESH,
+	NL80211_CMD_LEAVE_MESH,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 902895d..788c398 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -258,13 +258,9 @@ struct ieee80211_supported_band {
 
 /**
  * struct vif_params - describes virtual interface parameters
- * @mesh_id: mesh ID to use
- * @mesh_id_len: length of the mesh ID
  * @use_4addr: use 4-address frames
  */
 struct vif_params {
-       u8 *mesh_id;
-       int mesh_id_len;
        int use_4addr;
 };
 
@@ -615,6 +611,11 @@ struct bss_parameters {
 	int ap_isolate;
 };
 
+/*
+ * struct mesh_config - 802.11s mesh configuration
+ *
+ * These parameters can be changed while the mesh is active.
+ */
 struct mesh_config {
 	/* Timeouts in ms */
 	/* Mesh plink management parameters */
@@ -638,6 +639,18 @@ struct mesh_config {
 };
 
 /**
+ * struct mesh_setup - 802.11s mesh setup configuration
+ * @mesh_id: the mesh ID
+ * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes
+ *
+ * These parameters are fixed when the mesh is created.
+ */
+struct mesh_setup {
+	const u8 *mesh_id;
+	u8 mesh_id_len;
+};
+
+/**
  * struct ieee80211_txq_params - TX queue parameters
  * @queue: TX queue identifier (NL80211_TXQ_Q_*)
  * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled
@@ -1078,7 +1091,7 @@ struct cfg80211_pmksa {
  *
  * @get_mesh_params: Put the current mesh parameters into *params
  *
- * @set_mesh_params: Set mesh parameters.
+ * @update_mesh_params: Update mesh parameters on a running mesh.
  *	The mask is a bitfield which tells us which parameters to
  *	set, and which to leave alone.
  *
@@ -1229,9 +1242,14 @@ struct cfg80211_ops {
 	int	(*get_mesh_params)(struct wiphy *wiphy,
 				struct net_device *dev,
 				struct mesh_config *conf);
-	int	(*set_mesh_params)(struct wiphy *wiphy,
-				struct net_device *dev,
-				const struct mesh_config *nconf, u32 mask);
+	int	(*update_mesh_params)(struct wiphy *wiphy,
+				      struct net_device *dev, u32 mask,
+				      const struct mesh_config *nconf);
+	int	(*join_mesh)(struct wiphy *wiphy, struct net_device *dev,
+			     const struct mesh_config *conf,
+			     const struct mesh_setup *setup);
+	int	(*leave_mesh)(struct wiphy *wiphy, struct net_device *dev);
+
 	int	(*change_bss)(struct wiphy *wiphy, struct net_device *dev,
 			      struct bss_parameters *params);
 
@@ -1647,6 +1665,8 @@ struct cfg80211_cached_keys;
  * @bssid: (private) Used by the internal configuration code
  * @ssid: (private) Used by the internal configuration code
  * @ssid_len: (private) Used by the internal configuration code
+ * @mesh_id_len: (private) Used by the internal configuration code
+ * @mesh_id_up_len: (private) Used by the internal configuration code
  * @wext: (private) Used by the internal wireless extensions compat code
  * @use_4addr: indicates 4addr mode is used on this interface, must be
  *	set by driver (if supported) on add_interface BEFORE registering the
@@ -1676,7 +1696,7 @@ struct wireless_dev {
 
 	/* currently used for IBSS and SME - might be rearranged later */
 	u8 ssid[IEEE80211_MAX_SSID_LEN];
-	u8 ssid_len;
+	u8 ssid_len, mesh_id_len, mesh_id_up_len;
 	enum {
 		CFG80211_SME_IDLE,
 		CFG80211_SME_CONNECTING,
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index d34c7c3..68329d7 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -60,11 +60,6 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
 	if (ret)
 		return ret;
 
-	if (ieee80211_vif_is_mesh(&sdata->vif) && params->mesh_id_len)
-		ieee80211_sdata_set_mesh_id(sdata,
-					    params->mesh_id_len,
-					    params->mesh_id);
-
 	if (type == NL80211_IFTYPE_AP_VLAN &&
 	    params && params->use_4addr == 0)
 		rcu_assign_pointer(sdata->u.vlan.sta, NULL);
@@ -1003,9 +998,9 @@ static inline bool _chg_mesh_attr(enum nl80211_meshconf_params parm, u32 mask)
 	return (mask >> (parm-1)) & 0x1;
 }
 
-static int ieee80211_set_mesh_params(struct wiphy *wiphy,
-				struct net_device *dev,
-				const struct mesh_config *nconf, u32 mask)
+static int ieee80211_update_mesh_params(struct wiphy *wiphy,
+					struct net_device *dev, u32 mask,
+					const struct mesh_config *nconf)
 {
 	struct mesh_config *conf;
 	struct ieee80211_sub_if_data *sdata;
@@ -1056,6 +1051,30 @@ static int ieee80211_set_mesh_params(struct wiphy *wiphy,
 	return 0;
 }
 
+static int ieee80211_join_mesh(struct wiphy *wiphy, struct net_device *dev,
+			       const struct mesh_config *conf,
+			       const struct mesh_setup *setup)
+{
+	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+
+	memcpy(&sdata->u.mesh.mshcfg, conf, sizeof(struct mesh_config));
+	ifmsh->mesh_id_len = setup->mesh_id_len;
+	memcpy(ifmsh->mesh_id, setup->mesh_id, ifmsh->mesh_id_len);
+
+	ieee80211_start_mesh(sdata);
+
+	return 0;
+}
+
+static int ieee80211_leave_mesh(struct wiphy *wiphy, struct net_device *dev)
+{
+	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+
+	ieee80211_stop_mesh(sdata);
+
+	return 0;
+}
 #endif
 
 static int ieee80211_change_bss(struct wiphy *wiphy,
@@ -1760,8 +1779,10 @@ struct cfg80211_ops mac80211_config_ops = {
 	.change_mpath = ieee80211_change_mpath,
 	.get_mpath = ieee80211_get_mpath,
 	.dump_mpath = ieee80211_dump_mpath,
-	.set_mesh_params = ieee80211_set_mesh_params,
+	.update_mesh_params = ieee80211_update_mesh_params,
 	.get_mesh_params = ieee80211_get_mesh_params,
+	.join_mesh = ieee80211_join_mesh,
+	.leave_mesh = ieee80211_leave_mesh,
 #endif
 	.change_bss = ieee80211_change_bss,
 	.set_txq_params = ieee80211_set_txq_params,
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 66b0b52..e37f0d5 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -608,19 +608,6 @@ struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p)
 	return container_of(p, struct ieee80211_sub_if_data, vif);
 }
 
-static inline void
-ieee80211_sdata_set_mesh_id(struct ieee80211_sub_if_data *sdata,
-			    u8 mesh_id_len, u8 *mesh_id)
-{
-#ifdef CONFIG_MAC80211_MESH
-	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
-	ifmsh->mesh_id_len = mesh_id_len;
-	memcpy(ifmsh->mesh_id, mesh_id, mesh_id_len);
-#else
-	WARN_ON(1);
-#endif
-}
-
 enum sdata_queue_type {
 	IEEE80211_SDATA_QUEUE_TYPE_FRAME	= 0,
 	IEEE80211_SDATA_QUEUE_AGG_START		= 1,
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 96e27f1..f0f11bb 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -268,9 +268,7 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
 				goto err_stop;
 		}
 
-		if (ieee80211_vif_is_mesh(&sdata->vif)) {
-			ieee80211_start_mesh(sdata);
-		} else if (sdata->vif.type == NL80211_IFTYPE_AP) {
+		if (sdata->vif.type == NL80211_IFTYPE_AP) {
 			local->fif_pspoll++;
 			local->fif_probe_req++;
 
@@ -495,10 +493,6 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
 		ieee80211_adjust_monitor_flags(sdata, -1);
 		ieee80211_configure_filter(local);
 		break;
-	case NL80211_IFTYPE_MESH_POINT:
-		if (ieee80211_vif_is_mesh(&sdata->vif))
-			ieee80211_stop_mesh(sdata);
-		/* fall through */
 	default:
 		flush_work(&sdata->work);
 		/*
@@ -1188,12 +1182,6 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 	if (ret)
 		goto fail;
 
-	if (ieee80211_vif_is_mesh(&sdata->vif) &&
-	    params && params->mesh_id_len)
-		ieee80211_sdata_set_mesh_id(sdata,
-					    params->mesh_id_len,
-					    params->mesh_id);
-
 	mutex_lock(&local->iflist_mtx);
 	list_add_tail_rcu(&sdata->list, &local->interfaces);
 	mutex_unlock(&local->iflist_mtx);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 107a0cb..973fee9 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -245,9 +245,12 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
 				sdata->vif.bss_conf.enable_beacon =
 					!!sdata->u.ibss.presp;
 				break;
+#ifdef CONFIG_MAC80211_MESH
 			case NL80211_IFTYPE_MESH_POINT:
-				sdata->vif.bss_conf.enable_beacon = true;
+				sdata->vif.bss_conf.enable_beacon =
+					!!sdata->u.mesh.mesh_id_len;
 				break;
+#endif
 			default:
 				/* not reached */
 				WARN_ON(1);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 0d32348..63e1188 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -530,6 +530,11 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
 void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
 {
 	struct ieee80211_local *local = sdata->local;
+	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+
+	ifmsh->mesh_id_len = 0;
+	ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED);
+	sta_info_flush(local, NULL);
 
 	del_timer_sync(&sdata->u.mesh.housekeeping_timer);
 	del_timer_sync(&sdata->u.mesh.mesh_path_root_timer);
@@ -674,27 +679,6 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
 		    ieee80211_mesh_housekeeping_timer,
 		    (unsigned long) sdata);
 
-	ifmsh->mshcfg.dot11MeshRetryTimeout = MESH_RET_T;
-	ifmsh->mshcfg.dot11MeshConfirmTimeout = MESH_CONF_T;
-	ifmsh->mshcfg.dot11MeshHoldingTimeout = MESH_HOLD_T;
-	ifmsh->mshcfg.dot11MeshMaxRetries = MESH_MAX_RETR;
-	ifmsh->mshcfg.dot11MeshTTL = MESH_TTL;
-	ifmsh->mshcfg.element_ttl = MESH_DEFAULT_ELEMENT_TTL;
-	ifmsh->mshcfg.auto_open_plinks = true;
-	ifmsh->mshcfg.dot11MeshMaxPeerLinks =
-		MESH_MAX_ESTAB_PLINKS;
-	ifmsh->mshcfg.dot11MeshHWMPactivePathTimeout =
-		MESH_PATH_TIMEOUT;
-	ifmsh->mshcfg.dot11MeshHWMPpreqMinInterval =
-		MESH_PREQ_MIN_INT;
-	ifmsh->mshcfg.dot11MeshHWMPnetDiameterTraversalTime =
-		MESH_DIAM_TRAVERSAL_TIME;
-	ifmsh->mshcfg.dot11MeshHWMPmaxPREQretries =
-		MESH_MAX_PREQ_RETRIES;
-	ifmsh->mshcfg.path_refresh_time =
-		MESH_PATH_REFRESH_TIME;
-	ifmsh->mshcfg.min_discovery_timeout =
-		MESH_MIN_DISCOVERY_TIMEOUT;
 	ifmsh->accepting_plinks = true;
 	ifmsh->preq_id = 0;
 	ifmsh->sn = 0;
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 182942e..039d7fa 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -175,33 +175,10 @@ struct mesh_rmc {
  */
 #define MESH_CFG_CMP_LEN 	(IEEE80211_MESH_CONFIG_LEN - 2)
 
-/* Default values, timeouts in ms */
-#define MESH_TTL 		31
-#define MESH_MAX_RETR	 	3
-#define MESH_RET_T 		100
-#define MESH_CONF_T 		100
-#define MESH_HOLD_T 		100
-
-#define MESH_PATH_TIMEOUT	5000
-/* Minimum interval between two consecutive PREQs originated by the same
- * interface
- */
-#define MESH_PREQ_MIN_INT	10
-#define MESH_DIAM_TRAVERSAL_TIME 50
-/* A path will be refreshed if it is used PATH_REFRESH_TIME milliseconds before
- * timing out.  This way it will remain ACTIVE and no data frames will be
- * unnecesarily held in the pending queue.
- */
-#define MESH_PATH_REFRESH_TIME			1000
-#define MESH_MIN_DISCOVERY_TIMEOUT (2 * MESH_DIAM_TRAVERSAL_TIME)
 #define MESH_DEFAULT_BEACON_INTERVAL		1000 	/* in 1024 us units */
 
-#define MESH_MAX_PREQ_RETRIES 4
 #define MESH_PATH_EXPIRE (600 * HZ)
 
-/* Default maximum number of established plinks per interface */
-#define MESH_MAX_ESTAB_PLINKS	32
-
 /* Default maximum number of plinks per interface */
 #define MESH_MAX_PLINKS		256
 
@@ -216,8 +193,6 @@ struct mesh_rmc {
 #define PERR_RCODE_NO_ROUTE     12
 #define PERR_RCODE_DEST_UNREACH 13
 
-#define MESH_DEFAULT_ELEMENT_TTL 31
-
 /* Public interfaces */
 /* Various */
 int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc,
diff --git a/net/wireless/Makefile b/net/wireless/Makefile
index e77e508..55a28ab 100644
--- a/net/wireless/Makefile
+++ b/net/wireless/Makefile
@@ -10,7 +10,7 @@ obj-$(CONFIG_WEXT_SPY) += wext-spy.o
 obj-$(CONFIG_WEXT_PRIV) += wext-priv.o
 
 cfg80211-y += core.o sysfs.o radiotap.o util.o reg.o scan.o nl80211.o
-cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o
+cfg80211-y += mlme.o ibss.o sme.o chan.o ethtool.o mesh.o
 cfg80211-$(CONFIG_CFG80211_DEBUGFS) += debugfs.o
 cfg80211-$(CONFIG_CFG80211_WEXT) += wext-compat.o wext-sme.o
 cfg80211-$(CONFIG_CFG80211_INTERNAL_REGDB) += regdb.o
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 630bcf0..79772fc 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -332,6 +332,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
 	WARN_ON(ops->add_virtual_intf && !ops->del_virtual_intf);
 	WARN_ON(ops->add_station && !ops->del_station);
 	WARN_ON(ops->add_mpath && !ops->del_mpath);
+	WARN_ON(ops->join_mesh && !ops->leave_mesh);
 
 	alloc_size = sizeof(*rdev) + sizeof_priv;
 
@@ -752,6 +753,9 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
 			cfg80211_mlme_down(rdev, dev);
 			wdev_unlock(wdev);
 			break;
+		case NL80211_IFTYPE_MESH_POINT:
+			cfg80211_leave_mesh(rdev, dev);
+			break;
 		default:
 			break;
 		}
@@ -775,20 +779,27 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
 		}
 		cfg80211_lock_rdev(rdev);
 		mutex_lock(&rdev->devlist_mtx);
-#ifdef CONFIG_CFG80211_WEXT
 		wdev_lock(wdev);
 		switch (wdev->iftype) {
+#ifdef CONFIG_CFG80211_WEXT
 		case NL80211_IFTYPE_ADHOC:
 			cfg80211_ibss_wext_join(rdev, wdev);
 			break;
 		case NL80211_IFTYPE_STATION:
 			cfg80211_mgd_wext_connect(rdev, wdev);
 			break;
+#endif
+		case NL80211_IFTYPE_MESH_POINT:
+			/* backward compat code ... */
+			if (wdev->mesh_id_up_len)
+				__cfg80211_join_mesh(rdev, dev, wdev->ssid,
+						     wdev->mesh_id_up_len,
+						     &default_mesh_config);
+			break;
 		default:
 			break;
 		}
 		wdev_unlock(wdev);
-#endif
 		rdev->opencount++;
 		mutex_unlock(&rdev->devlist_mtx);
 		cfg80211_unlock_rdev(rdev);
diff --git a/net/wireless/core.h b/net/wireless/core.h
index ee80ad8..743203b 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -285,6 +285,19 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid);
 int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev,
 			    struct wireless_dev *wdev);
 
+/* mesh */
+extern const struct mesh_config default_mesh_config;
+int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
+			 struct net_device *dev,
+			 const u8 *mesh_id, u8 mesh_id_len,
+			 const struct mesh_config *conf);
+int cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
+		       struct net_device *dev,
+		       const u8 *mesh_id, u8 mesh_id_len,
+		       const struct mesh_config *conf);
+int cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
+			struct net_device *dev);
+
 /* MLME */
 int __cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
 			 struct net_device *dev,
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
new file mode 100644
index 0000000..e0b9747
--- /dev/null
+++ b/net/wireless/mesh.c
@@ -0,0 +1,140 @@
+#include <linux/ieee80211.h>
+#include <net/cfg80211.h>
+#include "core.h"
+
+/* Default values, timeouts in ms */
+#define MESH_TTL 		31
+#define MESH_DEFAULT_ELEMENT_TTL 31
+#define MESH_MAX_RETR	 	3
+#define MESH_RET_T 		100
+#define MESH_CONF_T 		100
+#define MESH_HOLD_T 		100
+
+#define MESH_PATH_TIMEOUT	5000
+
+/*
+ * Minimum interval between two consecutive PREQs originated by the same
+ * interface
+ */
+#define MESH_PREQ_MIN_INT	10
+#define MESH_DIAM_TRAVERSAL_TIME 50
+
+/*
+ * A path will be refreshed if it is used PATH_REFRESH_TIME milliseconds
+ * before timing out.  This way it will remain ACTIVE and no data frames
+ * will be unnecessarily held in the pending queue.
+ */
+#define MESH_PATH_REFRESH_TIME			1000
+#define MESH_MIN_DISCOVERY_TIMEOUT (2 * MESH_DIAM_TRAVERSAL_TIME)
+
+/* Default maximum number of established plinks per interface */
+#define MESH_MAX_ESTAB_PLINKS	32
+
+#define MESH_MAX_PREQ_RETRIES	4
+
+
+const struct mesh_config default_mesh_config = {
+	.dot11MeshRetryTimeout = MESH_RET_T,
+	.dot11MeshConfirmTimeout = MESH_CONF_T,
+	.dot11MeshHoldingTimeout = MESH_HOLD_T,
+	.dot11MeshMaxRetries = MESH_MAX_RETR,
+	.dot11MeshTTL = MESH_TTL,
+	.element_ttl = MESH_DEFAULT_ELEMENT_TTL,
+	.auto_open_plinks = true,
+	.dot11MeshMaxPeerLinks = MESH_MAX_ESTAB_PLINKS,
+	.dot11MeshHWMPactivePathTimeout = MESH_PATH_TIMEOUT,
+	.dot11MeshHWMPpreqMinInterval = MESH_PREQ_MIN_INT,
+	.dot11MeshHWMPnetDiameterTraversalTime = MESH_DIAM_TRAVERSAL_TIME,
+	.dot11MeshHWMPmaxPREQretries = MESH_MAX_PREQ_RETRIES,
+	.path_refresh_time = MESH_PATH_REFRESH_TIME,
+	.min_discovery_timeout = MESH_MIN_DISCOVERY_TIMEOUT,
+};
+
+
+int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
+			 struct net_device *dev,
+			 const u8 *mesh_id, u8 mesh_id_len,
+			 const struct mesh_config *conf)
+{
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
+	struct mesh_setup setup = {
+		.mesh_id = mesh_id,
+		.mesh_id_len = mesh_id_len,
+	};
+	int err;
+
+	BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN != IEEE80211_MAX_MESH_ID_LEN);
+
+	ASSERT_WDEV_LOCK(wdev);
+
+	if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT)
+		return -EOPNOTSUPP;
+
+	if (wdev->mesh_id_len)
+		return -EALREADY;
+
+	if (!mesh_id_len)
+		return -EINVAL;
+
+	if (!rdev->ops->join_mesh)
+		return -EOPNOTSUPP;
+
+	err = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, &setup);
+	if (!err) {
+		memcpy(wdev->ssid, mesh_id, mesh_id_len);
+		wdev->mesh_id_len = mesh_id_len;
+	}
+
+	return err;
+}
+
+int cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
+		       struct net_device *dev,
+		       const u8 *mesh_id, u8 mesh_id_len,
+		       const struct mesh_config *conf)
+{
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
+	int err;
+
+	wdev_lock(wdev);
+	err = __cfg80211_join_mesh(rdev, dev, mesh_id, mesh_id_len, conf);
+	wdev_unlock(wdev);
+
+	return err;
+}
+
+static int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
+				 struct net_device *dev)
+{
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
+	int err;
+
+	ASSERT_WDEV_LOCK(wdev);
+
+	if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_MESH_POINT)
+		return -EOPNOTSUPP;
+
+	if (!rdev->ops->leave_mesh)
+		return -EOPNOTSUPP;
+
+	if (!wdev->mesh_id_len)
+		return -ENOTCONN;
+
+	err = rdev->ops->leave_mesh(&rdev->wiphy, dev);
+	if (!err)
+		wdev->mesh_id_len = 0;
+	return err;
+}
+
+int cfg80211_leave_mesh(struct cfg80211_registered_device *rdev,
+			struct net_device *dev)
+{
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
+	int err;
+
+	wdev_lock(wdev);
+	err = __cfg80211_leave_mesh(rdev, dev);
+	wdev_unlock(wdev);
+
+	return err;
+}
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c8d4d53..56508d4 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -661,13 +661,14 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
 	CMD(add_beacon, NEW_BEACON);
 	CMD(add_station, NEW_STATION);
 	CMD(add_mpath, NEW_MPATH);
-	CMD(set_mesh_params, SET_MESH_PARAMS);
+	CMD(update_mesh_params, SET_MESH_PARAMS);
 	CMD(change_bss, SET_BSS);
 	CMD(auth, AUTHENTICATE);
 	CMD(assoc, ASSOCIATE);
 	CMD(deauth, DEAUTHENTICATE);
 	CMD(disassoc, DISASSOCIATE);
 	CMD(join_ibss, JOIN_IBSS);
+	CMD(join_mesh, JOIN_MESH);
 	CMD(set_pmksa, SET_PMKSA);
 	CMD(del_pmksa, DEL_PMKSA);
 	CMD(flush_pmksa, FLUSH_PMKSA);
@@ -1324,11 +1325,21 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
 	}
 
 	if (info->attrs[NL80211_ATTR_MESH_ID]) {
+		struct wireless_dev *wdev = dev->ieee80211_ptr;
+
 		if (ntype != NL80211_IFTYPE_MESH_POINT)
 			return -EINVAL;
-		params.mesh_id = nla_data(info->attrs[NL80211_ATTR_MESH_ID]);
-		params.mesh_id_len = nla_len(info->attrs[NL80211_ATTR_MESH_ID]);
-		change = true;
+		if (netif_running(dev))
+			return -EBUSY;
+
+		wdev_lock(wdev);
+		BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN !=
+			     IEEE80211_MAX_MESH_ID_LEN);
+		wdev->mesh_id_up_len =
+			nla_len(info->attrs[NL80211_ATTR_MESH_ID]);
+		memcpy(wdev->ssid, nla_data(info->attrs[NL80211_ATTR_MESH_ID]),
+		       wdev->mesh_id_up_len);
+		wdev_unlock(wdev);
 	}
 
 	if (info->attrs[NL80211_ATTR_4ADDR]) {
@@ -1388,12 +1399,6 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
 	    !(rdev->wiphy.interface_modes & (1 << type)))
 		return -EOPNOTSUPP;
 
-	if (type == NL80211_IFTYPE_MESH_POINT &&
-	    info->attrs[NL80211_ATTR_MESH_ID]) {
-		params.mesh_id = nla_data(info->attrs[NL80211_ATTR_MESH_ID]);
-		params.mesh_id_len = nla_len(info->attrs[NL80211_ATTR_MESH_ID]);
-	}
-
 	if (info->attrs[NL80211_ATTR_4ADDR]) {
 		params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]);
 		err = nl80211_valid_4addr(rdev, NULL, params.use_4addr, type);
@@ -1410,6 +1415,20 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
 	if (IS_ERR(dev))
 		return PTR_ERR(dev);
 
+	if (type == NL80211_IFTYPE_MESH_POINT &&
+	    info->attrs[NL80211_ATTR_MESH_ID]) {
+		struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+		wdev_lock(wdev);
+		BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN !=
+			     IEEE80211_MAX_MESH_ID_LEN);
+		wdev->mesh_id_up_len =
+			nla_len(info->attrs[NL80211_ATTR_MESH_ID]);
+		memcpy(wdev->ssid, nla_data(info->attrs[NL80211_ATTR_MESH_ID]),
+		       wdev->mesh_id_up_len);
+		wdev_unlock(wdev);
+	}
+
 	return 0;
 }
 
@@ -2543,21 +2562,32 @@ static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
 }
 
 static int nl80211_get_mesh_params(struct sk_buff *skb,
-	struct genl_info *info)
+				   struct genl_info *info)
 {
 	struct cfg80211_registered_device *rdev = info->user_ptr[0];
-	struct mesh_config cur_params;
-	int err;
 	struct net_device *dev = info->user_ptr[1];
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
+	struct mesh_config cur_params;
+	int err = 0;
 	void *hdr;
 	struct nlattr *pinfoattr;
 	struct sk_buff *msg;
 
+	if (wdev->iftype != NL80211_IFTYPE_MESH_POINT)
+		return -EOPNOTSUPP;
+
 	if (!rdev->ops->get_mesh_params)
 		return -EOPNOTSUPP;
 
-	/* Get the mesh params */
-	err = rdev->ops->get_mesh_params(&rdev->wiphy, dev, &cur_params);
+	wdev_lock(wdev);
+	/* If not connected, get default parameters */
+	if (!wdev->mesh_id_len)
+		memcpy(&cur_params, &default_mesh_config, sizeof(cur_params));
+	else
+		err = rdev->ops->get_mesh_params(&rdev->wiphy, dev,
+						 &cur_params);
+	wdev_unlock(wdev);
+
 	if (err)
 		return err;
 
@@ -2705,23 +2735,37 @@ do {\
 #undef FILL_IN_MESH_PARAM_IF_SET
 }
 
-static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
+static int nl80211_update_mesh_params(struct sk_buff *skb,
+				      struct genl_info *info)
 {
 	struct cfg80211_registered_device *rdev = info->user_ptr[0];
 	struct net_device *dev = info->user_ptr[1];
+	struct wireless_dev *wdev = dev->ieee80211_ptr;
 	struct mesh_config cfg;
 	u32 mask;
 	int err;
 
-	if (!rdev->ops->set_mesh_params)
+	if (wdev->iftype != NL80211_IFTYPE_MESH_POINT)
+		return -EOPNOTSUPP;
+
+	if (!rdev->ops->update_mesh_params)
 		return -EOPNOTSUPP;
 
 	err = nl80211_parse_mesh_params(info, &cfg, &mask);
 	if (err)
 		return err;
 
-	/* Apply changes */
-	return rdev->ops->set_mesh_params(&rdev->wiphy, dev, &cfg, mask);
+	wdev_lock(wdev);
+	if (!wdev->mesh_id_len)
+		err = -ENOLINK;
+
+	if (!err)
+		err = rdev->ops->update_mesh_params(&rdev->wiphy, dev,
+						    mask, &cfg);
+
+	wdev_unlock(wdev);
+
+	return err;
 }
 
 static int nl80211_get_reg(struct sk_buff *skb, struct genl_info *info)
@@ -4505,6 +4549,41 @@ out:
 	return err;
 }
 
+static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev = info->user_ptr[0];
+	struct net_device *dev = info->user_ptr[1];
+	struct mesh_config cfg;
+	int err;
+
+	/* start with default */
+	memcpy(&cfg, &default_mesh_config, sizeof(cfg));
+
+	if (info->attrs[NL80211_ATTR_MESH_PARAMS]) {
+		/* and parse parameters if given */
+		err = nl80211_parse_mesh_params(info, &cfg, NULL);
+		if (err)
+			return err;
+	}
+
+	if (!info->attrs[NL80211_ATTR_MESH_ID] ||
+	    !nla_len(info->attrs[NL80211_ATTR_MESH_ID]))
+		return -EINVAL;
+
+	return cfg80211_join_mesh(rdev, dev,
+				  nla_data(info->attrs[NL80211_ATTR_MESH_ID]),
+				  nla_len(info->attrs[NL80211_ATTR_MESH_ID]),
+				  &cfg);
+}
+
+static int nl80211_leave_mesh(struct sk_buff *skb, struct genl_info *info)
+{
+	struct cfg80211_registered_device *rdev = info->user_ptr[0];
+	struct net_device *dev = info->user_ptr[1];
+
+	return cfg80211_leave_mesh(rdev, dev);
+}
+
 #define NL80211_FLAG_NEED_WIPHY		0x01
 #define NL80211_FLAG_NEED_NETDEV	0x02
 #define NL80211_FLAG_NEED_RTNL		0x04
@@ -4769,10 +4848,10 @@ static struct genl_ops nl80211_ops[] = {
 	},
 	{
 		.cmd = NL80211_CMD_SET_MESH_PARAMS,
-		.doit = nl80211_set_mesh_params,
+		.doit = nl80211_update_mesh_params,
 		.policy = nl80211_policy,
 		.flags = GENL_ADMIN_PERM,
-		.internal_flags = NL80211_FLAG_NEED_NETDEV |
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
 				  NL80211_FLAG_NEED_RTNL,
 	},
 	{
@@ -4987,6 +5066,22 @@ static struct genl_ops nl80211_ops[] = {
 		.internal_flags = NL80211_FLAG_NEED_NETDEV |
 				  NL80211_FLAG_NEED_RTNL,
 	},
+	{
+		.cmd = NL80211_CMD_JOIN_MESH,
+		.doit = nl80211_join_mesh,
+		.policy = nl80211_policy,
+		.flags = GENL_ADMIN_PERM,
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
+				  NL80211_FLAG_NEED_RTNL,
+	},
+	{
+		.cmd = NL80211_CMD_LEAVE_MESH,
+		.doit = nl80211_leave_mesh,
+		.policy = nl80211_policy,
+		.flags = GENL_ADMIN_PERM,
+		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
+				  NL80211_FLAG_NEED_RTNL,
+	},
 };
 
 static struct genl_multicast_group nl80211_mlme_mcgrp = {
diff --git a/net/wireless/util.c b/net/wireless/util.c
index fee020b..4de624c 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -792,6 +792,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
 
 	if (ntype != otype) {
 		dev->ieee80211_ptr->use_4addr = false;
+		dev->ieee80211_ptr->mesh_id_up_len = 0;
 
 		switch (otype) {
 		case NL80211_IFTYPE_ADHOC:
-- 
1.7.1


^ permalink raw reply related

* Re: [linux-next] next-20101207: Better now, but modinfo ath5k
From: Sedat Dilek @ 2010-12-07 18:13 UTC (permalink / raw)
  To: John W. Linville
  Cc: wireless, LKML, Stephen Rothwell, Nick Kossifidis, Bruno Randolf,
	ath5k-devel
In-Reply-To: <20101207155924.GC2700@tuxdriver.com>

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

On Tue, Dec 7, 2010 at 4:59 PM, John W. Linville <linville@tuxdriver.com> wrote:
> On Tue, Dec 07, 2010 at 04:57:08PM +0100, Sedat Dilek wrote:
>> On Tue, Dec 7, 2010 at 3:26 PM, John W. Linville <linville@tuxdriver.com> wrote:
>> > On Tue, Dec 07, 2010 at 12:24:14PM +0100, Sedat Dilek wrote:
>> >
>> >> I have already reported on linux-wireless (short: l-w) ML that after
>> >> especially the merge of "AHB Bus support" patchset (see [2]) my ath5k
>> >> was not working as expected in daily use (also modinfo).
>> >>
>> >> I am not sure if it is the driver but reverting the 9 commits in my
>> >> local linux-next GIT seemed to "stabilize" a bit the Internet
>> >> connection.
>> >> The patchset from Nick (see below) definitely helped to stabilize ath5k.
>> >
>> > I imagine that these are the "9 commits" you mean:
>> >
>> >> git rev-list c30ae13..4cebb34
>> > 4cebb34caa5122216a1e2451eae9e0fc47ec2589
>> > a0b907ee2a71052fefdf6151764095f3f97b3275
>> > c31b5c9c806b1fbdc9e98885d897664a0d482989
>> > e7aecd327d80b2f156b54769013aaccb2a20645a
>> > 8efa5d7d6ad307ae2d220def37ca89594062c40d
>> > 4aa5d783c9e1c72e4950ff34f388077ccecac74a
>> > e5b046d86fac609f636d127a38de94a175c7e83b
>> > 132b1c3ee38ea6fa0501004fd0f19acb554e5a44
>> > aeae4ac9090462ea38387dcdbac4f01b944af6a4
>> >
>> > Most of those look fairly harmless so long as you don't define
>> > CONFIG_ATHEROS_AR231X.  Just to narrow things down...if you only revert
>> > the first 8 (i.e. leave aeae4ac alone), do you still have problems?
>> > Or does it still "stabilize"?
>> >
>> > That patch converts the driver to the generic DMA API.  It seems
>> > OK at first glance, but I suspect it is the only one likely to be
>> > effecting your situation.
>> >
>> > John
>> > --
>> > John W. Linville                Someday the world will need a hero, and you
>> > linville@tuxdriver.com                  might be all we have.  Be ready.
>> >
>>
>> Before jumping to another problem, I had a quick look into the
>> appropriate Kconfig file, as you say I have not CONFIG_ATHEROS_AR231X
>> set and that's why AHB support is not selected/built, instead
>>
>>   CC [M]  drivers/net/wireless/ath/ath5k/pci.o
>>
>> is built.
>>
>> Unfortunately, I can't cleanly revert. Sorry, I can't help.
>
> I don't quite understand -- you said you were reverting them before,
> but now I ask you to revert one _less_ patch (i.e. the last one to
> be reverted anyway) and you can't do it?
>
> John
> --
> John W. Linville                Someday the world will need a hero, and you
> linville@tuxdriver.com                  might be all we have.  Be ready.
>

I tested with a linux-next (next-20101206) with revert-at5k-patches.
Unfortunately, Nick's patchset is needed for a stable WLAN connection,
several ReAssoc's etc.
So, I can't give a comment to the effects of the AHB patchset on my AR5212.

But... I have found the culprit patch which makes modinfo no more list
the aliases/pci-id (see [1]):

commit e5b046d86fac609f636d127a38de94a175c7e83b
"ath5k: Move PCI bus functions to separate file."

- Sedat -

[1] http://git.kernel.org/?p=linux/kernel/git/linville/wireless-next-2.6.git;a=commit;h=e5b046d86fac609f636d127a38de94a175c7e83b

$ ~/src/linux-2.6/linux-2.6.37-rc4/debian/build/source_i386_none

$ cat .pc/applied-patches
revert-ath5k-patches/0001-Revert-ath5k-Fix-reset-and-interrupts-for-AHB-type-o.patch
revert-ath5k-patches/0002-Revert-ath5k-Add-AHB-bus-support.patch
revert-ath5k-patches/0003-Revert-ath5k-Add-initial-registers-values-for-radio-.patch
revert-ath5k-patches/0004-Revert-ath5k-Add-a-function-to-read-chipset-s-MAC-re.patch
revert-ath5k-patches/0005-Revert-ath5k-Check-if-pci-pdev-struct-is-initialized.patch
revert-ath5k-patches/0006-Revert-ath5k-Use-generic-eeprom-read-from-common-ath.patch
revert-ath5k-patches/0007-Revert-ath5k-Move-PCI-bus-functions-to-separate-file.patch

# modinfo ath5k
filename:
/lib/modules/2.6.37-rc4-686/kernel/drivers/net/wireless/ath/ath5k/ath5k.ko
version:        0.6.0 (EXPERIMENTAL)
license:        Dual BSD/GPL
description:    Support for 5xxx series of Atheros 802.11 wireless LAN
cards.
author:         Nick Kossifidis
author:         Jiri Slaby
srcversion:     666105BAEE881F2C2F10CE6
alias:          pci:v0000168Cd0000001Dsv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000001Csv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000001Bsv*sd*bc*sc*i*
alias:          pci:v0000168Cd0000001Asv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000019sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000018sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000017sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000016sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000015sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000014sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00001014sv*sd*bc*sc*i*
alias:          pci:v000010B7d00000013sv*sd*bc*sc*i*
alias:          pci:v0000A727d00000013sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000013sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000012sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000011sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000007sv*sd*bc*sc*i*
alias:          pci:v0000168Cd00000207sv*sd*bc*sc*i*
depends:        mac80211,cfg80211,ath
vermagic:       2.6.37-rc4-686 SMP mod_unload modversions 686
parm:           debug:uint
parm:           nohwcrypt:Disable hardware encryption. (bool)
parm:           all_channels:Expose all channels the device can use. (bool)

[-- Attachment #2: 0007-Revert-ath5k-Move-PCI-bus-functions-to-separate-file.patch --]
[-- Type: text/x-diff, Size: 18973 bytes --]

From e2f79441224cf9cd1f9e399ca774040f1ece72fa Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Fri, 3 Dec 2010 23:19:54 +0100
Subject: [PATCH 7/9] Revert "ath5k: Move PCI bus functions to separate file."

This reverts commit e5b046d86fac609f636d127a38de94a175c7e83b.
---
 drivers/net/wireless/ath/ath5k/Makefile |    1 -
 drivers/net/wireless/ath/ath5k/ath5k.h  |    3 -
 drivers/net/wireless/ath/ath5k/base.c   |  267 +++++++++++++++++++++++++++++-
 drivers/net/wireless/ath/ath5k/pci.c    |  284 -------------------------------
 4 files changed, 266 insertions(+), 289 deletions(-)
 delete mode 100644 drivers/net/wireless/ath/ath5k/pci.c

diff --git a/drivers/net/wireless/ath/ath5k/Makefile b/drivers/net/wireless/ath/ath5k/Makefile
index dae881c..2242a14 100644
--- a/drivers/net/wireless/ath/ath5k/Makefile
+++ b/drivers/net/wireless/ath/ath5k/Makefile
@@ -15,5 +15,4 @@ ath5k-y				+= rfkill.o
 ath5k-y				+= ani.o
 ath5k-y				+= sysfs.o
 ath5k-$(CONFIG_ATH5K_DEBUG)	+= debug.o
-ath5k-y				+= pci.o
 obj-$(CONFIG_ATH5K)		+= ath5k.o
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index ee3c0af..a74f448 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1145,7 +1145,6 @@ struct ath5k_hw {
 /*
  * Prototypes
  */
-extern const struct ieee80211_ops ath5k_hw_ops;
 
 /* Initialization and detach functions */
 int ath5k_init_softc(struct ath5k_softc *sc, const struct ath_bus_ops *bus_ops);
@@ -1156,8 +1155,6 @@ void ath5k_hw_deinit(struct ath5k_hw *ah);
 int ath5k_sysfs_register(struct ath5k_softc *sc);
 void ath5k_sysfs_unregister(struct ath5k_softc *sc);
 
-/*Chip id helper function */
-const char *ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val);
 
 /* LED functions */
 int ath5k_init_leds(struct ath5k_softc *sc);
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 9fcc4e1..b11ea3d 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -47,6 +47,8 @@
 #include <linux/io.h>
 #include <linux/netdevice.h>
 #include <linux/cache.h>
+#include <linux/pci.h>
+#include <linux/pci-aspm.h>
 #include <linux/ethtool.h>
 #include <linux/uaccess.h>
 #include <linux/slab.h>
@@ -85,6 +87,30 @@ static int ath5k_beacon_update(struct ieee80211_hw *hw,
 		struct ieee80211_vif *vif);
 static void ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf);
 
+/* Known PCI ids */
+static DEFINE_PCI_DEVICE_TABLE(ath5k_pci_id_table) = {
+	{ PCI_VDEVICE(ATHEROS, 0x0207) }, /* 5210 early */
+	{ PCI_VDEVICE(ATHEROS, 0x0007) }, /* 5210 */
+	{ PCI_VDEVICE(ATHEROS, 0x0011) }, /* 5311 - this is on AHB bus !*/
+	{ PCI_VDEVICE(ATHEROS, 0x0012) }, /* 5211 */
+	{ PCI_VDEVICE(ATHEROS, 0x0013) }, /* 5212 */
+	{ PCI_VDEVICE(3COM_2,  0x0013) }, /* 3com 5212 */
+	{ PCI_VDEVICE(3COM,    0x0013) }, /* 3com 3CRDAG675 5212 */
+	{ PCI_VDEVICE(ATHEROS, 0x1014) }, /* IBM minipci 5212 */
+	{ PCI_VDEVICE(ATHEROS, 0x0014) }, /* 5212 combatible */
+	{ PCI_VDEVICE(ATHEROS, 0x0015) }, /* 5212 combatible */
+	{ PCI_VDEVICE(ATHEROS, 0x0016) }, /* 5212 combatible */
+	{ PCI_VDEVICE(ATHEROS, 0x0017) }, /* 5212 combatible */
+	{ PCI_VDEVICE(ATHEROS, 0x0018) }, /* 5212 combatible */
+	{ PCI_VDEVICE(ATHEROS, 0x0019) }, /* 5212 combatible */
+	{ PCI_VDEVICE(ATHEROS, 0x001a) }, /* 2413 Griffin-lite */
+	{ PCI_VDEVICE(ATHEROS, 0x001b) }, /* 5413 Eagle */
+	{ PCI_VDEVICE(ATHEROS, 0x001c) }, /* PCI-E cards */
+	{ PCI_VDEVICE(ATHEROS, 0x001d) }, /* 2417 Nala */
+	{ 0 }
+};
+MODULE_DEVICE_TABLE(pci, ath5k_pci_id_table);
+
 /* Known SREVs */
 static const struct ath5k_srev_name srev_names[] = {
 	{ "5210",	AR5K_VERSION_MAC,	AR5K_SREV_AR5210 },
@@ -167,6 +193,32 @@ static const struct ieee80211_rate ath5k_rates[] = {
 	/* XR missing */
 };
 
+/* return bus cachesize in 4B word units */
+static void ath5k_pci_read_cachesize(struct ath_common *common, int *csz)
+{
+	struct ath5k_softc *sc = (struct ath5k_softc *) common->priv;
+	u8 u8tmp;
+
+	pci_read_config_byte(sc->pdev, PCI_CACHE_LINE_SIZE, &u8tmp);
+	*csz = (int)u8tmp;
+
+	/*
+	 * This check was put in to avoid "unplesant" consequences if
+	 * the bootrom has not fully initialized all PCI devices.
+	 * Sometimes the cache line size register is not set
+	 */
+
+	if (*csz == 0)
+		*csz = L1_CACHE_BYTES >> 2;   /* Use the default size */
+}
+
+/* Common ath_bus_opts structure */
+static const struct ath_bus_ops ath_pci_bus_ops = {
+	.ath_bus_type = ATH_PCI,
+	.read_cachesize = ath5k_pci_read_cachesize,
+};
+
+
 static inline void ath5k_txbuf_free_skb(struct ath5k_softc *sc,
 				struct ath5k_buf *bf)
 {
@@ -209,7 +261,7 @@ static inline u64 ath5k_extend_tsf(struct ath5k_hw *ah, u32 rstamp)
 	return (tsf & ~0x7fff) | rstamp;
 }
 
-const char *
+static const char *
 ath5k_chip_name(enum ath5k_srev_type type, u_int16_t val)
 {
 	const char *name = "xxxxx";
@@ -3575,3 +3627,216 @@ const struct ieee80211_ops ath5k_hw_ops = {
 	.set_antenna	= ath5k_set_antenna,
 	.get_antenna	= ath5k_get_antenna,
 };
+
+/********************\
+* PCI Initialization *
+\********************/
+
+static int __devinit
+ath5k_pci_probe(struct pci_dev *pdev,
+		const struct pci_device_id *id)
+{
+	void __iomem *mem;
+	struct ath5k_softc *sc;
+	struct ieee80211_hw *hw;
+	int ret;
+	u8 csz;
+
+	/*
+	 * L0s needs to be disabled on all ath5k cards.
+	 *
+	 * For distributions shipping with CONFIG_PCIEASPM (this will be enabled
+	 * by default in the future in 2.6.36) this will also mean both L1 and
+	 * L0s will be disabled when a pre 1.1 PCIe device is detected. We do
+	 * know L1 works correctly even for all ath5k pre 1.1 PCIe devices
+	 * though but cannot currently undue the effect of a blacklist, for
+	 * details you can read pcie_aspm_sanity_check() and see how it adjusts
+	 * the device link capability.
+	 *
+	 * It may be possible in the future to implement some PCI API to allow
+	 * drivers to override blacklists for pre 1.1 PCIe but for now it is
+	 * best to accept that both L0s and L1 will be disabled completely for
+	 * distributions shipping with CONFIG_PCIEASPM rather than having this
+	 * issue present. Motivation for adding this new API will be to help
+	 * with power consumption for some of these devices.
+	 */
+	pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S);
+
+	ret = pci_enable_device(pdev);
+	if (ret) {
+		dev_err(&pdev->dev, "can't enable device\n");
+		goto err;
+	}
+
+	/* XXX 32-bit addressing only */
+	ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+	if (ret) {
+		dev_err(&pdev->dev, "32-bit DMA not available\n");
+		goto err_dis;
+	}
+
+	/*
+	 * Cache line size is used to size and align various
+	 * structures used to communicate with the hardware.
+	 */
+	pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &csz);
+	if (csz == 0) {
+		/*
+		 * Linux 2.4.18 (at least) writes the cache line size
+		 * register as a 16-bit wide register which is wrong.
+		 * We must have this setup properly for rx buffer
+		 * DMA to work so force a reasonable value here if it
+		 * comes up zero.
+		 */
+		csz = L1_CACHE_BYTES >> 2;
+		pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz);
+	}
+	/*
+	 * The default setting of latency timer yields poor results,
+	 * set it to the value used by other systems.  It may be worth
+	 * tweaking this setting more.
+	 */
+	pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xa8);
+
+	/* Enable bus mastering */
+	pci_set_master(pdev);
+
+	/*
+	 * Disable the RETRY_TIMEOUT register (0x41) to keep
+	 * PCI Tx retries from interfering with C3 CPU state.
+	 */
+	pci_write_config_byte(pdev, 0x41, 0);
+
+	ret = pci_request_region(pdev, 0, "ath5k");
+	if (ret) {
+		dev_err(&pdev->dev, "cannot reserve PCI memory region\n");
+		goto err_dis;
+	}
+
+	mem = pci_iomap(pdev, 0, 0);
+	if (!mem) {
+		dev_err(&pdev->dev, "cannot remap PCI memory region\n") ;
+		ret = -EIO;
+		goto err_reg;
+	}
+
+	/*
+	 * Allocate hw (mac80211 main struct)
+	 * and hw->priv (driver private data)
+	 */
+	hw = ieee80211_alloc_hw(sizeof(*sc), &ath5k_hw_ops);
+	if (hw == NULL) {
+		dev_err(&pdev->dev, "cannot allocate ieee80211_hw\n");
+		ret = -ENOMEM;
+		goto err_map;
+	}
+
+	dev_info(&pdev->dev, "registered as '%s'\n", wiphy_name(hw->wiphy));
+
+	sc = hw->priv;
+	sc->hw = hw;
+	sc->pdev = pdev;
+	sc->dev = &pdev->dev;
+	sc->irq = pdev->irq;
+	sc->devid = id->device;
+	sc->iobase = mem; /* So we can unmap it on detach */
+
+	/* Initialize */
+	ret = ath5k_init_softc(sc, &ath_pci_bus_ops);
+	if (ret) {
+		goto err_free;
+	}
+
+	/* Set private data */
+	pci_set_drvdata(pdev, hw);
+
+	return 0;
+err_free:
+	ieee80211_free_hw(hw);
+err_map:
+	pci_iounmap(pdev, mem);
+err_reg:
+	pci_release_region(pdev, 0);
+err_dis:
+	pci_disable_device(pdev);
+err:
+	return ret;
+}
+
+static void __devexit
+ath5k_pci_remove(struct pci_dev *pdev)
+{
+	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
+	struct ath5k_softc *sc = hw->priv;
+
+	ath5k_deinit_softc(sc);
+	pci_iounmap(pdev, sc->iobase);
+	pci_release_region(pdev, 0);
+	pci_disable_device(pdev);
+	ieee80211_free_hw(hw);
+}
+
+#ifdef CONFIG_PM_SLEEP
+static int ath5k_pci_suspend(struct device *dev)
+{
+	struct ath5k_softc *sc = pci_get_drvdata(to_pci_dev(dev));
+
+	ath5k_led_off(sc);
+	return 0;
+}
+
+static int ath5k_pci_resume(struct device *dev)
+{
+	struct pci_dev *pdev = to_pci_dev(dev);
+	struct ath5k_softc *sc = pci_get_drvdata(pdev);
+
+	/*
+	 * Suspend/Resume resets the PCI configuration space, so we have to
+	 * re-disable the RETRY_TIMEOUT register (0x41) to keep
+	 * PCI Tx retries from interfering with C3 CPU state
+	 */
+	pci_write_config_byte(pdev, 0x41, 0);
+
+	ath5k_led_enable(sc);
+	return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume);
+#define ATH5K_PM_OPS	(&ath5k_pm_ops)
+#else
+#define ATH5K_PM_OPS	NULL
+#endif /* CONFIG_PM_SLEEP */
+
+static struct pci_driver ath5k_pci_driver = {
+	.name		= KBUILD_MODNAME,
+	.id_table	= ath5k_pci_id_table,
+	.probe		= ath5k_pci_probe,
+	.remove		= __devexit_p(ath5k_pci_remove),
+	.driver.pm	= ATH5K_PM_OPS,
+};
+
+/*
+ * Module init/exit functions
+ */
+static int __init
+init_ath5k_pci(void)
+{
+	int ret;
+
+	ret = pci_register_driver(&ath5k_pci_driver);
+	if (ret) {
+		printk(KERN_ERR "ath5k_pci: can't register pci driver\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+static void __exit
+exit_ath5k_pci(void)
+{
+	pci_unregister_driver(&ath5k_pci_driver);
+}
+
+module_init(init_ath5k_pci);
+module_exit(exit_ath5k_pci);
diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
deleted file mode 100644
index 9f7d3ca..0000000
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (c) 2008-2009 Atheros Communications Inc.
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <linux/nl80211.h>
-#include <linux/pci.h>
-#include <linux/pci-aspm.h>
-#include "../ath.h"
-#include "ath5k.h"
-#include "debug.h"
-#include "base.h"
-#include "reg.h"
-
-/* Known PCI ids */
-static DEFINE_PCI_DEVICE_TABLE(ath5k_pci_id_table) = {
-	{ PCI_VDEVICE(ATHEROS, 0x0207) }, /* 5210 early */
-	{ PCI_VDEVICE(ATHEROS, 0x0007) }, /* 5210 */
-	{ PCI_VDEVICE(ATHEROS, 0x0011) }, /* 5311 - this is on AHB bus !*/
-	{ PCI_VDEVICE(ATHEROS, 0x0012) }, /* 5211 */
-	{ PCI_VDEVICE(ATHEROS, 0x0013) }, /* 5212 */
-	{ PCI_VDEVICE(3COM_2,  0x0013) }, /* 3com 5212 */
-	{ PCI_VDEVICE(3COM,    0x0013) }, /* 3com 3CRDAG675 5212 */
-	{ PCI_VDEVICE(ATHEROS, 0x1014) }, /* IBM minipci 5212 */
-	{ PCI_VDEVICE(ATHEROS, 0x0014) }, /* 5212 combatible */
-	{ PCI_VDEVICE(ATHEROS, 0x0015) }, /* 5212 combatible */
-	{ PCI_VDEVICE(ATHEROS, 0x0016) }, /* 5212 combatible */
-	{ PCI_VDEVICE(ATHEROS, 0x0017) }, /* 5212 combatible */
-	{ PCI_VDEVICE(ATHEROS, 0x0018) }, /* 5212 combatible */
-	{ PCI_VDEVICE(ATHEROS, 0x0019) }, /* 5212 combatible */
-	{ PCI_VDEVICE(ATHEROS, 0x001a) }, /* 2413 Griffin-lite */
-	{ PCI_VDEVICE(ATHEROS, 0x001b) }, /* 5413 Eagle */
-	{ PCI_VDEVICE(ATHEROS, 0x001c) }, /* PCI-E cards */
-	{ PCI_VDEVICE(ATHEROS, 0x001d) }, /* 2417 Nala */
-	{ 0 }
-};
-
-/* return bus cachesize in 4B word units */
-static void ath5k_pci_read_cachesize(struct ath_common *common, int *csz)
-{
-	struct ath5k_softc *sc = (struct ath5k_softc *) common->priv;
-	u8 u8tmp;
-
-	pci_read_config_byte(sc->pdev, PCI_CACHE_LINE_SIZE, &u8tmp);
-	*csz = (int)u8tmp;
-
-	/*
-	 * This check was put in to avoid "unplesant" consequences if
-	 * the bootrom has not fully initialized all PCI devices.
-	 * Sometimes the cache line size register is not set
-	 */
-
-	if (*csz == 0)
-		*csz = L1_CACHE_BYTES >> 2;   /* Use the default size */
-}
-
-/* Common ath_bus_opts structure */
-static const struct ath_bus_ops ath_pci_bus_ops = {
-	.ath_bus_type = ATH_PCI,
-	.read_cachesize = ath5k_pci_read_cachesize,
-};
-
-/********************\
-* PCI Initialization *
-\********************/
-
-static int __devinit
-ath5k_pci_probe(struct pci_dev *pdev,
-		const struct pci_device_id *id)
-{
-	void __iomem *mem;
-	struct ath5k_softc *sc;
-	struct ieee80211_hw *hw;
-	int ret;
-	u8 csz;
-
-	/*
-	 * L0s needs to be disabled on all ath5k cards.
-	 *
-	 * For distributions shipping with CONFIG_PCIEASPM (this will be enabled
-	 * by default in the future in 2.6.36) this will also mean both L1 and
-	 * L0s will be disabled when a pre 1.1 PCIe device is detected. We do
-	 * know L1 works correctly even for all ath5k pre 1.1 PCIe devices
-	 * though but cannot currently undue the effect of a blacklist, for
-	 * details you can read pcie_aspm_sanity_check() and see how it adjusts
-	 * the device link capability.
-	 *
-	 * It may be possible in the future to implement some PCI API to allow
-	 * drivers to override blacklists for pre 1.1 PCIe but for now it is
-	 * best to accept that both L0s and L1 will be disabled completely for
-	 * distributions shipping with CONFIG_PCIEASPM rather than having this
-	 * issue present. Motivation for adding this new API will be to help
-	 * with power consumption for some of these devices.
-	 */
-	pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S);
-
-	ret = pci_enable_device(pdev);
-	if (ret) {
-		dev_err(&pdev->dev, "can't enable device\n");
-		goto err;
-	}
-
-	/* XXX 32-bit addressing only */
-	ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
-	if (ret) {
-		dev_err(&pdev->dev, "32-bit DMA not available\n");
-		goto err_dis;
-	}
-
-	/*
-	 * Cache line size is used to size and align various
-	 * structures used to communicate with the hardware.
-	 */
-	pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &csz);
-	if (csz == 0) {
-		/*
-		 * Linux 2.4.18 (at least) writes the cache line size
-		 * register as a 16-bit wide register which is wrong.
-		 * We must have this setup properly for rx buffer
-		 * DMA to work so force a reasonable value here if it
-		 * comes up zero.
-		 */
-		csz = L1_CACHE_BYTES >> 2;
-		pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, csz);
-	}
-	/*
-	 * The default setting of latency timer yields poor results,
-	 * set it to the value used by other systems.  It may be worth
-	 * tweaking this setting more.
-	 */
-	pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xa8);
-
-	/* Enable bus mastering */
-	pci_set_master(pdev);
-
-	/*
-	 * Disable the RETRY_TIMEOUT register (0x41) to keep
-	 * PCI Tx retries from interfering with C3 CPU state.
-	 */
-	pci_write_config_byte(pdev, 0x41, 0);
-
-	ret = pci_request_region(pdev, 0, "ath5k");
-	if (ret) {
-		dev_err(&pdev->dev, "cannot reserve PCI memory region\n");
-		goto err_dis;
-	}
-
-	mem = pci_iomap(pdev, 0, 0);
-	if (!mem) {
-		dev_err(&pdev->dev, "cannot remap PCI memory region\n") ;
-		ret = -EIO;
-		goto err_reg;
-	}
-
-	/*
-	 * Allocate hw (mac80211 main struct)
-	 * and hw->priv (driver private data)
-	 */
-	hw = ieee80211_alloc_hw(sizeof(*sc), &ath5k_hw_ops);
-	if (hw == NULL) {
-		dev_err(&pdev->dev, "cannot allocate ieee80211_hw\n");
-		ret = -ENOMEM;
-		goto err_map;
-	}
-
-	dev_info(&pdev->dev, "registered as '%s'\n", wiphy_name(hw->wiphy));
-
-	sc = hw->priv;
-	sc->hw = hw;
-	sc->pdev = pdev;
-	sc->dev = &pdev->dev;
-	sc->irq = pdev->irq;
-	sc->devid = id->device;
-	sc->iobase = mem; /* So we can unmap it on detach */
-
-	/* Initialize */
-	ret = ath5k_init_softc(sc, &ath_pci_bus_ops);
-	if (ret)
-		goto err_free;
-
-	/* Set private data */
-	pci_set_drvdata(pdev, hw);
-
-	return 0;
-err_free:
-	ieee80211_free_hw(hw);
-err_map:
-	pci_iounmap(pdev, mem);
-err_reg:
-	pci_release_region(pdev, 0);
-err_dis:
-	pci_disable_device(pdev);
-err:
-	return ret;
-}
-
-static void __devexit
-ath5k_pci_remove(struct pci_dev *pdev)
-{
-	struct ieee80211_hw *hw = pci_get_drvdata(pdev);
-	struct ath5k_softc *sc = hw->priv;
-
-	ath5k_deinit_softc(sc);
-	pci_iounmap(pdev, sc->iobase);
-	pci_release_region(pdev, 0);
-	pci_disable_device(pdev);
-	ieee80211_free_hw(hw);
-}
-
-#ifdef CONFIG_PM_SLEEP
-static int ath5k_pci_suspend(struct device *dev)
-{
-	struct ath5k_softc *sc = pci_get_drvdata(to_pci_dev(dev));
-
-	ath5k_led_off(sc);
-	return 0;
-}
-
-static int ath5k_pci_resume(struct device *dev)
-{
-	struct pci_dev *pdev = to_pci_dev(dev);
-	struct ath5k_softc *sc = pci_get_drvdata(pdev);
-
-	/*
-	 * Suspend/Resume resets the PCI configuration space, so we have to
-	 * re-disable the RETRY_TIMEOUT register (0x41) to keep
-	 * PCI Tx retries from interfering with C3 CPU state
-	 */
-	pci_write_config_byte(pdev, 0x41, 0);
-
-	ath5k_led_enable(sc);
-	return 0;
-}
-
-static SIMPLE_DEV_PM_OPS(ath5k_pm_ops, ath5k_pci_suspend, ath5k_pci_resume);
-#define ATH5K_PM_OPS	(&ath5k_pm_ops)
-#else
-#define ATH5K_PM_OPS	NULL
-#endif /* CONFIG_PM_SLEEP */
-
-static struct pci_driver ath5k_pci_driver = {
-	.name		= KBUILD_MODNAME,
-	.id_table	= ath5k_pci_id_table,
-	.probe		= ath5k_pci_probe,
-	.remove		= __devexit_p(ath5k_pci_remove),
-	.driver.pm	= ATH5K_PM_OPS,
-};
-
-/*
- * Module init/exit functions
- */
-static int __init
-init_ath5k_pci(void)
-{
-	int ret;
-
-	ret = pci_register_driver(&ath5k_pci_driver);
-	if (ret) {
-		printk(KERN_ERR "ath5k_pci: can't register pci driver\n");
-		return ret;
-	}
-
-	return 0;
-}
-
-static void __exit
-exit_ath5k_pci(void)
-{
-	pci_unregister_driver(&ath5k_pci_driver);
-}
-
-module_init(init_ath5k_pci);
-module_exit(exit_ath5k_pci);
-- 
1.7.2.3


^ permalink raw reply related

* Re: [PATCH 5/5] mac80211: fix issuing idle calls when device open count is 0
From: Johannes Berg @ 2010-12-07 18:12 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Luis Rodriguez, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org, Amod Bodas, pstew@google.com,
	stable@kernel.org
In-Reply-To: <AANLkTi=Sj7YpKzFHQtf2MdUcRDTzfXszbK7gGg_yup1Y@mail.gmail.com>

On Tue, 2010-12-07 at 10:04 -0800, Luis R. Rodriguez wrote:
> On Tue, Dec 7, 2010 at 9:32 AM, Johannes Berg <johannes@sipsolutions.net> wrote:
> > On Tue, 2010-12-07 at 07:59 -0800, Luis R. Rodriguez wrote:
> >
> >> @@ -301,7 +301,7 @@ static void __ieee80211_scan_completed_finish(struct ieee80211_hw *hw,
> >>       }
> >>
> >>       mutex_lock(&local->mtx);
> >> -     ieee80211_recalc_idle(local);
> >> +     ieee80211_recalc_idle_force(local);
> >>       mutex_unlock(&local->mtx);
> >
> > This is the change that I don't think is necessary.
> 
> Without this resume fails.

In what situation? When you just suspend while things are up&running, or
if you suspend with interfaces down? It doesn't make sense anyway, so
something's going on in the rest of the scan code -- we should be
canceling scans properly when going down and when suspending, well
before any of this becomes relevant.

johannes


^ permalink raw reply


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