aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-17 12:14:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-17 12:14:21 -0400
commit32535bd5637d3152f944f124bcc82d498892ba1b (patch)
tree99d33b58cfec44f4cf95fad5efa75aea0dd7d60b /drivers/net
parent0b623f871d7c993fac8ad7aaaa8f5f3cdb8ed480 (diff)
parent3a36dd068f4308461661d28e8e14e11e426eba6b (diff)
Merge branch 'v3.5-for-usb' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into usb-next
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_main.c16
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c23
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c2
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c4
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c24
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h3
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c43
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c10
-rw-r--r--drivers/net/ethernet/micrel/ks8851.c7
-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.c14
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c4
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rx.c21
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h1
22 files changed, 172 insertions, 89 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_main.c b/drivers/net/bonding/bond_main.c
index 62d2409bb293..bc13b3d77432 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> */
@@ -2723,7 +2728,7 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
2723 } 2728 }
2724} 2729}
2725 2730
2726static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, 2731static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2727 struct slave *slave) 2732 struct slave *slave)
2728{ 2733{
2729 struct arphdr *arp; 2734 struct arphdr *arp;
@@ -2731,7 +2736,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2731 __be32 sip, tip; 2736 __be32 sip, tip;
2732 2737
2733 if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) 2738 if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
2734 return; 2739 return RX_HANDLER_ANOTHER;
2735 2740
2736 read_lock(&bond->lock); 2741 read_lock(&bond->lock);
2737 2742
@@ -2776,6 +2781,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2776 2781
2777out_unlock: 2782out_unlock:
2778 read_unlock(&bond->lock); 2783 read_unlock(&bond->lock);
2784 return RX_HANDLER_ANOTHER;
2779} 2785}
2780 2786
2781/* 2787/*
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index e077d2508727..6af310195bae 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -9122,13 +9122,34 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp)
9122 return bnx2x_prev_mcp_done(bp); 9122 return bnx2x_prev_mcp_done(bp);
9123} 9123}
9124 9124
9125/* previous driver DMAE transaction may have occurred when pre-boot stage ended
9126 * and boot began, or when kdump kernel was loaded. Either case would invalidate
9127 * the addresses of the transaction, resulting in was-error bit set in the pci
9128 * causing all hw-to-host pcie transactions to timeout. If this happened we want
9129 * to clear the interrupt which detected this from the pglueb and the was done
9130 * bit
9131 */
9132static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
9133{
9134 u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);
9135 if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) {
9136 BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing");
9137 REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, 1 << BP_FUNC(bp));
9138 }
9139}
9140
9125static int __devinit bnx2x_prev_unload(struct bnx2x *bp) 9141static int __devinit bnx2x_prev_unload(struct bnx2x *bp)
9126{ 9142{
9127 int time_counter = 10; 9143 int time_counter = 10;
9128 u32 rc, fw, hw_lock_reg, hw_lock_val; 9144 u32 rc, fw, hw_lock_reg, hw_lock_val;
9129 BNX2X_DEV_INFO("Entering Previous Unload Flow\n"); 9145 BNX2X_DEV_INFO("Entering Previous Unload Flow\n");
9130 9146
9131 /* Release previously held locks */ 9147 /* clear hw from errors which may have resulted from an interrupted
9148 * dmae transaction.
9149 */
9150 bnx2x_prev_interrupted_dmae(bp);
9151
9152 /* Release previously held locks */
9132 hw_lock_reg = (BP_FUNC(bp) <= 5) ? 9153 hw_lock_reg = (BP_FUNC(bp) <= 5) ?
9133 (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) : 9154 (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) :
9134 (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8); 9155 (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8);
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/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 4348b6fd44fa..37caa8885c2a 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -3380,7 +3380,7 @@ static void e1000_dump(struct e1000_adapter *adapter)
3380 for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { 3380 for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
3381 struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i); 3381 struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i);
3382 struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i]; 3382 struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i];
3383 struct my_u { u64 a; u64 b; }; 3383 struct my_u { __le64 a; __le64 b; };
3384 struct my_u *u = (struct my_u *)tx_desc; 3384 struct my_u *u = (struct my_u *)tx_desc;
3385 const char *type; 3385 const char *type;
3386 3386
@@ -3424,7 +3424,7 @@ rx_ring_summary:
3424 for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) { 3424 for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) {
3425 struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i); 3425 struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i);
3426 struct e1000_buffer *buffer_info = &rx_ring->buffer_info[i]; 3426 struct e1000_buffer *buffer_info = &rx_ring->buffer_info[i];
3427 struct my_u { u64 a; u64 b; }; 3427 struct my_u { __le64 a; __le64 b; };
3428 struct my_u *u = (struct my_u *)rx_desc; 3428 struct my_u *u = (struct my_u *)rx_desc;
3429 const char *type; 3429 const char *type;
3430 3430
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 5ec31598ee47..8683ca4748c8 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1111,9 +1111,12 @@ msi_only:
1111 adapter->flags |= IGB_FLAG_HAS_MSI; 1111 adapter->flags |= IGB_FLAG_HAS_MSI;
1112out: 1112out:
1113 /* Notify the stack of the (possibly) reduced queue counts. */ 1113 /* Notify the stack of the (possibly) reduced queue counts. */
1114 rtnl_lock();
1114 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); 1115 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
1115 return netif_set_real_num_rx_queues(adapter->netdev, 1116 err = netif_set_real_num_rx_queues(adapter->netdev,
1116 adapter->num_rx_queues); 1117 adapter->num_rx_queues);
1118 rtnl_unlock();
1119 return err;
1117} 1120}
1118 1121
1119/** 1122/**
@@ -2771,8 +2774,6 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
2771 2774
2772 txdctl |= E1000_TXDCTL_QUEUE_ENABLE; 2775 txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
2773 wr32(E1000_TXDCTL(reg_idx), txdctl); 2776 wr32(E1000_TXDCTL(reg_idx), txdctl);
2774
2775 netdev_tx_reset_queue(txring_txq(ring));
2776} 2777}
2777 2778
2778/** 2779/**
@@ -3282,6 +3283,8 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
3282 igb_unmap_and_free_tx_resource(tx_ring, buffer_info); 3283 igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
3283 } 3284 }
3284 3285
3286 netdev_tx_reset_queue(txring_txq(tx_ring));
3287
3285 size = sizeof(struct igb_tx_buffer) * tx_ring->count; 3288 size = sizeof(struct igb_tx_buffer) * tx_ring->count;
3286 memset(tx_ring->tx_buffer_info, 0, size); 3289 memset(tx_ring->tx_buffer_info, 0, size);
3287 3290
@@ -6796,18 +6799,7 @@ static int igb_resume(struct device *dev)
6796 pci_enable_wake(pdev, PCI_D3hot, 0); 6799 pci_enable_wake(pdev, PCI_D3hot, 0);
6797 pci_enable_wake(pdev, PCI_D3cold, 0); 6800 pci_enable_wake(pdev, PCI_D3cold, 0);
6798 6801
6799 if (!rtnl_is_locked()) { 6802 if (igb_init_interrupt_scheme(adapter)) {
6800 /*
6801 * shut up ASSERT_RTNL() warning in
6802 * netif_set_real_num_tx/rx_queues.
6803 */
6804 rtnl_lock();
6805 err = igb_init_interrupt_scheme(adapter);
6806 rtnl_unlock();
6807 } else {
6808 err = igb_init_interrupt_scheme(adapter);
6809 }
6810 if (err) {
6811 dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); 6803 dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
6812 return -ENOMEM; 6804 return -ENOMEM;
6813 } 6805 }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 74e192107f9a..81b155589532 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -574,9 +574,6 @@ extern struct ixgbe_info ixgbe_82599_info;
574extern struct ixgbe_info ixgbe_X540_info; 574extern struct ixgbe_info ixgbe_X540_info;
575#ifdef CONFIG_IXGBE_DCB 575#ifdef CONFIG_IXGBE_DCB
576extern const struct dcbnl_rtnl_ops dcbnl_ops; 576extern const struct dcbnl_rtnl_ops dcbnl_ops;
577extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg,
578 struct ixgbe_dcb_config *dst_dcb_cfg,
579 int tc_max);
580#endif 577#endif
581 578
582extern char ixgbe_driver_name[]; 579extern char ixgbe_driver_name[];
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 652e4b09546d..32e5c02ff6d0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -44,18 +44,26 @@
44#define DCB_NO_HW_CHG 1 /* DCB configuration did not change */ 44#define DCB_NO_HW_CHG 1 /* DCB configuration did not change */
45#define DCB_HW_CHG 2 /* DCB configuration changed, no reset */ 45#define DCB_HW_CHG 2 /* DCB configuration changed, no reset */
46 46
47int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *scfg, 47static int ixgbe_copy_dcb_cfg(struct ixgbe_adapter *adapter, int tc_max)
48 struct ixgbe_dcb_config *dcfg, int tc_max)
49{ 48{
49 struct ixgbe_dcb_config *scfg = &adapter->temp_dcb_cfg;
50 struct ixgbe_dcb_config *dcfg = &adapter->dcb_cfg;
50 struct tc_configuration *src = NULL; 51 struct tc_configuration *src = NULL;
51 struct tc_configuration *dst = NULL; 52 struct tc_configuration *dst = NULL;
52 int i, j; 53 int i, j;
53 int tx = DCB_TX_CONFIG; 54 int tx = DCB_TX_CONFIG;
54 int rx = DCB_RX_CONFIG; 55 int rx = DCB_RX_CONFIG;
55 int changes = 0; 56 int changes = 0;
57#ifdef IXGBE_FCOE
58 struct dcb_app app = {
59 .selector = DCB_APP_IDTYPE_ETHTYPE,
60 .protocol = ETH_P_FCOE,
61 };
62 u8 up = dcb_getapp(adapter->netdev, &app);
56 63
57 if (!scfg || !dcfg) 64 if (up && !(up & (1 << adapter->fcoe.up)))
58 return changes; 65 changes |= BIT_APP_UPCHG;
66#endif
59 67
60 for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) { 68 for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) {
61 src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0]; 69 src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0];
@@ -332,28 +340,12 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
332 struct ixgbe_adapter *adapter = netdev_priv(netdev); 340 struct ixgbe_adapter *adapter = netdev_priv(netdev);
333 int ret = DCB_NO_HW_CHG; 341 int ret = DCB_NO_HW_CHG;
334 int i; 342 int i;
335#ifdef IXGBE_FCOE
336 struct dcb_app app = {
337 .selector = DCB_APP_IDTYPE_ETHTYPE,
338 .protocol = ETH_P_FCOE,
339 };
340 u8 up;
341
342 /* In IEEE mode, use the IEEE Ethertype selector value */
343 if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) {
344 app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE;
345 up = dcb_ieee_getapp_mask(netdev, &app);
346 } else {
347 up = dcb_getapp(netdev, &app);
348 }
349#endif
350 343
351 /* Fail command if not in CEE mode */ 344 /* Fail command if not in CEE mode */
352 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) 345 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
353 return ret; 346 return ret;
354 347
355 adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, 348 adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(adapter,
356 &adapter->dcb_cfg,
357 MAX_TRAFFIC_CLASS); 349 MAX_TRAFFIC_CLASS);
358 if (!adapter->dcb_set_bitmap) 350 if (!adapter->dcb_set_bitmap)
359 return ret; 351 return ret;
@@ -440,8 +432,13 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
440 * FCoE is using changes. This happens if the APP info 432 * FCoE is using changes. This happens if the APP info
441 * changes or the up2tc mapping is updated. 433 * changes or the up2tc mapping is updated.
442 */ 434 */
443 if ((up && !(up & (1 << adapter->fcoe.up))) || 435 if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
444 (adapter->dcb_set_bitmap & BIT_APP_UPCHG)) { 436 struct dcb_app app = {
437 .selector = DCB_APP_IDTYPE_ETHTYPE,
438 .protocol = ETH_P_FCOE,
439 };
440 u8 up = dcb_getapp(netdev, &app);
441
445 adapter->fcoe.up = ffs(up) - 1; 442 adapter->fcoe.up = ffs(up) - 1;
446 ixgbe_dcbnl_devreset(netdev); 443 ixgbe_dcbnl_devreset(netdev);
447 ret = DCB_HW_CHG_RST; 444 ret = DCB_HW_CHG_RST;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 31a2bf76a346..cfe7d269590c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -1780,6 +1780,8 @@ static u16 ixgbe_clean_test_rings(struct ixgbe_ring *rx_ring,
1780 rx_desc = IXGBE_RX_DESC(rx_ring, rx_ntc); 1780 rx_desc = IXGBE_RX_DESC(rx_ring, rx_ntc);
1781 } 1781 }
1782 1782
1783 netdev_tx_reset_queue(txring_txq(tx_ring));
1784
1783 /* re-map buffers to ring, store next to clean values */ 1785 /* re-map buffers to ring, store next to clean values */
1784 ixgbe_alloc_rx_buffers(rx_ring, count); 1786 ixgbe_alloc_rx_buffers(rx_ring, count);
1785 rx_ring->next_to_clean = rx_ntc; 1787 rx_ring->next_to_clean = rx_ntc;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 88f6b2e9b72d..467948e9ecd9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2671,8 +2671,6 @@ void ixgbe_configure_tx_ring(struct ixgbe_adapter *adapter,
2671 /* enable queue */ 2671 /* enable queue */
2672 IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl); 2672 IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl);
2673 2673
2674 netdev_tx_reset_queue(txring_txq(ring));
2675
2676 /* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */ 2674 /* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */
2677 if (hw->mac.type == ixgbe_mac_82598EB && 2675 if (hw->mac.type == ixgbe_mac_82598EB &&
2678 !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP)) 2676 !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP))
@@ -4167,6 +4165,8 @@ static void ixgbe_clean_tx_ring(struct ixgbe_ring *tx_ring)
4167 ixgbe_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); 4165 ixgbe_unmap_and_free_tx_resource(tx_ring, tx_buffer_info);
4168 } 4166 }
4169 4167
4168 netdev_tx_reset_queue(txring_txq(tx_ring));
4169
4170 size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count; 4170 size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count;
4171 memset(tx_ring->tx_buffer_info, 0, size); 4171 memset(tx_ring->tx_buffer_info, 0, size);
4172 4172
@@ -4418,8 +4418,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
4418 adapter->dcb_cfg.pfc_mode_enable = false; 4418 adapter->dcb_cfg.pfc_mode_enable = false;
4419 adapter->dcb_set_bitmap = 0x00; 4419 adapter->dcb_set_bitmap = 0x00;
4420 adapter->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE; 4420 adapter->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE;
4421 ixgbe_copy_dcb_cfg(&adapter->dcb_cfg, &adapter->temp_dcb_cfg, 4421 memcpy(&adapter->temp_dcb_cfg, &adapter->dcb_cfg,
4422 MAX_TRAFFIC_CLASS); 4422 sizeof(adapter->temp_dcb_cfg));
4423 4423
4424#endif 4424#endif
4425 4425
@@ -4866,10 +4866,12 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
4866 netif_device_detach(netdev); 4866 netif_device_detach(netdev);
4867 4867
4868 if (netif_running(netdev)) { 4868 if (netif_running(netdev)) {
4869 rtnl_lock();
4869 ixgbe_down(adapter); 4870 ixgbe_down(adapter);
4870 ixgbe_free_irq(adapter); 4871 ixgbe_free_irq(adapter);
4871 ixgbe_free_all_tx_resources(adapter); 4872 ixgbe_free_all_tx_resources(adapter);
4872 ixgbe_free_all_rx_resources(adapter); 4873 ixgbe_free_all_rx_resources(adapter);
4874 rtnl_unlock();
4873 } 4875 }
4874 4876
4875 ixgbe_clear_interrupt_scheme(adapter); 4877 ixgbe_clear_interrupt_scheme(adapter);
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/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index f54509377efa..ce6b44d1f252 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -61,8 +61,12 @@
61#define R8169_MSG_DEFAULT \ 61#define R8169_MSG_DEFAULT \
62 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN) 62 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN)
63 63
64#define TX_BUFFS_AVAIL(tp) \ 64#define TX_SLOTS_AVAIL(tp) \
65 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1) 65 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx)
66
67/* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */
68#define TX_FRAGS_READY_FOR(tp,nr_frags) \
69 (TX_SLOTS_AVAIL(tp) >= (nr_frags + 1))
66 70
67/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). 71/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
68 The RTL chips use a 64 element hash table based on the Ethernet CRC. */ 72 The RTL chips use a 64 element hash table based on the Ethernet CRC. */
@@ -5115,7 +5119,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5115 u32 opts[2]; 5119 u32 opts[2];
5116 int frags; 5120 int frags;
5117 5121
5118 if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { 5122 if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) {
5119 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); 5123 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
5120 goto err_stop_0; 5124 goto err_stop_0;
5121 } 5125 }
@@ -5169,7 +5173,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5169 5173
5170 mmiowb(); 5174 mmiowb();
5171 5175
5172 if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { 5176 if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {
5173 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must 5177 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must
5174 * not miss a ring update when it notices a stopped queue. 5178 * not miss a ring update when it notices a stopped queue.
5175 */ 5179 */
@@ -5183,7 +5187,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5183 * can't. 5187 * can't.
5184 */ 5188 */
5185 smp_mb(); 5189 smp_mb();
5186 if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) 5190 if (TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS))
5187 netif_wake_queue(dev); 5191 netif_wake_queue(dev);
5188 } 5192 }
5189 5193
@@ -5306,7 +5310,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp)
5306 */ 5310 */
5307 smp_mb(); 5311 smp_mb();
5308 if (netif_queue_stopped(dev) && 5312 if (netif_queue_stopped(dev) &&
5309 (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { 5313 TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {
5310 netif_wake_queue(dev); 5314 netif_wake_queue(dev);
5311 } 5315 }
5312 /* 5316 /*
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 3cbfbffe3f00..4a0005342e65 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1349,7 +1349,7 @@ static int efx_probe_interrupts(struct efx_nic *efx)
1349 } 1349 }
1350 1350
1351 /* RSS might be usable on VFs even if it is disabled on the PF */ 1351 /* RSS might be usable on VFs even if it is disabled on the PF */
1352 efx->rss_spread = (efx->n_rx_channels > 1 ? 1352 efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ?
1353 efx->n_rx_channels : efx_vf_size(efx)); 1353 efx->n_rx_channels : efx_vf_size(efx));
1354 1354
1355 return 0; 1355 return 0;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index f975afdc315c..025367a94add 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -259,7 +259,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
259 259
260xmit_world: 260xmit_world:
261 skb->ip_summed = ip_summed; 261 skb->ip_summed = ip_summed;
262 skb_set_dev(skb, vlan->lowerdev); 262 skb->dev = vlan->lowerdev;
263 return dev_queue_xmit(skb); 263 return dev_queue_xmit(skb);
264} 264}
265 265
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 0427c6561c84..cb8fd5069dbe 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>
@@ -759,6 +760,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
759 struct macvlan_dev *vlan; 760 struct macvlan_dev *vlan;
760 int ret; 761 int ret;
761 int vnet_hdr_len = 0; 762 int vnet_hdr_len = 0;
763 int vlan_offset = 0;
764 int copied;
762 765
763 if (q->flags & IFF_VNET_HDR) { 766 if (q->flags & IFF_VNET_HDR) {
764 struct virtio_net_hdr vnet_hdr; 767 struct virtio_net_hdr vnet_hdr;
@@ -773,18 +776,48 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
773 if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) 776 if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr)))
774 return -EFAULT; 777 return -EFAULT;
775 } 778 }
779 copied = vnet_hdr_len;
780
781 if (!vlan_tx_tag_present(skb))
782 len = min_t(int, skb->len, len);
783 else {
784 int copy;
785 struct {
786 __be16 h_vlan_proto;
787 __be16 h_vlan_TCI;
788 } veth;
789 veth.h_vlan_proto = htons(ETH_P_8021Q);
790 veth.h_vlan_TCI = htons(vlan_tx_tag_get(skb));
791
792 vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto);
793 len = min_t(int, skb->len + VLAN_HLEN, len);
794
795 copy = min_t(int, vlan_offset, len);
796 ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy);
797 len -= copy;
798 copied += copy;
799 if (ret || !len)
800 goto done;
801
802 copy = min_t(int, sizeof(veth), len);
803 ret = memcpy_toiovecend(iv, (void *)&veth, copied, copy);
804 len -= copy;
805 copied += copy;
806 if (ret || !len)
807 goto done;
808 }
776 809
777 len = min_t(int, skb->len, len); 810 ret = skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len);
778 811 copied += len;
779 ret = skb_copy_datagram_const_iovec(skb, 0, iv, vnet_hdr_len, len);
780 812
813done:
781 rcu_read_lock_bh(); 814 rcu_read_lock_bh();
782 vlan = rcu_dereference_bh(q->vlan); 815 vlan = rcu_dereference_bh(q->vlan);
783 if (vlan) 816 if (vlan)
784 macvlan_count_rx(vlan, len, ret == 0, 0); 817 macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0);
785 rcu_read_unlock_bh(); 818 rcu_read_unlock_bh();
786 819
787 return ret ? ret : (len + vnet_hdr_len); 820 return ret ? ret : copied;
788} 821}
789 822
790static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb, 823static 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 90a30026a931..00880edba048 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -83,6 +83,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
83 struct cdc_state *info = (void *) &dev->data; 83 struct cdc_state *info = (void *) &dev->data;
84 int status; 84 int status;
85 int rndis; 85 int rndis;
86 bool android_rndis_quirk = false;
86 struct usb_driver *driver = driver_of(intf); 87 struct usb_driver *driver = driver_of(intf);
87 struct usb_cdc_mdlm_desc *desc = NULL; 88 struct usb_cdc_mdlm_desc *desc = NULL;
88 struct usb_cdc_mdlm_detail_desc *detail = NULL; 89 struct usb_cdc_mdlm_detail_desc *detail = NULL;
@@ -195,6 +196,11 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
195 info->control, 196 info->control,
196 info->u->bSlaveInterface0, 197 info->u->bSlaveInterface0,
197 info->data); 198 info->data);
199 /* fall back to hard-wiring for RNDIS */
200 if (rndis) {
201 android_rndis_quirk = true;
202 goto next_desc;
203 }
198 goto bad_desc; 204 goto bad_desc;
199 } 205 }
200 if (info->control != intf) { 206 if (info->control != intf) {
@@ -271,11 +277,15 @@ next_desc:
271 /* Microsoft ActiveSync based and some regular RNDIS devices lack the 277 /* Microsoft ActiveSync based and some regular RNDIS devices lack the
272 * CDC descriptors, so we'll hard-wire the interfaces and not check 278 * CDC descriptors, so we'll hard-wire the interfaces and not check
273 * for descriptors. 279 * for descriptors.
280 *
281 * Some Android RNDIS devices have a CDC Union descriptor pointing
282 * to non-existing interfaces. Ignore that and attempt the same
283 * hard-wired 0 and 1 interfaces.
274 */ 284 */
275 if (rndis && !info->u) { 285 if (rndis && (!info->u || android_rndis_quirk)) {
276 info->control = usb_ifnum_to_if(dev->udev, 0); 286 info->control = usb_ifnum_to_if(dev->udev, 0);
277 info->data = usb_ifnum_to_if(dev->udev, 1); 287 info->data = usb_ifnum_to_if(dev->udev, 1);
278 if (!info->control || !info->data) { 288 if (!info->control || !info->data || info->control != intf) {
279 dev_dbg(&intf->dev, 289 dev_dbg(&intf->dev,
280 "rndis: master #0/%p slave #1/%p\n", 290 "rndis: master #0/%p slave #1/%p\n",
281 info->control, 291 info->control,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index deb6cfb2959a..600aca9fe6b1 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -373,7 +373,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah,
373 else 373 else
374 spur_subchannel_sd = 0; 374 spur_subchannel_sd = 0;
375 375
376 spur_freq_sd = (freq_offset << 9) / 11; 376 spur_freq_sd = ((freq_offset + 10) << 9) / 11;
377 377
378 } else { 378 } else {
379 if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, 379 if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL,
@@ -382,7 +382,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah,
382 else 382 else
383 spur_subchannel_sd = 1; 383 spur_subchannel_sd = 1;
384 384
385 spur_freq_sd = (freq_offset << 9) / 11; 385 spur_freq_sd = ((freq_offset - 10) << 9) / 11;
386 386
387 } 387 }
388 388
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index eb3829b03cd3..e2b34e1563f4 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -2637,6 +2637,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data)
2637 /* after stopping the bus, exit thread */ 2637 /* after stopping the bus, exit thread */
2638 brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); 2638 brcmf_sdbrcm_bus_stop(bus->sdiodev->dev);
2639 bus->dpc_tsk = NULL; 2639 bus->dpc_tsk = NULL;
2640 spin_lock_irqsave(&bus->dpc_tl_lock, flags);
2640 break; 2641 break;
2641 } 2642 }
2642 2643
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
index f4b84d1596e3..22474608a70b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
@@ -773,8 +773,7 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
773 struct sk_buff *skb; 773 struct sk_buff *skb;
774 __le16 fc = hdr->frame_control; 774 __le16 fc = hdr->frame_control;
775 struct iwl_rxon_context *ctx; 775 struct iwl_rxon_context *ctx;
776 struct page *p; 776 unsigned int hdrlen, fraglen;
777 int offset;
778 777
779 /* We only process data packets if the interface is open */ 778 /* We only process data packets if the interface is open */
780 if (unlikely(!priv->is_open)) { 779 if (unlikely(!priv->is_open)) {
@@ -788,16 +787,24 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
788 iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats)) 787 iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats))
789 return; 788 return;
790 789
791 skb = dev_alloc_skb(128); 790 /* Dont use dev_alloc_skb(), we'll have enough headroom once
791 * ieee80211_hdr pulled.
792 */
793 skb = alloc_skb(128, GFP_ATOMIC);
792 if (!skb) { 794 if (!skb) {
793 IWL_ERR(priv, "dev_alloc_skb failed\n"); 795 IWL_ERR(priv, "alloc_skb failed\n");
794 return; 796 return;
795 } 797 }
798 hdrlen = min_t(unsigned int, len, skb_tailroom(skb));
799 memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
800 fraglen = len - hdrlen;
796 801
797 offset = (void *)hdr - rxb_addr(rxb); 802 if (fraglen) {
798 p = rxb_steal_page(rxb); 803 int offset = (void *)hdr + hdrlen - rxb_addr(rxb);
799 skb_add_rx_frag(skb, 0, p, offset, len, len);
800 804
805 skb_add_rx_frag(skb, 0, rxb_steal_page(rxb), offset,
806 fraglen, rxb->truesize);
807 }
801 iwl_update_stats(priv, false, fc, len); 808 iwl_update_stats(priv, false, fc, len);
802 809
803 /* 810 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
index 8b1a7988e176..aa7aea168138 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
@@ -374,8 +374,9 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans,
374 if (WARN_ON(!rxb)) 374 if (WARN_ON(!rxb))
375 return; 375 return;
376 376
377 rxcb.truesize = PAGE_SIZE << hw_params(trans).rx_page_order;
377 dma_unmap_page(trans->dev, rxb->page_dma, 378 dma_unmap_page(trans->dev, rxb->page_dma,
378 PAGE_SIZE << hw_params(trans).rx_page_order, 379 rxcb.truesize,
379 DMA_FROM_DEVICE); 380 DMA_FROM_DEVICE);
380 381
381 rxcb._page = rxb->page; 382 rxcb._page = rxb->page;
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 0c81cbaa8088..fdf97886a5e4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -260,6 +260,7 @@ static inline void iwl_free_resp(struct iwl_host_cmd *cmd)
260 260
261struct iwl_rx_cmd_buffer { 261struct iwl_rx_cmd_buffer {
262 struct page *_page; 262 struct page *_page;
263 unsigned int truesize;
263}; 264};
264 265
265static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r) 266static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r)