diff options
author | Zhu Yi <yi.zhu@intel.com> | 2006-08-20 23:37:01 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-08-29 17:06:31 -0400 |
commit | c580f67fd7fa9deee1f4cf6b86c694b880534a82 (patch) | |
tree | b2ff842c56d9746a56d1fb51d70d8521c9ae1598 /drivers/net/wireless | |
parent | 01d478338ff3eff3bade043495f0fc9e57568876 (diff) |
[PATCH] ipw2200: SIOCGIWFREQ ioctl returns frequency rather than channel
The SIOCGIWFREQ ioctl fills the request structure's freq field by setting
the exponent to 0 and the mantissa to the current channel number. The
iwconfig tool works around this behaviour by looking up the frequency
from the channel table if a frequency below 1kHz is returned, other tools
(e.g. kwlaninfo) don't. According to the comment in the iwconfig source
the driver is supposed to return the frequency, not the channel number.
Signed-off-by: Ingo van Lil <inguin@gmx.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 89e076fa1039..0b2c774f5ee7 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -8562,9 +8562,26 @@ static int ipw_wx_get_freq(struct net_device *dev, | |||
8562 | * configured CHANNEL then return that; otherwise return ANY */ | 8562 | * configured CHANNEL then return that; otherwise return ANY */ |
8563 | mutex_lock(&priv->mutex); | 8563 | mutex_lock(&priv->mutex); |
8564 | if (priv->config & CFG_STATIC_CHANNEL || | 8564 | if (priv->config & CFG_STATIC_CHANNEL || |
8565 | priv->status & (STATUS_ASSOCIATING | STATUS_ASSOCIATED)) | 8565 | priv->status & (STATUS_ASSOCIATING | STATUS_ASSOCIATED)) { |
8566 | wrqu->freq.m = priv->channel; | 8566 | int i; |
8567 | else | 8567 | |
8568 | i = ieee80211_channel_to_index(priv->ieee, priv->channel); | ||
8569 | BUG_ON(i == -1); | ||
8570 | wrqu->freq.e = 1; | ||
8571 | |||
8572 | switch (ieee80211_is_valid_channel(priv->ieee, priv->channel)) { | ||
8573 | case IEEE80211_52GHZ_BAND: | ||
8574 | wrqu->freq.m = priv->ieee->geo.a[i].freq * 100000; | ||
8575 | break; | ||
8576 | |||
8577 | case IEEE80211_24GHZ_BAND: | ||
8578 | wrqu->freq.m = priv->ieee->geo.bg[i].freq * 100000; | ||
8579 | break; | ||
8580 | |||
8581 | default: | ||
8582 | BUG(); | ||
8583 | } | ||
8584 | } else | ||
8568 | wrqu->freq.m = 0; | 8585 | wrqu->freq.m = 0; |
8569 | 8586 | ||
8570 | mutex_unlock(&priv->mutex); | 8587 | mutex_unlock(&priv->mutex); |