From a9005b33bf31ab3fd371c4407e1650fa9910c37b Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Thu, 6 Dec 2018 21:30:45 +0800 Subject: [PATCH] qcacld-3.0: Move ifdef CONFIG_VDEV_SM outside of functions in lim Moves ifdef CONFIG_VDEV_SM outside of functions in lim. Change-Id: I4ec40ce1dedccdc69e0e2dd68c1823ec4bb7549a CRs-Fixed: 2362457 --- core/mac/src/pe/lim/lim_ibss_peer_mgmt.c | 142 +++++++++----- core/mac/src/pe/lim/lim_ibss_peer_mgmt.h | 10 + .../src/pe/lim/lim_process_mlm_rsp_messages.c | 31 +-- .../src/pe/lim/lim_process_sme_req_messages.c | 183 ++++++++++++------ core/mac/src/pe/lim/lim_utils.c | 73 +++++-- core/mac/src/pe/lim/lim_utils.h | 19 ++ core/sme/src/csr/csr_api_roam.c | 2 - 7 files changed, 301 insertions(+), 159 deletions(-) diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c index bfa1af57aa76..6865abf7c507 100644 --- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c +++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c @@ -392,6 +392,67 @@ ibss_coalesce_save(struct mac_context *mac, qdf_mem_copy(mac->lim.ibssInfo.pBeacon, pBeacon, sizeof(*pBeacon)); } +#ifdef CONFIG_VDEV_SM +static QDF_STATUS lim_ibss_add_bss( + struct mac_context *mac, + struct pe_session *session, + tLimMlmStartReq mlmStartReq) +{ + return wlan_vdev_mlme_sm_deliver_evt( + session->vdev, + WLAN_VDEV_SM_EV_START, + sizeof(mlmStartReq), &mlmStartReq); +} + +void lim_ibss_delete(struct mac_context *mac, struct pe_session *session) +{ + ibss_coalesce_free(mac); +} + +static void lim_ibss_delete_peers(struct mac_context *mac, + struct pe_session *session) +{} +#else +/** + * lim_ibss_add_bss() - ibss add bss + * + * @mac: Pointer to Global MAC structure + * @session: Pointer to session entry + * @mlmStartReq: Pointer to mlme start request + * + * Return: none + */ +static QDF_STATUS lim_ibss_add_bss( + struct mac_context *mac, + struct pe_session *session, + tLimMlmStartReq mlmStartReq) +{ + return lim_mlm_add_bss(mac, &mlmStartReq, session) == + eSIR_SME_SUCCESS ? QDF_STATUS_SUCCESS : QDF_STATUS_E_FAILURE; +} + +void lim_ibss_delete(struct mac_context *mac, struct pe_session *session) +{ + lim_ibss_delete_all_peers(mac, session); + ibss_coalesce_free(mac); +} + +/** + * lim_ibss_delete_peers() - Delete ibss peer entries + * + * @mac: Pointer to Global MAC structure + * @session: Pointer to session entry + * + * Return: none + */ +static void lim_ibss_delete_peers(struct mac_context *mac, + struct pe_session *session) +{ + /* Delete peer entries. */ + lim_ibss_delete_all_peers(mac, session); +} +#endif + /* * tries to add a new entry to dph hash node * if necessary, an existing entry is eliminated @@ -483,6 +544,7 @@ void ibss_bss_add(struct mac_context *mac, struct pe_session *pe_session) tpSchBeaconStruct pBeacon = (tpSchBeaconStruct) mac->lim.ibssInfo.pBeacon; qdf_size_t num_ext_rates = 0; + QDF_STATUS status; if ((pHdr == NULL) || (pBeacon == NULL)) { pe_err("Unable to add BSS (no cached BSS info)"); @@ -568,17 +630,12 @@ void ibss_bss_add(struct mac_context *mac, struct pe_session *pe_session) pe_session->pLimStartBssReq->ssId.length + 1); pe_debug("invoking ADD_BSS as part of coalescing!"); -#ifdef CONFIG_VDEV_SM - wlan_vdev_mlme_sm_deliver_evt(pe_session->vdev, - WLAN_VDEV_SM_EV_START, - sizeof(mlmStartReq), &mlmStartReq); -#else - if (lim_mlm_add_bss(mac, &mlmStartReq, pe_session) != - eSIR_SME_SUCCESS) { + + status = lim_ibss_add_bss(mac, pe_session, mlmStartReq); + if (QDF_IS_STATUS_ERROR(status)) { pe_err("AddBss failure"); return; } -#endif /* Update fields in Beacon */ if (sch_set_fixed_beacon_fields(mac, pe_session) != QDF_STATUS_SUCCESS) { pe_err("Unable to set fixed Beacon fields"); @@ -650,9 +707,6 @@ void lim_ibss_delete_all_peers(struct mac_context *mac, tLimIbssPeerNode *pCurrNode, *pTempNode; tpDphHashNode pStaDs; uint16_t peerIdx; -#ifdef CONFIG_VDEV_SM - QDF_STATUS status; -#endif pCurrNode = pTempNode = mac->lim.gLimIbssPeerList; @@ -706,35 +760,7 @@ void lim_ibss_delete_all_peers(struct mac_context *mac, mac->lim.gLimNumIbssPeers = 0; mac->lim.gLimIbssPeerList = NULL; -#ifdef CONFIG_VDEV_SM - status = - wlan_vdev_mlme_sm_deliver_evt(pe_session->vdev, - WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE, - sizeof(*pe_session), pe_session); - if (!mac->lim.gLimIbssCoalescingHappened && - QDF_IS_STATUS_ERROR(status)) { - pe_err("failed to post WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE for vdevid %d", - pe_session->smeSessionId); - lim_send_stop_bss_failure_resp(mac, pe_session); - } -#endif -} - -/** - * lim_ibss_delete() - This function is called while tearing down an IBSS - * - * @mac: Pointer to Global MAC structure - * @pe_session: Pointer to session entry - * - * Return: none - */ - -void lim_ibss_delete(struct mac_context *mac, struct pe_session *pe_session) -{ -#ifndef CONFIG_VDEV_SM - lim_ibss_delete_all_peers(mac, pe_session); -#endif - ibss_coalesce_free(mac); + lim_disconnect_complete(pe_session, false); } /** ------------------------------------------------------------- @@ -1247,10 +1273,8 @@ void lim_ibss_del_bss_rsp_when_coalescing(struct mac_context *mac, void *msg, goto end; } -#ifndef CONFIG_VDEV_SM /* Delete peer entries. */ - lim_ibss_delete_all_peers(mac, pe_session); -#endif + lim_ibss_delete_peers(mac, pe_session); /* add the new bss */ ibss_bss_add(mac, pe_session); end: @@ -1376,6 +1400,28 @@ end: } } +#ifdef CONFIG_VDEV_SM +static void lim_ibss_bss_delete(struct mac_context *mac, + struct pe_session *pe_session) +{ + QDF_STATUS status; + + status = wlan_vdev_mlme_sm_deliver_evt( + pe_session->vdev, + WLAN_VDEV_SM_EV_DOWN, + sizeof(*pe_session), + pe_session); + if (QDF_IS_STATUS_ERROR(status)) + pe_err("Deliver WLAN_VDEV_SM_EV_DOWN failed"); +} +#else +static void lim_ibss_bss_delete(struct mac_context *mac, + struct pe_session *pe_session) +{ + ibss_bss_delete(mac, pe_session); +} +#endif + /** * lim_ibss_coalesce() * @@ -1451,14 +1497,8 @@ lim_ibss_coalesce(struct mac_context *mac, ibss_coalesce_save(mac, pHdr, pBeacon); pe_debug("IBSS Coalescing happened Delete BSSID :" MAC_ADDRESS_STR, MAC_ADDR_ARRAY(currentBssId)); -#ifdef CONFIG_VDEV_SM - wlan_vdev_mlme_sm_deliver_evt(pe_session->vdev, - WLAN_VDEV_SM_EV_DOWN, - sizeof(*pe_session), - pe_session); -#else - ibss_bss_delete(mac, pe_session); -#endif + lim_ibss_bss_delete(mac, pe_session); + return QDF_STATUS_SUCCESS; } else { if (qdf_mem_cmp diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h index 43ecd15c4e6e..44eb298ac3b8 100644 --- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h +++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.h @@ -58,7 +58,17 @@ void ibss_bss_delete(struct mac_context *mac_ctx, struct pe_session *session); void lim_ibss_delete_all_peers(struct mac_context *mac_ctx, struct pe_session *session); void lim_ibss_init(struct mac_context *); + +/** + * lim_ibss_delete() - Delete ibss while tearing down an IBSS + * + * @mac: Pointer to Global MAC structure + * @session: Pointer to session entry + * + * Return: none + */ void lim_ibss_delete(struct mac_context *, struct pe_session *pe_session); + QDF_STATUS lim_ibss_coalesce(struct mac_context *, tpSirMacMgmtHdr, tpSchBeaconStruct, uint8_t *, uint32_t, uint16_t, struct pe_session *); diff --git a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c index e24e5582be91..64bfe8034ed2 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c @@ -2013,10 +2013,6 @@ void lim_process_sta_mlm_del_sta_rsp(struct mac_context *mac, { tSirResultCodes statusCode = eSIR_SME_SUCCESS; tpDeleteStaParams pDelStaParams = (tpDeleteStaParams) limMsgQ->bodyptr; - tpDphHashNode pStaDs = NULL; -#ifdef CONFIG_VDEV_SM - QDF_STATUS status; -#endif if (NULL == pDelStaParams) { pe_err("Encountered NULL Pointer"); @@ -2036,22 +2032,12 @@ void lim_process_sta_mlm_del_sta_rsp(struct mac_context *mac, pe_err("Del STA failed! Status:%d, proceeding with Del BSS", pDelStaParams->status); - pStaDs = dph_get_hash_entry(mac, DPH_STA_HASH_INDEX_PEER, - &pe_session->dph.dphHashTable); - if (pStaDs == NULL) { - pe_err("DPH Entry for STA %X missing", - pDelStaParams->assocId); - statusCode = eSIR_SME_REFUSED; - goto end; - } if (eLIM_MLM_WT_DEL_STA_RSP_STATE != pe_session->limMlmState) { pe_err("Received unexpected WDA_DELETE_STA_RSP in state %s", lim_mlm_state_str(pe_session->limMlmState)); statusCode = eSIR_SME_REFUSED; goto end; } - pe_debug("STA AssocID %d MAC", pStaDs->assocId); - lim_print_mac_addr(mac, pStaDs->staAddr, LOGD); /* * we must complete all cleanup related to delSta before * calling limDelBSS. @@ -2060,21 +2046,8 @@ void lim_process_sta_mlm_del_sta_rsp(struct mac_context *mac, qdf_mem_free(pDelStaParams); limMsgQ->bodyptr = NULL; } -#ifdef CONFIG_VDEV_SM - status = - wlan_vdev_mlme_sm_deliver_evt(pe_session->vdev, - WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE, - sizeof(*pe_session), - pe_session); - if (QDF_IS_STATUS_ERROR(status)) { - pe_err("failed to post WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE for vdevid %d", - pe_session->smeSessionId); - } -#else - /* Proceed to do DelBSS even if DelSta resulted in failure */ - statusCode = (tSirResultCodes)lim_del_bss(mac, pStaDs, 0, - pe_session); -#endif + + lim_disconnect_complete(pe_session, true); return; end: diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 475a6bb95024..27e083399c0c 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -2985,19 +2985,7 @@ void lim_delete_all_peers(struct pe_session *session) QDF_ASSERT(0); } } - -#ifdef CONFIG_VDEV_SM - status = - wlan_vdev_mlme_sm_deliver_evt(session->vdev, - WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE, - sizeof(*session), session); - if (QDF_IS_STATUS_ERROR(status)) { - pe_err("failed to post WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE for vdevid %d", - session->smeSessionId); - lim_send_stop_bss_failure_resp(mac_ctx, session); - } -#endif - + lim_disconnect_complete(session, false); } QDF_STATUS lim_sta_send_del_bss(struct pe_session *session) @@ -3973,15 +3961,7 @@ static void lim_process_roam_invoke(struct mac_context *mac_ctx, } #endif -/* - * lim_handle_update_ssid_hidden() - Processes SSID hidden update - * @mac_ctx: Pointer to global mac context - * @session: Pointer to PE session - * @ssid_hidden: SSID hidden value to set; 0 - Broadcast SSID, - * 1 - Disable broadcast SSID - * - * Return: None - */ +#ifdef CONFIG_VDEV_SM static void lim_handle_update_ssid_hidden(struct mac_context *mac_ctx, struct pe_session *session, uint8_t ssid_hidden) { @@ -3995,20 +3975,42 @@ static void lim_handle_update_ssid_hidden(struct mac_context *mac_ctx, return; } -#ifdef CONFIG_VDEV_SM ap_mlme_set_hidden_ssid_restart_in_progress(session->vdev, true); wlan_vdev_mlme_sm_deliver_evt(session->vdev, WLAN_VDEV_SM_EV_FW_VDEV_RESTART, sizeof(*session), session); +} #else +/* + * lim_handle_update_ssid_hidden() - Processes SSID hidden update + * @mac_ctx: Pointer to global mac context + * @session: Pointer to PE session + * @ssid_hidden: SSID hidden value to set; 0 - Broadcast SSID, + * 1 - Disable broadcast SSID + * + * Return: None + */ +static void lim_handle_update_ssid_hidden( + struct mac_context *mac_ctx, + struct pe_session *session, + uint8_t ssid_hidden) +{ + pe_debug("rcvd HIDE_SSID message old HIDE_SSID: %d new HIDE_SSID: %d", + session->ssidHidden, ssid_hidden); + + if (ssid_hidden != session->ssidHidden) { + session->ssidHidden = ssid_hidden; + } else { + pe_debug("Dont process HIDE_SSID msg with existing setting"); + return; + } /* Send vdev restart */ lim_send_vdev_restart(mac_ctx, session, session->smeSessionId); -#endif return; } - +#endif /** * __lim_process_sme_session_update - process SME session update msg * @@ -4806,12 +4808,10 @@ static void lim_process_disconnect_sta(struct pe_session *session, WLAN_VDEV_SM_EV_DOWN, sizeof(*msg), msg); } -#endif static void lim_process_sme_disassoc_cnf(struct mac_context *mac_ctx, struct scheduler_msg *msg) { -#ifdef CONFIG_VDEV_SM tSirSmeDisassocCnf sme_disassoc_cnf; struct pe_session *session; uint8_t session_id; @@ -4828,15 +4828,11 @@ static void lim_process_sme_disassoc_cnf(struct mac_context *mac_ctx, else __lim_process_sme_disassoc_cnf(mac_ctx, (uint32_t *)msg->bodyptr); -#else - __lim_process_sme_disassoc_cnf(mac_ctx, (uint32_t *)msg->bodyptr); -#endif } static void lim_process_sme_disassoc_req(struct mac_context *mac_ctx, struct scheduler_msg *msg) { -#ifdef CONFIG_VDEV_SM tSirSmeDisassocReq disassoc_req; struct pe_session *session; uint8_t session_id; @@ -4851,15 +4847,11 @@ static void lim_process_sme_disassoc_req(struct mac_context *mac_ctx, else __lim_process_sme_disassoc_req(mac_ctx, (uint32_t *)msg->bodyptr); -#else - __lim_process_sme_disassoc_req(mac_ctx, (uint32_t *)msg->bodyptr); -#endif } static void lim_process_sme_deauth_req(struct mac_context *mac_ctx, struct scheduler_msg *msg) { -#ifdef CONFIG_VDEV_SM tSirSmeDeauthReq sme_deauth_req; struct pe_session *session; uint8_t session_id; @@ -4874,10 +4866,56 @@ static void lim_process_sme_deauth_req(struct mac_context *mac_ctx, else __lim_process_sme_deauth_req(mac_ctx, (uint32_t *)msg->bodyptr); -#else - __lim_process_sme_deauth_req(mac_ctx, (uint32_t *)msg->bodyptr); -#endif } +#else +/** + * lim_process_sme_disassoc_cnf() - process sme disassoc cnf message + * @mac_ctx: Pointer to Global MAC structure + * @msg: pointer to message buffer + * + * This function is called to process SME_DISASSOC_CNF message + * from HDD or upper layer application. + * + * Return: None + */ +static void lim_process_sme_disassoc_cnf(struct mac_context *mac_ctx, + struct scheduler_msg *msg) +{ + __lim_process_sme_disassoc_cnf(mac_ctx, (uint32_t *)msg->bodyptr); +} + +/** + * lim_process_sme_disassoc_req() - process sme deauth req + * @mac_ctx: Pointer to Global MAC structure + * @msg: pointer to message buffer + * + * This function is called to process SME_DISASSOC_REQ message + * from HDD or upper layer application. + * + * Return: None + */ +static void lim_process_sme_disassoc_req(struct mac_context *mac_ctx, + struct scheduler_msg *msg) +{ + __lim_process_sme_disassoc_req(mac_ctx, (uint32_t *)msg->bodyptr); +} + +/** + * lim_process_sme_deauth_req() - process sme deauth req + * @mac_ctx: Pointer to Global MAC structure + * @msg: pointer to message buffer + * + * This function is called to process SME_DEAUTH_REQ message + * from HDD or upper layer application. + * + * Return: None + */ +static void lim_process_sme_deauth_req(struct mac_context *mac_ctx, + struct scheduler_msg *msg) +{ + __lim_process_sme_deauth_req(mac_ctx, (uint32_t *)msg->bodyptr); +} +#endif /** * lim_process_sme_req_messages() @@ -5191,6 +5229,50 @@ static void lim_process_sme_start_beacon_req(struct mac_context *mac, uint32_t * } } +#ifdef CONFIG_VDEV_SM +static void lim_change_channel( + struct mac_context *mac_ctx, + struct pe_session *session_entry) +{ + mlme_set_chan_switch_in_progress(session_entry->vdev, true); + if (wlan_vdev_mlme_get_state(session_entry->vdev) == + WLAN_VDEV_S_DFS_CAC_WAIT) + wlan_vdev_mlme_sm_deliver_evt(session_entry->vdev, + WLAN_VDEV_SM_EV_RADAR_DETECTED, + sizeof(*session_entry), + session_entry); + else + wlan_vdev_mlme_sm_deliver_evt(session_entry->vdev, + WLAN_VDEV_SM_EV_CSA_COMPLETE, + sizeof(*session_entry), + session_entry); +} +#else +/** + * lim_change_channel() - lim change channel api + * + * @mac_ctx: Pointer to Global MAC structure + * @session_entry: pointer to the SME message buffer + * + * This function is called to process SME_CHANNEL_CHANGE_REQ message + * + * Return: None + */ +static void lim_change_channel( + struct mac_context *mac_ctx, + struct pe_session *session_entry) +{ + lim_set_channel(mac_ctx, session_entry->currentOperChannel, + session_entry->ch_center_freq_seg0, + session_entry->ch_center_freq_seg1, + session_entry->ch_width, + session_entry->maxTxPower, + session_entry->peSessionId, + session_entry->cac_duration_ms, + session_entry->dfs_regdomain); +} +#endif + /** * lim_process_sme_channel_change_request() - process sme ch change req * @@ -5293,30 +5375,7 @@ static void lim_process_sme_channel_change_request(struct mac_context *mac_ctx, &ch_change_req->extended_rateset, sizeof(session_entry->extRateSet)); -#ifdef CONFIG_VDEV_SM - mlme_set_chan_switch_in_progress(session_entry->vdev, true); - if (wlan_vdev_mlme_get_state(session_entry->vdev) == - WLAN_VDEV_S_DFS_CAC_WAIT) - wlan_vdev_mlme_sm_deliver_evt(session_entry->vdev, - WLAN_VDEV_SM_EV_RADAR_DETECTED, - sizeof(*session_entry), - session_entry); - else - wlan_vdev_mlme_sm_deliver_evt(session_entry->vdev, - WLAN_VDEV_SM_EV_CSA_COMPLETE, - sizeof(*session_entry), - session_entry); - - -#else - lim_set_channel(mac_ctx, ch_change_req->targetChannel, - session_entry->ch_center_freq_seg0, - session_entry->ch_center_freq_seg1, - session_entry->ch_width, - max_tx_pwr, session_entry->peSessionId, - ch_change_req->cac_duration_ms, - ch_change_req->dfs_regdomain); -#endif + lim_change_channel(mac_ctx, session_entry); } /****************************************************************************** diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 98719b61d871..047f97e79008 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -2052,6 +2052,23 @@ static void __lim_process_channel_switch_timeout(struct mac_context *mac) } #ifdef CONFIG_VDEV_SM +void lim_disconnect_complete(struct pe_session *session, bool del_bss) +{ + QDF_STATUS status; + struct mac_context *mac = session->mac_ctx; + + status = + wlan_vdev_mlme_sm_deliver_evt(session->vdev, + WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE, + sizeof(*session), session); + if (!mac->lim.gLimIbssCoalescingHappened && + QDF_IS_STATUS_ERROR(status)) { + pe_err("failed to post WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE for vdevid %d", + session->smeSessionId); + lim_send_stop_bss_failure_resp(mac, session); + } +} + void lim_process_channel_switch_timeout(struct mac_context *mac_ctx) { struct pe_session *session_entry = NULL; @@ -2073,6 +2090,18 @@ void lim_process_channel_switch_timeout(struct mac_context *mac_ctx) } } #else +void lim_disconnect_complete(struct pe_session *session, bool del_bss) +{ + if (del_bss) + lim_sta_send_del_bss(session); +} + +/** + * lim_process_channel_switch_timeout() - process chanel switch timeout + * @mac: pointer to Global MAC structure + * + * Return: none + */ void lim_process_channel_switch_timeout(struct mac_context *mac) { __lim_process_channel_switch_timeout(mac); @@ -2270,6 +2299,33 @@ lim_util_count_sta_del(struct mac_context *mac, sch_edca_profile_update(mac, pe_session); } +#ifdef CONFIG_VDEV_SM +/** + * lim_switch_channel_vdev_started() - Send vdev started when switch channel + * + * @pe_session: PE session entry + * + * This function is called to deliver WLAN_VDEV_SM_EV_START_SUCCESS to VDEV SM + * + * Return: None + */ +static void lim_switch_channel_vdev_started(struct pe_session *pe_session) +{ + QDF_STATUS status; + + status = wlan_vdev_mlme_sm_deliver_evt( + pe_session->vdev, + WLAN_VDEV_SM_EV_START_SUCCESS, + sizeof(*pe_session), pe_session); + if (QDF_IS_STATUS_ERROR(status)) { + pe_err("Failed to post WLAN_VDEV_SM_EV_START_SUCCESS for vdevid %d", + pe_session->smeSessionId); + } +} +#else +static void lim_switch_channel_vdev_started(struct pe_session *pe_session) {} +#endif + /** * lim_switch_channel_cback() * @@ -2289,9 +2345,6 @@ void lim_switch_channel_cback(struct mac_context *mac, QDF_STATUS status, { struct scheduler_msg mmhMsg = { 0 }; tSirSmeSwitchChannelInd *pSirSmeSwitchChInd; -#ifdef CONFIG_VDEV_SM - QDF_STATUS evt_status; -#endif pe_session->currentOperChannel = pe_session->currentReqChannel; @@ -2341,19 +2394,9 @@ void lim_switch_channel_cback(struct mac_context *mac, QDF_STATUS status, pe_session->peSessionId, mmhMsg.type)); sys_process_mmh_msg(mac, &mmhMsg); -#ifdef CONFIG_VDEV_SM - if (QDF_IS_STATUS_ERROR(status)) - return; - evt_status = wlan_vdev_mlme_sm_deliver_evt( - pe_session->vdev, - WLAN_VDEV_SM_EV_START_SUCCESS, - sizeof(*pe_session), pe_session); - if (QDF_IS_STATUS_ERROR(evt_status)) { - pe_err("Failed to post WLAN_VDEV_SM_EV_START_SUCCESS for vdevid %d", - pe_session->smeSessionId); - } -#endif + if (QDF_IS_STATUS_SUCCESS(status)) + lim_switch_channel_vdev_started(pe_session); } /** diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 5720dc462ebd..248d68be6b79 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -293,6 +293,13 @@ uint8_t lim_is_null_ssid(tSirMacSSid *pSsid); /* 11h Support */ void lim_stop_tx_and_switch_channel(struct mac_context *mac, uint8_t sessionId); + +/** + * lim_process_channel_switch_timeout() - Process chanel switch timeout + * @mac: pointer to Global MAC structure + * + * Return: none + */ void lim_process_channel_switch_timeout(struct mac_context *); QDF_STATUS lim_start_channel_switch(struct mac_context *mac, struct pe_session *pe_session); @@ -1519,6 +1526,18 @@ void lim_send_beacon(struct mac_context *mac_ctx, struct pe_session *session); */ void lim_ndi_mlme_vdev_up_transition(struct pe_session *session); +/** + * lim_disconnect_complete - Deliver vdev disconnect complete event or + * STA send deleting bss + * @session: PE session pointer + * @del_bss: Whether to call lim_sta_send_del_bss + * + * API delivers vdev disconnect complete event + * + * Return: None + */ +void lim_disconnect_complete(struct pe_session *session, bool del_bss); + #ifdef CONFIG_VDEV_SM /** * lim_sta_mlme_vdev_stop_send() - send VDEV stop diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index afc6a5028990..41ef56803020 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -11237,14 +11237,12 @@ csr_roam_chk_lnk_swt_ch_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr) return; } -#ifdef CONFIG_VDEV_SM if (QDF_IS_STATUS_ERROR(pSwitchChnInd->status)) { sme_err("Channel switch failed"); csr_roam_disconnect_internal(mac_ctx, sessionId, eCSR_DISCONNECT_REASON_DEAUTH); return; } -#endif session->connectedProfile.operationChannel = (uint8_t) pSwitchChnInd->newChannelId; if (session->pConnectBssDesc) {