qcacld-3.0: Cleanup abort scan called from CSR and LIM

Cleanup abort scan called from CSR and LIM by calling
ucfg_scan_cancel api to abort the scan.

Change-Id: Ie146c60a1888a55b0da295864a9edc083fc36d1a
CRs-Fixed: 2180189
This commit is contained in:
Abhishek Singh 2018-01-29 17:38:36 +05:30 • committed by snandini
commit 9fabbbb36e
12 changed files with 99 additions and 555 deletions

View file

@ -337,7 +337,17 @@ void pe_free_msg(tpAniSirGlobal pMac, struct scheduler_msg *pMsg);
--------------------------------------------------------------------------*/
void lim_remain_on_chn_rsp(tpAniSirGlobal pMac, QDF_STATUS status, uint32_t *data);
void lim_process_abort_scan_ind(tpAniSirGlobal pMac, uint8_t sessionId,
/**
* lim_process_abort_scan_ind() - abort the scan which is presently being run
*
* @mac_ctx: Pointer to Global MAC structure
* @vdev_id: vdev_id
* @scan_id: Scan ID from the scan request
* @scan_requesor_id: Entity requesting the scan
*
* @return: None
*/
void lim_process_abort_scan_ind(tpAniSirGlobal pMac, uint8_t vdev_id,
uint32_t scan_id, uint32_t scan_requestor_id);
void __lim_process_sme_assoc_cnf_new(tpAniSirGlobal, uint32_t, uint32_t *);

View file

@ -488,9 +488,9 @@ send_rsp:
psessionEntry->ftPEContext.pFTPreAuthReq->preAuthchannelNum) ||
lim_is_in_mcc(pMac)) {
/* Need to move to the original AP channel */
lim_process_abort_scan_ind(pMac, psessionEntry->peSessionId,
lim_process_abort_scan_ind(pMac, psessionEntry->smeSessionId,
psessionEntry->ftPEContext.pFTPreAuthReq->scan_id,
PREAUTH_REQUESTOR_ID);
pMac->lim.req_id | PREAUTH_REQUESTOR_ID);
} else {
pe_debug("Pre auth on same channel as connected AP channel %d\
and no mcc pe sessions exist",
@ -714,6 +714,7 @@ QDF_STATUS lim_send_preauth_scan_offload(tpAniSirGlobal mac_ctx,
FL("Invalid scan ID"));
return QDF_STATUS_E_FAILURE;
}
ft_preauth_req->scan_id = req->scan_req.scan_id;
req->scan_req.vdev_id = session_id;
req->scan_req.scan_req_id = mac_ctx->lim.req_id | PREAUTH_REQUESTOR_ID;
req->scan_req.scan_priority = WMI_SCAN_PRIORITY_VERY_HIGH;

View file

@ -67,6 +67,8 @@
#include "wlan_reg_services_api.h"
#include "lim_security_utils.h"
#include "cds_ieee80211_common.h"
#include <wlan_scan_ucfg_api.h>
void lim_log_session_states(tpAniSirGlobal pMac);
static void lim_process_normal_hdd_msg(tpAniSirGlobal mac_ctx,
@ -1209,76 +1211,42 @@ end:
return;
} /*** end lim_handle80211_frames() ***/
/**
* lim_send_stop_scan_offload_req()
*
***FUNCTION:
* This function will be called to abort the ongoing offloaded scan
* request.
*
*
***NOTE:
*
* @param pMac Pointer to Global MAC structure
* @return QDF_STATUS_SUCCESS or QDF_STATUS_E_FAILURE
*/
static QDF_STATUS lim_send_stop_scan_offload_req(tpAniSirGlobal pMac,
uint8_t SessionId, uint32_t scan_id, uint32_t scan_requestor_id)
{
struct scheduler_msg msg = {0};
tSirRetStatus rc = eSIR_SUCCESS;
tAbortScanParams *pAbortScanParams;
pAbortScanParams = qdf_mem_malloc(sizeof(tAbortScanParams));
if (NULL == pAbortScanParams) {
pe_err("Memory allocation failed for AbortScanParams");
return QDF_STATUS_E_NOMEM;
}
pAbortScanParams->SessionId = SessionId;
pAbortScanParams->scan_id = scan_id;
pAbortScanParams->scan_requestor_id = scan_requestor_id;
msg.type = WMA_STOP_SCAN_OFFLOAD_REQ;
msg.bodyptr = pAbortScanParams;
msg.bodyval = 0;
rc = wma_post_ctrl_msg(pMac, &msg);
if (rc != eSIR_SUCCESS) {
pe_err("wma_post_ctrl_msg() return failure");
qdf_mem_free(pAbortScanParams);
return QDF_STATUS_E_FAILURE;
}
pe_debug("Abort ongoing offload scan");
return QDF_STATUS_SUCCESS;
}
/**
* lim_process_abort_scan_ind() - abort the scan which is presently being run
*
* @mac_ctx: Pointer to Global MAC structure
* @session_id: PE session
* @scan_id: Scan ID from the scan request
* @scan_requesor_id: Entity requesting the scan
*
* @return: None
*/
void lim_process_abort_scan_ind(tpAniSirGlobal mac_ctx,
uint8_t session_id, uint32_t scan_id, uint32_t scan_requestor_id)
uint8_t vdev_id, uint32_t scan_id, uint32_t scan_requestor_id)
{
#ifdef FEATURE_WLAN_DIAG_SUPPORT_LIM
lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_SCAN_ABORT_IND_EVENT,
NULL, 0, 0);
#endif
QDF_STATUS status;
struct scan_cancel_request *req;
struct wlan_objmgr_vdev *vdev;
pe_debug("scan_id %d, scan_requestor_id 0x%x",
scan_id, scan_requestor_id);
scan_id, scan_requestor_id);
/* send stop scan cmd to firmware */
lim_send_stop_scan_offload_req(mac_ctx, session_id, scan_id,
scan_requestor_id);
return;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
mac_ctx->psoc, vdev_id,
WLAN_LEGACY_MAC_ID);
if (!vdev) {
pe_debug("vdev is NULL");
return;
}
req = qdf_mem_malloc(sizeof(*req));
if (!req) {
pe_debug("failed to alloc scan cancel request");
goto fail;
}
req->vdev = vdev;
req->cancel_req.requester = scan_requestor_id;
req->cancel_req.scan_id = scan_id;
req->cancel_req.vdev_id = vdev_id;
req->cancel_req.req_type = WLAN_SCAN_CANCEL_SINGLE;
status = ucfg_scan_cancel(req);
if (QDF_IS_STATUS_ERROR(status))
pe_err("Cancel scan request failed");
fail:
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
}
static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx,
@ -1337,9 +1305,7 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx,
cds_pkt_t *body_ptr = NULL;
QDF_STATUS qdf_status;
struct scheduler_msg new_msg = {0};
tSirSmeScanAbortReq *req_msg = NULL;
uint8_t session_id;
uint32_t scan_id;
#ifdef FEATURE_WLAN_TDLS
tSirTdlsInd *tdls_ind = NULL;
@ -1493,17 +1459,6 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx,
/* Need to response to hdd */
lim_process_normal_hdd_msg(mac_ctx, msg, true);
break;
case eWNI_SME_SCAN_ABORT_IND:
req_msg = msg->bodyptr;
if (req_msg) {
session_id = req_msg->sessionId;
scan_id = req_msg->scan_id;
lim_process_abort_scan_ind(mac_ctx, session_id,
scan_id, USER_SCAN_REQUESTOR_ID);
qdf_mem_free((void *)msg->bodyptr);
msg->bodyptr = NULL;
}
break;
case eWNI_SME_PDEV_SET_HT_VHT_IE:
case eWNI_SME_SET_VDEV_IES_PER_BAND:
case eWNI_SME_SYS_READY_IND:

