netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [d80211] some issues regarding iwconfig parameters sequence
@ 2006-09-13 21:00 mabbas
  2006-09-14 13:34 ` Dan Williams
  0 siblings, 1 reply; 3+ messages in thread
From: mabbas @ 2006-09-13 21:00 UTC (permalink / raw)
  To: netdev; +Cc: jkm, johannes

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

Hi
I have some problem connecting if I don't follow some parameters 
sequence in iwconfig command for example if I issues the following
# iwconfig wlan0 essid test  ap xx:xx:xx:xx:xx:xx
#iwconfif wlan0 channel 9

in d80211 if essid and bssid set it will start authentication with 
default channel and authentication will timeout then after the second 
command kicks in to tune to the right channel the retry counter of 
authentication will be at maximum and we wont authenticate, same problem 
exist for IBSS it will start searching but once we call #iwconfif wlan0 
channel 9 this will stop scanning and we stop IBSS searching . I 
attached a patch for workaround this problem. I am not sure this is the 
right way to fix just attached to illustrate the problem.
Mohamed

[-- Attachment #2: d80211-conn.patch --]
[-- Type: text/x-patch, Size: 2220 bytes --]


Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>

diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index 3ffdc5c..9bd385b 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -1852,6 +1852,29 @@ static int ieee80211_ioctl_giwmode(struc
 	return 0;
 }
 
+#define IEEE80211_AUTH_TIMEOUT (HZ / 5)
+#define IEEE80211_AUTH_MAX_TRIES 3
+#define IEEE80211_ASSOC_TIMEOUT (HZ / 5)
+#define IEEE80211_ASSOC_MAX_TRIES 3
+
+void ieee80211_reset_tries(struct net_device *dev,
+                           struct ieee80211_if_sta *ifsta,
+			   int was_scanning)
+{
+
+	if ((ifsta->state == IEEE80211_AUTHENTICATE) &&
+	    (ifsta->auth_tries > IEEE80211_AUTH_MAX_TRIES)) {
+		ifsta->auth_tries = 0;
+		ifsta->auth_transaction = -1;
+		mod_timer(&ifsta->timer, jiffies + IEEE80211_AUTH_TIMEOUT);
+	} else if ((ifsta->assoc_tries > IEEE80211_ASSOC_MAX_TRIES) &&
+		   (ifsta->state == IEEE80211_ASSOCIATE)) {
+		ifsta->assoc_tries = 0;
+		mod_timer(&ifsta->timer, jiffies + IEEE80211_ASSOC_TIMEOUT);
+	} if (ifsta->state == IEEE80211_IBSS_SEARCH && was_scanning)
+		mod_timer(&ifsta->timer, jiffies + 2 * HZ);
+	return;
+}
 
 int ieee80211_ioctl_siwfreq(struct net_device *dev,
 			    struct iw_request_info *info,
@@ -1898,8 +1921,23 @@ int ieee80211_ioctl_siwfreq(struct net_d
 	}
 
 	if (set) {
+		struct ieee80211_sub_if_data *sdata;
+		struct ieee80211_if_sta *ifsta;
+		int ret;
+		int was_scanning;
+
+		sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+		ifsta = &sdata->u.sta;
+
+		was_scanning = local->sta_scanning;
 		local->sta_scanning = 0; /* Abort possible scan */
-		return ieee80211_hw_config(dev);
+	
+		ret = ieee80211_hw_config(dev);
+
+		if (!ret)
+			ieee80211_reset_tries(dev, ifsta, was_scanning);
+
+		return ret;
 	}
 
 	return -EINVAL;
diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c
index e94cb4d..6a3011c 100644
--- a/net/d80211/ieee80211_sta.c
+++ b/net/d80211/ieee80211_sta.c
@@ -2346,7 +2346,7 @@ int ieee80211_sta_set_ssid(struct net_de
 		return ieee80211_sta_find_ibss(dev, ifsta);
 	}
 
-	if (ifsta->bssid_set && ifsta->state != IEEE80211_AUTHENTICATE)
+	if (ifsta->bssid_set )
 		ieee80211_sta_new_auth(dev, ifsta);
 
 	return 0;

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

end of thread, other threads:[~2006-09-14 17:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-13 21:00 [d80211] some issues regarding iwconfig parameters sequence mabbas
2006-09-14 13:34 ` Dan Williams
2006-09-14 17:48   ` mabbas

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