|
@@ -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;
|