ath11k: wmi: put hardware to DBS mode
authorCarl Huang <cjhuang@codeaurora.org>
Mon, 17 Aug 2020 10:31:51 +0000 (13:31 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 18 Aug 2020 09:44:45 +0000 (12:44 +0300)
For QCA6390, host puts hardware to Dual Band Simultaneous (DBS) mode by default
so both 2G and 5G bands can be used. Otherwise only the 5G band can be used.
QCA6390 doesn't provide band_to_mac configuration and firmware will do the
band_to_mac map.

Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1
Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1597576599-8857-12-git-send-email-kvalo@codeaurora.org
drivers/net/wireless/ath/ath11k/core.c
drivers/net/wireless/ath/ath11k/hw.h
drivers/net/wireless/ath/ath11k/wmi.c

index 62fac8bbf2213e60b41e538e65ef62b73976681f..b94630822d1e236222a2d5fbc56bca27aa46d88e 100644 (file)
@@ -36,6 +36,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
                .host_ce_config = ath11k_host_ce_config_ipq8074,
                .ce_count = 12,
                .single_pdev_only = false,
+               .needs_band_to_mac = true,
        },
        {
                .name = "qca6390 hw2.0",
@@ -54,6 +55,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
                .host_ce_config = ath11k_host_ce_config_qca6390,
                .ce_count = 9,
                .single_pdev_only = true,
+               .needs_band_to_mac = false,
        },
 };
 
index 4651aed2eaf0bd56a30b69de9d499bc4ded25f52..8db9534b176b4b87a301d41600febcdd8a05402e 100644 (file)
@@ -145,6 +145,12 @@ struct ath11k_hw_params {
        u32 ce_count;
 
        bool single_pdev_only;
+
+       /* For example on QCA6390 struct
+        * wmi_init_cmd_param::band_to_mac_config needs to be false as the
+        * firmware creates the mapping.
+        */
+       bool needs_band_to_mac;
 };
 
 extern const struct ath11k_hw_ops ipq8074_ops;
index 21f9070a130042b67966d41d39e50d639ca25042..4e100407fea6cce2340d39fcdc7bbb8f8deb75d4 100644 (file)
@@ -3396,13 +3396,13 @@ int ath11k_wmi_cmd_init(struct ath11k_base *ab)
        init_param.hw_mode_id = wmi_sc->preferred_hw_mode;
        init_param.mem_chunks = wmi_sc->mem_chunks;
 
-       if (wmi_sc->preferred_hw_mode == WMI_HOST_HW_MODE_SINGLE ||
-           ab->hw_params.single_pdev_only)
+       if (wmi_sc->preferred_hw_mode == WMI_HOST_HW_MODE_SINGLE)
                init_param.hw_mode_id = WMI_HOST_HW_MODE_MAX;
 
-       init_param.num_band_to_mac = ab->num_radios;
-
-       ath11k_fill_band_to_mac_param(ab, init_param.band_to_mac);
+       if (ab->hw_params.needs_band_to_mac) {
+               init_param.num_band_to_mac = ab->num_radios;
+               ath11k_fill_band_to_mac_param(ab, init_param.band_to_mac);
+       }
 
        return ath11k_init_cmd_send(&wmi_sc->wmi[0], &init_param);
 }