summaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-08 08:20:32 -0500
committerTakashi Iwai <tiwai@suse.de>2019-02-08 08:20:32 -0500
commitd02cac152c97dffcb0cdd91e09b54fd6e2cca63d (patch)
tree68e4c6bd842703009f3edbf8f0e0e9326e4b2fad /net/wireless/reg.c
parent36e4617c01153757cde9e5fcd375a75a8f8425c3 (diff)
parenta50e32694fbcdbf55875095258b9398e2eabd71f (diff)
Merge tag 'asoc-v5.1' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v5.1 Lots and lots of new drivers so far, a highlight being the MediaTek BTCVSD which is a driver for a Bluetooth radio chip - the first such driver we've had upstream. Hopefully we will soon also see a baseband with an upstream driver! - Support for only powering up channels that are actively being used. - Quite a few improvements to simplify the generic card drivers, especially the merge of the SCU cards into the main generic drivers. - Lots of fixes for probing on Intel systems, trying to rationalize things to look more standard from a framework point of view. - New drivers for Asahi Kasei Microdevices AK4497, Cirrus Logic CS4341, Google ChromeOS embedded controllers, Ingenic JZ4725B, MediaTek BTCVSD, MT8183 and MT6358, NXP MICFIL, Rockchip RK3328, Spreadtrum DMA controllers, Qualcomm WCD9335, Xilinx S/PDIF and PCM formatters.
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index ecfb1a06dbb2..dd58b9909ac9 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1024,8 +1024,13 @@ static void regdb_fw_cb(const struct firmware *fw, void *context)
1024 } 1024 }
1025 1025
1026 rtnl_lock(); 1026 rtnl_lock();
1027 if (WARN_ON(regdb && !IS_ERR(regdb))) { 1027 if (regdb && !IS_ERR(regdb)) {
1028 /* just restore and free new db */ 1028 /* negative case - a bug
1029 * positive case - can happen due to race in case of multiple cb's in
1030 * queue, due to usage of asynchronous callback
1031 *
1032 * Either case, just restore and free new db.
1033 */
1029 } else if (set_error) { 1034 } else if (set_error) {
1030 regdb = ERR_PTR(set_error); 1035 regdb = ERR_PTR(set_error);
1031 } else if (fw) { 1036 } else if (fw) {
@@ -1255,7 +1260,7 @@ static bool is_valid_rd(const struct ieee80211_regdomain *rd)
1255 * definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"), 1260 * definitions (the "2.4 GHz band", the "5 GHz band" and the "60GHz band"),
1256 * however it is safe for now to assume that a frequency rule should not be 1261 * however it is safe for now to assume that a frequency rule should not be
1257 * part of a frequency's band if the start freq or end freq are off by more 1262 * part of a frequency's band if the start freq or end freq are off by more
1258 * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 10 GHz for the 1263 * than 2 GHz for the 2.4 and 5 GHz bands, and by more than 20 GHz for the
1259 * 60 GHz band. 1264 * 60 GHz band.
1260 * This resolution can be lowered and should be considered as we add 1265 * This resolution can be lowered and should be considered as we add
1261 * regulatory rule support for other "bands". 1266 * regulatory rule support for other "bands".
@@ -1270,7 +1275,7 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range,
1270 * with the Channel starting frequency above 45 GHz. 1275 * with the Channel starting frequency above 45 GHz.
1271 */ 1276 */
1272 u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ? 1277 u32 limit = freq_khz > 45 * ONE_GHZ_IN_KHZ ?
1273 10 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ; 1278 20 * ONE_GHZ_IN_KHZ : 2 * ONE_GHZ_IN_KHZ;
1274 if (abs(freq_khz - freq_range->start_freq_khz) <= limit) 1279 if (abs(freq_khz - freq_range->start_freq_khz) <= limit)
1275 return true; 1280 return true;
1276 if (abs(freq_khz - freq_range->end_freq_khz) <= limit) 1281 if (abs(freq_khz - freq_range->end_freq_khz) <= limit)