From: mabbas <mabbas@linux.intel.com>
To: netdev@vger.kernel.org
Cc: jkm@devicescape.com, johannes@sipsolutions.net
Subject: [d80211] some issues regarding iwconfig parameters sequence
Date: Wed, 13 Sep 2006 14:00:43 -0700 [thread overview]
Message-ID: <4508717B.8060403@linux.intel.com> (raw)
[-- 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;
next reply other threads:[~2006-09-13 21:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-13 21:00 mabbas [this message]
2006-09-14 13:34 ` [d80211] some issues regarding iwconfig parameters sequence Dan Williams
2006-09-14 17:48 ` mabbas
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=4508717B.8060403@linux.intel.com \
--to=mabbas@linux.intel.com \
--cc=jkm@devicescape.com \
--cc=johannes@sipsolutions.net \
--cc=netdev@vger.kernel.org \
/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).