qcacmn: Add support for handling MLO TSF sync capability

Add APIs to init the TSF sync capability based on
WMI_SERVICE_MLO_TSF_SYNC service bit sent from FW,
per ML group.

Change-Id: I5dad3fef7ebfa2af330b95d45cac3bef862f46f0
CRs-Fixed: 3491364
This commit is contained in:
Jhalak Naik 2023-04-17 14:44:32 +05:30 committed by Madan Koyyalamudi
parent ba55e0f2a8
commit d563641c08
6 changed files with 69 additions and 0 deletions

View File

@ -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 */

View File

@ -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;
};
/**

View File

@ -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_ */

View File

@ -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*/

View File

@ -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

View File

@ -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
}
/**