diff options
author | Mark Brown <broonie@kernel.org> | 2014-11-03 10:13:33 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-11-03 10:13:33 -0500 |
commit | ebc01f593b58e1896150fc2e3cbdd0116323c52c (patch) | |
tree | 23e905a3fdbee3fc8a66ef760b9ed5ef5455e9dd /drivers/net | |
parent | 3f7256fe5fc64132a2dd19695255c990aa2188cf (diff) | |
parent | 0df1f2487d2f0d04703f142813d53615d62a1da4 (diff) |
Merge tag 'v3.18-rc3' into asoc-sgtl5000
Linux 3.18-rc3
Diffstat (limited to 'drivers/net')
90 files changed, 961 insertions, 468 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 4706386b7d34..f9009be3f307 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -135,6 +135,7 @@ config MACVLAN | |||
135 | config MACVTAP | 135 | config MACVTAP |
136 | tristate "MAC-VLAN based tap driver" | 136 | tristate "MAC-VLAN based tap driver" |
137 | depends on MACVLAN | 137 | depends on MACVLAN |
138 | depends on INET | ||
138 | help | 139 | help |
139 | This adds a specialized tap character device driver that is based | 140 | This adds a specialized tap character device driver that is based |
140 | on the MAC-VLAN network interface, called macvtap. A macvtap device | 141 | on the MAC-VLAN network interface, called macvtap. A macvtap device |
@@ -200,6 +201,7 @@ config RIONET_RX_SIZE | |||
200 | 201 | ||
201 | config TUN | 202 | config TUN |
202 | tristate "Universal TUN/TAP device driver support" | 203 | tristate "Universal TUN/TAP device driver support" |
204 | depends on INET | ||
203 | select CRC32 | 205 | select CRC32 |
204 | ---help--- | 206 | ---help--- |
205 | TUN/TAP provides packet reception and transmission for user space | 207 | TUN/TAP provides packet reception and transmission for user space |
diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c index 1020a7af67cf..78d8e876f3aa 100644 --- a/drivers/net/dsa/mv88e6171.c +++ b/drivers/net/dsa/mv88e6171.c | |||
@@ -395,7 +395,7 @@ static int mv88e6171_get_sset_count(struct dsa_switch *ds) | |||
395 | } | 395 | } |
396 | 396 | ||
397 | struct dsa_switch_driver mv88e6171_switch_driver = { | 397 | struct dsa_switch_driver mv88e6171_switch_driver = { |
398 | .tag_protocol = DSA_TAG_PROTO_DSA, | 398 | .tag_protocol = DSA_TAG_PROTO_EDSA, |
399 | .priv_size = sizeof(struct mv88e6xxx_priv_state), | 399 | .priv_size = sizeof(struct mv88e6xxx_priv_state), |
400 | .probe = mv88e6171_probe, | 400 | .probe = mv88e6171_probe, |
401 | .setup = mv88e6171_setup, | 401 | .setup = mv88e6171_setup, |
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index 29554992215a..2349ea970255 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c | |||
@@ -1465,7 +1465,7 @@ static int xgbe_set_features(struct net_device *netdev, | |||
1465 | { | 1465 | { |
1466 | struct xgbe_prv_data *pdata = netdev_priv(netdev); | 1466 | struct xgbe_prv_data *pdata = netdev_priv(netdev); |
1467 | struct xgbe_hw_if *hw_if = &pdata->hw_if; | 1467 | struct xgbe_hw_if *hw_if = &pdata->hw_if; |
1468 | unsigned int rxcsum, rxvlan, rxvlan_filter; | 1468 | netdev_features_t rxcsum, rxvlan, rxvlan_filter; |
1469 | 1469 | ||
1470 | rxcsum = pdata->netdev_features & NETIF_F_RXCSUM; | 1470 | rxcsum = pdata->netdev_features & NETIF_F_RXCSUM; |
1471 | rxvlan = pdata->netdev_features & NETIF_F_HW_VLAN_CTAG_RX; | 1471 | rxvlan = pdata->netdev_features & NETIF_F_HW_VLAN_CTAG_RX; |
@@ -1598,7 +1598,8 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) | |||
1598 | struct skb_shared_hwtstamps *hwtstamps; | 1598 | struct skb_shared_hwtstamps *hwtstamps; |
1599 | unsigned int incomplete, error, context_next, context; | 1599 | unsigned int incomplete, error, context_next, context; |
1600 | unsigned int len, put_len, max_len; | 1600 | unsigned int len, put_len, max_len; |
1601 | int received = 0; | 1601 | unsigned int received = 0; |
1602 | int packet_count = 0; | ||
1602 | 1603 | ||
1603 | DBGPR("-->xgbe_rx_poll: budget=%d\n", budget); | 1604 | DBGPR("-->xgbe_rx_poll: budget=%d\n", budget); |
1604 | 1605 | ||
@@ -1608,7 +1609,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) | |||
1608 | 1609 | ||
1609 | rdata = XGBE_GET_DESC_DATA(ring, ring->cur); | 1610 | rdata = XGBE_GET_DESC_DATA(ring, ring->cur); |
1610 | packet = &ring->packet_data; | 1611 | packet = &ring->packet_data; |
1611 | while (received < budget) { | 1612 | while (packet_count < budget) { |
1612 | DBGPR(" cur = %d\n", ring->cur); | 1613 | DBGPR(" cur = %d\n", ring->cur); |
1613 | 1614 | ||
1614 | /* First time in loop see if we need to restore state */ | 1615 | /* First time in loop see if we need to restore state */ |
@@ -1662,7 +1663,7 @@ read_again: | |||
1662 | if (packet->errors) | 1663 | if (packet->errors) |
1663 | DBGPR("Error in received packet\n"); | 1664 | DBGPR("Error in received packet\n"); |
1664 | dev_kfree_skb(skb); | 1665 | dev_kfree_skb(skb); |
1665 | continue; | 1666 | goto next_packet; |
1666 | } | 1667 | } |
1667 | 1668 | ||
1668 | if (!context) { | 1669 | if (!context) { |
@@ -1677,7 +1678,7 @@ read_again: | |||
1677 | } | 1678 | } |
1678 | 1679 | ||
1679 | dev_kfree_skb(skb); | 1680 | dev_kfree_skb(skb); |
1680 | continue; | 1681 | goto next_packet; |
1681 | } | 1682 | } |
1682 | memcpy(skb_tail_pointer(skb), rdata->skb->data, | 1683 | memcpy(skb_tail_pointer(skb), rdata->skb->data, |
1683 | put_len); | 1684 | put_len); |
@@ -1694,7 +1695,7 @@ read_again: | |||
1694 | 1695 | ||
1695 | /* Stray Context Descriptor? */ | 1696 | /* Stray Context Descriptor? */ |
1696 | if (!skb) | 1697 | if (!skb) |
1697 | continue; | 1698 | goto next_packet; |
1698 | 1699 | ||
1699 | /* Be sure we don't exceed the configured MTU */ | 1700 | /* Be sure we don't exceed the configured MTU */ |
1700 | max_len = netdev->mtu + ETH_HLEN; | 1701 | max_len = netdev->mtu + ETH_HLEN; |
@@ -1705,7 +1706,7 @@ read_again: | |||
1705 | if (skb->len > max_len) { | 1706 | if (skb->len > max_len) { |
1706 | DBGPR("packet length exceeds configured MTU\n"); | 1707 | DBGPR("packet length exceeds configured MTU\n"); |
1707 | dev_kfree_skb(skb); | 1708 | dev_kfree_skb(skb); |
1708 | continue; | 1709 | goto next_packet; |
1709 | } | 1710 | } |
1710 | 1711 | ||
1711 | #ifdef XGMAC_ENABLE_RX_PKT_DUMP | 1712 | #ifdef XGMAC_ENABLE_RX_PKT_DUMP |
@@ -1739,6 +1740,9 @@ read_again: | |||
1739 | 1740 | ||
1740 | netdev->last_rx = jiffies; | 1741 | netdev->last_rx = jiffies; |
1741 | napi_gro_receive(&pdata->napi, skb); | 1742 | napi_gro_receive(&pdata->napi, skb); |
1743 | |||
1744 | next_packet: | ||
1745 | packet_count++; | ||
1742 | } | 1746 | } |
1743 | 1747 | ||
1744 | /* Check if we need to save state before leaving */ | 1748 | /* Check if we need to save state before leaving */ |
@@ -1752,9 +1756,9 @@ read_again: | |||
1752 | rdata->state.error = error; | 1756 | rdata->state.error = error; |
1753 | } | 1757 | } |
1754 | 1758 | ||
1755 | DBGPR("<--xgbe_rx_poll: received = %d\n", received); | 1759 | DBGPR("<--xgbe_rx_poll: packet_count = %d\n", packet_count); |
1756 | 1760 | ||
1757 | return received; | 1761 | return packet_count; |
1758 | } | 1762 | } |
1759 | 1763 | ||
1760 | static int xgbe_poll(struct napi_struct *napi, int budget) | 1764 | static int xgbe_poll(struct napi_struct *napi, int budget) |
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c b/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c index e6d24c210198..c22f32622fa9 100644 --- a/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c | |||
@@ -124,20 +124,18 @@ static int xgene_enet_ecc_init(struct xgene_enet_pdata *p) | |||
124 | { | 124 | { |
125 | struct net_device *ndev = p->ndev; | 125 | struct net_device *ndev = p->ndev; |
126 | u32 data; | 126 | u32 data; |
127 | int i; | 127 | int i = 0; |
128 | 128 | ||
129 | xgene_enet_wr_diag_csr(p, ENET_CFG_MEM_RAM_SHUTDOWN_ADDR, 0); | 129 | xgene_enet_wr_diag_csr(p, ENET_CFG_MEM_RAM_SHUTDOWN_ADDR, 0); |
130 | for (i = 0; i < 10 && data != ~0U ; i++) { | 130 | do { |
131 | usleep_range(100, 110); | 131 | usleep_range(100, 110); |
132 | data = xgene_enet_rd_diag_csr(p, ENET_BLOCK_MEM_RDY_ADDR); | 132 | data = xgene_enet_rd_diag_csr(p, ENET_BLOCK_MEM_RDY_ADDR); |
133 | } | 133 | if (data == ~0U) |
134 | return 0; | ||
135 | } while (++i < 10); | ||
134 | 136 | ||
135 | if (data != ~0U) { | 137 | netdev_err(ndev, "Failed to release memory from shutdown\n"); |
136 | netdev_err(ndev, "Failed to release memory from shutdown\n"); | 138 | return -ENODEV; |
137 | return -ENODEV; | ||
138 | } | ||
139 | |||
140 | return 0; | ||
141 | } | 139 | } |
142 | 140 | ||
143 | static void xgene_enet_config_ring_if_assoc(struct xgene_enet_pdata *p) | 141 | static void xgene_enet_config_ring_if_assoc(struct xgene_enet_pdata *p) |
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index 9ae36979bdee..3a6778a667f4 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c | |||
@@ -1397,6 +1397,9 @@ static void bcm_sysport_netif_start(struct net_device *dev) | |||
1397 | /* Enable NAPI */ | 1397 | /* Enable NAPI */ |
1398 | napi_enable(&priv->napi); | 1398 | napi_enable(&priv->napi); |
1399 | 1399 | ||
1400 | /* Enable RX interrupt and TX ring full interrupt */ | ||
1401 | intrl2_0_mask_clear(priv, INTRL2_0_RDMA_MBDONE | INTRL2_0_TX_RING_FULL); | ||
1402 | |||
1400 | phy_start(priv->phydev); | 1403 | phy_start(priv->phydev); |
1401 | 1404 | ||
1402 | /* Enable TX interrupts for the 32 TXQs */ | 1405 | /* Enable TX interrupts for the 32 TXQs */ |
@@ -1499,9 +1502,6 @@ static int bcm_sysport_open(struct net_device *dev) | |||
1499 | if (ret) | 1502 | if (ret) |
1500 | goto out_free_rx_ring; | 1503 | goto out_free_rx_ring; |
1501 | 1504 | ||
1502 | /* Enable RX interrupt and TX ring full interrupt */ | ||
1503 | intrl2_0_mask_clear(priv, INTRL2_0_RDMA_MBDONE | INTRL2_0_TX_RING_FULL); | ||
1504 | |||
1505 | /* Turn on TDMA */ | 1505 | /* Turn on TDMA */ |
1506 | ret = tdma_enable_set(priv, 1); | 1506 | ret = tdma_enable_set(priv, 1); |
1507 | if (ret) | 1507 | if (ret) |
@@ -1858,6 +1858,8 @@ static int bcm_sysport_resume(struct device *d) | |||
1858 | if (!netif_running(dev)) | 1858 | if (!netif_running(dev)) |
1859 | return 0; | 1859 | return 0; |
1860 | 1860 | ||
1861 | umac_reset(priv); | ||
1862 | |||
1861 | /* We may have been suspended and never received a WOL event that | 1863 | /* We may have been suspended and never received a WOL event that |
1862 | * would turn off MPD detection, take care of that now | 1864 | * would turn off MPD detection, take care of that now |
1863 | */ | 1865 | */ |
@@ -1885,9 +1887,6 @@ static int bcm_sysport_resume(struct device *d) | |||
1885 | 1887 | ||
1886 | netif_device_attach(dev); | 1888 | netif_device_attach(dev); |
1887 | 1889 | ||
1888 | /* Enable RX interrupt and TX ring full interrupt */ | ||
1889 | intrl2_0_mask_clear(priv, INTRL2_0_RDMA_MBDONE | INTRL2_0_TX_RING_FULL); | ||
1890 | |||
1891 | /* RX pipe enable */ | 1890 | /* RX pipe enable */ |
1892 | topctrl_writel(priv, 0, RX_FLUSH_CNTL); | 1891 | topctrl_writel(priv, 0, RX_FLUSH_CNTL); |
1893 | 1892 | ||
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 23f23c97c2ad..f05fab65d78a 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c | |||
@@ -382,10 +382,8 @@ static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type, | |||
382 | if (l5_cid >= MAX_CM_SK_TBL_SZ) | 382 | if (l5_cid >= MAX_CM_SK_TBL_SZ) |
383 | break; | 383 | break; |
384 | 384 | ||
385 | rcu_read_lock(); | ||
386 | if (!rcu_access_pointer(cp->ulp_ops[CNIC_ULP_L4])) { | 385 | if (!rcu_access_pointer(cp->ulp_ops[CNIC_ULP_L4])) { |
387 | rc = -ENODEV; | 386 | rc = -ENODEV; |
388 | rcu_read_unlock(); | ||
389 | break; | 387 | break; |
390 | } | 388 | } |
391 | csk = &cp->csk_tbl[l5_cid]; | 389 | csk = &cp->csk_tbl[l5_cid]; |
@@ -414,7 +412,6 @@ static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type, | |||
414 | } | 412 | } |
415 | } | 413 | } |
416 | csk_put(csk); | 414 | csk_put(csk); |
417 | rcu_read_unlock(); | ||
418 | rc = 0; | 415 | rc = 0; |
419 | } | 416 | } |
420 | } | 417 | } |
@@ -615,7 +612,7 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) | |||
615 | cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); | 612 | cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL); |
616 | 613 | ||
617 | mutex_lock(&cnic_lock); | 614 | mutex_lock(&cnic_lock); |
618 | if (rcu_dereference(cp->ulp_ops[ulp_type])) { | 615 | if (rcu_access_pointer(cp->ulp_ops[ulp_type])) { |
619 | RCU_INIT_POINTER(cp->ulp_ops[ulp_type], NULL); | 616 | RCU_INIT_POINTER(cp->ulp_ops[ulp_type], NULL); |
620 | cnic_put(dev); | 617 | cnic_put(dev); |
621 | } else { | 618 | } else { |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c index 8edf0f5bd679..6fe300e316c3 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_dcb.c | |||
@@ -60,6 +60,42 @@ void cxgb4_dcb_version_init(struct net_device *dev) | |||
60 | dcb->dcb_version = FW_PORT_DCB_VER_AUTO; | 60 | dcb->dcb_version = FW_PORT_DCB_VER_AUTO; |
61 | } | 61 | } |
62 | 62 | ||
63 | static void cxgb4_dcb_cleanup_apps(struct net_device *dev) | ||
64 | { | ||
65 | struct port_info *pi = netdev2pinfo(dev); | ||
66 | struct adapter *adap = pi->adapter; | ||
67 | struct port_dcb_info *dcb = &pi->dcb; | ||
68 | struct dcb_app app; | ||
69 | int i, err; | ||
70 | |||
71 | /* zero priority implies remove */ | ||
72 | app.priority = 0; | ||
73 | |||
74 | for (i = 0; i < CXGB4_MAX_DCBX_APP_SUPPORTED; i++) { | ||
75 | /* Check if app list is exhausted */ | ||
76 | if (!dcb->app_priority[i].protocolid) | ||
77 | break; | ||
78 | |||
79 | app.protocol = dcb->app_priority[i].protocolid; | ||
80 | |||
81 | if (dcb->dcb_version == FW_PORT_DCB_VER_IEEE) { | ||
82 | app.selector = dcb->app_priority[i].sel_field + 1; | ||
83 | err = dcb_ieee_setapp(dev, &app); | ||
84 | } else { | ||
85 | app.selector = !!(dcb->app_priority[i].sel_field); | ||
86 | err = dcb_setapp(dev, &app); | ||
87 | } | ||
88 | |||
89 | if (err) { | ||
90 | dev_err(adap->pdev_dev, | ||
91 | "Failed DCB Clear %s Application Priority: sel=%d, prot=%d, , err=%d\n", | ||
92 | dcb_ver_array[dcb->dcb_version], app.selector, | ||
93 | app.protocol, -err); | ||
94 | break; | ||
95 | } | ||
96 | } | ||
97 | } | ||
98 | |||
63 | /* Finite State machine for Data Center Bridging. | 99 | /* Finite State machine for Data Center Bridging. |
64 | */ | 100 | */ |
65 | void cxgb4_dcb_state_fsm(struct net_device *dev, | 101 | void cxgb4_dcb_state_fsm(struct net_device *dev, |
@@ -80,7 +116,6 @@ void cxgb4_dcb_state_fsm(struct net_device *dev, | |||
80 | /* we're going to use Host DCB */ | 116 | /* we're going to use Host DCB */ |
81 | dcb->state = CXGB4_DCB_STATE_HOST; | 117 | dcb->state = CXGB4_DCB_STATE_HOST; |
82 | dcb->supported = CXGB4_DCBX_HOST_SUPPORT; | 118 | dcb->supported = CXGB4_DCBX_HOST_SUPPORT; |
83 | dcb->enabled = 1; | ||
84 | break; | 119 | break; |
85 | } | 120 | } |
86 | 121 | ||
@@ -145,6 +180,7 @@ void cxgb4_dcb_state_fsm(struct net_device *dev, | |||
145 | * state. We need to reset back to a ground state | 180 | * state. We need to reset back to a ground state |
146 | * of incomplete. | 181 | * of incomplete. |
147 | */ | 182 | */ |
183 | cxgb4_dcb_cleanup_apps(dev); | ||
148 | cxgb4_dcb_state_init(dev); | 184 | cxgb4_dcb_state_init(dev); |
149 | dcb->state = CXGB4_DCB_STATE_FW_INCOMPLETE; | 185 | dcb->state = CXGB4_DCB_STATE_FW_INCOMPLETE; |
150 | dcb->supported = CXGB4_DCBX_FW_SUPPORT; | 186 | dcb->supported = CXGB4_DCBX_FW_SUPPORT; |
@@ -349,6 +385,12 @@ static u8 cxgb4_setstate(struct net_device *dev, u8 enabled) | |||
349 | { | 385 | { |
350 | struct port_info *pi = netdev2pinfo(dev); | 386 | struct port_info *pi = netdev2pinfo(dev); |
351 | 387 | ||
388 | /* If DCBx is host-managed, dcb is enabled by outside lldp agents */ | ||
389 | if (pi->dcb.state == CXGB4_DCB_STATE_HOST) { | ||
390 | pi->dcb.enabled = enabled; | ||
391 | return 0; | ||
392 | } | ||
393 | |||
352 | /* Firmware doesn't provide any mechanism to control the DCB state. | 394 | /* Firmware doesn't provide any mechanism to control the DCB state. |
353 | */ | 395 | */ |
354 | if (enabled != (pi->dcb.state == CXGB4_DCB_STATE_FW_ALLSYNCED)) | 396 | if (enabled != (pi->dcb.state == CXGB4_DCB_STATE_FW_ALLSYNCED)) |
@@ -833,11 +875,16 @@ static int cxgb4_setapp(struct net_device *dev, u8 app_idtype, u16 app_id, | |||
833 | 875 | ||
834 | /* Return whether IEEE Data Center Bridging has been negotiated. | 876 | /* Return whether IEEE Data Center Bridging has been negotiated. |
835 | */ | 877 | */ |
836 | static inline int cxgb4_ieee_negotiation_complete(struct net_device *dev) | 878 | static inline int |
879 | cxgb4_ieee_negotiation_complete(struct net_device *dev, | ||
880 | enum cxgb4_dcb_fw_msgs dcb_subtype) | ||
837 | { | 881 | { |
838 | struct port_info *pi = netdev2pinfo(dev); | 882 | struct port_info *pi = netdev2pinfo(dev); |
839 | struct port_dcb_info *dcb = &pi->dcb; | 883 | struct port_dcb_info *dcb = &pi->dcb; |
840 | 884 | ||
885 | if (dcb_subtype && !(dcb->msgs & dcb_subtype)) | ||
886 | return 0; | ||
887 | |||
841 | return (dcb->state == CXGB4_DCB_STATE_FW_ALLSYNCED && | 888 | return (dcb->state == CXGB4_DCB_STATE_FW_ALLSYNCED && |
842 | (dcb->supported & DCB_CAP_DCBX_VER_IEEE)); | 889 | (dcb->supported & DCB_CAP_DCBX_VER_IEEE)); |
843 | } | 890 | } |
@@ -850,7 +897,7 @@ static int cxgb4_ieee_getapp(struct net_device *dev, struct dcb_app *app) | |||
850 | { | 897 | { |
851 | int prio; | 898 | int prio; |
852 | 899 | ||
853 | if (!cxgb4_ieee_negotiation_complete(dev)) | 900 | if (!cxgb4_ieee_negotiation_complete(dev, CXGB4_DCB_FW_APP_ID)) |
854 | return -EINVAL; | 901 | return -EINVAL; |
855 | if (!(app->selector && app->protocol)) | 902 | if (!(app->selector && app->protocol)) |
856 | return -EINVAL; | 903 | return -EINVAL; |
@@ -872,7 +919,7 @@ static int cxgb4_ieee_setapp(struct net_device *dev, struct dcb_app *app) | |||
872 | { | 919 | { |
873 | int ret; | 920 | int ret; |
874 | 921 | ||
875 | if (!cxgb4_ieee_negotiation_complete(dev)) | 922 | if (!cxgb4_ieee_negotiation_complete(dev, CXGB4_DCB_FW_APP_ID)) |
876 | return -EINVAL; | 923 | return -EINVAL; |
877 | if (!(app->selector && app->protocol)) | 924 | if (!(app->selector && app->protocol)) |
878 | return -EINVAL; | 925 | return -EINVAL; |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index 3f60070f2519..8520d5529df8 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | |||
@@ -694,7 +694,11 @@ int cxgb4_dcb_enabled(const struct net_device *dev) | |||
694 | #ifdef CONFIG_CHELSIO_T4_DCB | 694 | #ifdef CONFIG_CHELSIO_T4_DCB |
695 | struct port_info *pi = netdev_priv(dev); | 695 | struct port_info *pi = netdev_priv(dev); |
696 | 696 | ||
697 | return pi->dcb.state == CXGB4_DCB_STATE_FW_ALLSYNCED; | 697 | if (!pi->dcb.enabled) |
698 | return 0; | ||
699 | |||
700 | return ((pi->dcb.state == CXGB4_DCB_STATE_FW_ALLSYNCED) || | ||
701 | (pi->dcb.state == CXGB4_DCB_STATE_HOST)); | ||
698 | #else | 702 | #else |
699 | return 0; | 703 | return 0; |
700 | #endif | 704 | #endif |
@@ -6610,6 +6614,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
6610 | 6614 | ||
6611 | spin_lock_init(&adapter->stats_lock); | 6615 | spin_lock_init(&adapter->stats_lock); |
6612 | spin_lock_init(&adapter->tid_release_lock); | 6616 | spin_lock_init(&adapter->tid_release_lock); |
6617 | spin_lock_init(&adapter->win0_lock); | ||
6613 | 6618 | ||
6614 | INIT_WORK(&adapter->tid_release_task, process_tid_release_list); | 6619 | INIT_WORK(&adapter->tid_release_task, process_tid_release_list); |
6615 | INIT_WORK(&adapter->db_full_task, process_db_full); | 6620 | INIT_WORK(&adapter->db_full_task, process_db_full); |
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index bfa398d91826..0b42bddaf284 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | |||
@@ -2929,14 +2929,14 @@ static const struct pci_device_id cxgb4vf_pci_tbl[] = { | |||
2929 | CH_DEVICE(0x480d), /* T480-cr */ | 2929 | CH_DEVICE(0x480d), /* T480-cr */ |
2930 | CH_DEVICE(0x480e), /* T440-lp-cr */ | 2930 | CH_DEVICE(0x480e), /* T440-lp-cr */ |
2931 | CH_DEVICE(0x4880), | 2931 | CH_DEVICE(0x4880), |
2932 | CH_DEVICE(0x4880), | 2932 | CH_DEVICE(0x4881), |
2933 | CH_DEVICE(0x4880), | 2933 | CH_DEVICE(0x4882), |
2934 | CH_DEVICE(0x4880), | 2934 | CH_DEVICE(0x4883), |
2935 | CH_DEVICE(0x4880), | 2935 | CH_DEVICE(0x4884), |
2936 | CH_DEVICE(0x4880), | 2936 | CH_DEVICE(0x4885), |
2937 | CH_DEVICE(0x4880), | 2937 | CH_DEVICE(0x4886), |
2938 | CH_DEVICE(0x4880), | 2938 | CH_DEVICE(0x4887), |
2939 | CH_DEVICE(0x4880), | 2939 | CH_DEVICE(0x4888), |
2940 | CH_DEVICE(0x5801), /* T520-cr */ | 2940 | CH_DEVICE(0x5801), /* T520-cr */ |
2941 | CH_DEVICE(0x5802), /* T522-cr */ | 2941 | CH_DEVICE(0x5802), /* T522-cr */ |
2942 | CH_DEVICE(0x5803), /* T540-cr */ | 2942 | CH_DEVICE(0x5803), /* T540-cr */ |
diff --git a/drivers/net/ethernet/cisco/enic/enic_clsf.c b/drivers/net/ethernet/cisco/enic/enic_clsf.c index 69dfd3c9e529..0be6850be8a2 100644 --- a/drivers/net/ethernet/cisco/enic/enic_clsf.c +++ b/drivers/net/ethernet/cisco/enic/enic_clsf.c | |||
@@ -86,7 +86,7 @@ void enic_rfs_flw_tbl_free(struct enic *enic) | |||
86 | int i; | 86 | int i; |
87 | 87 | ||
88 | enic_rfs_timer_stop(enic); | 88 | enic_rfs_timer_stop(enic); |
89 | spin_lock(&enic->rfs_h.lock); | 89 | spin_lock_bh(&enic->rfs_h.lock); |
90 | enic->rfs_h.free = 0; | 90 | enic->rfs_h.free = 0; |
91 | for (i = 0; i < (1 << ENIC_RFS_FLW_BITSHIFT); i++) { | 91 | for (i = 0; i < (1 << ENIC_RFS_FLW_BITSHIFT); i++) { |
92 | struct hlist_head *hhead; | 92 | struct hlist_head *hhead; |
@@ -100,7 +100,7 @@ void enic_rfs_flw_tbl_free(struct enic *enic) | |||
100 | kfree(n); | 100 | kfree(n); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | spin_unlock(&enic->rfs_h.lock); | 103 | spin_unlock_bh(&enic->rfs_h.lock); |
104 | } | 104 | } |
105 | 105 | ||
106 | struct enic_rfs_fltr_node *htbl_fltr_search(struct enic *enic, u16 fltr_id) | 106 | struct enic_rfs_fltr_node *htbl_fltr_search(struct enic *enic, u16 fltr_id) |
@@ -128,7 +128,7 @@ void enic_flow_may_expire(unsigned long data) | |||
128 | bool res; | 128 | bool res; |
129 | int j; | 129 | int j; |
130 | 130 | ||
131 | spin_lock(&enic->rfs_h.lock); | 131 | spin_lock_bh(&enic->rfs_h.lock); |
132 | for (j = 0; j < ENIC_CLSF_EXPIRE_COUNT; j++) { | 132 | for (j = 0; j < ENIC_CLSF_EXPIRE_COUNT; j++) { |
133 | struct hlist_head *hhead; | 133 | struct hlist_head *hhead; |
134 | struct hlist_node *tmp; | 134 | struct hlist_node *tmp; |
@@ -148,7 +148,7 @@ void enic_flow_may_expire(unsigned long data) | |||
148 | } | 148 | } |
149 | } | 149 | } |
150 | } | 150 | } |
151 | spin_unlock(&enic->rfs_h.lock); | 151 | spin_unlock_bh(&enic->rfs_h.lock); |
152 | mod_timer(&enic->rfs_h.rfs_may_expire, jiffies + HZ/4); | 152 | mod_timer(&enic->rfs_h.rfs_may_expire, jiffies + HZ/4); |
153 | } | 153 | } |
154 | 154 | ||
@@ -183,7 +183,7 @@ int enic_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, | |||
183 | return -EPROTONOSUPPORT; | 183 | return -EPROTONOSUPPORT; |
184 | 184 | ||
185 | tbl_idx = skb_get_hash_raw(skb) & ENIC_RFS_FLW_MASK; | 185 | tbl_idx = skb_get_hash_raw(skb) & ENIC_RFS_FLW_MASK; |
186 | spin_lock(&enic->rfs_h.lock); | 186 | spin_lock_bh(&enic->rfs_h.lock); |
187 | n = htbl_key_search(&enic->rfs_h.ht_head[tbl_idx], &keys); | 187 | n = htbl_key_search(&enic->rfs_h.ht_head[tbl_idx], &keys); |
188 | 188 | ||
189 | if (n) { /* entry already present */ | 189 | if (n) { /* entry already present */ |
@@ -277,7 +277,7 @@ int enic_rx_flow_steer(struct net_device *dev, const struct sk_buff *skb, | |||
277 | } | 277 | } |
278 | 278 | ||
279 | ret_unlock: | 279 | ret_unlock: |
280 | spin_unlock(&enic->rfs_h.lock); | 280 | spin_unlock_bh(&enic->rfs_h.lock); |
281 | return res; | 281 | return res; |
282 | } | 282 | } |
283 | 283 | ||
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c index 929bfe70080a..180e53fa628f 100644 --- a/drivers/net/ethernet/cisco/enic/enic_main.c +++ b/drivers/net/ethernet/cisco/enic/enic_main.c | |||
@@ -1674,13 +1674,13 @@ static int enic_stop(struct net_device *netdev) | |||
1674 | 1674 | ||
1675 | enic_dev_disable(enic); | 1675 | enic_dev_disable(enic); |
1676 | 1676 | ||
1677 | local_bh_disable(); | ||
1678 | for (i = 0; i < enic->rq_count; i++) { | 1677 | for (i = 0; i < enic->rq_count; i++) { |
1679 | napi_disable(&enic->napi[i]); | 1678 | napi_disable(&enic->napi[i]); |
1679 | local_bh_disable(); | ||
1680 | while (!enic_poll_lock_napi(&enic->rq[i])) | 1680 | while (!enic_poll_lock_napi(&enic->rq[i])) |
1681 | mdelay(1); | 1681 | mdelay(1); |
1682 | local_bh_enable(); | ||
1682 | } | 1683 | } |
1683 | local_bh_enable(); | ||
1684 | 1684 | ||
1685 | netif_carrier_off(netdev); | 1685 | netif_carrier_off(netdev); |
1686 | netif_tx_disable(netdev); | 1686 | netif_tx_disable(netdev); |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 81b96cf87574..50a851db2852 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -1581,7 +1581,8 @@ fec_enet_interrupt(int irq, void *dev_id) | |||
1581 | complete(&fep->mdio_done); | 1581 | complete(&fep->mdio_done); |
1582 | } | 1582 | } |
1583 | 1583 | ||
1584 | fec_ptp_check_pps_event(fep); | 1584 | if (fep->ptp_clock) |
1585 | fec_ptp_check_pps_event(fep); | ||
1585 | 1586 | ||
1586 | return ret; | 1587 | return ret; |
1587 | } | 1588 | } |
diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c index 3d4e08be1709..b34214e2df5f 100644 --- a/drivers/net/ethernet/freescale/fs_enet/mac-fec.c +++ b/drivers/net/ethernet/freescale/fs_enet/mac-fec.c | |||
@@ -341,6 +341,9 @@ static void restart(struct net_device *dev) | |||
341 | FC(fecp, x_cntrl, FEC_TCNTRL_FDEN); /* FD disable */ | 341 | FC(fecp, x_cntrl, FEC_TCNTRL_FDEN); /* FD disable */ |
342 | } | 342 | } |
343 | 343 | ||
344 | /* Restore multicast and promiscuous settings */ | ||
345 | set_multicast_list(dev); | ||
346 | |||
344 | /* | 347 | /* |
345 | * Enable interrupts we wish to service. | 348 | * Enable interrupts we wish to service. |
346 | */ | 349 | */ |
diff --git a/drivers/net/ethernet/freescale/fs_enet/mac-scc.c b/drivers/net/ethernet/freescale/fs_enet/mac-scc.c index f30411f0701f..7a184e8816a4 100644 --- a/drivers/net/ethernet/freescale/fs_enet/mac-scc.c +++ b/drivers/net/ethernet/freescale/fs_enet/mac-scc.c | |||
@@ -355,6 +355,9 @@ static void restart(struct net_device *dev) | |||
355 | if (fep->phydev->duplex) | 355 | if (fep->phydev->duplex) |
356 | S16(sccp, scc_psmr, SCC_PSMR_LPB | SCC_PSMR_FDE); | 356 | S16(sccp, scc_psmr, SCC_PSMR_LPB | SCC_PSMR_FDE); |
357 | 357 | ||
358 | /* Restore multicast and promiscuous settings */ | ||
359 | set_multicast_list(dev); | ||
360 | |||
358 | S32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); | 361 | S32(sccp, scc_gsmrl, SCC_GSMRL_ENR | SCC_GSMRL_ENT); |
359 | } | 362 | } |
360 | 363 | ||
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 5f6aded512f5..24f3986cfae2 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -1075,7 +1075,10 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1075 | NETIF_F_HW_CSUM | | 1075 | NETIF_F_HW_CSUM | |
1076 | NETIF_F_SG); | 1076 | NETIF_F_SG); |
1077 | 1077 | ||
1078 | netdev->priv_flags |= IFF_UNICAST_FLT; | 1078 | /* Do not set IFF_UNICAST_FLT for VMWare's 82545EM */ |
1079 | if (hw->device_id != E1000_DEV_ID_82545EM_COPPER || | ||
1080 | hw->subsystem_vendor_id != PCI_VENDOR_ID_VMWARE) | ||
1081 | netdev->priv_flags |= IFF_UNICAST_FLT; | ||
1079 | 1082 | ||
1080 | adapter->en_mng_pt = e1000_enable_mng_pass_thru(hw); | 1083 | adapter->en_mng_pt = e1000_enable_mng_pass_thru(hw); |
1081 | 1084 | ||
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index ed5f1c15fb0f..c3a7f4a4b775 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -6151,7 +6151,7 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf) | |||
6151 | I40E_GL_MDET_TX_PF_NUM_SHIFT; | 6151 | I40E_GL_MDET_TX_PF_NUM_SHIFT; |
6152 | u8 vf_num = (reg & I40E_GL_MDET_TX_VF_NUM_MASK) >> | 6152 | u8 vf_num = (reg & I40E_GL_MDET_TX_VF_NUM_MASK) >> |
6153 | I40E_GL_MDET_TX_VF_NUM_SHIFT; | 6153 | I40E_GL_MDET_TX_VF_NUM_SHIFT; |
6154 | u8 event = (reg & I40E_GL_MDET_TX_EVENT_SHIFT) >> | 6154 | u8 event = (reg & I40E_GL_MDET_TX_EVENT_MASK) >> |
6155 | I40E_GL_MDET_TX_EVENT_SHIFT; | 6155 | I40E_GL_MDET_TX_EVENT_SHIFT; |
6156 | u8 queue = (reg & I40E_GL_MDET_TX_QUEUE_MASK) >> | 6156 | u8 queue = (reg & I40E_GL_MDET_TX_QUEUE_MASK) >> |
6157 | I40E_GL_MDET_TX_QUEUE_SHIFT; | 6157 | I40E_GL_MDET_TX_QUEUE_SHIFT; |
@@ -6165,7 +6165,7 @@ static void i40e_handle_mdd_event(struct i40e_pf *pf) | |||
6165 | if (reg & I40E_GL_MDET_RX_VALID_MASK) { | 6165 | if (reg & I40E_GL_MDET_RX_VALID_MASK) { |
6166 | u8 func = (reg & I40E_GL_MDET_RX_FUNCTION_MASK) >> | 6166 | u8 func = (reg & I40E_GL_MDET_RX_FUNCTION_MASK) >> |
6167 | I40E_GL_MDET_RX_FUNCTION_SHIFT; | 6167 | I40E_GL_MDET_RX_FUNCTION_SHIFT; |
6168 | u8 event = (reg & I40E_GL_MDET_RX_EVENT_SHIFT) >> | 6168 | u8 event = (reg & I40E_GL_MDET_RX_EVENT_MASK) >> |
6169 | I40E_GL_MDET_RX_EVENT_SHIFT; | 6169 | I40E_GL_MDET_RX_EVENT_SHIFT; |
6170 | u8 queue = (reg & I40E_GL_MDET_RX_QUEUE_MASK) >> | 6170 | u8 queue = (reg & I40E_GL_MDET_RX_QUEUE_MASK) >> |
6171 | I40E_GL_MDET_RX_QUEUE_SHIFT; | 6171 | I40E_GL_MDET_RX_QUEUE_SHIFT; |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index a21b14495ebd..a2d72a87cbde 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -6537,6 +6537,9 @@ static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer, | |||
6537 | if (unlikely(page_to_nid(page) != numa_node_id())) | 6537 | if (unlikely(page_to_nid(page) != numa_node_id())) |
6538 | return false; | 6538 | return false; |
6539 | 6539 | ||
6540 | if (unlikely(page->pfmemalloc)) | ||
6541 | return false; | ||
6542 | |||
6540 | #if (PAGE_SIZE < 8192) | 6543 | #if (PAGE_SIZE < 8192) |
6541 | /* if we are only owner of page we can reuse it */ | 6544 | /* if we are only owner of page we can reuse it */ |
6542 | if (unlikely(page_count(page) != 1)) | 6545 | if (unlikely(page_count(page) != 1)) |
@@ -6603,7 +6606,8 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring, | |||
6603 | memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long))); | 6606 | memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long))); |
6604 | 6607 | ||
6605 | /* we can reuse buffer as-is, just make sure it is local */ | 6608 | /* we can reuse buffer as-is, just make sure it is local */ |
6606 | if (likely(page_to_nid(page) == numa_node_id())) | 6609 | if (likely((page_to_nid(page) == numa_node_id()) && |
6610 | !page->pfmemalloc)) | ||
6607 | return true; | 6611 | return true; |
6608 | 6612 | ||
6609 | /* this page cannot be reused so discard it */ | 6613 | /* this page cannot be reused so discard it */ |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 3ce4a258f945..0ae038b9af90 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -342,12 +342,16 @@ static int ixgbe_set_settings(struct net_device *netdev, | |||
342 | if (old == advertised) | 342 | if (old == advertised) |
343 | return err; | 343 | return err; |
344 | /* this sets the link speed and restarts auto-neg */ | 344 | /* this sets the link speed and restarts auto-neg */ |
345 | while (test_and_set_bit(__IXGBE_IN_SFP_INIT, &adapter->state)) | ||
346 | usleep_range(1000, 2000); | ||
347 | |||
345 | hw->mac.autotry_restart = true; | 348 | hw->mac.autotry_restart = true; |
346 | err = hw->mac.ops.setup_link(hw, advertised, true); | 349 | err = hw->mac.ops.setup_link(hw, advertised, true); |
347 | if (err) { | 350 | if (err) { |
348 | e_info(probe, "setup link failed with code %d\n", err); | 351 | e_info(probe, "setup link failed with code %d\n", err); |
349 | hw->mac.ops.setup_link(hw, old, true); | 352 | hw->mac.ops.setup_link(hw, old, true); |
350 | } | 353 | } |
354 | clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state); | ||
351 | } else { | 355 | } else { |
352 | /* in this case we currently only support 10Gb/FULL */ | 356 | /* in this case we currently only support 10Gb/FULL */ |
353 | u32 speed = ethtool_cmd_speed(ecmd); | 357 | u32 speed = ethtool_cmd_speed(ecmd); |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index fec5212d4337..d2df4e3d1032 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -4321,8 +4321,8 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring) | |||
4321 | IXGBE_CB(skb)->page_released = false; | 4321 | IXGBE_CB(skb)->page_released = false; |
4322 | } | 4322 | } |
4323 | dev_kfree_skb(skb); | 4323 | dev_kfree_skb(skb); |
4324 | rx_buffer->skb = NULL; | ||
4324 | } | 4325 | } |
4325 | rx_buffer->skb = NULL; | ||
4326 | if (rx_buffer->dma) | 4326 | if (rx_buffer->dma) |
4327 | dma_unmap_page(dev, rx_buffer->dma, | 4327 | dma_unmap_page(dev, rx_buffer->dma, |
4328 | ixgbe_rx_pg_size(rx_ring), | 4328 | ixgbe_rx_pg_size(rx_ring), |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_tx.c b/drivers/net/ethernet/mellanox/mlx4/en_tx.c index 34c137878545..454d9fea640e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_tx.c | |||
@@ -836,8 +836,11 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
836 | * whether LSO is used */ | 836 | * whether LSO is used */ |
837 | tx_desc->ctrl.srcrb_flags = priv->ctrl_flags; | 837 | tx_desc->ctrl.srcrb_flags = priv->ctrl_flags; |
838 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { | 838 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { |
839 | tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM | | 839 | if (!skb->encapsulation) |
840 | MLX4_WQE_CTRL_TCP_UDP_CSUM); | 840 | tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM | |
841 | MLX4_WQE_CTRL_TCP_UDP_CSUM); | ||
842 | else | ||
843 | tx_desc->ctrl.srcrb_flags |= cpu_to_be32(MLX4_WQE_CTRL_IP_CSUM); | ||
841 | ring->tx_csum++; | 844 | ring->tx_csum++; |
842 | } | 845 | } |
843 | 846 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index a49c9d11d8a5..49290a405903 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |||
@@ -1026,6 +1026,7 @@ static void mlx4_free_eq(struct mlx4_dev *dev, | |||
1026 | pr_cont("\n"); | 1026 | pr_cont("\n"); |
1027 | } | 1027 | } |
1028 | } | 1028 | } |
1029 | synchronize_irq(eq->irq); | ||
1029 | 1030 | ||
1030 | mlx4_mtt_cleanup(dev, &eq->mtt); | 1031 | mlx4_mtt_cleanup(dev, &eq->mtt); |
1031 | for (i = 0; i < npages; ++i) | 1032 | for (i = 0; i < npages; ++i) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c index ca0f98c95105..872843179f44 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c | |||
@@ -955,6 +955,10 @@ static void mlx4_err_rule(struct mlx4_dev *dev, char *str, | |||
955 | cur->ib.dst_gid_msk); | 955 | cur->ib.dst_gid_msk); |
956 | break; | 956 | break; |
957 | 957 | ||
958 | case MLX4_NET_TRANS_RULE_ID_VXLAN: | ||
959 | len += snprintf(buf + len, BUF_SIZE - len, | ||
960 | "VNID = %d ", be32_to_cpu(cur->vxlan.vni)); | ||
961 | break; | ||
958 | case MLX4_NET_TRANS_RULE_ID_IPV6: | 962 | case MLX4_NET_TRANS_RULE_ID_IPV6: |
959 | break; | 963 | break; |
960 | 964 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index ed53291468f3..a278238a2db6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c | |||
@@ -420,6 +420,7 @@ int mlx5_destroy_unmap_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq) | |||
420 | if (err) | 420 | if (err) |
421 | mlx5_core_warn(dev, "failed to destroy a previously created eq: eqn %d\n", | 421 | mlx5_core_warn(dev, "failed to destroy a previously created eq: eqn %d\n", |
422 | eq->eqn); | 422 | eq->eqn); |
423 | synchronize_irq(table->msix_arr[eq->irqn].vector); | ||
423 | mlx5_buf_free(dev, &eq->buf); | 424 | mlx5_buf_free(dev, &eq->buf); |
424 | 425 | ||
425 | return err; | 426 | return err; |
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c index ee84a90e371c..aaf2987512b5 100644 --- a/drivers/net/ethernet/sfc/tx.c +++ b/drivers/net/ethernet/sfc/tx.c | |||
@@ -343,8 +343,6 @@ netdev_tx_t efx_enqueue_skb(struct efx_tx_queue *tx_queue, struct sk_buff *skb) | |||
343 | unsigned short dma_flags; | 343 | unsigned short dma_flags; |
344 | int i = 0; | 344 | int i = 0; |
345 | 345 | ||
346 | EFX_BUG_ON_PARANOID(tx_queue->write_count > tx_queue->insert_count); | ||
347 | |||
348 | if (skb_shinfo(skb)->gso_size) | 346 | if (skb_shinfo(skb)->gso_size) |
349 | return efx_enqueue_skb_tso(tx_queue, skb); | 347 | return efx_enqueue_skb_tso(tx_queue, skb); |
350 | 348 | ||
@@ -1258,8 +1256,6 @@ static int efx_enqueue_skb_tso(struct efx_tx_queue *tx_queue, | |||
1258 | /* Find the packet protocol and sanity-check it */ | 1256 | /* Find the packet protocol and sanity-check it */ |
1259 | state.protocol = efx_tso_check_protocol(skb); | 1257 | state.protocol = efx_tso_check_protocol(skb); |
1260 | 1258 | ||
1261 | EFX_BUG_ON_PARANOID(tx_queue->write_count > tx_queue->insert_count); | ||
1262 | |||
1263 | rc = tso_start(&state, efx, skb); | 1259 | rc = tso_start(&state, efx, skb); |
1264 | if (rc) | 1260 | if (rc) |
1265 | goto mem_err; | 1261 | goto mem_err; |
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 5e94d00b96b3..2c62208077fe 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c | |||
@@ -81,6 +81,7 @@ static const char version[] = | |||
81 | #include <linux/workqueue.h> | 81 | #include <linux/workqueue.h> |
82 | #include <linux/of.h> | 82 | #include <linux/of.h> |
83 | #include <linux/of_device.h> | 83 | #include <linux/of_device.h> |
84 | #include <linux/of_gpio.h> | ||
84 | 85 | ||
85 | #include <linux/netdevice.h> | 86 | #include <linux/netdevice.h> |
86 | #include <linux/etherdevice.h> | 87 | #include <linux/etherdevice.h> |
@@ -2188,6 +2189,41 @@ static const struct of_device_id smc91x_match[] = { | |||
2188 | {}, | 2189 | {}, |
2189 | }; | 2190 | }; |
2190 | MODULE_DEVICE_TABLE(of, smc91x_match); | 2191 | MODULE_DEVICE_TABLE(of, smc91x_match); |
2192 | |||
2193 | /** | ||
2194 | * of_try_set_control_gpio - configure a gpio if it exists | ||
2195 | */ | ||
2196 | static int try_toggle_control_gpio(struct device *dev, | ||
2197 | struct gpio_desc **desc, | ||
2198 | const char *name, int index, | ||
2199 | int value, unsigned int nsdelay) | ||
2200 | { | ||
2201 | struct gpio_desc *gpio = *desc; | ||
2202 | int res; | ||
2203 | |||
2204 | gpio = devm_gpiod_get_index(dev, name, index); | ||
2205 | if (IS_ERR(gpio)) { | ||
2206 | if (PTR_ERR(gpio) == -ENOENT) { | ||
2207 | *desc = NULL; | ||
2208 | return 0; | ||
2209 | } | ||
2210 | |||
2211 | return PTR_ERR(gpio); | ||
2212 | } | ||
2213 | res = gpiod_direction_output(gpio, !value); | ||
2214 | if (res) { | ||
2215 | dev_err(dev, "unable to toggle gpio %s: %i\n", name, res); | ||
2216 | devm_gpiod_put(dev, gpio); | ||
2217 | gpio = NULL; | ||
2218 | return res; | ||
2219 | } | ||
2220 | if (nsdelay) | ||
2221 | usleep_range(nsdelay, 2 * nsdelay); | ||
2222 | gpiod_set_value_cansleep(gpio, value); | ||
2223 | *desc = gpio; | ||
2224 | |||
2225 | return 0; | ||
2226 | } | ||
2191 | #endif | 2227 | #endif |
2192 | 2228 | ||
2193 | /* | 2229 | /* |
@@ -2237,6 +2273,28 @@ static int smc_drv_probe(struct platform_device *pdev) | |||
2237 | struct device_node *np = pdev->dev.of_node; | 2273 | struct device_node *np = pdev->dev.of_node; |
2238 | u32 val; | 2274 | u32 val; |
2239 | 2275 | ||
2276 | /* Optional pwrdwn GPIO configured? */ | ||
2277 | ret = try_toggle_control_gpio(&pdev->dev, &lp->power_gpio, | ||
2278 | "power", 0, 0, 100); | ||
2279 | if (ret) | ||
2280 | return ret; | ||
2281 | |||
2282 | /* | ||
2283 | * Optional reset GPIO configured? Minimum 100 ns reset needed | ||
2284 | * according to LAN91C96 datasheet page 14. | ||
2285 | */ | ||
2286 | ret = try_toggle_control_gpio(&pdev->dev, &lp->reset_gpio, | ||
2287 | "reset", 0, 0, 100); | ||
2288 | if (ret) | ||
2289 | return ret; | ||
2290 | |||
2291 | /* | ||
2292 | * Need to wait for optional EEPROM to load, max 750 us according | ||
2293 | * to LAN91C96 datasheet page 55. | ||
2294 | */ | ||
2295 | if (lp->reset_gpio) | ||
2296 | usleep_range(750, 1000); | ||
2297 | |||
2240 | /* Combination of IO widths supported, default to 16-bit */ | 2298 | /* Combination of IO widths supported, default to 16-bit */ |
2241 | if (!of_property_read_u32(np, "reg-io-width", &val)) { | 2299 | if (!of_property_read_u32(np, "reg-io-width", &val)) { |
2242 | if (val & 1) | 2300 | if (val & 1) |
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h index 47dce918eb0f..2a38dacbbd27 100644 --- a/drivers/net/ethernet/smsc/smc91x.h +++ b/drivers/net/ethernet/smsc/smc91x.h | |||
@@ -298,6 +298,9 @@ struct smc_local { | |||
298 | struct sk_buff *pending_tx_skb; | 298 | struct sk_buff *pending_tx_skb; |
299 | struct tasklet_struct tx_task; | 299 | struct tasklet_struct tx_task; |
300 | 300 | ||
301 | struct gpio_desc *power_gpio; | ||
302 | struct gpio_desc *reset_gpio; | ||
303 | |||
301 | /* version/revision of the SMC91x chip */ | 304 | /* version/revision of the SMC91x chip */ |
302 | int version; | 305 | int version; |
303 | 306 | ||
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index 655a23bbc451..e17a970eaf2b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | |||
@@ -33,6 +33,7 @@ static struct stmmac_dma_cfg dma_cfg; | |||
33 | static void stmmac_default_data(void) | 33 | static void stmmac_default_data(void) |
34 | { | 34 | { |
35 | memset(&plat_dat, 0, sizeof(struct plat_stmmacenet_data)); | 35 | memset(&plat_dat, 0, sizeof(struct plat_stmmacenet_data)); |
36 | |||
36 | plat_dat.bus_id = 1; | 37 | plat_dat.bus_id = 1; |
37 | plat_dat.phy_addr = 0; | 38 | plat_dat.phy_addr = 0; |
38 | plat_dat.interface = PHY_INTERFACE_MODE_GMII; | 39 | plat_dat.interface = PHY_INTERFACE_MODE_GMII; |
@@ -47,6 +48,12 @@ static void stmmac_default_data(void) | |||
47 | dma_cfg.pbl = 32; | 48 | dma_cfg.pbl = 32; |
48 | dma_cfg.burst_len = DMA_AXI_BLEN_256; | 49 | dma_cfg.burst_len = DMA_AXI_BLEN_256; |
49 | plat_dat.dma_cfg = &dma_cfg; | 50 | plat_dat.dma_cfg = &dma_cfg; |
51 | |||
52 | /* Set default value for multicast hash bins */ | ||
53 | plat_dat.multicast_filter_bins = HASH_TABLE_SIZE; | ||
54 | |||
55 | /* Set default value for unicast filter entries */ | ||
56 | plat_dat.unicast_filter_entries = 1; | ||
50 | } | 57 | } |
51 | 58 | ||
52 | /** | 59 | /** |
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 952e1e4764b7..d8794488f80a 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -591,8 +591,8 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable) | |||
591 | if (enable) { | 591 | if (enable) { |
592 | unsigned long timeout = jiffies + HZ; | 592 | unsigned long timeout = jiffies + HZ; |
593 | 593 | ||
594 | /* Disable Learn for all ports */ | 594 | /* Disable Learn for all ports (host is port 0 and slaves are port 1 and up */ |
595 | for (i = 0; i < priv->data.slaves; i++) { | 595 | for (i = 0; i <= priv->data.slaves; i++) { |
596 | cpsw_ale_control_set(ale, i, | 596 | cpsw_ale_control_set(ale, i, |
597 | ALE_PORT_NOLEARN, 1); | 597 | ALE_PORT_NOLEARN, 1); |
598 | cpsw_ale_control_set(ale, i, | 598 | cpsw_ale_control_set(ale, i, |
@@ -616,11 +616,11 @@ static void cpsw_set_promiscious(struct net_device *ndev, bool enable) | |||
616 | cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1); | 616 | cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 1); |
617 | dev_dbg(&ndev->dev, "promiscuity enabled\n"); | 617 | dev_dbg(&ndev->dev, "promiscuity enabled\n"); |
618 | } else { | 618 | } else { |
619 | /* Flood All Unicast Packets to Host port */ | 619 | /* Don't Flood All Unicast Packets to Host port */ |
620 | cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 0); | 620 | cpsw_ale_control_set(ale, 0, ALE_P0_UNI_FLOOD, 0); |
621 | 621 | ||
622 | /* Enable Learn for all ports */ | 622 | /* Enable Learn for all ports (host is port 0 and slaves are port 1 and up */ |
623 | for (i = 0; i < priv->data.slaves; i++) { | 623 | for (i = 0; i <= priv->data.slaves; i++) { |
624 | cpsw_ale_control_set(ale, i, | 624 | cpsw_ale_control_set(ale, i, |
625 | ALE_PORT_NOLEARN, 0); | 625 | ALE_PORT_NOLEARN, 0); |
626 | cpsw_ale_control_set(ale, i, | 626 | cpsw_ale_control_set(ale, i, |
@@ -638,12 +638,16 @@ static void cpsw_ndo_set_rx_mode(struct net_device *ndev) | |||
638 | if (ndev->flags & IFF_PROMISC) { | 638 | if (ndev->flags & IFF_PROMISC) { |
639 | /* Enable promiscuous mode */ | 639 | /* Enable promiscuous mode */ |
640 | cpsw_set_promiscious(ndev, true); | 640 | cpsw_set_promiscious(ndev, true); |
641 | cpsw_ale_set_allmulti(priv->ale, IFF_ALLMULTI); | ||
641 | return; | 642 | return; |
642 | } else { | 643 | } else { |
643 | /* Disable promiscuous mode */ | 644 | /* Disable promiscuous mode */ |
644 | cpsw_set_promiscious(ndev, false); | 645 | cpsw_set_promiscious(ndev, false); |
645 | } | 646 | } |
646 | 647 | ||
648 | /* Restore allmulti on vlans if necessary */ | ||
649 | cpsw_ale_set_allmulti(priv->ale, priv->ndev->flags & IFF_ALLMULTI); | ||
650 | |||
647 | /* Clear all mcast from ALE */ | 651 | /* Clear all mcast from ALE */ |
648 | cpsw_ale_flush_multicast(priv->ale, ALE_ALL_PORTS << priv->host_port); | 652 | cpsw_ale_flush_multicast(priv->ale, ALE_ALL_PORTS << priv->host_port); |
649 | 653 | ||
@@ -1149,6 +1153,7 @@ static inline void cpsw_add_default_vlan(struct cpsw_priv *priv) | |||
1149 | const int port = priv->host_port; | 1153 | const int port = priv->host_port; |
1150 | u32 reg; | 1154 | u32 reg; |
1151 | int i; | 1155 | int i; |
1156 | int unreg_mcast_mask; | ||
1152 | 1157 | ||
1153 | reg = (priv->version == CPSW_VERSION_1) ? CPSW1_PORT_VLAN : | 1158 | reg = (priv->version == CPSW_VERSION_1) ? CPSW1_PORT_VLAN : |
1154 | CPSW2_PORT_VLAN; | 1159 | CPSW2_PORT_VLAN; |
@@ -1158,9 +1163,14 @@ static inline void cpsw_add_default_vlan(struct cpsw_priv *priv) | |||
1158 | for (i = 0; i < priv->data.slaves; i++) | 1163 | for (i = 0; i < priv->data.slaves; i++) |
1159 | slave_write(priv->slaves + i, vlan, reg); | 1164 | slave_write(priv->slaves + i, vlan, reg); |
1160 | 1165 | ||
1166 | if (priv->ndev->flags & IFF_ALLMULTI) | ||
1167 | unreg_mcast_mask = ALE_ALL_PORTS; | ||
1168 | else | ||
1169 | unreg_mcast_mask = ALE_PORT_1 | ALE_PORT_2; | ||
1170 | |||
1161 | cpsw_ale_add_vlan(priv->ale, vlan, ALE_ALL_PORTS << port, | 1171 | cpsw_ale_add_vlan(priv->ale, vlan, ALE_ALL_PORTS << port, |
1162 | ALE_ALL_PORTS << port, ALE_ALL_PORTS << port, | 1172 | ALE_ALL_PORTS << port, ALE_ALL_PORTS << port, |
1163 | (ALE_PORT_1 | ALE_PORT_2) << port); | 1173 | unreg_mcast_mask << port); |
1164 | } | 1174 | } |
1165 | 1175 | ||
1166 | static void cpsw_init_host_port(struct cpsw_priv *priv) | 1176 | static void cpsw_init_host_port(struct cpsw_priv *priv) |
@@ -1620,11 +1630,17 @@ static inline int cpsw_add_vlan_ale_entry(struct cpsw_priv *priv, | |||
1620 | unsigned short vid) | 1630 | unsigned short vid) |
1621 | { | 1631 | { |
1622 | int ret; | 1632 | int ret; |
1633 | int unreg_mcast_mask; | ||
1634 | |||
1635 | if (priv->ndev->flags & IFF_ALLMULTI) | ||
1636 | unreg_mcast_mask = ALE_ALL_PORTS; | ||
1637 | else | ||
1638 | unreg_mcast_mask = ALE_PORT_1 | ALE_PORT_2; | ||
1623 | 1639 | ||
1624 | ret = cpsw_ale_add_vlan(priv->ale, vid, | 1640 | ret = cpsw_ale_add_vlan(priv->ale, vid, |
1625 | ALE_ALL_PORTS << priv->host_port, | 1641 | ALE_ALL_PORTS << priv->host_port, |
1626 | 0, ALE_ALL_PORTS << priv->host_port, | 1642 | 0, ALE_ALL_PORTS << priv->host_port, |
1627 | (ALE_PORT_1 | ALE_PORT_2) << priv->host_port); | 1643 | unreg_mcast_mask << priv->host_port); |
1628 | if (ret != 0) | 1644 | if (ret != 0) |
1629 | return ret; | 1645 | return ret; |
1630 | 1646 | ||
@@ -2006,7 +2022,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
2006 | parp = of_get_property(slave_node, "phy_id", &lenp); | 2022 | parp = of_get_property(slave_node, "phy_id", &lenp); |
2007 | if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { | 2023 | if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { |
2008 | dev_err(&pdev->dev, "Missing slave[%d] phy_id property\n", i); | 2024 | dev_err(&pdev->dev, "Missing slave[%d] phy_id property\n", i); |
2009 | return -EINVAL; | 2025 | goto no_phy_slave; |
2010 | } | 2026 | } |
2011 | mdio_node = of_find_node_by_phandle(be32_to_cpup(parp)); | 2027 | mdio_node = of_find_node_by_phandle(be32_to_cpup(parp)); |
2012 | phyid = be32_to_cpup(parp+1); | 2028 | phyid = be32_to_cpup(parp+1); |
@@ -2019,6 +2035,14 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
2019 | snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), | 2035 | snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), |
2020 | PHY_ID_FMT, mdio->name, phyid); | 2036 | PHY_ID_FMT, mdio->name, phyid); |
2021 | 2037 | ||
2038 | slave_data->phy_if = of_get_phy_mode(slave_node); | ||
2039 | if (slave_data->phy_if < 0) { | ||
2040 | dev_err(&pdev->dev, "Missing or malformed slave[%d] phy-mode property\n", | ||
2041 | i); | ||
2042 | return slave_data->phy_if; | ||
2043 | } | ||
2044 | |||
2045 | no_phy_slave: | ||
2022 | mac_addr = of_get_mac_address(slave_node); | 2046 | mac_addr = of_get_mac_address(slave_node); |
2023 | if (mac_addr) { | 2047 | if (mac_addr) { |
2024 | memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN); | 2048 | memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN); |
@@ -2030,14 +2054,6 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
2030 | return ret; | 2054 | return ret; |
2031 | } | 2055 | } |
2032 | } | 2056 | } |
2033 | |||
2034 | slave_data->phy_if = of_get_phy_mode(slave_node); | ||
2035 | if (slave_data->phy_if < 0) { | ||
2036 | dev_err(&pdev->dev, "Missing or malformed slave[%d] phy-mode property\n", | ||
2037 | i); | ||
2038 | return slave_data->phy_if; | ||
2039 | } | ||
2040 | |||
2041 | if (data->dual_emac) { | 2057 | if (data->dual_emac) { |
2042 | if (of_property_read_u32(slave_node, "dual_emac_res_vlan", | 2058 | if (of_property_read_u32(slave_node, "dual_emac_res_vlan", |
2043 | &prop)) { | 2059 | &prop)) { |
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c index 0579b2243bb6..3ae83879a75f 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.c +++ b/drivers/net/ethernet/ti/cpsw_ale.c | |||
@@ -443,6 +443,35 @@ int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask) | |||
443 | return 0; | 443 | return 0; |
444 | } | 444 | } |
445 | 445 | ||
446 | void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti) | ||
447 | { | ||
448 | u32 ale_entry[ALE_ENTRY_WORDS]; | ||
449 | int type, idx; | ||
450 | int unreg_mcast = 0; | ||
451 | |||
452 | /* Only bother doing the work if the setting is actually changing */ | ||
453 | if (ale->allmulti == allmulti) | ||
454 | return; | ||
455 | |||
456 | /* Remember the new setting to check against next time */ | ||
457 | ale->allmulti = allmulti; | ||
458 | |||
459 | for (idx = 0; idx < ale->params.ale_entries; idx++) { | ||
460 | cpsw_ale_read(ale, idx, ale_entry); | ||
461 | type = cpsw_ale_get_entry_type(ale_entry); | ||
462 | if (type != ALE_TYPE_VLAN) | ||
463 | continue; | ||
464 | |||
465 | unreg_mcast = cpsw_ale_get_vlan_unreg_mcast(ale_entry); | ||
466 | if (allmulti) | ||
467 | unreg_mcast |= 1; | ||
468 | else | ||
469 | unreg_mcast &= ~1; | ||
470 | cpsw_ale_set_vlan_unreg_mcast(ale_entry, unreg_mcast); | ||
471 | cpsw_ale_write(ale, idx, ale_entry); | ||
472 | } | ||
473 | } | ||
474 | |||
446 | struct ale_control_info { | 475 | struct ale_control_info { |
447 | const char *name; | 476 | const char *name; |
448 | int offset, port_offset; | 477 | int offset, port_offset; |
diff --git a/drivers/net/ethernet/ti/cpsw_ale.h b/drivers/net/ethernet/ti/cpsw_ale.h index 31cf43cab42e..c0d4127aa549 100644 --- a/drivers/net/ethernet/ti/cpsw_ale.h +++ b/drivers/net/ethernet/ti/cpsw_ale.h | |||
@@ -27,6 +27,7 @@ struct cpsw_ale { | |||
27 | struct cpsw_ale_params params; | 27 | struct cpsw_ale_params params; |
28 | struct timer_list timer; | 28 | struct timer_list timer; |
29 | unsigned long ageout; | 29 | unsigned long ageout; |
30 | int allmulti; | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | enum cpsw_ale_control { | 33 | enum cpsw_ale_control { |
@@ -103,6 +104,7 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask, | |||
103 | int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag, | 104 | int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag, |
104 | int reg_mcast, int unreg_mcast); | 105 | int reg_mcast, int unreg_mcast); |
105 | int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port); | 106 | int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port); |
107 | void cpsw_ale_set_allmulti(struct cpsw_ale *ale, int allmulti); | ||
106 | 108 | ||
107 | int cpsw_ale_control_get(struct cpsw_ale *ale, int port, int control); | 109 | int cpsw_ale_control_get(struct cpsw_ale *ale, int port, int control); |
108 | int cpsw_ale_control_set(struct cpsw_ale *ale, int port, | 110 | int cpsw_ale_control_set(struct cpsw_ale *ale, int port, |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 9e17d1a91e71..78ec33f5100b 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -550,6 +550,7 @@ do_lso: | |||
550 | do_send: | 550 | do_send: |
551 | /* Start filling in the page buffers with the rndis hdr */ | 551 | /* Start filling in the page buffers with the rndis hdr */ |
552 | rndis_msg->msg_len += rndis_msg_size; | 552 | rndis_msg->msg_len += rndis_msg_size; |
553 | packet->total_data_buflen = rndis_msg->msg_len; | ||
553 | packet->page_buf_cnt = init_page_array(rndis_msg, rndis_msg_size, | 554 | packet->page_buf_cnt = init_page_array(rndis_msg, rndis_msg_size, |
554 | skb, &packet->page_buf[0]); | 555 | skb, &packet->page_buf[0]); |
555 | 556 | ||
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 29b3bb410781..bfb0b6ec8c56 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -272,7 +272,7 @@ static void macvlan_process_broadcast(struct work_struct *w) | |||
272 | struct sk_buff *skb; | 272 | struct sk_buff *skb; |
273 | struct sk_buff_head list; | 273 | struct sk_buff_head list; |
274 | 274 | ||
275 | skb_queue_head_init(&list); | 275 | __skb_queue_head_init(&list); |
276 | 276 | ||
277 | spin_lock_bh(&port->bc_queue.lock); | 277 | spin_lock_bh(&port->bc_queue.lock); |
278 | skb_queue_splice_tail_init(&port->bc_queue, &list); | 278 | skb_queue_splice_tail_init(&port->bc_queue, &list); |
@@ -1082,9 +1082,15 @@ static void macvlan_port_destroy(struct net_device *dev) | |||
1082 | { | 1082 | { |
1083 | struct macvlan_port *port = macvlan_port_get_rtnl(dev); | 1083 | struct macvlan_port *port = macvlan_port_get_rtnl(dev); |
1084 | 1084 | ||
1085 | cancel_work_sync(&port->bc_work); | ||
1086 | dev->priv_flags &= ~IFF_MACVLAN_PORT; | 1085 | dev->priv_flags &= ~IFF_MACVLAN_PORT; |
1087 | netdev_rx_handler_unregister(dev); | 1086 | netdev_rx_handler_unregister(dev); |
1087 | |||
1088 | /* After this point, no packet can schedule bc_work anymore, | ||
1089 | * but we need to cancel it and purge left skbs if any. | ||
1090 | */ | ||
1091 | cancel_work_sync(&port->bc_work); | ||
1092 | __skb_queue_purge(&port->bc_queue); | ||
1093 | |||
1088 | kfree_rcu(port, rcu); | 1094 | kfree_rcu(port, rcu); |
1089 | } | 1095 | } |
1090 | 1096 | ||
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 65e2892342bd..6f226de655a4 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/idr.h> | 16 | #include <linux/idr.h> |
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | 18 | ||
19 | #include <net/ipv6.h> | ||
19 | #include <net/net_namespace.h> | 20 | #include <net/net_namespace.h> |
20 | #include <net/rtnetlink.h> | 21 | #include <net/rtnetlink.h> |
21 | #include <net/sock.h> | 22 | #include <net/sock.h> |
@@ -65,7 +66,7 @@ static struct cdev macvtap_cdev; | |||
65 | static const struct proto_ops macvtap_socket_ops; | 66 | static const struct proto_ops macvtap_socket_ops; |
66 | 67 | ||
67 | #define TUN_OFFLOADS (NETIF_F_HW_CSUM | NETIF_F_TSO_ECN | NETIF_F_TSO | \ | 68 | #define TUN_OFFLOADS (NETIF_F_HW_CSUM | NETIF_F_TSO_ECN | NETIF_F_TSO | \ |
68 | NETIF_F_TSO6 | NETIF_F_UFO) | 69 | NETIF_F_TSO6) |
69 | #define RX_OFFLOADS (NETIF_F_GRO | NETIF_F_LRO) | 70 | #define RX_OFFLOADS (NETIF_F_GRO | NETIF_F_LRO) |
70 | #define TAP_FEATURES (NETIF_F_GSO | NETIF_F_SG) | 71 | #define TAP_FEATURES (NETIF_F_GSO | NETIF_F_SG) |
71 | 72 | ||
@@ -569,7 +570,11 @@ static int macvtap_skb_from_vnet_hdr(struct sk_buff *skb, | |||
569 | gso_type = SKB_GSO_TCPV6; | 570 | gso_type = SKB_GSO_TCPV6; |
570 | break; | 571 | break; |
571 | case VIRTIO_NET_HDR_GSO_UDP: | 572 | case VIRTIO_NET_HDR_GSO_UDP: |
573 | pr_warn_once("macvtap: %s: using disabled UFO feature; please fix this program\n", | ||
574 | current->comm); | ||
572 | gso_type = SKB_GSO_UDP; | 575 | gso_type = SKB_GSO_UDP; |
576 | if (skb->protocol == htons(ETH_P_IPV6)) | ||
577 | ipv6_proxy_select_ident(skb); | ||
573 | break; | 578 | break; |
574 | default: | 579 | default: |
575 | return -EINVAL; | 580 | return -EINVAL; |
@@ -614,8 +619,6 @@ static void macvtap_skb_to_vnet_hdr(const struct sk_buff *skb, | |||
614 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; | 619 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; |
615 | else if (sinfo->gso_type & SKB_GSO_TCPV6) | 620 | else if (sinfo->gso_type & SKB_GSO_TCPV6) |
616 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6; | 621 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6; |
617 | else if (sinfo->gso_type & SKB_GSO_UDP) | ||
618 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_UDP; | ||
619 | else | 622 | else |
620 | BUG(); | 623 | BUG(); |
621 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) | 624 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) |
@@ -950,9 +953,6 @@ static int set_offload(struct macvtap_queue *q, unsigned long arg) | |||
950 | if (arg & TUN_F_TSO6) | 953 | if (arg & TUN_F_TSO6) |
951 | feature_mask |= NETIF_F_TSO6; | 954 | feature_mask |= NETIF_F_TSO6; |
952 | } | 955 | } |
953 | |||
954 | if (arg & TUN_F_UFO) | ||
955 | feature_mask |= NETIF_F_UFO; | ||
956 | } | 956 | } |
957 | 957 | ||
958 | /* tun/tap driver inverts the usage for TSO offloads, where | 958 | /* tun/tap driver inverts the usage for TSO offloads, where |
@@ -963,7 +963,7 @@ static int set_offload(struct macvtap_queue *q, unsigned long arg) | |||
963 | * When user space turns off TSO, we turn off GSO/LRO so that | 963 | * When user space turns off TSO, we turn off GSO/LRO so that |
964 | * user-space will not receive TSO frames. | 964 | * user-space will not receive TSO frames. |
965 | */ | 965 | */ |
966 | if (feature_mask & (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_UFO)) | 966 | if (feature_mask & (NETIF_F_TSO | NETIF_F_TSO6)) |
967 | features |= RX_OFFLOADS; | 967 | features |= RX_OFFLOADS; |
968 | else | 968 | else |
969 | features &= ~RX_OFFLOADS; | 969 | features &= ~RX_OFFLOADS; |
@@ -1064,7 +1064,7 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd, | |||
1064 | case TUNSETOFFLOAD: | 1064 | case TUNSETOFFLOAD: |
1065 | /* let the user check for future flags */ | 1065 | /* let the user check for future flags */ |
1066 | if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | | 1066 | if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | |
1067 | TUN_F_TSO_ECN | TUN_F_UFO)) | 1067 | TUN_F_TSO_ECN)) |
1068 | return -EINVAL; | 1068 | return -EINVAL; |
1069 | 1069 | ||
1070 | rtnl_lock(); | 1070 | rtnl_lock(); |
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index bd37e45c89c0..225c033b08f3 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c | |||
@@ -50,10 +50,15 @@ | |||
50 | #define MII_M1011_PHY_SCR 0x10 | 50 | #define MII_M1011_PHY_SCR 0x10 |
51 | #define MII_M1011_PHY_SCR_AUTO_CROSS 0x0060 | 51 | #define MII_M1011_PHY_SCR_AUTO_CROSS 0x0060 |
52 | 52 | ||
53 | #define MII_M1145_PHY_EXT_SR 0x1b | ||
53 | #define MII_M1145_PHY_EXT_CR 0x14 | 54 | #define MII_M1145_PHY_EXT_CR 0x14 |
54 | #define MII_M1145_RGMII_RX_DELAY 0x0080 | 55 | #define MII_M1145_RGMII_RX_DELAY 0x0080 |
55 | #define MII_M1145_RGMII_TX_DELAY 0x0002 | 56 | #define MII_M1145_RGMII_TX_DELAY 0x0002 |
56 | 57 | ||
58 | #define MII_M1145_HWCFG_MODE_SGMII_NO_CLK 0x4 | ||
59 | #define MII_M1145_HWCFG_MODE_MASK 0xf | ||
60 | #define MII_M1145_HWCFG_FIBER_COPPER_AUTO 0x8000 | ||
61 | |||
57 | #define MII_M1111_PHY_LED_CONTROL 0x18 | 62 | #define MII_M1111_PHY_LED_CONTROL 0x18 |
58 | #define MII_M1111_PHY_LED_DIRECT 0x4100 | 63 | #define MII_M1111_PHY_LED_DIRECT 0x4100 |
59 | #define MII_M1111_PHY_LED_COMBINE 0x411c | 64 | #define MII_M1111_PHY_LED_COMBINE 0x411c |
@@ -676,6 +681,20 @@ static int m88e1145_config_init(struct phy_device *phydev) | |||
676 | } | 681 | } |
677 | } | 682 | } |
678 | 683 | ||
684 | if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { | ||
685 | int temp = phy_read(phydev, MII_M1145_PHY_EXT_SR); | ||
686 | if (temp < 0) | ||
687 | return temp; | ||
688 | |||
689 | temp &= ~MII_M1145_HWCFG_MODE_MASK; | ||
690 | temp |= MII_M1145_HWCFG_MODE_SGMII_NO_CLK; | ||
691 | temp |= MII_M1145_HWCFG_FIBER_COPPER_AUTO; | ||
692 | |||
693 | err = phy_write(phydev, MII_M1145_PHY_EXT_SR, temp); | ||
694 | if (err < 0) | ||
695 | return err; | ||
696 | } | ||
697 | |||
679 | err = marvell_of_reg_init(phydev); | 698 | err = marvell_of_reg_init(phydev); |
680 | if (err < 0) | 699 | if (err < 0) |
681 | return err; | 700 | return err; |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 186ce541c657..7302398f0b1f 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -65,6 +65,7 @@ | |||
65 | #include <linux/nsproxy.h> | 65 | #include <linux/nsproxy.h> |
66 | #include <linux/virtio_net.h> | 66 | #include <linux/virtio_net.h> |
67 | #include <linux/rcupdate.h> | 67 | #include <linux/rcupdate.h> |
68 | #include <net/ipv6.h> | ||
68 | #include <net/net_namespace.h> | 69 | #include <net/net_namespace.h> |
69 | #include <net/netns/generic.h> | 70 | #include <net/netns/generic.h> |
70 | #include <net/rtnetlink.h> | 71 | #include <net/rtnetlink.h> |
@@ -174,7 +175,7 @@ struct tun_struct { | |||
174 | struct net_device *dev; | 175 | struct net_device *dev; |
175 | netdev_features_t set_features; | 176 | netdev_features_t set_features; |
176 | #define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \ | 177 | #define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \ |
177 | NETIF_F_TSO6|NETIF_F_UFO) | 178 | NETIF_F_TSO6) |
178 | 179 | ||
179 | int vnet_hdr_sz; | 180 | int vnet_hdr_sz; |
180 | int sndbuf; | 181 | int sndbuf; |
@@ -1139,6 +1140,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, | |||
1139 | break; | 1140 | break; |
1140 | } | 1141 | } |
1141 | 1142 | ||
1143 | skb_reset_network_header(skb); | ||
1144 | |||
1142 | if (gso.gso_type != VIRTIO_NET_HDR_GSO_NONE) { | 1145 | if (gso.gso_type != VIRTIO_NET_HDR_GSO_NONE) { |
1143 | pr_debug("GSO!\n"); | 1146 | pr_debug("GSO!\n"); |
1144 | switch (gso.gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { | 1147 | switch (gso.gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { |
@@ -1149,8 +1152,20 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, | |||
1149 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; | 1152 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; |
1150 | break; | 1153 | break; |
1151 | case VIRTIO_NET_HDR_GSO_UDP: | 1154 | case VIRTIO_NET_HDR_GSO_UDP: |
1155 | { | ||
1156 | static bool warned; | ||
1157 | |||
1158 | if (!warned) { | ||
1159 | warned = true; | ||
1160 | netdev_warn(tun->dev, | ||
1161 | "%s: using disabled UFO feature; please fix this program\n", | ||
1162 | current->comm); | ||
1163 | } | ||
1152 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | 1164 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; |
1165 | if (skb->protocol == htons(ETH_P_IPV6)) | ||
1166 | ipv6_proxy_select_ident(skb); | ||
1153 | break; | 1167 | break; |
1168 | } | ||
1154 | default: | 1169 | default: |
1155 | tun->dev->stats.rx_frame_errors++; | 1170 | tun->dev->stats.rx_frame_errors++; |
1156 | kfree_skb(skb); | 1171 | kfree_skb(skb); |
@@ -1179,7 +1194,6 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, | |||
1179 | skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG; | 1194 | skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG; |
1180 | } | 1195 | } |
1181 | 1196 | ||
1182 | skb_reset_network_header(skb); | ||
1183 | skb_probe_transport_header(skb, 0); | 1197 | skb_probe_transport_header(skb, 0); |
1184 | 1198 | ||
1185 | rxhash = skb_get_hash(skb); | 1199 | rxhash = skb_get_hash(skb); |
@@ -1251,8 +1265,6 @@ static ssize_t tun_put_user(struct tun_struct *tun, | |||
1251 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4; | 1265 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4; |
1252 | else if (sinfo->gso_type & SKB_GSO_TCPV6) | 1266 | else if (sinfo->gso_type & SKB_GSO_TCPV6) |
1253 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; | 1267 | gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; |
1254 | else if (sinfo->gso_type & SKB_GSO_UDP) | ||
1255 | gso.gso_type = VIRTIO_NET_HDR_GSO_UDP; | ||
1256 | else { | 1268 | else { |
1257 | pr_err("unexpected GSO type: " | 1269 | pr_err("unexpected GSO type: " |
1258 | "0x%x, gso_size %d, hdr_len %d\n", | 1270 | "0x%x, gso_size %d, hdr_len %d\n", |
@@ -1762,11 +1774,6 @@ static int set_offload(struct tun_struct *tun, unsigned long arg) | |||
1762 | features |= NETIF_F_TSO6; | 1774 | features |= NETIF_F_TSO6; |
1763 | arg &= ~(TUN_F_TSO4|TUN_F_TSO6); | 1775 | arg &= ~(TUN_F_TSO4|TUN_F_TSO6); |
1764 | } | 1776 | } |
1765 | |||
1766 | if (arg & TUN_F_UFO) { | ||
1767 | features |= NETIF_F_UFO; | ||
1768 | arg &= ~TUN_F_UFO; | ||
1769 | } | ||
1770 | } | 1777 | } |
1771 | 1778 | ||
1772 | /* This gives the user a way to test for new features in future by | 1779 | /* This gives the user a way to test for new features in future by |
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index be4275721039..e6338c16081a 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c | |||
@@ -937,6 +937,7 @@ static int ax88179_set_mac_addr(struct net_device *net, void *p) | |||
937 | { | 937 | { |
938 | struct usbnet *dev = netdev_priv(net); | 938 | struct usbnet *dev = netdev_priv(net); |
939 | struct sockaddr *addr = p; | 939 | struct sockaddr *addr = p; |
940 | int ret; | ||
940 | 941 | ||
941 | if (netif_running(net)) | 942 | if (netif_running(net)) |
942 | return -EBUSY; | 943 | return -EBUSY; |
@@ -946,8 +947,12 @@ static int ax88179_set_mac_addr(struct net_device *net, void *p) | |||
946 | memcpy(net->dev_addr, addr->sa_data, ETH_ALEN); | 947 | memcpy(net->dev_addr, addr->sa_data, ETH_ALEN); |
947 | 948 | ||
948 | /* Set the MAC address */ | 949 | /* Set the MAC address */ |
949 | return ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN, | 950 | ret = ax88179_write_cmd(dev, AX_ACCESS_MAC, AX_NODE_ID, ETH_ALEN, |
950 | ETH_ALEN, net->dev_addr); | 951 | ETH_ALEN, net->dev_addr); |
952 | if (ret < 0) | ||
953 | return ret; | ||
954 | |||
955 | return 0; | ||
951 | } | 956 | } |
952 | 957 | ||
953 | static const struct net_device_ops ax88179_netdev_ops = { | 958 | static const struct net_device_ops ax88179_netdev_ops = { |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 2a32d9167d3b..d3920b54a92c 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -67,6 +67,35 @@ static const u8 mbm_guid[16] = { | |||
67 | 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a, | 67 | 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static void usbnet_cdc_update_filter(struct usbnet *dev) | ||
71 | { | ||
72 | struct cdc_state *info = (void *) &dev->data; | ||
73 | struct usb_interface *intf = info->control; | ||
74 | |||
75 | u16 cdc_filter = | ||
76 | USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | | ||
77 | USB_CDC_PACKET_TYPE_BROADCAST; | ||
78 | |||
79 | if (dev->net->flags & IFF_PROMISC) | ||
80 | cdc_filter |= USB_CDC_PACKET_TYPE_PROMISCUOUS; | ||
81 | |||
82 | /* FIXME cdc-ether has some multicast code too, though it complains | ||
83 | * in routine cases. info->ether describes the multicast support. | ||
84 | * Implement that here, manipulating the cdc filter as needed. | ||
85 | */ | ||
86 | |||
87 | usb_control_msg(dev->udev, | ||
88 | usb_sndctrlpipe(dev->udev, 0), | ||
89 | USB_CDC_SET_ETHERNET_PACKET_FILTER, | ||
90 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
91 | cdc_filter, | ||
92 | intf->cur_altsetting->desc.bInterfaceNumber, | ||
93 | NULL, | ||
94 | 0, | ||
95 | USB_CTRL_SET_TIMEOUT | ||
96 | ); | ||
97 | } | ||
98 | |||
70 | /* probes control interface, claims data interface, collects the bulk | 99 | /* probes control interface, claims data interface, collects the bulk |
71 | * endpoints, activates data interface (if needed), maybe sets MTU. | 100 | * endpoints, activates data interface (if needed), maybe sets MTU. |
72 | * all pure cdc, except for certain firmware workarounds, and knowing | 101 | * all pure cdc, except for certain firmware workarounds, and knowing |
@@ -347,16 +376,8 @@ next_desc: | |||
347 | * don't do reset all the way. So the packet filter should | 376 | * don't do reset all the way. So the packet filter should |
348 | * be set to a sane initial value. | 377 | * be set to a sane initial value. |
349 | */ | 378 | */ |
350 | usb_control_msg(dev->udev, | 379 | usbnet_cdc_update_filter(dev); |
351 | usb_sndctrlpipe(dev->udev, 0), | 380 | |
352 | USB_CDC_SET_ETHERNET_PACKET_FILTER, | ||
353 | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||
354 | USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | USB_CDC_PACKET_TYPE_BROADCAST, | ||
355 | intf->cur_altsetting->desc.bInterfaceNumber, | ||
356 | NULL, | ||
357 | 0, | ||
358 | USB_CTRL_SET_TIMEOUT | ||
359 | ); | ||
360 | return 0; | 381 | return 0; |
361 | 382 | ||
362 | bad_desc: | 383 | bad_desc: |
@@ -468,10 +489,6 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
468 | return status; | 489 | return status; |
469 | } | 490 | } |
470 | 491 | ||
471 | /* FIXME cdc-ether has some multicast code too, though it complains | ||
472 | * in routine cases. info->ether describes the multicast support. | ||
473 | * Implement that here, manipulating the cdc filter as needed. | ||
474 | */ | ||
475 | return 0; | 492 | return 0; |
476 | } | 493 | } |
477 | EXPORT_SYMBOL_GPL(usbnet_cdc_bind); | 494 | EXPORT_SYMBOL_GPL(usbnet_cdc_bind); |
@@ -482,6 +499,7 @@ static const struct driver_info cdc_info = { | |||
482 | .bind = usbnet_cdc_bind, | 499 | .bind = usbnet_cdc_bind, |
483 | .unbind = usbnet_cdc_unbind, | 500 | .unbind = usbnet_cdc_unbind, |
484 | .status = usbnet_cdc_status, | 501 | .status = usbnet_cdc_status, |
502 | .set_rx_mode = usbnet_cdc_update_filter, | ||
485 | .manage_power = usbnet_manage_power, | 503 | .manage_power = usbnet_manage_power, |
486 | }; | 504 | }; |
487 | 505 | ||
@@ -491,6 +509,7 @@ static const struct driver_info wwan_info = { | |||
491 | .bind = usbnet_cdc_bind, | 509 | .bind = usbnet_cdc_bind, |
492 | .unbind = usbnet_cdc_unbind, | 510 | .unbind = usbnet_cdc_unbind, |
493 | .status = usbnet_cdc_status, | 511 | .status = usbnet_cdc_status, |
512 | .set_rx_mode = usbnet_cdc_update_filter, | ||
494 | .manage_power = usbnet_manage_power, | 513 | .manage_power = usbnet_manage_power, |
495 | }; | 514 | }; |
496 | 515 | ||
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index e3d84c322e4e..c6554c7a8147 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -1162,6 +1162,9 @@ static void intr_callback(struct urb *urb) | |||
1162 | case -ESHUTDOWN: | 1162 | case -ESHUTDOWN: |
1163 | netif_device_detach(tp->netdev); | 1163 | netif_device_detach(tp->netdev); |
1164 | case -ENOENT: | 1164 | case -ENOENT: |
1165 | case -EPROTO: | ||
1166 | netif_info(tp, intr, tp->netdev, | ||
1167 | "Stop submitting intr, status %d\n", status); | ||
1165 | return; | 1168 | return; |
1166 | case -EOVERFLOW: | 1169 | case -EOVERFLOW: |
1167 | netif_info(tp, intr, tp->netdev, "intr status -EOVERFLOW\n"); | 1170 | netif_info(tp, intr, tp->netdev, "intr status -EOVERFLOW\n"); |
@@ -2891,6 +2894,9 @@ static int rtl8152_open(struct net_device *netdev) | |||
2891 | if (res) | 2894 | if (res) |
2892 | goto out; | 2895 | goto out; |
2893 | 2896 | ||
2897 | /* set speed to 0 to avoid autoresume try to submit rx */ | ||
2898 | tp->speed = 0; | ||
2899 | |||
2894 | res = usb_autopm_get_interface(tp->intf); | 2900 | res = usb_autopm_get_interface(tp->intf); |
2895 | if (res < 0) { | 2901 | if (res < 0) { |
2896 | free_all_mem(tp); | 2902 | free_all_mem(tp); |
@@ -2904,6 +2910,8 @@ static int rtl8152_open(struct net_device *netdev) | |||
2904 | clear_bit(WORK_ENABLE, &tp->flags); | 2910 | clear_bit(WORK_ENABLE, &tp->flags); |
2905 | usb_kill_urb(tp->intr_urb); | 2911 | usb_kill_urb(tp->intr_urb); |
2906 | cancel_delayed_work_sync(&tp->schedule); | 2912 | cancel_delayed_work_sync(&tp->schedule); |
2913 | |||
2914 | /* disable the tx/rx, if the workqueue has enabled them. */ | ||
2907 | if (tp->speed & LINK_STATUS) | 2915 | if (tp->speed & LINK_STATUS) |
2908 | tp->rtl_ops.disable(tp); | 2916 | tp->rtl_ops.disable(tp); |
2909 | } | 2917 | } |
@@ -2955,10 +2963,7 @@ static int rtl8152_close(struct net_device *netdev) | |||
2955 | * be disable when autoresume occurs, because the | 2963 | * be disable when autoresume occurs, because the |
2956 | * netif_running() would be false. | 2964 | * netif_running() would be false. |
2957 | */ | 2965 | */ |
2958 | if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { | 2966 | rtl_runtime_suspend_enable(tp, false); |
2959 | rtl_runtime_suspend_enable(tp, false); | ||
2960 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); | ||
2961 | } | ||
2962 | 2967 | ||
2963 | tasklet_disable(&tp->tl); | 2968 | tasklet_disable(&tp->tl); |
2964 | tp->rtl_ops.down(tp); | 2969 | tp->rtl_ops.down(tp); |
@@ -3205,7 +3210,7 @@ static int rtl8152_suspend(struct usb_interface *intf, pm_message_t message) | |||
3205 | netif_device_detach(netdev); | 3210 | netif_device_detach(netdev); |
3206 | } | 3211 | } |
3207 | 3212 | ||
3208 | if (netif_running(netdev)) { | 3213 | if (netif_running(netdev) && test_bit(WORK_ENABLE, &tp->flags)) { |
3209 | clear_bit(WORK_ENABLE, &tp->flags); | 3214 | clear_bit(WORK_ENABLE, &tp->flags); |
3210 | usb_kill_urb(tp->intr_urb); | 3215 | usb_kill_urb(tp->intr_urb); |
3211 | tasklet_disable(&tp->tl); | 3216 | tasklet_disable(&tp->tl); |
@@ -3253,6 +3258,8 @@ static int rtl8152_resume(struct usb_interface *intf) | |||
3253 | set_bit(WORK_ENABLE, &tp->flags); | 3258 | set_bit(WORK_ENABLE, &tp->flags); |
3254 | } | 3259 | } |
3255 | usb_submit_urb(tp->intr_urb, GFP_KERNEL); | 3260 | usb_submit_urb(tp->intr_urb, GFP_KERNEL); |
3261 | } else if (test_bit(SELECTIVE_SUSPEND, &tp->flags)) { | ||
3262 | clear_bit(SELECTIVE_SUSPEND, &tp->flags); | ||
3256 | } | 3263 | } |
3257 | 3264 | ||
3258 | mutex_unlock(&tp->control); | 3265 | mutex_unlock(&tp->control); |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 20615bbd693b..3a6770a65d78 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1052,6 +1052,21 @@ static void __handle_link_change(struct usbnet *dev) | |||
1052 | clear_bit(EVENT_LINK_CHANGE, &dev->flags); | 1052 | clear_bit(EVENT_LINK_CHANGE, &dev->flags); |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | static void usbnet_set_rx_mode(struct net_device *net) | ||
1056 | { | ||
1057 | struct usbnet *dev = netdev_priv(net); | ||
1058 | |||
1059 | usbnet_defer_kevent(dev, EVENT_SET_RX_MODE); | ||
1060 | } | ||
1061 | |||
1062 | static void __handle_set_rx_mode(struct usbnet *dev) | ||
1063 | { | ||
1064 | if (dev->driver_info->set_rx_mode) | ||
1065 | (dev->driver_info->set_rx_mode)(dev); | ||
1066 | |||
1067 | clear_bit(EVENT_SET_RX_MODE, &dev->flags); | ||
1068 | } | ||
1069 | |||
1055 | /* work that cannot be done in interrupt context uses keventd. | 1070 | /* work that cannot be done in interrupt context uses keventd. |
1056 | * | 1071 | * |
1057 | * NOTE: with 2.5 we could do more of this using completion callbacks, | 1072 | * NOTE: with 2.5 we could do more of this using completion callbacks, |
@@ -1157,6 +1172,10 @@ skip_reset: | |||
1157 | if (test_bit (EVENT_LINK_CHANGE, &dev->flags)) | 1172 | if (test_bit (EVENT_LINK_CHANGE, &dev->flags)) |
1158 | __handle_link_change(dev); | 1173 | __handle_link_change(dev); |
1159 | 1174 | ||
1175 | if (test_bit (EVENT_SET_RX_MODE, &dev->flags)) | ||
1176 | __handle_set_rx_mode(dev); | ||
1177 | |||
1178 | |||
1160 | if (dev->flags) | 1179 | if (dev->flags) |
1161 | netdev_dbg(dev->net, "kevent done, flags = 0x%lx\n", dev->flags); | 1180 | netdev_dbg(dev->net, "kevent done, flags = 0x%lx\n", dev->flags); |
1162 | } | 1181 | } |
@@ -1525,6 +1544,7 @@ static const struct net_device_ops usbnet_netdev_ops = { | |||
1525 | .ndo_stop = usbnet_stop, | 1544 | .ndo_stop = usbnet_stop, |
1526 | .ndo_start_xmit = usbnet_start_xmit, | 1545 | .ndo_start_xmit = usbnet_start_xmit, |
1527 | .ndo_tx_timeout = usbnet_tx_timeout, | 1546 | .ndo_tx_timeout = usbnet_tx_timeout, |
1547 | .ndo_set_rx_mode = usbnet_set_rx_mode, | ||
1528 | .ndo_change_mtu = usbnet_change_mtu, | 1548 | .ndo_change_mtu = usbnet_change_mtu, |
1529 | .ndo_set_mac_address = eth_mac_addr, | 1549 | .ndo_set_mac_address = eth_mac_addr, |
1530 | .ndo_validate_addr = eth_validate_addr, | 1550 | .ndo_validate_addr = eth_validate_addr, |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index d75256bd1a6a..ec2a8b41ed41 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -491,8 +491,17 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len) | |||
491 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; | 491 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; |
492 | break; | 492 | break; |
493 | case VIRTIO_NET_HDR_GSO_UDP: | 493 | case VIRTIO_NET_HDR_GSO_UDP: |
494 | { | ||
495 | static bool warned; | ||
496 | |||
497 | if (!warned) { | ||
498 | warned = true; | ||
499 | netdev_warn(dev, | ||
500 | "host using disabled UFO feature; please fix it\n"); | ||
501 | } | ||
494 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | 502 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; |
495 | break; | 503 | break; |
504 | } | ||
496 | case VIRTIO_NET_HDR_GSO_TCPV6: | 505 | case VIRTIO_NET_HDR_GSO_TCPV6: |
497 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; | 506 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; |
498 | break; | 507 | break; |
@@ -881,8 +890,6 @@ static int xmit_skb(struct send_queue *sq, struct sk_buff *skb) | |||
881 | hdr->hdr.gso_type = VIRTIO_NET_HDR_GSO_TCPV4; | 890 | hdr->hdr.gso_type = VIRTIO_NET_HDR_GSO_TCPV4; |
882 | else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) | 891 | else if (skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6) |
883 | hdr->hdr.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; | 892 | hdr->hdr.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; |
884 | else if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP) | ||
885 | hdr->hdr.gso_type = VIRTIO_NET_HDR_GSO_UDP; | ||
886 | else | 893 | else |
887 | BUG(); | 894 | BUG(); |
888 | if (skb_shinfo(skb)->gso_type & SKB_GSO_TCP_ECN) | 895 | if (skb_shinfo(skb)->gso_type & SKB_GSO_TCP_ECN) |
@@ -1705,7 +1712,7 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
1705 | dev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST; | 1712 | dev->features |= NETIF_F_HW_CSUM|NETIF_F_SG|NETIF_F_FRAGLIST; |
1706 | 1713 | ||
1707 | if (virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) { | 1714 | if (virtio_has_feature(vdev, VIRTIO_NET_F_GSO)) { |
1708 | dev->hw_features |= NETIF_F_TSO | NETIF_F_UFO | 1715 | dev->hw_features |= NETIF_F_TSO |
1709 | | NETIF_F_TSO_ECN | NETIF_F_TSO6; | 1716 | | NETIF_F_TSO_ECN | NETIF_F_TSO6; |
1710 | } | 1717 | } |
1711 | /* Individual feature bits: what can host handle? */ | 1718 | /* Individual feature bits: what can host handle? */ |
@@ -1715,11 +1722,9 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
1715 | dev->hw_features |= NETIF_F_TSO6; | 1722 | dev->hw_features |= NETIF_F_TSO6; |
1716 | if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN)) | 1723 | if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_ECN)) |
1717 | dev->hw_features |= NETIF_F_TSO_ECN; | 1724 | dev->hw_features |= NETIF_F_TSO_ECN; |
1718 | if (virtio_has_feature(vdev, VIRTIO_NET_F_HOST_UFO)) | ||
1719 | dev->hw_features |= NETIF_F_UFO; | ||
1720 | 1725 | ||
1721 | if (gso) | 1726 | if (gso) |
1722 | dev->features |= dev->hw_features & (NETIF_F_ALL_TSO|NETIF_F_UFO); | 1727 | dev->features |= dev->hw_features & NETIF_F_ALL_TSO; |
1723 | /* (!csum && gso) case will be fixed by register_netdev() */ | 1728 | /* (!csum && gso) case will be fixed by register_netdev() */ |
1724 | } | 1729 | } |
1725 | if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_CSUM)) | 1730 | if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_CSUM)) |
@@ -1757,8 +1762,7 @@ static int virtnet_probe(struct virtio_device *vdev) | |||
1757 | /* If we can receive ANY GSO packets, we must allocate large ones. */ | 1762 | /* If we can receive ANY GSO packets, we must allocate large ones. */ |
1758 | if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || | 1763 | if (virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO4) || |
1759 | virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) || | 1764 | virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_TSO6) || |
1760 | virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN) || | 1765 | virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_ECN)) |
1761 | virtio_has_feature(vdev, VIRTIO_NET_F_GUEST_UFO)) | ||
1762 | vi->big_packets = true; | 1766 | vi->big_packets = true; |
1763 | 1767 | ||
1764 | if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) | 1768 | if (virtio_has_feature(vdev, VIRTIO_NET_F_MRG_RXBUF)) |
@@ -1952,9 +1956,9 @@ static struct virtio_device_id id_table[] = { | |||
1952 | static unsigned int features[] = { | 1956 | static unsigned int features[] = { |
1953 | VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, | 1957 | VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, |
1954 | VIRTIO_NET_F_GSO, VIRTIO_NET_F_MAC, | 1958 | VIRTIO_NET_F_GSO, VIRTIO_NET_F_MAC, |
1955 | VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, | 1959 | VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_TSO6, |
1956 | VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, | 1960 | VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, |
1957 | VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, | 1961 | VIRTIO_NET_F_GUEST_ECN, |
1958 | VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, | 1962 | VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, |
1959 | VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, | 1963 | VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, |
1960 | VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, | 1964 | VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, |
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index e5ba6faf3281..86907e5ba6ca 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h | |||
@@ -80,6 +80,7 @@ struct reg_dmn_pair_mapping { | |||
80 | 80 | ||
81 | struct ath_regulatory { | 81 | struct ath_regulatory { |
82 | char alpha2[2]; | 82 | char alpha2[2]; |
83 | enum nl80211_dfs_regions region; | ||
83 | u16 country_code; | 84 | u16 country_code; |
84 | u16 max_power_level; | 85 | u16 max_power_level; |
85 | u16 current_rd; | 86 | u16 current_rd; |
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c index c6dd7f1fed65..33b0c7aef2ea 100644 --- a/drivers/net/wireless/ath/ath9k/common.c +++ b/drivers/net/wireless/ath/ath9k/common.c | |||
@@ -368,11 +368,11 @@ void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow, | |||
368 | { | 368 | { |
369 | struct ath_regulatory *reg = ath9k_hw_regulatory(ah); | 369 | struct ath_regulatory *reg = ath9k_hw_regulatory(ah); |
370 | 370 | ||
371 | if (reg->power_limit != new_txpow) { | 371 | if (reg->power_limit != new_txpow) |
372 | ath9k_hw_set_txpowerlimit(ah, new_txpow, false); | 372 | ath9k_hw_set_txpowerlimit(ah, new_txpow, false); |
373 | /* read back in case value is clamped */ | 373 | |
374 | *txpower = reg->max_power_level; | 374 | /* read back in case value is clamped */ |
375 | } | 375 | *txpower = reg->max_power_level; |
376 | } | 376 | } |
377 | EXPORT_SYMBOL(ath9k_cmn_update_txpow); | 377 | EXPORT_SYMBOL(ath9k_cmn_update_txpow); |
378 | 378 | ||
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 46f20a309b5f..5c45e787814e 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -455,7 +455,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf, | |||
455 | "%2d %2x %1x %2x %2x\n", | 455 | "%2d %2x %1x %2x %2x\n", |
456 | i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset, | 456 | i, (*qcuBase & (0x7 << qcuOffset)) >> qcuOffset, |
457 | (*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset + 3), | 457 | (*qcuBase & (0x8 << qcuOffset)) >> (qcuOffset + 3), |
458 | val[2] & (0x7 << (i * 3)) >> (i * 3), | 458 | (val[2] & (0x7 << (i * 3))) >> (i * 3), |
459 | (*dcuBase & (0x1f << dcuOffset)) >> dcuOffset); | 459 | (*dcuBase & (0x1f << dcuOffset)) >> dcuOffset); |
460 | } | 460 | } |
461 | 461 | ||
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 156a944134dc..3bd030494986 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -734,6 +734,32 @@ static const struct ieee80211_iface_combination if_comb[] = { | |||
734 | #endif | 734 | #endif |
735 | }; | 735 | }; |
736 | 736 | ||
737 | #ifdef CONFIG_ATH9K_CHANNEL_CONTEXT | ||
738 | static void ath9k_set_mcc_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | ||
739 | { | ||
740 | struct ath_hw *ah = sc->sc_ah; | ||
741 | struct ath_common *common = ath9k_hw_common(ah); | ||
742 | |||
743 | if (!ath9k_is_chanctx_enabled()) | ||
744 | return; | ||
745 | |||
746 | hw->flags |= IEEE80211_HW_QUEUE_CONTROL; | ||
747 | hw->queues = ATH9K_NUM_TX_QUEUES; | ||
748 | hw->offchannel_tx_hw_queue = hw->queues - 1; | ||
749 | hw->wiphy->interface_modes &= ~ BIT(NL80211_IFTYPE_WDS); | ||
750 | hw->wiphy->iface_combinations = if_comb_multi; | ||
751 | hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb_multi); | ||
752 | hw->wiphy->max_scan_ssids = 255; | ||
753 | hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; | ||
754 | hw->wiphy->max_remain_on_channel_duration = 10000; | ||
755 | hw->chanctx_data_size = sizeof(void *); | ||
756 | hw->extra_beacon_tailroom = | ||
757 | sizeof(struct ieee80211_p2p_noa_attr) + 9; | ||
758 | |||
759 | ath_dbg(common, CHAN_CTX, "Use channel contexts\n"); | ||
760 | } | ||
761 | #endif /* CONFIG_ATH9K_CHANNEL_CONTEXT */ | ||
762 | |||
737 | static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | 763 | static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) |
738 | { | 764 | { |
739 | struct ath_hw *ah = sc->sc_ah; | 765 | struct ath_hw *ah = sc->sc_ah; |
@@ -746,7 +772,6 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
746 | IEEE80211_HW_SPECTRUM_MGMT | | 772 | IEEE80211_HW_SPECTRUM_MGMT | |
747 | IEEE80211_HW_REPORTS_TX_ACK_STATUS | | 773 | IEEE80211_HW_REPORTS_TX_ACK_STATUS | |
748 | IEEE80211_HW_SUPPORTS_RC_TABLE | | 774 | IEEE80211_HW_SUPPORTS_RC_TABLE | |
749 | IEEE80211_HW_QUEUE_CONTROL | | ||
750 | IEEE80211_HW_SUPPORTS_HT_CCK_RATES; | 775 | IEEE80211_HW_SUPPORTS_HT_CCK_RATES; |
751 | 776 | ||
752 | if (ath9k_ps_enable) | 777 | if (ath9k_ps_enable) |
@@ -781,24 +806,6 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
781 | hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); | 806 | hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); |
782 | } | 807 | } |
783 | 808 | ||
784 | #ifdef CONFIG_ATH9K_CHANNEL_CONTEXT | ||
785 | |||
786 | if (ath9k_is_chanctx_enabled()) { | ||
787 | hw->wiphy->interface_modes &= ~ BIT(NL80211_IFTYPE_WDS); | ||
788 | hw->wiphy->iface_combinations = if_comb_multi; | ||
789 | hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb_multi); | ||
790 | hw->wiphy->max_scan_ssids = 255; | ||
791 | hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN; | ||
792 | hw->wiphy->max_remain_on_channel_duration = 10000; | ||
793 | hw->chanctx_data_size = sizeof(void *); | ||
794 | hw->extra_beacon_tailroom = | ||
795 | sizeof(struct ieee80211_p2p_noa_attr) + 9; | ||
796 | |||
797 | ath_dbg(common, CHAN_CTX, "Use channel contexts\n"); | ||
798 | } | ||
799 | |||
800 | #endif /* CONFIG_ATH9K_CHANNEL_CONTEXT */ | ||
801 | |||
802 | hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; | 809 | hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; |
803 | 810 | ||
804 | hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; | 811 | hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; |
@@ -808,12 +815,7 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
808 | hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; | 815 | hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; |
809 | hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; | 816 | hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; |
810 | 817 | ||
811 | /* allow 4 queues per channel context + | 818 | hw->queues = 4; |
812 | * 1 cab queue + 1 offchannel tx queue | ||
813 | */ | ||
814 | hw->queues = ATH9K_NUM_TX_QUEUES; | ||
815 | /* last queue for offchannel */ | ||
816 | hw->offchannel_tx_hw_queue = hw->queues - 1; | ||
817 | hw->max_rates = 4; | 819 | hw->max_rates = 4; |
818 | hw->max_listen_interval = 10; | 820 | hw->max_listen_interval = 10; |
819 | hw->max_rate_tries = 10; | 821 | hw->max_rate_tries = 10; |
@@ -837,6 +839,9 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
837 | hw->wiphy->bands[IEEE80211_BAND_5GHZ] = | 839 | hw->wiphy->bands[IEEE80211_BAND_5GHZ] = |
838 | &common->sbands[IEEE80211_BAND_5GHZ]; | 840 | &common->sbands[IEEE80211_BAND_5GHZ]; |
839 | 841 | ||
842 | #ifdef CONFIG_ATH9K_CHANNEL_CONTEXT | ||
843 | ath9k_set_mcc_capab(sc, hw); | ||
844 | #endif | ||
840 | ath9k_init_wow(hw); | 845 | ath9k_init_wow(hw); |
841 | ath9k_cmn_reload_chainmask(ah); | 846 | ath9k_cmn_reload_chainmask(ah); |
842 | 847 | ||
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 6f6a974f7fdb..30c66dfcd7a0 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1162,6 +1162,9 @@ static void ath9k_assign_hw_queues(struct ieee80211_hw *hw, | |||
1162 | { | 1162 | { |
1163 | int i; | 1163 | int i; |
1164 | 1164 | ||
1165 | if (!ath9k_is_chanctx_enabled()) | ||
1166 | return; | ||
1167 | |||
1165 | for (i = 0; i < IEEE80211_NUM_ACS; i++) | 1168 | for (i = 0; i < IEEE80211_NUM_ACS; i++) |
1166 | vif->hw_queue[i] = i; | 1169 | vif->hw_queue[i] = i; |
1167 | 1170 | ||
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 493a183d0aaf..d6e54a3c88f6 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -169,7 +169,10 @@ static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, | |||
169 | 169 | ||
170 | if (txq->stopped && | 170 | if (txq->stopped && |
171 | txq->pending_frames < sc->tx.txq_max_pending[q]) { | 171 | txq->pending_frames < sc->tx.txq_max_pending[q]) { |
172 | ieee80211_wake_queue(sc->hw, info->hw_queue); | 172 | if (ath9k_is_chanctx_enabled()) |
173 | ieee80211_wake_queue(sc->hw, info->hw_queue); | ||
174 | else | ||
175 | ieee80211_wake_queue(sc->hw, q); | ||
173 | txq->stopped = false; | 176 | txq->stopped = false; |
174 | } | 177 | } |
175 | } | 178 | } |
@@ -2247,7 +2250,10 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
2247 | fi->txq = q; | 2250 | fi->txq = q; |
2248 | if (++txq->pending_frames > sc->tx.txq_max_pending[q] && | 2251 | if (++txq->pending_frames > sc->tx.txq_max_pending[q] && |
2249 | !txq->stopped) { | 2252 | !txq->stopped) { |
2250 | ieee80211_stop_queue(sc->hw, info->hw_queue); | 2253 | if (ath9k_is_chanctx_enabled()) |
2254 | ieee80211_stop_queue(sc->hw, info->hw_queue); | ||
2255 | else | ||
2256 | ieee80211_stop_queue(sc->hw, q); | ||
2251 | txq->stopped = true; | 2257 | txq->stopped = true; |
2252 | } | 2258 | } |
2253 | } | 2259 | } |
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c index 415393dfb6fc..06ea6cc9e30a 100644 --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c | |||
@@ -515,6 +515,7 @@ void ath_reg_notifier_apply(struct wiphy *wiphy, | |||
515 | if (!request) | 515 | if (!request) |
516 | return; | 516 | return; |
517 | 517 | ||
518 | reg->region = request->dfs_region; | ||
518 | switch (request->initiator) { | 519 | switch (request->initiator) { |
519 | case NL80211_REGDOM_SET_BY_CORE: | 520 | case NL80211_REGDOM_SET_BY_CORE: |
520 | /* | 521 | /* |
@@ -779,6 +780,19 @@ u32 ath_regd_get_band_ctl(struct ath_regulatory *reg, | |||
779 | return SD_NO_CTL; | 780 | return SD_NO_CTL; |
780 | } | 781 | } |
781 | 782 | ||
783 | if (ath_regd_get_eepromRD(reg) == CTRY_DEFAULT) { | ||
784 | switch (reg->region) { | ||
785 | case NL80211_DFS_FCC: | ||
786 | return CTL_FCC; | ||
787 | case NL80211_DFS_ETSI: | ||
788 | return CTL_ETSI; | ||
789 | case NL80211_DFS_JP: | ||
790 | return CTL_MKK; | ||
791 | default: | ||
792 | break; | ||
793 | } | ||
794 | } | ||
795 | |||
782 | switch (band) { | 796 | switch (band) { |
783 | case IEEE80211_BAND_2GHZ: | 797 | case IEEE80211_BAND_2GHZ: |
784 | return reg->regpair->reg_2ghz_ctl; | 798 | return reg->regpair->reg_2ghz_ctl; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index f55f625fd06b..d20d4e6f391a 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -670,7 +670,6 @@ static int brcmf_sdio_get_fwnames(struct brcmf_chip *ci, | |||
670 | struct brcmf_sdio_dev *sdiodev) | 670 | struct brcmf_sdio_dev *sdiodev) |
671 | { | 671 | { |
672 | int i; | 672 | int i; |
673 | uint fw_len, nv_len; | ||
674 | char end; | 673 | char end; |
675 | 674 | ||
676 | for (i = 0; i < ARRAY_SIZE(brcmf_fwname_data); i++) { | 675 | for (i = 0; i < ARRAY_SIZE(brcmf_fwname_data); i++) { |
@@ -684,25 +683,25 @@ static int brcmf_sdio_get_fwnames(struct brcmf_chip *ci, | |||
684 | return -ENODEV; | 683 | return -ENODEV; |
685 | } | 684 | } |
686 | 685 | ||
687 | fw_len = sizeof(sdiodev->fw_name) - 1; | ||
688 | nv_len = sizeof(sdiodev->nvram_name) - 1; | ||
689 | /* check if firmware path is provided by module parameter */ | 686 | /* check if firmware path is provided by module parameter */ |
690 | if (brcmf_firmware_path[0] != '\0') { | 687 | if (brcmf_firmware_path[0] != '\0') { |
691 | strncpy(sdiodev->fw_name, brcmf_firmware_path, fw_len); | 688 | strlcpy(sdiodev->fw_name, brcmf_firmware_path, |
692 | strncpy(sdiodev->nvram_name, brcmf_firmware_path, nv_len); | 689 | sizeof(sdiodev->fw_name)); |
693 | fw_len -= strlen(sdiodev->fw_name); | 690 | strlcpy(sdiodev->nvram_name, brcmf_firmware_path, |
694 | nv_len -= strlen(sdiodev->nvram_name); | 691 | sizeof(sdiodev->nvram_name)); |
695 | 692 | ||
696 | end = brcmf_firmware_path[strlen(brcmf_firmware_path) - 1]; | 693 | end = brcmf_firmware_path[strlen(brcmf_firmware_path) - 1]; |
697 | if (end != '/') { | 694 | if (end != '/') { |
698 | strncat(sdiodev->fw_name, "/", fw_len); | 695 | strlcat(sdiodev->fw_name, "/", |
699 | strncat(sdiodev->nvram_name, "/", nv_len); | 696 | sizeof(sdiodev->fw_name)); |
700 | fw_len--; | 697 | strlcat(sdiodev->nvram_name, "/", |
701 | nv_len--; | 698 | sizeof(sdiodev->nvram_name)); |
702 | } | 699 | } |
703 | } | 700 | } |
704 | strncat(sdiodev->fw_name, brcmf_fwname_data[i].bin, fw_len); | 701 | strlcat(sdiodev->fw_name, brcmf_fwname_data[i].bin, |
705 | strncat(sdiodev->nvram_name, brcmf_fwname_data[i].nv, nv_len); | 702 | sizeof(sdiodev->fw_name)); |
703 | strlcat(sdiodev->nvram_name, brcmf_fwname_data[i].nv, | ||
704 | sizeof(sdiodev->nvram_name)); | ||
706 | 705 | ||
707 | return 0; | 706 | return 0; |
708 | } | 707 | } |
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c index 2364a3c09b9e..cae692ff1013 100644 --- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c | |||
@@ -1095,6 +1095,7 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1095 | u32 queues, bool drop) | 1095 | u32 queues, bool drop) |
1096 | { | 1096 | { |
1097 | struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); | 1097 | struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); |
1098 | u32 scd_queues; | ||
1098 | 1099 | ||
1099 | mutex_lock(&priv->mutex); | 1100 | mutex_lock(&priv->mutex); |
1100 | IWL_DEBUG_MAC80211(priv, "enter\n"); | 1101 | IWL_DEBUG_MAC80211(priv, "enter\n"); |
@@ -1108,18 +1109,19 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
1108 | goto done; | 1109 | goto done; |
1109 | } | 1110 | } |
1110 | 1111 | ||
1111 | /* | 1112 | scd_queues = BIT(priv->cfg->base_params->num_of_queues) - 1; |
1112 | * mac80211 will not push any more frames for transmit | 1113 | scd_queues &= ~(BIT(IWL_IPAN_CMD_QUEUE_NUM) | |
1113 | * until the flush is completed | 1114 | BIT(IWL_DEFAULT_CMD_QUEUE_NUM)); |
1114 | */ | 1115 | |
1115 | if (drop) { | 1116 | if (vif) |
1116 | IWL_DEBUG_MAC80211(priv, "send flush command\n"); | 1117 | scd_queues &= ~BIT(vif->hw_queue[IEEE80211_AC_VO]); |
1117 | if (iwlagn_txfifo_flush(priv, 0)) { | 1118 | |
1118 | IWL_ERR(priv, "flush request fail\n"); | 1119 | IWL_DEBUG_TX_QUEUES(priv, "Flushing SCD queues: 0x%x\n", scd_queues); |
1119 | goto done; | 1120 | if (iwlagn_txfifo_flush(priv, scd_queues)) { |
1120 | } | 1121 | IWL_ERR(priv, "flush request fail\n"); |
1122 | goto done; | ||
1121 | } | 1123 | } |
1122 | IWL_DEBUG_MAC80211(priv, "wait transmit/flush all frames\n"); | 1124 | IWL_DEBUG_TX_QUEUES(priv, "wait transmit/flush all frames\n"); |
1123 | iwl_trans_wait_tx_queue_empty(priv->trans, 0xffffffff); | 1125 | iwl_trans_wait_tx_queue_empty(priv->trans, 0xffffffff); |
1124 | done: | 1126 | done: |
1125 | mutex_unlock(&priv->mutex); | 1127 | mutex_unlock(&priv->mutex); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-8000.c b/drivers/net/wireless/iwlwifi/iwl-8000.c index e4351487ca72..d2b7234b1c73 100644 --- a/drivers/net/wireless/iwlwifi/iwl-8000.c +++ b/drivers/net/wireless/iwlwifi/iwl-8000.c | |||
@@ -82,7 +82,8 @@ | |||
82 | #define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */ | 82 | #define IWL8000_TX_POWER_VERSION 0xffff /* meaningless */ |
83 | 83 | ||
84 | #define IWL8000_FW_PRE "iwlwifi-8000" | 84 | #define IWL8000_FW_PRE "iwlwifi-8000" |
85 | #define IWL8000_MODULE_FIRMWARE(api) IWL8000_FW_PRE __stringify(api) ".ucode" | 85 | #define IWL8000_MODULE_FIRMWARE(api) \ |
86 | IWL8000_FW_PRE "-" __stringify(api) ".ucode" | ||
86 | 87 | ||
87 | #define NVM_HW_SECTION_NUM_FAMILY_8000 10 | 88 | #define NVM_HW_SECTION_NUM_FAMILY_8000 10 |
88 | #define DEFAULT_NVM_FILE_FAMILY_8000 "iwl_nvm_8000.bin" | 89 | #define DEFAULT_NVM_FILE_FAMILY_8000 "iwl_nvm_8000.bin" |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 9eb85249e89c..d8fc548c0d6c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -563,6 +563,7 @@ enum iwl_trans_state { | |||
563 | * Set during transport allocation. | 563 | * Set during transport allocation. |
564 | * @hw_id_str: a string with info about HW ID. Set during transport allocation. | 564 | * @hw_id_str: a string with info about HW ID. Set during transport allocation. |
565 | * @pm_support: set to true in start_hw if link pm is supported | 565 | * @pm_support: set to true in start_hw if link pm is supported |
566 | * @ltr_enabled: set to true if the LTR is enabled | ||
566 | * @dev_cmd_pool: pool for Tx cmd allocation - for internal use only. | 567 | * @dev_cmd_pool: pool for Tx cmd allocation - for internal use only. |
567 | * The user should use iwl_trans_{alloc,free}_tx_cmd. | 568 | * The user should use iwl_trans_{alloc,free}_tx_cmd. |
568 | * @dev_cmd_headroom: room needed for the transport's private use before the | 569 | * @dev_cmd_headroom: room needed for the transport's private use before the |
@@ -589,6 +590,7 @@ struct iwl_trans { | |||
589 | u8 rx_mpdu_cmd, rx_mpdu_cmd_hdr_size; | 590 | u8 rx_mpdu_cmd, rx_mpdu_cmd_hdr_size; |
590 | 591 | ||
591 | bool pm_support; | 592 | bool pm_support; |
593 | bool ltr_enabled; | ||
592 | 594 | ||
593 | /* The following fields are internal only */ | 595 | /* The following fields are internal only */ |
594 | struct kmem_cache *dev_cmd_pool; | 596 | struct kmem_cache *dev_cmd_pool; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/coex.c b/drivers/net/wireless/iwlwifi/mvm/coex.c index 8df2021f9856..da2ffb785194 100644 --- a/drivers/net/wireless/iwlwifi/mvm/coex.c +++ b/drivers/net/wireless/iwlwifi/mvm/coex.c | |||
@@ -303,8 +303,8 @@ static const __le64 iwl_ci_mask[][3] = { | |||
303 | }; | 303 | }; |
304 | 304 | ||
305 | static const __le32 iwl_bt_mprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE] = { | 305 | static const __le32 iwl_bt_mprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE] = { |
306 | cpu_to_le32(0x28412201), | 306 | cpu_to_le32(0x2e402280), |
307 | cpu_to_le32(0x11118451), | 307 | cpu_to_le32(0x7711a751), |
308 | }; | 308 | }; |
309 | 309 | ||
310 | struct corunning_block_luts { | 310 | struct corunning_block_luts { |
diff --git a/drivers/net/wireless/iwlwifi/mvm/coex_legacy.c b/drivers/net/wireless/iwlwifi/mvm/coex_legacy.c index 585c0ab4a3ec..8a1d2f33d5b7 100644 --- a/drivers/net/wireless/iwlwifi/mvm/coex_legacy.c +++ b/drivers/net/wireless/iwlwifi/mvm/coex_legacy.c | |||
@@ -291,8 +291,8 @@ static const __le64 iwl_ci_mask[][3] = { | |||
291 | }; | 291 | }; |
292 | 292 | ||
293 | static const __le32 iwl_bt_mprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE] = { | 293 | static const __le32 iwl_bt_mprio_lut[BT_COEX_MULTI_PRIO_LUT_SIZE] = { |
294 | cpu_to_le32(0x28412201), | 294 | cpu_to_le32(0x2e402280), |
295 | cpu_to_le32(0x11118451), | 295 | cpu_to_le32(0x7711a751), |
296 | }; | 296 | }; |
297 | 297 | ||
298 | struct corunning_block_luts { | 298 | struct corunning_block_luts { |
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h index 27dd86395b39..2fd8ad4633e0 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-power.h | |||
@@ -68,13 +68,46 @@ | |||
68 | 68 | ||
69 | /* Power Management Commands, Responses, Notifications */ | 69 | /* Power Management Commands, Responses, Notifications */ |
70 | 70 | ||
71 | /** | ||
72 | * enum iwl_ltr_config_flags - masks for LTR config command flags | ||
73 | * @LTR_CFG_FLAG_FEATURE_ENABLE: Feature operational status | ||
74 | * @LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS: allow LTR change on shadow | ||
75 | * memory access | ||
76 | * @LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH: allow LTR msg send on ANY LTR | ||
77 | * reg change | ||
78 | * @LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3: allow LTR msg send on transition from | ||
79 | * D0 to D3 | ||
80 | * @LTR_CFG_FLAG_SW_SET_SHORT: fixed static short LTR register | ||
81 | * @LTR_CFG_FLAG_SW_SET_LONG: fixed static short LONG register | ||
82 | * @LTR_CFG_FLAG_DENIE_C10_ON_PD: allow going into C10 on PD | ||
83 | */ | ||
84 | enum iwl_ltr_config_flags { | ||
85 | LTR_CFG_FLAG_FEATURE_ENABLE = BIT(0), | ||
86 | LTR_CFG_FLAG_HW_DIS_ON_SHADOW_REG_ACCESS = BIT(1), | ||
87 | LTR_CFG_FLAG_HW_EN_SHRT_WR_THROUGH = BIT(2), | ||
88 | LTR_CFG_FLAG_HW_DIS_ON_D0_2_D3 = BIT(3), | ||
89 | LTR_CFG_FLAG_SW_SET_SHORT = BIT(4), | ||
90 | LTR_CFG_FLAG_SW_SET_LONG = BIT(5), | ||
91 | LTR_CFG_FLAG_DENIE_C10_ON_PD = BIT(6), | ||
92 | }; | ||
93 | |||
94 | /** | ||
95 | * struct iwl_ltr_config_cmd - configures the LTR | ||
96 | * @flags: See %enum iwl_ltr_config_flags | ||
97 | */ | ||
98 | struct iwl_ltr_config_cmd { | ||
99 | __le32 flags; | ||
100 | __le32 static_long; | ||
101 | __le32 static_short; | ||
102 | } __packed; | ||
103 | |||
71 | /* Radio LP RX Energy Threshold measured in dBm */ | 104 | /* Radio LP RX Energy Threshold measured in dBm */ |
72 | #define POWER_LPRX_RSSI_THRESHOLD 75 | 105 | #define POWER_LPRX_RSSI_THRESHOLD 75 |
73 | #define POWER_LPRX_RSSI_THRESHOLD_MAX 94 | 106 | #define POWER_LPRX_RSSI_THRESHOLD_MAX 94 |
74 | #define POWER_LPRX_RSSI_THRESHOLD_MIN 30 | 107 | #define POWER_LPRX_RSSI_THRESHOLD_MIN 30 |
75 | 108 | ||
76 | /** | 109 | /** |
77 | * enum iwl_scan_flags - masks for power table command flags | 110 | * enum iwl_power_flags - masks for power table command flags |
78 | * @POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off | 111 | * @POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off |
79 | * receiver and transmitter. '0' - does not allow. | 112 | * receiver and transmitter. '0' - does not allow. |
80 | * @POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK: '0' Driver disables power management, | 113 | * @POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK: '0' Driver disables power management, |
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api.h b/drivers/net/wireless/iwlwifi/mvm/fw-api.h index 667a92274c87..c62575d86bcd 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api.h | |||
@@ -157,6 +157,7 @@ enum { | |||
157 | /* Power - legacy power table command */ | 157 | /* Power - legacy power table command */ |
158 | POWER_TABLE_CMD = 0x77, | 158 | POWER_TABLE_CMD = 0x77, |
159 | PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78, | 159 | PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION = 0x78, |
160 | LTR_CONFIG = 0xee, | ||
160 | 161 | ||
161 | /* Thermal Throttling*/ | 162 | /* Thermal Throttling*/ |
162 | REPLY_THERMAL_MNG_BACKOFF = 0x7e, | 163 | REPLY_THERMAL_MNG_BACKOFF = 0x7e, |
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw.c b/drivers/net/wireless/iwlwifi/mvm/fw.c index 23fd711a67e4..e0d9f19650b0 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/iwlwifi/mvm/fw.c | |||
@@ -480,6 +480,15 @@ int iwl_mvm_up(struct iwl_mvm *mvm) | |||
480 | /* Initialize tx backoffs to the minimal possible */ | 480 | /* Initialize tx backoffs to the minimal possible */ |
481 | iwl_mvm_tt_tx_backoff(mvm, 0); | 481 | iwl_mvm_tt_tx_backoff(mvm, 0); |
482 | 482 | ||
483 | if (mvm->trans->ltr_enabled) { | ||
484 | struct iwl_ltr_config_cmd cmd = { | ||
485 | .flags = cpu_to_le32(LTR_CFG_FLAG_FEATURE_ENABLE), | ||
486 | }; | ||
487 | |||
488 | WARN_ON(iwl_mvm_send_cmd_pdu(mvm, LTR_CONFIG, 0, | ||
489 | sizeof(cmd), &cmd)); | ||
490 | } | ||
491 | |||
483 | ret = iwl_mvm_power_update_device(mvm); | 492 | ret = iwl_mvm_power_update_device(mvm); |
484 | if (ret) | 493 | if (ret) |
485 | goto error; | 494 | goto error; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index c7a73c68bdab..585fe5b7100f 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -526,7 +526,8 @@ static void iwl_mvm_mac_tx(struct ieee80211_hw *hw, | |||
526 | } | 526 | } |
527 | 527 | ||
528 | if (IEEE80211_SKB_CB(skb)->hw_queue == IWL_MVM_OFFCHANNEL_QUEUE && | 528 | if (IEEE80211_SKB_CB(skb)->hw_queue == IWL_MVM_OFFCHANNEL_QUEUE && |
529 | !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status)) | 529 | !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) && |
530 | !test_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) | ||
530 | goto drop; | 531 | goto drop; |
531 | 532 | ||
532 | /* treat non-bufferable MMPDUs as broadcast if sta is sleeping */ | 533 | /* treat non-bufferable MMPDUs as broadcast if sta is sleeping */ |
@@ -1734,6 +1735,13 @@ iwl_mvm_bss_info_changed_ap_ibss(struct iwl_mvm *mvm, | |||
1734 | if (changes & BSS_CHANGED_BEACON && | 1735 | if (changes & BSS_CHANGED_BEACON && |
1735 | iwl_mvm_mac_ctxt_beacon_changed(mvm, vif)) | 1736 | iwl_mvm_mac_ctxt_beacon_changed(mvm, vif)) |
1736 | IWL_WARN(mvm, "Failed updating beacon data\n"); | 1737 | IWL_WARN(mvm, "Failed updating beacon data\n"); |
1738 | |||
1739 | if (changes & BSS_CHANGED_TXPOWER) { | ||
1740 | IWL_DEBUG_CALIB(mvm, "Changing TX Power to %d\n", | ||
1741 | bss_conf->txpower); | ||
1742 | iwl_mvm_set_tx_power(mvm, vif, bss_conf->txpower); | ||
1743 | } | ||
1744 | |||
1737 | } | 1745 | } |
1738 | 1746 | ||
1739 | static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw, | 1747 | static void iwl_mvm_bss_info_changed(struct ieee80211_hw *hw, |
@@ -2367,14 +2375,19 @@ static int iwl_mvm_send_aux_roc_cmd(struct iwl_mvm *mvm, | |||
2367 | /* Set the node address */ | 2375 | /* Set the node address */ |
2368 | memcpy(aux_roc_req.node_addr, vif->addr, ETH_ALEN); | 2376 | memcpy(aux_roc_req.node_addr, vif->addr, ETH_ALEN); |
2369 | 2377 | ||
2378 | lockdep_assert_held(&mvm->mutex); | ||
2379 | |||
2380 | spin_lock_bh(&mvm->time_event_lock); | ||
2381 | |||
2382 | if (WARN_ON(te_data->id == HOT_SPOT_CMD)) { | ||
2383 | spin_unlock_bh(&mvm->time_event_lock); | ||
2384 | return -EIO; | ||
2385 | } | ||
2386 | |||
2370 | te_data->vif = vif; | 2387 | te_data->vif = vif; |
2371 | te_data->duration = duration; | 2388 | te_data->duration = duration; |
2372 | te_data->id = HOT_SPOT_CMD; | 2389 | te_data->id = HOT_SPOT_CMD; |
2373 | 2390 | ||
2374 | lockdep_assert_held(&mvm->mutex); | ||
2375 | |||
2376 | spin_lock_bh(&mvm->time_event_lock); | ||
2377 | list_add_tail(&te_data->list, &mvm->time_event_list); | ||
2378 | spin_unlock_bh(&mvm->time_event_lock); | 2391 | spin_unlock_bh(&mvm->time_event_lock); |
2379 | 2392 | ||
2380 | /* | 2393 | /* |
@@ -2430,22 +2443,23 @@ static int iwl_mvm_roc(struct ieee80211_hw *hw, | |||
2430 | IWL_DEBUG_MAC80211(mvm, "enter (%d, %d, %d)\n", channel->hw_value, | 2443 | IWL_DEBUG_MAC80211(mvm, "enter (%d, %d, %d)\n", channel->hw_value, |
2431 | duration, type); | 2444 | duration, type); |
2432 | 2445 | ||
2446 | mutex_lock(&mvm->mutex); | ||
2447 | |||
2433 | switch (vif->type) { | 2448 | switch (vif->type) { |
2434 | case NL80211_IFTYPE_STATION: | 2449 | case NL80211_IFTYPE_STATION: |
2435 | /* Use aux roc framework (HS20) */ | 2450 | /* Use aux roc framework (HS20) */ |
2436 | ret = iwl_mvm_send_aux_roc_cmd(mvm, channel, | 2451 | ret = iwl_mvm_send_aux_roc_cmd(mvm, channel, |
2437 | vif, duration); | 2452 | vif, duration); |
2438 | return ret; | 2453 | goto out_unlock; |
2439 | case NL80211_IFTYPE_P2P_DEVICE: | 2454 | case NL80211_IFTYPE_P2P_DEVICE: |
2440 | /* handle below */ | 2455 | /* handle below */ |
2441 | break; | 2456 | break; |
2442 | default: | 2457 | default: |
2443 | IWL_ERR(mvm, "vif isn't P2P_DEVICE: %d\n", vif->type); | 2458 | IWL_ERR(mvm, "vif isn't P2P_DEVICE: %d\n", vif->type); |
2444 | return -EINVAL; | 2459 | ret = -EINVAL; |
2460 | goto out_unlock; | ||
2445 | } | 2461 | } |
2446 | 2462 | ||
2447 | mutex_lock(&mvm->mutex); | ||
2448 | |||
2449 | for (i = 0; i < NUM_PHY_CTX; i++) { | 2463 | for (i = 0; i < NUM_PHY_CTX; i++) { |
2450 | phy_ctxt = &mvm->phy_ctxts[i]; | 2464 | phy_ctxt = &mvm->phy_ctxts[i]; |
2451 | if (phy_ctxt->ref == 0 || mvmvif->phy_ctxt == phy_ctxt) | 2465 | if (phy_ctxt->ref == 0 || mvmvif->phy_ctxt == phy_ctxt) |
diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c index 15aa298ee79c..48cb25a93591 100644 --- a/drivers/net/wireless/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/iwlwifi/mvm/ops.c | |||
@@ -336,6 +336,7 @@ static const char *const iwl_mvm_cmd_strings[REPLY_MAX] = { | |||
336 | CMD(DTS_MEASUREMENT_NOTIFICATION), | 336 | CMD(DTS_MEASUREMENT_NOTIFICATION), |
337 | CMD(REPLY_THERMAL_MNG_BACKOFF), | 337 | CMD(REPLY_THERMAL_MNG_BACKOFF), |
338 | CMD(MAC_PM_POWER_TABLE), | 338 | CMD(MAC_PM_POWER_TABLE), |
339 | CMD(LTR_CONFIG), | ||
339 | CMD(BT_COEX_CI), | 340 | CMD(BT_COEX_CI), |
340 | CMD(BT_COEX_UPDATE_SW_BOOST), | 341 | CMD(BT_COEX_UPDATE_SW_BOOST), |
341 | CMD(BT_COEX_UPDATE_CORUN_LUT), | 342 | CMD(BT_COEX_UPDATE_CORUN_LUT), |
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index cb85e63c20aa..b280d5d87127 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -459,7 +459,8 @@ int iwl_mvm_scan_request(struct iwl_mvm *mvm, | |||
459 | basic_ssid ? 1 : 0); | 459 | basic_ssid ? 1 : 0); |
460 | 460 | ||
461 | cmd->tx_cmd.tx_flags = cpu_to_le32(TX_CMD_FLG_SEQ_CTL | | 461 | cmd->tx_cmd.tx_flags = cpu_to_le32(TX_CMD_FLG_SEQ_CTL | |
462 | TX_CMD_FLG_BT_DIS); | 462 | 3 << TX_CMD_FLG_BT_PRIO_POS); |
463 | |||
463 | cmd->tx_cmd.sta_id = mvm->aux_sta.sta_id; | 464 | cmd->tx_cmd.sta_id = mvm->aux_sta.sta_id; |
464 | cmd->tx_cmd.life_time = cpu_to_le32(TX_CMD_LIFE_TIME_INFINITE); | 465 | cmd->tx_cmd.life_time = cpu_to_le32(TX_CMD_LIFE_TIME_INFINITE); |
465 | cmd->tx_cmd.rate_n_flags = | 466 | cmd->tx_cmd.rate_n_flags = |
diff --git a/drivers/net/wireless/iwlwifi/mvm/time-event.c b/drivers/net/wireless/iwlwifi/mvm/time-event.c index b7f9e61d14e2..6dfad230be5e 100644 --- a/drivers/net/wireless/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/iwlwifi/mvm/time-event.c | |||
@@ -305,8 +305,8 @@ static int iwl_mvm_aux_roc_te_handle_notif(struct iwl_mvm *mvm, | |||
305 | te_data->running = false; | 305 | te_data->running = false; |
306 | te_data->vif = NULL; | 306 | te_data->vif = NULL; |
307 | te_data->uid = 0; | 307 | te_data->uid = 0; |
308 | te_data->id = TE_MAX; | ||
308 | } else if (le32_to_cpu(notif->action) == TE_V2_NOTIF_HOST_EVENT_START) { | 309 | } else if (le32_to_cpu(notif->action) == TE_V2_NOTIF_HOST_EVENT_START) { |
309 | set_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status); | ||
310 | set_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status); | 310 | set_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status); |
311 | te_data->running = true; | 311 | te_data->running = true; |
312 | ieee80211_ready_on_channel(mvm->hw); /* Start TE */ | 312 | ieee80211_ready_on_channel(mvm->hw); /* Start TE */ |
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c index 1cb793a498ac..c6a517c771df 100644 --- a/drivers/net/wireless/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/iwlwifi/mvm/tx.c | |||
@@ -175,14 +175,10 @@ static void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, | |||
175 | 175 | ||
176 | /* | 176 | /* |
177 | * for data packets, rate info comes from the table inside the fw. This | 177 | * for data packets, rate info comes from the table inside the fw. This |
178 | * table is controlled by LINK_QUALITY commands. Exclude ctrl port | 178 | * table is controlled by LINK_QUALITY commands |
179 | * frames like EAPOLs which should be treated as mgmt frames. This | ||
180 | * avoids them being sent initially in high rates which increases the | ||
181 | * chances for completion of the 4-Way handshake. | ||
182 | */ | 179 | */ |
183 | 180 | ||
184 | if (ieee80211_is_data(fc) && sta && | 181 | if (ieee80211_is_data(fc) && sta) { |
185 | !(info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO)) { | ||
186 | tx_cmd->initial_rate_index = 0; | 182 | tx_cmd->initial_rate_index = 0; |
187 | tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_STA_RATE); | 183 | tx_cmd->tx_flags |= cpu_to_le32(TX_CMD_FLG_STA_RATE); |
188 | return; | 184 | return; |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 1393bac0025c..3781b029e54a 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -174,6 +174,7 @@ static void iwl_pcie_apm_config(struct iwl_trans *trans) | |||
174 | { | 174 | { |
175 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 175 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
176 | u16 lctl; | 176 | u16 lctl; |
177 | u16 cap; | ||
177 | 178 | ||
178 | /* | 179 | /* |
179 | * HW bug W/A for instability in PCIe bus L0S->L1 transition. | 180 | * HW bug W/A for instability in PCIe bus L0S->L1 transition. |
@@ -184,16 +185,17 @@ static void iwl_pcie_apm_config(struct iwl_trans *trans) | |||
184 | * power savings, even without L1. | 185 | * power savings, even without L1. |
185 | */ | 186 | */ |
186 | pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_LNKCTL, &lctl); | 187 | pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_LNKCTL, &lctl); |
187 | if (lctl & PCI_EXP_LNKCTL_ASPM_L1) { | 188 | if (lctl & PCI_EXP_LNKCTL_ASPM_L1) |
188 | /* L1-ASPM enabled; disable(!) L0S */ | ||
189 | iwl_set_bit(trans, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | 189 | iwl_set_bit(trans, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); |
190 | dev_info(trans->dev, "L1 Enabled; Disabling L0S\n"); | 190 | else |
191 | } else { | ||
192 | /* L1-ASPM disabled; enable(!) L0S */ | ||
193 | iwl_clear_bit(trans, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); | 191 | iwl_clear_bit(trans, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); |
194 | dev_info(trans->dev, "L1 Disabled; Enabling L0S\n"); | ||
195 | } | ||
196 | trans->pm_support = !(lctl & PCI_EXP_LNKCTL_ASPM_L0S); | 192 | trans->pm_support = !(lctl & PCI_EXP_LNKCTL_ASPM_L0S); |
193 | |||
194 | pcie_capability_read_word(trans_pcie->pci_dev, PCI_EXP_DEVCTL2, &cap); | ||
195 | trans->ltr_enabled = cap & PCI_EXP_DEVCTL2_LTR_EN; | ||
196 | dev_info(trans->dev, "L1 %sabled - LTR %sabled\n", | ||
197 | (lctl & PCI_EXP_LNKCTL_ASPM_L1) ? "En" : "Dis", | ||
198 | trans->ltr_enabled ? "En" : "Dis"); | ||
197 | } | 199 | } |
198 | 200 | ||
199 | /* | 201 | /* |
@@ -428,7 +430,7 @@ static int iwl_pcie_apm_stop_master(struct iwl_trans *trans) | |||
428 | ret = iwl_poll_bit(trans, CSR_RESET, | 430 | ret = iwl_poll_bit(trans, CSR_RESET, |
429 | CSR_RESET_REG_FLAG_MASTER_DISABLED, | 431 | CSR_RESET_REG_FLAG_MASTER_DISABLED, |
430 | CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); | 432 | CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); |
431 | if (ret) | 433 | if (ret < 0) |
432 | IWL_WARN(trans, "Master Disable Timed Out, 100 usec\n"); | 434 | IWL_WARN(trans, "Master Disable Timed Out, 100 usec\n"); |
433 | 435 | ||
434 | IWL_DEBUG_INFO(trans, "stop master\n"); | 436 | IWL_DEBUG_INFO(trans, "stop master\n"); |
@@ -544,7 +546,7 @@ static int iwl_pcie_prepare_card_hw(struct iwl_trans *trans) | |||
544 | msleep(25); | 546 | msleep(25); |
545 | } | 547 | } |
546 | 548 | ||
547 | IWL_DEBUG_INFO(trans, "got NIC after %d iterations\n", iter); | 549 | IWL_ERR(trans, "Couldn't prepare the card\n"); |
548 | 550 | ||
549 | return ret; | 551 | return ret; |
550 | } | 552 | } |
@@ -1043,7 +1045,7 @@ static int iwl_trans_pcie_d3_resume(struct iwl_trans *trans, | |||
1043 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, | 1045 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, |
1044 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, | 1046 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, |
1045 | 25000); | 1047 | 25000); |
1046 | if (ret) { | 1048 | if (ret < 0) { |
1047 | IWL_ERR(trans, "Failed to resume the device (mac ready)\n"); | 1049 | IWL_ERR(trans, "Failed to resume the device (mac ready)\n"); |
1048 | return ret; | 1050 | return ret; |
1049 | } | 1051 | } |
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c index 40057079ffb9..5ef5a0eeba50 100644 --- a/drivers/net/wireless/mwifiex/11n_rxreorder.c +++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c | |||
@@ -196,6 +196,7 @@ mwifiex_del_rx_reorder_entry(struct mwifiex_private *priv, | |||
196 | mwifiex_11n_dispatch_pkt_until_start_win(priv, tbl, start_win); | 196 | mwifiex_11n_dispatch_pkt_until_start_win(priv, tbl, start_win); |
197 | 197 | ||
198 | del_timer_sync(&tbl->timer_context.timer); | 198 | del_timer_sync(&tbl->timer_context.timer); |
199 | tbl->timer_context.timer_is_set = false; | ||
199 | 200 | ||
200 | spin_lock_irqsave(&priv->rx_reorder_tbl_lock, flags); | 201 | spin_lock_irqsave(&priv->rx_reorder_tbl_lock, flags); |
201 | list_del(&tbl->list); | 202 | list_del(&tbl->list); |
@@ -297,6 +298,7 @@ mwifiex_flush_data(unsigned long context) | |||
297 | (struct reorder_tmr_cnxt *) context; | 298 | (struct reorder_tmr_cnxt *) context; |
298 | int start_win, seq_num; | 299 | int start_win, seq_num; |
299 | 300 | ||
301 | ctx->timer_is_set = false; | ||
300 | seq_num = mwifiex_11n_find_last_seq_num(ctx); | 302 | seq_num = mwifiex_11n_find_last_seq_num(ctx); |
301 | 303 | ||
302 | if (seq_num < 0) | 304 | if (seq_num < 0) |
@@ -385,6 +387,7 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta, | |||
385 | 387 | ||
386 | new_node->timer_context.ptr = new_node; | 388 | new_node->timer_context.ptr = new_node; |
387 | new_node->timer_context.priv = priv; | 389 | new_node->timer_context.priv = priv; |
390 | new_node->timer_context.timer_is_set = false; | ||
388 | 391 | ||
389 | init_timer(&new_node->timer_context.timer); | 392 | init_timer(&new_node->timer_context.timer); |
390 | new_node->timer_context.timer.function = mwifiex_flush_data; | 393 | new_node->timer_context.timer.function = mwifiex_flush_data; |
@@ -399,6 +402,22 @@ mwifiex_11n_create_rx_reorder_tbl(struct mwifiex_private *priv, u8 *ta, | |||
399 | spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags); | 402 | spin_unlock_irqrestore(&priv->rx_reorder_tbl_lock, flags); |
400 | } | 403 | } |
401 | 404 | ||
405 | static void | ||
406 | mwifiex_11n_rxreorder_timer_restart(struct mwifiex_rx_reorder_tbl *tbl) | ||
407 | { | ||
408 | u32 min_flush_time; | ||
409 | |||
410 | if (tbl->win_size >= MWIFIEX_BA_WIN_SIZE_32) | ||
411 | min_flush_time = MIN_FLUSH_TIMER_15_MS; | ||
412 | else | ||
413 | min_flush_time = MIN_FLUSH_TIMER_MS; | ||
414 | |||
415 | mod_timer(&tbl->timer_context.timer, | ||
416 | jiffies + msecs_to_jiffies(min_flush_time * tbl->win_size)); | ||
417 | |||
418 | tbl->timer_context.timer_is_set = true; | ||
419 | } | ||
420 | |||
402 | /* | 421 | /* |
403 | * This function prepares command for adding a BA request. | 422 | * This function prepares command for adding a BA request. |
404 | * | 423 | * |
@@ -523,31 +542,31 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv, | |||
523 | u8 *ta, u8 pkt_type, void *payload) | 542 | u8 *ta, u8 pkt_type, void *payload) |
524 | { | 543 | { |
525 | struct mwifiex_rx_reorder_tbl *tbl; | 544 | struct mwifiex_rx_reorder_tbl *tbl; |
526 | int start_win, end_win, win_size; | 545 | int prev_start_win, start_win, end_win, win_size; |
527 | u16 pkt_index; | 546 | u16 pkt_index; |
528 | bool init_window_shift = false; | 547 | bool init_window_shift = false; |
548 | int ret = 0; | ||
529 | 549 | ||
530 | tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, ta); | 550 | tbl = mwifiex_11n_get_rx_reorder_tbl(priv, tid, ta); |
531 | if (!tbl) { | 551 | if (!tbl) { |
532 | if (pkt_type != PKT_TYPE_BAR) | 552 | if (pkt_type != PKT_TYPE_BAR) |
533 | mwifiex_11n_dispatch_pkt(priv, payload); | 553 | mwifiex_11n_dispatch_pkt(priv, payload); |
534 | return 0; | 554 | return ret; |
535 | } | 555 | } |
536 | 556 | ||
537 | if ((pkt_type == PKT_TYPE_AMSDU) && !tbl->amsdu) { | 557 | if ((pkt_type == PKT_TYPE_AMSDU) && !tbl->amsdu) { |
538 | mwifiex_11n_dispatch_pkt(priv, payload); | 558 | mwifiex_11n_dispatch_pkt(priv, payload); |
539 | return 0; | 559 | return ret; |
540 | } | 560 | } |
541 | 561 | ||
542 | start_win = tbl->start_win; | 562 | start_win = tbl->start_win; |
563 | prev_start_win = start_win; | ||
543 | win_size = tbl->win_size; | 564 | win_size = tbl->win_size; |
544 | end_win = ((start_win + win_size) - 1) & (MAX_TID_VALUE - 1); | 565 | end_win = ((start_win + win_size) - 1) & (MAX_TID_VALUE - 1); |
545 | if (tbl->flags & RXREOR_INIT_WINDOW_SHIFT) { | 566 | if (tbl->flags & RXREOR_INIT_WINDOW_SHIFT) { |
546 | init_window_shift = true; | 567 | init_window_shift = true; |
547 | tbl->flags &= ~RXREOR_INIT_WINDOW_SHIFT; | 568 | tbl->flags &= ~RXREOR_INIT_WINDOW_SHIFT; |
548 | } | 569 | } |
549 | mod_timer(&tbl->timer_context.timer, | ||
550 | jiffies + msecs_to_jiffies(MIN_FLUSH_TIMER_MS * win_size)); | ||
551 | 570 | ||
552 | if (tbl->flags & RXREOR_FORCE_NO_DROP) { | 571 | if (tbl->flags & RXREOR_FORCE_NO_DROP) { |
553 | dev_dbg(priv->adapter->dev, | 572 | dev_dbg(priv->adapter->dev, |
@@ -568,11 +587,14 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv, | |||
568 | if ((start_win + TWOPOW11) > (MAX_TID_VALUE - 1)) { | 587 | if ((start_win + TWOPOW11) > (MAX_TID_VALUE - 1)) { |
569 | if (seq_num >= ((start_win + TWOPOW11) & | 588 | if (seq_num >= ((start_win + TWOPOW11) & |
570 | (MAX_TID_VALUE - 1)) && | 589 | (MAX_TID_VALUE - 1)) && |
571 | seq_num < start_win) | 590 | seq_num < start_win) { |
572 | return -1; | 591 | ret = -1; |
592 | goto done; | ||
593 | } | ||
573 | } else if ((seq_num < start_win) || | 594 | } else if ((seq_num < start_win) || |
574 | (seq_num > (start_win + TWOPOW11))) { | 595 | (seq_num >= (start_win + TWOPOW11))) { |
575 | return -1; | 596 | ret = -1; |
597 | goto done; | ||
576 | } | 598 | } |
577 | } | 599 | } |
578 | 600 | ||
@@ -601,8 +623,10 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv, | |||
601 | else | 623 | else |
602 | pkt_index = (seq_num+MAX_TID_VALUE) - start_win; | 624 | pkt_index = (seq_num+MAX_TID_VALUE) - start_win; |
603 | 625 | ||
604 | if (tbl->rx_reorder_ptr[pkt_index]) | 626 | if (tbl->rx_reorder_ptr[pkt_index]) { |
605 | return -1; | 627 | ret = -1; |
628 | goto done; | ||
629 | } | ||
606 | 630 | ||
607 | tbl->rx_reorder_ptr[pkt_index] = payload; | 631 | tbl->rx_reorder_ptr[pkt_index] = payload; |
608 | } | 632 | } |
@@ -613,7 +637,11 @@ int mwifiex_11n_rx_reorder_pkt(struct mwifiex_private *priv, | |||
613 | */ | 637 | */ |
614 | mwifiex_11n_scan_and_dispatch(priv, tbl); | 638 | mwifiex_11n_scan_and_dispatch(priv, tbl); |
615 | 639 | ||
616 | return 0; | 640 | done: |
641 | if (!tbl->timer_context.timer_is_set || | ||
642 | prev_start_win != tbl->start_win) | ||
643 | mwifiex_11n_rxreorder_timer_restart(tbl); | ||
644 | return ret; | ||
617 | } | 645 | } |
618 | 646 | ||
619 | /* | 647 | /* |
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.h b/drivers/net/wireless/mwifiex/11n_rxreorder.h index 3a87bb0e3a62..63ecea89b4ab 100644 --- a/drivers/net/wireless/mwifiex/11n_rxreorder.h +++ b/drivers/net/wireless/mwifiex/11n_rxreorder.h | |||
@@ -21,6 +21,8 @@ | |||
21 | #define _MWIFIEX_11N_RXREORDER_H_ | 21 | #define _MWIFIEX_11N_RXREORDER_H_ |
22 | 22 | ||
23 | #define MIN_FLUSH_TIMER_MS 50 | 23 | #define MIN_FLUSH_TIMER_MS 50 |
24 | #define MIN_FLUSH_TIMER_15_MS 15 | ||
25 | #define MWIFIEX_BA_WIN_SIZE_32 32 | ||
24 | 26 | ||
25 | #define PKT_TYPE_BAR 0xE7 | 27 | #define PKT_TYPE_BAR 0xE7 |
26 | #define MAX_TID_VALUE (2 << 11) | 28 | #define MAX_TID_VALUE (2 << 11) |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index e2635747d966..f55658d15c60 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -592,6 +592,7 @@ struct reorder_tmr_cnxt { | |||
592 | struct timer_list timer; | 592 | struct timer_list timer; |
593 | struct mwifiex_rx_reorder_tbl *ptr; | 593 | struct mwifiex_rx_reorder_tbl *ptr; |
594 | struct mwifiex_private *priv; | 594 | struct mwifiex_private *priv; |
595 | u8 timer_is_set; | ||
595 | }; | 596 | }; |
596 | 597 | ||
597 | struct mwifiex_rx_reorder_tbl { | 598 | struct mwifiex_rx_reorder_tbl { |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 573897b8e878..8444313eabe2 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -1111,6 +1111,7 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
1111 | /* Ovislink */ | 1111 | /* Ovislink */ |
1112 | { USB_DEVICE(0x1b75, 0x3071) }, | 1112 | { USB_DEVICE(0x1b75, 0x3071) }, |
1113 | { USB_DEVICE(0x1b75, 0x3072) }, | 1113 | { USB_DEVICE(0x1b75, 0x3072) }, |
1114 | { USB_DEVICE(0x1b75, 0xa200) }, | ||
1114 | /* Para */ | 1115 | /* Para */ |
1115 | { USB_DEVICE(0x20b8, 0x8888) }, | 1116 | { USB_DEVICE(0x20b8, 0x8888) }, |
1116 | /* Pegatron */ | 1117 | /* Pegatron */ |
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c index 58ba71830886..40b6d1d006d7 100644 --- a/drivers/net/wireless/rtlwifi/base.c +++ b/drivers/net/wireless/rtlwifi/base.c | |||
@@ -467,7 +467,7 @@ static void _rtl_init_deferred_work(struct ieee80211_hw *hw) | |||
467 | rtl_easy_concurrent_retrytimer_callback, (unsigned long)hw); | 467 | rtl_easy_concurrent_retrytimer_callback, (unsigned long)hw); |
468 | /* <2> work queue */ | 468 | /* <2> work queue */ |
469 | rtlpriv->works.hw = hw; | 469 | rtlpriv->works.hw = hw; |
470 | rtlpriv->works.rtl_wq = alloc_workqueue(rtlpriv->cfg->name, 0, 0); | 470 | rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name); |
471 | INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq, | 471 | INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq, |
472 | (void *)rtl_watchdog_wq_callback); | 472 | (void *)rtl_watchdog_wq_callback); |
473 | INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq, | 473 | INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq, |
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c index f6179bc06086..07dae0d44abc 100644 --- a/drivers/net/wireless/rtlwifi/core.c +++ b/drivers/net/wireless/rtlwifi/core.c | |||
@@ -1828,3 +1828,9 @@ const struct ieee80211_ops rtl_ops = { | |||
1828 | .flush = rtl_op_flush, | 1828 | .flush = rtl_op_flush, |
1829 | }; | 1829 | }; |
1830 | EXPORT_SYMBOL_GPL(rtl_ops); | 1830 | EXPORT_SYMBOL_GPL(rtl_ops); |
1831 | |||
1832 | bool rtl_btc_status_false(void) | ||
1833 | { | ||
1834 | return false; | ||
1835 | } | ||
1836 | EXPORT_SYMBOL_GPL(rtl_btc_status_false); | ||
diff --git a/drivers/net/wireless/rtlwifi/core.h b/drivers/net/wireless/rtlwifi/core.h index 59cd3b9dca25..624e1dc16d31 100644 --- a/drivers/net/wireless/rtlwifi/core.h +++ b/drivers/net/wireless/rtlwifi/core.h | |||
@@ -42,5 +42,6 @@ void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr, | |||
42 | u32 mask, u32 data); | 42 | u32 mask, u32 data); |
43 | void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data); | 43 | void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data); |
44 | bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb); | 44 | bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb); |
45 | bool rtl_btc_status_false(void); | ||
45 | 46 | ||
46 | #endif | 47 | #endif |
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 667aba81246c..25daa8715219 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
@@ -1796,7 +1796,8 @@ static int rtl_pci_start(struct ieee80211_hw *hw) | |||
1796 | rtl_pci_reset_trx_ring(hw); | 1796 | rtl_pci_reset_trx_ring(hw); |
1797 | 1797 | ||
1798 | rtlpci->driver_is_goingto_unload = false; | 1798 | rtlpci->driver_is_goingto_unload = false; |
1799 | if (rtlpriv->cfg->ops->get_btc_status()) { | 1799 | if (rtlpriv->cfg->ops->get_btc_status && |
1800 | rtlpriv->cfg->ops->get_btc_status()) { | ||
1800 | rtlpriv->btcoexist.btc_ops->btc_init_variables(rtlpriv); | 1801 | rtlpriv->btcoexist.btc_ops->btc_init_variables(rtlpriv); |
1801 | rtlpriv->btcoexist.btc_ops->btc_init_hal_vars(rtlpriv); | 1802 | rtlpriv->btcoexist.btc_ops->btc_init_hal_vars(rtlpriv); |
1802 | } | 1803 | } |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c index a00861b26ece..29983bc96a89 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | |||
@@ -656,7 +656,8 @@ static u8 reserved_page_packet[TOTAL_RESERVED_PKT_LEN] = { | |||
656 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 656 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
657 | }; | 657 | }; |
658 | 658 | ||
659 | void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished) | 659 | void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, |
660 | bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *)) | ||
660 | { | 661 | { |
661 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 662 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
662 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); | 663 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); |
@@ -722,7 +723,10 @@ void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished) | |||
722 | memcpy((u8 *)skb_put(skb, totalpacketlen), | 723 | memcpy((u8 *)skb_put(skb, totalpacketlen), |
723 | &reserved_page_packet, totalpacketlen); | 724 | &reserved_page_packet, totalpacketlen); |
724 | 725 | ||
725 | rtstatus = rtl_cmd_send_packet(hw, skb); | 726 | if (cmd_send_packet) |
727 | rtstatus = cmd_send_packet(hw, skb); | ||
728 | else | ||
729 | rtstatus = rtl_cmd_send_packet(hw, skb); | ||
726 | 730 | ||
727 | if (rtstatus) | 731 | if (rtstatus) |
728 | b_dlok = true; | 732 | b_dlok = true; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h index a815bd6273da..b64ae45dc674 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h | |||
@@ -109,7 +109,9 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id, | |||
109 | u32 cmd_len, u8 *p_cmdbuffer); | 109 | u32 cmd_len, u8 *p_cmdbuffer); |
110 | void rtl92c_firmware_selfreset(struct ieee80211_hw *hw); | 110 | void rtl92c_firmware_selfreset(struct ieee80211_hw *hw); |
111 | void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); | 111 | void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); |
112 | void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished); | 112 | void rtl92c_set_fw_rsvdpagepkt |
113 | (struct ieee80211_hw *hw, | ||
114 | bool (*cmd_send_packet)(struct ieee80211_hw *, struct sk_buff *)); | ||
113 | void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); | 115 | void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); |
114 | void usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, void *data, u16 len); | 116 | void usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, void *data, u16 len); |
115 | void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); | 117 | void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h index 831df101d7b7..9b660df6fd71 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h | |||
@@ -114,6 +114,8 @@ | |||
114 | LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 16, 4) | 114 | LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 16, 4) |
115 | #define GET_C2H_CMD_FEEDBACK_CCX_SEQ(__pcmdfbhdr) \ | 115 | #define GET_C2H_CMD_FEEDBACK_CCX_SEQ(__pcmdfbhdr) \ |
116 | LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 20, 12) | 116 | LE_BITS_TO_4BYTE(((__pcmdfbhdr) + 4), 20, 12) |
117 | #define GET_RX_STATUS_DESC_BUFF_ADDR(__pdesc) \ | ||
118 | SHIFT_AND_MASK_LE(__pdesc + 24, 0, 32) | ||
117 | 119 | ||
118 | #define CHIP_VER_B BIT(4) | 120 | #define CHIP_VER_B BIT(4) |
119 | #define CHIP_BONDING_IDENTIFIER(_value) (((_value) >> 22) & 0x3) | 121 | #define CHIP_BONDING_IDENTIFIER(_value) (((_value) >> 22) & 0x3) |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c index 8ec0f031f48a..55357d69397a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | |||
@@ -459,7 +459,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
459 | rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2, | 459 | rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2, |
460 | tmp_reg422 & (~BIT(6))); | 460 | tmp_reg422 & (~BIT(6))); |
461 | 461 | ||
462 | rtl92c_set_fw_rsvdpagepkt(hw, 0); | 462 | rtl92c_set_fw_rsvdpagepkt(hw, NULL); |
463 | 463 | ||
464 | _rtl92ce_set_bcn_ctrl_reg(hw, BIT(3), 0); | 464 | _rtl92ce_set_bcn_ctrl_reg(hw, BIT(3), 0); |
465 | _rtl92ce_set_bcn_ctrl_reg(hw, 0, BIT(4)); | 465 | _rtl92ce_set_bcn_ctrl_reg(hw, 0, BIT(4)); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c index d86b5b566444..46ea07605eb4 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | |||
@@ -244,6 +244,7 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = { | |||
244 | .phy_lc_calibrate = _rtl92ce_phy_lc_calibrate, | 244 | .phy_lc_calibrate = _rtl92ce_phy_lc_calibrate, |
245 | .phy_set_bw_mode_callback = rtl92ce_phy_set_bw_mode_callback, | 245 | .phy_set_bw_mode_callback = rtl92ce_phy_set_bw_mode_callback, |
246 | .dm_dynamic_txpower = rtl92ce_dm_dynamic_txpower, | 246 | .dm_dynamic_txpower = rtl92ce_dm_dynamic_txpower, |
247 | .get_btc_status = rtl_btc_status_false, | ||
247 | }; | 248 | }; |
248 | 249 | ||
249 | static struct rtl_mod_params rtl92ce_mod_params = { | 250 | static struct rtl_mod_params rtl92ce_mod_params = { |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c index 2fb9c7acb76a..dc3d20b17a26 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | |||
@@ -728,6 +728,9 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name) | |||
728 | case HW_DESC_RXPKT_LEN: | 728 | case HW_DESC_RXPKT_LEN: |
729 | ret = GET_RX_DESC_PKT_LEN(pdesc); | 729 | ret = GET_RX_DESC_PKT_LEN(pdesc); |
730 | break; | 730 | break; |
731 | case HW_DESC_RXBUFF_ADDR: | ||
732 | ret = GET_RX_STATUS_DESC_BUFF_ADDR(pdesc); | ||
733 | break; | ||
731 | default: | 734 | default: |
732 | RT_ASSERT(false, "ERR rxdesc :%d not process\n", | 735 | RT_ASSERT(false, "ERR rxdesc :%d not process\n", |
733 | desc_name); | 736 | desc_name); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c index 04aa0b5f5b3d..873363acbacf 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | |||
@@ -1592,6 +1592,20 @@ void rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
1592 | } | 1592 | } |
1593 | } | 1593 | } |
1594 | 1594 | ||
1595 | bool usb_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb) | ||
1596 | { | ||
1597 | /* Currently nothing happens here. | ||
1598 | * Traffic stops after some seconds in WPA2 802.11n mode. | ||
1599 | * Maybe because rtl8192cu chip should be set from here? | ||
1600 | * If I understand correctly, the realtek vendor driver sends some urbs | ||
1601 | * if its "here". | ||
1602 | * | ||
1603 | * This is maybe necessary: | ||
1604 | * rtlpriv->cfg->ops->fill_tx_cmddesc(hw, buffer, 1, 1, skb); | ||
1605 | */ | ||
1606 | return true; | ||
1607 | } | ||
1608 | |||
1595 | void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | 1609 | void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) |
1596 | { | 1610 | { |
1597 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 1611 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -1939,7 +1953,8 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
1939 | recover = true; | 1953 | recover = true; |
1940 | rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2, | 1954 | rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2, |
1941 | tmp_reg422 & (~BIT(6))); | 1955 | tmp_reg422 & (~BIT(6))); |
1942 | rtl92c_set_fw_rsvdpagepkt(hw, 0); | 1956 | rtl92c_set_fw_rsvdpagepkt(hw, |
1957 | &usb_cmd_send_packet); | ||
1943 | _rtl92cu_set_bcn_ctrl_reg(hw, BIT(3), 0); | 1958 | _rtl92cu_set_bcn_ctrl_reg(hw, BIT(3), 0); |
1944 | _rtl92cu_set_bcn_ctrl_reg(hw, 0, BIT(4)); | 1959 | _rtl92cu_set_bcn_ctrl_reg(hw, 0, BIT(4)); |
1945 | if (recover) | 1960 | if (recover) |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h index 0f7812e0c8aa..c1e33b0228c0 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.h | |||
@@ -104,7 +104,6 @@ bool rtl92cu_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid); | |||
104 | void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); | 104 | void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); |
105 | int rtl92c_download_fw(struct ieee80211_hw *hw); | 105 | int rtl92c_download_fw(struct ieee80211_hw *hw); |
106 | void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); | 106 | void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); |
107 | void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool dl_finished); | ||
108 | void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); | 107 | void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); |
109 | void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, | 108 | void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, |
110 | u8 element_id, u32 cmd_len, u8 *p_cmdbuffer); | 109 | u8 element_id, u32 cmd_len, u8 *p_cmdbuffer); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index 7c5fbaf5fee0..e06bafee37f9 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | |||
@@ -101,6 +101,12 @@ static void rtl92cu_deinit_sw_vars(struct ieee80211_hw *hw) | |||
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | /* get bt coexist status */ | ||
105 | static bool rtl92cu_get_btc_status(void) | ||
106 | { | ||
107 | return false; | ||
108 | } | ||
109 | |||
104 | static struct rtl_hal_ops rtl8192cu_hal_ops = { | 110 | static struct rtl_hal_ops rtl8192cu_hal_ops = { |
105 | .init_sw_vars = rtl92cu_init_sw_vars, | 111 | .init_sw_vars = rtl92cu_init_sw_vars, |
106 | .deinit_sw_vars = rtl92cu_deinit_sw_vars, | 112 | .deinit_sw_vars = rtl92cu_deinit_sw_vars, |
@@ -148,6 +154,7 @@ static struct rtl_hal_ops rtl8192cu_hal_ops = { | |||
148 | .phy_set_bw_mode_callback = rtl92cu_phy_set_bw_mode_callback, | 154 | .phy_set_bw_mode_callback = rtl92cu_phy_set_bw_mode_callback, |
149 | .dm_dynamic_txpower = rtl92cu_dm_dynamic_txpower, | 155 | .dm_dynamic_txpower = rtl92cu_dm_dynamic_txpower, |
150 | .fill_h2c_cmd = rtl92c_fill_h2c_cmd, | 156 | .fill_h2c_cmd = rtl92c_fill_h2c_cmd, |
157 | .get_btc_status = rtl92cu_get_btc_status, | ||
151 | }; | 158 | }; |
152 | 159 | ||
153 | static struct rtl_mod_params rtl92cu_mod_params = { | 160 | static struct rtl_mod_params rtl92cu_mod_params = { |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c index edab5a5351b5..a0aba088259a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c | |||
@@ -251,6 +251,7 @@ static struct rtl_hal_ops rtl8192de_hal_ops = { | |||
251 | .get_rfreg = rtl92d_phy_query_rf_reg, | 251 | .get_rfreg = rtl92d_phy_query_rf_reg, |
252 | .set_rfreg = rtl92d_phy_set_rf_reg, | 252 | .set_rfreg = rtl92d_phy_set_rf_reg, |
253 | .linked_set_reg = rtl92d_linked_set_reg, | 253 | .linked_set_reg = rtl92d_linked_set_reg, |
254 | .get_btc_status = rtl_btc_status_false, | ||
254 | }; | 255 | }; |
255 | 256 | ||
256 | static struct rtl_mod_params rtl92de_mod_params = { | 257 | static struct rtl_mod_params rtl92de_mod_params = { |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c index dfdc9b20e4ad..1a87edca2c3f 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c | |||
@@ -362,7 +362,7 @@ void rtl92ee_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
362 | } | 362 | } |
363 | break; | 363 | break; |
364 | default: | 364 | default: |
365 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 365 | RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG, |
366 | "switch case not process %x\n", variable); | 366 | "switch case not process %x\n", variable); |
367 | break; | 367 | break; |
368 | } | 368 | } |
@@ -591,7 +591,7 @@ void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
591 | acm_ctrl &= (~ACMHW_BEQEN); | 591 | acm_ctrl &= (~ACMHW_BEQEN); |
592 | break; | 592 | break; |
593 | default: | 593 | default: |
594 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 594 | RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG, |
595 | "switch case not process\n"); | 595 | "switch case not process\n"); |
596 | break; | 596 | break; |
597 | } | 597 | } |
@@ -710,7 +710,7 @@ void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
710 | } | 710 | } |
711 | break; | 711 | break; |
712 | default: | 712 | default: |
713 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 713 | RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG, |
714 | "switch case not process %x\n", variable); | 714 | "switch case not process %x\n", variable); |
715 | break; | 715 | break; |
716 | } | 716 | } |
@@ -2424,7 +2424,7 @@ void rtl92ee_set_key(struct ieee80211_hw *hw, u32 key_index, | |||
2424 | enc_algo = CAM_AES; | 2424 | enc_algo = CAM_AES; |
2425 | break; | 2425 | break; |
2426 | default: | 2426 | default: |
2427 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 2427 | RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG, |
2428 | "switch case not process\n"); | 2428 | "switch case not process\n"); |
2429 | enc_algo = CAM_TKIP; | 2429 | enc_algo = CAM_TKIP; |
2430 | break; | 2430 | break; |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/def.h b/drivers/net/wireless/rtlwifi/rtl8192se/def.h index 83c98674bfd3..6e7a70b43949 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/def.h +++ b/drivers/net/wireless/rtlwifi/rtl8192se/def.h | |||
@@ -446,6 +446,8 @@ | |||
446 | /* DWORD 6 */ | 446 | /* DWORD 6 */ |
447 | #define SET_RX_STATUS__DESC_BUFF_ADDR(__pdesc, __val) \ | 447 | #define SET_RX_STATUS__DESC_BUFF_ADDR(__pdesc, __val) \ |
448 | SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val) | 448 | SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val) |
449 | #define GET_RX_STATUS_DESC_BUFF_ADDR(__pdesc) \ | ||
450 | SHIFT_AND_MASK_LE(__pdesc + 24, 0, 32) | ||
449 | 451 | ||
450 | #define SE_RX_HAL_IS_CCK_RATE(_pdesc)\ | 452 | #define SE_RX_HAL_IS_CCK_RATE(_pdesc)\ |
451 | (GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M || \ | 453 | (GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M || \ |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c index 1bff2a0f7600..aadba29c167a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c | |||
@@ -87,11 +87,8 @@ static void rtl92s_init_aspm_vars(struct ieee80211_hw *hw) | |||
87 | static void rtl92se_fw_cb(const struct firmware *firmware, void *context) | 87 | static void rtl92se_fw_cb(const struct firmware *firmware, void *context) |
88 | { | 88 | { |
89 | struct ieee80211_hw *hw = context; | 89 | struct ieee80211_hw *hw = context; |
90 | struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); | ||
91 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 90 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
92 | struct rtl_pci *rtlpci = rtl_pcidev(pcipriv); | ||
93 | struct rt_firmware *pfirmware = NULL; | 91 | struct rt_firmware *pfirmware = NULL; |
94 | int err; | ||
95 | 92 | ||
96 | RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, | 93 | RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD, |
97 | "Firmware callback routine entered!\n"); | 94 | "Firmware callback routine entered!\n"); |
@@ -112,20 +109,6 @@ static void rtl92se_fw_cb(const struct firmware *firmware, void *context) | |||
112 | memcpy(pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size); | 109 | memcpy(pfirmware->sz_fw_tmpbuffer, firmware->data, firmware->size); |
113 | pfirmware->sz_fw_tmpbufferlen = firmware->size; | 110 | pfirmware->sz_fw_tmpbufferlen = firmware->size; |
114 | release_firmware(firmware); | 111 | release_firmware(firmware); |
115 | |||
116 | err = ieee80211_register_hw(hw); | ||
117 | if (err) { | ||
118 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
119 | "Can't register mac80211 hw\n"); | ||
120 | return; | ||
121 | } else { | ||
122 | rtlpriv->mac80211.mac80211_registered = 1; | ||
123 | } | ||
124 | rtlpci->irq_alloc = 1; | ||
125 | set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status); | ||
126 | |||
127 | /*init rfkill */ | ||
128 | rtl_init_rfkill(hw); | ||
129 | } | 112 | } |
130 | 113 | ||
131 | static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) | 114 | static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) |
@@ -226,8 +209,8 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw) | |||
226 | if (!rtlpriv->rtlhal.pfirmware) | 209 | if (!rtlpriv->rtlhal.pfirmware) |
227 | return 1; | 210 | return 1; |
228 | 211 | ||
229 | rtlpriv->max_fw_size = RTL8190_MAX_RAW_FIRMWARE_CODE_SIZE; | 212 | rtlpriv->max_fw_size = RTL8190_MAX_FIRMWARE_CODE_SIZE*2 + |
230 | 213 | sizeof(struct fw_hdr); | |
231 | pr_info("Driver for Realtek RTL8192SE/RTL8191SE\n" | 214 | pr_info("Driver for Realtek RTL8192SE/RTL8191SE\n" |
232 | "Loading firmware %s\n", rtlpriv->cfg->fw_name); | 215 | "Loading firmware %s\n", rtlpriv->cfg->fw_name); |
233 | /* request fw */ | 216 | /* request fw */ |
@@ -294,6 +277,7 @@ static struct rtl_hal_ops rtl8192se_hal_ops = { | |||
294 | .set_bbreg = rtl92s_phy_set_bb_reg, | 277 | .set_bbreg = rtl92s_phy_set_bb_reg, |
295 | .get_rfreg = rtl92s_phy_query_rf_reg, | 278 | .get_rfreg = rtl92s_phy_query_rf_reg, |
296 | .set_rfreg = rtl92s_phy_set_rf_reg, | 279 | .set_rfreg = rtl92s_phy_set_rf_reg, |
280 | .get_btc_status = rtl_btc_status_false, | ||
297 | }; | 281 | }; |
298 | 282 | ||
299 | static struct rtl_mod_params rtl92se_mod_params = { | 283 | static struct rtl_mod_params rtl92se_mod_params = { |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c index b358ebce8942..672fd3b02835 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c | |||
@@ -640,6 +640,9 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name) | |||
640 | case HW_DESC_RXPKT_LEN: | 640 | case HW_DESC_RXPKT_LEN: |
641 | ret = GET_RX_STATUS_DESC_PKT_LEN(desc); | 641 | ret = GET_RX_STATUS_DESC_PKT_LEN(desc); |
642 | break; | 642 | break; |
643 | case HW_DESC_RXBUFF_ADDR: | ||
644 | ret = GET_RX_STATUS_DESC_BUFF_ADDR(desc); | ||
645 | break; | ||
643 | default: | 646 | default: |
644 | RT_ASSERT(false, "ERR rxdesc :%d not process\n", | 647 | RT_ASSERT(false, "ERR rxdesc :%d not process\n", |
645 | desc_name); | 648 | desc_name); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8821ae/phy.c b/drivers/net/wireless/rtlwifi/rtl8821ae/phy.c index 9786313dc62f..1e9570fa874f 100644 --- a/drivers/net/wireless/rtlwifi/rtl8821ae/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8821ae/phy.c | |||
@@ -1889,15 +1889,18 @@ static void _rtl8821ae_store_tx_power_by_rate(struct ieee80211_hw *hw, | |||
1889 | struct rtl_phy *rtlphy = &rtlpriv->phy; | 1889 | struct rtl_phy *rtlphy = &rtlpriv->phy; |
1890 | u8 rate_section = _rtl8821ae_get_rate_section_index(regaddr); | 1890 | u8 rate_section = _rtl8821ae_get_rate_section_index(regaddr); |
1891 | 1891 | ||
1892 | if (band != BAND_ON_2_4G && band != BAND_ON_5G) | 1892 | if (band != BAND_ON_2_4G && band != BAND_ON_5G) { |
1893 | RT_TRACE(rtlpriv, COMP_INIT, DBG_WARNING, "Invalid Band %d\n", band); | 1893 | RT_TRACE(rtlpriv, COMP_INIT, DBG_WARNING, "Invalid Band %d\n", band); |
1894 | 1894 | band = BAND_ON_2_4G; | |
1895 | if (rfpath >= MAX_RF_PATH) | 1895 | } |
1896 | if (rfpath >= MAX_RF_PATH) { | ||
1896 | RT_TRACE(rtlpriv, COMP_INIT, DBG_WARNING, "Invalid RfPath %d\n", rfpath); | 1897 | RT_TRACE(rtlpriv, COMP_INIT, DBG_WARNING, "Invalid RfPath %d\n", rfpath); |
1897 | 1898 | rfpath = MAX_RF_PATH - 1; | |
1898 | if (txnum >= MAX_RF_PATH) | 1899 | } |
1900 | if (txnum >= MAX_RF_PATH) { | ||
1899 | RT_TRACE(rtlpriv, COMP_INIT, DBG_WARNING, "Invalid TxNum %d\n", txnum); | 1901 | RT_TRACE(rtlpriv, COMP_INIT, DBG_WARNING, "Invalid TxNum %d\n", txnum); |
1900 | 1902 | txnum = MAX_RF_PATH - 1; | |
1903 | } | ||
1901 | rtlphy->tx_power_by_rate_offset[band][rfpath][txnum][rate_section] = data; | 1904 | rtlphy->tx_power_by_rate_offset[band][rfpath][txnum][rate_section] = data; |
1902 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | 1905 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, |
1903 | "TxPwrByRateOffset[Band %d][RfPath %d][TxNum %d][RateSection %d] = 0x%x\n", | 1906 | "TxPwrByRateOffset[Band %d][RfPath %d][TxNum %d][RateSection %d] = 0x%x\n", |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index 10cf69c4bc42..46ee956d0235 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
@@ -1117,7 +1117,18 @@ int rtl_usb_probe(struct usb_interface *intf, | |||
1117 | } | 1117 | } |
1118 | rtlpriv->cfg->ops->init_sw_leds(hw); | 1118 | rtlpriv->cfg->ops->init_sw_leds(hw); |
1119 | 1119 | ||
1120 | err = ieee80211_register_hw(hw); | ||
1121 | if (err) { | ||
1122 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
1123 | "Can't register mac80211 hw.\n"); | ||
1124 | err = -ENODEV; | ||
1125 | goto error_out; | ||
1126 | } | ||
1127 | rtlpriv->mac80211.mac80211_registered = 1; | ||
1128 | |||
1129 | set_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status); | ||
1120 | return 0; | 1130 | return 0; |
1131 | |||
1121 | error_out: | 1132 | error_out: |
1122 | rtl_deinit_core(hw); | 1133 | rtl_deinit_core(hw); |
1123 | _rtl_usb_io_handler_release(hw); | 1134 | _rtl_usb_io_handler_release(hw); |
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h index d4eb8d2e9cb7..083ecc93fe5e 100644 --- a/drivers/net/xen-netback/common.h +++ b/drivers/net/xen-netback/common.h | |||
@@ -176,10 +176,11 @@ struct xenvif_queue { /* Per-queue data for xenvif */ | |||
176 | char rx_irq_name[IRQ_NAME_SIZE]; /* DEVNAME-qN-rx */ | 176 | char rx_irq_name[IRQ_NAME_SIZE]; /* DEVNAME-qN-rx */ |
177 | struct xen_netif_rx_back_ring rx; | 177 | struct xen_netif_rx_back_ring rx; |
178 | struct sk_buff_head rx_queue; | 178 | struct sk_buff_head rx_queue; |
179 | RING_IDX rx_last_skb_slots; | ||
180 | unsigned long status; | ||
181 | 179 | ||
182 | struct timer_list rx_stalled; | 180 | unsigned int rx_queue_max; |
181 | unsigned int rx_queue_len; | ||
182 | unsigned long last_rx_time; | ||
183 | bool stalled; | ||
183 | 184 | ||
184 | struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS]; | 185 | struct gnttab_copy grant_copy_op[MAX_GRANT_COPY_OPS]; |
185 | 186 | ||
@@ -199,18 +200,14 @@ struct xenvif_queue { /* Per-queue data for xenvif */ | |||
199 | struct xenvif_stats stats; | 200 | struct xenvif_stats stats; |
200 | }; | 201 | }; |
201 | 202 | ||
203 | /* Maximum number of Rx slots a to-guest packet may use, including the | ||
204 | * slot needed for GSO meta-data. | ||
205 | */ | ||
206 | #define XEN_NETBK_RX_SLOTS_MAX (MAX_SKB_FRAGS + 1) | ||
207 | |||
202 | enum state_bit_shift { | 208 | enum state_bit_shift { |
203 | /* This bit marks that the vif is connected */ | 209 | /* This bit marks that the vif is connected */ |
204 | VIF_STATUS_CONNECTED, | 210 | VIF_STATUS_CONNECTED, |
205 | /* This bit signals the RX thread that queuing was stopped (in | ||
206 | * start_xmit), and either the timer fired or an RX interrupt came | ||
207 | */ | ||
208 | QUEUE_STATUS_RX_PURGE_EVENT, | ||
209 | /* This bit tells the interrupt handler that this queue was the reason | ||
210 | * for the carrier off, so it should kick the thread. Only queues which | ||
211 | * brought it down can turn on the carrier. | ||
212 | */ | ||
213 | QUEUE_STATUS_RX_STALLED | ||
214 | }; | 211 | }; |
215 | 212 | ||
216 | struct xenvif { | 213 | struct xenvif { |
@@ -228,9 +225,6 @@ struct xenvif { | |||
228 | u8 ip_csum:1; | 225 | u8 ip_csum:1; |
229 | u8 ipv6_csum:1; | 226 | u8 ipv6_csum:1; |
230 | 227 | ||
231 | /* Internal feature information. */ | ||
232 | u8 can_queue:1; /* can queue packets for receiver? */ | ||
233 | |||
234 | /* Is this interface disabled? True when backend discovers | 228 | /* Is this interface disabled? True when backend discovers |
235 | * frontend is rogue. | 229 | * frontend is rogue. |
236 | */ | 230 | */ |
@@ -240,6 +234,9 @@ struct xenvif { | |||
240 | /* Queues */ | 234 | /* Queues */ |
241 | struct xenvif_queue *queues; | 235 | struct xenvif_queue *queues; |
242 | unsigned int num_queues; /* active queues, resource allocated */ | 236 | unsigned int num_queues; /* active queues, resource allocated */ |
237 | unsigned int stalled_queues; | ||
238 | |||
239 | spinlock_t lock; | ||
243 | 240 | ||
244 | #ifdef CONFIG_DEBUG_FS | 241 | #ifdef CONFIG_DEBUG_FS |
245 | struct dentry *xenvif_dbg_root; | 242 | struct dentry *xenvif_dbg_root; |
@@ -249,6 +246,14 @@ struct xenvif { | |||
249 | struct net_device *dev; | 246 | struct net_device *dev; |
250 | }; | 247 | }; |
251 | 248 | ||
249 | struct xenvif_rx_cb { | ||
250 | unsigned long expires; | ||
251 | int meta_slots_used; | ||
252 | bool full_coalesce; | ||
253 | }; | ||
254 | |||
255 | #define XENVIF_RX_CB(skb) ((struct xenvif_rx_cb *)(skb)->cb) | ||
256 | |||
252 | static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif) | 257 | static inline struct xenbus_device *xenvif_to_xenbus_device(struct xenvif *vif) |
253 | { | 258 | { |
254 | return to_xenbus_device(vif->dev->dev.parent); | 259 | return to_xenbus_device(vif->dev->dev.parent); |
@@ -272,8 +277,6 @@ void xenvif_xenbus_fini(void); | |||
272 | 277 | ||
273 | int xenvif_schedulable(struct xenvif *vif); | 278 | int xenvif_schedulable(struct xenvif *vif); |
274 | 279 | ||
275 | int xenvif_must_stop_queue(struct xenvif_queue *queue); | ||
276 | |||
277 | int xenvif_queue_stopped(struct xenvif_queue *queue); | 280 | int xenvif_queue_stopped(struct xenvif_queue *queue); |
278 | void xenvif_wake_queue(struct xenvif_queue *queue); | 281 | void xenvif_wake_queue(struct xenvif_queue *queue); |
279 | 282 | ||
@@ -296,6 +299,8 @@ void xenvif_kick_thread(struct xenvif_queue *queue); | |||
296 | 299 | ||
297 | int xenvif_dealloc_kthread(void *data); | 300 | int xenvif_dealloc_kthread(void *data); |
298 | 301 | ||
302 | void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb); | ||
303 | |||
299 | /* Determine whether the needed number of slots (req) are available, | 304 | /* Determine whether the needed number of slots (req) are available, |
300 | * and set req_event if not. | 305 | * and set req_event if not. |
301 | */ | 306 | */ |
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c index f379689dde30..895fe84011e7 100644 --- a/drivers/net/xen-netback/interface.c +++ b/drivers/net/xen-netback/interface.c | |||
@@ -43,6 +43,9 @@ | |||
43 | #define XENVIF_QUEUE_LENGTH 32 | 43 | #define XENVIF_QUEUE_LENGTH 32 |
44 | #define XENVIF_NAPI_WEIGHT 64 | 44 | #define XENVIF_NAPI_WEIGHT 64 |
45 | 45 | ||
46 | /* Number of bytes allowed on the internal guest Rx queue. */ | ||
47 | #define XENVIF_RX_QUEUE_BYTES (XEN_NETIF_RX_RING_SIZE/2 * PAGE_SIZE) | ||
48 | |||
46 | /* This function is used to set SKBTX_DEV_ZEROCOPY as well as | 49 | /* This function is used to set SKBTX_DEV_ZEROCOPY as well as |
47 | * increasing the inflight counter. We need to increase the inflight | 50 | * increasing the inflight counter. We need to increase the inflight |
48 | * counter because core driver calls into xenvif_zerocopy_callback | 51 | * counter because core driver calls into xenvif_zerocopy_callback |
@@ -60,20 +63,11 @@ void xenvif_skb_zerocopy_complete(struct xenvif_queue *queue) | |||
60 | atomic_dec(&queue->inflight_packets); | 63 | atomic_dec(&queue->inflight_packets); |
61 | } | 64 | } |
62 | 65 | ||
63 | static inline void xenvif_stop_queue(struct xenvif_queue *queue) | ||
64 | { | ||
65 | struct net_device *dev = queue->vif->dev; | ||
66 | |||
67 | if (!queue->vif->can_queue) | ||
68 | return; | ||
69 | |||
70 | netif_tx_stop_queue(netdev_get_tx_queue(dev, queue->id)); | ||
71 | } | ||
72 | |||
73 | int xenvif_schedulable(struct xenvif *vif) | 66 | int xenvif_schedulable(struct xenvif *vif) |
74 | { | 67 | { |
75 | return netif_running(vif->dev) && | 68 | return netif_running(vif->dev) && |
76 | test_bit(VIF_STATUS_CONNECTED, &vif->status); | 69 | test_bit(VIF_STATUS_CONNECTED, &vif->status) && |
70 | !vif->disabled; | ||
77 | } | 71 | } |
78 | 72 | ||
79 | static irqreturn_t xenvif_tx_interrupt(int irq, void *dev_id) | 73 | static irqreturn_t xenvif_tx_interrupt(int irq, void *dev_id) |
@@ -114,16 +108,7 @@ int xenvif_poll(struct napi_struct *napi, int budget) | |||
114 | static irqreturn_t xenvif_rx_interrupt(int irq, void *dev_id) | 108 | static irqreturn_t xenvif_rx_interrupt(int irq, void *dev_id) |
115 | { | 109 | { |
116 | struct xenvif_queue *queue = dev_id; | 110 | struct xenvif_queue *queue = dev_id; |
117 | struct netdev_queue *net_queue = | ||
118 | netdev_get_tx_queue(queue->vif->dev, queue->id); | ||
119 | 111 | ||
120 | /* QUEUE_STATUS_RX_PURGE_EVENT is only set if either QDisc was off OR | ||
121 | * the carrier went down and this queue was previously blocked | ||
122 | */ | ||
123 | if (unlikely(netif_tx_queue_stopped(net_queue) || | ||
124 | (!netif_carrier_ok(queue->vif->dev) && | ||
125 | test_bit(QUEUE_STATUS_RX_STALLED, &queue->status)))) | ||
126 | set_bit(QUEUE_STATUS_RX_PURGE_EVENT, &queue->status); | ||
127 | xenvif_kick_thread(queue); | 112 | xenvif_kick_thread(queue); |
128 | 113 | ||
129 | return IRQ_HANDLED; | 114 | return IRQ_HANDLED; |
@@ -151,24 +136,13 @@ void xenvif_wake_queue(struct xenvif_queue *queue) | |||
151 | netif_tx_wake_queue(netdev_get_tx_queue(dev, id)); | 136 | netif_tx_wake_queue(netdev_get_tx_queue(dev, id)); |
152 | } | 137 | } |
153 | 138 | ||
154 | /* Callback to wake the queue's thread and turn the carrier off on timeout */ | ||
155 | static void xenvif_rx_stalled(unsigned long data) | ||
156 | { | ||
157 | struct xenvif_queue *queue = (struct xenvif_queue *)data; | ||
158 | |||
159 | if (xenvif_queue_stopped(queue)) { | ||
160 | set_bit(QUEUE_STATUS_RX_PURGE_EVENT, &queue->status); | ||
161 | xenvif_kick_thread(queue); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | static int xenvif_start_xmit(struct sk_buff *skb, struct net_device *dev) | 139 | static int xenvif_start_xmit(struct sk_buff *skb, struct net_device *dev) |
166 | { | 140 | { |
167 | struct xenvif *vif = netdev_priv(dev); | 141 | struct xenvif *vif = netdev_priv(dev); |
168 | struct xenvif_queue *queue = NULL; | 142 | struct xenvif_queue *queue = NULL; |
169 | unsigned int num_queues = vif->num_queues; | 143 | unsigned int num_queues = vif->num_queues; |
170 | u16 index; | 144 | u16 index; |
171 | int min_slots_needed; | 145 | struct xenvif_rx_cb *cb; |
172 | 146 | ||
173 | BUG_ON(skb->dev != dev); | 147 | BUG_ON(skb->dev != dev); |
174 | 148 | ||
@@ -191,30 +165,10 @@ static int xenvif_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
191 | !xenvif_schedulable(vif)) | 165 | !xenvif_schedulable(vif)) |
192 | goto drop; | 166 | goto drop; |
193 | 167 | ||
194 | /* At best we'll need one slot for the header and one for each | 168 | cb = XENVIF_RX_CB(skb); |
195 | * frag. | 169 | cb->expires = jiffies + rx_drain_timeout_jiffies; |
196 | */ | ||
197 | min_slots_needed = 1 + skb_shinfo(skb)->nr_frags; | ||
198 | |||
199 | /* If the skb is GSO then we'll also need an extra slot for the | ||
200 | * metadata. | ||
201 | */ | ||
202 | if (skb_is_gso(skb)) | ||
203 | min_slots_needed++; | ||
204 | 170 | ||
205 | /* If the skb can't possibly fit in the remaining slots | 171 | xenvif_rx_queue_tail(queue, skb); |
206 | * then turn off the queue to give the ring a chance to | ||
207 | * drain. | ||
208 | */ | ||
209 | if (!xenvif_rx_ring_slots_available(queue, min_slots_needed)) { | ||
210 | queue->rx_stalled.function = xenvif_rx_stalled; | ||
211 | queue->rx_stalled.data = (unsigned long)queue; | ||
212 | xenvif_stop_queue(queue); | ||
213 | mod_timer(&queue->rx_stalled, | ||
214 | jiffies + rx_drain_timeout_jiffies); | ||
215 | } | ||
216 | |||
217 | skb_queue_tail(&queue->rx_queue, skb); | ||
218 | xenvif_kick_thread(queue); | 172 | xenvif_kick_thread(queue); |
219 | 173 | ||
220 | return NETDEV_TX_OK; | 174 | return NETDEV_TX_OK; |
@@ -465,6 +419,8 @@ struct xenvif *xenvif_alloc(struct device *parent, domid_t domid, | |||
465 | vif->queues = NULL; | 419 | vif->queues = NULL; |
466 | vif->num_queues = 0; | 420 | vif->num_queues = 0; |
467 | 421 | ||
422 | spin_lock_init(&vif->lock); | ||
423 | |||
468 | dev->netdev_ops = &xenvif_netdev_ops; | 424 | dev->netdev_ops = &xenvif_netdev_ops; |
469 | dev->hw_features = NETIF_F_SG | | 425 | dev->hw_features = NETIF_F_SG | |
470 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | | 426 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
@@ -508,6 +464,8 @@ int xenvif_init_queue(struct xenvif_queue *queue) | |||
508 | init_timer(&queue->credit_timeout); | 464 | init_timer(&queue->credit_timeout); |
509 | queue->credit_window_start = get_jiffies_64(); | 465 | queue->credit_window_start = get_jiffies_64(); |
510 | 466 | ||
467 | queue->rx_queue_max = XENVIF_RX_QUEUE_BYTES; | ||
468 | |||
511 | skb_queue_head_init(&queue->rx_queue); | 469 | skb_queue_head_init(&queue->rx_queue); |
512 | skb_queue_head_init(&queue->tx_queue); | 470 | skb_queue_head_init(&queue->tx_queue); |
513 | 471 | ||
@@ -539,8 +497,6 @@ int xenvif_init_queue(struct xenvif_queue *queue) | |||
539 | queue->grant_tx_handle[i] = NETBACK_INVALID_HANDLE; | 497 | queue->grant_tx_handle[i] = NETBACK_INVALID_HANDLE; |
540 | } | 498 | } |
541 | 499 | ||
542 | init_timer(&queue->rx_stalled); | ||
543 | |||
544 | return 0; | 500 | return 0; |
545 | } | 501 | } |
546 | 502 | ||
@@ -551,7 +507,6 @@ void xenvif_carrier_on(struct xenvif *vif) | |||
551 | dev_set_mtu(vif->dev, ETH_DATA_LEN); | 507 | dev_set_mtu(vif->dev, ETH_DATA_LEN); |
552 | netdev_update_features(vif->dev); | 508 | netdev_update_features(vif->dev); |
553 | set_bit(VIF_STATUS_CONNECTED, &vif->status); | 509 | set_bit(VIF_STATUS_CONNECTED, &vif->status); |
554 | netif_carrier_on(vif->dev); | ||
555 | if (netif_running(vif->dev)) | 510 | if (netif_running(vif->dev)) |
556 | xenvif_up(vif); | 511 | xenvif_up(vif); |
557 | rtnl_unlock(); | 512 | rtnl_unlock(); |
@@ -611,6 +566,8 @@ int xenvif_connect(struct xenvif_queue *queue, unsigned long tx_ring_ref, | |||
611 | disable_irq(queue->rx_irq); | 566 | disable_irq(queue->rx_irq); |
612 | } | 567 | } |
613 | 568 | ||
569 | queue->stalled = true; | ||
570 | |||
614 | task = kthread_create(xenvif_kthread_guest_rx, | 571 | task = kthread_create(xenvif_kthread_guest_rx, |
615 | (void *)queue, "%s-guest-rx", queue->name); | 572 | (void *)queue, "%s-guest-rx", queue->name); |
616 | if (IS_ERR(task)) { | 573 | if (IS_ERR(task)) { |
@@ -674,7 +631,6 @@ void xenvif_disconnect(struct xenvif *vif) | |||
674 | netif_napi_del(&queue->napi); | 631 | netif_napi_del(&queue->napi); |
675 | 632 | ||
676 | if (queue->task) { | 633 | if (queue->task) { |
677 | del_timer_sync(&queue->rx_stalled); | ||
678 | kthread_stop(queue->task); | 634 | kthread_stop(queue->task); |
679 | queue->task = NULL; | 635 | queue->task = NULL; |
680 | } | 636 | } |
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c index 08f65996534c..6563f0713fc0 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c | |||
@@ -55,13 +55,20 @@ | |||
55 | bool separate_tx_rx_irq = 1; | 55 | bool separate_tx_rx_irq = 1; |
56 | module_param(separate_tx_rx_irq, bool, 0644); | 56 | module_param(separate_tx_rx_irq, bool, 0644); |
57 | 57 | ||
58 | /* When guest ring is filled up, qdisc queues the packets for us, but we have | 58 | /* The time that packets can stay on the guest Rx internal queue |
59 | * to timeout them, otherwise other guests' packets can get stuck there | 59 | * before they are dropped. |
60 | */ | 60 | */ |
61 | unsigned int rx_drain_timeout_msecs = 10000; | 61 | unsigned int rx_drain_timeout_msecs = 10000; |
62 | module_param(rx_drain_timeout_msecs, uint, 0444); | 62 | module_param(rx_drain_timeout_msecs, uint, 0444); |
63 | unsigned int rx_drain_timeout_jiffies; | 63 | unsigned int rx_drain_timeout_jiffies; |
64 | 64 | ||
65 | /* The length of time before the frontend is considered unresponsive | ||
66 | * because it isn't providing Rx slots. | ||
67 | */ | ||
68 | static unsigned int rx_stall_timeout_msecs = 60000; | ||
69 | module_param(rx_stall_timeout_msecs, uint, 0444); | ||
70 | static unsigned int rx_stall_timeout_jiffies; | ||
71 | |||
65 | unsigned int xenvif_max_queues; | 72 | unsigned int xenvif_max_queues; |
66 | module_param_named(max_queues, xenvif_max_queues, uint, 0644); | 73 | module_param_named(max_queues, xenvif_max_queues, uint, 0644); |
67 | MODULE_PARM_DESC(max_queues, | 74 | MODULE_PARM_DESC(max_queues, |
@@ -83,7 +90,6 @@ static void make_tx_response(struct xenvif_queue *queue, | |||
83 | s8 st); | 90 | s8 st); |
84 | 91 | ||
85 | static inline int tx_work_todo(struct xenvif_queue *queue); | 92 | static inline int tx_work_todo(struct xenvif_queue *queue); |
86 | static inline int rx_work_todo(struct xenvif_queue *queue); | ||
87 | 93 | ||
88 | static struct xen_netif_rx_response *make_rx_response(struct xenvif_queue *queue, | 94 | static struct xen_netif_rx_response *make_rx_response(struct xenvif_queue *queue, |
89 | u16 id, | 95 | u16 id, |
@@ -163,6 +169,69 @@ bool xenvif_rx_ring_slots_available(struct xenvif_queue *queue, int needed) | |||
163 | return false; | 169 | return false; |
164 | } | 170 | } |
165 | 171 | ||
172 | void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb) | ||
173 | { | ||
174 | unsigned long flags; | ||
175 | |||
176 | spin_lock_irqsave(&queue->rx_queue.lock, flags); | ||
177 | |||
178 | __skb_queue_tail(&queue->rx_queue, skb); | ||
179 | |||
180 | queue->rx_queue_len += skb->len; | ||
181 | if (queue->rx_queue_len > queue->rx_queue_max) | ||
182 | netif_tx_stop_queue(netdev_get_tx_queue(queue->vif->dev, queue->id)); | ||
183 | |||
184 | spin_unlock_irqrestore(&queue->rx_queue.lock, flags); | ||
185 | } | ||
186 | |||
187 | static struct sk_buff *xenvif_rx_dequeue(struct xenvif_queue *queue) | ||
188 | { | ||
189 | struct sk_buff *skb; | ||
190 | |||
191 | spin_lock_irq(&queue->rx_queue.lock); | ||
192 | |||
193 | skb = __skb_dequeue(&queue->rx_queue); | ||
194 | if (skb) | ||
195 | queue->rx_queue_len -= skb->len; | ||
196 | |||
197 | spin_unlock_irq(&queue->rx_queue.lock); | ||
198 | |||
199 | return skb; | ||
200 | } | ||
201 | |||
202 | static void xenvif_rx_queue_maybe_wake(struct xenvif_queue *queue) | ||
203 | { | ||
204 | spin_lock_irq(&queue->rx_queue.lock); | ||
205 | |||
206 | if (queue->rx_queue_len < queue->rx_queue_max) | ||
207 | netif_tx_wake_queue(netdev_get_tx_queue(queue->vif->dev, queue->id)); | ||
208 | |||
209 | spin_unlock_irq(&queue->rx_queue.lock); | ||
210 | } | ||
211 | |||
212 | |||
213 | static void xenvif_rx_queue_purge(struct xenvif_queue *queue) | ||
214 | { | ||
215 | struct sk_buff *skb; | ||
216 | while ((skb = xenvif_rx_dequeue(queue)) != NULL) | ||
217 | kfree_skb(skb); | ||
218 | } | ||
219 | |||
220 | static void xenvif_rx_queue_drop_expired(struct xenvif_queue *queue) | ||
221 | { | ||
222 | struct sk_buff *skb; | ||
223 | |||
224 | for(;;) { | ||
225 | skb = skb_peek(&queue->rx_queue); | ||
226 | if (!skb) | ||
227 | break; | ||
228 | if (time_before(jiffies, XENVIF_RX_CB(skb)->expires)) | ||
229 | break; | ||
230 | xenvif_rx_dequeue(queue); | ||
231 | kfree_skb(skb); | ||
232 | } | ||
233 | } | ||
234 | |||
166 | /* | 235 | /* |
167 | * Returns true if we should start a new receive buffer instead of | 236 | * Returns true if we should start a new receive buffer instead of |
168 | * adding 'size' bytes to a buffer which currently contains 'offset' | 237 | * adding 'size' bytes to a buffer which currently contains 'offset' |
@@ -237,13 +306,6 @@ static struct xenvif_rx_meta *get_next_rx_buffer(struct xenvif_queue *queue, | |||
237 | return meta; | 306 | return meta; |
238 | } | 307 | } |
239 | 308 | ||
240 | struct xenvif_rx_cb { | ||
241 | int meta_slots_used; | ||
242 | bool full_coalesce; | ||
243 | }; | ||
244 | |||
245 | #define XENVIF_RX_CB(skb) ((struct xenvif_rx_cb *)(skb)->cb) | ||
246 | |||
247 | /* | 309 | /* |
248 | * Set up the grant operations for this fragment. If it's a flipping | 310 | * Set up the grant operations for this fragment. If it's a flipping |
249 | * interface, we also set up the unmap request from here. | 311 | * interface, we also set up the unmap request from here. |
@@ -587,12 +649,15 @@ static void xenvif_rx_action(struct xenvif_queue *queue) | |||
587 | 649 | ||
588 | skb_queue_head_init(&rxq); | 650 | skb_queue_head_init(&rxq); |
589 | 651 | ||
590 | while ((skb = skb_dequeue(&queue->rx_queue)) != NULL) { | 652 | while (xenvif_rx_ring_slots_available(queue, XEN_NETBK_RX_SLOTS_MAX) |
653 | && (skb = xenvif_rx_dequeue(queue)) != NULL) { | ||
591 | RING_IDX max_slots_needed; | 654 | RING_IDX max_slots_needed; |
592 | RING_IDX old_req_cons; | 655 | RING_IDX old_req_cons; |
593 | RING_IDX ring_slots_used; | 656 | RING_IDX ring_slots_used; |
594 | int i; | 657 | int i; |
595 | 658 | ||
659 | queue->last_rx_time = jiffies; | ||
660 | |||
596 | /* We need a cheap worse case estimate for the number of | 661 | /* We need a cheap worse case estimate for the number of |
597 | * slots we'll use. | 662 | * slots we'll use. |
598 | */ | 663 | */ |
@@ -634,15 +699,6 @@ static void xenvif_rx_action(struct xenvif_queue *queue) | |||
634 | skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)) | 699 | skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6)) |
635 | max_slots_needed++; | 700 | max_slots_needed++; |
636 | 701 | ||
637 | /* If the skb may not fit then bail out now */ | ||
638 | if (!xenvif_rx_ring_slots_available(queue, max_slots_needed)) { | ||
639 | skb_queue_head(&queue->rx_queue, skb); | ||
640 | need_to_notify = true; | ||
641 | queue->rx_last_skb_slots = max_slots_needed; | ||
642 | break; | ||
643 | } else | ||
644 | queue->rx_last_skb_slots = 0; | ||
645 | |||
646 | old_req_cons = queue->rx.req_cons; | 702 | old_req_cons = queue->rx.req_cons; |
647 | XENVIF_RX_CB(skb)->meta_slots_used = xenvif_gop_skb(skb, &npo, queue); | 703 | XENVIF_RX_CB(skb)->meta_slots_used = xenvif_gop_skb(skb, &npo, queue); |
648 | ring_slots_used = queue->rx.req_cons - old_req_cons; | 704 | ring_slots_used = queue->rx.req_cons - old_req_cons; |
@@ -1869,12 +1925,6 @@ void xenvif_idx_unmap(struct xenvif_queue *queue, u16 pending_idx) | |||
1869 | } | 1925 | } |
1870 | } | 1926 | } |
1871 | 1927 | ||
1872 | static inline int rx_work_todo(struct xenvif_queue *queue) | ||
1873 | { | ||
1874 | return (!skb_queue_empty(&queue->rx_queue) && | ||
1875 | xenvif_rx_ring_slots_available(queue, queue->rx_last_skb_slots)); | ||
1876 | } | ||
1877 | |||
1878 | static inline int tx_work_todo(struct xenvif_queue *queue) | 1928 | static inline int tx_work_todo(struct xenvif_queue *queue) |
1879 | { | 1929 | { |
1880 | if (likely(RING_HAS_UNCONSUMED_REQUESTS(&queue->tx))) | 1930 | if (likely(RING_HAS_UNCONSUMED_REQUESTS(&queue->tx))) |
@@ -1931,92 +1981,121 @@ err: | |||
1931 | return err; | 1981 | return err; |
1932 | } | 1982 | } |
1933 | 1983 | ||
1934 | static void xenvif_start_queue(struct xenvif_queue *queue) | 1984 | static void xenvif_queue_carrier_off(struct xenvif_queue *queue) |
1935 | { | 1985 | { |
1936 | if (xenvif_schedulable(queue->vif)) | 1986 | struct xenvif *vif = queue->vif; |
1937 | xenvif_wake_queue(queue); | 1987 | |
1988 | queue->stalled = true; | ||
1989 | |||
1990 | /* At least one queue has stalled? Disable the carrier. */ | ||
1991 | spin_lock(&vif->lock); | ||
1992 | if (vif->stalled_queues++ == 0) { | ||
1993 | netdev_info(vif->dev, "Guest Rx stalled"); | ||
1994 | netif_carrier_off(vif->dev); | ||
1995 | } | ||
1996 | spin_unlock(&vif->lock); | ||
1938 | } | 1997 | } |
1939 | 1998 | ||
1940 | /* Only called from the queue's thread, it handles the situation when the guest | 1999 | static void xenvif_queue_carrier_on(struct xenvif_queue *queue) |
1941 | * doesn't post enough requests on the receiving ring. | ||
1942 | * First xenvif_start_xmit disables QDisc and start a timer, and then either the | ||
1943 | * timer fires, or the guest send an interrupt after posting new request. If it | ||
1944 | * is the timer, the carrier is turned off here. | ||
1945 | * */ | ||
1946 | static void xenvif_rx_purge_event(struct xenvif_queue *queue) | ||
1947 | { | 2000 | { |
1948 | /* Either the last unsuccesful skb or at least 1 slot should fit */ | 2001 | struct xenvif *vif = queue->vif; |
1949 | int needed = queue->rx_last_skb_slots ? | ||
1950 | queue->rx_last_skb_slots : 1; | ||
1951 | 2002 | ||
1952 | /* It is assumed that if the guest post new slots after this, the RX | 2003 | queue->last_rx_time = jiffies; /* Reset Rx stall detection. */ |
1953 | * interrupt will set the QUEUE_STATUS_RX_PURGE_EVENT bit and wake up | 2004 | queue->stalled = false; |
1954 | * the thread again | ||
1955 | */ | ||
1956 | set_bit(QUEUE_STATUS_RX_STALLED, &queue->status); | ||
1957 | if (!xenvif_rx_ring_slots_available(queue, needed)) { | ||
1958 | rtnl_lock(); | ||
1959 | if (netif_carrier_ok(queue->vif->dev)) { | ||
1960 | /* Timer fired and there are still no slots. Turn off | ||
1961 | * everything except the interrupts | ||
1962 | */ | ||
1963 | netif_carrier_off(queue->vif->dev); | ||
1964 | skb_queue_purge(&queue->rx_queue); | ||
1965 | queue->rx_last_skb_slots = 0; | ||
1966 | if (net_ratelimit()) | ||
1967 | netdev_err(queue->vif->dev, "Carrier off due to lack of guest response on queue %d\n", queue->id); | ||
1968 | } else { | ||
1969 | /* Probably an another queue already turned the carrier | ||
1970 | * off, make sure nothing is stucked in the internal | ||
1971 | * queue of this queue | ||
1972 | */ | ||
1973 | skb_queue_purge(&queue->rx_queue); | ||
1974 | queue->rx_last_skb_slots = 0; | ||
1975 | } | ||
1976 | rtnl_unlock(); | ||
1977 | } else if (!netif_carrier_ok(queue->vif->dev)) { | ||
1978 | unsigned int num_queues = queue->vif->num_queues; | ||
1979 | unsigned int i; | ||
1980 | /* The carrier was down, but an interrupt kicked | ||
1981 | * the thread again after new requests were | ||
1982 | * posted | ||
1983 | */ | ||
1984 | clear_bit(QUEUE_STATUS_RX_STALLED, | ||
1985 | &queue->status); | ||
1986 | rtnl_lock(); | ||
1987 | netif_carrier_on(queue->vif->dev); | ||
1988 | netif_tx_wake_all_queues(queue->vif->dev); | ||
1989 | rtnl_unlock(); | ||
1990 | 2005 | ||
1991 | for (i = 0; i < num_queues; i++) { | 2006 | /* All queues are ready? Enable the carrier. */ |
1992 | struct xenvif_queue *temp = &queue->vif->queues[i]; | 2007 | spin_lock(&vif->lock); |
2008 | if (--vif->stalled_queues == 0) { | ||
2009 | netdev_info(vif->dev, "Guest Rx ready"); | ||
2010 | netif_carrier_on(vif->dev); | ||
2011 | } | ||
2012 | spin_unlock(&vif->lock); | ||
2013 | } | ||
1993 | 2014 | ||
1994 | xenvif_napi_schedule_or_enable_events(temp); | 2015 | static bool xenvif_rx_queue_stalled(struct xenvif_queue *queue) |
1995 | } | 2016 | { |
1996 | if (net_ratelimit()) | 2017 | RING_IDX prod, cons; |
1997 | netdev_err(queue->vif->dev, "Carrier on again\n"); | 2018 | |
1998 | } else { | 2019 | prod = queue->rx.sring->req_prod; |
1999 | /* Queuing were stopped, but the guest posted | 2020 | cons = queue->rx.req_cons; |
2000 | * new requests and sent an interrupt | 2021 | |
2001 | */ | 2022 | return !queue->stalled |
2002 | clear_bit(QUEUE_STATUS_RX_STALLED, | 2023 | && prod - cons < XEN_NETBK_RX_SLOTS_MAX |
2003 | &queue->status); | 2024 | && time_after(jiffies, |
2004 | del_timer_sync(&queue->rx_stalled); | 2025 | queue->last_rx_time + rx_stall_timeout_jiffies); |
2005 | xenvif_start_queue(queue); | 2026 | } |
2027 | |||
2028 | static bool xenvif_rx_queue_ready(struct xenvif_queue *queue) | ||
2029 | { | ||
2030 | RING_IDX prod, cons; | ||
2031 | |||
2032 | prod = queue->rx.sring->req_prod; | ||
2033 | cons = queue->rx.req_cons; | ||
2034 | |||
2035 | return queue->stalled | ||
2036 | && prod - cons >= XEN_NETBK_RX_SLOTS_MAX; | ||
2037 | } | ||
2038 | |||
2039 | static bool xenvif_have_rx_work(struct xenvif_queue *queue) | ||
2040 | { | ||
2041 | return (!skb_queue_empty(&queue->rx_queue) | ||
2042 | && xenvif_rx_ring_slots_available(queue, XEN_NETBK_RX_SLOTS_MAX)) | ||
2043 | || xenvif_rx_queue_stalled(queue) | ||
2044 | || xenvif_rx_queue_ready(queue) | ||
2045 | || kthread_should_stop() | ||
2046 | || queue->vif->disabled; | ||
2047 | } | ||
2048 | |||
2049 | static long xenvif_rx_queue_timeout(struct xenvif_queue *queue) | ||
2050 | { | ||
2051 | struct sk_buff *skb; | ||
2052 | long timeout; | ||
2053 | |||
2054 | skb = skb_peek(&queue->rx_queue); | ||
2055 | if (!skb) | ||
2056 | return MAX_SCHEDULE_TIMEOUT; | ||
2057 | |||
2058 | timeout = XENVIF_RX_CB(skb)->expires - jiffies; | ||
2059 | return timeout < 0 ? 0 : timeout; | ||
2060 | } | ||
2061 | |||
2062 | /* Wait until the guest Rx thread has work. | ||
2063 | * | ||
2064 | * The timeout needs to be adjusted based on the current head of the | ||
2065 | * queue (and not just the head at the beginning). In particular, if | ||
2066 | * the queue is initially empty an infinite timeout is used and this | ||
2067 | * needs to be reduced when a skb is queued. | ||
2068 | * | ||
2069 | * This cannot be done with wait_event_timeout() because it only | ||
2070 | * calculates the timeout once. | ||
2071 | */ | ||
2072 | static void xenvif_wait_for_rx_work(struct xenvif_queue *queue) | ||
2073 | { | ||
2074 | DEFINE_WAIT(wait); | ||
2075 | |||
2076 | if (xenvif_have_rx_work(queue)) | ||
2077 | return; | ||
2078 | |||
2079 | for (;;) { | ||
2080 | long ret; | ||
2081 | |||
2082 | prepare_to_wait(&queue->wq, &wait, TASK_INTERRUPTIBLE); | ||
2083 | if (xenvif_have_rx_work(queue)) | ||
2084 | break; | ||
2085 | ret = schedule_timeout(xenvif_rx_queue_timeout(queue)); | ||
2086 | if (!ret) | ||
2087 | break; | ||
2006 | } | 2088 | } |
2089 | finish_wait(&queue->wq, &wait); | ||
2007 | } | 2090 | } |
2008 | 2091 | ||
2009 | int xenvif_kthread_guest_rx(void *data) | 2092 | int xenvif_kthread_guest_rx(void *data) |
2010 | { | 2093 | { |
2011 | struct xenvif_queue *queue = data; | 2094 | struct xenvif_queue *queue = data; |
2012 | struct sk_buff *skb; | 2095 | struct xenvif *vif = queue->vif; |
2013 | 2096 | ||
2014 | while (!kthread_should_stop()) { | 2097 | for (;;) { |
2015 | wait_event_interruptible(queue->wq, | 2098 | xenvif_wait_for_rx_work(queue); |
2016 | rx_work_todo(queue) || | ||
2017 | queue->vif->disabled || | ||
2018 | test_bit(QUEUE_STATUS_RX_PURGE_EVENT, &queue->status) || | ||
2019 | kthread_should_stop()); | ||
2020 | 2099 | ||
2021 | if (kthread_should_stop()) | 2100 | if (kthread_should_stop()) |
2022 | break; | 2101 | break; |
@@ -2028,35 +2107,38 @@ int xenvif_kthread_guest_rx(void *data) | |||
2028 | * context so we defer it here, if this thread is | 2107 | * context so we defer it here, if this thread is |
2029 | * associated with queue 0. | 2108 | * associated with queue 0. |
2030 | */ | 2109 | */ |
2031 | if (unlikely(queue->vif->disabled && queue->id == 0)) { | 2110 | if (unlikely(vif->disabled && queue->id == 0)) { |
2032 | xenvif_carrier_off(queue->vif); | 2111 | xenvif_carrier_off(vif); |
2033 | } else if (unlikely(queue->vif->disabled)) { | 2112 | xenvif_rx_queue_purge(queue); |
2034 | /* kthread_stop() would be called upon this thread soon, | 2113 | continue; |
2035 | * be a bit proactive | ||
2036 | */ | ||
2037 | skb_queue_purge(&queue->rx_queue); | ||
2038 | queue->rx_last_skb_slots = 0; | ||
2039 | } else if (unlikely(test_and_clear_bit(QUEUE_STATUS_RX_PURGE_EVENT, | ||
2040 | &queue->status))) { | ||
2041 | xenvif_rx_purge_event(queue); | ||
2042 | } else if (!netif_carrier_ok(queue->vif->dev)) { | ||
2043 | /* Another queue stalled and turned the carrier off, so | ||
2044 | * purge the internal queue of queues which were not | ||
2045 | * blocked | ||
2046 | */ | ||
2047 | skb_queue_purge(&queue->rx_queue); | ||
2048 | queue->rx_last_skb_slots = 0; | ||
2049 | } | 2114 | } |
2050 | 2115 | ||
2051 | if (!skb_queue_empty(&queue->rx_queue)) | 2116 | if (!skb_queue_empty(&queue->rx_queue)) |
2052 | xenvif_rx_action(queue); | 2117 | xenvif_rx_action(queue); |
2053 | 2118 | ||
2119 | /* If the guest hasn't provided any Rx slots for a | ||
2120 | * while it's probably not responsive, drop the | ||
2121 | * carrier so packets are dropped earlier. | ||
2122 | */ | ||
2123 | if (xenvif_rx_queue_stalled(queue)) | ||
2124 | xenvif_queue_carrier_off(queue); | ||
2125 | else if (xenvif_rx_queue_ready(queue)) | ||
2126 | xenvif_queue_carrier_on(queue); | ||
2127 | |||
2128 | /* Queued packets may have foreign pages from other | ||
2129 | * domains. These cannot be queued indefinitely as | ||
2130 | * this would starve guests of grant refs and transmit | ||
2131 | * slots. | ||
2132 | */ | ||
2133 | xenvif_rx_queue_drop_expired(queue); | ||
2134 | |||
2135 | xenvif_rx_queue_maybe_wake(queue); | ||
2136 | |||
2054 | cond_resched(); | 2137 | cond_resched(); |
2055 | } | 2138 | } |
2056 | 2139 | ||
2057 | /* Bin any remaining skbs */ | 2140 | /* Bin any remaining skbs */ |
2058 | while ((skb = skb_dequeue(&queue->rx_queue)) != NULL) | 2141 | xenvif_rx_queue_purge(queue); |
2059 | dev_kfree_skb(skb); | ||
2060 | 2142 | ||
2061 | return 0; | 2143 | return 0; |
2062 | } | 2144 | } |
@@ -2113,6 +2195,7 @@ static int __init netback_init(void) | |||
2113 | goto failed_init; | 2195 | goto failed_init; |
2114 | 2196 | ||
2115 | rx_drain_timeout_jiffies = msecs_to_jiffies(rx_drain_timeout_msecs); | 2197 | rx_drain_timeout_jiffies = msecs_to_jiffies(rx_drain_timeout_msecs); |
2198 | rx_stall_timeout_jiffies = msecs_to_jiffies(rx_stall_timeout_msecs); | ||
2116 | 2199 | ||
2117 | #ifdef CONFIG_DEBUG_FS | 2200 | #ifdef CONFIG_DEBUG_FS |
2118 | xen_netback_dbg_root = debugfs_create_dir("xen-netback", NULL); | 2201 | xen_netback_dbg_root = debugfs_create_dir("xen-netback", NULL); |
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index 8079c31ac5e6..4e56a27f9689 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -52,6 +52,7 @@ static int xenvif_read_io_ring(struct seq_file *m, void *v) | |||
52 | struct xenvif_queue *queue = m->private; | 52 | struct xenvif_queue *queue = m->private; |
53 | struct xen_netif_tx_back_ring *tx_ring = &queue->tx; | 53 | struct xen_netif_tx_back_ring *tx_ring = &queue->tx; |
54 | struct xen_netif_rx_back_ring *rx_ring = &queue->rx; | 54 | struct xen_netif_rx_back_ring *rx_ring = &queue->rx; |
55 | struct netdev_queue *dev_queue; | ||
55 | 56 | ||
56 | if (tx_ring->sring) { | 57 | if (tx_ring->sring) { |
57 | struct xen_netif_tx_sring *sring = tx_ring->sring; | 58 | struct xen_netif_tx_sring *sring = tx_ring->sring; |
@@ -112,6 +113,13 @@ static int xenvif_read_io_ring(struct seq_file *m, void *v) | |||
112 | queue->credit_timeout.expires, | 113 | queue->credit_timeout.expires, |
113 | jiffies); | 114 | jiffies); |
114 | 115 | ||
116 | dev_queue = netdev_get_tx_queue(queue->vif->dev, queue->id); | ||
117 | |||
118 | seq_printf(m, "\nRx internal queue: len %u max %u pkts %u %s\n", | ||
119 | queue->rx_queue_len, queue->rx_queue_max, | ||
120 | skb_queue_len(&queue->rx_queue), | ||
121 | netif_tx_queue_stopped(dev_queue) ? "stopped" : "running"); | ||
122 | |||
115 | return 0; | 123 | return 0; |
116 | } | 124 | } |
117 | 125 | ||
@@ -703,6 +711,7 @@ static void connect(struct backend_info *be) | |||
703 | be->vif->queues = vzalloc(requested_num_queues * | 711 | be->vif->queues = vzalloc(requested_num_queues * |
704 | sizeof(struct xenvif_queue)); | 712 | sizeof(struct xenvif_queue)); |
705 | be->vif->num_queues = requested_num_queues; | 713 | be->vif->num_queues = requested_num_queues; |
714 | be->vif->stalled_queues = requested_num_queues; | ||
706 | 715 | ||
707 | for (queue_index = 0; queue_index < requested_num_queues; ++queue_index) { | 716 | for (queue_index = 0; queue_index < requested_num_queues; ++queue_index) { |
708 | queue = &be->vif->queues[queue_index]; | 717 | queue = &be->vif->queues[queue_index]; |
@@ -873,15 +882,10 @@ static int read_xenbus_vif_flags(struct backend_info *be) | |||
873 | if (!rx_copy) | 882 | if (!rx_copy) |
874 | return -EOPNOTSUPP; | 883 | return -EOPNOTSUPP; |
875 | 884 | ||
876 | if (vif->dev->tx_queue_len != 0) { | 885 | if (xenbus_scanf(XBT_NIL, dev->otherend, |
877 | if (xenbus_scanf(XBT_NIL, dev->otherend, | 886 | "feature-rx-notify", "%d", &val) < 0 || val == 0) { |
878 | "feature-rx-notify", "%d", &val) < 0) | 887 | xenbus_dev_fatal(dev, -EINVAL, "feature-rx-notify is mandatory"); |
879 | val = 0; | 888 | return -EINVAL; |
880 | if (val) | ||
881 | vif->can_queue = 1; | ||
882 | else | ||
883 | /* Must be non-zero for pfifo_fast to work. */ | ||
884 | vif->dev->tx_queue_len = 1; | ||
885 | } | 889 | } |
886 | 890 | ||
887 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-sg", | 891 | if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-sg", |