Skip to content

Instantly share code, notes, and snippets.

@ewa ewa/ath9k_5GHz.patch
Created Apr 19, 2012

Embed
What would you like to do?
More permissive regd settings for ath9k. Use with caution and know your local regulations!
diff --git a/linux-lts-backport-oneiric-3.0.0/drivers/net/wireless/ath/regd.c b/linux-lts-backport-oneiric-3.0.0/drivers/net/wireless/ath/regd.c
index 028310f..23fd937 100644
--- a/linux-lts-backport-oneiric-3.0.0/drivers/net/wireless/ath/regd.c
+++ b/linux-lts-backport-oneiric-3.0.0/drivers/net/wireless/ath/regd.c
@@ -37,12 +37,9 @@
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM)
/* We allow IBSS on these on a case by case basis by regulatory domain */
-#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 40, 0, 30,\
- NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
-#define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 40, 0, 30,\
- NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
-#define ATH9K_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 40, 0, 30,\
- NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
+#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 40, 0, 30, 0)
+#define ATH9K_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 40, 0, 30, 0)
+#define ATH9K_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 40, 0, 30, 0)
#define ATH9K_2GHZ_ALL ATH9K_2GHZ_CH01_11, \
ATH9K_2GHZ_CH12_13, \
@@ -135,6 +132,8 @@ static const struct ieee80211_regdomain *ath_default_world_regdomain(void)
static const struct
ieee80211_regdomain *ath_world_regdomain(struct ath_regulatory *reg)
{
+ printk(KERN_INFO "ath: enter ath_world_regdomain\n");
+ printk(KERN_INFO "ath:\t reg->regpair->regDmnEnum: %d\n", reg->regpair->regDmnEnum);
switch (reg->regpair->regDmnEnum) {
case 0x60:
case 0x61:
@@ -193,6 +192,7 @@ ath_reg_apply_beaconing_flags(struct wiphy *wiphy,
u32 bandwidth = 0;
int r;
+ printk(KERN_INFO "ath: enter ath_reg_apply_beaconing_flags\n");
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (!wiphy->bands[band])
@@ -252,6 +252,7 @@ ath_reg_apply_active_scan_flags(struct wiphy *wiphy,
u32 bandwidth = 0;
int r;
+ printk(KERN_INFO "ath: enter ath_reg_apply_active_scan_flags\n");
sband = wiphy->bands[IEEE80211_BAND_2GHZ];
/*
@@ -298,7 +299,7 @@ static void ath_reg_apply_radar_flags(struct wiphy *wiphy)
struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch;
unsigned int i;
-
+ printk(KERN_INFO "ath: enter ath_reg_apply_radar_flags\n");
if (!wiphy->bands[IEEE80211_BAND_5GHZ])
return;
@@ -329,6 +330,7 @@ static void ath_reg_apply_world_flags(struct wiphy *wiphy,
enum nl80211_reg_initiator initiator,
struct ath_regulatory *reg)
{
+ printk(KERN_INFO "ath: enter ath_reg_apply_world_flags\n");
switch (reg->regpair->regDmnEnum) {
case 0x60:
case 0x63:
@@ -348,6 +350,7 @@ int ath_reg_notifier_apply(struct wiphy *wiphy,
struct regulatory_request *request,
struct ath_regulatory *reg)
{
+ printk(KERN_INFO "ath: enter ath_reg_notifier_apply\n");
/* We always apply this */
ath_reg_apply_radar_flags(wiphy);
@@ -363,6 +366,7 @@ int ath_reg_notifier_apply(struct wiphy *wiphy,
case NL80211_REGDOM_SET_BY_DRIVER:
case NL80211_REGDOM_SET_BY_CORE:
case NL80211_REGDOM_SET_BY_USER:
+ printk(KERN_INFO "ath:\t doing nothing\n");
break;
case NL80211_REGDOM_SET_BY_COUNTRY_IE:
if (ath_is_world_regd(reg))
@@ -464,11 +468,13 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
int (*reg_notifier)(struct wiphy *wiphy,
struct regulatory_request *request))
{
+ printk(KERN_INFO "ath: enter ath_regd_init_wiphy\n");
const struct ieee80211_regdomain *regd;
wiphy->reg_notifier = reg_notifier;
wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;
+ printk(KERN_INFO "ath:\t ath_is_world_regd(reg): %d\n",ath_is_world_regd(reg));
if (ath_is_world_regd(reg)) {
/*
* Anything applied here (prior to wiphy registration) gets
@@ -484,6 +490,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
*/
regd = ath_default_world_regdomain();
}
+ printk(KERN_INFO "ath:\t callinng wiphy_apply_custom_regulatory!\n");
wiphy_apply_custom_regulatory(wiphy, regd);
ath_reg_apply_radar_flags(wiphy);
ath_reg_apply_world_flags(wiphy, NL80211_REGDOM_SET_BY_DRIVER, reg);
@@ -514,6 +521,7 @@ ath_regd_init(struct ath_regulatory *reg,
struct country_code_to_enum_rd *country = NULL;
u16 regdmn;
+ printk(KERN_INFO "ath: enter ath_regd_init\n");
if (!reg)
return -EINVAL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.