wlan-ap-Telecominfraproject/feeds/ipq95xx/mac80211/patches/qca/657-ath12k-add-module-param-to-enable-disable-MLO.patch
John Crispin 144c5d00f4 ipq95xx/mac80211: update to ATH12.3-CS
Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

75 lines
2.7 KiB
Diff

From 49330b81c47943eb75009f5649ac189e3ff3a95b Mon Sep 17 00:00:00 2001
From: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Date: Fri, 12 Aug 2022 06:49:55 +0530
Subject: [PATCH] ath12k: add module param to enable/disable MLO
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
---
drivers/net/wireless/ath/ath12k/core.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -31,6 +31,10 @@ module_param_named(frame_mode, ath12k_fr
MODULE_PARM_DESC(frame_mode,
"Datapath frame mode (0: raw, 1: native wifi (default), 2: ethernet)");
+unsigned int ath12k_mlo_capable = true;
+module_param_named(mlo_capable, ath12k_mlo_capable, uint, 0644);
+MODULE_PARM_DESC(mlo_capable, "mlo capable: 0-disable, 1-enable");
+
static DEFINE_MUTEX(ath12k_hw_lock);
static struct list_head ath12k_hw_groups = LIST_HEAD_INIT(ath12k_hw_groups);
@@ -126,14 +130,14 @@ ath12k_core_hw_group_alloc(u8 id, u8 max
static struct ath12k_hw_group *ath12k_core_get_hw_group(struct ath12k_base *ab)
{
struct ath12k_hw_group *ag = NULL;
- struct device_node *mlo = NULL;
+ struct device_node *mlo;
struct device *dev = ab->dev;
u32 group_id, num_chips;
int ret;
lockdep_assert_held(&ath12k_hw_lock);
- /* If there is no grouping info in the dt, we don't enalbe
+ /* If there is no grouping info in the dt, we don't enable
* multi soc hw grouping and registration, rather the single
* soc is added to hw group and based on the number of links
* within the soc, all links are combined into a single wiphy.
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -40,6 +40,7 @@
#define ATH12K_RX_RATE_TABLE_11AX_NUM 576
extern unsigned int ath12k_frame_mode;
+extern unsigned int ath12k_mlo_capable;
#define ATH12K_MON_TIMER_INTERVAL 10
#define ATH12K_RESET_TIMEOUT_HZ (20 * HZ)
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -11242,15 +11242,14 @@ int ath12k_mac_allocate(struct ath12k_hw
for (i = 0; i < ag->num_chip; i++)
total_radio += ag->ab[i]->num_radios;
- /* Each pdev get register separately in the default
- * (ATH12K_INVALID_GRP_ID) group.
- * where as in other group, all pdev get combined in
- * register as single wiphy.
+ /* All pdev get combined and register as single wiphy in the non-invalid
+ * group where also multi-link is enabled. where as in other group,
+ * each pdev get register separately.
*/
- if (ag->id == ATH12K_INVALID_GRP_ID)
- num_radios = 1;
- else
+ if (ag->id != ATH12K_INVALID_GRP_ID && ath12k_mlo_capable)
num_radios = total_radio;
+ else
+ num_radios = 1;
num_hw = total_radio / num_radios;