Skip to contentSkip to conversation

ath11k: enable 11s secured mesh support

PATCH In review Pradeep Kumar Chitrapu 2 participants 6 messages May 28, 2019 – May 29, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

cover ath11k: enable 11s secured mesh support

In case of PMF, multicast/broadcast action frames and unicast action frames differ in processing. This patch series fixes the same in tx and rx path which is required for 11s secured mesh path establishment and data traffic on ath11k.

Pradeep Kumar Chitrapu (4):
ath11k: reset qos control bit after stripping qos field in

    iee80211_hdr

ath11k: pad mic len for protected action frames
ath11k: fix multicast txrx for secure 11s mesh support
ath11k: fix action frame rx processing

 drivers/net/wireless/ath/ath11k/dp_tx.c |  1 +
 drivers/net/wireless/ath/ath11k/mac.c   | 16 ++++++++++++++++
 drivers/net/wireless/ath/ath11k/wmi.c   | 15 +++++++++------
 3 files changed, 26 insertions(+), 6 deletions(-)
Signature · 7 lines
2.1.2


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw

PATCH 1/4 ath11k: reset qos control bit after stripping qos field in iee80211_hdr

fix resetting qos control bit in frame control when qos control field is stripped from native wifi packet.

---
 drivers/net/wireless/ath/ath11k/dp_tx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath11k/dp_tx.c +1 -0
index 55a19a05558f..2a15ca33d83c 100644
@@ -32,6 +32,7 @@ static void ath11k_dp_encap_nwifi(struct sk_buff *skb)
 		skb->data, (void *)qos_ctl - (void *)skb->data);
 	skb_pull(skb, IEEE80211_QOS_CTL_LEN);
 
+	hdr = (void *)skb->data;
 	hdr->frame_control &= ~__cpu_to_le16(IEEE80211_STYPE_QOS_DATA);
 }
 
Signature · 7 lines
2.1.2


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#2 lore raw

Re: [PATCH 1/4] ath11k: reset qos control bit after stripping qos field in iee80211_hdr

Quoted 4 lines · Pradeep Kumar Chitrapu

fix resetting qos control bit in frame control when qos control field is stripped from native wifi packet.

4 patches applied to ath.git, thanks.

e10d09bc1c2f ath11k: reset qos control bit after stripping qos field in iee80211_hdr 291848e1edc1 ath11k: pad mic len for protected action frames 28c2a93e7c41 ath11k: fix multicast txrx for secure 11s mesh support 5710b3f7f0f9 ath11k: fix action frame rx processing

Signature · 9 lines
https://patchwork.kernel.org/patch/10965859/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#3 lore raw

PATCH 2/4 ath11k: pad mic len for protected action frames

In reply to Pradeep Kumar Chitrapu

padding mic space is necessary for firmware to generate mic len correctly and to not run into any memory issues.

---
 drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +8 -0
index cb0de8e2aa60..c78c1481fe7f 100644
@@ -3179,6 +3179,7 @@ static int ath11k_mac_mgmt_tx_wmi(struct ath11k *ar, struct ath11k_vif *arvif,
 				  struct sk_buff *skb)
 {
 	struct ath11k_base *ab = ar->ab;
+	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 	dma_addr_t paddr;
 	int buf_id;
 	int ret;
@@ -3190,6 +3191,13 @@ static int ath11k_mac_mgmt_tx_wmi(struct ath11k *ar, struct ath11k_vif *arvif,
 	if (buf_id < 0)
 		return -ENOSPC;
 
+	if ((ieee80211_is_action(hdr->frame_control) ||
+	     ieee80211_is_deauth(hdr->frame_control) ||
+	     ieee80211_is_disassoc(hdr->frame_control)) &&
+	     ieee80211_has_protected(hdr->frame_control)) {
+		skb_put(skb, IEEE80211_CCMP_MIC_LEN);
+	}
+
 	paddr = dma_map_single(ab->dev, skb->data, skb->len, DMA_TO_DEVICE);
 	if (dma_mapping_error(ab->dev, paddr)) {
 		ath11k_warn(ab, "failed to DMA map mgmt Tx buffer\n");
Signature · 7 lines
2.1.2


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#4 lore raw

PATCH 3/4 ath11k: fix multicast txrx for secure 11s mesh support

In reply to Pradeep Kumar Chitrapu

setting MESH_MCAST_ENABLE wmi param is necessary for txrx of multicast action frames in 11s mesh.

---
 drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/wireless/ath/ath11k/mac.c +8 -0
index c78c1481fe7f..9730c077149a 100644
@@ -3373,6 +3373,14 @@ static int ath11k_start(struct ieee80211_hw *hw)
 		goto err;
 	}
 
+	ret = ath11k_wmi_pdev_set_param(ar, WMI_PDEV_PARAM_MESH_MCAST_ENABLE,
+					1, pdev->pdev_id);
+
+	if (ret) {
+		ath11k_err(ar->ab, "failed to enable MESH MCAST ENABLE: (%d\n", ret);
+		goto err;
+	}
+
 	__ath11k_set_antenna(ar, ar->cfg_tx_chainmask, ar->cfg_rx_chainmask);
 
 	/* TODO: Do we need to enable ANI? */
Signature · 7 lines
2.1.2


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#5 lore raw

PATCH 4/4 ath11k: fix action frame rx processing

In reply to Pradeep Kumar Chitrapu

Firmware/HW delivers broadcast/multicast management frames as encrypted and it should be decrypted by mac80211. Setting RX_FLAG_DECRYPTED status for these frames is breaking mesh connection establishment. For unicast protected action frames, HW decrypts the packet, however, IV and MIC are not stripped in HW and same must be done by mac80211. so fix that.

---
 drivers/net/wireless/ath/ath11k/wmi.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.c +9 -6
index 9ca44c4b24f8..07a6fd4d2f8c 100644
@@ -4905,16 +4905,19 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
 	status->flag |= RX_FLAG_SKIP_MONITOR;
 
 	/* In case of PMF, FW delivers decrypted frames with Protected Bit set.
-	 * Don't clear that. FW also delivers broadcast management frames
+	 * Don't clear that. Also, FW delivers broadcast management frames
 	 * (ex: group privacy action frames in mesh) as encrypted payload.
 	 */
-	if (!ieee80211_is_robust_mgmt_frame(skb))  {
+	if (ieee80211_has_protected(hdr->frame_control) &&
+	    !is_multicast_ether_addr(ieee80211_get_DA(hdr))) {
 		status->flag |= RX_FLAG_DECRYPTED;
 
-		status->flag |= RX_FLAG_IV_STRIPPED |
-			RX_FLAG_MMIC_STRIPPED;
-		hdr->frame_control = __cpu_to_le16(fc &
-				~IEEE80211_FCTL_PROTECTED);
+		if (!ieee80211_is_robust_mgmt_frame(skb)) {
+			status->flag |= RX_FLAG_IV_STRIPPED |
+					RX_FLAG_MMIC_STRIPPED;
+			hdr->frame_control = __cpu_to_le16(fc &
+					     ~IEEE80211_FCTL_PROTECTED);
+		}
 	}
 
 	/* TODO: Pending handle beacon implementation
Signature · 7 lines
2.1.2


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k