diff --git a/target_if/init_deinit/src/init_event_handler.c b/target_if/init_deinit/src/init_event_handler.c index da87a85be9..8221c956b9 100644 --- a/target_if/init_deinit/src/init_event_handler.c +++ b/target_if/init_deinit/src/init_event_handler.c @@ -224,6 +224,9 @@ static inline void init_deinit_update_tdls_caps(struct wmi_unified *wmi_handle, {} #endif +static void init_deinit_mlo_tsf_sync_support(struct wmi_unified *wmi_handle, + struct wlan_objmgr_psoc *psoc); + static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle, uint8_t *event, uint32_t data_len) @@ -380,6 +383,8 @@ static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle, init_deinit_update_wifi_pos_caps(wmi_handle, psoc); init_deinit_update_tdls_caps(wmi_handle, psoc); + init_deinit_mlo_tsf_sync_support(wmi_handle, psoc); + /* override derived value, if it exceeds max peer count */ if ((wlan_psoc_get_max_peer_count(psoc) > tgt_hdl->info.wlan_res_cfg.num_active_peers) && @@ -854,12 +859,30 @@ static void init_deinit_mlo_update_pdev_ready(struct wlan_objmgr_psoc *psoc, init_deinit_send_ml_link_ready, NULL, 0, WLAN_INIT_DEINIT_ID); } + +static void init_deinit_mlo_tsf_sync_support(struct wmi_unified *wmi_handle, + struct wlan_objmgr_psoc *psoc) +{ + bool mlo_tsf_sync_enab = false; + + if (!init_deinit_mlo_capable(psoc)) + return; + + if (wmi_service_enabled(wmi_handle, wmi_service_mlo_tsf_sync)) + mlo_tsf_sync_enab = true; + + mlo_update_tsf_sync_support(psoc, mlo_tsf_sync_enab); +} + #else static void init_deinit_mlo_update_soc_ready(struct wlan_objmgr_psoc *psoc) {} static void init_deinit_mlo_update_pdev_ready(struct wlan_objmgr_psoc *psoc, uint8_t num_radios) {} +static void init_deinit_mlo_tsf_sync_support(struct wmi_unified *wmi_handle, + struct wlan_objmgr_psoc *psoc) +{} #endif /*WLAN_FEATURE_11BE_MLO && WLAN_MLO_MULTI_CHIP*/ /* MAC address fourth byte index */ diff --git a/umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h b/umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h index 5c6e9a9173..3356354168 100644 --- a/umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h +++ b/umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h @@ -148,6 +148,7 @@ struct mlo_chip_info { * @event: event for teardown completion * @dp_handle: pointer to DP ML context * @chip_info: chip specific info of the soc + * @tsf_sync_enabled: MLO TSF sync is enabled at FW or not */ struct mlo_setup_info { uint8_t ml_grp_id; @@ -166,6 +167,7 @@ struct mlo_setup_info { qdf_event_t event; struct cdp_mlo_ctxt *dp_handle; struct mlo_chip_info chip_info; + bool tsf_sync_enabled; }; /** diff --git a/umac/mlo_mgr/inc/wlan_mlo_mgr_setup.h b/umac/mlo_mgr/inc/wlan_mlo_mgr_setup.h index 23d9b5e7cc..69442e2106 100644 --- a/umac/mlo_mgr/inc/wlan_mlo_mgr_setup.h +++ b/umac/mlo_mgr/inc/wlan_mlo_mgr_setup.h @@ -220,6 +220,18 @@ bool mlo_vdevs_check_single_soc(struct wlan_objmgr_vdev **wlan_vdev_list, QDF_STATUS mlo_check_all_pdev_state(struct wlan_objmgr_psoc *psoc, uint8_t grp_id, enum MLO_LINK_STATE state); + +/** + * mlo_update_tsf_sync_support() - API to update TSF sync support per MLO + * group. + * + * @psoc: Pointer to psoc object + * @tsf_sync_enab: Indicates TSF sync is to be enabled or not + * + * Return: None + */ +void mlo_update_tsf_sync_support(struct wlan_objmgr_psoc *psoc, + bool tsf_sync_enab); #else static inline void mlo_setup_init(uint8_t total_grp) { @@ -248,5 +260,11 @@ bool mlo_psoc_get_grp_id(struct wlan_objmgr_psoc *psoc, uint8_t *grp_id) { return 0; } + +static inline +void mlo_update_tsf_sync_support(struct wlan_objmgr_psoc *psoc, + bool tsf_sync_enab) +{ +} #endif /* WLAN_MLO_MULTI_CHIP */ #endif /* _WLAN_MLO_MGR_SETUP_H_ */ diff --git a/umac/mlo_mgr/src/wlan_mlo_mgr_setup.c b/umac/mlo_mgr/src/wlan_mlo_mgr_setup.c index c5d222eaae..dd216f4d47 100644 --- a/umac/mlo_mgr/src/wlan_mlo_mgr_setup.c +++ b/umac/mlo_mgr/src/wlan_mlo_mgr_setup.c @@ -434,6 +434,7 @@ void mlo_setup_init(uint8_t total_grp) mlo_ctx->setup_info = setup_info; mlo_ctx->setup_info[0].ml_grp_id = 0; for (id = 0; id < total_grp; id++) { + mlo_ctx->setup_info[id].tsf_sync_enabled = true; if (qdf_event_create(&mlo_ctx->setup_info[id].event) != QDF_STATUS_SUCCESS) mlo_err("Unable to create teardown event"); @@ -1096,4 +1097,23 @@ QDF_STATUS mlo_link_teardown_link(struct wlan_objmgr_psoc *psoc, } qdf_export_symbol(mlo_link_teardown_link); + +void mlo_update_tsf_sync_support(struct wlan_objmgr_psoc *psoc, + bool tsf_sync_enab) +{ + uint8_t ml_grp_id; + struct mlo_mgr_context *mlo_ctx = wlan_objmgr_get_mlo_ctx(); + struct mlo_setup_info *mlo_setup; + + ml_grp_id = wlan_mlo_get_psoc_group_id(psoc); + if (ml_grp_id < 0) { + mlo_err("Invalid ML Grp ID %d", ml_grp_id); + return; + } + + mlo_setup = &mlo_ctx->setup_info[ml_grp_id]; + mlo_setup->tsf_sync_enabled &= tsf_sync_enab; +} + +qdf_export_symbol(mlo_update_tsf_sync_support); #endif /*WLAN_MLO_MULTI_CHIP*/ diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index e2c4ca6c19..dacd58161f 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -6359,6 +6359,9 @@ typedef enum { wmi_service_cca_busy_info_for_each_20mhz, wmi_service_vdev_param_chwidth_with_notify_support, +#ifdef WLAN_FEATURE_11BE_MLO + wmi_service_mlo_tsf_sync, +#endif wmi_services_max, } wmi_conv_service_ids; #define WMI_SERVICE_UNAVAILABLE 0xFFFF diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 23742997dd..11eee0c57b 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -22289,6 +22289,9 @@ static void populate_tlv_service(uint32_t *wmi_service) WMI_SERVICE_CCA_BUSY_INFO_FOREACH_20MHZ; wmi_service[wmi_service_vdev_param_chwidth_with_notify_support] = WMI_SERVICE_VDEV_PARAM_CHWIDTH_WITH_NOTIFY_SUPPORT; +#ifdef WLAN_FEATURE_11BE_MLO + wmi_service[wmi_service_mlo_tsf_sync] = WMI_SERVICE_MLO_TSF_SYNC; +#endif } /**