diff options
author | Alexander Wetzel <alexander@wetzel-home.de> | 2019-06-29 15:50:14 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2019-07-26 07:29:10 -0400 |
commit | dc3998ec5cf2d377f2e85ba16b6a15affec98a0a (patch) | |
tree | cde1eea51bcb6f321717cea130dd82df202b20f9 | |
parent | 3e47bf1ca4c363ba8b1f99c4c3dcda13d2979954 (diff) |
mac80211: AMPDU handling for rekeys with Extended Key ID
Extended Key ID allows A-MPDU sessions while rekeying as long as each
A-MPDU aggregates only MPDUs with one keyid together.
Drivers able to segregate MPDUs accordingly can tell mac80211 to not
stop A-MPDU sessions when rekeying by setting the new flag
IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT.
Signed-off-by: Alexander Wetzel <alexander@wetzel-home.de>
Link: https://lore.kernel.org/r/20190629195015.19680-3-alexander@wetzel-home.de
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | include/net/mac80211.h | 5 | ||||
-rw-r--r-- | net/mac80211/debugfs.c | 1 | ||||
-rw-r--r-- | net/mac80211/key.c | 14 |
3 files changed, 14 insertions, 6 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 58941893a13f..0187d84031fc 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -2268,6 +2268,10 @@ struct ieee80211_txq { | |||
2268 | * @IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID: Hardware supports multi BSSID | 2268 | * @IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID: Hardware supports multi BSSID |
2269 | * only for HE APs. Applies if @IEEE80211_HW_SUPPORTS_MULTI_BSSID is set. | 2269 | * only for HE APs. Applies if @IEEE80211_HW_SUPPORTS_MULTI_BSSID is set. |
2270 | * | 2270 | * |
2271 | * @IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT: The card and driver is only | ||
2272 | * aggregating MPDUs with the same keyid, allowing mac80211 to keep Tx | ||
2273 | * A-MPDU sessions active while rekeying with Extended Key ID. | ||
2274 | * | ||
2271 | * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays | 2275 | * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays |
2272 | */ | 2276 | */ |
2273 | enum ieee80211_hw_flags { | 2277 | enum ieee80211_hw_flags { |
@@ -2319,6 +2323,7 @@ enum ieee80211_hw_flags { | |||
2319 | IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN, | 2323 | IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN, |
2320 | IEEE80211_HW_SUPPORTS_MULTI_BSSID, | 2324 | IEEE80211_HW_SUPPORTS_MULTI_BSSID, |
2321 | IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID, | 2325 | IEEE80211_HW_SUPPORTS_ONLY_HE_MULTI_BSSID, |
2326 | IEEE80211_HW_AMPDU_KEYBORDER_SUPPORT, | ||
2322 | 2327 | ||
2323 | /* keep last, obviously */ | 2328 | /* keep last, obviously */ |
2324 | NUM_IEEE80211_HW_FLAGS | 2329 | NUM_IEEE80211_HW_FLAGS |
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index 47435f57e086..568b3b276931 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c | |||
@@ -271,6 +271,7 @@ static const char *hw_flag_names[] = { | |||
271 | FLAG(TX_STATUS_NO_AMPDU_LEN), | 271 | FLAG(TX_STATUS_NO_AMPDU_LEN), |
272 | FLAG(SUPPORTS_MULTI_BSSID), | 272 | FLAG(SUPPORTS_MULTI_BSSID), |
273 | FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID), | 273 | FLAG(SUPPORTS_ONLY_HE_MULTI_BSSID), |
274 | FLAG(AMPDU_KEYBORDER_SUPPORT), | ||
274 | #undef FLAG | 275 | #undef FLAG |
275 | }; | 276 | }; |
276 | 277 | ||
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 92c3affb0eb0..7dfee848abac 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -270,7 +270,8 @@ int ieee80211_set_tx_key(struct ieee80211_key *key) | |||
270 | 270 | ||
271 | sta->ptk_idx = key->conf.keyidx; | 271 | sta->ptk_idx = key->conf.keyidx; |
272 | 272 | ||
273 | clear_sta_flag(sta, WLAN_STA_BLOCK_BA); | 273 | if (!ieee80211_hw_check(&local->hw, AMPDU_KEYBORDER_SUPPORT)) |
274 | clear_sta_flag(sta, WLAN_STA_BLOCK_BA); | ||
274 | ieee80211_check_fast_xmit(sta); | 275 | ieee80211_check_fast_xmit(sta); |
275 | 276 | ||
276 | return 0; | 277 | return 0; |
@@ -288,15 +289,16 @@ static void ieee80211_pairwise_rekey(struct ieee80211_key *old, | |||
288 | if (new->conf.flags & IEEE80211_KEY_FLAG_NO_AUTO_TX) { | 289 | if (new->conf.flags & IEEE80211_KEY_FLAG_NO_AUTO_TX) { |
289 | /* Extended Key ID key install, initial one or rekey */ | 290 | /* Extended Key ID key install, initial one or rekey */ |
290 | 291 | ||
291 | if (sta->ptk_idx != INVALID_PTK_KEYIDX) { | 292 | if (sta->ptk_idx != INVALID_PTK_KEYIDX && |
293 | !ieee80211_hw_check(&local->hw, AMPDU_KEYBORDER_SUPPORT)) { | ||
292 | /* Aggregation Sessions with Extended Key ID must not | 294 | /* Aggregation Sessions with Extended Key ID must not |
293 | * mix MPDUs with different keyIDs within one A-MPDU. | 295 | * mix MPDUs with different keyIDs within one A-MPDU. |
294 | * Tear down running Tx aggregation sessions and block | 296 | * Tear down running Tx aggregation sessions and block |
295 | * new Rx/Tx aggregation requests during rekey to | 297 | * new Rx/Tx aggregation requests during rekey to |
296 | * ensure there are no A-MPDUs for the driver to | 298 | * ensure there are no A-MPDUs when the driver is not |
297 | * aggregate. (Blocking Tx only would be sufficient but | 299 | * supporting A-MPDU key borders. (Blocking Tx only |
298 | * WLAN_STA_BLOCK_BA gets the job done for the few ms | 300 | * would be sufficient but WLAN_STA_BLOCK_BA gets the |
299 | * we need it.) | 301 | * job done for the few ms we need it.) |
300 | */ | 302 | */ |
301 | set_sta_flag(sta, WLAN_STA_BLOCK_BA); | 303 | set_sta_flag(sta, WLAN_STA_BLOCK_BA); |
302 | mutex_lock(&sta->ampdu_mlme.mtx); | 304 | mutex_lock(&sta->ampdu_mlme.mtx); |