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/iwl-agn.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/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index e971a893eec8..c8ce84a1eef4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2224,27 +2224,6 @@ static void iwl_bg_rf_kill(struct work_struct *work) | |||
2224 | iwl_rfkill_set_hw_state(priv); | 2224 | iwl_rfkill_set_hw_state(priv); |
2225 | } | 2225 | } |
2226 | 2226 | ||
2227 | static void iwl_bg_set_monitor(struct work_struct *work) | ||
2228 | { | ||
2229 | struct iwl_priv *priv = container_of(work, | ||
2230 | struct iwl_priv, set_monitor); | ||
2231 | int ret; | ||
2232 | |||
2233 | IWL_DEBUG(IWL_DL_STATE, "setting monitor mode\n"); | ||
2234 | |||
2235 | mutex_lock(&priv->mutex); | ||
2236 | |||
2237 | ret = iwl_set_mode(priv, NL80211_IFTYPE_MONITOR); | ||
2238 | if (ret) { | ||
2239 | if (ret == -EAGAIN) | ||
2240 | IWL_DEBUG(IWL_DL_STATE, "leave - not ready\n"); | ||
2241 | else | ||
2242 | IWL_ERROR("iwl_set_mode() failed ret = %d\n", ret); | ||
2243 | } | ||
2244 | |||
2245 | mutex_unlock(&priv->mutex); | ||
2246 | } | ||
2247 | |||
2248 | static void iwl_bg_run_time_calib_work(struct work_struct *work) | 2227 | static void iwl_bg_run_time_calib_work(struct work_struct *work) |
2249 | { | 2228 | { |
2250 | struct iwl_priv *priv = container_of(work, struct iwl_priv, | 2229 | struct iwl_priv *priv = container_of(work, struct iwl_priv, |
@@ -2890,16 +2869,43 @@ static void iwl_configure_filter(struct ieee80211_hw *hw, | |||
2890 | int mc_count, struct dev_addr_list *mc_list) | 2869 | int mc_count, struct dev_addr_list *mc_list) |
2891 | { | 2870 | { |
2892 | struct iwl_priv *priv = hw->priv; | 2871 | struct iwl_priv *priv = hw->priv; |
2872 | __le32 *filter_flags = &priv->staging_rxon.filter_flags; | ||
2873 | |||
2874 | IWL_DEBUG_MAC80211("Enter: changed: 0x%x, total: 0x%x\n", | ||
2875 | changed_flags, *total_flags); | ||
2893 | 2876 | ||
2894 | if (changed_flags & (*total_flags) & FIF_OTHER_BSS) { | 2877 | if (changed_flags & (FIF_OTHER_BSS | FIF_PROMISC_IN_BSS)) { |
2895 | IWL_DEBUG_MAC80211("Enter: type %d (0x%x, 0x%x)\n", | 2878 | if (*total_flags & (FIF_OTHER_BSS | FIF_PROMISC_IN_BSS)) |
2896 | NL80211_IFTYPE_MONITOR, | 2879 | *filter_flags |= RXON_FILTER_PROMISC_MSK; |
2897 | changed_flags, *total_flags); | 2880 | else |
2898 | /* queue work 'cuz mac80211 is holding a lock which | 2881 | *filter_flags &= ~RXON_FILTER_PROMISC_MSK; |
2899 | * prevents us from issuing (synchronous) f/w cmds */ | 2882 | } |
2900 | queue_work(priv->workqueue, &priv->set_monitor); | 2883 | if (changed_flags & FIF_ALLMULTI) { |
2884 | if (*total_flags & FIF_ALLMULTI) | ||
2885 | *filter_flags |= RXON_FILTER_ACCEPT_GRP_MSK; | ||
2886 | else | ||
2887 | *filter_flags &= ~RXON_FILTER_ACCEPT_GRP_MSK; | ||
2888 | } | ||
2889 | if (changed_flags & FIF_CONTROL) { | ||
2890 | if (*total_flags & FIF_CONTROL) | ||
2891 | *filter_flags |= RXON_FILTER_CTL2HOST_MSK; | ||
2892 | else | ||
2893 | *filter_flags &= ~RXON_FILTER_CTL2HOST_MSK; | ||
2894 | } | ||
2895 | if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { | ||
2896 | if (*total_flags & FIF_BCN_PRBRESP_PROMISC) | ||
2897 | *filter_flags |= RXON_FILTER_BCON_AWARE_MSK; | ||
2898 | else | ||
2899 | *filter_flags &= ~RXON_FILTER_BCON_AWARE_MSK; | ||
2901 | } | 2900 | } |
2902 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | | 2901 | |
2902 | /* We avoid iwl_commit_rxon here to commit the new filter flags | ||
2903 | * since mac80211 will call ieee80211_hw_config immediately. | ||
2904 | * (mc_list is not supported at this time). Otherwise, we need to | ||
2905 | * queue a background iwl_commit_rxon work. | ||
2906 | */ | ||
2907 | |||
2908 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | FIF_PROMISC_IN_BSS | | ||
2903 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; | 2909 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; |
2904 | } | 2910 | } |
2905 | 2911 | ||
@@ -3796,7 +3802,6 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv) | |||
3796 | INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish); | 3802 | INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish); |
3797 | INIT_WORK(&priv->rf_kill, iwl_bg_rf_kill); | 3803 | INIT_WORK(&priv->rf_kill, iwl_bg_rf_kill); |
3798 | INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update); | 3804 | INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update); |
3799 | INIT_WORK(&priv->set_monitor, iwl_bg_set_monitor); | ||
3800 | INIT_WORK(&priv->run_time_calib_work, iwl_bg_run_time_calib_work); | 3805 | INIT_WORK(&priv->run_time_calib_work, iwl_bg_run_time_calib_work); |
3801 | INIT_DELAYED_WORK(&priv->init_alive_start, iwl_bg_init_alive_start); | 3806 | INIT_DELAYED_WORK(&priv->init_alive_start, iwl_bg_init_alive_start); |
3802 | INIT_DELAYED_WORK(&priv->alive_start, iwl_bg_alive_start); | 3807 | INIT_DELAYED_WORK(&priv->alive_start, iwl_bg_alive_start); |