diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 52 |
1 files changed, 22 insertions, 30 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 5c6f25462a09..246538a27fc6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1257,41 +1257,33 @@ void iwl_configure_filter(struct ieee80211_hw *hw, | |||
1257 | u64 multicast) | 1257 | u64 multicast) |
1258 | { | 1258 | { |
1259 | struct iwl_priv *priv = hw->priv; | 1259 | struct iwl_priv *priv = hw->priv; |
1260 | __le32 *filter_flags = &priv->staging_rxon.filter_flags; | 1260 | __le32 filter_or = 0, filter_nand = 0; |
1261 | |||
1262 | #define CHK(test, flag) do { \ | ||
1263 | if (*total_flags & (test)) \ | ||
1264 | filter_or |= (flag); \ | ||
1265 | else \ | ||
1266 | filter_nand |= (flag); \ | ||
1267 | } while (0) | ||
1261 | 1268 | ||
1262 | IWL_DEBUG_MAC80211(priv, "Enter: changed: 0x%x, total: 0x%x\n", | 1269 | IWL_DEBUG_MAC80211(priv, "Enter: changed: 0x%x, total: 0x%x\n", |
1263 | changed_flags, *total_flags); | 1270 | changed_flags, *total_flags); |
1264 | 1271 | ||
1265 | if (changed_flags & (FIF_OTHER_BSS | FIF_PROMISC_IN_BSS)) { | 1272 | CHK(FIF_OTHER_BSS | FIF_PROMISC_IN_BSS, RXON_FILTER_PROMISC_MSK); |
1266 | if (*total_flags & (FIF_OTHER_BSS | FIF_PROMISC_IN_BSS)) | 1273 | CHK(FIF_ALLMULTI, RXON_FILTER_ACCEPT_GRP_MSK); |
1267 | *filter_flags |= RXON_FILTER_PROMISC_MSK; | 1274 | CHK(FIF_CONTROL, RXON_FILTER_CTL2HOST_MSK); |
1268 | else | 1275 | CHK(FIF_BCN_PRBRESP_PROMISC, RXON_FILTER_BCON_AWARE_MSK); |
1269 | *filter_flags &= ~RXON_FILTER_PROMISC_MSK; | ||
1270 | } | ||
1271 | if (changed_flags & FIF_ALLMULTI) { | ||
1272 | if (*total_flags & FIF_ALLMULTI) | ||
1273 | *filter_flags |= RXON_FILTER_ACCEPT_GRP_MSK; | ||
1274 | else | ||
1275 | *filter_flags &= ~RXON_FILTER_ACCEPT_GRP_MSK; | ||
1276 | } | ||
1277 | if (changed_flags & FIF_CONTROL) { | ||
1278 | if (*total_flags & FIF_CONTROL) | ||
1279 | *filter_flags |= RXON_FILTER_CTL2HOST_MSK; | ||
1280 | else | ||
1281 | *filter_flags &= ~RXON_FILTER_CTL2HOST_MSK; | ||
1282 | } | ||
1283 | if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { | ||
1284 | if (*total_flags & FIF_BCN_PRBRESP_PROMISC) | ||
1285 | *filter_flags |= RXON_FILTER_BCON_AWARE_MSK; | ||
1286 | else | ||
1287 | *filter_flags &= ~RXON_FILTER_BCON_AWARE_MSK; | ||
1288 | } | ||
1289 | 1276 | ||
1290 | /* We avoid iwl_commit_rxon here to commit the new filter flags | 1277 | #undef CHK |
1291 | * since mac80211 will call ieee80211_hw_config immediately. | 1278 | |
1292 | * (mc_list is not supported at this time). Otherwise, we need to | 1279 | mutex_lock(&priv->mutex); |
1293 | * queue a background iwl_commit_rxon work. | 1280 | |
1294 | */ | 1281 | priv->staging_rxon.filter_flags &= ~filter_nand; |
1282 | priv->staging_rxon.filter_flags |= filter_or; | ||
1283 | |||
1284 | iwlcore_commit_rxon(priv); | ||
1285 | |||
1286 | mutex_unlock(&priv->mutex); | ||
1295 | 1287 | ||
1296 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | FIF_PROMISC_IN_BSS | | 1288 | *total_flags &= FIF_OTHER_BSS | FIF_ALLMULTI | FIF_PROMISC_IN_BSS | |
1297 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; | 1289 | FIF_BCN_PRBRESP_PROMISC | FIF_CONTROL; |