|
@@ -5640,215 +5640,6 @@ static bool csr_is_rate_set_match(tpAniSirGlobal mac_ctx,
|
|
|
return match;
|
|
|
}
|
|
|
|
|
|
-#ifdef WLAN_FEATURE_FILS_SK
|
|
|
-/*
|
|
|
- * csr_is_fils_realm_match: API to check whether realm in scan filter is
|
|
|
- * matching with realm in bss info
|
|
|
- * @bss_descr: bss description
|
|
|
- * @filter: scan filter
|
|
|
- *
|
|
|
- * Return: true if success else false
|
|
|
- */
|
|
|
-static bool csr_is_fils_realm_match(tSirBssDescription *bss_descr,
|
|
|
- tCsrScanResultFilter *filter)
|
|
|
-{
|
|
|
- int i;
|
|
|
- bool is_match = true;
|
|
|
-
|
|
|
- if (filter->realm_check) {
|
|
|
- is_match = false;
|
|
|
- for (i = 0; i < bss_descr->fils_info_element.realm_cnt; i++) {
|
|
|
- if (!qdf_mem_cmp(filter->fils_realm,
|
|
|
- bss_descr->fils_info_element.realm[i],
|
|
|
- SIR_REALM_LEN)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return is_match;
|
|
|
-}
|
|
|
-#else
|
|
|
-static bool csr_is_fils_realm_match(tSirBssDescription *bss_descr,
|
|
|
- tCsrScanResultFilter *filter)
|
|
|
-{
|
|
|
- return true;
|
|
|
-}
|
|
|
-#endif
|
|
|
-/**
|
|
|
- * csr_match_bss() - to compare the bss
|
|
|
- * @hal: pointer to hal context
|
|
|
- * @bss_descr: pointer bss description
|
|
|
- * @filter: scan filter
|
|
|
- * @neg_auth: negotiated auth
|
|
|
- * @neg_uc: negotiated for unicast
|
|
|
- * @neg_mc: negotiated for multicast
|
|
|
- * @ie_dblptr: double pointer to IE
|
|
|
- *
|
|
|
- * This routine will be called to match the bss
|
|
|
- * If caller want to get the *ie_dblptr allocated by this function,
|
|
|
- * pass in *ie_dblptr = NULL
|
|
|
- *
|
|
|
- * Return: bool
|
|
|
- */
|
|
|
-bool csr_match_bss(tHalHandle hal, tSirBssDescription *bss_descr,
|
|
|
- tCsrScanResultFilter *filter, eCsrAuthType *neg_auth,
|
|
|
- eCsrEncryptionType *neg_uc, eCsrEncryptionType *neg_mc,
|
|
|
- tDot11fBeaconIEs **ie_dblptr)
|
|
|
-{
|
|
|
- tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
|
|
|
- bool rc = false, check, blacklist_check;
|
|
|
- uint32_t i;
|
|
|
- tDot11fBeaconIEs *ie_ptr = NULL;
|
|
|
- uint8_t *pb;
|
|
|
- struct roam_ext_params *roam_params;
|
|
|
- uint8_t *p2p_macaddr = NULL;
|
|
|
-
|
|
|
- roam_params = &mac_ctx->roam.configParam.roam_params;
|
|
|
- if ((NULL == ie_dblptr) || (*ie_dblptr) == NULL) {
|
|
|
- /* If no IEs passed in, get our own. */
|
|
|
- if (!QDF_IS_STATUS_SUCCESS(
|
|
|
- csr_get_parsed_bss_description_ies(mac_ctx,
|
|
|
- bss_descr, &ie_ptr))) {
|
|
|
- goto end;
|
|
|
- }
|
|
|
- } else {
|
|
|
- /* Save the one pass in for local use */
|
|
|
- ie_ptr = *ie_dblptr;
|
|
|
- }
|
|
|
-
|
|
|
- /* Check if caller wants P2P */
|
|
|
- check = (!filter->p2pResult || ie_ptr->P2PBeaconProbeRes.present);
|
|
|
- if (!check)
|
|
|
- goto end;
|
|
|
-
|
|
|
- /* Check for Blacklist BSSID's and avoid connections */
|
|
|
- blacklist_check = false;
|
|
|
- for (i = 0; i < roam_params->num_bssid_avoid_list; i++) {
|
|
|
- if (qdf_is_macaddr_equal((struct qdf_mac_addr *)
|
|
|
- &roam_params->bssid_avoid_list[i],
|
|
|
- (struct qdf_mac_addr *)bss_descr->bssId)) {
|
|
|
- blacklist_check = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (blacklist_check) {
|
|
|
- sme_err("Don't Attempt connect to blacklist bssid");
|
|
|
- goto end;
|
|
|
- }
|
|
|
-
|
|
|
- if (ie_ptr->SSID.present) {
|
|
|
- for (i = 0; i < filter->SSIDs.numOfSSIDs; i++) {
|
|
|
- check = csr_is_ssid_match(mac_ctx,
|
|
|
- filter->SSIDs.SSIDList[i].SSID.ssId,
|
|
|
- filter->SSIDs.SSIDList[i].SSID.length,
|
|
|
- ie_ptr->SSID.ssid,
|
|
|
- ie_ptr->SSID.num_ssid, true);
|
|
|
- if (check)
|
|
|
- break;
|
|
|
- }
|
|
|
- if (!check)
|
|
|
- goto end;
|
|
|
- }
|
|
|
- check = true;
|
|
|
- p2p_macaddr = ie_ptr->P2PBeaconProbeRes.P2PDeviceInfo.P2PDeviceAddress;
|
|
|
- for (i = 0; i < filter->BSSIDs.numOfBSSIDs; i++) {
|
|
|
- check = csr_is_bssid_match(mac_ctx,
|
|
|
- (struct qdf_mac_addr *)&filter->BSSIDs.bssid[i],
|
|
|
- (struct qdf_mac_addr *)bss_descr->bssId);
|
|
|
- if (check)
|
|
|
- break;
|
|
|
-
|
|
|
- if (filter->p2pResult && ie_ptr->P2PBeaconProbeRes.present) {
|
|
|
- check = csr_is_bssid_match(mac_ctx,
|
|
|
- (struct qdf_mac_addr *)
|
|
|
- &filter->BSSIDs.bssid[i],
|
|
|
- (struct qdf_mac_addr *)p2p_macaddr);
|
|
|
- if (check)
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (!check)
|
|
|
- goto end;
|
|
|
-
|
|
|
- check = true;
|
|
|
- for (i = 0; i < filter->ChannelInfo.numOfChannels; i++) {
|
|
|
- check = csr_is_channel_band_match(mac_ctx,
|
|
|
- filter->ChannelInfo.ChannelList[i], bss_descr);
|
|
|
- if (check)
|
|
|
- break;
|
|
|
- }
|
|
|
- if (!check)
|
|
|
- goto end;
|
|
|
- /* If this is for measurement filtering */
|
|
|
- if (filter->fMeasurement) {
|
|
|
- rc = true;
|
|
|
- goto end;
|
|
|
- }
|
|
|
- if (!csr_is_phy_mode_match(mac_ctx, filter->phyMode, bss_descr,
|
|
|
- NULL, NULL, ie_ptr))
|
|
|
- goto end;
|
|
|
-
|
|
|
-#ifdef WLAN_FEATURE_11W
|
|
|
- if ((!filter->bWPSAssociation) && (!filter->bOSENAssociation) &&
|
|
|
- !csr_is_security_match(mac_ctx, &filter->authType,
|
|
|
- &filter->EncryptionType,
|
|
|
- &filter->mcEncryptionType,
|
|
|
- &filter->MFPEnabled,
|
|
|
- &filter->MFPRequired,
|
|
|
- &filter->MFPCapable,
|
|
|
- bss_descr, ie_ptr, neg_auth,
|
|
|
- neg_uc, neg_mc))
|
|
|
-#else
|
|
|
- if ((!filter->bWPSAssociation) && (!filter->bOSENAssociation) &&
|
|
|
- !csr_is_security_match(mac_ctx, &filter->authType,
|
|
|
- &filter->EncryptionType,
|
|
|
- &filter->mcEncryptionType,
|
|
|
- NULL, NULL, NULL,
|
|
|
- bss_descr, ie_ptr, neg_auth,
|
|
|
- neg_uc, neg_mc))
|
|
|
-#endif
|
|
|
- goto end;
|
|
|
- if (!csr_is_capabilities_match(mac_ctx, filter->BSSType, bss_descr))
|
|
|
- goto end;
|
|
|
- if (!csr_is_rate_set_match(mac_ctx, &ie_ptr->SuppRates,
|
|
|
- &ie_ptr->ExtSuppRates))
|
|
|
- goto end;
|
|
|
- if ((eCsrRoamWmmQbssOnly == mac_ctx->roam.configParam.WMMSupportMode)
|
|
|
- && !CSR_IS_QOS_BSS(ie_ptr))
|
|
|
- goto end;
|
|
|
- /*
|
|
|
- * Check country. check even when pb is NULL because we may
|
|
|
- * want to make sure
|
|
|
- */
|
|
|
- pb = (filter->countryCode[0]) ? (filter->countryCode) : NULL;
|
|
|
- check = csr_match_country_code(mac_ctx, pb, ie_ptr);
|
|
|
- if (!check)
|
|
|
- goto end;
|
|
|
-
|
|
|
- if (filter->MDID.mdiePresent && csr_roam_is11r_assoc(mac_ctx,
|
|
|
- mac_ctx->roam.roamSession->sessionId)) {
|
|
|
- if (bss_descr->mdiePresent) {
|
|
|
- if (filter->MDID.mobilityDomain !=
|
|
|
- (bss_descr->mdie[1] << 8 |
|
|
|
- bss_descr->mdie[0]))
|
|
|
- goto end;
|
|
|
- } else {
|
|
|
- goto end;
|
|
|
- }
|
|
|
- }
|
|
|
- rc = true;
|
|
|
- if (rc)
|
|
|
- rc = csr_is_fils_realm_match(bss_descr, filter);
|
|
|
-
|
|
|
-end:
|
|
|
- if (ie_dblptr)
|
|
|
- *ie_dblptr = ie_ptr;
|
|
|
- else if (ie_ptr)
|
|
|
- qdf_mem_free(ie_ptr);
|
|
|
- return rc;
|
|
|
-}
|
|
|
-
|
|
|
static bool csr_match_connected_bss_security(tpAniSirGlobal pMac,
|
|
|
tCsrRoamConnectedProfile *pProfile,
|
|
|
tSirBssDescription *pBssDesc,
|
|
@@ -6456,49 +6247,6 @@ QDF_STATUS csr_get_regulatory_domain_for_country(tpAniSirGlobal pMac,
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
-/* To check whether a country code matches the one in the IE
|
|
|
- * Only check the first two characters, ignoring in/outdoor
|
|
|
- * pCountry -- caller allocated buffer contain the country
|
|
|
- * code that is checking against the one in pIes. It can be
|
|
|
- * NULL. Caller must provide pIes, it cannot be NULL This
|
|
|
- * function always return true if 11d support is not turned on.
|
|
|
- */
|
|
|
-bool csr_match_country_code(tpAniSirGlobal pMac, uint8_t *pCountry,
|
|
|
- tDot11fBeaconIEs *pIes)
|
|
|
-{
|
|
|
- bool fRet = true;
|
|
|
-
|
|
|
- do {
|
|
|
- if (!wlan_reg_11d_enabled_on_host(pMac->psoc))
|
|
|
- break;
|
|
|
-
|
|
|
- if (!pIes) {
|
|
|
- sme_err("No IEs");
|
|
|
- break;
|
|
|
- }
|
|
|
-
|
|
|
- if (pCountry) {
|
|
|
- uint32_t i;
|
|
|
-
|
|
|
- if (!pIes->Country.present) {
|
|
|
- fRet = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- /* Convert the CountryCode characters to upper */
|
|
|
- for (i = 0; i < WNI_CFG_COUNTRY_CODE_LEN - 1; i++)
|
|
|
- pCountry[i] = csr_to_upper(pCountry[i]);
|
|
|
-
|
|
|
- if (qdf_mem_cmp(pIes->Country.country, pCountry,
|
|
|
- WNI_CFG_COUNTRY_CODE_LEN - 1)) {
|
|
|
- fRet = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- } while (0);
|
|
|
-
|
|
|
- return fRet;
|
|
|
-}
|
|
|
-
|
|
|
QDF_STATUS csr_get_modify_profile_fields(tpAniSirGlobal pMac,
|
|
|
uint32_t sessionId,
|
|
|
tCsrRoamModifyProfileFields *
|