All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ath11k: enable 11s secured mesh support
@ 2019-05-28 21:52 Pradeep Kumar Chitrapu
  2019-05-28 21:52 ` [PATCH 1/4] ath11k: reset qos control bit after stripping qos field in iee80211_hdr Pradeep Kumar Chitrapu
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Pradeep Kumar Chitrapu @ 2019-05-28 21:52 UTC (permalink / raw)
  To: ath11k; +Cc: Pradeep Kumar Chitrapu

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(-)

-- 
2.1.2


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] ath11k: reset qos control bit after stripping qos field in iee80211_hdr
  2019-05-28 21:52 [PATCH 0/4] ath11k: enable 11s secured mesh support Pradeep Kumar Chitrapu
@ 2019-05-28 21:52 ` Pradeep Kumar Chitrapu
  2019-05-29 15:21   ` Kalle Valo
  2019-05-28 21:52 ` [PATCH 2/4] ath11k: pad mic len for protected action frames Pradeep Kumar Chitrapu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Pradeep Kumar Chitrapu @ 2019-05-28 21:52 UTC (permalink / raw)
  To: ath11k; +Cc: Pradeep Kumar Chitrapu

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

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/dp_tx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
index 55a19a05558f..2a15ca33d83c 100644
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
@@ -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);
 }
 
-- 
2.1.2


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/4] ath11k: pad mic len for protected action frames
  2019-05-28 21:52 [PATCH 0/4] ath11k: enable 11s secured mesh support Pradeep Kumar Chitrapu
  2019-05-28 21:52 ` [PATCH 1/4] ath11k: reset qos control bit after stripping qos field in iee80211_hdr Pradeep Kumar Chitrapu
@ 2019-05-28 21:52 ` Pradeep Kumar Chitrapu
  2019-05-28 21:52 ` [PATCH 3/4] ath11k: fix multicast txrx for secure 11s mesh support Pradeep Kumar Chitrapu
  2019-05-28 21:52 ` [PATCH 4/4] ath11k: fix action frame rx processing Pradeep Kumar Chitrapu
  3 siblings, 0 replies; 6+ messages in thread
From: Pradeep Kumar Chitrapu @ 2019-05-28 21:52 UTC (permalink / raw)
  To: ath11k; +Cc: Pradeep Kumar Chitrapu

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

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index cb0de8e2aa60..c78c1481fe7f 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -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");
-- 
2.1.2


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/4] ath11k: fix multicast txrx for secure 11s mesh support
  2019-05-28 21:52 [PATCH 0/4] ath11k: enable 11s secured mesh support Pradeep Kumar Chitrapu
  2019-05-28 21:52 ` [PATCH 1/4] ath11k: reset qos control bit after stripping qos field in iee80211_hdr Pradeep Kumar Chitrapu
  2019-05-28 21:52 ` [PATCH 2/4] ath11k: pad mic len for protected action frames Pradeep Kumar Chitrapu
@ 2019-05-28 21:52 ` Pradeep Kumar Chitrapu
  2019-05-28 21:52 ` [PATCH 4/4] ath11k: fix action frame rx processing Pradeep Kumar Chitrapu
  3 siblings, 0 replies; 6+ messages in thread
From: Pradeep Kumar Chitrapu @ 2019-05-28 21:52 UTC (permalink / raw)
  To: ath11k; +Cc: Pradeep Kumar Chitrapu

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

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index c78c1481fe7f..9730c077149a 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -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? */
-- 
2.1.2


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/4] ath11k: fix action frame rx processing
  2019-05-28 21:52 [PATCH 0/4] ath11k: enable 11s secured mesh support Pradeep Kumar Chitrapu
                   ` (2 preceding siblings ...)
  2019-05-28 21:52 ` [PATCH 3/4] ath11k: fix multicast txrx for secure 11s mesh support Pradeep Kumar Chitrapu
@ 2019-05-28 21:52 ` Pradeep Kumar Chitrapu
  3 siblings, 0 replies; 6+ messages in thread
From: Pradeep Kumar Chitrapu @ 2019-05-28 21:52 UTC (permalink / raw)
  To: ath11k; +Cc: 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.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/wmi.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 9ca44c4b24f8..07a6fd4d2f8c 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -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
-- 
2.1.2


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/4] ath11k: reset qos control bit after stripping qos field in iee80211_hdr
  2019-05-28 21:52 ` [PATCH 1/4] ath11k: reset qos control bit after stripping qos field in iee80211_hdr Pradeep Kumar Chitrapu
@ 2019-05-29 15:21   ` Kalle Valo
  0 siblings, 0 replies; 6+ messages in thread
From: Kalle Valo @ 2019-05-29 15:21 UTC (permalink / raw)
  To: Pradeep Kumar Chitrapu; +Cc: ath11k

Pradeep Kumar Chitrapu <pradeepc@codeaurora.org> wrote:

> fix resetting qos control bit in frame control when qos control field
> is stripped from native wifi packet.
> 
> Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>

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

-- 
https://patchwork.kernel.org/patch/10965859/

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


_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-05-29 15:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-28 21:52 [PATCH 0/4] ath11k: enable 11s secured mesh support Pradeep Kumar Chitrapu
2019-05-28 21:52 ` [PATCH 1/4] ath11k: reset qos control bit after stripping qos field in iee80211_hdr Pradeep Kumar Chitrapu
2019-05-29 15:21   ` Kalle Valo
2019-05-28 21:52 ` [PATCH 2/4] ath11k: pad mic len for protected action frames Pradeep Kumar Chitrapu
2019-05-28 21:52 ` [PATCH 3/4] ath11k: fix multicast txrx for secure 11s mesh support Pradeep Kumar Chitrapu
2019-05-28 21:52 ` [PATCH 4/4] ath11k: fix action frame rx processing Pradeep Kumar Chitrapu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.