diff options
author | Rick Farrington <rickdic@hotmail.com> | 2008-06-30 05:23:28 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-07-02 15:41:55 -0400 |
commit | 25b3f57c1f4572d9b2d5671d60e99f26d2a7a26b (patch) | |
tree | 759f8b1c62da78178e138b60ee625187f9f58274 | |
parent | 0a078ffa011209c307880da10917ef205b4b11f4 (diff) |
iwlwifi: fix incorrect monitor mode operation
This patch fixes monitor mode operation for iwlwifi.
Problems addressed:
1. when monitor mode was enabled, multiple, overlapped calls were being
made to 'iwl3945_bg_set_monitor'
2. when monitor mode was disabled (via the configure_filter callback),
the driver was still enabling monitor mode
3. when monitor mode was enabled, the selected channel was not set
(eg. 'iwconfig wlanx mode monitor channel n' DID NOT SET channel 'n'
when packet capture was subsequently enabled)
Signed-off-by: Rick Farrington <rickdic@hotmail.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl4965-base.c | 33 |
2 files changed, 22 insertions, 41 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 43cb8ff97939..4f0a18a0e664 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -2312,7 +2312,7 @@ static void iwl3945_connection_init_rx_config(struct iwl3945_priv *priv) | |||
2312 | #endif | 2312 | #endif |
2313 | 2313 | ||
2314 | ch_info = iwl3945_get_channel_info(priv, priv->band, | 2314 | ch_info = iwl3945_get_channel_info(priv, priv->band, |
2315 | le16_to_cpu(priv->staging_rxon.channel)); | 2315 | le16_to_cpu(priv->active_rxon.channel)); |
2316 | 2316 | ||
2317 | if (!ch_info) | 2317 | if (!ch_info) |
2318 | ch_info = &priv->channel_info[0]; | 2318 | ch_info = &priv->channel_info[0]; |
@@ -7006,26 +7006,18 @@ static void iwl3945_configure_filter(struct ieee80211_hw *hw, | |||
7006 | unsigned int *total_flags, | 7006 | unsigned int *total_flags, |
7007 | int mc_count, struct dev_addr_list *mc_list) | 7007 | int mc_count, struct dev_addr_list *mc_list) |
7008 | { | 7008 | { |
7009 | /* | ||
7010 | * XXX: dummy | ||
7011 | * see also iwl3945_connection_init_rx_config | ||
7012 | */ | ||
7013 | struct iwl3945_priv *priv = hw->priv; | 7009 | struct iwl3945_priv *priv = hw->priv; |
7014 | int new_flags = 0; | 7010 | |
7015 | if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { | 7011 | if (changed_flags & (*total_flags) & FIF_OTHER_BSS) { |
7016 | if (*total_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { | 7012 | IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", |
7017 | IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", | 7013 | IEEE80211_IF_TYPE_MNTR, |
7018 | IEEE80211_IF_TYPE_MNTR, | 7014 | changed_flags, *total_flags); |
7019 | changed_flags, *total_flags); | 7015 | /* queue work 'cuz mac80211 is holding a lock which |
7020 | /* queue work 'cuz mac80211 is holding a lock which | 7016 | * prevents us from issuing (synchronous) f/w cmds */ |
7021 | * prevents us from issuing (synchronous) f/w cmds */ | 7017 | queue_work(priv->workqueue, &priv->set_monitor); |
7022 | queue_work(priv->workqueue, &priv->set_monitor); | ||
7023 | new_flags &= FIF_PROMISC_IN_BSS | | ||
7024 | FIF_OTHER_BSS | | ||
7025 | FIF_ALLMULTI; | ||
7026 | } | ||
7027 | } | 7018 | } |
7028 | *total_flags = new_flags; | 7019 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | |
7020 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; | ||
7029 | } | 7021 | } |
7030 | 7022 | ||
7031 | static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, | 7023 | static void iwl3945_mac_remove_interface(struct ieee80211_hw *hw, |
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c index 5eb2a3eaf677..ba0f28945eb1 100644 --- a/drivers/net/wireless/iwlwifi/iwl4965-base.c +++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c | |||
@@ -758,7 +758,7 @@ static void iwl4965_connection_init_rx_config(struct iwl_priv *priv) | |||
758 | #endif | 758 | #endif |
759 | 759 | ||
760 | ch_info = iwl_get_channel_info(priv, priv->band, | 760 | ch_info = iwl_get_channel_info(priv, priv->band, |
761 | le16_to_cpu(priv->staging_rxon.channel)); | 761 | le16_to_cpu(priv->active_rxon.channel)); |
762 | 762 | ||
763 | if (!ch_info) | 763 | if (!ch_info) |
764 | ch_info = &priv->channel_info[0]; | 764 | ch_info = &priv->channel_info[0]; |
@@ -794,9 +794,6 @@ static int iwl4965_set_mode(struct iwl_priv *priv, int mode) | |||
794 | { | 794 | { |
795 | priv->iw_mode = mode; | 795 | priv->iw_mode = mode; |
796 | 796 | ||
797 | /* init channel/phymode to values given at driver init */ | ||
798 | iwl_set_rxon_channel(priv, IEEE80211_BAND_2GHZ, 6); | ||
799 | |||
800 | iwl4965_connection_init_rx_config(priv); | 797 | iwl4965_connection_init_rx_config(priv); |
801 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); | 798 | memcpy(priv->staging_rxon.node_addr, priv->mac_addr, ETH_ALEN); |
802 | 799 | ||
@@ -3025,26 +3022,18 @@ static void iwl4965_configure_filter(struct ieee80211_hw *hw, | |||
3025 | unsigned int *total_flags, | 3022 | unsigned int *total_flags, |
3026 | int mc_count, struct dev_addr_list *mc_list) | 3023 | int mc_count, struct dev_addr_list *mc_list) |
3027 | { | 3024 | { |
3028 | /* | ||
3029 | * XXX: dummy | ||
3030 | * see also iwl4965_connection_init_rx_config | ||
3031 | */ | ||
3032 | struct iwl_priv *priv = hw->priv; | 3025 | struct iwl_priv *priv = hw->priv; |
3033 | int new_flags = 0; | 3026 | |
3034 | if (changed_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { | 3027 | if (changed_flags & (*total_flags) & FIF_OTHER_BSS) { |
3035 | if (*total_flags & (FIF_PROMISC_IN_BSS | FIF_OTHER_BSS)) { | 3028 | IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", |
3036 | IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", | 3029 | IEEE80211_IF_TYPE_MNTR, |
3037 | IEEE80211_IF_TYPE_MNTR, | 3030 | changed_flags, *total_flags); |
3038 | changed_flags, *total_flags); | 3031 | /* queue work 'cuz mac80211 is holding a lock which |
3039 | /* queue work 'cuz mac80211 is holding a lock which | 3032 | * prevents us from issuing (synchronous) f/w cmds */ |
3040 | * prevents us from issuing (synchronous) f/w cmds */ | 3033 | queue_work(priv->workqueue, &priv->set_monitor); |
3041 | queue_work(priv->workqueue, &priv->set_monitor); | ||
3042 | new_flags &= FIF_PROMISC_IN_BSS | | ||
3043 | FIF_OTHER_BSS | | ||
3044 | FIF_ALLMULTI; | ||
3045 | } | ||
3046 | } | 3034 | } |
3047 | *total_flags = new_flags; | 3035 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | |
3036 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; | ||
3048 | } | 3037 | } |
3049 | 3038 | ||
3050 | static void iwl4965_mac_remove_interface(struct ieee80211_hw *hw, | 3039 | static void iwl4965_mac_remove_interface(struct ieee80211_hw *hw, |