Linux wireless drivers development
 help / color / mirror / Atom feed
* RE: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: Venkataraman, Meenakshi @ 2011-09-26 21:24 UTC (permalink / raw)
  To: Henrik Friedrichsen; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <CAJTrwG4AHo-_P_j8x2_vbd-eCXRVM=MPRoCh-uQQPHoKduyxvw@mail.gmail.com>

SGkgSGVucmlrLA0KDQo+PiBbTVZdIFRoYXQncyBpbnRlcmVzdGluZy4gV2hhdCBpcyB0aGUgbW9k
ZWwgb2YgdGhlIEFQIHRoYXQgd29ya3M/IEFyZSB5b3UNCj51c2luZyB0aGUgc2FtZSBrZXJuZWwg
dmVyc2lvbiB3aXRoIHRoaXMgQVAgKGp1c3Qgd2FudCB0byBjb25maXJtIHdpdGggeW91KT8NCj5B
bHNvLCBhcmUgeW91IGluIGEgcG9zaXRpb24gdG8gc2VuZCB1cyAob25seSkgYSBzbmlmZmVyIGxv
Zz8NCj4NCj5XZWxsLCBJIGNhbid0IHJlYWxseSB0ZWxsIHlvdSB3aGljaCByb3V0ZXIgbW9kZWxz
IHdvcmtlZCBmaW5lLCBiZWNhdXNlIEkgYWxtb3N0DQo+bmV2ZXIgaGFkIHBoeXNpY2FsIGFjY2Vz
cyB0byB0aGVtIChvciBib3RoZXJlZCwgZm9yIHRoYXQgbWF0dGVyIDspKS4gVGhlDQo+TmV0Z2Vh
ciBXR1I2MTR2MTAsIHdoaWNoIEkgdXNlZCB0byBoYXZlIGF0IGhvbWUsIHdvcmtlZCB3aXRob3V0
DQo+cHJvYmxlbXMuIFNhbWUgd2l0aCBhIGZldyBUUC1MaW5rIHJvdXRlcnMuIFR1cm5pbmcgbXkg
SFRDIERlc2lyZSBIRA0KPihBbmRyb2lkKSBoYW5kc2V0IHRvIGEgV2lGaSBob3RzcG90IHdvcmtl
ZCBmaW5lLCB0b28uIFNvIHRoaXMgb25lIGlzIHByZXR0eQ0KPm11Y2ggdGhlIGZpcnN0IG9uZSB0
aGF0IEkgYW0gZW5jb3VudGVyaW5nLg0KPlVuZm9ydHVuYXRlbHkgSSBkb24ndCBoYXZlIGFueSBv
dGhlciBGcml0eiFCb3hlcyBieSBBVk0gYXQgdGhlIG1vbWVudC4NCj5UaGUgb25lIEkgYW0gY29u
bmVjdGVkIHRvIHJpZ2h0IG5vdyBpcyBhIFp5WEVMIElTUCByZWJyYW5kLiBJIGRvbid0IGhhdmUN
Cj5waHlzaWNhbCBhY2Nlc3MgdG8gaXQsIHNvIEkgY2FuJ3QgcmVhbGx5IHRlbGwgeW91IHdoYXQg
bW9kZWwgaXQgaXMuDQoNCltNVl0gQWxscmlnaHQuLi50aGF0J3MgaGVscGZ1bC4gTm90IHN1cmUg
aG93IGF0IHRoZSBtb21lbnQsIGJ1dCB3ZSBjYW4gZmlndXJlIHRoYXQgb3V0Lg0KDQo+V2hhdCBr
aW5kIG9mIGEgc25pZmZlciBsb2cuIFlvdSBtZWFuIFRDUCBwYWNrZXRzPw0KDQpbTVZdIFdlbGwu
Li53aGF0IEknbSBpbnRlcmVzdGVkIGluIGlzIHJlYWxseSB0aGUgSUVFRTgwMi4xMSBwYWNrZXRz
IGZvciB3aGVuIHlvdSBhdHRlbXB0IHRvIGJyb3dzZSB0aGUgd2ViIChvciBvdGhlciB3b3JrbG9h
ZHMpIHdoZXJlIHlvdSdyZSBzZWVpbmcgdGhlIGlzc3VlLiBPZiBjb3Vyc2UsIFRDUCB0cmFmZmlj
IHRoYXQgdGhlc2UgcGFja2V0cyBhcmUgY2Fycnlpbmcgd2lsbCBhbHNvIGJlIGhlbHBmdWwuDQoN
ClRoYW5rcywNCk1lZW5ha3NoaQ0K

^ permalink raw reply

* Re: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: Henrik Friedrichsen @ 2011-09-26 21:31 UTC (permalink / raw)
  To: wwguy; +Cc: linux-wireless
In-Reply-To: <1317071853.2400.11.camel@wwguy-ubuntu>

On Mon, Sep 26, 2011 at 11:17 PM, wwguy <wey-yi.w.guy@intel.com> wrote:
> how about just doing a flood ping to your AP
> #sudo ping -f <AP's ip address>

Okay, here's what's happening:
~ > ping -f fritz.box
PING fritz.box (192.168.178.1) 56(84) bytes of data.
ping: cannot flood; minimal interval, allowed for user, is 200ms

When I send regular pings:
~ > ping -c5 fritz.box
PING fritz.box (192.168.178.1) 56(84) bytes of data.
64 bytes from fritz.box (192.168.178.1): icmp_req=1 ttl=64 time=1.31 ms
64 bytes from fritz.box (192.168.178.1): icmp_req=2 ttl=64 time=1.26 ms
64 bytes from fritz.box (192.168.178.1): icmp_req=3 ttl=64 time=1.30 ms
64 bytes from fritz.box (192.168.178.1): icmp_req=4 ttl=64 time=2.51 ms
64 bytes from fritz.box (192.168.178.1): icmp_req=5 ttl=64 time=1.22 ms

--- fritz.box ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 32046ms
rtt min/avg/max/mdev = 1.226/1.524/2.515/0.496 ms

As you can see, the packets get there and the response goes back to
me. But it seems to take ages for the package to be sent. I've sent
five pings and got my response back in regular latency, however the
whole process took 32 seconds.

^ permalink raw reply

* Re: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: Henrik Friedrichsen @ 2011-09-26 21:32 UTC (permalink / raw)
  To: Venkataraman, Meenakshi; +Cc: linux-wireless
In-Reply-To: <C5A7FB31FD9AEA42B600BDC3C74F8E00170525B4@orsmsx511.amr.corp.intel.com>

On Mon, Sep 26, 2011 at 11:24 PM, Venkataraman, Meenakshi
<meenakshi.venkataraman@intel.com> wrote:
> [MV] Well...what I'm interested in is really the IEEE802.11 packets for when you attempt to browse the web (or other workloads) where you're seeing the issue. Of course, TCP traffic that these packets are carrying will also be helpful.

I see. You're going to have to excuse me here, though. I have never
done WiFi debugging. What would be the easiest (and for you most
useful) way to capture IEEE802.11 packets?

^ permalink raw reply

* Re: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: wwguy @ 2011-09-26 21:29 UTC (permalink / raw)
  To: Henrik Friedrichsen; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <CAJTrwG5ydoheYzYuRZaaR0AfqBgE9KnfYQ8X_0esRNVog3hF=g@mail.gmail.com>

On Mon, 2011-09-26 at 14:31 -0700, Henrik Friedrichsen wrote:
> On Mon, Sep 26, 2011 at 11:17 PM, wwguy <wey-yi.w.guy@intel.com> wrote:
> > how about just doing a flood ping to your AP
> > #sudo ping -f <AP's ip address>
> 
> Okay, here's what's happening:
> ~ > ping -f fritz.box
> PING fritz.box (192.168.178.1) 56(84) bytes of data.
> ping: cannot flood; minimal interval, allowed for user, is 200ms
> 
> When I send regular pings:
> ~ > ping -c5 fritz.box
> PING fritz.box (192.168.178.1) 56(84) bytes of data.
> 64 bytes from fritz.box (192.168.178.1): icmp_req=1 ttl=64 time=1.31 ms
> 64 bytes from fritz.box (192.168.178.1): icmp_req=2 ttl=64 time=1.26 ms
> 64 bytes from fritz.box (192.168.178.1): icmp_req=3 ttl=64 time=1.30 ms
> 64 bytes from fritz.box (192.168.178.1): icmp_req=4 ttl=64 time=2.51 ms
> 64 bytes from fritz.box (192.168.178.1): icmp_req=5 ttl=64 time=1.22 ms
> 
> --- fritz.box ping statistics ---
> 5 packets transmitted, 5 received, 0% packet loss, time 32046ms
> rtt min/avg/max/mdev = 1.226/1.524/2.515/0.496 ms
> 
> As you can see, the packets get there and the response goes back to
> me. But it seems to take ages for the package to be sent. I've sent
> five pings and got my response back in regular latency, however the
> whole process took 32 seconds.

