From 13d57c69d22a758482c37ebe5928d634844463b2 Mon Sep 17 00:00:00 2001 From: Subrat Mishra Date: Wed, 22 May 2019 15:35:50 +0530 Subject: [PATCH] qcacmn: Configure TWT pdev count dynamically Configure TWT pdev count based on number of active radios. Change-Id: I8b297c2f2398774a57932bd1fafc83aba2f891d2 CRs-Fixed: 2449799 --- target_if/core/inc/target_if.h | 17 +++++++++++++++++ target_if/init_deinit/src/init_event_handler.c | 2 ++ 2 files changed, 19 insertions(+) diff --git a/target_if/core/inc/target_if.h b/target_if/core/inc/target_if.h index 045e62b80015..4573abdb01f4 100644 --- a/target_if/core/inc/target_if.h +++ b/target_if/core/inc/target_if.h @@ -2137,5 +2137,22 @@ static inline int32_t target_psoc_get_num_hw_modes return tgt_hdl->info.service_ext_param.num_hw_modes; } + +#ifdef WLAN_SUPPORT_TWT +static inline void target_if_set_twt_ap_pdev_count + (struct tgt_info *info, struct target_psoc_info *tgt_hdl) +{ + if (!tgt_hdl) + return; + + info->wlan_res_cfg.twt_ap_pdev_count = + target_psoc_get_num_radios(tgt_hdl); +} +#else +static inline void target_if_set_twt_ap_pdev_count + (struct tgt_info *info, struct target_psoc_info *tgt_hdl) +{ +} +#endif /* WLAN_SUPPORT_TWT */ #endif diff --git a/target_if/init_deinit/src/init_event_handler.c b/target_if/init_deinit/src/init_event_handler.c index 9fede2c7ac0a..c0e4205cb433 100644 --- a/target_if/init_deinit/src/init_event_handler.c +++ b/target_if/init_deinit/src/init_event_handler.c @@ -288,6 +288,8 @@ static int init_deinit_service_ext_ready_event_handler(ol_scn_t scn_handle, target_if_qwrap_cfg_enable(psoc, tgt_hdl, event); + target_if_set_twt_ap_pdev_count(info, tgt_hdl); + info->wlan_res_cfg.num_vdevs = (target_psoc_get_num_radios(tgt_hdl) * info->wlan_res_cfg.num_vdevs); info->wlan_res_cfg.beacon_tx_offload_max_vdev =