diff options
author | Eliad Peller <eliad@wizery.com> | 2011-04-05 12:13:28 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-05-02 03:25:57 -0400 |
commit | 30df14d0d35dd166d50b8ea80d5f0b7ef1edb6da (patch) | |
tree | 1c7929f02ec89ff84cc0712967dc2783bef5b146 | |
parent | a20a5b7e48e24c1bf9c10ba27cb1862f8f777d00 (diff) |
wl12xx: avoid redundant join on interface reconfiguration
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>
Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r-- | 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 11497a90463b..1dd735cc38b1 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -2698,8 +2698,10 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, | |||
2698 | } | 2698 | } |
2699 | } else { | 2699 | } else { |
2700 | /* use defaults when not associated */ | 2700 | /* use defaults when not associated */ |
2701 | bool was_assoc = | ||
2702 | !!test_and_clear_bit(WL1271_FLAG_STA_ASSOCIATED, | ||
2703 | &wl->flags); | ||
2701 | clear_bit(WL1271_FLAG_STA_STATE_SENT, &wl->flags); | 2704 | clear_bit(WL1271_FLAG_STA_STATE_SENT, &wl->flags); |
2702 | clear_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags); | ||
2703 | wl->aid = 0; | 2705 | wl->aid = 0; |
2704 | 2706 | ||
2705 | /* free probe-request template */ | 2707 | /* free probe-request template */ |
@@ -2725,8 +2727,10 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl, | |||
2725 | goto out; | 2727 | goto out; |
2726 | 2728 | ||
2727 | /* restore the bssid filter and go to dummy bssid */ | 2729 | /* restore the bssid filter and go to dummy bssid */ |
2728 | wl1271_unjoin(wl); | 2730 | if (was_assoc) { |
2729 | wl1271_dummy_join(wl); | 2731 | wl1271_unjoin(wl); |
2732 | wl1271_dummy_join(wl); | ||
2733 | } | ||
2730 | } | 2734 | } |
2731 | } | 2735 | } |
2732 | 2736 | ||