Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 1/1] mac80211: fix basic rates setting from association response
@ 2008-10-30 15:08 Tomas Winkler
  2008-10-30 15:16 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Tomas Winkler @ 2008-10-30 15:08 UTC (permalink / raw)
  To: linville, johannes, yi.zhu; +Cc: linux-wireless, Tomas Winkler

In previous code all the rates were marked as basic.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/mlme.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index d5006b2..9ea7b28 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1302,29 +1302,35 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
 
 	for (i = 0; i < elems.supp_rates_len; i++) {
 		int rate = (elems.supp_rates[i] & 0x7f) * 5;
+		bool is_basic = !!(elems.supp_rates[i] & 0x80);
 
 		if (rate > 110)
 			have_higher_than_11mbit = true;
 
 		for (j = 0; j < sband->n_bitrates; j++) {
-			if (sband->bitrates[j].bitrate == rate)
+			if (sband->bitrates[j].bitrate == rate) {
 				rates |= BIT(j);
-			if (elems.supp_rates[i] & 0x80)
-				basic_rates |= BIT(j);
+				if (is_basic)
+					basic_rates |= BIT(j);
+				break;
+			}
 		}
 	}
 
 	for (i = 0; i < elems.ext_supp_rates_len; i++) {
 		int rate = (elems.ext_supp_rates[i] & 0x7f) * 5;
+		bool is_basic = !!(elems.supp_rates[i] & 0x80);
 
 		if (rate > 110)
 			have_higher_than_11mbit = true;
 
 		for (j = 0; j < sband->n_bitrates; j++) {
-			if (sband->bitrates[j].bitrate == rate)
+			if (sband->bitrates[j].bitrate == rate) {
 				rates |= BIT(j);
-			if (elems.ext_supp_rates[i] & 0x80)
-				basic_rates |= BIT(j);
+				if (is_basic)
+					basic_rates |= BIT(j);
+				break;
+			}
 		}
 	}
 
-- 
1.5.4.3

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


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

* Re: [PATCH 1/1] mac80211: fix basic rates setting from association response
  2008-10-30 15:08 [PATCH 1/1] mac80211: fix basic rates setting from association response Tomas Winkler
@ 2008-10-30 15:16 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2008-10-30 15:16 UTC (permalink / raw)
  To: Tomas Winkler; +Cc: linville, yi.zhu, linux-wireless

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

On Thu, 2008-10-30 at 17:08 +0200, Tomas Winkler wrote:
> In previous code all the rates were marked as basic.

thanks.

johannes

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

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

end of thread, other threads:[~2008-10-30 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-30 15:08 [PATCH 1/1] mac80211: fix basic rates setting from association response Tomas Winkler
2008-10-30 15:16 ` Johannes Berg

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