wifi: ath11k: save max transmit power in vdev start response event from firmware
authorWen Gong <quic_wgong@quicinc.com>
Thu, 11 Jan 2024 13:56:58 +0000 (15:56 +0200)
committerKalle Valo <quic_kvalo@quicinc.com>
Sun, 14 Jan 2024 14:59:09 +0000 (16:59 +0200)
Save the max transmit power received in the vdev start response event from
firmware. A subsequent patch will use this to calculate the final power
value for WMI_VDEV_SET_TPC_POWER_CMDID.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23

Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20231218085844.2658-9-quic_bqiang@quicinc.com
drivers/net/wireless/ath/ath11k/core.h
drivers/net/wireless/ath/ath11k/wmi.c
drivers/net/wireless/ath/ath11k/wmi.h

index 9a398de5dc44fc202784e229851e7b19fe003a02..12fa5b28520f05f2cfd1bc3f67bbaaa20c16851e 100644 (file)
@@ -778,6 +778,7 @@ struct ath11k {
        /* protected by conf_mutex */
        bool ps_state_enable;
        bool ps_timekeeper_enable;
+       s8 max_allowed_tx_power;
 };
 
 struct ath11k_band_cap {
index 5c6f3bdcb4af6f15e577cbd00e67813b0e998a21..3a3a2b697119954c7131e8f9bf2edf689a1f8a22 100644 (file)
@@ -5036,6 +5036,7 @@ static int ath11k_pull_vdev_start_resp_tlv(struct ath11k_base *ab, struct sk_buf
        vdev_rsp->mac_id = ev->mac_id;
        vdev_rsp->cfgd_tx_streams = ev->cfgd_tx_streams;
        vdev_rsp->cfgd_rx_streams = ev->cfgd_rx_streams;
+       vdev_rsp->max_allowed_tx_power = ev->max_allowed_tx_power;
 
        kfree(tb);
        return 0;
@@ -7257,7 +7258,7 @@ static void ath11k_vdev_start_resp_event(struct ath11k_base *ab, struct sk_buff
        }
 
        ar->last_wmi_vdev_start_status = 0;
-
+       ar->max_allowed_tx_power = vdev_start_resp.max_allowed_tx_power;
        status = vdev_start_resp.status;
 
        if (WARN_ON_ONCE(status)) {
index 528756198a7a7f9d23ba63da1f570e7b43cec3f1..7f6287f22cf5681b267b4c657ce905c14d39f82f 100644 (file)
@@ -4119,6 +4119,7 @@ struct wmi_vdev_start_resp_event {
        };
        u32 cfgd_tx_streams;
        u32 cfgd_rx_streams;
+       s32 max_allowed_tx_power;
 } __packed;
 
 /* VDEV start response status codes */