ath11k: Change qcn9074 fw to operate in mode-2
v3 cover ath11k: Change qcn9074 fw to operate in mode-2
From: Kalle Valo <[email protected]>
Use firmware mode 2 with QCN9074 to reduce host memory usage. Please review.
Kalle
v3:
* new patch: ath11k: add ab to TARGET_NUM_VDEVS & co
* remove now unused ATH11K_QMI_TARGET_MEM_MODE_DEFAULT
Kalle Valo (1):
ath11k: add ab to TARGET_NUM_VDEVS & co
Seevalamuthu Mariappan (1):
ath11k: Change qcn9074 fw to operate in mode-2
drivers/net/wireless/ath/ath11k/core.c | 20 +++++++++++++++++++- drivers/net/wireless/ath/ath11k/hw.c | 14 +++++++------- drivers/net/wireless/ath/ath11k/hw.h | 21 ++++++++++++--------- drivers/net/wireless/ath/ath11k/mac.c | 10 +++++----- drivers/net/wireless/ath/ath11k/qmi.c | 2 +- drivers/net/wireless/ath/ath11k/qmi.h | 1 - 6 files changed, 44 insertions(+), 24 deletions(-)
base-commit: a3d88d337890f66f594ae06cedc1adeb5d5f8f31
Signature · 1 line
2.20.1
PATCH v3 1/2 ath11k: add ab to TARGET_NUM_VDEVS & co
From: Kalle Valo <[email protected]>
The next patch changes TARGET_NUM_VDEVS to be dynamic and need access to ab. Add ab separately to keep the next patch simple.
Compile tested only.
--- drivers/net/wireless/ath/ath11k/core.c | 2 +- drivers/net/wireless/ath/ath11k/hw.c | 14 +++++++------- drivers/net/wireless/ath/ath11k/hw.h | 18 +++++++++--------- drivers/net/wireless/ath/ath11k/mac.c | 10 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-)
drivers/net/wireless/ath/ath11k/core.c +1 -1
@@ -1067,7 +1067,7 @@ static int ath11k_core_reconfigure_on_crash(struct ath11k_base *ab)ath11k_dp_free (ab);ath11k_hal_srng_deinit (ab); - ab->free_vdev_map = (1LL << (ab->num_radios *TARGET_NUM_VDEVS )) -1 ; + ab->free_vdev_map = (1LL << (ab->num_radios *TARGET_NUM_VDEVS (ab))) -1 ; ret =ath11k_hal_srng_init (ab);if (ret)
drivers/net/wireless/ath/ath11k/hw.c +7 -7
@@ -150,18 +150,18 @@ static void ath11k_hw_ipq8074_reo_setup(struct ath11k_base *ab)static void ath11k_init_wmi_config_ipq8074 (struct ath11k_base *ab,struct target_resource_config *config) { - config->num_vdevs = ab->num_radios *TARGET_NUM_VDEVS ; + config->num_vdevs = ab->num_radios *TARGET_NUM_VDEVS (ab);if (ab->num_radios ==2 ) { - config->num_peers =TARGET_NUM_PEERS (DBS ); - config->num_tids =TARGET_NUM_TIDS (DBS ); + config->num_peers =TARGET_NUM_PEERS (ab,DBS ); + config->num_tids =TARGET_NUM_TIDS (ab,DBS ); }else if (ab->num_radios ==3 ) { - config->num_peers =TARGET_NUM_PEERS (DBS_SBS ); - config->num_tids =TARGET_NUM_TIDS (DBS_SBS ); + config->num_peers =TARGET_NUM_PEERS (ab,DBS_SBS ); + config->num_tids =TARGET_NUM_TIDS (ab,DBS_SBS ); }else {/* Control should not reach here */ - config->num_peers =TARGET_NUM_PEERS (SINGLE ); - config->num_tids =TARGET_NUM_TIDS (SINGLE ); + config->num_peers =TARGET_NUM_PEERS (ab,SINGLE ); + config->num_tids =TARGET_NUM_TIDS (ab,SINGLE ); } config->num_offload_peers =TARGET_NUM_OFFLD_PEERS ; config->num_offload_reorder_buffs =TARGET_NUM_OFFLD_REORDER_BUFFS ;
drivers/net/wireless/ath/ath11k/hw.h +9 -9
@@ -12,26 +12,26 @@/* Target configuration defines */ /* Num VDEVS per radio */ -#define TARGET_NUM_VDEVS (16 + 1) +#define TARGET_NUM_VDEVS (ab) (16 + 1) -#define TARGET_NUM_PEERS_PDEV (512 + TARGET_NUM_VDEVS) +#define TARGET_NUM_PEERS_PDEV (ab) (512 + TARGET_NUM_VDEVS(ab))/* Num of peers for Single Radio mode */ -#define TARGET_NUM_PEERS_SINGLE (TARGET_NUM_PEERS_PDEV) +#define TARGET_NUM_PEERS_SINGLE (ab) (TARGET_NUM_PEERS_PDEV(ab))/* Num of peers for DBS */ -#define TARGET_NUM_PEERS_DBS (2 * TARGET_NUM_PEERS_PDEV) +#define TARGET_NUM_PEERS_DBS (ab) (2 * TARGET_NUM_PEERS_PDEV(ab))/* Num of peers for DBS_SBS */ -#define TARGET_NUM_PEERS_DBS_SBS (3 * TARGET_NUM_PEERS_PDEV) +#define TARGET_NUM_PEERS_DBS_SBS (ab) (3 * TARGET_NUM_PEERS_PDEV(ab))/* Max num of stations (per radio) */ -#define TARGET_NUM_STATIONS 512 +#define TARGET_NUM_STATIONS (ab) 512 -#define TARGET_NUM_PEERS (x) TARGET_NUM_PEERS_##x +#define TARGET_NUM_PEERS (ab, x) TARGET_NUM_PEERS_##x(ab)#define TARGET_NUM_PEER_KEYS 2 -#define TARGET_NUM_TIDS (x) (2 * TARGET_NUM_PEERS(x) + \ - 4 * TARGET_NUM_VDEVS + 8) +#define TARGET_NUM_TIDS (ab, x) (2 * TARGET_NUM_PEERS(ab, x) + \ + 4 * TARGET_NUM_VDEVS(ab) + 8)#define TARGET_AST_SKID_LIMIT 16#define TARGET_NUM_OFFLD_PEERS 4
drivers/net/wireless/ath/ath11k/mac.c +5 -5
@@ -5980,9 +5980,9 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, goto err; } -if (ar->num_created_vdevs > (TARGET_NUM_VDEVS -1 )) { +if (ar->num_created_vdevs > (TARGET_NUM_VDEVS (ab) -1 )) {ath11k_warn (ab,"failed to create vdev %u, reached max vdev limit %d\n" , - ar->num_created_vdevs,TARGET_NUM_VDEVS ); + ar->num_created_vdevs,TARGET_NUM_VDEVS (ab)); ret = -EBUSY ; goto err; }
@@ -8178,8 +8178,8 @@ static int __ath11k_mac_register(struct ath11k *ar) ar->hw->wiphy->features |=NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE |NL80211_FEATURE_AP_SCAN ; - ar->max_num_stations =TARGET_NUM_STATIONS ; - ar->max_num_peers =TARGET_NUM_PEERS_PDEV ; + ar->max_num_stations =TARGET_NUM_STATIONS (ab); + ar->max_num_peers =TARGET_NUM_PEERS_PDEV (ab); ar->hw->wiphy->max_ap_assoc_sta = ar->max_num_stations;
@@ -8277,7 +8277,7 @@ int ath11k_mac_register(struct ath11k_base *ab)/* Initialize channel counters frequency value in hertz */ ab->cc_freq_hz =IPQ8074_CC_FREQ_HERTZ ; - ab->free_vdev_map = (1LL << (ab->num_radios *TARGET_NUM_VDEVS )) -1 ; + ab->free_vdev_map = (1LL << (ab->num_radios *TARGET_NUM_VDEVS (ab))) -1 ;for (i =0 ; i < ab->num_radios; i++) { pdev = &ab->pdevs[i];
Signature · 1 line
2.20.1
Re: [PATCH v3 1/2] ath11k: add ab to TARGET_NUM_VDEVS & co
Quoted 6 lines · Kalle Valo
The next patch changes
TARGET_NUM_VDEVSto be dynamic and need access to ab. Add ab separately to keep the next patch simple.Compile tested only.
Signed-off-by Kalle Valo <[email protected]>
2 patches applied to ath-next branch of ath.git, thanks.
523aafd0f071 ath11k: add ab to TARGET_NUM_VDEVS & co beefee71336b ath11k: Change qcn9074 fw to operate in mode-2
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
PATCH v3 2/2 ath11k: Change qcn9074 fw to operate in mode-2
In reply to Kalle ValoFrom: Seevalamuthu Mariappan <[email protected]>
In mode-2 QCN9074 firmware uses 15MB of host memory and firmware request 1MB size segements in QMI, whereas in mode-0 firmware uses 45MB of host memory and each segment is of 2MB size. In mode-2 firmware operates with reduced number of vdevs and peers.
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01838-QCAHKSWPL_SILICONZ-1
Patchwork-Id: 12664445
--- drivers/net/wireless/ath/ath11k/core.c | 18 ++++++++++++++++++ drivers/net/wireless/ath/ath11k/hw.h | 9 ++++++--- drivers/net/wireless/ath/ath11k/qmi.c | 2 +- drivers/net/wireless/ath/ath11k/qmi.h | 1 - 4 files changed, 25 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/core.c +18 -0
@@ -79,6 +79,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .idle_ps = false, .supports_sta_ps = false, .cold_boot_calib = true, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, + .num_peers = 512, .supports_suspend = false, .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .fix_l1ss = true,
@@ -134,6 +137,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .idle_ps = false, .supports_sta_ps = false, .cold_boot_calib = true, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, + .num_peers = 512, .supports_suspend = false, .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .fix_l1ss = true,
@@ -188,6 +194,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .idle_ps = true, .supports_sta_ps = true, .cold_boot_calib = false, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, + .num_peers = 512, .supports_suspend = true, .hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074), .fix_l1ss = true,
@@ -242,6 +251,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .idle_ps = false, .supports_sta_ps = false, .cold_boot_calib = false, + .fw_mem_mode = 2, + .num_vdevs = 8, + .num_peers = 128, .supports_suspend = false, .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), .fix_l1ss = true,
@@ -296,6 +308,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .idle_ps = true, .supports_sta_ps = true, .cold_boot_calib = false, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, + .num_peers = 512, .supports_suspend = true, .hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855), .fix_l1ss = false,
@@ -349,6 +364,9 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { .idle_ps = true, .supports_sta_ps = true, .cold_boot_calib = false, + .fw_mem_mode = 0, + .num_vdevs = 16 + 1, + .num_peers = 512, .supports_suspend = true, .hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855), .fix_l1ss = false,
drivers/net/wireless/ath/ath11k/hw.h +6 -3
@@ -12,9 +12,9 @@/* Target configuration defines */ /* Num VDEVS per radio */ -#define TARGET_NUM_VDEVS (ab) (16 + 1) +#define TARGET_NUM_VDEVS (ab) (ab->hw_params.num_vdevs) -#define TARGET_NUM_PEERS_PDEV (ab) (512 + TARGET_NUM_VDEVS(ab)) +#define TARGET_NUM_PEERS_PDEV (ab) (ab->hw_params.num_peers + TARGET_NUM_VDEVS(ab))/* Num of peers for Single Radio mode */ #define TARGET_NUM_PEERS_SINGLE (ab) (TARGET_NUM_PEERS_PDEV(ab))
@@ -26,7 +26,7 @@#define TARGET_NUM_PEERS_DBS_SBS (ab) (3 * TARGET_NUM_PEERS_PDEV(ab))/* Max num of stations (per radio) */ -#define TARGET_NUM_STATIONS (ab) 512 +#define TARGET_NUM_STATIONS (ab) (ab->hw_params.num_peers)#define TARGET_NUM_PEERS (ab, x) TARGET_NUM_PEERS_##x(ab)#define TARGET_NUM_PEER_KEYS 2
@@ -173,6 +173,9 @@ struct ath11k_hw_params {bool idle_ps;bool supports_sta_ps;bool cold_boot_calib; +int fw_mem_mode; +u32 num_vdevs; +u32 num_peers;bool supports_suspend;u32 hal_desc_sz;bool fix_l1ss;
drivers/net/wireless/ath/ath11k/qmi.c +1 -1
@@ -2830,7 +2830,7 @@ int ath11k_qmi_init_service(struct ath11k_base *ab)memset (&ab->qmi.target_mem,0 ,sizeof (struct target_mem_chunk )); ab->qmi.ab = ab; - ab->qmi.target_mem_mode =ATH11K_QMI_TARGET_MEM_MODE_DEFAULT ; + ab->qmi.target_mem_mode = ab->hw_params.fw_mem_mode; ret =qmi_handle_init (&ab->qmi.handle,ATH11K_QMI_RESP_LEN_MAX , &ath11k_qmi_ops, ath11k_qmi_msg_handlers);if (ret <0 ) {
drivers/net/wireless/ath/ath11k/qmi.h +0 -1
@@ -34,7 +34,6 @@#define QMI_WLANFW_MAX_DATA_SIZE_V01 6144#define ATH11K_FIRMWARE_MODE_OFF 4 -#define ATH11K_QMI_TARGET_MEM_MODE_DEFAULT 0#define ATH11K_COLD_BOOT_FW_RESET_DELAY (40 * HZ)struct ath11k_base ;
Signature · 1 line
2.20.1