$sudo ping -f fritz.box

Wey



^ permalink raw reply

* Re: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: Henrik Friedrichsen @ 2011-09-26 21:40 UTC (permalink / raw)
  To: wwguy; +Cc: linux-wireless
In-Reply-To: <1317072572.2400.12.camel@wwguy-ubuntu>

On Mon, Sep 26, 2011 at 11:29 PM, wwguy <wey-yi.w.guy@intel.com> wrote:
> $sudo ping -f fritz.box

Oh I'm sorry.

~ > ping -f fritz.box
PING fritz.box (192.168.178.1) 56(84) bytes of data.
.^C
--- fritz.box ping statistics ---
48268 packets transmitted, 48267 received, 0% packet loss, time 81796ms
rtt min/avg/max/mdev = 1.066/1.642/54.477/1.830 ms, pipe 4, ipg/ewma
1.694/1.342 ms

^ permalink raw reply

* Re: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: Larry Finger @ 2011-09-26 21:56 UTC (permalink / raw)
  To: Henrik Friedrichsen; +Cc: wwguy, linux-wireless
In-Reply-To: <CAJTrwG5ydoheYzYuRZaaR0AfqBgE9KnfYQ8X_0esRNVog3hF=g@mail.gmail.com>

On 09/26/2011 04:31 PM, Henrik Friedrichsen wrote:
> On Mon, Sep 26, 2011 at 11:17 PM, wwguy<wey-yi.w.guy@intel.com>  wrote:
>> how about just doing a flood ping to your AP
>> #sudo ping -f<AP's ip address>
>
> Okay, here's what's happening:
> ~>  ping -f fritz.box
> PING fritz.box (192.168.178.1) 56(84) bytes of data.
> ping: cannot flood; minimal interval, allowed for user, is 200ms
>
> When I send regular pings:
> ~>  ping -c5 fritz.box
> PING fritz.box (192.168.178.1) 56(84) bytes of data.
> 64 bytes from fritz.box (192.168.178.1): icmp_req=1 ttl=64 time=1.31 ms
> 64 bytes from fritz.box (192.168.178.1): icmp_req=2 ttl=64 time=1.26 ms
> 64 bytes from fritz.box (192.168.178.1): icmp_req=3 ttl=64 time=1.30 ms
> 64 bytes from fritz.box (192.168.178.1): icmp_req=4 ttl=64 time=2.51 ms
> 64 bytes from fritz.box (192.168.178.1): icmp_req=5 ttl=64 time=1.22 ms
>
> --- fritz.box ping statistics ---
> 5 packets transmitted, 5 received, 0% packet loss, time 32046ms
> rtt min/avg/max/mdev = 1.226/1.524/2.515/0.496 ms
>
> As you can see, the packets get there and the response goes back to
> me. But it seems to take ages for the package to be sent. I've sent
> five pings and got my response back in regular latency, however the
> whole process took 32 seconds.

Of course, it should take a little over 4 sec. Try adding the -D switch to the 
ping command. Does repeating the ping command immediately change the timing?

Larry


^ permalink raw reply

* Re: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: Henrik Friedrichsen @ 2011-09-26 22:12 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless
In-Reply-To: <4E80F522.3010903@lwfinger.net>

On Mon, Sep 26, 2011 at 11:56 PM, Larry Finger
<Larry.Finger@lwfinger.net> wrote:
> Of course, it should take a little over 4 sec. Try adding the -D switch to
> the ping command. Does repeating the ping command immediately change the
> timing?

There you go:
~ > ping -Dc5 fritz.box
PING fritz.box (192.168.178.1) 56(84) bytes of data.
[1317074796.140468] 64 bytes from fritz.box (192.168.178.1):
icmp_req=1 ttl=64 time=1.19 ms
[1317074804.154425] 64 bytes from fritz.box (192.168.178.1):
icmp_req=2 ttl=64 time=1.52 ms
[1317074812.165947] 64 bytes from fritz.box (192.168.178.1):
icmp_req=3 ttl=64 time=1.20 ms
[1317074820.177252] 64 bytes from fritz.box (192.168.178.1):
icmp_req=4 ttl=64 time=1.23 ms
[1317074828.187470] 64 bytes from fritz.box (192.168.178.1):
icmp_req=5 ttl=64 time=1.76 ms

Nope, it doesn't.

^ permalink raw reply

* RE: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: Venkataraman, Meenakshi @ 2011-09-26 22:19 UTC (permalink / raw)
  To: Henrik Friedrichsen, Larry Finger; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <CAJTrwG6r2ZEUg8VugVxDQ_AKL6_ukdregydm-_r9SjUMNbwBHQ@mail.gmail.com>

SGVucmlrLA0KDQo+PiBPZiBjb3Vyc2UsIGl0IHNob3VsZCB0YWtlIGEgbGl0dGxlIG92ZXIgNCBz
ZWMuIFRyeSBhZGRpbmcgdGhlIC1EDQo+PiBzd2l0Y2ggdG8gdGhlIHBpbmcgY29tbWFuZC4gRG9l
cyByZXBlYXRpbmcgdGhlIHBpbmcgY29tbWFuZA0KPj4gaW1tZWRpYXRlbHkgY2hhbmdlIHRoZSB0
aW1pbmc/DQo+DQo+VGhlcmUgeW91IGdvOg0KPn4gPiBwaW5nIC1EYzUgZnJpdHouYm94DQo+UElO
RyBmcml0ei5ib3ggKDE5Mi4xNjguMTc4LjEpIDU2KDg0KSBieXRlcyBvZiBkYXRhLg0KPlsxMzE3
MDc0Nzk2LjE0MDQ2OF0gNjQgYnl0ZXMgZnJvbSBmcml0ei5ib3ggKDE5Mi4xNjguMTc4LjEpOg0K
PmljbXBfcmVxPTEgdHRsPTY0IHRpbWU9MS4xOSBtcw0KPlsxMzE3MDc0ODA0LjE1NDQyNV0gNjQg
Ynl0ZXMgZnJvbSBmcml0ei5ib3ggKDE5Mi4xNjguMTc4LjEpOg0KPmljbXBfcmVxPTIgdHRsPTY0
IHRpbWU9MS41MiBtcw0KPlsxMzE3MDc0ODEyLjE2NTk0N10gNjQgYnl0ZXMgZnJvbSBmcml0ei5i
b3ggKDE5Mi4xNjguMTc4LjEpOg0KPmljbXBfcmVxPTMgdHRsPTY0IHRpbWU9MS4yMCBtcw0KPlsx
MzE3MDc0ODIwLjE3NzI1Ml0gNjQgYnl0ZXMgZnJvbSBmcml0ei5ib3ggKDE5Mi4xNjguMTc4LjEp
Og0KPmljbXBfcmVxPTQgdHRsPTY0IHRpbWU9MS4yMyBtcw0KPlsxMzE3MDc0ODI4LjE4NzQ3MF0g
NjQgYnl0ZXMgZnJvbSBmcml0ei5ib3ggKDE5Mi4xNjguMTc4LjEpOg0KPmljbXBfcmVxPTUgdHRs
PTY0IHRpbWU9MS43NiBtcw0KPg0KPk5vcGUsIGl0IGRvZXNuJ3QuDQoNCltNVl0gWW91J3ZlIHBy
b2JhYmx5IGFscmVhZHkgZG9uZSB0aGlzLCBidXQgd2hhdCBhYm91dCBpZiB5b3UgY29ubmVjdGVk
IHRvIHRoZSBBUCB2aWEgYW4gRXRoZXJuZXQgY2FibGUsIGFuZCB0aGVuIHRyaWVkIHRoZSBwaW5n
Pw0KDQpNZWVuYWtzaGkNCg==

^ permalink raw reply

* Re: [RFC 03/15] mac80211: also expire filtered frames
From: Luis R. Rodriguez @ 2011-09-26 22:30 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <20110922154849.369194760@sipsolutions.net>

On Thu, Sep 22, 2011 at 8:47 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> mac80211 will expire normal PS-buffered frames, but
> if the device rejected some frames for a sleeping
> station, these won't be on the ps_tx_buf queue but
> on the tx_filtered queue instead; this is done to
> avoid reordering.
>
> However, mac80211 will not expire frames from the
> filtered queue, let's fix that.
>
> Also add a more comments to what all this expiry is
> doing and how it works.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>

No particular comments on the code yet but latency issues has got me
thinking about the filtered frames stuff and if we really need it. How
much benefit does keeping these frames give us instead of just
dropping them?

  Luis

