diff options
author | Zhu Yi <yi.zhu@intel.com> | 2006-03-02 05:55:51 +0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-03-17 15:08:03 -0500 |
commit | e815de422c1dc2fe787c6f3edba81f3cf0176e32 (patch) | |
tree | bf2bd807d9741934872f2f87c24ddefa4095c6bb /drivers | |
parent | e8c69e27d14a5fb15df9967f8c8ec5978af33ba8 (diff) | |
download | linux-3.10-e815de422c1dc2fe787c6f3edba81f3cf0176e32.tar.gz linux-3.10-e815de422c1dc2fe787c6f3edba81f3cf0176e32.tar.bz2 linux-3.10-e815de422c1dc2fe787c6f3edba81f3cf0176e32.zip |
[PATCH] ipw2200: Filter unsupported channels out in ad-hoc mode
Currently iwlist ethX freq[uency]/channel lists all the channels the card
supported for the current region, which includes some channels can only
be used in infrastructure mode. This patch filters these channels out if
the card is currently in ad-hoc mode.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index e9804450ca6..d2fc8400d3a 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -8387,20 +8387,28 @@ static int ipw_wx_get_range(struct net_device *dev, i = 0; if (priv->ieee->mode & (IEEE_B | IEEE_G)) { - for (j = 0; j < geo->bg_channels && i < IW_MAX_FREQUENCIES; - i++, j++) { + for (j = 0; j < geo->bg_channels && i < IW_MAX_FREQUENCIES; j++) { + if ((priv->ieee->iw_mode == IW_MODE_ADHOC) && + (geo->bg[j].flags & IEEE80211_CH_PASSIVE_ONLY)) + continue; + range->freq[i].i = geo->bg[j].channel; range->freq[i].m = geo->bg[j].freq * 100000; range->freq[i].e = 1; + i++; } } if (priv->ieee->mode & IEEE_A) { - for (j = 0; j < geo->a_channels && i < IW_MAX_FREQUENCIES; - i++, j++) { + for (j = 0; j < geo->a_channels && i < IW_MAX_FREQUENCIES; j++) { + if ((priv->ieee->iw_mode == IW_MODE_ADHOC) && + (geo->a[j].flags & IEEE80211_CH_PASSIVE_ONLY)) + continue; + range->freq[i].i = geo->a[j].channel; range->freq[i].m = geo->a[j].freq * 100000; range->freq[i].e = 1; + i++; } } |