diff options
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r-- | net/mac80211/util.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 086ef6257b4b..acb6626ad0a4 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -908,16 +908,24 @@ int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, | |||
908 | } | 908 | } |
909 | 909 | ||
910 | if (sband->ht_cap.ht_supported) { | 910 | if (sband->ht_cap.ht_supported) { |
911 | __le16 tmp = cpu_to_le16(sband->ht_cap.cap); | 911 | u16 cap = sband->ht_cap.cap; |
912 | __le16 tmp; | ||
913 | |||
914 | if (ieee80211_disable_40mhz_24ghz && | ||
915 | sband->band == IEEE80211_BAND_2GHZ) { | ||
916 | cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; | ||
917 | cap &= ~IEEE80211_HT_CAP_SGI_40; | ||
918 | } | ||
912 | 919 | ||
913 | *pos++ = WLAN_EID_HT_CAPABILITY; | 920 | *pos++ = WLAN_EID_HT_CAPABILITY; |
914 | *pos++ = sizeof(struct ieee80211_ht_cap); | 921 | *pos++ = sizeof(struct ieee80211_ht_cap); |
915 | memset(pos, 0, sizeof(struct ieee80211_ht_cap)); | 922 | memset(pos, 0, sizeof(struct ieee80211_ht_cap)); |
923 | tmp = cpu_to_le16(cap); | ||
916 | memcpy(pos, &tmp, sizeof(u16)); | 924 | memcpy(pos, &tmp, sizeof(u16)); |
917 | pos += sizeof(u16); | 925 | pos += sizeof(u16); |
918 | /* TODO: needs a define here for << 2 */ | ||
919 | *pos++ = sband->ht_cap.ampdu_factor | | 926 | *pos++ = sband->ht_cap.ampdu_factor | |
920 | (sband->ht_cap.ampdu_density << 2); | 927 | (sband->ht_cap.ampdu_density << |
928 | IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT); | ||
921 | memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs)); | 929 | memcpy(pos, &sband->ht_cap.mcs, sizeof(sband->ht_cap.mcs)); |
922 | pos += sizeof(sband->ht_cap.mcs); | 930 | pos += sizeof(sband->ht_cap.mcs); |
923 | pos += 2 + 4 + 1; /* ext info, BF cap, antsel */ | 931 | pos += 2 + 4 + 1; /* ext info, BF cap, antsel */ |