From: Dan Williams <dcbw@redhat.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, Jean Tourrilhes <jt@hpl.hp.com>
Subject: [PATCH] introduce WEXT scan capabilities
Date: Fri, 07 Dec 2007 19:22:46 -0500 [thread overview]
Message-ID: <1197073366.4563.15.camel@localhost.localdomain> (raw)
Introduce scan capabilities to WEXT so that userspace can do intelligent
things with scan behavior, partly in an attempt to handle hidden SSIDs
more gracefully. If the driver reports a specific scan capability, the
driver must respect the options specified in the iw_scan_req structure
when handling the SIOCSIWSCAN call, unless it's mode or state does not
allow it to do so, in which case it must return an error.
Signed-off-by: Dan Williams <dcbw@redhat.com>
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index d8f5efc..3a57d48 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1089,6 +1089,9 @@ static int prism2_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;
+ if (local->sta_fw_ver >= PRISM2_FW_VER(1,3,1))
+ range->scan_capa = IW_SCAN_CAPA_ESSID;
+
return 0;
}
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 54f44e5..e30ad24 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8901,6 +8901,8 @@ static int ipw_wx_get_range(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;
+ range->scan_capa = IW_SCAN_CAPA_ESSID | IW_SCAN_CAPA_TYPE;
+
IPW_DEBUG_WX("GET Range\n");
return 0;
}
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index 0987aa7..07e3d01 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -541,6 +541,15 @@
/* Maximum size of returned data */
#define IW_SCAN_MAX_DATA 4096 /* In bytes */
+/* Scan capabilitiy macros - in (struct iw_range *)->scan_capa */
+#define IW_SCAN_CAPA_ESSID 0x00000001
+#define IW_SCAN_CAPA_BSSID 0x00000002
+#define IW_SCAN_CAPA_CHANNEL 0x00000004
+#define IW_SCAN_CAPA_MODE 0x00000008
+#define IW_SCAN_CAPA_RATE 0x00000010
+#define IW_SCAN_CAPA_TYPE 0x00000020
+#define IW_SCAN_CAPA_DWELL_TIME 0x00000040
+
/* Max number of char in custom event - use multiple of them if needed */
#define IW_CUSTOM_MAX 256 /* In bytes */
@@ -1040,6 +1049,16 @@ struct iw_range
* because each entry contain its channel index */
__u32 enc_capa; /* IW_ENC_CAPA_* bit field */
+
+ /* Do *NOT* use those fields, they are just used as padding to get
+ * proper alignement with user space */
+ __s32 reserved1;
+ __s32 reserved2;
+ __u16 reserved3;
+ __s32 reserved4;
+ __u32 reserved5;
+
+ __u32 scan_capa; /* IW_SCAN_CAPA_* bit field */
};
/*
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index 646e2f2..0c52ed8 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -218,6 +218,8 @@ static int ieee80211_ioctl_giwrange(struct net_device *dev,
IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP);
IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWSCAN);
+ range->scan_capa = IW_SCAN_CAPA_ESSID;
+
return 0;
}
next reply other threads:[~2007-12-08 0:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-08 0:22 Dan Williams [this message]
2007-12-08 2:12 ` [PATCH] introduce WEXT scan capabilities David Miller
2007-12-08 10:56 ` drago01
2007-12-09 17:31 ` Dan Williams
2007-12-09 18:34 ` Dave
2007-12-09 18:35 ` Dan Williams
2007-12-10 12:23 ` Johannes Berg
2007-12-10 12:34 ` Johannes Berg
2007-12-10 18:08 ` Jean Tourrilhes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1197073366.4563.15.camel@localhost.localdomain \
--to=dcbw@redhat.com \
--cc=jt@hpl.hp.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).