Skip to contentSkip to conversation

ath10k: add ATH10K_FW_IE_HTT_OP_VERSION

PATCH Applied Kalle Valo 1 participant 4 messages Mar 25, 2015 – Mar 30, 2015 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore

Kalle Valo

author
#0 lore raw

v2 cover ath10k: add ATH10K_FW_IE_HTT_OP_VERSION

My proposal how to solve the differences between HTT interfaces by adding ATH10K_FW_IE_HTT_OP_VERSION. Based on Rajkumar's "ath10k: fix htt t2h message conflicts among firmware revisions", I just added the new IE and bumped up the FW API.

For now only compile tested, I will run proper tests later.

---

Kalle Valo (1):
ath10k: bump up FW API to 5

Rajkumar Manoharan (1):

      ath10k: add ATH10K_FW_IE_HTT_OP_VERSION
 drivers/net/wireless/ath/ath10k/core.c   |   18 ++++
 drivers/net/wireless/ath/ath10k/htt.c    |   98 +++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/htt.h    |  130 ++++++++++++++++++++++++------
 drivers/net/wireless/ath/ath10k/htt_rx.c |   20 +++--
 drivers/net/wireless/ath/ath10k/hw.h     |   22 +++++
 drivers/net/wireless/ath/ath10k/pci.c    |    1 
 6 files changed, 256 insertions(+), 33 deletions(-)
author
#1 lore raw

PATCH v2 1/2 ath10k: add ATH10K_FW_IE_HTT_OP_VERSION

From: Rajkumar Manoharan <[email protected]>

Target to host HTT messages are conflicting between 10.x and other firmware revisions. By maintaining separate HTT T2H tables for each firmware revisions (main, 10x and tlv) similar to WMI abstraction, solves the conflicts. Add ATH10K_FW_IE_HTT_OP_VERSION so that the firmware can advertise the HTT interface to ath10k.

This fix is needed to get management frames over HTT (ie. ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX disabled) working with 10.2.4.48-2 firmware. Otherwise there will be unknown htt events and nothing works:

[30087.438343] ath10k_pci 0000:02:00.0: htt event (19) not handled
[30087.448691] ath10k_pci 0000:02:00.0: htt event (19) not handled
[30149.032974] ath10k_pci 0000:02:00.0: htt event (19) not handled

If the firmware does not have ATH10K_FW_IE_HTT_OP_VERSION use the main HTT interface. That way old firmware images will still work.

---
 drivers/net/wireless/ath/ath10k/core.c   |   11 +++
 drivers/net/wireless/ath/ath10k/htt.c    |   98 +++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/htt.h    |  130 ++++++++++++++++++++++++------
 drivers/net/wireless/ath/ath10k/htt_rx.c |   20 +++--
 drivers/net/wireless/ath/ath10k/hw.h     |   19 ++++
 5 files changed, 245 insertions(+), 33 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +11 -0
index c0e454bb6a8d..f4f91b230af0 100644
@@ -675,6 +675,17 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name)
 			ath10k_dbg(ar, ATH10K_DBG_BOOT, "found fw ie wmi op version %d\n",
 				   ar->wmi.op_version);
 			break;
+		case ATH10K_FW_IE_HTT_OP_VERSION:
+			if (ie_len != sizeof(u32))
+				break;
+
+			version = (__le32 *)data;
+
+			ar->htt.op_version = le32_to_cpup(version);
+
+			ath10k_dbg(ar, ATH10K_DBG_BOOT, "found fw ie htt op version %d\n",
+				   ar->htt.op_version);
+			break;
 		default:
 			ath10k_warn(ar, "Unknown FW IE: %u\n",
 				    le32_to_cpu(hdr->id));
drivers/net/wireless/ath/ath10k/htt.c +98 -0

110 lines not on this page · raw message

drivers/net/wireless/ath/ath10k/htt.h +104 -26

151 lines not on this page · raw message

drivers/net/wireless/ath/ath10k/htt_rx.c +13 -7
index 01a2b384f358..21e92537dc50 100644
@@ -1892,6 +1892,7 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 {
 	struct ath10k_htt *htt = &ar->htt;
 	struct htt_resp *resp = (struct htt_resp *)skb->data;
+	enum htt_t2h_msg_type type;
 
 	/* confirm alignment */
 	if (!IS_ALIGNED((unsigned long)skb->data, 4))
@@ -1899,7 +1900,16 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 
 	ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx, msg_type: 0x%0X\n",
 		   resp->hdr.msg_type);
-	switch (resp->hdr.msg_type) {
+
+	if (resp->hdr.msg_type >= ar->htt.t2h_msg_types_max) {
+		ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx, unsupported msg_type: 0x%0X\n max: 0x%0X",
+			   resp->hdr.msg_type, ar->htt.t2h_msg_types_max);
+		dev_kfree_skb_any(skb);
+		return;
+	}
+	type = ar->htt.t2h_msg_types[resp->hdr.msg_type];
+
+	switch (type) {
 	case HTT_T2H_MSG_TYPE_VERSION_CONF: {
 		htt->target_version_major = resp->ver_resp.major;
 		htt->target_version_minor = resp->ver_resp.minor;
@@ -1976,7 +1986,6 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 		break;
 	}
 	case HTT_T2H_MSG_TYPE_TEST:
-		/* FIX THIS */
 		break;
 	case HTT_T2H_MSG_TYPE_STATS_CONF:
 		trace_ath10k_htt_stats(ar, skb->data, skb->len);
@@ -2018,11 +2027,8 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 		return;
 	}
 	case HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND:
