summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSourav Mohapatra <mohapatr@codeaurora.org>2018-03-14 17:50:34 +0530
committernshrivas <nshrivas@codeaurora.org>2018-03-23 01:29:56 -0700
commitd8416e90107d0b09009d4bfc1444f6b2e46df8a0 (patch)
tree75e78e53a9e5b7aac7f0967e3bdcff97b863cfe5
parentbe2be6b4a1b219f00bb76a8d6f9464c8489bf52b (diff)
qcacld-3.0: Allow country change to occur during driver load
In the current scenario, when the country_code parameter is passed while driver load, the country change is unsuccesful. This is due to the check in cds_get_reg_domain_from_country_code that returns while driver load is in progress. Remove the check for driver load as this command needs to be executed while the driver is in loading state only. Keep checks for only recovering and driver unloading. Change-Id: I300e44be44df9b8496e83e9d135e5096e492c3e5 CRs-Fixed: 2205621
-rw-r--r--core/cds/src/cds_reg_service.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c
index ee755963a9f3..4ebfe3cedafa 100644
--- a/core/cds/src/cds_reg_service.c
+++ b/core/cds/src/cds_reg_service.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -637,8 +637,16 @@ QDF_STATUS cds_get_reg_domain_from_country_code(v_REGDOMAIN_t *reg_domain_ptr,
hdd_context_t *hdd_ctx;
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
- if (wlan_hdd_validate_context(hdd_ctx))
- return false;
+
+ if (cds_is_driver_unloading()) {
+ hdd_err("Driver is unloading can not open the hdd");
+ return -EBUSY;
+ }
+
+ if (cds_is_driver_recovering()) {
+ hdd_err("WLAN is currently recovering; Please try again.");
+ return -EBUSY;
+ }
if (NULL == reg_domain_ptr) {
QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,