^ permalink raw reply

* Re: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: Larry Finger @ 2011-09-26 22:44 UTC (permalink / raw)
  To: Henrik Friedrichsen; +Cc: linux-wireless
In-Reply-To: <CAJTrwG6r2ZEUg8VugVxDQ_AKL6_ukdregydm-_r9SjUMNbwBHQ@mail.gmail.com>

On 09/26/2011 05:12 PM, Henrik Friedrichsen wrote:
> On Mon, Sep 26, 2011 at 11:56 PM, Larry Finger
> <Larry.Finger@lwfinger.net>  wrote:
>> Of course, it should take a little over 4 sec. Try adding the -D switch to
>> the ping command. Does repeating the ping command immediately change the
>> timing?
>
> There you go:
> ~>  ping -Dc5 fritz.box
> PING fritz.box (192.168.178.1) 56(84) bytes of data.
> [1317074796.140468] 64 bytes from fritz.box (192.168.178.1):
> icmp_req=1 ttl=64 time=1.19 ms
> [1317074804.154425] 64 bytes from fritz.box (192.168.178.1):
> icmp_req=2 ttl=64 time=1.52 ms
> [1317074812.165947] 64 bytes from fritz.box (192.168.178.1):
> icmp_req=3 ttl=64 time=1.20 ms
> [1317074820.177252] 64 bytes from fritz.box (192.168.178.1):
> icmp_req=4 ttl=64 time=1.23 ms
> [1317074828.187470] 64 bytes from fritz.box (192.168.178.1):
> icmp_req=5 ttl=64 time=1.76 ms
>
> Nope, it doesn't.

Your ping seems to have an interval of 8 seconds, not 1 like the man page says.

Mine shows

finger@larrylap:~> ping -D -c5 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
[1317073193.249666] 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.19 ms
[1317073194.251148] 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=2.27 ms
[1317073195.250589] 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=1.14 ms
[1317073196.252548] 64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=1.76 ms
[1317073197.253527] 64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=0.801 ms

What does 'ping -i1 -D -c5 <AP>' show?

Larry

^ permalink raw reply

* Re: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: Henrik Friedrichsen @ 2011-09-26 23:03 UTC (permalink / raw)
  To: Venkataraman, Meenakshi, wwguy, Larry Finger; +Cc: linux-wireless
In-Reply-To: <C5A7FB31FD9AEA42B600BDC3C74F8E00170F307E@orsmsx511.amr.corp.intel.com>

Okay. As it turns out, the problem was distribution related (combined
with a few config changes I made when I was in China) and NOT
hardware. I'd rather not go into it, because it's almost too
embarrassing to admit. Either way, I would like to thank everyone of
you for the time and effort and apologize for the trouble. For me, it
is quite a relief, but I can understand if it pisses you off (wasted
time, etc.). Sorry guys!

Anyway, here's a free drink/tea/coffee coupon for compensation.. =X

^ permalink raw reply

* Re: [PATCH 09/20] staging: brcm80211: use endian annotated structures in brcmsmac
From: Greg KH @ 2011-09-26 23:50 UTC (permalink / raw)
  To: Franky Lin
  Cc: Arend van Spriel, Johannes Berg, devel@linuxdriverproject.org,
	gregkh@suse.de, linux-wireless@vger.kernel.org
In-Reply-To: <4E80CFE1.506@broadcom.com>

On Mon, Sep 26, 2011 at 12:17:53PM -0700, Franky Lin wrote:
> On 09/26/2011 11:26 AM, Arend van Spriel wrote:
> >On 09/26/2011 11:37 AM, Johannes Berg wrote:
> >>On Sat, 2011-09-24 at 14:34 +0200, Arend van Spriel wrote:
> >>>On 09/24/2011 12:38 PM, Johannes Berg wrote:
> >>>>On Fri, 2011-09-23 at 19:08 -0700, Franky Lin wrote:
> >>>>>    struct d11rxhdr {
> >>>>>    	u16 RxFrameSize;
> >>>>>    	u16 PAD;
> >>>>>+	union {
> >>>>>+		struct d11rxhdr_le rxh_le;
> >>>>>+		struct d11rxhdr rxh_cpu;
> >>>>>+	};
> >>>>This seems a little strange. Why would it be both in LE and CPU byte
> >>>>order?
> >>>Indeed. When we receive it from the device it is in LE and we convert it
> >>>to CPU order for further processing using rxh_cpu.
> >>That seems a confusing and error-prone -- you'll have to remember
> >>whether you're before or after conversion. Would it be possible to have
> >>two versions of the outer structure and change the pointer type at that
> >>point?
> >>
> >>johannes
> >
> >For me knowing the driver design (a little ;-) it is not difficult to
> >remember. Your feedback has valid arguments so I will reconsider. Franky
> >is looking whether dropping it will affect the other patches submitted
> >to Greg.
> >
> >Gr. AvS
> 
> Dropping this one will affect some following patches in the series.
> Since it's not a bug, shall we keep this one and change it as
> Johannes suggested in future commit?

How about just resend the whole series, that way I don't accidentally
apply it, or the other one you wanted dropped?

I've dropped this whole series from my to-apply queue now.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH 09/20] staging: brcm80211: use endian annotated structures in brcmsmac
From: Franky Lin @ 2011-09-27  0:08 UTC (permalink / raw)
  To: Greg KH
  Cc: Arend Van Spriel, Johannes Berg, devel@linuxdriverproject.org,
	gregkh@suse.de, linux-wireless@vger.kernel.org
In-Reply-To: <20110926235011.GA3878@kroah.com>

On 09/26/2011 04:50 PM, Greg KH wrote:
> How about just resend the whole series, that way I don't accidentally
> apply it, or the other one you wanted dropped?
>
> I've dropped this whole series from my to-apply queue now.

Sure. Will resend after all issues are addressed.

Thanks,
Franky





^ permalink raw reply

* Re: iwlagn: "Intel Centrino Advanced-N 6205 AGN" and "AVM Fritz!Box (7390)" incompatible
From: wwguy @ 2011-09-27  0:36 UTC (permalink / raw)
  To: Henrik Friedrichsen
  Cc: Venkataraman, Meenakshi, Larry Finger,
	linux-wireless@vger.kernel.org
In-Reply-To: <CAJTrwG7JgpXCgyB7JQg9VNYrt-p7u3C5tsGC-3shVZzbyuyxQQ@mail.gmail.com>

Henrik,


On Mon, 2011-09-26 at 16:03 -0700, Henrik Friedrichsen wrote:
> Okay. As it turns out, the problem was distribution related (combined
> with a few config changes I made when I was in China) and NOT
> hardware. I'd rather not go into it, because it's almost too
> embarrassing to admit. Either way, I would like to thank everyone of
> you for the time and effort and apologize for the trouble. For me, it
> is quite a relief, but I can understand if it pisses you off (wasted
> time, etc.). Sorry guys!
> 
> Anyway, here's a free drink/tea/coffee coupon for compensation.. =X

No problem, enjoy doing it with you, you are quick in response and very
helpful :-)

Wey



^ permalink raw reply

* Re: [RFC 03/15] mac80211: also expire filtered frames
From: Adrian Chadd @ 2011-09-27  2:26 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Johannes Berg, linux-wireless
In-Reply-To: <CAB=NE6UP9xYmLY3nJRMVdjPky87hB1YzFTHEzBv0Pt=qv3kAmg@mail.gmail.com>

On 27 September 2011 06:30, Luis R. Rodriguez <mcgrof@frijolero.org> wrote:

> No particular comments on the code yet but latency issues has got me
> thinking about the filtered frames stuff and if we really need it. How
> much benefit does keeping these frames give us instead of just
> dropping them?

Do you guys keep statistics about this sort of thing?

My macbook pro ends up causing my FreeBSD AP to miss TX'ing a lot of
frames, even if it's close by. This only occurs when it's on battery
power.

I have a feeling it's going to be doing aggressiveish power saving
stuff and this'll be fixed by me porting over and tidying up the
filtered frames support.


Adrian

^ permalink raw reply

* [PATCH 1/4] mwifiex: remove unnecessary mwifiex_dump_station_info() call
From: Bing Zhao @ 2011-09-27  3:37 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao

From: Amitkumar Karwar <akarwar@marvell.com>

An extra call to mwifiex_dump_station_info() routine in get_station
callback function is redundant

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/cfg80211.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 6fd53e4..5550741 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -565,8 +565,6 @@ mwifiex_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
 {
 	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
 
-	mwifiex_dump_station_info(priv, sinfo);
-
 	if (!priv->media_connected)
 		return -ENOENT;
 	if (memcmp(mac, priv->cfg_bssid, ETH_ALEN))
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 2/4] mwifiex: remove unreachable code
From: Bing Zhao @ 2011-09-27  3:37 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1317094646-7718-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

