diff options
Diffstat (limited to 'drivers/net')
| -rw-r--r-- | drivers/net/bonding/bond_sysfs_slave.c | 4 | ||||
| -rw-r--r-- | drivers/net/ethernet/allwinner/sun4i-emac.c | 6 | ||||
| -rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 22 | ||||
| -rw-r--r-- | drivers/net/ethernet/brocade/bna/bnad.c | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/brocade/bna/bnad_ethtool.c | 6 | ||||
| -rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 18 | ||||
| -rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 10 | ||||
| -rw-r--r-- | drivers/net/macvlan.c | 1 | ||||
| -rw-r--r-- | drivers/net/phy/mdio_bus.c | 1 | ||||
| -rw-r--r-- | drivers/net/usb/cdc_subset.c | 27 | ||||
| -rw-r--r-- | drivers/net/usb/usbnet.c | 8 | ||||
| -rw-r--r-- | drivers/net/xen-netfront.c | 74 |
13 files changed, 83 insertions, 98 deletions
diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c index 198677f58ce0..5cd532ca1cfe 100644 --- a/drivers/net/bonding/bond_sysfs_slave.c +++ b/drivers/net/bonding/bond_sysfs_slave.c | |||
| @@ -125,7 +125,7 @@ int bond_sysfs_slave_add(struct slave *slave) | |||
| 125 | for (a = slave_attrs; *a; ++a) { | 125 | for (a = slave_attrs; *a; ++a) { |
| 126 | err = sysfs_create_file(&slave->kobj, &((*a)->attr)); | 126 | err = sysfs_create_file(&slave->kobj, &((*a)->attr)); |
| 127 | if (err) { | 127 | if (err) { |
| 128 | kobject_del(&slave->kobj); | 128 | kobject_put(&slave->kobj); |
| 129 | return err; | 129 | return err; |
| 130 | } | 130 | } |
| 131 | } | 131 | } |
| @@ -140,5 +140,5 @@ void bond_sysfs_slave_del(struct slave *slave) | |||
| 140 | for (a = slave_attrs; *a; ++a) | 140 | for (a = slave_attrs; *a; ++a) |
| 141 | sysfs_remove_file(&slave->kobj, &((*a)->attr)); | 141 | sysfs_remove_file(&slave->kobj, &((*a)->attr)); |
| 142 | 142 | ||
| 143 | kobject_del(&slave->kobj); | 143 | kobject_put(&slave->kobj); |
| 144 | } | 144 | } |
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index d81e7167a8b5..29b9f082475d 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c | |||
| @@ -633,8 +633,10 @@ static void emac_rx(struct net_device *dev) | |||
| 633 | } | 633 | } |
| 634 | 634 | ||
| 635 | /* Move data from EMAC */ | 635 | /* Move data from EMAC */ |
| 636 | skb = dev_alloc_skb(rxlen + 4); | 636 | if (good_packet) { |
| 637 | if (good_packet && skb) { | 637 | skb = netdev_alloc_skb(dev, rxlen + 4); |
| 638 | if (!skb) | ||
| 639 | continue; | ||
| 638 | skb_reserve(skb, 2); | 640 | skb_reserve(skb, 2); |
| 639 | rdptr = (u8 *) skb_put(skb, rxlen - 4); | 641 | rdptr = (u8 *) skb_put(skb, rxlen - 4); |
| 640 | 642 | ||
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 8afa579e7c40..a3dd5dc64f4c 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
| @@ -7830,17 +7830,18 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi *tnapi, | |||
| 7830 | 7830 | ||
| 7831 | static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *); | 7831 | static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *); |
| 7832 | 7832 | ||
| 7833 | /* Use GSO to workaround a rare TSO bug that may be triggered when the | 7833 | /* Use GSO to workaround all TSO packets that meet HW bug conditions |
| 7834 | * TSO header is greater than 80 bytes. | 7834 | * indicated in tg3_tx_frag_set() |
| 7835 | */ | 7835 | */ |
| 7836 | static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb) | 7836 | static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi, |
| 7837 | struct netdev_queue *txq, struct sk_buff *skb) | ||
| 7837 | { | 7838 | { |
| 7838 | struct sk_buff *segs, *nskb; | 7839 | struct sk_buff *segs, *nskb; |
| 7839 | u32 frag_cnt_est = skb_shinfo(skb)->gso_segs * 3; | 7840 | u32 frag_cnt_est = skb_shinfo(skb)->gso_segs * 3; |
| 7840 | 7841 | ||
| 7841 | /* Estimate the number of fragments in the worst case */ | 7842 | /* Estimate the number of fragments in the worst case */ |
| 7842 | if (unlikely(tg3_tx_avail(&tp->napi[0]) <= frag_cnt_est)) { | 7843 | if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) { |
| 7843 | netif_stop_queue(tp->dev); | 7844 | netif_tx_stop_queue(txq); |
| 7844 | 7845 | ||
| 7845 | /* netif_tx_stop_queue() must be done before checking | 7846 | /* netif_tx_stop_queue() must be done before checking |
| 7846 | * checking tx index in tg3_tx_avail() below, because in | 7847 | * checking tx index in tg3_tx_avail() below, because in |
| @@ -7848,13 +7849,14 @@ static int tg3_tso_bug(struct tg3 *tp, struct sk_buff *skb) | |||
| 7848 | * netif_tx_queue_stopped(). | 7849 | * netif_tx_queue_stopped(). |
| 7849 | */ | 7850 | */ |
| 7850 | smp_mb(); | 7851 | smp_mb(); |
| 7851 | if (tg3_tx_avail(&tp->napi[0]) <= frag_cnt_est) | 7852 | if (tg3_tx_avail(tnapi) <= frag_cnt_est) |
| 7852 | return NETDEV_TX_BUSY; | 7853 | return NETDEV_TX_BUSY; |
| 7853 | 7854 | ||
| 7854 | netif_wake_queue(tp->dev); | 7855 | netif_tx_wake_queue(txq); |
| 7855 | } | 7856 | } |
| 7856 | 7857 | ||
| 7857 | segs = skb_gso_segment(skb, tp->dev->features & ~(NETIF_F_TSO | NETIF_F_TSO6)); | 7858 | segs = skb_gso_segment(skb, tp->dev->features & |
| 7859 | ~(NETIF_F_TSO | NETIF_F_TSO6)); | ||
| 7858 | if (IS_ERR(segs) || !segs) | 7860 | if (IS_ERR(segs) || !segs) |
| 7859 | goto tg3_tso_bug_end; | 7861 | goto tg3_tso_bug_end; |
| 7860 | 7862 | ||
| @@ -7930,7 +7932,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 7930 | if (!skb_is_gso_v6(skb)) { | 7932 | if (!skb_is_gso_v6(skb)) { |
| 7931 | if (unlikely((ETH_HLEN + hdr_len) > 80) && | 7933 | if (unlikely((ETH_HLEN + hdr_len) > 80) && |
| 7932 | tg3_flag(tp, TSO_BUG)) | 7934 | tg3_flag(tp, TSO_BUG)) |
| 7933 | return tg3_tso_bug(tp, skb); | 7935 | return tg3_tso_bug(tp, tnapi, txq, skb); |
| 7934 | 7936 | ||
| 7935 | ip_csum = iph->check; | 7937 | ip_csum = iph->check; |
| 7936 | ip_tot_len = iph->tot_len; | 7938 | ip_tot_len = iph->tot_len; |
| @@ -8061,7 +8063,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 8061 | iph->tot_len = ip_tot_len; | 8063 | iph->tot_len = ip_tot_len; |
| 8062 | } | 8064 | } |
| 8063 | tcph->check = tcp_csum; | 8065 | tcph->check = tcp_csum; |
| 8064 | return tg3_tso_bug(tp, skb); | 8066 | return tg3_tso_bug(tp, tnapi, txq, skb); |
| 8065 | } | 8067 | } |
| 8066 | 8068 | ||
| 8067 | /* If the workaround fails due to memory/mapping | 8069 | /* If the workaround fails due to memory/mapping |
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index 3a77f9ead004..556aab75f490 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c | |||
| @@ -600,9 +600,9 @@ bnad_cq_process(struct bnad *bnad, struct bna_ccb *ccb, int budget) | |||
| 600 | prefetch(bnad->netdev); | 600 | prefetch(bnad->netdev); |
| 601 | 601 | ||
| 602 | cq = ccb->sw_q; | 602 | cq = ccb->sw_q; |
| 603 | cmpl = &cq[ccb->producer_index]; | ||
| 604 | 603 | ||
| 605 | while (packets < budget) { | 604 | while (packets < budget) { |
| 605 | cmpl = &cq[ccb->producer_index]; | ||
| 606 | if (!cmpl->valid) | 606 | if (!cmpl->valid) |
| 607 | break; | 607 | break; |
| 608 | /* The 'valid' field is set by the adapter, only after writing | 608 | /* The 'valid' field is set by the adapter, only after writing |
diff --git a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c index 882cad71ad62..d26adac6ab99 100644 --- a/drivers/net/ethernet/brocade/bna/bnad_ethtool.c +++ b/drivers/net/ethernet/brocade/bna/bnad_ethtool.c | |||
| @@ -997,10 +997,8 @@ bnad_get_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, | |||
| 997 | unsigned long flags = 0; | 997 | unsigned long flags = 0; |
| 998 | int ret = 0; | 998 | int ret = 0; |
| 999 | 999 | ||
| 1000 | /* Check if the flash read request is valid */ | 1000 | /* Fill the magic value */ |
| 1001 | if (eeprom->magic != (bnad->pcidev->vendor | | 1001 | eeprom->magic = bnad->pcidev->vendor | (bnad->pcidev->device << 16); |
| 1002 | (bnad->pcidev->device << 16))) | ||
| 1003 | return -EFAULT; | ||
| 1004 | 1002 | ||
| 1005 | /* Query the flash partition based on the offset */ | 1003 | /* Query the flash partition based on the offset */ |
| 1006 | flash_part = bnad_get_flash_partition_by_offset(bnad, | 1004 | flash_part = bnad_get_flash_partition_by_offset(bnad, |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c index 304e247bdf33..ffbae293cef5 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | |||
| @@ -136,7 +136,7 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter, | |||
| 136 | rsp = qlcnic_poll_rsp(adapter); | 136 | rsp = qlcnic_poll_rsp(adapter); |
| 137 | 137 | ||
| 138 | if (rsp == QLCNIC_CDRP_RSP_TIMEOUT) { | 138 | if (rsp == QLCNIC_CDRP_RSP_TIMEOUT) { |
| 139 | dev_err(&pdev->dev, "card response timeout.\n"); | 139 | dev_err(&pdev->dev, "command timeout, response = 0x%x\n", rsp); |
| 140 | cmd->rsp.arg[0] = QLCNIC_RCODE_TIMEOUT; | 140 | cmd->rsp.arg[0] = QLCNIC_RCODE_TIMEOUT; |
| 141 | } else if (rsp == QLCNIC_CDRP_RSP_FAIL) { | 141 | } else if (rsp == QLCNIC_CDRP_RSP_FAIL) { |
| 142 | cmd->rsp.arg[0] = QLCRD32(adapter, QLCNIC_CDRP_ARG(1), &err); | 142 | cmd->rsp.arg[0] = QLCRD32(adapter, QLCNIC_CDRP_ARG(1), &err); |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 1b7f3dbae289..141f116eb868 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
| @@ -1290,17 +1290,25 @@ static u64 *qlcnic_fill_stats(u64 *data, void *stats, int type) | |||
| 1290 | 1290 | ||
| 1291 | void qlcnic_update_stats(struct qlcnic_adapter *adapter) | 1291 | void qlcnic_update_stats(struct qlcnic_adapter *adapter) |
| 1292 | { | 1292 | { |
| 1293 | struct qlcnic_tx_queue_stats tx_stats; | ||
| 1293 | struct qlcnic_host_tx_ring *tx_ring; | 1294 | struct qlcnic_host_tx_ring *tx_ring; |
| 1294 | int ring; | 1295 | int ring; |
| 1295 | 1296 | ||
| 1297 | memset(&tx_stats, 0, sizeof(tx_stats)); | ||
| 1296 | for (ring = 0; ring < adapter->drv_tx_rings; ring++) { | 1298 | for (ring = 0; ring < adapter->drv_tx_rings; ring++) { |
| 1297 | tx_ring = &adapter->tx_ring[ring]; | 1299 | tx_ring = &adapter->tx_ring[ring]; |
| 1298 | adapter->stats.xmit_on += tx_ring->tx_stats.xmit_on; | 1300 | tx_stats.xmit_on += tx_ring->tx_stats.xmit_on; |
| 1299 | adapter->stats.xmit_off += tx_ring->tx_stats.xmit_off; | 1301 | tx_stats.xmit_off += tx_ring->tx_stats.xmit_off; |
| 1300 | adapter->stats.xmitcalled += tx_ring->tx_stats.xmit_called; | 1302 | tx_stats.xmit_called += tx_ring->tx_stats.xmit_called; |
| 1301 | adapter->stats.xmitfinished += tx_ring->tx_stats.xmit_finished; | 1303 | tx_stats.xmit_finished += tx_ring->tx_stats.xmit_finished; |
| 1302 | adapter->stats.txbytes += tx_ring->tx_stats.tx_bytes; | 1304 | tx_stats.tx_bytes += tx_ring->tx_stats.tx_bytes; |
| 1303 | } | 1305 | } |
| 1306 | |||
| 1307 | adapter->stats.xmit_on = tx_stats.xmit_on; | ||
| 1308 | adapter->stats.xmit_off = tx_stats.xmit_off; | ||
| 1309 | adapter->stats.xmitcalled = tx_stats.xmit_called; | ||
| 1310 | adapter->stats.xmitfinished = tx_stats.xmit_finished; | ||
| 1311 | adapter->stats.txbytes = tx_stats.tx_bytes; | ||
| 1304 | } | 1312 | } |
| 1305 | 1313 | ||
| 1306 | static u64 *qlcnic_fill_tx_queue_stats(u64 *data, void *stats) | 1314 | static u64 *qlcnic_fill_tx_queue_stats(u64 *data, void *stats) |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 0fdbcc8319f7..59846daf1379 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
| @@ -2324,14 +2324,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, struct net_device *netdev, | |||
| 2324 | if (err) | 2324 | if (err) |
| 2325 | return err; | 2325 | return err; |
| 2326 | 2326 | ||
| 2327 | qlcnic_dcb_init_dcbnl_ops(adapter->dcb); | ||
| 2328 | |||
| 2327 | err = register_netdev(netdev); | 2329 | err = register_netdev(netdev); |
| 2328 | if (err) { | 2330 | if (err) { |
| 2329 | dev_err(&pdev->dev, "failed to register net device\n"); | 2331 | dev_err(&pdev->dev, "failed to register net device\n"); |
| 2330 | return err; | 2332 | return err; |
| 2331 | } | 2333 | } |
| 2332 | 2334 | ||
| 2333 | qlcnic_dcb_init_dcbnl_ops(adapter->dcb); | ||
| 2334 | |||
| 2335 | return 0; | 2335 | return 0; |
| 2336 | } | 2336 | } |
| 2337 | 2337 | ||
| @@ -2624,13 +2624,13 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 2624 | if (err) | 2624 | if (err) |
| 2625 | goto err_out_disable_mbx_intr; | 2625 | goto err_out_disable_mbx_intr; |
| 2626 | 2626 | ||
| 2627 | if (adapter->portnum == 0) | ||
| 2628 | qlcnic_set_drv_version(adapter); | ||
| 2629 | |||
| 2627 | err = qlcnic_setup_netdev(adapter, netdev, pci_using_dac); | 2630 | err = qlcnic_setup_netdev(adapter, netdev, pci_using_dac); |
| 2628 | if (err) | 2631 | if (err) |
| 2629 | goto err_out_disable_mbx_intr; | 2632 | goto err_out_disable_mbx_intr; |
| 2630 | 2633 | ||
| 2631 | if (adapter->portnum == 0) | ||
| 2632 | qlcnic_set_drv_version(adapter); | ||
| 2633 | |||
| 2634 | pci_set_drvdata(pdev, adapter); | 2634 | pci_set_drvdata(pdev, adapter); |
| 2635 | 2635 | ||
| 2636 | if (qlcnic_82xx_check(adapter)) | 2636 | if (qlcnic_82xx_check(adapter)) |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 958df383068a..ef8a5c20236a 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
| @@ -646,6 +646,7 @@ static int macvlan_init(struct net_device *dev) | |||
| 646 | (lowerdev->state & MACVLAN_STATE_MASK); | 646 | (lowerdev->state & MACVLAN_STATE_MASK); |
| 647 | dev->features = lowerdev->features & MACVLAN_FEATURES; | 647 | dev->features = lowerdev->features & MACVLAN_FEATURES; |
| 648 | dev->features |= ALWAYS_ON_FEATURES; | 648 | dev->features |= ALWAYS_ON_FEATURES; |
| 649 | dev->vlan_features = lowerdev->vlan_features & MACVLAN_FEATURES; | ||
| 649 | dev->gso_max_size = lowerdev->gso_max_size; | 650 | dev->gso_max_size = lowerdev->gso_max_size; |
| 650 | dev->iflink = lowerdev->ifindex; | 651 | dev->iflink = lowerdev->ifindex; |
| 651 | dev->hard_header_len = lowerdev->hard_header_len; | 652 | dev->hard_header_len = lowerdev->hard_header_len; |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 203651ebccb0..4eaadcfcb0fe 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
| @@ -255,7 +255,6 @@ int mdiobus_register(struct mii_bus *bus) | |||
| 255 | 255 | ||
| 256 | bus->dev.parent = bus->parent; | 256 | bus->dev.parent = bus->parent; |
| 257 | bus->dev.class = &mdio_bus_class; | 257 | bus->dev.class = &mdio_bus_class; |
| 258 | bus->dev.driver = bus->parent->driver; | ||
| 259 | bus->dev.groups = NULL; | 258 | bus->dev.groups = NULL; |
| 260 | dev_set_name(&bus->dev, "%s", bus->id); | 259 | dev_set_name(&bus->dev, "%s", bus->id); |
| 261 | 260 | ||
diff --git a/drivers/net/usb/cdc_subset.c b/drivers/net/usb/cdc_subset.c index 91f0919fe278..6ea98cff2d3b 100644 --- a/drivers/net/usb/cdc_subset.c +++ b/drivers/net/usb/cdc_subset.c | |||
| @@ -85,14 +85,28 @@ static int always_connected (struct usbnet *dev) | |||
| 85 | * | 85 | * |
| 86 | *-------------------------------------------------------------------------*/ | 86 | *-------------------------------------------------------------------------*/ |
| 87 | 87 | ||
| 88 | static void m5632_recover(struct usbnet *dev) | ||
| 89 | { | ||
| 90 | struct usb_device *udev = dev->udev; | ||
| 91 | struct usb_interface *intf = dev->intf; | ||
| 92 | int r; | ||
| 93 | |||
| 94 | r = usb_lock_device_for_reset(udev, intf); | ||
| 95 | if (r < 0) | ||
| 96 | return; | ||
| 97 | |||
| 98 | usb_reset_device(udev); | ||
| 99 | usb_unlock_device(udev); | ||
| 100 | } | ||
| 101 | |||
| 88 | static const struct driver_info ali_m5632_info = { | 102 | static const struct driver_info ali_m5632_info = { |
| 89 | .description = "ALi M5632", | 103 | .description = "ALi M5632", |
| 90 | .flags = FLAG_POINTTOPOINT, | 104 | .flags = FLAG_POINTTOPOINT, |
| 105 | .recover = m5632_recover, | ||
| 91 | }; | 106 | }; |
| 92 | 107 | ||
| 93 | #endif | 108 | #endif |
| 94 | 109 | ||
| 95 | |||
| 96 | #ifdef CONFIG_USB_AN2720 | 110 | #ifdef CONFIG_USB_AN2720 |
| 97 | #define HAVE_HARDWARE | 111 | #define HAVE_HARDWARE |
| 98 | 112 | ||
| @@ -326,12 +340,23 @@ static const struct usb_device_id products [] = { | |||
| 326 | MODULE_DEVICE_TABLE(usb, products); | 340 | MODULE_DEVICE_TABLE(usb, products); |
| 327 | 341 | ||
| 328 | /*-------------------------------------------------------------------------*/ | 342 | /*-------------------------------------------------------------------------*/ |
| 343 | static int dummy_prereset(struct usb_interface *intf) | ||
| 344 | { | ||
| 345 | return 0; | ||
| 346 | } | ||
| 347 | |||
| 348 | static int dummy_postreset(struct usb_interface *intf) | ||
| 349 | { | ||
| 350 | return 0; | ||
| 351 | } | ||
| 329 | 352 | ||
| 330 | static struct usb_driver cdc_subset_driver = { | 353 | static struct usb_driver cdc_subset_driver = { |
| 331 | .name = "cdc_subset", | 354 | .name = "cdc_subset", |
| 332 | .probe = usbnet_probe, | 355 | .probe = usbnet_probe, |
| 333 | .suspend = usbnet_suspend, | 356 | .suspend = usbnet_suspend, |
| 334 | .resume = usbnet_resume, | 357 | .resume = usbnet_resume, |
| 358 | .pre_reset = dummy_prereset, | ||
| 359 | .post_reset = dummy_postreset, | ||
| 335 | .disconnect = usbnet_disconnect, | 360 | .disconnect = usbnet_disconnect, |
| 336 | .id_table = products, | 361 | .id_table = products, |
| 337 | .disable_hub_initiated_lpm = 1, | 362 | .disable_hub_initiated_lpm = 1, |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index f9e96c427558..5173821a9575 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
| @@ -1218,8 +1218,12 @@ void usbnet_tx_timeout (struct net_device *net) | |||
| 1218 | 1218 | ||
| 1219 | unlink_urbs (dev, &dev->txq); | 1219 | unlink_urbs (dev, &dev->txq); |
| 1220 | tasklet_schedule (&dev->bh); | 1220 | tasklet_schedule (&dev->bh); |
| 1221 | 1221 | /* this needs to be handled individually because the generic layer | |
| 1222 | // FIXME: device recovery -- reset? | 1222 | * doesn't know what is sufficient and could not restore private |
| 1223 | * information if a remedy of an unconditional reset were used. | ||
| 1224 | */ | ||
| 1225 | if (dev->driver_info->recover) | ||
| 1226 | (dev->driver_info->recover)(dev); | ||
| 1223 | } | 1227 | } |
| 1224 | EXPORT_SYMBOL_GPL(usbnet_tx_timeout); | 1228 | EXPORT_SYMBOL_GPL(usbnet_tx_timeout); |
| 1225 | 1229 | ||
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 055222bae6e4..28204bc4f369 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
| @@ -1196,22 +1196,6 @@ static void xennet_release_rx_bufs(struct netfront_queue *queue) | |||
| 1196 | spin_unlock_bh(&queue->rx_lock); | 1196 | spin_unlock_bh(&queue->rx_lock); |
| 1197 | } | 1197 | } |
| 1198 | 1198 | ||
| 1199 | static void xennet_uninit(struct net_device *dev) | ||
| 1200 | { | ||
| 1201 | struct netfront_info *np = netdev_priv(dev); | ||
| 1202 | unsigned int num_queues = dev->real_num_tx_queues; | ||
| 1203 | struct netfront_queue *queue; | ||
| 1204 | unsigned int i; | ||
| 1205 | |||
| 1206 | for (i = 0; i < num_queues; ++i) { | ||
| 1207 | queue = &np->queues[i]; | ||
| 1208 | xennet_release_tx_bufs(queue); | ||
| 1209 | xennet_release_rx_bufs(queue); | ||
| 1210 | gnttab_free_grant_references(queue->gref_tx_head); | ||
| 1211 | gnttab_free_grant_references(queue->gref_rx_head); | ||
| 1212 | } | ||
| 1213 | } | ||
| 1214 | |||
| 1215 | static netdev_features_t xennet_fix_features(struct net_device *dev, | 1199 | static netdev_features_t xennet_fix_features(struct net_device *dev, |
| 1216 | netdev_features_t features) | 1200 | netdev_features_t features) |
| 1217 | { | 1201 | { |
| @@ -1313,7 +1297,6 @@ static void xennet_poll_controller(struct net_device *dev) | |||
| 1313 | 1297 | ||
| 1314 | static const struct net_device_ops xennet_netdev_ops = { | 1298 | static const struct net_device_ops xennet_netdev_ops = { |
| 1315 | .ndo_open = xennet_open, | 1299 | .ndo_open = xennet_open, |
| 1316 | .ndo_uninit = xennet_uninit, | ||
| 1317 | .ndo_stop = xennet_close, | 1300 | .ndo_stop = xennet_close, |
| 1318 | .ndo_start_xmit = xennet_start_xmit, | 1301 | .ndo_start_xmit = xennet_start_xmit, |
| 1319 | .ndo_change_mtu = xennet_change_mtu, | 1302 | .ndo_change_mtu = xennet_change_mtu, |
| @@ -1455,6 +1438,11 @@ static void xennet_disconnect_backend(struct netfront_info *info) | |||
| 1455 | 1438 | ||
| 1456 | napi_synchronize(&queue->napi); | 1439 | napi_synchronize(&queue->napi); |
| 1457 | 1440 | ||
| 1441 | xennet_release_tx_bufs(queue); | ||
| 1442 | xennet_release_rx_bufs(queue); | ||
| 1443 | gnttab_free_grant_references(queue->gref_tx_head); | ||
| 1444 | gnttab_free_grant_references(queue->gref_rx_head); | ||
| 1445 | |||
| 1458 | /* End access and free the pages */ | 1446 | /* End access and free the pages */ |
| 1459 | xennet_end_access(queue->tx_ring_ref, queue->tx.sring); | 1447 | xennet_end_access(queue->tx_ring_ref, queue->tx.sring); |
| 1460 | xennet_end_access(queue->rx_ring_ref, queue->rx.sring); | 1448 | xennet_end_access(queue->rx_ring_ref, queue->rx.sring); |
| @@ -1827,8 +1815,8 @@ static int xennet_create_queues(struct netfront_info *info, | |||
| 1827 | 1815 | ||
| 1828 | ret = xennet_init_queue(queue); | 1816 | ret = xennet_init_queue(queue); |
| 1829 | if (ret < 0) { | 1817 | if (ret < 0) { |
| 1830 | dev_warn(&info->netdev->dev, "only created %d queues\n", | 1818 | dev_warn(&info->netdev->dev, |
| 1831 | num_queues); | 1819 | "only created %d queues\n", i); |
| 1832 | num_queues = i; | 1820 | num_queues = i; |
| 1833 | break; | 1821 | break; |
| 1834 | } | 1822 | } |
| @@ -2001,7 +1989,7 @@ abort_transaction_no_dev_fatal: | |||
| 2001 | info->queues = NULL; | 1989 | info->queues = NULL; |
| 2002 | rtnl_lock(); | 1990 | rtnl_lock(); |
| 2003 | netif_set_real_num_tx_queues(info->netdev, 0); | 1991 | netif_set_real_num_tx_queues(info->netdev, 0); |
| 2004 | rtnl_lock(); | 1992 | rtnl_unlock(); |
| 2005 | out: | 1993 | out: |
| 2006 | return err; | 1994 | return err; |
| 2007 | } | 1995 | } |
| @@ -2010,10 +1998,7 @@ static int xennet_connect(struct net_device *dev) | |||
| 2010 | { | 1998 | { |
| 2011 | struct netfront_info *np = netdev_priv(dev); | 1999 | struct netfront_info *np = netdev_priv(dev); |
| 2012 | unsigned int num_queues = 0; | 2000 | unsigned int num_queues = 0; |
| 2013 | int i, requeue_idx, err; | 2001 | int err; |
| 2014 | struct sk_buff *skb; | ||
| 2015 | grant_ref_t ref; | ||
| 2016 | struct xen_netif_rx_request *req; | ||
| 2017 | unsigned int feature_rx_copy; | 2002 | unsigned int feature_rx_copy; |
| 2018 | unsigned int j = 0; | 2003 | unsigned int j = 0; |
| 2019 | struct netfront_queue *queue = NULL; | 2004 | struct netfront_queue *queue = NULL; |
| @@ -2040,47 +2025,8 @@ static int xennet_connect(struct net_device *dev) | |||
| 2040 | netdev_update_features(dev); | 2025 | netdev_update_features(dev); |
| 2041 | rtnl_unlock(); | 2026 | rtnl_unlock(); |
| 2042 | 2027 | ||
| 2043 | /* By now, the queue structures have been set up */ | ||
| 2044 | for (j = 0; j < num_queues; ++j) { | ||
| 2045 | queue = &np->queues[j]; | ||
| 2046 | |||
| 2047 | /* Step 1: Discard all pending TX packet fragments. */ | ||
| 2048 | spin_lock_irq(&queue->tx_lock); | ||
| 2049 | xennet_release_tx_bufs(queue); | ||
| 2050 | spin_unlock_irq(&queue->tx_lock); | ||
| 2051 | |||
| 2052 | /* Step 2: Rebuild the RX buffer freelist and the RX ring itself. */ | ||
| 2053 | spin_lock_bh(&queue->rx_lock); | ||
| 2054 | |||
| 2055 | for (requeue_idx = 0, i = 0; i < NET_RX_RING_SIZE; i++) { | ||
| 2056 | skb_frag_t *frag; | ||
| 2057 | const struct page *page; | ||
| 2058 | if (!queue->rx_skbs[i]) | ||
| 2059 | continue; | ||
| 2060 | |||
| 2061 | skb = queue->rx_skbs[requeue_idx] = xennet_get_rx_skb(queue, i); | ||
| 2062 | ref = queue->grant_rx_ref[requeue_idx] = xennet_get_rx_ref(queue, i); | ||
| 2063 | req = RING_GET_REQUEST(&queue->rx, requeue_idx); | ||
| 2064 | |||
| 2065 | frag = &skb_shinfo(skb)->frags[0]; | ||
| 2066 | page = skb_frag_page(frag); | ||
| 2067 | gnttab_grant_foreign_access_ref( | ||
| 2068 | ref, queue->info->xbdev->otherend_id, | ||
| 2069 | pfn_to_mfn(page_to_pfn(page)), | ||
| 2070 | 0); | ||
| 2071 | req->gref = ref; | ||
| 2072 | req->id = requeue_idx; | ||
| 2073 | |||
| 2074 | requeue_idx++; | ||
| 2075 | } | ||
| 2076 | |||
| 2077 | queue->rx.req_prod_pvt = requeue_idx; | ||
| 2078 | |||
| 2079 | spin_unlock_bh(&queue->rx_lock); | ||
| 2080 | } | ||
| 2081 | |||
| 2082 | /* | 2028 | /* |
| 2083 | * Step 3: All public and private state should now be sane. Get | 2029 | * All public and private state should now be sane. Get |
| 2084 | * ready to start sending and receiving packets and give the driver | 2030 | * ready to start sending and receiving packets and give the driver |
| 2085 | * domain a kick because we've probably just requeued some | 2031 | * domain a kick because we've probably just requeued some |
| 2086 | * packets. | 2032 | * packets. |
