summaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorAshok Nagarajan <ashok@cozybit.com>2012-04-02 21:21:21 -0700
committerJohn W. Linville <linville@tuxdriver.com>2012-04-11 16:23:47 -0400
commit9ebb61a23d90703344fc609fbee8da67b1e7456c (patch)
tree021483e65ed424166b539d9a26d92d415c842d86 /net/mac80211/util.c
parent657c3e0c4147bb3d3fdd338e32b83b968b0f9d02 (diff)
downloadop-kernel-dev-9ebb61a23d90703344fc609fbee8da67b1e7456c.zip
op-kernel-dev-9ebb61a23d90703344fc609fbee8da67b1e7456c.tar.gz
mac80211: Modify sta_get_rates to give basic rates
Signed-off-by: Ashok Nagarajan <ashok@cozybit.com> Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 468a18e..a18b693 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1109,7 +1109,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
u32 ieee80211_sta_get_rates(struct ieee80211_local *local,
struct ieee802_11_elems *elems,
- enum ieee80211_band band)
+ enum ieee80211_band band, u32 *basic_rates)
{
struct ieee80211_supported_band *sband;
struct ieee80211_rate *bitrates;
@@ -1130,15 +1130,25 @@ u32 ieee80211_sta_get_rates(struct ieee80211_local *local,
elems->ext_supp_rates_len; i++) {
u8 rate = 0;
int own_rate;
+ bool is_basic;
if (i < elems->supp_rates_len)
rate = elems->supp_rates[i];
else if (elems->ext_supp_rates)
rate = elems->ext_supp_rates
[i - elems->supp_rates_len];
own_rate = 5 * (rate & 0x7f);
- for (j = 0; j < num_rates; j++)
- if (bitrates[j].bitrate == own_rate)
+ is_basic = !!(rate & 0x80);
+
+ if (is_basic && (rate & 0x7f) == BSS_MEMBERSHIP_SELECTOR_HT_PHY)
+ continue;
+
+ for (j = 0; j < num_rates; j++) {
+ if (bitrates[j].bitrate == own_rate) {
supp_rates |= BIT(j);
+ if (basic_rates && is_basic)
+ *basic_rates |= BIT(j);
+ }
+ }
}
return supp_rates;
}
OpenPOWER on IntegriCloud