From e2f7d54e429bc9578ee3ddfe7fffcbae96e3cc5b Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Sun, 24 Sep 2017 20:52:24 -0700 Subject: [PATCH] qcacld-3.0: Refine API wlansap_start_bss() See change "qcacld-3.0: Refine API wlansap_open()" for the API history. Update wlansap_start_bss() to use the true struct pointer type. Change-Id: Ic6db98d641f5c71967f04e09b7b41ec20285bc99 CRs-Fixed: 2116267 --- core/sap/inc/sap_api.h | 24 +++++++++++++++++++++--- core/sap/src/sap_module.c | 36 ++++-------------------------------- 2 files changed, 25 insertions(+), 35 deletions(-) diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index b89724b821bd..2d5c9491fbea 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -897,9 +897,27 @@ bool wlansap_is_channel_leaking_in_nol(struct sap_context *sap_ctx, uint8_t channel, uint8_t chan_bw); -QDF_STATUS wlansap_start_bss(void *p_cds_gctx, - tpWLAN_SAPEventCB pSapEventCallback, - tsap_Config_t *pConfig, void *pUsrContext); +/** + * wlansap_start_bss() - start BSS + * @pSapCtx: Pointer to the SAP context + * @pSapEventCallback: Callback function in HDD called by SAP to inform HDD + * about SAP results + * @pConfig: Pointer to configuration structure passed down from + * HDD(HostApd for Android) + * @pUsrContext: Parameter that will be passed back in all the SAP callback + * events. + * + * This api function provides SAP FSM event eWLAN_SAP_PHYSICAL_LINK_CREATE for + * starting AP BSS + * + * Return: The result code associated with performing the operation + * QDF_STATUS_E_FAULT: Pointer to SAP cb is NULL; + * access would cause a page fault + * QDF_STATUS_SUCCESS: Success + */ +QDF_STATUS wlansap_start_bss(struct sap_context *pSapCtx, + tpWLAN_SAPEventCB pSapEventCallback, + tsap_Config_t *pConfig, void *pUsrContext); /** * wlan_sap_update_next_channel() - Update next channel configured using vendor diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 73878a23dc86..cdd47080b4e4 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -648,49 +648,21 @@ static inline bool wlan_sap_validate_channel_switch(tHalHandle hal, return true; } #endif -/** - * wlansap_start_bss() - start BSS - * @pCtx: Pointer to the global cds context; a handle to SAP's control block - * can be extracted from its context. When MBSSID feature is enabled, - * SAP context is directly passed to SAP APIs. - * @pQctCommitConfig: Pointer to configuration structure passed down from - * HDD(HostApd for Android) - * @hdd_SapEventCallback: Callback function in HDD called by SAP to inform HDD - * about SAP results - * @pUsrContext: Parameter that will be passed back in all the SAP callback - * events. - * - * This api function provides SAP FSM event eWLAN_SAP_PHYSICAL_LINK_CREATE for - * starting AP BSS - * - * Return: The result code associated with performing the operation - * QDF_STATUS_E_FAULT: Pointer to SAP cb is NULL; - * access would cause a page fault - * QDF_STATUS_SUCCESS: Success - */ -QDF_STATUS wlansap_start_bss(void *pCtx, /* pwextCtx */ +QDF_STATUS wlansap_start_bss(struct sap_context *pSapCtx, tpWLAN_SAPEventCB pSapEventCallback, - tsap_Config_t *pConfig, void *pUsrContext) { + tsap_Config_t *pConfig, void *pUsrContext) +{ tWLAN_SAPEvent sapEvent; /* State machine event */ QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; - struct sap_context *pSapCtx = NULL; tHalHandle hHal; tpAniSirGlobal pmac = NULL; - /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ - - /*------------------------------------------------------------------------ - Sanity check - Extract SAP control block - ------------------------------------------------------------------------*/ - pSapCtx = CDS_GET_SAP_CB(pCtx); - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "wlansap_start_bss: sapContext=%pK", pSapCtx); if (NULL == pSapCtx) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, - "%s: Invalid SAP pointer from pCtx", + "%s: Invalid SAP pointer", __func__); return QDF_STATUS_E_FAULT; }