From ecc2c7597f0792301f5bf7555ce882be23e86b1b Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Mon, 18 Mar 2019 11:05:39 +0530 Subject: [PATCH] qcacld-3.0: Cleanup SME_CSA_OFFLOAD_EVENT msg to flush BSSID With new scan module there is no need for LIM to send msg eWNI_SME_CSA_OFFLOAD_EVENT to CSR to flush scan cache. Lim can call the scan flush API directly. Change-Id: I30390a7a6407ab24089b735f55ded1aa354fc17e CRs-Fixed: 2417852 --- core/mac/inc/sir_api.h | 6 ---- core/mac/inc/wni_api.h | 1 - .../src/pe/lim/lim_send_sme_rsp_messages.c | 23 ++---------- core/mac/src/pe/lim/lim_utils.c | 36 +++++++++++++++++-- core/mac/src/pe/lim/lim_utils.h | 9 +++++ .../src/sys/legacy/src/utils/src/mac_trace.c | 1 - core/sme/src/common/sme_api.c | 6 ---- core/sme/src/csr/csr_api_scan.c | 7 ---- core/sme/src/csr/csr_inside_api.h | 2 -- 9 files changed, 45 insertions(+), 46 deletions(-) diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 0fd32315febe..378fec541206 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -1720,12 +1720,6 @@ typedef struct sSmeMaxAssocInd { struct qdf_mac_addr peer_mac; } tSmeMaxAssocInd, *tpSmeMaxAssocInd; -typedef struct sSmeCsaOffloadInd { - uint16_t mesgType; /* eWNI_SME_CSA_OFFLOAD_EVENT */ - uint16_t mesgLen; - struct qdf_mac_addr bssid; /* BSSID */ -} tSmeCsaOffloadInd, *tpSmeCsaOffloadInd; - #define SIR_MAX_NAME_SIZE 64 #define SIR_MAX_TEXT_SIZE 32 diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index ae02e96f846e..80c586ca64d1 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -159,7 +159,6 @@ enum eWniMsgTypes { eWNI_SME_STATS_EXT_EVENT = SIR_SME_MSG_TYPES_BEGIN + 89, eWNI_SME_GET_PEER_INFO_IND = SIR_SME_MSG_TYPES_BEGIN + 90, eWNI_SME_GET_PEER_INFO_EXT_IND = SIR_SME_MSG_TYPES_BEGIN + 91, - eWNI_SME_CSA_OFFLOAD_EVENT = SIR_SME_MSG_TYPES_BEGIN + 92, /* indicates Additional IE from hdd to PE */ eWNI_SME_UPDATE_ADDITIONAL_IES = SIR_SME_MSG_TYPES_BEGIN + 93, /* To indicate IE modify from hdd to PE */ diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 6ae245026c5a..efff5f1ca9e5 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1636,10 +1636,8 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, struct scheduler_msg *msg) { struct pe_session *session_entry; - struct scheduler_msg mmh_msg = {0}; struct csa_offload_params *csa_params = (struct csa_offload_params *) (msg->bodyptr); - tpSmeCsaOffloadInd csa_offload_ind; tpDphHashNode sta_ds = NULL; uint8_t session_id; uint16_t aid = 0; @@ -1656,17 +1654,12 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, return; } - csa_offload_ind = qdf_mem_malloc(sizeof(tSmeCsaOffloadInd)); - if (!csa_offload_ind) - goto err; - session_entry = pe_find_session_by_bssid(mac_ctx, csa_params->bssId, &session_id); if (!session_entry) { pe_err("Session does not exists for %pM", csa_params->bssId); - qdf_mem_free(csa_offload_ind); goto err; } @@ -1675,13 +1668,11 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, if (!sta_ds) { pe_err("sta_ds does not exist"); - qdf_mem_free(csa_offload_ind); goto err; } if (!LIM_IS_STA_ROLE(session_entry)) { pe_debug("Invalid role to handle CSA"); - qdf_mem_free(csa_offload_ind); goto err; } /* @@ -1856,7 +1847,6 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, (session_entry->ch_width == session_entry->gLimChannelSwitch.ch_width)) { pe_debug("Ignore CSA, no change in ch and bw"); - qdf_mem_free(csa_offload_ind); goto err; } @@ -1876,22 +1866,13 @@ void lim_handle_csa_offload_msg(struct mac_context *mac_ctx, lim_prepare_for11h_channel_switch(mac_ctx, session_entry); - csa_offload_ind->mesgType = eWNI_SME_CSA_OFFLOAD_EVENT; - csa_offload_ind->mesgLen = sizeof(tSmeCsaOffloadInd); - qdf_mem_copy(csa_offload_ind->bssid.bytes, session_entry->bssId, - QDF_MAC_ADDR_SIZE); - mmh_msg.type = eWNI_SME_CSA_OFFLOAD_EVENT; - mmh_msg.bodyptr = csa_offload_ind; - mmh_msg.bodyval = 0; - pe_debug("Sending eWNI_SME_CSA_OFFLOAD_EVENT to SME"); - MTRACE(mac_trace_msg_tx - (mac_ctx, session_entry->peSessionId, mmh_msg.type)); + lim_flush_bssid(mac_ctx, session_entry->bssId); + #ifdef FEATURE_WLAN_DIAG_SUPPORT lim_diag_event_report(mac_ctx, WLAN_PE_DIAG_SWITCH_CHL_IND_EVENT, session_entry, QDF_STATUS_SUCCESS, QDF_STATUS_SUCCESS); #endif - lim_sys_process_mmh_msg_api(mac_ctx, &mmh_msg); err: qdf_mem_free(csa_params); diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index cebb191a3762..57750312a393 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -67,6 +67,7 @@ #include "wlan_mlme_main.h" #include "qdf_util.h" #include "wlan_qct_sys.h" +#include #define ASCII_SPACE_CHARACTER 0x20 @@ -359,8 +360,6 @@ char *lim_msg_str(uint32_t msgType) case eWNI_SME_GET_TSM_STATS_RSP: return "eWNI_SME_GET_TSM_STATS_RSP"; #endif /* FEATURE_WLAN_ESE */ - case eWNI_SME_CSA_OFFLOAD_EVENT: - return "eWNI_SME_CSA_OFFLOAD_EVENT"; case eWNI_SME_SET_HW_MODE_REQ: return "eWNI_SME_SET_HW_MODE_REQ"; case eWNI_SME_SET_HW_MODE_RESP: @@ -8372,3 +8371,36 @@ QDF_STATUS lim_get_capability_info(struct mac_context *mac, uint16_t *pcap, return QDF_STATUS_SUCCESS; } + +void lim_flush_bssid(struct mac_context *mac_ctx, uint8_t *bssid) +{ + struct scan_filter *filter; + struct wlan_objmgr_pdev *pdev = NULL; + QDF_STATUS status; + + if (!bssid) + return; + + filter = qdf_mem_malloc(sizeof(*filter)); + if (!filter) + return; + + filter->num_of_bssid = 1; + qdf_mem_copy(filter->bssid_list[0].bytes, bssid, QDF_MAC_ADDR_SIZE); + + pdev = wlan_objmgr_get_pdev_by_id(mac_ctx->psoc, 0, WLAN_LEGACY_MAC_ID); + if (!pdev) { + pe_err("pdev is NULL"); + qdf_mem_free(filter); + return; + } + status = ucfg_scan_flush_results(pdev, filter); + + wlan_objmgr_pdev_release_ref(pdev, WLAN_LEGACY_MAC_ID); + + if (QDF_IS_STATUS_SUCCESS(status)) + pe_debug("Removed BSS entry:%pM", bssid); + + if (filter) + qdf_mem_free(filter); +} diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index ac8398c691f8..5da2f6bbcd03 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -1711,4 +1711,13 @@ int8_t lim_get_regulatory_max_transmit_power(struct mac_context *mac, QDF_STATUS lim_get_capability_info(struct mac_context *mac, uint16_t *pCap, struct pe_session *pe_session); +/** + * lim_flush_bssid() - flush bssid from scan cache + * @mac_ctx: pointer to mac data + * @bssid: bssid to be flushed + * + * Return: void + */ +void lim_flush_bssid(struct mac_context *mac_ctx, uint8_t *bssid); + #endif /* __LIM_UTILS_H */ diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c index 414ea9e1167c..1aa820d2e0cb 100644 --- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c +++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c @@ -288,7 +288,6 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg) CASE_RETURN_STRING(eWNI_SME_DFS_BEACON_CHAN_SW_IE_REQ); CASE_RETURN_STRING(eWNI_SME_DFS_CSAIE_TX_COMPLETE_IND); CASE_RETURN_STRING(eWNI_SME_STATS_EXT_EVENT); - CASE_RETURN_STRING(eWNI_SME_CSA_OFFLOAD_EVENT); CASE_RETURN_STRING(eWNI_SME_UPDATE_ADDITIONAL_IES); CASE_RETURN_STRING(eWNI_SME_MODIFY_ADDITIONAL_IES); #ifdef FEATURE_WLAN_AUTO_SHUTDOWN diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 9c38746e1304..1fcf1b8ebe9e 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -2115,12 +2115,6 @@ QDF_STATUS sme_process_msg(struct mac_context *mac, struct scheduler_msg *pMsg) case eWNI_SME_FW_STATUS_IND: status = sme_fw_state_resp(mac); break; - case eWNI_SME_CSA_OFFLOAD_EVENT: - if (pMsg->bodyptr) { - csr_scan_flush_bss_entry(mac, pMsg->bodyptr); - qdf_mem_free(pMsg->bodyptr); - } - break; case eWNI_SME_TSF_EVENT: if (mac->sme.get_tsf_cb) { mac->sme.get_tsf_cb(mac->sme.get_tsf_cxt, diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 7c07cfa384be..dff84a12b373 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -3009,13 +3009,6 @@ static inline void csr_flush_bssid(struct mac_context *mac_ctx, qdf_mem_free(filter); } -void csr_scan_flush_bss_entry(struct mac_context *mac_ctx, - tpSmeCsaOffloadInd csa_off_ind) -{ - csr_flush_bssid(mac_ctx, - csa_off_ind->bssid.bytes); -} - void csr_remove_bssid_from_scan_list(struct mac_context *mac_ctx, tSirMacAddr bssid) { diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h index b27fcd56b333..b4ea0e504441 100644 --- a/core/sme/src/csr/csr_inside_api.h +++ b/core/sme/src/csr/csr_inside_api.h @@ -469,8 +469,6 @@ QDF_STATUS csr_queue_sme_command(struct mac_context *mac, tSmeCmd *pCommand, tSmeCmd *csr_get_command_buffer(struct mac_context *mac); void csr_release_command(struct mac_context *mac, tSmeCmd *pCommand); void csr_release_command_buffer(struct mac_context *mac, tSmeCmd *pCommand); -void csr_scan_flush_bss_entry(struct mac_context *mac, - tpSmeCsaOffloadInd pCsaOffloadInd); #ifdef FEATURE_WLAN_WAPI bool csr_is_profile_wapi(struct csr_roam_profile *pProfile);