diff options
Diffstat (limited to 'net/mac80211/iface.c')
| -rw-r--r-- | net/mac80211/iface.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 09a80b55cf5a..8be854e86cd9 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
| @@ -207,17 +207,8 @@ void ieee80211_recalc_idle(struct ieee80211_local *local) | |||
| 207 | 207 | ||
| 208 | static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) | 208 | static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) |
| 209 | { | 209 | { |
| 210 | int meshhdrlen; | 210 | if (new_mtu < 256 || new_mtu > IEEE80211_MAX_DATA_LEN) |
| 211 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
| 212 | |||
| 213 | meshhdrlen = (sdata->vif.type == NL80211_IFTYPE_MESH_POINT) ? 5 : 0; | ||
| 214 | |||
| 215 | /* FIX: what would be proper limits for MTU? | ||
| 216 | * This interface uses 802.3 frames. */ | ||
| 217 | if (new_mtu < 256 || | ||
| 218 | new_mtu > IEEE80211_MAX_DATA_LEN - 24 - 6 - meshhdrlen) { | ||
| 219 | return -EINVAL; | 211 | return -EINVAL; |
| 220 | } | ||
| 221 | 212 | ||
| 222 | dev->mtu = new_mtu; | 213 | dev->mtu = new_mtu; |
| 223 | return 0; | 214 | return 0; |
| @@ -586,11 +577,13 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up) | |||
| 586 | 577 | ||
| 587 | switch (sdata->vif.type) { | 578 | switch (sdata->vif.type) { |
| 588 | case NL80211_IFTYPE_AP_VLAN: | 579 | case NL80211_IFTYPE_AP_VLAN: |
| 589 | /* no need to tell driver, but set carrier */ | 580 | /* no need to tell driver, but set carrier and chanctx */ |
| 590 | if (rtnl_dereference(sdata->bss->beacon)) | 581 | if (rtnl_dereference(sdata->bss->beacon)) { |
| 582 | ieee80211_vif_vlan_copy_chanctx(sdata); | ||
| 591 | netif_carrier_on(dev); | 583 | netif_carrier_on(dev); |
| 592 | else | 584 | } else { |
| 593 | netif_carrier_off(dev); | 585 | netif_carrier_off(dev); |
| 586 | } | ||
| 594 | break; | 587 | break; |
| 595 | case NL80211_IFTYPE_MONITOR: | 588 | case NL80211_IFTYPE_MONITOR: |
| 596 | if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) { | 589 | if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) { |
| @@ -839,6 +832,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, | |||
| 839 | switch (sdata->vif.type) { | 832 | switch (sdata->vif.type) { |
| 840 | case NL80211_IFTYPE_AP_VLAN: | 833 | case NL80211_IFTYPE_AP_VLAN: |
| 841 | list_del(&sdata->u.vlan.list); | 834 | list_del(&sdata->u.vlan.list); |
| 835 | rcu_assign_pointer(sdata->vif.chanctx_conf, NULL); | ||
| 842 | /* no need to tell driver */ | 836 | /* no need to tell driver */ |
| 843 | break; | 837 | break; |
| 844 | case NL80211_IFTYPE_MONITOR: | 838 | case NL80211_IFTYPE_MONITOR: |
| @@ -865,20 +859,11 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, | |||
| 865 | cancel_work_sync(&sdata->work); | 859 | cancel_work_sync(&sdata->work); |
| 866 | /* | 860 | /* |
| 867 | * When we get here, the interface is marked down. | 861 | * When we get here, the interface is marked down. |
| 868 | * Call rcu_barrier() to wait both for the RX path | 862 | * Call synchronize_rcu() to wait for the RX path |
| 869 | * should it be using the interface and enqueuing | 863 | * should it be using the interface and enqueuing |
| 870 | * frames at this very time on another CPU, and | 864 | * frames at this very time on another CPU. |
| 871 | * for the sta free call_rcu callbacks. | ||
| 872 | */ | ||
| 873 | rcu_barrier(); | ||
| 874 | |||
| 875 | /* | ||
| 876 | * free_sta_rcu() enqueues a work for the actual | ||
| 877 | * sta cleanup, so we need to flush it while | ||
| 878 | * sdata is still valid. | ||
| 879 | */ | 865 | */ |
| 880 | flush_workqueue(local->workqueue); | 866 | synchronize_rcu(); |
| 881 | |||
| 882 | skb_queue_purge(&sdata->skb_queue); | 867 | skb_queue_purge(&sdata->skb_queue); |
| 883 | 868 | ||
| 884 | /* | 869 | /* |
| @@ -1498,6 +1483,15 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local, | |||
| 1498 | mutex_unlock(&local->iflist_mtx); | 1483 | mutex_unlock(&local->iflist_mtx); |
| 1499 | } | 1484 | } |
| 1500 | 1485 | ||
| 1486 | static void ieee80211_cleanup_sdata_stas_wk(struct work_struct *wk) | ||
| 1487 | { | ||
| 1488 | struct ieee80211_sub_if_data *sdata; | ||
| 1489 | |||
| 1490 | sdata = container_of(wk, struct ieee80211_sub_if_data, cleanup_stations_wk); | ||
| 1491 | |||
| 1492 | ieee80211_cleanup_sdata_stas(sdata); | ||
| 1493 | } | ||
| 1494 | |||
| 1501 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, | 1495 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, |
| 1502 | struct wireless_dev **new_wdev, enum nl80211_iftype type, | 1496 | struct wireless_dev **new_wdev, enum nl80211_iftype type, |
| 1503 | struct vif_params *params) | 1497 | struct vif_params *params) |
| @@ -1573,6 +1567,10 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, | |||
| 1573 | 1567 | ||
| 1574 | INIT_LIST_HEAD(&sdata->key_list); | 1568 | INIT_LIST_HEAD(&sdata->key_list); |
| 1575 | 1569 | ||
| 1570 | spin_lock_init(&sdata->cleanup_stations_lock); | ||
| 1571 | INIT_LIST_HEAD(&sdata->cleanup_stations); | ||
| 1572 | INIT_WORK(&sdata->cleanup_stations_wk, ieee80211_cleanup_sdata_stas_wk); | ||
| 1573 | |||
| 1576 | for (i = 0; i < IEEE80211_NUM_BANDS; i++) { | 1574 | for (i = 0; i < IEEE80211_NUM_BANDS; i++) { |
| 1577 | struct ieee80211_supported_band *sband; | 1575 | struct ieee80211_supported_band *sband; |
| 1578 | sband = local->hw.wiphy->bands[i]; | 1576 | sband = local->hw.wiphy->bands[i]; |
