Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2] introduce WEXT scan capabilities
@ 2007-12-12 15:25 Dan Williams
  2007-12-12 15:38 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dan Williams @ 2007-12-12 15:25 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jean Tourrilhes, linux-wireless, David Miller

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>


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..74e84ca 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -541,6 +541,16 @@
 /* Maximum size of returned data */
 #define IW_SCAN_MAX_DATA	4096	/* In bytes */
 
+/* Scan capability flags - in (struct iw_range *)->scan_capa */
+#define IW_SCAN_CAPA_NONE		0x00
+#define IW_SCAN_CAPA_ESSID		0x01
+#define IW_SCAN_CAPA_BSSID		0x02
+#define IW_SCAN_CAPA_CHANNEL	0x04
+#define IW_SCAN_CAPA_MODE		0x08
+#define IW_SCAN_CAPA_RATE		0x10
+#define IW_SCAN_CAPA_TYPE		0x20
+#define IW_SCAN_CAPA_TIME		0x40
+
 /* Max number of char in custom event - use multiple of them if needed */
 #define IW_CUSTOM_MAX		256	/* In bytes */
 
@@ -963,6 +973,9 @@ struct	iw_range
 	__u16		old_num_channels;
 	__u8		old_num_frequency;
 
+	/* Scan capabilities */
+	__u8		scan_capa; 	/* IW_SCAN_CAPA_* bit field */
+
 	/* Wireless event capability bitmasks */
 	__u32		event_capa[6];
 
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;
 }
 


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] introduce WEXT scan capabilities
  2007-12-12 15:25 [PATCH v2] introduce WEXT scan capabilities Dan Williams
@ 2007-12-12 15:38 ` David Miller
  2007-12-12 16:58 ` Luis R. Rodriguez
  2007-12-12 17:41 ` Johannes Berg
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2007-12-12 15:38 UTC (permalink / raw)
  To: dcbw; +Cc: linville, jt, linux-wireless

From: Dan Williams <dcbw@redhat.com>
Date: Wed, 12 Dec 2007 10:25:07 -0500

> 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>

Ok, I'm fine with this.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] introduce WEXT scan capabilities
  2007-12-12 15:25 [PATCH v2] introduce WEXT scan capabilities Dan Williams
  2007-12-12 15:38 ` David Miller
@ 2007-12-12 16:58 ` Luis R. Rodriguez
  2007-12-12 17:41   ` Johannes Berg
  2007-12-12 17:41 ` Johannes Berg
  2 siblings, 1 reply; 5+ messages in thread
From: Luis R. Rodriguez @ 2007-12-12 16:58 UTC (permalink / raw)
  To: Dan Williams
  Cc: John W. Linville, Jean Tourrilhes, linux-wireless, David Miller

On Dec 12, 2007 10:25 AM, Dan Williams <dcbw@redhat.com> wrote:
> --- a/include/linux/wireless.h
> +++ b/include/linux/wireless.h
> @@ -541,6 +541,16 @@
>  /* Maximum size of returned data */
>  #define IW_SCAN_MAX_DATA       4096    /* In bytes */
>
> +/* Scan capability flags - in (struct iw_range *)->scan_capa */
> +#define IW_SCAN_CAPA_NONE              0x00
> +#define IW_SCAN_CAPA_ESSID             0x01
> +#define IW_SCAN_CAPA_BSSID             0x02
> +#define IW_SCAN_CAPA_CHANNEL   0x04
> +#define IW_SCAN_CAPA_MODE              0x08
> +#define IW_SCAN_CAPA_RATE              0x10
> +#define IW_SCAN_CAPA_TYPE              0x20
> +#define IW_SCAN_CAPA_TIME              0x40
> +

Oh well... Would you mind putting this on enum and kerneldoc'ing them?
I'm not sure what some of these would imply capabilities for.

  Luis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] introduce WEXT scan capabilities
  2007-12-12 15:25 [PATCH v2] introduce WEXT scan capabilities Dan Williams
  2007-12-12 15:38 ` David Miller
  2007-12-12 16:58 ` Luis R. Rodriguez
@ 2007-12-12 17:41 ` Johannes Berg
  2 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2007-12-12 17:41 UTC (permalink / raw)
  To: Dan Williams
  Cc: John W. Linville, Jean Tourrilhes, linux-wireless, David Miller

[-- Attachment #1: Type: text/plain, Size: 678 bytes --]


On Wed, 2007-12-12 at 10:25 -0500, Dan Williams wrote:
> 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>

Looks ok to me.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] introduce WEXT scan capabilities
  2007-12-12 16:58 ` Luis R. Rodriguez
@ 2007-12-12 17:41   ` Johannes Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2007-12-12 17:41 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Dan Williams, John W. Linville, Jean Tourrilhes, linux-wireless,
	David Miller

[-- Attachment #1: Type: text/plain, Size: 261 bytes --]


> Oh well... Would you mind putting this on enum and kerneldoc'ing them?
> I'm not sure what some of these would imply capabilities for.

kerneldoc isn't very useful on that file and nobody's going to convert
all the comments there any more.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-12 17:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-12 15:25 [PATCH v2] introduce WEXT scan capabilities Dan Williams
2007-12-12 15:38 ` David Miller
2007-12-12 16:58 ` Luis R. Rodriguez
2007-12-12 17:41   ` Johannes Berg
2007-12-12 17:41 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox