aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-21 10:56:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-21 10:56:12 -0500
commit0c86a6bd85ff0629cd2c5141027fc1c8bb6cde9c (patch)
tree48f978cecf58c9eec7b055a2331b68f95b209dca
parentb620fd2df20d2073b4f432113e0de9a6b5d33be5 (diff)
parenta13e8d418f3cb9d0b4efa6e744b8b23c0e3cdfe8 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix a reference to a module parameter which was lost during the GREv6 receive path rewrite, from Alexey Kodanev. 2) Fix deref before NULL check in ipheth, from Gustavo A. R. Silva. 3) RCU read lock imbalance in tun_build_skb(), from Xin Long. 4) Some stragglers from the mac80211 folks: a) Timer conversions from Kees Cook b) Fix some sequencing issue when cfg80211 is built statically, from Johannes Berg c) Memory leak in mac80211_hwsim, from Ben Hutchings. 5) Add new qmi_wwan device ID, from Sebastian Sjoholm. 6) Fix use after free in tipc, from Jon Maloy. 7) Missing kdoc in nfp driver, from Jakub Kicinski. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: nfp: flower: add missing kdoc tipc: fix access of released memory net: qmi_wwan: add Quectel BG96 2c7c:0296 mlxsw: spectrum: Do not try to create non-existing ports during unsplit mac80211: properly free requested-but-not-started TX agg sessions mac80211_hwsim: Fix memory leak in hwsim_new_radio_nl() cfg80211: initialize regulatory keys/database later mac80211: aggregation: Convert timers to use timer_setup() nl80211: don't expose wdev->ssid for most interfaces mac80211: Convert timers to use timer_setup() net: vxge: Fix some indentation issues net: ena: fix race condition between device reset and link up setup r8169: use same RTL8111EVL green settings as in vendor driver r8169: fix RTL8111EVL EEE and green settings tun: fix rcu_read_lock imbalance in tun_build_skb tcp: when scheduling TLP, time of RTO should account for current ACK usbnet: ipheth: fix potential null pointer dereference in ipheth_carrier_set gre6: use log_ecn_error module parameter in ip6_tnl_rcv()
-rw-r--r--drivers/net/ethernet/amazon/ena/ena_netdev.c11
-rw-r--r--drivers/net/ethernet/amazon/ena/ena_netdev.h3
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c8
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.h2
-rw-r--r--drivers/net/ethernet/neterion/vxge/vxge-main.c37
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/offload.c1
-rw-r--r--drivers/net/ethernet/realtek/r8169.c17
-rw-r--r--drivers/net/tun.c3
-rw-r--r--drivers/net/usb/ipheth.c5
-rw-r--r--drivers/net/usb/qmi_wwan.c1
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c5
-rw-r--r--include/net/tcp.h2
-rw-r--r--net/ipv4/tcp_input.c2
-rw-r--r--net/ipv4/tcp_output.c8
-rw-r--r--net/ipv6/ip6_gre.c2
-rw-r--r--net/mac80211/agg-rx.c41
-rw-r--r--net/mac80211/agg-tx.c49
-rw-r--r--net/mac80211/ibss.c7
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/led.c11
-rw-r--r--net/mac80211/main.c3
-rw-r--r--net/mac80211/mesh.c27
-rw-r--r--net/mac80211/mesh.h2
-rw-r--r--net/mac80211/mesh_hwmp.c4
-rw-r--r--net/mac80211/mesh_pathtbl.c3
-rw-r--r--net/mac80211/mlme.c32
-rw-r--r--net/mac80211/ocb.c10
-rw-r--r--net/mac80211/sta_info.c15
-rw-r--r--net/mac80211/sta_info.h12
-rw-r--r--net/tipc/group.c2
-rw-r--r--net/wireless/nl80211.c26
-rw-r--r--net/wireless/reg.c42
32 files changed, 220 insertions, 176 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 7451922c209d..1c1ddd891ca3 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -2579,6 +2579,7 @@ static int ena_restore_device(struct ena_adapter *adapter)
2579 bool wd_state; 2579 bool wd_state;
2580 int rc; 2580 int rc;
2581 2581
2582 set_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags);
2582 rc = ena_device_init(ena_dev, adapter->pdev, &get_feat_ctx, &wd_state); 2583 rc = ena_device_init(ena_dev, adapter->pdev, &get_feat_ctx, &wd_state);
2583 if (rc) { 2584 if (rc) {
2584 dev_err(&pdev->dev, "Can not initialize device\n"); 2585 dev_err(&pdev->dev, "Can not initialize device\n");
@@ -2592,6 +2593,11 @@ static int ena_restore_device(struct ena_adapter *adapter)
2592 goto err_device_destroy; 2593 goto err_device_destroy;
2593 } 2594 }
2594 2595
2596 clear_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags);
2597 /* Make sure we don't have a race with AENQ Links state handler */
2598 if (test_bit(ENA_FLAG_LINK_UP, &adapter->flags))
2599 netif_carrier_on(adapter->netdev);
2600
2595 rc = ena_enable_msix_and_set_admin_interrupts(adapter, 2601 rc = ena_enable_msix_and_set_admin_interrupts(adapter,
2596 adapter->num_queues); 2602 adapter->num_queues);
2597 if (rc) { 2603 if (rc) {
@@ -2618,7 +2624,7 @@ err_device_destroy:
2618 ena_com_admin_destroy(ena_dev); 2624 ena_com_admin_destroy(ena_dev);
2619err: 2625err:
2620 clear_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags); 2626 clear_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags);
2621 2627 clear_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags);
2622 dev_err(&pdev->dev, 2628 dev_err(&pdev->dev,
2623 "Reset attempt failed. Can not reset the device\n"); 2629 "Reset attempt failed. Can not reset the device\n");
2624 2630
@@ -3495,7 +3501,8 @@ static void ena_update_on_link_change(void *adapter_data,
3495 if (status) { 3501 if (status) {
3496 netdev_dbg(adapter->netdev, "%s\n", __func__); 3502 netdev_dbg(adapter->netdev, "%s\n", __func__);
3497 set_bit(ENA_FLAG_LINK_UP, &adapter->flags); 3503 set_bit(ENA_FLAG_LINK_UP, &adapter->flags);
3498 netif_carrier_on(adapter->netdev); 3504 if (!test_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags))
3505 netif_carrier_on(adapter->netdev);
3499 } else { 3506 } else {
3500 clear_bit(ENA_FLAG_LINK_UP, &adapter->flags); 3507 clear_bit(ENA_FLAG_LINK_UP, &adapter->flags);
3501 netif_carrier_off(adapter->netdev); 3508 netif_carrier_off(adapter->netdev);
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
index ed8bd0a579c4..3bbc003871de 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
@@ -272,7 +272,8 @@ enum ena_flags_t {
272 ENA_FLAG_DEV_UP, 272 ENA_FLAG_DEV_UP,
273 ENA_FLAG_LINK_UP, 273 ENA_FLAG_LINK_UP,
274 ENA_FLAG_MSIX_ENABLED, 274 ENA_FLAG_MSIX_ENABLED,
275 ENA_FLAG_TRIGGER_RESET 275 ENA_FLAG_TRIGGER_RESET,
276 ENA_FLAG_ONGOING_RESET
276}; 277};
277 278
278/* adapter specific private data structure */ 279/* adapter specific private data structure */
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 2d46ec84ebdf..2d0897b7d860 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -3142,13 +3142,17 @@ static int mlxsw_sp_ports_create(struct mlxsw_sp *mlxsw_sp)
3142 if (!mlxsw_sp->ports) 3142 if (!mlxsw_sp->ports)
3143 return -ENOMEM; 3143 return -ENOMEM;
3144 3144
3145 mlxsw_sp->port_to_module = kcalloc(max_ports, sizeof(u8), GFP_KERNEL); 3145 mlxsw_sp->port_to_module = kmalloc_array(max_ports, sizeof(int),
3146 GFP_KERNEL);
3146 if (!mlxsw_sp->port_to_module) { 3147 if (!mlxsw_sp->port_to_module) {
3147 err = -ENOMEM; 3148 err = -ENOMEM;
3148 goto err_port_to_module_alloc; 3149 goto err_port_to_module_alloc;
3149 } 3150 }
3150 3151
3151 for (i = 1; i < max_ports; i++) { 3152 for (i = 1; i < max_ports; i++) {
3153 /* Mark as invalid */
3154 mlxsw_sp->port_to_module[i] = -1;
3155
3152 err = mlxsw_sp_port_module_info_get(mlxsw_sp, i, &module, 3156 err = mlxsw_sp_port_module_info_get(mlxsw_sp, i, &module,
3153 &width, &lane); 3157 &width, &lane);
3154 if (err) 3158 if (err)
@@ -3216,6 +3220,8 @@ static void mlxsw_sp_port_unsplit_create(struct mlxsw_sp *mlxsw_sp,
3216 3220
3217 for (i = 0; i < count; i++) { 3221 for (i = 0; i < count; i++) {
3218 local_port = base_port + i * 2; 3222 local_port = base_port + i * 2;
3223 if (mlxsw_sp->port_to_module[local_port] < 0)
3224 continue;
3219 module = mlxsw_sp->port_to_module[local_port]; 3225 module = mlxsw_sp->port_to_module[local_port];
3220 3226
3221 mlxsw_sp_port_create(mlxsw_sp, local_port, false, module, 3227 mlxsw_sp_port_create(mlxsw_sp, local_port, false, module,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index 58cf222fb985..432ab9b12b7f 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -152,7 +152,7 @@ struct mlxsw_sp {
152 const struct mlxsw_bus_info *bus_info; 152 const struct mlxsw_bus_info *bus_info;
153 unsigned char base_mac[ETH_ALEN]; 153 unsigned char base_mac[ETH_ALEN];
154 struct mlxsw_sp_upper *lags; 154 struct mlxsw_sp_upper *lags;
155 u8 *port_to_module; 155 int *port_to_module;
156 struct mlxsw_sp_sb *sb; 156 struct mlxsw_sp_sb *sb;
157 struct mlxsw_sp_bridge *bridge; 157 struct mlxsw_sp_bridge *bridge;
158 struct mlxsw_sp_router *router; 158 struct mlxsw_sp_router *router;
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index fe7e0e1dd01d..b2299f2b2155 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -1530,7 +1530,7 @@ static int vxge_reset_vpath(struct vxgedev *vdev, int vp_id)
1530 vxge_debug_init(VXGE_ERR, 1530 vxge_debug_init(VXGE_ERR,
1531 "vxge_hw_vpath_reset failed for" 1531 "vxge_hw_vpath_reset failed for"
1532 "vpath:%d", vp_id); 1532 "vpath:%d", vp_id);
1533 return status; 1533 return status;
1534 } 1534 }
1535 } else 1535 } else
1536 return VXGE_HW_FAIL; 1536 return VXGE_HW_FAIL;
@@ -1950,19 +1950,19 @@ static enum vxge_hw_status vxge_rth_configure(struct vxgedev *vdev)
1950 * for all VPATHs. The h/w only uses the lowest numbered VPATH 1950 * for all VPATHs. The h/w only uses the lowest numbered VPATH
1951 * when steering frames. 1951 * when steering frames.
1952 */ 1952 */
1953 for (index = 0; index < vdev->no_of_vpath; index++) { 1953 for (index = 0; index < vdev->no_of_vpath; index++) {
1954 status = vxge_hw_vpath_rts_rth_set( 1954 status = vxge_hw_vpath_rts_rth_set(
1955 vdev->vpaths[index].handle, 1955 vdev->vpaths[index].handle,
1956 vdev->config.rth_algorithm, 1956 vdev->config.rth_algorithm,
1957 &hash_types, 1957 &hash_types,
1958 vdev->config.rth_bkt_sz); 1958 vdev->config.rth_bkt_sz);
1959 if (status != VXGE_HW_OK) { 1959 if (status != VXGE_HW_OK) {
1960 vxge_debug_init(VXGE_ERR, 1960 vxge_debug_init(VXGE_ERR,
1961 "RTH configuration failed for vpath:%d", 1961 "RTH configuration failed for vpath:%d",
1962 vdev->vpaths[index].device_id); 1962 vdev->vpaths[index].device_id);
1963 return status; 1963 return status;
1964 } 1964 }
1965 } 1965 }
1966 1966
1967 return status; 1967 return status;
1968} 1968}
@@ -1991,7 +1991,7 @@ static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev)
1991 vxge_debug_init(VXGE_ERR, 1991 vxge_debug_init(VXGE_ERR,
1992 "vxge_hw_vpath_reset failed for " 1992 "vxge_hw_vpath_reset failed for "
1993 "vpath:%d", i); 1993 "vpath:%d", i);
1994 return status; 1994 return status;
1995 } 1995 }
1996 } 1996 }
1997 } 1997 }
@@ -2474,32 +2474,31 @@ static int vxge_add_isr(struct vxgedev *vdev)
2474 switch (msix_idx) { 2474 switch (msix_idx) {
2475 case 0: 2475 case 0:
2476 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN, 2476 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN,
2477 "%s:vxge:MSI-X %d - Tx - fn:%d vpath:%d", 2477 "%s:vxge:MSI-X %d - Tx - fn:%d vpath:%d",
2478 vdev->ndev->name, 2478 vdev->ndev->name,
2479 vdev->entries[intr_cnt].entry, 2479 vdev->entries[intr_cnt].entry,
2480 pci_fun, vp_idx); 2480 pci_fun, vp_idx);
2481 ret = request_irq( 2481 ret = request_irq(
2482 vdev->entries[intr_cnt].vector, 2482 vdev->entries[intr_cnt].vector,
2483 vxge_tx_msix_handle, 0, 2483 vxge_tx_msix_handle, 0,
2484 vdev->desc[intr_cnt], 2484 vdev->desc[intr_cnt],
2485 &vdev->vpaths[vp_idx].fifo); 2485 &vdev->vpaths[vp_idx].fifo);
2486 vdev->vxge_entries[intr_cnt].arg = 2486 vdev->vxge_entries[intr_cnt].arg =
2487 &vdev->vpaths[vp_idx].fifo; 2487 &vdev->vpaths[vp_idx].fifo;
2488 irq_req = 1; 2488 irq_req = 1;
2489 break; 2489 break;
2490 case 1: 2490 case 1:
2491 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN, 2491 snprintf(vdev->desc[intr_cnt], VXGE_INTR_STRLEN,
2492 "%s:vxge:MSI-X %d - Rx - fn:%d vpath:%d", 2492 "%s:vxge:MSI-X %d - Rx - fn:%d vpath:%d",
2493 vdev->ndev->name, 2493 vdev->ndev->name,
2494 vdev->entries[intr_cnt].entry, 2494 vdev->entries[intr_cnt].entry,
2495 pci_fun, vp_idx); 2495 pci_fun, vp_idx);
2496 ret = request_irq( 2496 ret = request_irq(
2497 vdev->entries[intr_cnt].vector, 2497 vdev->entries[intr_cnt].vector,
2498 vxge_rx_msix_napi_handle, 2498 vxge_rx_msix_napi_handle, 0,
2499 0,
2500 vdev->desc[intr_cnt], 2499 vdev->desc[intr_cnt],
2501 &vdev->vpaths[vp_idx].ring); 2500 &vdev->vpaths[vp_idx].ring);
2502 vdev->vxge_entries[intr_cnt].arg = 2501 vdev->vxge_entries[intr_cnt].arg =
2503 &vdev->vpaths[vp_idx].ring; 2502 &vdev->vpaths[vp_idx].ring;
2504 irq_req = 1; 2503 irq_req = 1;
2505 break; 2504 break;
@@ -2512,9 +2511,9 @@ static int vxge_add_isr(struct vxgedev *vdev)
2512 vxge_rem_msix_isr(vdev); 2511 vxge_rem_msix_isr(vdev);
2513 vdev->config.intr_type = INTA; 2512 vdev->config.intr_type = INTA;
2514 vxge_debug_init(VXGE_ERR, 2513 vxge_debug_init(VXGE_ERR,
2515 "%s: Defaulting to INTA" 2514 "%s: Defaulting to INTA",
2516 , vdev->ndev->name); 2515 vdev->ndev->name);
2517 goto INTA_MODE; 2516 goto INTA_MODE;
2518 } 2517 }
2519 2518
2520 if (irq_req) { 2519 if (irq_req) {
@@ -4505,8 +4504,8 @@ vxge_probe(struct pci_dev *pdev, const struct pci_device_id *pre)
4505 if (status != VXGE_HW_OK) { 4504 if (status != VXGE_HW_OK) {
4506 vxge_debug_init(VXGE_ERR, 4505 vxge_debug_init(VXGE_ERR,
4507 "Failed to initialize device (%d)", status); 4506 "Failed to initialize device (%d)", status);
4508 ret = -EINVAL; 4507 ret = -EINVAL;
4509 goto _exit3; 4508 goto _exit3;
4510 } 4509 }
4511 4510
4512 if (VXGE_FW_VER(ll_config->device_hw_info.fw_version.major, 4511 if (VXGE_FW_VER(ll_config->device_hw_info.fw_version.major,
diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c
index f5d73b83dcc2..553f94f55dce 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/offload.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c
@@ -315,6 +315,7 @@ err_free_flow:
315 * @app: Pointer to the APP handle 315 * @app: Pointer to the APP handle
316 * @netdev: netdev structure. 316 * @netdev: netdev structure.
317 * @flow: TC flower classifier offload structure. 317 * @flow: TC flower classifier offload structure.
318 * @egress: NFP netdev is the egress.
318 * 319 *
319 * Adds a new flow to the repeated hash structure and action payload. 320 * Adds a new flow to the repeated hash structure and action payload.
320 * 321 *
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index dcb8c39382e7..2cb3622c4acc 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3789,27 +3789,32 @@ static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
3789 rtl_writephy(tp, 0x1f, 0x0000); 3789 rtl_writephy(tp, 0x1f, 0x0000);
3790 3790
3791 /* EEE setting */ 3791 /* EEE setting */
3792 rtl_w0w1_eri(tp, 0x1b0, ERIAR_MASK_1111, 0x0000, 0x0003, ERIAR_EXGMAC); 3792 rtl_w0w1_eri(tp, 0x1b0, ERIAR_MASK_1111, 0x0003, 0x0000, ERIAR_EXGMAC);
3793 rtl_writephy(tp, 0x1f, 0x0005); 3793 rtl_writephy(tp, 0x1f, 0x0005);
3794 rtl_writephy(tp, 0x05, 0x8b85); 3794 rtl_writephy(tp, 0x05, 0x8b85);
3795 rtl_w0w1_phy(tp, 0x06, 0x0000, 0x2000); 3795 rtl_w0w1_phy(tp, 0x06, 0x2000, 0x0000);
3796 rtl_writephy(tp, 0x1f, 0x0004); 3796 rtl_writephy(tp, 0x1f, 0x0004);
3797 rtl_writephy(tp, 0x1f, 0x0007); 3797 rtl_writephy(tp, 0x1f, 0x0007);
3798 rtl_writephy(tp, 0x1e, 0x0020); 3798 rtl_writephy(tp, 0x1e, 0x0020);
3799 rtl_w0w1_phy(tp, 0x15, 0x0000, 0x0100); 3799 rtl_w0w1_phy(tp, 0x15, 0x0100, 0x0000);
3800 rtl_writephy(tp, 0x1f, 0x0002); 3800 rtl_writephy(tp, 0x1f, 0x0002);
3801 rtl_writephy(tp, 0x1f, 0x0000); 3801 rtl_writephy(tp, 0x1f, 0x0000);
3802 rtl_writephy(tp, 0x0d, 0x0007); 3802 rtl_writephy(tp, 0x0d, 0x0007);
3803 rtl_writephy(tp, 0x0e, 0x003c); 3803 rtl_writephy(tp, 0x0e, 0x003c);
3804 rtl_writephy(tp, 0x0d, 0x4007); 3804 rtl_writephy(tp, 0x0d, 0x4007);
3805 rtl_writephy(tp, 0x0e, 0x0000); 3805 rtl_writephy(tp, 0x0e, 0x0006);
3806 rtl_writephy(tp, 0x0d, 0x0000); 3806 rtl_writephy(tp, 0x0d, 0x0000);
3807 3807
3808 /* Green feature */ 3808 /* Green feature */
3809 rtl_writephy(tp, 0x1f, 0x0003); 3809 rtl_writephy(tp, 0x1f, 0x0003);
3810 rtl_w0w1_phy(tp, 0x19, 0x0000, 0x0001); 3810 rtl_w0w1_phy(tp, 0x19, 0x0001, 0x0000);
3811 rtl_w0w1_phy(tp, 0x10, 0x0000, 0x0400); 3811 rtl_w0w1_phy(tp, 0x10, 0x0400, 0x0000);
3812 rtl_writephy(tp, 0x1f, 0x0000);
3813 rtl_writephy(tp, 0x1f, 0x0005);
3814 rtl_w0w1_phy(tp, 0x01, 0x0100, 0x0000);
3812 rtl_writephy(tp, 0x1f, 0x0000); 3815 rtl_writephy(tp, 0x1f, 0x0000);
3816 /* soft-reset phy */
3817 rtl_writephy(tp, MII_BMCR, BMCR_RESET | BMCR_ANENABLE | BMCR_ANRESTART);
3813 3818
3814 /* Broken BIOS workaround: feed GigaMAC registers with MAC address. */ 3819 /* Broken BIOS workaround: feed GigaMAC registers with MAC address. */
3815 rtl_rar_exgmac_set(tp, tp->dev->dev_addr); 3820 rtl_rar_exgmac_set(tp, tp->dev->dev_addr);
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 6bb1e604aadd..5a2ea78a008f 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1485,6 +1485,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,
1485 err = xdp_do_redirect(tun->dev, &xdp, xdp_prog); 1485 err = xdp_do_redirect(tun->dev, &xdp, xdp_prog);
1486 if (err) 1486 if (err)
1487 goto err_redirect; 1487 goto err_redirect;
1488 rcu_read_unlock();
1488 return NULL; 1489 return NULL;
1489 case XDP_TX: 1490 case XDP_TX:
1490 xdp_xmit = true; 1491 xdp_xmit = true;
@@ -1517,7 +1518,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,
1517 if (xdp_xmit) { 1518 if (xdp_xmit) {
1518 skb->dev = tun->dev; 1519 skb->dev = tun->dev;
1519 generic_xdp_tx(skb, xdp_prog); 1520 generic_xdp_tx(skb, xdp_prog);
1520 rcu_read_lock(); 1521 rcu_read_unlock();
1521 return NULL; 1522 return NULL;
1522 } 1523 }
1523 1524
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index ca71f6c03859..7275761a1177 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -291,12 +291,15 @@ static void ipheth_sndbulk_callback(struct urb *urb)
291 291
292static int ipheth_carrier_set(struct ipheth_device *dev) 292static int ipheth_carrier_set(struct ipheth_device *dev)
293{ 293{
294 struct usb_device *udev = dev->udev; 294 struct usb_device *udev;
295 int retval; 295 int retval;
296
296 if (!dev) 297 if (!dev)
297 return 0; 298 return 0;
298 if (!dev->confirmed_pairing) 299 if (!dev->confirmed_pairing)
299 return 0; 300 return 0;
301
302 udev = dev->udev;
300 retval = usb_control_msg(udev, 303 retval = usb_control_msg(udev,
301 usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP), 304 usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP),
302 IPHETH_CMD_CARRIER_CHECK, /* request */ 305 IPHETH_CMD_CARRIER_CHECK, /* request */
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 720a3a248070..c750cf7c042b 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -1239,6 +1239,7 @@ static const struct usb_device_id products[] = {
1239 {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */ 1239 {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */
1240 {QMI_QUIRK_SET_DTR(0x2c7c, 0x0125, 4)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ 1240 {QMI_QUIRK_SET_DTR(0x2c7c, 0x0125, 4)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
1241 {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */ 1241 {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */
1242 {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */
1242 1243
1243 /* 4. Gobi 1000 devices */ 1244 /* 4. Gobi 1000 devices */
1244 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */ 1245 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 7c3600643c7f..10b075a46b26 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -3108,6 +3108,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
3108{ 3108{
3109 struct hwsim_new_radio_params param = { 0 }; 3109 struct hwsim_new_radio_params param = { 0 };
3110 const char *hwname = NULL; 3110 const char *hwname = NULL;
3111 int ret;
3111 3112
3112 param.reg_strict = info->attrs[HWSIM_ATTR_REG_STRICT_REG]; 3113 param.reg_strict = info->attrs[HWSIM_ATTR_REG_STRICT_REG];
3113 param.p2p_device = info->attrs[HWSIM_ATTR_SUPPORT_P2P_DEVICE]; 3114 param.p2p_device = info->attrs[HWSIM_ATTR_SUPPORT_P2P_DEVICE];
@@ -3147,7 +3148,9 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)
3147 param.regd = hwsim_world_regdom_custom[idx]; 3148 param.regd = hwsim_world_regdom_custom[idx];
3148 } 3149 }
3149 3150
3150 return mac80211_hwsim_new_radio(info, &param); 3151 ret = mac80211_hwsim_new_radio(info, &param);
3152 kfree(hwname);
3153 return ret;
3151} 3154}
3152 3155
3153static int hwsim_del_radio_nl(struct sk_buff *msg, struct genl_info *info) 3156static int hwsim_del_radio_nl(struct sk_buff *msg, struct genl_info *info)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 85ea578195d4..4e09398009c1 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -539,7 +539,7 @@ void tcp_push_one(struct sock *, unsigned int mss_now);
539void tcp_send_ack(struct sock *sk); 539void tcp_send_ack(struct sock *sk);
540void tcp_send_delayed_ack(struct sock *sk); 540void tcp_send_delayed_ack(struct sock *sk);
541void tcp_send_loss_probe(struct sock *sk); 541void tcp_send_loss_probe(struct sock *sk);
542bool tcp_schedule_loss_probe(struct sock *sk); 542bool tcp_schedule_loss_probe(struct sock *sk, bool advancing_rto);
543void tcp_skb_collapse_tstamp(struct sk_buff *skb, 543void tcp_skb_collapse_tstamp(struct sk_buff *skb,
544 const struct sk_buff *next_skb); 544 const struct sk_buff *next_skb);
545 545
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index f844c06c0676..734cfc8ff76e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2964,7 +2964,7 @@ void tcp_rearm_rto(struct sock *sk)
2964/* Try to schedule a loss probe; if that doesn't work, then schedule an RTO. */ 2964/* Try to schedule a loss probe; if that doesn't work, then schedule an RTO. */
2965static void tcp_set_xmit_timer(struct sock *sk) 2965static void tcp_set_xmit_timer(struct sock *sk)
2966{ 2966{
2967 if (!tcp_schedule_loss_probe(sk)) 2967 if (!tcp_schedule_loss_probe(sk, true))
2968 tcp_rearm_rto(sk); 2968 tcp_rearm_rto(sk);
2969} 2969}
2970 2970
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 540b7d92cc70..a4d214c7b506 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2391,7 +2391,7 @@ repair:
2391 2391
2392 /* Send one loss probe per tail loss episode. */ 2392 /* Send one loss probe per tail loss episode. */
2393 if (push_one != 2) 2393 if (push_one != 2)
2394 tcp_schedule_loss_probe(sk); 2394 tcp_schedule_loss_probe(sk, false);
2395 is_cwnd_limited |= (tcp_packets_in_flight(tp) >= tp->snd_cwnd); 2395 is_cwnd_limited |= (tcp_packets_in_flight(tp) >= tp->snd_cwnd);
2396 tcp_cwnd_validate(sk, is_cwnd_limited); 2396 tcp_cwnd_validate(sk, is_cwnd_limited);
2397 return false; 2397 return false;
@@ -2399,7 +2399,7 @@ repair:
2399 return !tp->packets_out && !tcp_write_queue_empty(sk); 2399 return !tp->packets_out && !tcp_write_queue_empty(sk);
2400} 2400}
2401 2401
2402bool tcp_schedule_loss_probe(struct sock *sk) 2402bool tcp_schedule_loss_probe(struct sock *sk, bool advancing_rto)
2403{ 2403{
2404 struct inet_connection_sock *icsk = inet_csk(sk); 2404 struct inet_connection_sock *icsk = inet_csk(sk);
2405 struct tcp_sock *tp = tcp_sk(sk); 2405 struct tcp_sock *tp = tcp_sk(sk);
@@ -2440,7 +2440,9 @@ bool tcp_schedule_loss_probe(struct sock *sk)
2440 } 2440 }
2441 2441
2442 /* If the RTO formula yields an earlier time, then use that time. */ 2442 /* If the RTO formula yields an earlier time, then use that time. */
2443 rto_delta_us = tcp_rto_delta_us(sk); /* How far in future is RTO? */ 2443 rto_delta_us = advancing_rto ?
2444 jiffies_to_usecs(inet_csk(sk)->icsk_rto) :
2445 tcp_rto_delta_us(sk); /* How far in future is RTO? */
2444 if (rto_delta_us > 0) 2446 if (rto_delta_us > 0)
2445 timeout = min_t(u32, timeout, usecs_to_jiffies(rto_delta_us)); 2447 timeout = min_t(u32, timeout, usecs_to_jiffies(rto_delta_us));
2446 2448
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index b90bad7a4e56..4cfd8e0696fe 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -460,7 +460,7 @@ static int ip6gre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi)
460 &ipv6h->saddr, &ipv6h->daddr, tpi->key, 460 &ipv6h->saddr, &ipv6h->daddr, tpi->key,
461 tpi->proto); 461 tpi->proto);
462 if (tunnel) { 462 if (tunnel) {
463 ip6_tnl_rcv(tunnel, skb, tpi, NULL, false); 463 ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error);
464 464
465 return PACKET_RCVD; 465 return PACKET_RCVD;
466 } 466 }
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index 88cc1ae935ea..d444752dbf40 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -151,21 +151,17 @@ EXPORT_SYMBOL(ieee80211_stop_rx_ba_session);
151 * After accepting the AddBA Request we activated a timer, 151 * After accepting the AddBA Request we activated a timer,
152 * resetting it after each frame that arrives from the originator. 152 * resetting it after each frame that arrives from the originator.
153 */ 153 */
154static void sta_rx_agg_session_timer_expired(unsigned long data) 154static void sta_rx_agg_session_timer_expired(struct timer_list *t)
155{ 155{
156 /* not an elegant detour, but there is no choice as the timer passes 156 struct tid_ampdu_rx *tid_rx_timer =
157 * only one argument, and various sta_info are needed here, so init 157 from_timer(tid_rx_timer, t, session_timer);
158 * flow in sta_info_create gives the TID as data, while the timer_to_id 158 struct sta_info *sta = tid_rx_timer->sta;
159 * array gives the sta through container_of */ 159 u8 tid = tid_rx_timer->tid;
160 u8 *ptid = (u8 *)data;
161 u8 *timer_to_id = ptid - *ptid;
162 struct sta_info *sta = container_of(timer_to_id, struct sta_info,
163 timer_to_tid[0]);
164 struct tid_ampdu_rx *tid_rx; 160 struct tid_ampdu_rx *tid_rx;
165 unsigned long timeout; 161 unsigned long timeout;
166 162
167 rcu_read_lock(); 163 rcu_read_lock();
168 tid_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[*ptid]); 164 tid_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]);
169 if (!tid_rx) { 165 if (!tid_rx) {
170 rcu_read_unlock(); 166 rcu_read_unlock();
171 return; 167 return;
@@ -180,21 +176,18 @@ static void sta_rx_agg_session_timer_expired(unsigned long data)
180 rcu_read_unlock(); 176 rcu_read_unlock();
181 177
182 ht_dbg(sta->sdata, "RX session timer expired on %pM tid %d\n", 178 ht_dbg(sta->sdata, "RX session timer expired on %pM tid %d\n",
183 sta->sta.addr, (u16)*ptid); 179 sta->sta.addr, tid);
184 180
185 set_bit(*ptid, sta->ampdu_mlme.tid_rx_timer_expired); 181 set_bit(tid, sta->ampdu_mlme.tid_rx_timer_expired);
186 ieee80211_queue_work(&sta->local->hw, &sta->ampdu_mlme.work); 182 ieee80211_queue_work(&sta->local->hw, &sta->ampdu_mlme.work);
187} 183}
188 184
189static void sta_rx_agg_reorder_timer_expired(unsigned long data) 185static void sta_rx_agg_reorder_timer_expired(struct timer_list *t)
190{ 186{
191 u8 *ptid = (u8 *)data; 187 struct tid_ampdu_rx *tid_rx = from_timer(tid_rx, t, reorder_timer);
192 u8 *timer_to_id = ptid - *ptid;
193 struct sta_info *sta = container_of(timer_to_id, struct sta_info,
194 timer_to_tid[0]);
195 188
196 rcu_read_lock(); 189 rcu_read_lock();
197 ieee80211_release_reorder_timeout(sta, *ptid); 190 ieee80211_release_reorder_timeout(tid_rx->sta, tid_rx->tid);
198 rcu_read_unlock(); 191 rcu_read_unlock();
199} 192}
200 193
@@ -356,14 +349,12 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
356 spin_lock_init(&tid_agg_rx->reorder_lock); 349 spin_lock_init(&tid_agg_rx->reorder_lock);
357 350
358 /* rx timer */ 351 /* rx timer */
359 setup_deferrable_timer(&tid_agg_rx->session_timer, 352 timer_setup(&tid_agg_rx->session_timer,
360 sta_rx_agg_session_timer_expired, 353 sta_rx_agg_session_timer_expired, TIMER_DEFERRABLE);
361 (unsigned long)&sta->timer_to_tid[tid]);
362 354
363 /* rx reorder timer */ 355 /* rx reorder timer */
364 setup_timer(&tid_agg_rx->reorder_timer, 356 timer_setup(&tid_agg_rx->reorder_timer,
365 sta_rx_agg_reorder_timer_expired, 357 sta_rx_agg_reorder_timer_expired, 0);
366 (unsigned long)&sta->timer_to_tid[tid]);
367 358
368 /* prepare reordering buffer */ 359 /* prepare reordering buffer */
369 tid_agg_rx->reorder_buf = 360 tid_agg_rx->reorder_buf =
@@ -399,6 +390,8 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
399 tid_agg_rx->auto_seq = auto_seq; 390 tid_agg_rx->auto_seq = auto_seq;
400 tid_agg_rx->started = false; 391 tid_agg_rx->started = false;
401 tid_agg_rx->reorder_buf_filtered = 0; 392 tid_agg_rx->reorder_buf_filtered = 0;
393 tid_agg_rx->tid = tid;
394 tid_agg_rx->sta = sta;
402 status = WLAN_STATUS_SUCCESS; 395 status = WLAN_STATUS_SUCCESS;
403 396
404 /* activate it for RX */ 397 /* activate it for RX */
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
index bef516ec47f9..5f8ab5be369f 100644
--- a/net/mac80211/agg-tx.c
+++ b/net/mac80211/agg-tx.c
@@ -330,6 +330,11 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
330 330
331 spin_lock_bh(&sta->lock); 331 spin_lock_bh(&sta->lock);
332 332
333 /* free struct pending for start, if present */
334 tid_tx = sta->ampdu_mlme.tid_start_tx[tid];
335 kfree(tid_tx);
336 sta->ampdu_mlme.tid_start_tx[tid] = NULL;
337
333 tid_tx = rcu_dereference_protected_tid_tx(sta, tid); 338 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
334 if (!tid_tx) { 339 if (!tid_tx) {
335 spin_unlock_bh(&sta->lock); 340 spin_unlock_bh(&sta->lock);
@@ -422,15 +427,12 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
422 * add Block Ack response will arrive from the recipient. 427 * add Block Ack response will arrive from the recipient.
423 * If this timer expires sta_addba_resp_timer_expired will be executed. 428 * If this timer expires sta_addba_resp_timer_expired will be executed.
424 */ 429 */
425static void sta_addba_resp_timer_expired(unsigned long data) 430static void sta_addba_resp_timer_expired(struct timer_list *t)
426{ 431{
427 /* not an elegant detour, but there is no choice as the timer passes 432 struct tid_ampdu_tx *tid_tx_timer =
428 * only one argument, and both sta_info and TID are needed, so init 433 from_timer(tid_tx_timer, t, addba_resp_timer);
429 * flow in sta_info_create gives the TID as data, while the timer_to_id 434 struct sta_info *sta = tid_tx_timer->sta;
430 * array gives the sta through container_of */ 435 u8 tid = tid_tx_timer->tid;
431 u16 tid = *(u8 *)data;
432 struct sta_info *sta = container_of((void *)data,
433 struct sta_info, timer_to_tid[tid]);
434 struct tid_ampdu_tx *tid_tx; 436 struct tid_ampdu_tx *tid_tx;
435 437
436 /* check if the TID waits for addBA response */ 438 /* check if the TID waits for addBA response */
@@ -525,21 +527,17 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
525 * After accepting the AddBA Response we activated a timer, 527 * After accepting the AddBA Response we activated a timer,
526 * resetting it after each frame that we send. 528 * resetting it after each frame that we send.
527 */ 529 */
528static void sta_tx_agg_session_timer_expired(unsigned long data) 530static void sta_tx_agg_session_timer_expired(struct timer_list *t)
529{ 531{
530 /* not an elegant detour, but there is no choice as the timer passes 532 struct tid_ampdu_tx *tid_tx_timer =
531 * only one argument, and various sta_info are needed here, so init 533 from_timer(tid_tx_timer, t, session_timer);
532 * flow in sta_info_create gives the TID as data, while the timer_to_id 534 struct sta_info *sta = tid_tx_timer->sta;
533 * array gives the sta through container_of */ 535 u8 tid = tid_tx_timer->tid;
534 u8 *ptid = (u8 *)data;
535 u8 *timer_to_id = ptid - *ptid;
536 struct sta_info *sta = container_of(timer_to_id, struct sta_info,
537 timer_to_tid[0]);
538 struct tid_ampdu_tx *tid_tx; 536 struct tid_ampdu_tx *tid_tx;
539 unsigned long timeout; 537 unsigned long timeout;
540 538
541 rcu_read_lock(); 539 rcu_read_lock();
542 tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[*ptid]); 540 tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
543 if (!tid_tx || test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { 541 if (!tid_tx || test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) {
544 rcu_read_unlock(); 542 rcu_read_unlock();
545 return; 543 return;
@@ -555,9 +553,9 @@ static void sta_tx_agg_session_timer_expired(unsigned long data)
555 rcu_read_unlock(); 553 rcu_read_unlock();
556 554
557 ht_dbg(sta->sdata, "tx session timer expired on %pM tid %d\n", 555 ht_dbg(sta->sdata, "tx session timer expired on %pM tid %d\n",
558 sta->sta.addr, (u16)*ptid); 556 sta->sta.addr, tid);
559 557
560 ieee80211_stop_tx_ba_session(&sta->sta, *ptid); 558 ieee80211_stop_tx_ba_session(&sta->sta, tid);
561} 559}
562 560
563int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, 561int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
@@ -670,16 +668,15 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
670 __set_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); 668 __set_bit(HT_AGG_STATE_WANT_START, &tid_tx->state);
671 669
672 tid_tx->timeout = timeout; 670 tid_tx->timeout = timeout;
671 tid_tx->sta = sta;
672 tid_tx->tid = tid;
673 673
674 /* response timer */ 674 /* response timer */
675 setup_timer(&tid_tx->addba_resp_timer, 675 timer_setup(&tid_tx->addba_resp_timer, sta_addba_resp_timer_expired, 0);
676 sta_addba_resp_timer_expired,
677 (unsigned long)&sta->timer_to_tid[tid]);
678 676
679 /* tx timer */ 677 /* tx timer */
680 setup_deferrable_timer(&tid_tx->session_timer, 678 timer_setup(&tid_tx->session_timer,
681 sta_tx_agg_session_timer_expired, 679 sta_tx_agg_session_timer_expired, TIMER_DEFERRABLE);
682 (unsigned long)&sta->timer_to_tid[tid]);
683 680
684 /* assign a dialog token */ 681 /* assign a dialog token */
685 sta->ampdu_mlme.dialog_token_allocator++; 682 sta->ampdu_mlme.dialog_token_allocator++;
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index e9c6aa3ed05b..db07e0de9a03 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1711,10 +1711,10 @@ void ieee80211_ibss_work(struct ieee80211_sub_if_data *sdata)
1711 sdata_unlock(sdata); 1711 sdata_unlock(sdata);
1712} 1712}
1713 1713
1714static void ieee80211_ibss_timer(unsigned long data) 1714static void ieee80211_ibss_timer(struct timer_list *t)
1715{ 1715{
1716 struct ieee80211_sub_if_data *sdata = 1716 struct ieee80211_sub_if_data *sdata =
1717 (struct ieee80211_sub_if_data *) data; 1717 from_timer(sdata, t, u.ibss.timer);
1718 1718
1719 ieee80211_queue_work(&sdata->local->hw, &sdata->work); 1719 ieee80211_queue_work(&sdata->local->hw, &sdata->work);
1720} 1720}
@@ -1723,8 +1723,7 @@ void ieee80211_ibss_setup_sdata(struct ieee80211_sub_if_data *sdata)
1723{ 1723{
1724 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; 1724 struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
1725 1725
1726 setup_timer(&ifibss->timer, ieee80211_ibss_timer, 1726 timer_setup(&ifibss->timer, ieee80211_ibss_timer, 0);
1727 (unsigned long) sdata);
1728 INIT_LIST_HEAD(&ifibss->incomplete_stations); 1727 INIT_LIST_HEAD(&ifibss->incomplete_stations);
1729 spin_lock_init(&ifibss->incomplete_lock); 1728 spin_lock_init(&ifibss->incomplete_lock);
1730 INIT_WORK(&ifibss->csa_connection_drop_work, 1729 INIT_WORK(&ifibss->csa_connection_drop_work,
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 68f874e73561..885d00b41911 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1057,6 +1057,7 @@ struct tpt_led_trigger {
1057 const struct ieee80211_tpt_blink *blink_table; 1057 const struct ieee80211_tpt_blink *blink_table;
1058 unsigned int blink_table_len; 1058 unsigned int blink_table_len;
1059 struct timer_list timer; 1059 struct timer_list timer;
1060 struct ieee80211_local *local;
1060 unsigned long prev_traffic; 1061 unsigned long prev_traffic;
1061 unsigned long tx_bytes, rx_bytes; 1062 unsigned long tx_bytes, rx_bytes;
1062 unsigned int active, want; 1063 unsigned int active, want;
@@ -1932,7 +1933,7 @@ static inline int ieee80211_ac_from_tid(int tid)
1932 1933
1933void ieee80211_dynamic_ps_enable_work(struct work_struct *work); 1934void ieee80211_dynamic_ps_enable_work(struct work_struct *work);
1934void ieee80211_dynamic_ps_disable_work(struct work_struct *work); 1935void ieee80211_dynamic_ps_disable_work(struct work_struct *work);
1935void ieee80211_dynamic_ps_timer(unsigned long data); 1936void ieee80211_dynamic_ps_timer(struct timer_list *t);
1936void ieee80211_send_nullfunc(struct ieee80211_local *local, 1937void ieee80211_send_nullfunc(struct ieee80211_local *local,
1937 struct ieee80211_sub_if_data *sdata, 1938 struct ieee80211_sub_if_data *sdata,
1938 bool powersave); 1939 bool powersave);
diff --git a/net/mac80211/led.c b/net/mac80211/led.c
index 0505845b7ab8..ba0b507ea691 100644
--- a/net/mac80211/led.c
+++ b/net/mac80211/led.c
@@ -248,10 +248,10 @@ static unsigned long tpt_trig_traffic(struct ieee80211_local *local,
248 return DIV_ROUND_UP(delta, 1024 / 8); 248 return DIV_ROUND_UP(delta, 1024 / 8);
249} 249}
250 250
251static void tpt_trig_timer(unsigned long data) 251static void tpt_trig_timer(struct timer_list *t)
252{ 252{
253 struct ieee80211_local *local = (void *)data; 253 struct tpt_led_trigger *tpt_trig = from_timer(tpt_trig, t, timer);
254 struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger; 254 struct ieee80211_local *local = tpt_trig->local;
255 struct led_classdev *led_cdev; 255 struct led_classdev *led_cdev;
256 unsigned long on, off, tpt; 256 unsigned long on, off, tpt;
257 int i; 257 int i;
@@ -306,8 +306,9 @@ __ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
306 tpt_trig->blink_table = blink_table; 306 tpt_trig->blink_table = blink_table;
307 tpt_trig->blink_table_len = blink_table_len; 307 tpt_trig->blink_table_len = blink_table_len;
308 tpt_trig->want = flags; 308 tpt_trig->want = flags;
309 tpt_trig->local = local;
309 310
310 setup_timer(&tpt_trig->timer, tpt_trig_timer, (unsigned long)local); 311 timer_setup(&tpt_trig->timer, tpt_trig_timer, 0);
311 312
312 local->tpt_led_trigger = tpt_trig; 313 local->tpt_led_trigger = tpt_trig;
313 314
@@ -326,7 +327,7 @@ static void ieee80211_start_tpt_led_trig(struct ieee80211_local *local)
326 tpt_trig_traffic(local, tpt_trig); 327 tpt_trig_traffic(local, tpt_trig);
327 tpt_trig->running = true; 328 tpt_trig->running = true;
328 329
329 tpt_trig_timer((unsigned long)local); 330 tpt_trig_timer(&tpt_trig->timer);
330 mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ)); 331 mod_timer(&tpt_trig->timer, round_jiffies(jiffies + HZ));
331} 332}
332 333
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 8aa1f5b6a051..e054a2fd8d38 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -633,8 +633,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
633 ieee80211_dynamic_ps_enable_work); 633 ieee80211_dynamic_ps_enable_work);
634 INIT_WORK(&local->dynamic_ps_disable_work, 634 INIT_WORK(&local->dynamic_ps_disable_work,
635 ieee80211_dynamic_ps_disable_work); 635 ieee80211_dynamic_ps_disable_work);
636 setup_timer(&local->dynamic_ps_timer, 636 timer_setup(&local->dynamic_ps_timer, ieee80211_dynamic_ps_timer, 0);
637 ieee80211_dynamic_ps_timer, (unsigned long) local);
638 637
639 INIT_WORK(&local->sched_scan_stopped_work, 638 INIT_WORK(&local->sched_scan_stopped_work,
640 ieee80211_sched_scan_stopped_work); 639 ieee80211_sched_scan_stopped_work);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 7a76c4a6df30..5e27364e10ac 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -37,9 +37,10 @@ void ieee80211s_stop(void)
37 kmem_cache_destroy(rm_cache); 37 kmem_cache_destroy(rm_cache);
38} 38}
39 39
40static void ieee80211_mesh_housekeeping_timer(unsigned long data) 40static void ieee80211_mesh_housekeeping_timer(struct timer_list *t)
41{ 41{
42 struct ieee80211_sub_if_data *sdata = (void *) data; 42 struct ieee80211_sub_if_data *sdata =
43 from_timer(sdata, t, u.mesh.housekeeping_timer);
43 struct ieee80211_local *local = sdata->local; 44 struct ieee80211_local *local = sdata->local;
44 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 45 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
45 46
@@ -528,18 +529,18 @@ int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata,
528 return 0; 529 return 0;
529} 530}
530 531
531static void ieee80211_mesh_path_timer(unsigned long data) 532static void ieee80211_mesh_path_timer(struct timer_list *t)
532{ 533{
533 struct ieee80211_sub_if_data *sdata = 534 struct ieee80211_sub_if_data *sdata =
534 (struct ieee80211_sub_if_data *) data; 535 from_timer(sdata, t, u.mesh.mesh_path_timer);
535 536
536 ieee80211_queue_work(&sdata->local->hw, &sdata->work); 537 ieee80211_queue_work(&sdata->local->hw, &sdata->work);
537} 538}
538 539
539static void ieee80211_mesh_path_root_timer(unsigned long data) 540static void ieee80211_mesh_path_root_timer(struct timer_list *t)
540{ 541{
541 struct ieee80211_sub_if_data *sdata = 542 struct ieee80211_sub_if_data *sdata =
542 (struct ieee80211_sub_if_data *) data; 543 from_timer(sdata, t, u.mesh.mesh_path_root_timer);
543 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 544 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
544 545
545 set_bit(MESH_WORK_ROOT, &ifmsh->wrkq_flags); 546 set_bit(MESH_WORK_ROOT, &ifmsh->wrkq_flags);
@@ -1442,9 +1443,8 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
1442 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 1443 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
1443 static u8 zero_addr[ETH_ALEN] = {}; 1444 static u8 zero_addr[ETH_ALEN] = {};
1444 1445
1445 setup_timer(&ifmsh->housekeeping_timer, 1446 timer_setup(&ifmsh->housekeeping_timer,
1446 ieee80211_mesh_housekeeping_timer, 1447 ieee80211_mesh_housekeeping_timer, 0);
1447 (unsigned long) sdata);
1448 1448
1449 ifmsh->accepting_plinks = true; 1449 ifmsh->accepting_plinks = true;
1450 atomic_set(&ifmsh->mpaths, 0); 1450 atomic_set(&ifmsh->mpaths, 0);
@@ -1458,12 +1458,9 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
1458 1458
1459 mesh_pathtbl_init(sdata); 1459 mesh_pathtbl_init(sdata);
1460 1460
1461 setup_timer(&ifmsh->mesh_path_timer, 1461 timer_setup(&ifmsh->mesh_path_timer, ieee80211_mesh_path_timer, 0);
1462 ieee80211_mesh_path_timer, 1462 timer_setup(&ifmsh->mesh_path_root_timer,
1463 (unsigned long) sdata); 1463 ieee80211_mesh_path_root_timer, 0);
1464 setup_timer(&ifmsh->mesh_path_root_timer,
1465 ieee80211_mesh_path_root_timer,
1466 (unsigned long) sdata);
1467 INIT_LIST_HEAD(&ifmsh->preq_queue.list); 1464 INIT_LIST_HEAD(&ifmsh->preq_queue.list);
1468 skb_queue_head_init(&ifmsh->ps.bc_buf); 1465 skb_queue_head_init(&ifmsh->ps.bc_buf);
1469 spin_lock_init(&ifmsh->mesh_preq_queue_lock); 1466 spin_lock_init(&ifmsh->mesh_preq_queue_lock);
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 465b7853edc0..ee56f18cad3f 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -296,7 +296,7 @@ void mesh_path_tx_pending(struct mesh_path *mpath);
296int mesh_pathtbl_init(struct ieee80211_sub_if_data *sdata); 296int mesh_pathtbl_init(struct ieee80211_sub_if_data *sdata);
297void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata); 297void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata);
298int mesh_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr); 298int mesh_path_del(struct ieee80211_sub_if_data *sdata, const u8 *addr);
299void mesh_path_timer(unsigned long data); 299void mesh_path_timer(struct timer_list *t);
300void mesh_path_flush_by_nexthop(struct sta_info *sta); 300void mesh_path_flush_by_nexthop(struct sta_info *sta);
301void mesh_path_discard_frame(struct ieee80211_sub_if_data *sdata, 301void mesh_path_discard_frame(struct ieee80211_sub_if_data *sdata,
302 struct sk_buff *skb); 302 struct sk_buff *skb);
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 146ec6c0f12f..4f7826d7b47c 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -1194,9 +1194,9 @@ endlookup:
1194 return err; 1194 return err;
1195} 1195}
1196 1196
1197void mesh_path_timer(unsigned long data) 1197void mesh_path_timer(struct timer_list *t)
1198{ 1198{
1199 struct mesh_path *mpath = (void *) data; 1199 struct mesh_path *mpath = from_timer(mpath, t, timer);
1200 struct ieee80211_sub_if_data *sdata = mpath->sdata; 1200 struct ieee80211_sub_if_data *sdata = mpath->sdata;
1201 int ret; 1201 int ret;
1202 1202
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 97269caafecd..86c8dfef56a4 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -399,8 +399,7 @@ struct mesh_path *mesh_path_new(struct ieee80211_sub_if_data *sdata,
399 skb_queue_head_init(&new_mpath->frame_queue); 399 skb_queue_head_init(&new_mpath->frame_queue);
400 new_mpath->exp_time = jiffies; 400 new_mpath->exp_time = jiffies;
401 spin_lock_init(&new_mpath->state_lock); 401 spin_lock_init(&new_mpath->state_lock);
402 setup_timer(&new_mpath->timer, mesh_path_timer, 402 timer_setup(&new_mpath->timer, mesh_path_timer, 0);
403 (unsigned long) new_mpath);
404 403
405 return new_mpath; 404 return new_mpath;
406} 405}
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index e4ededa1909d..04460440d731 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1066,10 +1066,10 @@ void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success)
1066} 1066}
1067EXPORT_SYMBOL(ieee80211_chswitch_done); 1067EXPORT_SYMBOL(ieee80211_chswitch_done);
1068 1068
1069static void ieee80211_chswitch_timer(unsigned long data) 1069static void ieee80211_chswitch_timer(struct timer_list *t)
1070{ 1070{
1071 struct ieee80211_sub_if_data *sdata = 1071 struct ieee80211_sub_if_data *sdata =
1072 (struct ieee80211_sub_if_data *) data; 1072 from_timer(sdata, t, u.mgd.chswitch_timer);
1073 1073
1074 ieee80211_queue_work(&sdata->local->hw, &sdata->u.mgd.chswitch_work); 1074 ieee80211_queue_work(&sdata->local->hw, &sdata->u.mgd.chswitch_work);
1075} 1075}
@@ -1577,9 +1577,9 @@ void ieee80211_dynamic_ps_enable_work(struct work_struct *work)
1577 } 1577 }
1578} 1578}
1579 1579
1580void ieee80211_dynamic_ps_timer(unsigned long data) 1580void ieee80211_dynamic_ps_timer(struct timer_list *t)
1581{ 1581{
1582 struct ieee80211_local *local = (void *) data; 1582 struct ieee80211_local *local = from_timer(local, t, dynamic_ps_timer);
1583 1583
1584 ieee80211_queue_work(&local->hw, &local->dynamic_ps_enable_work); 1584 ieee80211_queue_work(&local->hw, &local->dynamic_ps_enable_work);
1585} 1585}
@@ -3711,10 +3711,10 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
3711 sdata_unlock(sdata); 3711 sdata_unlock(sdata);
3712} 3712}
3713 3713
3714static void ieee80211_sta_timer(unsigned long data) 3714static void ieee80211_sta_timer(struct timer_list *t)
3715{ 3715{
3716 struct ieee80211_sub_if_data *sdata = 3716 struct ieee80211_sub_if_data *sdata =
3717 (struct ieee80211_sub_if_data *) data; 3717 from_timer(sdata, t, u.mgd.timer);
3718 3718
3719 ieee80211_queue_work(&sdata->local->hw, &sdata->work); 3719 ieee80211_queue_work(&sdata->local->hw, &sdata->work);
3720} 3720}
@@ -3991,10 +3991,10 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
3991 sdata_unlock(sdata); 3991 sdata_unlock(sdata);
3992} 3992}
3993 3993
3994static void ieee80211_sta_bcn_mon_timer(unsigned long data) 3994static void ieee80211_sta_bcn_mon_timer(struct timer_list *t)
3995{ 3995{
3996 struct ieee80211_sub_if_data *sdata = 3996 struct ieee80211_sub_if_data *sdata =
3997 (struct ieee80211_sub_if_data *) data; 3997 from_timer(sdata, t, u.mgd.bcn_mon_timer);
3998 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 3998 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
3999 3999
4000 if (sdata->vif.csa_active && !ifmgd->csa_waiting_bcn) 4000 if (sdata->vif.csa_active && !ifmgd->csa_waiting_bcn)
@@ -4005,10 +4005,10 @@ static void ieee80211_sta_bcn_mon_timer(unsigned long data)
4005 &sdata->u.mgd.beacon_connection_loss_work); 4005 &sdata->u.mgd.beacon_connection_loss_work);
4006} 4006}
4007 4007
4008static void ieee80211_sta_conn_mon_timer(unsigned long data) 4008static void ieee80211_sta_conn_mon_timer(struct timer_list *t)
4009{ 4009{
4010 struct ieee80211_sub_if_data *sdata = 4010 struct ieee80211_sub_if_data *sdata =
4011 (struct ieee80211_sub_if_data *) data; 4011 from_timer(sdata, t, u.mgd.conn_mon_timer);
4012 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 4012 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4013 struct ieee80211_local *local = sdata->local; 4013 struct ieee80211_local *local = sdata->local;
4014 4014
@@ -4139,14 +4139,10 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
4139 INIT_WORK(&ifmgd->request_smps_work, ieee80211_request_smps_mgd_work); 4139 INIT_WORK(&ifmgd->request_smps_work, ieee80211_request_smps_mgd_work);
4140 INIT_DELAYED_WORK(&ifmgd->tdls_peer_del_work, 4140 INIT_DELAYED_WORK(&ifmgd->tdls_peer_del_work,
4141 ieee80211_tdls_peer_del_work); 4141 ieee80211_tdls_peer_del_work);
4142 setup_timer(&ifmgd->timer, ieee80211_sta_timer, 4142 timer_setup(&ifmgd->timer, ieee80211_sta_timer, 0);
4143 (unsigned long) sdata); 4143 timer_setup(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer, 0);
4144 setup_timer(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer, 4144 timer_setup(&ifmgd->conn_mon_timer, ieee80211_sta_conn_mon_timer, 0);
4145 (unsigned long) sdata); 4145 timer_setup(&ifmgd->chswitch_timer, ieee80211_chswitch_timer, 0);
4146 setup_timer(&ifmgd->conn_mon_timer, ieee80211_sta_conn_mon_timer,
4147 (unsigned long) sdata);
4148 setup_timer(&ifmgd->chswitch_timer, ieee80211_chswitch_timer,
4149 (unsigned long) sdata);
4150 INIT_DELAYED_WORK(&ifmgd->tx_tspec_wk, 4146 INIT_DELAYED_WORK(&ifmgd->tx_tspec_wk,
4151 ieee80211_sta_handle_tspec_ac_params_wk); 4147 ieee80211_sta_handle_tspec_ac_params_wk);
4152 4148
diff --git a/net/mac80211/ocb.c b/net/mac80211/ocb.c
index 88e6ebbbe24f..d351dc1162be 100644
--- a/net/mac80211/ocb.c
+++ b/net/mac80211/ocb.c
@@ -150,9 +150,10 @@ void ieee80211_ocb_work(struct ieee80211_sub_if_data *sdata)
150 sdata_unlock(sdata); 150 sdata_unlock(sdata);
151} 151}
152 152
153static void ieee80211_ocb_housekeeping_timer(unsigned long data) 153static void ieee80211_ocb_housekeeping_timer(struct timer_list *t)
154{ 154{
155 struct ieee80211_sub_if_data *sdata = (void *)data; 155 struct ieee80211_sub_if_data *sdata =
156 from_timer(sdata, t, u.ocb.housekeeping_timer);
156 struct ieee80211_local *local = sdata->local; 157 struct ieee80211_local *local = sdata->local;
157 struct ieee80211_if_ocb *ifocb = &sdata->u.ocb; 158 struct ieee80211_if_ocb *ifocb = &sdata->u.ocb;
158 159
@@ -165,9 +166,8 @@ void ieee80211_ocb_setup_sdata(struct ieee80211_sub_if_data *sdata)
165{ 166{
166 struct ieee80211_if_ocb *ifocb = &sdata->u.ocb; 167 struct ieee80211_if_ocb *ifocb = &sdata->u.ocb;
167 168
168 setup_timer(&ifocb->housekeeping_timer, 169 timer_setup(&ifocb->housekeeping_timer,
169 ieee80211_ocb_housekeeping_timer, 170 ieee80211_ocb_housekeeping_timer, 0);
170 (unsigned long)sdata);
171 INIT_LIST_HEAD(&ifocb->incomplete_stations); 171 INIT_LIST_HEAD(&ifocb->incomplete_stations);
172 spin_lock_init(&ifocb->incomplete_lock); 172 spin_lock_init(&ifocb->incomplete_lock);
173} 173}
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index a3060e55122c..0c5627f8a104 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -379,14 +379,6 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
379 if (sta_prepare_rate_control(local, sta, gfp)) 379 if (sta_prepare_rate_control(local, sta, gfp))
380 goto free_txq; 380 goto free_txq;
381 381
382 for (i = 0; i < IEEE80211_NUM_TIDS; i++) {
383 /*
384 * timer_to_tid must be initialized with identity mapping
385 * to enable session_timer's data differentiation. See
386 * sta_rx_agg_session_timer_expired for usage.
387 */
388 sta->timer_to_tid[i] = i;
389 }
390 for (i = 0; i < IEEE80211_NUM_ACS; i++) { 382 for (i = 0; i < IEEE80211_NUM_ACS; i++) {
391 skb_queue_head_init(&sta->ps_tx_buf[i]); 383 skb_queue_head_init(&sta->ps_tx_buf[i]);
392 skb_queue_head_init(&sta->tx_filtered[i]); 384 skb_queue_head_init(&sta->tx_filtered[i]);
@@ -1064,9 +1056,9 @@ int sta_info_destroy_addr_bss(struct ieee80211_sub_if_data *sdata,
1064 return ret; 1056 return ret;
1065} 1057}
1066 1058
1067static void sta_info_cleanup(unsigned long data) 1059static void sta_info_cleanup(struct timer_list *t)
1068{ 1060{
1069 struct ieee80211_local *local = (struct ieee80211_local *) data; 1061 struct ieee80211_local *local = from_timer(local, t, sta_cleanup);
1070 struct sta_info *sta; 1062 struct sta_info *sta;
1071 bool timer_needed = false; 1063 bool timer_needed = false;
1072 1064
@@ -1098,8 +1090,7 @@ int sta_info_init(struct ieee80211_local *local)
1098 mutex_init(&local->sta_mtx); 1090 mutex_init(&local->sta_mtx);
1099 INIT_LIST_HEAD(&local->sta_list); 1091 INIT_LIST_HEAD(&local->sta_list);
1100 1092
1101 setup_timer(&local->sta_cleanup, sta_info_cleanup, 1093 timer_setup(&local->sta_cleanup, sta_info_cleanup, 0);
1102 (unsigned long)local);
1103 return 0; 1094 return 0;
1104} 1095}
1105 1096
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 5c54acd10562..cd53619435b6 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -126,6 +126,8 @@ enum ieee80211_agg_stop_reason {
126 AGG_STOP_DESTROY_STA, 126 AGG_STOP_DESTROY_STA,
127}; 127};
128 128
129struct sta_info;
130
129/** 131/**
130 * struct tid_ampdu_tx - TID aggregation information (Tx). 132 * struct tid_ampdu_tx - TID aggregation information (Tx).
131 * 133 *
@@ -133,8 +135,10 @@ enum ieee80211_agg_stop_reason {
133 * @session_timer: check if we keep Tx-ing on the TID (by timeout value) 135 * @session_timer: check if we keep Tx-ing on the TID (by timeout value)
134 * @addba_resp_timer: timer for peer's response to addba request 136 * @addba_resp_timer: timer for peer's response to addba request
135 * @pending: pending frames queue -- use sta's spinlock to protect 137 * @pending: pending frames queue -- use sta's spinlock to protect
138 * @sta: station we are attached to
136 * @dialog_token: dialog token for aggregation session 139 * @dialog_token: dialog token for aggregation session
137 * @timeout: session timeout value to be filled in ADDBA requests 140 * @timeout: session timeout value to be filled in ADDBA requests
141 * @tid: TID number
138 * @state: session state (see above) 142 * @state: session state (see above)
139 * @last_tx: jiffies of last tx activity 143 * @last_tx: jiffies of last tx activity
140 * @stop_initiator: initiator of a session stop 144 * @stop_initiator: initiator of a session stop
@@ -158,6 +162,7 @@ struct tid_ampdu_tx {
158 struct timer_list session_timer; 162 struct timer_list session_timer;
159 struct timer_list addba_resp_timer; 163 struct timer_list addba_resp_timer;
160 struct sk_buff_head pending; 164 struct sk_buff_head pending;
165 struct sta_info *sta;
161 unsigned long state; 166 unsigned long state;
162 unsigned long last_tx; 167 unsigned long last_tx;
163 u16 timeout; 168 u16 timeout;
@@ -169,6 +174,7 @@ struct tid_ampdu_tx {
169 u16 failed_bar_ssn; 174 u16 failed_bar_ssn;
170 bool bar_pending; 175 bool bar_pending;
171 bool amsdu; 176 bool amsdu;
177 u8 tid;
172}; 178};
173 179
174/** 180/**
@@ -181,12 +187,14 @@ struct tid_ampdu_tx {
181 * @reorder_time: jiffies when skb was added 187 * @reorder_time: jiffies when skb was added
182 * @session_timer: check if peer keeps Tx-ing on the TID (by timeout value) 188 * @session_timer: check if peer keeps Tx-ing on the TID (by timeout value)
183 * @reorder_timer: releases expired frames from the reorder buffer. 189 * @reorder_timer: releases expired frames from the reorder buffer.
190 * @sta: station we are attached to
184 * @last_rx: jiffies of last rx activity 191 * @last_rx: jiffies of last rx activity
185 * @head_seq_num: head sequence number in reordering buffer. 192 * @head_seq_num: head sequence number in reordering buffer.
186 * @stored_mpdu_num: number of MPDUs in reordering buffer 193 * @stored_mpdu_num: number of MPDUs in reordering buffer
187 * @ssn: Starting Sequence Number expected to be aggregated. 194 * @ssn: Starting Sequence Number expected to be aggregated.
188 * @buf_size: buffer size for incoming A-MPDUs 195 * @buf_size: buffer size for incoming A-MPDUs
189 * @timeout: reset timer value (in TUs). 196 * @timeout: reset timer value (in TUs).
197 * @tid: TID number
190 * @rcu_head: RCU head used for freeing this struct 198 * @rcu_head: RCU head used for freeing this struct
191 * @reorder_lock: serializes access to reorder buffer, see below. 199 * @reorder_lock: serializes access to reorder buffer, see below.
192 * @auto_seq: used for offloaded BA sessions to automatically pick head_seq_and 200 * @auto_seq: used for offloaded BA sessions to automatically pick head_seq_and
@@ -208,6 +216,7 @@ struct tid_ampdu_rx {
208 u64 reorder_buf_filtered; 216 u64 reorder_buf_filtered;
209 struct sk_buff_head *reorder_buf; 217 struct sk_buff_head *reorder_buf;
210 unsigned long *reorder_time; 218 unsigned long *reorder_time;
219 struct sta_info *sta;
211 struct timer_list session_timer; 220 struct timer_list session_timer;
212 struct timer_list reorder_timer; 221 struct timer_list reorder_timer;
213 unsigned long last_rx; 222 unsigned long last_rx;
@@ -216,6 +225,7 @@ struct tid_ampdu_rx {
216 u16 ssn; 225 u16 ssn;
217 u16 buf_size; 226 u16 buf_size;
218 u16 timeout; 227 u16 timeout;
228 u8 tid;
219 u8 auto_seq:1, 229 u8 auto_seq:1,
220 removed:1, 230 removed:1,
221 started:1; 231 started:1;
@@ -447,7 +457,6 @@ struct ieee80211_sta_rx_stats {
447 * plus one for non-QoS frames) 457 * plus one for non-QoS frames)
448 * @tid_seq: per-TID sequence numbers for sending to this STA 458 * @tid_seq: per-TID sequence numbers for sending to this STA
449 * @ampdu_mlme: A-MPDU state machine state 459 * @ampdu_mlme: A-MPDU state machine state
450 * @timer_to_tid: identity mapping to ID timers
451 * @mesh: mesh STA information 460 * @mesh: mesh STA information
452 * @debugfs_dir: debug filesystem directory dentry 461 * @debugfs_dir: debug filesystem directory dentry
453 * @dead: set to true when sta is unlinked 462 * @dead: set to true when sta is unlinked
@@ -554,7 +563,6 @@ struct sta_info {
554 * Aggregation information, locked with lock. 563 * Aggregation information, locked with lock.
555 */ 564 */
556 struct sta_ampdu_mlme ampdu_mlme; 565 struct sta_ampdu_mlme ampdu_mlme;
557 u8 timer_to_tid[IEEE80211_NUM_TIDS];
558 566
559#ifdef CONFIG_MAC80211_DEBUGFS 567#ifdef CONFIG_MAC80211_DEBUGFS
560 struct dentry *debugfs_dir; 568 struct dentry *debugfs_dir;
diff --git a/net/tipc/group.c b/net/tipc/group.c
index 7821085a7dd8..12777cac638a 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -539,8 +539,8 @@ void tipc_group_filter_msg(struct tipc_group *grp, struct sk_buff_head *inputq,
539 tipc_group_proto_xmit(grp, m, GRP_ACK_MSG, xmitq); 539 tipc_group_proto_xmit(grp, m, GRP_ACK_MSG, xmitq);
540 540
541 if (leave) { 541 if (leave) {
542 tipc_group_delete_member(grp, m);
543 __skb_queue_purge(defq); 542 __skb_queue_purge(defq);
543 tipc_group_delete_member(grp, m);
544 break; 544 break;
545 } 545 }
546 if (!update) 546 if (!update)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a0e1951227fa..b1ac23ca20c8 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2605,10 +2605,32 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flag
2605 goto nla_put_failure; 2605 goto nla_put_failure;
2606 } 2606 }
2607 2607
2608 if (wdev->ssid_len) { 2608 wdev_lock(wdev);
2609 if (nla_put(msg, NL80211_ATTR_SSID, wdev->ssid_len, wdev->ssid)) 2609 switch (wdev->iftype) {
2610 case NL80211_IFTYPE_AP:
2611 if (wdev->ssid_len &&
2612 nla_put(msg, NL80211_ATTR_SSID, wdev->ssid_len, wdev->ssid))
2610 goto nla_put_failure; 2613 goto nla_put_failure;
2614 break;
2615 case NL80211_IFTYPE_STATION:
2616 case NL80211_IFTYPE_P2P_CLIENT:
2617 case NL80211_IFTYPE_ADHOC: {
2618 const u8 *ssid_ie;
2619 if (!wdev->current_bss)
2620 break;
2621 ssid_ie = ieee80211_bss_get_ie(&wdev->current_bss->pub,
2622 WLAN_EID_SSID);
2623 if (!ssid_ie)
2624 break;
2625 if (nla_put(msg, NL80211_ATTR_SSID, ssid_ie[1], ssid_ie + 2))
2626 goto nla_put_failure;
2627 break;
2628 }
2629 default:
2630 /* nothing */
2631 break;
2611 } 2632 }
2633 wdev_unlock(wdev);
2612 2634
2613 genlmsg_end(msg, hdr); 2635 genlmsg_end(msg, hdr);
2614 return 0; 2636 return 0;
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 3871998059de..78e71b0390be 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -3644,27 +3644,14 @@ void regulatory_propagate_dfs_state(struct wiphy *wiphy,
3644 } 3644 }
3645} 3645}
3646 3646
3647int __init regulatory_init(void) 3647static int __init regulatory_init_db(void)
3648{ 3648{
3649 int err = 0; 3649 int err;
3650 3650
3651 err = load_builtin_regdb_keys(); 3651 err = load_builtin_regdb_keys();
3652 if (err) 3652 if (err)
3653 return err; 3653 return err;
3654 3654
3655 reg_pdev = platform_device_register_simple("regulatory", 0, NULL, 0);
3656 if (IS_ERR(reg_pdev))
3657 return PTR_ERR(reg_pdev);
3658
3659 spin_lock_init(&reg_requests_lock);
3660 spin_lock_init(&reg_pending_beacons_lock);
3661 spin_lock_init(&reg_indoor_lock);
3662
3663 rcu_assign_pointer(cfg80211_regdomain, cfg80211_world_regdom);
3664
3665 user_alpha2[0] = '9';
3666 user_alpha2[1] = '7';
3667
3668 /* We always try to get an update for the static regdomain */ 3655 /* We always try to get an update for the static regdomain */
3669 err = regulatory_hint_core(cfg80211_world_regdom->alpha2); 3656 err = regulatory_hint_core(cfg80211_world_regdom->alpha2);
3670 if (err) { 3657 if (err) {
@@ -3692,6 +3679,31 @@ int __init regulatory_init(void)
3692 3679
3693 return 0; 3680 return 0;
3694} 3681}
3682#ifndef MODULE
3683late_initcall(regulatory_init_db);
3684#endif
3685
3686int __init regulatory_init(void)
3687{
3688 reg_pdev = platform_device_register_simple("regulatory", 0, NULL, 0);
3689 if (IS_ERR(reg_pdev))
3690 return PTR_ERR(reg_pdev);
3691
3692 spin_lock_init(&reg_requests_lock);
3693 spin_lock_init(&reg_pending_beacons_lock);
3694 spin_lock_init(&reg_indoor_lock);
3695
3696 rcu_assign_pointer(cfg80211_regdomain, cfg80211_world_regdom);
3697
3698 user_alpha2[0] = '9';
3699 user_alpha2[1] = '7';
3700
3701#ifdef MODULE
3702 return regulatory_init_db();
3703#else
3704 return 0;
3705#endif
3706}
3695 3707
3696void regulatory_exit(void) 3708void regulatory_exit(void)
3697{ 3709{