summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmar Singhal <asinghal@codeaurora.org>2016-11-20 21:43:40 -0800
committerqcabuildsw <qcabuildsw@localhost>2016-11-29 16:07:41 -0800
commitdcbf44291e2b4a6d803d1c94a2f0a1cfe6d487c5 (patch)
tree331cf9b5c1fb4a1319b446e79f8747aa610ddf77
parent507908c8248e1e208fc537099437fbf8b1141c9e (diff)
qcacld-3.0: Keep source of driver hint also
Maintain source of driver as well as 11d hint. Use the source of hint to correctly disable 11d if required. CRs-Fixed: 1093565 Change-Id: Id0ccc44389836b72466b501f5ce024f1be4b5926
-rw-r--r--core/cds/inc/cds_reg_service.h1
-rw-r--r--core/hdd/src/wlan_hdd_regulatory.c5
-rw-r--r--core/mac/inc/ani_global.h2
-rw-r--r--core/sme/inc/sme_api.h2
-rw-r--r--core/sme/src/common/sme_api.c45
-rw-r--r--core/sme/src/csr/csr_api_scan.c2
6 files changed, 35 insertions, 22 deletions
diff --git a/core/cds/inc/cds_reg_service.h b/core/cds/inc/cds_reg_service.h
index 4fc7a5223b4a..b3ed3ca468e3 100644
--- a/core/cds/inc/cds_reg_service.h
+++ b/core/cds/inc/cds_reg_service.h
@@ -272,6 +272,7 @@ struct channel_power {
* @SOURCE_11D: source 11D
*/
enum country_src {
+ SOURCE_UNKNOWN,
SOURCE_QUERY,
SOURCE_CORE,
SOURCE_DRIVER,
diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c
index 666bc778e6fc..64de8caf969a 100644
--- a/core/hdd/src/wlan_hdd_regulatory.c
+++ b/core/hdd/src/wlan_hdd_regulatory.c
@@ -672,9 +672,10 @@ void hdd_reg_notifier(struct wiphy *wiphy,
hdd_ctx->reg.cc_src = SOURCE_CORE;
if (is_wiphy_custom_regulatory(wiphy))
reset = true;
- } else if (NL80211_REGDOM_SET_BY_DRIVER == request->initiator)
+ } else if (NL80211_REGDOM_SET_BY_DRIVER == request->initiator) {
hdd_ctx->reg.cc_src = SOURCE_DRIVER;
- else {
+ sme_set_cc_src(hdd_ctx->hHal, SOURCE_DRIVER);
+ } else {
hdd_ctx->reg.cc_src = SOURCE_USERSPACE;
hdd_restore_custom_reg_settings(wiphy,
request->alpha2,
diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h
index 0a3af0e4bf25..aeef08462450 100644
--- a/core/mac/inc/ani_global.h
+++ b/core/mac/inc/ani_global.h
@@ -965,7 +965,7 @@ typedef struct sAniSirGlobal {
enum auth_tx_ack_status auth_ack_status;
uint8_t user_configured_nss;
bool sta_prefer_80MHz_over_160MHz;
- bool is_11d_hint;
+ enum country_src reg_hint_src;
} tAniSirGlobal;
typedef enum {
diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h
index b362cd3aa4e5..b7effcea939b 100644
--- a/core/sme/inc/sme_api.h
+++ b/core/sme/inc/sme_api.h
@@ -1360,4 +1360,6 @@ QDF_STATUS sme_power_debug_stats_req(tHalHandle hal, void (*callback_fn)
(struct power_stats_response *response,
void *context), void *power_stats_context);
#endif
+
+void sme_set_cc_src(tHalHandle hal_handle, enum country_src);
#endif /* #if !defined( __SME_API_H ) */
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index 010fd77ffe5d..0e8129d95e5e 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -7661,6 +7661,12 @@ QDF_STATUS sme_get_cfg_valid_channels(tHalHandle hHal, uint8_t *aValidChannels,
return status;
}
+void sme_set_cc_src(tHalHandle hHal, enum country_src cc_src)
+{
+ tpAniSirGlobal mac_ctx = PMAC_STRUCT(hHal);
+
+ mac_ctx->reg_hint_src = cc_src;
+}
/* ---------------------------------------------------------------------------
\fn sme_handle_change_country_code
@@ -7816,23 +7822,25 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx,
sms_log(mac_ctx, LOG1, FL(" called"));
- if (!mac_ctx->is_11d_hint) {
- if (user_ctry_priority)
- mac_ctx->roam.configParam.Is11dSupportEnabled = false;
- else {
- if (mac_ctx->roam.configParam.Is11dSupportEnabled &&
- mac_ctx->scan.countryCode11d[0] != 0) {
-
- sms_log(mac_ctx, LOGW,
- FL("restore 11d"));
-
- status = csr_get_regulatory_domain_for_country(
- mac_ctx,
- mac_ctx->scan.countryCode11d,
- &reg_domain_id,
- SOURCE_11D);
-
- return QDF_STATUS_E_FAILURE;
+ if (SOURCE_11D != mac_ctx->reg_hint_src) {
+ if (SOURCE_DRIVER != mac_ctx->reg_hint_src) {
+ if (user_ctry_priority)
+ mac_ctx->roam.configParam.Is11dSupportEnabled =
+ false;
+ else {
+ if (mac_ctx->roam.configParam.Is11dSupportEnabled &&
+ mac_ctx->scan.countryCode11d[0] != 0) {
+
+ sms_log(mac_ctx, LOGW,
+ FL("restore 11d"));
+
+ status = csr_get_regulatory_domain_for_country(
+ mac_ctx,
+ mac_ctx->scan.countryCode11d,
+ &reg_domain_id,
+ SOURCE_11D);
+ return QDF_STATUS_E_FAILURE;
+ }
}
}
} else {
@@ -7844,7 +7852,6 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx,
qdf_mem_copy(mac_ctx->scan.countryCode11d,
msg->countryCode,
WNI_CFG_COUNTRY_CODE_LEN);
- mac_ctx->is_11d_hint = false;
}
qdf_mem_copy(mac_ctx->scan.countryCodeCurrent,
@@ -7869,6 +7876,8 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx,
*/
mac_ctx->scan.curScanType = eSIR_ACTIVE_SCAN;
+ mac_ctx->reg_hint_src = SOURCE_UNKNOWN;
+
sme_disconnect_connected_sessions(mac_ctx);
sms_log(mac_ctx, LOG1, FL(" returned"));
diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c
index a7149c92668b..92fa1afda4e2 100644
--- a/core/sme/src/csr/csr_api_scan.c
+++ b/core/sme/src/csr/csr_api_scan.c
@@ -3713,7 +3713,7 @@ bool csr_learn_11dcountry_information(tpAniSirGlobal pMac,
goto free_ie;
}
- pMac->is_11d_hint = true;
+ pMac->reg_hint_src = SOURCE_11D;
status = csr_get_regulatory_domain_for_country(pMac,
pCountryCodeSelected, &domainId, SOURCE_11D);
if (status != QDF_STATUS_SUCCESS) {