diff options
-rw-r--r-- | include/net/mac80211.h | 8 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 2 | ||||
-rw-r--r-- | net/mac80211/iface.c | 18 | ||||
-rw-r--r-- | net/mac80211/main.c | 3 |
4 files changed, 26 insertions, 5 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 5ed93f4406a8..e2fb5767e1fa 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1244,10 +1244,13 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
1244 | * mac80211 needs to do and the amount of CPU wakeups, so you should | 1244 | * mac80211 needs to do and the amount of CPU wakeups, so you should |
1245 | * honour this flag if possible. | 1245 | * honour this flag if possible. |
1246 | * | 1246 | * |
1247 | * @FIF_CONTROL: pass control frames, if PROMISC_IN_BSS is not set then | 1247 | * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS |
1248 | * only those addressed to this station | 1248 | * is not set then only those addressed to this station. |
1249 | * | 1249 | * |
1250 | * @FIF_OTHER_BSS: pass frames destined to other BSSes | 1250 | * @FIF_OTHER_BSS: pass frames destined to other BSSes |
1251 | * | ||
1252 | * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only | ||
1253 | * those addressed to this station. | ||
1251 | */ | 1254 | */ |
1252 | enum ieee80211_filter_flags { | 1255 | enum ieee80211_filter_flags { |
1253 | FIF_PROMISC_IN_BSS = 1<<0, | 1256 | FIF_PROMISC_IN_BSS = 1<<0, |
@@ -1257,6 +1260,7 @@ enum ieee80211_filter_flags { | |||
1257 | FIF_BCN_PRBRESP_PROMISC = 1<<4, | 1260 | FIF_BCN_PRBRESP_PROMISC = 1<<4, |
1258 | FIF_CONTROL = 1<<5, | 1261 | FIF_CONTROL = 1<<5, |
1259 | FIF_OTHER_BSS = 1<<6, | 1262 | FIF_OTHER_BSS = 1<<6, |
1263 | FIF_PSPOLL = 1<<7, | ||
1260 | }; | 1264 | }; |
1261 | 1265 | ||
1262 | /** | 1266 | /** |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 8d790e40f3e9..630a438180fd 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -628,7 +628,7 @@ struct ieee80211_local { | |||
628 | int open_count; | 628 | int open_count; |
629 | int monitors, cooked_mntrs; | 629 | int monitors, cooked_mntrs; |
630 | /* number of interfaces with corresponding FIF_ flags */ | 630 | /* number of interfaces with corresponding FIF_ flags */ |
631 | int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss; | 631 | int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll; |
632 | unsigned int filter_flags; /* FIF_* */ | 632 | unsigned int filter_flags; /* FIF_* */ |
633 | struct iw_statistics wstats; | 633 | struct iw_statistics wstats; |
634 | 634 | ||
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 8c1284d45e69..e8fb03b91a44 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -220,8 +220,10 @@ static int ieee80211_open(struct net_device *dev) | |||
220 | local->fif_fcsfail++; | 220 | local->fif_fcsfail++; |
221 | if (sdata->u.mntr_flags & MONITOR_FLAG_PLCPFAIL) | 221 | if (sdata->u.mntr_flags & MONITOR_FLAG_PLCPFAIL) |
222 | local->fif_plcpfail++; | 222 | local->fif_plcpfail++; |
223 | if (sdata->u.mntr_flags & MONITOR_FLAG_CONTROL) | 223 | if (sdata->u.mntr_flags & MONITOR_FLAG_CONTROL) { |
224 | local->fif_control++; | 224 | local->fif_control++; |
225 | local->fif_pspoll++; | ||
226 | } | ||
225 | if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS) | 227 | if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS) |
226 | local->fif_other_bss++; | 228 | local->fif_other_bss++; |
227 | 229 | ||
@@ -244,7 +246,14 @@ static int ieee80211_open(struct net_device *dev) | |||
244 | spin_unlock_bh(&local->filter_lock); | 246 | spin_unlock_bh(&local->filter_lock); |
245 | 247 | ||
246 | ieee80211_start_mesh(sdata); | 248 | ieee80211_start_mesh(sdata); |
249 | } else if (sdata->vif.type == NL80211_IFTYPE_AP) { | ||
250 | local->fif_pspoll++; | ||
251 | |||
252 | spin_lock_bh(&local->filter_lock); | ||
253 | ieee80211_configure_filter(local); | ||
254 | spin_unlock_bh(&local->filter_lock); | ||
247 | } | 255 | } |
256 | |||
248 | changed |= ieee80211_reset_erp_info(sdata); | 257 | changed |= ieee80211_reset_erp_info(sdata); |
249 | ieee80211_bss_info_change_notify(sdata, changed); | 258 | ieee80211_bss_info_change_notify(sdata, changed); |
250 | ieee80211_enable_keys(sdata); | 259 | ieee80211_enable_keys(sdata); |
@@ -388,6 +397,9 @@ static int ieee80211_stop(struct net_device *dev) | |||
388 | if (sdata->flags & IEEE80211_SDATA_PROMISC) | 397 | if (sdata->flags & IEEE80211_SDATA_PROMISC) |
389 | atomic_dec(&local->iff_promiscs); | 398 | atomic_dec(&local->iff_promiscs); |
390 | 399 | ||
400 | if (sdata->vif.type == NL80211_IFTYPE_AP) | ||
401 | local->fif_pspoll--; | ||
402 | |||
391 | netif_addr_lock_bh(dev); | 403 | netif_addr_lock_bh(dev); |
392 | spin_lock_bh(&local->filter_lock); | 404 | spin_lock_bh(&local->filter_lock); |
393 | __dev_addr_unsync(&local->mc_list, &local->mc_count, | 405 | __dev_addr_unsync(&local->mc_list, &local->mc_count, |
@@ -439,8 +451,10 @@ static int ieee80211_stop(struct net_device *dev) | |||
439 | local->fif_fcsfail--; | 451 | local->fif_fcsfail--; |
440 | if (sdata->u.mntr_flags & MONITOR_FLAG_PLCPFAIL) | 452 | if (sdata->u.mntr_flags & MONITOR_FLAG_PLCPFAIL) |
441 | local->fif_plcpfail--; | 453 | local->fif_plcpfail--; |
442 | if (sdata->u.mntr_flags & MONITOR_FLAG_CONTROL) | 454 | if (sdata->u.mntr_flags & MONITOR_FLAG_CONTROL) { |
455 | local->fif_pspoll--; | ||
443 | local->fif_control--; | 456 | local->fif_control--; |
457 | } | ||
444 | if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS) | 458 | if (sdata->u.mntr_flags & MONITOR_FLAG_OTHER_BSS) |
445 | local->fif_other_bss--; | 459 | local->fif_other_bss--; |
446 | 460 | ||
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 22e07385ff60..0c4f8e122ed6 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -77,6 +77,9 @@ void ieee80211_configure_filter(struct ieee80211_local *local) | |||
77 | if (local->fif_other_bss) | 77 | if (local->fif_other_bss) |
78 | new_flags |= FIF_OTHER_BSS; | 78 | new_flags |= FIF_OTHER_BSS; |
79 | 79 | ||
80 | if (local->fif_pspoll) | ||
81 | new_flags |= FIF_PSPOLL; | ||
82 | |||
80 | changed_flags = local->filter_flags ^ new_flags; | 83 | changed_flags = local->filter_flags ^ new_flags; |
81 | 84 | ||
82 | /* be a bit nasty */ | 85 | /* be a bit nasty */ |