diff options
author | Zhu, Yi <yi.zhu@intel.com> | 2008-11-12 16:14:09 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-25 16:41:19 -0500 |
commit | 352bc8de19a7e5e065d422825e226e8e80cd6576 (patch) | |
tree | 2f7a1d2184d8a04ee9dafdd97b24262225320192 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | c3056065400aeb437390e1a86b85f9c32fb1c1df (diff) |
iwlwifi: configure_filter rewrite
The patch rewrites the mac80211 configure_filter handler to better mapping
mac80211 filter flags to iwlwifi hardware filter flags. We now can support
5 mac80211 filter flags: FIF_OTHER_BSS, FIF_ALLMULTI, FIF_PROMISC_IN_BSS,
FIF_BCN_PRBRESP_PROMISC and FIF_CONTROL. This patch also avoids reconnecting
if the filter flags are changed when the STA is associated. Because rx_assoc
is used when full rxon is not necessary.
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index baa0d6c59d20..beba6e3cfbfd 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -5996,24 +5996,6 @@ static void iwl3945_bg_rf_kill(struct work_struct *work) | |||
5996 | iwl3945_rfkill_set_hw_state(priv); | 5996 | iwl3945_rfkill_set_hw_state(priv); |
5997 | } | 5997 | } |
5998 | 5998 | ||
5999 | static void iwl3945_bg_set_monitor(struct work_struct *work) | ||
6000 | { | ||
6001 | struct iwl3945_priv *priv = container_of(work, | ||
6002 | struct iwl3945_priv, set_monitor); | ||
6003 | |||
6004 | IWL_DEBUG(IWL_DL_STATE, "setting monitor mode\n"); | ||
6005 | |||
6006 | mutex_lock(&priv->mutex); | ||
6007 | |||
6008 | if (!iwl3945_is_ready(priv)) | ||
6009 | IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n"); | ||
6010 | else | ||
6011 | if (iwl3945_set_mode(priv, NL80211_IFTYPE_MONITOR) != 0) | ||
6012 | IWL_ERROR("iwl3945_set_mode() failed\n"); | ||
6013 | |||
6014 | mutex_unlock(&priv->mutex); | ||
6015 | } | ||
6016 | |||
6017 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) | 5999 | #define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) |
6018 | 6000 | ||
6019 | static void iwl3945_bg_scan_check(struct work_struct *data) | 6001 | static void iwl3945_bg_scan_check(struct work_struct *data) |
@@ -6830,16 +6812,43 @@ static void iwl3945_configure_filter(struct ieee80211_hw *hw, | |||
6830 | int mc_count, struct dev_addr_list *mc_list) | 6812 | int mc_count, struct dev_addr_list *mc_list) |
6831 | { | 6813 | { |
6832 | struct iwl3945_priv *priv = hw->priv; | 6814 | struct iwl3945_priv *priv = hw->priv; |
6815 | __le32 *filter_flags = &priv->staging_rxon.filter_flags; | ||
6833 | 6816 | ||
6834 | if (changed_flags & (*total_flags) & FIF_OTHER_BSS) { | 6817 | IWL_DEBUG_MAC80211("Enter: changed: 0x%x, total: 0x%x\n", |
6835 | IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", | 6818 | changed_flags, *total_flags); |
6836 | NL80211_IFTYPE_MONITOR, | 6819 | |
6837 | changed_flags, *total_flags); | 6820 | if (changed_flags & (FIF_OTHER_BSS | FIF_PROMISC_IN_BSS)) { |
6838 | /* queue work 'cuz mac80211 is holding a lock which | 6821 | if (*total_flags & (FIF_OTHER_BSS | FIF_PROMISC_IN_BSS)) |
6839 | * prevents us from issuing (synchronous) f/w cmds */ | 6822 | *filter_flags |= RXON_FILTER_PROMISC_MSK; |
6840 | queue_work(priv->workqueue, &priv->set_monitor); | 6823 | else |
6824 | *filter_flags &= ~RXON_FILTER_PROMISC_MSK; | ||
6825 | } | ||
6826 | if (changed_flags & FIF_ALLMULTI) { | ||
6827 | if (*total_flags & FIF_ALLMULTI) | ||
6828 | *filter_flags |= RXON_FILTER_ACCEPT_GRP_MSK; | ||
6829 | else | ||
6830 | *filter_flags &= ~RXON_FILTER_ACCEPT_GRP_MSK; | ||
6831 | } | ||
6832 | if (changed_flags & FIF_CONTROL) { | ||
6833 | if (*total_flags & FIF_CONTROL) | ||
6834 | *filter_flags |= RXON_FILTER_CTL2HOST_MSK; | ||
6835 | else | ||
6836 | *filter_flags &= ~RXON_FILTER_CTL2HOST_MSK; | ||
6841 | } | 6837 | } |
6842 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | | 6838 | if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { |
6839 | if (*total_flags & FIF_BCN_PRBRESP_PROMISC) | ||
6840 | *filter_flags |= RXON_FILTER_BCON_AWARE_MSK; | ||
6841 | else | ||
6842 | *filter_flags &= ~RXON_FILTER_BCON_AWARE_MSK; | ||
6843 | } | ||
6844 | |||
6845 | /* We avoid iwl_commit_rxon here to commit the new filter flags | ||
6846 | * since mac80211 will call ieee80211_hw_config immediately. | ||
6847 | * (mc_list is not supported at this time). Otherwise, we need to | ||
6848 | * queue a background iwl_commit_rxon work. | ||
6849 | */ | ||
6850 | |||
6851 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | FIF_PROMISC_IN_BSS | | ||
6843 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; | 6852 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; |
6844 | } | 6853 | } |
6845 | 6854 | ||
@@ -7715,7 +7724,6 @@ static void iwl3945_setup_deferred_work(struct iwl3945_priv *priv) | |||
7715 | INIT_WORK(&priv->abort_scan, iwl3945_bg_abort_scan); | 7724 | INIT_WORK(&priv->abort_scan, iwl3945_bg_abort_scan); |
7716 | INIT_WORK(&priv->rf_kill, iwl3945_bg_rf_kill); | 7725 | INIT_WORK(&priv->rf_kill, iwl3945_bg_rf_kill); |
7717 | INIT_WORK(&priv->beacon_update, iwl3945_bg_beacon_update); | 7726 | INIT_WORK(&priv->beacon_update, iwl3945_bg_beacon_update); |
7718 | INIT_WORK(&priv->set_monitor, iwl3945_bg_set_monitor); | ||
7719 | INIT_DELAYED_WORK(&priv->init_alive_start, iwl3945_bg_init_alive_start); | 7727 | INIT_DELAYED_WORK(&priv->init_alive_start, iwl3945_bg_init_alive_start); |
7720 | INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start); | 7728 | INIT_DELAYED_WORK(&priv->alive_start, iwl3945_bg_alive_start); |
7721 | INIT_DELAYED_WORK(&priv->scan_check, iwl3945_bg_scan_check); | 7729 | INIT_DELAYED_WORK(&priv->scan_check, iwl3945_bg_scan_check); |