diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2008-05-04 22:22:48 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-14 16:29:46 -0400 |
commit | 5ec0397679f1c1606199cfd6f3e24351891c60c3 (patch) | |
tree | 0a2dd00d5de9ac8972f2a70101a8a4d53f2eb576 /drivers/net/wireless/iwlwifi | |
parent | 4419e39b6041b213e49bb13fd40fb267de0eb568 (diff) |
iwlwifi : Set monitor mode for 3945
The patch leverages mac80211 configure_filter to enable iwl3945
monitor mode.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 36 |
2 files changed, 36 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index fb96c62ad0ff..9fdc1405e853 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -886,6 +886,7 @@ struct iwl3945_priv { | |||
886 | struct work_struct report_work; | 886 | struct work_struct report_work; |
887 | struct work_struct request_scan; | 887 | struct work_struct request_scan; |
888 | struct work_struct beacon_update; | 888 | struct work_struct beacon_update; |
889 | struct work_struct set_monitor; | ||
889 | 890 | ||
890 | struct tasklet_struct irq_tasklet; | 891 | struct tasklet_struct irq_tasklet; |
891 | 892 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 7040cde8bc28..f021eba41e6a 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -6144,6 +6144,24 @@ static void iwl3945_bg_rf_kill(struct work_struct *work) | |||
6144 | mutex_unlock(&priv->mutex); | 6144 | mutex_unlock(&priv->mutex); |
6145 | } | 6145 | } |
6146 | 6146 | ||
6147 | static void iwl3945_bg_set_monitor(struct work_struct *work) | ||
6148 | { | ||
6149 | struct iwl3945_priv *priv = container_of(work, | ||
6150 | struct iwl3945_priv, set_monitor); | ||
6151 | |||
6152 | IWL_DEBUG(IWL_DL_STATE, "setting monitor mode\n"); | ||
6153 | |||
6154 | mutex_lock(&priv->mutex); | ||
6155 | |||
6156 | if (!iwl3945_is_ready(priv)) | ||
6157 | IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n"); | ||
6158 | else | ||
6159 | if (iwl3945_set_mode(priv, IEEE80211_IF_TYPE_MNTR) != 0) | ||
6160 | IWL_ERROR("iwl3945_set_mode() failed\n"); | ||
6161 | |||
6162 | mutex_unlock(&priv->mutex); | ||
6163 | } | ||
6164 | |||
6147 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) | 6165 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) |
6148 | 6166 | ||
6149 | static void iwl3945_bg_scan_check(struct work_struct *data) | 6167 | static void iwl3945_bg_scan_check(struct work_struct *data) |
@@ -6996,7 +7014,22 @@ static void iwl3945_configure_filter(struct ieee80211_hw *hw, | |||
6996 | * XXX: dummy | 7014 | * XXX: dummy |
6997 | * see also iwl3945_connection_init_rx_config | 7015 | * see also iwl3945_connection_init_rx_config |
6998 | */ | 7016 | */ |
6999 | *total_flags = 0; | 7017 | struct iwl3945_priv *priv = hw->priv; |
7018 | int new_flags = 0; | ||
7019 | if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { | ||
7020 | if (*total_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { | ||
7021 | IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", | ||
7022 | IEEE80211_IF_TYPE_MNTR, | ||
7023 | changed_flags, *total_flags); | ||
7024 | /* queue work 'cuz mac80211 is holding a lock which | ||
7025 | * prevents us from issuing (synchronous) f/w cmds */ | ||
7026 | queue_work(priv->workqueue, &priv->set_monitor); | ||
7027 | new_flags &= FIF_PROMISC_IN_BSS | | ||
7028 | FIF_OTHER_BSS | | ||
7029 | FIF_ALLMULTI; | ||
7030 | } | ||
7031 | } | ||
7032 | *total_flags = new_flags; | ||
7000 | } | 7033 | } |
7001 | 7034 | ||
7002 | static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, | 7035 | static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, |
@@ -7872,6 +7905,7 @@ static void iwl3945_setup_deferred_work(struct iwl3945_priv *priv) | |||
7872 | INIT_WORK(&priv->abort_scan, iwl3945_bg_abort_scan); | 7905 | INIT_WORK(&priv->abort_scan, iwl3945_bg_abort_scan); |
7873 | INIT_WORK(&priv->rf_kill, iwl3945_bg_rf_kill); | 7906 | INIT_WORK(&priv->rf_kill, iwl3945_bg_rf_kill); |
7874 | INIT_WORK(&priv->beacon_update, iwl3945_bg_beacon_update); | 7907 | INIT_WORK(&priv->beacon_update, iwl3945_bg_beacon_update); |
7908 | INIT_WORK(&priv->set_monitor, iwl3945_bg_set_monitor); | ||
7875 | INIT_DELAYED_WORK(&priv->post_associate, iwl3945_bg_post_associate); | 7909 | INIT_DELAYED_WORK(&priv->post_associate, iwl3945_bg_post_associate); |
7876 | INIT_DELAYED_WORK(&priv->init_alive_start, iwl3945_bg_init_alive_start); | 7910 | INIT_DELAYED_WORK(&priv->init_alive_start, iwl3945_bg_init_alive_start); |
7877 | INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start); | 7911 | INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start); |