Add option to disable the internal regulatory mask
sourced from EEPROM data. This does not affect CRDA
regulatory operation, but nevertheless this option
should not be used by default.
Signed-off-by: Paul Stewart <pstew@chromium.org>
BUG=chromium:218911
TEST=Recompile with and without flag, ensure EEPROM
regulatory still works with this change disabled using
world regulatory EEPROM card an "iw reg set" command.
Change-Id: I20de00c7c6ea57124df1da8b052e573920579614
Reviewed-on: https://gerrit.chromium.org/gerrit/49176
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Say Y, if you want to debug atheros wireless drivers.
Right now only ath9k makes use of this.
Say Y, if you want to debug atheros wireless drivers.
Right now only ath9k makes use of this.
+config ATH_DEFER_EEPROM_REGULATORY
+ bool "Atheros defer EEPROM regulatory"
+ ---help---
+ Say Y, if you want to disable the internal regulatory mask
+ sourced from EEPROM data.
+
source "drivers/net/wireless/ath/ath5k/Kconfig"
source "drivers/net/wireless/ath/ath9k/Kconfig"
source "drivers/net/wireless/ath/ath9k_btcoex/Kconfig"
source "drivers/net/wireless/ath/ath5k/Kconfig"
source "drivers/net/wireless/ath/ath9k/Kconfig"
source "drivers/net/wireless/ath/ath9k_btcoex/Kconfig"
}
EXPORT_SYMBOL(ath_is_world_regd);
}
EXPORT_SYMBOL(ath_is_world_regd);
+#ifndef CONFIG_ATH_DEFER_EEPROM_REGULATORY
static const struct ieee80211_regdomain *ath_default_world_regdomain(void)
{
/* this is the most restrictive */
static const struct ieee80211_regdomain *ath_default_world_regdomain(void)
{
/* this is the most restrictive */
return ath_default_world_regdomain();
}
}
return ath_default_world_regdomain();
}
}
+#endif /* CONFIG_ATH_DEFER_EEPROM_REGULATORY */
bool ath_is_49ghz_allowed(u16 regdomain)
{
bool ath_is_49ghz_allowed(u16 regdomain)
{
}
EXPORT_SYMBOL(ath_is_49ghz_allowed);
}
EXPORT_SYMBOL(ath_is_49ghz_allowed);
+#ifndef CONFIG_ATH_DEFER_EEPROM_REGULATORY
/* Frequency is one where radar detection is required */
static bool ath_is_radar_freq(u16 center_freq)
{
return (center_freq >= 5260 && center_freq <= 5700);
}
/* Frequency is one where radar detection is required */
static bool ath_is_radar_freq(u16 center_freq)
{
return (center_freq >= 5260 && center_freq <= 5700);
}
+#endif /* CONFIG_ATH_DEFER_EEPROM_REGULATORY */
/*
* N.B: These exception rules do not apply radar freqs.
/*
* N.B: These exception rules do not apply radar freqs.
ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator)
{
ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator)
{
+#ifndef CONFIG_ATH_DEFER_EEPROM_REGULATORY
enum ieee80211_band band;
struct ieee80211_supported_band *sband;
const struct ieee80211_reg_rule *reg_rule;
enum ieee80211_band band;
struct ieee80211_supported_band *sband;
const struct ieee80211_reg_rule *reg_rule;
+#endif /* CONFIG_ATH_DEFER_EEPROM_REGULATORY */
ath_reg_apply_active_scan_flags(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator)
{
ath_reg_apply_active_scan_flags(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator)
{
+#ifndef CONFIG_ATH_DEFER_EEPROM_REGULATORY
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
const struct ieee80211_reg_rule *reg_rule;
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
const struct ieee80211_reg_rule *reg_rule;
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
}
if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN)
ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
}
+#endif /* CONFIG_ATH_DEFER_EEPROM_REGULATORY */
}
/* Always apply Radar/DFS rules on freq range 5260 MHz - 5700 MHz */
static void ath_reg_apply_radar_flags(struct wiphy *wiphy)
{
}
/* Always apply Radar/DFS rules on freq range 5260 MHz - 5700 MHz */
static void ath_reg_apply_radar_flags(struct wiphy *wiphy)
{
+#ifndef CONFIG_ATH_DEFER_EEPROM_REGULATORY
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
unsigned int i;
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
unsigned int i;
IEEE80211_CHAN_NO_IBSS |
IEEE80211_CHAN_PASSIVE_SCAN;
}
IEEE80211_CHAN_NO_IBSS |
IEEE80211_CHAN_PASSIVE_SCAN;
}
+#endif /* CONFIG_ATH_DEFER_EEPROM_REGULATORY */
}
static void ath_reg_apply_world_flags(struct wiphy *wiphy,
}
static void ath_reg_apply_world_flags(struct wiphy *wiphy,
int (*reg_notifier)(struct wiphy *wiphy,
struct regulatory_request *request))
{
int (*reg_notifier)(struct wiphy *wiphy,
struct regulatory_request *request))
{
+#ifndef CONFIG_ATH_DEFER_EEPROM_REGULATORY
const struct ieee80211_regdomain *regd;
wiphy->reg_notifier = reg_notifier;
const struct ieee80211_regdomain *regd;
wiphy->reg_notifier = reg_notifier;
wiphy_apply_custom_regulatory(wiphy, regd);
ath_reg_apply_radar_flags(wiphy);
ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg);
wiphy_apply_custom_regulatory(wiphy, regd);
ath_reg_apply_radar_flags(wiphy);
ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg);
+#endif /* CONFIG_ATH_DEFER_EEPROM_REGULATORY */