diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2010-04-28 09:17:03 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-04-28 16:50:28 -0400 |
commit | f0b058b61711ebf5be94d6865ca7b2c259b71d37 (patch) | |
tree | fa8e96ce04ad161b0f4fb6573a43edc449623e05 /net/mac80211 | |
parent | f7f7cc47fce6f01c3d3374c51508859c328ad5b2 (diff) |
mac80211: do not wip out old supported rates
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | 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 2b1f1f3d6a58..a9d40584e383 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -84,7 +84,7 @@ ieee80211_bss_info_update(struct ieee80211_local *local, | |||
84 | { | 84 | { |
85 | struct cfg80211_bss *cbss; | 85 | struct cfg80211_bss *cbss; |
86 | struct ieee80211_bss *bss; | 86 | struct ieee80211_bss *bss; |
87 | int clen; | 87 | int clen, srlen; |
88 | s32 signal = 0; | 88 | s32 signal = 0; |
89 | 89 | ||
90 | if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) | 90 | if (local->hw.flags & IEEE80211_HW_SIGNAL_DBM) |
@@ -113,23 +113,24 @@ ieee80211_bss_info_update(struct ieee80211_local *local, | |||
113 | bss->dtim_period = tim_ie->dtim_period; | 113 | bss->dtim_period = tim_ie->dtim_period; |
114 | } | 114 | } |
115 | 115 | ||
116 | bss->supp_rates_len = 0; | 116 | /* replace old supported rates if we get new values */ |
117 | srlen = 0; | ||
117 | if (elems->supp_rates) { | 118 | if (elems->supp_rates) { |
118 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; | 119 | clen = IEEE80211_MAX_SUPP_RATES; |
119 | if (clen > elems->supp_rates_len) | 120 | if (clen > elems->supp_rates_len) |
120 | clen = elems->supp_rates_len; | 121 | clen = elems->supp_rates_len; |
121 | memcpy(&bss->supp_rates[bss->supp_rates_len], elems->supp_rates, | 122 | memcpy(bss->supp_rates, elems->supp_rates, clen); |
122 | clen); | 123 | srlen += clen; |
123 | bss->supp_rates_len += clen; | ||
124 | } | 124 | } |
125 | if (elems->ext_supp_rates) { | 125 | if (elems->ext_supp_rates) { |
126 | clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; | 126 | clen = IEEE80211_MAX_SUPP_RATES - srlen; |
127 | if (clen > elems->ext_supp_rates_len) | 127 | if (clen > elems->ext_supp_rates_len) |
128 | clen = elems->ext_supp_rates_len; | 128 | clen = elems->ext_supp_rates_len; |
129 | memcpy(&bss->supp_rates[bss->supp_rates_len], | 129 | memcpy(bss->supp_rates + srlen, elems->ext_supp_rates, clen); |
130 | elems->ext_supp_rates, clen); | 130 | srlen += clen; |
131 | bss->supp_rates_len += clen; | ||
132 | } | 131 | } |
132 | if (srlen) | ||
133 | bss->supp_rates_len = srlen; | ||
133 | 134 | ||
134 | bss->wmm_used = elems->wmm_param || elems->wmm_info; | 135 | bss->wmm_used = elems->wmm_param || elems->wmm_info; |
135 | bss->uapsd_supported = is_uapsd_supported(elems); | 136 | bss->uapsd_supported = is_uapsd_supported(elems); |