Linux wireless drivers development
 help / color / mirror / Atom feed
* [RFC] b43: LP-PHY: Initialize SW TX power control
From: Gábor Stefanik @ 2009-08-11 21:03 UTC (permalink / raw)
  To: Michael Buesch, John Linville, Larry Finger
  Cc: linux-wireless, Broadcom Wireless

I'm not sure at all if writing to offset 0 in the TX gain table
is the right thing to do... please clarify.

Not-yet-signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>

---
If this is indeed the right thing to do, please inform me,
and I will resubmit this as a formal patch.

 phy_lp.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c
index 689c932..93451c9 100644
--- a/drivers/net/wireless/b43/phy_lp.c
+++ b/drivers/net/wireless/b43/phy_lp.c
@@ -847,15 +847,23 @@ static void lpphy_calibration(struct b43_wldev *dev)
 /* Initialize TX power control */
 static void lpphy_tx_pctl_init(struct b43_wldev *dev)
 {
+	lpphy_tx_gain_table_entry txgain;
 	if (0/*FIXME HWPCTL capable */) {
 		//TODO
 	} else { /* This device is only software TX power control capable. */
+		txgain.bb_mult = 0x96;
 		if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
-			//TODO
+			txgain.gm = 4;
+			txgain.pad = 12;
+			txgain.pga = 12;
+			txgain.dac = 0;
 		} else {
-			//TODO
-		}
-		//TODO set BB multiplier to 0x0096
+			txgain.gm = 7;
+			txgain.pad = 15;
+			txgain.pga = 14;
+			txgain.dac = 0;
+		} // FIXME offset 0 is just a guess!
+		lpphy_write_gain_table(dev, 0, txgain);
 	}
 }
 



^ permalink raw reply related

* Re: [PATCH 3/7] [compat-2.6] pcmcia_parse_tuple was redefined in pcmcia/cistpl.h
From: Luis R. Rodriguez @ 2009-08-11 21:04 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: linux-wireless
In-Reply-To: <4A81DA33.1050405@hauke-m.de>

On Tue, Aug 11, 2009 at 1:53 PM, Hauke Mehrtens<hauke@hauke-m.de> wrote:
> Hi Luis,
>
> Thank you for applying the rest of the patches. Next time I will use
> --cover-letter when generating the patches.
>
> Luis R. Rodriguez wrote:
>> On Sat, Aug 8, 2009 at 5:38 AM, Hauke Mehrtens<hauke@hauke-m.de> wrote:
>>> fix build:
>>> undef pcmcia_parse_tuple before redefine it again.
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>>> ---
>>>  compat/compat-2.6.28.h |    8 +++++++-
>>>  1 files changed, 7 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/compat/compat-2.6.28.h b/compat/compat-2.6.28.h
>>> index fdc021a..e25259f 100644
>>> --- a/compat/compat-2.6.28.h
>>> +++ b/compat/compat-2.6.28.h
>>> @@ -29,7 +29,13 @@
>>>  })
>>>  #endif /* From include/asm-generic/bug.h */
>>>
>>> -#define pcmcia_parse_tuple(tuple, parse) pcmcia_parse_tuple(NULL, tuple, parse)
>>> +#include <pcmcia/cs_types.h>
>>> +#include <pcmcia/cs.h>
>>> +#include <pcmcia/cistpl.h>
>>> +#ifdef pcmcia_parse_tuple
>>> +#undef pcmcia_parse_tuple
>>> +#define pcmcia_parse_tuple(tuple, parse) pccard_parse_tuple(tuple, parse)
>>> +#endif
>>
>> Where did pccard_parse_tuple() come from?
> In include/pcmcia/cistpl.h pcmcia_parse_tuple(p_dev, tuple, parse) is
> defined as pccard_parse_tuple(tuple, parse)
>
>> Did you see the commit 0df8084caf53774113c8f118e9dd43e660cf9e15 by any
>> chance? That fixed compilation for me against older kernels.
> I still get a compile error with recent compat-wireless including commit
> 0df8084caf53774113c8f118e9dd43e660cf9e15 with kernel <= 2.6.27 in Ubuntu:
>
> In file included from
> /compat-wireless-git/drivers/net/wireless/b43/pcmcia.c:30:
> include/pcmcia/cistpl.h:610:1: warning: "pcmcia_parse_tuple" redefined
> In file included from /compat-wireless-git/include/net/compat.h:19,
>                 from <command-line>:0:
> /compat-wireless-git/include/net/compat-2.6.28.h:32:1: warning: this is
> the location of the previous definition
>
> The above patch fixes it for me. The patch does not look relay nice, do
> you have a better idea how to solve this problem?

Hm odd, compilation worked for me against 2.6.27 using KLIB and
KLIB_BUILD. I'll try to do that again today see if I still can compile
ok or not.

  Luis

^ permalink raw reply

* Re: B43: MGMT (TX callback) fail
From: Larry Finger @ 2009-08-11 21:32 UTC (permalink / raw)
  To: Manuel Schölling; +Cc: linux-wireless
In-Reply-To: <loom.20090811T204305-105@post.gmane.org>

