diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 727c6f8f6d2b..74075a38baaa 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -1244,8 +1244,27 @@ QDF_STATUS wlansap_de_register_mgmt_frame(struct sap_context *pSapCtx, uint8_t *match_data, uint16_t match_len); -QDF_STATUS wlansap_channel_change_request(void *p_cds_gctx, - uint8_t tArgetChannel); +/** + * wlansap_channel_change_request() - Send channel change request + * @sapContext: Pointer to the SAP context + * @target_channel: Target channel + * + * This API is used to send an Indication to SME/PE to change the + * current operating channel to a different target channel. + * + * The Channel change will be issued by SAP under the following + * scenarios. + * 1. A radar indication is received during SAP CAC WAIT STATE and + * channel change is required. + * 2. A radar indication is received during SAP STARTED STATE and + * channel change is required. + * + * Return: The QDF_STATUS code associated with performing the operation + * QDF_STATUS_SUCCESS: Success + * + */ +QDF_STATUS wlansap_channel_change_request(struct sap_context *sapContext, + uint8_t target_channel); /** * wlansap_start_beacon_req() - Send Start Beaconing Request diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index e68806b7f550..e6f465d31831 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -289,29 +289,14 @@ static QDF_STATUS sap_hdd_signal_event_handler(void *ctx) return status; } -/** - * - * wlansap_pre_start_bss_acs_scan_callback() - callback for scan results - * - * hal_handle: the hal_handle passed in with the scan request - * pcontext: the second context pass in for the caller, opaque sap Handle. - * scanid: scan id passed - * sessionid: session identifier - * status: status of scan -success, failure or abort - * - * Api for scan callback. This function is invoked as a result of scan - * completion and reports the scan results. - * - * Return: The QDF_STATUS code associated with performing the operation - */ -QDF_STATUS -wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, void *pcontext, - uint8_t sessionid, uint32_t scanid, - eCsrScanStatus scan_status) +QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, + struct sap_context *sap_ctx, + uint8_t sessionid, + uint32_t scanid, + eCsrScanStatus scan_status) { tScanResultHandle presult = NULL; QDF_STATUS scan_get_result_status = QDF_STATUS_E_FAILURE; - struct sap_context *sap_ctx = pcontext; uint8_t oper_channel = 0; QDF_STATUS status = QDF_STATUS_E_FAILURE; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index e1f9bc44bb25..2b40afa59a0a 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -3264,7 +3264,7 @@ static QDF_STATUS sap_fsm_state_dfs_cac_wait(struct sap_context *sap_ctx, (void *)eSAP_STATUS_SUCCESS); wlansap_channel_change_request( - (void *)t_sap_ctx, + t_sap_ctx, mac_ctx->sap.SapDfsInfo.target_channel); } } @@ -3546,7 +3546,7 @@ static QDF_STATUS sap_fsm_state_disconnecting(struct sap_context *sap_ctx, * Most likely, radar has been detected and SAP wants to * change the channel */ - qdf_status = wlansap_channel_change_request((void *) sap_ctx, + qdf_status = wlansap_channel_change_request(sap_ctx, mac_ctx->sap.SapDfsInfo.target_channel); QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO, diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index d0a14bd720c3..9306da5be4fd 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -303,14 +303,24 @@ QDF_STATUS wlansap_scan_callback(tHalHandle hal_handle, uint8_t session_id, uint32_t scan_id, eCsrScanStatus scan_status); -QDF_STATUS -wlansap_pre_start_bss_acs_scan_callback( - tHalHandle hal_handle, - void *pcontext, - uint8_t sessionid, - uint32_t scanid, - eCsrScanStatus scan_status -); +/** + * wlansap_pre_start_bss_acs_scan_callback() - callback for scan results + * @hal_handle: the hal_handle passed in with the scan request + * @sap_ctx: the SAP context pointer. + * @scanid: scan id passed + * @sessionid: session identifier + * @scan_status: status of scan -success, failure or abort + * + * Api for scan callback. This function is invoked as a result of scan + * completion and reports the scan results. + * + * Return: The QDF_STATUS code associated with performing the operation + */ +QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle, + struct sap_context *sap_ctx, + uint8_t sessionid, + uint32_t scanid, + eCsrScanStatus scan_status); QDF_STATUS wlansap_roam_callback diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 3979450a4d99..57ce7e61931e 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1793,43 +1793,14 @@ QDF_STATUS wlansap_de_register_mgmt_frame(struct sap_context *pSapCtx, return QDF_STATUS_E_FAULT; } -/*========================================================================== - FUNCTION wlansap_channel_change_request - - DESCRIPTION - This API is used to send an Indication to SME/PE to change the - current operating channel to a different target channel. - - The Channel change will be issued by SAP under the following - scenarios. - 1. A radar indication is received during SAP CAC WAIT STATE and - channel change is required. - 2. A radar indication is received during SAP STARTED STATE and - channel change is required. - DEPENDENCIES - NA. - - PARAMETERS - IN - pSapCtx: Pointer to cds global context structure - - RETURN VALUE - The QDF_STATUS code associated with performing the operation - - QDF_STATUS_SUCCESS: Success - - SIDE EFFECTS - ============================================================================*/ -QDF_STATUS -wlansap_channel_change_request(void *pSapCtx, uint8_t target_channel) +QDF_STATUS wlansap_channel_change_request(struct sap_context *sapContext, + uint8_t target_channel) { - struct sap_context *sapContext = NULL; QDF_STATUS qdf_ret_status = QDF_STATUS_E_FAILURE; void *hHal = NULL; tpAniSirGlobal mac_ctx = NULL; eCsrPhyMode phy_mode; struct ch_params *ch_params; - sapContext = pSapCtx; if (NULL == sapContext) { QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,