Skip to content

Commit 05337d0

Browse files
Aaradhana Sahujeff-t-johnson
authored andcommitted
wifi: ath12k: add hardware parameters for maximum supported clients
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>
1 parent 47809a7 commit 05337d0

2 files changed

Lines changed: 52 additions & 3 deletions

File tree

  • drivers/net/wireless/ath/ath12k

drivers/net/wireless/ath/ath12k/hw.h

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,28 @@
1919
#define TARGET_NUM_VDEVS(ab) ((ab)->profile_param->num_vdevs)
2020

2121
/* Max num of stations for Single Radio mode */
22-
#define TARGET_NUM_STATIONS_SINGLE(ab) ((ab)->profile_param->max_client_single)
22+
#define TARGET_NUM_STATIONS_SINGLE(ab) \
23+
({ \
24+
typeof(ab) _ab = (ab); \
25+
min_not_zero(_ab->hw_params->client.max_client_single, \
26+
_ab->profile_param->max_client_single); \
27+
})
2328

2429
/* Max num of stations for DBS */
25-
#define TARGET_NUM_STATIONS_DBS(ab) ((ab)->profile_param->max_client_dbs)
30+
#define TARGET_NUM_STATIONS_DBS(ab) \
31+
({ \
32+
typeof(ab) _ab = (ab); \
33+
min_not_zero(_ab->hw_params->client.max_client_dbs, \
34+
_ab->profile_param->max_client_dbs); \
35+
})
2636

2737
/* Max num of stations for DBS_SBS */
2838
#define TARGET_NUM_STATIONS_DBS_SBS(ab) \
29-
((ab)->profile_param->max_client_dbs_sbs)
39+
({ \
40+
typeof(ab) _ab = (ab); \
41+
min_not_zero(_ab->hw_params->client.max_client_dbs_sbs, \
42+
_ab->profile_param->max_client_dbs_sbs); \
43+
})
3044

3145
#define TARGET_NUM_STATIONS(ab, x) TARGET_NUM_STATIONS_##x(ab)
3246

@@ -213,6 +227,11 @@ struct ath12k_hw_params {
213227

214228
/* setup REO queue, frag etc only for primary link peer */
215229
bool dp_primary_link_only:1;
230+
struct {
231+
u32 max_client_single;
232+
u32 max_client_dbs;
233+
u32 max_client_dbs_sbs;
234+
} client;
216235
};
217236

218237
struct ath12k_hw_ops {

drivers/net/wireless/ath/ath12k/wifi7/hw.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
434434
.current_cc_support = false,
435435

436436
.dp_primary_link_only = true,
437+
.client = {
438+
.max_client_single = 512,
439+
.max_client_dbs = 128,
440+
.max_client_dbs_sbs = 128,
441+
},
437442
},
438443
{
439444
.name = "wcn7850 hw2.0",
@@ -520,6 +525,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
520525
.current_cc_support = true,
521526

522527
.dp_primary_link_only = false,
528+
.client = {
529+
.max_client_single = 512,
530+
.max_client_dbs = 128,
531+
.max_client_dbs_sbs = 128,
532+
},
523533
},
524534
{
525535
.name = "qcn9274 hw2.0",
@@ -602,6 +612,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
602612
.current_cc_support = false,
603613

604614
.dp_primary_link_only = true,
615+
.client = {
616+
.max_client_single = 512,
617+
.max_client_dbs = 128,
618+
.max_client_dbs_sbs = 128,
619+
},
605620
},
606621
{
607622
.name = "ipq5332 hw1.0",
@@ -677,6 +692,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
677692
.bdf_addr_offset = 0xC00000,
678693

679694
.dp_primary_link_only = true,
695+
.client = {
696+
.max_client_single = 256,
697+
.max_client_dbs = 128,
698+
.max_client_dbs_sbs = 128,
699+
},
680700
},
681701
{
682702
.name = "qcc2072 hw1.0",
@@ -764,6 +784,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
764784
.current_cc_support = true,
765785

766786
.dp_primary_link_only = false,
787+
.client = {
788+
.max_client_single = 512,
789+
.max_client_dbs = 128,
790+
.max_client_dbs_sbs = 128,
791+
},
767792
},
768793
{
769794
.name = "ipq5424 hw1.0",
@@ -843,6 +868,11 @@ static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = {
843868
.current_cc_support = false,
844869

845870
.dp_primary_link_only = true,
871+
.client = {
872+
.max_client_single = 512,
873+
.max_client_dbs = 128,
874+
.max_client_dbs_sbs = 128,
875+
},
846876
},
847877
};
848878

0 commit comments

Comments
 (0)