Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=375dd24428cfe900f4ed95d301fe604f8e0d459b
Commit:     375dd24428cfe900f4ed95d301fe604f8e0d459b
Parent:     b9099ff63c75216d6ca10bce5a1abcd9293c27e6
Author:     Zhu Yi <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 14 16:04:24 2007 +0800
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sat Apr 28 11:00:54 2007 -0400

    [PATCH] ipw2200: add channels sysfs entry
    
    Add 'channels' sysfs entry for ipw2200. The entry exports channels
    information for the user space.
    
    Signed-off-by: Zhu Yi <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/ipw2200.c |   47 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 4839a45..2069908 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -1847,6 +1847,52 @@ static ssize_t store_net_stats(struct device *d, struct 
device_attribute *attr,
 static DEVICE_ATTR(net_stats, S_IWUSR | S_IRUGO,
                   show_net_stats, store_net_stats);
 
+static ssize_t show_channels(struct device *d,
+                            struct device_attribute *attr,
+                            char *buf)
+{
+       struct ipw_priv *priv = dev_get_drvdata(d);
+       const struct ieee80211_geo *geo = ipw_get_geo(priv->ieee);
+       int len = 0, i;
+
+       len = sprintf(&buf[len],
+                     "Displaying %d channels in 2.4Ghz band "
+                     "(802.11bg):\n", geo->bg_channels);
+
+       for (i = 0; i < geo->bg_channels; i++) {
+               len += sprintf(&buf[len], "%d: BSS%s%s, %s, Band %s.\n",
+                              geo->bg[i].channel,
+                              geo->bg[i].flags & IEEE80211_CH_RADAR_DETECT ?
+                              " (radar spectrum)" : "",
+                              ((geo->bg[i].flags & IEEE80211_CH_NO_IBSS) ||
+                               (geo->bg[i].flags & IEEE80211_CH_RADAR_DETECT))
+                              ? "" : ", IBSS",
+                              geo->bg[i].flags & IEEE80211_CH_PASSIVE_ONLY ?
+                              "passive only" : "active/passive",
+                              geo->bg[i].flags & IEEE80211_CH_B_ONLY ?
+                              "B" : "B/G");
+       }
+
+       len += sprintf(&buf[len],
+                      "Displaying %d channels in 5.2Ghz band "
+                      "(802.11a):\n", geo->a_channels);
+       for (i = 0; i < geo->a_channels; i++) {
+               len += sprintf(&buf[len], "%d: BSS%s%s, %s.\n",
+                              geo->a[i].channel,
+                              geo->a[i].flags & IEEE80211_CH_RADAR_DETECT ?
+                              " (radar spectrum)" : "",
+                              ((geo->a[i].flags & IEEE80211_CH_NO_IBSS) ||
+                               (geo->a[i].flags & IEEE80211_CH_RADAR_DETECT))
+                              ? "" : ", IBSS",
+                              geo->a[i].flags & IEEE80211_CH_PASSIVE_ONLY ?
+                              "passive only" : "active/passive");
+       }
+
+       return len;
+}
+
+static DEVICE_ATTR(channels, S_IRUSR, show_channels, NULL);
+
 static void notify_wx_assoc_event(struct ipw_priv *priv)
 {
        union iwreq_data wrqu;
@@ -11383,6 +11429,7 @@ static struct attribute *ipw_sysfs_entries[] = {
        &dev_attr_led.attr,
        &dev_attr_speed_scan.attr,
        &dev_attr_net_stats.attr,
+       &dev_attr_channels.attr,
 #ifdef CONFIG_IPW2200_PROMISCUOUS
        &dev_attr_rtap_iface.attr,
        &dev_attr_rtap_filter.attr,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to