Skip to contentSkip to conversation

ath11k: Add Mesh mode support

PATCH In review Rajkumar Manoharan 2 participants 9 messages Apr 19, 2019 – May 29, 2019 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

v2 cover ath11k: Add Mesh mode support

Hi,

Posting initial patches to bring Mesh support to ath11k. There are known issues which is also captured in first patch.

Known issues:
- Depends on firmware fix to allow other BSS frames
- Failed to complete path negotiation in secured mode
- Target assert while shutting down interface in secured mode

-Rajkumar

Rajkumar Manoharan (3):
ath11k: enable mesh mode
ath11k: allow 4 address transmission for mesh packet
ath11k: remove addition check for PMF

 drivers/net/wireless/ath/ath11k/dp_tx.c |  3 +++
 drivers/net/wireless/ath/ath11k/mac.c   | 19 ++++++++++++++++++-
 drivers/net/wireless/ath/ath11k/wmi.c   | 21 ++++++++++-----------
 drivers/net/wireless/ath/ath11k/wmi.h   | 11 +++++++----
 4 files changed, 38 insertions(+), 16 deletions(-)
Signature · 7 lines
1.9.1


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

PATCH v2 1/3 ath11k: enable mesh mode

Allow Meshpoint configuration from ath11k and advertise MP support to mac80211. Firmware supports mesh type from WLAN.HK.2.1.0.1-00113-QCAHKSWPL_SILICONZ-1 onwards. As of now, only open auth mesh networking is working.

Known issues:
- Depends on firmware fix to allow other BSS frames
- Failed to complete path negotiation in secured mode
- Target assert while shutting down interface in secured mode

---
v2: added fallthrough comment

 drivers/net/wireless/ath/ath11k/mac.c | 11 ++++++++++-
 drivers/net/wireless/ath/ath11k/wmi.h | 11 +++++++----
 2 files changed, 17 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +10 -1
