linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/4] wifi: ath12k: Factory test mode support
@ 2024-06-24  9:53 Aaradhana Sahu
  2024-06-24  9:53 ` [PATCH v5 1/4] wifi: ath: create common testmode_i.h file for ath drivers Aaradhana Sahu
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Aaradhana Sahu @ 2024-06-24  9:53 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Aaradhana Sahu

Device is booted in factory test mode for calibration.
The commands are sent from userspace application, which
is sent to firmware using wmi commands. Firmware sends
the response to driver as wmi events and driver sends
these events to the application via netlink message.

Also added changes related to correct pdev id access for
fw test cmd.

Aaradhana Sahu (3):
  wifi: ath: create common testmode_i.h file for ath drivers
  wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
  wifi: ath12k: add factory test mode support

Rajat Soni (1):
  wifi: ath12k: Fill pdev id for fw test cmd

---
v5:
  -Updated copyright
  -Fixed line length within 90 char
v4:
  -Rebased on latest ToT
v3:
  -Rebased on latest ToT
  -Updated Tested-on Tag
  -Removed second parameter of ath12k_core_start()
  -Updated copyright
v2:
  -Rebased on latest ath ToT
---

 drivers/net/wireless/ath/ath11k/testmode.c    |  78 ++--
 drivers/net/wireless/ath/ath12k/Makefile      |   1 +
 drivers/net/wireless/ath/ath12k/core.c        |  22 +-
 drivers/net/wireless/ath/ath12k/core.h        |  13 +
 drivers/net/wireless/ath/ath12k/debug.h       |   1 +
 drivers/net/wireless/ath/ath12k/dp.c          |   3 +
 drivers/net/wireless/ath/ath12k/mac.c         |  15 +-
 drivers/net/wireless/ath/ath12k/pci.c         |   1 +
 drivers/net/wireless/ath/ath12k/testmode.c    | 423 ++++++++++++++++++
 drivers/net/wireless/ath/ath12k/testmode.h    |  40 ++
 drivers/net/wireless/ath/ath12k/wmi.c         |  39 +-
 drivers/net/wireless/ath/ath12k/wmi.h         |  21 +
 .../wireless/ath/{ath11k => }/testmode_i.h    |  54 +--
 13 files changed, 636 insertions(+), 75 deletions(-)
 create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
 create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h
 rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)


base-commit: cac9bfd02678adbcca9a7dce770609b9f7434d37
-- 
2.34.1


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

* [PATCH v5 1/4] wifi: ath: create common testmode_i.h file for ath drivers
  2024-06-24  9:53 [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
@ 2024-06-24  9:53 ` Aaradhana Sahu
  2024-06-25 18:43   ` Jeff Johnson
  2024-06-24  9:53 ` [PATCH v5 2/4] wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode Aaradhana Sahu
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Aaradhana Sahu @ 2024-06-24  9:53 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Aaradhana Sahu

User space application requires that the testmode interface
is exactly same between ath drivers. Move testmode_i.h file
in ath directory to ensure that all ath driver uses same testmode
interface instead of duplicating testmode_i.h for each ath drivers.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/testmode.c    | 78 +++++++++----------
 .../wireless/ath/{ath11k => }/testmode_i.h    | 54 ++++++-------
 2 files changed, 66 insertions(+), 66 deletions(-)
 rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)

diff --git a/drivers/net/wireless/ath/ath11k/testmode.c b/drivers/net/wireless/ath/ath11k/testmode.c
index 302d66092b97..5d0680d4053d 100644
--- a/drivers/net/wireless/ath/ath11k/testmode.c
+++ b/drivers/net/wireless/ath/ath11k/testmode.c
@@ -10,18 +10,18 @@
 #include "wmi.h"
 #include "hw.h"
 #include "core.h"
-#include "testmode_i.h"
+#include "../testmode_i.h"
 
 #define ATH11K_FTM_SEGHDR_CURRENT_SEQ		GENMASK(3, 0)
 #define ATH11K_FTM_SEGHDR_TOTAL_SEGMENTS	GENMASK(7, 4)
 
-static const struct nla_policy ath11k_tm_policy[ATH11K_TM_ATTR_MAX + 1] = {
-	[ATH11K_TM_ATTR_CMD]		= { .type = NLA_U32 },
-	[ATH11K_TM_ATTR_DATA]		= { .type = NLA_BINARY,
-					    .len = ATH11K_TM_DATA_MAX_LEN },
-	[ATH11K_TM_ATTR_WMI_CMDID]	= { .type = NLA_U32 },
-	[ATH11K_TM_ATTR_VERSION_MAJOR]	= { .type = NLA_U32 },
-	[ATH11K_TM_ATTR_VERSION_MINOR]	= { .type = NLA_U32 },
+static const struct nla_policy ath11k_tm_policy[ATH_TM_ATTR_MAX + 1] = {
+	[ATH_TM_ATTR_CMD]		= { .type = NLA_U32 },
+	[ATH_TM_ATTR_DATA]		= { .type = NLA_BINARY,
+					    .len = ATH_TM_DATA_MAX_LEN },
+	[ATH_TM_ATTR_WMI_CMDID]		= { .type = NLA_U32 },
+	[ATH_TM_ATTR_VERSION_MAJOR]	= { .type = NLA_U32 },
+	[ATH_TM_ATTR_VERSION_MINOR]	= { .type = NLA_U32 },
 };
 
 static struct ath11k *ath11k_tm_get_ar(struct ath11k_base *ab)
@@ -73,9 +73,9 @@ static void ath11k_tm_wmi_event_unsegmented(struct ath11k_base *ab, u32 cmd_id,
 		goto out;
 	}
 
-	if (nla_put_u32(nl_skb, ATH11K_TM_ATTR_CMD, ATH11K_TM_CMD_WMI) ||
-	    nla_put_u32(nl_skb, ATH11K_TM_ATTR_WMI_CMDID, cmd_id) ||
-	    nla_put(nl_skb, ATH11K_TM_ATTR_DATA, skb->len, skb->data)) {
+	if (nla_put_u32(nl_skb, ATH_TM_ATTR_CMD, ATH_TM_CMD_WMI) ||
+	    nla_put_u32(nl_skb, ATH_TM_ATTR_WMI_CMDID, cmd_id) ||
+	    nla_put(nl_skb, ATH_TM_ATTR_DATA, skb->len, skb->data)) {
 		ath11k_warn(ab, "failed to populate testmode unsegmented event\n");
 		kfree_skb(nl_skb);
 		goto out;
@@ -140,7 +140,7 @@ static int ath11k_tm_process_event(struct ath11k_base *ab, u32 cmd_id,
 
 	data_pos = ab->testmode.data_pos;
 
-	if ((data_pos + datalen) > ATH11K_FTM_EVENT_MAX_BUF_LENGTH) {
+	if ((data_pos + datalen) > ATH_FTM_EVENT_MAX_BUF_LENGTH) {
 		ath11k_warn(ab, "Invalid ftm event length at %d: %d\n",
 			    data_pos, datalen);
 		ret = -EINVAL;
@@ -172,10 +172,10 @@ static int ath11k_tm_process_event(struct ath11k_base *ab, u32 cmd_id,
 		goto out;
 	}
 
-	if (nla_put_u32(nl_skb, ATH11K_TM_ATTR_CMD,
-			ATH11K_TM_CMD_WMI_FTM) ||
-	    nla_put_u32(nl_skb, ATH11K_TM_ATTR_WMI_CMDID, cmd_id) ||
-	    nla_put(nl_skb, ATH11K_TM_ATTR_DATA, data_pos,
+	if (nla_put_u32(nl_skb, ATH_TM_ATTR_CMD,
+			ATH_TM_CMD_WMI_FTM) ||
+	    nla_put_u32(nl_skb, ATH_TM_ATTR_WMI_CMDID, cmd_id) ||
+	    nla_put(nl_skb, ATH_TM_ATTR_DATA, data_pos,
 		    &ab->testmode.eventdata[0])) {
 		ath11k_warn(ab, "failed to populate segmented testmode event");
 		kfree_skb(nl_skb);
@@ -235,23 +235,23 @@ static int ath11k_tm_cmd_get_version(struct ath11k *ar, struct nlattr *tb[])
 
 	ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE,
 		   "cmd get version_major %d version_minor %d\n",
-		   ATH11K_TESTMODE_VERSION_MAJOR,
-		   ATH11K_TESTMODE_VERSION_MINOR);
+		   ATH_TESTMODE_VERSION_MAJOR,
+		   ATH_TESTMODE_VERSION_MINOR);
 
 	skb = cfg80211_testmode_alloc_reply_skb(ar->hw->wiphy,
 						nla_total_size(sizeof(u32)));
 	if (!skb)
 		return -ENOMEM;
 
-	ret = nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MAJOR,
-			  ATH11K_TESTMODE_VERSION_MAJOR);
+	ret = nla_put_u32(skb, ATH_TM_ATTR_VERSION_MAJOR,
+			  ATH_TESTMODE_VERSION_MAJOR);
 	if (ret) {
 		kfree_skb(skb);
 		return ret;
 	}
 
-	ret = nla_put_u32(skb, ATH11K_TM_ATTR_VERSION_MINOR,
-			  ATH11K_TESTMODE_VERSION_MINOR);
+	ret = nla_put_u32(skb, ATH_TM_ATTR_VERSION_MINOR,
+			  ATH_TESTMODE_VERSION_MINOR);
 	if (ret) {
 		kfree_skb(skb);
 		return ret;
@@ -277,7 +277,7 @@ static int ath11k_tm_cmd_testmode_start(struct ath11k *ar, struct nlattr *tb[])
 		goto err;
 	}
 
-	ar->ab->testmode.eventdata = kzalloc(ATH11K_FTM_EVENT_MAX_BUF_LENGTH,
+	ar->ab->testmode.eventdata = kzalloc(ATH_FTM_EVENT_MAX_BUF_LENGTH,
 					     GFP_KERNEL);
 	if (!ar->ab->testmode.eventdata) {
 		ret = -ENOMEM;
@@ -310,25 +310,25 @@ static int ath11k_tm_cmd_wmi(struct ath11k *ar, struct nlattr *tb[],
 
 	mutex_lock(&ar->conf_mutex);
 
-	if (!tb[ATH11K_TM_ATTR_DATA]) {
+	if (!tb[ATH_TM_ATTR_DATA]) {
 		ret = -EINVAL;
 		goto out;
 	}
 
-	if (!tb[ATH11K_TM_ATTR_WMI_CMDID]) {
+	if (!tb[ATH_TM_ATTR_WMI_CMDID]) {
 		ret = -EINVAL;
 		goto out;
 	}
 
-	buf = nla_data(tb[ATH11K_TM_ATTR_DATA]);
-	buf_len = nla_len(tb[ATH11K_TM_ATTR_DATA]);
+	buf = nla_data(tb[ATH_TM_ATTR_DATA]);
+	buf_len = nla_len(tb[ATH_TM_ATTR_DATA]);
 	if (!buf_len) {
 		ath11k_warn(ar->ab, "No data present in testmode wmi command\n");
 		ret = -EINVAL;
 		goto out;
 	}
 
-	cmd_id = nla_get_u32(tb[ATH11K_TM_ATTR_WMI_CMDID]);
+	cmd_id = nla_get_u32(tb[ATH_TM_ATTR_WMI_CMDID]);
 
 	/* Make sure that the buffer length is long enough to
 	 * hold TLV and pdev/vdev id.
@@ -409,13 +409,13 @@ static int ath11k_tm_cmd_wmi_ftm(struct ath11k *ar, struct nlattr *tb[])
 		goto out;
 	}
 
-	if (!tb[ATH11K_TM_ATTR_DATA]) {
+	if (!tb[ATH_TM_ATTR_DATA]) {
 		ret = -EINVAL;
 		goto out;
 	}
 
-	buf = nla_data(tb[ATH11K_TM_ATTR_DATA]);
-	buf_len = nla_len(tb[ATH11K_TM_ATTR_DATA]);
+	buf = nla_data(tb[ATH_TM_ATTR_DATA]);
+	buf_len = nla_len(tb[ATH_TM_ATTR_DATA]);
 	cmd_id = WMI_PDEV_UTF_CMDID;
 
 	ath11k_dbg(ar->ab, ATH11K_DBG_TESTMODE,
@@ -476,25 +476,25 @@ int ath11k_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		  void *data, int len)
 {
 	struct ath11k *ar = hw->priv;
-	struct nlattr *tb[ATH11K_TM_ATTR_MAX + 1];
+	struct nlattr *tb[ATH_TM_ATTR_MAX + 1];
 	int ret;
 
-	ret = nla_parse(tb, ATH11K_TM_ATTR_MAX, data, len, ath11k_tm_policy,
+	ret = nla_parse(tb, ATH_TM_ATTR_MAX, data, len, ath11k_tm_policy,
 			NULL);
 	if (ret)
 		return ret;
 
-	if (!tb[ATH11K_TM_ATTR_CMD])
+	if (!tb[ATH_TM_ATTR_CMD])
 		return -EINVAL;
 
-	switch (nla_get_u32(tb[ATH11K_TM_ATTR_CMD])) {
-	case ATH11K_TM_CMD_GET_VERSION:
+	switch (nla_get_u32(tb[ATH_TM_ATTR_CMD])) {
+	case ATH_TM_CMD_GET_VERSION:
 		return ath11k_tm_cmd_get_version(ar, tb);
-	case ATH11K_TM_CMD_WMI:
+	case ATH_TM_CMD_WMI:
 		return ath11k_tm_cmd_wmi(ar, tb, vif);
-	case ATH11K_TM_CMD_TESTMODE_START:
+	case ATH_TM_CMD_TESTMODE_START:
 		return ath11k_tm_cmd_testmode_start(ar, tb);
-	case ATH11K_TM_CMD_WMI_FTM:
+	case ATH_TM_CMD_WMI_FTM:
 		return ath11k_tm_cmd_wmi_ftm(ar, tb);
 	default:
 		return -EOPNOTSUPP;
diff --git a/drivers/net/wireless/ath/ath11k/testmode_i.h b/drivers/net/wireless/ath/testmode_i.h
similarity index 50%
rename from drivers/net/wireless/ath/ath11k/testmode_i.h
rename to drivers/net/wireless/ath/testmode_i.h
index 91b83873d660..b8fa5092e6ca 100644
--- a/drivers/net/wireless/ath/ath11k/testmode_i.h
+++ b/drivers/net/wireless/ath/testmode_i.h
@@ -1,59 +1,59 @@
 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
 /*
  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
- * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
  */
 
-/* "API" level of the ath11k testmode interface. Bump it after every
+/* "API" level of the ath testmode interface. Bump it after every
  * incompatible interface change.
  */
-#define ATH11K_TESTMODE_VERSION_MAJOR 1
+#define ATH_TESTMODE_VERSION_MAJOR 1
 
 /* Bump this after every _compatible_ interface change, for example
  * addition of a new command or an attribute.
  */
-#define ATH11K_TESTMODE_VERSION_MINOR 1
+#define ATH_TESTMODE_VERSION_MINOR 1
 
-#define ATH11K_TM_DATA_MAX_LEN		5000
-#define ATH11K_FTM_EVENT_MAX_BUF_LENGTH 2048
+#define ATH_TM_DATA_MAX_LEN		5000
+#define ATH_FTM_EVENT_MAX_BUF_LENGTH	2048
 
-enum ath11k_tm_attr {
-	__ATH11K_TM_ATTR_INVALID		= 0,
-	ATH11K_TM_ATTR_CMD			= 1,
-	ATH11K_TM_ATTR_DATA			= 2,
-	ATH11K_TM_ATTR_WMI_CMDID		= 3,
-	ATH11K_TM_ATTR_VERSION_MAJOR		= 4,
-	ATH11K_TM_ATTR_VERSION_MINOR		= 5,
-	ATH11K_TM_ATTR_WMI_OP_VERSION		= 6,
+enum ath_tm_attr {
+	__ATH_TM_ATTR_INVALID		= 0,
+	ATH_TM_ATTR_CMD			= 1,
+	ATH_TM_ATTR_DATA		= 2,
+	ATH_TM_ATTR_WMI_CMDID		= 3,
+	ATH_TM_ATTR_VERSION_MAJOR	= 4,
+	ATH_TM_ATTR_VERSION_MINOR	= 5,
+	ATH_TM_ATTR_WMI_OP_VERSION	= 6,
 
 	/* keep last */
-	__ATH11K_TM_ATTR_AFTER_LAST,
-	ATH11K_TM_ATTR_MAX		= __ATH11K_TM_ATTR_AFTER_LAST - 1,
+	__ATH_TM_ATTR_AFTER_LAST,
+	ATH_TM_ATTR_MAX			= __ATH_TM_ATTR_AFTER_LAST - 1,
 };
 
-/* All ath11k testmode interface commands specified in
- * ATH11K_TM_ATTR_CMD
+/* All ath testmode interface commands specified in
+ * ATH_TM_ATTR_CMD
  */
-enum ath11k_tm_cmd {
-	/* Returns the supported ath11k testmode interface version in
-	 * ATH11K_TM_ATTR_VERSION. Always guaranteed to work. User space
+enum ath_tm_cmd {
+	/* Returns the supported ath testmode interface version in
+	 * ATH_TM_ATTR_VERSION. Always guaranteed to work. User space
 	 * uses this to verify it's using the correct version of the
 	 * testmode interface
 	 */
-	ATH11K_TM_CMD_GET_VERSION = 0,
+	ATH_TM_CMD_GET_VERSION = 0,
 
 	/* The command used to transmit a WMI command to the firmware and
 	 * the event to receive WMI events from the firmware. Without
 	 * struct wmi_cmd_hdr header, only the WMI payload. Command id is
-	 * provided with ATH11K_TM_ATTR_WMI_CMDID and payload in
-	 * ATH11K_TM_ATTR_DATA.
+	 * provided with ATH_TM_ATTR_WMI_CMDID and payload in
+	 * ATH_TM_ATTR_DATA.
 	 */
-	ATH11K_TM_CMD_WMI = 1,
+	ATH_TM_CMD_WMI = 1,
 
 	/* Boots the UTF firmware, the netdev interface must be down at the
 	 * time.
 	 */
-	ATH11K_TM_CMD_TESTMODE_START = 2,
+	ATH_TM_CMD_TESTMODE_START = 2,
 
 	/* The command used to transmit a FTM WMI command to the firmware
 	 * and the event to receive WMI events from the firmware. The data
@@ -62,5 +62,5 @@ enum ath11k_tm_cmd {
 	 * The data payload size could be large and the driver needs to
 	 * send segmented data to firmware.
 	 */
-	ATH11K_TM_CMD_WMI_FTM = 3,
+	ATH_TM_CMD_WMI_FTM = 3,
 };
-- 
2.34.1


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

* [PATCH v5 2/4] wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
  2024-06-24  9:53 [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
  2024-06-24  9:53 ` [PATCH v5 1/4] wifi: ath: create common testmode_i.h file for ath drivers Aaradhana Sahu
@ 2024-06-24  9:53 ` Aaradhana Sahu
  2024-06-25 18:43   ` Jeff Johnson
  2024-06-24  9:53 ` [PATCH v5 3/4] wifi: ath12k: add factory test mode support Aaradhana Sahu
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Aaradhana Sahu @ 2024-06-24  9:53 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Aaradhana Sahu

Export ath12k_wmi_tlv_hdr() to further use in the testmode command
processing.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/wmi.c | 2 +-
 drivers/net/wireless/ath/ath12k/wmi.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index d6e1d1398cdb..7aaa534be32f 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -173,7 +173,7 @@ static const struct ath12k_wmi_tlv_policy ath12k_wmi_tlv_policies[] = {
 		.min_len = sizeof(struct wmi_p2p_noa_event) },
 };
 
-static __le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len)
+__le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len)
 {
 	return le32_encode_bits(cmd, WMI_TLV_TAG) |
 		le32_encode_bits(len, WMI_TLV_LEN);
diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
index c2b86e187a03..ffb9e3fce767 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -5027,6 +5027,7 @@ int ath12k_wmi_set_bios_cmd(struct ath12k_base *ab, u32 param_id,
 			    const u8 *buf, size_t buf_len);
 int ath12k_wmi_set_bios_sar_cmd(struct ath12k_base *ab, const u8 *psar_table);
 int ath12k_wmi_set_bios_geo_cmd(struct ath12k_base *ab, const u8 *pgeo_table);
+__le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len);
 
 static inline u32
 ath12k_wmi_caps_ext_get_pdev_id(const struct ath12k_wmi_caps_ext_params *param)
-- 
2.34.1


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

* [PATCH v5 3/4] wifi: ath12k: add factory test mode support
  2024-06-24  9:53 [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
  2024-06-24  9:53 ` [PATCH v5 1/4] wifi: ath: create common testmode_i.h file for ath drivers Aaradhana Sahu
  2024-06-24  9:53 ` [PATCH v5 2/4] wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode Aaradhana Sahu
@ 2024-06-24  9:53 ` Aaradhana Sahu
  2024-06-25 18:44   ` Jeff Johnson
                     ` (3 more replies)
  2024-06-24  9:53 ` [PATCH v5 4/4] wifi: ath12k: Fill pdev id for fw test cmd Aaradhana Sahu
  2025-01-09  4:43 ` [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
  4 siblings, 4 replies; 22+ messages in thread
From: Aaradhana Sahu @ 2024-06-24  9:53 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Aaradhana Sahu

Add support to process factory test mode commands(FTM) for calibration.
By default firmware start with MISSION mode and to process the FTM commands
firmware needs to be restarted in FTM mode using module parameter ftm_mode.
The pre-request is all the radios should be down before starting the test.

All ath12k test mode interface related commands specified in enum
ath_tm_cmd.

When start command ATH_TM_CMD_TESTMODE_START is received, ar state
is set to test Mode and FTM daemon sends test mode command to wifi
driver via cfg80211. Wifi driver sends these command to firmware as
wmi events. If it is segmented commands it will be broken down into
multiple segments and encoded with TLV header else it is sent to
firmware as it is.

Firmware response via UTF events, wifi driver creates skb and send
to cfg80211, cfg80211 sends firmware response to FTM daemon via
netlink message.

Command to boot in ftm mode
insmod ath12k ftm_mode=1

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/Makefile   |   1 +
 drivers/net/wireless/ath/ath12k/core.c     |  22 +-
 drivers/net/wireless/ath/ath12k/core.h     |  13 +
 drivers/net/wireless/ath/ath12k/debug.h    |   1 +
 drivers/net/wireless/ath/ath12k/dp.c       |   3 +
 drivers/net/wireless/ath/ath12k/mac.c      |  15 +-
 drivers/net/wireless/ath/ath12k/pci.c      |   1 +
 drivers/net/wireless/ath/ath12k/testmode.c | 416 +++++++++++++++++++++
 drivers/net/wireless/ath/ath12k/testmode.h |  40 ++
 drivers/net/wireless/ath/ath12k/wmi.c      |  37 +-
 drivers/net/wireless/ath/ath12k/wmi.h      |  20 +
 11 files changed, 561 insertions(+), 8 deletions(-)
 create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
 create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h

diff --git a/drivers/net/wireless/ath/ath12k/Makefile b/drivers/net/wireless/ath/ath12k/Makefile
index d42480db7463..3fe52ac707cc 100644
--- a/drivers/net/wireless/ath/ath12k/Makefile
+++ b/drivers/net/wireless/ath/ath12k/Makefile
@@ -26,6 +26,7 @@ ath12k-y += core.o \
 ath12k-$(CONFIG_ATH12K_DEBUGFS) += debugfs.o
 ath12k-$(CONFIG_ACPI) += acpi.o
 ath12k-$(CONFIG_ATH12K_TRACING) += trace.o
+ath12k-$(CONFIG_NL80211_TESTMODE) += testmode.o
 
 # for tracing framework to find trace.h
 CFLAGS_trace.o := -I$(src)
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 197099f15e3f..b07ffcee60ae 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -42,6 +42,10 @@ static int ath12k_core_rfkill_config(struct ath12k_base *ab)
 	return ret;
 }
 
+bool ath12k_ftm_mode;
+module_param_named(ftm_mode, ath12k_ftm_mode, bool, 0444);
+MODULE_PARM_DESC(ftm_mode, "Boots up in factory test mode");
+
 int ath12k_core_suspend(struct ath12k_base *ab)
 {
 	struct ath12k *ar;
@@ -647,6 +651,11 @@ static int ath12k_core_soc_create(struct ath12k_base *ab)
 {
 	int ret;
 
+	if (ath12k_ftm_mode) {
+		ab->fw_mode = ATH12K_FIRMWARE_MODE_FTM;
+		ath12k_info(ab, "Booting in ftm mode\n");
+	}
+
 	ret = ath12k_qmi_init_service(ab);
 	if (ret) {
 		ath12k_err(ab, "failed to initialize qmi :%d\n", ret);
@@ -708,8 +717,7 @@ static void ath12k_core_pdev_destroy(struct ath12k_base *ab)
 	ath12k_dp_pdev_free(ab);
 }
 
-static int ath12k_core_start(struct ath12k_base *ab,
-			     enum ath12k_firmware_mode mode)
+static int ath12k_core_start(struct ath12k_base *ab)
 {
 	int ret;
 
@@ -847,7 +855,7 @@ int ath12k_core_qmi_firmware_ready(struct ath12k_base *ab)
 {
 	int ret;
 
-	ret = ath12k_core_start_firmware(ab, ATH12K_FIRMWARE_MODE_NORMAL);
+	ret = ath12k_core_start_firmware(ab, ab->fw_mode);
 	if (ret) {
 		ath12k_err(ab, "failed to start firmware: %d\n", ret);
 		return ret;
@@ -866,7 +874,7 @@ int ath12k_core_qmi_firmware_ready(struct ath12k_base *ab)
 	}
 
 	mutex_lock(&ab->core_lock);
-	ret = ath12k_core_start(ab, ATH12K_FIRMWARE_MODE_NORMAL);
+	ret = ath12k_core_start(ab);
 	if (ret) {
 		ath12k_err(ab, "failed to start core: %d\n", ret);
 		goto err_dp_free;
@@ -1005,7 +1013,8 @@ static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
 
 	for (i = 0; i < ab->num_hw; i++) {
 		ah = ab->ah[i];
-		if (!ah || ah->state == ATH12K_HW_STATE_OFF)
+		if (!ah || ah->state == ATH12K_HW_STATE_OFF ||
+		    ah->state == ATH12K_HW_STATE_TM)
 			continue;
 
 		ieee80211_stop_queues(ah->hw);
@@ -1076,6 +1085,9 @@ static void ath12k_core_post_reconfigure_recovery(struct ath12k_base *ab)
 			ath12k_warn(ab,
 				    "device is wedged, will not restart hw %d\n", i);
 			break;
+		case ATH12K_HW_STATE_TM:
+			ath12k_warn(ab, "fw mode reset done radio %d\n", i);
+			break;
 		}
 
 		mutex_unlock(&ah->hw_mutex);
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index d7a3e8fddb20..b6ede8f21761 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -209,6 +209,7 @@ enum ath12k_dev_flags {
 	ATH12K_FLAG_HTC_SUSPEND_COMPLETE,
 	ATH12K_FLAG_CE_IRQ_ENABLED,
 	ATH12K_FLAG_EXT_IRQ_ENABLED,
+	ATH12K_FLAG_FTM_SEGMENTED
 };
 
 struct ath12k_tx_conf {
@@ -458,12 +459,19 @@ enum ath12k_hw_state {
 	ATH12K_HW_STATE_RESTARTING,
 	ATH12K_HW_STATE_RESTARTED,
 	ATH12K_HW_STATE_WEDGED,
+	ATH12K_HW_STATE_TM,
 	/* Add other states as required */
 };
 
 /* Antenna noise floor */
 #define ATH12K_DEFAULT_NOISE_FLOOR -95
 
+struct ath12k_ftm_event_obj {
+	u32 data_pos;
+	u32 expected_seq;
+	u8 *eventdata;
+};
+
 struct ath12k_fw_stats {
 	u32 pdev_id;
 	u32 stats_id;
@@ -626,6 +634,8 @@ struct ath12k {
 
 	u32 freq_low;
 	u32 freq_high;
+	struct completion fw_mode_reset;
+	u8 ftm_msgref;
 };
 
 struct ath12k_hw {
@@ -743,6 +753,7 @@ enum ath12k_link_capable_flags {
 /* Master structure to hold the hw data which may be used in core module */
 struct ath12k_base {
 	enum ath12k_hw_rev hw_rev;
+	enum ath12k_firmware_mode fw_mode;
 	struct platform_device *pdev;
 	struct device *dev;
 	struct ath12k_qmi qmi;
@@ -856,6 +867,8 @@ struct ath12k_base {
 		/* protected by data_lock */
 		u32 fw_crash_counter;
 	} stats;
+	bool ftm_segment_handler;
+	struct ath12k_ftm_event_obj ftm_event_obj;
 	u32 pktlog_defs_checksum;
 
 	struct ath12k_dbring_cap *db_caps;
diff --git a/drivers/net/wireless/ath/ath12k/debug.h b/drivers/net/wireless/ath/ath12k/debug.h
index aa685295f8a4..11139793547d 100644
--- a/drivers/net/wireless/ath/ath12k/debug.h
+++ b/drivers/net/wireless/ath/ath12k/debug.h
@@ -33,6 +33,7 @@ __printf(2, 3) void ath12k_err(struct ath12k_base *ab, const char *fmt, ...);
 __printf(2, 3) void ath12k_warn(struct ath12k_base *ab, const char *fmt, ...);
 
 extern unsigned int ath12k_debug_mask;
+extern bool ath12k_ftm_mode;
 
 #ifdef CONFIG_ATH12K_DEBUG
 __printf(3, 4) void __ath12k_dbg(struct ath12k_base *ab,
diff --git a/drivers/net/wireless/ath/ath12k/dp.c b/drivers/net/wireless/ath/ath12k/dp.c
index 61aa78d8bd8c..0b4463fc177c 100644
--- a/drivers/net/wireless/ath/ath12k/dp.c
+++ b/drivers/net/wireless/ath/ath12k/dp.c
@@ -1290,6 +1290,9 @@ void ath12k_dp_cc_config(struct ath12k_base *ab)
 	u32 wbm_base = HAL_SEQ_WCSS_UMAC_WBM_REG;
 	u32 val = 0;
 
+	if (ath12k_ftm_mode)
+		return;
+
 	ath12k_hif_write32(ab, reo_base + HAL_REO1_SW_COOKIE_CFG0(ab), cmem_base);
 
 	val |= u32_encode_bits(ATH12K_CMEM_ADDR_MSB,
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 17b7fab03d50..342b02bead7c 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -13,6 +13,7 @@
 #include "hw.h"
 #include "dp_tx.h"
 #include "dp_rx.h"
+#include "testmode.h"
 #include "peer.h"
 #include "debugfs.h"
 
@@ -614,7 +615,10 @@ struct ath12k *ath12k_mac_get_ar_by_pdev_id(struct ath12k_base *ab, u32 pdev_id)
 		return NULL;
 
 	for (i = 0; i < ab->num_radios; i++) {
-		pdev = rcu_dereference(ab->pdevs_active[i]);
+		if (ab->fw_mode == ATH12K_FIRMWARE_MODE_FTM)
+			pdev = &ab->pdevs[i];
+		else
+			pdev = rcu_dereference(ab->pdevs_active[i]);
 
 		if (pdev && pdev->pdev_id == pdev_id)
 			return (pdev->ar ? pdev->ar : NULL);
@@ -5962,9 +5966,14 @@ static void ath12k_drain_tx(struct ath12k_hw *ah)
 static int ath12k_mac_op_start(struct ieee80211_hw *hw)
 {
 	struct ath12k_hw *ah = ath12k_hw_to_ah(hw);
-	struct ath12k *ar;
+	struct ath12k *ar = ah->radio;
 	int ret, i;
 
+	if (ath12k_ftm_mode) {
+		ath12k_err(ar->ab, "fail to start mac operations in ftm mode\n");
+		return -EWOULDBLOCK;
+	}
+
 	ath12k_drain_tx(ah);
 
 	guard(mutex)(&ah->hw_mutex);
@@ -5979,6 +5988,7 @@ static int ath12k_mac_op_start(struct ieee80211_hw *hw)
 	case ATH12K_HW_STATE_RESTARTED:
 	case ATH12K_HW_STATE_WEDGED:
 	case ATH12K_HW_STATE_ON:
+	case ATH12K_HW_STATE_TM:
 		ah->state = ATH12K_HW_STATE_OFF;
 
 		WARN_ON(1);
@@ -8578,6 +8588,7 @@ static const struct ieee80211_ops ath12k_ops = {
 	.sta_statistics			= ath12k_mac_op_sta_statistics,
 	.remain_on_channel              = ath12k_mac_op_remain_on_channel,
 	.cancel_remain_on_channel       = ath12k_mac_op_cancel_remain_on_channel,
+	CFG80211_TESTMODE_CMD(ath12k_tm_cmd)
 };
 
 static void ath12k_mac_update_ch_list(struct ath12k *ar,
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index 876c029f58f6..f64f31088989 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -1366,6 +1366,7 @@ static int ath12k_pci_probe(struct pci_dev *pdev,
 	ab_pci->ab = ab;
 	ab_pci->pdev = pdev;
 	ab->hif.ops = &ath12k_pci_hif_ops;
+	ab->fw_mode = ATH12K_FIRMWARE_MODE_NORMAL;
 	pci_set_drvdata(pdev, ab);
 	spin_lock_init(&ab_pci->window_lock);
 
diff --git a/drivers/net/wireless/ath/ath12k/testmode.c b/drivers/net/wireless/ath/ath12k/testmode.c
new file mode 100644
index 000000000000..c334d64e839b
--- /dev/null
+++ b/drivers/net/wireless/ath/ath12k/testmode.c
@@ -0,0 +1,416 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+/*
+ * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#include "testmode.h"
+#include <net/netlink.h>
+#include "debug.h"
+#include "wmi.h"
+#include "hw.h"
+#include "core.h"
+#include "hif.h"
+#include "../testmode_i.h"
+
+#define ATH12K_FTM_SEGHDR_CURRENT_SEQ		GENMASK(3, 0)
+#define ATH12K_FTM_SEGHDR_TOTAL_SEGMENTS	GENMASK(7, 4)
+
+static const struct nla_policy ath12k_tm_policy[ATH_TM_ATTR_MAX + 1] = {
+	[ATH_TM_ATTR_CMD]		= { .type = NLA_U32 },
+	[ATH_TM_ATTR_DATA]		= { .type = NLA_BINARY,
+					    .len = ATH_TM_DATA_MAX_LEN },
+	[ATH_TM_ATTR_WMI_CMDID]		= { .type = NLA_U32 },
+	[ATH_TM_ATTR_VERSION_MAJOR]	= { .type = NLA_U32 },
+	[ATH_TM_ATTR_VERSION_MINOR]	= { .type = NLA_U32 },
+};
+
+static struct ath12k *ath12k_tm_get_ar(struct ath12k_base *ab)
+{
+	struct ath12k_pdev *pdev;
+	struct ath12k *ar;
+	int i;
+
+	for (i = 0; i < ab->num_radios; i++) {
+		pdev = &ab->pdevs[i];
+		ar = pdev->ar;
+
+		if (ar && ar->ah->state == ATH12K_HW_STATE_TM)
+			return ar;
+	}
+
+	return NULL;
+}
+
+void ath12k_tm_wmi_event_unsegmented(struct ath12k_base *ab, u32 cmd_id,
+				     struct sk_buff *skb)
+{
+	struct sk_buff *nl_skb;
+	struct ath12k *ar;
+
+	ath12k_dbg(ab, ATH12K_DBG_TESTMODE,
+		   "testmode event wmi cmd_id %d skb length %d\n",
+		   cmd_id, skb->len);
+
+	ath12k_dbg_dump(ab, ATH12K_DBG_TESTMODE, NULL, "", skb->data, skb->len);
+
+	ar = ath12k_tm_get_ar(ab);
+	if (!ar) {
+		ath12k_warn(ab, "testmode event not handled due to invalid pdev\n");
+		return;
+	}
+
+	spin_lock_bh(&ar->data_lock);
+
+	nl_skb = cfg80211_testmode_alloc_event_skb(ar->ah->hw->wiphy,
+						   2 * nla_total_size(sizeof(u32)) +
+						   nla_total_size(skb->len),
+						   GFP_ATOMIC);
+	spin_unlock_bh(&ar->data_lock);
+
+	if (!nl_skb) {
+		ath12k_warn(ab,
+			    "failed to allocate skb for unsegmented testmode wmi event\n");
+		return;
+	}
+
+	if (nla_put_u32(nl_skb, ATH_TM_ATTR_CMD, ATH_TM_CMD_WMI) ||
+	    nla_put_u32(nl_skb, ATH_TM_ATTR_WMI_CMDID, cmd_id) ||
+	    nla_put(nl_skb, ATH_TM_ATTR_DATA, skb->len, skb->data)) {
+		ath12k_warn(ab, "failed to populate testmode unsegmented event\n");
+		kfree_skb(nl_skb);
+		return;
+	}
+
+	cfg80211_testmode_event(nl_skb, GFP_ATOMIC);
+}
+
+void ath12k_tm_process_event(struct ath12k_base *ab, u32 cmd_id,
+			     const struct ath12k_wmi_ftm_event *ftm_msg,
+			     u16 length)
+{
+	struct sk_buff *nl_skb;
+	struct ath12k *ar;
+	u32 data_pos, pdev_id;
+	u16 datalen;
+	u8 total_segments, current_seq;
+	u8 const *buf_pos;
+
+	ath12k_dbg(ab, ATH12K_DBG_TESTMODE,
+		   "testmode event wmi cmd_id %d ftm event msg %pK datalen %d\n",
+		   cmd_id, ftm_msg, length);
+	ath12k_dbg_dump(ab, ATH12K_DBG_TESTMODE, NULL, "", ftm_msg, length);
+	pdev_id = DP_HW2SW_MACID(le32_to_cpu(ftm_msg->seg_hdr.pdev_id));
+
+	if (pdev_id >= ab->num_radios) {
+		ath12k_warn(ab, "testmode event not handled due to invalid pdev id\n");
+		return;
+	}
+
+	ar = ab->pdevs[pdev_id].ar;
+
+	if (!ar) {
+		ath12k_warn(ab, "testmode event not handled due to absence of pdev\n");
+		return;
+	}
+
+	current_seq = le32_get_bits(ftm_msg->seg_hdr.segmentinfo,
+				    ATH12K_FTM_SEGHDR_CURRENT_SEQ);
+	total_segments = le32_get_bits(ftm_msg->seg_hdr.segmentinfo,
+				       ATH12K_FTM_SEGHDR_TOTAL_SEGMENTS);
+	datalen = length - (sizeof(struct ath12k_wmi_ftm_seg_hdr_params));
+	buf_pos = ftm_msg->data;
+
+	if (current_seq == 0) {
+		ab->ftm_event_obj.expected_seq = 0;
+		ab->ftm_event_obj.data_pos = 0;
+	}
+
+	data_pos = ab->ftm_event_obj.data_pos;
+
+	if ((data_pos + datalen) > ATH_FTM_EVENT_MAX_BUF_LENGTH) {
+		ath12k_warn(ab,
+			    "Invalid event length date_pos[%d] datalen[%d]\n",
+			    data_pos, datalen);
+		return;
+	}
+
+	memcpy(&ab->ftm_event_obj.eventdata[data_pos], buf_pos, datalen);
+	data_pos += datalen;
+
+	if (++ab->ftm_event_obj.expected_seq != total_segments) {
+		ab->ftm_event_obj.data_pos = data_pos;
+		ath12k_dbg(ab, ATH12K_DBG_TESTMODE,
+			   "partial data received current_seq[%d], total_seg[%d]\n",
+			    current_seq, total_segments);
+		return;
+	}
+
+	ath12k_dbg(ab, ATH12K_DBG_TESTMODE,
+		   "total data length[%d] = [%d]\n",
+		   data_pos, ftm_msg->seg_hdr.len);
+
+	spin_lock_bh(&ar->data_lock);
+	nl_skb = cfg80211_testmode_alloc_event_skb(ar->ah->hw->wiphy,
+						   2 * nla_total_size(sizeof(u32)) +
+						   nla_total_size(data_pos),
+						   GFP_ATOMIC);
+	spin_unlock_bh(&ar->data_lock);
+
+	if (!nl_skb) {
+		ath12k_warn(ab,
+			    "failed to allocate skb for testmode wmi event\n");
+		return;
+	}
+
+	if (nla_put_u32(nl_skb, ATH_TM_ATTR_CMD,
+			ATH_TM_CMD_WMI_FTM) ||
+	    nla_put_u32(nl_skb, ATH_TM_ATTR_WMI_CMDID, cmd_id) ||
+	    nla_put(nl_skb, ATH_TM_ATTR_DATA, data_pos,
+		    &ab->ftm_event_obj.eventdata[0])) {
+		ath12k_warn(ab, "failed to populate testmode event");
+		kfree_skb(nl_skb);
+		return;
+	}
+
+	cfg80211_testmode_event(nl_skb, GFP_ATOMIC);
+}
+
+static int ath12k_tm_cmd_get_version(struct ath12k *ar, struct nlattr *tb[])
+{
+	struct sk_buff *skb;
+
+	ath12k_dbg(ar->ab, ATH12K_DBG_TESTMODE,
+		   "testmode cmd get version_major %d version_minor %d\n",
+		   ATH_TESTMODE_VERSION_MAJOR,
+		   ATH_TESTMODE_VERSION_MINOR);
+
+	spin_lock_bh(&ar->data_lock);
+	skb = cfg80211_testmode_alloc_reply_skb(ar->ah->hw->wiphy,
+						2 * nla_total_size(sizeof(u32)));
+	spin_unlock_bh(&ar->data_lock);
+
+	if (!skb)
+		return -ENOMEM;
+
+	if (nla_put_u32(skb, ATH_TM_ATTR_VERSION_MAJOR,
+			ATH_TESTMODE_VERSION_MAJOR) ||
+	    nla_put_u32(skb, ATH_TM_ATTR_VERSION_MINOR,
+			ATH_TESTMODE_VERSION_MINOR)) {
+		kfree_skb(skb);
+		return -ENOBUFS;
+	}
+
+	return cfg80211_testmode_reply(skb);
+}
+
+static int ath12k_tm_cmd_process_ftm(struct ath12k *ar, struct nlattr *tb[])
+{
+	struct ath12k_wmi_pdev *wmi = ar->wmi;
+	struct sk_buff *skb;
+	struct ath12k_wmi_ftm_cmd *ftm_cmd;
+	int ret = 0;
+	void *buf;
+	size_t aligned_len;
+	u32 cmd_id, buf_len;
+	u16 chunk_len, total_bytes, num_segments;
+	u8 segnumber = 0, *bufpos;
+
+	mutex_lock(&ar->conf_mutex);
+	ath12k_dbg(ar->ab, ATH12K_DBG_TESTMODE, "ah->state  %d\n", ar->ah->state);
+	if (ar->ah->state != ATH12K_HW_STATE_TM) {
+		ret = -ENETDOWN;
+		goto out;
+	}
+
+	if (!tb[ATH_TM_ATTR_DATA]) {
+		ret = -EINVAL;
+		goto out;
+	}
+
+	buf = nla_data(tb[ATH_TM_ATTR_DATA]);
+	buf_len = nla_len(tb[ATH_TM_ATTR_DATA]);
+	cmd_id = WMI_PDEV_UTF_CMDID;
+	ath12k_dbg(ar->ab, ATH12K_DBG_TESTMODE,
+		   "testmode cmd wmi cmd_id %d buf %pK buf_len %d\n",
+		   cmd_id, buf, buf_len);
+	ath12k_dbg_dump(ar->ab, ATH12K_DBG_TESTMODE, NULL, "", buf, buf_len);
+	bufpos = buf;
+	total_bytes = buf_len;
+	num_segments = total_bytes / MAX_WMI_UTF_LEN;
+
+	if (buf_len - (num_segments * MAX_WMI_UTF_LEN))
+		num_segments++;
+
+	while (buf_len) {
+		if (buf_len > MAX_WMI_UTF_LEN)
+			chunk_len = MAX_WMI_UTF_LEN;    /* MAX message */
+		else
+			chunk_len = buf_len;
+
+		skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, (chunk_len +
+					sizeof(struct ath12k_wmi_ftm_cmd)));
+
+		if (!skb) {
+			ret = -ENOMEM;
+			goto out;
+		}
+
+		ftm_cmd = (struct ath12k_wmi_ftm_cmd *)skb->data;
+		aligned_len  = chunk_len + sizeof(struct ath12k_wmi_ftm_seg_hdr_params);
+		ftm_cmd->tlv_header = ath12k_wmi_tlv_hdr(WMI_TAG_ARRAY_BYTE, aligned_len);
+		ftm_cmd->seg_hdr.len = cpu_to_le32(total_bytes);
+		ftm_cmd->seg_hdr.msgref = cpu_to_le32(ar->ftm_msgref);
+		ftm_cmd->seg_hdr.segmentinfo =
+			le32_encode_bits(num_segments,
+					 ATH12K_FTM_SEGHDR_TOTAL_SEGMENTS) |
+			le32_encode_bits(segnumber,
+					 ATH12K_FTM_SEGHDR_CURRENT_SEQ);
+		segnumber++;
+		memcpy(&ftm_cmd->data, bufpos, chunk_len);
+		ret = ath12k_wmi_cmd_send(wmi, skb, cmd_id);
+
+		if (ret) {
+			ath12k_warn(ar->ab, "ftm wmi command fail: %d\n", ret);
+			kfree_skb(skb);
+			goto out;
+		}
+
+		buf_len -= chunk_len;
+		bufpos += chunk_len;
+	}
+
+	++ar->ftm_msgref;
+out:
+	mutex_unlock(&ar->conf_mutex);
+	return ret;
+}
+
+static int ath12k_tm_cmd_testmode_start(struct ath12k *ar, struct nlattr *tb[])
+{
+	int ret = 0;
+
+	mutex_lock(&ar->conf_mutex);
+
+	if (ar->ah->state == ATH12K_HW_STATE_TM) {
+		ret = -EALREADY;
+		goto out;
+	}
+
+	if (ar->ah->state != ATH12K_HW_STATE_OFF) {
+		ret = -EBUSY;
+		goto out;
+	}
+
+	ar->ab->ftm_event_obj.eventdata = kzalloc(ATH_FTM_EVENT_MAX_BUF_LENGTH,
+						  GFP_KERNEL);
+
+	if (!ar->ab->ftm_event_obj.eventdata) {
+		ret = -ENOMEM;
+		goto out;
+	}
+
+	ar->ah->state = ATH12K_HW_STATE_TM;
+	ar->ftm_msgref = 0;
+out:
+	mutex_unlock(&ar->conf_mutex);
+	return ret;
+}
+
+static int ath12k_tm_cmd_wmi(struct ath12k *ar, struct nlattr *tb[])
+{
+	struct ath12k_wmi_pdev *wmi = ar->wmi;
+	struct sk_buff *skb;
+	u32 cmd_id, buf_len;
+	int ret;
+	void *buf;
+
+	mutex_lock(&ar->conf_mutex);
+
+	if (!tb[ATH_TM_ATTR_DATA]) {
+		ret = -EINVAL;
+		goto out;
+	}
+
+	if (!tb[ATH_TM_ATTR_WMI_CMDID]) {
+		ret = -EINVAL;
+		goto out;
+	}
+
+	buf = nla_data(tb[ATH_TM_ATTR_DATA]);
+	buf_len = nla_len(tb[ATH_TM_ATTR_DATA]);
+
+	if (!buf_len) {
+		ath12k_warn(ar->ab, "No data present in testmode command\n");
+		ret = -EINVAL;
+		goto out;
+	}
+
+	cmd_id = nla_get_u32(tb[ATH_TM_ATTR_WMI_CMDID]);
+
+	ath12k_dbg(ar->ab, ATH12K_DBG_TESTMODE,
+		   "testmode cmd wmi cmd_id %d  buf length %d\n",
+		   cmd_id, buf_len);
+
+	ath12k_dbg_dump(ar->ab, ATH12K_DBG_TESTMODE, NULL, "", buf, buf_len);
+
+	skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, buf_len);
+
+	if (!skb) {
+		ret = -ENOMEM;
+		goto out;
+	}
+
+	memcpy(skb->data, buf, buf_len);
+
+	ret = ath12k_wmi_cmd_send(wmi, skb, cmd_id);
+	if (ret) {
+		dev_kfree_skb(skb);
+		ath12k_warn(ar->ab, "failed to transmit wmi command (testmode): %d\n",
+			    ret);
+		goto out;
+	}
+
+out:
+	mutex_unlock(&ar->conf_mutex);
+	return ret;
+}
+
+int ath12k_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+		  void *data, int len)
+{
+	struct ath12k_hw *ah = hw->priv;
+	struct ath12k *ar = NULL;
+	struct nlattr *tb[ATH_TM_ATTR_MAX + 1];
+	struct ath12k_base *ab;
+	int ret;
+
+	ret = nla_parse(tb, ATH_TM_ATTR_MAX, data, len, ath12k_tm_policy,
+			NULL);
+	if (ret)
+		return ret;
+
+	if (!tb[ATH_TM_ATTR_CMD])
+		return -EINVAL;
+
+	if (ah->num_radio)
+		ar = ah->radio;
+
+	if (!ar)
+		return -EINVAL;
+
+	ab = ar->ab;
+	switch (nla_get_u32(tb[ATH_TM_ATTR_CMD])) {
+	case ATH_TM_CMD_WMI:
+		return ath12k_tm_cmd_wmi(ar, tb);
+	case ATH_TM_CMD_TESTMODE_START:
+		return ath12k_tm_cmd_testmode_start(ar, tb);
+	case ATH_TM_CMD_GET_VERSION:
+		return ath12k_tm_cmd_get_version(ar, tb);
+	case ATH_TM_CMD_WMI_FTM:
+		set_bit(ATH12K_FLAG_FTM_SEGMENTED, &ab->dev_flags);
+		return ath12k_tm_cmd_process_ftm(ar, tb);
+	default:
+		return -EOPNOTSUPP;
+	}
+}
diff --git a/drivers/net/wireless/ath/ath12k/testmode.h b/drivers/net/wireless/ath/ath12k/testmode.h
new file mode 100644
index 000000000000..91d67f68c09e
--- /dev/null
+++ b/drivers/net/wireless/ath/ath12k/testmode.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: BSD-3-Clause-Clear */
+/*
+ * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+#include "core.h"
+#include "hif.h"
+
+#ifdef CONFIG_NL80211_TESTMODE
+
+void ath12k_tm_wmi_event_unsegmented(struct ath12k_base *ab, u32 cmd_id,
+				     struct sk_buff *skb);
+void ath12k_tm_process_event(struct ath12k_base *ab, u32 cmd_id,
+			     const struct ath12k_wmi_ftm_event *ftm_msg,
+			     u16 length);
+int ath12k_tm_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+		  void *data, int len);
+
+#else
+
+static inline void ath12k_tm_wmi_event_unsegmented(struct ath12k_base *ab, u32 cmd_id,
+						   struct sk_buff *skb)
+{
+}
+
+static inline void ath12k_tm_process_event(struct ath12k_base *ab, u32 cmd_id,
+					   const struct ath12k_wmi_ftm_event *msg,
+					   u16 length)
+{
+}
+
+static inline int ath12k_tm_cmd(struct ieee80211_hw *hw,
+				struct ieee80211_vif *vif,
+				void *data, int len)
+{
+	return 0;
+}
+
+#endif
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 7aaa534be32f..cc7643370093 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -20,6 +20,7 @@
 #include "hw.h"
 #include "peer.h"
 #include "p2p.h"
+#include "testmode.h"
 
 struct ath12k_wmi_svc_ready_parse {
 	bool wmi_svc_bitmap_done;
@@ -6793,6 +6794,35 @@ ath12k_wmi_pdev_dfs_radar_detected_event(struct ath12k_base *ab, struct sk_buff
 	kfree(tb);
 }
 
+static void ath12k_tm_wmi_event_segmented(struct ath12k_base *ab, u32 cmd_id,
+					  struct sk_buff *skb)
+{
+	const struct ath12k_wmi_ftm_event *ev;
+	const void **tb;
+	int ret;
+	u16 length;
+
+	tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
+
+	if (IS_ERR(tb)) {
+		ret = PTR_ERR(tb);
+		ath12k_warn(ab, "failed to parse ftm event tlv: %d\n", ret);
+		return;
+	}
+
+	ev = tb[WMI_TAG_ARRAY_BYTE];
+	if (!ev) {
+		ath12k_warn(ab, "failed to fetch ftm msg\n");
+		kfree(tb);
+		return;
+	}
+
+	length = skb->len - TLV_HDR_SIZE;
+	ath12k_tm_process_event(ab, cmd_id, ev, length);
+	kfree(tb);
+	tb = NULL;
+}
+
 static void
 ath12k_wmi_pdev_temperature_event(struct ath12k_base *ab,
 				  struct sk_buff *skb)
@@ -7150,7 +7180,12 @@ static void ath12k_wmi_op_rx(struct ath12k_base *ab, struct sk_buff *skb)
 	case WMI_DIAG_EVENTID:
 		ath12k_wmi_diag_event(ab, skb);
 		break;
-	/* TODO: Add remaining events */
+	case WMI_PDEV_UTF_EVENTID:
+		if (test_bit(ATH12K_FLAG_FTM_SEGMENTED, &ab->dev_flags))
+			ath12k_tm_wmi_event_segmented(ab, id, skb);
+		else
+			ath12k_tm_wmi_event_unsegmented(ab, id, skb);
+		break;
 	default:
 		ath12k_dbg(ab, ATH12K_DBG_WMI, "Unknown eventid: 0x%x\n", id);
 		break;
diff --git a/drivers/net/wireless/ath/ath12k/wmi.h b/drivers/net/wireless/ath/ath12k/wmi.h
index ffb9e3fce767..4004f6aa6962 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.h
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
@@ -3531,6 +3531,26 @@ struct ath12k_wmi_p2p_noa_info {
 	struct ath12k_wmi_p2p_noa_descriptor descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
 } __packed;
 
+#define MAX_WMI_UTF_LEN 252
+
+struct ath12k_wmi_ftm_seg_hdr_params {
+	__le32 len;
+	__le32 msgref;
+	__le32 segmentinfo;
+	__le32 pdev_id;
+} __packed;
+
+struct ath12k_wmi_ftm_cmd {
+	__le32 tlv_header;
+	struct ath12k_wmi_ftm_seg_hdr_params seg_hdr;
+	u8 data[];
+} __packed;
+
+struct ath12k_wmi_ftm_event {
+	struct ath12k_wmi_ftm_seg_hdr_params seg_hdr;
+	u8 data[];
+} __packed;
+
 #define WMI_BEACON_TX_BUFFER_SIZE	512
 
 #define WMI_EMA_BEACON_CNT      GENMASK(7, 0)
-- 
2.34.1


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

* [PATCH v5 4/4] wifi: ath12k: Fill pdev id for fw test cmd
  2024-06-24  9:53 [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
                   ` (2 preceding siblings ...)
  2024-06-24  9:53 ` [PATCH v5 3/4] wifi: ath12k: add factory test mode support Aaradhana Sahu
@ 2024-06-24  9:53 ` Aaradhana Sahu
  2024-06-25 18:44   ` Jeff Johnson
  2025-01-09  4:43 ` [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
  4 siblings, 1 reply; 22+ messages in thread
From: Aaradhana Sahu @ 2024-06-24  9:53 UTC (permalink / raw)
  To: ath12k; +Cc: linux-wireless, Rajat Soni, Aaradhana Sahu

From: Rajat Soni <quic_rajson@quicinc.com>

Currently pdev id is not set properly. That can cause a crash
if pdev id is not equal to the pdev id when firmware test
command is run during AP bring up or ping.

Set pdev id in function ath12k_tm_cmd_wmi to resolve this
issue.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1

Signed-off-by: Rajat Soni <quic_rajson@quicinc.com>
Co-developed-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/testmode.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/testmode.c b/drivers/net/wireless/ath/ath12k/testmode.c
index c334d64e839b..4d81ff2a174c 100644
--- a/drivers/net/wireless/ath/ath12k/testmode.c
+++ b/drivers/net/wireless/ath/ath12k/testmode.c
@@ -321,9 +321,10 @@ static int ath12k_tm_cmd_wmi(struct ath12k *ar, struct nlattr *tb[])
 {
 	struct ath12k_wmi_pdev *wmi = ar->wmi;
 	struct sk_buff *skb;
-	u32 cmd_id, buf_len;
-	int ret;
+	struct wmi_pdev_set_param_cmd *cmd;
+	int ret, tag;
 	void *buf;
+	u32 cmd_id, buf_len;
 
 	mutex_lock(&ar->conf_mutex);
 
@@ -348,6 +349,12 @@ static int ath12k_tm_cmd_wmi(struct ath12k *ar, struct nlattr *tb[])
 
 	cmd_id = nla_get_u32(tb[ATH_TM_ATTR_WMI_CMDID]);
 
+	cmd = buf;
+	tag = le32_get_bits(cmd->tlv_header, WMI_TLV_TAG);
+
+	if (tag == WMI_TAG_PDEV_SET_PARAM_CMD)
+		cmd->pdev_id = cpu_to_le32(ar->pdev->pdev_id);
+
 	ath12k_dbg(ar->ab, ATH12K_DBG_TESTMODE,
 		   "testmode cmd wmi cmd_id %d  buf length %d\n",
 		   cmd_id, buf_len);
-- 
2.34.1


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

* Re: [PATCH v5 1/4] wifi: ath: create common testmode_i.h file for ath drivers
  2024-06-24  9:53 ` [PATCH v5 1/4] wifi: ath: create common testmode_i.h file for ath drivers Aaradhana Sahu
@ 2024-06-25 18:43   ` Jeff Johnson
  0 siblings, 0 replies; 22+ messages in thread
From: Jeff Johnson @ 2024-06-25 18:43 UTC (permalink / raw)
  To: Aaradhana Sahu, ath12k; +Cc: linux-wireless

On 6/24/2024 2:53 AM, Aaradhana Sahu wrote:
> User space application requires that the testmode interface
> is exactly same between ath drivers. Move testmode_i.h file
> in ath directory to ensure that all ath driver uses same testmode
> interface instead of duplicating testmode_i.h for each ath drivers.
> 
> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>


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

* Re: [PATCH v5 2/4] wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
  2024-06-24  9:53 ` [PATCH v5 2/4] wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode Aaradhana Sahu
@ 2024-06-25 18:43   ` Jeff Johnson
  0 siblings, 0 replies; 22+ messages in thread
From: Jeff Johnson @ 2024-06-25 18:43 UTC (permalink / raw)
  To: Aaradhana Sahu, ath12k; +Cc: linux-wireless

On 6/24/2024 2:53 AM, Aaradhana Sahu wrote:
> Export ath12k_wmi_tlv_hdr() to further use in the testmode command
> processing.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>


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

* Re: [PATCH v5 3/4] wifi: ath12k: add factory test mode support
  2024-06-24  9:53 ` [PATCH v5 3/4] wifi: ath12k: add factory test mode support Aaradhana Sahu
@ 2024-06-25 18:44   ` Jeff Johnson
  2024-06-27 17:43   ` Kalle Valo
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 22+ messages in thread
From: Jeff Johnson @ 2024-06-25 18:44 UTC (permalink / raw)
  To: Aaradhana Sahu, ath12k; +Cc: linux-wireless

On 6/24/2024 2:53 AM, Aaradhana Sahu wrote:
> Add support to process factory test mode commands(FTM) for calibration.
> By default firmware start with MISSION mode and to process the FTM commands
> firmware needs to be restarted in FTM mode using module parameter ftm_mode.
> The pre-request is all the radios should be down before starting the test.
> 
> All ath12k test mode interface related commands specified in enum
> ath_tm_cmd.
> 
> When start command ATH_TM_CMD_TESTMODE_START is received, ar state
> is set to test Mode and FTM daemon sends test mode command to wifi
> driver via cfg80211. Wifi driver sends these command to firmware as
> wmi events. If it is segmented commands it will be broken down into
> multiple segments and encoded with TLV header else it is sent to
> firmware as it is.
> 
> Firmware response via UTF events, wifi driver creates skb and send
> to cfg80211, cfg80211 sends firmware response to FTM daemon via
> netlink message.
> 
> Command to boot in ftm mode
> insmod ath12k ftm_mode=1
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>


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

* Re: [PATCH v5 4/4] wifi: ath12k: Fill pdev id for fw test cmd
  2024-06-24  9:53 ` [PATCH v5 4/4] wifi: ath12k: Fill pdev id for fw test cmd Aaradhana Sahu
@ 2024-06-25 18:44   ` Jeff Johnson
  0 siblings, 0 replies; 22+ messages in thread
From: Jeff Johnson @ 2024-06-25 18:44 UTC (permalink / raw)
  To: Aaradhana Sahu, ath12k; +Cc: linux-wireless, Rajat Soni

On 6/24/2024 2:53 AM, Aaradhana Sahu wrote:
> From: Rajat Soni <quic_rajson@quicinc.com>
> 
> Currently pdev id is not set properly. That can cause a crash
> if pdev id is not equal to the pdev id when firmware test
> command is run during AP bring up or ping.
> 
> Set pdev id in function ath12k_tm_cmd_wmi to resolve this
> issue.
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Rajat Soni <quic_rajson@quicinc.com>
> Co-developed-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>


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

* Re: [PATCH v5 3/4] wifi: ath12k: add factory test mode support
  2024-06-24  9:53 ` [PATCH v5 3/4] wifi: ath12k: add factory test mode support Aaradhana Sahu
  2024-06-25 18:44   ` Jeff Johnson
@ 2024-06-27 17:43   ` Kalle Valo
  2024-06-27 18:29     ` Jeff Johnson
  2024-06-28  3:19     ` Aaradhana Sahu
  2024-07-02 10:18   ` Kalle Valo
  2024-07-02 13:49   ` Kalle Valo
  3 siblings, 2 replies; 22+ messages in thread
From: Kalle Valo @ 2024-06-27 17:43 UTC (permalink / raw)
  To: Aaradhana Sahu; +Cc: ath12k, linux-wireless, Aaradhana Sahu

Aaradhana Sahu <quic_aarasahu@quicinc.com> wrote:

> Add support to process factory test mode commands(FTM) for calibration.
> By default firmware start with MISSION mode and to process the FTM commands
> firmware needs to be restarted in FTM mode using module parameter ftm_mode.
> The pre-request is all the radios should be down before starting the test.
> 
> All ath12k test mode interface related commands specified in enum
> ath_tm_cmd.
> 
> When start command ATH_TM_CMD_TESTMODE_START is received, ar state
> is set to test Mode and FTM daemon sends test mode command to wifi
> driver via cfg80211. Wifi driver sends these command to firmware as
> wmi events. If it is segmented commands it will be broken down into
> multiple segments and encoded with TLV header else it is sent to
> firmware as it is.
> 
> Firmware response via UTF events, wifi driver creates skb and send
> to cfg80211, cfg80211 sends firmware response to FTM daemon via
> netlink message.
> 
> Command to boot in ftm mode
> insmod ath12k ftm_mode=1
> 
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
> 
> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Now that the wow patchset was applied I saw a new warning:

drivers/net/wireless/ath/ath12k/wow.c: In function 'ath12k_wow_op_resume':
drivers/net/wireless/ath/ath12k/wow.c:982:17: warning: enumeration value 'ATH12K_HW_STATE_TM' not handled in switch [-Wswitch]

I fixed it adding the new state to ath12k_wow_op_resume(), please check:

https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=pending&id=882f310572b27564412e1d6158d1e9709861b7a7

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240624095305.37189-4-quic_aarasahu@quicinc.com/

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


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

* Re: [PATCH v5 3/4] wifi: ath12k: add factory test mode support
  2024-06-27 17:43   ` Kalle Valo
@ 2024-06-27 18:29     ` Jeff Johnson
  2024-06-28  3:19     ` Aaradhana Sahu
  1 sibling, 0 replies; 22+ messages in thread
From: Jeff Johnson @ 2024-06-27 18:29 UTC (permalink / raw)
  To: Kalle Valo, Aaradhana Sahu; +Cc: ath12k, linux-wireless

On 6/27/2024 10:43 AM, Kalle Valo wrote:
> Aaradhana Sahu <quic_aarasahu@quicinc.com> wrote:
> 
>> Add support to process factory test mode commands(FTM) for calibration.
>> By default firmware start with MISSION mode and to process the FTM commands
>> firmware needs to be restarted in FTM mode using module parameter ftm_mode.
>> The pre-request is all the radios should be down before starting the test.
>>
>> All ath12k test mode interface related commands specified in enum
>> ath_tm_cmd.
>>
>> When start command ATH_TM_CMD_TESTMODE_START is received, ar state
>> is set to test Mode and FTM daemon sends test mode command to wifi
>> driver via cfg80211. Wifi driver sends these command to firmware as
>> wmi events. If it is segmented commands it will be broken down into
>> multiple segments and encoded with TLV header else it is sent to
>> firmware as it is.
>>
>> Firmware response via UTF events, wifi driver creates skb and send
>> to cfg80211, cfg80211 sends firmware response to FTM daemon via
>> netlink message.
>>
>> Command to boot in ftm mode
>> insmod ath12k ftm_mode=1
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
>> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> 
> Now that the wow patchset was applied I saw a new warning:
> 
> drivers/net/wireless/ath/ath12k/wow.c: In function 'ath12k_wow_op_resume':
> drivers/net/wireless/ath/ath12k/wow.c:982:17: warning: enumeration value 'ATH12K_HW_STATE_TM' not handled in switch [-Wswitch]
> 
> I fixed it adding the new state to ath12k_wow_op_resume(), please check:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=pending&id=882f310572b27564412e1d6158d1e9709861b7a7
> 
LGTM, thanks!

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

* Re: [PATCH v5 3/4] wifi: ath12k: add factory test mode support
  2024-06-27 17:43   ` Kalle Valo
  2024-06-27 18:29     ` Jeff Johnson
@ 2024-06-28  3:19     ` Aaradhana Sahu
  1 sibling, 0 replies; 22+ messages in thread
From: Aaradhana Sahu @ 2024-06-28  3:19 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath12k, linux-wireless



On 6/27/2024 11:13 PM, Kalle Valo wrote:
> Aaradhana Sahu <quic_aarasahu@quicinc.com> wrote:
> 
>> Add support to process factory test mode commands(FTM) for calibration.
>> By default firmware start with MISSION mode and to process the FTM commands
>> firmware needs to be restarted in FTM mode using module parameter ftm_mode.
>> The pre-request is all the radios should be down before starting the test.
>>
>> All ath12k test mode interface related commands specified in enum
>> ath_tm_cmd.
>>
>> When start command ATH_TM_CMD_TESTMODE_START is received, ar state
>> is set to test Mode and FTM daemon sends test mode command to wifi
>> driver via cfg80211. Wifi driver sends these command to firmware as
>> wmi events. If it is segmented commands it will be broken down into
>> multiple segments and encoded with TLV header else it is sent to
>> firmware as it is.
>>
>> Firmware response via UTF events, wifi driver creates skb and send
>> to cfg80211, cfg80211 sends firmware response to FTM daemon via
>> netlink message.
>>
>> Command to boot in ftm mode
>> insmod ath12k ftm_mode=1
>>
>> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
>>
>> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>
>> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
>> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> 
> Now that the wow patchset was applied I saw a new warning:
> 
> drivers/net/wireless/ath/ath12k/wow.c: In function 'ath12k_wow_op_resume':
> drivers/net/wireless/ath/ath12k/wow.c:982:17: warning: enumeration value 'ATH12K_HW_STATE_TM' not handled in switch [-Wswitch]
> 
> I fixed it adding the new state to ath12k_wow_op_resume(), please check:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=pending&id=882f310572b27564412e1d6158d1e9709861b7a7
> 

Looks fine for me, thanks!

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

* Re: [PATCH v5 3/4] wifi: ath12k: add factory test mode support
  2024-06-24  9:53 ` [PATCH v5 3/4] wifi: ath12k: add factory test mode support Aaradhana Sahu
  2024-06-25 18:44   ` Jeff Johnson
  2024-06-27 17:43   ` Kalle Valo
@ 2024-07-02 10:18   ` Kalle Valo
  2024-07-02 13:49   ` Kalle Valo
  3 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2024-07-02 10:18 UTC (permalink / raw)
  To: Aaradhana Sahu; +Cc: ath12k, linux-wireless

Aaradhana Sahu <quic_aarasahu@quicinc.com> writes:

> Add support to process factory test mode commands(FTM) for calibration.
> By default firmware start with MISSION mode and to process the FTM commands
> firmware needs to be restarted in FTM mode using module parameter ftm_mode.
> The pre-request is all the radios should be down before starting the test.
>
> All ath12k test mode interface related commands specified in enum
> ath_tm_cmd.
>
> When start command ATH_TM_CMD_TESTMODE_START is received, ar state
> is set to test Mode and FTM daemon sends test mode command to wifi
> driver via cfg80211. Wifi driver sends these command to firmware as
> wmi events. If it is segmented commands it will be broken down into
> multiple segments and encoded with TLV header else it is sent to
> firmware as it is.
>
> Firmware response via UTF events, wifi driver creates skb and send
> to cfg80211, cfg80211 sends firmware response to FTM daemon via
> netlink message.
>
> Command to boot in ftm mode
> insmod ath12k ftm_mode=1
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>

[...]

> --- a/drivers/net/wireless/ath/ath12k/core.c
> +++ b/drivers/net/wireless/ath/ath12k/core.c
> @@ -42,6 +42,10 @@ static int ath12k_core_rfkill_config(struct ath12k_base *ab)
>  	return ret;
>  }
>  
> +bool ath12k_ftm_mode;
> +module_param_named(ftm_mode, ath12k_ftm_mode, bool, 0444);
> +MODULE_PARM_DESC(ftm_mode, "Boots up in factory test mode");

In the pending branch I moved these to the beginning of the file,
otherwise they are quite hidden:

https://git.kernel.org/pub/scm/linux/kernel/git/ath/ath.git/commit/?h=pending&id=0006b23098b2cb0dded6c650ef9b5a590bfb5a3c

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

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

* Re: [PATCH v5 3/4] wifi: ath12k: add factory test mode support
  2024-06-24  9:53 ` [PATCH v5 3/4] wifi: ath12k: add factory test mode support Aaradhana Sahu
                     ` (2 preceding siblings ...)
  2024-07-02 10:18   ` Kalle Valo
@ 2024-07-02 13:49   ` Kalle Valo
  3 siblings, 0 replies; 22+ messages in thread
From: Kalle Valo @ 2024-07-02 13:49 UTC (permalink / raw)
  To: Aaradhana Sahu; +Cc: ath12k, linux-wireless

Aaradhana Sahu <quic_aarasahu@quicinc.com> writes:

> Add support to process factory test mode commands(FTM) for calibration.
> By default firmware start with MISSION mode and to process the FTM commands
> firmware needs to be restarted in FTM mode using module parameter ftm_mode.
> The pre-request is all the radios should be down before starting the test.
>
> All ath12k test mode interface related commands specified in enum
> ath_tm_cmd.
>
> When start command ATH_TM_CMD_TESTMODE_START is received, ar state
> is set to test Mode and FTM daemon sends test mode command to wifi
> driver via cfg80211. Wifi driver sends these command to firmware as
> wmi events. If it is segmented commands it will be broken down into
> multiple segments and encoded with TLV header else it is sent to
> firmware as it is.
>
> Firmware response via UTF events, wifi driver creates skb and send
> to cfg80211, cfg80211 sends firmware response to FTM daemon via
> netlink message.
>
> Command to boot in ftm mode
> insmod ath12k ftm_mode=1
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00210-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Aaradhana Sahu <quic_aarasahu@quicinc.com>

I have not reviewed this in detail yet but few first impressions:

> @@ -626,6 +634,8 @@ struct ath12k {
>  
>  	u32 freq_low;
>  	u32 freq_high;
> +	struct completion fw_mode_reset;
> +	u8 ftm_msgref;
>  };

fw_mode_reset is unused so I removed it in the pending branch.

> @@ -856,6 +867,8 @@ struct ath12k_base {
>  		/* protected by data_lock */
>  		u32 fw_crash_counter;
>  	} stats;
> +	bool ftm_segment_handler;
> +	struct ath12k_ftm_event_obj ftm_event_obj;
>  	u32 pktlog_defs_checksum;

ftm_segment_handler is also unused so removed that as well.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

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

* Re: [PATCH v5 0/4] wifi: ath12k: Factory test mode support
  2024-06-24  9:53 [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
                   ` (3 preceding siblings ...)
  2024-06-24  9:53 ` [PATCH v5 4/4] wifi: ath12k: Fill pdev id for fw test cmd Aaradhana Sahu
@ 2025-01-09  4:43 ` Aaradhana Sahu
  2025-01-09  4:55   ` Aditya Kumar Singh
  4 siblings, 1 reply; 22+ messages in thread
From: Aaradhana Sahu @ 2025-01-09  4:43 UTC (permalink / raw)
  To: ath12k, Kalle Valo; +Cc: linux-wireless



On 6/24/2024 3:23 PM, Aaradhana Sahu wrote:
> Device is booted in factory test mode for calibration.
> The commands are sent from userspace application, which
> is sent to firmware using wmi commands. Firmware sends
> the response to driver as wmi events and driver sends
> these events to the application via netlink message.
> 
> Also added changes related to correct pdev id access for
> fw test cmd.
> 
> Aaradhana Sahu (3):
>   wifi: ath: create common testmode_i.h file for ath drivers
>   wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>   wifi: ath12k: add factory test mode support
> 
> Rajat Soni (1):
>   wifi: ath12k: Fill pdev id for fw test cmd
> 
> ---
> v5:
>   -Updated copyright
>   -Fixed line length within 90 char
> v4:
>   -Rebased on latest ToT
> v3:
>   -Rebased on latest ToT
>   -Updated Tested-on Tag
>   -Removed second parameter of ath12k_core_start()
>   -Updated copyright
> v2:
>   -Rebased on latest ath ToT
> ---
> 
>  drivers/net/wireless/ath/ath11k/testmode.c    |  78 ++--
>  drivers/net/wireless/ath/ath12k/Makefile      |   1 +
>  drivers/net/wireless/ath/ath12k/core.c        |  22 +-
>  drivers/net/wireless/ath/ath12k/core.h        |  13 +
>  drivers/net/wireless/ath/ath12k/debug.h       |   1 +
>  drivers/net/wireless/ath/ath12k/dp.c          |   3 +
>  drivers/net/wireless/ath/ath12k/mac.c         |  15 +-
>  drivers/net/wireless/ath/ath12k/pci.c         |   1 +
>  drivers/net/wireless/ath/ath12k/testmode.c    | 423 ++++++++++++++++++
>  drivers/net/wireless/ath/ath12k/testmode.h    |  40 ++
>  drivers/net/wireless/ath/ath12k/wmi.c         |  39 +-
>  drivers/net/wireless/ath/ath12k/wmi.h         |  21 +
>  .../wireless/ath/{ath11k => }/testmode_i.h    |  54 +--
>  13 files changed, 636 insertions(+), 75 deletions(-)
>  create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
>  create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h
>  rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)
> 
> 
> base-commit: cac9bfd02678adbcca9a7dce770609b9f7434d37

Hi Kalle,

Please let me know, if any thing is pending from the developer side, to merge this series into ath.git tree.

Thanks,
Aaradhana Sahu


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

* Re: [PATCH v5 0/4] wifi: ath12k: Factory test mode support
  2025-01-09  4:43 ` [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
@ 2025-01-09  4:55   ` Aditya Kumar Singh
  2025-01-09  5:29     ` Jeff Johnson
  2025-01-09 13:13     ` Aaradhana Sahu
  0 siblings, 2 replies; 22+ messages in thread
From: Aditya Kumar Singh @ 2025-01-09  4:55 UTC (permalink / raw)
  To: Aaradhana Sahu, ath12k, Kalle Valo; +Cc: linux-wireless

On 1/9/25 10:13, Aaradhana Sahu wrote:
> 
> 
> On 6/24/2024 3:23 PM, Aaradhana Sahu wrote:
>> Device is booted in factory test mode for calibration.
>> The commands are sent from userspace application, which
>> is sent to firmware using wmi commands. Firmware sends
>> the response to driver as wmi events and driver sends
>> these events to the application via netlink message.
>>
>> Also added changes related to correct pdev id access for
>> fw test cmd.
>>
>> Aaradhana Sahu (3):
>>    wifi: ath: create common testmode_i.h file for ath drivers
>>    wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>>    wifi: ath12k: add factory test mode support
>>
>> Rajat Soni (1):
>>    wifi: ath12k: Fill pdev id for fw test cmd
>>
>> ---
>> v5:
>>    -Updated copyright
>>    -Fixed line length within 90 char
>> v4:
>>    -Rebased on latest ToT
>> v3:
>>    -Rebased on latest ToT
>>    -Updated Tested-on Tag
>>    -Removed second parameter of ath12k_core_start()
>>    -Updated copyright
>> v2:
>>    -Rebased on latest ath ToT
>> ---
>>
>>   drivers/net/wireless/ath/ath11k/testmode.c    |  78 ++--
>>   drivers/net/wireless/ath/ath12k/Makefile      |   1 +
>>   drivers/net/wireless/ath/ath12k/core.c        |  22 +-
>>   drivers/net/wireless/ath/ath12k/core.h        |  13 +
>>   drivers/net/wireless/ath/ath12k/debug.h       |   1 +
>>   drivers/net/wireless/ath/ath12k/dp.c          |   3 +
>>   drivers/net/wireless/ath/ath12k/mac.c         |  15 +-
>>   drivers/net/wireless/ath/ath12k/pci.c         |   1 +
>>   drivers/net/wireless/ath/ath12k/testmode.c    | 423 ++++++++++++++++++
>>   drivers/net/wireless/ath/ath12k/testmode.h    |  40 ++
>>   drivers/net/wireless/ath/ath12k/wmi.c         |  39 +-
>>   drivers/net/wireless/ath/ath12k/wmi.h         |  21 +
>>   .../wireless/ath/{ath11k => }/testmode_i.h    |  54 +--
>>   13 files changed, 636 insertions(+), 75 deletions(-)
>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h
>>   rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)
>>
>>
>> base-commit: cac9bfd02678adbcca9a7dce770609b9f7434d37
> 
> Hi Kalle,
> 
> Please let me know, if any thing is pending from the developer side, to merge this series into ath.git tree.

This series does not apply cleanly on latest tip. And base commit is 
around 6 months old. So may be you would want to rebase and send a new 
version?

Applying: wifi: ath: create common testmode_i.h file for ath drivers
Applying: wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
Applying: wifi: ath12k: add factory test mode support
error: patch failed: drivers/net/wireless/ath/ath12k/Makefile:26
error: drivers/net/wireless/ath/ath12k/Makefile: patch does not apply
error: patch failed: drivers/net/wireless/ath/ath12k/core.c:42
error: drivers/net/wireless/ath/ath12k/core.c: patch does not apply
error: patch failed: drivers/net/wireless/ath/ath12k/core.h:209
error: drivers/net/wireless/ath/ath12k/core.h: patch does not apply
error: patch failed: drivers/net/wireless/ath/ath12k/debug.h:33
error: drivers/net/wireless/ath/ath12k/debug.h: patch does not apply
error: patch failed: drivers/net/wireless/ath/ath12k/mac.c:13
error: drivers/net/wireless/ath/ath12k/mac.c: patch does not apply
error: patch failed: drivers/net/wireless/ath/ath12k/wmi.c:7150
error: drivers/net/wireless/ath/ath12k/wmi.c: patch does not apply
Patch failed at 0003 wifi: ath12k: add factory test mode support
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

And since you'll be submitting in 2025, don't forget to update
copyrights.


-- 
Aditya

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

* Re: [PATCH v5 0/4] wifi: ath12k: Factory test mode support
  2025-01-09  4:55   ` Aditya Kumar Singh
@ 2025-01-09  5:29     ` Jeff Johnson
  2025-01-09 12:54       ` Kalle Valo
  2025-01-09 13:14       ` Aaradhana Sahu
  2025-01-09 13:13     ` Aaradhana Sahu
  1 sibling, 2 replies; 22+ messages in thread
From: Jeff Johnson @ 2025-01-09  5:29 UTC (permalink / raw)
  To: Aditya Kumar Singh, Aaradhana Sahu, ath12k, Kalle Valo; +Cc: linux-wireless

On 1/8/2025 8:55 PM, Aditya Kumar Singh wrote:
> On 1/9/25 10:13, Aaradhana Sahu wrote:
>>
>>
>> On 6/24/2024 3:23 PM, Aaradhana Sahu wrote:
>>> Device is booted in factory test mode for calibration.
>>> The commands are sent from userspace application, which
>>> is sent to firmware using wmi commands. Firmware sends
>>> the response to driver as wmi events and driver sends
>>> these events to the application via netlink message.
>>>
>>> Also added changes related to correct pdev id access for
>>> fw test cmd.
>>>
>>> Aaradhana Sahu (3):
>>>    wifi: ath: create common testmode_i.h file for ath drivers
>>>    wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>>>    wifi: ath12k: add factory test mode support
>>>
>>> Rajat Soni (1):
>>>    wifi: ath12k: Fill pdev id for fw test cmd
>>>
>>> ---
>>> v5:
>>>    -Updated copyright
>>>    -Fixed line length within 90 char
>>> v4:
>>>    -Rebased on latest ToT
>>> v3:
>>>    -Rebased on latest ToT
>>>    -Updated Tested-on Tag
>>>    -Removed second parameter of ath12k_core_start()
>>>    -Updated copyright
>>> v2:
>>>    -Rebased on latest ath ToT
>>> ---
>>>
>>>   drivers/net/wireless/ath/ath11k/testmode.c    |  78 ++--
>>>   drivers/net/wireless/ath/ath12k/Makefile      |   1 +
>>>   drivers/net/wireless/ath/ath12k/core.c        |  22 +-
>>>   drivers/net/wireless/ath/ath12k/core.h        |  13 +
>>>   drivers/net/wireless/ath/ath12k/debug.h       |   1 +
>>>   drivers/net/wireless/ath/ath12k/dp.c          |   3 +
>>>   drivers/net/wireless/ath/ath12k/mac.c         |  15 +-
>>>   drivers/net/wireless/ath/ath12k/pci.c         |   1 +
>>>   drivers/net/wireless/ath/ath12k/testmode.c    | 423 ++++++++++++++++++
>>>   drivers/net/wireless/ath/ath12k/testmode.h    |  40 ++
>>>   drivers/net/wireless/ath/ath12k/wmi.c         |  39 +-
>>>   drivers/net/wireless/ath/ath12k/wmi.h         |  21 +
>>>   .../wireless/ath/{ath11k => }/testmode_i.h    |  54 +--
>>>   13 files changed, 636 insertions(+), 75 deletions(-)
>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h
>>>   rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)
>>>
>>>
>>> base-commit: cac9bfd02678adbcca9a7dce770609b9f7434d37
>>
>> Hi Kalle,
>>
>> Please let me know, if any thing is pending from the developer side, to merge this series into ath.git tree.
> 
> This series does not apply cleanly on latest tip. And base commit is 
> around 6 months old. So may be you would want to rebase and send a new 
> version?
> 
> Applying: wifi: ath: create common testmode_i.h file for ath drivers
> Applying: wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
> Applying: wifi: ath12k: add factory test mode support
> error: patch failed: drivers/net/wireless/ath/ath12k/Makefile:26
> error: drivers/net/wireless/ath/ath12k/Makefile: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/core.c:42
> error: drivers/net/wireless/ath/ath12k/core.c: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/core.h:209
> error: drivers/net/wireless/ath/ath12k/core.h: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/debug.h:33
> error: drivers/net/wireless/ath/ath12k/debug.h: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/mac.c:13
> error: drivers/net/wireless/ath/ath12k/mac.c: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/wmi.c:7150
> error: drivers/net/wireless/ath/ath12k/wmi.c: patch does not apply
> Patch failed at 0003 wifi: ath12k: add factory test mode support
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
> 
> And since you'll be submitting in 2025, don't forget to update
> copyrights.
> 
> 

Make sure to review all the changes that Kalle made locally to the pending
version and incorporate those.

/jeff

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

* Re: [PATCH v5 0/4] wifi: ath12k: Factory test mode support
  2025-01-09  5:29     ` Jeff Johnson
@ 2025-01-09 12:54       ` Kalle Valo
  2025-01-09 13:15         ` Aaradhana Sahu
  2025-01-09 13:14       ` Aaradhana Sahu
  1 sibling, 1 reply; 22+ messages in thread
From: Kalle Valo @ 2025-01-09 12:54 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: Aditya Kumar Singh, Aaradhana Sahu, ath12k, linux-wireless

Jeff Johnson <jeff.johnson@oss.qualcomm.com> writes:

> On 1/8/2025 8:55 PM, Aditya Kumar Singh wrote:
>
>> On 1/9/25 10:13, Aaradhana Sahu wrote:
>>>
>>>
>>> On 6/24/2024 3:23 PM, Aaradhana Sahu wrote:
>>>> Device is booted in factory test mode for calibration.
>>>> The commands are sent from userspace application, which
>>>> is sent to firmware using wmi commands. Firmware sends
>>>> the response to driver as wmi events and driver sends
>>>> these events to the application via netlink message.
>>>>
>>>> Also added changes related to correct pdev id access for
>>>> fw test cmd.
>>>>
>>>> Aaradhana Sahu (3):
>>>>    wifi: ath: create common testmode_i.h file for ath drivers
>>>>    wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>>>>    wifi: ath12k: add factory test mode support
>>>>
>>>> Rajat Soni (1):
>>>>    wifi: ath12k: Fill pdev id for fw test cmd
>>>>
>>>> ---
>>>> v5:
>>>>    -Updated copyright
>>>>    -Fixed line length within 90 char
>>>> v4:
>>>>    -Rebased on latest ToT
>>>> v3:
>>>>    -Rebased on latest ToT
>>>>    -Updated Tested-on Tag
>>>>    -Removed second parameter of ath12k_core_start()
>>>>    -Updated copyright
>>>> v2:
>>>>    -Rebased on latest ath ToT
>>>> ---
>>>>
>>>>   drivers/net/wireless/ath/ath11k/testmode.c    |  78 ++--
>>>>   drivers/net/wireless/ath/ath12k/Makefile      |   1 +
>>>>   drivers/net/wireless/ath/ath12k/core.c        |  22 +-
>>>>   drivers/net/wireless/ath/ath12k/core.h        |  13 +
>>>>   drivers/net/wireless/ath/ath12k/debug.h       |   1 +
>>>>   drivers/net/wireless/ath/ath12k/dp.c          |   3 +
>>>>   drivers/net/wireless/ath/ath12k/mac.c         |  15 +-
>>>>   drivers/net/wireless/ath/ath12k/pci.c         |   1 +
>>>>   drivers/net/wireless/ath/ath12k/testmode.c    | 423 ++++++++++++++++++
>>>>   drivers/net/wireless/ath/ath12k/testmode.h    |  40 ++
>>>>   drivers/net/wireless/ath/ath12k/wmi.c         |  39 +-
>>>>   drivers/net/wireless/ath/ath12k/wmi.h         |  21 +
>>>>   .../wireless/ath/{ath11k => }/testmode_i.h    |  54 +--
>>>>   13 files changed, 636 insertions(+), 75 deletions(-)
>>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
>>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h
>>>>   rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)
>>>>
>>>>
>>>> base-commit: cac9bfd02678adbcca9a7dce770609b9f7434d37
>>>
>>> Hi Kalle,
>>>
>>> Please let me know, if any thing is pending from the developer side, to merge this series into ath.git tree.
>> 
>> This series does not apply cleanly on latest tip. And base commit is 
>> around 6 months old. So may be you would want to rebase and send a new 
>> version?
>> 
>> Applying: wifi: ath: create common testmode_i.h file for ath drivers
>> Applying: wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>> Applying: wifi: ath12k: add factory test mode support
>> error: patch failed: drivers/net/wireless/ath/ath12k/Makefile:26
>> error: drivers/net/wireless/ath/ath12k/Makefile: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/core.c:42
>> error: drivers/net/wireless/ath/ath12k/core.c: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/core.h:209
>> error: drivers/net/wireless/ath/ath12k/core.h: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/debug.h:33
>> error: drivers/net/wireless/ath/ath12k/debug.h: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/mac.c:13
>> error: drivers/net/wireless/ath/ath12k/mac.c: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/wmi.c:7150
>> error: drivers/net/wireless/ath/ath12k/wmi.c: patch does not apply
>> Patch failed at 0003 wifi: ath12k: add factory test mode support
>> hint: Use 'git am --show-current-patch=diff' to see the failed patch
>> When you have resolved this problem, run "git am --continue".
>> If you prefer to skip this patch, run "git am --skip" instead.
>> To restore the original branch and stop patching, run "git am --abort".
>> 
>> And since you'll be submitting in 2025, don't forget to update
>> copyrights.
>> 
>> 
>
> Make sure to review all the changes that Kalle made locally to the pending
> version and incorporate those.

BTW my changes are available in tag ath-pending-202407031443 and these
are the commit ids:

194fb8d58727 wifi: ath12k: Fill pdev id for fw test cmd
0ca2ecc31b40 wifi: ath12k: add factory test mode support
df17f461e7c3 wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
593b976359bf wifi: ath: create common testmode_i.h file for ath drivers

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

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

* Re: [PATCH v5 0/4] wifi: ath12k: Factory test mode support
  2025-01-09  4:55   ` Aditya Kumar Singh
  2025-01-09  5:29     ` Jeff Johnson
@ 2025-01-09 13:13     ` Aaradhana Sahu
  1 sibling, 0 replies; 22+ messages in thread
From: Aaradhana Sahu @ 2025-01-09 13:13 UTC (permalink / raw)
  To: Aditya Kumar Singh, ath12k, Kalle Valo; +Cc: linux-wireless



On 1/9/2025 10:25 AM, Aditya Kumar Singh wrote:
> On 1/9/25 10:13, Aaradhana Sahu wrote:
>>
>>
>> On 6/24/2024 3:23 PM, Aaradhana Sahu wrote:
>>> Device is booted in factory test mode for calibration.
>>> The commands are sent from userspace application, which
>>> is sent to firmware using wmi commands. Firmware sends
>>> the response to driver as wmi events and driver sends
>>> these events to the application via netlink message.
>>>
>>> Also added changes related to correct pdev id access for
>>> fw test cmd.
>>>
>>> Aaradhana Sahu (3):
>>>    wifi: ath: create common testmode_i.h file for ath drivers
>>>    wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>>>    wifi: ath12k: add factory test mode support
>>>
>>> Rajat Soni (1):
>>>    wifi: ath12k: Fill pdev id for fw test cmd
>>>
>>> ---
>>> v5:
>>>    -Updated copyright
>>>    -Fixed line length within 90 char
>>> v4:
>>>    -Rebased on latest ToT
>>> v3:
>>>    -Rebased on latest ToT
>>>    -Updated Tested-on Tag
>>>    -Removed second parameter of ath12k_core_start()
>>>    -Updated copyright
>>> v2:
>>>    -Rebased on latest ath ToT
>>> ---
>>>
>>>   drivers/net/wireless/ath/ath11k/testmode.c    |  78 ++--
>>>   drivers/net/wireless/ath/ath12k/Makefile      |   1 +
>>>   drivers/net/wireless/ath/ath12k/core.c        |  22 +-
>>>   drivers/net/wireless/ath/ath12k/core.h        |  13 +
>>>   drivers/net/wireless/ath/ath12k/debug.h       |   1 +
>>>   drivers/net/wireless/ath/ath12k/dp.c          |   3 +
>>>   drivers/net/wireless/ath/ath12k/mac.c         |  15 +-
>>>   drivers/net/wireless/ath/ath12k/pci.c         |   1 +
>>>   drivers/net/wireless/ath/ath12k/testmode.c    | 423 ++++++++++++++++++
>>>   drivers/net/wireless/ath/ath12k/testmode.h    |  40 ++
>>>   drivers/net/wireless/ath/ath12k/wmi.c         |  39 +-
>>>   drivers/net/wireless/ath/ath12k/wmi.h         |  21 +
>>>   .../wireless/ath/{ath11k => }/testmode_i.h    |  54 +--
>>>   13 files changed, 636 insertions(+), 75 deletions(-)
>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h
>>>   rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)
>>>
>>>
>>> base-commit: cac9bfd02678adbcca9a7dce770609b9f7434d37
>>
>> Hi Kalle,
>>
>> Please let me know, if any thing is pending from the developer side, to merge this series into ath.git tree.
> 
> This series does not apply cleanly on latest tip. And base commit is around 6 months old. So may be you would want to rebase and send a new version?
> 
> Applying: wifi: ath: create common testmode_i.h file for ath drivers
> Applying: wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
> Applying: wifi: ath12k: add factory test mode support
> error: patch failed: drivers/net/wireless/ath/ath12k/Makefile:26
> error: drivers/net/wireless/ath/ath12k/Makefile: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/core.c:42
> error: drivers/net/wireless/ath/ath12k/core.c: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/core.h:209
> error: drivers/net/wireless/ath/ath12k/core.h: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/debug.h:33
> error: drivers/net/wireless/ath/ath12k/debug.h: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/mac.c:13
> error: drivers/net/wireless/ath/ath12k/mac.c: patch does not apply
> error: patch failed: drivers/net/wireless/ath/ath12k/wmi.c:7150
> error: drivers/net/wireless/ath/ath12k/wmi.c: patch does not apply
> Patch failed at 0003 wifi: ath12k: add factory test mode support
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
> 
> And since you'll be submitting in 2025, don't forget to update
> copyrights.
> 
> 
Sure, will address in the next version.


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

* Re: [PATCH v5 0/4] wifi: ath12k: Factory test mode support
  2025-01-09  5:29     ` Jeff Johnson
  2025-01-09 12:54       ` Kalle Valo
@ 2025-01-09 13:14       ` Aaradhana Sahu
  1 sibling, 0 replies; 22+ messages in thread
From: Aaradhana Sahu @ 2025-01-09 13:14 UTC (permalink / raw)
  To: Jeff Johnson, Aditya Kumar Singh, ath12k, Kalle Valo; +Cc: linux-wireless



On 1/9/2025 10:59 AM, Jeff Johnson wrote:
> On 1/8/2025 8:55 PM, Aditya Kumar Singh wrote:
>> On 1/9/25 10:13, Aaradhana Sahu wrote:
>>>
>>>
>>> On 6/24/2024 3:23 PM, Aaradhana Sahu wrote:
>>>> Device is booted in factory test mode for calibration.
>>>> The commands are sent from userspace application, which
>>>> is sent to firmware using wmi commands. Firmware sends
>>>> the response to driver as wmi events and driver sends
>>>> these events to the application via netlink message.
>>>>
>>>> Also added changes related to correct pdev id access for
>>>> fw test cmd.
>>>>
>>>> Aaradhana Sahu (3):
>>>>    wifi: ath: create common testmode_i.h file for ath drivers
>>>>    wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>>>>    wifi: ath12k: add factory test mode support
>>>>
>>>> Rajat Soni (1):
>>>>    wifi: ath12k: Fill pdev id for fw test cmd
>>>>
>>>> ---
>>>> v5:
>>>>    -Updated copyright
>>>>    -Fixed line length within 90 char
>>>> v4:
>>>>    -Rebased on latest ToT
>>>> v3:
>>>>    -Rebased on latest ToT
>>>>    -Updated Tested-on Tag
>>>>    -Removed second parameter of ath12k_core_start()
>>>>    -Updated copyright
>>>> v2:
>>>>    -Rebased on latest ath ToT
>>>> ---
>>>>
>>>>   drivers/net/wireless/ath/ath11k/testmode.c    |  78 ++--
>>>>   drivers/net/wireless/ath/ath12k/Makefile      |   1 +
>>>>   drivers/net/wireless/ath/ath12k/core.c        |  22 +-
>>>>   drivers/net/wireless/ath/ath12k/core.h        |  13 +
>>>>   drivers/net/wireless/ath/ath12k/debug.h       |   1 +
>>>>   drivers/net/wireless/ath/ath12k/dp.c          |   3 +
>>>>   drivers/net/wireless/ath/ath12k/mac.c         |  15 +-
>>>>   drivers/net/wireless/ath/ath12k/pci.c         |   1 +
>>>>   drivers/net/wireless/ath/ath12k/testmode.c    | 423 ++++++++++++++++++
>>>>   drivers/net/wireless/ath/ath12k/testmode.h    |  40 ++
>>>>   drivers/net/wireless/ath/ath12k/wmi.c         |  39 +-
>>>>   drivers/net/wireless/ath/ath12k/wmi.h         |  21 +
>>>>   .../wireless/ath/{ath11k => }/testmode_i.h    |  54 +--
>>>>   13 files changed, 636 insertions(+), 75 deletions(-)
>>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
>>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h
>>>>   rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)
>>>>
>>>>
>>>> base-commit: cac9bfd02678adbcca9a7dce770609b9f7434d37
>>>
>>> Hi Kalle,
>>>
>>> Please let me know, if any thing is pending from the developer side, to merge this series into ath.git tree.
>>
>> This series does not apply cleanly on latest tip. And base commit is 
>> around 6 months old. So may be you would want to rebase and send a new 
>> version?
>>
>> Applying: wifi: ath: create common testmode_i.h file for ath drivers
>> Applying: wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>> Applying: wifi: ath12k: add factory test mode support
>> error: patch failed: drivers/net/wireless/ath/ath12k/Makefile:26
>> error: drivers/net/wireless/ath/ath12k/Makefile: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/core.c:42
>> error: drivers/net/wireless/ath/ath12k/core.c: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/core.h:209
>> error: drivers/net/wireless/ath/ath12k/core.h: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/debug.h:33
>> error: drivers/net/wireless/ath/ath12k/debug.h: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/mac.c:13
>> error: drivers/net/wireless/ath/ath12k/mac.c: patch does not apply
>> error: patch failed: drivers/net/wireless/ath/ath12k/wmi.c:7150
>> error: drivers/net/wireless/ath/ath12k/wmi.c: patch does not apply
>> Patch failed at 0003 wifi: ath12k: add factory test mode support
>> hint: Use 'git am --show-current-patch=diff' to see the failed patch
>> When you have resolved this problem, run "git am --continue".
>> If you prefer to skip this patch, run "git am --skip" instead.
>> To restore the original branch and stop patching, run "git am --abort".
>>
>> And since you'll be submitting in 2025, don't forget to update
>> copyrights.
>>
>>
> 
> Make sure to review all the changes that Kalle made locally to the pending
> version and incorporate those.
> 
> /jeff

Sure

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

* Re: [PATCH v5 0/4] wifi: ath12k: Factory test mode support
  2025-01-09 12:54       ` Kalle Valo
@ 2025-01-09 13:15         ` Aaradhana Sahu
  2025-01-09 20:53           ` Jeff Johnson
  0 siblings, 1 reply; 22+ messages in thread
From: Aaradhana Sahu @ 2025-01-09 13:15 UTC (permalink / raw)
  To: Kalle Valo, Jeff Johnson; +Cc: Aditya Kumar Singh, ath12k, linux-wireless



On 1/9/2025 6:24 PM, Kalle Valo wrote:
> Jeff Johnson <jeff.johnson@oss.qualcomm.com> writes:
> 
>> On 1/8/2025 8:55 PM, Aditya Kumar Singh wrote:
>>
>>> On 1/9/25 10:13, Aaradhana Sahu wrote:
>>>>
>>>>
>>>> On 6/24/2024 3:23 PM, Aaradhana Sahu wrote:
>>>>> Device is booted in factory test mode for calibration.
>>>>> The commands are sent from userspace application, which
>>>>> is sent to firmware using wmi commands. Firmware sends
>>>>> the response to driver as wmi events and driver sends
>>>>> these events to the application via netlink message.
>>>>>
>>>>> Also added changes related to correct pdev id access for
>>>>> fw test cmd.
>>>>>
>>>>> Aaradhana Sahu (3):
>>>>>    wifi: ath: create common testmode_i.h file for ath drivers
>>>>>    wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>>>>>    wifi: ath12k: add factory test mode support
>>>>>
>>>>> Rajat Soni (1):
>>>>>    wifi: ath12k: Fill pdev id for fw test cmd
>>>>>
>>>>> ---
>>>>> v5:
>>>>>    -Updated copyright
>>>>>    -Fixed line length within 90 char
>>>>> v4:
>>>>>    -Rebased on latest ToT
>>>>> v3:
>>>>>    -Rebased on latest ToT
>>>>>    -Updated Tested-on Tag
>>>>>    -Removed second parameter of ath12k_core_start()
>>>>>    -Updated copyright
>>>>> v2:
>>>>>    -Rebased on latest ath ToT
>>>>> ---
>>>>>
>>>>>   drivers/net/wireless/ath/ath11k/testmode.c    |  78 ++--
>>>>>   drivers/net/wireless/ath/ath12k/Makefile      |   1 +
>>>>>   drivers/net/wireless/ath/ath12k/core.c        |  22 +-
>>>>>   drivers/net/wireless/ath/ath12k/core.h        |  13 +
>>>>>   drivers/net/wireless/ath/ath12k/debug.h       |   1 +
>>>>>   drivers/net/wireless/ath/ath12k/dp.c          |   3 +
>>>>>   drivers/net/wireless/ath/ath12k/mac.c         |  15 +-
>>>>>   drivers/net/wireless/ath/ath12k/pci.c         |   1 +
>>>>>   drivers/net/wireless/ath/ath12k/testmode.c    | 423 ++++++++++++++++++
>>>>>   drivers/net/wireless/ath/ath12k/testmode.h    |  40 ++
>>>>>   drivers/net/wireless/ath/ath12k/wmi.c         |  39 +-
>>>>>   drivers/net/wireless/ath/ath12k/wmi.h         |  21 +
>>>>>   .../wireless/ath/{ath11k => }/testmode_i.h    |  54 +--
>>>>>   13 files changed, 636 insertions(+), 75 deletions(-)
>>>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
>>>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h
>>>>>   rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)
>>>>>
>>>>>
>>>>> base-commit: cac9bfd02678adbcca9a7dce770609b9f7434d37
>>>>
>>>> Hi Kalle,
>>>>
>>>> Please let me know, if any thing is pending from the developer side, to merge this series into ath.git tree.
>>>
>>> This series does not apply cleanly on latest tip. And base commit is 
>>> around 6 months old. So may be you would want to rebase and send a new 
>>> version?
>>>
>>> Applying: wifi: ath: create common testmode_i.h file for ath drivers
>>> Applying: wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>>> Applying: wifi: ath12k: add factory test mode support
>>> error: patch failed: drivers/net/wireless/ath/ath12k/Makefile:26
>>> error: drivers/net/wireless/ath/ath12k/Makefile: patch does not apply
>>> error: patch failed: drivers/net/wireless/ath/ath12k/core.c:42
>>> error: drivers/net/wireless/ath/ath12k/core.c: patch does not apply
>>> error: patch failed: drivers/net/wireless/ath/ath12k/core.h:209
>>> error: drivers/net/wireless/ath/ath12k/core.h: patch does not apply
>>> error: patch failed: drivers/net/wireless/ath/ath12k/debug.h:33
>>> error: drivers/net/wireless/ath/ath12k/debug.h: patch does not apply
>>> error: patch failed: drivers/net/wireless/ath/ath12k/mac.c:13
>>> error: drivers/net/wireless/ath/ath12k/mac.c: patch does not apply
>>> error: patch failed: drivers/net/wireless/ath/ath12k/wmi.c:7150
>>> error: drivers/net/wireless/ath/ath12k/wmi.c: patch does not apply
>>> Patch failed at 0003 wifi: ath12k: add factory test mode support
>>> hint: Use 'git am --show-current-patch=diff' to see the failed patch
>>> When you have resolved this problem, run "git am --continue".
>>> If you prefer to skip this patch, run "git am --skip" instead.
>>> To restore the original branch and stop patching, run "git am --abort".
>>>
>>> And since you'll be submitting in 2025, don't forget to update
>>> copyrights.
>>>
>>>
>>
>> Make sure to review all the changes that Kalle made locally to the pending
>> version and incorporate those.
> 
> BTW my changes are available in tag ath-pending-202407031443 and these
> are the commit ids:
> 
> 194fb8d58727 wifi: ath12k: Fill pdev id for fw test cmd
> 0ca2ecc31b40 wifi: ath12k: add factory test mode support
> df17f461e7c3 wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
> 593b976359bf wifi: ath: create common testmode_i.h file for ath drivers
> 
Thanks, I will pick your changes as well.

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

* Re: [PATCH v5 0/4] wifi: ath12k: Factory test mode support
  2025-01-09 13:15         ` Aaradhana Sahu
@ 2025-01-09 20:53           ` Jeff Johnson
  0 siblings, 0 replies; 22+ messages in thread
From: Jeff Johnson @ 2025-01-09 20:53 UTC (permalink / raw)
  To: Aaradhana Sahu, Kalle Valo; +Cc: Aditya Kumar Singh, ath12k, linux-wireless

On 1/9/2025 5:15 AM, Aaradhana Sahu wrote:
> 
> 
> On 1/9/2025 6:24 PM, Kalle Valo wrote:
>> Jeff Johnson <jeff.johnson@oss.qualcomm.com> writes:
>>
>>> On 1/8/2025 8:55 PM, Aditya Kumar Singh wrote:
>>>
>>>> On 1/9/25 10:13, Aaradhana Sahu wrote:
>>>>>
>>>>>
>>>>> On 6/24/2024 3:23 PM, Aaradhana Sahu wrote:
>>>>>> Device is booted in factory test mode for calibration.
>>>>>> The commands are sent from userspace application, which
>>>>>> is sent to firmware using wmi commands. Firmware sends
>>>>>> the response to driver as wmi events and driver sends
>>>>>> these events to the application via netlink message.
>>>>>>
>>>>>> Also added changes related to correct pdev id access for
>>>>>> fw test cmd.
>>>>>>
>>>>>> Aaradhana Sahu (3):
>>>>>>    wifi: ath: create common testmode_i.h file for ath drivers
>>>>>>    wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>>>>>>    wifi: ath12k: add factory test mode support
>>>>>>
>>>>>> Rajat Soni (1):
>>>>>>    wifi: ath12k: Fill pdev id for fw test cmd
>>>>>>
>>>>>> ---
>>>>>> v5:
>>>>>>    -Updated copyright
>>>>>>    -Fixed line length within 90 char
>>>>>> v4:
>>>>>>    -Rebased on latest ToT
>>>>>> v3:
>>>>>>    -Rebased on latest ToT
>>>>>>    -Updated Tested-on Tag
>>>>>>    -Removed second parameter of ath12k_core_start()
>>>>>>    -Updated copyright
>>>>>> v2:
>>>>>>    -Rebased on latest ath ToT
>>>>>> ---
>>>>>>
>>>>>>   drivers/net/wireless/ath/ath11k/testmode.c    |  78 ++--
>>>>>>   drivers/net/wireless/ath/ath12k/Makefile      |   1 +
>>>>>>   drivers/net/wireless/ath/ath12k/core.c        |  22 +-
>>>>>>   drivers/net/wireless/ath/ath12k/core.h        |  13 +
>>>>>>   drivers/net/wireless/ath/ath12k/debug.h       |   1 +
>>>>>>   drivers/net/wireless/ath/ath12k/dp.c          |   3 +
>>>>>>   drivers/net/wireless/ath/ath12k/mac.c         |  15 +-
>>>>>>   drivers/net/wireless/ath/ath12k/pci.c         |   1 +
>>>>>>   drivers/net/wireless/ath/ath12k/testmode.c    | 423 ++++++++++++++++++
>>>>>>   drivers/net/wireless/ath/ath12k/testmode.h    |  40 ++
>>>>>>   drivers/net/wireless/ath/ath12k/wmi.c         |  39 +-
>>>>>>   drivers/net/wireless/ath/ath12k/wmi.h         |  21 +
>>>>>>   .../wireless/ath/{ath11k => }/testmode_i.h    |  54 +--
>>>>>>   13 files changed, 636 insertions(+), 75 deletions(-)
>>>>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.c
>>>>>>   create mode 100644 drivers/net/wireless/ath/ath12k/testmode.h
>>>>>>   rename drivers/net/wireless/ath/{ath11k => }/testmode_i.h (50%)
>>>>>>
>>>>>>
>>>>>> base-commit: cac9bfd02678adbcca9a7dce770609b9f7434d37
>>>>>
>>>>> Hi Kalle,
>>>>>
>>>>> Please let me know, if any thing is pending from the developer side, to merge this series into ath.git tree.
>>>>
>>>> This series does not apply cleanly on latest tip. And base commit is 
>>>> around 6 months old. So may be you would want to rebase and send a new 
>>>> version?
>>>>
>>>> Applying: wifi: ath: create common testmode_i.h file for ath drivers
>>>> Applying: wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>>>> Applying: wifi: ath12k: add factory test mode support
>>>> error: patch failed: drivers/net/wireless/ath/ath12k/Makefile:26
>>>> error: drivers/net/wireless/ath/ath12k/Makefile: patch does not apply
>>>> error: patch failed: drivers/net/wireless/ath/ath12k/core.c:42
>>>> error: drivers/net/wireless/ath/ath12k/core.c: patch does not apply
>>>> error: patch failed: drivers/net/wireless/ath/ath12k/core.h:209
>>>> error: drivers/net/wireless/ath/ath12k/core.h: patch does not apply
>>>> error: patch failed: drivers/net/wireless/ath/ath12k/debug.h:33
>>>> error: drivers/net/wireless/ath/ath12k/debug.h: patch does not apply
>>>> error: patch failed: drivers/net/wireless/ath/ath12k/mac.c:13
>>>> error: drivers/net/wireless/ath/ath12k/mac.c: patch does not apply
>>>> error: patch failed: drivers/net/wireless/ath/ath12k/wmi.c:7150
>>>> error: drivers/net/wireless/ath/ath12k/wmi.c: patch does not apply
>>>> Patch failed at 0003 wifi: ath12k: add factory test mode support
>>>> hint: Use 'git am --show-current-patch=diff' to see the failed patch
>>>> When you have resolved this problem, run "git am --continue".
>>>> If you prefer to skip this patch, run "git am --skip" instead.
>>>> To restore the original branch and stop patching, run "git am --abort".
>>>>
>>>> And since you'll be submitting in 2025, don't forget to update
>>>> copyrights.
>>>>
>>>>
>>>
>>> Make sure to review all the changes that Kalle made locally to the pending
>>> version and incorporate those.
>>
>> BTW my changes are available in tag ath-pending-202407031443 and these
>> are the commit ids:
>>
>> 194fb8d58727 wifi: ath12k: Fill pdev id for fw test cmd
>> 0ca2ecc31b40 wifi: ath12k: add factory test mode support
>> df17f461e7c3 wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode
>> 593b976359bf wifi: ath: create common testmode_i.h file for ath drivers
>>
> Thanks, I will pick your changes as well.

I've verified that v6 picks up Kalle's local changes

/jeff

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

end of thread, other threads:[~2025-01-09 20:53 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24  9:53 [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
2024-06-24  9:53 ` [PATCH v5 1/4] wifi: ath: create common testmode_i.h file for ath drivers Aaradhana Sahu
2024-06-25 18:43   ` Jeff Johnson
2024-06-24  9:53 ` [PATCH v5 2/4] wifi: ath12k: export ath12k_wmi_tlv_hdr for testmode Aaradhana Sahu
2024-06-25 18:43   ` Jeff Johnson
2024-06-24  9:53 ` [PATCH v5 3/4] wifi: ath12k: add factory test mode support Aaradhana Sahu
2024-06-25 18:44   ` Jeff Johnson
2024-06-27 17:43   ` Kalle Valo
2024-06-27 18:29     ` Jeff Johnson
2024-06-28  3:19     ` Aaradhana Sahu
2024-07-02 10:18   ` Kalle Valo
2024-07-02 13:49   ` Kalle Valo
2024-06-24  9:53 ` [PATCH v5 4/4] wifi: ath12k: Fill pdev id for fw test cmd Aaradhana Sahu
2024-06-25 18:44   ` Jeff Johnson
2025-01-09  4:43 ` [PATCH v5 0/4] wifi: ath12k: Factory test mode support Aaradhana Sahu
2025-01-09  4:55   ` Aditya Kumar Singh
2025-01-09  5:29     ` Jeff Johnson
2025-01-09 12:54       ` Kalle Valo
2025-01-09 13:15         ` Aaradhana Sahu
2025-01-09 20:53           ` Jeff Johnson
2025-01-09 13:14       ` Aaradhana Sahu
2025-01-09 13:13     ` Aaradhana Sahu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).