2008-04-10 22:55:19

by Reinette Chatre

[permalink] [raw]
Subject: [PATCH RFC] mac80211: Fixes n-band association problem with certain APs

=46rom: Abhijeet Kolekar <[email protected]>

=46or WME(221) tag in beacon frames from certain n-only aps=C2=B7
5th bit is not set.So while parsing the beacon frame the wmm_info=C2=B7
structure is used instead of wmm_param. wmm_info structure is=C2=B7
never used to set bss->wmm_ie. While sending the association request to
n-only ap it checks for wmm_ie. If it is set then only ieee80211_ht_cap
is sent during association request.So n-only association fails.
This patch fixes this problem by copying the WME information from wmm_i=
nfo
to bss->wmm_ie and thus enabling n-band association.

Signed-off-by: Abhijeet Kolekar <[email protected]>
Acked-by: Ron Rindjunsky <[email protected]>
---
net/mac80211/mlme.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 83e8b49..ec2f722 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2668,7 +2668,18 @@ static void ieee80211_rx_bss_info(struct net_dev=
ice *dev,
bss->wmm_ie_len =3D elems.wmm_param_len + 2;
} else
bss->wmm_ie_len =3D 0;
- } else if (!elems.wmm_param && bss->wmm_ie) {
+ } else if (elems.wmm_info &&
+ (!bss->wmm_ie || bss->wmm_ie_len !=3D elems.wmm_info_len ||
+ memcmp(bss->wmm_ie, elems.wmm_info,elems.wmm_info_len))) {
+ kfree(bss->wmm_ie);
+ bss->wmm_ie =3D kmalloc(elems.wmm_info_len + 2, GFP_ATOMIC);
+ if (bss->wmm_ie) {
+ memcpy(bss->wmm_ie, elems.wmm_info - 2,
+ elems.wmm_info_len + 2);
+ bss->wmm_ie_len =3D elems.wmm_info_len + 2;
+ } else
+ bss->wmm_ie_len =3D 0;
+ } else if (!elems.wmm_param && !elems.wmm_info && bss->wmm_ie) {
kfree(bss->wmm_ie);
bss->wmm_ie =3D NULL;
bss->wmm_ie_len =3D 0;
--=20
1.5.3.4


2008-04-11 19:43:49

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH RFC] mac80211: Fixes n-band association problem with certain APs

On Thu, 2008-04-10 at 15:49 -0700, Reinette Chatre wrote:
> From: Abhijeet Kolekar <[email protected]>
>
> For WME(221) tag in beacon frames from certain n-only aps·
> 5th bit is not set.So while parsing the beacon frame the wmm_info·
> structure is used instead of wmm_param. wmm_info structure is·
> never used to set bss->wmm_ie. While sending the association request to
> n-only ap it checks for wmm_ie. If it is set then only ieee80211_ht_cap
> is sent during association request.So n-only association fails.
> This patch fixes this problem by copying the WME information from wmm_info
> to bss->wmm_ie and thus enabling n-band association.

I haven't got a clue. I didn't even know there where two things,
wmm_param and wmm_info.

> Signed-off-by: Abhijeet Kolekar <[email protected]>
> Acked-by: Ron Rindjunsky <[email protected]>
> ---
> net/mac80211/mlme.c | 13 ++++++++++++-
> 1 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 83e8b49..ec2f722 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -2668,7 +2668,18 @@ static void ieee80211_rx_bss_info(struct net_device *dev,
> bss->wmm_ie_len = elems.wmm_param_len + 2;
> } else
> bss->wmm_ie_len = 0;
> - } else if (!elems.wmm_param && bss->wmm_ie) {
> + } else if (elems.wmm_info &&
> + (!bss->wmm_ie || bss->wmm_ie_len != elems.wmm_info_len ||
> + memcmp(bss->wmm_ie, elems.wmm_info,elems.wmm_info_len))) {
> + kfree(bss->wmm_ie);
> + bss->wmm_ie = kmalloc(elems.wmm_info_len + 2, GFP_ATOMIC);
> + if (bss->wmm_ie) {
> + memcpy(bss->wmm_ie, elems.wmm_info - 2,
> + elems.wmm_info_len + 2);
> + bss->wmm_ie_len = elems.wmm_info_len + 2;
> + } else
> + bss->wmm_ie_len = 0;
> + } else if (!elems.wmm_param && !elems.wmm_info && bss->wmm_ie) {
> kfree(bss->wmm_ie);
> bss->wmm_ie = NULL;
> bss->wmm_ie_len = 0;


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part

2008-04-15 17:01:16

by Abhijeet Kolekar

[permalink] [raw]
Subject: RE: [PATCH RFC] mac80211: Fixes n-band association problem withcertain APs

There are two structures named wmm_info and wmm_param, they are used
while
Parsing the beacon frame. (Check the function ieee802_11_parse_elems).
Certain APs like D-link does not set the fifth bit in WMM IE. I was able
to see it thought packet capture. And this patch fixes this problem by
copying the wmm_info to wmm_ie, which enables the "wmm" flag in
iee80211_send_assoc.


Abhijeet


-----Original Message-----
From: Johannes Berg [mailto:[email protected]]
Sent: Friday, April 11, 2008 12:44 PM
To: Chatre, Reinette
Cc: [email protected]; [email protected];
[email protected]; Kolekar, Abhijeet
Subject: Re: [PATCH RFC] mac80211: Fixes n-band association problem
withcertain APs

On Thu, 2008-04-10 at 15:49 -0700, Reinette Chatre wrote:
> From: Abhijeet Kolekar <[email protected]>
>
> For WME(221) tag in beacon frames from certain n-only aps*
> 5th bit is not set.So while parsing the beacon frame the wmm_info*
> structure is used instead of wmm_param. wmm_info structure is*
> never used to set bss->wmm_ie. While sending the association request
to
> n-only ap it checks for wmm_ie. If it is set then only
ieee80211_ht_cap
> is sent during association request.So n-only association fails.
> This patch fixes this problem by copying the WME information from
wmm_info
> to bss->wmm_ie and thus enabling n-band association.

I haven't got a clue. I didn't even know there where two things,
wmm_param and wmm_info.

> Signed-off-by: Abhijeet Kolekar <[email protected]>
> Acked-by: Ron Rindjunsky <[email protected]>
> ---
> net/mac80211/mlme.c | 13 ++++++++++++-
> 1 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 83e8b49..ec2f722 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -2668,7 +2668,18 @@ static void ieee80211_rx_bss_info(struct
net_device *dev,
> bss->wmm_ie_len = elems.wmm_param_len + 2;
> } else
> bss->wmm_ie_len = 0;
> - } else if (!elems.wmm_param && bss->wmm_ie) {
> + } else if (elems.wmm_info &&
> + (!bss->wmm_ie || bss->wmm_ie_len !=
elems.wmm_info_len ||
> + memcmp(bss->wmm_ie,
elems.wmm_info,elems.wmm_info_len))) {
> + kfree(bss->wmm_ie);
> + bss->wmm_ie = kmalloc(elems.wmm_info_len + 2,
GFP_ATOMIC);
> + if (bss->wmm_ie) {
> + memcpy(bss->wmm_ie, elems.wmm_info - 2,
> + elems.wmm_info_len + 2);
> + bss->wmm_ie_len = elems.wmm_info_len + 2;
> + } else
> + bss->wmm_ie_len = 0;
> + } else if (!elems.wmm_param && !elems.wmm_info && bss->wmm_ie) {
> kfree(bss->wmm_ie);
> bss->wmm_ie = NULL;
> bss->wmm_ie_len = 0;

2008-04-16 14:08:47

by Johannes Berg

[permalink] [raw]
Subject: RE: [PATCH RFC] mac80211: Fixes n-band association problem withcertain APs

On Tue, 2008-04-15 at 10:01 -0700, Kolekar, Abhijeet wrote:
> There are two structures named wmm_info and wmm_param, they are used
> while
> Parsing the beacon frame. (Check the function ieee802_11_parse_elems).
> Certain APs like D-link does not set the fifth bit in WMM IE. I was able
> to see it thought packet capture. And this patch fixes this problem by
> copying the wmm_info to wmm_ie, which enables the "wmm" flag in
> iee80211_send_assoc.

Ok. Sounds like we want this, but maybe with a comment saying why we do
it?

johannes


Attachments:
signature.asc (828.00 B)
This is a digitally signed message part