wifi: ath12k: save max transmit power in vdev start response event from firmware
authorBaochen Qiang <quic_bqiang@quicinc.com>
Fri, 18 Apr 2025 02:55:45 +0000 (10:55 +0800)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Fri, 16 May 2025 19:38:53 +0000 (12:38 -0700)
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

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20250418-ath12k-6g-lp-vlp-v1-12-c869c86cad60@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/core.h
drivers/net/wireless/ath/ath12k/wmi.c
drivers/net/wireless/ath/ath12k/wmi.h

index cc6c43373e218e9d626942dc8965fb3d6ab24758..3aafbac46e81af9ed2da34201522fb9e73650205 100644 (file)
@@ -811,6 +811,8 @@ struct ath12k {
        u8 ftm_msgref;
        struct ath12k_fw_stats fw_stats;
        unsigned long last_tx_power_update;
+
+       s8 max_allowed_tx_power;
 };
 
 struct ath12k_hw {
index 385f59077050ce89aa9aab19b0ffc9af98e35549..6fa7cba35ab8f6d2420213c452a2722bed57b80a 100644 (file)
@@ -6342,13 +6342,14 @@ static void ath12k_vdev_start_resp_event(struct ath12k_base *ab, struct sk_buff
        ar->last_wmi_vdev_start_status = 0;
 
        status = le32_to_cpu(vdev_start_resp.status);
-
        if (WARN_ON_ONCE(status)) {
                ath12k_warn(ab, "vdev start resp error status %d (%s)\n",
                            status, ath12k_wmi_vdev_resp_print(status));
                ar->last_wmi_vdev_start_status = status;
        }
 
+       ar->max_allowed_tx_power = (s8)le32_to_cpu(vdev_start_resp.max_allowed_tx_power);
+
        complete(&ar->vdev_setup_done);
 
        rcu_read_unlock();
index 5f0f9f120497c5746ae9175c3fa9e119a61ab91c..e4d383c090a60461b1af4529c6d5ef2fa4a2f2e9 100644 (file)
@@ -4162,6 +4162,7 @@ struct wmi_vdev_start_resp_event {
        };
        __le32 cfgd_tx_streams;
        __le32 cfgd_rx_streams;
+       __le32 max_allowed_tx_power;
 } __packed;
 
 /* VDEV start response status codes */