wlan: Handle set band if CONFIG_ENABLE_LINUX_REG is not defined.
vos_is_nv_country_non_zero() and
vos_update_nv_table_from_wiphy_band() function definitions are
under macro but are being called irrespective of macro, thus if
CONFIG_ENABLE_LINUX_REG is not defined set band functionality is
broken.
Removed vos_is_nv_country_non_zero() from the macro, and added a
alternative for vos_update_nv_table_from_wiphy_band() in
hdd_setBand if CONFIG_ENABLE_LINUX_REG=n.
Change-Id: I689a6b21fc76d2045654b0d07ac63d65b7cb5302
CRs-Fixed: 750196
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h
index fce9e70..b8fd5b4 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg80211.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h
@@ -926,6 +926,8 @@
#endif
struct cfg80211_scan_request *request);
+int wlan_hdd_cfg80211_update_band(struct wiphy *wiphy, eCsrBand eBand);
+
int wlan_hdd_cfg80211_init(struct device *dev,
struct wiphy *wiphy,
hdd_config_t *pCfg
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index f6f5a19..42177dc 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -4969,12 +4969,7 @@
if (IEEE80211_BAND_2GHZ == i && eCSR_BAND_5G == eBand) // 5G only
{
- // Enable Social channels for P2P
- if (WLAN_HDD_IS_SOCIAL_CHANNEL(band->channels[j].center_freq) &&
- NV_CHANNEL_ENABLE == channelEnabledState)
- band->channels[j].flags &= ~IEEE80211_CHAN_DISABLED;
- else
- band->channels[j].flags |= IEEE80211_CHAN_DISABLED;
+ band->channels[j].flags |= IEEE80211_CHAN_DISABLED;
continue;
}
else if (IEEE80211_BAND_5GHZ == i && eCSR_BAND_24 == eBand) // 2G only
diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c
index e316ea3..561ba46 100644
--- a/CORE/HDD/src/wlan_hdd_wext.c
+++ b/CORE/HDD/src/wlan_hdd_wext.c
@@ -124,6 +124,7 @@
static int tdlsOffCh = 1;
static int tdlsOffChBwOffset = 0;
#endif
+
static int ioctl_debug;
module_param(ioctl_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
@@ -7959,8 +7960,13 @@
}
else
{
+#ifdef CONFIG_ENABLE_LINUX_REG
vos_update_nv_table_from_wiphy_band((void *)pHddCtx,
(void *)pHddCtx->wiphy, (eCsrBand)band);
+#else
+ wlan_hdd_cfg80211_update_band( pHddCtx->wiphy, (eCsrBand)band );
+#endif
+
}
pScanInfo = &pHddCtx->scan_info;
if ((pScanInfo != NULL) && pHddCtx->scan_info.mScanPending)
diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c
index 973d4a9..b736330 100644
--- a/CORE/VOSS/src/vos_nvitem.c
+++ b/CORE/VOSS/src/vos_nvitem.c
@@ -3123,6 +3123,20 @@
return (0);
}
+/* function to tell about if Default country is Non-Zero */
+v_BOOL_t vos_is_nv_country_non_zero()
+{
+ v_BOOL_t status = VOS_FALSE;
+ if (!(pnvEFSTable->halnv.tables.defaultCountryTable.countryCode[0] == '0' &&
+ pnvEFSTable->halnv.tables.defaultCountryTable.countryCode[1] == '0'))
+ {
+ VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
+ "Default Country is Non-Zero\n");
+ return VOS_TRUE;
+ }
+
+ return status ;
+}
#ifdef CONFIG_ENABLE_LINUX_REG
@@ -3615,22 +3629,6 @@
}
-/* function to tell about if Default country is Non-Zero */
-v_BOOL_t vos_is_nv_country_non_zero()
-{
- v_BOOL_t status = VOS_FALSE;
- if (!(pnvEFSTable->halnv.tables.defaultCountryTable.countryCode[0] == '0' &&
- pnvEFSTable->halnv.tables.defaultCountryTable.countryCode[1] == '0'))
- {
- VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO,
- "Default Country is Non-Zero\n");
- return VOS_TRUE;
- }
-
- return status ;
-}
-
-
/*
* Function: wlan_hdd_linux_reg_notifier
* This function is called from cfg80211 core to provide regulatory settings