|
@@ -1257,108 +1257,6 @@ static bool csr_scan_flush_denied(tpAniSirGlobal pMac)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static QDF_STATUS csr_add_pmkid_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);
|
|
|
- tPmkidCandidateInfo *pmkid_info = NULL;
|
|
|
-#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
|
|
|
- WLAN_HOST_DIAG_EVENT_DEF(secEvent,
|
|
|
- host_event_wlan_security_payload_type);
|
|
|
-#endif /* FEATURE_WLAN_DIAG_SUPPORT_CSR */
|
|
|
- if (!pSession) {
|
|
|
- sme_err("session %d not found", sessionId);
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
- }
|
|
|
-
|
|
|
- sme_debug("NumPmkidCandidate: %d", pSession->NumPmkidCandidate);
|
|
|
- if (!pIes)
|
|
|
- return status;
|
|
|
- /* check if this is a RSN BSS */
|
|
|
- if (!pIes->RSN.present)
|
|
|
- return status;
|
|
|
-
|
|
|
- if (pSession->NumPmkidCandidate >= CSR_MAX_PMKID_ALLOWED)
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
-
|
|
|
- /* BSS is capable of doing pre-authentication */
|
|
|
-#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
|
|
|
- qdf_mem_set(&secEvent, sizeof(host_event_wlan_security_payload_type),
|
|
|
- 0);
|
|
|
- secEvent.eventId = WLAN_SECURITY_EVENT_PMKID_CANDIDATE_FOUND;
|
|
|
- secEvent.encryptionModeMulticast = (uint8_t)diag_enc_type_from_csr_type(
|
|
|
- pSession->connectedProfile.mcEncryptionType);
|
|
|
- secEvent.encryptionModeUnicast = (uint8_t)diag_enc_type_from_csr_type(
|
|
|
- pSession->connectedProfile.EncryptionType);
|
|
|
- qdf_mem_copy(secEvent.bssid, pSession->connectedProfile.bssid.bytes,
|
|
|
- QDF_MAC_ADDR_SIZE);
|
|
|
- secEvent.authMode = (uint8_t)diag_auth_type_from_csr_type(
|
|
|
- pSession->connectedProfile.AuthType);
|
|
|
- WLAN_HOST_DIAG_EVENT_REPORT(&secEvent, EVENT_WLAN_SECURITY);
|
|
|
-#endif /* #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR */
|
|
|
-
|
|
|
- pmkid_info = &pSession->PmkidCandidateInfo[pSession->NumPmkidCandidate];
|
|
|
- /* if yes, then add to PMKIDCandidateList */
|
|
|
- qdf_mem_copy(pmkid_info->BSSID.bytes, pBssDesc->bssId,
|
|
|
- QDF_MAC_ADDR_SIZE);
|
|
|
- /* Bit 0 offirst byte - PreAuthentication Capability */
|
|
|
- if ((pIes->RSN.RSN_Cap[0] >> 0) & 0x1)
|
|
|
- pmkid_info->preAuthSupported = true;
|
|
|
- else
|
|
|
- pmkid_info->preAuthSupported = false;
|
|
|
- pSession->NumPmkidCandidate++;
|
|
|
- return status;
|
|
|
-}
|
|
|
-/*
|
|
|
- * This function checks whether new AP is found for the current connected
|
|
|
- * profile. If it is found, it return the sessionId, else it return invalid
|
|
|
- * sessionID
|
|
|
- */
|
|
|
-static QDF_STATUS csr_process_bss_desc_for_pmkid_list(tpAniSirGlobal pMac,
|
|
|
- tSirBssDescription *pBssDesc,
|
|
|
- tDot11fBeaconIEs *pIes,
|
|
|
- uint8_t sessionId)
|
|
|
-{
|
|
|
- struct csr_roam_session *pSession;
|
|
|
- tDot11fBeaconIEs *pIesLocal = pIes;
|
|
|
- QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
|
|
-
|
|
|
- if (!(pIesLocal ||
|
|
|
- QDF_IS_STATUS_SUCCESS(
|
|
|
- csr_get_parsed_bss_description_ies(pMac, pBssDesc,
|
|
|
- &pIesLocal))))
|
|
|
- return status;
|
|
|
-
|
|
|
- if (!CSR_IS_SESSION_VALID(pMac, sessionId)) {
|
|
|
- if (!pIes)
|
|
|
- qdf_mem_free(pIesLocal);
|
|
|
- return status;
|
|
|
- }
|
|
|
-
|
|
|
- pSession = CSR_GET_SESSION(pMac, sessionId);
|
|
|
- if (csr_is_conn_state_connected_infra(pMac, sessionId)
|
|
|
- && (eCSR_AUTH_TYPE_RSN == 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_pmkid_candidate_list(pMac, sessionId,
|
|
|
- pBssDesc, pIesLocal);
|
|
|
- if (!QDF_IS_STATUS_SUCCESS(status))
|
|
|
- sme_err("csr_add_pmkid_candidate_list failed");
|
|
|
- else
|
|
|
- status = QDF_STATUS_SUCCESS;
|
|
|
- }
|
|
|
-
|
|
|
- if (!pIes)
|
|
|
- qdf_mem_free(pIesLocal);
|
|
|
-
|
|
|
- return status;
|
|
|
-}
|
|
|
-
|
|
|
#ifdef FEATURE_WLAN_WAPI
|
|
|
static QDF_STATUS csr_add_bkid_candidate_list(tpAniSirGlobal pMac,
|
|
|
uint32_t sessionId,
|
|
@@ -2433,75 +2331,6 @@ QDF_STATUS csr_move_bss_to_head_from_bssid(tpAniSirGlobal pMac,
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
-QDF_STATUS csr_scan_get_pmkid_candidate_list(tpAniSirGlobal pMac,
|
|
|
- uint32_t sessionId,
|
|
|
- tPmkidCandidateInfo *pPmkidList,
|
|
|
- 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.NumPmkidCandidate = %d",
|
|
|
- pSession->NumPmkidCandidate);
|
|
|
- csr_reset_pmkid_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->NumPmkidCandidate < nItems) {
|
|
|
- pScanResult = csr_scan_result_get_next(pMac, hBSSList);
|
|
|
- while (pScanResult != NULL) {
|
|
|
- /* NumPmkidCandidate adds up here */
|
|
|
- csr_process_bss_desc_for_pmkid_list(pMac,
|
|
|
- &pScanResult->BssDescriptor,
|
|
|
- (tDot11fBeaconIEs *)(pScanResult->pvIes),
|
|
|
- sessionId);
|
|
|
- pScanResult = csr_scan_result_get_next(pMac, hBSSList);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (pSession->NumPmkidCandidate) {
|
|
|
- *pNumItems = pSession->NumPmkidCandidate;
|
|
|
- qdf_mem_copy(pPmkidList, pSession->PmkidCandidateInfo,
|
|
|
- pSession->NumPmkidCandidate *
|
|
|
- sizeof(tPmkidCandidateInfo));
|
|
|
- }
|
|
|
-
|
|
|
- csr_scan_result_purge(pMac, hBSSList);
|
|
|
- csr_free_scan_filter(pMac, pScanFilter);
|
|
|
- qdf_mem_free(pScanFilter);
|
|
|
- return status;
|
|
|
-}
|
|
|
-
|
|
|
#ifdef FEATURE_WLAN_WAPI
|
|
|
QDF_STATUS csr_scan_get_bkid_candidate_list(tpAniSirGlobal pMac,
|
|
|
uint32_t sessionId,
|