qcacmn: Add API to get num radios

Introduce API to get number of radios

Change-Id: Idb0b6fdf9fe7e524b20016ff5cf6497ca6f13318
CRs-Fixed: 2177109
This commit is contained in:
Srinivas Pitla
2017-12-13 17:39:31 +05:30
committed by snandini
parent 38c6f988d5
commit 5530895779
2 changed files with 30 additions and 2 deletions

View File

@@ -214,4 +214,15 @@ void *ucfg_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc);
* Return: pdev feature pointer * Return: pdev feature pointer
*/ */
void *ucfg_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev); 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_ */ #endif /* _INIT_DEINIT_UCFG_H_ */

View File

@@ -330,6 +330,23 @@ void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev)
return target_pdev_get_wmi_handle(tgt_hdl); 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) void *ucfg_get_psoc_feature_ptr(struct wlan_objmgr_psoc *psoc)
{ {
struct target_psoc_info *tgt_hdl; 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"); target_if_err("psoc is null");
return 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) { if (!tgt_hdl) {
target_if_err("target_psoc_info is null"); target_if_err("target_psoc_info is null");
return NULL; return NULL;
@@ -355,7 +372,7 @@ void *ucfg_get_pdev_feature_ptr(struct wlan_objmgr_pdev *pdev)
target_if_err("pdev is null"); target_if_err("pdev is null");
return 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) { if (!tgt_hdl) {
target_if_err("target_pdev_info is null"); target_if_err("target_pdev_info is null");
return NULL; return NULL;