aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-05-16 22:17:37 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-16 22:17:37 -0400
commit028940342a906db8da014a7603a0deddc2c323dd (patch)
tree688dbc38a3e218f2493d311b1d70a67668837347 /drivers/net
parentbe3eed2e96340d3c7a4d1ea1d63e7bd6095d1e34 (diff)
parent0e93b4b304ae052ba1bc73f6d34a68556fe93429 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_3ad.c18
-rw-r--r--drivers/net/bonding/bond_3ad.h2
-rw-r--r--drivers/net/bonding/bond_alb.c12
-rw-r--r--drivers/net/bonding/bond_main.c16
-rw-r--r--drivers/net/bonding/bonding.h2
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c2
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c20
-rw-r--r--drivers/net/ethernet/micrel/ks8851.c7
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h2
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c25
-rw-r--r--drivers/net/ethernet/realtek/r8169.c16
-rw-r--r--drivers/net/ethernet/sfc/efx.c2
-rw-r--r--drivers/net/macvlan.c2
-rw-r--r--drivers/net/macvtap.c43
-rw-r--r--drivers/net/usb/cdc_ether.c16
-rw-r--r--drivers/net/usb/usbnet.c54
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c16
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c10
18 files changed, 172 insertions, 93 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 793b00138275..3463b469e657 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2173,9 +2173,10 @@ re_arm:
2173 * received frames (loopback). Since only the payload is given to this 2173 * received frames (loopback). Since only the payload is given to this
2174 * function, it check for loopback. 2174 * function, it check for loopback.
2175 */ 2175 */
2176static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) 2176static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length)
2177{ 2177{
2178 struct port *port; 2178 struct port *port;
2179 int ret = RX_HANDLER_ANOTHER;
2179 2180
2180 if (length >= sizeof(struct lacpdu)) { 2181 if (length >= sizeof(struct lacpdu)) {
2181 2182
@@ -2184,11 +2185,12 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
2184 if (!port->slave) { 2185 if (!port->slave) {
2185 pr_warning("%s: Warning: port of slave %s is uninitialized\n", 2186 pr_warning("%s: Warning: port of slave %s is uninitialized\n",
2186 slave->dev->name, slave->dev->master->name); 2187 slave->dev->name, slave->dev->master->name);
2187 return; 2188 return ret;
2188 } 2189 }
2189 2190
2190 switch (lacpdu->subtype) { 2191 switch (lacpdu->subtype) {
2191 case AD_TYPE_LACPDU: 2192 case AD_TYPE_LACPDU:
2193 ret = RX_HANDLER_CONSUMED;
2192 pr_debug("Received LACPDU on port %d\n", 2194 pr_debug("Received LACPDU on port %d\n",
2193 port->actor_port_number); 2195 port->actor_port_number);
2194 /* Protect against concurrent state machines */ 2196 /* Protect against concurrent state machines */
@@ -2198,6 +2200,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
2198 break; 2200 break;
2199 2201
2200 case AD_TYPE_MARKER: 2202 case AD_TYPE_MARKER:
2203 ret = RX_HANDLER_CONSUMED;
2201 // No need to convert fields to Little Endian since we don't use the marker's fields. 2204 // No need to convert fields to Little Endian since we don't use the marker's fields.
2202 2205
2203 switch (((struct bond_marker *)lacpdu)->tlv_type) { 2206 switch (((struct bond_marker *)lacpdu)->tlv_type) {
@@ -2219,6 +2222,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
2219 } 2222 }
2220 } 2223 }
2221 } 2224 }
2225 return ret;
2222} 2226}
2223 2227
2224/** 2228/**
@@ -2456,18 +2460,20 @@ out:
2456 return NETDEV_TX_OK; 2460 return NETDEV_TX_OK;
2457} 2461}
2458 2462
2459void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 2463int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
2460 struct slave *slave) 2464 struct slave *slave)
2461{ 2465{
2466 int ret = RX_HANDLER_ANOTHER;
2462 if (skb->protocol != PKT_TYPE_LACPDU) 2467 if (skb->protocol != PKT_TYPE_LACPDU)
2463 return; 2468 return ret;
2464 2469
2465 if (!pskb_may_pull(skb, sizeof(struct lacpdu))) 2470 if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
2466 return; 2471 return ret;
2467 2472
2468 read_lock(&bond->lock); 2473 read_lock(&bond->lock);
2469 bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); 2474 ret = bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
2470 read_unlock(&bond->lock); 2475 read_unlock(&bond->lock);
2476 return ret;
2471} 2477}
2472 2478
2473/* 2479/*
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h
index 235b2cc58b28..5ee7e3c45db7 100644
--- a/drivers/net/bonding/bond_3ad.h
+++ b/drivers/net/bonding/bond_3ad.h
@@ -274,7 +274,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave);
274void bond_3ad_handle_link_change(struct slave *slave, char link); 274void bond_3ad_handle_link_change(struct slave *slave, char link);
275int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); 275int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
276int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); 276int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
277void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 277int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
278 struct slave *slave); 278 struct slave *slave);
279int bond_3ad_set_carrier(struct bonding *bond); 279int bond_3ad_set_carrier(struct bonding *bond);
280void bond_3ad_update_lacp_rate(struct bonding *bond); 280void bond_3ad_update_lacp_rate(struct bonding *bond);
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index b4f1b4ac92c6..0f59c1564e53 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -342,26 +342,26 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
342 _unlock_rx_hashtbl_bh(bond); 342 _unlock_rx_hashtbl_bh(bond);
343} 343}
344 344
345static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, 345static int rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
346 struct slave *slave) 346 struct slave *slave)
347{ 347{
348 struct arp_pkt *arp; 348 struct arp_pkt *arp;
349 349
350 if (skb->protocol != cpu_to_be16(ETH_P_ARP)) 350 if (skb->protocol != cpu_to_be16(ETH_P_ARP))
351 return; 351 goto out;
352 352
353 arp = (struct arp_pkt *) skb->data; 353 arp = (struct arp_pkt *) skb->data;
354 if (!arp) { 354 if (!arp) {
355 pr_debug("Packet has no ARP data\n"); 355 pr_debug("Packet has no ARP data\n");
356 return; 356 goto out;
357 } 357 }
358 358
359 if (!pskb_may_pull(skb, arp_hdr_len(bond->dev))) 359 if (!pskb_may_pull(skb, arp_hdr_len(bond->dev)))
360 return; 360 goto out;
361 361
362 if (skb->len < sizeof(struct arp_pkt)) { 362 if (skb->len < sizeof(struct arp_pkt)) {
363 pr_debug("Packet is too small to be an ARP\n"); 363 pr_debug("Packet is too small to be an ARP\n");
364 return; 364 goto out;
365 } 365 }
366 366
367 if (arp->op_code == htons(ARPOP_REPLY)) { 367 if (arp->op_code == htons(ARPOP_REPLY)) {
@@ -369,6 +369,8 @@ static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
369 rlb_update_entry_from_arp(bond, arp); 369 rlb_update_entry_from_arp(bond, arp);
370 pr_debug("Server received an ARP Reply from client\n"); 370 pr_debug("Server received an ARP Reply from client\n");
371 } 371 }
372out:
373 return RX_HANDLER_ANOTHER;
372} 374}
373 375
374/* Caller must hold bond lock for read */ 376/* Caller must hold bond lock for read */
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index bbb004354bbd..2ee8cf9e8a3b 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1444,8 +1444,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1444 struct sk_buff *skb = *pskb; 1444 struct sk_buff *skb = *pskb;
1445 struct slave *slave; 1445 struct slave *slave;
1446 struct bonding *bond; 1446 struct bonding *bond;
1447 void (*recv_probe)(struct sk_buff *, struct bonding *, 1447 int (*recv_probe)(struct sk_buff *, struct bonding *,
1448 struct slave *); 1448 struct slave *);
1449 int ret = RX_HANDLER_ANOTHER;
1449 1450
1450 skb = skb_share_check(skb, GFP_ATOMIC); 1451 skb = skb_share_check(skb, GFP_ATOMIC);
1451 if (unlikely(!skb)) 1452 if (unlikely(!skb))
@@ -1464,8 +1465,12 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1464 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); 1465 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
1465 1466
1466 if (likely(nskb)) { 1467 if (likely(nskb)) {
1467 recv_probe(nskb, bond, slave); 1468 ret = recv_probe(nskb, bond, slave);
1468 dev_kfree_skb(nskb); 1469 dev_kfree_skb(nskb);
1470 if (ret == RX_HANDLER_CONSUMED) {
1471 consume_skb(skb);
1472 return ret;
1473 }
1469 } 1474 }
1470 } 1475 }
1471 1476
@@ -1487,7 +1492,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1487 memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN); 1492 memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN);
1488 } 1493 }
1489 1494
1490 return RX_HANDLER_ANOTHER; 1495 return ret;
1491} 1496}
1492 1497
1493/* enslave device <slave> to bond device <master> */ 1498/* enslave device <slave> to bond device <master> */
@@ -2732,7 +2737,7 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
2732 } 2737 }
2733} 2738}
2734 2739
2735static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, 2740static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2736 struct slave *slave) 2741 struct slave *slave)
2737{ 2742{
2738 struct arphdr *arp; 2743 struct arphdr *arp;
@@ -2740,7 +2745,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2740 __be32 sip, tip; 2745 __be32 sip, tip;
2741 2746
2742 if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) 2747 if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
2743 return; 2748 return RX_HANDLER_ANOTHER;
2744 2749
2745 read_lock(&bond->lock); 2750 read_lock(&bond->lock);
2746 2751
@@ -2785,6 +2790,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2785 2790
2786out_unlock: 2791out_unlock:
2787 read_unlock(&bond->lock); 2792 read_unlock(&bond->lock);
2793 return RX_HANDLER_ANOTHER;
2788} 2794}
2789 2795
2790/* 2796/*
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 9f2bae6616d3..4581aa5ccaba 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -218,7 +218,7 @@ struct bonding {
218 struct slave *primary_slave; 218 struct slave *primary_slave;
219 bool force_primary; 219 bool force_primary;
220 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ 220 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */
221 void (*recv_probe)(struct sk_buff *, struct bonding *, 221 int (*recv_probe)(struct sk_buff *, struct bonding *,
222 struct slave *); 222 struct slave *);
223 rwlock_t lock; 223 rwlock_t lock;
224 rwlock_t curr_slave_lock; 224 rwlock_t curr_slave_lock;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index c9069a28832b..f4d2da0db1b1 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -3335,6 +3335,8 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
3335 goto out_shutdown_ports; 3335 goto out_shutdown_ports;
3336 } 3336 }
3337 3337
3338 /* Handle any events that might be pending. */
3339 tasklet_hi_schedule(&adapter->neq_tasklet);
3338 3340
3339 ret = 0; 3341 ret = 0;
3340 goto out; 3342 goto out;
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index ba21f9c72a21..9bbf1a275947 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1103,9 +1103,12 @@ msi_only:
1103 adapter->flags |= IGB_FLAG_HAS_MSI; 1103 adapter->flags |= IGB_FLAG_HAS_MSI;
1104out: 1104out:
1105 /* Notify the stack of the (possibly) reduced queue counts. */ 1105 /* Notify the stack of the (possibly) reduced queue counts. */
1106 rtnl_lock();
1106 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); 1107 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
1107 return netif_set_real_num_rx_queues(adapter->netdev, 1108 err = netif_set_real_num_rx_queues(adapter->netdev,
1108 adapter->num_rx_queues); 1109 adapter->num_rx_queues);
1110 rtnl_unlock();
1111 return err;
1109} 1112}
1110 1113
1111/** 1114/**
@@ -6706,18 +6709,7 @@ static int igb_resume(struct device *dev)
6706 pci_enable_wake(pdev, PCI_D3hot, 0); 6709 pci_enable_wake(pdev, PCI_D3hot, 0);
6707 pci_enable_wake(pdev, PCI_D3cold, 0); 6710 pci_enable_wake(pdev, PCI_D3cold, 0);
6708 6711
6709 if (!rtnl_is_locked()) { 6712 if (igb_init_interrupt_scheme(adapter)) {
6710 /*
6711 * shut up ASSERT_RTNL() warning in
6712 * netif_set_real_num_tx/rx_queues.
6713 */
6714 rtnl_lock();
6715 err = igb_init_interrupt_scheme(adapter);
6716 rtnl_unlock();
6717 } else {
6718 err = igb_init_interrupt_scheme(adapter);
6719 }
6720 if (err) {
6721 dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); 6713 dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
6722 return -ENOMEM; 6714 return -ENOMEM;
6723 } 6715 }
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index f8dda009d3c0..5e313e9a252f 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -618,10 +618,8 @@ static void ks8851_irq_work(struct work_struct *work)
618 netif_dbg(ks, intr, ks->netdev, 618 netif_dbg(ks, intr, ks->netdev,
619 "%s: status 0x%04x\n", __func__, status); 619 "%s: status 0x%04x\n", __func__, status);
620 620
621 if (status & IRQ_LCI) { 621 if (status & IRQ_LCI)
622 /* should do something about checking link status */
623 handled |= IRQ_LCI; 622 handled |= IRQ_LCI;
624 }
625 623
626 if (status & IRQ_LDI) { 624 if (status & IRQ_LDI) {
627 u16 pmecr = ks8851_rdreg16(ks, KS_PMECR); 625 u16 pmecr = ks8851_rdreg16(ks, KS_PMECR);
@@ -684,6 +682,9 @@ static void ks8851_irq_work(struct work_struct *work)
684 682
685 mutex_unlock(&ks->lock); 683 mutex_unlock(&ks->lock);
686 684
685 if (status & IRQ_LCI)
686 mii_check_link(&ks->mii);
687
687 if (status & IRQ_TXI) 688 if (status & IRQ_TXI)
688 netif_wake_queue(ks->netdev); 689 netif_wake_queue(ks->netdev);
689 690
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
index 9f3dbc4feadc..b07311eaa693 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
@@ -584,7 +584,6 @@ struct pch_gbe_hw_stats {
584/** 584/**
585 * struct pch_gbe_adapter - board specific private data structure 585 * struct pch_gbe_adapter - board specific private data structure
586 * @stats_lock: Spinlock structure for status 586 * @stats_lock: Spinlock structure for status
587 * @tx_queue_lock: Spinlock structure for transmit
588 * @ethtool_lock: Spinlock structure for ethtool 587 * @ethtool_lock: Spinlock structure for ethtool
589 * @irq_sem: Semaphore for interrupt 588 * @irq_sem: Semaphore for interrupt
590 * @netdev: Pointer of network device structure 589 * @netdev: Pointer of network device structure
@@ -609,7 +608,6 @@ struct pch_gbe_hw_stats {
609 608
610struct pch_gbe_adapter { 609struct pch_gbe_adapter {
611 spinlock_t stats_lock; 610 spinlock_t stats_lock;
612 spinlock_t tx_queue_lock;
613 spinlock_t ethtool_lock; 611 spinlock_t ethtool_lock;
614 atomic_t irq_sem; 612 atomic_t irq_sem;
615 struct net_device *netdev; 613 struct net_device *netdev;
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 9dc7e5023671..3787c64ee71c 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -645,14 +645,11 @@ static void pch_gbe_mac_set_pause_packet(struct pch_gbe_hw *hw)
645 */ 645 */
646static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter) 646static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter)
647{ 647{
648 int size; 648 adapter->tx_ring = kzalloc(sizeof(*adapter->tx_ring), GFP_KERNEL);
649
650 size = (int)sizeof(struct pch_gbe_tx_ring);
651 adapter->tx_ring = kzalloc(size, GFP_KERNEL);
652 if (!adapter->tx_ring) 649 if (!adapter->tx_ring)
653 return -ENOMEM; 650 return -ENOMEM;
654 size = (int)sizeof(struct pch_gbe_rx_ring); 651
655 adapter->rx_ring = kzalloc(size, GFP_KERNEL); 652 adapter->rx_ring = kzalloc(sizeof(*adapter->rx_ring), GFP_KERNEL);
656 if (!adapter->rx_ring) { 653 if (!adapter->rx_ring) {
657 kfree(adapter->tx_ring); 654 kfree(adapter->tx_ring);
658 return -ENOMEM; 655 return -ENOMEM;
@@ -1169,7 +1166,6 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
1169 struct sk_buff *tmp_skb; 1166 struct sk_buff *tmp_skb;
1170 unsigned int frame_ctrl; 1167 unsigned int frame_ctrl;
1171 unsigned int ring_num; 1168 unsigned int ring_num;
1172 unsigned long flags;
1173 1169
1174 /*-- Set frame control --*/ 1170 /*-- Set frame control --*/
1175 frame_ctrl = 0; 1171 frame_ctrl = 0;
@@ -1216,14 +1212,14 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
1216 } 1212 }
1217 } 1213 }
1218 } 1214 }
1219 spin_lock_irqsave(&tx_ring->tx_lock, flags); 1215
1220 ring_num = tx_ring->next_to_use; 1216 ring_num = tx_ring->next_to_use;
1221 if (unlikely((ring_num + 1) == tx_ring->count)) 1217 if (unlikely((ring_num + 1) == tx_ring->count))
1222 tx_ring->next_to_use = 0; 1218 tx_ring->next_to_use = 0;
1223 else 1219 else
1224 tx_ring->next_to_use = ring_num + 1; 1220 tx_ring->next_to_use = ring_num + 1;
1225 1221
1226 spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 1222
1227 buffer_info = &tx_ring->buffer_info[ring_num]; 1223 buffer_info = &tx_ring->buffer_info[ring_num];
1228 tmp_skb = buffer_info->skb; 1224 tmp_skb = buffer_info->skb;
1229 1225
@@ -1525,7 +1521,7 @@ pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter,
1525 &rx_ring->rx_buff_pool_logic, 1521 &rx_ring->rx_buff_pool_logic,
1526 GFP_KERNEL); 1522 GFP_KERNEL);
1527 if (!rx_ring->rx_buff_pool) { 1523 if (!rx_ring->rx_buff_pool) {
1528 pr_err("Unable to allocate memory for the receive poll buffer\n"); 1524 pr_err("Unable to allocate memory for the receive pool buffer\n");
1529 return -ENOMEM; 1525 return -ENOMEM;
1530 } 1526 }
1531 memset(rx_ring->rx_buff_pool, 0, size); 1527 memset(rx_ring->rx_buff_pool, 0, size);
@@ -1644,15 +1640,17 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
1644 pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n", 1640 pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n",
1645 cleaned_count); 1641 cleaned_count);
1646 /* Recover from running out of Tx resources in xmit_frame */ 1642 /* Recover from running out of Tx resources in xmit_frame */
1643 spin_lock(&tx_ring->tx_lock);
1647 if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) { 1644 if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) {
1648 netif_wake_queue(adapter->netdev); 1645 netif_wake_queue(adapter->netdev);
1649 adapter->stats.tx_restart_count++; 1646 adapter->stats.tx_restart_count++;
1650 pr_debug("Tx wake queue\n"); 1647 pr_debug("Tx wake queue\n");
1651 } 1648 }
1652 spin_lock(&adapter->tx_queue_lock); 1649
1653 tx_ring->next_to_clean = i; 1650 tx_ring->next_to_clean = i;
1654 spin_unlock(&adapter->tx_queue_lock); 1651
1655 pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean); 1652 pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean);
1653 spin_unlock(&tx_ring->tx_lock);
1656 return cleaned; 1654 return cleaned;
1657} 1655}
1658 1656
@@ -2043,7 +2041,6 @@ static int pch_gbe_sw_init(struct pch_gbe_adapter *adapter)
2043 return -ENOMEM; 2041 return -ENOMEM;
2044 } 2042 }
2045 spin_lock_init(&adapter->hw.miim_lock); 2043 spin_lock_init(&adapter->hw.miim_lock);
2046 spin_lock_init(&adapter->tx_queue_lock);
2047 spin_lock_init(&adapter->stats_lock); 2044 spin_lock_init(&adapter->stats_lock);
2048 spin_lock_init(&adapter->ethtool_lock); 2045 spin_lock_init(&adapter->ethtool_lock);
2049 atomic_set(&adapter->irq_sem, 0); 2046 atomic_set(&adapter->irq_sem, 0);
@@ -2148,10 +2145,10 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2148 tx_ring->next_to_use, tx_ring->next_to_clean); 2145 tx_ring->next_to_use, tx_ring->next_to_clean);
2149 return NETDEV_TX_BUSY; 2146 return NETDEV_TX_BUSY;
2150 } 2147 }
2151 spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
2152 2148
2153 /* CRC,ITAG no support */ 2149 /* CRC,ITAG no support */
2154 pch_gbe_tx_queue(adapter, tx_ring, skb); 2150 pch_gbe_tx_queue(adapter, tx_ring, skb);
2151 spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
2155 return NETDEV_TX_OK; 2152 return NETDEV_TX_OK;
2156} 2153}
2157 2154
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 00628d84342f..4f74b9762c29 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -63,8 +63,12 @@
63#define R8169_MSG_DEFAULT \ 63#define R8169_MSG_DEFAULT \
64 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN) 64 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN)
65 65
66#define TX_BUFFS_AVAIL(tp) \ 66#define TX_SLOTS_AVAIL(tp) \
67 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1) 67 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx)
68
69/* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */
70#define TX_FRAGS_READY_FOR(tp,nr_frags) \
71 (TX_SLOTS_AVAIL(tp) >= (nr_frags + 1))
68 72
69/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). 73/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
70 The RTL chips use a 64 element hash table based on the Ethernet CRC. */ 74 The RTL chips use a 64 element hash table based on the Ethernet CRC. */
@@ -5494,7 +5498,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5494 u32 opts[2]; 5498 u32 opts[2];
5495 int frags; 5499 int frags;
5496 5500
5497 if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { 5501 if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) {
5498 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); 5502 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
5499 goto err_stop_0; 5503 goto err_stop_0;
5500 } 5504 }
@@ -5548,7 +5552,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5548 5552
5549 mmiowb(); 5553 mmiowb();
5550 5554
5551 if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { 5555 if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {
5552 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must 5556 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must
5553 * not miss a ring update when it notices a stopped queue. 5557 * not miss a ring update when it notices a stopped queue.
5554 */ 5558 */
@@ -5562,7 +5566,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5562 * can't. 5566 * can't.
5563 */ 5567 */
5564 smp_mb(); 5568 smp_mb();
5565 if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) 5569 if (TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS))
5566 netif_wake_queue(dev); 5570 netif_wake_queue(dev);
5567 } 5571 }
5568 5572
@@ -5685,7 +5689,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp)
5685 */ 5689 */
5686 smp_mb(); 5690 smp_mb();
5687 if (netif_queue_stopped(dev) && 5691 if (netif_queue_stopped(dev) &&
5688 (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { 5692 TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {
5689 netif_wake_queue(dev); 5693 netif_wake_queue(dev);
5690 } 5694 }
5691 /* 5695 /*
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 8253d2155fe3..b95f2e1b33f0 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1354,7 +1354,7 @@ static int efx_probe_interrupts(struct efx_nic *efx)
1354 } 1354 }
1355 1355
1356 /* RSS might be usable on VFs even if it is disabled on the PF */ 1356 /* RSS might be usable on VFs even if it is disabled on the PF */
1357 efx->rss_spread = (efx->n_rx_channels > 1 ? 1357 efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ?
1358 efx->n_rx_channels : efx_vf_size(efx)); 1358 efx->n_rx_channels : efx_vf_size(efx));
1359 1359
1360 return 0; 1360 return 0;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index ebacec1944ed..66a9bfe7b1c8 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -258,7 +258,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
258 258
259xmit_world: 259xmit_world:
260 skb->ip_summed = ip_summed; 260 skb->ip_summed = ip_summed;
261 skb_set_dev(skb, vlan->lowerdev); 261 skb->dev = vlan->lowerdev;
262 return dev_queue_xmit(skb); 262 return dev_queue_xmit(skb);
263} 263}
264 264
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 163559c16988..2ee56de7b0ca 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -1,5 +1,6 @@
1#include <linux/etherdevice.h> 1#include <linux/etherdevice.h>
2#include <linux/if_macvlan.h> 2#include <linux/if_macvlan.h>
3#include <linux/if_vlan.h>
3#include <linux/interrupt.h> 4#include <linux/interrupt.h>
4#include <linux/nsproxy.h> 5#include <linux/nsproxy.h>
5#include <linux/compat.h> 6#include <linux/compat.h>
@@ -782,6 +783,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
782 struct macvlan_dev *vlan; 783 struct macvlan_dev *vlan;
783 int ret; 784 int ret;
784 int vnet_hdr_len = 0; 785 int vnet_hdr_len = 0;
786 int vlan_offset = 0;
787 int copied;
785 788
786 if (q->flags & IFF_VNET_HDR) { 789 if (q->flags & IFF_VNET_HDR) {
787 struct virtio_net_hdr vnet_hdr; 790 struct virtio_net_hdr vnet_hdr;
@@ -796,18 +799,48 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
796 if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) 799 if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr)))
797 return -EFAULT; 800 return -EFAULT;
798 } 801 }
802 copied = vnet_hdr_len;
803
804 if (!vlan_tx_tag_present(skb))
805 len = min_t(int, skb->len, len);
806 else {
807 int copy;
808 struct {
809 __be16 h_vlan_proto;
810 __be16 h_vlan_TCI;
811 } veth;
812 veth.h_vlan_proto = htons(ETH_P_8021Q);
813 veth.h_vlan_TCI = htons(vlan_tx_tag_get(skb));
814
815 vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto);
816 len = min_t(int, skb->len + VLAN_HLEN, len);
817
818 copy = min_t(int, vlan_offset, len);
819 ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy);
820 len -= copy;
821 copied += copy;
822 if (ret || !len)
823 goto done;
824
825 copy = min_t(int, sizeof(veth), len);
826 ret = memcpy_toiovecend(iv, (void *)&veth, copied, copy);
827 len -= copy;
828 copied += copy;
829 if (ret || !len)
830 goto done;
831 }
799 832
800 len = min_t(int, skb->len, len); 833 ret = skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len);
801 834 copied += len;
802 ret = skb_copy_datagram_const_iovec(skb, 0, iv, vnet_hdr_len, len);
803 835
836done:
804 rcu_read_lock_bh(); 837 rcu_read_lock_bh();
805 vlan = rcu_dereference_bh(q->vlan); 838 vlan = rcu_dereference_bh(q->vlan);
806 if (vlan) 839 if (vlan)
807 macvlan_count_rx(vlan, len, ret == 0, 0); 840 macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0);
808 rcu_read_unlock_bh(); 841 rcu_read_unlock_bh();
809 842
810 return ret ? ret : (len + vnet_hdr_len); 843 return ret ? ret : copied;
811} 844}
812 845
813static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb, 846static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb,
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 00880edba048..425e201f597c 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -485,6 +485,7 @@ static const struct driver_info wwan_info = {
485/*-------------------------------------------------------------------------*/ 485/*-------------------------------------------------------------------------*/
486 486
487#define HUAWEI_VENDOR_ID 0x12D1 487#define HUAWEI_VENDOR_ID 0x12D1
488#define NOVATEL_VENDOR_ID 0x1410
488 489
489static const struct usb_device_id products [] = { 490static const struct usb_device_id products [] = {
490/* 491/*
@@ -602,6 +603,21 @@ static const struct usb_device_id products [] = {
602 * because of bugs/quirks in a given product (like Zaurus, above). 603 * because of bugs/quirks in a given product (like Zaurus, above).
603 */ 604 */
604{ 605{
606 /* Novatel USB551L */
607 /* This match must come *before* the generic CDC-ETHER match so that
608 * we get FLAG_WWAN set on the device, since it's descriptors are
609 * generic CDC-ETHER.
610 */
611 .match_flags = USB_DEVICE_ID_MATCH_VENDOR
612 | USB_DEVICE_ID_MATCH_PRODUCT
613 | USB_DEVICE_ID_MATCH_INT_INFO,
614 .idVendor = NOVATEL_VENDOR_ID,
615 .idProduct = 0xB001,
616 .bInterfaceClass = USB_CLASS_COMM,
617 .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
618 .bInterfaceProtocol = USB_CDC_PROTO_NONE,
619 .driver_info = (unsigned long)&wwan_info,
620}, {
605 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET, 621 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
606 USB_CDC_PROTO_NONE), 622 USB_CDC_PROTO_NONE),
607 .driver_info = (unsigned long) &cdc_info, 623 .driver_info = (unsigned long) &cdc_info,
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 80b837c88f0d..9f58330f1312 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -282,17 +282,32 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu)
282} 282}
283EXPORT_SYMBOL_GPL(usbnet_change_mtu); 283EXPORT_SYMBOL_GPL(usbnet_change_mtu);
284 284
285/* The caller must hold list->lock */
286static void __usbnet_queue_skb(struct sk_buff_head *list,
287 struct sk_buff *newsk, enum skb_state state)
288{
289 struct skb_data *entry = (struct skb_data *) newsk->cb;
290
291 __skb_queue_tail(list, newsk);
292 entry->state = state;
293}
294
285/*-------------------------------------------------------------------------*/ 295/*-------------------------------------------------------------------------*/
286 296
287/* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from 297/* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from
288 * completion callbacks. 2.5 should have fixed those bugs... 298 * completion callbacks. 2.5 should have fixed those bugs...
289 */ 299 */
290 300
291static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_head *list) 301static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb,
302 struct sk_buff_head *list, enum skb_state state)
292{ 303{
293 unsigned long flags; 304 unsigned long flags;
305 enum skb_state old_state;
306 struct skb_data *entry = (struct skb_data *) skb->cb;
294 307
295 spin_lock_irqsave(&list->lock, flags); 308 spin_lock_irqsave(&list->lock, flags);
309 old_state = entry->state;
310 entry->state = state;
296 __skb_unlink(skb, list); 311 __skb_unlink(skb, list);
297 spin_unlock(&list->lock); 312 spin_unlock(&list->lock);
298 spin_lock(&dev->done.lock); 313 spin_lock(&dev->done.lock);
@@ -300,6 +315,7 @@ static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_hea
300 if (dev->done.qlen == 1) 315 if (dev->done.qlen == 1)
301 tasklet_schedule(&dev->bh); 316 tasklet_schedule(&dev->bh);
302 spin_unlock_irqrestore(&dev->done.lock, flags); 317 spin_unlock_irqrestore(&dev->done.lock, flags);
318 return old_state;
303} 319}
304 320
305/* some work can't be done in tasklets, so we use keventd 321/* some work can't be done in tasklets, so we use keventd
@@ -340,7 +356,6 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
340 entry = (struct skb_data *) skb->cb; 356 entry = (struct skb_data *) skb->cb;
341 entry->urb = urb; 357 entry->urb = urb;
342 entry->dev = dev; 358 entry->dev = dev;
343 entry->state = rx_start;
344 entry->length = 0; 359 entry->length = 0;
345 360
346 usb_fill_bulk_urb (urb, dev->udev, dev->in, 361 usb_fill_bulk_urb (urb, dev->udev, dev->in,
@@ -372,7 +387,7 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
372 tasklet_schedule (&dev->bh); 387 tasklet_schedule (&dev->bh);
373 break; 388 break;
374 case 0: 389 case 0:
375 __skb_queue_tail (&dev->rxq, skb); 390 __usbnet_queue_skb(&dev->rxq, skb, rx_start);
376 } 391 }
377 } else { 392 } else {
378 netif_dbg(dev, ifdown, dev->net, "rx: stopped\n"); 393 netif_dbg(dev, ifdown, dev->net, "rx: stopped\n");
@@ -423,16 +438,17 @@ static void rx_complete (struct urb *urb)
423 struct skb_data *entry = (struct skb_data *) skb->cb; 438 struct skb_data *entry = (struct skb_data *) skb->cb;
424 struct usbnet *dev = entry->dev; 439 struct usbnet *dev = entry->dev;
425 int urb_status = urb->status; 440 int urb_status = urb->status;
441 enum skb_state state;
426 442
427 skb_put (skb, urb->actual_length); 443 skb_put (skb, urb->actual_length);
428 entry->state = rx_done; 444 state = rx_done;
429 entry->urb = NULL; 445 entry->urb = NULL;
430 446
431 switch (urb_status) { 447 switch (urb_status) {
432 /* success */ 448 /* success */
433 case 0: 449 case 0:
434 if (skb->len < dev->net->hard_header_len) { 450 if (skb->len < dev->net->hard_header_len) {
435 entry->state = rx_cleanup; 451 state = rx_cleanup;
436 dev->net->stats.rx_errors++; 452 dev->net->stats.rx_errors++;
437 dev->net->stats.rx_length_errors++; 453 dev->net->stats.rx_length_errors++;
438 netif_dbg(dev, rx_err, dev->net, 454 netif_dbg(dev, rx_err, dev->net,
@@ -471,7 +487,7 @@ static void rx_complete (struct urb *urb)
471 "rx throttle %d\n", urb_status); 487 "rx throttle %d\n", urb_status);
472 } 488 }
473block: 489block:
474 entry->state = rx_cleanup; 490 state = rx_cleanup;
475 entry->urb = urb; 491 entry->urb = urb;
476 urb = NULL; 492 urb = NULL;
477 break; 493 break;
@@ -482,17 +498,18 @@ block:
482 // FALLTHROUGH 498 // FALLTHROUGH
483 499
484 default: 500 default:
485 entry->state = rx_cleanup; 501 state = rx_cleanup;
486 dev->net->stats.rx_errors++; 502 dev->net->stats.rx_errors++;
487 netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status); 503 netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status);
488 break; 504 break;
489 } 505 }
490 506
491 defer_bh(dev, skb, &dev->rxq); 507 state = defer_bh(dev, skb, &dev->rxq, state);
492 508
493 if (urb) { 509 if (urb) {
494 if (netif_running (dev->net) && 510 if (netif_running (dev->net) &&
495 !test_bit (EVENT_RX_HALT, &dev->flags)) { 511 !test_bit (EVENT_RX_HALT, &dev->flags) &&
512 state != unlink_start) {
496 rx_submit (dev, urb, GFP_ATOMIC); 513 rx_submit (dev, urb, GFP_ATOMIC);
497 usb_mark_last_busy(dev->udev); 514 usb_mark_last_busy(dev->udev);
498 return; 515 return;
@@ -579,16 +596,23 @@ EXPORT_SYMBOL_GPL(usbnet_purge_paused_rxq);
579static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) 596static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q)
580{ 597{
581 unsigned long flags; 598 unsigned long flags;
582 struct sk_buff *skb, *skbnext; 599 struct sk_buff *skb;
583 int count = 0; 600 int count = 0;
584 601
585 spin_lock_irqsave (&q->lock, flags); 602 spin_lock_irqsave (&q->lock, flags);
586 skb_queue_walk_safe(q, skb, skbnext) { 603 while (!skb_queue_empty(q)) {
587 struct skb_data *entry; 604 struct skb_data *entry;
588 struct urb *urb; 605 struct urb *urb;
589 int retval; 606 int retval;
590 607
591 entry = (struct skb_data *) skb->cb; 608 skb_queue_walk(q, skb) {
609 entry = (struct skb_data *) skb->cb;
610 if (entry->state != unlink_start)
611 goto found;
612 }
613 break;
614found:
615 entry->state = unlink_start;
592 urb = entry->urb; 616 urb = entry->urb;
593 617
594 /* 618 /*
@@ -1040,8 +1064,7 @@ static void tx_complete (struct urb *urb)
1040 } 1064 }
1041 1065
1042 usb_autopm_put_interface_async(dev->intf); 1066 usb_autopm_put_interface_async(dev->intf);
1043 entry->state = tx_done; 1067 (void) defer_bh(dev, skb, &dev->txq, tx_done);
1044 defer_bh(dev, skb, &dev->txq);
1045} 1068}
1046 1069
1047/*-------------------------------------------------------------------------*/ 1070/*-------------------------------------------------------------------------*/
@@ -1097,7 +1120,6 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1097 entry = (struct skb_data *) skb->cb; 1120 entry = (struct skb_data *) skb->cb;
1098 entry->urb = urb; 1121 entry->urb = urb;
1099 entry->dev = dev; 1122 entry->dev = dev;
1100 entry->state = tx_start;
1101 entry->length = length; 1123 entry->length = length;
1102 1124
1103 usb_fill_bulk_urb (urb, dev->udev, dev->out, 1125 usb_fill_bulk_urb (urb, dev->udev, dev->out,
@@ -1156,7 +1178,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1156 break; 1178 break;
1157 case 0: 1179 case 0:
1158 net->trans_start = jiffies; 1180 net->trans_start = jiffies;
1159 __skb_queue_tail (&dev->txq, skb); 1181 __usbnet_queue_skb(&dev->txq, skb, tx_start);
1160 if (dev->txq.qlen >= TX_QLEN (dev)) 1182 if (dev->txq.qlen >= TX_QLEN (dev))
1161 netif_stop_queue (net); 1183 netif_stop_queue (net);
1162 } 1184 }
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index f7868c0d79ed..2062ea1d7c80 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1853,14 +1853,6 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1853 /*like read eeprom and so on */ 1853 /*like read eeprom and so on */
1854 rtlpriv->cfg->ops->read_eeprom_info(hw); 1854 rtlpriv->cfg->ops->read_eeprom_info(hw);
1855 1855
1856 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
1857 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
1858 err = -ENODEV;
1859 goto fail3;
1860 }
1861
1862 rtlpriv->cfg->ops->init_sw_leds(hw);
1863
1864 /*aspm */ 1856 /*aspm */
1865 rtl_pci_init_aspm(hw); 1857 rtl_pci_init_aspm(hw);
1866 1858
@@ -1879,6 +1871,14 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1879 goto fail3; 1871 goto fail3;
1880 } 1872 }
1881 1873
1874 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
1875 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
1876 err = -ENODEV;
1877 goto fail3;
1878 }
1879
1880 rtlpriv->cfg->ops->init_sw_leds(hw);
1881
1882 err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); 1882 err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group);
1883 if (err) { 1883 if (err) {
1884 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1884 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index d04dbda13f5a..a6049d7d51b3 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -971,11 +971,6 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
971 rtlpriv->cfg->ops->read_chip_version(hw); 971 rtlpriv->cfg->ops->read_chip_version(hw);
972 /*like read eeprom and so on */ 972 /*like read eeprom and so on */
973 rtlpriv->cfg->ops->read_eeprom_info(hw); 973 rtlpriv->cfg->ops->read_eeprom_info(hw);
974 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
975 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
976 goto error_out;
977 }
978 rtlpriv->cfg->ops->init_sw_leds(hw);
979 err = _rtl_usb_init(hw); 974 err = _rtl_usb_init(hw);
980 if (err) 975 if (err)
981 goto error_out; 976 goto error_out;
@@ -987,6 +982,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
987 "Can't allocate sw for mac80211\n"); 982 "Can't allocate sw for mac80211\n");
988 goto error_out; 983 goto error_out;
989 } 984 }
985 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
986 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
987 goto error_out;
988 }
989 rtlpriv->cfg->ops->init_sw_leds(hw);
990 990
991 return 0; 991 return 0;
992error_out: 992error_out: