mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 16:16:15 -04:00
Merge "qcacld-3.0: (Part-2) Refactor open and close session logic in SAP module" into wlan-cld3.driver.lnx.2.0
This commit is contained in:
commit
f69f2a154a
5 changed files with 23 additions and 134 deletions
|
|
@ -785,13 +785,33 @@ typedef struct {
|
|||
*
|
||||
* struct sap_context is used to share per-BSS context between SAP and
|
||||
* its clients. A context is generated by sap_create_ctx() and is
|
||||
* destroyed by wlansap_close(). During the lifetime of the BSS the
|
||||
* destroyed by sap_destroy_ctx(). During the lifetime of the BSS the
|
||||
* SAP context is passed as the primary parameter to SAP APIs. Note
|
||||
* that by design the contents of the structure are opaque to the
|
||||
* clients and a SAP context pointer must only be dereferenced by SAP.
|
||||
*/
|
||||
struct sap_context;
|
||||
|
||||
/**
|
||||
* wlansap_roam_callback() - API to get the events for SAP persona
|
||||
* @pContext: sap context
|
||||
* @pCsrRoamInfo: pointer to SME CSR roam info structure
|
||||
* @roamId: roam id being used
|
||||
* @roamStatus: status of the event reported by SME to SAP
|
||||
* @roamResult: result of the event reported by SME to SAP
|
||||
*
|
||||
* Any activity like start_bss, stop_bss, and etc for SAP persona
|
||||
* happens, SME reports the result of those events to SAP through this
|
||||
* callback.
|
||||
*
|
||||
* Return: QDF_STATUS based on overall result
|
||||
*/
|
||||
QDF_STATUS wlansap_roam_callback(void *pContext,
|
||||
struct csr_roam_info *pCsrRoamInfo,
|
||||
uint32_t roamId,
|
||||
eRoamCmdStatus roamStatus,
|
||||
eCsrRoamResult roamResult);
|
||||
|
||||
/**
|
||||
* sap_create_ctx() - API to create the sap context
|
||||
*
|
||||
|
|
|
|||
|
|
@ -878,20 +878,6 @@ static void wlansap_update_vendor_acs_chan(tpAniSirGlobal mac_ctx,
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* wlansap_roam_callback() - Callback for Roam (connection status) Events
|
||||
* @ctx : pContext passed in with the roam request
|
||||
* @csr_roam_info : Pointer to a struct csr_roam_info
|
||||
* @roamId : to identify the callback related roam request.
|
||||
* 0 means unsolicit
|
||||
* @roam_status : Flag indicating the status of the callback
|
||||
* @roam_result : Result
|
||||
*
|
||||
* This function finds dot11 mode based on current mode, operating channel and
|
||||
* fw supported modes.
|
||||
*
|
||||
* Return: Status of operation
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlansap_roam_callback(void *ctx, struct csr_roam_info *csr_roam_info,
|
||||
uint32_t roamId,
|
||||
|
|
@ -923,12 +909,6 @@ wlansap_roam_callback(void *ctx, struct csr_roam_info *csr_roam_info,
|
|||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("Before switch on roam_status = %d"), roam_status);
|
||||
switch (roam_status) {
|
||||
case eCSR_ROAM_SESSION_OPENED:
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("Session %d opened successfully"),
|
||||
sap_ctx->sessionId);
|
||||
qdf_event_set(&sap_ctx->sap_session_opened_evt);
|
||||
break;
|
||||
case eCSR_ROAM_INFRA_IND:
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("CSR roam_status = eCSR_ROAM_INFRA_IND (%d)"),
|
||||
|
|
|
|||
|
|
@ -2056,62 +2056,6 @@ QDF_STATUS sap_clear_session_param(tHalHandle hal, struct sap_context *sapctx,
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* sap_open_session() - Opens a SAP session
|
||||
* @hHal: Hal handle
|
||||
* @sapContext: Sap Context value
|
||||
* @session_id: Pointer to the session id
|
||||
*
|
||||
* Function for opening SME and SAP sessions when system is in SoftAP role
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS sap_open_session(tHalHandle hHal, struct sap_context *sapContext,
|
||||
uint32_t session_id)
|
||||
{
|
||||
uint32_t type, subType;
|
||||
QDF_STATUS qdf_ret_status;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
if (sapContext->csr_roamProfile.csrPersona == QDF_P2P_GO_MODE)
|
||||
status = cds_get_vdev_types(QDF_P2P_GO_MODE, &type, &subType);
|
||||
else
|
||||
status = cds_get_vdev_types(QDF_SAP_MODE, &type, &subType);
|
||||
|
||||
if (QDF_STATUS_SUCCESS != status) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_FATAL,
|
||||
"failed to get vdev type");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
qdf_event_reset(&sapContext->sap_session_opened_evt);
|
||||
/* Open SME Session for Softap */
|
||||
qdf_ret_status = sme_open_session(hHal,
|
||||
&wlansap_roam_callback,
|
||||
sapContext,
|
||||
sapContext->self_mac_addr,
|
||||
session_id, type, subType);
|
||||
|
||||
if (QDF_STATUS_SUCCESS != qdf_ret_status) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"Error: In %s calling sme_roam_connect status = %d",
|
||||
__func__, qdf_ret_status);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
status = qdf_wait_single_event(&sapContext->sap_session_opened_evt,
|
||||
SME_CMD_TIMEOUT_VALUE);
|
||||
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"wait for sap open session event timed out");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/*==========================================================================
|
||||
FUNCTION sapGotoStarting
|
||||
|
||||
|
|
@ -2735,28 +2679,6 @@ static struct sap_context *sap_find_cac_wait_session(tHalHandle handle)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* sap_close_session() - API to close SAP/SME sesssion
|
||||
* @hal: pointer hal
|
||||
* @sapctx: pointer to sap context
|
||||
* @callback: callback to be called up on operation completion
|
||||
* @valid: flag to check if sap context to be passed
|
||||
*
|
||||
* This API is used to close the SME session opened for SAP persona
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS sap_close_session(tHalHandle hal, struct sap_context *sapctx,
|
||||
csr_roamSessionCloseCallback callback, bool valid)
|
||||
{
|
||||
if (false == valid)
|
||||
return sme_close_session(hal, sapctx->sessionId,
|
||||
callback, NULL);
|
||||
else
|
||||
return sme_close_session(hal, sapctx->sessionId,
|
||||
callback, sapctx);
|
||||
}
|
||||
|
||||
/*==========================================================================
|
||||
FUNCTION sap_cac_reset_notify
|
||||
|
||||
|
|
|
|||
|
|
@ -242,8 +242,6 @@ struct sap_context {
|
|||
eSapHddEvent sap_state;
|
||||
eSapStatus sap_status;
|
||||
uint32_t roc_ind_scan_id;
|
||||
|
||||
qdf_event_t sap_session_opened_evt;
|
||||
bool is_pre_cac_on;
|
||||
bool pre_cac_complete;
|
||||
bool vendor_acs_dfs_lte_enabled;
|
||||
|
|
@ -322,13 +320,6 @@ QDF_STATUS wlansap_pre_start_bss_acs_scan_callback(tHalHandle hal_handle,
|
|||
uint32_t scanid,
|
||||
eCsrScanStatus scan_status);
|
||||
|
||||
QDF_STATUS
|
||||
wlansap_roam_callback
|
||||
(void *pContext,
|
||||
struct csr_roam_info *pCsrRoamInfo,
|
||||
uint32_t roamId,
|
||||
eRoamCmdStatus roamStatus, eCsrRoamResult roamResult);
|
||||
|
||||
QDF_STATUS SapFsm(struct sap_context *sapContext, ptWLAN_SAPEvent sapEvent,
|
||||
uint8_t *status);
|
||||
|
||||
|
|
@ -423,11 +414,6 @@ void sap_config_acs_result(tHalHandle hal, struct sap_context *sap_ctx,
|
|||
*/
|
||||
bool
|
||||
sap_check_in_avoid_ch_list(struct sap_context *sap_ctx, uint8_t channel);
|
||||
QDF_STATUS sap_open_session(tHalHandle hHal, struct sap_context *sapContext,
|
||||
uint32_t session_id);
|
||||
QDF_STATUS sap_close_session(tHalHandle hHal,
|
||||
struct sap_context *sapContext,
|
||||
csr_roamSessionCloseCallback callback, bool valid);
|
||||
/**
|
||||
* sap_set_session_param() - set sap related param to sap context and global var
|
||||
* @hal: pointer to hardware abstraction layer
|
||||
|
|
|
|||
|
|
@ -318,7 +318,6 @@ QDF_STATUS sap_init_ctx(struct sap_context *sap_ctx,
|
|||
sap_ctx->csr_roamProfile.BSSIDs.bssid = &sap_ctx->bssid;
|
||||
sap_ctx->csr_roamProfile.csrPersona = mode;
|
||||
qdf_mem_copy(sap_ctx->self_mac_addr, addr, QDF_MAC_ADDR_SIZE);
|
||||
qdf_event_create(&sap_ctx->sap_session_opened_evt);
|
||||
|
||||
/* Now configure the auth type in the roaming profile. To open. */
|
||||
sap_ctx->csr_roamProfile.negotiatedAuthType = eCSR_AUTH_TYPE_OPEN_SYSTEM; /* open is the default */
|
||||
|
|
@ -330,17 +329,6 @@ QDF_STATUS sap_init_ctx(struct sap_context *sap_ctx,
|
|||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
pmac = PMAC_STRUCT(hal);
|
||||
/*
|
||||
* Anytime when you call sap_open_session, please call
|
||||
* sap_set_session_param to fill sap context parameters
|
||||
*/
|
||||
qdf_ret_status = sap_open_session(hal, sap_ctx, session_id);
|
||||
if (QDF_STATUS_SUCCESS != qdf_ret_status) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
"Error: In %s calling sap_open_session status = %d",
|
||||
__func__, qdf_ret_status);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
qdf_ret_status = sap_set_session_param(hal, sap_ctx, session_id);
|
||||
if (QDF_STATUS_SUCCESS != qdf_ret_status) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
|
|
@ -376,13 +364,6 @@ QDF_STATUS sap_deinit_ctx(struct sap_context *sap_ctx)
|
|||
"%s: Invalid MAC context", __func__);
|
||||
return QDF_STATUS_E_FAULT;
|
||||
}
|
||||
if (QDF_STATUS_SUCCESS !=
|
||||
sap_close_session(hal, sap_ctx, NULL, false)) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
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) {
|
||||
|
|
@ -396,7 +377,7 @@ QDF_STATUS sap_deinit_ctx(struct sap_context *sap_ctx)
|
|||
QDF_STATUS sap_destroy_ctx(struct sap_context *sap_ctx)
|
||||
{
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
"wlansap_close invoked");
|
||||
"sap_destroy_ctx invoked");
|
||||
|
||||
if (NULL == sap_ctx) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
|
||||
|
|
@ -413,7 +394,7 @@ QDF_STATUS sap_destroy_ctx(struct sap_context *sap_ctx)
|
|||
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_DEBUG, FL("Exit"));
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
} /* wlansap_close */
|
||||
} /* sap_destroy_ctx */
|
||||
|
||||
bool wlansap_is_channel_in_nol_list(struct sap_context *sap_ctx,
|
||||
uint8_t channelNumber,
|
||||
|
|
|
|||
Loading…
Reference in a new issue