iwlagn: fix iwl_is_any_associated
commit054ec924944912413e4ee927b8cf02f476d08783
authorJohannes Berg <johannes.berg@intel.com>
Fri, 6 May 2011 18:11:20 +0000 (6 11:11 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 May 2011 19:54:45 +0000 (10 15:54 -0400)
tree230bce23cafb27dc755f883203dd400bd5411a75
parent4105f8075051b62816830c95de1ec17ceb364d09
iwlagn: fix iwl_is_any_associated

The function iwl_is_any_associated() was intended
to check both contexts, but due to an oversight
it only checks the BSS context. This leads to a
problem with scanning since the passive dwell
time isn't restricted appropriately and a scan
that includes passive channels will never finish
if only the PAN context is associated since the
default dwell time of 120ms won't fit into the
normal 100 TU DTIM interval.

Fix the function by using for_each_context() and
also reorganise the other functions a bit to take
advantage of each other making the code easier to
read.

Cc: stable@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-dev.h