diff options
| author | Amar Singhal <asinghal@qca.qualcomm.com> | 2014-08-01 15:54:35 -0700 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-08-13 11:31:04 -0700 |
| commit | 50f6a46d215216101513a88fdebc5f2ea7e5e01d (patch) | |
| tree | d80adf7124109b21d8a6b83f4ee1ce3d10839c30 | |
| parent | 7a4d3f822ba3ed0046c838c2bfeff2e11b349eb1 (diff) | |
wlan: remove config item CONFIG_ENABLE_LINUX_REG
remove the config item CONFIG_ENABLE_LINUX_REG
CRs-Fixed: 704142
Change-Id: I67c22940d775ced90332f318d99fc6e797acce02
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg80211.h | 8 | ||||
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_main.h | 10 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 9 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_early_suspend.c | 2 | ||||
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 124 | ||||
| -rw-r--r-- | CORE/SME/src/csr/csrApiScan.c | 126 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 21 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_api.c | 27 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_nvitem.c | 1182 | ||||
| -rw-r--r-- | Kbuild | 8 | ||||
| -rw-r--r-- | Kconfig | 4 |
11 files changed, 13 insertions, 1508 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index e23eb8bbea07..578e50b815c4 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -792,19 +792,11 @@ void wlan_hdd_cfg80211_register_frames(hdd_adapter_t* pAdapter); void wlan_hdd_cfg80211_deregister_frames(hdd_adapter_t* pAdapter); -#ifdef CONFIG_ENABLE_LINUX_REG #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) void wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); #else int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); #endif -#else -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) -void wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); -#else -int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); -#endif -#endif extern v_VOID_t hdd_connSetConnectionState( hdd_station_ctx_t *pHddStaCtx, eConnectionState connState ); diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 1c751d6fec88..aa4681382f32 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -132,11 +132,7 @@ #define WAIT_TIME_TDLS_INITIATOR 600 /* Maximum time to get linux regulatory entry settings */ -#ifdef CONFIG_ENABLE_LINUX_REG #define LINUX_REG_WAIT_TIME 300 -#else -#define CRDA_WAIT_TIME 300 -#endif /* Scan Req Timeout */ #define WLAN_WAIT_TIME_SCAN_REQ 100 @@ -1276,11 +1272,7 @@ struct hdd_context_s struct completion mc_sus_event_var; /* Completion variable for regulatory hint */ -#ifdef CONFIG_ENABLE_LINUX_REG struct completion linux_reg_req; -#else - struct completion driver_crda_req; -#endif v_BOOL_t isWlanSuspended; @@ -1599,9 +1591,7 @@ void hdd_ipv6_notifier_work_queue(struct work_struct *work); #endif -#ifdef CONFIG_ENABLE_LINUX_REG void hdd_checkandupdate_phymode( hdd_context_t *pHddCtx); -#endif int hdd_wmmps_helper(hdd_adapter_t *pAdapter, tANI_U8 *ptr); int wlan_hdd_set_mc_rate(hdd_adapter_t *pAdapter, int targetRate); diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index c724d236eb87..b8ffe947bfec 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -3546,11 +3546,6 @@ int wlan_hdd_cfg80211_init(struct device *dev, wiphy->mgmt_stypes = wlan_hdd_txrx_stypes; -#ifndef CONFIG_ENABLE_LINUX_REG - /* the flag for the other case would be initialzed in - vos_init_wiphy_from_nv_bin */ - wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY; -#endif /* This will disable updating of NL channels from passive to * active if a beacon is received on passive channel. */ @@ -3604,7 +3599,6 @@ int wlan_hdd_cfg80211_init(struct device *dev, if (vos_get_conparam() != VOS_FTM_MODE) { #endif -#ifdef CONFIG_ENABLE_LINUX_REG /* even with WIPHY_FLAG_CUSTOM_REGULATORY, driver can still register regulatory callback and it will get regulatory settings in wiphy->band[], but @@ -3612,9 +3606,6 @@ int wlan_hdd_cfg80211_init(struct device *dev, regulatory settings */ wiphy->reg_notifier = wlan_hdd_linux_reg_notifier; -#else - wiphy->reg_notifier = wlan_hdd_crda_reg_notifier; -#endif #if defined QCA_WIFI_FTM } diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c index f426b2f5158c..04deaa45954d 100644 --- a/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -2058,7 +2058,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) goto err_vosclose; } -#ifdef CONFIG_ENABLE_LINUX_REG /* initialize the NV module. This is required so that we can initialize the channel information in wiphy from the NV.bin data. The channel information in @@ -2072,7 +2071,6 @@ VOS_STATUS hdd_wlan_re_init(void *hif_sc) "%s: vos_init_wiphy_from_eeprom failed", __func__); goto err_vosclose; } -#endif vosStatus = hdd_set_sme_chan_list(pHddCtx); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 003b75e7040b..bb9ddf08c15f 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -867,7 +867,8 @@ int wlan_hdd_validate_context(hdd_context_t *pHddCtx) } return 0; } -#ifdef CONFIG_ENABLE_LINUX_REG + + void hdd_checkandupdate_phymode( hdd_context_t *pHddCtx) { hdd_adapter_t *pAdapter = NULL; @@ -944,77 +945,7 @@ void hdd_checkandupdate_phymode( hdd_context_t *pHddCtx) } } } -#else -void hdd_checkandupdate_phymode( hdd_adapter_t *pAdapter, char *country_code) -{ - hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - hdd_config_t *cfg_param; - eCsrPhyMode phyMode; - unsigned long rc; - - if (NULL == pHddCtx) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "HDD Context is null !!"); - return ; - } - - cfg_param = pHddCtx->cfg_ini; - - if (NULL == cfg_param) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, - "cfg_params not available !!"); - return ; - } - - phyMode = sme_GetPhyMode(WLAN_HDD_GET_HAL_CTX(pAdapter)); - - if (NULL != strstr(cfg_param->listOfNon11acCountryCode, country_code)) - { - if ((eCSR_DOT11_MODE_AUTO == phyMode) || - (eCSR_DOT11_MODE_11ac == phyMode) || - (eCSR_DOT11_MODE_11ac_ONLY == phyMode)) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "Setting phymode to 11n!!"); - sme_SetPhyMode(WLAN_HDD_GET_HAL_CTX(pAdapter), eCSR_DOT11_MODE_11n); - } - } - else - { - /*New country Supports 11ac as well resetting value back from .ini*/ - sme_SetPhyMode(WLAN_HDD_GET_HAL_CTX(pAdapter), - hdd_cfg_xlate_to_csr_phy_mode(cfg_param->dot11Mode)); - return ; - } - - if ((eConnectionState_Associated == pHddStaCtx->conn_info.connState) && - ((eCSR_CFG_DOT11_MODE_11AC_ONLY == pHddStaCtx->conn_info.dot11Mode) || - (eCSR_CFG_DOT11_MODE_11AC == pHddStaCtx->conn_info.dot11Mode))) - { - VOS_STATUS vosStatus; - - // need to issue a disconnect to CSR. - INIT_COMPLETION(pAdapter->disconnect_comp_var); - vosStatus = sme_RoamDisconnect(WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId, - eCSR_DISCONNECT_REASON_UNSPECIFIED ); - if (VOS_STATUS_SUCCESS == vosStatus) - { - rc = wait_for_completion_timeout(&pAdapter->disconnect_comp_var, - msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); - if (!rc) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "wait on disconnect_comp_var is failed"); - } - } - } -} -#endif //CONFIG_ENABLE_LINUX_REG void hdd_checkandupdate_dfssetting( hdd_adapter_t *pAdapter, char *country_code) { @@ -3750,9 +3681,7 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, INIT_COMPLETION(pAdapter->change_country_code); hdd_checkandupdate_dfssetting(pAdapter, country_code); -#ifndef CONFIG_ENABLE_LINUX_REG - hdd_checkandupdate_phymode(pAdapter, country_code); -#endif + status = sme_ChangeCountryCode(pHddCtx->hHal, (void *)(tSmeChangeCountryCallback) @@ -10444,7 +10373,6 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) /* Destroy the wake lock */ vos_wake_lock_destroy(&pHddCtx->sap_wake_lock); -#ifdef CONFIG_ENABLE_LINUX_REG vosStatus = vos_nv_close(); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { @@ -10452,7 +10380,6 @@ void hdd_wlan_exit(hdd_context_t *pHddCtx) "%s: Failed to close NV", __func__); VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); } -#endif //Close VOSS //This frees pMac(HAL) context. There should not be any call that requires pMac access after this. @@ -10883,7 +10810,6 @@ boolean hdd_is_5g_supported(hdd_context_t * pHddCtx) return true; } -#ifdef CONFIG_ENABLE_LINUX_REG #define WOW_MAX_FILTER_LISTS 1 #define WOW_MAX_FILTERS_PER_LIST 4 #define WOW_MIN_PATTERN_SIZE 6 @@ -10933,7 +10859,7 @@ static VOS_STATUS wlan_hdd_reg_init(hdd_context_t *hdd_ctx) return status; } -#endif + #ifdef MSM_PLATFORM void hdd_cnss_request_bus_bandwidth(hdd_context_t *pHddCtx, @@ -11143,11 +11069,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) init_completion(&pHddCtx->standby_comp_var); init_completion(&pHddCtx->req_bmps_comp_var); -#ifdef CONFIG_ENABLE_LINUX_REG init_completion(&pHddCtx->linux_reg_req); -#else - init_completion(&pHddCtx->driver_crda_req); -#endif spin_lock_init(&pHddCtx->schedScan_lock); @@ -11320,7 +11242,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) pHddCtx->isLogpInProgress = FALSE; vos_set_logp_in_progress(VOS_MODULE_ID_VOSS, FALSE); -#ifdef CONFIG_ENABLE_LINUX_REG status = vos_nv_open(); if (!VOS_IS_STATUS_SUCCESS(status)) { @@ -11330,8 +11251,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) goto err_wdclose; } -#endif - status = vos_open( &pVosContext, 0); if ( !VOS_IS_STATUS_SUCCESS( status )) { @@ -11361,14 +11280,12 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) goto err_vosclose; } -#ifdef CONFIG_ENABLE_LINUX_REG status = wlan_hdd_reg_init(pHddCtx); if (status != VOS_STATUS_SUCCESS) { hddLog(VOS_TRACE_LEVEL_FATAL, "%s: Failed to init channel list", __func__); goto err_vosclose; } -#endif if (0 == enable_dfs_chan_scan || 1 == enable_dfs_chan_scan) { @@ -11480,19 +11397,6 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) goto err_vosstop; } -#ifndef CONFIG_ENABLE_LINUX_REG - wlan_hdd_cfg80211_update_reg_info( wiphy ); - - wlan_hdd_cfg80211_update_wiphy_caps( wiphy ); - - /* registration of wiphy dev with cfg80211 */ - if (0 > wlan_hdd_cfg80211_register(wiphy)) - { - hddLog(VOS_TRACE_LEVEL_ERROR,"%s: wiphy register failed", __func__); - goto err_vosstop; - } -#endif - #ifdef QCA_PKT_PROTO_TRACE vos_pkt_proto_trace_init(); #endif /* QCA_PKT_PROTO_TRACE */ @@ -11596,9 +11500,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) INIT_COMPLETION(pAdapter->change_country_code); hdd_checkandupdate_dfssetting(pAdapter, country_code); -#ifndef CONFIG_ENABLE_LINUX_REG - hdd_checkandupdate_phymode(pAdapter, country_code); -#endif + ret = sme_ChangeCountryCode(pHddCtx->hHal, (void *)(tSmeChangeCountryCallback) wlan_hdd_change_country_code_callback, @@ -11791,13 +11693,7 @@ int hdd_wlan_startup(struct device *dev, v_VOID_t *hif_sc) vos_set_load_unload_in_progress(VOS_MODULE_ID_VOSS, FALSE); hdd_allow_suspend(); -#ifndef CONFIG_ENABLE_LINUX_REG - /*updating wiphy so that regulatory user hints can be processed*/ - if (wiphy) - { - regulatory_hint(wiphy, "00"); - } -#endif + // Initialize the restart logic wlan_hdd_restart_init(pHddCtx); @@ -11940,17 +11836,11 @@ err_bap_close: err_close_adapter: hdd_close_all_adapters( pHddCtx ); -#ifndef CONFIG_ENABLE_LINUX_REG - wiphy_unregister(wiphy) ; -#endif - err_vosstop: vos_stop(pVosContext); err_wiphy_unregister: -#ifdef CONFIG_ENABLE_LINUX_REG wiphy_unregister(wiphy); -#endif err_vosclose: status = vos_sched_close( pVosContext ); @@ -11963,9 +11853,7 @@ err_vosclose: err_vos_nv_close: -#ifdef CONFIG_ENABLE_LINUX_REG vos_nv_close(); -#endif err_wdclose: if(pHddCtx->cfg_ini->fIsLogpEnabled) diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c index ad3782b91acc..2bee76670762 100644 --- a/CORE/SME/src/csr/csrApiScan.c +++ b/CORE/SME/src/csr/csrApiScan.c @@ -76,33 +76,9 @@ #define CSR_SCAN_IS_OVER_BSS_LIMIT(pMac) \ ( (pMac)->scan.nBssLimit <= (csrLLCount(&(pMac)->scan.scanResultList)) ) -/* Maximum number of channels per country can be ignored */ -#define MAX_CHANNELS_IGNORE 10 - -#define MAX_COUNTRY_IGNORE 5 #define THIRTY_PERCENT(x) (x*30/100); -/*struct to hold the ignored channel list based on country */ -typedef struct sCsrIgnoreChannels -{ - tANI_U8 countryCode[NV_FIELD_COUNTRY_CODE_SIZE]; - tANI_U16 channelList[MAX_CHANNELS_IGNORE]; - tANI_U16 channelCount; -}tCsrIgnoreChannels; - -#ifndef CONFIG_ENABLE_LINUX_REG -static tCsrIgnoreChannels countryIgnoreList[MAX_COUNTRY_IGNORE] = { - { {'U','A'}, { 136, 140}, 2}, - { {'T','W'}, { 36, 40, 44, 48, 52}, 5}, - { {'I','D'}, { 165}, 1 }, - { {'A','U'}, { 120, 124, 128}, 3 }, - { {'A','R'}, { 120, 124, 128}, 3 } - }; -#else -static tCsrIgnoreChannels countryIgnoreList[MAX_COUNTRY_IGNORE] = { }; -#endif //CONFIG_ENABLE_LINUX_REG - //*** This is temporary work around. It need to call CCM api to get to CFG later /// Get string parameter value extern tSirRetStatus wlan_cfgGetStr(tpAniSirGlobal, tANI_U16, tANI_U8*, tANI_U32*); @@ -3537,30 +3513,19 @@ void csrApplyPower2Current( tpAniSirGlobal pMac ) void csrApplyChannelPowerCountryInfo( tpAniSirGlobal pMac, tCsrChannel *pChannelList, tANI_U8 *countryCode, tANI_BOOLEAN updateRiva) { - int i, j, count, countryIndex = -1; + int i; eNVChannelEnabledType channelEnabledType; tANI_U8 numChannels = 0; tANI_U8 tempNumChannels = 0; - tANI_U8 channelIgnore = FALSE; tCsrChannel ChannelList; if( pChannelList->numChannels ) { - for(count=0; count < MAX_COUNTRY_IGNORE; count++) - { - if(vos_mem_compare(countryCode, countryIgnoreList[count].countryCode, - VOS_COUNTRY_CODE_LEN)) - { - countryIndex = count; - break; - } - } tempNumChannels = CSR_MIN(pChannelList->numChannels, WNI_CFG_VALID_CHANNEL_LIST_LEN); /* If user doesn't want to scan the DFS channels lets trim them from the valid channel list*/ for(i=0; i < tempNumChannels; i++) { - channelIgnore = FALSE; if( FALSE == pMac->scan.fEnableDFSChnlScan ) { channelEnabledType = @@ -3572,25 +3537,11 @@ void csrApplyChannelPowerCountryInfo( tpAniSirGlobal pMac, tCsrChannel *pChannel } if( NV_CHANNEL_ENABLE == channelEnabledType ) { - if( countryIndex != -1 ) - { - for(j=0; j < countryIgnoreList[countryIndex].channelCount; j++) - { - if( pChannelList->channelList[i] == - countryIgnoreList[countryIndex].channelList[j] ) - { - channelIgnore = TRUE; - break; - } - } - } - if( FALSE == channelIgnore ) - { - ChannelList.channelList[numChannels] = pChannelList->channelList[i]; - numChannels++; - } + ChannelList.channelList[numChannels] = pChannelList->channelList[i]; + numChannels++; } } + ChannelList.numChannels = numChannels; csrSetCfgValidChannelList(pMac, ChannelList.channelList, ChannelList.numChannels); // extend scan capability @@ -3869,9 +3820,7 @@ void csrApplyCountryInformation( tpAniSirGlobal pMac, tANI_BOOLEAN fForce ) smsLog( pMac, LOGE, FL(" fail to set regId %d"), domainId ); } pMac->scan.domainIdCurrent = domainId; -#ifndef CONFIG_ENABLE_LINUX_REG - csrApplyChannelPowerCountryInfo( pMac, &pMac->scan.channels11d, pMac->scan.countryCode11d, eANI_BOOLEAN_TRUE ); -#endif + // switch to active scans using this new channel list pMac->scan.curScanType = eSIR_ACTIVE_SCAN; pMac->scan.f11dInfoApplied = eANI_BOOLEAN_TRUE; @@ -4224,10 +4173,10 @@ tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tSirBssDescription } } } -#ifdef CONFIG_ENABLE_LINUX_REG + csrGetRegulatoryDomainForCountry(pMac, pIesLocal->Country.country, &domainId, COUNTRY_IE); -#endif + } else //Tush { @@ -4252,68 +4201,7 @@ tANI_BOOLEAN csrLearnCountryInformation( tpAniSirGlobal pMac, tSirBssDescription // set the indicator of the channel where the country IE was found... pMac->scan.channelOf11dInfo = pSirBssDesc->channelId; -#ifndef CONFIG_ENABLE_LINUX_REG - status = csrGetRegulatoryDomainForCountry(pMac, - pIesLocal->Country.country, &domainId, COUNTRY_IE); - if ( status != eHAL_STATUS_SUCCESS ) - { - smsLog( pMac, LOGE, FL(" fail to get regId %d"), domainId ); - fRet = eANI_BOOLEAN_FALSE; - break; - } - // Checking for Domain Id change - if ( domainId != pMac->scan.domainIdCurrent ) - { - vos_mem_copy(pMac->scan.countryCode11d, - pIesLocal->Country.country, - sizeof( pMac->scan.countryCode11d ) ); - /* Set Current Country code and Current Regulatory domain */ - status = csrSetRegulatoryDomain(pMac, domainId, NULL); - if (eHAL_STATUS_SUCCESS != status) - { - smsLog(pMac, LOGE, "Set Reg Domain Fail %d", status); - fRet = eANI_BOOLEAN_FALSE; - break; - } - //csrSetRegulatoryDomain will fail if the country doesn't fit our domain criteria. - vos_mem_copy(pMac->scan.countryCodeCurrent, - pIesLocal->Country.country, WNI_CFG_COUNTRY_CODE_LEN); - //Simply set it to cfg. - csrSetCfgCountryCode(pMac, pIesLocal->Country.country); - - /* overwrite the defualt country code */ - vos_mem_copy(pMac->scan.countryCodeDefault, - pMac->scan.countryCodeCurrent, - WNI_CFG_COUNTRY_CODE_LEN); - /* Set Current RegDomain */ - status = WDA_SetRegDomain(pMac, domainId, eSIR_TRUE); - if ( status != eHAL_STATUS_SUCCESS ) - { - smsLog( pMac, LOGE, FL(" fail to Set regId %d"), domainId ); - fRet = eANI_BOOLEAN_FALSE; - break; - } - /* set to default domain ID */ - pMac->scan.domainIdCurrent = domainId; - /* get the channels based on new cc */ - status = csrInitGetChannels( pMac ); - if ( status != eHAL_STATUS_SUCCESS ) - { - smsLog( pMac, LOGE, FL(" fail to get Channels ")); - fRet = eANI_BOOLEAN_FALSE; - break; - } - - /* reset info based on new cc, and we are done */ - csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); - /* Regulatory Domain Changed, Purge Only scan result - * which does not have channel number belong to 11d - * channel list - */ - csrScanFilterResults(pMac); - } -#endif fRet = eANI_BOOLEAN_TRUE; } while( 0 ); diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 22bc6f6e34c6..d6204ea9c4c7 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -7804,28 +7804,7 @@ eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); } } -#ifndef CONFIG_ENABLE_LINUX_REG - /* set to default domain ID */ - pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; - /* get the channels based on new cc */ - status = csrInitGetChannels( pMac ); - - if ( status != eHAL_STATUS_SUCCESS ) - { - smsLog( pMac, LOGE, FL(" fail to get Channels ")); - return status; - } - - /* reset info based on new cc, and we are done */ - csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); - /* Country code Changed, Purge Only scan result - * which does not have channel number belong to 11d - * channel list - */ - csrScanFilterResults(pMac); - -#endif if( pMsg->changeCCCallback ) { ((tSmeChangeCountryCallback)(pMsg->changeCCCallback))((void *)pMsg->pDevContext); diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c index eadd860a1a3f..59c558453b2c 100644 --- a/CORE/VOSS/src/vos_api.c +++ b/CORE/VOSS/src/vos_api.c @@ -488,17 +488,6 @@ VOS_STATUS vos_open( v_CONTEXT_t *pVosContext, v_SIZE_t hddContextSize ) goto err_packet_close; } -#ifndef CONFIG_ENABLE_LINUX_REG - /* initialize the NV module */ - vStatus = vos_nv_open(); - if (!VOS_IS_STATUS_SUCCESS(vStatus)) - { - // NV module cannot be initialized - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_FATAL, - "%s: Failed to initialize the NV module", __func__); - goto err_sys_close; - } -#endif /* If we arrive here, both threads dispacthing messages correctly */ @@ -574,12 +563,6 @@ err_mac_close: err_nv_close: -#ifndef CONFIG_ENABLE_LINUX_REG - vos_nv_close(); - -err_sys_close: -#endif - sysClose(gpVosContext); err_packet_close: @@ -1019,16 +1002,6 @@ VOS_STATUS vos_close( v_CONTEXT_t vosContext ) ((pVosContextType)vosContext)->pMACContext = NULL; -#ifndef CONFIG_ENABLE_LINUX_REG - vosStatus = vos_nv_close(); - if (!VOS_IS_STATUS_SUCCESS(vosStatus)) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Failed to close NV", __func__); - VOS_ASSERT( VOS_IS_STATUS_SUCCESS( vosStatus ) ); - } -#endif - vosStatus = sysClose( vosContext ); if (!VOS_IS_STATUS_SUCCESS(vosStatus)) { diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c index fac5f4a0993a..aa1e70f1c4ee 100644 --- a/CORE/VOSS/src/vos_nvitem.c +++ b/CORE/VOSS/src/vos_nvitem.c @@ -57,8 +57,6 @@ #define IEEE80211_CHAN_NO_80MHZ 1<<7 #endif -#ifdef CONFIG_ENABLE_LINUX_REG - static v_REGDOMAIN_t cur_reg_domain = REGDOMAIN_COUNT; static char linux_reg_cc[2] = {0, 0}; static v_REGDOMAIN_t temp_reg_domain = REGDOMAIN_COUNT; @@ -67,19 +65,6 @@ static v_BOOL_t init_by_driver = VOS_FALSE; /* true if init happens thru init time callback from regulatory core. this should be set to true during driver reload */ static v_BOOL_t init_by_reg_core = VOS_FALSE; -#else - -/* Cant access pAdapter in this file so defining a new variable to wait when changing country*/ -static struct completion change_country_code; - -#endif - -#ifndef CONFIG_ENABLE_LINUX_REG -static char crda_alpha2[2] = {0, 0}; /* country code from initial crda req */ -static char run_time_alpha2[2] = {0, 0}; /* country code from none-default country req */ -static v_BOOL_t crda_regulatory_entry_valid = VOS_FALSE; -static v_BOOL_t crda_regulatory_run_time_entry_valid = VOS_FALSE; -#endif /* ndef CONFIG_ENABLE_LINUX_REG */ /*---------------------------------------------------------------------------- @@ -206,7 +191,6 @@ typedef struct // this is re-initialized from data on binary file // loaded on driver initialization if available -#ifdef CONFIG_ENABLE_LINUX_REG static CountryInfoTable_t countryInfoTable = { @@ -354,275 +338,6 @@ static CountryInfoTable_t countryInfoTable = } }; -#else - -// cache of country info table; -// this is re-initialized from data on binary file -// loaded on driver initialization if available -static CountryInfoTable_t countryInfoTable = -{ - 254, - { - { REGDOMAIN_FCC, {'U', 'S'}}, //USA - must be the first country code - { REGDOMAIN_ETSI, {'A', 'D'}}, //ANDORRA - { REGDOMAIN_ETSI, {'A', 'E'}}, //UAE - { REGDOMAIN_N_AMER_EXC_FCC, {'A', 'F'}}, //AFGHANISTAN - { REGDOMAIN_WORLD, {'A', 'G'}}, //ANTIGUA AND BARBUDA - { REGDOMAIN_FCC, {'A', 'I'}}, //ANGUILLA - { REGDOMAIN_ETSI, {'A', 'L'}}, //ALBANIA - { REGDOMAIN_N_AMER_EXC_FCC, {'A', 'M'}}, //ARMENIA - { REGDOMAIN_ETSI, {'A', 'N'}}, //NETHERLANDS ANTILLES - { REGDOMAIN_NO_5GHZ, {'A', 'O'}}, //ANGOLA - { REGDOMAIN_WORLD, {'A', 'Q'}}, //ANTARCTICA - { REGDOMAIN_WORLD, {'A', 'R'}}, //ARGENTINA - { REGDOMAIN_FCC, {'A', 'S'}}, //AMERICAN SOMOA - { REGDOMAIN_ETSI, {'A', 'T'}}, //AUSTRIA - { REGDOMAIN_WORLD, {'A', 'U'}}, //AUSTRALIA - { REGDOMAIN_ETSI, {'A', 'W'}}, //ARUBA - { REGDOMAIN_WORLD, {'A', 'X'}}, //ALAND ISLANDS - { REGDOMAIN_N_AMER_EXC_FCC, {'A', 'Z'}}, //AZERBAIJAN - { REGDOMAIN_ETSI, {'B', 'A'}}, //BOSNIA AND HERZEGOVINA - { REGDOMAIN_APAC, {'B', 'B'}}, //BARBADOS - { REGDOMAIN_HI_5GHZ, {'B', 'D'}}, //BANGLADESH - { REGDOMAIN_ETSI, {'B', 'E'}}, //BELGIUM - { REGDOMAIN_HI_5GHZ, {'B', 'F'}}, //BURKINA FASO - { REGDOMAIN_ETSI, {'B', 'G'}}, //BULGARIA - { REGDOMAIN_APAC, {'B', 'H'}}, //BAHRAIN - { REGDOMAIN_NO_5GHZ, {'B', 'I'}}, //BURUNDI - { REGDOMAIN_NO_5GHZ, {'B', 'J'}}, //BENIN - { REGDOMAIN_FCC, {'B', 'M'}}, //BERMUDA - { REGDOMAIN_APAC, {'B', 'N'}}, //BRUNEI DARUSSALAM - { REGDOMAIN_HI_5GHZ, {'B', 'O'}}, //BOLIVIA - { REGDOMAIN_WORLD, {'B', 'R'}}, //BRAZIL - { REGDOMAIN_APAC, {'B', 'S'}}, //BAHAMAS - { REGDOMAIN_NO_5GHZ, {'B', 'T'}}, //BHUTAN - { REGDOMAIN_WORLD, {'B', 'V'}}, //BOUVET ISLAND - { REGDOMAIN_ETSI, {'B', 'W'}}, //BOTSWANA - { REGDOMAIN_ETSI, {'B', 'Y'}}, //BELARUS - { REGDOMAIN_HI_5GHZ, {'B', 'Z'}}, //BELIZE - { REGDOMAIN_FCC, {'C', 'A'}}, //CANADA - { REGDOMAIN_WORLD, {'C', 'C'}}, //COCOS (KEELING) ISLANDS - { REGDOMAIN_NO_5GHZ, {'C', 'D'}}, //CONGO, THE DEMOCRATIC REPUBLIC OF THE - { REGDOMAIN_NO_5GHZ, {'C', 'F'}}, //CENTRAL AFRICAN REPUBLIC - { REGDOMAIN_NO_5GHZ, {'C', 'G'}}, //CONGO - { REGDOMAIN_ETSI, {'C', 'H'}}, //SWITZERLAND - { REGDOMAIN_NO_5GHZ, {'C', 'I'}}, //COTE D'IVOIRE - { REGDOMAIN_WORLD, {'C', 'K'}}, //COOK ISLANDS - { REGDOMAIN_APAC, {'C', 'L'}}, //CHILE - { REGDOMAIN_NO_5GHZ, {'C', 'M'}}, //CAMEROON - { REGDOMAIN_APAC, {'C', 'N'}}, //CHINA - { REGDOMAIN_APAC, {'C', 'O'}}, //COLOMBIA - { REGDOMAIN_APAC, {'C', 'R'}}, //COSTA RICA - { REGDOMAIN_NO_5GHZ, {'C', 'U'}}, //CUBA - { REGDOMAIN_ETSI, {'C', 'V'}}, //CAPE VERDE - { REGDOMAIN_WORLD, {'C', 'X'}}, //CHRISTMAS ISLAND - { REGDOMAIN_ETSI, {'C', 'Y'}}, //CYPRUS - { REGDOMAIN_ETSI, {'C', 'Z'}}, //CZECH REPUBLIC - { REGDOMAIN_ETSI, {'D', 'E'}}, //GERMANY - { REGDOMAIN_NO_5GHZ, {'D', 'J'}}, //DJIBOUTI - { REGDOMAIN_ETSI, {'D', 'K'}}, //DENMARK - { REGDOMAIN_WORLD, {'D', 'M'}}, //DOMINICA - { REGDOMAIN_APAC, {'D', 'O'}}, //DOMINICAN REPUBLIC - { REGDOMAIN_ETSI, {'D', 'Z'}}, //ALGERIA - { REGDOMAIN_APAC, {'E', 'C'}}, //ECUADOR - { REGDOMAIN_ETSI, {'E', 'E'}}, //ESTONIA - { REGDOMAIN_N_AMER_EXC_FCC, {'E', 'G'}}, //EGYPT - { REGDOMAIN_WORLD, {'E', 'H'}}, //WESTERN SAHARA - { REGDOMAIN_NO_5GHZ, {'E', 'R'}}, //ERITREA - { REGDOMAIN_ETSI, {'E', 'S'}}, //SPAIN - { REGDOMAIN_ETSI, {'E', 'T'}}, //ETHIOPIA - { REGDOMAIN_ETSI, {'E', 'U'}}, //Europe (SSGFI) - { REGDOMAIN_ETSI, {'F', 'I'}}, //FINLAND - { REGDOMAIN_NO_5GHZ, {'F', 'J'}}, //FIJI - { REGDOMAIN_WORLD, {'F', 'K'}}, //FALKLAND ISLANDS (MALVINAS) - { REGDOMAIN_WORLD, {'F', 'M'}}, //MICRONESIA, FEDERATED STATES OF - { REGDOMAIN_WORLD, {'F', 'O'}}, //FAROE ISLANDS - { REGDOMAIN_ETSI, {'F', 'R'}}, //FRANCE - { REGDOMAIN_NO_5GHZ, {'G', 'A'}}, //GABON - { REGDOMAIN_ETSI, {'G', 'B'}}, //UNITED KINGDOM - { REGDOMAIN_WORLD, {'G', 'D'}}, //GRENADA - { REGDOMAIN_ETSI, {'G', 'E'}}, //GEORGIA - { REGDOMAIN_ETSI, {'G', 'F'}}, //FRENCH GUIANA - { REGDOMAIN_WORLD, {'G', 'G'}}, //GUERNSEY - { REGDOMAIN_WORLD, {'G', 'H'}}, //GHANA - { REGDOMAIN_WORLD, {'G', 'I'}}, //GIBRALTAR - { REGDOMAIN_ETSI, {'G', 'L'}}, //GREENLAND - { REGDOMAIN_NO_5GHZ, {'G', 'M'}}, //GAMBIA - { REGDOMAIN_NO_5GHZ, {'G', 'N'}}, //GUINEA - { REGDOMAIN_ETSI, {'G', 'P'}}, //GUADELOUPE - { REGDOMAIN_NO_5GHZ, {'G', 'Q'}}, //EQUATORIAL GUINEA - { REGDOMAIN_ETSI, {'G', 'R'}}, //GREECE - { REGDOMAIN_WORLD, {'G', 'S'}}, //SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS - { REGDOMAIN_APAC, {'G', 'T'}}, //GUATEMALA - { REGDOMAIN_FCC, {'G', 'U'}}, //GUAM - { REGDOMAIN_NO_5GHZ, {'G', 'W'}}, //GUINEA-BISSAU - { REGDOMAIN_HI_5GHZ, {'G', 'Y'}}, //GUYANA - { REGDOMAIN_WORLD, {'H', 'K'}}, //HONGKONG - { REGDOMAIN_WORLD, {'H', 'M'}}, //HEARD ISLAND AND MCDONALD ISLANDS - { REGDOMAIN_WORLD, {'H', 'N'}}, //HONDURAS - { REGDOMAIN_ETSI, {'H', 'R'}}, //CROATIA - { REGDOMAIN_ETSI, {'H', 'T'}}, //HAITI - { REGDOMAIN_ETSI, {'H', 'U'}}, //HUNGARY - { REGDOMAIN_HI_5GHZ, {'I', 'D'}}, //INDONESIA - { REGDOMAIN_ETSI, {'I', 'E'}}, //IRELAND - { REGDOMAIN_N_AMER_EXC_FCC, {'I', 'L'}}, //ISRAEL - { REGDOMAIN_WORLD, {'I', 'M'}}, //ISLE OF MAN - { REGDOMAIN_APAC, {'I', 'N'}}, //INDIA - { REGDOMAIN_WORLD, {'I', 'O'}}, //BRITISH INDIAN OCEAN TERRITORY - { REGDOMAIN_NO_5GHZ, {'I', 'Q'}}, //IRAQ - { REGDOMAIN_HI_5GHZ, {'I', 'R'}}, //IRAN, ISLAMIC REPUBLIC OF - { REGDOMAIN_ETSI, {'I', 'S'}}, //ICELAND - { REGDOMAIN_ETSI, {'I', 'T'}}, //ITALY - { REGDOMAIN_JAPAN, {'J', '1'}}, //Japan alternate 1 - { REGDOMAIN_JAPAN, {'J', '2'}}, //Japan alternate 2 - { REGDOMAIN_JAPAN, {'J', '3'}}, //Japan alternate 3 - { REGDOMAIN_JAPAN, {'J', '4'}}, //Japan alternate 4 - { REGDOMAIN_JAPAN, {'J', '5'}}, //Japan alternate 5 - { REGDOMAIN_WORLD, {'J', 'E'}}, //JERSEY - { REGDOMAIN_WORLD, {'J', 'M'}}, //JAMAICA - { REGDOMAIN_APAC, {'J', 'O'}}, //JORDAN - { REGDOMAIN_JAPAN, {'J', 'P'}}, //JAPAN - { REGDOMAIN_KOREA, {'K', '1'}}, //Korea alternate 1 - { REGDOMAIN_KOREA, {'K', '2'}}, //Korea alternate 2 - { REGDOMAIN_KOREA, {'K', '3'}}, //Korea alternate 3 - { REGDOMAIN_KOREA, {'K', '4'}}, //Korea alternate 4 - { REGDOMAIN_APAC, {'K', 'E'}}, //KENYA - { REGDOMAIN_NO_5GHZ, {'K', 'G'}}, //KYRGYZSTAN - { REGDOMAIN_ETSI, {'K', 'H'}}, //CAMBODIA - { REGDOMAIN_WORLD, {'K', 'I'}}, //KIRIBATI - { REGDOMAIN_NO_5GHZ, {'K', 'M'}}, //COMOROS - { REGDOMAIN_WORLD, {'K', 'N'}}, //SAINT KITTS AND NEVIS - { REGDOMAIN_WORLD, {'K', 'P'}}, //KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF - { REGDOMAIN_KOREA, {'K', 'R'}}, //KOREA, REPUBLIC OF - { REGDOMAIN_N_AMER_EXC_FCC, {'K', 'W'}}, //KUWAIT - { REGDOMAIN_FCC, {'K', 'Y'}}, //CAYMAN ISLANDS - { REGDOMAIN_WORLD, {'K', 'Z'}}, //KAZAKHSTAN - { REGDOMAIN_WORLD, {'L', 'A'}}, //LAO PEOPLE'S DEMOCRATIC REPUBLIC - { REGDOMAIN_WORLD, {'L', 'B'}}, //LEBANON - { REGDOMAIN_WORLD, {'L', 'C'}}, //SAINT LUCIA - { REGDOMAIN_ETSI, {'L', 'I'}}, //LIECHTENSTEIN - { REGDOMAIN_WORLD, {'L', 'K'}}, //SRI LANKA - { REGDOMAIN_WORLD, {'L', 'R'}}, //LIBERIA - { REGDOMAIN_ETSI, {'L', 'S'}}, //LESOTHO - { REGDOMAIN_ETSI, {'L', 'T'}}, //LITHUANIA - { REGDOMAIN_ETSI, {'L', 'U'}}, //LUXEMBOURG - { REGDOMAIN_ETSI, {'L', 'V'}}, //LATVIA - { REGDOMAIN_NO_5GHZ, {'L', 'Y'}}, //LIBYAN ARAB JAMAHIRIYA - { REGDOMAIN_APAC, {'M', 'A'}}, //MOROCCO - { REGDOMAIN_ETSI, {'M', 'C'}}, //MONACO - { REGDOMAIN_ETSI, {'M', 'D'}}, //MOLDOVA, REPUBLIC OF - { REGDOMAIN_ETSI, {'M', 'E'}}, //MONTENEGRO - { REGDOMAIN_NO_5GHZ, {'M', 'G'}}, //MADAGASCAR - { REGDOMAIN_WORLD, {'M', 'H'}}, //MARSHALL ISLANDS - { REGDOMAIN_ETSI, {'M', 'K'}}, //MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF - { REGDOMAIN_NO_5GHZ, {'M', 'L'}}, //MALI - { REGDOMAIN_WORLD, {'M', 'M'}}, //MYANMAR - { REGDOMAIN_WORLD, {'M', 'N'}}, //MONGOLIA - { REGDOMAIN_APAC, {'M', 'O'}}, //MACAO - { REGDOMAIN_FCC, {'M', 'P'}}, //NORTHERN MARIANA ISLANDS - { REGDOMAIN_ETSI, {'M', 'Q'}}, //MARTINIQUE - { REGDOMAIN_ETSI, {'M', 'R'}}, //MAURITANIA - { REGDOMAIN_ETSI, {'M', 'S'}}, //MONTSERRAT - { REGDOMAIN_ETSI, {'M', 'T'}}, //MALTA - { REGDOMAIN_ETSI, {'M', 'U'}}, //MAURITIUS - { REGDOMAIN_APAC, {'M', 'V'}}, //MALDIVES - { REGDOMAIN_HI_5GHZ, {'M', 'W'}}, //MALAWI - { REGDOMAIN_APAC, {'M', 'X'}}, //MEXICO - { REGDOMAIN_APAC, {'M', 'Y'}}, //MALAYSIA - { REGDOMAIN_WORLD, {'M', 'Z'}}, //MOZAMBIQUE - { REGDOMAIN_WORLD, {'N', 'A'}}, //NAMIBIA - { REGDOMAIN_NO_5GHZ, {'N', 'C'}}, //NEW CALEDONIA - { REGDOMAIN_WORLD, {'N', 'E'}}, //NIGER - { REGDOMAIN_WORLD, {'N', 'F'}}, //NORFOLD ISLAND - { REGDOMAIN_WORLD, {'N', 'G'}}, //NIGERIA - { REGDOMAIN_WORLD, {'N', 'I'}}, //NICARAGUA - { REGDOMAIN_ETSI, {'N', 'L'}}, //NETHERLANDS - { REGDOMAIN_ETSI, {'N', 'O'}}, //NORWAY - { REGDOMAIN_APAC, {'N', 'P'}}, //NEPAL - { REGDOMAIN_NO_5GHZ, {'N', 'R'}}, //NAURU - { REGDOMAIN_WORLD, {'N', 'U'}}, //NIUE - { REGDOMAIN_APAC, {'N', 'Z'}}, //NEW ZEALAND - { REGDOMAIN_ETSI, {'O', 'M'}}, //OMAN - { REGDOMAIN_APAC, {'P', 'A'}}, //PANAMA - { REGDOMAIN_WORLD, {'P', 'E'}}, //PERU - { REGDOMAIN_ETSI, {'P', 'F'}}, //FRENCH POLYNESIA - { REGDOMAIN_WORLD, {'P', 'G'}}, //PAPUA NEW GUINEA - { REGDOMAIN_WORLD, {'P', 'H'}}, //PHILIPPINES - { REGDOMAIN_HI_5GHZ, {'P', 'K'}}, //PAKISTAN - { REGDOMAIN_ETSI, {'P', 'L'}}, //POLAND - { REGDOMAIN_WORLD, {'P', 'M'}}, //SAINT PIERRE AND MIQUELON - { REGDOMAIN_WORLD, {'P', 'N'}}, //WORLDPITCAIRN - { REGDOMAIN_FCC, {'P', 'R'}}, //PUERTO RICO - { REGDOMAIN_WORLD, {'P', 'S'}}, //PALESTINIAN TERRITORY, OCCUPIED - { REGDOMAIN_ETSI, {'P', 'T'}}, //PORTUGAL - { REGDOMAIN_WORLD, {'P', 'W'}}, //PALAU - { REGDOMAIN_WORLD, {'P', 'Y'}}, //PARAGUAY - { REGDOMAIN_HI_5GHZ, {'Q', 'A'}}, //QATAR - { REGDOMAIN_ETSI, {'R', 'E'}}, //REUNION - { REGDOMAIN_ETSI, {'R', 'O'}}, //ROMANIA - { REGDOMAIN_ETSI, {'R', 'S'}}, //SERBIA - { REGDOMAIN_APAC, {'R', 'U'}}, //RUSSIA - { REGDOMAIN_WORLD, {'R', 'W'}}, //RWANDA - { REGDOMAIN_WORLD, {'S', 'A'}}, //SAUDI ARABIA - { REGDOMAIN_NO_5GHZ, {'S', 'B'}}, //SOLOMON ISLANDS - { REGDOMAIN_NO_5GHZ, {'S', 'C'}}, //SEYCHELLES - { REGDOMAIN_WORLD, {'S', 'D'}}, //SUDAN - { REGDOMAIN_ETSI, {'S', 'E'}}, //SWEDEN - { REGDOMAIN_APAC, {'S', 'G'}}, //SINGAPORE - { REGDOMAIN_WORLD, {'S', 'H'}}, //SAINT HELENA - { REGDOMAIN_ETSI, {'S', 'I'}}, //SLOVENNIA - { REGDOMAIN_WORLD, {'S', 'J'}}, //SVALBARD AND JAN MAYEN - { REGDOMAIN_ETSI, {'S', 'K'}}, //SLOVAKIA - { REGDOMAIN_WORLD, {'S', 'L'}}, //SIERRA LEONE - { REGDOMAIN_ETSI, {'S', 'M'}}, //SAN MARINO - { REGDOMAIN_ETSI, {'S', 'N'}}, //SENEGAL - { REGDOMAIN_NO_5GHZ, {'S', 'O'}}, //SOMALIA - { REGDOMAIN_NO_5GHZ, {'S', 'R'}}, //SURINAME - { REGDOMAIN_WORLD, {'S', 'T'}}, //SAO TOME AND PRINCIPE - { REGDOMAIN_APAC, {'S', 'V'}}, //EL SALVADOR - { REGDOMAIN_NO_5GHZ, {'S', 'Y'}}, //SYRIAN ARAB REPUBLIC - { REGDOMAIN_NO_5GHZ, {'S', 'Z'}}, //SWAZILAND - { REGDOMAIN_ETSI, {'T', 'C'}}, //TURKS AND CAICOS ISLANDS - { REGDOMAIN_NO_5GHZ, {'T', 'D'}}, //CHAD - { REGDOMAIN_ETSI, {'T', 'F'}}, //FRENCH SOUTHERN TERRITORIES - { REGDOMAIN_NO_5GHZ, {'T', 'G'}}, //TOGO - { REGDOMAIN_WORLD, {'T', 'H'}}, //THAILAND - { REGDOMAIN_NO_5GHZ, {'T', 'J'}}, //TAJIKISTAN - { REGDOMAIN_WORLD, {'T', 'K'}}, //TOKELAU - { REGDOMAIN_WORLD, {'T', 'L'}}, //TIMOR-LESTE - { REGDOMAIN_NO_5GHZ, {'T', 'M'}}, //TURKMENISTAN - { REGDOMAIN_N_AMER_EXC_FCC, {'T', 'N'}}, //TUNISIA - { REGDOMAIN_NO_5GHZ, {'T', 'O'}}, //TONGA - { REGDOMAIN_ETSI, {'T', 'R'}}, //TURKEY - { REGDOMAIN_WORLD, {'T', 'T'}}, //TRINIDAD AND TOBAGO - { REGDOMAIN_NO_5GHZ, {'T', 'V'}}, //TUVALU - { REGDOMAIN_FCC, {'T', 'W'}}, //TAIWAN, PROVINCE OF CHINA - { REGDOMAIN_HI_5GHZ, {'T', 'Z'}}, //TANZANIA, UNITED REPUBLIC OF - { REGDOMAIN_WORLD, {'U', 'A'}}, //UKRAINE - { REGDOMAIN_KOREA, {'U', 'G'}}, //UGANDA - { REGDOMAIN_FCC, {'U', 'M'}}, //UNITED STATES MINOR OUTLYING ISLANDS - { REGDOMAIN_WORLD, {'U', 'Y'}}, //URUGUAY - { REGDOMAIN_FCC, {'U', 'Z'}}, //UZBEKISTAN - { REGDOMAIN_ETSI, {'V', 'A'}}, //HOLY SEE (VATICAN CITY STATE) - { REGDOMAIN_WORLD, {'V', 'C'}}, //SAINT VINCENT AND THE GRENADINES - { REGDOMAIN_HI_5GHZ, {'V', 'E'}}, //VENEZUELA - { REGDOMAIN_ETSI, {'V', 'G'}}, //VIRGIN ISLANDS, BRITISH - { REGDOMAIN_FCC, {'V', 'I'}}, //VIRGIN ISLANDS, US - { REGDOMAIN_FCC, {'V', 'N'}}, //VIET NAM - { REGDOMAIN_NO_5GHZ, {'V', 'U'}}, //VANUATU - { REGDOMAIN_WORLD, {'W', 'F'}}, //WALLIS AND FUTUNA - { REGDOMAIN_N_AMER_EXC_FCC, {'W', 'S'}}, //SOMOA - { REGDOMAIN_NO_5GHZ, {'Y', 'E'}}, //YEMEN - { REGDOMAIN_ETSI, {'Y', 'T'}}, //MAYOTTE - { REGDOMAIN_WORLD, {'Z', 'A'}}, //SOUTH AFRICA - { REGDOMAIN_APAC, {'Z', 'M'}}, //ZAMBIA - { REGDOMAIN_ETSI, {'Z', 'W'}}, //ZIMBABWE - } -}; - -#endif - - typedef struct nvEFSTable_s { sHalNv halnv; @@ -1298,441 +1013,7 @@ static int bw20_ch_index_to_bw40_ch_index(int k) return m; } -#ifndef CONFIG_ENABLE_LINUX_REG -void crda_regulatory_entry_default(v_U8_t *countryCode, int domain_id) -{ - int k; - pr_info("Country %c%c domain_id %d\n enable ch 1 - 11.\n", - countryCode[0], countryCode[1], domain_id); - for (k = RF_CHAN_1; k <= RF_CHAN_11; k++) { - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[k].enabled = - NV_CHANNEL_ENABLE; - /* Max Tx Power 20dBm */ - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[k].pwrLimit = 20; - } - /* enable ch 12 to ch 14 passive scan */ - pr_info(" enable ch 12 - 14 to scan passively by setting DFS flag.\n"); - for (k = RF_CHAN_12; k <= MAX_2_4GHZ_CHANNEL; k++) { - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[k].enabled = - NV_CHANNEL_DFS; - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[k].pwrLimit = 0; - } - pr_info(" enable 5GHz to scan passively by setting DFS flag.\n"); - for (k = MIN_5GHZ_CHANNEL; k <= MAX_5GHZ_CHANNEL; k++) { - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[k].enabled = - NV_CHANNEL_DFS; - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[k].pwrLimit = 0; - } -#ifdef PASSIVE_SCAN_4_9GHZ - pr_info(" enable 4.9 GHz to scan passively by setting DFS flag.\n"); - for (k = RF_CHAN_240; k <= RF_CHAN_216; k++) { - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[k].enabled = - NV_CHANNEL_DFS; - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[k].pwrLimit = 0; - } -#endif - if (domain_id == NUM_REG_DOMAINS-1) - { /* init time */ - crda_alpha2[0] = countryCode[0]; - crda_alpha2[1] = countryCode[1]; - crda_regulatory_entry_valid = VOS_TRUE; - pnvEFSTable->halnv.tables.defaultCountryTable.countryCode[0] = countryCode[0]; - pnvEFSTable->halnv.tables.defaultCountryTable.countryCode[1] = countryCode[1]; - pnvEFSTable->halnv.tables.defaultCountryTable.countryCode[2] = 'I'; - pnvEFSTable->halnv.tables.defaultCountryTable.regDomain = NUM_REG_DOMAINS-1; - } - if (domain_id == NUM_REG_DOMAINS-2) - { /* none-default country */ - run_time_alpha2[0] = countryCode[0]; - run_time_alpha2[1] = countryCode[1]; - crda_regulatory_run_time_entry_valid = VOS_TRUE; - } -} - -static int crda_regulatory_entry_post_processing(struct wiphy *wiphy, - struct regulatory_request *request, - v_U8_t nBandCapability, - int domain_id) -{ - if (request->alpha2[0] == '0' && request->alpha2[1] == '0') { - pr_info("Country 00 special handling to enable passive scan.\n"); - crda_regulatory_entry_default(request->alpha2, domain_id); - } - return 0; -} -/* create_crda_regulatory_entry should be called from user command or 11d country IE */ -static int create_crda_regulatory_entry(struct wiphy *wiphy, - struct regulatory_request *request, - v_U8_t nBandCapability) -{ - int i, j, m; - int k = 0, n = 0; - - if (run_time_alpha2[0]==request->alpha2[0] && - run_time_alpha2[1]==request->alpha2[1] && - crda_regulatory_run_time_entry_valid == VOS_TRUE) - return 0; /* already created */ - - /* 20MHz channels */ - if (nBandCapability == eCSR_BAND_24) - pr_info("BandCapability is set to 2G only.\n"); - for (i=0,m=0;i<IEEE80211_NUM_BANDS;i++) - { - if (i == IEEE80211_BAND_2GHZ && nBandCapability == eCSR_BAND_5G) // 5G only - continue; - else if (i == IEEE80211_BAND_5GHZ && nBandCapability == eCSR_BAND_24) // 2G only - continue; - if (wiphy->bands[i] == NULL) - { - pr_info("error: wiphy->bands[i] is NULL, i = %d\n", i); - return -1; - } - // internal channels[] is one continous array for both 2G and 5G bands - // m is internal starting channel index for each band - if (i == 0) - m = 0; - else - m = wiphy->bands[i-1]->n_channels + m; - - for (j=0;j<wiphy->bands[i]->n_channels;j++) - { - // k = (m + j) is internal current channel index for 20MHz channel - // n is internal channel index for corresponding 40MHz channel - k = m + j; - n = bw20_ch_index_to_bw40_ch_index(k); - if (n == -1) - return -1; - if (wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_DISABLED) - { - if (pnvEFSTable == NULL) - { - pr_info("error: pnvEFSTable is NULL, probably not parsed nv.bin yet\n"); - return -1; - } - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[k].enabled = - NV_CHANNEL_DISABLE; - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[n].enabled = - NV_CHANNEL_DISABLE; - //pr_info("CH %d disabled, no bonding centered on CH %d.\n", rfChannels[k].channelNum, - // rfChannels[n].channelNum); - } - else if (wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_RADAR) - { - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[k].enabled = - NV_CHANNEL_DFS; - // max_power is in mBm = 100 * dBm - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[k].pwrLimit = - (tANI_S8) ((wiphy->bands[i]->channels[j].max_power)/100); - if ((wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_HT40) == 0) - { - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[n].enabled = - NV_CHANNEL_DFS; - // 40MHz channel power is half of 20MHz (-3dB) ?? - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[n].pwrLimit = - (tANI_S8) (((wiphy->bands[i]->channels[j].max_power)/100)-3); - } - } - else // Enable is only last flag we support - { - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[k].enabled = - NV_CHANNEL_ENABLE; - // max_power is in dBm - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[k].pwrLimit = - (tANI_S8) ((wiphy->bands[i]->channels[j].max_power)/100); - if ((wiphy->bands[i]->channels[j].flags & IEEE80211_CHAN_NO_HT40) == 0) - { - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[n].enabled = - NV_CHANNEL_ENABLE; - // 40MHz channel power is half of 20MHz (-3dB) ?? - pnvEFSTable->halnv.tables.regDomains[NUM_REG_DOMAINS-2].channels[n].pwrLimit = - (tANI_S8) (((wiphy->bands[i]->channels[j].max_power)/100)-3); - } - } - /* ignore CRDA max_antenna_gain typical is 3dBi, nv.bin antennaGain is - real gain which should be provided by the real design */ - } - } - if (k == 0) - return -1; - run_time_alpha2[0] = request->alpha2[0]; - run_time_alpha2[1] = request->alpha2[1]; - crda_regulatory_run_time_entry_valid = VOS_TRUE; - crda_regulatory_entry_post_processing(wiphy, request, nBandCapability, NUM_REG_DOMAINS-2); - return 0; -} - -v_BOOL_t is_crda_regulatory_entry_valid(void) -{ - return crda_regulatory_entry_valid; -} - -/* Handling routines for the conversion from regd rules (start/end freq) to channel index -start freq + 10000 = center freq of the 20MHz start channel -end freq - 10000 = center freq of the 20MHz end channel -start freq + 20000 = center freq of the 40MHz start channel -end freq - 20000 = center freq of the 40MHz end channel -*/ -static int bw20_start_freq_to_channel_index(u32 freq_khz) -{ - int i; - u32 center_freq = freq_khz + 10000; - //Has to compare from low freq to high freq - //RF_SUBBAND_2_4_GHZ - for (i=RF_CHAN_1;i<=RF_CHAN_14;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_4_9_GHZ, Ch 240, 244, 248, 252, 208, 212, 216 - for (i=RF_CHAN_240;i<=RF_CHAN_216;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_LOW_GHZ - for (i=RF_CHAN_36;i<=RF_CHAN_64;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_MID_GHZ - for (i=RF_CHAN_100;i<=RF_CHAN_140;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_HIGH_GHZ - for (i=RF_CHAN_149;i<=RF_CHAN_165;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - return -1; -} - -static int bw20_end_freq_to_channel_index(u32 freq_khz) -{ - int i; - u32 center_freq = freq_khz - 10000; - //Has to compare from high freq to low freq - //RF_SUBBAND_5_HIGH_GHZ - for (i=RF_CHAN_165;i>=RF_CHAN_149;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_MID_GHZ - for (i=RF_CHAN_140;i>=RF_CHAN_100;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_LOW_GHZ - for (i=RF_CHAN_64;i>=RF_CHAN_36;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_4_9_GHZ, Ch 216, 212, 208, 252, 248, 244, 240 - for (i=RF_CHAN_216;i>=RF_CHAN_240;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_2_4_GHZ - for (i=RF_CHAN_14;i>=RF_CHAN_1;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - return -1; -} - -static int bw40_start_freq_to_channel_index(u32 freq_khz) -{ - int i; - u32 center_freq = freq_khz + 20000; - //Has to compare from low freq to high freq - //RF_SUBBAND_2_4_GHZ - for (i=RF_CHAN_BOND_3;i<=RF_CHAN_BOND_11;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_4_9_GHZ, Ch 242, 246, 250, 210, 214 - for (i=RF_CHAN_BOND_242;i<=RF_CHAN_BOND_214;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_LOW_GHZ - for (i=RF_CHAN_BOND_38;i<=RF_CHAN_BOND_62;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_MID_GHZ - for (i=RF_CHAN_BOND_102;i<=RF_CHAN_BOND_138;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_HIGH_GHZ - for (i=RF_CHAN_BOND_151;i<=RF_CHAN_BOND_163;i++) - if (center_freq <= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - return -1; -} - -static int bw40_end_freq_to_channel_index(u32 freq_khz) -{ - int i; - u32 center_freq = freq_khz - 20000; - //Has to compare from high freq to low freq - //RF_SUBBAND_5_HIGH_GHZ - for (i=RF_CHAN_BOND_163;i>=RF_CHAN_BOND_151;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_MID_GHZ - for (i=RF_CHAN_BOND_138;i>=RF_CHAN_BOND_102;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_5_LOW_GHZ - for (i=RF_CHAN_BOND_62;i>=RF_CHAN_BOND_38;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_4_9_GHZ, Ch 214, 210, 250, 246, 242 - for (i=RF_CHAN_BOND_214;i>=RF_CHAN_BOND_242;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - //RF_SUBBAND_2_4_GHZ - for (i=RF_CHAN_BOND_11;i>=RF_CHAN_BOND_3;i--) - if (center_freq >= (u32) (rfChannels[i].targetFreq) * 1000) - return i; - return -1; -} - -static v_BOOL_t channel_in_capable_band(int j, v_U8_t nBandCapability) -{ - switch (nBandCapability) - { - case eCSR_BAND_ALL: - return VOS_TRUE; - case eCSR_BAND_24: - if (j >= RF_CHAN_1 && j <= RF_CHAN_14) - return VOS_TRUE; - if (j >= RF_CHAN_BOND_3 && j <= RF_CHAN_BOND_11) - return VOS_TRUE; // 2.4G 40MHz channel - break; - case eCSR_BAND_5G: - if (j >= RF_CHAN_240 && j <= RF_CHAN_165) - return VOS_TRUE; - if (j >= RF_CHAN_BOND_242 && j <= RF_CHAN_BOND_163) - return VOS_TRUE; // 2.4G 40MHz channel - break; - default: - break; - } - return VOS_FALSE; -} - -/* create_crda_regulatory_entry_from_regd should be called during init time */ -static int create_crda_regulatory_entry_from_regd(struct wiphy *wiphy, - struct regulatory_request *request, - v_U8_t nBandCapability) -{ - int i, j, n, domain_id; - int bw20_start_channel_index, bw20_end_channel_index; - int bw40_start_channel_index, bw40_end_channel_index; - - if (wiphy == NULL || wiphy->regd == NULL) - { - wiphy_dbg(wiphy, "error: wiphy->regd is NULL\n"); - return -1; - } - if (crda_regulatory_entry_valid == VOS_FALSE) - domain_id = NUM_REG_DOMAINS-1; /* init time */ - else - domain_id = NUM_REG_DOMAINS-2; /* none-default country */ - for (n = 0; n < NUM_RF_CHANNELS; n++) - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[n].enabled = NV_CHANNEL_DISABLE; - - for (i=0;i<wiphy->regd->n_reg_rules;i++) - { - wiphy_dbg(wiphy, "info: crda rule %d --------------------------------------------\n", i); - bw20_start_channel_index = - bw20_start_freq_to_channel_index(wiphy->regd->reg_rules[i].freq_range.start_freq_khz); - bw20_end_channel_index = - bw20_end_freq_to_channel_index(wiphy->regd->reg_rules[i].freq_range.end_freq_khz); - if (bw20_start_channel_index == -1 || bw20_end_channel_index == -1) - { - wiphy_dbg(wiphy, "error: crda freq not supported, start freq (KHz) %d end freq %d\n", - wiphy->regd->reg_rules[i].freq_range.start_freq_khz, - wiphy->regd->reg_rules[i].freq_range.end_freq_khz); - continue; // skip this rull, but continue to next rule - } - wiphy_dbg(wiphy, "20MHz start freq (KHz) %d end freq %d start ch index %d end ch index %d\n", - wiphy->regd->reg_rules[i].freq_range.start_freq_khz, - wiphy->regd->reg_rules[i].freq_range.end_freq_khz, - bw20_start_channel_index, bw20_end_channel_index); - for (j=bw20_start_channel_index;j<=bw20_end_channel_index;j++) - { - if (channel_in_capable_band(j, nBandCapability) == VOS_FALSE) - { - wiphy_dbg(wiphy, "info: CH %d is not in capable band\n", - rfChannels[j].channelNum); - continue; // skip this channel, continue to next - } - if (wiphy->regd->reg_rules[i].flags & NL80211_RRF_DFS) - { - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[j].enabled = NV_CHANNEL_DFS; - wiphy_dbg(wiphy, "info: CH %d is DFS, max EIRP (mBm) is %d\n", rfChannels[j].channelNum, - wiphy->regd->reg_rules[i].power_rule.max_eirp); - } - else - { - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[j].enabled = NV_CHANNEL_ENABLE; - wiphy_dbg(wiphy, "info: CH %d is enabled, no DFS, max EIRP (mBm) is %d\n", rfChannels[j].channelNum, - wiphy->regd->reg_rules[i].power_rule.max_eirp); - } - /* max_eirp is in mBm (= 100 * dBm) unit */ - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[j].pwrLimit = - (tANI_S8) ((wiphy->regd->reg_rules[i].power_rule.max_eirp)/100); - } - /* ignore CRDA max_antenna_gain typical is 3dBi, nv.bin antennaGain is - real gain which should be provided by the real design */ - if (wiphy->regd->reg_rules[i].freq_range.max_bandwidth_khz == 40000) - { - wiphy_dbg(wiphy, "info: 40MHz (channel bonding) is allowed\n"); - bw40_start_channel_index = - bw40_start_freq_to_channel_index(wiphy->regd->reg_rules[i].freq_range.start_freq_khz); - bw40_end_channel_index = - bw40_end_freq_to_channel_index(wiphy->regd->reg_rules[i].freq_range.end_freq_khz); - if (bw40_start_channel_index == -1 || bw40_end_channel_index == -1) - { - wiphy_dbg(wiphy, "error: crda freq not supported, start_freq_khz %d end_freq_khz %d\n", - wiphy->regd->reg_rules[i].freq_range.start_freq_khz, - wiphy->regd->reg_rules[i].freq_range.end_freq_khz); - continue; // skip this rull, but continue to next rule - } - wiphy_dbg(wiphy, "40MHz start freq (KHz) %d end freq %d start ch index %d end ch index %d\n", - wiphy->regd->reg_rules[i].freq_range.start_freq_khz, - wiphy->regd->reg_rules[i].freq_range.end_freq_khz, - bw40_start_channel_index, bw40_end_channel_index); - for (j=bw40_start_channel_index;j<=bw40_end_channel_index;j++) - { - if (channel_in_capable_band(j, nBandCapability) == VOS_FALSE) - continue; // skip this channel, continue to next - if (wiphy->regd->reg_rules[i].flags & NL80211_RRF_DFS) - { - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[j].enabled = NV_CHANNEL_DFS; - wiphy_dbg(wiphy, "info: 40MHz centered on CH %d is DFS\n", rfChannels[j].channelNum); - } - else - { - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[j].enabled = NV_CHANNEL_ENABLE; - wiphy_dbg(wiphy, "info: 40MHz centered on CH %d is enabled, no DFS\n", rfChannels[j].channelNum); - } - /* set 40MHz channel power as half (- 3 dB) of 20MHz */ - pnvEFSTable->halnv.tables.regDomains[domain_id].channels[j].pwrLimit = - (tANI_S8) (((wiphy->regd->reg_rules[i].power_rule.max_eirp)/100)-3); - } - } - } - /* ToDo update other (than DFS) crda regulatory flags (NO_OUTDOOR, - NO_OFDM, PASSIVE_SCAN, NO_IBSS) to pnvEFSTable which doesn't add - these flags and has no implementation yet. */ - if (crda_regulatory_entry_valid == VOS_FALSE) - { /* init time */ - crda_alpha2[0] = request->alpha2[0]; - crda_alpha2[1] = request->alpha2[1]; - crda_regulatory_entry_valid = VOS_TRUE; - } - else - { /* none-default country */ - run_time_alpha2[0] = request->alpha2[0]; - run_time_alpha2[1] = request->alpha2[1]; - crda_regulatory_run_time_entry_valid = VOS_TRUE; - } - crda_regulatory_entry_post_processing(wiphy, request, nBandCapability, domain_id); - return 0; -} -#endif /* ndef CONFIG_ENABLE_LINUX_REG */ - -#ifdef CONFIG_ENABLE_LINUX_REG static int create_linux_regulatory_entry(struct wiphy *wiphy, v_U8_t nBandCapability); @@ -2537,466 +1818,3 @@ VOS_STATUS vos_init_wiphy_from_nv_bin(void) return VOS_STATUS_SUCCESS; } - -#else - -/**------------------------------------------------------------------------ - \brief vos_nv_setRegDomain - - \param clientCtxt - Client Context, Not used for PRIMA - regId - Regulatory Domain ID - sendRegHint - send hint to nl80211 - \return status set REG domain operation - \sa - -------------------------------------------------------------------------*/ -VOS_STATUS vos_nv_setRegDomain(void * clientCtxt, v_REGDOMAIN_t regId, - v_BOOL_t sendRegHint) -{ - v_CONTEXT_t pVosContext = NULL; - hdd_context_t *pHddCtx = NULL; - struct wiphy *wiphy = NULL; - /* Client Context Argumant not used for PRIMA */ - if (regId >= REGDOMAIN_COUNT) - { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "VOS set reg domain, invalid REG domain ID %d", regId); - return VOS_STATUS_E_INVAL; - } - - pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); - if (NULL != pVosContext) - pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); - else - return VOS_STATUS_E_EXISTS; - /* Set correct channel information based on REG Domain */ - regChannels = pnvEFSTable->halnv.tables.regDomains[regId].channels; - - /* when CRDA is not running then we are world roaming. - In this case if 11d is enabled, then country code should - be update on basis of world roaming */ - if (NULL != pHddCtx && sendRegHint) - { - wiphy = pHddCtx->wiphy; - regulatory_hint(wiphy, "00"); - } - return VOS_STATUS_SUCCESS; -} - - -/**------------------------------------------------------------------------ - \brief vos_nv_getRegDomainFromCountryCode() - get the regulatory domain of - a country given its country code - The \a vos_nv_getRegDomainFromCountryCode() returns the regulatory domain of - a country given its country code. This is done from reading a cached - copy of the binary file. - \param pRegDomain - pointer to regulatory domain - \param countryCode - country code - \param source - source of the country code - \return VOS_STATUS_SUCCESS - regulatory domain is found for the given country - VOS_STATUS_E_FAULT - invalid pointer error - VOS_STATUS_E_EMPTY - country code table is empty - VOS_STATUS_E_EXISTS - given country code does not exist in table - \sa - -------------------------------------------------------------------------*/ -VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain, - const v_COUNTRYCODE_t countryCode, v_CountryInfoSource_t source) -{ - int i; - v_CONTEXT_t pVosContext = NULL; - hdd_context_t *pHddCtx = NULL; - struct wiphy *wiphy = NULL; - unsigned long rc; - - // sanity checks - if (NULL == pRegDomain) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - ("Invalid reg domain pointer") ); - return VOS_STATUS_E_FAULT; - } - *pRegDomain = REGDOMAIN_COUNT; - - if (NULL == countryCode) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - ("Country code array is NULL") ); - return VOS_STATUS_E_FAULT; - } - if (0 == countryInfoTable.countryCount) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - ("Reg domain table is empty") ); - return VOS_STATUS_E_EMPTY; - } - /* If CRDA regulatory settings is valid, i.e. crda is enabled - and reg_notifier is called back. - Intercept here and redirect to the Reg domain table's CRDA - entry if country code is crda's country. - last one NUM_REG_DOMAINS-1 is reserved for crda */ - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO_HIGH, - "vos_nv_getRegDomainFromCountryCode %c%c", - countryCode[0], countryCode[1]); - - if (crda_regulatory_entry_valid == VOS_TRUE) - { - if (crda_alpha2[0]==countryCode[0] && crda_alpha2[1]==countryCode[1]) - { - *pRegDomain = NUM_REG_DOMAINS-1; - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO_HIGH, - "vos_nv_getRegDomainFromCountryCode return crda init entry"); - return VOS_STATUS_SUCCESS; - } - if (run_time_alpha2[0]==countryCode[0] && - run_time_alpha2[1]==countryCode[1] && - crda_regulatory_run_time_entry_valid == VOS_TRUE) - { - *pRegDomain = NUM_REG_DOMAINS-2; - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO_HIGH, - "vos_nv_getRegDomainFromCountryCode return crda none-default country entry"); - return VOS_STATUS_SUCCESS; - } - else - { - crda_regulatory_run_time_entry_valid = VOS_FALSE; - pVosContext = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); - if (NULL != pVosContext) - pHddCtx = vos_get_context(VOS_MODULE_ID_HDD, pVosContext); - else - return VOS_STATUS_E_EXISTS; - if (NULL == pHddCtx) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - ("Invalid pHddCtx pointer") ); - return VOS_STATUS_E_FAULT; - } - - wiphy = pHddCtx->wiphy; - - INIT_COMPLETION(pHddCtx->driver_crda_req); - regulatory_hint(wiphy, countryCode); - rc = wait_for_completion_timeout( - &pHddCtx->driver_crda_req, - msecs_to_jiffies(CRDA_WAIT_TIME)); - if (!rc) { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "%s: Timeout waiting for CRDA REQ", __func__); - } - - if (crda_regulatory_run_time_entry_valid == VOS_TRUE) - { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO_HIGH, - "vos_nv_getRegDomainFromCountryCode return crda new none-default country entry"); - return VOS_STATUS_SUCCESS; - } - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "vos_nv_getRegDomainFromCountryCode failed to get crda new none-default country entry"); - return VOS_STATUS_E_EXISTS; - } - } - - // iterate the country info table until end of table or the country code - // is found - for (i = 0; i < countryInfoTable.countryCount && - REGDOMAIN_COUNT == *pRegDomain; i++) - { - if (memcmp(countryCode, countryInfoTable.countryInfo[i].countryCode, - VOS_COUNTRY_CODE_LEN) == 0) - { - // country code is found - *pRegDomain = countryInfoTable.countryInfo[i].regDomain; - } - } - if (REGDOMAIN_COUNT != *pRegDomain) - { - return VOS_STATUS_SUCCESS; - } - else - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_WARN, - ("country code is not found")); - return VOS_STATUS_E_EXISTS; - } -} -/* FUNCTION: vos_nv_change_country_code_cb -* to wait for contry code completion -*/ -void* vos_nv_change_country_code_cb(void *pAdapter) -{ - struct completion *change_code_cng = pAdapter; - complete(change_code_cng); - return NULL; -} - -/* - * Function: wlan_hdd_crda_reg_notifier - * This function is called from cfg80211 core to provide regulatory settings - * after new country is requested or intersected (init, user input or 11d) - * This function is used to create a CRDA regulatory settings entry into internal - * regulatory setting table. - */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) -void wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, - struct regulatory_request *request) -#else -int wlan_hdd_crda_reg_notifier(struct wiphy *wiphy, - struct regulatory_request *request) -#endif -{ - hdd_context_t *pHddCtx = wiphy_priv(wiphy); - v_REGDOMAIN_t domainIdCurrent; - tANI_U8 ccode[WNI_CFG_COUNTRY_CODE_LEN]; - tANI_U8 uBufLen = WNI_CFG_COUNTRY_CODE_LEN; - eCsrBand nBandCapability = eCSR_BAND_ALL; - int i,j,k,m; - - wiphy_dbg(wiphy, "info: cfg80211 reg_notifier callback for country" - " %c%c\n", request->alpha2[0], request->alpha2[1]); - - /* During load and SSR, vos_open (which will lead to WDA_SetRegDomain) - * is called before we assign pHddCtx->hHal so we might get it as - * NULL here leading to crash. - */ - if (NULL == pHddCtx) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - ("%s Invalid pHddCtx pointer"), __func__); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - return; -#else - return 0; -#endif - } - if(pHddCtx->isUnloadInProgress || - pHddCtx->isLogpInProgress) - { - VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - ("%s Unload or SSR is in progress Ignore"), __func__ ); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - return; -#else - return 0; -#endif - } - - if (request->initiator == NL80211_REGDOM_SET_BY_USER) - { - int status; - unsigned long rc; - wiphy_dbg(wiphy, "info: set by user\n"); - memset(ccode, 0, WNI_CFG_COUNTRY_CODE_LEN); - memcpy(ccode, request->alpha2, 2); - init_completion(&change_country_code); - /* We will process hints by user from nl80211 in driver. - * sme_ChangeCountryCode will set the country to driver - * and update the regdomain. - * when we return back to nl80211 from this callback, the nl80211 will - * send NL80211_CMD_REG_CHANGE event to the hostapd waking it up to - * query channel list from nl80211. Thus we need to update the channels - * according to reg domain set by user before returning to nl80211 so - * that hostapd will gets the updated channels. - * The argument sendRegHint in sme_ChangeCountryCode is - * set to eSIR_FALSE (hint is from nl80211 and thus - * no need to notify nl80211 back)*/ - status = sme_ChangeCountryCode(pHddCtx->hHal, - (void *)(tSmeChangeCountryCallback) - vos_nv_change_country_code_cb, - ccode, - &change_country_code, - pHddCtx->pvosContext, - eSIR_FALSE, - eSIR_FALSE); - if (eHAL_STATUS_SUCCESS == status) - { - rc = wait_for_completion_timeout( - &change_country_code, - msecs_to_jiffies(WLAN_WAIT_TIME_COUNTRY)); - if (!rc) { - wiphy_dbg(wiphy, "info: set country timed out\n"); - } - } - else - { - wiphy_dbg(wiphy, "info: unable to set country by user\n"); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - return; -#else - return 0; -#endif - } - // ToDo - /* Don't change default country code to CRDA country code by user req */ - /* Shouldcall sme_ChangeCountryCode to send a message to trigger read - regd for new country settings */ - //sme_ChangeCountryCode(pHddCtx->hHal, NULL, - // &country_code[0], pAdapter, pHddCtx->pvosContext); - } - - sme_GetFreqBand(pHddCtx->hHal, &nBandCapability); - - if (request->initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) - { - wiphy_dbg(wiphy, "info: set by country IE\n"); - if (create_crda_regulatory_entry(wiphy, request, nBandCapability) != 0) -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - return; -#else - return 0; -#endif - // ToDo - /* Intersect of 11d and crda settings */ - - /* Don't change default country code to CRDA country code by 11d req */ - /* for every adapter call sme_ChangeCountryCode to trigger read regd - for intersected new country settings */ - // sme_ChangeCountryCode(pHddCtx->hHal, NULL, - // &country_code[0], pAdapter, pHddCtx->pvosContext); - } - else if (request->initiator == NL80211_REGDOM_SET_BY_DRIVER || - (request->initiator == NL80211_REGDOM_SET_BY_CORE)|| - (request->initiator == NL80211_REGDOM_SET_BY_USER)) - { - if ( eHAL_STATUS_SUCCESS != sme_GetCountryCode(pHddCtx->hHal, ccode, &uBufLen)) - { - wiphy_dbg(wiphy, "info: set by driver CCODE ERROR\n"); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - return; -#else - return 0; -#endif - } - if (eHAL_STATUS_SUCCESS != sme_GetRegulatoryDomainForCountry (pHddCtx->hHal, - ccode, (v_REGDOMAIN_t *) &domainIdCurrent)) - { - wiphy_dbg(wiphy, "info: set by driver ERROR\n"); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - return; -#else - return 0; -#endif - } - - wiphy_dbg(wiphy, "country: %c%c set by driver\n",ccode[0],ccode[1]); - /* if set by driver itself, it means driver can accept the crda - regulatory settings and wiphy->regd should be populated with crda - settings. iwiphy->bands doesn't seem to set ht40 flags in kernel - correctly, this may be fixed by later kernel */ - - for (i = 0, m = 0; i < IEEE80211_NUM_BANDS; i++) - { - if (NULL == wiphy->bands[i]) - { - VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, - "error: wiphy->bands[i] is NULL, i = %d", i); - continue; - } - - // internal channels[] is one continous array for both 2G and 5G bands - // m is internal starting channel index for each band - if (0 == i) - { - m = 0; - } - else - { - m = wiphy->bands[i-1]?wiphy->bands[i-1]->n_channels + m:m; - } - - for (j=0; j<wiphy->bands[i]->n_channels; j++) - { - // k = (m + j) is internal current channel index for 20MHz channel - // n is internal channel index for corresponding 40MHz channel - k = m + j; - if (IEEE80211_BAND_2GHZ == i && eCSR_BAND_5G == nBandCapability) // 5G only - { -#ifdef WLAN_ENABLE_SOCIAL_CHANNELS_5G_ONLY - // Enable social channels for P2P - if ((2412 == wiphy->bands[i]->channels[j].center_freq || - 2437 == wiphy->bands[i]->channels[j].center_freq || - 2462 == wiphy->bands[i]->channels[j].center_freq ) && - NV_CHANNEL_ENABLE == regChannels[k].enabled) - { - wiphy->bands[i]->channels[j].flags &= ~IEEE80211_CHAN_DISABLED; - } - else -#endif - { - wiphy->bands[i]->channels[j].flags |= IEEE80211_CHAN_DISABLED; - } - continue; - } - else if (IEEE80211_BAND_5GHZ == i && eCSR_BAND_24 == nBandCapability) // 2G only - { - wiphy->bands[i]->channels[j].flags |= IEEE80211_CHAN_DISABLED; - continue; - } - - if (NV_CHANNEL_DISABLE == regChannels[k].enabled || - NV_CHANNEL_INVALID == regChannels[k].enabled) - { - wiphy->bands[i]->channels[j].flags |= IEEE80211_CHAN_DISABLED; - } - else if (NV_CHANNEL_DFS == regChannels[k].enabled) - { - wiphy->bands[i]->channels[j].flags &= ~(IEEE80211_CHAN_DISABLED - |IEEE80211_CHAN_RADAR); - wiphy->bands[i]->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; - } - else - { - wiphy->bands[i]->channels[j].flags &= ~(IEEE80211_CHAN_DISABLED - |IEEE80211_CHAN_PASSIVE_SCAN - |IEEE80211_CHAN_NO_IBSS - |IEEE80211_CHAN_RADAR); - } - } - } - - /* Haven't seen any condition that will set by driver after init. - If we do, then we should also call sme_ChangeCountryCode */ - - /* To Disable the strict regulatory FCC rule, need set - gEnableStrictRegulatoryForFCC to zero from INI. - By default regulatory FCC rule enable or set to 1, and - in this case one can control dynamically using IOCTL - (nEnableStrictRegulatoryForFCC). - If gEnableStrictRegulatoryForFCC is set to zero then - IOCTL operation is inactive */ - - if ( pHddCtx->cfg_ini->gEnableStrictRegulatoryForFCC && - wiphy->bands[IEEE80211_BAND_5GHZ]) - { - for (j=0; j<wiphy->bands[IEEE80211_BAND_5GHZ]->n_channels; j++) - { - // UNII-1 band channels are passive when domain is FCC. - if ((wiphy->bands[IEEE80211_BAND_5GHZ ]->channels[j].center_freq == 5180 || - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5200 || - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5220 || - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5240) && - (ccode[0]== 'U' && ccode[1]=='S')) - { - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags |= IEEE80211_CHAN_PASSIVE_SCAN; - } - else if ((wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5180 || - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5200 || - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5220 || - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].center_freq == 5240) && - (ccode[0]!= 'U' && ccode[1]!='S')) - { - wiphy->bands[IEEE80211_BAND_5GHZ]->channels[j].flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; - } - } - } - - if (request->initiator == NL80211_REGDOM_SET_BY_CORE) - { - request->processed = 1; - } - } - -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) - return; -#else - return 0; -#endif -} - -#endif @@ -73,8 +73,6 @@ ifeq ($(KERNEL_BUILD), 0) endif endif - #Flag to enable new Linux Regulatory implementation - CONFIG_ENABLE_LINUX_REG := y #Flag to enable Protected Managment Frames (11w) feature ifeq ($(CONFIG_ROME_IF),usb) @@ -1093,12 +1091,6 @@ ifeq ($(WLAN_OPEN_SOURCE), 1) CDEFINES += -DWLAN_OPEN_SOURCE endif -ifeq ($(CONFIG_ENABLE_LINUX_REG), y) -ifeq ($(CONFIG_QCA_WIFI_2_0), 1) -CDEFINES += -DCONFIG_ENABLE_LINUX_REG -endif -endif - ifeq ($(CONFIG_FEATURE_STATS_EXT), 1) CDEFINES += -DWLAN_FEATURE_STATS_EXT endif @@ -49,10 +49,6 @@ config QCOM_VOWIFI_11R bool "Enable Fast Transition (11r) feature" default n -config CONFIG_ENABLE_LINUX_REG - bool "Enable linux regulatory feature" - default n - config CONFIG_FEATURE_NAN bool "Enable NAN feature" default n |
