summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath11k/mac.c
diff options
context:
space:
mode:
authorManikanta Pubbisetty <mpubbise@codeaurora.org>2020-03-16 07:37:19 +0200
committerKalle Valo <kvalo@codeaurora.org>2020-03-17 08:35:30 +0200
commit243874c64c8137bc90455200a7735da72836ecab (patch)
tree3a6c21445862e3fdca5e396fd0438b000005e7c2 /drivers/net/wireless/ath/ath11k/mac.c
parent377c0a94ad1cf005c47d7a502d1f8e46fbcf747a (diff)
ath11k: handle RX fragments
IPQ8074 HW has support to verify the PN of the received frames. For all frames except for fragmented ones, HW checks the PN and delivers them to the driver. For fragmented frames, driver is required to do a little more; it has to reassemble the fragments and then reinject them to the HW for verifying the PN. Currently, to keep the logic simple, PN verifcation is disabled in HW and is handled in mac80211 for all the frames (fragmented and unfragmented). On the contrary, offloading PN Validation to the HW brings important benefits. It reduces CPU cycles spent on the host CPU for verifying the same; helps in enabling features which improve performance like mac80211 fast RX path, enabling multiple REO rings for parallel RX processing, 802.11 decapsulation offloading. All these features are dependent on PN offload which in turn is dependent on handling of the received fragments in the driver. When TKIP security is used, additional handling is required while processing the fragments; since MIC is computed on an MSDU in TKIP, only the last fragment has the MIC info. In this case, driver has to compute the MIC after reassembly and compare it against the MIC present in the frame. For this, MICHAEL_MIC kernel crypto library APIs are used and the dependencies are appropriately set. Signed-off-by: Manikanta Pubbisetty <mpubbise@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/ath/ath11k/mac.c')
-rw-r--r--drivers/net/wireless/ath/ath11k/mac.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index e28f5a348be6..2b9097557d95 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -2384,11 +2384,19 @@ static int ath11k_mac_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
spin_lock_bh(&ab->base_lock);
peer = ath11k_peer_find(ab, arvif->vdev_id, peer_addr);
- if (peer && cmd == SET_KEY)
+ if (peer && cmd == SET_KEY) {
peer->keys[key->keyidx] = key;
- else if (peer && cmd == DISABLE_KEY)
+ if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
+ peer->ucast_keyidx = key->keyidx;
+ else
+ peer->mcast_keyidx = key->keyidx;
+ } else if (peer && cmd == DISABLE_KEY) {
peer->keys[key->keyidx] = NULL;
- else if (!peer)
+ if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE)
+ peer->ucast_keyidx = 0;
+ else
+ peer->mcast_keyidx = 0;
+ } else if (!peer)
/* impossible unless FW goes crazy */
ath11k_warn(ab, "peer %pM disappeared!\n", peer_addr);
spin_unlock_bh(&ab->base_lock);