From cbfdb12cfaee28b4b277e6549ba735b794691f2f Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Tue, 6 Mar 2018 18:59:02 -0800 Subject: [PATCH] qcacld-3.0: (PART-2) Remove obsoleted APIs in SME module Remove some of the obsoleted APIs in SME module Change-Id: Ia4f890706769e5ace1dcff2d57fb33f6e67e1297 CRs-Fixed: 2201799 --- core/sme/inc/csr_internal.h | 3 - core/sme/inc/csr_support.h | 3 - core/sme/inc/sme_api.h | 5 - core/sme/src/common/sme_api.c | 37 ------ core/sme/src/csr/csr_api_scan.c | 162 ------------------------ core/sme/src/csr/csr_util.c | 217 -------------------------------- 6 files changed, 427 deletions(-) diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index dc3984a473d5..2a972c10ab22 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -1267,9 +1267,6 @@ QDF_STATUS csr_stop(tpAniSirGlobal pMac, tHalStopType stopType); QDF_STATUS csr_ready(tpAniSirGlobal pMac); #ifdef FEATURE_WLAN_WAPI -QDF_STATUS csr_scan_get_bkid_candidate_list(tpAniSirGlobal pMac, - uint32_t sessionId, tBkidCandidateInfo * pBkidList, - uint32_t *pNumItems); QDF_STATUS csr_roam_get_wapi_req_ie(tpAniSirGlobal pMac, uint32_t sessionId, uint32_t *pLen, uint8_t *pBuf); QDF_STATUS csr_roam_get_wapi_rsp_ie(tpAniSirGlobal pMac, diff --git a/core/sme/inc/csr_support.h b/core/sme/inc/csr_support.h index bf40d5187b0d..0c537dbee789 100644 --- a/core/sme/inc/csr_support.h +++ b/core/sme/inc/csr_support.h @@ -316,9 +316,6 @@ bool csr_is_bss_type_match(eCsrRoamBssType bssType1, eCsrRoamBssType bssType2); bool csr_is_bss_type_ibss(eCsrRoamBssType bssType); bool csr_is_bssid_match(tHalHandle hHal, struct qdf_mac_addr *pProfBssid, struct qdf_mac_addr *BssBssid); -bool csr_match_bss_to_connect_profile(tHalHandle hHal, - tCsrRoamConnectedProfile *pProfile, - tSirBssDescription *pBssDesc, tDot11fBeaconIEs *pIes); void csr_add_rate_bitmap(uint8_t rate, uint16_t *pRateBitmap); bool csr_check_rate_bitmap(uint8_t rate, uint16_t RateBitmap); bool csr_rates_is_dot11_rate_supported(tHalHandle hHal, uint8_t rate); diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 8bc6383a3c59..a46ccee5bc2a 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -546,11 +546,6 @@ QDF_STATUS sme_get_wcnss_software_version(tHalHandle hHal, uint8_t *pVersion, uint32_t versionBufferSize); QDF_STATUS sme_get_wcnss_hardware_version(tHalHandle hHal, uint8_t *pVersion, uint32_t versionBufferSize); -#ifdef FEATURE_WLAN_WAPI -QDF_STATUS sme_scan_get_bkid_candidate_list(tHalHandle hHal, uint32_t sessionId, - tBkidCandidateInfo * pBkidList, - uint32_t *pNumItems); -#endif /* FEATURE_WLAN_WAPI */ #ifdef FEATURE_OEM_DATA_SUPPORT QDF_STATUS sme_oem_data_req(tHalHandle hHal, struct oem_data_req *); QDF_STATUS sme_oem_update_capability(tHalHandle hHal, diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 22145937b23a..1dfbfdc6284a 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -4892,43 +4892,6 @@ QDF_STATUS sme_get_wcnss_hardware_version(tHalHandle hHal, return status; } -#ifdef FEATURE_WLAN_WAPI - -/* - * sme_scan_get_bkid_candidate_list() - - * A wrapper function to return the BKID candidate list - * - * pBkidList - caller allocated buffer point to an array of - * tBkidCandidateInfo - * pNumItems - pointer to a variable that has the number of - * tBkidCandidateInfo allocated when retruning, this is - * either the number needed or number of items put into - * pPmkidList - * Return QDF_STATUS - when fail, it usually means the buffer allocated is not - * big enough and pNumItems - * has the number of tBkidCandidateInfo. - * Note: pNumItems is a number of tBkidCandidateInfo, - * not sizeof(tBkidCandidateInfo) * something - */ -QDF_STATUS sme_scan_get_bkid_candidate_list(tHalHandle hHal, uint32_t sessionId, - tBkidCandidateInfo *pBkidList, - uint32_t *pNumItems) -{ - QDF_STATUS status = QDF_STATUS_E_FAILURE; - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - - status = sme_acquire_global_lock(&pMac->sme); - if (QDF_IS_STATUS_SUCCESS(status)) { - status = - csr_scan_get_bkid_candidate_list(pMac, sessionId, - pBkidList, pNumItems); - sme_release_global_lock(&pMac->sme); - } - - return status; -} -#endif /* FEATURE_WLAN_WAPI */ - #ifdef FEATURE_OEM_DATA_SUPPORT /** * sme_oem_data_req() - send oem data request to WMA diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index cfe9c2a44859..4bd2e8f0c500 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -1257,98 +1257,6 @@ static bool csr_scan_flush_denied(tpAniSirGlobal pMac) return 0; } -#ifdef FEATURE_WLAN_WAPI -static QDF_STATUS csr_add_bkid_candidate_list(tpAniSirGlobal pMac, - uint32_t sessionId, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes) -{ - QDF_STATUS status = QDF_STATUS_E_FAILURE; - struct csr_roam_session *pSession = CSR_GET_SESSION(pMac, sessionId); - - if (!pSession) { - sme_err("session %d not found", sessionId); - return QDF_STATUS_E_FAILURE; - } - - sme_debug("csr_add_bkid_candidate_list called pMac->scan.NumBkidCandidate: %d", - pSession->NumBkidCandidate); - if (pIes) { - /* check if this is a WAPI BSS */ - if (pIes->WAPI.present) { - /* Check if the BSS is capable of doing - * pre-authentication - */ - if (pSession->NumBkidCandidate < CSR_MAX_BKID_ALLOWED) { - - /* if yes, then add to BKIDCandidateList */ - qdf_mem_copy(pSession-> - BkidCandidateInfo[pSession-> - NumBkidCandidate]. - BSSID.bytes, pBssDesc->bssId, - QDF_MAC_ADDR_SIZE); - if (pIes->WAPI.preauth) { - pSession->BkidCandidateInfo[pSession-> - NumBkidCandidate]. - preAuthSupported = true; - } else { - pSession->BkidCandidateInfo[pSession-> - NumBkidCandidate]. - preAuthSupported = false; - } - pSession->NumBkidCandidate++; - } else - status = QDF_STATUS_E_FAILURE; - } - } - - return status; -} - -/* - * This function checks whether new AP is found for the current connected - * profile, if so add to BKIDCandidateList - */ -static bool csr_process_bss_desc_for_bkid_list(tpAniSirGlobal pMac, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes) -{ - bool fRC = false; - tDot11fBeaconIEs *pIesLocal = pIes; - uint32_t sessionId; - struct csr_roam_session *pSession; - QDF_STATUS status; - - if (!(pIesLocal || - QDF_IS_STATUS_SUCCESS( - csr_get_parsed_bss_description_ies(pMac, pBssDesc, - &pIesLocal)))) - return fRC; - - for (sessionId = 0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) { - if (!CSR_IS_SESSION_VALID(pMac, sessionId)) - continue; - pSession = CSR_GET_SESSION(pMac, sessionId); - if (csr_is_conn_state_connected_infra(pMac, sessionId) - && (eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE == - pSession->connectedProfile.AuthType) - && csr_match_bss_to_connect_profile(pMac, - &pSession->connectedProfile, - pBssDesc, pIesLocal)) { - /* this new BSS fits the current profile connected */ - status = csr_add_bkid_candidate_list(pMac, sessionId, - pBssDesc, pIesLocal); - if (QDF_IS_STATUS_SUCCESS(status)) - fRC = true; - } - } - if (!pIes) - qdf_mem_free(pIesLocal); - return fRC; -} - -#endif - static bool csr_scan_save_bss_description(tpAniSirGlobal pMac, tSirBssDescription * pBSSDescription) @@ -2331,76 +2239,6 @@ QDF_STATUS csr_move_bss_to_head_from_bssid(tpAniSirGlobal pMac, return status; } -#ifdef FEATURE_WLAN_WAPI -QDF_STATUS csr_scan_get_bkid_candidate_list(tpAniSirGlobal pMac, - uint32_t sessionId, - tBkidCandidateInfo *pBkidList, - uint32_t *pNumItems) -{ - QDF_STATUS status = QDF_STATUS_SUCCESS; - struct csr_roam_session *pSession = CSR_GET_SESSION(pMac, sessionId); - tCsrScanResultFilter *pScanFilter; - tCsrScanResultInfo *pScanResult; - tScanResultHandle hBSSList; - uint32_t nItems = *pNumItems; - - if (!pSession) { - sme_err("session %d not found", sessionId); - return QDF_STATUS_E_FAILURE; - } - - sme_debug("pMac->scan.NumBkidCandidate = %d", - pSession->NumBkidCandidate); - csr_reset_bkid_candidate_list(pMac, sessionId); - if (!(csr_is_conn_state_connected(pMac, sessionId) - && pSession->pCurRoamProfile)) - return status; - - *pNumItems = 0; - pScanFilter = qdf_mem_malloc(sizeof(tCsrScanResultFilter)); - if (NULL == pScanFilter) - return QDF_STATUS_E_NOMEM; - - /* Here is the profile we need to connect to */ - status = csr_roam_prepare_filter_from_profile(pMac, - pSession->pCurRoamProfile, pScanFilter); - if (!QDF_IS_STATUS_SUCCESS(status)) { - qdf_mem_free(pScanFilter); - return status; - } - - status = csr_scan_get_result(pMac, pScanFilter, &hBSSList); - if (!QDF_IS_STATUS_SUCCESS(status)) { - csr_free_scan_filter(pMac, pScanFilter); - qdf_mem_free(pScanFilter); - return status; - } - - if (pSession->NumBkidCandidate < nItems) { - pScanResult = csr_scan_result_get_next(pMac, hBSSList); - while (pScanResult != NULL) { - /* pMac->scan.NumBkidCandidate adds up here */ - csr_process_bss_desc_for_bkid_list(pMac, - &pScanResult->BssDescriptor, - (tDot11fBeaconIEs *)(pScanResult->pvIes)); - pScanResult = csr_scan_result_get_next(pMac, hBSSList); - } - } - - if (pSession->NumBkidCandidate) { - *pNumItems = pSession->NumBkidCandidate; - qdf_mem_copy(pBkidList, pSession->BkidCandidateInfo, - pSession->NumBkidCandidate * - sizeof(tBkidCandidateInfo)); - } - - csr_scan_result_purge(pMac, hBSSList); - csr_free_scan_filter(pMac, pScanFilter); - qdf_mem_free(pScanFilter); - return status; -} -#endif /* FEATURE_WLAN_WAPI */ - /** * csr_scan_for_ssid() - Function usually used for BSSs that suppresses SSID * @mac_ctx: Pointer to Global Mac structure diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index 3f971091a403..50e16f7c7d73 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -5341,87 +5341,6 @@ bool csr_is_bss_type_ibss(eCsrRoamBssType bssType) || eCSR_BSS_TYPE_IBSS == bssType); } - -static bool csr_is_bss_type_caps_match(eCsrRoamBssType bssType, - tSirBssDescription *pSirBssDesc) -{ - bool fMatch = true; - - do { - switch (bssType) { - case eCSR_BSS_TYPE_ANY: - break; - - case eCSR_BSS_TYPE_INFRASTRUCTURE: - if (!csr_is_infra_bss_desc(pSirBssDesc)) - fMatch = false; - break; - - case eCSR_BSS_TYPE_IBSS: - case eCSR_BSS_TYPE_START_IBSS: - if (!csr_is_ibss_bss_desc(pSirBssDesc)) - fMatch = false; - - break; - default: - fMatch = false; - break; - } - } while (0); - - return fMatch; -} - -static bool csr_is_capabilities_match(tpAniSirGlobal pMac, eCsrRoamBssType - bssType, tSirBssDescription *pSirBssDesc) -{ - return csr_is_bss_type_caps_match(bssType, pSirBssDesc); -} - -static bool csr_is_specific_channel_match(tpAniSirGlobal pMac, - tSirBssDescription *pSirBssDesc, - uint8_t Channel) -{ - bool fMatch = true; - - do { - /* if the channel is ANY, then always match... */ - if (eCSR_OPERATING_CHANNEL_ANY == Channel) - break; - if (Channel == pSirBssDesc->channelId) - break; - - /* didn't match anything.. so return NO match */ - fMatch = false; - - } while (0); - - return fMatch; -} - -static bool csr_is_channel_band_match(tpAniSirGlobal pMac, uint8_t channelId, - tSirBssDescription *pSirBssDesc) -{ - bool fMatch = true; - - do { - /* If the profile says Any channel AND the global settings - * says ANY channel, then we always match. - */ - if (eCSR_OPERATING_CHANNEL_ANY == channelId) - break; - - if (eCSR_OPERATING_CHANNEL_ANY != channelId) { - fMatch = - csr_is_specific_channel_match(pMac, pSirBssDesc, - channelId); - } - - } while (0); - - return fMatch; -} - /** * csr_is_aggregate_rate_supported() - to check if aggregate rate is supported * @mac_ctx: pointer to mac context @@ -5594,142 +5513,6 @@ static bool csr_is_aggregate_rate_supported(tpAniSirGlobal mac_ctx, return supported; } -/** - * csr_is_rate_set_match() - to check if rate set is matching - * @mac_ctx: pointer to mac context - * @bss_supported_rates: supported rates of BSS - * @bss_ext_supp_rates: extended rates of bss - * - * This routine is to checke if rate set is matched or no - * - * Return: bool - */ -static bool csr_is_rate_set_match(tpAniSirGlobal mac_ctx, - tDot11fIESuppRates *bss_supported_rates, - tDot11fIEExtSuppRates *bss_ext_supp_rates) -{ - bool match = true; - uint32_t i; - - /* - * Validate that all of the Basic rates advertised in the Bss - * description are supported - */ - if (bss_supported_rates) { - for (i = 0; i < bss_supported_rates->num_rates; i++) { - if (!CSR_IS_BASIC_RATE(bss_supported_rates->rates[i])) - continue; - if (!csr_is_aggregate_rate_supported(mac_ctx, - bss_supported_rates->rates[i])) { - match = false; - break; - } - } - } - if (match && bss_ext_supp_rates) { - for (i = 0; i < bss_ext_supp_rates->num_rates; i++) { - if (!CSR_IS_BASIC_RATE(bss_ext_supp_rates->rates[i])) - continue; - if (!csr_is_aggregate_rate_supported(mac_ctx, - bss_ext_supp_rates->rates[i])) { - match = false; - break; - } - } - } - return match; -} - -static bool csr_match_connected_bss_security(tpAniSirGlobal pMac, - tCsrRoamConnectedProfile *pProfile, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes) -{ - tCsrEncryptionList ucEncryptionList, mcEncryptionList; - tCsrAuthList authList; - - ucEncryptionList.numEntries = 1; - ucEncryptionList.encryptionType[0] = pProfile->EncryptionType; - - mcEncryptionList.numEntries = 1; - mcEncryptionList.encryptionType[0] = pProfile->mcEncryptionType; - - authList.numEntries = 1; - authList.authType[0] = pProfile->AuthType; - -#ifdef WLAN_FEATURE_11W - return csr_is_security_match(pMac, &authList, &ucEncryptionList, - &mcEncryptionList, - &pProfile->MFPEnabled, - &pProfile->MFPRequired, - &pProfile->MFPCapable, - pBssDesc, pIes, NULL, NULL, NULL); -#else - return csr_is_security_match(pMac, &authList, &ucEncryptionList, - &mcEncryptionList, NULL, NULL, NULL, - pBssDesc, pIes, NULL, NULL, NULL); -#endif - -} - -bool csr_match_bss_to_connect_profile(tHalHandle hHal, - tCsrRoamConnectedProfile *pProfile, - tSirBssDescription *pBssDesc, - tDot11fBeaconIEs *pIes) -{ - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - bool fRC = false, fCheck; - tDot11fBeaconIEs *pIesLocal = pIes; - - do { - if (!pIes) { - if (!QDF_IS_STATUS_SUCCESS - (csr_get_parsed_bss_description_ies - (pMac, pBssDesc, &pIesLocal))) - break; - } - fCheck = true; - if (pIesLocal->SSID.present) { - bool fCheckSsid = false; - - if (pProfile->SSID.length) - fCheckSsid = true; - - fCheck = - csr_is_ssid_match(pMac, pProfile->SSID.ssId, - pProfile->SSID.length, - pIesLocal->SSID.ssid, - pIesLocal->SSID.num_ssid, - fCheckSsid); - if (!fCheck) - break; - } - if (!csr_match_connected_bss_security - (pMac, pProfile, pBssDesc, pIesLocal)) - break; - if (!csr_is_capabilities_match(pMac, pProfile->BSSType, - pBssDesc)) - break; - if (!csr_is_rate_set_match(pMac, &pIesLocal->SuppRates, - &pIesLocal->ExtSuppRates)) - break; - fCheck = csr_is_channel_band_match(pMac, - pProfile->operationChannel, - pBssDesc); - if (!fCheck) - break; - - fRC = true; - - } while (0); - - if (!pIes && pIesLocal) - /* locally allocated */ - qdf_mem_free(pIesLocal); - - return fRC; -} - void csr_add_rate_bitmap(uint8_t rate, uint16_t *pRateBitmap) { uint16_t rateBitmap;