diff options
author | Dan Williams <dcbw@redhat.com> | 2007-12-12 10:25:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:58:25 -0500 |
commit | 374fdfbc67837c1f4369eedb0f371ce3e6cce832 (patch) | |
tree | 2bfa7f0294d83c19c23d680f74b3322e0e8200dc | |
parent | c49e5ea322c2fb43f430abb3c4a49eae1394287e (diff) |
introduce WEXT scan capabilities
Introduce scan capabilities to WEXT so that userspace can do intelligent
things with scan behavior such as handling 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.
This version switches to Dave Kilroy's suggestion of claiming unused
padding space for the scan_capa field.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 2 | ||||
-rw-r--r-- | include/linux/wireless.h | 13 | ||||
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 2 |
4 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index d8f5efcfcab9..3a57d48cc360 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, | |||
1089 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | | 1089 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | |
1090 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; | 1090 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; |
1091 | 1091 | ||
1092 | if (local->sta_fw_ver >= PRISM2_FW_VER(1,3,1)) | ||
1093 | range->scan_capa = IW_SCAN_CAPA_ESSID; | ||
1094 | |||
1092 | return 0; | 1095 | return 0; |
1093 | } | 1096 | } |
1094 | 1097 | ||
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 003f73f89efa..be31304dfad5 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -8912,6 +8912,8 @@ static int ipw_wx_get_range(struct net_device *dev, | |||
8912 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | | 8912 | range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | |
8913 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; | 8913 | IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; |
8914 | 8914 | ||
8915 | range->scan_capa = IW_SCAN_CAPA_ESSID | IW_SCAN_CAPA_TYPE; | ||
8916 | |||
8915 | IPW_DEBUG_WX("GET Range\n"); | 8917 | IPW_DEBUG_WX("GET Range\n"); |
8916 | return 0; | 8918 | return 0; |
8917 | } | 8919 | } |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 0987aa7a6cf5..74e84caa1e20 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -541,6 +541,16 @@ | |||
541 | /* Maximum size of returned data */ | 541 | /* Maximum size of returned data */ |
542 | #define IW_SCAN_MAX_DATA 4096 /* In bytes */ | 542 | #define IW_SCAN_MAX_DATA 4096 /* In bytes */ |
543 | 543 | ||
544 | /* Scan capability flags - in (struct iw_range *)->scan_capa */ | ||
545 | #define IW_SCAN_CAPA_NONE 0x00 | ||
546 | #define IW_SCAN_CAPA_ESSID 0x01 | ||
547 | #define IW_SCAN_CAPA_BSSID 0x02 | ||
548 | #define IW_SCAN_CAPA_CHANNEL 0x04 | ||
549 | #define IW_SCAN_CAPA_MODE 0x08 | ||
550 | #define IW_SCAN_CAPA_RATE 0x10 | ||
551 | #define IW_SCAN_CAPA_TYPE 0x20 | ||
552 | #define IW_SCAN_CAPA_TIME 0x40 | ||
553 | |||
544 | /* Max number of char in custom event - use multiple of them if needed */ | 554 | /* Max number of char in custom event - use multiple of them if needed */ |
545 | #define IW_CUSTOM_MAX 256 /* In bytes */ | 555 | #define IW_CUSTOM_MAX 256 /* In bytes */ |
546 | 556 | ||
@@ -963,6 +973,9 @@ struct iw_range | |||
963 | __u16 old_num_channels; | 973 | __u16 old_num_channels; |
964 | __u8 old_num_frequency; | 974 | __u8 old_num_frequency; |
965 | 975 | ||
976 | /* Scan capabilities */ | ||
977 | __u8 scan_capa; /* IW_SCAN_CAPA_* bit field */ | ||
978 | |||
966 | /* Wireless event capability bitmasks */ | 979 | /* Wireless event capability bitmasks */ |
967 | __u32 event_capa[6]; | 980 | __u32 event_capa[6]; |
968 | 981 | ||
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 161f3bdec41b..04ddce76135b 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, | |||
218 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP); | 218 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP); |
219 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWSCAN); | 219 | IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWSCAN); |
220 | 220 | ||
221 | range->scan_capa |= IW_SCAN_CAPA_ESSID; | ||
222 | |||
221 | return 0; | 223 | return 0; |
222 | } | 224 | } |
223 | 225 | ||