summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CORE/SERVICES/WMA/regdomain.h5
-rw-r--r--CORE/VOSS/inc/vos_cnss.h25
-rw-r--r--CORE/VOSS/src/vos_nvitem.c13
3 files changed, 39 insertions, 4 deletions
diff --git a/CORE/SERVICES/WMA/regdomain.h b/CORE/SERVICES/WMA/regdomain.h
index 6eff5a08715c..1400886cc67e 100644
--- a/CORE/SERVICES/WMA/regdomain.h
+++ b/CORE/SERVICES/WMA/regdomain.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2014-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011, 2014-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -310,7 +310,8 @@ typedef enum
{
COUNTRY_CODE_SET_BY_CORE,
COUNTRY_CODE_SET_BY_DRIVER,
- COUNTRY_CODE_SET_BY_USER
+ COUNTRY_CODE_SET_BY_USER,
+ COUNTRY_CODE_SET_BY_11D
} COUNTRY_CODE_SOURCE;
struct regulatory {
diff --git a/CORE/VOSS/inc/vos_cnss.h b/CORE/VOSS/inc/vos_cnss.h
index 0ef997411687..fa2d7f8d508e 100644
--- a/CORE/VOSS/inc/vos_cnss.h
+++ b/CORE/VOSS/inc/vos_cnss.h
@@ -46,6 +46,12 @@ enum cnss_bus_width_type {
CNSS_BUS_WIDTH_HIGH
};
+enum cnss_cc_src {
+ CNSS_SOURCE_CORE,
+ CNSS_SOURCE_11D,
+ CNSS_SOURCE_USER
+};
+
static inline void vos_wlan_pci_link_down(void){ return; }
static inline int vos_pcie_shadow_control(struct pci_dev *dev, bool enable)
{
@@ -233,6 +239,15 @@ static inline int vos_unregister_oob_irq_handler(void *pm_oob)
static inline void vos_dump_stack (struct task_struct *task)
{
}
+
+static inline void vos_set_cc_source(enum cnss_cc_src cc_source)
+{
+}
+
+static inline enum cnss_cc_src vos_get_cc_source(void)
+{
+ return CNSS_SOURCE_USER;
+}
#else /* END WLAN_OPEN_SOURCE and !CONFIG_CNSS */
static inline void vos_dump_stack (struct task_struct *task)
{
@@ -327,6 +342,16 @@ static inline void vos_get_boottime_ts(struct timespec *ts)
cnss_get_boottime(ts);
}
+static inline void vos_set_cc_source(enum cnss_cc_src cc_source)
+{
+ cnss_set_cc_source(cc_source);
+}
+
+static inline enum cnss_cc_src vos_get_cc_source(void)
+{
+ return cnss_get_cc_source();
+}
+
#ifdef HIF_SDIO
static inline void vos_request_pm_qos_type(int latency_type, u32 qos_val)
{
diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c
index 59b3cabfe1ce..ac88ebd64c60 100644
--- a/CORE/VOSS/src/vos_nvitem.c
+++ b/CORE/VOSS/src/vos_nvitem.c
@@ -52,6 +52,7 @@
#include <net/cfg80211.h>
#include "regdomain.h"
#include "regdomain_common.h"
+#include "vos_cnss.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0)) && !defined(WITH_BACKPORTS)
#define IEEE80211_CHAN_NO_80MHZ 1<<7
@@ -1611,6 +1612,11 @@ VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain,
}
} else if (COUNTRY_IE == source || COUNTRY_USER == source) {
+ if (COUNTRY_USER == source)
+ vos_set_cc_source(CNSS_SOURCE_USER);
+ else
+ vos_set_cc_source(CNSS_SOURCE_11D);
+
INIT_COMPLETION(pHddCtx->reg_init);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) || defined(WITH_BACKPORTS)
regulatory_hint_user(country_code, NL80211_USER_REG_HINT_USER);
@@ -1632,7 +1638,6 @@ VOS_STATUS vos_nv_getRegDomainFromCountryCode( v_REGDOMAIN_t *pRegDomain,
country_code[0], country_code[1]);
*pRegDomain = temp_reg_domain;
}
-
else
{
VOS_TRACE( VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_WARN,
@@ -2317,6 +2322,7 @@ int __wlan_hdd_linux_reg_notifier(struct wiphy *wiphy,
}
if (NL80211_REGDOM_SET_BY_CORE == request->initiator) {
pHddCtx->reg.cc_src = COUNTRY_CODE_SET_BY_CORE;
+ vos_set_cc_source(CNSS_SOURCE_CORE);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) || defined(WITH_BACKPORTS)
if (wiphy->regulatory_flags & REGULATORY_CUSTOM_REG)
#else
@@ -2326,7 +2332,10 @@ int __wlan_hdd_linux_reg_notifier(struct wiphy *wiphy,
} else if (NL80211_REGDOM_SET_BY_DRIVER == request->initiator) {
pHddCtx->reg.cc_src = COUNTRY_CODE_SET_BY_DRIVER;
} else {
- pHddCtx->reg.cc_src = COUNTRY_CODE_SET_BY_USER;
+ if (vos_get_cc_source() == CNSS_SOURCE_11D)
+ pHddCtx->reg.cc_src = COUNTRY_CODE_SET_BY_11D;
+ else
+ pHddCtx->reg.cc_src = COUNTRY_CODE_SET_BY_USER;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)) && !defined(WITH_BACKPORTS)
if ((request->alpha2[0] == '0') &&
(request->alpha2[1] == '0') &&