diff options
author | Ben Greear <greearb@candelatech.com> | 2011-11-18 14:32:00 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-21 16:22:06 -0500 |
commit | ef96a84202ccfb48a4569256ffba45e32308f7ee (patch) | |
tree | 708275d21455ecbf3b5408241b73f95fa4c484e0 /net/mac80211/mlme.c | |
parent | 7e7c8926b2f4e3453b8aeb39cd814d2af3fec24f (diff) |
mac80211: Support ht-cap over-rides.
This implements ht-cap over-rides for mac80211 drivers.
HT may be disabled, making an /a/b/g/n station act like an
a/b/g station. HT40 may be disabled forcing the station to
be HT20 even if the AP and local hardware support HT40.
MAX-AMSDU may be disabled.
AMPDU-Density may be increased.
AMPDU-Factor may be decreased.
This has been successfully tested with ath9k using patched
wpa_supplicant and iw.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 0f58122edffa..8925138736ef 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -207,6 +207,7 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata, | |||
207 | channel_type = NL80211_CHAN_HT20; | 207 | channel_type = NL80211_CHAN_HT20; |
208 | 208 | ||
209 | if (!(ap_ht_cap_flags & IEEE80211_HT_CAP_40MHZ_INTOLERANT) && | 209 | if (!(ap_ht_cap_flags & IEEE80211_HT_CAP_40MHZ_INTOLERANT) && |
210 | !ieee80111_cfg_override_disables_ht40(sdata) && | ||
210 | (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) && | 211 | (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) && |
211 | (hti->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) { | 212 | (hti->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) { |
212 | switch(hti->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { | 213 | switch(hti->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) { |
@@ -1118,6 +1119,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, | |||
1118 | 1119 | ||
1119 | /* on the next assoc, re-program HT parameters */ | 1120 | /* on the next assoc, re-program HT parameters */ |
1120 | sdata->ht_opmode_valid = false; | 1121 | sdata->ht_opmode_valid = false; |
1122 | memset(&ifmgd->ht_capa, 0, sizeof(ifmgd->ht_capa)); | ||
1123 | memset(&ifmgd->ht_capa_mask, 0, sizeof(ifmgd->ht_capa_mask)); | ||
1121 | 1124 | ||
1122 | local->power_constr_level = 0; | 1125 | local->power_constr_level = 0; |
1123 | 1126 | ||
@@ -1611,7 +1614,7 @@ static bool ieee80211_assoc_success(struct ieee80211_work *wk, | |||
1611 | sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; | 1614 | sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE; |
1612 | 1615 | ||
1613 | if (elems.ht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_11N)) | 1616 | if (elems.ht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_11N)) |
1614 | ieee80211_ht_cap_ie_to_sta_ht_cap(sband, | 1617 | ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, |
1615 | elems.ht_cap_elem, &sta->sta.ht_cap); | 1618 | elems.ht_cap_elem, &sta->sta.ht_cap); |
1616 | 1619 | ||
1617 | ap_ht_cap_flags = sta->sta.ht_cap.cap; | 1620 | ap_ht_cap_flags = sta->sta.ht_cap.cap; |
@@ -1980,7 +1983,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, | |||
1980 | 1983 | ||
1981 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; | 1984 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; |
1982 | 1985 | ||
1983 | ieee80211_ht_cap_ie_to_sta_ht_cap(sband, | 1986 | ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, |
1984 | elems.ht_cap_elem, &sta->sta.ht_cap); | 1987 | elems.ht_cap_elem, &sta->sta.ht_cap); |
1985 | 1988 | ||
1986 | ap_ht_cap_flags = sta->sta.ht_cap.cap; | 1989 | ap_ht_cap_flags = sta->sta.ht_cap.cap; |
@@ -2640,6 +2643,13 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, | |||
2640 | ifmgd->flags |= IEEE80211_STA_DISABLE_11N; | 2643 | ifmgd->flags |= IEEE80211_STA_DISABLE_11N; |
2641 | 2644 | ||
2642 | 2645 | ||
2646 | if (req->flags & ASSOC_REQ_DISABLE_HT) | ||
2647 | ifmgd->flags |= IEEE80211_STA_DISABLE_11N; | ||
2648 | |||
2649 | memcpy(&ifmgd->ht_capa, &req->ht_capa, sizeof(ifmgd->ht_capa)); | ||
2650 | memcpy(&ifmgd->ht_capa_mask, &req->ht_capa_mask, | ||
2651 | sizeof(ifmgd->ht_capa_mask)); | ||
2652 | |||
2643 | if (req->ie && req->ie_len) { | 2653 | if (req->ie && req->ie_len) { |
2644 | memcpy(wk->ie, req->ie, req->ie_len); | 2654 | memcpy(wk->ie, req->ie, req->ie_len); |
2645 | wk->ie_len = req->ie_len; | 2655 | wk->ie_len = req->ie_len; |