qcacld-3.0: Make SAP open()-close() & start()-stop() symmetrical

Current driver is not having wlansap_open() and wlansap_close()
symmetrical and same goes for wlansap_start() and wlansap_stop()
which may create confusion in understanding.

Create a symmetry and clean-up any unnecessary data-structure.

CRs-Fixed: 2135995
Change-Id: I2c3b96e1f2ee44c9f1158108d4b5e48495222080
This commit is contained in:
Krunal Soni
2017-10-31 11:38:57 -07:00
committed by snandini
parent 4a020c72f4
commit f6a367bf53
4 changed files with 5 additions and 46 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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