wifi: ath12k: set mlo_capable_flags based on QMI PHY capability
authorRaj Kumar Bhagat <quic_rajkbhag@quicinc.com>
Tue, 23 Apr 2024 09:32:06 +0000 (12:32 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 24 Apr 2024 15:34:11 +0000 (18:34 +0300)
Currently, mlo_capable_flags is set to zero if dualmac device is
detected based on One Time Programmable (OTP) register value.
This is not generic and in future dualmac devices may support
Single Link Operation (SLO) and Multi Link Operation (MLO).

Thus, set mlo_capable_flags based on 'single_chip_mlo_support'
parameter from QMI PHY capability response message from the firmware.
Also, add check on mlo_capable_flags to disable MLO parameter in the
host capability QMI request message.

If the firmware does not respond with this optional parameter
'single_chip_mlo_support' in QMI PHY capability response, default
ab->mlo_capable_flags is used.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00209-QCAHKSWPL_SILICONZ-1

Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240418125609.3867730-3-quic_rajkbhag@quicinc.com
drivers/net/wireless/ath/ath12k/mhi.c
drivers/net/wireless/ath/ath12k/qmi.c

index 72d3e804f4531badffedb1874b89bc1138414568..fef2f76220336d8817f657cbdefff55f4956192d 100644 (file)
@@ -329,7 +329,6 @@ int ath12k_mhi_register(struct ath12k_pci *ab_pci)
                                   "failed to read board id\n");
                } else if (board_id & OTP_VALID_DUALMAC_BOARD_ID_MASK) {
                        dualmac = true;
-                       ab->mlo_capable_flags = 0;
                        ath12k_dbg(ab, ATH12K_DBG_BOOT,
                                   "dualmac fw selected for board id: %x\n", board_id);
                }
index ee24a2f39bc0bfcb2e5f4f707f66a4afc0acb346..ebb20fc8e3ba5bdd87926025a872b17da72c2b1d 100644 (file)
@@ -2023,6 +2023,12 @@ static void ath12k_host_cap_parse_mlo(struct ath12k_base *ab,
        u8 hw_link_id = 0;
        int i;
 
+       if (!(ab->mlo_capable_flags & ATH12K_INTRA_DEVICE_MLO_SUPPORT)) {
+               ath12k_dbg(ab, ATH12K_DBG_QMI,
+                          "intra device MLO is disabled hence skip QMI MLO cap");
+               return;
+       }
+
        if (!ab->qmi.num_radios || ab->qmi.num_radios == U8_MAX) {
                ab->mlo_capable_flags = 0;
 
@@ -2144,9 +2150,6 @@ static void ath12k_qmi_phy_cap_send(struct ath12k_base *ab)
        struct qmi_txn txn;
        int ret;
 
-       if (!ab->mlo_capable_flags)
-               goto out;
-
        ret = qmi_txn_init(&ab->qmi.handle, &txn,
                           qmi_wlanfw_phy_cap_resp_msg_v01_ei, &resp);
        if (ret < 0)
@@ -2171,6 +2174,13 @@ static void ath12k_qmi_phy_cap_send(struct ath12k_base *ab)
                goto out;
        }
 
+       if (resp.single_chip_mlo_support_valid) {
+               if (resp.single_chip_mlo_support)
+                       ab->mlo_capable_flags |= ATH12K_INTRA_DEVICE_MLO_SUPPORT;
+               else
+                       ab->mlo_capable_flags &= ~ATH12K_INTRA_DEVICE_MLO_SUPPORT;
+       }
+
        if (!resp.num_phy_valid) {
                ret = -ENODATA;
                goto out;