index 12a2c4421264..7d838f2a9138 100644
@@ -2579,6 +2579,7 @@ static int ath11k_sta_state(struct ieee80211_hw *hw,
 	} else if (old_state == IEEE80211_STA_AUTH &&
 		   new_state == IEEE80211_STA_ASSOC &&
 		   (vif->type == NL80211_IFTYPE_AP ||
+		    vif->type == NL80211_IFTYPE_MESH_POINT ||
 		    vif->type == NL80211_IFTYPE_ADHOC)) {
 		ret = ath11k_station_assoc(ar, vif, sta, false);
 		if (ret)
@@ -2591,6 +2592,7 @@ static int ath11k_sta_state(struct ieee80211_hw *hw,
 	} else if (old_state == IEEE80211_STA_ASSOC &&
 		   new_state == IEEE80211_STA_AUTH &&
 		   (vif->type == NL80211_IFTYPE_AP ||
+		    vif->type == NL80211_IFTYPE_MESH_POINT ||
 		    vif->type == NL80211_IFTYPE_ADHOC)) {
 		ret = ath11k_station_disassoc(ar, vif, sta);
 		if (ret)
@@ -3436,6 +3438,9 @@ static int ath11k_add_interface(struct ieee80211_hw *hw,
 	case NL80211_IFTYPE_STATION:
 		arvif->vdev_type = WMI_VDEV_TYPE_STA;
 		break;
+	case NL80211_IFTYPE_MESH_POINT:
+		arvif->vdev_subtype = WMI_VDEV_SUBTYPE_MESH_11S;
+		/* fall through */
 	case NL80211_IFTYPE_AP:
 		arvif->vdev_type = WMI_VDEV_TYPE_AP;
 		break;
@@ -4702,6 +4707,9 @@ static int ath11k_get_survey(struct ieee80211_hw *hw, int idx,
 	{
 		.max    = 16,
 		.types  = BIT(NL80211_IFTYPE_AP)
+#ifdef CONFIG_MAC80211_MESH
+			| BIT(NL80211_IFTYPE_MESH_POINT)
+#endif
 	},
 };
 
@@ -4820,7 +4828,8 @@ static int ath11k_mac_register(struct ath11k *ar)
 	ar->hw->wiphy->available_antennas_tx = cap->tx_chain_mask;
 
 	ar->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
-					 BIT(NL80211_IFTYPE_AP);
+					 BIT(NL80211_IFTYPE_AP) |
+					 BIT(NL80211_IFTYPE_MESH_POINT);
 
 	ieee80211_hw_set(ar->hw, SIGNAL_DBM);
 	ieee80211_hw_set(ar->hw, SUPPORTS_PS);
drivers/net/wireless/ath/ath11k/wmi.h +7 -4
index 8102e80506fa..5d20f57fbacc 100644
@@ -4720,10 +4720,13 @@ enum wmi_vdev_type {
 };
 
 enum wmi_vdev_subtype {
-	WMI_VDEV_SUBTYPE_NONE       = 0,
-	WMI_VDEV_SUBTYPE_P2P_DEVICE = 1,
-	WMI_VDEV_SUBTYPE_P2P_CLIENT = 2,
-	WMI_VDEV_SUBTYPE_P2P_GO     = 3,
+	WMI_VDEV_SUBTYPE_NONE,
+	WMI_VDEV_SUBTYPE_P2P_DEVICE,
+	WMI_VDEV_SUBTYPE_P2P_CLIENT,
+	WMI_VDEV_SUBTYPE_P2P_GO,
+	WMI_VDEV_SUBTYPE_PROXY_STA,
+	WMI_VDEV_SUBTYPE_MESH_NON_11S,
+	WMI_VDEV_SUBTYPE_MESH_11S,
 };
 
 enum wmi_sta_powersave_param {
Signature · 7 lines
1.9.1


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

PATCH v2 2/3 ath11k: allow 4 address transmission for mesh packet

In reply to Rajkumar Manoharan

Inform the target to use 4 adressses in 802.11 header for mesh data by marking the peer is capable of operating in 4 address format. Also ensure to inform TCL ring that mesh header is pesent in payload. This will be useful for enabling HW checksumming form mesh packets.

---
 drivers/net/wireless/ath/ath11k/dp_tx.c |  3 +++
 drivers/net/wireless/ath/ath11k/mac.c   | 11 +++++++++++
 2 files changed, 14 insertions(+)
drivers/net/wireless/ath/ath11k/dp_tx.c +3 -0
index 5324c5f514f8..b2807a88df9c 100644
@@ -131,7 +131,10 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
 			     FIELD_PREP(HAL_TCL_DATA_CMD_INFO1_TCP6_CKSUM_EN, 1);
 	}
 
+	if (ieee80211_vif_is_mesh(arvif->vif))
+		ti.flags1 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_MESH_ENABLE, 1);
 	ti.flags1 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE, 1);
+
 	ti.tid = ath11k_dp_get_tid(skb);
 
 	switch (ti.encap_type) {
drivers/net/wireless/ath/ath11k/mac.c +11 -0
index 7d838f2a9138..ccac41bf9217 100644
@@ -2550,6 +2550,17 @@ static int ath11k_sta_state(struct ieee80211_hw *hw,
 				goto exit;
 		}
 
+		if (ieee80211_vif_is_mesh(vif)) {
+			ret = ath11k_wmi_set_peer_param(ar, sta->addr,
+							arvif->vdev_id,
+							WMI_PEER_USE_4ADDR, 1);
+			if (ret) {
+				ath11k_warn(ar->ab, "failed to STA %pM 4addr capability: %d\n",
+					    sta->addr, ret);
+				goto exit;
+			}
+		}
+
 		ret = ath11k_dp_peer_setup(ar, arvif->vdev_id, sta->addr);
 		if (ret) {
 			ath11k_warn(ar->ab, "failed to setup dp for peer %pM on vdev %i (%d)\n",
Signature · 7 lines
1.9.1


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

PATCH v2 3/3 ath11k: remove unnecessary check for PMF

In reply to Rajkumar Manoharan

Firmware delivers mesh group action frame as encrypted payload. To allow software decryption for these group action frames, rx status should not be marked as RX_FLAG_DECRYPTED and protected bit in frame control should not be cleared. Existing robust management check is enough to handle RX_FLAG_DECRYPTED. Hence removing unnecessary protected frame validation.

---
 drivers/net/wireless/ath/ath11k/wmi.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.c +10 -11
index cdacbaea188c..5712ac030419 100644
@@ -5196,18 +5196,17 @@ void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
 	 */
 	status->flag |= RX_FLAG_SKIP_MONITOR;
 
-	if (ieee80211_has_protected(hdr->frame_control)) {
-		/* In case of PMF, FW delivers decrypted frames
-		 * with Protected Bit set. Don't clear that.
-		 */
-		if (!ieee80211_is_robust_mgmt_frame(skb))  {
-			status->flag |= RX_FLAG_DECRYPTED;
+	/* In case of PMF, FW delivers decrypted frames with Protected Bit set.
+	 * Don't clear that. FW also delivers broadcast management frames
+	 * (ex: group privacy action frames in mesh) as encrypted payload.
+	 */
+	if (!ieee80211_is_robust_mgmt_frame(skb))  {
+		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);
-		}
+		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
1.9.1


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#4 lore raw
In reply to Rajkumar Manoharan
Quoted 4 lines · On Friday, 19 April 2019 20:11:35 CEST Rajkumar Manoharan wrote:

Hi,

Posting initial patches to bring Mesh support to ath11k. There are known issues which is also captured in first patch.

What else is required to get this working? I used ath11k-bringup (which included these patches) and wanted to implement the HE registration part for it. But it turns out that it doesn't event work here with VHT. This is what I did on two HK01 rev B:

iw phy phy2 interface add mesh2 type mp ip link set up dev mesh2
iw dev mesh2 mesh join testmesh freq 5180 80MHz

But the firmware just crashes somewhere around the association phase:

    [   59.458342] ath11k c000000.wifi1: Added peer: 00:03:7f:12:82:a3 for VDEV: 0
    [   59.566646] qcom-q6v5-wcss-pil cd00000.qcom_q6v5_wcss: fatal error received:
    [   59.566646] QC Image Version: QC_IMAGE_VERSION_STRING=WLAN.HK.2.1.0.1-00410-QCAHKSWPL_SILICONZ-2
    [   59.566646] Image Variant : IMAGE_VARIANT_STRING=8074.wlanfw.eval_v2Q
    [   59.566646]
    [   59.566646] wlan_peer.c:2486 Assertion (vdev->bss->ni_chan.phy_mode >= peer_ratectrl_params.phymode) failedparam0 :zero, param1 :zero, param2 :zero.
    [   59.566646] Thread ID      : 0x0000005d  Thread name    : WLAN RT2  Process ID     : 0
    [   59.566646] Register:
    [   59.566646] SP : 0x4c1921f0
    [   59.566646] FP : 0x4c1921f8
    [   59.566646] PC : 0x4b1c8850
    [   59.566646] SSR : 0x00000008
    [   59.566646] BADVA : 0x00020000
    [   59.566646] LR : 0x4b1c7c68
    [   59.566646]
    [   59.566646] Stack Dump
    [   59.566646] from : 0x4c1921f0
    [   59.566646] to   : 0x4c192860
    [   59.566646]
    [   59.618939] remoteproc remoteproc0: crash detected in cd00000.qcom_q6v5_wcss: type fatal error
    [   59.641203] remoteproc remoteproc0: handling crash #1 in cd00000.qcom_q6v5_wcss
    [   59.649605] Kernel panic - not syncing: remoteproc remoteproc0: Resetting the SoC - cd00000.qcom_q6v5_wcss crashed

The whole device goes down after that.

Kind regards,
Sven

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

#5 lore raw

On Tuesday, 28 May 2019 15:48:25 CEST Sven Eckelmann wrote:
[...]

Quoted 3 lines

What else is required to get this working? I used ath11k-bringup (which included these patches) and wanted to implement the HE registration part for it. But it turns out that it doesn't event work here with VHT. This is what

I

Quoted 1 line

did on two HK01 rev B:

[...]

Just talked to John. It seems that mesh at the moment only "works" when using legacy (non-HT) mode (this is what he used previously - so mesh join without freq and bandwidth):

iw phy phy2 interface add mesh2 type mp
ip link set up dev mesh2
iw dev mesh2 mesh join testmesh

But the HT/VHT stuff is just crashing the firmware as shown in the last mail.

iw dev mesh2 mesh join testmesh freq 5180 80MHz

Also tested ph1 with "freq 2412 HT20" and it crashed the same way.

Kind regards,
Sven

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

#6 lore raw
Quoted 17 lines · Sven Eckelmann

On Tuesday, 28 May 2019 15:48:25 CEST Sven Eckelmann wrote:
[...]

Quoted 3 lines

What else is required to get this working? I used ath11k-bringup (which included these patches) and wanted to implement the HE registration part for it. But it turns out that it doesn't event work here with VHT. This is what

I

Quoted 1 line

did on two HK01 rev B:

[...]

Just talked to John. It seems that mesh at the moment only "works" when using legacy (non-HT) mode (this is what he used previously - so mesh join without freq and bandwidth):

iw phy phy2 interface add mesh2 type mp
ip link set up dev mesh2
iw dev mesh2 mesh join testmesh

Quoted 6 lines

But the HT/VHT stuff is just crashing the firmware as shown in the last mail.

iw dev mesh2 mesh join testmesh freq 5180 80MHz

Also tested ph1 with "freq 2412 HT20" and it crashed the same way.

Sven,

FW assert occurs, if a mesh node of different phymode/bw tries to join existing mesh network. We noticed this issue when 11n device peering with ath11k mesh node. IMHO this shouldn't be HT/VHT specific. It is problem of mixed mode.

-Rajkumar

-Rajkumar

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

#7 lore raw
Quoted 5 lines · On Wednesday, 29 May 2019 06:26:16 CEST Rajkumar Manoharan wrote:

FW assert occurs, if a mesh node of different phymode/bw tries to join existing mesh network. We noticed this issue when 11n device peering with ath11k mesh
node. IMHO this shouldn't be HT/VHT specific. It is problem of mixed mode.

Happens for me when both HK01 boards are set up the same way (see the examples which I provided) in an earlier mail.

Will check it again when I was informed that the new firmware is available for us.

Kind regards,
Sven

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

#8 lore raw
Quoted 10 lines · Sven Eckelmann
Quoted 5 lines · On Wednesday, 29 May 2019 06:26:16 CEST Rajkumar Manoharan wrote:

FW assert occurs, if a mesh node of different phymode/bw tries to join existing mesh network. We noticed this issue when 11n device peering with ath11k mesh
node. IMHO this shouldn't be HT/VHT specific. It is problem of mixed mode.

Happens for me when both HK01 boards are set up the same way (see the examples which I provided) in an earlier mail.

Will confirm it from our side too.

Quoted 3 lines

Will check it again when I was informed that the new firmware is available for us.

Yes. Latest firmware release has fixes for secured 11s mode. You have to cherrypick ath11k changes[1] too.

-Rajkumar

[1] https://patchwork.kernel.org/project/ath11k/list/?series=124083

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