Skip to contentSkip to conversation

ath11k: Meshpoint interfaces with fw 0x30804a5

DISCUSSION Rajkumar Manoharan 3 participants 3 messages Apr 4, 2019 1 message not in the archive Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 9 lines

I just wanted to try out meshpoint interfaces with firmware 0x30804a5. The change seemed to be a straight forward port from ath10k. But it turned out that the firmware seems to behave significantly different. I saw three unexpected things:

0. firmware dies immediately when using subtype 6 (MESH_11S) during vdev create

Quoted 9 lines
    [   28.663988] Fatal error received from wcss software!:
    [   28.663988] QC Image Version: 
QC_IMAGE_VERSION_STRING=WLAN.HK.1.1-01967-QCAHKSWPL_SILICONZ-1
    [   28.663988] Image Variant : 
IMAGE_VARIANT_STRING=8074.wlanfw.evalQ
    [   28.663988]
    [   28.663988] ar_wal_peer.c:7223 Assertion 

!WAL_IS_TID_QOS_DATA(tidno) failedparam0 :zero, param1 :zero, param2 :zero.

Sven,

Cool... The target assert was fixed in firmware. QCA also is bringing up ath11k in MP and with attached list of changes, we were able to send traffic open-mesh. Changes are not yet pushed to tree.

Below issues were observed in bring up and fixed in WLAN.HK.2.1.0.1-00113-QCAHKSWPL_SILICONZ-1 firmware

1) Assert in mesh interface creation.
2) Group action were filtered
3) fix 4 addr in firmware for mesh peers

Moving forward please use 2.1.0-1 firmware release which is meant for ath11k. We are still working on to enable secured mesh (SAE).

-Rajkumar

From 8c5024b43512ae5985436c835d2624041b823a7e Mon Sep 17 00:00:00 2001
From: Rajkumar Manoharan <[email protected]>
Date: Mon, 21 Jan 2019 16:45:21 -0800
Subject: [PATCH 1/6] ath11k: enable mesh mode

Allow Meshpoint configuration from ath11k and advertise MP support to mac80211.

---
 drivers/net/wireless/ath/ath11k/mac.c | 13 +++++++++++--
 drivers/net/wireless/ath/ath11k/wmi.h | 11 +++++++----
 2 files changed, 18 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +11 -2
index 3d624a46c62c..07b340a97be9 100644
@@ -2150,7 +2150,8 @@ static int ath11k_install_peer_wep_keys(struct ath11k_vif *arvif,
 
 	lockdep_assert_held(&ar->conf_mutex);
 
-	if (WARN_ON(arvif->vif->type != NL80211_IFTYPE_AP))
+	if (WARN_ON(arvif->vif->type != NL80211_IFTYPE_AP &&
+		    arvif->vif->type != NL80211_IFTYPE_MESH_POINT))
 		return -EINVAL;
 
 	spin_lock_bh(&ar->data_lock);
@@ -2713,6 +2714,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)
@@ -2725,6 +2727,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)
@@ -3562,6 +3565,8 @@ 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;
 	case NL80211_IFTYPE_AP:
 		arvif->vdev_type = WMI_VDEV_TYPE_AP;
 		break;
@@ -4813,6 +4818,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
 	},
 };
 
@@ -4927,7 +4935,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 06ba7cdd9c10..c25ed3934fb7 100644
@@ -4685,10 +4685,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 · 20 lines
1.9.1


From 77c0156d8f4eeca518dc63946b413c1127323dbe Mon Sep 17 00:00:00 2001
From: Rajkumar Manoharan <[email protected]>
Date: Wed, 13 Mar 2019 11:21:54 -0700
Subject: [PATCH 2/6] ath11k: allow 4 address transmission for mesh packet

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.

Co-Developed-by: Pradeep Kumar Chitrapu <[email protected]>
Signed-off-by: Pradeep Kumar Chitrapu <[email protected]>
Signed-off-by: Rajkumar Manoharan <[email protected]>
---
 drivers/net/wireless/ath/ath11k/dp_tx.c | 3 +++
 drivers/net/wireless/ath/ath11k/mac.c   | 9 +++++++++
 2 files changed, 12 insertions(+)
drivers/net/wireless/ath/ath11k/dp_tx.c +3 -0
index eedf8a465db6..33b190ed9d7c 100644
@@ -128,7 +128,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 +9 -0
index 07b340a97be9..14bd1e86c6f4 100644
@@ -2487,6 +2487,15 @@ static int ath11k_station_assoc(struct ath11k *ar,
 		}
 	}
 
+	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);
+		}
+	}
+
 	return 0;
 }
 
Signature · 18 lines
1.9.1


From 7cd5c82b3162a41e156240ed6d3ff74f1ffc745f Mon Sep 17 00:00:00 2001
From: Rajkumar Manoharan <[email protected]>
Date: Thu, 28 Mar 2019 13:34:18 -0700
Subject: [PATCH 3/6] ath11k: handle encrypted mesh group action frame

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.