In disconnected state "iw dev mlan0 link" command will return
from cfg80211 stack itself. We also have an error check in
mwifiex_cfg80211_get_station() routine. Therefore the code
under "if (!priv->media_connected)" condition in
mwifiex_rate_ioctl_get_rate_value() routine becomes unreachable.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/sta_ioctl.c |   46 +----------------------------
 1 files changed, 2 insertions(+), 44 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 1df5ef6..cee1487 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -717,51 +717,9 @@ done:
 static int mwifiex_rate_ioctl_get_rate_value(struct mwifiex_private *priv,
 					     struct mwifiex_rate_cfg *rate_cfg)
 {
-	struct mwifiex_adapter *adapter = priv->adapter;
-
 	rate_cfg->is_rate_auto = priv->is_data_rate_auto;
-	if (!priv->media_connected) {
-		switch (adapter->config_bands) {
-		case BAND_B:
-			/* Return the lowest supported rate for B band */
-			rate_cfg->rate = supported_rates_b[0] & 0x7f;
-			break;
-		case BAND_G:
-		case BAND_G | BAND_GN:
-			/* Return the lowest supported rate for G band */
-			rate_cfg->rate = supported_rates_g[0] & 0x7f;
-			break;
-		case BAND_B | BAND_G:
-		case BAND_A | BAND_B | BAND_G:
-		case BAND_A | BAND_B:
-		case BAND_A | BAND_B | BAND_G | BAND_AN | BAND_GN:
-		case BAND_B | BAND_G | BAND_GN:
-			/* Return the lowest supported rate for BG band */
-			rate_cfg->rate = supported_rates_bg[0] & 0x7f;
-			break;
-		case BAND_A:
-		case BAND_A | BAND_G:
-		case BAND_A | BAND_G | BAND_AN | BAND_GN:
-		case BAND_A | BAND_AN:
-			/* Return the lowest supported rate for A band */
-			rate_cfg->rate = supported_rates_a[0] & 0x7f;
-			break;
-		case BAND_GN:
-			/* Return the lowest supported rate for N band */
-			rate_cfg->rate = supported_rates_n[0] & 0x7f;
-			break;
-		default:
-			dev_warn(adapter->dev, "invalid band %#x\n",
-			       adapter->config_bands);
-			break;
-		}
-	} else {
-		return mwifiex_send_cmd_sync(priv,
-					    HostCmd_CMD_802_11_TX_RATE_QUERY,
-					    HostCmd_ACT_GEN_GET, 0, NULL);
-	}
-
-	return 0;
+	return mwifiex_send_cmd_sync(priv, HostCmd_CMD_802_11_TX_RATE_QUERY,
+				     HostCmd_ACT_GEN_GET, 0, NULL);
 }
 
 /*
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 3/4] mwifiex: fix Tx data rate display issue
From: Bing Zhao @ 2011-09-27  3:37 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1317094646-7718-1-git-send-email-bzhao@marvell.com>

From: Amitkumar Karwar <akarwar@marvell.com>

"iw dev mlan0 link" shows wrong data rate, because data rate is
not sent properly to cfg80211 stack. Also stack is not updated
with mcs and Tx data flags information.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/cfg80211.c |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 5550741..c429661 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -543,12 +543,28 @@ mwifiex_dump_station_info(struct mwifiex_private *priv,
 		ret = -EFAULT;
 	}
 
+	/*
+	 * Bit 0 in tx_htinfo indicates that current Tx rate is 11n rate. Valid
+	 * MCS index values for us are 0 to 7.
+	 */
+	if ((priv->tx_htinfo & BIT(0)) && (priv->tx_rate < 8)) {
+		sinfo->txrate.mcs = priv->tx_rate;
+		sinfo->txrate.flags |= RATE_INFO_FLAGS_MCS;
+		/* 40MHz rate */
+		if (priv->tx_htinfo & BIT(1))
+			sinfo->txrate.flags |= RATE_INFO_FLAGS_40_MHZ_WIDTH;
+		/* SGI enabled */
+		if (priv->tx_htinfo & BIT(2))
+			sinfo->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI;
+	}
+
 	sinfo->rx_bytes = priv->stats.rx_bytes;
 	sinfo->tx_bytes = priv->stats.tx_bytes;
 	sinfo->rx_packets = priv->stats.rx_packets;
 	sinfo->tx_packets = priv->stats.tx_packets;
 	sinfo->signal = priv->qual_level;
-	sinfo->txrate.legacy = rate.rate;
+	/* bit rate is in 500 kb/s units. Convert it to 100kb/s units */
+	sinfo->txrate.legacy = rate.rate * 5;
 
 	return ret;
 }
-- 
1.7.0.2


^ permalink raw reply related

* [PATCH 4/4] mwifiex: add cfg80211 handlers add/del_virtual_intf
From: Bing Zhao @ 2011-09-27  3:37 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Kiran Divekar, Yogesh Powar,
	Frank Huang, Bing Zhao
In-Reply-To: <1317094646-7718-1-git-send-email-bzhao@marvell.com>

From: Yogesh Ashok Powar <yogeshp@marvell.com>

Making adding and deleting virtual interfaces dynamic. Adding
handlers for creating and deleting virtual interface with
given name and dev respectively.

Also, creating default interface of type station on insmod of
the driver.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/cfg80211.c |  156 +++++++++++++++++--
 drivers/net/wireless/mwifiex/cfg80211.h |    3 +-
 drivers/net/wireless/mwifiex/decl.h     |    8 -
 drivers/net/wireless/mwifiex/init.c     |    2 +-
 drivers/net/wireless/mwifiex/main.c     |  263 ++++++------------------------
 drivers/net/wireless/mwifiex/main.h     |   18 +--
 6 files changed, 207 insertions(+), 243 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index c429661..3b6c329 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1160,8 +1160,150 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *ht_info,
 	ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
 }
 
