linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wl12xx: avoid redundant join on interface reconfiguration
@ 2011-04-05 16:13 Eliad Peller
  2011-04-20 18:05 ` Luciano Coelho
  0 siblings, 1 reply; 2+ messages in thread
From: Eliad Peller @ 2011-04-05 16:13 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

ieee80211_reconfig() sets most of the "changed" flags regardless
of the actual change (e.g. BSS_CHANGED_ASSOC will be set even if
the interface is still not associated). in this case the driver
will issue some unneeded commands.

Since the driver relies solely on the BSS_CHANGED_ASSOC flag,
without checking if there was an actual change, it will end up
issuing unjoin() and dummy_join() commands, although it was
never associated and should just remain idle.

Avoid it by checking the actual state change, in addition to the
"changed" flag.

(there seem to be more redundant configuration commands being
issued, but they shouldn't harm)

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/wl12xx/main.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 7126506..9d0cde3 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2692,8 +2692,10 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
 			}
 		} else {
 			/* use defaults when not associated */
+			bool was_assoc =
+			    !!test_and_clear_bit(WL1271_FLAG_STA_ASSOCIATED,
+						 &wl->flags);
 			clear_bit(WL1271_FLAG_STA_STATE_SENT, &wl->flags);
-			clear_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags);
 			wl->aid = 0;
 
 			/* free probe-request template */
@@ -2719,8 +2721,10 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
 				goto out;
 
 			/* restore the bssid filter and go to dummy bssid */
-			wl1271_unjoin(wl);
-			wl1271_dummy_join(wl);
+			if (was_assoc) {
+				wl1271_unjoin(wl);
+				wl1271_dummy_join(wl);
+			}
 		}
 	}
 
-- 
1.7.0.4


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

end of thread, other threads:[~2011-04-20 18:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-05 16:13 [PATCH] wl12xx: avoid redundant join on interface reconfiguration Eliad Peller
2011-04-20 18:05 ` Luciano Coelho

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