QCN9274 Ath12k chipset can support single-mac or dualmac architecture.
Currently, Ath12k driver supports only the single-mac QCN9274
architecture.
Hence, add support for dualmac QCN9274 chipset.
Depends-On: [v2] wifi: ath12k: add firmware-2.bin support
Aaradhana Sahu (1):
wifi: ath12k: fix firmware assert during insmod in memory segment mode
Ganesh Babu Jothiram (1):
wifi: ath12k: Read board id to support split-PHY QCN9274
Harshitha Prem (1):
wifi: ath12k: add support for peer meta data version
Karthikeyan Kathirvel (1):
wifi: ath12k: subscribe required word mask from rx tlv
Karthikeyan Periyasamy (1):
wifi: ath12k: add MAC id support in WBM error path
P Praneesh (2):
wifi: ath12k: Add logic to write QRTR node id to scratch
wifi: ath12k: fix PCI read and write
Raj Kumar Bhagat (4):
wifi: ath12k: fix fetching MCBC flag for QCN9274
wifi: ath12k: split hal_ops to support RX TLVs word mask compaction
wifi: ath12k: remove hal_desc_sz from hw params
wifi: ath12k: disable QMI PHY capability learn in split-phy QCN9274
Sowmiya Sree Elavalagan (1):
wifi: ath12k: fetch correct pdev id from WMI_SERVICE_READY_EXT_EVENTID
Sriram R (1):
wifi: ath12k: indicate NON MBSSID vdev by default during vdev start
---
v3:
- Added patch "wifi: ath12k: disable QMI PHY capability learn in
split-phy QCN9274" to avoid firmware crash.
- Tested on WCN7850
v2:
- dropped patch [1/13] - wifi: ath12k: Update enum wmi_direct_buffer_module
not required with FW version being used.
- defined enum wmi_vdev_mbssid_flags at proper place.
- implemented hal_ops to retrieve the corresponding compact ops.
---
drivers/net/wireless/ath/ath12k/core.c | 30 ++
drivers/net/wireless/ath/ath12k/core.h | 12 +
drivers/net/wireless/ath/ath12k/dp.c | 25 +-
drivers/net/wireless/ath/ath12k/dp.h | 17 +-
drivers/net/wireless/ath/ath12k/dp_mon.c | 5 +-
drivers/net/wireless/ath/ath12k/dp_rx.c | 158 ++++----
drivers/net/wireless/ath/ath12k/dp_tx.c | 20 ++
drivers/net/wireless/ath/ath12k/fw.c | 7 +
drivers/net/wireless/ath/ath12k/fw.h | 6 +
drivers/net/wireless/ath/ath12k/hal.c | 415 +++++++++++++++++++++-
drivers/net/wireless/ath/ath12k/hal.h | 20 +-
drivers/net/wireless/ath/ath12k/hw.c | 13 +-
drivers/net/wireless/ath/ath12k/hw.h | 30 +-
drivers/net/wireless/ath/ath12k/mac.c | 12 +-
drivers/net/wireless/ath/ath12k/mhi.c | 50 ++-
drivers/net/wireless/ath/ath12k/pci.c | 84 +++--
drivers/net/wireless/ath/ath12k/pci.h | 6 +-
drivers/net/wireless/ath/ath12k/qmi.c | 3 +
drivers/net/wireless/ath/ath12k/qmi.h | 1 -
drivers/net/wireless/ath/ath12k/rx_desc.h | 116 +++++-
drivers/net/wireless/ath/ath12k/wmi.c | 31 +-
drivers/net/wireless/ath/ath12k/wmi.h | 58 ++-
22 files changed, 949 insertions(+), 170 deletions(-)
base-commit: 17f4b952f067b1f87d14e6df4c8c216fe7a245d1
prerequisite-patch-id: 20d8782c4835d0a1e32c8cbc6ffca53a71603ed3
--
2.34.1
From: Aaradhana Sahu <[email protected]>
In segment memory mode, firmware allocates memory segments of size
2 MB. This 2 MB memory is used by firmware for the number of peers.
This number of peer is sent from host to firmware during WMI init
command. For single-phy the number of peers sent is
TARGET_NUM_PEERS_SINGLE = 529 (512 + 17). While for split-phy number
of peers sent to firmware is TARGET_NUM_PEERS_DBS = 2 *(512 + 17) =
1058. With this 1058 number of peers firmware is unable to allocate
memory in 2 MB segment and firmware crash is observed.
Hence, fix this firmware crash by reducing the number of stations
TARGET_NUM_STATIONS for split-phy.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00188-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-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: Aaradhana Sahu <[email protected]>
Co-developed-by: Raj Kumar Bhagat <[email protected]>
Signed-off-by: Raj Kumar Bhagat <[email protected]>
---
drivers/net/wireless/ath/ath12k/core.c | 27 ++++++++++++++++++++++++++
drivers/net/wireless/ath/ath12k/core.h | 3 +++
drivers/net/wireless/ath/ath12k/hw.h | 23 ++++++++++++++++------
drivers/net/wireless/ath/ath12k/mac.c | 4 ++--
drivers/net/wireless/ath/ath12k/wmi.c | 15 +++-----------
5 files changed, 52 insertions(+), 20 deletions(-)
diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
index 634a9ddc2fe5..7f0b395f1296 100644
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
@@ -510,6 +510,33 @@ int ath12k_core_fetch_regdb(struct ath12k_base *ab, struct ath12k_board_data *bd
return ret;
}
+u32 ath12k_core_get_max_station_per_radio(struct ath12k_base *ab)
+{
+ if (ab->num_radios == 2)
+ return TARGET_NUM_STATIONS_DBS;
+ else if (ab->num_radios == 3)
+ return TARGET_NUM_PEERS_PDEV_DBS_SBS;
+ return TARGET_NUM_STATIONS_SINGLE;
+}
+
+u32 ath12k_core_get_max_peers_per_radio(struct ath12k_base *ab)
+{
+ if (ab->num_radios == 2)
+ return TARGET_NUM_PEERS_PDEV_DBS;
+ else if (ab->num_radios == 3)
+ return TARGET_NUM_PEERS_PDEV_DBS_SBS;
+ return TARGET_NUM_PEERS_PDEV_SINGLE;
+}
+
+u32 ath12k_core_get_max_num_tids(struct ath12k_base *ab)
+{
+ if (ab->num_radios == 2)
+ return TARGET_NUM_TIDS(DBS);
+ else if (ab->num_radios == 3)
+ return TARGET_NUM_TIDS(DBS_SBS);
+ return TARGET_NUM_TIDS(SINGLE);
+}
+
static void ath12k_core_stop(struct ath12k_base *ab)
{
if (!test_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags))
diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
index fc906d7acd42..68b4031ac484 100644
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
@@ -869,6 +869,9 @@ int ath12k_core_suspend(struct ath12k_base *ab);
const struct firmware *ath12k_core_firmware_request(struct ath12k_base *ab,
const char *filename);
+u32 ath12k_core_get_max_station_per_radio(struct ath12k_base *ab);
+u32 ath12k_core_get_max_peers_per_radio(struct ath12k_base *ab);
+u32 ath12k_core_get_max_num_tids(struct ath12k_base *ab);
static inline const char *ath12k_scan_state_str(enum ath12k_scan_state state)
{
diff --git a/drivers/net/wireless/ath/ath12k/hw.h b/drivers/net/wireless/ath/ath12k/hw.h
index 44ba3a50e075..efa3411dc63d 100644
--- a/drivers/net/wireless/ath/ath12k/hw.h
+++ b/drivers/net/wireless/ath/ath12k/hw.h
@@ -17,19 +17,30 @@
/* Num VDEVS per radio */
#define TARGET_NUM_VDEVS (16 + 1)
-#define TARGET_NUM_PEERS_PDEV (512 + TARGET_NUM_VDEVS)
+#define TARGET_NUM_PEERS_PDEV_SINGLE (TARGET_NUM_STATIONS_SINGLE + \
+ TARGET_NUM_VDEVS)
+#define TARGET_NUM_PEERS_PDEV_DBS (TARGET_NUM_STATIONS_DBS + \
+ TARGET_NUM_VDEVS)
+#define TARGET_NUM_PEERS_PDEV_DBS_SBS (TARGET_NUM_STATIONS_DBS_SBS + \
+ TARGET_NUM_VDEVS)
/* Num of peers for Single Radio mode */
-#define TARGET_NUM_PEERS_SINGLE (TARGET_NUM_PEERS_PDEV)
+#define TARGET_NUM_PEERS_SINGLE (TARGET_NUM_PEERS_PDEV_SINGLE)
/* Num of peers for DBS */
-#define TARGET_NUM_PEERS_DBS (2 * TARGET_NUM_PEERS_PDEV)
+#define TARGET_NUM_PEERS_DBS (2 * TARGET_NUM_PEERS_PDEV_DBS)
/* Num of peers for DBS_SBS */
-#define TARGET_NUM_PEERS_DBS_SBS (3 * TARGET_NUM_PEERS_PDEV)
+#define TARGET_NUM_PEERS_DBS_SBS (3 * TARGET_NUM_PEERS_PDEV_DBS_SBS)
-/* Max num of stations (per radio) */
-#define TARGET_NUM_STATIONS 512
+/* Max num of stations for Single Radio mode */
+#define TARGET_NUM_STATIONS_SINGLE 512
+
+/* Max num of stations for DBS */
+#define TARGET_NUM_STATIONS_DBS 128
+
+/* Max num of stations for DBS_SBS */
+#define TARGET_NUM_STATIONS_DBS_SBS 128
#define TARGET_NUM_PEERS(x) TARGET_NUM_PEERS_##x
#define TARGET_NUM_PEER_KEYS 2
diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 672c9d347097..046bb466a391 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -7624,8 +7624,8 @@ static int ath12k_mac_setup_register(struct ath12k *ar,
ath12k_mac_setup_ht_vht_cap(ar, cap, ht_cap);
ath12k_mac_setup_sband_iftype_data(ar, cap);
- ar->max_num_stations = TARGET_NUM_STATIONS;
- ar->max_num_peers = TARGET_NUM_PEERS_PDEV;
+ ar->max_num_stations = ath12k_core_get_max_station_per_radio(ar->ab);
+ ar->max_num_peers = ath12k_core_get_max_peers_per_radio(ar->ab);
return 0;
}
diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index 276351d68efb..7fc269eb4a0c 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -179,18 +179,9 @@ void ath12k_wmi_init_qcn9274(struct ath12k_base *ab,
struct ath12k_wmi_resource_config_arg *config)
{
config->num_vdevs = ab->num_radios * TARGET_NUM_VDEVS;
-
- if (ab->num_radios == 2) {
- config->num_peers = TARGET_NUM_PEERS(DBS);
- config->num_tids = TARGET_NUM_TIDS(DBS);
- } else if (ab->num_radios == 3) {
- config->num_peers = TARGET_NUM_PEERS(DBS_SBS);
- config->num_tids = TARGET_NUM_TIDS(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 = ab->num_radios *
+ ath12k_core_get_max_peers_per_radio(ab);
+ config->num_tids = ath12k_core_get_max_num_tids(ab);
config->num_offload_peers = TARGET_NUM_OFFLD_PEERS;
config->num_offload_reorder_buffs = TARGET_NUM_OFFLD_REORDER_BUFFS;
config->num_peer_keys = TARGET_NUM_PEER_KEYS;
--
2.34.1
On 1/28/2024 10:57 PM, Raj Kumar Bhagat wrote:
> From: Aaradhana Sahu <[email protected]>
>
> In segment memory mode, firmware allocates memory segments of size
> 2 MB. This 2 MB memory is used by firmware for the number of peers.
> This number of peer is sent from host to firmware during WMI init
> command. For single-phy the number of peers sent is
> TARGET_NUM_PEERS_SINGLE = 529 (512 + 17). While for split-phy number
> of peers sent to firmware is TARGET_NUM_PEERS_DBS = 2 *(512 + 17) =
> 1058. With this 1058 number of peers firmware is unable to allocate
> memory in 2 MB segment and firmware crash is observed.
>
> Hence, fix this firmware crash by reducing the number of stations
> TARGET_NUM_STATIONS for split-phy.
>
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00188-QCAHKSWPL_SILICONZ-1
> Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-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: Aaradhana Sahu <[email protected]>
> Co-developed-by: Raj Kumar Bhagat <[email protected]>
> Signed-off-by: Raj Kumar Bhagat <[email protected]>
Acked-by: Jeff Johnson <[email protected]>