Manuel Schölling wrote:
> 
> Sorry about all the noise.
> I got it working switching to channel 1 (based on this post:
> http://lists.berlios.de/pipermail/bcm43xx-dev/2009-April/008896.html)
> It's for b43 legancy but I'm using 'ordinary' b43...
> 
> Anyway, is it already fixed in SVN version?

What is to fix? The message you posted was from somebody that had a
problem with the Broadcom wl (_CLOSED_ _SOURCE_ _DRIVER_)! We could
not fix that if we wanted to, and we have no interest in touching that
driver.

If you find a bug in b43, and document it, then it will get fixed.

BTW, there is no SVN version. All code versioning is done with git.
The wireless-testing git tree is what most of us use and test.


^ permalink raw reply

* RE: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
From: 吴新华 @ 2009-08-12  0:33 UTC (permalink / raw)
  To: John W. Linville
  Cc: Johannes Berg, javier@cozybit.com, linux-wireless@vger.kernel.org,
	andrey@cozybit.com, devel@lists.open80211s.org
In-Reply-To: <20090811184716.GH2634@tuxdriver.com>

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fDQpGcm9tOiBKb2huIFcuIExp
bnZpbGxlIFtsaW52aWxsZUB0dXhkcml2ZXIuY29tXQ0KU2VudDogV2VkbmVzZGF5LCBBdWd1c3Qg
MTIsIDIwMDkgMjo0NyBBTQ0KVG86IM7i0MK7qg0KQ2M6IEpvaGFubmVzIEJlcmc7IGphdmllckBj
b3p5Yml0LmNvbTsgbGludXgtd2lyZWxlc3NAdmdlci5rZXJuZWwub3JnOyBhbmRyZXlAY296eWJp
dC5jb207IGRldmVsQGxpc3RzLm9wZW44MDIxMXM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ICAgICAgICAgICAgICAgKG1wYXRo
LT5mbGFncyAmIE1FU0hfUEFUSF9BQ1RJVkUpKSB7DQo+ICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIHJlcGx5ID0gdHJ1ZTsNCj4gQEAgLTQ0NywxNCArNDQ4LDE1IEBAIHN0YXRpYyB2b2lk
IGh3bXBfcHJlcV9mcmFtZV9wcm9jZXNzKHN0cnVjdCBpZWVlODAyMTFfc3ViX2lmX2RhdGEgKnNk
YXRhLA0KPg0KPiAgICAgICBpZiAocmVwbHkpIHsNCj4gICAgICAgICAgICAgICBsaWZldGltZSA9
IFBSRVFfSUVfTElGRVRJTUUocHJlcV9lbGVtKTsNCj4gLSAgICAgICAgICAgICB0dGwgPSBpZm1z
aC0+bXNoY2ZnLmRvdDExTWVzaFRUTDsNCj4gLSAgICAgICAgICAgICBpZiAodHRsICE9IDApDQo+
ICsgICAgICAgICAgICAgdHRsID0gUFJFUV9JRV9UVEwocHJlcV9lbGVtKTsNCj4gKyAgICAgICAg
ICAgICBpZiAodHRsICE9IDApIHsNCj4gKyAgICAgICAgICAgICAgICAgICAgIHR0bCA9IGlmbXNo
LT5tc2hjZmcuZG90MTFNZXNoVFRMOw0KPiAgICAgICAgICAgICAgICAgICAgICAgbWVzaF9wYXRo
X3NlbF9mcmFtZV90eChNUEFUSF9QUkVQLCAwLCBkc3RfYWRkciwNCj4gICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgY3B1X3RvX2xlMzIoZHN0X2RzbiksIDAsIG9yaWdfYWRkciwNCj4gICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgY3B1X3RvX2xlMzIob3JpZ19kc24pLCBtZ210LT5z
YSwgMCwgdHRsLA0KPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcHVfdG9fbGUzMihs
aWZldGltZSksIGNwdV90b19sZTMyKG1ldHJpYyksDQo+ICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIDAsIHNkYXRhKTsNCj4gL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HwNCj4gICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICBEU05fTFQobXBhdGgtPmRzbiwgZHN0X2RzbikpIHsNCj4g
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXBhdGgtPmRzbiA9IGRzdF9kc247DQo+IC0g
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1wYXRoLT5mbGFncyAmPSBNRVNIX1BBVEhfRFNO
X1ZBTElEOw0KPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtcGF0aC0+ZmxhZ3MgfD0g
TUVTSF9QQVRIX0RTTl9WQUxJRDsNCj4gICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAo
KCEoZHN0X2ZsYWdzICYgTVBfRl9ETykpICYmDQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgKG1wYXRoLT5mbGFncyAmIE1FU0hfUEFUSF9BQ1RJVkUpKSB7DQo+ICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIHJlcGx5ID0gdHJ1ZTsNCj4gQEAgLTQ0NywxNCArNDQ4
LDE1IEBAIHN0YXRpYyB2b2lkIGh3bXBfcHJlcV9mcmFtZV9wcm9jZXNzKHN0cnVjdCBpZWVlODAy
MTFfc3ViX2lmX2RhdGEgKnNkYXRhLA0KPg0KPiAgICAgICBpZiAocmVwbHkpIHsNCj4gICAgICAg
ICAgICAgICBsaWZldGltZSA9IFBSRVFfSUVfTElGRVRJTUUocHJlcV9lbGVtKTsNCj4gLSAgICAg
ICAgICAgICB0dGwgPSBpZm1zaC0+bXNoY2ZnLmRvdDExTWVzaFRUTDsNCj4gLSAgICAgICAgICAg
ICBpZiAodHRsICE9IDApDQo+ICsgICAgICAgICAgICAgdHRsID0gUFJFUV9JRV9UVEwocHJlcV9l
bGVtKTsNCj4gKyAgICAgICAgICAgICBpZiAodHRsICE9IDApIHsNCj4gKyAgICAgICAgICAgICAg
ICAgICAgIHR0bCA9IGlmbXNoLT5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ikgbWdt
dDsNCj4gICAgICAgaWYgKG1nbXQtPnUuYWN0aW9uLnUucGxpbmtfYWN0aW9uLmFjdGlvbl9jb2Rl
ID09IFBMSU5LX0NPTkZJUk0pIHsNCj4gICAgICAgICAgICAgICBiYXNlYWRkciArPSA0Ow0KPiAt
ICAgICAgICAgICAgIGJhc2VsZW4gLT0gNDsNCj4gKyAgICAgICAgICAgICBiYXNlbGVuICs9IDQ7
DQo+ICAgICAgIH0NCj4gICAgICAgaWVlZTgwMl8xMV9wYXJzZV9lbGVtcyhiYXNlYWRkciwgbGVu
IC0gYmFzZWxlbiwgJmVsZW1zKTsNCj4gICAgICAgaWYgKCFlbGVtcy5wZWVyX2xpbmspIHsNCg0K
DQotLQ0KSm9obiBXLiBMaW52aWxsZSAgICAgICAgICAgICAgICBTb21lZGF5IHRoZSB3b3JsZCB3
aWxsIG5lZWQgYSBoZXJvLCBhbmQgeW91DQpsaW52aWxsZUB0dXhkcml2ZXIuY29tICAgICAgICAg
ICAgICAgICAgbWlnaHQgYmUgYWxsIHdlIGhhdmUuICBCZSByZWFkeS4NCg0KDQotLS0tLS1QbGVh
c2UgY29uc2lkZXIgdGhlIGVudmlyb25tZW50IGJlZm9yZSBwcmludGluZyB0aGlzIGUtbWFpbC4N
Cg0KDQo=

^ permalink raw reply

* Re: [RFC] b43: LP-PHY: Initialize SW TX power control
From: Larry Finger @ 2009-08-12  1:41 UTC (permalink / raw)
  To: Gábor Stefanik
  Cc: Michael Buesch, John Linville, linux-wireless, Broadcom Wireless
In-Reply-To: <4A81DC91.8020208@gmail.com>

Gábor Stefanik wrote:
> I'm not sure at all if writing to offset 0 in the TX gain table
> is the right thing to do... please clarify.
> 
> Not-yet-signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
> 
> ---
> If this is indeed the right thing to do, please inform me,
> and I will resubmit this as a formal patch.
> 
> phy_lp.c |   16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/phy_lp.c
> b/drivers/net/wireless/b43/phy_lp.c
> index 689c932..93451c9 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -847,15 +847,23 @@ static void lpphy_calibration(struct b43_wldev *dev)
> /* Initialize TX power control */
> static void lpphy_tx_pctl_init(struct b43_wldev *dev)
> {
> +    lpphy_tx_gain_table_entry txgain;
>     if (0/*FIXME HWPCTL capable */) {
>         //TODO
>     } else { /* This device is only software TX power control capable. */
> +        txgain.bb_mult = 0x96;
>         if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) {
> -            //TODO
> +            txgain.gm = 4;
> +            txgain.pad = 12;
> +            txgain.pga = 12;
> +            txgain.dac = 0;
>         } else {
> -            //TODO
> -        }
> -        //TODO set BB multiplier to 0x0096
> +            txgain.gm = 7;
> +            txgain.pad = 15;
> +            txgain.pga = 14;

I found a typo in the specs today. The pad should be 14 and pga should
be 15.

> +            txgain.dac = 0;
> +        } // FIXME offset 0 is just a guess!
> +        lpphy_write_gain_table(dev, 0, txgain);

The link was wrong in the page. The correct routine is
http://bcm-v4.sipsolutions.net/802.11/PHY/LP/SetTXGain. It has one
argument &txgain. I don't think this one has been written yet.

Larry

^ permalink raw reply

* Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
From: Javier Cardona @ 2009-08-12  1:42 UTC (permalink / raw)
  To: david woo
  Cc: Johannes Berg, linux-wireless@vger.kernel.org, andrey@cozybit.com,
	linville@tuxdriver.com, devel@lists.open80211s.org
In-Reply-To: <4A815A3B.3080404@realsil.com.cn>

David,

Thanks for the patch.

2009/8/11 david woo <xinhua_wu@realsil.com.cn>:
> [PATCH] mac80211: Fix preq frame process and peer link frame baselen.
>
> This patch is just to fix rreq reply condition, and peer link confirm frame baselen.
>
> Signed-off-by: David Woo <xinhua_wu@realsil.com.cn>
> ---
> diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
> index e1a763e..c065854 100644
> --- a/net/mac80211/mesh_hwmp.c
> +++ b/net/mac80211/mesh_hwmp.c
> @@ -397,7 +397,8 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
>
>  static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
>                                    struct ieee80211_mgmt *mgmt,
> -                                   u8 *preq_elem, u32 metric) {
> +                                   u8 *preq_elem, u32 metric)
> +{

nak

>        struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
>        struct mesh_path *mpath;
>        u8 *dst_addr, *orig_addr;
> @@ -430,7 +431,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
>                        if ((!(mpath->flags & MESH_PATH_DSN_VALID)) ||
>                                        DSN_LT(mpath->dsn, dst_dsn)) {
>                                mpath->dsn = dst_dsn;
> -                               mpath->flags &= MESH_PATH_DSN_VALID;
> +                               mpath->flags |= MESH_PATH_DSN_VALID;

This is a valid fix:  at this point we should set the "destination
sequence number" valid flag, not zero all flags.

>                        } else if ((!(dst_flags & MP_F_DO)) &&
>                                        (mpath->flags & MESH_PATH_ACTIVE)) {
>                                reply = true;
> @@ -447,14 +448,15 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
>
>        if (reply) {
>                lifetime = PREQ_IE_LIFETIME(preq_elem);
> -               ttl = ifmsh->mshcfg.dot11MeshTTL;
> -               if (ttl != 0)
> +               ttl = PREQ_IE_TTL(preq_elem);
> +               if (ttl != 0) {
> +                       ttl = ifmsh->mshcfg.dot11MeshTTL;

Nak.  The reply to a preq should have the locally configured TTL and
not the TTL that was in the PREP.

>                        mesh_path_sel_frame_tx(MPATH_PREP, 0, dst_addr,
>                                cpu_to_le32(dst_dsn), 0, orig_addr,
>                                cpu_to_le32(orig_dsn), mgmt->sa, 0, ttl,
>                                cpu_to_le32(lifetime), cpu_to_le32(metric),
>                                0, sdata);
> -               else
> +               } else
>                        ifmsh->mshstats.dropped_frames_ttl++;
>        }
>
> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
> index cb14253..ffcbad7 100644
> --- a/net/mac80211/mesh_plink.c
> +++ b/net/mac80211/mesh_plink.c
> @@ -409,7 +409,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
>        baselen = (u8 *) mgmt->u.action.u.plink_action.variable - (u8 *) mgmt;
>        if (mgmt->u.action.u.plink_action.action_code == PLINK_CONFIRM) {
>                baseaddr += 4;
> -               baselen -= 4;
> +               baselen += 4;

I'm confused with this.  Could you actually establish plinks after
changing this?

Can you resubmit the patch with only the MESH_PATH_DSN_VALID for now?

Thanks!

Javier

^ permalink raw reply

* Re: diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
From: david woo @ 2009-08-12  6:39 UTC (permalink / raw)
  To: Javier Cardona
  Cc: Johannes Berg, linux-wireless@vger.kernel.org, andrey@cozybit.com,
	linville@tuxdriver.com, devel@lists.open80211s.org
In-Reply-To: <445f43ac0908111842g5e43cd22i372e9b4608de98a6@mail.gmail.com>

Javier,

Thanks for your comments.

Javier Cardona 写道:
> David,
> 
> Thanks for the patch.
> 
> 2009/8/11 david woo <xinhua_wu@realsil.com.cn>:
>> [PATCH] mac80211: Fix preq frame process and peer link frame baselen.
>>
>> This patch is just to fix rreq reply condition, and peer link confirm frame baselen.
>>
>> Signed-off-by: David Woo <xinhua_wu@realsil.com.cn>
>> ---
>> diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
>> index e1a763e..c065854 100644
>> --- a/net/mac80211/mesh_hwmp.c
>> +++ b/net/mac80211/mesh_hwmp.c
>> @@ -397,7 +397,8 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata,
>>
>>  static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
>>                                    struct ieee80211_mgmt *mgmt,
>> -                                   u8 *preq_elem, u32 metric) {
>> +                                   u8 *preq_elem, u32 metric)
>> +{
> 
> nak
> 
>>        struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
>>        struct mesh_path *mpath;
>>        u8 *dst_addr, *orig_addr;
>> @@ -430,7 +431,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
>>                        if ((!(mpath->flags & MESH_PATH_DSN_VALID)) ||
>>                                        DSN_LT(mpath->dsn, dst_dsn)) {
>>                                mpath->dsn = dst_dsn;
>> -                               mpath->flags &= MESH_PATH_DSN_VALID;
>> +                               mpath->flags |= MESH_PATH_DSN_VALID;
> 
> This is a valid fix:  at this point we should set the "destination
> sequence number" valid flag, not zero all flags.
> 
>>                        } else if ((!(dst_flags & MP_F_DO)) &&
>>                                        (mpath->flags & MESH_PATH_ACTIVE)) {
>>                                reply = true;
>> @@ -447,14 +448,15 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
>>
>>        if (reply) {
>>                lifetime = PREQ_IE_LIFETIME(preq_elem);
>> -               ttl = ifmsh->mshcfg.dot11MeshTTL;
>> -               if (ttl != 0)
>> +               ttl = PREQ_IE_TTL(preq_elem);
>> +               if (ttl != 0) {
>> +                       ttl = ifmsh->mshcfg.dot11MeshTTL;
> 
> Nak.  The reply to a preq should have the locally configured TTL and
> not the TTL that was in the PREP.
> 
  Yes, I agree with you, and this patch is just to check whether this PREQ is valid with 
  the ttl it contains instead of local TTL, and the local TTL has also been provided for 
  PREP further process.

>>                        mesh_path_sel_frame_tx(MPATH_PREP, 0, dst_addr,
>>                                cpu_to_le32(dst_dsn), 0, orig_addr,
>>                                cpu_to_le32(orig_dsn), mgmt->sa, 0, ttl,
>>                                cpu_to_le32(lifetime), cpu_to_le32(metric),
>>                                0, sdata);
>> -               else
>> +               } else
>>                        ifmsh->mshstats.dropped_frames_ttl++;
>>        }
>>
>> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
>> index cb14253..ffcbad7 100644
>> --- a/net/mac80211/mesh_plink.c
>> +++ b/net/mac80211/mesh_plink.c
>> @@ -409,7 +409,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
>>        baselen = (u8 *) mgmt->u.action.u.plink_action.variable - (u8 *) mgmt;
>>        if (mgmt->u.action.u.plink_action.action_code == PLINK_CONFIRM) {
>>                baseaddr += 4;
>> -               baselen -= 4;
>> +               baselen += 4;
> 
> I'm confused with this.  Could you actually establish plinks after
> changing this?
  With the baseaddr steps with 4 bytes, while the baselen minus with 4 bytes, it's to avoid 
  following element parser in random with last 8 bytes.
  ===> ieee802_11_parse_elems(baseaddr, len - baselen, &elems);

 baseaddr               
  |<------------------->|

 baseaddr+4  
     |<--len - baselen->|<-4->|<-4->| (baselen -= 4)
     |<--len - baselen->|             (baselen += 4) 
           
> 
> Can you resubmit the patch with only the MESH_PATH_DSN_VALID for now?
> 
> Thanks!
> 
> Javier
> 
> 
> ------Please consider the environment before printing this e-mail. 
> 
> 

David

^ permalink raw reply

* Re: Roaming behavior
From: Holger Schurig @ 2009-08-12  7:07 UTC (permalink / raw)
  To: David Seira; +Cc: linux-wireless
In-Reply-To: <1250003481.4185.7.camel@solid2>

> I want to delete this behavior because I'm developing an
> application which do that alone.

Please look at wpa_supplicants behavior when you configure 
ap_scan= and scan_ssid=. With them, you can configure 
wpa_supplicant to not issue scan requests on it's own.

Then your user-space app can do the monitoring, scanning (via 
nl80211) issue a command to wpa_supplicant to authenticate to 
some AP.

Another option would be to look into network-manager and see what 
it offers.


But basically, mac80211 has inferior support for roaming compared 
to some older solutions.

Some examples: with madwifi, I can tell the driver to only scan 
on channels 1,6,11. That's not exactly standards-conforming, but 
can speed up roaming considerably, because a full scan is now 
way shorter. mac80211 doesn't support such a thing directly. It 
just occurs to me that you might be able to do something like 
with with a special regulatory daemon.

Or with orinoco, you could define a level when to roam (e.g. at 
what SNR/RSSI/whatever it is based on). mac80211 doesn't have 
this.



I'm quite sure that this will be eventually done, and then you 
have the same seamless roaming with all/most of your WLAN cards, 
where with the pre-mac80211 only some of the card did somewhat 
well and other cards were only usable for hot-spot operation.

-- 
http://www.holgerschurig.de

^ permalink raw reply

* Re: Roaming behavior
From: Johannes Berg @ 2009-08-12  7:14 UTC (permalink / raw)
  To: Holger Schurig; +Cc: David Seira, linux-wireless
In-Reply-To: <200908120907.18501.hs4233@mail.mn-solutions.de>

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

On Wed, 2009-08-12 at 09:07 +0200, Holger Schurig wrote:

> Some examples: with madwifi, I can tell the driver to only scan 
> on channels 1,6,11. That's not exactly standards-conforming, but 
> can speed up roaming considerably, because a full scan is now 
> way shorter. mac80211 doesn't support such a thing directly. It 
> just occurs to me that you might be able to do something like 
> with with a special regulatory daemon.

Or you can just ask wpa_supplicant to do that with -Dnl80211.

> Or with orinoco, you could define a level when to roam (e.g. at 
> what SNR/RSSI/whatever it is based on). mac80211 doesn't have 
> this.

The intention is to add signal strength triggers to mac80211/drivers to
notify wpa_supplicant which then implements the algorithm. There are a
ton of algorithms to choose from, so this will be very good for
experimentation, academia and getting the best algorithm eventually :)
Right now you don't have signal strength triggers so you'd have to
monitor the signal strength (like "iw wlan0 link").

johannes

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

^ permalink raw reply

* compile error: compat-wireless-2009-08-12
From: Bringfried Stecklum @ 2009-08-12 10:46 UTC (permalink / raw)
  To: linux-wireless

When trying to compile the latest compat-wireless package on an Ubuntu 8.10
64bit system running linux kernel 2.6.27-12 I get the following error

stecklum@extragalactix:~/System/src/compat-wireless-2009-08-12$ make
./scripts/gen-compat-autoconf.sh config.mk > include/linux/compat_autoconf.h
make -C /lib/modules/2.6.27-12-mygeneric/build 
M=/home/stecklum/System/src/compat-wireless-2009-08-12 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.27-12-mygeneric'
...
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/main.c: 
In function ‘b43_request_firmware’:
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/main.c:2103: 
warning: format not a string literal and no format arguments
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/tables.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/phy_common.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/phy_g.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/phy_a.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/sysfs.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/xmit.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/lo.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/wa.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/dma.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/pio.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/rfkill.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/leds.o
   CC [M] 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/pcmcia.o
In file included from 
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/pcmcia.c:30:
include/pcmcia/cistpl.h:610:1: warning: "pcmcia_parse_tuple" redefined
In file included from 
/home/stecklum/System/src/compat-wireless-2009-08-12/include/net/compat.h:19,
                  from <command-line>:0:
/home/stecklum/System/src/compat-wireless-2009-08-12/include/net/compat-2.6.28.h:32:1: 
warning: this is the location of the previous definition
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/pcmcia.c:91:41: 
error: macro "pcmcia_parse_tuple" requires 3 arguments, but only 2 given
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/pcmcia.c: 
In function ‘b43_pcmcia_probe’:
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/pcmcia.c:91: 
error: ‘pcmcia_parse_tuple’ undeclared (first use in this function)
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/pcmcia.c:91: 
error: (Each undeclared identifier is reported only once
/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/pcmcia.c:91: 
error: for each function it appears in.)
make[4]: *** 
[/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43/pcmcia.o] 
Error 1
make[3]: *** 
[/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless/b43] 
Error 2
make[2]: *** 
[/home/stecklum/System/src/compat-wireless-2009-08-12/drivers/net/wireless] Error 2
make[1]: *** [_module_/home/stecklum/System/src/compat-wireless-2009-08-12] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-12-mygeneric'
make: *** [modules] Error 2

Regards,

	Bringfried




^ permalink raw reply

* [PATCH] iwl3945: fix compilation error in iwl3945_pass_packet_to_mac80211()
From: Kalle Valo @ 2009-08-12 11:07 UTC (permalink / raw)
  To: linville; +Cc: reinette.chatre, linux-wireless

Commit "iwlwifi: Traffic type and counter for debugFs" broke iwl3945 in
a case when CONFIG_IWLWIFI_LEDS is disabled:

drivers/net/wireless/iwlwifi/iwl-3945.c:580: error: 'hdr' undeclared (first use in this function)

Fix it by removing the ifdef check for hdr variable.

Signed-off-by: Kalle Valo <kalle.valo@iki.fi>
---

 drivers/net/wireless/iwlwifi/iwl-3945.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index ae7f163..ba5ef83 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -544,9 +544,7 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,
 				   struct ieee80211_rx_status *stats)
 {
 	struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
-#ifdef CONFIG_IWLWIFI_LEDS
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)IWL_RX_DATA(pkt);
-#endif
 	struct iwl3945_rx_frame_hdr *rx_hdr = IWL_RX_HDR(pkt);
 	struct iwl3945_rx_frame_end *rx_end = IWL_RX_END(pkt);
 	short len = le16_to_cpu(rx_hdr->len);


^ permalink raw reply related

* [PATCH 1/2] wl1251: remove wl1251_ops.c
From: Kalle Valo @ 2009-08-12 11:42 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

From: Kalle Valo <kalle.valo@nokia.com>

Commit "wl1251: remove wl1251_ops" originally removed file wl1251_ops.c,
but while I rebased the patch the removal got lost. Now remote the file
for real.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
---

 drivers/net/wireless/wl12xx/wl1251_ops.c |  729 ------------------------------
 1 files changed, 0 insertions(+), 729 deletions(-)
 delete mode 100644 drivers/net/wireless/wl12xx/wl1251_ops.c

diff --git a/drivers/net/wireless/wl12xx/wl1251_ops.c b/drivers/net/wireless/wl12xx/wl1251_ops.c
deleted file mode 100644
index 758280a..0000000
--- a/drivers/net/wireless/wl12xx/wl1251_ops.c
+++ /dev/null
@@ -1,729 +0,0 @@
-/*
- * This file is part of wl1251
- *
- * Copyright (C) 2008-2009 Nokia Corporation
- *
- * Contact: Kalle Valo <kalle.valo@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-
-#include "wl1251_ops.h"
-#include "reg.h"
-#include "wl1251_io.h"
-#include "wl1251_spi.h"
-#include "wl1251_boot.h"
-#include "wl1251_event.h"
-#include "wl1251_acx.h"
-#include "wl1251_tx.h"
-#include "wl1251_rx.h"
-#include "wl1251_ps.h"
-#include "wl1251_init.h"
-
-static struct wl1251_partition_set wl1251_part_table[PART_TABLE_LEN] = {
-	[PART_DOWN] = {
-		.mem = {
-			.start = 0x00000000,
-			.size  = 0x00016800
-		},
-		.reg = {
-			.start = REGISTERS_BASE,
-			.size  = REGISTERS_DOWN_SIZE
-		},
-	},
-
-	[PART_WORK] = {
-		.mem = {
-			.start = 0x00028000,
-			.size  = 0x00014000
-		},
-		.reg = {
-			.start = REGISTERS_BASE,
-			.size  = REGISTERS_WORK_SIZE
-		},
-	},
-
-	/* WL1251 doesn't use the DRPW partition, so we don't set it here */
-};
-
-static enum wl12xx_acx_int_reg wl1251_acx_reg_table[ACX_REG_TABLE_LEN] = {
-	[ACX_REG_INTERRUPT_TRIG]     = (REGISTERS_BASE + 0x0474),
-	[ACX_REG_INTERRUPT_TRIG_H]   = (REGISTERS_BASE + 0x0478),
-	[ACX_REG_INTERRUPT_MASK]     = (REGISTERS_BASE + 0x0494),
-	[ACX_REG_HINT_MASK_SET]      = (REGISTERS_BASE + 0x0498),
-	[ACX_REG_HINT_MASK_CLR]      = (REGISTERS_BASE + 0x049C),
-	[ACX_REG_INTERRUPT_NO_CLEAR] = (REGISTERS_BASE + 0x04B0),
-	[ACX_REG_INTERRUPT_CLEAR]    = (REGISTERS_BASE + 0x04A4),
-	[ACX_REG_INTERRUPT_ACK]      = (REGISTERS_BASE + 0x04A8),
-	[ACX_REG_SLV_SOFT_RESET]     = (REGISTERS_BASE + 0x0000),
-	[ACX_REG_EE_START]           = (REGISTERS_BASE + 0x080C),
-	[ACX_REG_ECPU_CONTROL]       = (REGISTERS_BASE + 0x0804)
-};
-
-static int wl1251_upload_firmware(struct wl1251 *wl)
-{
-	struct wl1251_partition_set *p_table = wl->chip.p_table;
-	int addr, chunk_num, partition_limit;
-	size_t fw_data_len;
-	u8 *p;
-
-	/* whal_FwCtrl_LoadFwImageSm() */
-
-	wl1251_debug(DEBUG_BOOT, "chip id before fw upload: 0x%x",
-		     wl1251_reg_read32(wl, CHIP_ID_B));
-
-	/* 10.0 check firmware length and set partition */
-	fw_data_len =  (wl->fw[4] << 24) | (wl->fw[5] << 16) |
-		(wl->fw[6] << 8) | (wl->fw[7]);
-
-	wl1251_debug(DEBUG_BOOT, "fw_data_len %zu chunk_size %d", fw_data_len,
-		CHUNK_SIZE);
-
-	if ((fw_data_len % 4) != 0) {
-		wl1251_error("firmware length not multiple of four");
-		return -EIO;
-	}
-
-	wl1251_set_partition(wl,
-			     p_table[PART_DOWN].mem.start,
-			     p_table[PART_DOWN].mem.size,
-			     p_table[PART_DOWN].reg.start,
-			     p_table[PART_DOWN].reg.size);
-
-	/* 10.1 set partition limit and chunk num */
-	chunk_num = 0;
-	partition_limit = p_table[PART_DOWN].mem.size;
-
-	while (chunk_num < fw_data_len / CHUNK_SIZE) {
-		/* 10.2 update partition, if needed */
-		addr = p_table[PART_DOWN].mem.start +
-			(chunk_num + 2) * CHUNK_SIZE;
-		if (addr > partition_limit) {
-			addr = p_table[PART_DOWN].mem.start +
-				chunk_num * CHUNK_SIZE;
-			partition_limit = chunk_num * CHUNK_SIZE +
-				p_table[PART_DOWN].mem.size;
-			wl1251_set_partition(wl,
-					     addr,
-					     p_table[PART_DOWN].mem.size,
-					     p_table[PART_DOWN].reg.start,
-					     p_table[PART_DOWN].reg.size);
-		}
-
-		/* 10.3 upload the chunk */
-		addr = p_table[PART_DOWN].mem.start + chunk_num * CHUNK_SIZE;
-		p = wl->fw + FW_HDR_SIZE + chunk_num * CHUNK_SIZE;
-		wl1251_debug(DEBUG_BOOT, "uploading fw chunk 0x%p to 0x%x",
-			     p, addr);
-		wl1251_mem_write(wl, addr, p, CHUNK_SIZE);
-
-		chunk_num++;
-	}
-
-	/* 10.4 upload the last chunk */
-	addr = p_table[PART_DOWN].mem.start + chunk_num * CHUNK_SIZE;
-	p = wl->fw + FW_HDR_SIZE + chunk_num * CHUNK_SIZE;
-	wl1251_debug(DEBUG_BOOT, "uploading fw last chunk (%zu B) 0x%p to 0x%x",
-		     fw_data_len % CHUNK_SIZE, p, addr);
-	wl1251_mem_write(wl, addr, p, fw_data_len % CHUNK_SIZE);
-
-	return 0;
-}
-
-static int wl1251_upload_nvs(struct wl1251 *wl)
-{
-	size_t nvs_len, nvs_bytes_written, burst_len;
-	int nvs_start, i;
-	u32 dest_addr, val;
-	u8 *nvs_ptr, *nvs;
-
-	nvs = wl->nvs;
-	if (nvs == NULL)
-		return -ENODEV;
-
-	nvs_ptr = nvs;
-
-	nvs_len = wl->nvs_len;
-	nvs_start = wl->fw_len;
-
-	/*
-	 * Layout before the actual NVS tables:
-	 * 1 byte : burst length.
-	 * 2 bytes: destination address.
-	 * n bytes: data to burst copy.
-	 *
-	 * This is ended by a 0 length, then the NVS tables.
-	 */
-
-	while (nvs_ptr[0]) {
-		burst_len = nvs_ptr[0];
-		dest_addr = (nvs_ptr[1] & 0xfe) | ((u32)(nvs_ptr[2] << 8));
-
-		/* We move our pointer to the data */
-		nvs_ptr += 3;
-
-		for (i = 0; i < burst_len; i++) {
-			val = (nvs_ptr[0] | (nvs_ptr[1] << 8)
-			       | (nvs_ptr[2] << 16) | (nvs_ptr[3] << 24));
-
-			wl1251_debug(DEBUG_BOOT,
-				     "nvs burst write 0x%x: 0x%x",
-				     dest_addr, val);
-			wl1251_mem_write32(wl, dest_addr, val);
-
-			nvs_ptr += 4;
-			dest_addr += 4;
-		}
-	}
-
-	/*
-	 * We've reached the first zero length, the first NVS table
-	 * is 7 bytes further.
-	 */
-	nvs_ptr += 7;
-	nvs_len -= nvs_ptr - nvs;
-	nvs_len = ALIGN(nvs_len, 4);
-
-	/* Now we must set the partition correctly */
-	wl1251_set_partition(wl, nvs_start,
-			     wl->chip.p_table[PART_DOWN].mem.size,
-			     wl->chip.p_table[PART_DOWN].reg.start,
-			     wl->chip.p_table[PART_DOWN].reg.size);
-
-	/* And finally we upload the NVS tables */
-	nvs_bytes_written = 0;
-	while (nvs_bytes_written < nvs_len) {
-		val = (nvs_ptr[0] | (nvs_ptr[1] << 8)
-		       | (nvs_ptr[2] << 16) | (nvs_ptr[3] << 24));
-
-		val = cpu_to_le32(val);
-
-		wl1251_debug(DEBUG_BOOT,
-			     "nvs write table 0x%x: 0x%x",
-			     nvs_start, val);
-		wl1251_mem_write32(wl, nvs_start, val);
-
-		nvs_ptr += 4;
-		nvs_bytes_written += 4;
-		nvs_start += 4;
-	}
-
-	return 0;
-}
-
-static int wl1251_boot(struct wl1251 *wl)
-{
-	int ret = 0, minor_minor_e2_ver;
-	u32 tmp, boot_data;
-
-	ret = wl1251_boot_soft_reset(wl);
-	if (ret < 0)
-		goto out;
-
-	/* 2. start processing NVS file */
-	ret = wl->chip.op_upload_nvs(wl);
-	if (ret < 0)
-		goto out;
-
-	/* write firmware's last address (ie. it's length) to
-	 * ACX_EEPROMLESS_IND_REG */
-	wl1251_reg_write32(wl, ACX_EEPROMLESS_IND_REG, wl->fw_len);
-
-	/* 6. read the EEPROM parameters */
-	tmp = wl1251_reg_read32(wl, SCR_PAD2);
-
-	/* 7. read bootdata */
-	wl->boot_attr.radio_type = (tmp & 0x0000FF00) >> 8;
-	wl->boot_attr.major = (tmp & 0x00FF0000) >> 16;
-	tmp = wl1251_reg_read32(wl, SCR_PAD3);
-
-	/* 8. check bootdata and call restart sequence */
-	wl->boot_attr.minor = (tmp & 0x00FF0000) >> 16;
-	minor_minor_e2_ver = (tmp & 0xFF000000) >> 24;
-
-	wl1251_debug(DEBUG_BOOT, "radioType 0x%x majorE2Ver 0x%x "
-		     "minorE2Ver 0x%x minor_minor_e2_ver 0x%x",
-		     wl->boot_attr.radio_type, wl->boot_attr.major,
-		     wl->boot_attr.minor, minor_minor_e2_ver);
-
-	ret = wl1251_boot_init_seq(wl);
-	if (ret < 0)
-		goto out;
-
-	/* 9. NVS processing done */
-	boot_data = wl1251_reg_read32(wl, ACX_REG_ECPU_CONTROL);
-
-	wl1251_debug(DEBUG_BOOT, "halt boot_data 0x%x", boot_data);
-
-	/* 10. check that ECPU_CONTROL_HALT bits are set in
-	 * pWhalBus->uBootData and start uploading firmware
-	 */
-	if ((boot_data & ECPU_CONTROL_HALT) == 0) {
-		wl1251_error("boot failed, ECPU_CONTROL_HALT not set");
-		ret = -EIO;
-		goto out;
-	}
-
-	ret = wl->chip.op_upload_fw(wl);
-	if (ret < 0)
-		goto out;
-
-	/* 10.5 start firmware */
-	ret = wl1251_boot_run_firmware(wl);
-	if (ret < 0)
-		goto out;
-
-out:
-	return ret;
-}
-
-static int wl1251_mem_cfg(struct wl1251 *wl)
-{
-	struct wl1251_acx_config_memory *mem_conf;
-	int ret, i;
-
-	wl1251_debug(DEBUG_ACX, "wl1251 mem cfg");
-
-	mem_conf = kzalloc(sizeof(*mem_conf), GFP_KERNEL);
-	if (!mem_conf) {
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	/* memory config */
-	mem_conf->mem_config.num_stations = cpu_to_le16(DEFAULT_NUM_STATIONS);
-	mem_conf->mem_config.rx_mem_block_num = 35;
-	mem_conf->mem_config.tx_min_mem_block_num = 64;
-	mem_conf->mem_config.num_tx_queues = MAX_TX_QUEUES;
-	mem_conf->mem_config.host_if_options = HOSTIF_PKT_RING;
-	mem_conf->mem_config.num_ssid_profiles = 1;
-	mem_conf->mem_config.debug_buffer_size =
-		cpu_to_le16(TRACE_BUFFER_MAX_SIZE);
-
-	/* RX queue config */
-	mem_conf->rx_queue_config.dma_address = 0;
-	mem_conf->rx_queue_config.num_descs = ACX_RX_DESC_DEF;
-	mem_conf->rx_queue_config.priority = DEFAULT_RXQ_PRIORITY;
-	mem_conf->rx_queue_config.type = DEFAULT_RXQ_TYPE;
-
-	/* TX queue config */
-	for (i = 0; i < MAX_TX_QUEUES; i++) {
-		mem_conf->tx_queue_config[i].num_descs = ACX_TX_DESC_DEF;
-		mem_conf->tx_queue_config[i].attributes = i;
-	}
-
-	ret = wl1251_cmd_configure(wl, ACX_MEM_CFG, mem_conf,
-				   sizeof(*mem_conf));
-	if (ret < 0) {
-		wl1251_warning("wl1251 mem config failed: %d", ret);
-		goto out;
-	}
-
-out:
-	kfree(mem_conf);
-	return ret;
-}
-
-static int wl1251_hw_init_mem_config(struct wl1251 *wl)
-{
-	int ret;
-
-	ret = wl1251_mem_cfg(wl);
-	if (ret < 0)
-		return ret;
-
-	wl->target_mem_map = kzalloc(sizeof(struct wl1251_acx_mem_map),
-					  GFP_KERNEL);
-	if (!wl->target_mem_map) {
-		wl1251_error("couldn't allocate target memory map");
-		return -ENOMEM;
-	}
-
-	/* we now ask for the firmware built memory map */
-	ret = wl1251_acx_mem_map(wl, wl->target_mem_map,
-				 sizeof(struct wl1251_acx_mem_map));
-	if (ret < 0) {
-		wl1251_error("couldn't retrieve firmware memory map");
-		kfree(wl->target_mem_map);
-		wl->target_mem_map = NULL;
-		return ret;
-	}
-
-	return 0;
-}
-
-static void wl1251_set_ecpu_ctrl(struct wl1251 *wl, u32 flag)
-{
-	u32 cpu_ctrl;
-
-	/* 10.5.0 run the firmware (I) */
-	cpu_ctrl = wl1251_reg_read32(wl, ACX_REG_ECPU_CONTROL);
-
-	/* 10.5.1 run the firmware (II) */
-	cpu_ctrl &= ~flag;
-	wl1251_reg_write32(wl, ACX_REG_ECPU_CONTROL, cpu_ctrl);
-}
-
-static void wl1251_target_enable_interrupts(struct wl1251 *wl)
-{
-	/* Enable target's interrupts */
-	wl->intr_mask = WL1251_ACX_INTR_RX0_DATA |
-		WL1251_ACX_INTR_RX1_DATA |
-		WL1251_ACX_INTR_TX_RESULT |
-		WL1251_ACX_INTR_EVENT_A |
-		WL1251_ACX_INTR_EVENT_B |
-		WL1251_ACX_INTR_INIT_COMPLETE;
-	wl1251_boot_target_enable_interrupts(wl);
-}
-
-static void wl1251_fw_version(struct wl1251 *wl)
-{
-	wl1251_acx_fw_version(wl, wl->chip.fw_ver, sizeof(wl->chip.fw_ver));
-}
-
-static void wl1251_irq_work(struct work_struct *work)
-{
-	u32 intr;
-	struct wl1251 *wl =
-		container_of(work, struct wl1251, irq_work);
-	int ret;
-
-	mutex_lock(&wl->mutex);
-
-	wl1251_debug(DEBUG_IRQ, "IRQ work");
-
-	if (wl->state == WL1251_STATE_OFF)
-		goto out;
-
-	ret = wl1251_ps_elp_wakeup(wl);
-	if (ret < 0)
-		goto out;
-
-	wl1251_reg_write32(wl, ACX_REG_INTERRUPT_MASK, WL1251_ACX_INTR_ALL);
-
-	intr = wl1251_reg_read32(wl, ACX_REG_INTERRUPT_CLEAR);
-	wl1251_debug(DEBUG_IRQ, "intr: 0x%x", intr);
-
-	if (wl->data_path) {
-		wl->rx_counter =
-			wl1251_mem_read32(wl, wl->data_path->rx_control_addr);
-
-		/* We handle a firmware bug here */
-		switch ((wl->rx_counter - wl->rx_handled) & 0xf) {
-		case 0:
-			wl1251_debug(DEBUG_IRQ, "RX: FW and host in sync");
-			intr &= ~WL1251_ACX_INTR_RX0_DATA;
-			intr &= ~WL1251_ACX_INTR_RX1_DATA;
-			break;
-		case 1:
-			wl1251_debug(DEBUG_IRQ, "RX: FW +1");
-			intr |= WL1251_ACX_INTR_RX0_DATA;
-			intr &= ~WL1251_ACX_INTR_RX1_DATA;
-			break;
-		case 2:
-			wl1251_debug(DEBUG_IRQ, "RX: FW +2");
-			intr |= WL1251_ACX_INTR_RX0_DATA;
-			intr |= WL1251_ACX_INTR_RX1_DATA;
-			break;
-		default:
-			wl1251_warning("RX: FW and host out of sync: %d",
-				       wl->rx_counter - wl->rx_handled);
-			break;
-		}
-
-		wl->rx_handled = wl->rx_counter;
-
-
-		wl1251_debug(DEBUG_IRQ, "RX counter: %d", wl->rx_counter);
-	}
-
-	intr &= wl->intr_mask;
-
-	if (intr == 0) {
-		wl1251_debug(DEBUG_IRQ, "INTR is 0");
-		wl1251_reg_write32(wl, ACX_REG_INTERRUPT_MASK,
-				   ~(wl->intr_mask));
-
-		goto out_sleep;
-	}
-
-	if (intr & WL1251_ACX_INTR_RX0_DATA) {
-		wl1251_debug(DEBUG_IRQ, "WL1251_ACX_INTR_RX0_DATA");
-		wl1251_rx(wl);
-	}
-
-	if (intr & WL1251_ACX_INTR_RX1_DATA) {
-		wl1251_debug(DEBUG_IRQ, "WL1251_ACX_INTR_RX1_DATA");
-		wl1251_rx(wl);
-	}
-
-	if (intr & WL1251_ACX_INTR_TX_RESULT) {
-		wl1251_debug(DEBUG_IRQ, "WL1251_ACX_INTR_TX_RESULT");
-		wl1251_tx_complete(wl);
-	}
-
-	if (intr & (WL1251_ACX_INTR_EVENT_A | WL1251_ACX_INTR_EVENT_B)) {
-		wl1251_debug(DEBUG_IRQ, "WL1251_ACX_INTR_EVENT (0x%x)", intr);
-		if (intr & WL1251_ACX_INTR_EVENT_A)
-			wl1251_event_handle(wl, 0);
-		else
-			wl1251_event_handle(wl, 1);
-	}
-
-	if (intr & WL1251_ACX_INTR_INIT_COMPLETE)
-		wl1251_debug(DEBUG_IRQ, "WL1251_ACX_INTR_INIT_COMPLETE");
-
-	wl1251_reg_write32(wl, ACX_REG_INTERRUPT_MASK, ~(wl->intr_mask));
-
-out_sleep:
-	wl1251_ps_elp_sleep(wl);
-
-out:
-	mutex_unlock(&wl->mutex);
-}
-
-static int wl1251_hw_init_txq_fill(u8 qid,
-				   struct acx_tx_queue_qos_config *config,
-				   u32 num_blocks)
-{
-	config->qid = qid;
-
-	switch (qid) {
-	case QOS_AC_BE:
-		config->high_threshold =
-			(QOS_TX_HIGH_BE_DEF * num_blocks) / 100;
-		config->low_threshold =
-			(QOS_TX_LOW_BE_DEF * num_blocks) / 100;
-		break;
-	case QOS_AC_BK:
-		config->high_threshold =
-			(QOS_TX_HIGH_BK_DEF * num_blocks) / 100;
-		config->low_threshold =
-			(QOS_TX_LOW_BK_DEF * num_blocks) / 100;
-		break;
-	case QOS_AC_VI:
-		config->high_threshold =
-			(QOS_TX_HIGH_VI_DEF * num_blocks) / 100;
-		config->low_threshold =
-			(QOS_TX_LOW_VI_DEF * num_blocks) / 100;
-		break;
-	case QOS_AC_VO:
-		config->high_threshold =
-			(QOS_TX_HIGH_VO_DEF * num_blocks) / 100;
-		config->low_threshold =
-			(QOS_TX_LOW_VO_DEF * num_blocks) / 100;
-		break;
-	default:
-		wl1251_error("Invalid TX queue id: %d", qid);
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-static int wl1251_hw_init_tx_queue_config(struct wl1251 *wl)
-{
-	struct acx_tx_queue_qos_config *config;
-	struct wl1251_acx_mem_map *wl_mem_map = wl->target_mem_map;
-	int ret, i;
-
-	wl1251_debug(DEBUG_ACX, "acx tx queue config");
-
-	config = kzalloc(sizeof(*config), GFP_KERNEL);
-	if (!config) {
-		ret = -ENOMEM;
-		goto out;
-	}
-
-	for (i = 0; i < MAX_NUM_OF_AC; i++) {
-		ret = wl1251_hw_init_txq_fill(i, config,
-					      wl_mem_map->num_tx_mem_blocks);
-		if (ret < 0)
-			goto out;
-
-		ret = wl1251_cmd_configure(wl, ACX_TX_QUEUE_CFG,
-					   config, sizeof(*config));
-		if (ret < 0)
-			goto out;
-	}
-
-out:
-	kfree(config);
-	return ret;
-}
-
-static int wl1251_hw_init_data_path_config(struct wl1251 *wl)
-{
-	int ret;
-
-	/* asking for the data path parameters */
-	wl->data_path = kzalloc(sizeof(struct acx_data_path_params_resp),
-				GFP_KERNEL);
-	if (!wl->data_path) {
-		wl1251_error("Couldn't allocate data path parameters");
-		return -ENOMEM;
-	}
-
-	ret = wl1251_acx_data_path_params(wl, wl->data_path);
-	if (ret < 0) {
-		kfree(wl->data_path);
-		wl->data_path = NULL;
-		return ret;
-	}
-
-	return 0;
-}
-
-static int wl1251_hw_init(struct wl1251 *wl)
-{
-	struct wl1251_acx_mem_map *wl_mem_map;
-	int ret;
-
-	ret = wl1251_hw_init_hwenc_config(wl);
-	if (ret < 0)
-		return ret;
-
-	/* Template settings */
-	ret = wl1251_hw_init_templates_config(wl);
-	if (ret < 0)
-		return ret;
-
-	/* Default memory configuration */
-	ret = wl1251_hw_init_mem_config(wl);
-	if (ret < 0)
-		return ret;
-
-	/* Default data path configuration  */
-	ret = wl1251_hw_init_data_path_config(wl);
-	if (ret < 0)
-		goto out_free_memmap;
-
-	/* RX config */
-	ret = wl1251_hw_init_rx_config(wl,
-				       RX_CFG_PROMISCUOUS | RX_CFG_TSF,
-				       RX_FILTER_OPTION_DEF);
-	/* RX_CONFIG_OPTION_ANY_DST_ANY_BSS,
-	   RX_FILTER_OPTION_FILTER_ALL); */
-	if (ret < 0)
-		goto out_free_data_path;
-
-	/* TX queues config */
-	ret = wl1251_hw_init_tx_queue_config(wl);
-	if (ret < 0)
-		goto out_free_data_path;
-
-	/* PHY layer config */
-	ret = wl1251_hw_init_phy_config(wl);
-	if (ret < 0)
-		goto out_free_data_path;
-
-	/* Beacon filtering */
-	ret = wl1251_hw_init_beacon_filter(wl);
-	if (ret < 0)
-		goto out_free_data_path;
-
-	/* Bluetooth WLAN coexistence */
-	ret = wl1251_hw_init_pta(wl);
-	if (ret < 0)
-		goto out_free_data_path;
-
-	/* Energy detection */
-	ret = wl1251_hw_init_energy_detection(wl);
-	if (ret < 0)
-		goto out_free_data_path;
-
-	/* Beacons and boradcast settings */
-	ret = wl1251_hw_init_beacon_broadcast(wl);
-	if (ret < 0)
-		goto out_free_data_path;
-
-	/* Enable data path */
-	ret = wl1251_cmd_data_path(wl, wl->channel, 1);
-	if (ret < 0)
-		goto out_free_data_path;
-
-	/* Default power state */
-	ret = wl1251_hw_init_power_auth(wl);
-	if (ret < 0)
-		goto out_free_data_path;
-
-	wl_mem_map = wl->target_mem_map;
-	wl1251_info("%d tx blocks at 0x%x, %d rx blocks at 0x%x",
-		    wl_mem_map->num_tx_mem_blocks,
-		    wl->data_path->tx_control_addr,
-		    wl_mem_map->num_rx_mem_blocks,
-		    wl->data_path->rx_control_addr);
-
-	return 0;
-
- out_free_data_path:
-	kfree(wl->data_path);
-
- out_free_memmap:
-	kfree(wl->target_mem_map);
-
-	return ret;
-}
-
-static int wl1251_plt_init(struct wl1251 *wl)
-{
-	int ret;
-
-	ret = wl1251_hw_init_mem_config(wl);
-	if (ret < 0)
-		return ret;
-
-	ret = wl1251_cmd_data_path(wl, wl->channel, 1);
-	if (ret < 0)
-		return ret;
-
-	return 0;
-}
-
-void wl1251_setup(struct wl1251 *wl)
-{
-	/* FIXME: Is it better to use strncpy here or is this ok? */
-	wl->chip.fw_filename = WL1251_FW_NAME;
-	wl->chip.nvs_filename = WL1251_NVS_NAME;
-
-	/* Now we know what chip we're using, so adjust the power on sleep
-	 * time accordingly */
-	wl->chip.power_on_sleep = WL1251_POWER_ON_SLEEP;
-
-	wl->chip.intr_cmd_complete = WL1251_ACX_INTR_CMD_COMPLETE;
-	wl->chip.intr_init_complete = WL1251_ACX_INTR_INIT_COMPLETE;
-
-	wl->chip.op_upload_nvs = wl1251_upload_nvs;
-	wl->chip.op_upload_fw = wl1251_upload_firmware;
-	wl->chip.op_boot = wl1251_boot;
-	wl->chip.op_set_ecpu_ctrl = wl1251_set_ecpu_ctrl;
-	wl->chip.op_target_enable_interrupts = wl1251_target_enable_interrupts;
-	wl->chip.op_hw_init = wl1251_hw_init;
-	wl->chip.op_plt_init = wl1251_plt_init;
-	wl->chip.op_fw_version = wl1251_fw_version;
-	wl->chip.op_tx_flush = wl1251_tx_flush;
-	wl->chip.op_cmd_join = wl1251_cmd_join;
-
-	wl->chip.p_table = wl1251_part_table;
-	wl->chip.acx_reg_table = wl1251_acx_reg_table;
-
-	INIT_WORK(&wl->irq_work, wl1251_irq_work);
-	INIT_WORK(&wl->tx_work, wl1251_tx_work);
-
-}


^ permalink raw reply related

* [PATCH 2/2] wl1251: remove unused definitions from wl1251_reg.h
From: Kalle Valo @ 2009-08-12 11:42 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless
In-Reply-To: <20090812114251.5006.65671.stgit@tikku>

From: Kalle Valo <kalle.valo@nokia.com>

Luis reported that IRQ_MASK conflicts with include/pcmcia/cs.h on
compat-wireless. Remove that and a bunch of other unused defines
from wl1251_reg.h.

Reported-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
---

 drivers/net/wireless/wl12xx/wl1251_reg.h |  100 ------------------------------
 1 files changed, 0 insertions(+), 100 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1251_reg.h b/drivers/net/wireless/wl12xx/wl1251_reg.h
index 2de47cc..bdd5610 100644
--- a/drivers/net/wireless/wl12xx/wl1251_reg.h
+++ b/drivers/net/wireless/wl12xx/wl1251_reg.h
@@ -42,70 +42,6 @@
 /* ELP WLAN_READY bit */
 #define ELPCTRL_WLAN_READY          0x2
 
-/*
- * Interrupt registers.
- * 64 bit interrupt sources registers ws ced.
- * sme interupts were removed and new ones were added.
- * Order was changed.
- */
-#define FIQ_MASK                       (REGISTERS_BASE + 0x0400)
-#define FIQ_MASK_L                     (REGISTERS_BASE + 0x0400)
-#define FIQ_MASK_H                     (REGISTERS_BASE + 0x0404)
-#define FIQ_MASK_SET                   (REGISTERS_BASE + 0x0408)
-#define FIQ_MASK_SET_L                 (REGISTERS_BASE + 0x0408)
-#define FIQ_MASK_SET_H                 (REGISTERS_BASE + 0x040C)
-#define FIQ_MASK_CLR                   (REGISTERS_BASE + 0x0410)
-#define FIQ_MASK_CLR_L                 (REGISTERS_BASE + 0x0410)
-#define FIQ_MASK_CLR_H                 (REGISTERS_BASE + 0x0414)
-#define IRQ_MASK                       (REGISTERS_BASE + 0x0418)
-#define IRQ_MASK_L                     (REGISTERS_BASE + 0x0418)
-#define IRQ_MASK_H                     (REGISTERS_BASE + 0x041C)
-#define IRQ_MASK_SET                   (REGISTERS_BASE + 0x0420)
-#define IRQ_MASK_SET_L                 (REGISTERS_BASE + 0x0420)
-#define IRQ_MASK_SET_H                 (REGISTERS_BASE + 0x0424)
-#define IRQ_MASK_CLR                   (REGISTERS_BASE + 0x0428)
-#define IRQ_MASK_CLR_L                 (REGISTERS_BASE + 0x0428)
-#define IRQ_MASK_CLR_H                 (REGISTERS_BASE + 0x042C)
-#define ECPU_MASK                      (REGISTERS_BASE + 0x0448)
-#define FIQ_STS_L                      (REGISTERS_BASE + 0x044C)
-#define FIQ_STS_H                      (REGISTERS_BASE + 0x0450)
-#define IRQ_STS_L                      (REGISTERS_BASE + 0x0454)
-#define IRQ_STS_H                      (REGISTERS_BASE + 0x0458)
-#define INT_STS_ND                     (REGISTERS_BASE + 0x0464)
-#define INT_STS_RAW_L                  (REGISTERS_BASE + 0x0464)
-#define INT_STS_RAW_H                  (REGISTERS_BASE + 0x0468)
-#define INT_STS_CLR                    (REGISTERS_BASE + 0x04B4)
-#define INT_STS_CLR_L                  (REGISTERS_BASE + 0x04B4)
-#define INT_STS_CLR_H                  (REGISTERS_BASE + 0x04B8)
-#define INT_ACK                        (REGISTERS_BASE + 0x046C)
-#define INT_ACK_L                      (REGISTERS_BASE + 0x046C)
-#define INT_ACK_H                      (REGISTERS_BASE + 0x0470)
-#define INT_TRIG                       (REGISTERS_BASE + 0x0474)
-#define INT_TRIG_L                     (REGISTERS_BASE + 0x0474)
-#define INT_TRIG_H                     (REGISTERS_BASE + 0x0478)
-#define HOST_STS_L                     (REGISTERS_BASE + 0x045C)
-#define HOST_STS_H                     (REGISTERS_BASE + 0x0460)
-#define HOST_MASK                      (REGISTERS_BASE + 0x0430)
-#define HOST_MASK_L                    (REGISTERS_BASE + 0x0430)
-#define HOST_MASK_H                    (REGISTERS_BASE + 0x0434)
-#define HOST_MASK_SET                  (REGISTERS_BASE + 0x0438)
-#define HOST_MASK_SET_L                (REGISTERS_BASE + 0x0438)
-#define HOST_MASK_SET_H                (REGISTERS_BASE + 0x043C)
-#define HOST_MASK_CLR                  (REGISTERS_BASE + 0x0440)
-#define HOST_MASK_CLR_L                (REGISTERS_BASE + 0x0440)
-#define HOST_MASK_CLR_H                (REGISTERS_BASE + 0x0444)
-
-/* Host Interrupts*/
-#define HINT_MASK                      (REGISTERS_BASE + 0x0494)
-#define HINT_MASK_SET                  (REGISTERS_BASE + 0x0498)
-#define HINT_MASK_CLR                  (REGISTERS_BASE + 0x049C)
-#define HINT_STS_ND_MASKED             (REGISTERS_BASE + 0x04A0)
-/*1150 spec calls this HINT_STS_RAW*/
-#define HINT_STS_ND		       (REGISTERS_BASE + 0x04B0)
-#define HINT_STS_CLR                   (REGISTERS_BASE + 0x04A4)
-#define HINT_ACK                       (REGISTERS_BASE + 0x04A8)
-#define HINT_TRIG                      (REGISTERS_BASE + 0x04AC)
-
 /* Device Configuration registers*/
 #define SOR_CFG                        (REGISTERS_BASE + 0x0800)
 #define ECPU_CTRL                      (REGISTERS_BASE + 0x0804)
@@ -420,16 +356,6 @@ enum wl12xx_acx_int_reg {
 
 
 /*===============================================
-  Phy regs
- ===============================================*/
-#define ACX_PHY_ADDR_REG                SBB_ADDR
-#define ACX_PHY_DATA_REG                SBB_DATA
-#define ACX_PHY_CTRL_REG                SBB_CTL
-#define ACX_PHY_REG_WR_MASK             0x00000001ul
-#define ACX_PHY_REG_RD_MASK             0x00000002ul
-
-
-/*===============================================
  EEPROM Read/Write Request 32bit RW
  ------------------------------------------
  1 EE_READ - EEPROM Read Request 1 - Setting this bit
@@ -498,28 +424,6 @@ enum wl12xx_acx_int_reg {
 #define ACX_CONT_WIND_MIN_MASK   0x0000007f
 #define ACX_CONT_WIND_MAX        0x03ff0000
 
-/*
- * Indirect slave register/memory registers
- * ----------------------------------------
- */
-#define HW_SLAVE_REG_ADDR_REG		0x00000004
-#define HW_SLAVE_REG_DATA_REG		0x00000008
-#define HW_SLAVE_REG_CTRL_REG		0x0000000c
-
-#define SLAVE_AUTO_INC				0x00010000
-#define SLAVE_NO_AUTO_INC			0x00000000
-#define SLAVE_HOST_LITTLE_ENDIAN	0x00000000
-
-#define HW_SLAVE_MEM_ADDR_REG		SLV_MEM_ADDR
-#define HW_SLAVE_MEM_DATA_REG		SLV_MEM_DATA
-#define HW_SLAVE_MEM_CTRL_REG		SLV_MEM_CTL
-#define HW_SLAVE_MEM_ENDIAN_REG		SLV_END_CTL
-
-#define HW_FUNC_EVENT_INT_EN		0x8000
-#define HW_FUNC_EVENT_MASK_REG		0x00000034
-
-#define ACX_MAC_TIMESTAMP_REG	(MAC_TIMESTAMP)
-
 /*===============================================
   HI_CFG Interface Configuration Register Values
   ------------------------------------------
@@ -678,10 +582,6 @@ b12-b0 - Supported Rate indicator bits as defined below.
 ******************************************************************************/
 
 
-#define TNETW1251_CHIP_ID_PG1_0         0x07010101
-#define TNETW1251_CHIP_ID_PG1_1         0x07020101
-#define TNETW1251_CHIP_ID_PG1_2	        0x07030101
-
 /*************************************************************************
 
     Interrupt Trigger Register (Host -> WiLink)


^ permalink raw reply related

* Re: [PATCH] ath9k: Prevent read buffer overflow
From: Vasanthakumar Thiagarajan @ 2009-08-12 11:58 UTC (permalink / raw)
  To: Roel Kluin
  Cc: Luis Rodriguez, linux-wireless@vger.kernel.org,
	ath9k-devel@lists.ath9k.org, Andrew Morton
In-Reply-To: <4A81BB1E.6040904@gmail.com>

On Wed, Aug 12, 2009 at 12:10:30AM +0530, Roel Kluin wrote:
> Prevent a read from valid_rate_index[] with a negative index
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> Maybe we should add this?
> 
> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
> index ba06e78..a67b7f6 100644
> --- a/drivers/net/wireless/ath/ath9k/rc.c
> +++ b/drivers/net/wireless/ath/ath9k/rc.c
> @@ -1458,7 +1458,7 @@ static void ath_rc_init(struct ath_softc *sc,
>                 ath_rc_priv->rate_max_phy = ath_rc_priv->valid_phy_rateidx[i][j-1];
>         }
>         ASSERT(ath_rc_priv->rate_table_size <= RATE_TABLE_SIZE);
> -       ASSERT(k <= RATE_TABLE_SIZE);
> +       ASSERT(k <= RATE_TABLE_SIZE && k >= 4);


NACK, k is initialized to 0 in the for loop few lines above this
ASSERT.

Vasanth

^ permalink raw reply

* Re: [PATCH] ath9k: Prevent read buffer overflow
From: roel kluin @ 2009-08-12 12:35 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan
  Cc: Luis Rodriguez, linux-wireless@vger.kernel.org,
	ath9k-devel@lists.ath9k.org, Andrew Morton
In-Reply-To: <20090812115803.GA4876@vasanth-laptop>

On Wed, Aug 12, 2009 at 1:58 PM, Vasanthakumar
Thiagarajan<vasanth@atheros.com> wrote:
> On Wed, Aug 12, 2009 at 12:10:30AM +0530, Roel Kluin wrote:
>> Prevent a read from valid_rate_index[] with a negative index
>>
>> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
>> ---
>> Maybe we should add this?
>>
>> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
>> index ba06e78..a67b7f6 100644
>> --- a/drivers/net/wireless/ath/ath9k/rc.c
>> +++ b/drivers/net/wireless/ath/ath9k/rc.c
>> @@ -1458,7 +1458,7 @@ static void ath_rc_init(struct ath_softc *sc,
>>                 ath_rc_priv->rate_max_phy = ath_rc_priv->valid_phy_rateidx[i][j-1];
>>         }
>>         ASSERT(ath_rc_priv->rate_table_size <= RATE_TABLE_SIZE);
>> -       ASSERT(k <= RATE_TABLE_SIZE);
>> +       ASSERT(k <= RATE_TABLE_SIZE && k >= 4);
>
>
> NACK, k is initialized to 0 in the for loop few lines above this
> ASSERT.
>
> Vasanth

You could be right, but please explain, I don't understand:

k can only increment if ath_rc_priv->valid_phy_ratecnt[i] != 0
for i = 0 to WLAN_RC_PHY_MAX,

A few lines above these `ath_rc_priv->valid_phy_ratecnt[]'
are initialized to 0.

Say there was no working rate, and we call ath_rc_init_validrates(),

then in ath_rc_init_validrates()
ath_rc_priv->valid_phy_ratecnt[] can be initialized in this loop:

for (i = 0; i < rate_table->rate_cnt; i++) {
    ...
}

but where is this rate_cnt initialized?

[roel@zoinx linux-git]$ git grep rate_cnt
drivers/net/wireless/ath/ath9k/debug.c: max = 80 +
sc->cur_rate_table->rate_cnt * 64;
drivers/net/wireless/ath/ath9k/debug.c: for (i = 0; i <
sc->cur_rate_table->rate_cnt; i++) {
drivers/net/wireless/ath/ath9k/main.c:  if (rate_table->rate_cnt > ATH_RATE_MAX)
drivers/net/wireless/ath/ath9k/main.c:          maxrates = rate_table->rate_cnt;
drivers/net/wireless/ath/ath9k/rc.c:    for (i = 0; i <
rate_table->rate_cnt; i++) {
drivers/net/wireless/ath/ath9k/rc.c:            for (j = 0; j <
rate_table->rate_cnt; j++) {
drivers/net/wireless/ath/ath9k/rc.c:            for (j = 0; j <
rate_table->rate_cnt; j++) {
drivers/net/wireless/ath/ath9k/rc.c:    if ((tx_rate < 0) || (tx_rate
> rate_table->rate_cnt))
drivers/net/wireless/ath/ath9k/rc.h:    int rate_cnt;

Roel

^ permalink raw reply

* Re: [PATCH] ath9k: Prevent read buffer overflow
From: Vasanthakumar Thiagarajan @ 2009-08-12 12:42 UTC (permalink / raw)
  To: roel kluin
  Cc: Vasanth Thiagarajan, Luis Rodriguez,
	linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org,
	Andrew Morton
In-Reply-To: <25e057c00908120535p1135be7ak399599fdca6b636f@mail.gmail.com>

On Wed, Aug 12, 2009 at 06:05:55PM +0530, roel kluin wrote:
> On Wed, Aug 12, 2009 at 1:58 PM, Vasanthakumar
> Thiagarajan<vasanth@atheros.com> wrote:
> > On Wed, Aug 12, 2009 at 12:10:30AM +0530, Roel Kluin wrote:
> >> Prevent a read from valid_rate_index[] with a negative index
> >>
> >> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> >> ---
> >> Maybe we should add this?
> >>
> >> diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
> >> index ba06e78..a67b7f6 100644
> >> --- a/drivers/net/wireless/ath/ath9k/rc.c
> >> +++ b/drivers/net/wireless/ath/ath9k/rc.c
> >> @@ -1458,7 +1458,7 @@ static void ath_rc_init(struct ath_softc *sc,
> >>                 ath_rc_priv->rate_max_phy = ath_rc_priv->valid_phy_rateidx[i][j-1];
> >>         }
> >>         ASSERT(ath_rc_priv->rate_table_size <= RATE_TABLE_SIZE);
> >> -       ASSERT(k <= RATE_TABLE_SIZE);
> >> +       ASSERT(k <= RATE_TABLE_SIZE && k >= 4);
> >
> >
> > NACK, k is initialized to 0 in the for loop few lines above this
> > ASSERT.
> >
> > Vasanth
> 
> but where is this rate_cnt initialized?

from the static rate table for the respective mode. You can find
these tables in the begining of rc.c.


Vasanth


^ permalink raw reply

* Re: [PATCH 1/2] mac802154: add a software MAC 802.15.4 implementation
From: Dmitry Eremin-Solenikov @ 2009-08-12 13:06 UTC (permalink / raw)
  To: Johannes Berg; +Cc: netdev, linux-wireless, Sergey Lapin
In-Reply-To: <1250023198.13529.69.camel@johannes.local>

On Tue, Aug 11, 2009 at 10:39:58PM +0200, Johannes Berg wrote:
> On Wed, 2009-08-12 at 00:23 +0400, Dmitry Eremin-Solenikov wrote:
> 
> > > That return value is strange.
> > 
> > The idea is that tx function can return info about errors during
> > transmit (busy channel, no ACK, etc).
> 
> Well, TX functions don't usually wait for anything so busy channel or no
> ack wouldn't be possible to return there but more like a TX status, and
> I think people are more used to NETDEV_TX_OK etc. return values. But
> it's your choice to make, obviously. If you want to return specific
> information like that though I would recommend making an enum so you get
> at least some type checking (and things like 'return -1' are more
> obviously wrong).

Currently we do all the work from special worker threads, so it's
possible for this callback to sleep. The error isn't yet propagated to
upper layers (there is a huge TODO there), anyway.

> 
> > > We've had no end to trouble with the master netdev, I suggest you look
> > > into the current mac80211 code and see if you can get rid of it.
> > 
> > What troubles w/ master netdev did you have had? I do still see the
> > master devices in mac80211. IIUC, it's planned to replace (from
> > management point of view) the mdev with wiphy instance, isn't it?
> 
> Mostly the userspace API was a mess, and you can't actually _do_
> anything with the master netdev. It also doesn't see all the frames,
> only outgoing. It's very strange.

We were using master netdevices for several purposes:
1) ip link add link mwpanX type wpan, so that we have out-of-box support
   for radio additions. That's really nice thing to have.

2) for SOCK_RAW implementation that can be used to send raw packets
   over-the-air/receive raw packets. I think we can use af_packet for
   this, but I'm still not sure about packet injection.

3) On the RX, we did send a clone of skb to the mdev and clones to slave
   interfaces, thus overcoming your last argument.

> The biggest problem is that it really clutters up the userspace API
> since you can't do any netdev things with it, it's just a placeholder.
> 
> In addition to that, you can't put anything into skb->cb, then push the
> frame to the master netdev, and expect things in skb->cb to still be
> there when the frame arrives at the master netdev. Not sure you do that
> (I hope not because that would be very buggy), but eventually you'll
> probably find that you do want that, etc.

Hmm. It works for us. Could you please tell me more about the problems
with skb->cb ?

> IMHO it's just better practise to not use it in situations like this
> where it can't be really used as a netdev.

We did use it as a netdev, however we can probably live without it.
I'll rethink this interface.

-- 
With best wishes
Dmitry


^ permalink raw reply

* Re: [PATCH 1/2] mac802154: add a software MAC 802.15.4 implementation
From: Johannes Berg @ 2009-08-12 13:13 UTC (permalink / raw)
  To: Dmitry Eremin-Solenikov; +Cc: netdev, linux-wireless, Sergey Lapin
In-Reply-To: <20090812130605.GA17169@doriath.ww600.siemens.net>

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

On Wed, 2009-08-12 at 17:06 +0400, Dmitry Eremin-Solenikov wrote:

> > In addition to that, you can't put anything into skb->cb, then push the
> > frame to the master netdev, and expect things in skb->cb to still be
> > there when the frame arrives at the master netdev. Not sure you do that
> > (I hope not because that would be very buggy), but eventually you'll
> > probably find that you do want that, etc.
> 
> Hmm. It works for us. Could you please tell me more about the problems
> with skb->cb ?

Uh, well, you don't own the skb->cb between dev_queue_xmit() and
ndo_start_xmit(). In fact, your phy_cb data will be overwritten by the
qdisc.

So your code is completely and utterly broken just like mac80211 was for
a long time.

Also, looking into this a bit more, I see no reason to allocate a work
struct every time you get a frame -- better just queue them up and stick
everything else into skb->cb. In fact, you don't need a master netdev
here anyway, just move all code from ieee802154_master_hard_start_xmit()
into ieee802154_net_xmit().

johannes

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

^ permalink raw reply

* Re: Libertas: Association request to the driver failed
From: Jonathan Cameron @ 2009-08-12  8:17 UTC (permalink / raw)
  To: Daniel Mack
  Cc: Roel Kluin, libertas-dev, linux-wireless, linux-kernel,
	John W. Linville, Cyrill Gorcunov, Michael Buesch
In-Reply-To: <20090810174735.GD19257@buzzloop.caiaq.de>

Just as a heads up, even with this patch I'm still getting
problems with association that didn't occur before. Just reverted
and all works fine.

I'll try and pin them down and report back later this afternoon.

Jonathan
> On Mon, Aug 10, 2009 at 12:37:00PM +0200, Roel Kluin wrote:
>> I think there was another problem in lbs_associate(),
>> the memcpy already affected rates->rates.
>>
>> Also in get_common_rates() I think we can safely move the
>> memset/memcpy, originally after label done, upwards.
>>
>> The patch below, if correct, is to be applied after the revert
> 
> I tested that and the driver still works fine for me. Thanks :)
> 
> Feel free to add my Tested-by: if you like.
> 
> Daniel
> 
> 
>> diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
>> index b9b3741..ba0164a 100644
>> --- a/drivers/net/wireless/libertas/assoc.c
>> +++ b/drivers/net/wireless/libertas/assoc.c
>> @@ -1,6 +1,7 @@
>>  /* Copyright (C) 2006, Red Hat, Inc. */
>>  
>>  #include <linux/types.h>
>> +#include <linux/kernel.h>
>>  #include <linux/etherdevice.h>
>>  #include <linux/ieee80211.h>
>>  #include <linux/if_arp.h>
>> @@ -43,41 +44,41 @@ static int get_common_rates(struct lbs_private *priv,
>>  	u16 *rates_size)
>>  {
>>  	u8 *card_rates = lbs_bg_rates;
>> -	size_t num_card_rates = sizeof(lbs_bg_rates);
>> -	int ret = 0, i, j;
>> -	u8 tmp[30];
>> +	int i, j;
>> +	u8 tmp[MAX_RATES * ARRAY_SIZE(lbs_bg_rates)];
>>  	size_t tmp_size = 0;
>>  
>>  	/* For each rate in card_rates that exists in rate1, copy to tmp */
>> -	for (i = 0; card_rates[i] && (i < num_card_rates); i++) {
>> -		for (j = 0; rates[j] && (j < *rates_size); j++) {
>> +	for (i = 0; i < ARRAY_SIZE(lbs_bg_rates) && card_rates[i]; i++) {
>> +		for (j = 0; j < *rates_size && rates[j]; j++) {
>>  			if (rates[j] == card_rates[i])
>>  				tmp[tmp_size++] = card_rates[i];
>>  		}
>>  	}
>>  
>>  	lbs_deb_hex(LBS_DEB_JOIN, "AP rates    ", rates, *rates_size);
>> -	lbs_deb_hex(LBS_DEB_JOIN, "card rates  ", card_rates, num_card_rates);
>> +	lbs_deb_hex(LBS_DEB_JOIN, "card rates  ", card_rates,
>> +			ARRAY_SIZE(lbs_bg_rates));
>>  	lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size);
>>  	lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate);
>>  
>> +	memset(rates, 0, *rates_size);
>> +	*rates_size = min_t(u16, tmp_size, *rates_size);
>> +	memcpy(rates, tmp, *rates_size);
>> +
>>  	if (!priv->enablehwauto) {
>>  		for (i = 0; i < tmp_size; i++) {
>>  			if (tmp[i] == priv->cur_rate)
>> -				goto done;
>> +				break;
>> +		}
>> +		if (i == tmp_size) {
>> +			lbs_pr_alert("Previously set fixed data rate %#x isn't "
>> +					"compatible with the network.\n",
>> +					priv->cur_rate);
>> +			return -1;
>>  		}
>> -		lbs_pr_alert("Previously set fixed data rate %#x isn't "
>> -		       "compatible with the network.\n", priv->cur_rate);
>> -		ret = -1;
>> -		goto done;
>>  	}
>> -	ret = 0;
>> -
>> -done:
>> -	memset(rates, 0, *rates_size);
>> -	*rates_size = min_t(int, tmp_size, *rates_size);
>> -	memcpy(rates, tmp, *rates_size);
>> -	return ret;
>> +	return 0;
>>  }
>>  
>>  
>> @@ -321,8 +322,8 @@ static int lbs_associate(struct lbs_private *priv,
>>  
>>  	rates = (struct mrvl_ie_rates_param_set *) pos;
>>  	rates->header.type = cpu_to_le16(TLV_TYPE_RATES);
>> -	memcpy(&rates->rates, &bss->rates, MAX_RATES);
>> -	tmplen = MAX_RATES;
>> +	tmplen = min_t(u16, ARRAY_SIZE(rates->rates), MAX_RATES);
>> +	memcpy(&rates->rates, &bss->rates, tmplen);
>>  	if (get_common_rates(priv, rates->rates, &tmplen)) {
>>  		ret = -1;
>>  		goto done;
>> @@ -598,7 +599,7 @@ static int lbs_adhoc_join(struct lbs_private *priv,
>>  
>>  	/* Copy Data rates from the rates recorded in scan response */
>>  	memset(cmd.bss.rates, 0, sizeof(cmd.bss.rates));
>> -	ratesize = min_t(u16, sizeof(cmd.bss.rates), MAX_RATES);
>> +	ratesize = min_t(u16, ARRAY_SIZE(cmd.bss.rates), MAX_RATES);
>>  	memcpy(cmd.bss.rates, bss->rates, ratesize);
>>  	if (get_common_rates(priv, cmd.bss.rates, &ratesize)) {
>>  		lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n");
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev
> 


^ permalink raw reply

* Re: Libertas: Association request to the driver failed
From: Jonathan Cameron @ 2009-08-12  8:47 UTC (permalink / raw)
  To: Roel Kluin
  Cc: Cyrill Gorcunov, Michael Buesch, libertas-dev, linux-wireless,
	linux-kernel, John W. Linville, Daniel Mack
In-Reply-To: <4A7FF84C.7070708@gmail.com>

Hi All, 

After applying this patch I've been receiving 0x12 response from
an access point (association failed: not all rates supported)
to association requests.

See below for queries on what is happening,
> Several arrays were read before checking whether the index was within
> bounds. ARRAY_SIZE() should be used to determine the size of arrays.
> 
> rates->rates has an arraysize of 1, so calling get_common_rates()
> with a rates_size of MAX_RATES (14) was causing reads out of bounds.
> 
> tmp_size can increment at most to MAX_RATES * ARRAY_SIZE(lbs_bg_rates),
> so that should be the number of elements of tmp[].
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> 
>> | Is it a good idea to use dynamic stack arrays in the kernel?
>> | What about kmalloc for dynamic allocations?
>> | 
>> | -- 
>> | Greetings, Michael.
>>
>> I saw one pattern in trace code (not sure if it's
>> still there) but personally don't like dynamic
>> stack arrays (though at moment the max value
>> being passed into routine is known maybe just
>> use MAX_RATES instead of (*rates_size)?). Hmm?
> 
> Good point.
> 
>> 	-- Cyrill
> 
> Thanks,
> 
> I think there was another problem in lbs_associate(),
> the memcpy already affected rates->rates.
> 
> Also in get_common_rates() I think we can safely move the
> memset/memcpy, originally after label done, upwards.
> 
> The patch below, if correct, is to be applied after the revert
> 
> Roel
> 
> diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
> index b9b3741..ba0164a 100644
> --- a/drivers/net/wireless/libertas/assoc.c
> +++ b/drivers/net/wireless/libertas/assoc.c
> @@ -1,6 +1,7 @@
>  /* Copyright (C) 2006, Red Hat, Inc. */
>  
>  #include <linux/types.h>
> +#include <linux/kernel.h>
>  #include <linux/etherdevice.h>
>  #include <linux/ieee80211.h>
>  #include <linux/if_arp.h>
> @@ -43,41 +44,41 @@ static int get_common_rates(struct lbs_private *priv,
>  	u16 *rates_size)
>  {
>  	u8 *card_rates = lbs_bg_rates;
> -	size_t num_card_rates = sizeof(lbs_bg_rates);
> -	int ret = 0, i, j;
> -	u8 tmp[30];
> +	int i, j;
> +	u8 tmp[MAX_RATES * ARRAY_SIZE(lbs_bg_rates)];
>  	size_t tmp_size = 0;
>  
>  	/* For each rate in card_rates that exists in rate1, copy to tmp */
> -	for (i = 0; card_rates[i] && (i < num_card_rates); i++) {
> -		for (j = 0; rates[j] && (j < *rates_size); j++) {
> +	for (i = 0; i < ARRAY_SIZE(lbs_bg_rates) && card_rates[i]; i++) {
> +		for (j = 0; j < *rates_size && rates[j]; j++) {
>  			if (rates[j] == card_rates[i])
>  				tmp[tmp_size++] = card_rates[i];
>  		}
>  	}
>  
>  	lbs_deb_hex(LBS_DEB_JOIN, "AP rates    ", rates, *rates_size);
> -	lbs_deb_hex(LBS_DEB_JOIN, "card rates  ", card_rates, num_card_rates);
> +	lbs_deb_hex(LBS_DEB_JOIN, "card rates  ", card_rates,
> +			ARRAY_SIZE(lbs_bg_rates));
>  	lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size);
>  	lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate);
>  
> +	memset(rates, 0, *rates_size);
> +	*rates_size = min_t(u16, tmp_size, *rates_size);
> +	memcpy(rates, tmp, *rates_size);
> +
>  	if (!priv->enablehwauto) {
>  		for (i = 0; i < tmp_size; i++) {
>  			if (tmp[i] == priv->cur_rate)
> -				goto done;
> +				break;
> +		}
> +		if (i == tmp_size) {
> +			lbs_pr_alert("Previously set fixed data rate %#x isn't "
> +					"compatible with the network.\n",
> +					priv->cur_rate);
> +			return -1;
>  		}
> -		lbs_pr_alert("Previously set fixed data rate %#x isn't "
> -		       "compatible with the network.\n", priv->cur_rate);
> -		ret = -1;
> -		goto done;
>  	}
> -	ret = 0;
> -
> -done:
> -	memset(rates, 0, *rates_size);
> -	*rates_size = min_t(int, tmp_size, *rates_size);
> -	memcpy(rates, tmp, *rates_size);
> -	return ret;
> +	return 0;
>  }
>  
>  
> @@ -321,8 +322,8 @@ static int lbs_associate(struct lbs_private *priv,
>  
>  	rates = (struct mrvl_ie_rates_param_set *) pos;
>  	rates->header.type = cpu_to_le16(TLV_TYPE_RATES);
> -	memcpy(&rates->rates, &bss->rates, MAX_RATES);
> -	tmplen = MAX_RATES;
> +	tmplen = min_t(u16, ARRAY_SIZE(rates->rates), MAX_RATES);
Isn't this always going to be 1? Switching back to original version
allows association to work for me.

As is, it only allows one rate to be tested as ARRAY_SIZE(rates->rates)
is always 1 as it stands.  

If this is the desired behaviour please explain why?
I'll admit I'm not really sure what should be happening, I've merely
been bisecting looking for what was causing a regression for me.

> +	memcpy(&rates->rates, &bss->rates, tmplen);
>  	if (get_common_rates(priv, rates->rates, &tmplen)) {
>  		ret = -1;
>  		goto done;
> @@ -598,7 +599,7 @@ static int lbs_adhoc_join(struct lbs_private *priv,
>  
>  	/* Copy Data rates from the rates recorded in scan response */
>  	memset(cmd.bss.rates, 0, sizeof(cmd.bss.rates));
> -	ratesize = min_t(u16, sizeof(cmd.bss.rates), MAX_RATES);
> +	ratesize = min_t(u16, ARRAY_SIZE(cmd.bss.rates), MAX_RATES);
>  	memcpy(cmd.bss.rates, bss->rates, ratesize);
>  	if (get_common_rates(priv, cmd.bss.rates, &ratesize)) {
>  		lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n");
> 
> _______________________________________________
> libertas-dev mailing list
> libertas-dev@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/libertas-dev
> 


^ permalink raw reply

* [PATCH 1/3] mac80211: refactor dynamic power save check
From: Kalle Valo @ 2009-08-12 14:52 UTC (permalink / raw)
  To: linville; +Cc: johannes, linux-wireless

From: Kalle Valo <kalle.valo@nokia.com>

Refactor dynamic power save checks to a function of it's own for better
readibility. No functional changes.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
---

 net/mac80211/tx.c |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 10a1099..03005f9 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1384,6 +1384,26 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,
 	return 0;
 }
 
+static bool is_dynamic_ps_enabled(struct ieee80211_local *local)
+{
+	if (!(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))
+		/* driver doesn't support power save */
+		return false;
+
+	if (local->hw.conf.dynamic_ps_timeout <= 0)
+		/* dynamic power save disabled */
+		return false;
+
+	if (local->scanning)
+		/* we are scanning, don't enable power save */
+		return false;
+
+	if (!local->ps_sdata)
+		return false;
+
+	return true;
+}
+
 static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
 			   struct sk_buff *skb)
 {
@@ -1396,9 +1416,7 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
 
 	dev_hold(sdata->dev);
 
-	if ((local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK) &&
-	    local->hw.conf.dynamic_ps_timeout > 0 &&
-	    !(local->scanning) && local->ps_sdata) {
+	if (is_dynamic_ps_enabled(local)) {
 		if (local->hw.conf.flags & IEEE80211_CONF_PS) {
 			ieee80211_stop_queues_by_reason(&local->hw,
 					IEEE80211_QUEUE_STOP_REASON_PS);


^ permalink raw reply related

* [PATCH 2/3] mac80211: fix dynamic power save for devices which have nullfunc support
From: Kalle Valo @ 2009-08-12 14:52 UTC (permalink / raw)
  To: linville; +Cc: johannes, linux-wireless
In-Reply-To: <20090812145200.23691.17281.stgit@tikku>

From: Kalle Valo <kalle.valo@nokia.com>

In TX path it was assumed that dynamic power save works only if
IEEE80211_HW_PS_NULLFUNC_STACK is set. But is not the case, there are
devices which have nullfunc support in hardware but need mac80211
to handle dynamic power save timers, TI's wl1251 is one of them.

The fix is to not check for IEEE80211_HW_PS_NULLFUNC_STACK in
is_dynamic_ps_enabled(), instead check IEEE80211_HW_SUPPORTS_PS and
IEEE80211_HW_SUPPORTS_DYNAMIC_PS flags and act accordingly.

Tested with wl1251.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
---

 net/mac80211/tx.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 03005f9..0e7273c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1386,10 +1386,15 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,
 
 static bool is_dynamic_ps_enabled(struct ieee80211_local *local)
 {
-	if (!(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))
+
+	if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS))
 		/* driver doesn't support power save */
 		return false;
 
+	if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)
+		/* hardware does dynamic power save */
+		return false;
+
 	if (local->hw.conf.dynamic_ps_timeout <= 0)
 		/* dynamic power save disabled */
 		return false;


^ permalink raw reply related

* [PATCH 3/3] wl1251: enable power save
From: Kalle Valo @ 2009-08-12 14:52 UTC (permalink / raw)
  To: linville; +Cc: johannes, linux-wireless
In-Reply-To: <20090812145200.23691.17281.stgit@tikku>

From: Kalle Valo <kalle.valo@nokia.com>

wl1251 supports power save and it can be enabled now.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
---

 drivers/net/wireless/wl12xx/wl1251_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/wl1251_main.c b/drivers/net/wireless/wl12xx/wl1251_main.c
index 7148934..72e2dc9 100644
--- a/drivers/net/wireless/wl12xx/wl1251_main.c
+++ b/drivers/net/wireless/wl12xx/wl1251_main.c
@@ -1310,7 +1310,8 @@ int wl1251_init_ieee80211(struct wl1251 *wl)
 	wl->hw->channel_change_time = 10000;
 
 	wl->hw->flags = IEEE80211_HW_SIGNAL_DBM |
-		IEEE80211_HW_NOISE_DBM;
+		IEEE80211_HW_NOISE_DBM |
+		IEEE80211_HW_SUPPORTS_PS;
 
 	wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
 	wl->hw->wiphy->max_scan_ssids = 1;


^ permalink raw reply related

* Re: [PATCH 2/3] mac80211: fix dynamic power save for devices which have nullfunc support
From: Johannes Berg @ 2009-08-12 15:03 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linville, linux-wireless
In-Reply-To: <20090812145209.23691.82.stgit@tikku>

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

On Wed, 2009-08-12 at 17:52 +0300, Kalle Valo wrote:

>  static bool is_dynamic_ps_enabled(struct ieee80211_local *local)
>  {
> -	if (!(local->hw.flags & IEEE80211_HW_PS_NULLFUNC_STACK))
> +
> +	if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_PS))
>  		/* driver doesn't support power save */
>  		return false;

Why the blank line?
 
> +	if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_PS)
> +		/* hardware does dynamic power save */
> +		return false;

FWIW, also applies to patch 1, I think I prefer

	/* check if hardware does dynamic power save */
	if (local->hw.flags & ...)
		return false;

(wrt. comment location)

and you should probably rename the function to do_software_dynamic_ps()
or something like that?

johannes

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

^ permalink raw reply

* Re: [PATCH 2.6.30] iwl3945: fix rfkill switch
From: Stanislaw Gruszka @ 2009-08-12 15:12 UTC (permalink / raw)
  To: reinette chatre
  Cc: linux-wireless@vger.kernel.org, Zhu, Yi, John W. Linville,
	stable@kernel.org
In-Reply-To: <1250014113.30019.5799.camel@rc-desk>

On Tue, Aug 11, 2009 at 11:08:33AM -0700, reinette chatre wrote:
> Hi Stanislaw,
> 
> Thank you for your patience ...

Hello, I understand your concerns, patch is not so straightforward and
hard to understand, if you don't have system where you can reproduce.

> On Tue, 2009-08-11 at 07:09 -0700, Stanislaw Gruszka wrote:
> > On Mon, Aug 10, 2009 at 09:44:52AM -0700, reinette chatre wrote:
> > > Yes. I assume that what happens here is that rfkill notifies user that
> > > state changes to RFKILL_STATE_UNBLOCKED. In your new patch the driver
> > > will now clear STATUS_RF_KILL_SW, with STATUS_RF_KILL_HW still being
> > > set. So, in this run, after iwl_rfkill_soft_rf_kill is called there will
> > > be a state mismatch with rfkill thinking the system is unblocked while
> > > the driver has it as hard blocked. This is not right.
> > 
> > In such case we return -EBUSY from iwl_rfkill_soft_rf_kill() - rfkill
> > state not change. 
> 
> oh - right - sorry
> 
> > I made a comment it will be HARD_BLOCKED, this
> > is not true anymore, it can be also in state SOFT_BLOCKED . 
> 
> How so? Isn't the idea behind toggle_radio that the SOFT_BLOCKED state
> changes? In this case when we get a new state of UNBLOCKED then I do not
> understand how SOFT_BLOCKED can be true also.

Hugh, right I was completely wrong here. 
 
> > However
> > comment was true with previous version of the patch for 2.6.29, where
> > there was no HARD -> SOFT downgrade and that part was called only when
> > rfkill state was HARD_BLOCKED.
> > 
> > > Can this be fixed by adding a iwl_rfkill_set_hw_state in this run?
> > 
> > We can not call iwl_rfkill_set_hw_state in iwl_rfkill_soft_rt_kill
> > as rfkill->muttex is taken. We eventually can force state in the same ugly
> > way as is done for case RFKILL_STATE_SOFT_BLOCKED and I think, this is good
> > idea :) , below not tested delta patch:
> > 
> 
> This just seems to mess with the rfkill internals even more. Can this
> not be avoided?

Other solution eventually would be ignore rfkill core request to SW disable
radio when we have already STATUS_RF_KILL_HW=1, but I think it is very bad
idea and probably broke thinks.

We currently call rfkill_force_state() which is changing internal state
of rfkill core, however it is done through defined api. Uh, patch is
not ideal, but I do not have anything better. 

> > > >From what I can tell this patch introduced a disagreement of rfkill
> > > state between driver and rfkill system.
> > 
> > In driver we have no states, but separate bits for each killswitch. Situation
> > gets better after rfkill rewrite where also rfkill core become to have separate
> > bits, but with 2.6.30 we have no such luck.
> > 
> > Currently we have "states" like below:
> > 
> > STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_HARD_BLOCKED
> > STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
> > STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_HARD_BLOCKED
> > STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_UNBLOCKED
> > 
> > Patch is intended to work like that:
> > 
> > STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
> > STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=1 <-> RFKILL_STATUS_SOFT_BLOCKED
> > STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_HARD_BLOCKED
> > STATUS_RF_KILL_HW=0 STATUS_RF_KILL_SW=0 <-> RFKILL_STATUS_UNBLOCKED
> 
> I can see that this is what the last hunk of the patch accomplishes -
> but I do not see why it is needed.
> 
> > 
> >   STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
> > 
> > driver HW on
> > 
> >   STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_HARD_BLOCKED
> > 
> > rfkill SW on ( -> rfkill_epo() -> rfkill_toggle_radio() with force = 1)
> > 
> >   STATUS_RF_KILL_HW=1, STATUS_RF_KILL_SW=1, RFKILL_STATE_HARD_BLOCKED
> > 
> > rfkill SW off (HARD_BLOCKED not clearing STATUS_RF_KILL_SW)
> > 
> >   STATUS_RF_KILL_HW=1, STATUS_RF_KILL_SW=1, RFKILL_STATE_HARD_BLOCKED
> > 
> > driver HW off (called from iwl_bg_rf_kill())
> > 
> >   STATUS_RF_KILL_HW=0, STATUS_RF_KILL_SW=1, RFKILL_STATE_SOFT_BLOCKED
> > 
> > rfkill core no longer wants to turn radio on
> 
> >From what I understand what you are describing above should be addressed
> by this hunk of your patch:
> 
>         case RFKILL_STATE_UNBLOCKED:
>                 if (iwl_is_rfkill_hw(priv)) {
>                         err = -EBUSY;
> -                       goto out_unlock;
> +                       /* pass error to rfkill core to make it state HARD
> +                        * BLOCKED and disable software kill switch */
>                 }
> 
> This should make these new transitions possible:
> 
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
> driver HW on
> 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_HARD_BLOCKED
> rfkill SW on ( -> rfkill_epo() -> rfkill_toggle_radio() with force = 1)
> 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 1, RFKILL_STATE_HARD_BLOCKED
> rfkill SW off 
> 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_HARD_BLOCKED
No, rfkill core will not call ->toggle_radio()
 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 1, RFKILL_STATE_HARD_BLOCKED
> driver HW off (called from iwl_bg_rf_kill())
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
Would be:
 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 1, RFKILL_STATE_UNBLOCKED

Not work without the patch, with patch it works like that:

 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
driver HW on
 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_HARD_BLOCKED
rfkill SW on 
	rfkill call -> rfkill_epo() -> rfkill_toggle_radio(RFKILL_STATE_SOFT_BLOCKED)
	with force = 1 . Due to changes in iwl_rfkill_soft_rf_kill() we move
	state to RFKILL_STATE_SOFT_BLOCKED, so:
 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 1, RFKILL_STATE_SOFT_BLOCKED
rfkill SW off 
	rfkill core call ->toggle_radio(RFKILL_STATE_UNBLOCKED) 
	iwl_is_rfkill_hw(priv) is true but we disable STATUS_RF_KILL_SW
	anyway and return -EBUSY to not change rfkill core state, so:
 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_SOFT_BLOCKED
driver HW off
	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED

> Looking further I tried to see how other combinations would be treated. Here is how I see the potential scenarios:
> 
> Case1 (considered above):
> driver HW on -> rfkill SW on -> rfkill SW off -> driver HW off
> Case2:
> driver HW on -> rfkill SW on -> driver HW off -> rfkill SW off
> Case3:
> rfkill SW on -> driver HW on -> rfkill SW off -> driver HW off
> Case4:
> rfkill SW on -> driver HW on -> driver HW off -> rfkill SW off 
> 
> Looking at the rest of the cases I do not see the problem addressed by the other hunks.
> 
> I see:
> 
> Case 2:
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
> driver HW on
> 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_HARD_BLOCKED
> rfkill SW on
> 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 1, RFKILL_STATE_HARD_BLOCKED
> driver HW off
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 1, RFKILL_STATE_SOFT_BLOCKED
> rfkill SW off 
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED

Yes, works without the patch.

> Case3:
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
> rfkill SW on
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 1, RFKILL_STATE_SOFT_BLOCKED
> driver HW on
> 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 1, RFKILL_STATE_HARD_BLOCKED
> rfkill SW off

No, rfkill will not call ->toggle_radio()  

> 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_HARD_BLOCKED
> driver HW off
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED

Not work without the patch, with patch it works like that:

Case3:
 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
rfkill SW on
 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 1, RFKILL_STATE_SOFT_BLOCKED
driver HW on
	Here due to changes in iwl_rfkill_set_hw_state() rfkill core stay in
	RFKILL_STATE_SOFT_BLOCKED so:
 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 1, RFKILL_STATE_SOFT_BLOCKED
rfkill SW off
	rfkill core call ->toggle_radio(RFKILL_STATE_UNBLOCKED) 
	iwl_is_rfkill_hw(priv) is true but we disable STATUS_RF_KILL_SW
	anyway and return -EBUSY to not change rfkill core state, so:
 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_SOFT_BLOCKED
driver HW off
	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED

> Case4:
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
> rfkill SW on
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 1, RFKILL_STATE_SOFT_BLOCKED
> driver HW on
> 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 1, RFKILL_STATE_HARD_BLOCKED
> driver HW off
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 1, RFKILL_STATE_SOFT_BLOCKED
> rfkill SW off 
> 	STATUS_RF_KILL_HW = 0, STATUS_RF_KILL_SW = 0, RFKILL_STATE_UNBLOCKED
> 

Yes, work without the patch.

> I understand that one hunk of your patch accomplishes the mapping of
> "STATUS_RF_KILL_HW=1 STATUS_RF_KILL_SW=1 <->
> RFKILL_STATUS_SOFT_BLOCKED" - but I do not understand why it is needed. Could you please explain?

I hope above explanation are clear now. 

> I also do not understand the need to modify rfkill's internal state.

It's needed for Case1. Additional change of internal rfkill state, which
I proposed in previous e-mail is against situation when we have:
 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_SOFT_BLOCKED
To make it:
 	STATUS_RF_KILL_HW = 1, STATUS_RF_KILL_SW = 0, RFKILL_STATE_HARD_BLOCKED

Regards
Stanislaw


^ 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