wifi: ath11k: update regulatory rules when interface added
authorWen Gong <quic_wgong@quicinc.com>
Thu, 11 Jan 2024 13:56:57 +0000 (15:56 +0200)
committerKalle Valo <quic_kvalo@quicinc.com>
Sun, 14 Jan 2024 14:59:08 +0000 (16:59 +0200)
There are two power types for 6 GHz regulatory, one is AP, another
is client.

When firmware boots up, WMI_REG_CHAN_LIST_CC_EXT_EVENTID is sent from
firmware at an early stage, the interface mode is not decided at
this point, then ath11k select reg rules of AP type as default.

After interface is created, it is exactly decided the interface
type such as AP/mesh point/station. Then ath11k need to update
reg rules to the exact power type matched to the interface type.

The client power type is used for station interface, and AP power
type is used for AP/mesh point interface.

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-5-quic_bqiang@quicinc.com
drivers/net/wireless/ath/ath11k/mac.c
drivers/net/wireless/ath/ath11k/wmi.c
drivers/net/wireless/ath/ath11k/wmi.h

index db241589424d519607429b34ffd9946b32c525a9..3f52428433d1aa83abcb0b2fda649f3c621c9ae2 100644 (file)
@@ -6949,6 +6949,14 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
                                    ret);
        }
 
+       if (ath11k_wmi_supports_6ghz_cc_ext(ar)) {
+               struct cur_regulatory_info *reg_info;
+
+               reg_info = &ab->reg_info_store[ar->pdev_idx];
+               ath11k_dbg(ab, ATH11K_DBG_MAC, "interface added to change reg rules\n");
+               ath11k_reg_handle_chan_list(ab, reg_info, IEEE80211_REG_LPI_AP);
+       }
+
        mutex_unlock(&ar->conf_mutex);
 
        return 0;
index 7e604d4b9a7769f9758bcd7107b9fc15b45edf22..5c6f3bdcb4af6f15e577cbd00e67813b0e998a21 100644 (file)
@@ -9687,3 +9687,9 @@ int ath11k_wmi_sta_keepalive(struct ath11k *ar,
 
        return ath11k_wmi_cmd_send(wmi, skb, WMI_STA_KEEPALIVE_CMDID);
 }
+
+bool ath11k_wmi_supports_6ghz_cc_ext(struct ath11k *ar)
+{
+       return test_bit(WMI_TLV_SERVICE_REG_CC_EXT_EVENT_SUPPORT,
+                       ar->ab->wmi_ab.svc_map) && ar->supports_6ghz;
+}
index a466d2bb4bb8886d56ff91597e585e9b93d3bee6..528756198a7a7f9d23ba63da1f570e7b43cec3f1 100644 (file)
@@ -6480,5 +6480,6 @@ int ath11k_wmi_pdev_set_bios_sar_table_param(struct ath11k *ar, const u8 *sar_va
 int ath11k_wmi_pdev_set_bios_geo_table_param(struct ath11k *ar);
 int ath11k_wmi_sta_keepalive(struct ath11k *ar,
                             const struct wmi_sta_keepalive_arg *arg);
+bool ath11k_wmi_supports_6ghz_cc_ext(struct ath11k *ar);
 
 #endif