|
@@ -366,11 +366,17 @@ static bool ath_regd_is_eeprom_valid(struct ath_regulatory *reg)
|
|
if (rd & COUNTRY_ERD_FLAG) {
|
|
if (rd & COUNTRY_ERD_FLAG) {
|
|
/* EEPROM value is a country code */
|
|
/* EEPROM value is a country code */
|
|
u16 cc = rd & ~COUNTRY_ERD_FLAG;
|
|
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++)
|
|
for (i = 0; i < ARRAY_SIZE(allCountries); i++)
|
|
if (allCountries[i].countryCode == cc)
|
|
if (allCountries[i].countryCode == cc)
|
|
return true;
|
|
return true;
|
|
} else {
|
|
} else {
|
|
/* EEPROM value is a regpair value */
|
|
/* 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++)
|
|
for (i = 0; i < ARRAY_SIZE(regDomainPairs); i++)
|
|
if (regDomainPairs[i].regDmnEnum == rd)
|
|
if (regDomainPairs[i].regDmnEnum == rd)
|
|
return true;
|
|
return true;
|
|
@@ -477,6 +483,11 @@ ath_regd_init(struct ath_regulatory *reg,
|
|
struct country_code_to_enum_rd *country = NULL;
|
|
struct country_code_to_enum_rd *country = NULL;
|
|
u16 regdmn;
|
|
u16 regdmn;
|
|
|
|
|
|
|
|
+ if (!reg)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ printk(KERN_DEBUG "ath: EEPROM regdomain: 0x%0x\n", reg->current_rd);
|
|
|
|
+
|
|
if (!ath_regd_is_eeprom_valid(reg)) {
|
|
if (!ath_regd_is_eeprom_valid(reg)) {
|
|
printk(KERN_ERR "ath: Invalid EEPROM contents\n");
|
|
printk(KERN_ERR "ath: Invalid EEPROM contents\n");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -486,20 +497,30 @@ ath_regd_init(struct ath_regulatory *reg,
|
|
reg->country_code = ath_regd_get_default_country(regdmn);
|
|
reg->country_code = ath_regd_get_default_country(regdmn);
|
|
|
|
|
|
if (reg->country_code == CTRY_DEFAULT &&
|
|
if (reg->country_code == CTRY_DEFAULT &&
|
|
- regdmn == CTRY_DEFAULT)
|
|
|
|
|
|
+ regdmn == CTRY_DEFAULT) {
|
|
|
|
+ printk(KERN_DEBUG "ath: EEPROM indicates default "
|
|
|
|
+ "country code should be used\n");
|
|
reg->country_code = CTRY_UNITED_STATES;
|
|
reg->country_code = CTRY_UNITED_STATES;
|
|
|
|
+ }
|
|
|
|
|
|
if (reg->country_code == CTRY_DEFAULT) {
|
|
if (reg->country_code == CTRY_DEFAULT) {
|
|
country = NULL;
|
|
country = NULL;
|
|
} else {
|
|
} else {
|
|
|
|
+ printk(KERN_DEBUG "ath: doing EEPROM country->regdmn "
|
|
|
|
+ "map search\n");
|
|
country = ath_regd_find_country(reg->country_code);
|
|
country = ath_regd_find_country(reg->country_code);
|
|
if (country == NULL) {
|
|
if (country == NULL) {
|
|
printk(KERN_DEBUG
|
|
printk(KERN_DEBUG
|
|
- "ath: Country is NULL!!!!, cc= %d\n",
|
|
|
|
|
|
+ "ath: no valid country maps found for "
|
|
|
|
+ "country code: 0x%0x\n",
|
|
reg->country_code);
|
|
reg->country_code);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
- } else
|
|
|
|
|
|
+ } else {
|
|
regdmn = country->regDmnEnum;
|
|
regdmn = country->regDmnEnum;
|
|
|
|
+ printk(KERN_DEBUG "ath: country maps to "
|
|
|
|
+ "regdmn code: 0x%0x\n",
|
|
|
|
+ regdmn);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
reg->regpair = ath_get_regpair(regdmn);
|
|
reg->regpair = ath_get_regpair(regdmn);
|
|
@@ -523,7 +544,7 @@ ath_regd_init(struct ath_regulatory *reg,
|
|
|
|
|
|
printk(KERN_DEBUG "ath: Country alpha2 being used: %c%c\n",
|
|
printk(KERN_DEBUG "ath: Country alpha2 being used: %c%c\n",
|
|
reg->alpha2[0], reg->alpha2[1]);
|
|
reg->alpha2[0], reg->alpha2[1]);
|
|
- printk(KERN_DEBUG "ath: Regpair detected: 0x%0x\n",
|
|
|
|
|
|
+ printk(KERN_DEBUG "ath: Regpair used: 0x%0x\n",
|
|
reg->regpair->regDmnEnum);
|
|
reg->regpair->regDmnEnum);
|
|
|
|
|
|
ath_regd_init_wiphy(reg, wiphy, reg_notifier);
|
|
ath_regd_init_wiphy(reg, wiphy, reg_notifier);
|