Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236765
b: refs/heads/master
c: 410e612
h: refs/heads/master
i:
  236763: 4efa8f9
v: v3
  • Loading branch information
Bruno Randolf authored and John W. Linville committed Jan 21, 2011
1 parent 8cf4356 commit 8d9e0bd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 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: 0810569076c1f3cf4a82da40211dd0b07b3ad07e
refs/heads/master: 410e6120a500edcf3fb8239301deabf20a4310db
19 changes: 13 additions & 6 deletions trunk/drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,21 @@ static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *re
/*
* Returns true for the channel numbers used without all_channels modparam.
*/
static bool ath5k_is_standard_channel(short chan)
static bool ath5k_is_standard_channel(short chan, enum ieee80211_band band)
{
return ((chan <= 14) ||
/* UNII 1,2 */
((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
if (band == IEEE80211_BAND_2GHZ && chan <= 14)
return true;

return /* UNII 1,2 */
(((chan & 3) == 0 && chan >= 36 && chan <= 64) ||
/* midband */
((chan & 3) == 0 && chan >= 100 && chan <= 140) ||
/* UNII-3 */
((chan & 3) == 1 && chan >= 149 && chan <= 165));
((chan & 3) == 1 && chan >= 149 && chan <= 165) ||
/* 802.11j 5.030-5.080 GHz (20MHz) */
(chan == 8 || chan == 12 || chan == 16) ||
/* 802.11j 4.9GHz (20MHz) */
(chan == 184 || chan == 188 || chan == 192 || chan == 196));
}

static unsigned int
Expand Down Expand Up @@ -296,7 +302,8 @@ ath5k_setup_channels(struct ath5k_hw *ah,
if (!ath5k_channel_ok(ah, freq, chfreq))
continue;

if (!modparam_all_channels && !ath5k_is_standard_channel(ch))
if (!modparam_all_channels &&
!ath5k_is_standard_channel(ch, band))
continue;

/* Write channel info and increment counter */
Expand Down

0 comments on commit 8d9e0bd

Please sign in to comment.