diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 76a130f9d5..d20abd176e 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -847,16 +847,6 @@ QDF_STATUS wlansap_start(struct sap_context *sap_ctx, */ QDF_STATUS wlansap_stop(struct sap_context *sap_ctx); -/** - * sap_cleanup_channel_list() - cleanup channel list. - * @sap_ctx: Pointer to the SAP context - * - * Frees up the memory allocated to the channel list. - * - * Return: None - */ -void sap_cleanup_channel_list(struct sap_context *sap_ctx); - /** * sap_is_auto_channel_select() - is channel AUTO_CHANNEL_SELECT * @sapcontext: Pointer to the SAP context diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c index 2d3a88b781..45243c40cf 100644 --- a/core/sap/src/sap_ch_select.c +++ b/core/sap/src/sap_ch_select.c @@ -481,31 +481,6 @@ void sap_update_unsafe_channel_list(tHalHandle hal, struct sap_context *sap_ctx) #endif /* FEATURE_WLAN_CH_AVOID */ -void sap_cleanup_channel_list(struct sap_context *sap_ctx) -{ - - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, - "Cleaning up the channel list structure"); - - if (NULL == sap_ctx) { - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_FATAL, - "SAP Context is NULL"); - return; - } - - sap_ctx->SapChnlList.numChannel = 0; - if (sap_ctx->SapChnlList.channelList) { - qdf_mem_free(sap_ctx->SapChnlList.channelList); - sap_ctx->SapChnlList.channelList = NULL; - } - - sap_ctx->SapAllChnlList.numChannel = 0; - if (sap_ctx->SapAllChnlList.channelList) { - qdf_mem_free(sap_ctx->SapAllChnlList.channelList); - sap_ctx->SapAllChnlList.channelList = NULL; - } -} - /** * sap_channel_in_acs_channel_list() - check if channel in acs channel list * @channel_num: channel to check diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index ab0f5419bd..8174924ab9 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -191,7 +191,6 @@ struct sap_context { uint8_t *channelList; uint8_t num_of_channel; - tSapChannelListInfo SapChnlList; uint16_t ch_width_orig; struct ch_params ch_params; diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 733ec6a62c..ebd54c3033 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -382,16 +382,19 @@ QDF_STATUS wlansap_stop(struct sap_context *sap_ctx) FL("sap session can't be closed")); return QDF_STATUS_E_FAULT; } + qdf_event_destroy(&sap_ctx->sap_session_opened_evt); ucfg_scan_unregister_requester(pmac->psoc, sap_ctx->req_id); sap_free_roam_profile(&sap_ctx->csr_roamProfile); + if (sap_ctx->sessionId != CSR_SESSION_ID_INVALID) { + /* empty queues/lists/pkts if any */ + sap_clear_session_param(hal, sap_ctx, sap_ctx->sessionId); + } return QDF_STATUS_SUCCESS; } QDF_STATUS wlansap_close(struct sap_context *sap_ctx) { - tHalHandle hal; - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, "wlansap_close invoked"); @@ -402,14 +405,6 @@ QDF_STATUS wlansap_close(struct sap_context *sap_ctx) } /* Cleanup SAP control block */ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, FL("Enter")); - sap_cleanup_channel_list(sap_ctx); - hal = CDS_GET_HAL_CB(); - if (!hal) - QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR, - FL("hal is NULL, so lets skip global sap cleanup")); - else if (sap_ctx->sessionId != CSR_SESSION_ID_INVALID) - /* empty queues/lists/pkts if any */ - sap_clear_session_param(hal, sap_ctx, sap_ctx->sessionId); /* * wlansap_context_put will release actual sap_ctx memory * allocated during wlansap_open