/* Only these channels all allow active scan on all world regulatory domains */ #define ATH_2GHZ_CH01_11 REG_RULE(2412-10, 2462+10, 40, 0, 20, 0)
/* We enable active scan on these a case by case basis by regulatory domain */ #define ATH_2GHZ_CH12_13 REG_RULE(2467-10, 2472+10, 40, 0, 20,\
NL80211_RRF_NO_IR) #define ATH_2GHZ_CH14 REG_RULE(2484-10, 2484+10, 40, 0, 20,\
NL80211_RRF_NO_IR | \
NL80211_RRF_NO_OFDM)
/* We allow IBSS on these on a case by case basis by regulatory domain */ #define ATH_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 80, 0, 30,\
NL80211_RRF_NO_IR) #define ATH_5GHZ_5470_5850 REG_RULE(5470-10, 5850+10, 80, 0, 30,\
NL80211_RRF_NO_IR) #define ATH_5GHZ_5725_5850 REG_RULE(5725-10, 5850+10, 80, 0, 30,\
NL80211_RRF_NO_IR)
/* This one skips what we call "mid band" */ #define ATH_5GHZ_NO_MIDBAND ATH_5GHZ_5150_5350, \
ATH_5GHZ_5725_5850
/* Can be used for:
* 0x60, 0x61, 0x62 */ staticconststruct ieee80211_regdomain ath_world_regdom_60_61_62 = {
.n_reg_rules = 5,
.alpha2 = "99",
.reg_rules = {
ATH_2GHZ_ALL,
ATH_5GHZ_ALL,
}
};
/* Can be used by 0x63 and 0x65 */ staticconststruct ieee80211_regdomain ath_world_regdom_63_65 = {
.n_reg_rules = 4,
.alpha2 = "99",
.reg_rules = {
ATH_2GHZ_CH01_11,
ATH_2GHZ_CH12_13,
ATH_5GHZ_NO_MIDBAND,
}
};
/* Can be used by 0x64 only */ staticconststruct ieee80211_regdomain ath_world_regdom_64 = {
.n_reg_rules = 3,
.alpha2 = "99",
.reg_rules = {
ATH_2GHZ_CH01_11,
ATH_5GHZ_NO_MIDBAND,
}
};
/* Can be used by 0x66 and 0x69 */ staticconststruct ieee80211_regdomain ath_world_regdom_66_69 = {
.n_reg_rules = 3,
.alpha2 = "99",
.reg_rules = {
ATH_2GHZ_CH01_11,
ATH_5GHZ_ALL,
}
};
/* Can be used by 0x67, 0x68, 0x6A and 0x6C */ staticconststruct ieee80211_regdomain ath_world_regdom_67_68_6A_6C = {
.n_reg_rules = 4,
.alpha2 = "99",
.reg_rules = {
ATH_2GHZ_CH01_11,
ATH_2GHZ_CH12_13,
ATH_5GHZ_ALL,
}
};
staticbool dynamic_country_user_possible(struct ath_regulatory *reg)
{ if (IS_ENABLED(CONFIG_ATH_REG_DYNAMIC_USER_CERT_TESTING)) returntrue;
switch (reg->country_code) { case CTRY_UNITED_STATES: case CTRY_JAPAN1: case CTRY_JAPAN2: case CTRY_JAPAN3: case CTRY_JAPAN4: case CTRY_JAPAN5: case CTRY_JAPAN6: case CTRY_JAPAN7: case CTRY_JAPAN8: case CTRY_JAPAN9: case CTRY_JAPAN10: case CTRY_JAPAN11: case CTRY_JAPAN12: case CTRY_JAPAN13: case CTRY_JAPAN14: case CTRY_JAPAN15: case CTRY_JAPAN16: case CTRY_JAPAN17: case CTRY_JAPAN18: case CTRY_JAPAN19: case CTRY_JAPAN20: case CTRY_JAPAN21: case CTRY_JAPAN22: case CTRY_JAPAN23: case CTRY_JAPAN24: case CTRY_JAPAN25: case CTRY_JAPAN26: case CTRY_JAPAN27: case CTRY_JAPAN28: case CTRY_JAPAN29: case CTRY_JAPAN30: case CTRY_JAPAN31: case CTRY_JAPAN32: case CTRY_JAPAN33: case CTRY_JAPAN34: case CTRY_JAPAN35: case CTRY_JAPAN36: case CTRY_JAPAN37: case CTRY_JAPAN38: case CTRY_JAPAN39: case CTRY_JAPAN40: case CTRY_JAPAN41: case CTRY_JAPAN42: case CTRY_JAPAN43: case CTRY_JAPAN44: case CTRY_JAPAN45: case CTRY_JAPAN46: case CTRY_JAPAN47: case CTRY_JAPAN48: case CTRY_JAPAN49: case CTRY_JAPAN50: case CTRY_JAPAN51: case CTRY_JAPAN52: case CTRY_JAPAN53: case CTRY_JAPAN54: case CTRY_JAPAN55: case CTRY_JAPAN56: case CTRY_JAPAN57: case CTRY_JAPAN58: case CTRY_JAPAN59: returnfalse;
}
returntrue;
}
staticbool ath_reg_dyn_country_user_allow(struct ath_regulatory *reg)
{ if (!IS_ENABLED(CONFIG_ATH_REG_DYNAMIC_USER_REG_HINTS)) returnfalse; if (!dynamic_country_user_possible(reg)) returnfalse; returntrue;
}
if (rd & COUNTRY_ERD_FLAG) { /* EEPROM value is a country code */
u16 cc = rd & ~COUNTRY_ERD_FLAG;
printk(KERN_DEBUG "ath: EEPROM indicates we should expect " "a country code\n"); for (i = 0; i < ARRAY_SIZE(allCountries); i++) if (allCountries[i].countryCode == cc) returntrue;
} else { /* EEPROM value is a regpair value */ if (rd != CTRY_DEFAULT)
printk(KERN_DEBUG "ath: EEPROM indicates we " "should expect a direct regpair map\n"); for (i = 0; i < ARRAY_SIZE(regDomainPairs); i++) if (regDomainPairs[i].reg_domain == rd) returntrue;
}
printk(KERN_DEBUG "ath: invalid regulatory domain/country code 0x%x\n", rd); returnfalse;
}
/* EEPROM country code to regpair mapping */ staticstruct country_code_to_enum_rd*
ath_regd_find_country(u16 countryCode)
{ int i;
for (i = 0; i < ARRAY_SIZE(allCountries); i++) { if (allCountries[i].countryCode == countryCode) return &allCountries[i];
} return NULL;
}
/* EEPROM rd code to regpair mapping */ staticstruct country_code_to_enum_rd*
ath_regd_find_country_by_rd(int regdmn)
{ int i;
for (i = 0; i < ARRAY_SIZE(allCountries); i++) { if (allCountries[i].regDmnEnum == regdmn) return &allCountries[i];
} return NULL;
}
/* Returns the map of the EEPROM set RD to a country code */ static u16 ath_regd_get_default_country(u16 rd)
{ if (rd & COUNTRY_ERD_FLAG) { struct country_code_to_enum_rd *country = NULL;
u16 cc = rd & ~COUNTRY_ERD_FLAG;
country = ath_regd_find_country(cc); if (country != NULL) return cc;
}
return CTRY_DEFAULT;
}
staticstruct reg_dmn_pair_mapping*
ath_get_regpair(int regdmn)
{ int i;
if (regdmn == NO_ENUMRD) return NULL; for (i = 0; i < ARRAY_SIZE(regDomainPairs); i++) { if (regDomainPairs[i].reg_domain == regdmn) return ®DomainPairs[i];
} return NULL;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.