* [PATCH] cfg80211: don't optimise wext calls too much
@ 2009-07-16 9:39 Johannes Berg
2009-07-17 10:50 ` Kalle Valo
2009-07-18 12:00 ` Marcel Holtmann
0 siblings, 2 replies; 3+ messages in thread
From: Johannes Berg @ 2009-07-16 9:39 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, Marcel Holtmann
In the wext code I tried to not reconnect all the time
when the user wasn't really sure what they were doing,
like setting the BSSID back to the same value it was.
However, this optimisation should only be done while
associated so that setting the BSSID back to the same
value that it was actually triggers a new association
if not currently associated. To achieve, that, put the
relevant code into the !IDLE case instead.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
net/wireless/wext-sme.c | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
--- wireless-testing.orig/net/wireless/wext-sme.c 2009-07-16 11:29:00.000000000 +0200
+++ wireless-testing/net/wireless/wext-sme.c 2009-07-16 11:31:00.000000000 +0200
@@ -72,13 +72,14 @@ int cfg80211_mgd_wext_siwfreq(struct net
cfg80211_lock_rdev(rdev);
wdev_lock(wdev);
- if (wdev->wext.connect.channel == chan) {
- err = 0;
- goto out;
- }
-
if (wdev->sme_state != CFG80211_SME_IDLE) {
bool event = true;
+
+ if (wdev->wext.connect.channel == chan) {
+ err = 0;
+ goto out;
+ }
+
/* if SSID set, we'll try right again, avoid event */
if (wdev->wext.connect.ssid_len)
event = false;
@@ -164,13 +165,14 @@ int cfg80211_mgd_wext_siwessid(struct ne
err = 0;
- if (wdev->wext.connect.ssid && len &&
- len == wdev->wext.connect.ssid_len &&
- memcmp(wdev->wext.connect.ssid, ssid, len) == 0)
- goto out;
-
if (wdev->sme_state != CFG80211_SME_IDLE) {
bool event = true;
+
+ if (wdev->wext.connect.ssid && len &&
+ len == wdev->wext.connect.ssid_len &&
+ memcmp(wdev->wext.connect.ssid, ssid, len) == 0)
+ goto out;
+
/* if SSID set now, we'll try to connect, avoid event */
if (len)
event = false;
@@ -244,17 +246,17 @@ int cfg80211_mgd_wext_siwap(struct net_d
cfg80211_lock_rdev(wiphy_to_dev(wdev->wiphy));
wdev_lock(wdev);
- err = 0;
- /* both automatic */
- if (!bssid && !wdev->wext.connect.bssid)
- goto out;
+ if (wdev->sme_state != CFG80211_SME_IDLE) {
+ err = 0;
+ /* both automatic */
+ if (!bssid && !wdev->wext.connect.bssid)
+ goto out;
- /* fixed already - and no change */
- if (wdev->wext.connect.bssid && bssid &&
- compare_ether_addr(bssid, wdev->wext.connect.bssid) == 0)
- goto out;
+ /* fixed already - and no change */
+ if (wdev->wext.connect.bssid && bssid &&
+ compare_ether_addr(bssid, wdev->wext.connect.bssid) == 0)
+ goto out;
- if (wdev->sme_state != CFG80211_SME_IDLE) {
err = __cfg80211_disconnect(wiphy_to_dev(wdev->wiphy),
dev, WLAN_REASON_DEAUTH_LEAVING,
false);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cfg80211: don't optimise wext calls too much
2009-07-16 9:39 [PATCH] cfg80211: don't optimise wext calls too much Johannes Berg
@ 2009-07-17 10:50 ` Kalle Valo
2009-07-18 12:00 ` Marcel Holtmann
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2009-07-17 10:50 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless, Marcel Holtmann
Johannes Berg <johannes@sipsolutions.net> writes:
> In the wext code I tried to not reconnect all the time
> when the user wasn't really sure what they were doing,
> like setting the BSSID back to the same value it was.
> However, this optimisation should only be done while
> associated so that setting the BSSID back to the same
> value that it was actually triggers a new association
> if not currently associated. To achieve, that, put the
> relevant code into the !IDLE case instead.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
At least this patch cured my resume problems I reported earlier[1]. It
will take few days to test the dropping from network case, but I'm sure
this patch will help with that problem as well. If not, I'll report
about the issue. Thanks for fixing this.
Tested-by: Kalle Valo <kalle.valo@iki.fi>
[1] http://www.spinics.net/lists/linux-wireless/msg35797.html
--
Kalle Valo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] cfg80211: don't optimise wext calls too much
2009-07-16 9:39 [PATCH] cfg80211: don't optimise wext calls too much Johannes Berg
2009-07-17 10:50 ` Kalle Valo
@ 2009-07-18 12:00 ` Marcel Holtmann
1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2009-07-18 12:00 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, linux-wireless
Hi Johannes,
> In the wext code I tried to not reconnect all the time
> when the user wasn't really sure what they were doing,
> like setting the BSSID back to the same value it was.
> However, this optimisation should only be done while
> associated so that setting the BSSID back to the same
> value that it was actually triggers a new association
> if not currently associated. To achieve, that, put the
> relevant code into the !IDLE case instead.
this patch fixes my problems with wireless-testing.git
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Marcel Holtmann <marcel@holtmann.org>
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-18 12:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-16 9:39 [PATCH] cfg80211: don't optimise wext calls too much Johannes Berg
2009-07-17 10:50 ` Kalle Valo
2009-07-18 12:00 ` Marcel Holtmann
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).