Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134846
b: refs/heads/master
c: e775aaf
h: refs/heads/master
v: v3
  • Loading branch information
Bob Copeland authored and John W. Linville committed Feb 27, 2009
1 parent 09c53e9 commit cc0378c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 63a7c8e254651d1080809de22f0db3ac70fbf914
refs/heads/master: e775aaf07a72eafdb352a984d820612dd76eab8c
13 changes: 5 additions & 8 deletions trunk/drivers/net/wireless/ath9k/regd.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,8 @@ ath9k_regd_find_country_by_rd(int regdmn)
}

/* Returns the map of the EEPROM set RD to a country code */
static u16 ath9k_regd_get_default_country(struct ath_hw *ah)
static u16 ath9k_regd_get_default_country(u16 rd)
{
u16 rd;

rd = ath9k_regd_get_eepromRD(ah);
if (rd & COUNTRY_ERD_FLAG) {
struct country_code_to_enum_rd *country = NULL;
u16 cc = rd & ~COUNTRY_ERD_FLAG;
Expand Down Expand Up @@ -405,22 +402,22 @@ ath9k_get_regpair(int regdmn)
int ath9k_regd_init(struct ath_hw *ah)
{
struct country_code_to_enum_rd *country = NULL;
int regdmn;
u16 regdmn;

if (!ath9k_regd_is_eeprom_valid(ah)) {
DPRINTF(ah->ah_sc, ATH_DBG_REGULATORY,
"Invalid EEPROM contents\n");
return -EINVAL;
}

ah->regulatory.country_code = ath9k_regd_get_default_country(ah);
regdmn = ath9k_regd_get_eepromRD(ah);
ah->regulatory.country_code = ath9k_regd_get_default_country(regdmn);

if (ah->regulatory.country_code == CTRY_DEFAULT &&
ath9k_regd_get_eepromRD(ah) == CTRY_DEFAULT)
regdmn == CTRY_DEFAULT)
ah->regulatory.country_code = CTRY_UNITED_STATES;

if (ah->regulatory.country_code == CTRY_DEFAULT) {
regdmn = ath9k_regd_get_eepromRD(ah);
country = NULL;
} else {
country = ath9k_regd_find_country(ah->regulatory.country_code);
Expand Down

0 comments on commit cc0378c

Please sign in to comment.