Commit 8b8ab9d5 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

iwlwifi: fix 3945 filter flags

Applying the filter flags directly as done since

commit 3474ad63
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Thu Apr 29 04:43:05 2010 -0700

    iwlwifi: apply filter flags directly

broke 3945 under some unknown circumstances, as
reported by Alex.

Since I want to keep the direct application of
filter flags on iwlagn, duplicate the code into
both 3945 and agn and remove committing the
RXON that broke things from the 3945 version.

Cc: stable@kernel.org [2.6.35]
Reported-by: default avatarAlex Romosan <romosan@sycorax.lbl.gov>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c206a04f
...@@ -3667,6 +3667,49 @@ static void iwl_mac_channel_switch(struct ieee80211_hw *hw, ...@@ -3667,6 +3667,49 @@ static void iwl_mac_channel_switch(struct ieee80211_hw *hw,
IWL_DEBUG_MAC80211(priv, "leave\n"); IWL_DEBUG_MAC80211(priv, "leave\n");
} }
static void iwlagn_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags,
u64 multicast)
{
struct iwl_priv *priv = hw->priv;
__le32 filter_or = 0, filter_nand = 0;
#define CHK(test, flag) do { \
if (*total_flags & (test)) \
filter_or |= (flag); \
else \
filter_nand |= (flag); \
} while (0)
IWL_DEBUG_MAC80211(priv, "Enter: changed: 0x%x, total: 0x%x\n",
changed_flags, *total_flags);
CHK(FIF_OTHER_BSS | FIF_PROMISC_IN_BSS, RXON_FILTER_PROMISC_MSK);
CHK(FIF_CONTROL, RXON_FILTER_CTL2HOST_MSK);
CHK(FIF_BCN_PRBRESP_PROMISC, RXON_FILTER_BCON_AWARE_MSK);
#undef CHK
mutex_lock(&priv->mutex);
priv->staging_rxon.filter_flags &= ~filter_nand;
priv->staging_rxon.filter_flags |= filter_or;
iwlcore_commit_rxon(priv);
mutex_unlock(&priv->mutex);
/*
* Receiving all multicast frames is always enabled by the
* default flags setup in iwl_connection_init_rx_config()
* since we currently do not support programming multicast
* filters into the device.
*/
*total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | FIF_PROMISC_IN_BSS |
FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL;
}
static void iwl_mac_flush(struct ieee80211_hw *hw, bool drop) static void iwl_mac_flush(struct ieee80211_hw *hw, bool drop)
{ {
struct iwl_priv *priv = hw->priv; struct iwl_priv *priv = hw->priv;
...@@ -3867,7 +3910,7 @@ static struct ieee80211_ops iwl_hw_ops = { ...@@ -3867,7 +3910,7 @@ static struct ieee80211_ops iwl_hw_ops = {
.add_interface = iwl_mac_add_interface, .add_interface = iwl_mac_add_interface,
.remove_interface = iwl_mac_remove_interface, .remove_interface = iwl_mac_remove_interface,
.config = iwl_mac_config, .config = iwl_mac_config,
.configure_filter = iwl_configure_filter, .configure_filter = iwlagn_configure_filter,
.set_key = iwl_mac_set_key, .set_key = iwl_mac_set_key,
.update_tkip_key = iwl_mac_update_tkip_key, .update_tkip_key = iwl_mac_update_tkip_key,
.conf_tx = iwl_mac_conf_tx, .conf_tx = iwl_mac_conf_tx,
......
...@@ -1328,51 +1328,6 @@ int iwl_apm_init(struct iwl_priv *priv) ...@@ -1328,51 +1328,6 @@ int iwl_apm_init(struct iwl_priv *priv)
EXPORT_SYMBOL(iwl_apm_init); EXPORT_SYMBOL(iwl_apm_init);
void iwl_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags,
u64 multicast)
{
struct iwl_priv *priv = hw->priv;
__le32 filter_or = 0, filter_nand = 0;
#define CHK(test, flag) do { \
if (*total_flags & (test)) \
filter_or |= (flag); \
else \
filter_nand |= (flag); \
} while (0)
IWL_DEBUG_MAC80211(priv, "Enter: changed: 0x%x, total: 0x%x\n",
changed_flags, *total_flags);
CHK(FIF_OTHER_BSS | FIF_PROMISC_IN_BSS, RXON_FILTER_PROMISC_MSK);
CHK(FIF_CONTROL, RXON_FILTER_CTL2HOST_MSK);
CHK(FIF_BCN_PRBRESP_PROMISC, RXON_FILTER_BCON_AWARE_MSK);
#undef CHK
mutex_lock(&priv->mutex);
priv->staging_rxon.filter_flags &= ~filter_nand;
priv->staging_rxon.filter_flags |= filter_or;
iwlcore_commit_rxon(priv);
mutex_unlock(&priv->mutex);
/*
* Receiving all multicast frames is always enabled by the
* default flags setup in iwl_connection_init_rx_config()
* since we currently do not support programming multicast
* filters into the device.
*/
*total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | FIF_PROMISC_IN_BSS |
FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL;
}
EXPORT_SYMBOL(iwl_configure_filter);
int iwl_set_hw_params(struct iwl_priv *priv) int iwl_set_hw_params(struct iwl_priv *priv)
{ {
priv->hw_params.max_rxq_size = RX_QUEUE_SIZE; priv->hw_params.max_rxq_size = RX_QUEUE_SIZE;
......
...@@ -372,9 +372,6 @@ int iwl_set_decrypted_flag(struct iwl_priv *priv, ...@@ -372,9 +372,6 @@ int iwl_set_decrypted_flag(struct iwl_priv *priv,
u32 decrypt_res, u32 decrypt_res,
struct ieee80211_rx_status *stats); struct ieee80211_rx_status *stats);
void iwl_irq_handle_error(struct iwl_priv *priv); void iwl_irq_handle_error(struct iwl_priv *priv);
void iwl_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags, u64 multicast);
int iwl_set_hw_params(struct iwl_priv *priv); int iwl_set_hw_params(struct iwl_priv *priv);
void iwl_post_associate(struct iwl_priv *priv, struct ieee80211_vif *vif); void iwl_post_associate(struct iwl_priv *priv, struct ieee80211_vif *vif);
void iwl_bss_info_changed(struct ieee80211_hw *hw, void iwl_bss_info_changed(struct ieee80211_hw *hw,
......
...@@ -3391,6 +3391,55 @@ static int iwl3945_mac_sta_add(struct ieee80211_hw *hw, ...@@ -3391,6 +3391,55 @@ static int iwl3945_mac_sta_add(struct ieee80211_hw *hw,
return 0; return 0;
} }
static void iwl3945_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags,
u64 multicast)
{
struct iwl_priv *priv = hw->priv;
__le32 filter_or = 0, filter_nand = 0;
#define CHK(test, flag) do { \
if (*total_flags & (test)) \
filter_or |= (flag); \
else \
filter_nand |= (flag); \
} while (0)
IWL_DEBUG_MAC80211(priv, "Enter: changed: 0x%x, total: 0x%x\n",
changed_flags, *total_flags);
CHK(FIF_OTHER_BSS | FIF_PROMISC_IN_BSS, RXON_FILTER_PROMISC_MSK);
CHK(FIF_CONTROL, RXON_FILTER_CTL2HOST_MSK);
CHK(FIF_BCN_PRBRESP_PROMISC, RXON_FILTER_BCON_AWARE_MSK);
#undef CHK
mutex_lock(&priv->mutex);
priv->staging_rxon.filter_flags &= ~filter_nand;
priv->staging_rxon.filter_flags |= filter_or;
/*
* Committing directly here breaks for some reason,
* but we'll eventually commit the filter flags
* change anyway.
*/
mutex_unlock(&priv->mutex);
/*
* Receiving all multicast frames is always enabled by the
* default flags setup in iwl_connection_init_rx_config()
* since we currently do not support programming multicast
* filters into the device.
*/
*total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | FIF_PROMISC_IN_BSS |
FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL;
}
/***************************************************************************** /*****************************************************************************
* *
* sysfs attributes * sysfs attributes
...@@ -3796,7 +3845,7 @@ static struct ieee80211_ops iwl3945_hw_ops = { ...@@ -3796,7 +3845,7 @@ static struct ieee80211_ops iwl3945_hw_ops = {
.add_interface = iwl_mac_add_interface, .add_interface = iwl_mac_add_interface,
.remove_interface = iwl_mac_remove_interface, .remove_interface = iwl_mac_remove_interface,
.config = iwl_mac_config, .config = iwl_mac_config,
.configure_filter = iwl_configure_filter, .configure_filter = iwl3945_configure_filter,
.set_key = iwl3945_mac_set_key, .set_key = iwl3945_mac_set_key,
.conf_tx = iwl_mac_conf_tx, .conf_tx = iwl_mac_conf_tx,
.reset_tsf = iwl_mac_reset_tsf, .reset_tsf = iwl_mac_reset_tsf,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment