linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mac80211: do not wip out old supported rates
@ 2010-04-28 13:17 Stanislaw Gruszka
  2010-04-28 13:17 ` [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates Stanislaw Gruszka
  0 siblings, 1 reply; 9+ messages in thread
From: Stanislaw Gruszka @ 2010-04-28 13:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, John W. Linville, Stanislaw Gruszka

Use old supported rates, if AP do not provide supported rates
information element in a new managment frame.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 net/mac80211/scan.c |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index 85507bd..151d933 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -83,7 +83,7 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
 {
 	struct cfg80211_bss *cbss;
 	struct ieee80211_bss *bss;
-	int clen;
+	int clen, srlen;
 	s32 signal = 0;
 
 	if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM)
@@ -112,23 +112,24 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
 		bss->dtim_period = tim_ie->dtim_period;
 	}
 
-	bss->supp_rates_len = 0;
+	/* replace old supported rates if we get new values */
+	srlen = 0;
 	if (elems->supp_rates) {
-		clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len;
+		clen = IEEE80211_MAX_SUPP_RATES;
 		if (clen > elems->supp_rates_len)
 			clen = elems->supp_rates_len;
-		memcpy(&bss->supp_rates[bss->supp_rates_len], elems->supp_rates,
-		       clen);
-		bss->supp_rates_len += clen;
+		memcpy(bss->supp_rates, elems->supp_rates, clen);
+		srlen += clen;
 	}
 	if (elems->ext_supp_rates) {
-		clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len;
+		clen = IEEE80211_MAX_SUPP_RATES - srlen;
 		if (clen > elems->ext_supp_rates_len)
 			clen = elems->ext_supp_rates_len;
-		memcpy(&bss->supp_rates[bss->supp_rates_len],
-		       elems->ext_supp_rates, clen);
-		bss->supp_rates_len += clen;
+		memcpy(bss->supp_rates + srlen, elems->ext_supp_rates, clen);
+		srlen += clen;
 	}
+	if (srlen)
+		bss->supp_rates_len = srlen;
 
 	bss->wmm_used = elems->wmm_param || elems->wmm_info;
 	bss->uapsd_supported = is_uapsd_supported(elems);
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates
  2010-04-28 13:17 [PATCH 1/2] mac80211: do not wip out old supported rates Stanislaw Gruszka
@ 2010-04-28 13:17 ` Stanislaw Gruszka
  2010-04-28 13:33   ` Stanislaw Gruszka
  2010-04-28 13:39   ` Johannes Berg
  0 siblings, 2 replies; 9+ messages in thread
From: Stanislaw Gruszka @ 2010-04-28 13:17 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg, John W. Linville, Stanislaw Gruszka

If AP do not provide us supported rates before assiociation, send
all rates we are supporting instead of empty information element.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 net/mac80211/work.c |   23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 15e1ba9..f8f5c9a 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -213,15 +213,20 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
 
 	sband = local->hw.wiphy->bands[wk->chan->band];
 
-	/*
-	 * Get all rates supported by the device and the AP as
-	 * some APs don't like getting a superset of their rates
-	 * in the association request (e.g. D-Link DAP 1353 in
-	 * b-only mode)...
-	 */
-	rates_len = ieee80211_compatible_rates(wk->assoc.supp_rates,
-					       wk->assoc.supp_rates_len,
-					       sband, &rates);
+	if (wk->assoc.supp_rates_len) {
+		/*
+		 * Get all rates supported by the device and the AP as
+		 * some APs don't like getting a superset of their rates
+		 * in the association request (e.g. D-Link DAP 1353 in
+		 * b-only mode)...
+		 */
+		rates_len = ieee80211_compatible_rates(wk->assoc.supp_rates,
+						       wk->assoc.supp_rates_len,
+						       sband, &rates);
+	} else {
+		rates = ~0;
+		rates_len = sband->n_bitrates;
+	}
 
 	skb = alloc_skb(local->hw.extra_tx_headroom +
 			sizeof(*mgmt) + /* bit too much but doesn't matter */
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates
  2010-04-28 13:17 ` [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates Stanislaw Gruszka
@ 2010-04-28 13:33   ` Stanislaw Gruszka
  2010-04-28 20:33     ` John W. Linville
  2010-04-28 13:39   ` Johannes Berg
  1 sibling, 1 reply; 9+ messages in thread
From: Stanislaw Gruszka @ 2010-04-28 13:33 UTC (permalink / raw)
  To: John W. Linville; +Cc: Johannes Berg, linux-wireless

On Wed, Apr 28, 2010 at 03:17:04PM +0200, Stanislaw Gruszka wrote:
> If AP do not provide us supported rates before assiociation, send
> all rates we are supporting instead of empty information element.

Please note these two patches together with "QoS fixes":
- mac80211: explicitly disable/enable QoS
- iwlwifi: manage QoS by mac stack
resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=558002

"QoS fixes" alone resolve:
https://bugzilla.redhat.com/show_bug.cgi?id=539878

So I think we want all 4 patches in stable.

John,if possible push patches to Linus tree. When they lend there,
I will post backported patches to stable ML. I have them already
prepared ant tested for 2.6.32 :)

Thanks
Stanislaw

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates
  2010-04-28 13:17 ` [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates Stanislaw Gruszka
  2010-04-28 13:33   ` Stanislaw Gruszka
@ 2010-04-28 13:39   ` Johannes Berg
  2010-04-28 13:57     ` Stanislaw Gruszka
  1 sibling, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2010-04-28 13:39 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: linux-wireless, John W. Linville

On Wed, 2010-04-28 at 15:17 +0200, Stanislaw Gruszka wrote:
> If AP do not provide us supported rates before assiociation, send
> all rates we are supporting instead of empty information element.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
> ---
>  net/mac80211/work.c |   23 ++++++++++++++---------
>  1 files changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/net/mac80211/work.c b/net/mac80211/work.c
> index 15e1ba9..f8f5c9a 100644
> --- a/net/mac80211/work.c
> +++ b/net/mac80211/work.c
> @@ -213,15 +213,20 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
>  
>  	sband = local->hw.wiphy->bands[wk->chan->band];
>  
> -	/*
> -	 * Get all rates supported by the device and the AP as
> -	 * some APs don't like getting a superset of their rates
> -	 * in the association request (e.g. D-Link DAP 1353 in
> -	 * b-only mode)...
> -	 */
> -	rates_len = ieee80211_compatible_rates(wk->assoc.supp_rates,
> -					       wk->assoc.supp_rates_len,
> -					       sband, &rates);
> +	if (wk->assoc.supp_rates_len) {
> +		/*
> +		 * Get all rates supported by the device and the AP as
> +		 * some APs don't like getting a superset of their rates
> +		 * in the association request (e.g. D-Link DAP 1353 in
> +		 * b-only mode)...
> +		 */
> +		rates_len = ieee80211_compatible_rates(wk->assoc.supp_rates,
> +						       wk->assoc.supp_rates_len,
> +						       sband, &rates);
> +	} else {
> +		rates = ~0;
> +		rates_len = sband->n_bitrates;
> +	}

Could you add a comment about what AP this is, and that it's a
workaround please? The AP is surely supposed to send this information!

johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates
  2010-04-28 13:39   ` Johannes Berg
@ 2010-04-28 13:57     ` Stanislaw Gruszka
  2010-04-28 13:59       ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Stanislaw Gruszka @ 2010-04-28 13:57 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, John W. Linville

On Wed, 28 Apr 2010 15:39:24 +0200
Johannes Berg <johannes@sipsolutions.net> wrote:

> Could you add a comment about what AP this is

Bug reporter don't know what AP it is. He fail to connect
to wireless network at school.
https://bugzilla.redhat.com/show_bug.cgi?id=558002

>, and that it's a
> workaround please?

I don't think this is workaround. For me this is right behavior
and fix for workaround introduced in commit
36d16ae73becc5978fe22866e9ab66b509211afe "mac80211: fix association
with some APs"

> The AP is surely supposed to send this information!

The same as we are, no matter what :-)

Cheers
Stanislaw

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates
  2010-04-28 13:57     ` Stanislaw Gruszka
@ 2010-04-28 13:59       ` Johannes Berg
  2010-04-28 15:03         ` [PATCH 2/2 v2] " Stanislaw Gruszka
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2010-04-28 13:59 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: linux-wireless, John W. Linville

On Wed, 2010-04-28 at 15:57 +0200, Stanislaw Gruszka wrote:
> On Wed, 28 Apr 2010 15:39:24 +0200
> Johannes Berg <johannes@sipsolutions.net> wrote:
> 
> > Could you add a comment about what AP this is
> 
> Bug reporter don't know what AP it is. He fail to connect
> to wireless network at school.
> https://bugzilla.redhat.com/show_bug.cgi?id=558002

Ah bugger.

> >, and that it's a
> > workaround please?
> 
> I don't think this is workaround. For me this is right behavior
> and fix for workaround introduced in commit
> 36d16ae73becc5978fe22866e9ab66b509211afe "mac80211: fix association
> with some APs"

Oh yeah so it's a workaround for a workaround. Oh well. Can we still
have a comment about it in the else branch?

johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/2 v2] mac80211: fix supported rates IE if AP doesn't give us it's rates
  2010-04-28 13:59       ` Johannes Berg
@ 2010-04-28 15:03         ` Stanislaw Gruszka
  0 siblings, 0 replies; 9+ messages in thread
From: Stanislaw Gruszka @ 2010-04-28 15:03 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville, Johannes Berg

If AP do not provide us supported rates before assiociation, send
all rates we are supporting instead of empty information element.

v1 -> v2: Add comment.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 net/mac80211/work.c |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 15e1ba9..949c2d1 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -213,15 +213,25 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata,
 
 	sband = local->hw.wiphy->bands[wk->chan->band];
 
-	/*
-	 * Get all rates supported by the device and the AP as
-	 * some APs don't like getting a superset of their rates
-	 * in the association request (e.g. D-Link DAP 1353 in
-	 * b-only mode)...
-	 */
-	rates_len = ieee80211_compatible_rates(wk->assoc.supp_rates,
-					       wk->assoc.supp_rates_len,
-					       sband, &rates);
+	if (wk->assoc.supp_rates_len) {
+		/*
+		 * Get all rates supported by the device and the AP as
+		 * some APs don't like getting a superset of their rates
+		 * in the association request (e.g. D-Link DAP 1353 in
+		 * b-only mode)...
+		 */
+		rates_len = ieee80211_compatible_rates(wk->assoc.supp_rates,
+						       wk->assoc.supp_rates_len,
+						       sband, &rates);
+	} else {
+		/*
+		 * In case AP not provide any supported rates information
+		 * before association, we send information element(s) with
+		 * all rates that we support.
+		 */
+		rates = ~0;
+		rates_len = sband->n_bitrates;
+	}
 
 	skb = alloc_skb(local->hw.extra_tx_headroom +
 			sizeof(*mgmt) + /* bit too much but doesn't matter */
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates
  2010-04-28 13:33   ` Stanislaw Gruszka
@ 2010-04-28 20:33     ` John W. Linville
  2010-04-30  8:57       ` Stanislaw Gruszka
  0 siblings, 1 reply; 9+ messages in thread
From: John W. Linville @ 2010-04-28 20:33 UTC (permalink / raw)
  To: Stanislaw Gruszka; +Cc: Johannes Berg, linux-wireless

On Wed, Apr 28, 2010 at 03:33:37PM +0200, Stanislaw Gruszka wrote:
> On Wed, Apr 28, 2010 at 03:17:04PM +0200, Stanislaw Gruszka wrote:
> > If AP do not provide us supported rates before assiociation, send
> > all rates we are supporting instead of empty information element.
> 
> Please note these two patches together with "QoS fixes":
> - mac80211: explicitly disable/enable QoS
> - iwlwifi: manage QoS by mac stack
> resolve:
> https://bugzilla.redhat.com/show_bug.cgi?id=558002
> 
> "QoS fixes" alone resolve:
> https://bugzilla.redhat.com/show_bug.cgi?id=539878
> 
> So I think we want all 4 patches in stable.
> 
> John,if possible push patches to Linus tree. When they lend there,
> I will post backported patches to stable ML. I have them already
> prepared ant tested for 2.6.32 :)

It is fairly late in the 2.6.34 cycle, and it isn't obvious to me
that these fix any sort of regression.  Am I wrong?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates
  2010-04-28 20:33     ` John W. Linville
@ 2010-04-30  8:57       ` Stanislaw Gruszka
  0 siblings, 0 replies; 9+ messages in thread
From: Stanislaw Gruszka @ 2010-04-30  8:57 UTC (permalink / raw)
  To: John W. Linville; +Cc: Johannes Berg, linux-wireless

On Wed, 28 Apr 2010 16:33:04 -0400
"John W. Linville" <linville@tuxdriver.com> wrote:

> > Please note these two patches together with "QoS fixes":
> > - mac80211: explicitly disable/enable QoS
> > - iwlwifi: manage QoS by mac stack
> > resolve:
> > https://bugzilla.redhat.com/show_bug.cgi?id=558002
> > 
> > "QoS fixes" alone resolve:
> > https://bugzilla.redhat.com/show_bug.cgi?id=539878
> > 
> > So I think we want all 4 patches in stable.
> > 
> > John,if possible push patches to Linus tree. When they lend there,
> > I will post backported patches to stable ML. I have them already
> > prepared ant tested for 2.6.32 :)
> 
> It is fairly late in the 2.6.34 cycle, and it isn't obvious to me
> that these fix any sort of regression.  Am I wrong?

If you count as regression bugs introduced in 2.6.34 development
cycle, these are not regression. Bugs are Fedora 12 regression over
Fedora 11, so most likely these bugs were introduced in 2.6.32
or 2.6.31 kernel. I have no strong filings to fix them fast, since
we have them unfixed for long time and not hear many complains. We
may fix them for Fedora now, and post to -stable after some more testing
and 2.6.34 release.

Cheers
Stanislaw

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-04-30 17:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-28 13:17 [PATCH 1/2] mac80211: do not wip out old supported rates Stanislaw Gruszka
2010-04-28 13:17 ` [PATCH 2/2] mac80211: fix supported rates IE if AP doesn't give us it's rates Stanislaw Gruszka
2010-04-28 13:33   ` Stanislaw Gruszka
2010-04-28 20:33     ` John W. Linville
2010-04-30  8:57       ` Stanislaw Gruszka
2010-04-28 13:39   ` Johannes Berg
2010-04-28 13:57     ` Stanislaw Gruszka
2010-04-28 13:59       ` Johannes Berg
2010-04-28 15:03         ` [PATCH 2/2 v2] " Stanislaw Gruszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).