Tested-by: Pradeep Kumar Chitrapu <[email protected]>
Signed-off-by: Rajkumar Manoharan <[email protected]>
---
 drivers/net/wireless/ath/ath11k/wmi.c | 56 +++++++++++++++++++++++------------
 1 file changed, 37 insertions(+), 19 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.c +37 -19

91 lines not on this page · raw message

Signature · 15 lines
1.9.1


From 13ed4c1de2595f5ce21c09615974a086bfcbe22c Mon Sep 17 00:00:00 2001
From: Rajkumar Manoharan <[email protected]>
Date: Thu, 28 Mar 2019 16:45:11 -0700
Subject: [PATCH 4/6] ath11k: allow software encryption of GMAC/CMAC ciphers

Until hardward encryption of CMAC/GMAC ciphers are properly
validated, allow only software encryption for now.

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
 drivers/net/wireless/ath/ath11k/mac.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +18 -5
index 14bd1e86c6f4..120246c9b536 100644
@@ -2030,7 +2030,6 @@ static int ath11k_install_key(struct ath11k_vif *arvif,
 	switch (key->cipher) {
 	case WLAN_CIPHER_SUITE_CCMP:
 		arg.key_cipher = WMI_CIPHER_AES_CCM;
-		/* TODO: Re-check if flag is valid */
 		key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV_MGMT;
 		break;
 	case WLAN_CIPHER_SUITE_TKIP:
@@ -2049,12 +2048,12 @@ static int ath11k_install_key(struct ath11k_vif *arvif,
 	case WLAN_CIPHER_SUITE_GCMP_256:
 		arg.key_cipher = WMI_CIPHER_AES_GCM;
 		break;
-	case WLAN_CIPHER_SUITE_BIP_GMAC_128:
-	case WLAN_CIPHER_SUITE_BIP_GMAC_256:
-		arg.key_cipher = WMI_CIPHER_AES_GMAC;
 	case WLAN_CIPHER_SUITE_AES_CMAC:
 	case WLAN_CIPHER_SUITE_BIP_CMAC_256:
-		arg.key_cipher = WMI_CIPHER_AES_CMAC;
+	case WLAN_CIPHER_SUITE_BIP_GMAC_128:
+	case WLAN_CIPHER_SUITE_BIP_GMAC_256:
+		WARN_ON(1);
+		return -EINVAL;
 	default:
 		ath11k_warn(ar->ab, "cipher %d is not supported\n", key->cipher);
 		return -EOPNOTSUPP;
@@ -2237,6 +2236,13 @@ static int ath11k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	int ret = 0;
 	u32 flags = 0;
 
+	/* this one needs to be done in software */
+	if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
+	    key->cipher == WLAN_CIPHER_SUITE_BIP_CMAC_256 ||
+	    key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
+	    key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)
+		return 1;
+
 	if (key->keyidx > WMI_MAX_KEY_INDEX)
 		return -ENOSPC;
 
@@ -4922,7 +4928,14 @@ static int ath11k_mac_register(struct ath11k *ar)
 		WLAN_CIPHER_SUITE_WEP104,
 		WLAN_CIPHER_SUITE_TKIP,
 		WLAN_CIPHER_SUITE_CCMP,
+		WLAN_CIPHER_SUITE_GCMP,
+		WLAN_CIPHER_SUITE_GCMP_256,
+		WLAN_CIPHER_SUITE_CCMP_256,
+		/* Software encryption ciphers */
 		WLAN_CIPHER_SUITE_AES_CMAC,
+		WLAN_CIPHER_SUITE_BIP_CMAC_256,
+		WLAN_CIPHER_SUITE_BIP_GMAC_128,
+		WLAN_CIPHER_SUITE_BIP_GMAC_256,
 	};
 	int ret;
 	u32 ht_cap = 0;
Signature · 13 lines
1.9.1


From 74758b845bd69f339271457ae4fb8d067a769ad6 Mon Sep 17 00:00:00 2001
From: Rajkumar Manoharan <[email protected]>
Date: Thu, 28 Mar 2019 17:14:38 -0700
Subject: [PATCH 5/6] ath11k: fix key deletion

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
 drivers/net/wireless/ath/ath11k/mac.c | 14 +++++---------
 drivers/net/wireless/ath/ath11k/wmi.c |  3 ++-
 2 files changed, 7 insertions(+), 10 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +5 -9
index 120246c9b536..1dfc10d954a9 100644
@@ -2019,14 +2019,6 @@ static int ath11k_install_key(struct ath11k_vif *arvif,
 
 	reinit_completion(&ar->install_key_done);
 
-	if (cmd == DISABLE_KEY) {
-		/* TODO: Check if FW expects  value other than NONE for del */
-		/* arg.key_cipher = WMI_CIPHER_NONE; */
-		arg.key_len = 0;
-		arg.key_data = NULL;
-		goto install;
-	}
-
 	switch (key->cipher) {
 	case WLAN_CIPHER_SUITE_CCMP:
 		arg.key_cipher = WMI_CIPHER_AES_CCM;
@@ -2059,7 +2051,11 @@ static int ath11k_install_key(struct ath11k_vif *arvif,
 		return -EOPNOTSUPP;
 	}
 
-install:
+	if (cmd == DISABLE_KEY) {
+		arg.key_cipher = WMI_CIPHER_NONE;
+		arg.key_data = NULL;
+	}
+
 	ret = ath11k_wmi_vdev_install_key(arvif->ar, &arg);
 	if (ret)
 		return ret;
drivers/net/wireless/ath/ath11k/wmi.c +2 -1
index d983bbbdfef0..5ac178d4d9fd 100644
@@ -1732,7 +1732,8 @@ int ath11k_wmi_vdev_install_key(struct ath11k *ar,
 	tlv = (struct wmi_tlv *)(skb->data + sizeof(*cmd));
 	tlv->header = FIELD_PREP(WMI_TLV_TAG, WMI_TAG_ARRAY_BYTE) |
 		      FIELD_PREP(WMI_TLV_LEN, key_len_aligned);
-	memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned);
+	if (arg->key_data)
+		memcpy(tlv->value, (u8 *)arg->key_data, key_len_aligned);
 
 	ret = ath11k_wmi_cmd_send(wmi, skb, WMI_VDEV_INSTALL_KEY_CMDID);
 	if (ret) {
Signature · 12 lines
1.9.1


From d6c3f0f2caecc8eb1066cf4ee3bee7ff10645515 Mon Sep 17 00:00:00 2001
From: Rajkumar Manoharan <[email protected]>
Date: Thu, 28 Mar 2019 17:22:09 -0700
Subject: [PATCH 6/6] ath11k: do not set default keyidx by default

Signed-off-by: Rajkumar Manoharan <[email protected]>
---
 drivers/net/wireless/ath/ath11k/mac.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/net/wireless/ath/ath11k/mac.c +0 -5
index 1dfc10d954a9..65d147852636 100644
@@ -3611,11 +3611,6 @@ static int ath11k_add_interface(struct ieee80211_hw *hw,
 	spin_unlock_bh(&ar->data_lock);
 
 	arvif->def_wep_key_index = -1;
-	param_id = WMI_VDEV_PARAM_DEF_KEYID;
-	ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id,
-					    param_id, arvif->def_wep_key_index);
-	if (ret)
-		ath11k_warn(ar->ab, "Failed to set default keyid: %d\n", ret);
 
 	param_id = WMI_VDEV_PARAM_TX_ENCAP_TYPE;
 	param_value = ATH11K_HW_TXRX_NATIVE_WIFI;
Signature · 1 line
1.9.1

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

#2 lore raw

On Thursday, 4 April 2019 05:21:14 CEST Rajkumar Manoharan wrote:
[...]

Quoted 11 lines

Below issues were observed in bring up and fixed in WLAN.HK.2.1.0.1-00113-QCAHKSWPL_SILICONZ-1 firmware

1) Assert in mesh interface creation.
2) Group action were filtered
3) fix 4 addr in firmware for mesh peers

Moving forward please use 2.1.0-1 firmware release which is meant for ath11k.
We are still working on to enable secured mesh (SAE).

Thanks. So it looks like I was on the right track for the initial 11s support. We are using this firmware at the moment because I heard from John that the newest(?) firmware was not working with the public available ath11k sources. But since I have absolutely no idea about the current firmware situation of ath11k and can also not find anything which sounds like 2.1.0-1 in Kalle's repo [1] (and I most likely mixed something up), I would like John to add a comment about the current situation.

Kind regards,
Sven

[1] https://github.com/kvalo/ath11k-firmware

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

#3 lore raw
Quoted 21 lines · Sven Eckelmann

On Thursday, 4 April 2019 05:21:14 CEST Rajkumar Manoharan wrote:
[...]

Quoted 11 lines

Below issues were observed in bring up and fixed in WLAN.HK.2.1.0.1-00113-QCAHKSWPL_SILICONZ-1 firmware

1) Assert in mesh interface creation.
2) Group action were filtered
3) fix 4 addr in firmware for mesh peers

Moving forward please use 2.1.0-1 firmware release which is meant for ath11k.
We are still working on to enable secured mesh (SAE).

Thanks. So it looks like I was on the right track for the initial 11s support. We are using this firmware at the moment because I heard from John that the newest(?) firmware was not working with the public available ath11k sources. But since I have absolutely no idea about the current firmware situation of ath11k and can also not find anything which sounds like 2.1.0-1 in Kalle's repo [1] (and I most likely mixed something up), I would like John to add a comment about the current situation.

Quoted 4 lines

Kind regards,
Sven

[1] https://github.com/kvalo/ath11k-firmware

Hi All,

we imported the latest FW into our tree and were seeing that the driver did not come up successfully. I have not looked into the details yet as I am busy working on the V4 of the 802.3 encap mode patches and the matching ath11k support patch. I will give it another try int he coming days.

    John

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