diff options
84 files changed, 656 insertions, 291 deletions
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c index a746ba272f04..a956053608f9 100644 --- a/drivers/net/arcnet/arcnet.c +++ b/drivers/net/arcnet/arcnet.c | |||
@@ -1007,7 +1007,7 @@ static void arcnet_rx(struct net_device *dev, int bufnum) | |||
1007 | 1007 | ||
1008 | soft = &pkt.soft.rfc1201; | 1008 | soft = &pkt.soft.rfc1201; |
1009 | 1009 | ||
1010 | lp->hw.copy_from_card(dev, bufnum, 0, &pkt, sizeof(ARC_HDR_SIZE)); | 1010 | lp->hw.copy_from_card(dev, bufnum, 0, &pkt, ARC_HDR_SIZE); |
1011 | if (pkt.hard.offset[0]) { | 1011 | if (pkt.hard.offset[0]) { |
1012 | ofs = pkt.hard.offset[0]; | 1012 | ofs = pkt.hard.offset[0]; |
1013 | length = 256 - ofs; | 1013 | length = 256 - ofs; |
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c index 6aa7b3266c80..ac6177d3befc 100644 --- a/drivers/net/can/usb/esd_usb2.c +++ b/drivers/net/can/usb/esd_usb2.c | |||
@@ -412,10 +412,20 @@ static void esd_usb2_read_bulk_callback(struct urb *urb) | |||
412 | 412 | ||
413 | switch (msg->msg.hdr.cmd) { | 413 | switch (msg->msg.hdr.cmd) { |
414 | case CMD_CAN_RX: | 414 | case CMD_CAN_RX: |
415 | if (msg->msg.rx.net >= dev->net_count) { | ||
416 | dev_err(dev->udev->dev.parent, "format error\n"); | ||
417 | break; | ||
418 | } | ||
419 | |||
415 | esd_usb2_rx_can_msg(dev->nets[msg->msg.rx.net], msg); | 420 | esd_usb2_rx_can_msg(dev->nets[msg->msg.rx.net], msg); |
416 | break; | 421 | break; |
417 | 422 | ||
418 | case CMD_CAN_TX: | 423 | case CMD_CAN_TX: |
424 | if (msg->msg.txdone.net >= dev->net_count) { | ||
425 | dev_err(dev->udev->dev.parent, "format error\n"); | ||
426 | break; | ||
427 | } | ||
428 | |||
419 | esd_usb2_tx_done_msg(dev->nets[msg->msg.txdone.net], | 429 | esd_usb2_tx_done_msg(dev->nets[msg->msg.txdone.net], |
420 | msg); | 430 | msg); |
421 | break; | 431 | break; |
diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c index cbd388eea682..8becd3d838b5 100644 --- a/drivers/net/can/usb/usb_8dev.c +++ b/drivers/net/can/usb/usb_8dev.c | |||
@@ -779,6 +779,7 @@ static int usb_8dev_start(struct usb_8dev_priv *priv) | |||
779 | usb_unanchor_urb(urb); | 779 | usb_unanchor_urb(urb); |
780 | usb_free_coherent(priv->udev, RX_BUFFER_SIZE, buf, | 780 | usb_free_coherent(priv->udev, RX_BUFFER_SIZE, buf, |
781 | urb->transfer_dma); | 781 | urb->transfer_dma); |
782 | usb_free_urb(urb); | ||
782 | break; | 783 | break; |
783 | } | 784 | } |
784 | 785 | ||
diff --git a/drivers/net/ethernet/allwinner/Kconfig b/drivers/net/ethernet/allwinner/Kconfig index 53ad213e865b..d8d95d4cd45a 100644 --- a/drivers/net/ethernet/allwinner/Kconfig +++ b/drivers/net/ethernet/allwinner/Kconfig | |||
@@ -3,19 +3,20 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | config NET_VENDOR_ALLWINNER | 5 | config NET_VENDOR_ALLWINNER |
6 | bool "Allwinner devices" | 6 | bool "Allwinner devices" |
7 | default y | 7 | default y |
8 | depends on ARCH_SUNXI | ||
9 | ---help--- | ||
10 | If you have a network (Ethernet) card belonging to this | ||
11 | class, say Y and read the Ethernet-HOWTO, available from | ||
12 | <http://www.tldp.org/docs.html#howto>. | ||
13 | 8 | ||
14 | Note that the answer to this question doesn't directly | 9 | depends on ARCH_SUNXI |
15 | affect the kernel: saying N will just cause the configurator | 10 | ---help--- |
16 | to skip all the questions about Allwinner cards. If you say Y, | 11 | If you have a network (Ethernet) card belonging to this |
17 | you will be asked for your specific card in the following | 12 | class, say Y and read the Ethernet-HOWTO, available from |
18 | questions. | 13 | <http://www.tldp.org/docs.html#howto>. |
14 | |||
15 | Note that the answer to this question doesn't directly | ||
16 | affect the kernel: saying N will just cause the configurator | ||
17 | to skip all the questions about Allwinner cards. If you say Y, | ||
18 | you will be asked for your specific card in the following | ||
19 | questions. | ||
19 | 20 | ||
20 | if NET_VENDOR_ALLWINNER | 21 | if NET_VENDOR_ALLWINNER |
21 | 22 | ||
@@ -26,6 +27,7 @@ config SUN4I_EMAC | |||
26 | select CRC32 | 27 | select CRC32 |
27 | select MII | 28 | select MII |
28 | select PHYLIB | 29 | select PHYLIB |
30 | select MDIO_SUN4I | ||
29 | ---help--- | 31 | ---help--- |
30 | Support for Allwinner A10 EMAC ethernet driver. | 32 | Support for Allwinner A10 EMAC ethernet driver. |
31 | 33 | ||
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c.h b/drivers/net/ethernet/atheros/atl1c/atl1c.h index b2bf324631dc..0f0556526ba9 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c.h +++ b/drivers/net/ethernet/atheros/atl1c/atl1c.h | |||
@@ -520,6 +520,9 @@ struct atl1c_adapter { | |||
520 | struct net_device *netdev; | 520 | struct net_device *netdev; |
521 | struct pci_dev *pdev; | 521 | struct pci_dev *pdev; |
522 | struct napi_struct napi; | 522 | struct napi_struct napi; |
523 | struct page *rx_page; | ||
524 | unsigned int rx_page_offset; | ||
525 | unsigned int rx_frag_size; | ||
523 | struct atl1c_hw hw; | 526 | struct atl1c_hw hw; |
524 | struct atl1c_hw_stats hw_stats; | 527 | struct atl1c_hw_stats hw_stats; |
525 | struct mii_if_info mii; /* MII interface info */ | 528 | struct mii_if_info mii; /* MII interface info */ |
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c index 786a87483298..a36a760ada28 100644 --- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c | |||
@@ -481,10 +481,15 @@ static int atl1c_set_mac_addr(struct net_device *netdev, void *p) | |||
481 | static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter, | 481 | static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter, |
482 | struct net_device *dev) | 482 | struct net_device *dev) |
483 | { | 483 | { |
484 | unsigned int head_size; | ||
484 | int mtu = dev->mtu; | 485 | int mtu = dev->mtu; |
485 | 486 | ||
486 | adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ? | 487 | adapter->rx_buffer_len = mtu > AT_RX_BUF_SIZE ? |
487 | roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; | 488 | roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE; |
489 | |||
490 | head_size = SKB_DATA_ALIGN(adapter->rx_buffer_len + NET_SKB_PAD) + | ||
491 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); | ||
492 | adapter->rx_frag_size = roundup_pow_of_two(head_size); | ||
488 | } | 493 | } |
489 | 494 | ||
490 | static netdev_features_t atl1c_fix_features(struct net_device *netdev, | 495 | static netdev_features_t atl1c_fix_features(struct net_device *netdev, |
@@ -952,6 +957,10 @@ static void atl1c_free_ring_resources(struct atl1c_adapter *adapter) | |||
952 | kfree(adapter->tpd_ring[0].buffer_info); | 957 | kfree(adapter->tpd_ring[0].buffer_info); |
953 | adapter->tpd_ring[0].buffer_info = NULL; | 958 | adapter->tpd_ring[0].buffer_info = NULL; |
954 | } | 959 | } |
960 | if (adapter->rx_page) { | ||
961 | put_page(adapter->rx_page); | ||
962 | adapter->rx_page = NULL; | ||
963 | } | ||
955 | } | 964 | } |
956 | 965 | ||
957 | /** | 966 | /** |
@@ -1639,6 +1648,35 @@ static inline void atl1c_rx_checksum(struct atl1c_adapter *adapter, | |||
1639 | skb_checksum_none_assert(skb); | 1648 | skb_checksum_none_assert(skb); |
1640 | } | 1649 | } |
1641 | 1650 | ||
1651 | static struct sk_buff *atl1c_alloc_skb(struct atl1c_adapter *adapter) | ||
1652 | { | ||
1653 | struct sk_buff *skb; | ||
1654 | struct page *page; | ||
1655 | |||
1656 | if (adapter->rx_frag_size > PAGE_SIZE) | ||
1657 | return netdev_alloc_skb(adapter->netdev, | ||
1658 | adapter->rx_buffer_len); | ||
1659 | |||
1660 | page = adapter->rx_page; | ||
1661 | if (!page) { | ||
1662 | adapter->rx_page = page = alloc_page(GFP_ATOMIC); | ||
1663 | if (unlikely(!page)) | ||
1664 | return NULL; | ||
1665 | adapter->rx_page_offset = 0; | ||
1666 | } | ||
1667 | |||
1668 | skb = build_skb(page_address(page) + adapter->rx_page_offset, | ||
1669 | adapter->rx_frag_size); | ||
1670 | if (likely(skb)) { | ||
1671 | adapter->rx_page_offset += adapter->rx_frag_size; | ||
1672 | if (adapter->rx_page_offset >= PAGE_SIZE) | ||
1673 | adapter->rx_page = NULL; | ||
1674 | else | ||
1675 | get_page(page); | ||
1676 | } | ||
1677 | return skb; | ||
1678 | } | ||
1679 | |||
1642 | static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter) | 1680 | static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter) |
1643 | { | 1681 | { |
1644 | struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring; | 1682 | struct atl1c_rfd_ring *rfd_ring = &adapter->rfd_ring; |
@@ -1660,7 +1698,7 @@ static int atl1c_alloc_rx_buffer(struct atl1c_adapter *adapter) | |||
1660 | while (next_info->flags & ATL1C_BUFFER_FREE) { | 1698 | while (next_info->flags & ATL1C_BUFFER_FREE) { |
1661 | rfd_desc = ATL1C_RFD_DESC(rfd_ring, rfd_next_to_use); | 1699 | rfd_desc = ATL1C_RFD_DESC(rfd_ring, rfd_next_to_use); |
1662 | 1700 | ||
1663 | skb = netdev_alloc_skb(adapter->netdev, adapter->rx_buffer_len); | 1701 | skb = atl1c_alloc_skb(adapter); |
1664 | if (unlikely(!skb)) { | 1702 | if (unlikely(!skb)) { |
1665 | if (netif_msg_rx_err(adapter)) | 1703 | if (netif_msg_rx_err(adapter)) |
1666 | dev_warn(&pdev->dev, "alloc rx buffer failed\n"); | 1704 | dev_warn(&pdev->dev, "alloc rx buffer failed\n"); |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index d964f302ac94..ddebc7a5dda0 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -17625,7 +17625,8 @@ err_out_free_res: | |||
17625 | pci_release_regions(pdev); | 17625 | pci_release_regions(pdev); |
17626 | 17626 | ||
17627 | err_out_disable_pdev: | 17627 | err_out_disable_pdev: |
17628 | pci_disable_device(pdev); | 17628 | if (pci_is_enabled(pdev)) |
17629 | pci_disable_device(pdev); | ||
17629 | pci_set_drvdata(pdev, NULL); | 17630 | pci_set_drvdata(pdev, NULL); |
17630 | return err; | 17631 | return err; |
17631 | } | 17632 | } |
@@ -17773,7 +17774,8 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev, | |||
17773 | 17774 | ||
17774 | rtnl_lock(); | 17775 | rtnl_lock(); |
17775 | 17776 | ||
17776 | if (!netif_running(netdev)) | 17777 | /* We probably don't have netdev yet */ |
17778 | if (!netdev || !netif_running(netdev)) | ||
17777 | goto done; | 17779 | goto done; |
17778 | 17780 | ||
17779 | tg3_phy_stop(tp); | 17781 | tg3_phy_stop(tp); |
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index 2b0a0ea4f8e7..ae236009f1a8 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h | |||
@@ -259,6 +259,7 @@ struct bufdesc_ex { | |||
259 | struct fec_enet_delayed_work { | 259 | struct fec_enet_delayed_work { |
260 | struct delayed_work delay_work; | 260 | struct delayed_work delay_work; |
261 | bool timeout; | 261 | bool timeout; |
262 | bool trig_tx; | ||
262 | }; | 263 | }; |
263 | 264 | ||
264 | /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and | 265 | /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index d3ad5ea711d3..77ea0db0bbfc 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -93,6 +93,20 @@ static void set_multicast_list(struct net_device *ndev); | |||
93 | #define FEC_QUIRK_HAS_CSUM (1 << 5) | 93 | #define FEC_QUIRK_HAS_CSUM (1 << 5) |
94 | /* Controller has hardware vlan support */ | 94 | /* Controller has hardware vlan support */ |
95 | #define FEC_QUIRK_HAS_VLAN (1 << 6) | 95 | #define FEC_QUIRK_HAS_VLAN (1 << 6) |
96 | /* ENET IP errata ERR006358 | ||
97 | * | ||
98 | * If the ready bit in the transmit buffer descriptor (TxBD[R]) is previously | ||
99 | * detected as not set during a prior frame transmission, then the | ||
100 | * ENET_TDAR[TDAR] bit is cleared at a later time, even if additional TxBDs | ||
101 | * were added to the ring and the ENET_TDAR[TDAR] bit is set. This results in | ||
102 | * If the ready bit in the transmit buffer descriptor (TxBD[R]) is previously | ||
103 | * detected as not set during a prior frame transmission, then the | ||
104 | * ENET_TDAR[TDAR] bit is cleared at a later time, even if additional TxBDs | ||
105 | * were added to the ring and the ENET_TDAR[TDAR] bit is set. This results in | ||
106 | * frames not being transmitted until there is a 0-to-1 transition on | ||
107 | * ENET_TDAR[TDAR]. | ||
108 | */ | ||
109 | #define FEC_QUIRK_ERR006358 (1 << 7) | ||
96 | 110 | ||
97 | static struct platform_device_id fec_devtype[] = { | 111 | static struct platform_device_id fec_devtype[] = { |
98 | { | 112 | { |
@@ -112,7 +126,7 @@ static struct platform_device_id fec_devtype[] = { | |||
112 | .name = "imx6q-fec", | 126 | .name = "imx6q-fec", |
113 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | | 127 | .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT | |
114 | FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | | 128 | FEC_QUIRK_HAS_BUFDESC_EX | FEC_QUIRK_HAS_CSUM | |
115 | FEC_QUIRK_HAS_VLAN, | 129 | FEC_QUIRK_HAS_VLAN | FEC_QUIRK_ERR006358, |
116 | }, { | 130 | }, { |
117 | .name = "mvf600-fec", | 131 | .name = "mvf600-fec", |
118 | .driver_data = FEC_QUIRK_ENET_MAC, | 132 | .driver_data = FEC_QUIRK_ENET_MAC, |
@@ -275,16 +289,11 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
275 | struct fec_enet_private *fep = netdev_priv(ndev); | 289 | struct fec_enet_private *fep = netdev_priv(ndev); |
276 | const struct platform_device_id *id_entry = | 290 | const struct platform_device_id *id_entry = |
277 | platform_get_device_id(fep->pdev); | 291 | platform_get_device_id(fep->pdev); |
278 | struct bufdesc *bdp; | 292 | struct bufdesc *bdp, *bdp_pre; |
279 | void *bufaddr; | 293 | void *bufaddr; |
280 | unsigned short status; | 294 | unsigned short status; |
281 | unsigned int index; | 295 | unsigned int index; |
282 | 296 | ||
283 | if (!fep->link) { | ||
284 | /* Link is down or auto-negotiation is in progress. */ | ||
285 | return NETDEV_TX_BUSY; | ||
286 | } | ||
287 | |||
288 | /* Fill in a Tx ring entry */ | 297 | /* Fill in a Tx ring entry */ |
289 | bdp = fep->cur_tx; | 298 | bdp = fep->cur_tx; |
290 | 299 | ||
@@ -370,6 +379,15 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) | |||
370 | ebdp->cbd_esc |= BD_ENET_TX_PINS; | 379 | ebdp->cbd_esc |= BD_ENET_TX_PINS; |
371 | } | 380 | } |
372 | } | 381 | } |
382 | |||
383 | bdp_pre = fec_enet_get_prevdesc(bdp, fep->bufdesc_ex); | ||
384 | if ((id_entry->driver_data & FEC_QUIRK_ERR006358) && | ||
385 | !(bdp_pre->cbd_sc & BD_ENET_TX_READY)) { | ||
386 | fep->delay_work.trig_tx = true; | ||
387 | schedule_delayed_work(&(fep->delay_work.delay_work), | ||
388 | msecs_to_jiffies(1)); | ||
389 | } | ||
390 | |||
373 | /* If this was the last BD in the ring, start at the beginning again. */ | 391 | /* If this was the last BD in the ring, start at the beginning again. */ |
374 | if (status & BD_ENET_TX_WRAP) | 392 | if (status & BD_ENET_TX_WRAP) |
375 | bdp = fep->tx_bd_base; | 393 | bdp = fep->tx_bd_base; |
@@ -689,6 +707,11 @@ static void fec_enet_work(struct work_struct *work) | |||
689 | fec_restart(fep->netdev, fep->full_duplex); | 707 | fec_restart(fep->netdev, fep->full_duplex); |
690 | netif_wake_queue(fep->netdev); | 708 | netif_wake_queue(fep->netdev); |
691 | } | 709 | } |
710 | |||
711 | if (fep->delay_work.trig_tx) { | ||
712 | fep->delay_work.trig_tx = false; | ||
713 | writel(0, fep->hwp + FEC_X_DES_ACTIVE); | ||
714 | } | ||
692 | } | 715 | } |
693 | 716 | ||
694 | static void | 717 | static void |
@@ -2279,4 +2302,5 @@ static struct platform_driver fec_driver = { | |||
2279 | 2302 | ||
2280 | module_platform_driver(fec_driver); | 2303 | module_platform_driver(fec_driver); |
2281 | 2304 | ||
2305 | MODULE_ALIAS("platform:"DRIVER_NAME); | ||
2282 | MODULE_LICENSE("GPL"); | 2306 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 6a0c1b66ce54..c1d72c03cb59 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -3739,9 +3739,8 @@ static void igb_set_rx_mode(struct net_device *netdev) | |||
3739 | rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE | E1000_RCTL_VFE); | 3739 | rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE | E1000_RCTL_VFE); |
3740 | 3740 | ||
3741 | if (netdev->flags & IFF_PROMISC) { | 3741 | if (netdev->flags & IFF_PROMISC) { |
3742 | u32 mrqc = rd32(E1000_MRQC); | ||
3743 | /* retain VLAN HW filtering if in VT mode */ | 3742 | /* retain VLAN HW filtering if in VT mode */ |
3744 | if (mrqc & E1000_MRQC_ENABLE_VMDQ) | 3743 | if (adapter->vfs_allocated_count) |
3745 | rctl |= E1000_RCTL_VFE; | 3744 | rctl |= E1000_RCTL_VFE; |
3746 | rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); | 3745 | rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); |
3747 | vmolr |= (E1000_VMOLR_ROPE | E1000_VMOLR_MPME); | 3746 | vmolr |= (E1000_VMOLR_ROPE | E1000_VMOLR_MPME); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c index ac780770863d..7a77f37a7cbc 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_82598.c | |||
@@ -108,9 +108,8 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *hw, | |||
108 | 108 | ||
109 | /* Enable arbiter */ | 109 | /* Enable arbiter */ |
110 | reg &= ~IXGBE_DPMCS_ARBDIS; | 110 | reg &= ~IXGBE_DPMCS_ARBDIS; |
111 | /* Enable DFP and Recycle mode */ | ||
112 | reg |= (IXGBE_DPMCS_TDPAC | IXGBE_DPMCS_TRM); | ||
113 | reg |= IXGBE_DPMCS_TSOEF; | 111 | reg |= IXGBE_DPMCS_TSOEF; |
112 | |||
114 | /* Configure Max TSO packet size 34KB including payload and headers */ | 113 | /* Configure Max TSO packet size 34KB including payload and headers */ |
115 | reg |= (0x4 << IXGBE_DPMCS_MTSOS_SHIFT); | 114 | reg |= (0x4 << IXGBE_DPMCS_MTSOS_SHIFT); |
116 | 115 | ||
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index 712779fb12b7..b017818bccae 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c | |||
@@ -88,6 +88,8 @@ | |||
88 | #define MVNETA_TX_IN_PRGRS BIT(1) | 88 | #define MVNETA_TX_IN_PRGRS BIT(1) |
89 | #define MVNETA_TX_FIFO_EMPTY BIT(8) | 89 | #define MVNETA_TX_FIFO_EMPTY BIT(8) |
90 | #define MVNETA_RX_MIN_FRAME_SIZE 0x247c | 90 | #define MVNETA_RX_MIN_FRAME_SIZE 0x247c |
91 | #define MVNETA_SGMII_SERDES_CFG 0x24A0 | ||
92 | #define MVNETA_SGMII_SERDES_PROTO 0x0cc7 | ||
91 | #define MVNETA_TYPE_PRIO 0x24bc | 93 | #define MVNETA_TYPE_PRIO 0x24bc |
92 | #define MVNETA_FORCE_UNI BIT(21) | 94 | #define MVNETA_FORCE_UNI BIT(21) |
93 | #define MVNETA_TXQ_CMD_1 0x24e4 | 95 | #define MVNETA_TXQ_CMD_1 0x24e4 |
@@ -655,6 +657,8 @@ static void mvneta_port_sgmii_config(struct mvneta_port *pp) | |||
655 | val = mvreg_read(pp, MVNETA_GMAC_CTRL_2); | 657 | val = mvreg_read(pp, MVNETA_GMAC_CTRL_2); |
656 | val |= MVNETA_GMAC2_PSC_ENABLE; | 658 | val |= MVNETA_GMAC2_PSC_ENABLE; |
657 | mvreg_write(pp, MVNETA_GMAC_CTRL_2, val); | 659 | mvreg_write(pp, MVNETA_GMAC_CTRL_2, val); |
660 | |||
661 | mvreg_write(pp, MVNETA_SGMII_SERDES_CFG, MVNETA_SGMII_SERDES_PROTO); | ||
658 | } | 662 | } |
659 | 663 | ||
660 | /* Start the Ethernet port RX and TX activity */ | 664 | /* Start the Ethernet port RX and TX activity */ |
@@ -2728,28 +2732,24 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2728 | 2732 | ||
2729 | pp = netdev_priv(dev); | 2733 | pp = netdev_priv(dev); |
2730 | 2734 | ||
2731 | pp->tx_done_timer.function = mvneta_tx_done_timer_callback; | ||
2732 | init_timer(&pp->tx_done_timer); | ||
2733 | clear_bit(MVNETA_F_TX_DONE_TIMER_BIT, &pp->flags); | ||
2734 | |||
2735 | pp->weight = MVNETA_RX_POLL_WEIGHT; | 2735 | pp->weight = MVNETA_RX_POLL_WEIGHT; |
2736 | pp->phy_node = phy_node; | 2736 | pp->phy_node = phy_node; |
2737 | pp->phy_interface = phy_mode; | 2737 | pp->phy_interface = phy_mode; |
2738 | 2738 | ||
2739 | pp->base = of_iomap(dn, 0); | ||
2740 | if (pp->base == NULL) { | ||
2741 | err = -ENOMEM; | ||
2742 | goto err_free_irq; | ||
2743 | } | ||
2744 | |||
2745 | pp->clk = devm_clk_get(&pdev->dev, NULL); | 2739 | pp->clk = devm_clk_get(&pdev->dev, NULL); |
2746 | if (IS_ERR(pp->clk)) { | 2740 | if (IS_ERR(pp->clk)) { |
2747 | err = PTR_ERR(pp->clk); | 2741 | err = PTR_ERR(pp->clk); |
2748 | goto err_unmap; | 2742 | goto err_free_irq; |
2749 | } | 2743 | } |
2750 | 2744 | ||
2751 | clk_prepare_enable(pp->clk); | 2745 | clk_prepare_enable(pp->clk); |
2752 | 2746 | ||
2747 | pp->base = of_iomap(dn, 0); | ||
2748 | if (pp->base == NULL) { | ||
2749 | err = -ENOMEM; | ||
2750 | goto err_clk; | ||
2751 | } | ||
2752 | |||
2753 | dt_mac_addr = of_get_mac_address(dn); | 2753 | dt_mac_addr = of_get_mac_address(dn); |
2754 | if (dt_mac_addr && is_valid_ether_addr(dt_mac_addr)) { | 2754 | if (dt_mac_addr && is_valid_ether_addr(dt_mac_addr)) { |
2755 | mac_from = "device tree"; | 2755 | mac_from = "device tree"; |
@@ -2766,6 +2766,9 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2766 | } | 2766 | } |
2767 | 2767 | ||
2768 | pp->tx_done_timer.data = (unsigned long)dev; | 2768 | pp->tx_done_timer.data = (unsigned long)dev; |
2769 | pp->tx_done_timer.function = mvneta_tx_done_timer_callback; | ||
2770 | init_timer(&pp->tx_done_timer); | ||
2771 | clear_bit(MVNETA_F_TX_DONE_TIMER_BIT, &pp->flags); | ||
2769 | 2772 | ||
2770 | pp->tx_ring_size = MVNETA_MAX_TXD; | 2773 | pp->tx_ring_size = MVNETA_MAX_TXD; |
2771 | pp->rx_ring_size = MVNETA_MAX_RXD; | 2774 | pp->rx_ring_size = MVNETA_MAX_RXD; |
@@ -2776,7 +2779,7 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2776 | err = mvneta_init(pp, phy_addr); | 2779 | err = mvneta_init(pp, phy_addr); |
2777 | if (err < 0) { | 2780 | if (err < 0) { |
2778 | dev_err(&pdev->dev, "can't init eth hal\n"); | 2781 | dev_err(&pdev->dev, "can't init eth hal\n"); |
2779 | goto err_clk; | 2782 | goto err_unmap; |
2780 | } | 2783 | } |
2781 | mvneta_port_power_up(pp, phy_mode); | 2784 | mvneta_port_power_up(pp, phy_mode); |
2782 | 2785 | ||
@@ -2806,10 +2809,10 @@ static int mvneta_probe(struct platform_device *pdev) | |||
2806 | 2809 | ||
2807 | err_deinit: | 2810 | err_deinit: |
2808 | mvneta_deinit(pp); | 2811 | mvneta_deinit(pp); |
2809 | err_clk: | ||
2810 | clk_disable_unprepare(pp->clk); | ||
2811 | err_unmap: | 2812 | err_unmap: |
2812 | iounmap(pp->base); | 2813 | iounmap(pp->base); |
2814 | err_clk: | ||
2815 | clk_disable_unprepare(pp->clk); | ||
2813 | err_free_irq: | 2816 | err_free_irq: |
2814 | irq_dispose_mapping(dev->irq); | 2817 | irq_dispose_mapping(dev->irq); |
2815 | err_free_netdev: | 2818 | err_free_netdev: |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 205753a04cfc..40374063c01e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c | |||
@@ -1113,7 +1113,13 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector) | |||
1113 | 1113 | ||
1114 | for (i = 0; i < (1 << cmd->log_sz); i++) { | 1114 | for (i = 0; i < (1 << cmd->log_sz); i++) { |
1115 | if (test_bit(i, &vector)) { | 1115 | if (test_bit(i, &vector)) { |
1116 | struct semaphore *sem; | ||
1117 | |||
1116 | ent = cmd->ent_arr[i]; | 1118 | ent = cmd->ent_arr[i]; |
1119 | if (ent->page_queue) | ||
1120 | sem = &cmd->pages_sem; | ||
1121 | else | ||
1122 | sem = &cmd->sem; | ||
1117 | ktime_get_ts(&ent->ts2); | 1123 | ktime_get_ts(&ent->ts2); |
1118 | memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); | 1124 | memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); |
1119 | dump_command(dev, ent, 0); | 1125 | dump_command(dev, ent, 0); |
@@ -1136,10 +1142,7 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector) | |||
1136 | } else { | 1142 | } else { |
1137 | complete(&ent->done); | 1143 | complete(&ent->done); |
1138 | } | 1144 | } |
1139 | if (ent->page_queue) | 1145 | up(sem); |
1140 | up(&cmd->pages_sem); | ||
1141 | else | ||
1142 | up(&cmd->sem); | ||
1143 | } | 1146 | } |
1144 | } | 1147 | } |
1145 | } | 1148 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/uar.c b/drivers/net/ethernet/mellanox/mlx5/core/uar.c index 71d4a3937200..68f5d9c77c7b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/uar.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/uar.c | |||
@@ -164,6 +164,7 @@ int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari) | |||
164 | uuari->uars[i].map = ioremap(addr, PAGE_SIZE); | 164 | uuari->uars[i].map = ioremap(addr, PAGE_SIZE); |
165 | if (!uuari->uars[i].map) { | 165 | if (!uuari->uars[i].map) { |
166 | mlx5_cmd_free_uar(dev, uuari->uars[i].index); | 166 | mlx5_cmd_free_uar(dev, uuari->uars[i].index); |
167 | err = -ENOMEM; | ||
167 | goto out_count; | 168 | goto out_count; |
168 | } | 169 | } |
169 | mlx5_core_dbg(dev, "allocated uar index 0x%x, mmaped at %p\n", | 170 | mlx5_core_dbg(dev, "allocated uar index 0x%x, mmaped at %p\n", |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig index cb22341a14a8..a588ffde9700 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig +++ b/drivers/net/ethernet/oki-semi/pch_gbe/Kconfig | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | config PCH_GBE | 5 | config PCH_GBE |
6 | tristate "OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE" | 6 | tristate "OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE" |
7 | depends on PCI | 7 | depends on PCI && (X86 || COMPILE_TEST) |
8 | select MII | 8 | select MII |
9 | select PTP_1588_CLOCK_PCH | 9 | select PTP_1588_CLOCK_PCH |
10 | ---help--- | 10 | ---help--- |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index b00cf5665eab..f4bb8f5d7453 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |||
@@ -1869,7 +1869,8 @@ static inline void qlcnic_free_mac_list(struct qlcnic_adapter *adapter) | |||
1869 | 1869 | ||
1870 | static inline void qlcnic_set_mac_filter_count(struct qlcnic_adapter *adapter) | 1870 | static inline void qlcnic_set_mac_filter_count(struct qlcnic_adapter *adapter) |
1871 | { | 1871 | { |
1872 | adapter->ahw->hw_ops->set_mac_filter_count(adapter); | 1872 | if (adapter->ahw->hw_ops->set_mac_filter_count) |
1873 | adapter->ahw->hw_ops->set_mac_filter_count(adapter); | ||
1873 | } | 1874 | } |
1874 | 1875 | ||
1875 | static inline void qlcnic_dev_request_reset(struct qlcnic_adapter *adapter, | 1876 | static inline void qlcnic_dev_request_reset(struct qlcnic_adapter *adapter, |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index 0913c623a67e..bc483e1881a3 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | |||
@@ -3014,8 +3014,8 @@ int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter, | |||
3014 | } | 3014 | } |
3015 | 3015 | ||
3016 | if (ahw->port_type == QLCNIC_XGBE) { | 3016 | if (ahw->port_type == QLCNIC_XGBE) { |
3017 | ecmd->supported = SUPPORTED_1000baseT_Full; | 3017 | ecmd->supported = SUPPORTED_10000baseT_Full; |
3018 | ecmd->advertising = ADVERTISED_1000baseT_Full; | 3018 | ecmd->advertising = ADVERTISED_10000baseT_Full; |
3019 | } else { | 3019 | } else { |
3020 | ecmd->supported = (SUPPORTED_10baseT_Half | | 3020 | ecmd->supported = (SUPPORTED_10baseT_Half | |
3021 | SUPPORTED_10baseT_Full | | 3021 | SUPPORTED_10baseT_Full | |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c index f41dfab1e9a3..51ab4b56fc91 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | |||
@@ -2123,6 +2123,8 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac) | |||
2123 | set_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status); | 2123 | set_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status); |
2124 | qlcnic_83xx_clear_function_resources(adapter); | 2124 | qlcnic_83xx_clear_function_resources(adapter); |
2125 | 2125 | ||
2126 | INIT_DELAYED_WORK(&adapter->idc_aen_work, qlcnic_83xx_idc_aen_work); | ||
2127 | |||
2126 | /* register for NIC IDC AEN Events */ | 2128 | /* register for NIC IDC AEN Events */ |
2127 | qlcnic_83xx_register_nic_idc_func(adapter, 1); | 2129 | qlcnic_83xx_register_nic_idc_func(adapter, 1); |
2128 | 2130 | ||
@@ -2140,8 +2142,6 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac) | |||
2140 | if (adapter->nic_ops->init_driver(adapter)) | 2142 | if (adapter->nic_ops->init_driver(adapter)) |
2141 | return -EIO; | 2143 | return -EIO; |
2142 | 2144 | ||
2143 | INIT_DELAYED_WORK(&adapter->idc_aen_work, qlcnic_83xx_idc_aen_work); | ||
2144 | |||
2145 | /* Periodically monitor device status */ | 2145 | /* Periodically monitor device status */ |
2146 | qlcnic_83xx_idc_poll_dev_state(&adapter->fw_work.work); | 2146 | qlcnic_83xx_idc_poll_dev_state(&adapter->fw_work.work); |
2147 | 2147 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 700a46324d09..05a847e599c6 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -1540,7 +1540,7 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) | |||
1540 | return 0; | 1540 | return 0; |
1541 | case QLCNIC_SET_QUIESCENT: | 1541 | case QLCNIC_SET_QUIESCENT: |
1542 | case QLCNIC_RESET_QUIESCENT: | 1542 | case QLCNIC_RESET_QUIESCENT: |
1543 | state = QLCRD32(adapter, QLCNIC_CRB_DEV_STATE); | 1543 | state = QLC_SHARED_REG_RD32(adapter, QLCNIC_CRB_DEV_STATE); |
1544 | if (state == QLCNIC_DEV_FAILED || (state == QLCNIC_DEV_BADBAD)) | 1544 | if (state == QLCNIC_DEV_FAILED || (state == QLCNIC_DEV_BADBAD)) |
1545 | netdev_info(netdev, "Device in FAILED state\n"); | 1545 | netdev_info(netdev, "Device in FAILED state\n"); |
1546 | return 0; | 1546 | return 0; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c index 5b5d2edf125d..4ed7e73d88d3 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | |||
@@ -516,20 +516,18 @@ void __qlcnic_set_multi(struct net_device *netdev, u16 vlan) | |||
516 | if (netdev->flags & IFF_PROMISC) { | 516 | if (netdev->flags & IFF_PROMISC) { |
517 | if (!(adapter->flags & QLCNIC_PROMISC_DISABLED)) | 517 | if (!(adapter->flags & QLCNIC_PROMISC_DISABLED)) |
518 | mode = VPORT_MISS_MODE_ACCEPT_ALL; | 518 | mode = VPORT_MISS_MODE_ACCEPT_ALL; |
519 | } else if (netdev->flags & IFF_ALLMULTI) { | 519 | } else if ((netdev->flags & IFF_ALLMULTI) || |
520 | if (netdev_mc_count(netdev) > ahw->max_mc_count) { | 520 | (netdev_mc_count(netdev) > ahw->max_mc_count)) { |
521 | mode = VPORT_MISS_MODE_ACCEPT_MULTI; | 521 | mode = VPORT_MISS_MODE_ACCEPT_MULTI; |
522 | } else if (!netdev_mc_empty(netdev) && | 522 | } else if (!netdev_mc_empty(netdev) && |
523 | !qlcnic_sriov_vf_check(adapter)) { | 523 | !qlcnic_sriov_vf_check(adapter)) { |
524 | netdev_for_each_mc_addr(ha, netdev) | 524 | netdev_for_each_mc_addr(ha, netdev) |
525 | qlcnic_nic_add_mac(adapter, ha->addr, | 525 | qlcnic_nic_add_mac(adapter, ha->addr, vlan); |
526 | vlan); | ||
527 | } | ||
528 | if (mode != VPORT_MISS_MODE_ACCEPT_MULTI && | ||
529 | qlcnic_sriov_vf_check(adapter)) | ||
530 | qlcnic_vf_add_mc_list(netdev, vlan); | ||
531 | } | 526 | } |
532 | 527 | ||
528 | if (qlcnic_sriov_vf_check(adapter)) | ||
529 | qlcnic_vf_add_mc_list(netdev, vlan); | ||
530 | |||
533 | /* configure unicast MAC address, if there is not sufficient space | 531 | /* configure unicast MAC address, if there is not sufficient space |
534 | * to store all the unicast addresses then enable promiscuous mode | 532 | * to store all the unicast addresses then enable promiscuous mode |
535 | */ | 533 | */ |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c index d28336fc65ab..a2023090e866 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c | |||
@@ -142,7 +142,7 @@ void qlcnic_release_tx_buffers(struct qlcnic_adapter *adapter) | |||
142 | buffrag->length, PCI_DMA_TODEVICE); | 142 | buffrag->length, PCI_DMA_TODEVICE); |
143 | buffrag->dma = 0ULL; | 143 | buffrag->dma = 0ULL; |
144 | } | 144 | } |
145 | for (j = 0; j < cmd_buf->frag_count; j++) { | 145 | for (j = 1; j < cmd_buf->frag_count; j++) { |
146 | buffrag++; | 146 | buffrag++; |
147 | if (buffrag->dma) { | 147 | if (buffrag->dma) { |
148 | pci_unmap_page(adapter->pdev, buffrag->dma, | 148 | pci_unmap_page(adapter->pdev, buffrag->dma, |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 4528f8ec333b..cc78d3924c6a 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -1383,6 +1383,8 @@ qlcnic_request_irq(struct qlcnic_adapter *adapter) | |||
1383 | if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { | 1383 | if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { |
1384 | if (qlcnic_82xx_check(adapter)) | 1384 | if (qlcnic_82xx_check(adapter)) |
1385 | handler = qlcnic_tmp_intr; | 1385 | handler = qlcnic_tmp_intr; |
1386 | else | ||
1387 | handler = qlcnic_83xx_tmp_intr; | ||
1386 | if (!QLCNIC_IS_MSI_FAMILY(adapter)) | 1388 | if (!QLCNIC_IS_MSI_FAMILY(adapter)) |
1387 | flags |= IRQF_SHARED; | 1389 | flags |= IRQF_SHARED; |
1388 | 1390 | ||
@@ -1531,12 +1533,12 @@ int __qlcnic_up(struct qlcnic_adapter *adapter, struct net_device *netdev) | |||
1531 | if (netdev->features & NETIF_F_LRO) | 1533 | if (netdev->features & NETIF_F_LRO) |
1532 | qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED); | 1534 | qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED); |
1533 | 1535 | ||
1536 | set_bit(__QLCNIC_DEV_UP, &adapter->state); | ||
1534 | qlcnic_napi_enable(adapter); | 1537 | qlcnic_napi_enable(adapter); |
1535 | 1538 | ||
1536 | qlcnic_linkevent_request(adapter, 1); | 1539 | qlcnic_linkevent_request(adapter, 1); |
1537 | 1540 | ||
1538 | adapter->ahw->reset_context = 0; | 1541 | adapter->ahw->reset_context = 0; |
1539 | set_bit(__QLCNIC_DEV_UP, &adapter->state); | ||
1540 | return 0; | 1542 | return 0; |
1541 | } | 1543 | } |
1542 | 1544 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c index ab8a6744d402..79e54efe07b9 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c | |||
@@ -1084,7 +1084,7 @@ flash_temp: | |||
1084 | tmpl_hdr = ahw->fw_dump.tmpl_hdr; | 1084 | tmpl_hdr = ahw->fw_dump.tmpl_hdr; |
1085 | tmpl_hdr->drv_cap_mask = QLCNIC_DUMP_MASK_DEF; | 1085 | tmpl_hdr->drv_cap_mask = QLCNIC_DUMP_MASK_DEF; |
1086 | 1086 | ||
1087 | if ((tmpl_hdr->version & 0xffffff) >= 0x20001) | 1087 | if ((tmpl_hdr->version & 0xfffff) >= 0x20001) |
1088 | ahw->fw_dump.use_pex_dma = true; | 1088 | ahw->fw_dump.use_pex_dma = true; |
1089 | else | 1089 | else |
1090 | ahw->fw_dump.use_pex_dma = false; | 1090 | ahw->fw_dump.use_pex_dma = false; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c index 62380ce89905..56e85f98117f 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | |||
@@ -762,6 +762,7 @@ static int qlcnic_sriov_alloc_bc_mbx_args(struct qlcnic_cmd_args *mbx, u32 type) | |||
762 | memset(mbx->rsp.arg, 0, sizeof(u32) * mbx->rsp.num); | 762 | memset(mbx->rsp.arg, 0, sizeof(u32) * mbx->rsp.num); |
763 | mbx->req.arg[0] = (type | (mbx->req.num << 16) | | 763 | mbx->req.arg[0] = (type | (mbx->req.num << 16) | |
764 | (3 << 29)); | 764 | (3 << 29)); |
765 | mbx->rsp.arg[0] = (type & 0xffff) | mbx->rsp.num << 16; | ||
765 | return 0; | 766 | return 0; |
766 | } | 767 | } |
767 | } | 768 | } |
@@ -813,6 +814,7 @@ static int qlcnic_sriov_prepare_bc_hdr(struct qlcnic_bc_trans *trans, | |||
813 | cmd->req.num = trans->req_pay_size / 4; | 814 | cmd->req.num = trans->req_pay_size / 4; |
814 | cmd->rsp.num = trans->rsp_pay_size / 4; | 815 | cmd->rsp.num = trans->rsp_pay_size / 4; |
815 | hdr = trans->rsp_hdr; | 816 | hdr = trans->rsp_hdr; |
817 | cmd->op_type = trans->req_hdr->op_type; | ||
816 | } | 818 | } |
817 | 819 | ||
818 | trans->trans_id = seq; | 820 | trans->trans_id = seq; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c index ee0c1d307966..eb49cd65378c 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | |||
@@ -635,12 +635,12 @@ static int qlcnic_sriov_pf_channel_cfg_cmd(struct qlcnic_bc_trans *trans, | |||
635 | struct qlcnic_cmd_args *cmd) | 635 | struct qlcnic_cmd_args *cmd) |
636 | { | 636 | { |
637 | struct qlcnic_vf_info *vf = trans->vf; | 637 | struct qlcnic_vf_info *vf = trans->vf; |
638 | struct qlcnic_adapter *adapter = vf->adapter; | 638 | struct qlcnic_vport *vp = vf->vp; |
639 | int err; | 639 | struct qlcnic_adapter *adapter; |
640 | u16 func = vf->pci_func; | 640 | u16 func = vf->pci_func; |
641 | int err; | ||
641 | 642 | ||
642 | cmd->rsp.arg[0] = trans->req_hdr->cmd_op; | 643 | adapter = vf->adapter; |
643 | cmd->rsp.arg[0] |= (1 << 16); | ||
644 | 644 | ||
645 | if (trans->req_hdr->cmd_op == QLCNIC_BC_CMD_CHANNEL_INIT) { | 645 | if (trans->req_hdr->cmd_op == QLCNIC_BC_CMD_CHANNEL_INIT) { |
646 | err = qlcnic_sriov_pf_config_vport(adapter, 1, func); | 646 | err = qlcnic_sriov_pf_config_vport(adapter, 1, func); |
@@ -650,6 +650,8 @@ static int qlcnic_sriov_pf_channel_cfg_cmd(struct qlcnic_bc_trans *trans, | |||
650 | qlcnic_sriov_pf_config_vport(adapter, 0, func); | 650 | qlcnic_sriov_pf_config_vport(adapter, 0, func); |
651 | } | 651 | } |
652 | } else { | 652 | } else { |
653 | if (vp->vlan_mode == QLC_GUEST_VLAN_MODE) | ||
654 | vp->vlan = 0; | ||
653 | err = qlcnic_sriov_pf_config_vport(adapter, 0, func); | 655 | err = qlcnic_sriov_pf_config_vport(adapter, 0, func); |
654 | } | 656 | } |
655 | 657 | ||
@@ -1183,7 +1185,7 @@ static int qlcnic_sriov_pf_get_acl_cmd(struct qlcnic_bc_trans *trans, | |||
1183 | u8 cmd_op, mode = vp->vlan_mode; | 1185 | u8 cmd_op, mode = vp->vlan_mode; |
1184 | 1186 | ||
1185 | cmd_op = trans->req_hdr->cmd_op; | 1187 | cmd_op = trans->req_hdr->cmd_op; |
1186 | cmd->rsp.arg[0] = (cmd_op & 0xffff) | 14 << 16 | 1 << 25; | 1188 | cmd->rsp.arg[0] |= 1 << 25; |
1187 | 1189 | ||
1188 | switch (mode) { | 1190 | switch (mode) { |
1189 | case QLC_GUEST_VLAN_MODE: | 1191 | case QLC_GUEST_VLAN_MODE: |
@@ -1561,6 +1563,7 @@ void qlcnic_sriov_pf_handle_flr(struct qlcnic_sriov *sriov, | |||
1561 | struct qlcnic_vf_info *vf) | 1563 | struct qlcnic_vf_info *vf) |
1562 | { | 1564 | { |
1563 | struct net_device *dev = vf->adapter->netdev; | 1565 | struct net_device *dev = vf->adapter->netdev; |
1566 | struct qlcnic_vport *vp = vf->vp; | ||
1564 | 1567 | ||
1565 | if (!test_and_clear_bit(QLC_BC_VF_STATE, &vf->state)) { | 1568 | if (!test_and_clear_bit(QLC_BC_VF_STATE, &vf->state)) { |
1566 | clear_bit(QLC_BC_VF_FLR, &vf->state); | 1569 | clear_bit(QLC_BC_VF_FLR, &vf->state); |
@@ -1573,6 +1576,9 @@ void qlcnic_sriov_pf_handle_flr(struct qlcnic_sriov *sriov, | |||
1573 | return; | 1576 | return; |
1574 | } | 1577 | } |
1575 | 1578 | ||
1579 | if (vp->vlan_mode == QLC_GUEST_VLAN_MODE) | ||
1580 | vp->vlan = 0; | ||
1581 | |||
1576 | qlcnic_sriov_schedule_flr(sriov, vf, qlcnic_sriov_pf_process_flr); | 1582 | qlcnic_sriov_schedule_flr(sriov, vf, qlcnic_sriov_pf_process_flr); |
1577 | netdev_info(dev, "FLR received for PCI func %d\n", vf->pci_func); | 1583 | netdev_info(dev, "FLR received for PCI func %d\n", vf->pci_func); |
1578 | } | 1584 | } |
@@ -1621,13 +1627,15 @@ int qlcnic_sriov_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) | |||
1621 | { | 1627 | { |
1622 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 1628 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
1623 | struct qlcnic_sriov *sriov = adapter->ahw->sriov; | 1629 | struct qlcnic_sriov *sriov = adapter->ahw->sriov; |
1624 | int i, num_vfs = sriov->num_vfs; | 1630 | int i, num_vfs; |
1625 | struct qlcnic_vf_info *vf_info; | 1631 | struct qlcnic_vf_info *vf_info; |
1626 | u8 *curr_mac; | 1632 | u8 *curr_mac; |
1627 | 1633 | ||
1628 | if (!qlcnic_sriov_pf_check(adapter)) | 1634 | if (!qlcnic_sriov_pf_check(adapter)) |
1629 | return -EOPNOTSUPP; | 1635 | return -EOPNOTSUPP; |
1630 | 1636 | ||
1637 | num_vfs = sriov->num_vfs; | ||
1638 | |||
1631 | if (!is_valid_ether_addr(mac) || vf >= num_vfs) | 1639 | if (!is_valid_ether_addr(mac) || vf >= num_vfs) |
1632 | return -EINVAL; | 1640 | return -EINVAL; |
1633 | 1641 | ||
@@ -1741,6 +1749,7 @@ int qlcnic_sriov_set_vf_vlan(struct net_device *netdev, int vf, | |||
1741 | 1749 | ||
1742 | switch (vlan) { | 1750 | switch (vlan) { |
1743 | case 4095: | 1751 | case 4095: |
1752 | vp->vlan = 0; | ||
1744 | vp->vlan_mode = QLC_GUEST_VLAN_MODE; | 1753 | vp->vlan_mode = QLC_GUEST_VLAN_MODE; |
1745 | break; | 1754 | break; |
1746 | case 0: | 1755 | case 0: |
@@ -1759,6 +1768,29 @@ int qlcnic_sriov_set_vf_vlan(struct net_device *netdev, int vf, | |||
1759 | return 0; | 1768 | return 0; |
1760 | } | 1769 | } |
1761 | 1770 | ||
1771 | static inline __u32 qlcnic_sriov_get_vf_vlan(struct qlcnic_adapter *adapter, | ||
1772 | struct qlcnic_vport *vp, int vf) | ||
1773 | { | ||
1774 | __u32 vlan = 0; | ||
1775 | |||
1776 | switch (vp->vlan_mode) { | ||
1777 | case QLC_PVID_MODE: | ||
1778 | vlan = vp->vlan; | ||
1779 | break; | ||
1780 | case QLC_GUEST_VLAN_MODE: | ||
1781 | vlan = MAX_VLAN_ID; | ||
1782 | break; | ||
1783 | case QLC_NO_VLAN_MODE: | ||
1784 | vlan = 0; | ||
1785 | break; | ||
1786 | default: | ||
1787 | netdev_info(adapter->netdev, "Invalid VLAN mode = %d for VF %d\n", | ||
1788 | vp->vlan_mode, vf); | ||
1789 | } | ||
1790 | |||
1791 | return vlan; | ||
1792 | } | ||
1793 | |||
1762 | int qlcnic_sriov_get_vf_config(struct net_device *netdev, | 1794 | int qlcnic_sriov_get_vf_config(struct net_device *netdev, |
1763 | int vf, struct ifla_vf_info *ivi) | 1795 | int vf, struct ifla_vf_info *ivi) |
1764 | { | 1796 | { |
@@ -1774,7 +1806,7 @@ int qlcnic_sriov_get_vf_config(struct net_device *netdev, | |||
1774 | 1806 | ||
1775 | vp = sriov->vf_info[vf].vp; | 1807 | vp = sriov->vf_info[vf].vp; |
1776 | memcpy(&ivi->mac, vp->mac, ETH_ALEN); | 1808 | memcpy(&ivi->mac, vp->mac, ETH_ALEN); |
1777 | ivi->vlan = vp->vlan; | 1809 | ivi->vlan = qlcnic_sriov_get_vf_vlan(adapter, vp, vf); |
1778 | ivi->qos = vp->qos; | 1810 | ivi->qos = vp->qos; |
1779 | ivi->spoofchk = vp->spoofchk; | 1811 | ivi->spoofchk = vp->spoofchk; |
1780 | if (vp->max_tx_bw == MAX_BW) | 1812 | if (vp->max_tx_bw == MAX_BW) |
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 4106a743ca74..880015cae6a3 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -6468,6 +6468,8 @@ static int rtl8169_close(struct net_device *dev) | |||
6468 | rtl8169_down(dev); | 6468 | rtl8169_down(dev); |
6469 | rtl_unlock_work(tp); | 6469 | rtl_unlock_work(tp); |
6470 | 6470 | ||
6471 | cancel_work_sync(&tp->wk.work); | ||
6472 | |||
6471 | free_irq(pdev->irq, dev); | 6473 | free_irq(pdev->irq, dev); |
6472 | 6474 | ||
6473 | dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, | 6475 | dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray, |
@@ -6793,8 +6795,6 @@ static void rtl_remove_one(struct pci_dev *pdev) | |||
6793 | rtl8168_driver_stop(tp); | 6795 | rtl8168_driver_stop(tp); |
6794 | } | 6796 | } |
6795 | 6797 | ||
6796 | cancel_work_sync(&tp->wk.work); | ||
6797 | |||
6798 | netif_napi_del(&tp->napi); | 6798 | netif_napi_del(&tp->napi); |
6799 | 6799 | ||
6800 | unregister_netdev(dev); | 6800 | unregister_netdev(dev); |
diff --git a/drivers/net/ethernet/sfc/filter.c b/drivers/net/ethernet/sfc/filter.c index b74a60ab9ac7..2a469b27a506 100644 --- a/drivers/net/ethernet/sfc/filter.c +++ b/drivers/net/ethernet/sfc/filter.c | |||
@@ -1209,7 +1209,9 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, | |||
1209 | EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + 4 * ip->ihl + 4); | 1209 | EFX_BUG_ON_PARANOID(skb_headlen(skb) < nhoff + 4 * ip->ihl + 4); |
1210 | ports = (const __be16 *)(skb->data + nhoff + 4 * ip->ihl); | 1210 | ports = (const __be16 *)(skb->data + nhoff + 4 * ip->ihl); |
1211 | 1211 | ||
1212 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_HINT, 0, rxq_index); | 1212 | efx_filter_init_rx(&spec, EFX_FILTER_PRI_HINT, |
1213 | efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0, | ||
1214 | rxq_index); | ||
1213 | rc = efx_filter_set_ipv4_full(&spec, ip->protocol, | 1215 | rc = efx_filter_set_ipv4_full(&spec, ip->protocol, |
1214 | ip->daddr, ports[1], ip->saddr, ports[0]); | 1216 | ip->daddr, ports[1], ip->saddr, ports[0]); |
1215 | if (rc) | 1217 | if (rc) |
diff --git a/drivers/net/phy/mdio-sun4i.c b/drivers/net/phy/mdio-sun4i.c index 61d3f4ebf52e..7f25e49ae37f 100644 --- a/drivers/net/phy/mdio-sun4i.c +++ b/drivers/net/phy/mdio-sun4i.c | |||
@@ -40,7 +40,7 @@ struct sun4i_mdio_data { | |||
40 | static int sun4i_mdio_read(struct mii_bus *bus, int mii_id, int regnum) | 40 | static int sun4i_mdio_read(struct mii_bus *bus, int mii_id, int regnum) |
41 | { | 41 | { |
42 | struct sun4i_mdio_data *data = bus->priv; | 42 | struct sun4i_mdio_data *data = bus->priv; |
43 | unsigned long start_jiffies; | 43 | unsigned long timeout_jiffies; |
44 | int value; | 44 | int value; |
45 | 45 | ||
46 | /* issue the phy address and reg */ | 46 | /* issue the phy address and reg */ |
@@ -49,10 +49,9 @@ static int sun4i_mdio_read(struct mii_bus *bus, int mii_id, int regnum) | |||
49 | writel(0x1, data->membase + EMAC_MAC_MCMD_REG); | 49 | writel(0x1, data->membase + EMAC_MAC_MCMD_REG); |
50 | 50 | ||
51 | /* Wait read complete */ | 51 | /* Wait read complete */ |
52 | start_jiffies = jiffies; | 52 | timeout_jiffies = jiffies + MDIO_TIMEOUT; |
53 | while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) { | 53 | while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) { |
54 | if (time_after(start_jiffies, | 54 | if (time_is_before_jiffies(timeout_jiffies)) |
55 | start_jiffies + MDIO_TIMEOUT)) | ||
56 | return -ETIMEDOUT; | 55 | return -ETIMEDOUT; |
57 | msleep(1); | 56 | msleep(1); |
58 | } | 57 | } |
@@ -69,7 +68,7 @@ static int sun4i_mdio_write(struct mii_bus *bus, int mii_id, int regnum, | |||
69 | u16 value) | 68 | u16 value) |
70 | { | 69 | { |
71 | struct sun4i_mdio_data *data = bus->priv; | 70 | struct sun4i_mdio_data *data = bus->priv; |
72 | unsigned long start_jiffies; | 71 | unsigned long timeout_jiffies; |
73 | 72 | ||
74 | /* issue the phy address and reg */ | 73 | /* issue the phy address and reg */ |
75 | writel((mii_id << 8) | regnum, data->membase + EMAC_MAC_MADR_REG); | 74 | writel((mii_id << 8) | regnum, data->membase + EMAC_MAC_MADR_REG); |
@@ -77,10 +76,9 @@ static int sun4i_mdio_write(struct mii_bus *bus, int mii_id, int regnum, | |||
77 | writel(0x1, data->membase + EMAC_MAC_MCMD_REG); | 76 | writel(0x1, data->membase + EMAC_MAC_MCMD_REG); |
78 | 77 | ||
79 | /* Wait read complete */ | 78 | /* Wait read complete */ |
80 | start_jiffies = jiffies; | 79 | timeout_jiffies = jiffies + MDIO_TIMEOUT; |
81 | while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) { | 80 | while (readl(data->membase + EMAC_MAC_MIND_REG) & 0x1) { |
82 | if (time_after(start_jiffies, | 81 | if (time_is_before_jiffies(timeout_jiffies)) |
83 | start_jiffies + MDIO_TIMEOUT)) | ||
84 | return -ETIMEDOUT; | 82 | return -ETIMEDOUT; |
85 | msleep(1); | 83 | msleep(1); |
86 | } | 84 | } |
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 1e3c302d94fe..2bc87e3a8141 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c | |||
@@ -1029,10 +1029,10 @@ static int ax88179_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1029 | dev->mii.supports_gmii = 1; | 1029 | dev->mii.supports_gmii = 1; |
1030 | 1030 | ||
1031 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1031 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1032 | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; | 1032 | NETIF_F_RXCSUM; |
1033 | 1033 | ||
1034 | dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1034 | dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1035 | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; | 1035 | NETIF_F_RXCSUM; |
1036 | 1036 | ||
1037 | /* Enable checksum offload */ | 1037 | /* Enable checksum offload */ |
1038 | *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | | 1038 | *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | |
@@ -1173,7 +1173,6 @@ ax88179_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | |||
1173 | if (((skb->len + 8) % frame_size) == 0) | 1173 | if (((skb->len + 8) % frame_size) == 0) |
1174 | tx_hdr2 |= 0x80008000; /* Enable padding */ | 1174 | tx_hdr2 |= 0x80008000; /* Enable padding */ |
1175 | 1175 | ||
1176 | skb_linearize(skb); | ||
1177 | headroom = skb_headroom(skb); | 1176 | headroom = skb_headroom(skb); |
1178 | tailroom = skb_tailroom(skb); | 1177 | tailroom = skb_tailroom(skb); |
1179 | 1178 | ||
@@ -1317,10 +1316,10 @@ static int ax88179_reset(struct usbnet *dev) | |||
1317 | 1, 1, tmp); | 1316 | 1, 1, tmp); |
1318 | 1317 | ||
1319 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1318 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1320 | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; | 1319 | NETIF_F_RXCSUM; |
1321 | 1320 | ||
1322 | dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1321 | dev->net->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1323 | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO; | 1322 | NETIF_F_RXCSUM; |
1324 | 1323 | ||
1325 | /* Enable checksum offload */ | 1324 | /* Enable checksum offload */ |
1326 | *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | | 1325 | *tmp = AX_RXCOE_IP | AX_RXCOE_TCP | AX_RXCOE_UDP | |
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 75409748c774..66ebbacf066f 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c | |||
@@ -45,7 +45,6 @@ | |||
45 | #define EEPROM_MAC_OFFSET (0x01) | 45 | #define EEPROM_MAC_OFFSET (0x01) |
46 | #define DEFAULT_TX_CSUM_ENABLE (true) | 46 | #define DEFAULT_TX_CSUM_ENABLE (true) |
47 | #define DEFAULT_RX_CSUM_ENABLE (true) | 47 | #define DEFAULT_RX_CSUM_ENABLE (true) |
48 | #define DEFAULT_TSO_ENABLE (true) | ||
49 | #define SMSC75XX_INTERNAL_PHY_ID (1) | 48 | #define SMSC75XX_INTERNAL_PHY_ID (1) |
50 | #define SMSC75XX_TX_OVERHEAD (8) | 49 | #define SMSC75XX_TX_OVERHEAD (8) |
51 | #define MAX_RX_FIFO_SIZE (20 * 1024) | 50 | #define MAX_RX_FIFO_SIZE (20 * 1024) |
@@ -1410,17 +1409,14 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) | |||
1410 | 1409 | ||
1411 | INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write); | 1410 | INIT_WORK(&pdata->set_multicast, smsc75xx_deferred_multicast_write); |
1412 | 1411 | ||
1413 | if (DEFAULT_TX_CSUM_ENABLE) { | 1412 | if (DEFAULT_TX_CSUM_ENABLE) |
1414 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; | 1413 | dev->net->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; |
1415 | if (DEFAULT_TSO_ENABLE) | 1414 | |
1416 | dev->net->features |= NETIF_F_SG | | ||
1417 | NETIF_F_TSO | NETIF_F_TSO6; | ||
1418 | } | ||
1419 | if (DEFAULT_RX_CSUM_ENABLE) | 1415 | if (DEFAULT_RX_CSUM_ENABLE) |
1420 | dev->net->features |= NETIF_F_RXCSUM; | 1416 | dev->net->features |= NETIF_F_RXCSUM; |
1421 | 1417 | ||
1422 | dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 1418 | dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
1423 | NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_RXCSUM; | 1419 | NETIF_F_RXCSUM; |
1424 | 1420 | ||
1425 | ret = smsc75xx_wait_ready(dev, 0); | 1421 | ret = smsc75xx_wait_ready(dev, 0); |
1426 | if (ret < 0) { | 1422 | if (ret < 0) { |
@@ -2200,8 +2196,6 @@ static struct sk_buff *smsc75xx_tx_fixup(struct usbnet *dev, | |||
2200 | { | 2196 | { |
2201 | u32 tx_cmd_a, tx_cmd_b; | 2197 | u32 tx_cmd_a, tx_cmd_b; |
2202 | 2198 | ||
2203 | skb_linearize(skb); | ||
2204 | |||
2205 | if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) { | 2199 | if (skb_headroom(skb) < SMSC75XX_TX_OVERHEAD) { |
2206 | struct sk_buff *skb2 = | 2200 | struct sk_buff *skb2 = |
2207 | skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags); | 2201 | skb_copy_expand(skb, SMSC75XX_TX_OVERHEAD, 0, flags); |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index da866523cf20..eee1f19ef1e9 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -269,6 +269,7 @@ static void veth_setup(struct net_device *dev) | |||
269 | dev->ethtool_ops = &veth_ethtool_ops; | 269 | dev->ethtool_ops = &veth_ethtool_ops; |
270 | dev->features |= NETIF_F_LLTX; | 270 | dev->features |= NETIF_F_LLTX; |
271 | dev->features |= VETH_FEATURES; | 271 | dev->features |= VETH_FEATURES; |
272 | dev->vlan_features = dev->features; | ||
272 | dev->destructor = veth_dev_free; | 273 | dev->destructor = veth_dev_free; |
273 | 274 | ||
274 | dev->hw_features = VETH_FEATURES; | 275 | dev->hw_features = VETH_FEATURES; |
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index a5ba8dd7e6be..f4c6db419ddb 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -136,7 +136,8 @@ struct vxlan_dev { | |||
136 | u32 flags; /* VXLAN_F_* below */ | 136 | u32 flags; /* VXLAN_F_* below */ |
137 | 137 | ||
138 | struct work_struct sock_work; | 138 | struct work_struct sock_work; |
139 | struct work_struct igmp_work; | 139 | struct work_struct igmp_join; |
140 | struct work_struct igmp_leave; | ||
140 | 141 | ||
141 | unsigned long age_interval; | 142 | unsigned long age_interval; |
142 | struct timer_list age_timer; | 143 | struct timer_list age_timer; |
@@ -736,7 +737,6 @@ static bool vxlan_snoop(struct net_device *dev, | |||
736 | return false; | 737 | return false; |
737 | } | 738 | } |
738 | 739 | ||
739 | |||
740 | /* See if multicast group is already in use by other ID */ | 740 | /* See if multicast group is already in use by other ID */ |
741 | static bool vxlan_group_used(struct vxlan_net *vn, __be32 remote_ip) | 741 | static bool vxlan_group_used(struct vxlan_net *vn, __be32 remote_ip) |
742 | { | 742 | { |
@@ -770,12 +770,13 @@ static void vxlan_sock_release(struct vxlan_net *vn, struct vxlan_sock *vs) | |||
770 | queue_work(vxlan_wq, &vs->del_work); | 770 | queue_work(vxlan_wq, &vs->del_work); |
771 | } | 771 | } |
772 | 772 | ||
773 | /* Callback to update multicast group membership. | 773 | /* Callback to update multicast group membership when first VNI on |
774 | * Scheduled when vxlan goes up/down. | 774 | * multicast asddress is brought up |
775 | * Done as workqueue because ip_mc_join_group acquires RTNL. | ||
775 | */ | 776 | */ |
776 | static void vxlan_igmp_work(struct work_struct *work) | 777 | static void vxlan_igmp_join(struct work_struct *work) |
777 | { | 778 | { |
778 | struct vxlan_dev *vxlan = container_of(work, struct vxlan_dev, igmp_work); | 779 | struct vxlan_dev *vxlan = container_of(work, struct vxlan_dev, igmp_join); |
779 | struct vxlan_net *vn = net_generic(dev_net(vxlan->dev), vxlan_net_id); | 780 | struct vxlan_net *vn = net_generic(dev_net(vxlan->dev), vxlan_net_id); |
780 | struct vxlan_sock *vs = vxlan->vn_sock; | 781 | struct vxlan_sock *vs = vxlan->vn_sock; |
781 | struct sock *sk = vs->sock->sk; | 782 | struct sock *sk = vs->sock->sk; |
@@ -785,10 +786,27 @@ static void vxlan_igmp_work(struct work_struct *work) | |||
785 | }; | 786 | }; |
786 | 787 | ||
787 | lock_sock(sk); | 788 | lock_sock(sk); |
788 | if (vxlan_group_used(vn, vxlan->default_dst.remote_ip)) | 789 | ip_mc_join_group(sk, &mreq); |
789 | ip_mc_join_group(sk, &mreq); | 790 | release_sock(sk); |
790 | else | 791 | |
791 | ip_mc_leave_group(sk, &mreq); | 792 | vxlan_sock_release(vn, vs); |
793 | dev_put(vxlan->dev); | ||
794 | } | ||
795 | |||
796 | /* Inverse of vxlan_igmp_join when last VNI is brought down */ | ||
797 | static void vxlan_igmp_leave(struct work_struct *work) | ||
798 | { | ||
799 | struct vxlan_dev *vxlan = container_of(work, struct vxlan_dev, igmp_leave); | ||
800 | struct vxlan_net *vn = net_generic(dev_net(vxlan->dev), vxlan_net_id); | ||
801 | struct vxlan_sock *vs = vxlan->vn_sock; | ||
802 | struct sock *sk = vs->sock->sk; | ||
803 | struct ip_mreqn mreq = { | ||
804 | .imr_multiaddr.s_addr = vxlan->default_dst.remote_ip, | ||
805 | .imr_ifindex = vxlan->default_dst.remote_ifindex, | ||
806 | }; | ||
807 | |||
808 | lock_sock(sk); | ||
809 | ip_mc_leave_group(sk, &mreq); | ||
792 | release_sock(sk); | 810 | release_sock(sk); |
793 | 811 | ||
794 | vxlan_sock_release(vn, vs); | 812 | vxlan_sock_release(vn, vs); |
@@ -1359,6 +1377,7 @@ static void vxlan_uninit(struct net_device *dev) | |||
1359 | /* Start ageing timer and join group when device is brought up */ | 1377 | /* Start ageing timer and join group when device is brought up */ |
1360 | static int vxlan_open(struct net_device *dev) | 1378 | static int vxlan_open(struct net_device *dev) |
1361 | { | 1379 | { |
1380 | struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id); | ||
1362 | struct vxlan_dev *vxlan = netdev_priv(dev); | 1381 | struct vxlan_dev *vxlan = netdev_priv(dev); |
1363 | struct vxlan_sock *vs = vxlan->vn_sock; | 1382 | struct vxlan_sock *vs = vxlan->vn_sock; |
1364 | 1383 | ||
@@ -1366,10 +1385,11 @@ static int vxlan_open(struct net_device *dev) | |||
1366 | if (!vs) | 1385 | if (!vs) |
1367 | return -ENOTCONN; | 1386 | return -ENOTCONN; |
1368 | 1387 | ||
1369 | if (IN_MULTICAST(ntohl(vxlan->default_dst.remote_ip))) { | 1388 | if (IN_MULTICAST(ntohl(vxlan->default_dst.remote_ip)) && |
1389 | ! vxlan_group_used(vn, vxlan->default_dst.remote_ip)) { | ||
1370 | vxlan_sock_hold(vs); | 1390 | vxlan_sock_hold(vs); |
1371 | dev_hold(dev); | 1391 | dev_hold(dev); |
1372 | queue_work(vxlan_wq, &vxlan->igmp_work); | 1392 | queue_work(vxlan_wq, &vxlan->igmp_join); |
1373 | } | 1393 | } |
1374 | 1394 | ||
1375 | if (vxlan->age_interval) | 1395 | if (vxlan->age_interval) |
@@ -1400,13 +1420,15 @@ static void vxlan_flush(struct vxlan_dev *vxlan) | |||
1400 | /* Cleanup timer and forwarding table on shutdown */ | 1420 | /* Cleanup timer and forwarding table on shutdown */ |
1401 | static int vxlan_stop(struct net_device *dev) | 1421 | static int vxlan_stop(struct net_device *dev) |
1402 | { | 1422 | { |
1423 | struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id); | ||
1403 | struct vxlan_dev *vxlan = netdev_priv(dev); | 1424 | struct vxlan_dev *vxlan = netdev_priv(dev); |
1404 | struct vxlan_sock *vs = vxlan->vn_sock; | 1425 | struct vxlan_sock *vs = vxlan->vn_sock; |
1405 | 1426 | ||
1406 | if (vs && IN_MULTICAST(ntohl(vxlan->default_dst.remote_ip))) { | 1427 | if (vs && IN_MULTICAST(ntohl(vxlan->default_dst.remote_ip)) && |
1428 | ! vxlan_group_used(vn, vxlan->default_dst.remote_ip)) { | ||
1407 | vxlan_sock_hold(vs); | 1429 | vxlan_sock_hold(vs); |
1408 | dev_hold(dev); | 1430 | dev_hold(dev); |
1409 | queue_work(vxlan_wq, &vxlan->igmp_work); | 1431 | queue_work(vxlan_wq, &vxlan->igmp_leave); |
1410 | } | 1432 | } |
1411 | 1433 | ||
1412 | del_timer_sync(&vxlan->age_timer); | 1434 | del_timer_sync(&vxlan->age_timer); |
@@ -1471,7 +1493,8 @@ static void vxlan_setup(struct net_device *dev) | |||
1471 | 1493 | ||
1472 | INIT_LIST_HEAD(&vxlan->next); | 1494 | INIT_LIST_HEAD(&vxlan->next); |
1473 | spin_lock_init(&vxlan->hash_lock); | 1495 | spin_lock_init(&vxlan->hash_lock); |
1474 | INIT_WORK(&vxlan->igmp_work, vxlan_igmp_work); | 1496 | INIT_WORK(&vxlan->igmp_join, vxlan_igmp_join); |
1497 | INIT_WORK(&vxlan->igmp_leave, vxlan_igmp_leave); | ||
1475 | INIT_WORK(&vxlan->sock_work, vxlan_sock_work); | 1498 | INIT_WORK(&vxlan->sock_work, vxlan_sock_work); |
1476 | 1499 | ||
1477 | init_timer_deferrable(&vxlan->age_timer); | 1500 | init_timer_deferrable(&vxlan->age_timer); |
@@ -1878,10 +1901,12 @@ static __net_exit void vxlan_exit_net(struct net *net) | |||
1878 | { | 1901 | { |
1879 | struct vxlan_net *vn = net_generic(net, vxlan_net_id); | 1902 | struct vxlan_net *vn = net_generic(net, vxlan_net_id); |
1880 | struct vxlan_dev *vxlan; | 1903 | struct vxlan_dev *vxlan; |
1904 | LIST_HEAD(list); | ||
1881 | 1905 | ||
1882 | rtnl_lock(); | 1906 | rtnl_lock(); |
1883 | list_for_each_entry(vxlan, &vn->vxlan_list, next) | 1907 | list_for_each_entry(vxlan, &vn->vxlan_list, next) |
1884 | dev_close(vxlan->dev); | 1908 | unregister_netdevice_queue(vxlan->dev, &list); |
1909 | unregister_netdevice_many(&list); | ||
1885 | rtnl_unlock(); | 1910 | rtnl_unlock(); |
1886 | } | 1911 | } |
1887 | 1912 | ||
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c index 81b686c6a376..40825d43322e 100644 --- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c +++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c | |||
@@ -325,7 +325,7 @@ ath5k_prepare_multicast(struct ieee80211_hw *hw, | |||
325 | struct netdev_hw_addr *ha; | 325 | struct netdev_hw_addr *ha; |
326 | 326 | ||
327 | mfilt[0] = 0; | 327 | mfilt[0] = 0; |
328 | mfilt[1] = 1; | 328 | mfilt[1] = 0; |
329 | 329 | ||
330 | netdev_hw_addr_list_for_each(ha, mc_list) { | 330 | netdev_hw_addr_list_for_each(ha, mc_list) { |
331 | /* calculate XOR of eight 6-bit values */ | 331 | /* calculate XOR of eight 6-bit values */ |
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c index d1acfe98918a..1576d58291d4 100644 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c | |||
@@ -610,7 +610,15 @@ static void ar5008_hw_override_ini(struct ath_hw *ah, | |||
610 | REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); | 610 | REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); |
611 | 611 | ||
612 | if (AR_SREV_9280_20_OR_LATER(ah)) { | 612 | if (AR_SREV_9280_20_OR_LATER(ah)) { |
613 | val = REG_READ(ah, AR_PCU_MISC_MODE2); | 613 | /* |
614 | * For AR9280 and above, there is a new feature that allows | ||
615 | * Multicast search based on both MAC Address and Key ID. | ||
616 | * By default, this feature is enabled. But since the driver | ||
617 | * is not using this feature, we switch it off; otherwise | ||
618 | * multicast search based on MAC addr only will fail. | ||
619 | */ | ||
620 | val = REG_READ(ah, AR_PCU_MISC_MODE2) & | ||
621 | (~AR_ADHOC_MCAST_KEYID_ENABLE); | ||
614 | 622 | ||
615 | if (!AR_SREV_9271(ah)) | 623 | if (!AR_SREV_9271(ah)) |
616 | val &= ~AR_PCU_MISC_MODE2_HWWAR1; | 624 | val &= ~AR_PCU_MISC_MODE2_HWWAR1; |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 9e582e14da74..5205a3625e84 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -1082,7 +1082,7 @@ static void ath9k_hif_usb_firmware_fail(struct hif_device_usb *hif_dev) | |||
1082 | struct device *dev = &hif_dev->udev->dev; | 1082 | struct device *dev = &hif_dev->udev->dev; |
1083 | struct device *parent = dev->parent; | 1083 | struct device *parent = dev->parent; |
1084 | 1084 | ||
1085 | complete(&hif_dev->fw_done); | 1085 | complete_all(&hif_dev->fw_done); |
1086 | 1086 | ||
1087 | if (parent) | 1087 | if (parent) |
1088 | device_lock(parent); | 1088 | device_lock(parent); |
@@ -1131,7 +1131,7 @@ static void ath9k_hif_usb_firmware_cb(const struct firmware *fw, void *context) | |||
1131 | 1131 | ||
1132 | release_firmware(fw); | 1132 | release_firmware(fw); |
1133 | hif_dev->flags |= HIF_USB_READY; | 1133 | hif_dev->flags |= HIF_USB_READY; |
1134 | complete(&hif_dev->fw_done); | 1134 | complete_all(&hif_dev->fw_done); |
1135 | 1135 | ||
1136 | return; | 1136 | return; |
1137 | 1137 | ||
@@ -1295,7 +1295,9 @@ static void ath9k_hif_usb_disconnect(struct usb_interface *interface) | |||
1295 | 1295 | ||
1296 | usb_set_intfdata(interface, NULL); | 1296 | usb_set_intfdata(interface, NULL); |
1297 | 1297 | ||
1298 | if (!unplugged && (hif_dev->flags & HIF_USB_START)) | 1298 | /* If firmware was loaded we should drop it |
1299 | * go back to first stage bootloader. */ | ||
1300 | if (!unplugged && (hif_dev->flags & HIF_USB_READY)) | ||
1299 | ath9k_hif_usb_reboot(udev); | 1301 | ath9k_hif_usb_reboot(udev); |
1300 | 1302 | ||
1301 | kfree(hif_dev); | 1303 | kfree(hif_dev); |
@@ -1316,7 +1318,10 @@ static int ath9k_hif_usb_suspend(struct usb_interface *interface, | |||
1316 | if (!(hif_dev->flags & HIF_USB_START)) | 1318 | if (!(hif_dev->flags & HIF_USB_START)) |
1317 | ath9k_htc_suspend(hif_dev->htc_handle); | 1319 | ath9k_htc_suspend(hif_dev->htc_handle); |
1318 | 1320 | ||
1319 | ath9k_hif_usb_dealloc_urbs(hif_dev); | 1321 | wait_for_completion(&hif_dev->fw_done); |
1322 | |||
1323 | if (hif_dev->flags & HIF_USB_READY) | ||
1324 | ath9k_hif_usb_dealloc_urbs(hif_dev); | ||
1320 | 1325 | ||
1321 | return 0; | 1326 | return 0; |
1322 | } | 1327 | } |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 71a183ffc77f..c3676bf1d6c4 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -861,6 +861,7 @@ static int ath9k_init_device(struct ath9k_htc_priv *priv, | |||
861 | if (error != 0) | 861 | if (error != 0) |
862 | goto err_rx; | 862 | goto err_rx; |
863 | 863 | ||
864 | ath9k_hw_disable(priv->ah); | ||
864 | #ifdef CONFIG_MAC80211_LEDS | 865 | #ifdef CONFIG_MAC80211_LEDS |
865 | /* must be initialized before ieee80211_register_hw */ | 866 | /* must be initialized before ieee80211_register_hw */ |
866 | priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw, | 867 | priv->led_cdev.default_trigger = ieee80211_create_tpt_led_trigger(priv->hw, |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index c59ae43b9b35..927992732620 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -146,6 +146,28 @@ static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, | |||
146 | ARRAY_SIZE(bf->rates)); | 146 | ARRAY_SIZE(bf->rates)); |
147 | } | 147 | } |
148 | 148 | ||
149 | static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, | ||
150 | struct sk_buff *skb) | ||
151 | { | ||
152 | int q; | ||
153 | |||
154 | q = skb_get_queue_mapping(skb); | ||
155 | if (txq == sc->tx.uapsdq) | ||
156 | txq = sc->tx.txq_map[q]; | ||
157 | |||
158 | if (txq != sc->tx.txq_map[q]) | ||
159 | return; | ||
160 | |||
161 | if (WARN_ON(--txq->pending_frames < 0)) | ||
162 | txq->pending_frames = 0; | ||
163 | |||
164 | if (txq->stopped && | ||
165 | txq->pending_frames < sc->tx.txq_max_pending[q]) { | ||
166 | ieee80211_wake_queue(sc->hw, q); | ||
167 | txq->stopped = false; | ||
168 | } | ||
169 | } | ||
170 | |||
149 | static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) | 171 | static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) |
150 | { | 172 | { |
151 | struct ath_txq *txq = tid->ac->txq; | 173 | struct ath_txq *txq = tid->ac->txq; |
@@ -167,6 +189,7 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) | |||
167 | if (!bf) { | 189 | if (!bf) { |
168 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); | 190 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); |
169 | if (!bf) { | 191 | if (!bf) { |
192 | ath_txq_skb_done(sc, txq, skb); | ||
170 | ieee80211_free_txskb(sc->hw, skb); | 193 | ieee80211_free_txskb(sc->hw, skb); |
171 | continue; | 194 | continue; |
172 | } | 195 | } |
@@ -811,6 +834,7 @@ ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq, | |||
811 | 834 | ||
812 | if (!bf) { | 835 | if (!bf) { |
813 | __skb_unlink(skb, &tid->buf_q); | 836 | __skb_unlink(skb, &tid->buf_q); |
837 | ath_txq_skb_done(sc, txq, skb); | ||
814 | ieee80211_free_txskb(sc->hw, skb); | 838 | ieee80211_free_txskb(sc->hw, skb); |
815 | continue; | 839 | continue; |
816 | } | 840 | } |
@@ -1824,6 +1848,7 @@ static void ath_tx_send_ampdu(struct ath_softc *sc, struct ath_txq *txq, | |||
1824 | 1848 | ||
1825 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); | 1849 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); |
1826 | if (!bf) { | 1850 | if (!bf) { |
1851 | ath_txq_skb_done(sc, txq, skb); | ||
1827 | ieee80211_free_txskb(sc->hw, skb); | 1852 | ieee80211_free_txskb(sc->hw, skb); |
1828 | return; | 1853 | return; |
1829 | } | 1854 | } |
@@ -2090,6 +2115,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2090 | 2115 | ||
2091 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); | 2116 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); |
2092 | if (!bf) { | 2117 | if (!bf) { |
2118 | ath_txq_skb_done(sc, txq, skb); | ||
2093 | if (txctl->paprd) | 2119 | if (txctl->paprd) |
2094 | dev_kfree_skb_any(skb); | 2120 | dev_kfree_skb_any(skb); |
2095 | else | 2121 | else |
@@ -2189,7 +2215,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
2189 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 2215 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
2190 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 2216 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
2191 | struct ieee80211_hdr * hdr = (struct ieee80211_hdr *)skb->data; | 2217 | struct ieee80211_hdr * hdr = (struct ieee80211_hdr *)skb->data; |
2192 | int q, padpos, padsize; | 2218 | int padpos, padsize; |
2193 | unsigned long flags; | 2219 | unsigned long flags; |
2194 | 2220 | ||
2195 | ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); | 2221 | ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb); |
@@ -2225,21 +2251,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
2225 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); | 2251 | spin_unlock_irqrestore(&sc->sc_pm_lock, flags); |
2226 | 2252 | ||
2227 | __skb_queue_tail(&txq->complete_q, skb); | 2253 | __skb_queue_tail(&txq->complete_q, skb); |
2228 | 2254 | ath_txq_skb_done(sc, txq, skb); | |
2229 | q = skb_get_queue_mapping(skb); | ||
2230 | if (txq == sc->tx.uapsdq) | ||
2231 | txq = sc->tx.txq_map[q]; | ||
2232 | |||
2233 | if (txq == sc->tx.txq_map[q]) { | ||
2234 | if (WARN_ON(--txq->pending_frames < 0)) | ||
2235 | txq->pending_frames = 0; | ||
2236 | |||
2237 | if (txq->stopped && | ||
2238 | txq->pending_frames < sc->tx.txq_max_pending[q]) { | ||
2239 | ieee80211_wake_queue(sc->hw, q); | ||
2240 | txq->stopped = false; | ||
2241 | } | ||
2242 | } | ||
2243 | } | 2255 | } |
2244 | 2256 | ||
2245 | static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, | 2257 | static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, |
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index e8308ec30970..ab636767fbde 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c | |||
@@ -145,7 +145,7 @@ static void wil_print_ring(struct seq_file *s, const char *prefix, | |||
145 | le16_to_cpu(hdr.type), hdr.flags); | 145 | le16_to_cpu(hdr.type), hdr.flags); |
146 | if (len <= MAX_MBOXITEM_SIZE) { | 146 | if (len <= MAX_MBOXITEM_SIZE) { |
147 | int n = 0; | 147 | int n = 0; |
148 | unsigned char printbuf[16 * 3 + 2]; | 148 | char printbuf[16 * 3 + 2]; |
149 | unsigned char databuf[MAX_MBOXITEM_SIZE]; | 149 | unsigned char databuf[MAX_MBOXITEM_SIZE]; |
150 | void __iomem *src = wmi_buffer(wil, d.addr) + | 150 | void __iomem *src = wmi_buffer(wil, d.addr) + |
151 | sizeof(struct wil6210_mbox_hdr); | 151 | sizeof(struct wil6210_mbox_hdr); |
@@ -416,7 +416,7 @@ static int wil_txdesc_debugfs_show(struct seq_file *s, void *data) | |||
416 | seq_printf(s, " SKB = %p\n", skb); | 416 | seq_printf(s, " SKB = %p\n", skb); |
417 | 417 | ||
418 | if (skb) { | 418 | if (skb) { |
419 | unsigned char printbuf[16 * 3 + 2]; | 419 | char printbuf[16 * 3 + 2]; |
420 | int i = 0; | 420 | int i = 0; |
421 | int len = le16_to_cpu(d->dma.length); | 421 | int len = le16_to_cpu(d->dma.length); |
422 | void *p = skb->data; | 422 | void *p = skb->data; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index 8e8975562ec3..80099016d21f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -242,7 +242,7 @@ void brcmf_txflowblock_if(struct brcmf_if *ifp, | |||
242 | { | 242 | { |
243 | unsigned long flags; | 243 | unsigned long flags; |
244 | 244 | ||
245 | if (!ifp) | 245 | if (!ifp || !ifp->ndev) |
246 | return; | 246 | return; |
247 | 247 | ||
248 | brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n", | 248 | brcmf_dbg(TRACE, "enter: idx=%d stop=0x%X reason=%d state=%d\n", |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c index f0d9f7f6c83d..29b1f24c2d0f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c | |||
@@ -1744,13 +1744,14 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb) | |||
1744 | ulong flags; | 1744 | ulong flags; |
1745 | int fifo = BRCMF_FWS_FIFO_BCMC; | 1745 | int fifo = BRCMF_FWS_FIFO_BCMC; |
1746 | bool multicast = is_multicast_ether_addr(eh->h_dest); | 1746 | bool multicast = is_multicast_ether_addr(eh->h_dest); |
1747 | bool pae = eh->h_proto == htons(ETH_P_PAE); | ||
1747 | 1748 | ||
1748 | /* determine the priority */ | 1749 | /* determine the priority */ |
1749 | if (!skb->priority) | 1750 | if (!skb->priority) |
1750 | skb->priority = cfg80211_classify8021d(skb); | 1751 | skb->priority = cfg80211_classify8021d(skb); |
1751 | 1752 | ||
1752 | drvr->tx_multicast += !!multicast; | 1753 | drvr->tx_multicast += !!multicast; |
1753 | if (ntohs(eh->h_proto) == ETH_P_PAE) | 1754 | if (pae) |
1754 | atomic_inc(&ifp->pend_8021x_cnt); | 1755 | atomic_inc(&ifp->pend_8021x_cnt); |
1755 | 1756 | ||
1756 | if (!brcmf_fws_fc_active(fws)) { | 1757 | if (!brcmf_fws_fc_active(fws)) { |
@@ -1781,6 +1782,11 @@ int brcmf_fws_process_skb(struct brcmf_if *ifp, struct sk_buff *skb) | |||
1781 | brcmf_fws_schedule_deq(fws); | 1782 | brcmf_fws_schedule_deq(fws); |
1782 | } else { | 1783 | } else { |
1783 | brcmf_err("drop skb: no hanger slot\n"); | 1784 | brcmf_err("drop skb: no hanger slot\n"); |
1785 | if (pae) { | ||
1786 | atomic_dec(&ifp->pend_8021x_cnt); | ||
1787 | if (waitqueue_active(&ifp->pend_8021x_wait)) | ||
1788 | wake_up(&ifp->pend_8021x_wait); | ||
1789 | } | ||
1784 | brcmu_pkt_buf_free_skb(skb); | 1790 | brcmu_pkt_buf_free_skb(skb); |
1785 | } | 1791 | } |
1786 | brcmf_fws_unlock(drvr, flags); | 1792 | brcmf_fws_unlock(drvr, flags); |
diff --git a/drivers/net/wireless/cw1200/txrx.c b/drivers/net/wireless/cw1200/txrx.c index 5862c373d714..e824d4d4a18d 100644 --- a/drivers/net/wireless/cw1200/txrx.c +++ b/drivers/net/wireless/cw1200/txrx.c | |||
@@ -1165,7 +1165,7 @@ void cw1200_rx_cb(struct cw1200_common *priv, | |||
1165 | if (cw1200_handle_action_rx(priv, skb)) | 1165 | if (cw1200_handle_action_rx(priv, skb)) |
1166 | return; | 1166 | return; |
1167 | } else if (ieee80211_is_beacon(frame->frame_control) && | 1167 | } else if (ieee80211_is_beacon(frame->frame_control) && |
1168 | !arg->status && | 1168 | !arg->status && priv->vif && |
1169 | !memcmp(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid, | 1169 | !memcmp(ieee80211_get_SA(frame), priv->vif->bss_conf.bssid, |
1170 | ETH_ALEN)) { | 1170 | ETH_ALEN)) { |
1171 | const u8 *tim_ie; | 1171 | const u8 *tim_ie; |
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c index 3952ddf2ddb2..1531a4fc0960 100644 --- a/drivers/net/wireless/iwlwifi/dvm/main.c +++ b/drivers/net/wireless/iwlwifi/dvm/main.c | |||
@@ -758,7 +758,7 @@ int iwl_alive_start(struct iwl_priv *priv) | |||
758 | BT_COEX_PRIO_TBL_EVT_INIT_CALIB2); | 758 | BT_COEX_PRIO_TBL_EVT_INIT_CALIB2); |
759 | if (ret) | 759 | if (ret) |
760 | return ret; | 760 | return ret; |
761 | } else { | 761 | } else if (priv->lib->bt_params) { |
762 | /* | 762 | /* |
763 | * default is 2-wire BT coexexistence support | 763 | * default is 2-wire BT coexexistence support |
764 | */ | 764 | */ |
diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index e56ed2a84888..c24a744910ac 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c | |||
@@ -988,7 +988,11 @@ void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
988 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | 988 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); |
989 | char buf[100]; | 989 | char buf[100]; |
990 | 990 | ||
991 | if (!dbgfs_dir) | 991 | /* |
992 | * Check if debugfs directory already exist before creating it. | ||
993 | * This may happen when, for example, resetting hw or suspend-resume | ||
994 | */ | ||
995 | if (!dbgfs_dir || mvmvif->dbgfs_dir) | ||
992 | return; | 996 | return; |
993 | 997 | ||
994 | mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir); | 998 | mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index e08683b20531..1eedc424051c 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -257,7 +257,11 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) | |||
257 | if (ret) | 257 | if (ret) |
258 | return ret; | 258 | return ret; |
259 | 259 | ||
260 | return ieee80211_register_hw(mvm->hw); | 260 | ret = ieee80211_register_hw(mvm->hw); |
261 | if (ret) | ||
262 | iwl_mvm_leds_exit(mvm); | ||
263 | |||
264 | return ret; | ||
261 | } | 265 | } |
262 | 266 | ||
263 | static void iwl_mvm_mac_tx(struct ieee80211_hw *hw, | 267 | static void iwl_mvm_mac_tx(struct ieee80211_hw *hw, |
@@ -385,6 +389,7 @@ static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) | |||
385 | ieee80211_wake_queues(mvm->hw); | 389 | ieee80211_wake_queues(mvm->hw); |
386 | 390 | ||
387 | mvm->vif_count = 0; | 391 | mvm->vif_count = 0; |
392 | mvm->rx_ba_sessions = 0; | ||
388 | } | 393 | } |
389 | 394 | ||
390 | static int iwl_mvm_mac_start(struct ieee80211_hw *hw) | 395 | static int iwl_mvm_mac_start(struct ieee80211_hw *hw) |
@@ -1006,6 +1011,21 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, | |||
1006 | mutex_lock(&mvm->mutex); | 1011 | mutex_lock(&mvm->mutex); |
1007 | if (old_state == IEEE80211_STA_NOTEXIST && | 1012 | if (old_state == IEEE80211_STA_NOTEXIST && |
1008 | new_state == IEEE80211_STA_NONE) { | 1013 | new_state == IEEE80211_STA_NONE) { |
1014 | /* | ||
1015 | * Firmware bug - it'll crash if the beacon interval is less | ||
1016 | * than 16. We can't avoid connecting at all, so refuse the | ||
1017 | * station state change, this will cause mac80211 to abandon | ||
1018 | * attempts to connect to this AP, and eventually wpa_s will | ||
1019 | * blacklist the AP... | ||
1020 | */ | ||
1021 | if (vif->type == NL80211_IFTYPE_STATION && | ||
1022 | vif->bss_conf.beacon_int < 16) { | ||
1023 | IWL_ERR(mvm, | ||
1024 | "AP %pM beacon interval is %d, refusing due to firmware bug!\n", | ||
1025 | sta->addr, vif->bss_conf.beacon_int); | ||
1026 | ret = -EINVAL; | ||
1027 | goto out_unlock; | ||
1028 | } | ||
1009 | ret = iwl_mvm_add_sta(mvm, vif, sta); | 1029 | ret = iwl_mvm_add_sta(mvm, vif, sta); |
1010 | } else if (old_state == IEEE80211_STA_NONE && | 1030 | } else if (old_state == IEEE80211_STA_NONE && |
1011 | new_state == IEEE80211_STA_AUTH) { | 1031 | new_state == IEEE80211_STA_AUTH) { |
@@ -1038,6 +1058,7 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, | |||
1038 | } else { | 1058 | } else { |
1039 | ret = -EIO; | 1059 | ret = -EIO; |
1040 | } | 1060 | } |
1061 | out_unlock: | ||
1041 | mutex_unlock(&mvm->mutex); | 1062 | mutex_unlock(&mvm->mutex); |
1042 | 1063 | ||
1043 | return ret; | 1064 | return ret; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index d40d7db185d6..420e82d379d9 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
@@ -419,6 +419,7 @@ struct iwl_mvm { | |||
419 | struct work_struct sta_drained_wk; | 419 | struct work_struct sta_drained_wk; |
420 | unsigned long sta_drained[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)]; | 420 | unsigned long sta_drained[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)]; |
421 | atomic_t pending_frames[IWL_MVM_STATION_COUNT]; | 421 | atomic_t pending_frames[IWL_MVM_STATION_COUNT]; |
422 | u8 rx_ba_sessions; | ||
422 | 423 | ||
423 | /* configured by mac80211 */ | 424 | /* configured by mac80211 */ |
424 | u32 rts_threshold; | 425 | u32 rts_threshold; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index 2157b0f8ced5..268f027b45b0 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -137,8 +137,8 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_scan_cmd *cmd, | |||
137 | { | 137 | { |
138 | int fw_idx, req_idx; | 138 | int fw_idx, req_idx; |
139 | 139 | ||
140 | fw_idx = 0; | 140 | for (req_idx = req->n_ssids - 1, fw_idx = 0; req_idx > 0; |
141 | for (req_idx = req->n_ssids - 1; req_idx > 0; req_idx--) { | 141 | req_idx--, fw_idx++) { |
142 | cmd->direct_scan[fw_idx].id = WLAN_EID_SSID; | 142 | cmd->direct_scan[fw_idx].id = WLAN_EID_SSID; |
143 | cmd->direct_scan[fw_idx].len = req->ssids[req_idx].ssid_len; | 143 | cmd->direct_scan[fw_idx].len = req->ssids[req_idx].ssid_len; |
144 | memcpy(cmd->direct_scan[fw_idx].ssid, | 144 | memcpy(cmd->direct_scan[fw_idx].ssid, |
@@ -153,7 +153,9 @@ static void iwl_mvm_scan_fill_ssids(struct iwl_scan_cmd *cmd, | |||
153 | * just to notify that this scan is active and not passive. | 153 | * just to notify that this scan is active and not passive. |
154 | * In order to notify the FW of the number of SSIDs we wish to scan (including | 154 | * In order to notify the FW of the number of SSIDs we wish to scan (including |
155 | * the zero-length one), we need to set the corresponding bits in chan->type, | 155 | * the zero-length one), we need to set the corresponding bits in chan->type, |
156 | * one for each SSID, and set the active bit (first). | 156 | * one for each SSID, and set the active bit (first). The first SSID is already |
157 | * included in the probe template, so we need to set only req->n_ssids - 1 bits | ||
158 | * in addition to the first bit. | ||
157 | */ | 159 | */ |
158 | static u16 iwl_mvm_get_active_dwell(enum ieee80211_band band, int n_ssids) | 160 | static u16 iwl_mvm_get_active_dwell(enum ieee80211_band band, int n_ssids) |
159 | { | 161 | { |
@@ -179,7 +181,7 @@ static void iwl_mvm_scan_fill_channels(struct iwl_scan_cmd *cmd, | |||
179 | __le32 chan_type_value; | 181 | __le32 chan_type_value; |
180 | 182 | ||
181 | if (req->n_ssids > 0) | 183 | if (req->n_ssids > 0) |
182 | chan_type_value = cpu_to_le32(BIT(req->n_ssids + 1) - 1); | 184 | chan_type_value = cpu_to_le32(BIT(req->n_ssids) - 1); |
183 | else | 185 | else |
184 | chan_type_value = SCAN_CHANNEL_TYPE_PASSIVE; | 186 | chan_type_value = SCAN_CHANNEL_TYPE_PASSIVE; |
185 | 187 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c index 62fe5209093b..85d4bbe52157 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/iwlwifi/mvm/sta.c | |||
@@ -608,6 +608,8 @@ int iwl_mvm_rm_bcast_sta(struct iwl_mvm *mvm, struct iwl_mvm_int_sta *bsta) | |||
608 | return ret; | 608 | return ret; |
609 | } | 609 | } |
610 | 610 | ||
611 | #define IWL_MAX_RX_BA_SESSIONS 16 | ||
612 | |||
611 | int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | 613 | int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, |
612 | int tid, u16 ssn, bool start) | 614 | int tid, u16 ssn, bool start) |
613 | { | 615 | { |
@@ -618,11 +620,20 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | |||
618 | 620 | ||
619 | lockdep_assert_held(&mvm->mutex); | 621 | lockdep_assert_held(&mvm->mutex); |
620 | 622 | ||
623 | if (start && mvm->rx_ba_sessions >= IWL_MAX_RX_BA_SESSIONS) { | ||
624 | IWL_WARN(mvm, "Not enough RX BA SESSIONS\n"); | ||
625 | return -ENOSPC; | ||
626 | } | ||
627 | |||
621 | cmd.mac_id_n_color = cpu_to_le32(mvm_sta->mac_id_n_color); | 628 | cmd.mac_id_n_color = cpu_to_le32(mvm_sta->mac_id_n_color); |
622 | cmd.sta_id = mvm_sta->sta_id; | 629 | cmd.sta_id = mvm_sta->sta_id; |
623 | cmd.add_modify = STA_MODE_MODIFY; | 630 | cmd.add_modify = STA_MODE_MODIFY; |
624 | cmd.add_immediate_ba_tid = (u8) tid; | 631 | if (start) { |
625 | cmd.add_immediate_ba_ssn = cpu_to_le16(ssn); | 632 | cmd.add_immediate_ba_tid = (u8) tid; |
633 | cmd.add_immediate_ba_ssn = cpu_to_le16(ssn); | ||
634 | } else { | ||
635 | cmd.remove_immediate_ba_tid = (u8) tid; | ||
636 | } | ||
626 | cmd.modify_mask = start ? STA_MODIFY_ADD_BA_TID : | 637 | cmd.modify_mask = start ? STA_MODIFY_ADD_BA_TID : |
627 | STA_MODIFY_REMOVE_BA_TID; | 638 | STA_MODIFY_REMOVE_BA_TID; |
628 | 639 | ||
@@ -648,6 +659,14 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | |||
648 | break; | 659 | break; |
649 | } | 660 | } |
650 | 661 | ||
662 | if (!ret) { | ||
663 | if (start) | ||
664 | mvm->rx_ba_sessions++; | ||
665 | else if (mvm->rx_ba_sessions > 0) | ||
666 | /* check that restart flow didn't zero the counter */ | ||
667 | mvm->rx_ba_sessions--; | ||
668 | } | ||
669 | |||
651 | return ret; | 670 | return ret; |
652 | } | 671 | } |
653 | 672 | ||
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index caaf4bd56b30..2cf8b964e966 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c | |||
@@ -693,7 +693,7 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, | |||
693 | if (!ret) { | 693 | if (!ret) { |
694 | dev_notice(adapter->dev, | 694 | dev_notice(adapter->dev, |
695 | "WLAN FW already running! Skip FW dnld\n"); | 695 | "WLAN FW already running! Skip FW dnld\n"); |
696 | goto done; | 696 | return 0; |
697 | } | 697 | } |
698 | 698 | ||
699 | poll_num = MAX_FIRMWARE_POLL_TRIES; | 699 | poll_num = MAX_FIRMWARE_POLL_TRIES; |
@@ -719,14 +719,8 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, | |||
719 | poll_fw: | 719 | poll_fw: |
720 | /* Check if the firmware is downloaded successfully or not */ | 720 | /* Check if the firmware is downloaded successfully or not */ |
721 | ret = adapter->if_ops.check_fw_status(adapter, poll_num); | 721 | ret = adapter->if_ops.check_fw_status(adapter, poll_num); |
722 | if (ret) { | 722 | if (ret) |
723 | dev_err(adapter->dev, "FW failed to be active in time\n"); | 723 | dev_err(adapter->dev, "FW failed to be active in time\n"); |
724 | return -1; | ||
725 | } | ||
726 | done: | ||
727 | /* re-enable host interrupt for mwifiex after fw dnld is successful */ | ||
728 | if (adapter->if_ops.enable_int) | ||
729 | adapter->if_ops.enable_int(adapter); | ||
730 | 724 | ||
731 | return ret; | 725 | return ret; |
732 | } | 726 | } |
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index e15ab72fb03d..1753431de361 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -427,6 +427,10 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context) | |||
427 | "Cal data request_firmware() failed\n"); | 427 | "Cal data request_firmware() failed\n"); |
428 | } | 428 | } |
429 | 429 | ||
430 | /* enable host interrupt after fw dnld is successful */ | ||
431 | if (adapter->if_ops.enable_int) | ||
432 | adapter->if_ops.enable_int(adapter); | ||
433 | |||
430 | adapter->init_wait_q_woken = false; | 434 | adapter->init_wait_q_woken = false; |
431 | ret = mwifiex_init_fw(adapter); | 435 | ret = mwifiex_init_fw(adapter); |
432 | if (ret == -1) { | 436 | if (ret == -1) { |
@@ -478,6 +482,8 @@ err_add_intf: | |||
478 | mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev); | 482 | mwifiex_del_virtual_intf(adapter->wiphy, priv->wdev); |
479 | rtnl_unlock(); | 483 | rtnl_unlock(); |
480 | err_init_fw: | 484 | err_init_fw: |
485 | if (adapter->if_ops.disable_int) | ||
486 | adapter->if_ops.disable_int(adapter); | ||
481 | pr_debug("info: %s: unregister device\n", __func__); | 487 | pr_debug("info: %s: unregister device\n", __func__); |
482 | adapter->if_ops.unregister_dev(adapter); | 488 | adapter->if_ops.unregister_dev(adapter); |
483 | done: | 489 | done: |
@@ -855,7 +861,7 @@ mwifiex_add_card(void *card, struct semaphore *sem, | |||
855 | INIT_WORK(&adapter->main_work, mwifiex_main_work_queue); | 861 | INIT_WORK(&adapter->main_work, mwifiex_main_work_queue); |
856 | 862 | ||
857 | /* Register the device. Fill up the private data structure with relevant | 863 | /* Register the device. Fill up the private data structure with relevant |
858 | information from the card and request for the required IRQ. */ | 864 | information from the card. */ |
859 | if (adapter->if_ops.register_dev(adapter)) { | 865 | if (adapter->if_ops.register_dev(adapter)) { |
860 | pr_err("%s: failed to register mwifiex device\n", __func__); | 866 | pr_err("%s: failed to register mwifiex device\n", __func__); |
861 | goto err_registerdev; | 867 | goto err_registerdev; |
@@ -919,6 +925,11 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter, struct semaphore *sem) | |||
919 | if (!adapter) | 925 | if (!adapter) |
920 | goto exit_remove; | 926 | goto exit_remove; |
921 | 927 | ||
928 | /* We can no longer handle interrupts once we start doing the teardown | ||
929 | * below. */ | ||
930 | if (adapter->if_ops.disable_int) | ||
931 | adapter->if_ops.disable_int(adapter); | ||
932 | |||
922 | adapter->surprise_removed = true; | 933 | adapter->surprise_removed = true; |
923 | 934 | ||
924 | /* Stop data */ | 935 | /* Stop data */ |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 3da73d36acdf..253e0bd38e25 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -601,6 +601,7 @@ struct mwifiex_if_ops { | |||
601 | int (*register_dev) (struct mwifiex_adapter *); | 601 | int (*register_dev) (struct mwifiex_adapter *); |
602 | void (*unregister_dev) (struct mwifiex_adapter *); | 602 | void (*unregister_dev) (struct mwifiex_adapter *); |
603 | int (*enable_int) (struct mwifiex_adapter *); | 603 | int (*enable_int) (struct mwifiex_adapter *); |
604 | void (*disable_int) (struct mwifiex_adapter *); | ||
604 | int (*process_int_status) (struct mwifiex_adapter *); | 605 | int (*process_int_status) (struct mwifiex_adapter *); |
605 | int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *, | 606 | int (*host_to_card) (struct mwifiex_adapter *, u8, struct sk_buff *, |
606 | struct mwifiex_tx_param *); | 607 | struct mwifiex_tx_param *); |
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 5ee5ed02eccd..5ef49f2e375a 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c | |||
@@ -51,6 +51,7 @@ static struct mwifiex_if_ops sdio_ops; | |||
51 | static struct semaphore add_remove_card_sem; | 51 | static struct semaphore add_remove_card_sem; |
52 | 52 | ||
53 | static int mwifiex_sdio_resume(struct device *dev); | 53 | static int mwifiex_sdio_resume(struct device *dev); |
54 | static void mwifiex_sdio_interrupt(struct sdio_func *func); | ||
54 | 55 | ||
55 | /* | 56 | /* |
56 | * SDIO probe. | 57 | * SDIO probe. |
@@ -296,6 +297,15 @@ static struct sdio_driver mwifiex_sdio = { | |||
296 | } | 297 | } |
297 | }; | 298 | }; |
298 | 299 | ||
300 | /* Write data into SDIO card register. Caller claims SDIO device. */ | ||
301 | static int | ||
302 | mwifiex_write_reg_locked(struct sdio_func *func, u32 reg, u8 data) | ||
303 | { | ||
304 | int ret = -1; | ||
305 | sdio_writeb(func, data, reg, &ret); | ||
306 | return ret; | ||
307 | } | ||
308 | |||
299 | /* | 309 | /* |
300 | * This function writes data into SDIO card register. | 310 | * This function writes data into SDIO card register. |
301 | */ | 311 | */ |
@@ -303,10 +313,10 @@ static int | |||
303 | mwifiex_write_reg(struct mwifiex_adapter *adapter, u32 reg, u8 data) | 313 | mwifiex_write_reg(struct mwifiex_adapter *adapter, u32 reg, u8 data) |
304 | { | 314 | { |
305 | struct sdio_mmc_card *card = adapter->card; | 315 | struct sdio_mmc_card *card = adapter->card; |
306 | int ret = -1; | 316 | int ret; |
307 | 317 | ||
308 | sdio_claim_host(card->func); | 318 | sdio_claim_host(card->func); |
309 | sdio_writeb(card->func, data, reg, &ret); | 319 | ret = mwifiex_write_reg_locked(card->func, reg, data); |
310 | sdio_release_host(card->func); | 320 | sdio_release_host(card->func); |
311 | 321 | ||
312 | return ret; | 322 | return ret; |
@@ -685,23 +695,15 @@ mwifiex_sdio_read_fw_status(struct mwifiex_adapter *adapter, u16 *dat) | |||
685 | * The host interrupt mask is read, the disable bit is reset and | 695 | * The host interrupt mask is read, the disable bit is reset and |
686 | * written back to the card host interrupt mask register. | 696 | * written back to the card host interrupt mask register. |
687 | */ | 697 | */ |
688 | static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter) | 698 | static void mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter) |
689 | { | 699 | { |
690 | u8 host_int_mask, host_int_disable = HOST_INT_DISABLE; | 700 | struct sdio_mmc_card *card = adapter->card; |
691 | 701 | struct sdio_func *func = card->func; | |
692 | /* Read back the host_int_mask register */ | ||
693 | if (mwifiex_read_reg(adapter, HOST_INT_MASK_REG, &host_int_mask)) | ||
694 | return -1; | ||
695 | |||
696 | /* Update with the mask and write back to the register */ | ||
697 | host_int_mask &= ~host_int_disable; | ||
698 | |||
699 | if (mwifiex_write_reg(adapter, HOST_INT_MASK_REG, host_int_mask)) { | ||
700 | dev_err(adapter->dev, "disable host interrupt failed\n"); | ||
701 | return -1; | ||
702 | } | ||
703 | 702 | ||
704 | return 0; | 703 | sdio_claim_host(func); |
704 | mwifiex_write_reg_locked(func, HOST_INT_MASK_REG, 0); | ||
705 | sdio_release_irq(func); | ||
706 | sdio_release_host(func); | ||
705 | } | 707 | } |
706 | 708 | ||
707 | /* | 709 | /* |
@@ -713,14 +715,29 @@ static int mwifiex_sdio_disable_host_int(struct mwifiex_adapter *adapter) | |||
713 | static int mwifiex_sdio_enable_host_int(struct mwifiex_adapter *adapter) | 715 | static int mwifiex_sdio_enable_host_int(struct mwifiex_adapter *adapter) |
714 | { | 716 | { |
715 | struct sdio_mmc_card *card = adapter->card; | 717 | struct sdio_mmc_card *card = adapter->card; |
718 | struct sdio_func *func = card->func; | ||
719 | int ret; | ||
720 | |||
721 | sdio_claim_host(func); | ||
722 | |||
723 | /* Request the SDIO IRQ */ | ||
724 | ret = sdio_claim_irq(func, mwifiex_sdio_interrupt); | ||
725 | if (ret) { | ||
726 | dev_err(adapter->dev, "claim irq failed: ret=%d\n", ret); | ||
727 | goto out; | ||
728 | } | ||
716 | 729 | ||
717 | /* Simply write the mask to the register */ | 730 | /* Simply write the mask to the register */ |
718 | if (mwifiex_write_reg(adapter, HOST_INT_MASK_REG, | 731 | ret = mwifiex_write_reg_locked(func, HOST_INT_MASK_REG, |
719 | card->reg->host_int_enable)) { | 732 | card->reg->host_int_enable); |
733 | if (ret) { | ||
720 | dev_err(adapter->dev, "enable host interrupt failed\n"); | 734 | dev_err(adapter->dev, "enable host interrupt failed\n"); |
721 | return -1; | 735 | sdio_release_irq(func); |
722 | } | 736 | } |
723 | return 0; | 737 | |
738 | out: | ||
739 | sdio_release_host(func); | ||
740 | return ret; | ||
724 | } | 741 | } |
725 | 742 | ||
726 | /* | 743 | /* |
@@ -997,9 +1014,6 @@ mwifiex_sdio_interrupt(struct sdio_func *func) | |||
997 | } | 1014 | } |
998 | adapter = card->adapter; | 1015 | adapter = card->adapter; |
999 | 1016 | ||
1000 | if (adapter->surprise_removed) | ||
1001 | return; | ||
1002 | |||
1003 | if (!adapter->pps_uapsd_mode && adapter->ps_state == PS_STATE_SLEEP) | 1017 | if (!adapter->pps_uapsd_mode && adapter->ps_state == PS_STATE_SLEEP) |
1004 | adapter->ps_state = PS_STATE_AWAKE; | 1018 | adapter->ps_state = PS_STATE_AWAKE; |
1005 | 1019 | ||
@@ -1728,9 +1742,7 @@ mwifiex_unregister_dev(struct mwifiex_adapter *adapter) | |||
1728 | struct sdio_mmc_card *card = adapter->card; | 1742 | struct sdio_mmc_card *card = adapter->card; |
1729 | 1743 | ||
1730 | if (adapter->card) { | 1744 | if (adapter->card) { |
1731 | /* Release the SDIO IRQ */ | ||
1732 | sdio_claim_host(card->func); | 1745 | sdio_claim_host(card->func); |
1733 | sdio_release_irq(card->func); | ||
1734 | sdio_disable_func(card->func); | 1746 | sdio_disable_func(card->func); |
1735 | sdio_release_host(card->func); | 1747 | sdio_release_host(card->func); |
1736 | sdio_set_drvdata(card->func, NULL); | 1748 | sdio_set_drvdata(card->func, NULL); |
@@ -1744,7 +1756,7 @@ mwifiex_unregister_dev(struct mwifiex_adapter *adapter) | |||
1744 | */ | 1756 | */ |
1745 | static int mwifiex_register_dev(struct mwifiex_adapter *adapter) | 1757 | static int mwifiex_register_dev(struct mwifiex_adapter *adapter) |
1746 | { | 1758 | { |
1747 | int ret = 0; | 1759 | int ret; |
1748 | struct sdio_mmc_card *card = adapter->card; | 1760 | struct sdio_mmc_card *card = adapter->card; |
1749 | struct sdio_func *func = card->func; | 1761 | struct sdio_func *func = card->func; |
1750 | 1762 | ||
@@ -1753,22 +1765,14 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) | |||
1753 | 1765 | ||
1754 | sdio_claim_host(func); | 1766 | sdio_claim_host(func); |
1755 | 1767 | ||
1756 | /* Request the SDIO IRQ */ | ||
1757 | ret = sdio_claim_irq(func, mwifiex_sdio_interrupt); | ||
1758 | if (ret) { | ||
1759 | pr_err("claim irq failed: ret=%d\n", ret); | ||
1760 | goto disable_func; | ||
1761 | } | ||
1762 | |||
1763 | /* Set block size */ | 1768 | /* Set block size */ |
1764 | ret = sdio_set_block_size(card->func, MWIFIEX_SDIO_BLOCK_SIZE); | 1769 | ret = sdio_set_block_size(card->func, MWIFIEX_SDIO_BLOCK_SIZE); |
1770 | sdio_release_host(func); | ||
1765 | if (ret) { | 1771 | if (ret) { |
1766 | pr_err("cannot set SDIO block size\n"); | 1772 | pr_err("cannot set SDIO block size\n"); |
1767 | ret = -1; | 1773 | return ret; |
1768 | goto release_irq; | ||
1769 | } | 1774 | } |
1770 | 1775 | ||
1771 | sdio_release_host(func); | ||
1772 | sdio_set_drvdata(func, card); | 1776 | sdio_set_drvdata(func, card); |
1773 | 1777 | ||
1774 | adapter->dev = &func->dev; | 1778 | adapter->dev = &func->dev; |
@@ -1776,15 +1780,6 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter) | |||
1776 | strcpy(adapter->fw_name, card->firmware); | 1780 | strcpy(adapter->fw_name, card->firmware); |
1777 | 1781 | ||
1778 | return 0; | 1782 | return 0; |
1779 | |||
1780 | release_irq: | ||
1781 | sdio_release_irq(func); | ||
1782 | disable_func: | ||
1783 | sdio_disable_func(func); | ||
1784 | sdio_release_host(func); | ||
1785 | adapter->card = NULL; | ||
1786 | |||
1787 | return -1; | ||
1788 | } | 1783 | } |
1789 | 1784 | ||
1790 | /* | 1785 | /* |
@@ -1813,9 +1808,6 @@ static int mwifiex_init_sdio(struct mwifiex_adapter *adapter) | |||
1813 | */ | 1808 | */ |
1814 | mwifiex_read_reg(adapter, HOST_INTSTATUS_REG, &sdio_ireg); | 1809 | mwifiex_read_reg(adapter, HOST_INTSTATUS_REG, &sdio_ireg); |
1815 | 1810 | ||
1816 | /* Disable host interrupt mask register for SDIO */ | ||
1817 | mwifiex_sdio_disable_host_int(adapter); | ||
1818 | |||
1819 | /* Get SDIO ioport */ | 1811 | /* Get SDIO ioport */ |
1820 | mwifiex_init_sdio_ioport(adapter); | 1812 | mwifiex_init_sdio_ioport(adapter); |
1821 | 1813 | ||
@@ -1957,6 +1949,7 @@ static struct mwifiex_if_ops sdio_ops = { | |||
1957 | .register_dev = mwifiex_register_dev, | 1949 | .register_dev = mwifiex_register_dev, |
1958 | .unregister_dev = mwifiex_unregister_dev, | 1950 | .unregister_dev = mwifiex_unregister_dev, |
1959 | .enable_int = mwifiex_sdio_enable_host_int, | 1951 | .enable_int = mwifiex_sdio_enable_host_int, |
1952 | .disable_int = mwifiex_sdio_disable_host_int, | ||
1960 | .process_int_status = mwifiex_process_int_status, | 1953 | .process_int_status = mwifiex_process_int_status, |
1961 | .host_to_card = mwifiex_sdio_host_to_card, | 1954 | .host_to_card = mwifiex_sdio_host_to_card, |
1962 | .wakeup = mwifiex_pm_wakeup_card, | 1955 | .wakeup = mwifiex_pm_wakeup_card, |
diff --git a/drivers/net/wireless/mwifiex/sdio.h b/drivers/net/wireless/mwifiex/sdio.h index 6d51dfdd8251..532ae0ac4dfb 100644 --- a/drivers/net/wireless/mwifiex/sdio.h +++ b/drivers/net/wireless/mwifiex/sdio.h | |||
@@ -92,9 +92,6 @@ | |||
92 | /* Host Control Registers : Download host interrupt mask */ | 92 | /* Host Control Registers : Download host interrupt mask */ |
93 | #define DN_LD_HOST_INT_MASK (0x2U) | 93 | #define DN_LD_HOST_INT_MASK (0x2U) |
94 | 94 | ||
95 | /* Disable Host interrupt mask */ | ||
96 | #define HOST_INT_DISABLE 0xff | ||
97 | |||
98 | /* Host Control Registers : Host interrupt status */ | 95 | /* Host Control Registers : Host interrupt status */ |
99 | #define HOST_INTSTATUS_REG 0x03 | 96 | #define HOST_INTSTATUS_REG 0x03 |
100 | /* Host Control Registers : Upload host interrupt status */ | 97 | /* Host Control Registers : Upload host interrupt status */ |
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig index 9b915d3a44be..3e60a31582f8 100644 --- a/drivers/net/wireless/rt2x00/Kconfig +++ b/drivers/net/wireless/rt2x00/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | menuconfig RT2X00 | 1 | menuconfig RT2X00 |
2 | tristate "Ralink driver support" | 2 | tristate "Ralink driver support" |
3 | depends on MAC80211 | 3 | depends on MAC80211 && HAS_DMA |
4 | ---help--- | 4 | ---help--- |
5 | This will enable the support for the Ralink drivers, | 5 | This will enable the support for the Ralink drivers, |
6 | developed in the rt2x00 project <http://rt2x00.serialmonkey.com>. | 6 | developed in the rt2x00 project <http://rt2x00.serialmonkey.com>. |
diff --git a/drivers/net/wireless/rtlwifi/Kconfig b/drivers/net/wireless/rtlwifi/Kconfig index 7253de3d8c66..c2ffce7a907c 100644 --- a/drivers/net/wireless/rtlwifi/Kconfig +++ b/drivers/net/wireless/rtlwifi/Kconfig | |||
@@ -1,27 +1,20 @@ | |||
1 | config RTLWIFI | 1 | menuconfig RTL_CARDS |
2 | tristate "Realtek wireless card support" | 2 | tristate "Realtek rtlwifi family of devices" |
3 | depends on MAC80211 | 3 | depends on MAC80211 && (PCI || USB) |
4 | select FW_LOADER | ||
5 | ---help--- | ||
6 | This is common code for RTL8192CE/RTL8192CU/RTL8192SE/RTL8723AE | ||
7 | drivers. This module does nothing by itself - the various front-end | ||
8 | drivers need to be enabled to support any desired devices. | ||
9 | |||
10 | If you choose to build as a module, it'll be called rtlwifi. | ||
11 | |||
12 | config RTLWIFI_DEBUG | ||
13 | bool "Debugging output for rtlwifi driver family" | ||
14 | depends on RTLWIFI | ||
15 | default y | 4 | default y |
16 | ---help--- | 5 | ---help--- |
17 | To use the module option that sets the dynamic-debugging level for, | 6 | This option will enable support for the Realtek mac80211-based |
18 | the front-end driver, this parameter must be "Y". For memory-limited | 7 | wireless drivers. Drivers rtl8192ce, rtl8192cu, rtl8192se, rtl8192de, |
19 | systems, choose "N". If in doubt, choose "Y". | 8 | rtl8723eu, and rtl8188eu share some common code. |
9 | |||
10 | if RTL_CARDS | ||
20 | 11 | ||
21 | config RTL8192CE | 12 | config RTL8192CE |
22 | tristate "Realtek RTL8192CE/RTL8188CE Wireless Network Adapter" | 13 | tristate "Realtek RTL8192CE/RTL8188CE Wireless Network Adapter" |
23 | depends on RTLWIFI && PCI | 14 | depends on PCI |
24 | select RTL8192C_COMMON | 15 | select RTL8192C_COMMON |
16 | select RTLWIFI | ||
17 | select RTLWIFI_PCI | ||
25 | ---help--- | 18 | ---help--- |
26 | This is the driver for Realtek RTL8192CE/RTL8188CE 802.11n PCIe | 19 | This is the driver for Realtek RTL8192CE/RTL8188CE 802.11n PCIe |
27 | wireless network adapters. | 20 | wireless network adapters. |
@@ -30,7 +23,9 @@ config RTL8192CE | |||
30 | 23 | ||
31 | config RTL8192SE | 24 | config RTL8192SE |
32 | tristate "Realtek RTL8192SE/RTL8191SE PCIe Wireless Network Adapter" | 25 | tristate "Realtek RTL8192SE/RTL8191SE PCIe Wireless Network Adapter" |
33 | depends on RTLWIFI && PCI | 26 | depends on PCI |
27 | select RTLWIFI | ||
28 | select RTLWIFI_PCI | ||
34 | ---help--- | 29 | ---help--- |
35 | This is the driver for Realtek RTL8192SE/RTL8191SE 802.11n PCIe | 30 | This is the driver for Realtek RTL8192SE/RTL8191SE 802.11n PCIe |
36 | wireless network adapters. | 31 | wireless network adapters. |
@@ -39,7 +34,9 @@ config RTL8192SE | |||
39 | 34 | ||
40 | config RTL8192DE | 35 | config RTL8192DE |
41 | tristate "Realtek RTL8192DE/RTL8188DE PCIe Wireless Network Adapter" | 36 | tristate "Realtek RTL8192DE/RTL8188DE PCIe Wireless Network Adapter" |
42 | depends on RTLWIFI && PCI | 37 | depends on PCI |
38 | select RTLWIFI | ||
39 | select RTLWIFI_PCI | ||
43 | ---help--- | 40 | ---help--- |
44 | This is the driver for Realtek RTL8192DE/RTL8188DE 802.11n PCIe | 41 | This is the driver for Realtek RTL8192DE/RTL8188DE 802.11n PCIe |
45 | wireless network adapters. | 42 | wireless network adapters. |
@@ -48,7 +45,9 @@ config RTL8192DE | |||
48 | 45 | ||
49 | config RTL8723AE | 46 | config RTL8723AE |
50 | tristate "Realtek RTL8723AE PCIe Wireless Network Adapter" | 47 | tristate "Realtek RTL8723AE PCIe Wireless Network Adapter" |
51 | depends on RTLWIFI && PCI | 48 | depends on PCI |
49 | select RTLWIFI | ||
50 | select RTLWIFI_PCI | ||
52 | ---help--- | 51 | ---help--- |
53 | This is the driver for Realtek RTL8723AE 802.11n PCIe | 52 | This is the driver for Realtek RTL8723AE 802.11n PCIe |
54 | wireless network adapters. | 53 | wireless network adapters. |
@@ -57,7 +56,9 @@ config RTL8723AE | |||
57 | 56 | ||
58 | config RTL8188EE | 57 | config RTL8188EE |
59 | tristate "Realtek RTL8188EE Wireless Network Adapter" | 58 | tristate "Realtek RTL8188EE Wireless Network Adapter" |
60 | depends on RTLWIFI && PCI | 59 | depends on PCI |
60 | select RTLWIFI | ||
61 | select RTLWIFI_PCI | ||
61 | ---help--- | 62 | ---help--- |
62 | This is the driver for Realtek RTL8188EE 802.11n PCIe | 63 | This is the driver for Realtek RTL8188EE 802.11n PCIe |
63 | wireless network adapters. | 64 | wireless network adapters. |
@@ -66,7 +67,9 @@ config RTL8188EE | |||
66 | 67 | ||
67 | config RTL8192CU | 68 | config RTL8192CU |
68 | tristate "Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter" | 69 | tristate "Realtek RTL8192CU/RTL8188CU USB Wireless Network Adapter" |
69 | depends on RTLWIFI && USB | 70 | depends on USB |
71 | select RTLWIFI | ||
72 | select RTLWIFI_USB | ||
70 | select RTL8192C_COMMON | 73 | select RTL8192C_COMMON |
71 | ---help--- | 74 | ---help--- |
72 | This is the driver for Realtek RTL8192CU/RTL8188CU 802.11n USB | 75 | This is the driver for Realtek RTL8192CU/RTL8188CU 802.11n USB |
@@ -74,7 +77,28 @@ config RTL8192CU | |||
74 | 77 | ||
75 | If you choose to build it as a module, it will be called rtl8192cu | 78 | If you choose to build it as a module, it will be called rtl8192cu |
76 | 79 | ||
80 | config RTLWIFI | ||
81 | tristate | ||
82 | select FW_LOADER | ||
83 | |||
84 | config RTLWIFI_PCI | ||
85 | tristate | ||
86 | |||
87 | config RTLWIFI_USB | ||
88 | tristate | ||
89 | |||
90 | config RTLWIFI_DEBUG | ||
91 | bool "Debugging output for rtlwifi driver family" | ||
92 | depends on RTLWIFI | ||
93 | default y | ||
94 | ---help--- | ||
95 | To use the module option that sets the dynamic-debugging level for, | ||
96 | the front-end driver, this parameter must be "Y". For memory-limited | ||
97 | systems, choose "N". If in doubt, choose "Y". | ||
98 | |||
77 | config RTL8192C_COMMON | 99 | config RTL8192C_COMMON |
78 | tristate | 100 | tristate |
79 | depends on RTL8192CE || RTL8192CU | 101 | depends on RTL8192CE || RTL8192CU |
80 | default m | 102 | default y |
103 | |||
104 | endif | ||
diff --git a/drivers/net/wireless/rtlwifi/Makefile b/drivers/net/wireless/rtlwifi/Makefile index ff02b874f8d8..d56f023a4b90 100644 --- a/drivers/net/wireless/rtlwifi/Makefile +++ b/drivers/net/wireless/rtlwifi/Makefile | |||
@@ -12,13 +12,11 @@ rtlwifi-objs := \ | |||
12 | 12 | ||
13 | rtl8192c_common-objs += \ | 13 | rtl8192c_common-objs += \ |
14 | 14 | ||
15 | ifneq ($(CONFIG_PCI),) | 15 | obj-$(CONFIG_RTLWIFI_PCI) += rtl_pci.o |
16 | rtlwifi-objs += pci.o | 16 | rtl_pci-objs := pci.o |
17 | endif | ||
18 | 17 | ||
19 | ifneq ($(CONFIG_USB),) | 18 | obj-$(CONFIG_RTLWIFI_USB) += rtl_usb.o |
20 | rtlwifi-objs += usb.o | 19 | rtl_usb-objs := usb.o |
21 | endif | ||
22 | 20 | ||
23 | obj-$(CONFIG_RTL8192C_COMMON) += rtl8192c/ | 21 | obj-$(CONFIG_RTL8192C_COMMON) += rtl8192c/ |
24 | obj-$(CONFIG_RTL8192CE) += rtl8192ce/ | 22 | obj-$(CONFIG_RTL8192CE) += rtl8192ce/ |
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index 9d558ac77b0c..7651f5acc14b 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -172,6 +172,7 @@ u8 rtl_tid_to_ac(u8 tid) | |||
172 | { | 172 | { |
173 | return tid_to_ac[tid]; | 173 | return tid_to_ac[tid]; |
174 | } | 174 | } |
175 | EXPORT_SYMBOL_GPL(rtl_tid_to_ac); | ||
175 | 176 | ||
176 | static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw, | 177 | static void _rtl_init_hw_ht_capab(struct ieee80211_hw *hw, |
177 | struct ieee80211_sta_ht_cap *ht_cap) | 178 | struct ieee80211_sta_ht_cap *ht_cap) |
@@ -406,6 +407,7 @@ void rtl_deinit_deferred_work(struct ieee80211_hw *hw) | |||
406 | cancel_delayed_work(&rtlpriv->works.ps_rfon_wq); | 407 | cancel_delayed_work(&rtlpriv->works.ps_rfon_wq); |
407 | cancel_delayed_work(&rtlpriv->works.fwevt_wq); | 408 | cancel_delayed_work(&rtlpriv->works.fwevt_wq); |
408 | } | 409 | } |
410 | EXPORT_SYMBOL_GPL(rtl_deinit_deferred_work); | ||
409 | 411 | ||
410 | void rtl_init_rfkill(struct ieee80211_hw *hw) | 412 | void rtl_init_rfkill(struct ieee80211_hw *hw) |
411 | { | 413 | { |
@@ -439,6 +441,7 @@ void rtl_deinit_rfkill(struct ieee80211_hw *hw) | |||
439 | { | 441 | { |
440 | wiphy_rfkill_stop_polling(hw->wiphy); | 442 | wiphy_rfkill_stop_polling(hw->wiphy); |
441 | } | 443 | } |
444 | EXPORT_SYMBOL_GPL(rtl_deinit_rfkill); | ||
442 | 445 | ||
443 | int rtl_init_core(struct ieee80211_hw *hw) | 446 | int rtl_init_core(struct ieee80211_hw *hw) |
444 | { | 447 | { |
@@ -489,10 +492,12 @@ int rtl_init_core(struct ieee80211_hw *hw) | |||
489 | 492 | ||
490 | return 0; | 493 | return 0; |
491 | } | 494 | } |
495 | EXPORT_SYMBOL_GPL(rtl_init_core); | ||
492 | 496 | ||
493 | void rtl_deinit_core(struct ieee80211_hw *hw) | 497 | void rtl_deinit_core(struct ieee80211_hw *hw) |
494 | { | 498 | { |
495 | } | 499 | } |
500 | EXPORT_SYMBOL_GPL(rtl_deinit_core); | ||
496 | 501 | ||
497 | void rtl_init_rx_config(struct ieee80211_hw *hw) | 502 | void rtl_init_rx_config(struct ieee80211_hw *hw) |
498 | { | 503 | { |
@@ -501,6 +506,7 @@ void rtl_init_rx_config(struct ieee80211_hw *hw) | |||
501 | 506 | ||
502 | rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_RCR, (u8 *) (&mac->rx_conf)); | 507 | rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_RCR, (u8 *) (&mac->rx_conf)); |
503 | } | 508 | } |
509 | EXPORT_SYMBOL_GPL(rtl_init_rx_config); | ||
504 | 510 | ||
505 | /********************************************************* | 511 | /********************************************************* |
506 | * | 512 | * |
@@ -879,6 +885,7 @@ bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
879 | 885 | ||
880 | return true; | 886 | return true; |
881 | } | 887 | } |
888 | EXPORT_SYMBOL_GPL(rtl_tx_mgmt_proc); | ||
882 | 889 | ||
883 | void rtl_get_tcb_desc(struct ieee80211_hw *hw, | 890 | void rtl_get_tcb_desc(struct ieee80211_hw *hw, |
884 | struct ieee80211_tx_info *info, | 891 | struct ieee80211_tx_info *info, |
@@ -1052,6 +1059,7 @@ bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) | |||
1052 | 1059 | ||
1053 | return true; | 1060 | return true; |
1054 | } | 1061 | } |
1062 | EXPORT_SYMBOL_GPL(rtl_action_proc); | ||
1055 | 1063 | ||
1056 | /*should call before software enc*/ | 1064 | /*should call before software enc*/ |
1057 | u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) | 1065 | u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) |
@@ -1125,6 +1133,7 @@ u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx) | |||
1125 | 1133 | ||
1126 | return false; | 1134 | return false; |
1127 | } | 1135 | } |
1136 | EXPORT_SYMBOL_GPL(rtl_is_special_data); | ||
1128 | 1137 | ||
1129 | /********************************************************* | 1138 | /********************************************************* |
1130 | * | 1139 | * |
@@ -1300,6 +1309,7 @@ void rtl_beacon_statistic(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
1300 | 1309 | ||
1301 | rtlpriv->link_info.bcn_rx_inperiod++; | 1310 | rtlpriv->link_info.bcn_rx_inperiod++; |
1302 | } | 1311 | } |
1312 | EXPORT_SYMBOL_GPL(rtl_beacon_statistic); | ||
1303 | 1313 | ||
1304 | void rtl_watchdog_wq_callback(void *data) | 1314 | void rtl_watchdog_wq_callback(void *data) |
1305 | { | 1315 | { |
@@ -1793,6 +1803,7 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len) | |||
1793 | 1803 | ||
1794 | mac->vendor = vendor; | 1804 | mac->vendor = vendor; |
1795 | } | 1805 | } |
1806 | EXPORT_SYMBOL_GPL(rtl_recognize_peer); | ||
1796 | 1807 | ||
1797 | /********************************************************* | 1808 | /********************************************************* |
1798 | * | 1809 | * |
@@ -1849,6 +1860,7 @@ struct attribute_group rtl_attribute_group = { | |||
1849 | .name = "rtlsysfs", | 1860 | .name = "rtlsysfs", |
1850 | .attrs = rtl_sysfs_entries, | 1861 | .attrs = rtl_sysfs_entries, |
1851 | }; | 1862 | }; |
1863 | EXPORT_SYMBOL_GPL(rtl_attribute_group); | ||
1852 | 1864 | ||
1853 | MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); | 1865 | MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); |
1854 | MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); | 1866 | MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); |
@@ -1856,7 +1868,8 @@ MODULE_AUTHOR("Larry Finger <Larry.FInger@lwfinger.net>"); | |||
1856 | MODULE_LICENSE("GPL"); | 1868 | MODULE_LICENSE("GPL"); |
1857 | MODULE_DESCRIPTION("Realtek 802.11n PCI wireless core"); | 1869 | MODULE_DESCRIPTION("Realtek 802.11n PCI wireless core"); |
1858 | 1870 | ||
1859 | struct rtl_global_var global_var = {}; | 1871 | struct rtl_global_var rtl_global_var = {}; |
1872 | EXPORT_SYMBOL_GPL(rtl_global_var); | ||
1860 | 1873 | ||
1861 | static int __init rtl_core_module_init(void) | 1874 | static int __init rtl_core_module_init(void) |
1862 | { | 1875 | { |
@@ -1864,8 +1877,8 @@ static int __init rtl_core_module_init(void) | |||
1864 | pr_err("Unable to register rtl_rc, use default RC !!\n"); | 1877 | pr_err("Unable to register rtl_rc, use default RC !!\n"); |
1865 | 1878 | ||
1866 | /* init some global vars */ | 1879 | /* init some global vars */ |
1867 | INIT_LIST_HEAD(&global_var.glb_priv_list); | 1880 | INIT_LIST_HEAD(&rtl_global_var.glb_priv_list); |
1868 | spin_lock_init(&global_var.glb_list_lock); | 1881 | spin_lock_init(&rtl_global_var.glb_list_lock); |
1869 | 1882 | ||
1870 | return 0; | 1883 | return 0; |
1871 | } | 1884 | } |
diff --git a/drivers/net/wireless/rtlwifi/base.h b/drivers/net/wireless/rtlwifi/base.h index 8576bc34b032..0e5fe0902daf 100644 --- a/drivers/net/wireless/rtlwifi/base.h +++ b/drivers/net/wireless/rtlwifi/base.h | |||
@@ -147,7 +147,7 @@ void rtl_recognize_peer(struct ieee80211_hw *hw, u8 *data, unsigned int len); | |||
147 | u8 rtl_tid_to_ac(u8 tid); | 147 | u8 rtl_tid_to_ac(u8 tid); |
148 | extern struct attribute_group rtl_attribute_group; | 148 | extern struct attribute_group rtl_attribute_group; |
149 | void rtl_easy_concurrent_retrytimer_callback(unsigned long data); | 149 | void rtl_easy_concurrent_retrytimer_callback(unsigned long data); |
150 | extern struct rtl_global_var global_var; | 150 | extern struct rtl_global_var rtl_global_var; |
151 | int rtlwifi_rate_mapping(struct ieee80211_hw *hw, | 151 | int rtlwifi_rate_mapping(struct ieee80211_hw *hw, |
152 | bool isht, u8 desc_rate, bool first_ampdu); | 152 | bool isht, u8 desc_rate, bool first_ampdu); |
153 | bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb); | 153 | bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb); |
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c index ee84844be008..733b7ce7f0e2 100644 --- a/drivers/net/wireless/rtlwifi/core.c +++ b/drivers/net/wireless/rtlwifi/core.c | |||
@@ -1330,3 +1330,4 @@ const struct ieee80211_ops rtl_ops = { | |||
1330 | .rfkill_poll = rtl_op_rfkill_poll, | 1330 | .rfkill_poll = rtl_op_rfkill_poll, |
1331 | .flush = rtl_op_flush, | 1331 | .flush = rtl_op_flush, |
1332 | }; | 1332 | }; |
1333 | EXPORT_SYMBOL_GPL(rtl_ops); | ||
diff --git a/drivers/net/wireless/rtlwifi/debug.c b/drivers/net/wireless/rtlwifi/debug.c index 7d52d3d7769f..76e2086e137e 100644 --- a/drivers/net/wireless/rtlwifi/debug.c +++ b/drivers/net/wireless/rtlwifi/debug.c | |||
@@ -51,3 +51,4 @@ void rtl_dbgp_flag_init(struct ieee80211_hw *hw) | |||
51 | 51 | ||
52 | /*Init Debug flag enable condition */ | 52 | /*Init Debug flag enable condition */ |
53 | } | 53 | } |
54 | EXPORT_SYMBOL_GPL(rtl_dbgp_flag_init); | ||
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c index 9e3894178e77..838a1ed3f194 100644 --- a/drivers/net/wireless/rtlwifi/efuse.c +++ b/drivers/net/wireless/rtlwifi/efuse.c | |||
@@ -229,6 +229,7 @@ void read_efuse_byte(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf) | |||
229 | 229 | ||
230 | *pbuf = (u8) (value32 & 0xff); | 230 | *pbuf = (u8) (value32 & 0xff); |
231 | } | 231 | } |
232 | EXPORT_SYMBOL_GPL(read_efuse_byte); | ||
232 | 233 | ||
233 | void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) | 234 | void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) |
234 | { | 235 | { |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index c97e9d327331..703f839af6ca 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -35,6 +35,13 @@ | |||
35 | #include "efuse.h" | 35 | #include "efuse.h" |
36 | #include <linux/export.h> | 36 | #include <linux/export.h> |
37 | #include <linux/kmemleak.h> | 37 | #include <linux/kmemleak.h> |
38 | #include <linux/module.h> | ||
39 | |||
40 | MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); | ||
41 | MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); | ||
42 | MODULE_AUTHOR("Larry Finger <Larry.FInger@lwfinger.net>"); | ||
43 | MODULE_LICENSE("GPL"); | ||
44 | MODULE_DESCRIPTION("PCI basic driver for rtlwifi"); | ||
38 | 45 | ||
39 | static const u16 pcibridge_vendors[PCI_BRIDGE_VENDOR_MAX] = { | 46 | static const u16 pcibridge_vendors[PCI_BRIDGE_VENDOR_MAX] = { |
40 | PCI_VENDOR_ID_INTEL, | 47 | PCI_VENDOR_ID_INTEL, |
@@ -1008,19 +1015,6 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw) | |||
1008 | return; | 1015 | return; |
1009 | } | 1016 | } |
1010 | 1017 | ||
1011 | static void rtl_lps_change_work_callback(struct work_struct *work) | ||
1012 | { | ||
1013 | struct rtl_works *rtlworks = | ||
1014 | container_of(work, struct rtl_works, lps_change_work); | ||
1015 | struct ieee80211_hw *hw = rtlworks->hw; | ||
1016 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
1017 | |||
1018 | if (rtlpriv->enter_ps) | ||
1019 | rtl_lps_enter(hw); | ||
1020 | else | ||
1021 | rtl_lps_leave(hw); | ||
1022 | } | ||
1023 | |||
1024 | static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw) | 1018 | static void _rtl_pci_init_trx_var(struct ieee80211_hw *hw) |
1025 | { | 1019 | { |
1026 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 1020 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
@@ -1899,7 +1893,7 @@ int rtl_pci_probe(struct pci_dev *pdev, | |||
1899 | rtlpriv->rtlhal.interface = INTF_PCI; | 1893 | rtlpriv->rtlhal.interface = INTF_PCI; |
1900 | rtlpriv->cfg = (struct rtl_hal_cfg *)(id->driver_data); | 1894 | rtlpriv->cfg = (struct rtl_hal_cfg *)(id->driver_data); |
1901 | rtlpriv->intf_ops = &rtl_pci_ops; | 1895 | rtlpriv->intf_ops = &rtl_pci_ops; |
1902 | rtlpriv->glb_var = &global_var; | 1896 | rtlpriv->glb_var = &rtl_global_var; |
1903 | 1897 | ||
1904 | /* | 1898 | /* |
1905 | *init dbgp flags before all | 1899 | *init dbgp flags before all |
diff --git a/drivers/net/wireless/rtlwifi/ps.c b/drivers/net/wireless/rtlwifi/ps.c index 884bceae38a9..298b615964e8 100644 --- a/drivers/net/wireless/rtlwifi/ps.c +++ b/drivers/net/wireless/rtlwifi/ps.c | |||
@@ -269,6 +269,7 @@ void rtl_ips_nic_on(struct ieee80211_hw *hw) | |||
269 | 269 | ||
270 | spin_unlock_irqrestore(&rtlpriv->locks.ips_lock, flags); | 270 | spin_unlock_irqrestore(&rtlpriv->locks.ips_lock, flags); |
271 | } | 271 | } |
272 | EXPORT_SYMBOL_GPL(rtl_ips_nic_on); | ||
272 | 273 | ||
273 | /*for FW LPS*/ | 274 | /*for FW LPS*/ |
274 | 275 | ||
@@ -518,6 +519,7 @@ void rtl_swlps_beacon(struct ieee80211_hw *hw, void *data, unsigned int len) | |||
518 | "u_bufferd: %x, m_buffered: %x\n", u_buffed, m_buffed); | 519 | "u_bufferd: %x, m_buffered: %x\n", u_buffed, m_buffed); |
519 | } | 520 | } |
520 | } | 521 | } |
522 | EXPORT_SYMBOL_GPL(rtl_swlps_beacon); | ||
521 | 523 | ||
522 | void rtl_swlps_rf_awake(struct ieee80211_hw *hw) | 524 | void rtl_swlps_rf_awake(struct ieee80211_hw *hw) |
523 | { | 525 | { |
@@ -611,6 +613,19 @@ void rtl_swlps_rf_sleep(struct ieee80211_hw *hw) | |||
611 | MSECS(sleep_intv * mac->vif->bss_conf.beacon_int - 40)); | 613 | MSECS(sleep_intv * mac->vif->bss_conf.beacon_int - 40)); |
612 | } | 614 | } |
613 | 615 | ||
616 | void rtl_lps_change_work_callback(struct work_struct *work) | ||
617 | { | ||
618 | struct rtl_works *rtlworks = | ||
619 | container_of(work, struct rtl_works, lps_change_work); | ||
620 | struct ieee80211_hw *hw = rtlworks->hw; | ||
621 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
622 | |||
623 | if (rtlpriv->enter_ps) | ||
624 | rtl_lps_enter(hw); | ||
625 | else | ||
626 | rtl_lps_leave(hw); | ||
627 | } | ||
628 | EXPORT_SYMBOL_GPL(rtl_lps_change_work_callback); | ||
614 | 629 | ||
615 | void rtl_swlps_wq_callback(void *data) | 630 | void rtl_swlps_wq_callback(void *data) |
616 | { | 631 | { |
@@ -922,3 +937,4 @@ void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len) | |||
922 | else | 937 | else |
923 | rtl_p2p_noa_ie(hw, data, len - FCS_LEN); | 938 | rtl_p2p_noa_ie(hw, data, len - FCS_LEN); |
924 | } | 939 | } |
940 | EXPORT_SYMBOL_GPL(rtl_p2p_info); | ||
diff --git a/drivers/net/wireless/rtlwifi/ps.h b/drivers/net/wireless/rtlwifi/ps.h index 4d682b753f50..88bd76ea88f7 100644 --- a/drivers/net/wireless/rtlwifi/ps.h +++ b/drivers/net/wireless/rtlwifi/ps.h | |||
@@ -49,5 +49,6 @@ void rtl_swlps_rf_awake(struct ieee80211_hw *hw); | |||
49 | void rtl_swlps_rf_sleep(struct ieee80211_hw *hw); | 49 | void rtl_swlps_rf_sleep(struct ieee80211_hw *hw); |
50 | void rtl_p2p_ps_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); | 50 | void rtl_p2p_ps_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); |
51 | void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len); | 51 | void rtl_p2p_info(struct ieee80211_hw *hw, void *data, unsigned int len); |
52 | void rtl_lps_change_work_callback(struct work_struct *work); | ||
52 | 53 | ||
53 | #endif | 54 | #endif |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index a3532e077871..e56778cac9bf 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -32,6 +32,13 @@ | |||
32 | #include "ps.h" | 32 | #include "ps.h" |
33 | #include "rtl8192c/fw_common.h" | 33 | #include "rtl8192c/fw_common.h" |
34 | #include <linux/export.h> | 34 | #include <linux/export.h> |
35 | #include <linux/module.h> | ||
36 | |||
37 | MODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); | ||
38 | MODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); | ||
39 | MODULE_AUTHOR("Larry Finger <Larry.FInger@lwfinger.net>"); | ||
40 | MODULE_LICENSE("GPL"); | ||
41 | MODULE_DESCRIPTION("USB basic driver for rtlwifi"); | ||
35 | 42 | ||
36 | #define REALTEK_USB_VENQT_READ 0xC0 | 43 | #define REALTEK_USB_VENQT_READ 0xC0 |
37 | #define REALTEK_USB_VENQT_WRITE 0x40 | 44 | #define REALTEK_USB_VENQT_WRITE 0x40 |
@@ -1070,6 +1077,8 @@ int rtl_usb_probe(struct usb_interface *intf, | |||
1070 | spin_lock_init(&rtlpriv->locks.usb_lock); | 1077 | spin_lock_init(&rtlpriv->locks.usb_lock); |
1071 | INIT_WORK(&rtlpriv->works.fill_h2c_cmd, | 1078 | INIT_WORK(&rtlpriv->works.fill_h2c_cmd, |
1072 | rtl_fill_h2c_cmd_work_callback); | 1079 | rtl_fill_h2c_cmd_work_callback); |
1080 | INIT_WORK(&rtlpriv->works.lps_change_work, | ||
1081 | rtl_lps_change_work_callback); | ||
1073 | 1082 | ||
1074 | rtlpriv->usb_data_index = 0; | 1083 | rtlpriv->usb_data_index = 0; |
1075 | init_completion(&rtlpriv->firmware_loading_complete); | 1084 | init_completion(&rtlpriv->firmware_loading_complete); |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index b62d4af6c667..45e921401b06 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -361,7 +361,8 @@ struct ssb_device_id { | |||
361 | __u16 vendor; | 361 | __u16 vendor; |
362 | __u16 coreid; | 362 | __u16 coreid; |
363 | __u8 revision; | 363 | __u8 revision; |
364 | }; | 364 | __u8 __pad; |
365 | } __attribute__((packed, aligned(2))); | ||
365 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ | 366 | #define SSB_DEVICE(_vendor, _coreid, _revision) \ |
366 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } | 367 | { .vendor = _vendor, .coreid = _coreid, .revision = _revision, } |
367 | #define SSB_DEVTABLE_END \ | 368 | #define SSB_DEVTABLE_END \ |
@@ -377,7 +378,7 @@ struct bcma_device_id { | |||
377 | __u16 id; | 378 | __u16 id; |
378 | __u8 rev; | 379 | __u8 rev; |
379 | __u8 class; | 380 | __u8 class; |
380 | }; | 381 | } __attribute__((packed,aligned(2))); |
381 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ | 382 | #define BCMA_CORE(_manuf, _id, _rev, _class) \ |
382 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } | 383 | { .manuf = _manuf, .id = _id, .rev = _rev, .class = _class, } |
383 | #define BCMA_CORETABLE_END \ | 384 | #define BCMA_CORETABLE_END \ |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index ac09d98490aa..07f6fc468e17 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -2346,7 +2346,11 @@ static int do_proc_dointvec_ms_jiffies_conv(bool *negp, unsigned long *lvalp, | |||
2346 | int write, void *data) | 2346 | int write, void *data) |
2347 | { | 2347 | { |
2348 | if (write) { | 2348 | if (write) { |
2349 | *valp = msecs_to_jiffies(*negp ? -*lvalp : *lvalp); | 2349 | unsigned long jif = msecs_to_jiffies(*negp ? -*lvalp : *lvalp); |
2350 | |||
2351 | if (jif > INT_MAX) | ||
2352 | return 1; | ||
2353 | *valp = (int)jif; | ||
2350 | } else { | 2354 | } else { |
2351 | int val = *valp; | 2355 | int val = *valp; |
2352 | unsigned long lval; | 2356 | unsigned long lval; |
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 69af490cce44..4b99c9a27044 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -619,6 +619,9 @@ rehash: | |||
619 | mp->br = br; | 619 | mp->br = br; |
620 | mp->addr = *group; | 620 | mp->addr = *group; |
621 | 621 | ||
622 | setup_timer(&mp->timer, br_multicast_group_expired, | ||
623 | (unsigned long)mp); | ||
624 | |||
622 | hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]); | 625 | hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]); |
623 | mdb->size++; | 626 | mdb->size++; |
624 | 627 | ||
@@ -1126,7 +1129,6 @@ static int br_ip4_multicast_query(struct net_bridge *br, | |||
1126 | if (!mp) | 1129 | if (!mp) |
1127 | goto out; | 1130 | goto out; |
1128 | 1131 | ||
1129 | setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp); | ||
1130 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | 1132 | mod_timer(&mp->timer, now + br->multicast_membership_interval); |
1131 | mp->timer_armed = true; | 1133 | mp->timer_armed = true; |
1132 | 1134 | ||
@@ -1204,7 +1206,6 @@ static int br_ip6_multicast_query(struct net_bridge *br, | |||
1204 | if (!mp) | 1206 | if (!mp) |
1205 | goto out; | 1207 | goto out; |
1206 | 1208 | ||
1207 | setup_timer(&mp->timer, br_multicast_group_expired, (unsigned long)mp); | ||
1208 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | 1209 | mod_timer(&mp->timer, now + br->multicast_membership_interval); |
1209 | mp->timer_armed = true; | 1210 | mp->timer_armed = true; |
1210 | 1211 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index b7de821f98df..9232c68941ab 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -2767,6 +2767,7 @@ EXPORT_SYMBOL(neigh_app_ns); | |||
2767 | 2767 | ||
2768 | #ifdef CONFIG_SYSCTL | 2768 | #ifdef CONFIG_SYSCTL |
2769 | static int zero; | 2769 | static int zero; |
2770 | static int int_max = INT_MAX; | ||
2770 | static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN); | 2771 | static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN); |
2771 | 2772 | ||
2772 | static int proc_unres_qlen(struct ctl_table *ctl, int write, | 2773 | static int proc_unres_qlen(struct ctl_table *ctl, int write, |
@@ -2819,19 +2820,25 @@ static struct neigh_sysctl_table { | |||
2819 | .procname = "mcast_solicit", | 2820 | .procname = "mcast_solicit", |
2820 | .maxlen = sizeof(int), | 2821 | .maxlen = sizeof(int), |
2821 | .mode = 0644, | 2822 | .mode = 0644, |
2822 | .proc_handler = proc_dointvec, | 2823 | .extra1 = &zero, |
2824 | .extra2 = &int_max, | ||
2825 | .proc_handler = proc_dointvec_minmax, | ||
2823 | }, | 2826 | }, |
2824 | [NEIGH_VAR_UCAST_PROBE] = { | 2827 | [NEIGH_VAR_UCAST_PROBE] = { |
2825 | .procname = "ucast_solicit", | 2828 | .procname = "ucast_solicit", |
2826 | .maxlen = sizeof(int), | 2829 | .maxlen = sizeof(int), |
2827 | .mode = 0644, | 2830 | .mode = 0644, |
2828 | .proc_handler = proc_dointvec, | 2831 | .extra1 = &zero, |
2832 | .extra2 = &int_max, | ||
2833 | .proc_handler = proc_dointvec_minmax, | ||
2829 | }, | 2834 | }, |
2830 | [NEIGH_VAR_APP_PROBE] = { | 2835 | [NEIGH_VAR_APP_PROBE] = { |
2831 | .procname = "app_solicit", | 2836 | .procname = "app_solicit", |
2832 | .maxlen = sizeof(int), | 2837 | .maxlen = sizeof(int), |
2833 | .mode = 0644, | 2838 | .mode = 0644, |
2834 | .proc_handler = proc_dointvec, | 2839 | .extra1 = &zero, |
2840 | .extra2 = &int_max, | ||
2841 | .proc_handler = proc_dointvec_minmax, | ||
2835 | }, | 2842 | }, |
2836 | [NEIGH_VAR_RETRANS_TIME] = { | 2843 | [NEIGH_VAR_RETRANS_TIME] = { |
2837 | .procname = "retrans_time", | 2844 | .procname = "retrans_time", |
@@ -2874,7 +2881,9 @@ static struct neigh_sysctl_table { | |||
2874 | .procname = "proxy_qlen", | 2881 | .procname = "proxy_qlen", |
2875 | .maxlen = sizeof(int), | 2882 | .maxlen = sizeof(int), |
2876 | .mode = 0644, | 2883 | .mode = 0644, |
2877 | .proc_handler = proc_dointvec, | 2884 | .extra1 = &zero, |
2885 | .extra2 = &int_max, | ||
2886 | .proc_handler = proc_dointvec_minmax, | ||
2878 | }, | 2887 | }, |
2879 | [NEIGH_VAR_ANYCAST_DELAY] = { | 2888 | [NEIGH_VAR_ANYCAST_DELAY] = { |
2880 | .procname = "anycast_delay", | 2889 | .procname = "anycast_delay", |
@@ -2916,19 +2925,25 @@ static struct neigh_sysctl_table { | |||
2916 | .procname = "gc_thresh1", | 2925 | .procname = "gc_thresh1", |
2917 | .maxlen = sizeof(int), | 2926 | .maxlen = sizeof(int), |
2918 | .mode = 0644, | 2927 | .mode = 0644, |
2919 | .proc_handler = proc_dointvec, | 2928 | .extra1 = &zero, |
2929 | .extra2 = &int_max, | ||
2930 | .proc_handler = proc_dointvec_minmax, | ||
2920 | }, | 2931 | }, |
2921 | [NEIGH_VAR_GC_THRESH2] = { | 2932 | [NEIGH_VAR_GC_THRESH2] = { |
2922 | .procname = "gc_thresh2", | 2933 | .procname = "gc_thresh2", |
2923 | .maxlen = sizeof(int), | 2934 | .maxlen = sizeof(int), |
2924 | .mode = 0644, | 2935 | .mode = 0644, |
2925 | .proc_handler = proc_dointvec, | 2936 | .extra1 = &zero, |
2937 | .extra2 = &int_max, | ||
2938 | .proc_handler = proc_dointvec_minmax, | ||
2926 | }, | 2939 | }, |
2927 | [NEIGH_VAR_GC_THRESH3] = { | 2940 | [NEIGH_VAR_GC_THRESH3] = { |
2928 | .procname = "gc_thresh3", | 2941 | .procname = "gc_thresh3", |
2929 | .maxlen = sizeof(int), | 2942 | .maxlen = sizeof(int), |
2930 | .mode = 0644, | 2943 | .mode = 0644, |
2931 | .proc_handler = proc_dointvec, | 2944 | .extra1 = &zero, |
2945 | .extra2 = &int_max, | ||
2946 | .proc_handler = proc_dointvec_minmax, | ||
2932 | }, | 2947 | }, |
2933 | {}, | 2948 | {}, |
2934 | }, | 2949 | }, |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 20e02d2605ec..3df4d4ccf440 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -309,7 +309,8 @@ EXPORT_SYMBOL(__alloc_skb); | |||
309 | * @frag_size: size of fragment, or 0 if head was kmalloced | 309 | * @frag_size: size of fragment, or 0 if head was kmalloced |
310 | * | 310 | * |
311 | * Allocate a new &sk_buff. Caller provides space holding head and | 311 | * Allocate a new &sk_buff. Caller provides space holding head and |
312 | * skb_shared_info. @data must have been allocated by kmalloc() | 312 | * skb_shared_info. @data must have been allocated by kmalloc() only if |
313 | * @frag_size is 0, otherwise data should come from the page allocator. | ||
313 | * The return is the new skb buffer. | 314 | * The return is the new skb buffer. |
314 | * On a failure the return is %NULL, and @data is not freed. | 315 | * On a failure the return is %NULL, and @data is not freed. |
315 | * Notes : | 316 | * Notes : |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 49616fed9340..108a1e9c9eac 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -2133,7 +2133,7 @@ static void trie_show_stats(struct seq_file *seq, struct trie_stat *stat) | |||
2133 | max--; | 2133 | max--; |
2134 | 2134 | ||
2135 | pointers = 0; | 2135 | pointers = 0; |
2136 | for (i = 1; i <= max; i++) | 2136 | for (i = 1; i < max; i++) |
2137 | if (stat->nodesizes[i] != 0) { | 2137 | if (stat->nodesizes[i] != 0) { |
2138 | seq_printf(seq, " %u: %u", i, stat->nodesizes[i]); | 2138 | seq_printf(seq, " %u: %u", i, stat->nodesizes[i]); |
2139 | pointers += (1<<i) * stat->nodesizes[i]; | 2139 | pointers += (1<<i) * stat->nodesizes[i]; |
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index b2c123c44d69..610e324348d1 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -36,6 +36,8 @@ static int tcp_adv_win_scale_min = -31; | |||
36 | static int tcp_adv_win_scale_max = 31; | 36 | static int tcp_adv_win_scale_max = 31; |
37 | static int ip_ttl_min = 1; | 37 | static int ip_ttl_min = 1; |
38 | static int ip_ttl_max = 255; | 38 | static int ip_ttl_max = 255; |
39 | static int tcp_syn_retries_min = 1; | ||
40 | static int tcp_syn_retries_max = MAX_TCP_SYNCNT; | ||
39 | static int ip_ping_group_range_min[] = { 0, 0 }; | 41 | static int ip_ping_group_range_min[] = { 0, 0 }; |
40 | static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX }; | 42 | static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX }; |
41 | 43 | ||
@@ -332,7 +334,9 @@ static struct ctl_table ipv4_table[] = { | |||
332 | .data = &sysctl_tcp_syn_retries, | 334 | .data = &sysctl_tcp_syn_retries, |
333 | .maxlen = sizeof(int), | 335 | .maxlen = sizeof(int), |
334 | .mode = 0644, | 336 | .mode = 0644, |
335 | .proc_handler = proc_dointvec | 337 | .proc_handler = proc_dointvec_minmax, |
338 | .extra1 = &tcp_syn_retries_min, | ||
339 | .extra2 = &tcp_syn_retries_max | ||
336 | }, | 340 | }, |
337 | { | 341 | { |
338 | .procname = "tcp_synack_retries", | 342 | .procname = "tcp_synack_retries", |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 583e8d435f9a..03986d31fa41 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -259,10 +259,12 @@ static void __net_exit ip6mr_rules_exit(struct net *net) | |||
259 | { | 259 | { |
260 | struct mr6_table *mrt, *next; | 260 | struct mr6_table *mrt, *next; |
261 | 261 | ||
262 | rtnl_lock(); | ||
262 | list_for_each_entry_safe(mrt, next, &net->ipv6.mr6_tables, list) { | 263 | list_for_each_entry_safe(mrt, next, &net->ipv6.mr6_tables, list) { |
263 | list_del(&mrt->list); | 264 | list_del(&mrt->list); |
264 | ip6mr_free_table(mrt); | 265 | ip6mr_free_table(mrt); |
265 | } | 266 | } |
267 | rtnl_unlock(); | ||
266 | fib_rules_unregister(net->ipv6.mr6_rules_ops); | 268 | fib_rules_unregister(net->ipv6.mr6_rules_ops); |
267 | } | 269 | } |
268 | #else | 270 | #else |
@@ -289,7 +291,10 @@ static int __net_init ip6mr_rules_init(struct net *net) | |||
289 | 291 | ||
290 | static void __net_exit ip6mr_rules_exit(struct net *net) | 292 | static void __net_exit ip6mr_rules_exit(struct net *net) |
291 | { | 293 | { |
294 | rtnl_lock(); | ||
292 | ip6mr_free_table(net->ipv6.mrt6); | 295 | ip6mr_free_table(net->ipv6.mrt6); |
296 | net->ipv6.mrt6 = NULL; | ||
297 | rtnl_unlock(); | ||
293 | } | 298 | } |
294 | #endif | 299 | #endif |
295 | 300 | ||
diff --git a/net/key/af_key.c b/net/key/af_key.c index 9da862070dd8..ab8bd2cabfa0 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -2081,6 +2081,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, const struct xfrm_policy * | |||
2081 | pol->sadb_x_policy_type = IPSEC_POLICY_NONE; | 2081 | pol->sadb_x_policy_type = IPSEC_POLICY_NONE; |
2082 | } | 2082 | } |
2083 | pol->sadb_x_policy_dir = dir+1; | 2083 | pol->sadb_x_policy_dir = dir+1; |
2084 | pol->sadb_x_policy_reserved = 0; | ||
2084 | pol->sadb_x_policy_id = xp->index; | 2085 | pol->sadb_x_policy_id = xp->index; |
2085 | pol->sadb_x_policy_priority = xp->priority; | 2086 | pol->sadb_x_policy_priority = xp->priority; |
2086 | 2087 | ||
@@ -3137,7 +3138,9 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct | |||
3137 | pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; | 3138 | pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; |
3138 | pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; | 3139 | pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; |
3139 | pol->sadb_x_policy_dir = XFRM_POLICY_OUT + 1; | 3140 | pol->sadb_x_policy_dir = XFRM_POLICY_OUT + 1; |
3141 | pol->sadb_x_policy_reserved = 0; | ||
3140 | pol->sadb_x_policy_id = xp->index; | 3142 | pol->sadb_x_policy_id = xp->index; |
3143 | pol->sadb_x_policy_priority = xp->priority; | ||
3141 | 3144 | ||
3142 | /* Set sadb_comb's. */ | 3145 | /* Set sadb_comb's. */ |
3143 | if (x->id.proto == IPPROTO_AH) | 3146 | if (x->id.proto == IPPROTO_AH) |
@@ -3525,6 +3528,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, | |||
3525 | pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; | 3528 | pol->sadb_x_policy_exttype = SADB_X_EXT_POLICY; |
3526 | pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; | 3529 | pol->sadb_x_policy_type = IPSEC_POLICY_IPSEC; |
3527 | pol->sadb_x_policy_dir = dir + 1; | 3530 | pol->sadb_x_policy_dir = dir + 1; |
3531 | pol->sadb_x_policy_reserved = 0; | ||
3528 | pol->sadb_x_policy_id = 0; | 3532 | pol->sadb_x_policy_id = 0; |
3529 | pol->sadb_x_policy_priority = 0; | 3533 | pol->sadb_x_policy_priority = 0; |
3530 | 3534 | ||
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8184d121ff09..43dd7525bfcb 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -666,6 +666,8 @@ static void ieee80211_get_et_stats(struct wiphy *wiphy, | |||
666 | if (sta->sdata->dev != dev) | 666 | if (sta->sdata->dev != dev) |
667 | continue; | 667 | continue; |
668 | 668 | ||
669 | sinfo.filled = 0; | ||
670 | sta_set_sinfo(sta, &sinfo); | ||
669 | i = 0; | 671 | i = 0; |
670 | ADD_STA_STATS(sta); | 672 | ADD_STA_STATS(sta); |
671 | } | 673 | } |
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index ac7ef5414bde..e6512e2ffd20 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c | |||
@@ -290,7 +290,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, | |||
290 | struct minstrel_rate *msr, *mr; | 290 | struct minstrel_rate *msr, *mr; |
291 | unsigned int ndx; | 291 | unsigned int ndx; |
292 | bool mrr_capable; | 292 | bool mrr_capable; |
293 | bool prev_sample = mi->prev_sample; | 293 | bool prev_sample; |
294 | int delta; | 294 | int delta; |
295 | int sampling_ratio; | 295 | int sampling_ratio; |
296 | 296 | ||
@@ -314,6 +314,7 @@ minstrel_get_rate(void *priv, struct ieee80211_sta *sta, | |||
314 | (mi->sample_count + mi->sample_deferred / 2); | 314 | (mi->sample_count + mi->sample_deferred / 2); |
315 | 315 | ||
316 | /* delta < 0: no sampling required */ | 316 | /* delta < 0: no sampling required */ |
317 | prev_sample = mi->prev_sample; | ||
317 | mi->prev_sample = false; | 318 | mi->prev_sample = false; |
318 | if (delta < 0 || (!mrr_capable && prev_sample)) | 319 | if (delta < 0 || (!mrr_capable && prev_sample)) |
319 | return; | 320 | return; |
diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index 5b2d3012b983..f5aed963b22e 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c | |||
@@ -804,10 +804,18 @@ minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta, | |||
804 | 804 | ||
805 | sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES]; | 805 | sample_group = &minstrel_mcs_groups[sample_idx / MCS_GROUP_RATES]; |
806 | info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; | 806 | info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; |
807 | rate->count = 1; | ||
808 | |||
809 | if (sample_idx / MCS_GROUP_RATES == MINSTREL_CCK_GROUP) { | ||
810 | int idx = sample_idx % ARRAY_SIZE(mp->cck_rates); | ||
811 | rate->idx = mp->cck_rates[idx]; | ||
812 | rate->flags = 0; | ||
813 | return; | ||
814 | } | ||
815 | |||
807 | rate->idx = sample_idx % MCS_GROUP_RATES + | 816 | rate->idx = sample_idx % MCS_GROUP_RATES + |
808 | (sample_group->streams - 1) * MCS_GROUP_RATES; | 817 | (sample_group->streams - 1) * MCS_GROUP_RATES; |
809 | rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags; | 818 | rate->flags = IEEE80211_TX_RC_MCS | sample_group->flags; |
810 | rate->count = 1; | ||
811 | } | 819 | } |
812 | 820 | ||
813 | static void | 821 | static void |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 23dbcfc69b3b..2c5a79bd3777 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -936,8 +936,14 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx) | |||
936 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; | 936 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; |
937 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); | 937 | struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); |
938 | 938 | ||
939 | /* Drop duplicate 802.11 retransmissions (IEEE 802.11 Chap. 9.2.9) */ | 939 | /* |
940 | if (rx->sta && !is_multicast_ether_addr(hdr->addr1)) { | 940 | * Drop duplicate 802.11 retransmissions |
941 | * (IEEE 802.11-2012: 9.3.2.10 "Duplicate detection and recovery") | ||
942 | */ | ||
943 | if (rx->skb->len >= 24 && rx->sta && | ||
944 | !ieee80211_is_ctl(hdr->frame_control) && | ||
945 | !ieee80211_is_qos_nullfunc(hdr->frame_control) && | ||
946 | !is_multicast_ether_addr(hdr->addr1)) { | ||
941 | if (unlikely(ieee80211_has_retry(hdr->frame_control) && | 947 | if (unlikely(ieee80211_has_retry(hdr->frame_control) && |
942 | rx->sta->last_seq_ctrl[rx->seqno_idx] == | 948 | rx->sta->last_seq_ctrl[rx->seqno_idx] == |
943 | hdr->seq_ctrl)) { | 949 | hdr->seq_ctrl)) { |
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c index c63b618cd619..4fd1ca94fd4a 100644 --- a/net/netfilter/nf_conntrack_expect.c +++ b/net/netfilter/nf_conntrack_expect.c | |||
@@ -293,6 +293,11 @@ void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class, | |||
293 | sizeof(exp->tuple.dst.u3) - len); | 293 | sizeof(exp->tuple.dst.u3) - len); |
294 | 294 | ||
295 | exp->tuple.dst.u.all = *dst; | 295 | exp->tuple.dst.u.all = *dst; |
296 | |||
297 | #ifdef CONFIG_NF_NAT_NEEDED | ||
298 | memset(&exp->saved_addr, 0, sizeof(exp->saved_addr)); | ||
299 | memset(&exp->saved_proto, 0, sizeof(exp->saved_proto)); | ||
300 | #endif | ||
296 | } | 301 | } |
297 | EXPORT_SYMBOL_GPL(nf_ct_expect_init); | 302 | EXPORT_SYMBOL_GPL(nf_ct_expect_init); |
298 | 303 | ||
diff --git a/net/netfilter/xt_socket.c b/net/netfilter/xt_socket.c index f8b71911037a..20b15916f403 100644 --- a/net/netfilter/xt_socket.c +++ b/net/netfilter/xt_socket.c | |||
@@ -172,7 +172,7 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par, | |||
172 | 172 | ||
173 | /* Ignore non-transparent sockets, | 173 | /* Ignore non-transparent sockets, |
174 | if XT_SOCKET_TRANSPARENT is used */ | 174 | if XT_SOCKET_TRANSPARENT is used */ |
175 | if (info && info->flags & XT_SOCKET_TRANSPARENT) | 175 | if (info->flags & XT_SOCKET_TRANSPARENT) |
176 | transparent = ((sk->sk_state != TCP_TIME_WAIT && | 176 | transparent = ((sk->sk_state != TCP_TIME_WAIT && |
177 | inet_sk(sk)->transparent) || | 177 | inet_sk(sk)->transparent) || |
178 | (sk->sk_state == TCP_TIME_WAIT && | 178 | (sk->sk_state == TCP_TIME_WAIT && |
@@ -196,7 +196,11 @@ socket_match(const struct sk_buff *skb, struct xt_action_param *par, | |||
196 | static bool | 196 | static bool |
197 | socket_mt4_v0(const struct sk_buff *skb, struct xt_action_param *par) | 197 | socket_mt4_v0(const struct sk_buff *skb, struct xt_action_param *par) |
198 | { | 198 | { |
199 | return socket_match(skb, par, NULL); | 199 | static struct xt_socket_mtinfo1 xt_info_v0 = { |
200 | .flags = 0, | ||
201 | }; | ||
202 | |||
203 | return socket_match(skb, par, &xt_info_v0); | ||
200 | } | 204 | } |
201 | 205 | ||
202 | static bool | 206 | static bool |
@@ -314,7 +318,7 @@ socket_mt6_v1_v2(const struct sk_buff *skb, struct xt_action_param *par) | |||
314 | 318 | ||
315 | /* Ignore non-transparent sockets, | 319 | /* Ignore non-transparent sockets, |
316 | if XT_SOCKET_TRANSPARENT is used */ | 320 | if XT_SOCKET_TRANSPARENT is used */ |
317 | if (info && info->flags & XT_SOCKET_TRANSPARENT) | 321 | if (info->flags & XT_SOCKET_TRANSPARENT) |
318 | transparent = ((sk->sk_state != TCP_TIME_WAIT && | 322 | transparent = ((sk->sk_state != TCP_TIME_WAIT && |
319 | inet_sk(sk)->transparent) || | 323 | inet_sk(sk)->transparent) || |
320 | (sk->sk_state == TCP_TIME_WAIT && | 324 | (sk->sk_state == TCP_TIME_WAIT && |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 2fd6dbea327a..512718adb0d5 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -571,7 +571,7 @@ static int genl_family_rcv_msg(struct genl_family *family, | |||
571 | !capable(CAP_NET_ADMIN)) | 571 | !capable(CAP_NET_ADMIN)) |
572 | return -EPERM; | 572 | return -EPERM; |
573 | 573 | ||
574 | if (nlh->nlmsg_flags & NLM_F_DUMP) { | 574 | if ((nlh->nlmsg_flags & NLM_F_DUMP) == NLM_F_DUMP) { |
575 | struct netlink_dump_control c = { | 575 | struct netlink_dump_control c = { |
576 | .dump = ops->dumpit, | 576 | .dump = ops->dumpit, |
577 | .done = ops->done, | 577 | .done = ops->done, |
@@ -877,8 +877,10 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info) | |||
877 | #ifdef CONFIG_MODULES | 877 | #ifdef CONFIG_MODULES |
878 | if (res == NULL) { | 878 | if (res == NULL) { |
879 | genl_unlock(); | 879 | genl_unlock(); |
880 | up_read(&cb_lock); | ||
880 | request_module("net-pf-%d-proto-%d-family-%s", | 881 | request_module("net-pf-%d-proto-%d-family-%s", |
881 | PF_NETLINK, NETLINK_GENERIC, name); | 882 | PF_NETLINK, NETLINK_GENERIC, name); |
883 | down_read(&cb_lock); | ||
882 | genl_lock(); | 884 | genl_lock(); |
883 | res = genl_family_find_byname(name); | 885 | res = genl_family_find_byname(name); |
884 | } | 886 | } |
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 71a568862557..7a42c81a19eb 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -1465,6 +1465,7 @@ static int cbq_dump_wrr(struct sk_buff *skb, struct cbq_class *cl) | |||
1465 | unsigned char *b = skb_tail_pointer(skb); | 1465 | unsigned char *b = skb_tail_pointer(skb); |
1466 | struct tc_cbq_wrropt opt; | 1466 | struct tc_cbq_wrropt opt; |
1467 | 1467 | ||
1468 | memset(&opt, 0, sizeof(opt)); | ||
1468 | opt.flags = 0; | 1469 | opt.flags = 0; |
1469 | opt.allot = cl->allot; | 1470 | opt.allot = cl->allot; |
1470 | opt.priority = cl->priority + 1; | 1471 | opt.priority = cl->priority + 1; |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 1cc47aca7f05..25d217d90807 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -4770,9 +4770,9 @@ do { \ | |||
4770 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshForwarding, 0, 1, | 4770 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, dot11MeshForwarding, 0, 1, |
4771 | mask, NL80211_MESHCONF_FORWARDING, | 4771 | mask, NL80211_MESHCONF_FORWARDING, |
4772 | nla_get_u8); | 4772 | nla_get_u8); |
4773 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, 1, 255, | 4773 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold, -255, 0, |
4774 | mask, NL80211_MESHCONF_RSSI_THRESHOLD, | 4774 | mask, NL80211_MESHCONF_RSSI_THRESHOLD, |
4775 | nla_get_u32); | 4775 | nla_get_s32); |
4776 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, ht_opmode, 0, 16, | 4776 | FILL_IN_MESH_PARAM_IF_SET(tb, cfg, ht_opmode, 0, 16, |
4777 | mask, NL80211_MESHCONF_HT_OPMODE, | 4777 | mask, NL80211_MESHCONF_HT_OPMODE, |
4778 | nla_get_u16); | 4778 | nla_get_u16); |
@@ -6613,12 +6613,14 @@ EXPORT_SYMBOL(cfg80211_testmode_alloc_event_skb); | |||
6613 | 6613 | ||
6614 | void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp) | 6614 | void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp) |
6615 | { | 6615 | { |
6616 | struct cfg80211_registered_device *rdev = ((void **)skb->cb)[0]; | ||
6616 | void *hdr = ((void **)skb->cb)[1]; | 6617 | void *hdr = ((void **)skb->cb)[1]; |
6617 | struct nlattr *data = ((void **)skb->cb)[2]; | 6618 | struct nlattr *data = ((void **)skb->cb)[2]; |
6618 | 6619 | ||
6619 | nla_nest_end(skb, data); | 6620 | nla_nest_end(skb, data); |
6620 | genlmsg_end(skb, hdr); | 6621 | genlmsg_end(skb, hdr); |
6621 | genlmsg_multicast(skb, 0, nl80211_testmode_mcgrp.id, gfp); | 6622 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), skb, 0, |
6623 | nl80211_testmode_mcgrp.id, gfp); | ||
6622 | } | 6624 | } |
6623 | EXPORT_SYMBOL(cfg80211_testmode_event); | 6625 | EXPORT_SYMBOL(cfg80211_testmode_event); |
6624 | #endif | 6626 | #endif |
@@ -10064,7 +10066,8 @@ void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie, | |||
10064 | 10066 | ||
10065 | genlmsg_end(msg, hdr); | 10067 | genlmsg_end(msg, hdr); |
10066 | 10068 | ||
10067 | genlmsg_multicast(msg, 0, nl80211_mlme_mcgrp.id, gfp); | 10069 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, |
10070 | nl80211_mlme_mcgrp.id, gfp); | ||
10068 | return; | 10071 | return; |
10069 | 10072 | ||
10070 | nla_put_failure: | 10073 | nla_put_failure: |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 5a24c986f34b..5a950f36bae4 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -2279,7 +2279,9 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy) | |||
2279 | static void reg_timeout_work(struct work_struct *work) | 2279 | static void reg_timeout_work(struct work_struct *work) |
2280 | { | 2280 | { |
2281 | REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n"); | 2281 | REG_DBG_PRINT("Timeout while waiting for CRDA to reply, restoring regulatory settings\n"); |
2282 | rtnl_lock(); | ||
2282 | restore_regulatory_settings(true); | 2283 | restore_regulatory_settings(true); |
2284 | rtnl_unlock(); | ||
2283 | } | 2285 | } |
2284 | 2286 | ||
2285 | int __init regulatory_init(void) | 2287 | int __init regulatory_init(void) |
diff --git a/net/wireless/sme.c b/net/wireless/sme.c index 1d3cfb1a3f28..81c8a10d743c 100644 --- a/net/wireless/sme.c +++ b/net/wireless/sme.c | |||
@@ -34,8 +34,10 @@ struct cfg80211_conn { | |||
34 | CFG80211_CONN_SCAN_AGAIN, | 34 | CFG80211_CONN_SCAN_AGAIN, |
35 | CFG80211_CONN_AUTHENTICATE_NEXT, | 35 | CFG80211_CONN_AUTHENTICATE_NEXT, |
36 | CFG80211_CONN_AUTHENTICATING, | 36 | CFG80211_CONN_AUTHENTICATING, |
37 | CFG80211_CONN_AUTH_FAILED, | ||
37 | CFG80211_CONN_ASSOCIATE_NEXT, | 38 | CFG80211_CONN_ASSOCIATE_NEXT, |
38 | CFG80211_CONN_ASSOCIATING, | 39 | CFG80211_CONN_ASSOCIATING, |
40 | CFG80211_CONN_ASSOC_FAILED, | ||
39 | CFG80211_CONN_DEAUTH, | 41 | CFG80211_CONN_DEAUTH, |
40 | CFG80211_CONN_CONNECTED, | 42 | CFG80211_CONN_CONNECTED, |
41 | } state; | 43 | } state; |
@@ -164,6 +166,8 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev) | |||
164 | NULL, 0, | 166 | NULL, 0, |
165 | params->key, params->key_len, | 167 | params->key, params->key_len, |
166 | params->key_idx, NULL, 0); | 168 | params->key_idx, NULL, 0); |
169 | case CFG80211_CONN_AUTH_FAILED: | ||
170 | return -ENOTCONN; | ||
167 | case CFG80211_CONN_ASSOCIATE_NEXT: | 171 | case CFG80211_CONN_ASSOCIATE_NEXT: |
168 | BUG_ON(!rdev->ops->assoc); | 172 | BUG_ON(!rdev->ops->assoc); |
169 | wdev->conn->state = CFG80211_CONN_ASSOCIATING; | 173 | wdev->conn->state = CFG80211_CONN_ASSOCIATING; |
@@ -188,10 +192,17 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev) | |||
188 | WLAN_REASON_DEAUTH_LEAVING, | 192 | WLAN_REASON_DEAUTH_LEAVING, |
189 | false); | 193 | false); |
190 | return err; | 194 | return err; |
195 | case CFG80211_CONN_ASSOC_FAILED: | ||
196 | cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid, | ||
197 | NULL, 0, | ||
198 | WLAN_REASON_DEAUTH_LEAVING, false); | ||
199 | return -ENOTCONN; | ||
191 | case CFG80211_CONN_DEAUTH: | 200 | case CFG80211_CONN_DEAUTH: |
192 | cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid, | 201 | cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid, |
193 | NULL, 0, | 202 | NULL, 0, |
194 | WLAN_REASON_DEAUTH_LEAVING, false); | 203 | WLAN_REASON_DEAUTH_LEAVING, false); |
204 | /* free directly, disconnected event already sent */ | ||
205 | cfg80211_sme_free(wdev); | ||
195 | return 0; | 206 | return 0; |
196 | default: | 207 | default: |
197 | return 0; | 208 | return 0; |
@@ -371,7 +382,7 @@ bool cfg80211_sme_rx_assoc_resp(struct wireless_dev *wdev, u16 status) | |||
371 | return true; | 382 | return true; |
372 | } | 383 | } |
373 | 384 | ||
374 | wdev->conn->state = CFG80211_CONN_DEAUTH; | 385 | wdev->conn->state = CFG80211_CONN_ASSOC_FAILED; |
375 | schedule_work(&rdev->conn_work); | 386 | schedule_work(&rdev->conn_work); |
376 | return false; | 387 | return false; |
377 | } | 388 | } |
@@ -383,7 +394,13 @@ void cfg80211_sme_deauth(struct wireless_dev *wdev) | |||
383 | 394 | ||
384 | void cfg80211_sme_auth_timeout(struct wireless_dev *wdev) | 395 | void cfg80211_sme_auth_timeout(struct wireless_dev *wdev) |
385 | { | 396 | { |
386 | cfg80211_sme_free(wdev); | 397 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); |
398 | |||
399 | if (!wdev->conn) | ||
400 | return; | ||
401 | |||
402 | wdev->conn->state = CFG80211_CONN_AUTH_FAILED; | ||
403 | schedule_work(&rdev->conn_work); | ||
387 | } | 404 | } |
388 | 405 | ||
389 | void cfg80211_sme_disassoc(struct wireless_dev *wdev) | 406 | void cfg80211_sme_disassoc(struct wireless_dev *wdev) |
@@ -399,7 +416,13 @@ void cfg80211_sme_disassoc(struct wireless_dev *wdev) | |||
399 | 416 | ||
400 | void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev) | 417 | void cfg80211_sme_assoc_timeout(struct wireless_dev *wdev) |
401 | { | 418 | { |
402 | cfg80211_sme_disassoc(wdev); | 419 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); |
420 | |||
421 | if (!wdev->conn) | ||
422 | return; | ||
423 | |||
424 | wdev->conn->state = CFG80211_CONN_ASSOC_FAILED; | ||
425 | schedule_work(&rdev->conn_work); | ||
403 | } | 426 | } |
404 | 427 | ||
405 | static int cfg80211_sme_connect(struct wireless_dev *wdev, | 428 | static int cfg80211_sme_connect(struct wireless_dev *wdev, |