Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149867
b: refs/heads/master
c: 42639fc
h: refs/heads/master
i:
  149865: a165c95
  149863: 40350f3
v: v3
  • Loading branch information
Bob Copeland authored and John W. Linville committed Apr 22, 2009
1 parent 88e1643 commit d91351d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d5522e039586fdf72493225a88b944f726b69671
refs/heads/master: 42639fcd443d97a9a471f4b8269620286dd7036b
21 changes: 21 additions & 0 deletions trunk/drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ static int modparam_nohwcrypt;
module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");

static int modparam_all_channels;
module_param_named(all_channels, modparam_all_channels, int, 0444);
MODULE_PARM_DESC(all_channels, "Expose all channels the device can use.");


/******************\
* Internal defines *
Expand Down Expand Up @@ -862,6 +866,20 @@ ath5k_ieee2mhz(short chan)
return 2212 + chan * 20;
}

/*
* Returns true for the channel numbers used without all_channels modparam.
*/
static bool ath5k_is_standard_channel(short chan)
{
return ((chan <= 14) ||
/* 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));
}

static unsigned int
ath5k_copy_channels(struct ath5k_hw *ah,
struct ieee80211_channel *channels,
Expand Down Expand Up @@ -899,6 +917,9 @@ ath5k_copy_channels(struct ath5k_hw *ah,
if (!ath5k_channel_ok(ah, freq, chfreq))
continue;

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

/* Write channel info and increment counter */
channels[count].center_freq = freq;
channels[count].band = (chfreq == CHANNEL_2GHZ) ?
Expand Down

0 comments on commit d91351d

Please sign in to comment.