diff options
| author | Chandrasekaran, Manishekar <cmshekar@qti.qualcomm.com> | 2014-08-22 12:22:26 +0530 |
|---|---|---|
| committer | AnjaneeDevi Kapparapu <c_akappa@qti.qualcomm.com> | 2014-09-04 11:51:36 +0530 |
| commit | ad94d95937d26396792dc8a7d2cfdb92f8a44b2b (patch) | |
| tree | 224fca28953f0c86aa7763684633b07bb133abc0 | |
| parent | 24f1aa9d7b407e31bf90866fd9814fac0e100623 (diff) | |
prop: wlan: Fix to select the right country code during roaming
In the current code, with the voting logic for regulatory
in place, during roaming, instead of selecting the
country code of the AP that the STA joins, the STA is
selecting the country code that is decided by the voting
mechanism. This is fixed using this gerrit by using the
country code information from beacon and probe response
for roaming and by using the voting mechanism for other
scenarios.
Change-Id: I301be19f5e031634d4133b4fa448d2b7c54c5257
CRs-Fixed: 713484
| -rw-r--r-- | CORE/SME/src/csr/csrApiRoam.c | 2 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiScan.c | 61 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrInsideApi.h | 3 |
3 files changed, 53 insertions, 13 deletions
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c index d8940f61c3b2..991ed1828502 100644 --- a/CORE/SME/src/csr/csrApiRoam.c +++ b/CORE/SME/src/csr/csrApiRoam.c @@ -3965,7 +3965,7 @@ eHalStatus csrRoamSetBssConfigCfg(tpAniSirGlobal pMac, tANI_U32 sessionId, tCsrR //Do we need to worry about sequence for OSs that are not Windows?? if (pBssDesc) { - if (csrLearnCountryInformation(pMac, eANI_BOOLEAN_TRUE)) + if (csrLearnCountryInformation(pMac, pBssDesc, pIes, eANI_BOOLEAN_TRUE)) { //Make sure the 11d info from this BSSDesc can be applied pMac->scan.fAmbiguous11dInfoFound = eANI_BOOLEAN_FALSE; diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c index 8603942a48e6..bed23cedbf4f 100644 --- a/CORE/SME/src/csr/csrApiScan.c +++ b/CORE/SME/src/csr/csrApiScan.c @@ -3190,7 +3190,7 @@ static void csrMoveTempScanResultsToMainList(tpAniSirGlobal pMac, } } csrElectedCountryInfo(pMac); - csrLearnCountryInformation( pMac, eANI_BOOLEAN_TRUE ); + csrLearnCountryInformation( pMac, NULL, NULL, eANI_BOOLEAN_TRUE ); } end: @@ -4107,38 +4107,71 @@ void csrConstructCurrentValidChannelList( tpAniSirGlobal pMac, tDblLinkList *pCh /* * 802.11D only: Gather 11d IE via beacon or Probe response and store them in pAdapter->channels11d */ -tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tANI_BOOLEAN fForce) +tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tSirBssDescription *pSirBssDesc, + tDot11fBeaconIEs *pIes, tANI_BOOLEAN fForce) { eHalStatus status; + tANI_U8 *pCountryCodeSelected; tANI_BOOLEAN fRet = eANI_BOOLEAN_FALSE; v_REGDOMAIN_t domainId; + tDot11fBeaconIEs *pIesLocal = pIes; + tANI_BOOLEAN useVoting = eANI_BOOLEAN_FALSE; if (VOS_STA_SAP_MODE == vos_get_conparam ()) return eHAL_STATUS_SUCCESS; + if ((NULL == pSirBssDesc) && (NULL == pIes)) + useVoting = eANI_BOOLEAN_TRUE; + do { // check if .11d support is enabled if( !csrIs11dSupported( pMac ) ) break; -#ifdef CONFIG_ENABLE_LINUX_REG - csrGetRegulatoryDomainForCountry(pMac, pMac->scan.countryCodeElected, - &domainId, COUNTRY_IE); -#endif -#ifndef CONFIG_ENABLE_LINUX_REG + if (eANI_BOOLEAN_FALSE == useVoting) + { + if( !pIesLocal && + (!HAL_STATUS_SUCCESS(csrGetParsedBssDescriptionIEs(pMac, + pSirBssDesc, &pIesLocal)))) + { + break; + } + // check if country information element is present + if(!pIesLocal->Country.present) + { + //No country info + break; + } + + if( HAL_STATUS_SUCCESS(csrGetRegulatoryDomainForCountry + (pMac, pIesLocal->Country.country, &domainId, + COUNTRY_QUERY)) && + ( domainId == REGDOMAIN_WORLD)) + { + break; + } + } //useVoting == eANI_BOOLEAN_FALSE + + if (eANI_BOOLEAN_FALSE == useVoting) + pCountryCodeSelected = pIesLocal->Country.country; + else + pCountryCodeSelected = pMac->scan.countryCodeElected; + status = csrGetRegulatoryDomainForCountry(pMac, - pMac->scan.countryCodeElected, &domainId, COUNTRY_IE); + pCountryCodeSelected, &domainId, COUNTRY_IE); if ( status != eHAL_STATUS_SUCCESS ) { smsLog( pMac, LOGE, FL(" fail to get regId %d"), domainId ); fRet = eANI_BOOLEAN_FALSE; break; } + +#ifndef CONFIG_ENABLE_LINUX_REG // Checking for Domain Id change if ( domainId != pMac->scan.domainIdCurrent ) { vos_mem_copy(pMac->scan.countryCode11d, - pMac->scan.countryCodeElected, + pCountryCodeSelected, sizeof( pMac->scan.countryCode11d ) ); /* Set Current Country code and Current Regulatory domain */ status = csrSetRegulatoryDomain(pMac, domainId, NULL); @@ -4150,9 +4183,9 @@ tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tANI_BOOLEAN fForc } //csrSetRegulatoryDomain will fail if the country doesn't fit our domain criteria. vos_mem_copy(pMac->scan.countryCodeCurrent, - pMac->scan.countryCodeElected, WNI_CFG_COUNTRY_CODE_LEN); + pCountryCodeSelected, WNI_CFG_COUNTRY_CODE_LEN); //Simply set it to cfg. - csrSetCfgCountryCode(pMac, pMac->scan.countryCodeElected); + csrSetCfgCountryCode(pMac, pCountryCodeSelected); /* overwrite the defualt country code */ vos_mem_copy(pMac->scan.countryCodeDefault, @@ -4183,6 +4216,12 @@ tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tANI_BOOLEAN fForc } while( 0 ); + if( !pIes && pIesLocal ) + { + //locally allocated + vos_mem_free(pIesLocal); + } + return( fRet ); } diff --git a/CORE/SME/src/csr/csrInsideApi.h b/CORE/SME/src/csr/csrInsideApi.h index 81f09b9acb19..6df3bada4a81 100644 --- a/CORE/SME/src/csr/csrInsideApi.h +++ b/CORE/SME/src/csr/csrInsideApi.h @@ -302,7 +302,8 @@ eHalStatus csrScanAgeResults(tpAniSirGlobal pMac, tSmeGetScanChnRsp *pScanChnInf //If fForce is TRUE we will save the new String that is learn't. //Typically it will be true in case of Join or user initiated ioctl -tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tANI_BOOLEAN fForce ); +tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tSirBssDescription *pSirBssDesc, + tDot11fBeaconIEs *pIes, tANI_BOOLEAN fForce ); void csrApplyCountryInformation( tpAniSirGlobal pMac, tANI_BOOLEAN fForce ); void csrSetCfgScanControlList( tpAniSirGlobal pMac, tANI_U8 *countryCode, tCsrChannel *pChannelList ); void csrReinitScanCmd(tpAniSirGlobal pMac, tSmeCmd *pCommand); |
