diff options
author | Srinivas Pitla <spitla@codeaurora.org> | 2017-12-13 17:39:31 +0530 |
---|---|---|
committer | snandini <snandini@codeaurora.org> | 2018-02-03 15:11:18 -0800 |
commit | 5530895779c7679fc697995a8ded6c20f875310a (patch) | |
tree | cb04632df0129ebfc5f4f4285e1cc8ce0095ae6b /target_if | |
parent | 38c6f988d5527c128475a286a4341d74bfe4f8bf (diff) | |
download | qca-wfi-host-cmn-5530895779c7679fc697995a8ded6c20f875310a.tar.gz |
qcacmn: Add API to get num radios
Introduce API to get number of radios
Change-Id: Idb0b6fdf9fe7e524b20016ff5cf6497ca6f13318
CRs-Fixed: 2177109
Diffstat (limited to 'target_if')
-rw-r--r-- | target_if/init_deinit/inc/init_deinit_ucfg.h | 11 | ||||
-rw-r--r-- | target_if/init_deinit/src/init_deinit_ucfg.c | 21 |
2 files changed, 30 insertions, 2 deletions
diff --git a/target_if/init_deinit/inc/init_deinit_ucfg.h b/target_if/init_deinit/inc/init_deinit_ucfg.h index a0cbf6c4d..34dedc6e4 100644 --- a/target_if/init_deinit/inc/init_deinit_ucfg.h +++ b/target_if/init_deinit/inc/init_deinit_ucfg.h @@ -214,4 +214,15 @@ void *ucfg_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc); * Return: pdev feature pointer */ void *ucfg_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev); + +/** + * ucfg_get_num_radios() - get number of radios + * @psoc: pointer to psoc + * + * API to get number of radios + * + * Return: number of radios + */ +uint32_t ucfg_get_num_radios(struct wlan_objmgr_psoc *psoc); + #endif /* _INIT_DEINIT_UCFG_H_ */ diff --git a/target_if/init_deinit/src/init_deinit_ucfg.c b/target_if/init_deinit/src/init_deinit_ucfg.c index ac8b16170..a66cebe74 100644 --- a/target_if/init_deinit/src/init_deinit_ucfg.c +++ b/target_if/init_deinit/src/init_deinit_ucfg.c @@ -330,6 +330,23 @@ void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev) return target_pdev_get_wmi_handle(tgt_hdl); } +uint32_t ucfg_get_num_radios(struct wlan_objmgr_psoc *psoc) +{ + struct target_psoc_info *tgt_hdl; + + if (!psoc) { + target_if_err("psoc is null"); + return 0; + } + tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); + if (!tgt_hdl) { + target_if_err("target_psoc_info is null"); + return 0; + } + + return target_psoc_get_num_radios(tgt_hdl); +} + void *ucfg_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc) { struct target_psoc_info *tgt_hdl; @@ -338,7 +355,7 @@ void *ucfg_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc) target_if_err("psoc is null"); return NULL; } - tgt_hdl = (struct target_psoc_info *)wlan_psoc_get_tgt_if_handle(psoc); + tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc); if (!tgt_hdl) { target_if_err("target_psoc_info is null"); return NULL; @@ -355,7 +372,7 @@ void *ucfg_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev) target_if_err("pdev is null"); return NULL; } - tgt_hdl = (struct target_pdev_info *)wlan_pdev_get_tgt_if_handle(pdev); + tgt_hdl = wlan_pdev_get_tgt_if_handle(pdev); if (!tgt_hdl) { target_if_err("target_pdev_info is null"); return NULL; |