linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [PATCH] mac80211: honor IW_SCAN_THIS_ESSID in siwscan ioctl
@ 2007-10-10 20:34 John W. Linville
  2007-10-12 13:25 ` Helmut Schaa
  0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2007-10-10 20:34 UTC (permalink / raw)
  To: linux-wireless
  Cc: dana.r.ferguson, dcbw, ipw3945-devel, Bill Moss, Abhijeet Kolekar,
	John W. Linville

From: Bill Moss <bmoss@clemson.edu>

This patch fixes the problem of associating with wpa_secured hidden
AP.  Please try out.

The original author of this patch is Bill Moss <bmoss@clemson.edu>

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 net/mac80211/ieee80211_ioctl.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index f95d488..331048f 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -507,10 +507,11 @@ static int ieee80211_ioctl_giwap(struct net_device *dev,
 
 static int ieee80211_ioctl_siwscan(struct net_device *dev,
 				   struct iw_request_info *info,
-				   struct iw_point *data, char *extra)
+				   union iwreq_data *wrqu, char *extra)
 {
 	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	struct iw_scan_req *req = NULL;
 	u8 *ssid = NULL;
 	size_t ssid_len = 0;
 
@@ -519,6 +520,14 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev,
 
 	switch (sdata->type) {
 	case IEEE80211_IF_TYPE_STA:
+		if (wrqu->data.length == sizeof(struct iw_scan_req) &&
+		    wrqu->data.flags & IW_SCAN_THIS_ESSID) {
+			req = (struct iw_scan_req *)extra;
+			ssid = req->essid;
+			ssid_len = req->essid_len;
+			break;
+		}
+		/* else fall-through */
 	case IEEE80211_IF_TYPE_IBSS:
 		if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) {
 			ssid = sdata->u.sta.ssid;
-- 
1.5.2.4


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

* Re: [PATCH] [PATCH] mac80211: honor IW_SCAN_THIS_ESSID in siwscan ioctl
  2007-10-10 20:34 [PATCH] [PATCH] mac80211: honor IW_SCAN_THIS_ESSID in siwscan ioctl John W. Linville
@ 2007-10-12 13:25 ` Helmut Schaa
  2007-10-15  9:20   ` [ipw3945-devel] [PATCH] [PATCH] mac80211: honorIW_SCAN_THIS_ESSID " Winkler, Tomas
  0 siblings, 1 reply; 3+ messages in thread
From: Helmut Schaa @ 2007-10-12 13:25 UTC (permalink / raw)
  To: John W. Linville
  Cc: linux-wireless, dana.r.ferguson, dcbw, ipw3945-devel, Bill Moss,
	Abhijeet Kolekar

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

Hi,

Am Mittwoch, 10. Oktober 2007 22:34:56 schrieb John W. Linville:
> This patch fixes the problem of associating with wpa_secured hidden
> AP.  Please try out.

The patch did not fix the issue for _some_ APs I have here but it is 
apparently correct.

I was able to track the issue further down to the probe-request iwlwifi sends 
to connect to a hidden AP (hw_scan is enabled). Attached is a quick hack 
against iwlwifi-1.1.0 which made hidden AP working for me (using hw_scan).

The patch is only ment as a hint, not as a real fix!

The problem seemed to be in the info element "supported rates". The 
probe-request mac80211 would generate does only attach eight supported rates 
to this info element, the rest goes to "extended supported rates".

Instead iwlwifi puts _all_ (more then eight) rates into "supported rates" and 
omits "extended supported rates". As "supported rates" is specified in 
802.11b there should only be 802.11b rates (this is an assumption as I do not 
have the 802.11 specs here). This is exactly what my patch does: limit the 
number of supported rates to eight.

Can somebody please verify if I'm right?

Btw iwlwifi generates the probe-request itself _only_ if hw_scan is enabled. 
If hw_scan is disabled mac80211 generates the probe-request (which then 
should be correct) but the request gets somehow corrupted.

Thanks,
Helmut

[-- Attachment #2: fix_probe_request.diff --]
[-- Type: text/x-diff, Size: 930 bytes --]

diff -ur iwlwifi-1.1.0/origin/iwl-base.c iwlwifi-1.1.0_1/origin/iwl-base.c
--- origin/iwl-base.c	2007-09-19 11:11:16.000000000 +0200
+++ origin/iwl-base.c	2007-10-12 13:46:23.000000000 +0200
@@ -1877,6 +1877,7 @@
 	int len = 0;
 	u8 *pos = NULL;
 	u16 ret_rates;
+	int rate_count = 0;
 
 	/* Make sure there is enough space for the probe request,
 	 * two mandatory IEs and the data */
@@ -1924,11 +1925,16 @@
 	/* ... fill it in... */
 	*pos++ = WLAN_EID_SUPP_RATES;
 	*pos = 0;
+
+	rate_count = 8;
+	if (left < 8)
+		rate_count = left;
+
 	ret_rates = priv->active_rate = priv->rates_mask;
 	priv->active_rate_basic = priv->rates_mask & IWL_BASIC_RATES_MASK;
 
 	iwl_supported_rate_to_ie(pos, priv->active_rate,
-				 priv->active_rate_basic, left);
+				 priv->active_rate_basic, rate_count);
 	len += 2 + *pos;
 	pos += (*pos) + 1;
 	ret_rates = ~ret_rates & priv->active_rate;
Nur in iwlwifi-1.1.0_1/origin: iwl-base.c.orig.

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

* RE: [ipw3945-devel] [PATCH] [PATCH] mac80211: honorIW_SCAN_THIS_ESSID in siwscan ioctl
  2007-10-12 13:25 ` Helmut Schaa
