aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 166a29fe6c35..fe1704c4e8fb 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -339,8 +339,9 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
339 339
340 switch (key->conf.cipher) { 340 switch (key->conf.cipher) {
341 case WLAN_CIPHER_SUITE_TKIP: 341 case WLAN_CIPHER_SUITE_TKIP:
342 iv32 = key->u.tkip.tx.iv32; 342 pn64 = atomic64_read(&key->conf.tx_pn);
343 iv16 = key->u.tkip.tx.iv16; 343 iv32 = TKIP_PN_TO_IV32(pn64);
344 iv16 = TKIP_PN_TO_IV16(pn64);
344 345
345 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE && 346 if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE &&
346 !(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) { 347 !(key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) {
@@ -1131,6 +1132,34 @@ static int sta_apply_parameters(struct ieee80211_local *local,
1131 sta->sta.max_sp = params->max_sp; 1132 sta->sta.max_sp = params->max_sp;
1132 } 1133 }
1133 1134
1135 /* The sender might not have sent the last bit, consider it to be 0 */
1136 if (params->ext_capab_len >= 8) {
1137 u8 val = (params->ext_capab[7] &
1138 WLAN_EXT_CAPA8_MAX_MSDU_IN_AMSDU_LSB) >> 7;
1139
1140 /* we did get all the bits, take the MSB as well */
1141 if (params->ext_capab_len >= 9) {
1142 u8 val_msb = params->ext_capab[8] &
1143 WLAN_EXT_CAPA9_MAX_MSDU_IN_AMSDU_MSB;
1144 val_msb <<= 1;
1145 val |= val_msb;
1146 }
1147
1148 switch (val) {
1149 case 1:
1150 sta->sta.max_amsdu_subframes = 32;
1151 break;
1152 case 2:
1153 sta->sta.max_amsdu_subframes = 16;
1154 break;
1155 case 3:
1156 sta->sta.max_amsdu_subframes = 8;
1157 break;
1158 default:
1159 sta->sta.max_amsdu_subframes = 0;
1160 }
1161 }
1162
1134 /* 1163 /*
1135 * cfg80211 validates this (1-2007) and allows setting the AID 1164 * cfg80211 validates this (1-2007) and allows setting the AID
1136 * only when creating a new station entry 1165 * only when creating a new station entry
@@ -1160,6 +1189,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
1160 ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, 1189 ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
1161 params->ht_capa, sta); 1190 params->ht_capa, sta);
1162 1191
1192 /* VHT can override some HT caps such as the A-MSDU max length */
1163 if (params->vht_capa) 1193 if (params->vht_capa)
1164 ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, 1194 ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
1165 params->vht_capa, sta); 1195 params->vht_capa, sta);