summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHong Liu <hong.liu@intel.com>2007-07-10 19:32:08 +0200
committerJohn W. Linville <linville@tuxdriver.com>2007-07-12 16:07:25 -0400
commit333af2f0715c8d4d38cb657d8f4fb7c4e3ceba9f (patch)
tree88dbcd33da19e837f1d1904a609aec05a65a7ded /net
parentc59304b5e07128816347fe3996d7952561f60529 (diff)
downloadblackbird-op-linux-333af2f0715c8d4d38cb657d8f4fb7c4e3ceba9f.tar.gz
blackbird-op-linux-333af2f0715c8d4d38cb657d8f4fb7c4e3ceba9f.zip
[PATCH] mac80211: add support for iwlist channel
Add supported channels info in SIOCGIWRANGE implementation. Signed-off-by: Hong Liu <hong.liu@intel.com> Signed-off-by: Jiri Benc <jbenc@suse.cz> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/ieee80211_ioctl.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 66e8a976b311..ef74a91e02a5 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -345,6 +345,8 @@ static int ieee80211_ioctl_giwrange(struct net_device *dev,
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct iw_range *range = (struct iw_range *) extra;
+ struct ieee80211_hw_mode *mode = NULL;
+ int c = 0;
data->length = sizeof(struct iw_range);
memset(range, 0, sizeof(struct iw_range));
@@ -378,6 +380,29 @@ static int ieee80211_ioctl_giwrange(struct net_device *dev,
range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
+ list_for_each_entry(mode, &local->modes_list, list) {
+ int i = 0;
+
+ if (!(local->enabled_modes & (1 << mode->mode)) ||
+ (local->hw_modes & local->enabled_modes &
+ (1 << MODE_IEEE80211G) && mode->mode == MODE_IEEE80211B))
+ continue;
+
+ while (i < mode->num_channels && c < IW_MAX_FREQUENCIES) {
+ struct ieee80211_channel *chan = &mode->channels[i];
+
+ if (chan->flag & IEEE80211_CHAN_W_SCAN) {
+ range->freq[c].i = chan->chan;
+ range->freq[c].m = chan->freq * 100000;
+ range->freq[c].e = 1;
+ c++;
+ }
+ i++;
+ }
+ }
+ range->num_channels = c;
+ range->num_frequency = c;
+
IW_EVENT_CAPA_SET_KERNEL(range->event_capa);
IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWTHRSPY);
IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP);
OpenPOWER on IntegriCloud