+/*
+ *  create a new virtual interface with the given name
+ */
+struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
+						char *name,
+						enum nl80211_iftype type,
+						u32 *flags,
+						struct vif_params *params)
+{
+	struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
+	struct mwifiex_adapter *adapter;
+	struct net_device *dev;
+	void *mdev_priv;
+
+	if (!priv)
+		return NULL;
+
+	adapter = priv->adapter;
+	if (!adapter)
+		return NULL;
+
+	switch (type) {
+	case NL80211_IFTYPE_UNSPECIFIED:
+	case NL80211_IFTYPE_STATION:
+	case NL80211_IFTYPE_ADHOC:
+		if (priv->bss_mode) {
+			wiphy_err(wiphy, "cannot create multiple"
+					" station/adhoc interfaces\n");
+			return NULL;
+		}
+
+		if (type == NL80211_IFTYPE_UNSPECIFIED)
+			priv->bss_mode = NL80211_IFTYPE_STATION;
+		else
+			priv->bss_mode = type;
+
+		priv->bss_type = MWIFIEX_BSS_TYPE_STA;
+		priv->frame_type = MWIFIEX_DATA_FRAME_TYPE_ETH_II;
+		priv->bss_priority = 0;
+		priv->bss_role = MWIFIEX_BSS_ROLE_STA;
+		priv->bss_index = 0;
+		priv->bss_num = 0;
+
+		break;
+	default:
+		wiphy_err(wiphy, "type not supported\n");
+		return NULL;
+	}
+
+	dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), name,
+			      ether_setup, 1);
+	if (!dev) {
+		wiphy_err(wiphy, "no memory available for netdevice\n");
+		goto error;
+	}
+
+	dev_net_set(dev, wiphy_net(wiphy));
+	dev->ieee80211_ptr = priv->wdev;
+	dev->ieee80211_ptr->iftype = priv->bss_mode;
+	memcpy(dev->dev_addr, wiphy->perm_addr, ETH_ALEN);
+	memcpy(dev->perm_addr, wiphy->perm_addr, ETH_ALEN);
+	SET_NETDEV_DEV(dev, wiphy_dev(wiphy));
+
+	dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
+	dev->watchdog_timeo = MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT;
+	dev->hard_header_len += MWIFIEX_MIN_DATA_HEADER_LEN;
+
+	mdev_priv = netdev_priv(dev);
+	*((unsigned long *) mdev_priv) = (unsigned long) priv;
+
+	priv->netdev = dev;
+	mwifiex_init_priv_params(priv, dev);
+
+	SET_NETDEV_DEV(dev, adapter->dev);
+
+	/* Register network device */
+	if (register_netdevice(dev)) {
+		wiphy_err(wiphy, "cannot register virtual network device\n");
+		goto error;
+	}
+
+	sema_init(&priv->async_sem, 1);
+	priv->scan_pending_on_block = false;
+
+	dev_dbg(adapter->dev, "info: %s: Marvell 802.11 Adapter\n", dev->name);
+
+#ifdef CONFIG_DEBUG_FS
+	mwifiex_dev_debugfs_init(priv);
+#endif
+	return dev;
+error:
+	if (dev && (dev->reg_state == NETREG_UNREGISTERED))
+		free_netdev(dev);
+	priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
+
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf);
+
+/*
+ * del_virtual_intf: remove the virtual interface determined by dev
+ */
+int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev)
+{
+	struct mwifiex_private *priv = mwifiex_cfg80211_get_priv(wiphy);
+
+	if (!priv || !dev)
+		return 0;
+
+#ifdef CONFIG_DEBUG_FS
+	mwifiex_dev_debugfs_remove(priv);
+#endif
+
+	if (!netif_queue_stopped(priv->netdev))
+		netif_stop_queue(priv->netdev);
+
+	if (netif_carrier_ok(priv->netdev))
+		netif_carrier_off(priv->netdev);
+
+	if (dev->reg_state == NETREG_REGISTERED)
+		unregister_netdevice(dev);
+
+	if (dev->reg_state == NETREG_UNREGISTERED)
+		free_netdev(dev);
+
+	/* Clear the priv in adapter */
+	priv->netdev = NULL;
+
+	priv->media_connected = false;
+
+	cancel_work_sync(&priv->cfg_workqueue);
+	flush_workqueue(priv->workqueue);
+	destroy_workqueue(priv->workqueue);
+
+	priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(mwifiex_del_virtual_intf);
+
 /* station cfg80211 operations */
 static struct cfg80211_ops mwifiex_cfg80211_ops = {
+	.add_virtual_intf = mwifiex_add_virtual_intf,
+	.del_virtual_intf = mwifiex_del_virtual_intf,
 	.change_virtual_intf = mwifiex_cfg80211_change_virtual_intf,
 	.scan = mwifiex_cfg80211_scan,
 	.connect = mwifiex_cfg80211_connect,
@@ -1186,8 +1328,7 @@ static struct cfg80211_ops mwifiex_cfg80211_ops = {
  * default parameters and handler function pointers, and finally
  * registers the device.
  */
-int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac,
-			      struct mwifiex_private *priv)
+int mwifiex_register_cfg80211(struct mwifiex_private *priv)
 {
 	int ret;
 	void *wdev_priv;
@@ -1227,7 +1368,7 @@ int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac,
 	wdev->wiphy->cipher_suites = mwifiex_cipher_suites;
 	wdev->wiphy->n_cipher_suites = ARRAY_SIZE(mwifiex_cipher_suites);
 
-	memcpy(wdev->wiphy->perm_addr, mac, 6);
+	memcpy(wdev->wiphy->perm_addr, priv->curr_addr, ETH_ALEN);
 	wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
 
 	/* We are using custom domains */
@@ -1254,17 +1395,8 @@ int mwifiex_register_cfg80211(struct net_device *dev, u8 *mac,
 				"info: successfully registered wiphy device\n");
 	}
 
-	dev_net_set(dev, wiphy_net(wdev->wiphy));
-	dev->ieee80211_ptr = wdev;
-	memcpy(dev->dev_addr, wdev->wiphy->perm_addr, 6);
-	memcpy(dev->perm_addr, wdev->wiphy->perm_addr, 6);
-	SET_NETDEV_DEV(dev, wiphy_dev(wdev->wiphy));
 	priv->wdev = wdev;
 
-	dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
-	dev->watchdog_timeo = MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT;
-	dev->hard_header_len += MWIFIEX_MIN_DATA_HEADER_LEN;
-
 	return ret;
 }
 
diff --git a/drivers/net/wireless/mwifiex/cfg80211.h b/drivers/net/wireless/mwifiex/cfg80211.h
index c4db8f3..8d010f2 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.h
+++ b/drivers/net/wireless/mwifiex/cfg80211.h
@@ -24,8 +24,7 @@
 
 #include "main.h"
 
-int mwifiex_register_cfg80211(struct net_device *, u8 *,
-				struct mwifiex_private *);
+int mwifiex_register_cfg80211(struct mwifiex_private *);
 
 void mwifiex_cfg80211_results(struct work_struct *work);
 #endif
diff --git a/drivers/net/wireless/mwifiex/decl.h b/drivers/net/wireless/mwifiex/decl.h
index 94ddc90..6ca62c8 100644
--- a/drivers/net/wireless/mwifiex/decl.h
+++ b/drivers/net/wireless/mwifiex/decl.h
@@ -114,14 +114,6 @@ struct mwifiex_txinfo {
 	u8 bss_index;
 };
 
-struct mwifiex_bss_attr {
-	u8 bss_type;
-	u8 frame_type;
-	u8 active;
-	u8 bss_priority;
-	u8 bss_num;
-};
-
 enum mwifiex_wmm_ac_e {
 	WMM_AC_BK,
 	WMM_AC_BE,
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index 26e685a..e1076b4 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -76,7 +76,7 @@ static int mwifiex_init_priv(struct mwifiex_private *priv)
 	memset(priv->curr_addr, 0xff, ETH_ALEN);
 
 	priv->pkt_tx_ctrl = 0;
-	priv->bss_mode = NL80211_IFTYPE_STATION;
+	priv->bss_mode = NL80211_IFTYPE_UNSPECIFIED;
 	priv->data_rate = 0;	/* Initially indicate the rate as auto */
 	priv->is_data_rate_auto = true;
 	priv->bcn_avg_factor = DEFAULT_BCN_AVG_FACTOR;
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 53579ad..8b05b4f 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -26,21 +26,6 @@
 
 const char driver_version[] = "mwifiex " VERSION " (%s) ";
 
-static struct mwifiex_bss_attr mwifiex_bss_sta[] = {
-	{MWIFIEX_BSS_TYPE_STA, MWIFIEX_DATA_FRAME_TYPE_ETH_II, true, 0, 0},
-};
-
-static int drv_mode = DRV_MODE_STA;
-
-/* Supported drv_mode table */
-static struct mwifiex_drv_mode mwifiex_drv_mode_tbl[] = {
-	{
-		.drv_mode = DRV_MODE_STA,
-		.intf_num = ARRAY_SIZE(mwifiex_bss_sta),
-		.bss_attr = mwifiex_bss_sta,
-	},
-};
-
 /*
  * This function registers the device and performs all the necessary
  * initializations.
@@ -57,7 +42,6 @@ static struct mwifiex_drv_mode mwifiex_drv_mode_tbl[] = {
  * proper cleanup before exiting.
  */
 static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
-			    struct mwifiex_drv_mode *drv_mode_ptr,
 			    void **padapter)
 {
 	struct mwifiex_adapter *adapter;
@@ -78,42 +62,19 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
 		goto error;
 
 	adapter->priv_num = 0;
-	for (i = 0; i < drv_mode_ptr->intf_num; i++) {
-		adapter->priv[i] = NULL;
-
-		if (!drv_mode_ptr->bss_attr[i].active)
-			continue;
-
-		/* Allocate memory for private structure */
-		adapter->priv[i] = kzalloc(sizeof(struct mwifiex_private),
-				GFP_KERNEL);
-		if (!adapter->priv[i]) {
-			dev_err(adapter->dev, "%s: failed to alloc priv[%d]\n",
-			       __func__, i);
-			goto error;
-		}
 
-		adapter->priv_num++;
-		adapter->priv[i]->adapter = adapter;
-		/* Save bss_type, frame_type & bss_priority */
-		adapter->priv[i]->bss_type = drv_mode_ptr->bss_attr[i].bss_type;
-		adapter->priv[i]->frame_type =
-					drv_mode_ptr->bss_attr[i].frame_type;
-		adapter->priv[i]->bss_priority =
-					drv_mode_ptr->bss_attr[i].bss_priority;
-
-		if (drv_mode_ptr->bss_attr[i].bss_type == MWIFIEX_BSS_TYPE_STA)
-			adapter->priv[i]->bss_role = MWIFIEX_BSS_ROLE_STA;
-		else if (drv_mode_ptr->bss_attr[i].bss_type ==
-							MWIFIEX_BSS_TYPE_UAP)
-			adapter->priv[i]->bss_role = MWIFIEX_BSS_ROLE_UAP;
-
-		/* Save bss_index & bss_num */
-		adapter->priv[i]->bss_index = i;
-		adapter->priv[i]->bss_num = drv_mode_ptr->bss_attr[i].bss_num;
+	/* Allocate memory for private structure */
+	adapter->priv[0] = kzalloc(sizeof(struct mwifiex_private),
+			GFP_KERNEL);
+	if (!adapter->priv[0]) {
+		dev_err(adapter->dev, "%s: failed to alloc priv[0]\n",
+		       __func__);
+		goto error;
 	}
-	adapter->drv_mode = drv_mode_ptr;
 
+	adapter->priv_num++;
+
+	adapter->priv[0]->adapter = adapter;
 	if (mwifiex_init_lock_list(adapter))
 		goto error;
 
@@ -127,8 +88,10 @@ error:
 	dev_dbg(adapter->dev, "info: leave mwifiex_register with error\n");
 
 	mwifiex_free_lock_list(adapter);
-	for (i = 0; i < drv_mode_ptr->intf_num; i++)
+
+	for (i = 0; i < adapter->priv_num; i++)
 		kfree(adapter->priv[i]);
+
 	kfree(adapter);
 
 	return -1;
@@ -316,38 +279,6 @@ exit_main_proc:
 }
 
 /*
- * This function initializes the software.
- *
- * The main work includes allocating and initializing the adapter structure
- * and initializing the private structures.
- */
-static int
-mwifiex_init_sw(void *card, struct mwifiex_if_ops *if_ops, void **padapter)
-{
-	int i;
-	struct mwifiex_drv_mode *drv_mode_ptr;
-
-	/* find mwifiex_drv_mode entry from mwifiex_drv_mode_tbl */
-	drv_mode_ptr = NULL;
-	for (i = 0; i < ARRAY_SIZE(mwifiex_drv_mode_tbl); i++) {
-		if (mwifiex_drv_mode_tbl[i].drv_mode == drv_mode) {
-			drv_mode_ptr = &mwifiex_drv_mode_tbl[i];
-			break;
-		}
-	}
-
-	if (!drv_mode_ptr) {
-		pr_err("invalid drv_mode=%d\n", drv_mode);
-		return -1;
-	}
-
-	if (mwifiex_register(card, if_ops, drv_mode_ptr, padapter))
-		return -1;
-
-	return 0;
-}
-
-/*
  * This function frees the adapter structure.
  *
  * Additionally, this closes the netlink socket, frees the timers
@@ -649,8 +580,8 @@ static const struct net_device_ops mwifiex_netdev_ops = {
  *
  * In addition, the CFG80211 work queue is also created.
  */
-static void
-mwifiex_init_priv_params(struct mwifiex_private *priv, struct net_device *dev)
+void mwifiex_init_priv_params(struct mwifiex_private *priv,
+						struct net_device *dev)
 {
 	dev->netdev_ops = &mwifiex_netdev_ops;
 	/* Initialize private structure */
@@ -664,118 +595,6 @@ mwifiex_init_priv_params(struct mwifiex_private *priv, struct net_device *dev)
 }
 
 /*
- * This function adds a new logical interface.
- *
- * It allocates, initializes and registers the interface by performing
- * the following opearations -
- *      - Allocate a new net device structure
- *      - Assign device name
- *      - Register the new device with CFG80211 subsystem
- *      - Initialize semaphore and private structure
- *      - Register the new device with kernel
- *      - Create the complete debug FS structure if configured
- */
-static struct mwifiex_private *mwifiex_add_interface(
-			struct mwifiex_adapter *adapter,
-			u8 bss_index, u8 bss_type)
-{
-	struct net_device *dev;
-	struct mwifiex_private *priv;
-	void *mdev_priv;
-
-	dev = alloc_netdev_mq(sizeof(struct mwifiex_private *), "mlan%d",
-			      ether_setup, 1);
-	if (!dev) {
-		dev_err(adapter->dev, "no memory available for netdevice\n");
-		goto error;
-	}
-
-	if (mwifiex_register_cfg80211(dev, adapter->priv[bss_index]->curr_addr,
-				      adapter->priv[bss_index]) != 0) {
-		dev_err(adapter->dev, "cannot register netdevice with cfg80211\n");
-		goto error;
-	}
-	/* Save the priv pointer in netdev */
-	priv = adapter->priv[bss_index];
-	mdev_priv = netdev_priv(dev);
-	*((unsigned long *) mdev_priv) = (unsigned long) priv;
-
-	priv->netdev = dev;
-
-	sema_init(&priv->async_sem, 1);
-	priv->scan_pending_on_block = false;
-
-	mwifiex_init_priv_params(priv, dev);
-
-	SET_NETDEV_DEV(dev, adapter->dev);
-
-	/* Register network device */
-	if (register_netdev(dev)) {
-		dev_err(adapter->dev, "cannot register virtual network device\n");
-		goto error;
-	}
-
-	dev_dbg(adapter->dev, "info: %s: Marvell 802.11 Adapter\n", dev->name);
-#ifdef CONFIG_DEBUG_FS
-	mwifiex_dev_debugfs_init(priv);
-#endif
-	return priv;
-error:
-	if (dev)
-		free_netdev(dev);
-	return NULL;
-}
-
-/*
- * This function removes a logical interface.
- *
- * It deregisters, resets and frees the interface by performing
- * the following operations -
- *      - Disconnect the device if connected, send wireless event to
- *        notify applications.
- *      - Remove the debug FS structure if configured
- *      - Unregister the device from kernel
- *      - Free the net device structure
- *      - Cancel all works and destroy work queue
- *      - Unregister and free the wireless device from CFG80211 subsystem
- */
-static void
-mwifiex_remove_interface(struct mwifiex_adapter *adapter, u8 bss_index)
-{
-	struct net_device *dev;
-	struct mwifiex_private *priv = adapter->priv[bss_index];
-
-	if (!priv)
-		return;
-	dev = priv->netdev;
-
-	if (priv->media_connected)
-		priv->media_connected = false;
-
-#ifdef CONFIG_DEBUG_FS
-	mwifiex_dev_debugfs_remove(priv);
-#endif
-	/* Last reference is our one */
-	dev_dbg(adapter->dev, "info: %s: refcnt = %d\n",
-				dev->name, netdev_refcnt_read(dev));
-
-	if (dev->reg_state == NETREG_REGISTERED)
-		unregister_netdev(dev);
-
-	/* Clear the priv in adapter */
-	priv->netdev = NULL;
-	if (dev)
-		free_netdev(dev);
-
-	cancel_work_sync(&priv->cfg_workqueue);
-	flush_workqueue(priv->workqueue);
-	destroy_workqueue(priv->workqueue);
-	wiphy_unregister(priv->wdev->wiphy);
-	wiphy_free(priv->wdev->wiphy);
-	kfree(priv->wdev);
-}
-
-/*
  * This function check if command is pending.
  */
 int is_command_pending(struct mwifiex_adapter *adapter)
@@ -847,14 +666,14 @@ int
 mwifiex_add_card(void *card, struct semaphore *sem,
 		 struct mwifiex_if_ops *if_ops)
 {
-	int i;
 	struct mwifiex_adapter *adapter;
 	char fmt[64];
+	struct mwifiex_private *priv;
 
 	if (down_interruptible(sem))
 		goto exit_sem_err;
 
-	if (mwifiex_init_sw(card, if_ops, (void **)&adapter)) {
+	if (mwifiex_register(card, if_ops, (void **)&adapter)) {
 		pr_err("%s: software init failed\n", __func__);
 		goto err_init_sw;
 	}
@@ -888,14 +707,26 @@ mwifiex_add_card(void *card, struct semaphore *sem,
 		goto err_init_fw;
 	}
 
-	/* Add interfaces */
-	for (i = 0; i < adapter->drv_mode->intf_num; i++) {
-		if (!mwifiex_add_interface(adapter, i,
-				adapter->drv_mode->bss_attr[i].bss_type)) {
-			goto err_add_intf;
-		}
+	priv = adapter->priv[0];
+
+	if (mwifiex_register_cfg80211(priv) != 0) {
+		dev_err(adapter->dev, "cannot register netdevice"
+			       " with cfg80211\n");
+			goto err_init_fw;
+	}
+
+	rtnl_lock();
+	/* Create station interface by default */
+	if (!mwifiex_add_virtual_intf(priv->wdev->wiphy, "mlan%d",
+				NL80211_IFTYPE_STATION, NULL, NULL)) {
+		rtnl_unlock();
+		dev_err(adapter->dev, "cannot create default station"
+				" interface\n");
+		goto err_add_intf;
 	}
 
+	rtnl_unlock();
+
 	up(sem);
 
 	mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1);
@@ -904,8 +735,9 @@ mwifiex_add_card(void *card, struct semaphore *sem,
 	return 0;
 
 err_add_intf:
-	for (i = 0; i < adapter->priv_num; i++)
-		mwifiex_remove_interface(adapter, i);
+	rtnl_lock();
+	mwifiex_del_virtual_intf(priv->wdev->wiphy, priv->netdev);
+	rtnl_unlock();
 err_init_fw:
 	pr_debug("info: %s: unregister device\n", __func__);
 	adapter->if_ops.unregister_dev(adapter);
@@ -960,7 +792,7 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
 	/* Stop data */
 	for (i = 0; i < adapter->priv_num; i++) {
 		priv = adapter->priv[i];
-		if (priv) {
+		if (priv && priv->netdev) {
 			if (!netif_queue_stopped(priv->netdev))
 				netif_stop_queue(priv->netdev);
 			if (netif_carrier_ok(priv->netdev))
@@ -985,9 +817,20 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem)
 		       atomic_read(&adapter->cmd_pending));
 	}
 
-	/* Remove interface */
-	for (i = 0; i < adapter->priv_num; i++)
-		mwifiex_remove_interface(adapter, i);
+	for (i = 0; i < adapter->priv_num; i++) {
+		priv = adapter->priv[i];
+
+		if (!priv)
+			continue;
+
+		rtnl_lock();
+		mwifiex_del_virtual_intf(priv->wdev->wiphy, priv->netdev);
+		rtnl_unlock();
+	}
+
+	wiphy_unregister(priv->wdev->wiphy);
+	wiphy_free(priv->wdev->wiphy);
+	kfree(priv->wdev);
 
 	mwifiex_terminate_workqueue(adapter);
 
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index e6b6c0c..94f09a4 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -45,15 +45,6 @@ enum {
 	MWIFIEX_SYNC_CMD
 };
 
-#define DRV_MODE_STA       0x1
-
-struct mwifiex_drv_mode {
-	u16 drv_mode;
-	u16 intf_num;
-	struct mwifiex_bss_attr *bss_attr;
-};
-
-
 #define MWIFIEX_MAX_AP				64
 
 #define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT	(5 * HZ)
@@ -546,7 +537,6 @@ struct mwifiex_if_ops {
 struct mwifiex_adapter {
 	struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM];
 	u8 priv_num;
-	struct mwifiex_drv_mode *drv_mode;
 	const struct firmware *firmware;
 	char fw_name[32];
 	struct device *dev;
@@ -792,6 +782,8 @@ int mwifiex_cmd_get_hw_spec(struct mwifiex_private *priv,
 int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
 			    struct host_cmd_ds_command *resp);
 int is_command_pending(struct mwifiex_adapter *adapter);
+void mwifiex_init_priv_params(struct mwifiex_private *priv,
+						struct net_device *dev);
 
 /*
  * This function checks if the queuing is RA based or not.
@@ -966,6 +958,12 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter,
 int mwifiex_check_network_compatibility(struct mwifiex_private *priv,
 					struct mwifiex_bssdescriptor *bss_desc);
 
+struct net_device *mwifiex_add_virtual_intf(struct wiphy *wiphy,
+					char *name, enum nl80211_iftype type,
+					u32 *flags, struct vif_params *params);
+int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct net_device *dev);
+
+
 #ifdef CONFIG_DEBUG_FS
 void mwifiex_debugfs_init(void);
 void mwifiex_debugfs_remove(void);
-- 
1.7.0.2


^ permalink raw reply related

* Re: [PATCH] wl12xx: Add support for HW channel switch
From: Luciano Coelho @ 2011-09-27  5:28 UTC (permalink / raw)
  To: victorg; +Cc: Levi, Shahar, linux-wireless
In-Reply-To: <4E80286C.8090801@ti.com>

On Mon, 2011-09-26 at 10:23 +0300, Victor Goldenshtein wrote: 
> On 26/09/2011 09:25, Luciano Coelho wrote:
> >>> I checked this a bit further and I don't see the point in sending all
> >>> packets here.  In fact, if block_tx is set, we can't even send any more
> >>> frames until the switch happens (or fails).  So we should at least check
> >>> this here.
> >> The block_tx is taken into account in the mac layer.
> >
> > This is a bit strange, though.  I checked the code and nobody seems to
> > be using the block_tx element of ieee80211_channel_switch, so I wonder
> > why it's there at all.
> >
> 
> As far as I know the block_tx is for the DFS channel switch 
> implementation, when block_tx=1, the firmware will not start tx on new 
> channel.

I'll check this up with our firmware team.

-- 
Cheers,
Luca.


^ permalink raw reply

* Re: [PATCH] wl12xx: Add support for HW channel switch
From: Luciano Coelho @ 2011-09-27  5:33 UTC (permalink / raw)
  To: Levi, Shahar; +Cc: linux-wireless
In-Reply-To: <CAHiDVwksE1pjwij9cJDbFjQ_6XVdk2X=ULPpvL4KBnJzqJVLUg@mail.gmail.com>

On Mon, 2011-09-26 at 13:29 +0300, Levi, Shahar wrote: 
> On Mon, Sep 26, 2011 at 9:25 AM, Luciano Coelho <coelho@ti.com> wrote:
> > On Sun, 2011-09-25 at 19:08 +0300, Levi, Shahar wrote:
> >> On Fri, Sep 23, 2011 at 1:59 PM, Luciano Coelho <coelho@ti.com> wrote:
> >> > I'm leaving this patch out for now until I understand this better.
> >> Do you prefer me to set v2 without that line or you could fix that in
> >> the apply stage?
> >
> > No need to send v2.  It seems that Victor will need this change for
> > something else he's working on, so I guess he can take it over once it
> > is needed.  I don't want to include this unless we have a good reason to
> > do it.
> There is a good reason to include this:
> a) It solve STA calibration issue in the FW in case of SW channel
> switch (Rx issues)

This is a good reason (fixing a bug) and should be mentioned in the
commit description.  Do we have more detailed information on this?


> b) This is FW support for channel switch with one command instead of
> using several commands: rate_policies, roc \ join...

This is an optimization and not entirely mandatory.  This is the only
thing I thought this patch was addressing (the commit message was not
very descriptive, so I could only assume).  At this stage (ie. close to
the merge window), I didn't want to assume the risk of a change just for
to optimize things a bit.  And, since I had my doubts about the block_tx
value, I decided not to include it.


> Our latest version pass full test cycle with that fix that solve CS issues.

Okay, once I get the answer from the firmware team about the block_tx
value, I'll fix up this patch and apply it.

Thanks for the explanantions.

-- 
Cheers,
Luca.


^ permalink raw reply

* [PATCH 0/2] rtlwifi: Remove unused routines from USB driver
From: Larry Finger @ 2011-09-27  5:48 UTC (permalink / raw)
  To: linville; +Cc: Larry Finger, linux-wireless

While checking for endian problems in the USB section of rtlwifi, three
unused routines were discovered.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

John,

This is material for 3.2.

Larry
---

Larry Finger (2):
  rtlwifi: Remove unused routine _usb_readN_sync
  rtlwifi: Remove unused _usb_nbytes_read_write and _usb_writeN_sync

 drivers/net/wireless/rtlwifi/usb.c  |   40 -----------------------------------
 drivers/net/wireless/rtlwifi/wifi.h |    8 +-----
 2 files changed, 2 insertions(+), 46 deletions(-)

-- 
1.7.6.3


^ permalink raw reply

* [PATCH 1/2] rtlwifi: Remove unused routine _usb_readN_sync
From: Larry Finger @ 2011-09-27  5:48 UTC (permalink / raw)
  To: linville; +Cc: Larry Finger, linux-wireless
In-Reply-To: <1317102501-17387-1-git-send-email-Larry.Finger@lwfinger.net>

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/usb.c  |   10 ----------
 drivers/net/wireless/rtlwifi/wifi.h |    2 --
 2 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 4bf3cf4..2e544a0 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -211,15 +211,6 @@ static int _usb_nbytes_read_write(struct usb_device *udev, bool read, u32 addr,
 	return status;
 }
 
-static int _usb_readN_sync(struct rtl_priv *rtlpriv, u32 addr, u16 len,
-			   u8 *pdata)
-{
-	struct device *dev = rtlpriv->io.dev;
-
-	return _usb_nbytes_read_write(to_usb_device(dev), true, addr, len,
-				       pdata);
-}
-
 static int _usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, u16 len,
 			     u8 *pdata)
 {
@@ -243,7 +234,6 @@ static void _rtl_usb_io_handler_init(struct device *dev,
 	rtlpriv->io.read8_sync		= _usb_read8_sync;
 	rtlpriv->io.read16_sync		= _usb_read16_sync;
 	rtlpriv->io.read32_sync		= _usb_read32_sync;
-	rtlpriv->io.readN_sync		= _usb_readN_sync;
 }
 
 static void _rtl_usb_io_handler_release(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index 615f6b4..31b3be9 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -950,8 +950,6 @@ struct rtl_io {
 	u8(*read8_sync) (struct rtl_priv *rtlpriv, u32 addr);
 	u16(*read16_sync) (struct rtl_priv *rtlpriv, u32 addr);
 	u32(*read32_sync) (struct rtl_priv *rtlpriv, u32 addr);
-	int (*readN_sync) (struct rtl_priv *rtlpriv, u32 addr, u16 len,
-			    u8 *pdata);
 
 };
 
-- 
1.7.6.3


^ permalink raw reply related

* [PATCH 2/2] rtlwifi: Remove unused _usb_nbytes_read_write and _usb_writeN_sync
From: Larry Finger @ 2011-09-27  5:48 UTC (permalink / raw)
  To: linville; +Cc: Larry Finger, linux-wireless
In-Reply-To: <1317102501-17387-1-git-send-email-Larry.Finger@lwfinger.net>

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/usb.c  |   30 ------------------------------
 drivers/net/wireless/rtlwifi/wifi.h |    6 ++----
 2 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 2e544a0..b42c2e2 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -191,35 +191,6 @@ static void _usb_write32_async(struct rtl_priv *rtlpriv, u32 addr, u32 val)
 	_usb_write_async(to_usb_device(dev), addr, val, 4);
 }
 
-static int _usb_nbytes_read_write(struct usb_device *udev, bool read, u32 addr,
-				  u16 len, u8 *pdata)
-{
-	int status;
-	u8 request;
-	u16 wvalue;
-	u16 index;
-
-	request = REALTEK_USB_VENQT_CMD_REQ;
-	index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */
-	wvalue = (u16)addr;
-	if (read)
-		status = _usbctrl_vendorreq_sync_read(udev, request, wvalue,
-						      index, pdata, len);
-	else
-		status = _usbctrl_vendorreq_async_write(udev, request, wvalue,
-							index, pdata, len);
-	return status;
-}
-
-static int _usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, u16 len,
-			     u8 *pdata)
-{
-	struct device *dev = rtlpriv->io.dev;
-
-	return _usb_nbytes_read_write(to_usb_device(dev), false, addr, len,
-				      pdata);
-}
-
 static void _rtl_usb_io_handler_init(struct device *dev,
 				     struct ieee80211_hw *hw)
 {
@@ -230,7 +201,6 @@ static void _rtl_usb_io_handler_init(struct device *dev,
 	rtlpriv->io.write8_async	= _usb_write8_async;
 	rtlpriv->io.write16_async	= _usb_write16_async;
 	rtlpriv->io.write32_async	= _usb_write32_async;
-	rtlpriv->io.writeN_async	= _usb_writeN_async;
 	rtlpriv->io.read8_sync		= _usb_read8_sync;
 	rtlpriv->io.read16_sync		= _usb_read16_sync;
 	rtlpriv->io.read32_sync		= _usb_read32_sync;
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index 31b3be9..3126485 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -942,10 +942,8 @@ struct rtl_io {
 	unsigned long pci_base_addr;	/*device I/O address */
 
 	void (*write8_async) (struct rtl_priv *rtlpriv, u32 addr, u8 val);
-	void (*write16_async) (struct rtl_priv *rtlpriv, u32 addr, u16 val);
-	void (*write32_async) (struct rtl_priv *rtlpriv, u32 addr, u32 val);
-	int (*writeN_async) (struct rtl_priv *rtlpriv, u32 addr, u16 len,
-			     u8 *pdata);
+	void (*write16_async) (struct rtl_priv *rtlpriv, u32 addr, __le16 val);
+	void (*write32_async) (struct rtl_priv *rtlpriv, u32 addr, __le32 val);
 
 	u8(*read8_sync) (struct rtl_priv *rtlpriv, u32 addr);
 	u16(*read16_sync) (struct rtl_priv *rtlpriv, u32 addr);
-- 
1.7.6.3


^ permalink raw reply related

* [PATCH 1/1] rfkill: add module option to become inactive.
From: Andrew V. Stepanov @ 2011-09-27 10:33 UTC (permalink / raw)
  To: davem, johannes, linville; +Cc: linux-wireless, Andriy Stepanov

From: Andriy Stepanov <stanv@altlinux.ru>

Use as:
modprobe rfkill unblocked=1
or
/etc/modprobe.d/options
options rfkill unblocked=1

Signed-off-by: Andriy Stepanov <stanv@altlinux.ru>
---
 net/rfkill/core.c |   54 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index be90640..9d9014a 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -47,6 +47,10 @@
 				 RFKILL_BLOCK_SW_PREV)
 #define RFKILL_BLOCK_SW_SETCALL	BIT(31)
 
+int rfkill_unblocked;
+module_param_named(unblocked, rfkill_unblocked, int, 0);
+MODULE_PARM_DESC(unblocked, "rfkill subsystem become inactive.");
+
 struct rfkill {
 	spinlock_t		lock;
 
@@ -455,6 +459,10 @@ bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked)
 {
 	bool ret, change;
 
+	if (rfkill_unblocked) {
+		return blocked;
+	}
+
 	ret = __rfkill_set_hw_state(rfkill, blocked, &change);
 
 	if (!rfkill->registered)
@@ -486,6 +494,10 @@ bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked)
 	unsigned long flags;
 	bool prev, hwblock;
 
+	if (rfkill_unblocked) {
+		return blocked;
+	}
+
 	BUG_ON(!rfkill);
 
 	spin_lock_irqsave(&rfkill->lock, flags);
@@ -511,6 +523,10 @@ void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked)
 {
 	unsigned long flags;
 
+	if (rfkill_unblocked) {
+		return;
+	}
+
 	BUG_ON(!rfkill);
 	BUG_ON(rfkill->registered);
 
@@ -526,6 +542,10 @@ void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw)
 	unsigned long flags;
 	bool swprev, hwprev;
 
+	if (rfkill_unblocked) {
+		return;
+	}
+
 	BUG_ON(!rfkill);
 
 	spin_lock_irqsave(&rfkill->lock, flags);
@@ -760,6 +780,10 @@ static int rfkill_dev_uevent(struct device *dev, struct kobj_uevent_env *env)
 
 void rfkill_pause_polling(struct rfkill *rfkill)
 {
+	if (rfkill_unblocked) {
+		return;
+	}
+
 	BUG_ON(!rfkill);
 
 	if (!rfkill->ops->poll)
@@ -771,6 +795,10 @@ EXPORT_SYMBOL(rfkill_pause_polling);
 
 void rfkill_resume_polling(struct rfkill *rfkill)
 {
+	if (rfkill_unblocked) {
+		return;
+	}
+
 	BUG_ON(!rfkill);
 
 	if (!rfkill->ops->poll)
@@ -818,6 +846,10 @@ bool rfkill_blocked(struct rfkill *rfkill)
 	unsigned long flags;
 	u32 state;
 
+	if (rfkill_unblocked) {
+		return false;
+	}
+
 	spin_lock_irqsave(&rfkill->lock, flags);
 	state = rfkill->state;
 	spin_unlock_irqrestore(&rfkill->lock, flags);
@@ -836,6 +868,11 @@ struct rfkill * __must_check rfkill_alloc(const char *name,
 	struct rfkill *rfkill;
 	struct device *dev;
 
+	if (rfkill_unblocked) {
+		printk(KERN_DEBUG "rfkill: ignore object allocation.\n");
+		return ERR_PTR(-ENODEV);
+	}
+
 	if (WARN_ON(!ops))
 		return NULL;
 
@@ -915,6 +952,14 @@ int __must_check rfkill_register(struct rfkill *rfkill)
 	struct device *dev = &rfkill->dev;
 	int error;
 
+	if (rfkill_unblocked) {
+		if (rfkill == ERR_PTR(-ENODEV)) {
+			return 0;
+		} else {
+			return -EINVAL;
+		}
+	}
+
 	BUG_ON(!rfkill);
 
 	mutex_lock(&rfkill_global_mutex);
@@ -978,6 +1023,10 @@ void rfkill_unregister(struct rfkill *rfkill)
 {
 	BUG_ON(!rfkill);
 
+	if (rfkill_unblocked) {
+		return;
+	}
+
 	if (rfkill->ops->poll)
 		cancel_delayed_work_sync(&rfkill->poll_work);
 
@@ -999,6 +1048,11 @@ EXPORT_SYMBOL(rfkill_unregister);
 
 void rfkill_destroy(struct rfkill *rfkill)
 {
+
+	if (rfkill_unblocked) {
+		return;
+	}
+
 	if (rfkill)
 		put_device(&rfkill->dev);
 }
-- 
1.7.4.4


^ permalink raw reply related


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