wifi: ath11k: driver settings for MBSSID and EMA
authorAloka Dixit <quic_alokad@quicinc.com>
Fri, 5 May 2023 13:11:27 +0000 (16:11 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Tue, 9 May 2023 16:58:55 +0000 (19:58 +0300)
Advertise the driver support for multiple BSSID (MBSSID) and
enhanced multi-BSSID advertisements (EMA) by setting extended
capabilities.

Configure mbssid_max_interfaces and ema_max_profile_periodicity
fields in structure wiphy which are used to advertise maximum number
of interfaces and profile periodicity supported by the driver.

Add new WMI fields to configure maximum vdev count supported for
MBSSID and profile periodicity in case of EMA.
Setting WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET flag
indicates that the firmware should track and update the DTIM counts
for each non-transmitted profile.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
Co-developed-by: John Crispin <john@phrozen.org>
Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230405221648.17950-2-quic_alokad@quicinc.com
drivers/net/wireless/ath/ath11k/hw.c
drivers/net/wireless/ath/ath11k/hw.h
drivers/net/wireless/ath/ath11k/mac.c
drivers/net/wireless/ath/ath11k/wmi.c
drivers/net/wireless/ath/ath11k/wmi.h

index eb995f9..3b5181e 100644 (file)
@@ -202,6 +202,9 @@ static void ath11k_init_wmi_config_ipq8074(struct ath11k_base *ab,
        config->twt_ap_sta_count = 1000;
        config->flag1 |= WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64;
        config->flag1 |= WMI_RSRC_CFG_FLAG1_ACK_RSSI;
+       config->ema_max_vap_cnt = ab->num_radios;
+       config->ema_max_profile_period = TARGET_EMA_MAX_PROFILE_PERIOD;
+       config->beacon_tx_offload_max_vdev += config->ema_max_vap_cnt;
 }
 
 static int ath11k_hw_mac_id_to_pdev_id_ipq8074(struct ath11k_hw_params *hw,
index 6a5dd2d..f553363 100644 (file)
@@ -64,6 +64,7 @@
 #define TARGET_NUM_WDS_ENTRIES         32
 #define TARGET_DMA_BURST_SIZE          1
 #define TARGET_RX_BATCHMODE            1
+#define TARGET_EMA_MAX_PROFILE_PERIOD  8
 
 #define ATH11K_HW_MAX_QUEUES           4
 #define ATH11K_QUEUE_LEN               4096
index f8dc029..a25299b 100644 (file)
@@ -9001,19 +9001,23 @@ static int ath11k_mac_setup_iface_combinations(struct ath11k *ar)
 
 static const u8 ath11k_if_types_ext_capa[] = {
        [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
+       [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT,
        [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
 };
 
 static const u8 ath11k_if_types_ext_capa_sta[] = {
        [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
+       [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT,
        [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
        [9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT,
 };
 
 static const u8 ath11k_if_types_ext_capa_ap[] = {
        [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING,
+       [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT,
        [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
        [9] = WLAN_EXT_CAPA10_TWT_RESPONDER_SUPPORT,
+       [10] = WLAN_EXT_CAPA11_EMA_SUPPORT,
 };
 
 static const struct wiphy_iftype_ext_capab ath11k_iftypes_ext_capa[] = {
@@ -9251,6 +9255,9 @@ static int __ath11k_mac_register(struct ath11k *ar)
                wiphy_ext_feature_set(ar->hw->wiphy,
                                      NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);
 
+       ar->hw->wiphy->mbssid_max_interfaces = TARGET_NUM_VDEVS(ab);
+       ar->hw->wiphy->ema_max_profile_periodicity = TARGET_EMA_MAX_PROFILE_PERIOD;
+
        ath11k_reg_init(ar);
 
        if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) {
index a55b5fe..88bd9b9 100644 (file)
@@ -3987,6 +3987,9 @@ ath11k_wmi_copy_resource_config(struct wmi_resource_config *wmi_cfg,
                ~(1 << WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT);
        wmi_cfg->host_service_flags |= (tg_cfg->is_reg_cc_ext_event_supported <<
                                        WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT);
+       wmi_cfg->flags2 = WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET;
+       wmi_cfg->ema_max_vap_cnt = tg_cfg->ema_max_vap_cnt;
+       wmi_cfg->ema_max_profile_period = tg_cfg->ema_max_profile_period;
 }
 
 static int ath11k_init_cmd_send(struct ath11k_pdev_wmi *wmi,
index 91bc3e6..d70cf0b 100644 (file)
@@ -2317,6 +2317,7 @@ struct wmi_init_cmd {
 } __packed;
 
 #define WMI_RSRC_CFG_FLAG1_BSS_CHANNEL_INFO_64 BIT(5)
+#define WMI_RSRC_CFG_FLAG2_CALC_NEXT_DTIM_COUNT_SET BIT(9)
 #define WMI_RSRC_CFG_FLAG1_ACK_RSSI BIT(18)
 
 #define WMI_CFG_HOST_SERVICE_FLAG_REG_CC_EXT 4
@@ -2389,6 +2390,9 @@ struct wmi_resource_config {
        u32 msdu_flow_override_config1;
        u32 flags2;
        u32 host_service_flags;
+       u32 max_rnr_neighbours;
+       u32 ema_max_vap_cnt;
+       u32 ema_max_profile_period;
 } __packed;
 
 struct wmi_service_ready_event {
@@ -5646,6 +5650,8 @@ struct target_resource_config {
        u32 twt_ap_pdev_count;
        u32 twt_ap_sta_count;
        u8 is_reg_cc_ext_event_supported;
+       u32 ema_max_vap_cnt;
+       u32 ema_max_profile_period;
 };
 
 enum wmi_debug_log_param {