From: Kalle Valo <kvalo@kernel.org>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 6/7] wifi: ath12k: assign unique hardware link IDs during QMI host cap
Date: Wed, 11 Dec 2024 17:43:57 +0200 [thread overview]
Message-ID: <20241211154358.776279-7-kvalo@kernel.org> (raw)
In-Reply-To: <20241211154358.776279-1-kvalo@kernel.org>
From: Aditya Kumar Singh <quic_adisi@quicinc.com>
Currently, in the QMI host capability, the device index, the number of local
links, and the corresponding hardware link IDs are sent. The hardware link ID
assignment is based on the local variable `hw_link_id`, which starts from 0 and
ranges up to `num_local_links` in the device. Starting from 0 is not ideal
because it can result in the same link ID being assigned to different devices
in certain scenarios (e.g., split MAC). Additionally, for multi link
operations the firmware expects the hardware link IDs in the same order as the
Wireless Serial Interface (WSI) connection.
Hence, for MLO to function seamlessly, the hardware link IDs across devices
need to be unique and should follow the order of the WSI connection. To address
this, a previous change read the WSI index from the Device Tree (DT) and stored
it. Use this WSI index to determine the starting hardware link IDs for each
device, ensuring uniqueness and correct order across all devices.
While at it, add debug prints to clearly show the MLO capability advertisement
sent during QMI host capability exchange.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Co-developed-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
---
drivers/net/wireless/ath/ath12k/core.h | 2 ++
drivers/net/wireless/ath/ath12k/qmi.c | 35 +++++++++++++++++++++++++-
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index 9aed24597548..d07b54f441c3 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -863,11 +863,13 @@ struct ath12k_hw_group {
struct device_node *wsi_node[ATH12K_MAX_SOCS];
struct ath12k_mlo_memory mlo_mem;
struct ath12k_hw_link hw_links[ATH12K_GROUP_MAX_RADIO];
+ bool hw_link_id_init_done;
};
/* Holds WSI info specific to each device, excluding WSI group info */
struct ath12k_wsi_info {
u32 index;
+ u32 hw_link_id_base;
};
/* Master structure to hold the hw data which may be used in core module */
diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
index 964d350be748..a8ed86a294c3 100644
--- a/drivers/net/wireless/ath/ath12k/qmi.c
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
@@ -2016,6 +2016,30 @@ static const struct qmi_elem_info qmi_wlanfw_wlan_ini_resp_msg_v01_ei[] = {
},
};
+static void ath12k_host_cap_hw_link_id_init(struct ath12k_hw_group *ag)
+{
+ struct ath12k_base *ab, *partner_ab;
+ int i, j, hw_id_base;
+
+ for (i = 0; i < ag->num_devices; i++) {
+ hw_id_base = 0;
+ ab = ag->ab[i];
+
+ for (j = 0; j < ag->num_devices; j++) {
+ partner_ab = ag->ab[j];
+
+ if (partner_ab->wsi_info.index >= ab->wsi_info.index)
+ continue;
+
+ hw_id_base += partner_ab->qmi.num_radios;
+ }
+
+ ab->wsi_info.hw_link_id_base = hw_id_base;
+ }
+
+ ag->hw_link_id_init_done = true;
+}
+
static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab,
struct qmi_wlanfw_host_cap_req_msg_v01 *req)
{
@@ -2059,8 +2083,14 @@ static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab,
req->mlo_num_chips_valid = 1;
req->mlo_num_chips = ag->num_devices;
+ ath12k_dbg(ab, ATH12K_DBG_QMI, "mlo capability advertisement device_id %d group_id %d num_devices %d",
+ req->mlo_chip_id, req->mlo_group_id, req->mlo_num_chips);
+
mutex_lock(&ag->mutex);
+ if (!ag->hw_link_id_init_done)
+ ath12k_host_cap_hw_link_id_init(ag);
+
for (i = 0; i < ag->num_devices; i++) {
info = &req->mlo_chip_info[i];
partner_ab = ag->ab[i];
@@ -2078,9 +2108,12 @@ static int ath12k_host_cap_parse_mlo(struct ath12k_base *ab,
info->chip_id, info->num_local_links);
for (j = 0; j < info->num_local_links; j++) {
- info->hw_link_id[j] = hw_link_id;
+ info->hw_link_id[j] = partner_ab->wsi_info.hw_link_id_base + j;
info->valid_mlo_link_id[j] = 1;
+ ath12k_dbg(ab, ATH12K_DBG_QMI, "mlo hw_link_id %d\n",
+ info->hw_link_id[j]);
+
hw_link_id++;
}
}
--
2.39.5
next prev parent reply other threads:[~2024-12-11 15:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 15:43 [PATCH 0/7] wifi: ath12k: MLO support part 9/9 Kalle Valo
2024-12-11 15:43 ` [PATCH 1/7] wifi: ath12k: symmetrize scan vdev creation and deletion during HW scan Kalle Valo
2024-12-11 15:43 ` [PATCH 2/7] wifi: ath12k: add can_activate_links mac operation Kalle Valo
2024-12-11 15:43 ` [PATCH 3/7] wifi: ath12k: add no-op without debug print in WMI Rx event Kalle Valo
2024-12-11 15:43 ` [PATCH 4/7] wifi: ath12k: remove warning print in htt mlo offset event message Kalle Valo
2024-12-11 15:43 ` [PATCH 5/7] wifi: ath12k: add ATH12K_FW_FEATURE_MLO capability firmware feature Kalle Valo
2024-12-11 15:43 ` Kalle Valo [this message]
2024-12-11 15:43 ` [PATCH 7/7] wifi: ath12k: advertise MLO support and capabilities Kalle Valo
2024-12-16 16:51 ` [PATCH 0/7] wifi: ath12k: MLO support part 9/9 Jeff Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241211154358.776279-7-kvalo@kernel.org \
--to=kvalo@kernel.org \
--cc=ath12k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).