View file

@ -231,7 +231,6 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg)
switch (sme_msg) {
CASE_RETURN_STRING(eWNI_SME_SYS_READY_IND);
CASE_RETURN_STRING(eWNI_SME_SCAN_REQ);
CASE_RETURN_STRING(eWNI_SME_SCAN_ABORT_IND);
CASE_RETURN_STRING(eWNI_SME_SCAN_RSP);
CASE_RETURN_STRING(eWNI_SME_JOIN_REQ);
CASE_RETURN_STRING(eWNI_SME_JOIN_RSP);
@ -519,7 +518,6 @@ uint8_t *mac_trace_get_wma_msg_string(uint16_t wma_msg)
CASE_RETURN_STRING(WMA_UPDATE_MEMBERSHIP);
CASE_RETURN_STRING(WMA_UPDATE_USERPOS);
CASE_RETURN_STRING(WMA_START_SCAN_OFFLOAD_REQ);
CASE_RETURN_STRING(WMA_STOP_SCAN_OFFLOAD_REQ);
CASE_RETURN_STRING(WMA_UPDATE_CHAN_LIST_REQ);
CASE_RETURN_STRING(WMA_CLI_SET_CMD);
#ifndef REMOVE_PKT_LOG

View file

@ -1469,9 +1469,6 @@ uint32_t csr_scan_pending_ll_count(struct sAniSirGlobal *mac_ctx);
bool csr_scan_active_ll_is_list_empty(
struct sAniSirGlobal *mac_ctx,
bool inter_locked);
bool csr_scan_pending_ll_is_list_empty(
struct sAniSirGlobal *mac_ctx,
bool inter_locked);
bool csr_scan_active_ll_remove_entry(
struct sAniSirGlobal *mac_ctx,
tListElem *entry, bool inter_locked);

View file

@ -8327,8 +8327,8 @@ QDF_STATUS csr_roam_issue_connect(tpAniSirGlobal pMac, uint32_t sessionId,
status = QDF_STATUS_E_RESOURCES;
} else {
if (fClearScan)
csr_scan_abort_mac_scan_not_for_connect(pMac,
sessionId);
csr_scan_abort_mac_scan(pMac, sessionId, INVAL_SCAN_ID);
pCommand->u.roamCmd.fReleaseProfile = false;
if (NULL == pProfile) {
/* We can roam now
@ -8390,7 +8390,7 @@ QDF_STATUS csr_roam_issue_reassoc(tpAniSirGlobal pMac, uint32_t sessionId,
sme_err("fail to get command buffer");
status = QDF_STATUS_E_RESOURCES;
} else {
csr_scan_abort_mac_scan_not_for_connect(pMac, sessionId);
csr_scan_abort_mac_scan(pMac, sessionId, INVAL_SCAN_ID);
if (pProfile) {
/* This is likely trying to reassoc to
* different profile
@ -8562,10 +8562,7 @@ QDF_STATUS csr_roam_connect(tpAniSirGlobal pMac, uint32_t sessionId,
pProfile->BSSType, pProfile->AuthType.authType[0],
pProfile->EncryptionType.encryptionType[0]);
csr_roam_cancel_roaming(pMac, sessionId);
csr_scan_remove_fresh_scan_command(pMac, sessionId);
csr_scan_abort_mac_scan(pMac, sessionId,
INVALID_SCAN_ID,
eCSR_SCAN_ABORT_DEFAULT);
csr_scan_abort_mac_scan(pMac, sessionId, INVAL_SCAN_ID);
csr_roam_remove_duplicate_command(pMac, sessionId, NULL, eCsrHddIssued);
/* Check whether ssid changes */
if (csr_is_conn_state_connected(pMac, sessionId) &&
@ -8771,8 +8768,7 @@ csr_roam_reassoc(tpAniSirGlobal mac_ctx, uint32_t session_id,
profile->BSSType, profile->AuthType.authType[0],
profile->EncryptionType.encryptionType[0]);
csr_roam_cancel_roaming(mac_ctx, session_id);
csr_scan_remove_fresh_scan_command(mac_ctx, session_id);
csr_scan_abort_mac_scan_not_for_connect(mac_ctx, session_id);
csr_scan_abort_mac_scan(mac_ctx, session_id, INVAL_SCAN_ID);
csr_roam_remove_duplicate_command(mac_ctx, session_id, NULL,
eCsrHddIssuedReassocToSameAP);
if (csr_is_conn_state_connected(mac_ctx, session_id)) {
@ -8836,7 +8832,7 @@ static QDF_STATUS csr_roam_join_last_profile(tpAniSirGlobal pMac,
}
if (pSession->pCurRoamProfile) {
csr_scan_abort_mac_scan_not_for_connect(pMac, sessionId);
csr_scan_abort_mac_scan(pMac, sessionId, INVAL_SCAN_ID);
/* We have to make a copy of pCurRoamProfile because it
* will be free inside csr_roam_issue_connect
*/
@ -9175,7 +9171,7 @@ QDF_STATUS csr_roam_disconnect_internal(tpAniSirGlobal pMac, uint32_t sessionId,
} else {
pMac->roam.roamSession[sessionId].connectState =
eCSR_ASSOC_STATE_TYPE_INFRA_DISCONNECTING;
csr_scan_abort_scan_for_ssid(pMac, sessionId);
csr_scan_abort_mac_scan(pMac, sessionId, INVAL_SCAN_ID);
status = QDF_STATUS_CMD_NOT_QUEUED;
sme_debug("Disconnect cmd not queued, Roam command is not present return with status: %d",
status);
@ -12566,8 +12562,7 @@ void csr_roam_cancel_roaming(tpAniSirGlobal pMac, uint32_t sessionId)
/* Since CSR may be in lostlink roaming situation,
* abort all roaming related activities
*/
csr_scan_abort_mac_scan(pMac, sessionId,
INVALID_SCAN_ID, eCSR_SCAN_ABORT_DEFAULT);
csr_scan_abort_mac_scan(pMac, sessionId, INVAL_SCAN_ID);
csr_roam_stop_roaming_timer(pMac, sessionId);
}
}
@ -20928,8 +20923,8 @@ void csr_process_set_hw_mode(tpAniSirGlobal mac, tSmeCmd *command)
if (command->u.set_hw_mode_cmd.reason ==
POLICY_MGR_UPDATE_REASON_HIDDEN_STA) {
sme_err("clear any pending scan command");
status = csr_scan_abort_mac_scan_not_for_connect(mac,
command->u.set_hw_mode_cmd.session_id);
status = csr_scan_abort_mac_scan(mac,
command->u.set_hw_mode_cmd.session_id, INVAL_SCAN_ID);
if (!QDF_IS_STATUS_SUCCESS(status)) {
sme_err("Failed to clear scan cmd");
goto fail;

View file

@ -3886,62 +3886,6 @@ void csr_scan_call_callback(tpAniSirGlobal pMac, tSmeCmd *pCommand,
}
}
bool csr_scan_remove_fresh_scan_command(tpAniSirGlobal pMac, uint8_t sessionId)
{
bool fRet = false;
tListElem *pEntry, *pEntryTmp;
tSmeCmd *pCommand;
tDblLinkList localList;
qdf_mem_zero(&localList, sizeof(tDblLinkList));
if (!QDF_IS_STATUS_SUCCESS(csr_ll_open(pMac->hHdd, &localList))) {
sme_err("failed to open list");
return fRet;
}
csr_scan_pending_ll_lock(pMac);
pEntry = csr_scan_pending_ll_peek_head(pMac, LL_ACCESS_NOLOCK);
while (pEntry) {
pEntryTmp = csr_scan_pending_ll_next(pMac, pEntry,
LL_ACCESS_NOLOCK);
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
if (!((eSmeCommandScan == pCommand->command)
&& (sessionId == pCommand->sessionId))) {
pEntry = pEntryTmp;
continue;
}
sme_debug("-------- abort scan command reason = %d",
pCommand->u.scanCmd.reason);
/* The rest are fresh scan requests */
if (csr_scan_pending_ll_remove_entry(pMac, pEntry,
LL_ACCESS_NOLOCK)) {
csr_ll_insert_tail(&localList, pEntry,
LL_ACCESS_NOLOCK);
}
fRet = true;
pEntry = pEntryTmp;
}
csr_scan_pending_ll_unlock(pMac);
while ((pEntry = csr_ll_remove_head(&localList, LL_ACCESS_NOLOCK))) {
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
if (pCommand->u.scanCmd.callback) {
/*
* User scan request is pending, send response with
* status eCSR_SCAN_ABORT
*/
pCommand->u.scanCmd.callback(pMac,
pCommand->u.scanCmd.pContext, sessionId,
pCommand->u.scanCmd.scanID, eCSR_SCAN_ABORT);
}
csr_release_command(pMac, pCommand);
}
csr_ll_close(&localList);
return fRet;
}
QDF_STATUS csr_scan_get_pmkid_candidate_list(tpAniSirGlobal pMac,
uint32_t sessionId,
tPmkidCandidateInfo *pPmkidList,
@ -4444,61 +4388,50 @@ void csr_set_cfg_scan_control_list(tpAniSirGlobal pMac, uint8_t *countryCode,
} /* AllocateMemory */
}
/**
* csr_scan_abort_all_scans() - Abort scan on all Sessions
* @mac_ctx: pointer to Global Mac structure
* @reason: reason for cancelling scan
*
* Abort scan on all Sessions
*
* Return: QDF_STATUS
*/
QDF_STATUS csr_scan_abort_all_scans(tpAniSirGlobal mac_ctx,
eCsrAbortReason reason)
QDF_STATUS csr_scan_abort_mac_scan(tpAniSirGlobal mac_ctx, uint8_t vdev_id,
uint32_t scan_id)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
uint8_t session_id;
struct scan_cancel_request *req;
QDF_STATUS status;
struct wlan_objmgr_vdev *vdev;
mac_ctx->scan.fDropScanCmd = true;
for (session_id = 0; session_id < CSR_ROAM_SESSION_MAX; session_id++) {
if (CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
csr_remove_cmd_from_pending_list(
mac_ctx,
session_id, INVALID_SCAN_ID,
eSmeCommandScan);
csr_abort_scan_from_active_list(mac_ctx,
session_id, INVALID_SCAN_ID, eSmeCommandScan,
reason);
}
req = qdf_mem_malloc(sizeof(*req));
if (!req) {
sme_err("Failed to allocate memory");
return QDF_STATUS_E_NOMEM;
}
mac_ctx->scan.fDropScanCmd = false;
return status;
}
/* Get NL global context from objmgr*/
if (vdev_id == INVAL_VDEV_ID)
vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac_ctx->pdev,
0, WLAN_LEGACY_SME_ID);
else
vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac_ctx->pdev,
vdev_id, WLAN_LEGACY_SME_ID);
QDF_STATUS csr_scan_abort_mac_scan(tpAniSirGlobal pMac, uint8_t sessionId,
uint32_t scan_id, eCsrAbortReason reason)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
QDF_STATUS ret;
pMac->scan.fDropScanCmd = true;
ret = csr_remove_cmd_from_pending_list(pMac,
sessionId, scan_id, eSmeCommandScan);
pMac->scan.fDropScanCmd = false;
/*
* If we are not able to find command for scan id in
* pending list, check active list. Also if the session
* id is valid then we have to check below active list.
*/
if (ret != QDF_STATUS_SUCCESS ||
sessionId != CSR_SESSION_ID_INVALID) {
status = csr_abort_scan_from_active_list(pMac,
sessionId, scan_id,
eSmeCommandScan, reason);
if (!vdev) {
sme_err("Failed get vdev");
qdf_mem_free(req);
return QDF_STATUS_E_INVAL;
}
req->vdev = vdev;
req->cancel_req.scan_id = scan_id;
req->cancel_req.pdev_id = wlan_objmgr_pdev_get_pdev_id(mac_ctx->pdev);
req->cancel_req.vdev_id = vdev_id;
if (scan_id != INVAL_SCAN_ID)
req->cancel_req.req_type = WLAN_SCAN_CANCEL_SINGLE;
if (vdev_id == INVAL_VDEV_ID)
req->cancel_req.req_type = WLAN_SCAN_CANCEL_PDEV_ALL;
else
req->cancel_req.req_type = WLAN_SCAN_CANCEL_VDEV_ALL;
status = ucfg_scan_cancel(req);
if (QDF_IS_STATUS_ERROR(status))
sme_err("Cancel scan request failed");
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
return status;
}
QDF_STATUS csr_remove_nonscan_cmd_from_pending_list(tpAniSirGlobal pMac,
@ -4555,237 +4488,6 @@ QDF_STATUS csr_remove_nonscan_cmd_from_pending_list(tpAniSirGlobal pMac,
csr_ll_close(&localList);
return status;
}
QDF_STATUS csr_remove_cmd_from_pending_list(tpAniSirGlobal pMac,
uint8_t sessionId,
uint32_t scan_id,
eSmeCommandType commandType)
{
tDblLinkList localList;
tListElem *pEntry;
tSmeCmd *pCommand;
tListElem *pEntryToRemove;
QDF_STATUS status = QDF_STATUS_E_FAILURE;
qdf_mem_zero(&localList, sizeof(tDblLinkList));
if (!QDF_IS_STATUS_SUCCESS(csr_ll_open(pMac->hHdd, &localList))) {
sme_err("failed to open list");
return status;
}
csr_scan_pending_ll_lock(pMac);
pEntry = csr_scan_pending_ll_peek_head(pMac, LL_ACCESS_NOLOCK);
/*
* Have to make sure we don't loop back to the head of the list,
* which will happen if the entry is NOT on the list
*/
while (pEntry) {
pEntryToRemove = pEntry;
pEntry = csr_scan_pending_ll_next(pMac, pEntry,
LL_ACCESS_NOLOCK);
pCommand = GET_BASE_ADDR(pEntryToRemove, tSmeCmd, Link);
if ((pCommand->command == commandType) &&
(((commandType == eSmeCommandScan) &&
(pCommand->u.scanCmd.scanID == scan_id)) ||
(pCommand->sessionId == sessionId))) {
/* Remove that entry only */
if (csr_scan_pending_ll_remove_entry(pMac,
pEntryToRemove, LL_ACCESS_NOLOCK)) {
csr_ll_insert_tail(&localList, pEntryToRemove,
LL_ACCESS_NOLOCK);
status = QDF_STATUS_SUCCESS;
}
}
}
csr_scan_pending_ll_unlock(pMac);
while ((pEntry = csr_ll_remove_head(&localList, LL_ACCESS_NOLOCK))) {
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
sme_debug("Sending abort for command ID %d",
(commandType == eSmeCommandScan) ? pCommand->u.
scanCmd.scanID : sessionId);
csr_release_command(pMac, pCommand);
}
csr_ll_close(&localList);
return status;
}
QDF_STATUS csr_scan_abort_scan_for_ssid(tpAniSirGlobal pMac, uint32_t sessionId)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
pMac->scan.fDropScanCmd = true;
csr_remove_scan_for_ssid_from_pending_list(pMac, sessionId);
pMac->scan.fDropScanCmd = false;
csr_abort_scan_from_active_list(pMac,
sessionId, INVALID_SCAN_ID, eSmeCommandScan,
eCSR_SCAN_ABORT_SSID_ONLY);
return status;
}
void csr_remove_scan_for_ssid_from_pending_list(tpAniSirGlobal pMac,
uint32_t sessionId)
{
tDblLinkList localList;
tListElem *pEntry;
tSmeCmd *pCommand;
tListElem *pEntryToRemove;
qdf_mem_zero(&localList, sizeof(tDblLinkList));
if (!QDF_IS_STATUS_SUCCESS(csr_ll_open(pMac->hHdd, &localList))) {
sme_err("failed to open list");
return;
}
csr_scan_pending_ll_lock(pMac);
if (!csr_scan_pending_ll_is_list_empty(pMac, LL_ACCESS_NOLOCK)) {
pEntry = csr_scan_pending_ll_peek_head(pMac, LL_ACCESS_NOLOCK);
/*
* Have to make sure we don't loop back to the head of the list,
* which will happen if the entry is NOT on the list...
*/
while (pEntry) {
pEntryToRemove = pEntry;
pEntry = csr_scan_pending_ll_next(pMac, pEntry,
LL_ACCESS_NOLOCK);
pCommand = GET_BASE_ADDR(pEntryToRemove, tSmeCmd, Link);
if (!((eSmeCommandScan == pCommand->command) &&
(sessionId == pCommand->sessionId)))
continue;
if (eCsrScanForSsid != pCommand->u.scanCmd.reason)
continue;
/* Remove that entry only */
if (csr_scan_pending_ll_remove_entry(pMac,
pEntryToRemove, LL_ACCESS_NOLOCK)) {
csr_ll_insert_tail(&localList, pEntryToRemove,
LL_ACCESS_NOLOCK);
}
}
}
csr_scan_pending_ll_unlock(pMac);
while ((pEntry = csr_ll_remove_head(&localList, LL_ACCESS_NOLOCK))) {
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
csr_release_command(pMac, pCommand);
}
csr_ll_close(&localList);
}
/**
* csr_send_scan_abort() - Sends scan abort command to firmware
* @mac_ctx: Pointer to Global Mac structure
* @session_id: CSR session identification
* @scan_id: scan identifier
*
* .Sends scan abort command to firmware
*
* Return: None
*/
static void csr_send_scan_abort(tpAniSirGlobal mac_ctx,
uint32_t session_id, uint32_t scan_id)
{
tSirSmeScanAbortReq *msg;
uint16_t msg_len;
QDF_STATUS status = QDF_STATUS_SUCCESS;
msg_len = (uint16_t)(sizeof(tSirSmeScanAbortReq));
msg = qdf_mem_malloc(msg_len);
if (NULL == msg) {
sme_err("Failed to alloc memory for SmeScanAbortReq");
return;
}
msg->type = eWNI_SME_SCAN_ABORT_IND;
msg->msgLen = msg_len;
msg->sessionId = session_id;
msg->scan_id = scan_id;
sme_debug(
"Abort scan sent to Firmware scan_id %d session %d",
scan_id, session_id);
status = umac_send_mb_message_to_mac(msg);
if (!QDF_IS_STATUS_SUCCESS(status)) {
sme_err("Failed to send abort scan.scan_id %d session %d",
scan_id, session_id);
}
}
/**
* csr_abort_scan_from_active_list() - Remove Scan command from active list
* @mac_ctx: Pointer to Global Mac structure
* @list: pointer to scan active list
* @session_id: CSR session identification
* @scan_id: scan id
* @scan_cmd_type: scan command type
* @abort_reason: abort reason
*
* Remove Scan command from active scan list by matching either the scan id
* or session id.
*
* Return: Success - QDF_STATUS_SUCCESS, Failure - error number
*/
QDF_STATUS csr_abort_scan_from_active_list(tpAniSirGlobal mac_ctx,
uint32_t session_id, uint32_t scan_id,
eSmeCommandType scan_cmd_type, eCsrAbortReason abort_reason)
{
tListElem *entry;
tSmeCmd *cmd;
tListElem *entry_remove;
QDF_STATUS status = QDF_STATUS_SUCCESS;
csr_scan_active_ll_lock(mac_ctx);
if (!csr_scan_active_ll_is_list_empty(mac_ctx, LL_ACCESS_NOLOCK)) {
entry = csr_scan_active_ll_peek_head(mac_ctx, LL_ACCESS_NOLOCK);
while (entry) {
entry_remove = entry;
entry = csr_scan_active_ll_next(mac_ctx, entry,
LL_ACCESS_NOLOCK);
cmd = GET_BASE_ADDR(entry_remove, tSmeCmd, Link);
/*skip if abort reason is for SSID*/
if ((abort_reason == eCSR_SCAN_ABORT_SSID_ONLY) &&
(eCsrScanForSsid != cmd->u.scanCmd.reason))
continue;
/*
* Do not skip if command and either session id
* or scan id is matched
*/
if ((cmd->command == scan_cmd_type) &&
((cmd->u.scanCmd.scanID == scan_id) ||
(cmd->sessionId == session_id))) {
if (abort_reason ==
eCSR_SCAN_ABORT_DUE_TO_BAND_CHANGE)
cmd->u.scanCmd.abort_scan_indication =
eCSR_SCAN_ABORT_DUE_TO_BAND_CHANGE;
csr_send_scan_abort(mac_ctx, cmd->sessionId,
cmd->u.scanCmd.scanID);
}
}
}
csr_scan_active_ll_unlock(mac_ctx);
return status;
}
QDF_STATUS csr_scan_abort_mac_scan_not_for_connect(tpAniSirGlobal pMac,
uint8_t sessionId)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
if (!csr_is_scan_for_roam_command_active(pMac, sessionId)) {
/*
* Only abort the scan if it is not used for other roam/connect
* purpose
*/
status = csr_scan_abort_mac_scan(pMac, sessionId,
INVALID_SCAN_ID, eCSR_SCAN_ABORT_DEFAULT);
}
return status;
}
bool csr_roam_is_valid_channel(tpAniSirGlobal pMac, uint8_t channel)
{
bool fValid = false;
@ -5022,43 +4724,16 @@ csr_get_bssdescr_from_scan_handle(tScanResultHandle result_handle,
void csr_scan_active_list_timeout_handle(void *userData)
{
tSmeCmd *scan_cmd = (tSmeCmd *) userData;
tHalHandle *hal_ctx = cds_get_context(QDF_MODULE_ID_PE);
tpAniSirGlobal mac_ctx;
uint16_t scan_id;
tSirSmeScanAbortReq *msg;
uint16_t msg_len;
QDF_STATUS status = QDF_STATUS_SUCCESS;
if (scan_cmd == NULL) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("Scan Timeout: Scan command is NULL"));
return;
}
if (hal_ctx == NULL) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
FL("HAL Context is NULL"));
return;
}
mac_ctx = PMAC_STRUCT(hal_ctx);
scan_id = scan_cmd->u.scanCmd.scanID;
sme_err("Scan Timeout:Sending abort to Firmware ID %d session %d",
scan_id, scan_cmd->sessionId);
msg_len = (uint16_t)(sizeof(tSirSmeScanAbortReq));
msg = qdf_mem_malloc(msg_len);
if (NULL == msg) {
sme_err("Failed to alloc memory for SmeScanAbortReq");
return;
}
msg->type = eWNI_SME_SCAN_ABORT_IND;
msg->msgLen = msg_len;
msg->sessionId = scan_cmd->sessionId;
msg->scan_id = scan_id;
status = umac_send_mb_message_to_mac(msg);
if (!QDF_IS_STATUS_SUCCESS(status))
sme_err("Failed to post message to LIM");
scan_cmd->u.scanCmd.status = eCSR_SCAN_FAILURE;
csr_release_command(mac_ctx, scan_cmd);
}
static enum wlan_auth_type csr_covert_auth_type_new(eCsrAuthType auth)

View file

@ -291,42 +291,20 @@ QDF_STATUS csr_scan_free_request(tpAniSirGlobal pMac, tCsrScanRequest *pReq);
QDF_STATUS csr_scan_for_ssid(tpAniSirGlobal pMac, uint32_t sessionId,
tCsrRoamProfile *pProfile, uint32_t roamId,
bool notify);
/* To remove fresh scan commands from the pending queue */
bool csr_scan_remove_fresh_scan_command(tpAniSirGlobal pMac, uint8_t sessionId);
QDF_STATUS csr_scan_abort_mac_scan(tpAniSirGlobal pMac, uint8_t sessionId,
uint32_t scan_id, eCsrAbortReason reason);
QDF_STATUS csr_scan_abort_all_scans(tpAniSirGlobal mac_ctx,
eCsrAbortReason reason);
/**
* csr_remove_cmd_from_pending_list() - Remove command from
* pending list
* @pMac: Pointer to Global MAC structure
* @sessionId: session id
* csr_scan_abort_mac_scan() - Generic API to abort scan request
* @pMac: pointer to pmac
* @vdev_id: pdev id
* @scan_id: scan id
* @pList: pointer to pending command list
* @commandType: sme command type
*
* Remove command from pending list by matching either
* scan id or session id.
* Generic API to abort scans
*
* Return: QDF_STATUS_SUCCESS for success, QDF_STATUS_E_FAILURE
* for failure
* Return: 0 for success, non zero for failure
*/
QDF_STATUS csr_remove_cmd_from_pending_list(tpAniSirGlobal pMac,
uint8_t sessionId, uint32_t scan_id,
eSmeCommandType commandType);
QDF_STATUS csr_scan_abort_mac_scan(tpAniSirGlobal pMac, uint8_t vdev_id,
uint32_t scan_id);
QDF_STATUS csr_remove_nonscan_cmd_from_pending_list(tpAniSirGlobal pMac,
uint8_t sessionId, eSmeCommandType commandType);
QDF_STATUS csr_scan_abort_mac_scan_not_for_connect(tpAniSirGlobal pMac,
uint8_t sessionId);
QDF_STATUS csr_scan_abort_scan_for_ssid(tpAniSirGlobal pMac,
uint32_t sessionId);
void csr_remove_scan_for_ssid_from_pending_list(tpAniSirGlobal pMac,
uint32_t sessionId);
QDF_STATUS csr_abort_scan_from_active_list(tpAniSirGlobal pMac,
uint32_t sessionId, uint32_t scan_id,
eSmeCommandType scan_cmd_type, eCsrAbortReason abort_reason);
/* If fForce is true we will save the new String that is learn't. */
/* Typically it will be true in case of Join or user initiated ioctl */

View file

@ -492,11 +492,6 @@ bool csr_scan_active_ll_is_list_empty(struct sAniSirGlobal *mac_ctx,
return !wlan_serialization_get_active_list_count(mac_ctx->psoc, true);
}
bool csr_scan_pending_ll_is_list_empty(struct sAniSirGlobal *mac_ctx,
bool inter_locked)
{
return !wlan_serialization_get_pending_list_count(mac_ctx->psoc, true);
}
bool csr_nonscan_active_ll_is_list_empty(struct sAniSirGlobal *mac_ctx,
bool inter_locked)

View file

@ -248,9 +248,6 @@ QDF_STATUS wma_get_buf_stop_scan_cmd(tp_wma_handle wma_handle,
QDF_STATUS wma_start_scan(tp_wma_handle wma_handle,
tSirScanOffloadReq *scan_req, uint16_t msg_type);
QDF_STATUS wma_stop_scan(tp_wma_handle wma_handle,
tAbortScanParams *abort_scan_req);
QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
tSirUpdateChanList *chan_list);

View file

@ -7560,10 +7560,6 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
wma_start_scan(wma_handle, msg->bodyptr, msg->type);
qdf_mem_free(msg->bodyptr);
break;
case WMA_STOP_SCAN_OFFLOAD_REQ:
wma_stop_scan(wma_handle, msg->bodyptr);
qdf_mem_free(msg->bodyptr);
break;
case WMA_UPDATE_CHAN_LIST_REQ:
wma_update_channel_list(wma_handle,
(tSirUpdateChanList *) msg->bodyptr);

View file

@ -609,46 +609,6 @@ error1:
return qdf_status;
}
/**
* wma_stop_scan() - stop scan command
* @wma_handle: wma handle
* @abort_scan_req: abort scan params
*
* Send stop scan command to fw.
*
* Return: QDF status
*/
QDF_STATUS wma_stop_scan(tp_wma_handle wma_handle,
tAbortScanParams *abort_scan_req)
{
QDF_STATUS qdf_status;
struct scan_cancel_param scan_param = {0};
scan_param.vdev_id = abort_scan_req->SessionId;
scan_param.requester = abort_scan_req->scan_requestor_id;
scan_param.scan_id = abort_scan_req->scan_id;
/* stop the scan with the corresponding scan_id */
scan_param.req_type = WLAN_SCAN_CANCEL_SINGLE;
qdf_status = wmi_unified_scan_stop_cmd_send(wma_handle->wmi_handle,
&scan_param);
/* Call the wmi api to request the scan */
if (QDF_IS_STATUS_ERROR(qdf_status)) {
WMA_LOGE("wmi_unified_cmd_send WMI_STOP_SCAN_CMDID returned Error %d",
qdf_status);
goto error;
}
WMA_LOGI("scan_id 0x%x, scan_requestor_id 0x%x, vdev_id %d",
abort_scan_req->scan_id,
abort_scan_req->scan_requestor_id,
abort_scan_req->SessionId);
WMA_LOGI("WMA --> WMI_STOP_SCAN_CMDID");
return QDF_STATUS_SUCCESS;
error:
return qdf_status;
}
/**
* wma_update_channel_list() - update channel list
* @handle: wma handle
@ -5978,19 +5938,6 @@ void wma_roam_better_ap_handler(tp_wma_handle wma, uint32_t vdev_id)
{
struct scheduler_msg cds_msg = {0};
tSirSmeCandidateFoundInd *candidate_ind;
struct scan_param *params;
params = &wma->interfaces[vdev_id].scan_info;
/* abort existing scans from GUI, but not roaming preauth scan */
if (params->scan_id != 0 && params->chan_freq == 0 &&
params->scan_requestor_id == USER_SCAN_REQUESTOR_ID) {
tAbortScanParams abortScan;
abortScan.SessionId = vdev_id;
abortScan.scan_id = params->scan_id;
abortScan.scan_requestor_id = params->scan_requestor_id;
wma_stop_scan(wma, &abortScan);
}
candidate_ind = qdf_mem_malloc(sizeof(tSirSmeCandidateFoundInd));
if (!candidate_ind) {