aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-08-23 04:46:50 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-08-27 12:29:00 -0400
commit60744f62971cfa80cab36ab8c12afeae371fbe8b (patch)
tree6ae9fe1032ee38fa737c0d147625c51d66e164e5 /drivers
parentece9c4ee5e590f96d7221c746126eaafac15a60c (diff)
iwlagn: remove iw_mode check for beacon
Since we have the beacon context now, we no longer need to rely on iw_mode but can check the beacon context interface's type. However, that check must be in the work item instead due to locking constraints (mutex must be held when dereferencing beacon_ctx pointer). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index bad97f47eb9f..b07d397ed5a7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -613,6 +613,16 @@ static void iwl_bg_beacon_update(struct work_struct *work)
613 goto out; 613 goto out;
614 } 614 }
615 615
616 if (priv->beacon_ctx->vif->type != NL80211_IFTYPE_AP) {
617 /*
618 * The ucode will send beacon notifications even in
619 * IBSS mode, but we don't want to process them. But
620 * we need to defer the type check to here due to
621 * requiring locking around the beacon_ctx access.
622 */
623 goto out;
624 }
625
616 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ 626 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */
617 beacon = ieee80211_beacon_get(priv->hw, priv->beacon_ctx->vif); 627 beacon = ieee80211_beacon_get(priv->hw, priv->beacon_ctx->vif);
618 if (!beacon) { 628 if (!beacon) {
@@ -846,8 +856,7 @@ static void iwl_rx_beacon_notif(struct iwl_priv *priv,
846 856
847 priv->ibss_manager = le32_to_cpu(beacon->ibss_mgr_status); 857 priv->ibss_manager = le32_to_cpu(beacon->ibss_mgr_status);
848 858
849 if ((priv->iw_mode == NL80211_IFTYPE_AP) && 859 if (!test_bit(STATUS_EXIT_PENDING, &priv->status))
850 (!test_bit(STATUS_EXIT_PENDING, &priv->status)))
851 queue_work(priv->workqueue, &priv->beacon_update); 860 queue_work(priv->workqueue, &priv->beacon_update);
852} 861}
853 862