aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ipw2200.c
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2006-03-01 16:55:51 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-03-17 15:08:03 -0500
commite815de422c1dc2fe787c6f3edba81f3cf0176e32 (patch)
treebf2bd807d9741934872f2f87c24ddefa4095c6bb /drivers/net/wireless/ipw2200.c
parente8c69e27d14a5fb15df9967f8c8ec5978af33ba8 (diff)
[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/net/wireless/ipw2200.c')
-rw-r--r--drivers/net/wireless/ipw2200.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index e9804450ca6c..d2fc8400d3ab 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,
8387 8387
8388 i = 0; 8388 i = 0;
8389 if (priv->ieee->mode & (IEEE_B | IEEE_G)) { 8389 if (priv->ieee->mode & (IEEE_B | IEEE_G)) {
8390 for (j = 0; j < geo->bg_channels && i < IW_MAX_FREQUENCIES; 8390 for (j = 0; j < geo->bg_channels && i < IW_MAX_FREQUENCIES; j++) {
8391 i++, j++) { 8391 if ((priv->ieee->iw_mode == IW_MODE_ADHOC) &&
8392 (geo->bg[j].flags & IEEE80211_CH_PASSIVE_ONLY))
8393 continue;
8394
8392 range->freq[i].i = geo->bg[j].channel; 8395 range->freq[i].i = geo->bg[j].channel;
8393 range->freq[i].m = geo->bg[j].freq * 100000; 8396 range->freq[i].m = geo->bg[j].freq * 100000;
8394 range->freq[i].e = 1; 8397 range->freq[i].e = 1;
8398 i++;
8395 } 8399 }
8396 } 8400 }
8397 8401
8398 if (priv->ieee->mode & IEEE_A) { 8402 if (priv->ieee->mode & IEEE_A) {
8399 for (j = 0; j < geo->a_channels && i < IW_MAX_FREQUENCIES; 8403 for (j = 0; j < geo->a_channels && i < IW_MAX_FREQUENCIES; j++) {
8400 i++, j++) { 8404 if ((priv->ieee->iw_mode == IW_MODE_ADHOC) &&
8405 (geo->a[j].flags & IEEE80211_CH_PASSIVE_ONLY))
8406 continue;
8407
8401 range->freq[i].i = geo->a[j].channel; 8408 range->freq[i].i = geo->a[j].channel;
8402 range->freq[i].m = geo->a[j].freq * 100000; 8409 range->freq[i].m = geo->a[j].freq * 100000;
8403 range->freq[i].e = 1; 8410 range->freq[i].e = 1;
8411 i++;
8404 } 8412 }
8405 } 8413 }
8406 8414