mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
qcacld-3.0: Create wrapper APIs from csr_ll_lock and csr_ll_unlock
To make convergence easier, create wrapper API to lock and unlock active command list and pending command list Change-Id: Ic4bad27a2520c3c1f2af9fcb6d20a99f640f91a1 CRs-Fixed: 2005532
This commit is contained in:
parent
c1225608ef
commit
20126cbd4f
5 changed files with 60 additions and 42 deletions
|
|
@ -1401,6 +1401,11 @@ QDF_STATUS csr_scan_process_single_bssdescr(tpAniSirGlobal pMac,
|
|||
tSirBssDescription *pSirBssDescription,
|
||||
uint32_t scan_id, uint32_t flags);
|
||||
|
||||
void csr_nonscan_pending_ll_unlock(struct sAniSirGlobal *mac_ctx);
|
||||
void csr_nonscan_active_ll_unlock(struct sAniSirGlobal *mac_ctx);
|
||||
void csr_nonscan_pending_ll_lock(struct sAniSirGlobal *mac_ctx);
|
||||
void csr_nonscan_active_ll_lock(struct sAniSirGlobal *mac_ctx);
|
||||
|
||||
bool csr_wait_for_connection_update(tpAniSirGlobal mac,
|
||||
bool do_release_reacquire_lock);
|
||||
enum tQDF_ADAPTER_MODE csr_get_session_persona(tpAniSirGlobal pmac,
|
||||
|
|
|
|||
|
|
@ -202,7 +202,6 @@ void sme_process_pending_queue(tpAniSirGlobal pMac);
|
|||
void sme_release_command(tpAniSirGlobal pMac, tSmeCmd *pCmd);
|
||||
void purge_sme_session_cmd_list(tpAniSirGlobal pMac, uint32_t sessionId,
|
||||
tDblLinkList *pList);
|
||||
bool sme_command_pending(tpAniSirGlobal pMac);
|
||||
bool qos_process_command(tpAniSirGlobal pMac, tSmeCmd *pCommand);
|
||||
void qos_release_command(tpAniSirGlobal pMac, tSmeCmd *pCommand);
|
||||
QDF_STATUS csr_process_scan_command(tpAniSirGlobal pMac, tSmeCmd *pCommand);
|
||||
|
|
|
|||
|
|
@ -560,7 +560,7 @@ tSmeCmd *sme_get_command_buffer(tpAniSirGlobal pMac)
|
|||
} /* if(pTempCmd) */
|
||||
|
||||
/* dump what is in the pending queue */
|
||||
csr_ll_lock(&pMac->sme.smeCmdPendingList);
|
||||
csr_nonscan_pending_ll_lock(pMac);
|
||||
pEntry =
|
||||
csr_ll_peek_head(&pMac->sme.smeCmdPendingList,
|
||||
LL_ACCESS_NOLOCK);
|
||||
|
|
@ -580,7 +580,7 @@ tSmeCmd *sme_get_command_buffer(tpAniSirGlobal pMac)
|
|||
csr_ll_next(&pMac->sme.smeCmdPendingList, pEntry,
|
||||
LL_ACCESS_NOLOCK);
|
||||
}
|
||||
csr_ll_unlock(&pMac->sme.smeCmdPendingList);
|
||||
csr_nonscan_pending_ll_unlock(pMac);
|
||||
|
||||
if (pMac->roam.configParam.enable_fatal_event)
|
||||
cds_flush_logs(WLAN_LOG_TYPE_FATAL,
|
||||
|
|
@ -798,17 +798,17 @@ static bool sme_process_command(tpAniSirGlobal pMac)
|
|||
* a pending command...
|
||||
* alwasy lock active list before locking pending list
|
||||
*/
|
||||
csr_ll_lock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_lock(pMac);
|
||||
if (!csr_ll_is_list_empty(&pMac->sme.smeCmdActiveList,
|
||||
LL_ACCESS_NOLOCK)) {
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
goto process_scan_q;
|
||||
}
|
||||
|
||||
if (csr_ll_is_list_empty(&pMac->sme.smeCmdPendingList,
|
||||
LL_ACCESS_LOCK)) {
|
||||
/* No command waiting */
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
goto process_scan_q;
|
||||
}
|
||||
|
||||
|
|
@ -836,7 +836,7 @@ static bool sme_process_command(tpAniSirGlobal pMac)
|
|||
pEntry = csr_ll_peek_head(&pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK);
|
||||
sme_process_cmd:
|
||||
if (!pEntry) {
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
goto process_scan_q;
|
||||
}
|
||||
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
|
||||
|
|
@ -848,7 +848,7 @@ sme_process_cmd:
|
|||
&& !CSR_IS_DISCONNECT_COMMAND(pCommand)
|
||||
&& !CSR_IS_SET_KEY_COMMAND(pCommand)) {
|
||||
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
sms_log(pMac, LOGE,
|
||||
FL("SessionId %d: Can't process cmd(%d), waiting for key"),
|
||||
pCommand->sessionId, pCommand->command);
|
||||
|
|
@ -859,7 +859,7 @@ sme_process_cmd:
|
|||
if (!csr_ll_remove_entry(&pMac->sme.smeCmdPendingList, pEntry,
|
||||
LL_ACCESS_LOCK)) {
|
||||
/* This is odd. Some one else pull off the command. */
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
goto process_scan_q;
|
||||
}
|
||||
/* we can reuse the pCommand. Insert the command onto the ActiveList */
|
||||
|
|
@ -871,11 +871,11 @@ sme_process_cmd:
|
|||
|
||||
switch (pCommand->command) {
|
||||
case eSmeCommandScan:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
status = csr_process_scan_command(pMac, pCommand);
|
||||
break;
|
||||
case eSmeCommandRoam:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
status = csr_roam_process_command(pMac, pCommand);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)
|
||||
&& csr_ll_remove_entry(&pMac->sme.smeCmdActiveList,
|
||||
|
|
@ -883,11 +883,11 @@ sme_process_cmd:
|
|||
csr_release_command(pMac, pCommand);
|
||||
break;
|
||||
case eSmeCommandWmStatusChange:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
csr_roam_process_wm_status_change_command(pMac, pCommand);
|
||||
break;
|
||||
case eSmeCommandSetKey:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
status = csr_roam_process_set_key_command(pMac, pCommand);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)
|
||||
&& csr_ll_remove_entry(&pMac->sme.smeCmdActiveList,
|
||||
|
|
@ -896,7 +896,7 @@ sme_process_cmd:
|
|||
}
|
||||
break;
|
||||
case eSmeCommandNdpInitiatorRequest:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
if (csr_process_ndp_initiator_request(pMac, pCommand) !=
|
||||
QDF_STATUS_SUCCESS)
|
||||
if (csr_ll_remove_entry(
|
||||
|
|
@ -905,7 +905,7 @@ sme_process_cmd:
|
|||
csr_release_command(pMac, pCommand);
|
||||
break;
|
||||
case eSmeCommandNdpResponderRequest:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
status = csr_process_ndp_responder_request(pMac, pCommand);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
if (csr_ll_remove_entry(&pMac->sme.smeCmdActiveList,
|
||||
|
|
@ -914,7 +914,7 @@ sme_process_cmd:
|
|||
}
|
||||
break;
|
||||
case eSmeCommandNdpDataEndInitiatorRequest:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
status = csr_process_ndp_data_end_request(pMac, pCommand);
|
||||
if (status != QDF_STATUS_SUCCESS) {
|
||||
if (csr_ll_remove_entry(&pMac->sme.smeCmdActiveList,
|
||||
|
|
@ -923,7 +923,7 @@ sme_process_cmd:
|
|||
}
|
||||
break;
|
||||
case eSmeCommandRemainOnChannel:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
status = p2p_process_remain_on_channel_cmd(pMac, pCommand);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)
|
||||
&& csr_ll_remove_entry(&pMac->sme.smeCmdActiveList,
|
||||
|
|
@ -938,7 +938,7 @@ sme_process_cmd:
|
|||
break;
|
||||
case eSmeCommandAddTs:
|
||||
case eSmeCommandDelTs:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
#ifndef WLAN_MDM_CODE_REDUCTION_OPT
|
||||
fContinue = qos_process_command(pMac, pCommand);
|
||||
if (fContinue && csr_ll_remove_entry(
|
||||
|
|
@ -957,7 +957,7 @@ sme_process_cmd:
|
|||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO,
|
||||
FL("sending TDLS Command 0x%x to PE"),
|
||||
pCommand->command);
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
status = csr_tdls_process_cmd(pMac, pCommand);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
if (csr_ll_remove_entry(&pMac->sme.smeCmdActiveList,
|
||||
|
|
@ -971,19 +971,19 @@ sme_process_cmd:
|
|||
break;
|
||||
#endif
|
||||
case e_sme_command_set_hw_mode:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
csr_process_set_hw_mode(pMac, pCommand);
|
||||
break;
|
||||
case e_sme_command_nss_update:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
csr_process_nss_update_req(pMac, pCommand);
|
||||
break;
|
||||
case e_sme_command_set_dual_mac_config:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
csr_process_set_dual_mac_config(pMac, pCommand);
|
||||
break;
|
||||
case e_sme_command_set_antenna_mode:
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
csr_process_set_antenna_mode(pMac, pCommand);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -993,7 +993,7 @@ sme_process_cmd:
|
|||
pCommand->command);
|
||||
pEntry = csr_ll_remove_head(&pMac->sme.smeCmdActiveList,
|
||||
LL_ACCESS_NOLOCK);
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
|
||||
csr_release_command(pMac, pCommand);
|
||||
status = QDF_STATUS_E_FAILURE;
|
||||
|
|
@ -1013,13 +1013,6 @@ void sme_process_pending_queue(tpAniSirGlobal pMac)
|
|||
;
|
||||
}
|
||||
|
||||
bool sme_command_pending(tpAniSirGlobal pMac)
|
||||
{
|
||||
return !csr_ll_is_list_empty(&pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK)
|
||||
|| !csr_ll_is_list_empty(&pMac->sme.smeCmdPendingList,
|
||||
LL_ACCESS_NOLOCK);
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_get_sessionid_from_activelist() - gets session id
|
||||
* @mac: mac context
|
||||
|
|
|
|||
|
|
@ -3287,11 +3287,11 @@ void csr_roam_remove_duplicate_command(tpAniSirGlobal mac_ctx,
|
|||
eCsrRoamReason roam_reason)
|
||||
{
|
||||
/* Always lock active list before locking pending lists */
|
||||
csr_ll_lock(&mac_ctx->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_lock(mac_ctx);
|
||||
csr_roam_remove_duplicate_cmd_from_list(mac_ctx,
|
||||
session_id, &mac_ctx->sme.smeCmdPendingList,
|
||||
command, roam_reason);
|
||||
csr_ll_unlock(&mac_ctx->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(mac_ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -8473,7 +8473,7 @@ bool is_disconnect_pending(tpAniSirGlobal pmac,
|
|||
tSmeCmd *command = NULL;
|
||||
bool disconnect_cmd_exist = false;
|
||||
|
||||
csr_ll_lock(&pmac->sme.smeCmdPendingList);
|
||||
csr_nonscan_pending_ll_lock(pmac);
|
||||
entry = csr_ll_peek_head(&pmac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK);
|
||||
while (entry) {
|
||||
next_entry = csr_ll_next(&pmac->sme.smeCmdPendingList,
|
||||
|
|
@ -8487,7 +8487,7 @@ bool is_disconnect_pending(tpAniSirGlobal pmac,
|
|||
}
|
||||
entry = next_entry;
|
||||
}
|
||||
csr_ll_unlock(&pmac->sme.smeCmdPendingList);
|
||||
csr_nonscan_pending_ll_unlock(pmac);
|
||||
return disconnect_cmd_exist;
|
||||
}
|
||||
|
||||
|
|
@ -8695,7 +8695,7 @@ bool csr_is_roam_command_waiting_for_session(tpAniSirGlobal pMac, uint32_t sessi
|
|||
tListElem *pEntry;
|
||||
tSmeCmd *pCommand = NULL;
|
||||
/* alwasy lock active list before locking pending list */
|
||||
csr_ll_lock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_lock(pMac);
|
||||
pEntry = csr_ll_peek_head(&pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK);
|
||||
if (pEntry) {
|
||||
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
|
||||
|
|
@ -8705,7 +8705,7 @@ bool csr_is_roam_command_waiting_for_session(tpAniSirGlobal pMac, uint32_t sessi
|
|||
}
|
||||
}
|
||||
if (false == fRet) {
|
||||
csr_ll_lock(&pMac->sme.smeCmdPendingList);
|
||||
csr_nonscan_pending_ll_lock(pMac);
|
||||
pEntry =
|
||||
csr_ll_peek_head(&pMac->sme.smeCmdPendingList,
|
||||
LL_ACCESS_NOLOCK);
|
||||
|
|
@ -8720,9 +8720,10 @@ bool csr_is_roam_command_waiting_for_session(tpAniSirGlobal pMac, uint32_t sessi
|
|||
csr_ll_next(&pMac->sme.smeCmdPendingList, pEntry,
|
||||
LL_ACCESS_NOLOCK);
|
||||
}
|
||||
csr_ll_unlock(&pMac->sme.smeCmdPendingList);
|
||||
csr_nonscan_pending_ll_unlock(pMac);
|
||||
}
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
|
||||
return fRet;
|
||||
}
|
||||
|
||||
|
|
@ -8747,7 +8748,7 @@ bool csr_is_scan_for_roam_command_active(tpAniSirGlobal pMac,
|
|||
tListElem *pEntry;
|
||||
tSmeCmd *pCommand;
|
||||
/* alwasy lock active list before locking pending list */
|
||||
csr_ll_lock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_lock(pMac);
|
||||
pEntry = csr_ll_peek_head(&pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK);
|
||||
if (pEntry) {
|
||||
pCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link);
|
||||
|
|
@ -8757,7 +8758,7 @@ bool csr_is_scan_for_roam_command_active(tpAniSirGlobal pMac,
|
|||
fRet = true;
|
||||
}
|
||||
}
|
||||
csr_ll_unlock(&pMac->sme.smeCmdActiveList);
|
||||
csr_nonscan_active_ll_unlock(pMac);
|
||||
return fRet;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2011-2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
|
|
@ -254,6 +254,26 @@ const char *get_e_csr_roam_result_str(eCsrRoamResult val)
|
|||
}
|
||||
}
|
||||
|
||||
void csr_nonscan_pending_ll_unlock(struct sAniSirGlobal *mac_ctx)
|
||||
{
|
||||
csr_ll_unlock(&mac_ctx->sme.smeCmdPendingList);
|
||||
}
|
||||
|
||||
void csr_nonscan_active_ll_unlock(struct sAniSirGlobal *mac_ctx)
|
||||
{
|
||||
csr_ll_unlock(&mac_ctx->sme.smeCmdActiveList);
|
||||
}
|
||||
|
||||
void csr_nonscan_pending_ll_lock(struct sAniSirGlobal *mac_ctx)
|
||||
{
|
||||
csr_ll_lock(&mac_ctx->sme.smeCmdPendingList);
|
||||
}
|
||||
|
||||
void csr_nonscan_active_ll_lock(struct sAniSirGlobal *mac_ctx)
|
||||
{
|
||||
csr_ll_lock(&mac_ctx->sme.smeCmdActiveList);
|
||||
}
|
||||
|
||||
bool csr_get_bss_id_bss_desc(tHalHandle hHal, tSirBssDescription *pSirBssDesc,
|
||||
struct qdf_mac_addr *pBssId)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue