diff options
author | Paul Zhang <paulz@codeaurora.org> | 2017-09-22 23:20:41 +0800 |
---|---|---|
committer | snandini <snandini@codeaurora.org> | 2017-09-26 21:37:39 -0700 |
commit | be203451db22ebe0aacc6a9c1855d99e6205eac7 (patch) | |
tree | 59210e79cc49ec1ae40f6264ad920a4540d04147 /core/pld/src/pld_common.c | |
parent | 59d54e4d8cbe97214deba44497d8b2a443fe788f (diff) | |
download | qcacld-be203451db22ebe0aacc6a9c1855d99e6205eac7.tar.gz |
qcacld-3.0: save the cc source to platform driver
qcacld-2.0 to qcacld-3.0 propagation
There is a design limitation of our solution. Driver
sends regulatory_hint_user for both user-space and
11d country to kernel. So when wiphy re-registration
happens, kernel tells the source as USER even for 11d.
And per driver logic the 11d needs to be disabled
if INI gCountryCodePriority is set.
To mitigate this issue, storing the country source
in the platform driver.
Change-Id: I912a071991432305e69a3e572df4e02cedefee93
CRs-Fixed: 2114969
Diffstat (limited to 'core/pld/src/pld_common.c')
-rw-r--r-- | core/pld/src/pld_common.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index 768555c58b..ff6ece3eff 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1467,3 +1467,75 @@ bool pld_is_fw_dump_skipped(struct device *dev) } return ret; } + +#ifdef CONFIG_CNSS_UTILS +/** + * pld_set_cc_source() - Set the country code source + * @dev: device + * @cc_source: country code + * + * return: void + */ +void pld_set_cc_source(struct device *dev, + enum pld_cc_src cc_source) +{ + enum cnss_utils_cc_src cc; + + switch (cc_source) { + case PLD_SOURCE_CORE: + cc = CNSS_UTILS_SOURCE_CORE; + break; + case PLD_SOURCE_11D: + cc = CNSS_UTILS_SOURCE_11D; + break; + case PLD_SOURCE_USER: + cc = CNSS_UTILS_SOURCE_USER; + break; + default: + cc = CNSS_UTILS_SOURCE_CORE; + break; + } + + cnss_utils_set_cc_source(dev, cc); +} +/** + * pld_get_cc_source() - Get the country code source + * @dev: device + * + * return: cc_source + */ +enum pld_cc_src pld_get_cc_source(struct device *dev) +{ + enum cnss_utils_cc_src cc; + enum pld_cc_src cc_source; + + cc = cnss_utils_get_cc_source(dev); + switch (cc) { + case CNSS_UTILS_SOURCE_CORE: + cc_source = PLD_SOURCE_CORE; + break; + case CNSS_UTILS_SOURCE_11D: + cc_source = PLD_SOURCE_11D; + break; + case CNSS_UTILS_SOURCE_USER: + cc_source = PLD_SOURCE_USER; + break; + default: + cc_source = PLD_SOURCE_CORE; + break; + } + + return cc_source; +} +#else +void pld_set_cc_source(struct device *dev, + enum pld_cc_src cc_source) +{ + return; +} + +enum pld_cc_src pld_get_cc_source(struct device *dev) +{ + return PLD_SOURCE_CORE; +} +#endif |