@ 2007-10-15  9:20   ` Winkler, Tomas
  0 siblings, 0 replies; 3+ messages in thread
From: Winkler, Tomas @ 2007-10-15  9:20 UTC (permalink / raw)
  To: Helmut Schaa, John W. Linville
  Cc: dcbw, linux-wireless, ipw3945-devel, Bill Moss

You are, we will provide a patch to fix that.
Thanks.
Tomas

>-----Original Message-----
>From: ipw3945-devel-bounces@lists.sourceforge.net
[mailto:ipw3945-devel-
>bounces@lists.sourceforge.net] On Behalf Of Helmut Schaa
>Sent: Friday, October 12, 2007 3:25 PM
>To: John W. Linville
>Cc: dcbw@redhat.com; linux-wireless@vger.kernel.org; ipw3945-
>devel@lists.sourceforge.net; Bill Moss
>Subject: Re: [ipw3945-devel] [PATCH] [PATCH] mac80211:
>honorIW_SCAN_THIS_ESSID in siwscan ioctl
>
>Hi,
>
>Am Mittwoch, 10. Oktober 2007 22:34:56 schrieb John W. Linville:
>> This patch fixes the problem of associating with wpa_secured hidden
>> AP.  Please try out.
>
>The patch did not fix the issue for _some_ APs I have here but it is
>apparently correct.
>
>I was able to track the issue further down to the probe-request iwlwifi
>sends
>to connect to a hidden AP (hw_scan is enabled). Attached is a quick
hack
>against iwlwifi-1.1.0 which made hidden AP working for me (using
hw_scan).
>
>The patch is only ment as a hint, not as a real fix!
>
>The problem seemed to be in the info element "supported rates". The
>probe-request mac80211 would generate does only attach eight supported
>rates
>to this info element, the rest goes to "extended supported rates".
>
>Instead iwlwifi puts _all_ (more then eight) rates into "supported
rates"
>and
>omits "extended supported rates". As "supported rates" is specified in
>802.11b there should only be 802.11b rates (this is an assumption as I
do
>not
>have the 802.11 specs here). This is exactly what my patch does: limit
the
>number of supported rates to eight.
>
>Can somebody please verify if I'm right?
>
>Btw iwlwifi generates the probe-request itself _only_ if hw_scan is
>enabled.
>If hw_scan is disabled mac80211 generates the probe-request (which then
>should be correct) but the request gets somehow corrupted.
>
>Thanks,
>Helmut
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

end of thread, other threads:[~2007-10-15  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-10 20:34 [PATCH] [PATCH] mac80211: honor IW_SCAN_THIS_ESSID in siwscan ioctl John W. Linville
2007-10-12 13:25 ` Helmut Schaa
2007-10-15  9:20   ` [ipw3945-devel] [PATCH] [PATCH] mac80211: honorIW_SCAN_THIS_ESSID " Winkler, Tomas

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