-		/* FIXME: This WMI-TLV event is overlapping with 10.2
-		 * CHAN_CHANGE - both being 0xF. Neither is being used in
-		 * practice so no immediate action is necessary. Nevertheless
-		 * HTT may need an abstraction layer like WMI has one day.
-		 */
+		break;
+	case HTT_T2H_MSG_TYPE_CHAN_CHANGE:
 		break;
 	default:
 		ath10k_warn(ar, "htt event (%d) not handled\n",
drivers/net/wireless/ath/ath10k/hw.h +19 -0
index 7f0464541413..ec6eb401ea29 100644
@@ -104,6 +104,11 @@ enum ath10k_fw_ie_type {
 	 * FW API 4 and above.
 	 */
 	ATH10K_FW_IE_WMI_OP_VERSION = 5,
+
+	/* HTT "operations" interface version, 32 bit value. Supported from
+	 * FW API 5 and above.
+	 */
+	ATH10K_FW_IE_HTT_OP_VERSION = 6,
 };
 
 enum ath10k_fw_wmi_op_version {
@@ -119,6 +124,20 @@ enum ath10k_fw_wmi_op_version {
 	ATH10K_FW_WMI_OP_VERSION_MAX,
 };
 
+enum ath10k_fw_htt_op_version {
+	ATH10K_FW_HTT_OP_VERSION_UNSET = 0,
+
+	ATH10K_FW_HTT_OP_VERSION_MAIN = 1,
+
+	/* also used in 10.2 and 10.2.4 branches */
+	ATH10K_FW_HTT_OP_VERSION_10_1 = 2,
+
+	ATH10K_FW_HTT_OP_VERSION_TLV = 3,
+
+	/* keep last */
+	ATH10K_FW_HTT_OP_VERSION_MAX,
+};
+
 enum ath10k_hw_rev {
 	ATH10K_HW_QCA988X,
 	ATH10K_HW_QCA6174,
author
#2 lore raw

PATCH v2 2/2 ath10k: bump up FW API to 5

In reply to Kalle Valo

Firmware 10.2.4.48-3 now supports management frames over HTT feature and has ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX. But as 10.2.4 branch has conflicting HTT ids patch "ath10k: add ATH10K_FW_IE_HTT_OP_VERSION" is needed to fix the issue. Older ath10k versions don't have support that support and to maintain backwards compatibility we need bump up the FW API to 5 not break older versions.

---
 drivers/net/wireless/ath/ath10k/core.c |    7 +++++++
 drivers/net/wireless/ath/ath10k/hw.h   |    3 +++
 drivers/net/wireless/ath/ath10k/pci.c  |    1 +
 3 files changed, 11 insertions(+)
drivers/net/wireless/ath/ath10k/core.c +7 -0
index f4f91b230af0..81c02b566255 100644
@@ -741,6 +741,13 @@ static int ath10k_core_fetch_firmware_files(struct ath10k *ar)
 	/* calibration file is optional, don't check for any errors */
 	ath10k_fetch_cal_file(ar);
 
+	ar->fw_api = 5;
+	ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
+
+	ret = ath10k_core_fetch_firmware_api_n(ar, ATH10K_FW_API5_FILE);
+	if (ret == 0)
+		goto success;
+
 	ar->fw_api = 4;
 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "trying fw api %d\n", ar->fw_api);
 
drivers/net/wireless/ath/ath10k/hw.h +3 -0
index ec6eb401ea29..a40b7be010fa 100644
@@ -78,6 +78,9 @@ enum qca6174_chip_id_rev {
 /* added support for ATH10K_FW_IE_WMI_OP_VERSION */
 #define ATH10K_FW_API4_FILE		"firmware-4.bin"
 
+/* HTT id conflict fix for management frames over HTT */
+#define ATH10K_FW_API5_FILE		"firmware-5.bin"
+
 #define ATH10K_FW_UTF_FILE		"utf.bin"
 
 /* includes also the null byte */
drivers/net/wireless/ath/ath10k/pci.c +1 -0
index b4aacfad4b24..262a84f67f62 100644
@@ -2780,6 +2780,7 @@ MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_FW_FILE);
 MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API2_FILE);
 MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API3_FILE);
 MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API4_FILE);
+MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API5_FILE);
 MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_BOARD_DATA_FILE);
 
 /* QCA6174 2.1 firmware files */
author Applied
#3 lore raw
In reply to Kalle Valo
Quoted 7 lines · Kalle Valo

My proposal how to solve the differences between HTT interfaces by adding ATH10K_FW_IE_HTT_OP_VERSION. Based on Rajkumar's "ath10k: fix htt t2h message conflicts among firmware revisions", I just added the new IE and bumped up the FW API.

For now only compile tested, I will run proper tests later.

Quoted 7 lines

---

Kalle Valo (1):
ath10k: bump up FW API to 5

Rajkumar Manoharan (1):

      ath10k: add ATH10K_FW_IE_HTT_OP_VERSION

Applied.

Signature · 1 line
Kalle Valo