Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149879
b: refs/heads/master
c: fc2ada3
h: refs/heads/master
i:
  149877: 876f88d
  149875: 69b4443
  149871: 3032f6e
v: v3
  • Loading branch information
Bob Copeland authored and John W. Linville committed Apr 22, 2009
1 parent 29f5aa6 commit b0592df
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 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: 55a3757a5703ebc58612ffbfbcb7f193dae17df7
refs/heads/master: fc2ada30cacc28c96eabc598d3ef294338d8dcf5
36 changes: 23 additions & 13 deletions trunk/drivers/net/wireless/ath9k/regd.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <linux/kernel.h>
#include <linux/slab.h>
#include <net/wireless.h>
#include "ath9k.h"
#include "regd_common.h"

Expand Down Expand Up @@ -492,28 +493,37 @@ int ath9k_regd_init(struct ath_hw *ah)
return 0;
}

u32 ath9k_regd_get_ctl(struct ath_hw *ah, struct ath9k_channel *chan)
static
u32 ath9k_regd_get_band_ctl(struct ath_hw *ah, enum ieee80211_band band)
{
u32 ctl = NO_CTL;

if (!ah->regulatory.regpair ||
(ah->regulatory.country_code == CTRY_DEFAULT &&
is_wwr_sku(ath9k_regd_get_eepromRD(ah)))) {
if (IS_CHAN_B(chan))
ctl = SD_NO_CTL | CTL_11B;
else if (IS_CHAN_G(chan))
ctl = SD_NO_CTL | CTL_11G;
else
ctl = SD_NO_CTL | CTL_11A;
return ctl;
return SD_NO_CTL;
}

switch (band) {
case IEEE80211_BAND_2GHZ:
return ah->regulatory.regpair->reg_2ghz_ctl;
case IEEE80211_BAND_5GHZ:
return ah->regulatory.regpair->reg_5ghz_ctl;
default:
return NO_CTL;
}

return NO_CTL;
}

u32 ath9k_regd_get_ctl(struct ath_hw *ah, struct ath9k_channel *chan)
{
u32 ctl = ath9k_regd_get_band_ctl(ah, chan->chan->band);

if (IS_CHAN_B(chan))
ctl = ah->regulatory.regpair->reg_2ghz_ctl | CTL_11B;
ctl |= CTL_11B;
else if (IS_CHAN_G(chan))
ctl = ah->regulatory.regpair->reg_2ghz_ctl | CTL_11G;
ctl |= CTL_11G;
else
ctl = ah->regulatory.regpair->reg_5ghz_ctl | CTL_11A;
ctl |= CTL_11A;

return ctl;
}

0 comments on commit b0592df

Please sign in to comment.