]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: ath12k: add hardware parameters for maximum supported clients
authorAaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
Fri, 15 May 2026 03:09:09 +0000 (08:39 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 1 Jun 2026 16:58:04 +0000 (09:58 -0700)
Currently, the driver uses memory profile parameters to determine the
maximum number of supported clients, with a default limit of 512 for
single-radio and 128 for DBS and DBS+SBS configurations. However,
some devices have lower hardware limits depending on the radio
configuration. Exceeding these hardware-specific limits can lead to
firmware crashes.

Add hardware parameters in ath12k_hw_params to define the maximum supported
clients for each radio configuration. The driver uses the minimum of the
memory profile limit and the hardware capability limit to prevent exceeding
hardware constraints.

Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.6-01275-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20260515030909.3312511-1-aaradhana.sahu@oss.qualcomm.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/hw.h
drivers/net/wireless/ath/ath12k/wifi7/hw.c

index a9888e0521a1d1469bc980bdddeeee0a66c9b94d..d135b29363788b9aa5d7b4caa3ac901fe7e215b3 100644 (file)
 #define TARGET_NUM_VDEVS(ab)    ((ab)->profile_param->num_vdevs)
 
 /* Max num of stations for Single Radio mode */
-#define TARGET_NUM_STATIONS_SINGLE(ab) ((ab)->profile_param->max_client_single)
+#define TARGET_NUM_STATIONS_SINGLE(ab) \
+({ \
+       typeof(ab) _ab = (ab); \
+       min_not_zero(_ab->hw_params->client.max_client_single, \
+                    _ab->profile_param->max_client_single); \
+})
 
 /* Max num of stations for DBS */
-#define TARGET_NUM_STATIONS_DBS(ab)    ((ab)->profile_param->max_client_dbs)
+#define TARGET_NUM_STATIONS_DBS(ab) \
+({ \
+       typeof(ab) _ab = (ab); \
+       min_not_zero(_ab->hw_params->client.max_client_dbs, \
+                    _ab->profile_param->max_client_dbs); \
+})
 
 /* Max num of stations for DBS_SBS */
 #define TARGET_NUM_STATIONS_DBS_SBS(ab) \
-       ((ab)->profile_param->max_client_dbs_sbs)
+({ \
+       typeof(ab) _ab = (ab); \
+       min_not_zero(_ab->hw_params->client.max_client_dbs_sbs, \
+                    _ab->profile_param->max_client_dbs_sbs); \
+})
 
 #define TARGET_NUM_STATIONS(ab, x)     TARGET_NUM_STATIONS_##x(ab)
 
@@ -213,6 +227,11 @@ struct ath12k_hw_params {
 
        /* setup REO queue, frag etc only for primary link peer */
        bool dp_primary_link_only:1;
+       struct {
+               u32 max_client_single;
+               u32 max_client_dbs;
+               u32 max_client_dbs_sbs;
+       } client;
 };
 
 struct ath12k_hw_ops {
index cb3185850439eef0cec89a73ebbb85ffe65658c2..98bf9293dd33d0101b00e889b23de623156f694c 100644 (file)
@@ -434,6 +434,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
                .current_cc_support = false,
 
                .dp_primary_link_only = true,
+               .client = {
+                       .max_client_single = 512,
+                       .max_client_dbs = 128,
+                       .max_client_dbs_sbs = 128,
+               },
        },
        {
                .name = "wcn7850 hw2.0",
@@ -520,6 +525,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
                .current_cc_support = true,
 
                .dp_primary_link_only = false,
+               .client = {
+                       .max_client_single = 512,
+                       .max_client_dbs = 128,
+                       .max_client_dbs_sbs = 128,
+               },
        },
        {
                .name = "qcn9274 hw2.0",
@@ -602,6 +612,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
                .current_cc_support = false,
 
                .dp_primary_link_only = true,
+               .client = {
+                       .max_client_single = 512,
+                       .max_client_dbs = 128,
+                       .max_client_dbs_sbs = 128,
+               },
        },
        {
                .name = "ipq5332 hw1.0",
@@ -677,6 +692,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
                .bdf_addr_offset = 0xC00000,
 
                .dp_primary_link_only = true,
+               .client = {
+                       .max_client_single = 256,
+                       .max_client_dbs = 128,
+                       .max_client_dbs_sbs = 128,
+               },
        },
        {
                .name = "qcc2072 hw1.0",
@@ -764,6 +784,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
                .current_cc_support = true,
 
                .dp_primary_link_only = false,
+               .client = {
+                       .max_client_single = 512,
+                       .max_client_dbs = 128,
+                       .max_client_dbs_sbs = 128,
+               },
        },
        {
                .name = "ipq5424 hw1.0",
@@ -843,6 +868,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
                .current_cc_support = false,
 
                .dp_primary_link_only = true,
+               .client = {
+                       .max_client_single = 512,
+                       .max_client_dbs = 128,
+                       .max_client_dbs_sbs = 128,
+               },
        },
 };