wifi: ath12k: parse and save sbs_lower_band_end_freq from WMI_SERVICE_READY_EXT2_EVEN...
authorBaochen Qiang <quic_bqiang@quicinc.com>
Thu, 22 May 2025 08:54:11 +0000 (16:54 +0800)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Tue, 17 Jun 2025 23:28:34 +0000 (16:28 -0700)
Firmware sends the boundary between lower and higher bands in
ath12k_wmi_dbs_or_sbs_cap_params structure embedded in
WMI_SERVICE_READY_EXT2_EVENTID event. The boundary is needed when
updating frequency range in the following patch. So parse and save
it for later use. Note ath12k_wmi_dbs_or_sbs_cap_params is placed
after some other structures, so placeholders for them are added
as well.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00284-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20250522-ath12k-sbs-dbs-v1-2-54a29e7a3a88@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/wmi.c
drivers/net/wireless/ath/ath12k/wmi.h

index edb38fbb4ed4e6b1ae9413bce5f0df1d950f3a19..824c910bf1d60bb645f1875ba85b351d6b2b8e22 100644 (file)
@@ -91,6 +91,11 @@ struct ath12k_wmi_svc_rdy_ext2_parse {
        bool dma_ring_cap_done;
        bool spectral_bin_scaling_done;
        bool mac_phy_caps_ext_done;
+       bool hal_reg_caps_ext2_done;
+       bool scan_radio_caps_ext2_done;
+       bool twt_caps_done;
+       bool htt_msdu_idx_to_qtype_map_done;
+       bool dbs_or_sbs_cap_ext_done;
 };
 
 struct ath12k_wmi_rdy_parse {
@@ -4991,6 +4996,7 @@ static int ath12k_wmi_svc_rdy_ext2_parse(struct ath12k_base *ab,
                                         u16 tag, u16 len,
                                         const void *ptr, void *data)
 {
+       const struct ath12k_wmi_dbs_or_sbs_cap_params *dbs_or_sbs_caps;
        struct ath12k_wmi_pdev *wmi_handle = &ab->wmi_ab.wmi[0];
        struct ath12k_wmi_svc_rdy_ext2_parse *parse = data;
        int ret;
@@ -5032,6 +5038,23 @@ static int ath12k_wmi_svc_rdy_ext2_parse(struct ath12k_base *ab,
                        }
 
                        parse->mac_phy_caps_ext_done = true;
+               } else if (!parse->hal_reg_caps_ext2_done) {
+                       parse->hal_reg_caps_ext2_done = true;
+               } else if (!parse->scan_radio_caps_ext2_done) {
+                       parse->scan_radio_caps_ext2_done = true;
+               } else if (!parse->twt_caps_done) {
+                       parse->twt_caps_done = true;
+               } else if (!parse->htt_msdu_idx_to_qtype_map_done) {
+                       parse->htt_msdu_idx_to_qtype_map_done = true;
+               } else if (!parse->dbs_or_sbs_cap_ext_done) {
+                       dbs_or_sbs_caps = ptr;
+                       ab->wmi_ab.sbs_lower_band_end_freq =
+                               __le32_to_cpu(dbs_or_sbs_caps->sbs_lower_band_end_freq);
+
+                       ath12k_dbg(ab, ATH12K_DBG_WMI, "sbs_lower_band_end_freq %u\n",
+                                  ab->wmi_ab.sbs_lower_band_end_freq);
+
+                       parse->dbs_or_sbs_cap_ext_done = true;
                }
                break;
        default:
index 96c31b7820ec14ec8df2fa0d060da6d257d7a083..e69d53054f6d863e5d02358175ccc0a23012a829 100644 (file)
@@ -2747,6 +2747,11 @@ struct wmi_service_ready_ext2_event {
        __le32 default_num_msduq_supported_per_tid;
 } __packed;
 
+struct ath12k_wmi_dbs_or_sbs_cap_params {
+       __le32 hw_mode_id;
+       __le32 sbs_lower_band_end_freq;
+} __packed;
+
 struct ath12k_wmi_caps_ext_params {
        __le32 hw_mode_id;
        __le32 pdev_and_hw_link_ids;
@@ -5097,6 +5102,7 @@ struct ath12k_wmi_base {
        struct ath12k_wmi_target_cap_arg *targ_cap;
 
        struct ath12k_svc_ext_info svc_ext_info;
+       u32 sbs_lower_band_end_freq;
 };
 
 struct wmi_pdev_set_bios_interface_cmd {