aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-19 23:29:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-19 23:29:15 -0500
commit9eb127cc04c4005c8c0708ce92146d91da862b42 (patch)
treebebab2c136110edf32d6cf32f898871df9fbb0e6 /drivers/net
parente32795503de02da4e7e74a5e039cc268f6a0ecfb (diff)
parent152a2a8b5e1d4cbe91a7c66f1028db15164a3766 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Really fix tuntap SKB use after free bug, from Eric Dumazet. 2) Adjust SKB data pointer to point past the transport header before calling icmpv6_notify() so that the headers are in the state which that function expects. From Duan Jiong. 3) Fix ambiguities in the new tuntap multi-queue APIs. From Jason Wang. 4) mISDN needs to use del_timer_sync(), from Konstantin Khlebnikov. 5) Don't destroy mutex after freeing up device private in mac802154, fix also from Konstantin Khlebnikov. 6) Fix INET request socket leak in TCP and DCCP, from Christoph Paasch. 7) SCTP HMAC kconfig rework, from Neil Horman. 8) Fix SCTP jprobes function signature, otherwise things explode, from Daniel Borkmann. 9) Fix typo in ipv6-offload Makefile variable reference, from Simon Arlott. 10) Don't fail USBNET open just because remote wakeup isn't supported, from Oliver Neukum. 11) be2net driver bug fixes from Sathya Perla. 12) SOLOS PCI ATM driver bug fixes from Nathan Williams and David Woodhouse. 13) Fix MTU changing regression in 8139cp driver, from John Greene. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (45 commits) solos-pci: ensure all TX packets are aligned to 4 bytes solos-pci: add firmware upgrade support for new models solos-pci: remove superfluous debug output solos-pci: add GPIO support for newer versions on Geos board 8139cp: Prevent dev_close/cp_interrupt race on MTU change net: qmi_wwan: add ZTE MF880 drivers/net: Use of_match_ptr() macro in smsc911x.c drivers/net: Use of_match_ptr() macro in smc91x.c ipv6: addrconf.c: remove unnecessary "if" bridge: Correctly encode addresses when dumping mdb entries bridge: Do not unregister all PF_BRIDGE rtnl operations use generic usbnet_manage_power() usbnet: generic manage_power() usbnet: handle PM failure gracefully ksz884x: fix receive polling race condition qlcnic: update driver version qlcnic: fix unused variable warnings net: fec: forbid FEC_PTP on SoCs that do not support be2net: fix wrong frag_idx reported by RX CQ be2net: fix be_close() to ensure all events are ack'ed ...
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_main.c2
-rw-r--r--drivers/net/can/sja1000/sja1000_of_platform.c2
-rw-r--r--drivers/net/ethernet/emulex/benet/be.h2
-rw-r--r--drivers/net/ethernet/emulex/benet/be_cmds.c5
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c59
-rw-r--r--drivers/net/ethernet/freescale/Kconfig3
-rw-r--r--drivers/net/ethernet/micrel/ksz884x.c12
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic.h4
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c5
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c5
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c5
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c3
-rw-r--r--drivers/net/ethernet/realtek/8139cp.c18
-rw-r--r--drivers/net/ethernet/smsc/smc91x.c4
-rw-r--r--drivers/net/ethernet/smsc/smsc911x.c4
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac.h6
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c22
-rw-r--r--drivers/net/ethernet/ti/cpts.c2
-rw-r--r--drivers/net/tun.c87
-rw-r--r--drivers/net/usb/cdc_ether.c45
-rw-r--r--drivers/net/usb/cdc_ncm.c10
-rw-r--r--drivers/net/usb/qmi_wwan.c15
-rw-r--r--drivers/net/usb/usbnet.c25
-rw-r--r--drivers/net/wimax/i2400m/i2400m-usb.h3
-rw-r--r--drivers/net/wimax/i2400m/usb.c6
-rw-r--r--drivers/net/wireless/Makefile2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c8
27 files changed, 237 insertions, 127 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index ef2cb2418535..b7d45f367d4a 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4431,8 +4431,6 @@ static void bond_uninit(struct net_device *bond_dev)
4431 4431
4432 list_del(&bond->bond_list); 4432 list_del(&bond->bond_list);
4433 4433
4434 bond_work_cancel_all(bond);
4435
4436 bond_debug_unregister(bond); 4434 bond_debug_unregister(bond);
4437 4435
4438 __hw_addr_flush(&bond->mc_list); 4436 __hw_addr_flush(&bond->mc_list);
diff --git a/drivers/net/can/sja1000/sja1000_of_platform.c b/drivers/net/can/sja1000/sja1000_of_platform.c
index 0f5917000aa2..6433b81256cd 100644
--- a/drivers/net/can/sja1000/sja1000_of_platform.c
+++ b/drivers/net/can/sja1000/sja1000_of_platform.c
@@ -121,7 +121,7 @@ static int sja1000_ofp_probe(struct platform_device *ofdev)
121 } 121 }
122 122
123 irq = irq_of_parse_and_map(np, 0); 123 irq = irq_of_parse_and_map(np, 0);
124 if (irq == NO_IRQ) { 124 if (irq == 0) {
125 dev_err(&ofdev->dev, "no irq found\n"); 125 dev_err(&ofdev->dev, "no irq found\n");
126 err = -ENODEV; 126 err = -ENODEV;
127 goto exit_unmap_mem; 127 goto exit_unmap_mem;
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index abf26c7c1d19..3bc1912afba9 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -616,7 +616,7 @@ static inline bool be_error(struct be_adapter *adapter)
616 return adapter->eeh_error || adapter->hw_error || adapter->fw_timeout; 616 return adapter->eeh_error || adapter->hw_error || adapter->fw_timeout;
617} 617}
618 618
619static inline bool be_crit_error(struct be_adapter *adapter) 619static inline bool be_hw_error(struct be_adapter *adapter)
620{ 620{
621 return adapter->eeh_error || adapter->hw_error; 621 return adapter->eeh_error || adapter->hw_error;
622} 622}
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index f2875aa47661..8a250c38fb82 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -298,7 +298,12 @@ void be_async_mcc_enable(struct be_adapter *adapter)
298 298
299void be_async_mcc_disable(struct be_adapter *adapter) 299void be_async_mcc_disable(struct be_adapter *adapter)
300{ 300{
301 spin_lock_bh(&adapter->mcc_cq_lock);
302
301 adapter->mcc_obj.rearm_cq = false; 303 adapter->mcc_obj.rearm_cq = false;
304 be_cq_notify(adapter, adapter->mcc_obj.cq.id, false, 0);
305
306 spin_unlock_bh(&adapter->mcc_cq_lock);
302} 307}
303 308
304int be_process_mcc(struct be_adapter *adapter) 309int be_process_mcc(struct be_adapter *adapter)
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index f95612b907ae..9dca22be8125 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1689,15 +1689,41 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo)
1689 struct be_queue_info *rxq = &rxo->q; 1689 struct be_queue_info *rxq = &rxo->q;
1690 struct be_queue_info *rx_cq = &rxo->cq; 1690 struct be_queue_info *rx_cq = &rxo->cq;
1691 struct be_rx_compl_info *rxcp; 1691 struct be_rx_compl_info *rxcp;
1692 struct be_adapter *adapter = rxo->adapter;
1693 int flush_wait = 0;
1692 u16 tail; 1694 u16 tail;
1693 1695
1694 /* First cleanup pending rx completions */ 1696 /* Consume pending rx completions.
1695 while ((rxcp = be_rx_compl_get(rxo)) != NULL) { 1697 * Wait for the flush completion (identified by zero num_rcvd)
1696 be_rx_compl_discard(rxo, rxcp); 1698 * to arrive. Notify CQ even when there are no more CQ entries
1697 be_cq_notify(rxo->adapter, rx_cq->id, false, 1); 1699 * for HW to flush partially coalesced CQ entries.
1700 * In Lancer, there is no need to wait for flush compl.
1701 */
1702 for (;;) {
1703 rxcp = be_rx_compl_get(rxo);
1704 if (rxcp == NULL) {
1705 if (lancer_chip(adapter))
1706 break;
1707
1708 if (flush_wait++ > 10 || be_hw_error(adapter)) {
1709 dev_warn(&adapter->pdev->dev,
1710 "did not receive flush compl\n");
1711 break;
1712 }
1713 be_cq_notify(adapter, rx_cq->id, true, 0);
1714 mdelay(1);
1715 } else {
1716 be_rx_compl_discard(rxo, rxcp);
1717 be_cq_notify(adapter, rx_cq->id, true, 1);
1718 if (rxcp->num_rcvd == 0)
1719 break;
1720 }
1698 } 1721 }
1699 1722
1700 /* Then free posted rx buffer that were not used */ 1723 /* After cleanup, leave the CQ in unarmed state */
1724 be_cq_notify(adapter, rx_cq->id, false, 0);
1725
1726 /* Then free posted rx buffers that were not used */
1701 tail = (rxq->head + rxq->len - atomic_read(&rxq->used)) % rxq->len; 1727 tail = (rxq->head + rxq->len - atomic_read(&rxq->used)) % rxq->len;
1702 for (; atomic_read(&rxq->used) > 0; index_inc(&tail, rxq->len)) { 1728 for (; atomic_read(&rxq->used) > 0; index_inc(&tail, rxq->len)) {
1703 page_info = get_rx_page_info(rxo, tail); 1729 page_info = get_rx_page_info(rxo, tail);
@@ -2157,7 +2183,7 @@ void be_detect_error(struct be_adapter *adapter)
2157 u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0; 2183 u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0;
2158 u32 i; 2184 u32 i;
2159 2185
2160 if (be_crit_error(adapter)) 2186 if (be_hw_error(adapter))
2161 return; 2187 return;
2162 2188
2163 if (lancer_chip(adapter)) { 2189 if (lancer_chip(adapter)) {
@@ -2398,13 +2424,22 @@ static int be_close(struct net_device *netdev)
2398 2424
2399 be_roce_dev_close(adapter); 2425 be_roce_dev_close(adapter);
2400 2426
2401 be_async_mcc_disable(adapter);
2402
2403 if (!lancer_chip(adapter)) 2427 if (!lancer_chip(adapter))
2404 be_intr_set(adapter, false); 2428 be_intr_set(adapter, false);
2405 2429
2406 for_all_evt_queues(adapter, eqo, i) { 2430 for_all_evt_queues(adapter, eqo, i)
2407 napi_disable(&eqo->napi); 2431 napi_disable(&eqo->napi);
2432
2433 be_async_mcc_disable(adapter);
2434
2435 /* Wait for all pending tx completions to arrive so that
2436 * all tx skbs are freed.
2437 */
2438 be_tx_compl_clean(adapter);
2439
2440 be_rx_qs_destroy(adapter);
2441
2442 for_all_evt_queues(adapter, eqo, i) {
2408 if (msix_enabled(adapter)) 2443 if (msix_enabled(adapter))
2409 synchronize_irq(be_msix_vec_get(adapter, eqo)); 2444 synchronize_irq(be_msix_vec_get(adapter, eqo));
2410 else 2445 else
@@ -2414,12 +2449,6 @@ static int be_close(struct net_device *netdev)
2414 2449
2415 be_irq_unregister(adapter); 2450 be_irq_unregister(adapter);
2416 2451
2417 /* Wait for all pending tx completions to arrive so that
2418 * all tx skbs are freed.
2419 */
2420 be_tx_compl_clean(adapter);
2421
2422 be_rx_qs_destroy(adapter);
2423 return 0; 2452 return 0;
2424} 2453}
2425 2454
diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
index 5ba6e1cbd346..ec490d741fc0 100644
--- a/drivers/net/ethernet/freescale/Kconfig
+++ b/drivers/net/ethernet/freescale/Kconfig
@@ -94,9 +94,8 @@ config GIANFAR
94 94
95config FEC_PTP 95config FEC_PTP
96 bool "PTP Hardware Clock (PHC)" 96 bool "PTP Hardware Clock (PHC)"
97 depends on FEC && ARCH_MXC 97 depends on FEC && ARCH_MXC && !SOC_IMX25 && !SOC_IMX27 && !SOC_IMX35 && !SOC_IMX5
98 select PTP_1588_CLOCK 98 select PTP_1588_CLOCK
99 default y if SOC_IMX6Q
100 --help--- 99 --help---
101 Say Y here if you want to use PTP Hardware Clock (PHC) in the 100 Say Y here if you want to use PTP Hardware Clock (PHC) in the
102 driver. Only the basic clock operations have been implemented. 101 driver. Only the basic clock operations have been implemented.
diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index 83f0ea929d3d..8ebc352bcbe6 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -4761,7 +4761,7 @@ static void transmit_cleanup(struct dev_info *hw_priv, int normal)
4761 struct ksz_dma_buf *dma_buf; 4761 struct ksz_dma_buf *dma_buf;
4762 struct net_device *dev = NULL; 4762 struct net_device *dev = NULL;
4763 4763
4764 spin_lock(&hw_priv->hwlock); 4764 spin_lock_irq(&hw_priv->hwlock);
4765 last = info->last; 4765 last = info->last;
4766 4766
4767 while (info->avail < info->alloc) { 4767 while (info->avail < info->alloc) {
@@ -4795,7 +4795,7 @@ static void transmit_cleanup(struct dev_info *hw_priv, int normal)
4795 info->avail++; 4795 info->avail++;
4796 } 4796 }
4797 info->last = last; 4797 info->last = last;
4798 spin_unlock(&hw_priv->hwlock); 4798 spin_unlock_irq(&hw_priv->hwlock);
4799 4799
4800 /* Notify the network subsystem that the packet has been sent. */ 4800 /* Notify the network subsystem that the packet has been sent. */
4801 if (dev) 4801 if (dev)
@@ -5259,11 +5259,15 @@ static irqreturn_t netdev_intr(int irq, void *dev_id)
5259 struct dev_info *hw_priv = priv->adapter; 5259 struct dev_info *hw_priv = priv->adapter;
5260 struct ksz_hw *hw = &hw_priv->hw; 5260 struct ksz_hw *hw = &hw_priv->hw;
5261 5261
5262 spin_lock(&hw_priv->hwlock);
5263
5262 hw_read_intr(hw, &int_enable); 5264 hw_read_intr(hw, &int_enable);
5263 5265
5264 /* Not our interrupt! */ 5266 /* Not our interrupt! */
5265 if (!int_enable) 5267 if (!int_enable) {
5268 spin_unlock(&hw_priv->hwlock);
5266 return IRQ_NONE; 5269 return IRQ_NONE;
5270 }
5267 5271
5268 do { 5272 do {
5269 hw_ack_intr(hw, int_enable); 5273 hw_ack_intr(hw, int_enable);
@@ -5310,6 +5314,8 @@ static irqreturn_t netdev_intr(int irq, void *dev_id)
5310 5314
5311 hw_ena_intr(hw); 5315 hw_ena_intr(hw);
5312 5316
5317 spin_unlock(&hw_priv->hwlock);
5318
5313 return IRQ_HANDLED; 5319 return IRQ_HANDLED;
5314} 5320}
5315 5321
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 537902479689..bc7ec64e9c7a 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -36,8 +36,8 @@
36 36
37#define _QLCNIC_LINUX_MAJOR 5 37#define _QLCNIC_LINUX_MAJOR 5
38#define _QLCNIC_LINUX_MINOR 0 38#define _QLCNIC_LINUX_MINOR 0
39#define _QLCNIC_LINUX_SUBVERSION 29 39#define _QLCNIC_LINUX_SUBVERSION 30
40#define QLCNIC_LINUX_VERSIONID "5.0.29" 40#define QLCNIC_LINUX_VERSIONID "5.0.30"
41#define QLCNIC_DRV_IDC_VER 0x01 41#define QLCNIC_DRV_IDC_VER 0x01
42#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\ 42#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
43 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION)) 43 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index 58f094ca052e..b14b8f0787ea 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -134,7 +134,7 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
134 __le32 *tmp_buf; 134 __le32 *tmp_buf;
135 struct qlcnic_cmd_args cmd; 135 struct qlcnic_cmd_args cmd;
136 struct qlcnic_hardware_context *ahw; 136 struct qlcnic_hardware_context *ahw;
137 struct qlcnic_dump_template_hdr *tmpl_hdr, *tmp_tmpl; 137 struct qlcnic_dump_template_hdr *tmpl_hdr;
138 dma_addr_t tmp_addr_t = 0; 138 dma_addr_t tmp_addr_t = 0;
139 139
140 ahw = adapter->ahw; 140 ahw = adapter->ahw;
@@ -150,6 +150,8 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
150 } 150 }
151 temp_size = cmd.rsp.arg2; 151 temp_size = cmd.rsp.arg2;
152 version = cmd.rsp.arg3; 152 version = cmd.rsp.arg3;
153 dev_info(&adapter->pdev->dev,
154 "minidump template version = 0x%x", version);
153 if (!temp_size) 155 if (!temp_size)
154 return -EIO; 156 return -EIO;
155 157
@@ -174,7 +176,6 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
174 err = -EIO; 176 err = -EIO;
175 goto error; 177 goto error;
176 } 178 }
177 tmp_tmpl = tmp_addr;
178 ahw->fw_dump.tmpl_hdr = vzalloc(temp_size); 179 ahw->fw_dump.tmpl_hdr = vzalloc(temp_size);
179 if (!ahw->fw_dump.tmpl_hdr) { 180 if (!ahw->fw_dump.tmpl_hdr) {
180 err = -EIO; 181 err = -EIO;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
index fc48e000f35f..7a6d5ebe4e0f 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c
@@ -365,7 +365,7 @@ static int
365qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter, 365qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter,
366 struct cmd_desc_type0 *cmd_desc_arr, int nr_desc) 366 struct cmd_desc_type0 *cmd_desc_arr, int nr_desc)
367{ 367{
368 u32 i, producer, consumer; 368 u32 i, producer;
369 struct qlcnic_cmd_buffer *pbuf; 369 struct qlcnic_cmd_buffer *pbuf;
370 struct cmd_desc_type0 *cmd_desc; 370 struct cmd_desc_type0 *cmd_desc;
371 struct qlcnic_host_tx_ring *tx_ring; 371 struct qlcnic_host_tx_ring *tx_ring;
@@ -379,7 +379,6 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter,
379 __netif_tx_lock_bh(tx_ring->txq); 379 __netif_tx_lock_bh(tx_ring->txq);
380 380
381 producer = tx_ring->producer; 381 producer = tx_ring->producer;
382 consumer = tx_ring->sw_consumer;
383 382
384 if (nr_desc >= qlcnic_tx_avail(tx_ring)) { 383 if (nr_desc >= qlcnic_tx_avail(tx_ring)) {
385 netif_tx_stop_queue(tx_ring->txq); 384 netif_tx_stop_queue(tx_ring->txq);
@@ -402,7 +401,7 @@ qlcnic_send_cmd_descs(struct qlcnic_adapter *adapter,
402 pbuf->frag_count = 0; 401 pbuf->frag_count = 0;
403 402
404 memcpy(&tx_ring->desc_head[producer], 403 memcpy(&tx_ring->desc_head[producer],
405 &cmd_desc_arr[i], sizeof(struct cmd_desc_type0)); 404 cmd_desc, sizeof(struct cmd_desc_type0));
406 405
407 producer = get_next_index(producer, tx_ring->num_desc); 406 producer = get_next_index(producer, tx_ring->num_desc);
408 i++; 407 i++;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index a7554d9aab0c..d833f5927891 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -445,13 +445,10 @@ static int
445qlcnic_set_function_modes(struct qlcnic_adapter *adapter) 445qlcnic_set_function_modes(struct qlcnic_adapter *adapter)
446{ 446{
447 u8 id; 447 u8 id;
448 u32 ref_count;
449 int i, ret = 1; 448 int i, ret = 1;
450 u32 data = QLCNIC_MGMT_FUNC; 449 u32 data = QLCNIC_MGMT_FUNC;
451 struct qlcnic_hardware_context *ahw = adapter->ahw; 450 struct qlcnic_hardware_context *ahw = adapter->ahw;
452 451
453 /* If other drivers are not in use set their privilege level */
454 ref_count = QLCRD32(adapter, QLCNIC_CRB_DRV_ACTIVE);
455 ret = qlcnic_api_lock(adapter); 452 ret = qlcnic_api_lock(adapter);
456 if (ret) 453 if (ret)
457 goto err_lock; 454 goto err_lock;
@@ -531,11 +528,9 @@ static int qlcnic_setup_pci_map(struct pci_dev *pdev,
531{ 528{
532 u32 offset; 529 u32 offset;
533 void __iomem *mem_ptr0 = NULL; 530 void __iomem *mem_ptr0 = NULL;
534 resource_size_t mem_base;
535 unsigned long mem_len, pci_len0 = 0, bar0_len; 531 unsigned long mem_len, pci_len0 = 0, bar0_len;
536 532
537 /* remap phys address */ 533 /* remap phys address */
538 mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */
539 mem_len = pci_resource_len(pdev, 0); 534 mem_len = pci_resource_len(pdev, 0);
540 535
541 qlcnic_get_bar_length(pdev->device, &bar0_len); 536 qlcnic_get_bar_length(pdev->device, &bar0_len);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
index 12ff29270745..0b8d8625834c 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c
@@ -197,7 +197,7 @@ static u32 qlcnic_dump_ctrl(struct qlcnic_adapter *adapter,
197 int i, k, timeout = 0; 197 int i, k, timeout = 0;
198 void __iomem *base = adapter->ahw->pci_base0; 198 void __iomem *base = adapter->ahw->pci_base0;
199 u32 addr, data; 199 u32 addr, data;
200 u8 opcode, no_ops; 200 u8 no_ops;
201 struct __ctrl *ctr = &entry->region.ctrl; 201 struct __ctrl *ctr = &entry->region.ctrl;
202 struct qlcnic_dump_template_hdr *t_hdr = adapter->ahw->fw_dump.tmpl_hdr; 202 struct qlcnic_dump_template_hdr *t_hdr = adapter->ahw->fw_dump.tmpl_hdr;
203 203
@@ -206,7 +206,6 @@ static u32 qlcnic_dump_ctrl(struct qlcnic_adapter *adapter,
206 206
207 for (i = 0; i < no_ops; i++) { 207 for (i = 0; i < no_ops; i++) {
208 k = 0; 208 k = 0;
209 opcode = 0;
210 for (k = 0; k < 8; k++) { 209 for (k = 0; k < 8; k++) {
211 if (!(ctr->opcode & (1 << k))) 210 if (!(ctr->opcode & (1 << k)))
212 continue; 211 continue;
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index cb6fc5a743ca..5ac93323a40c 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -577,28 +577,30 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance)
577{ 577{
578 struct net_device *dev = dev_instance; 578 struct net_device *dev = dev_instance;
579 struct cp_private *cp; 579 struct cp_private *cp;
580 int handled = 0;
580 u16 status; 581 u16 status;
581 582
582 if (unlikely(dev == NULL)) 583 if (unlikely(dev == NULL))
583 return IRQ_NONE; 584 return IRQ_NONE;
584 cp = netdev_priv(dev); 585 cp = netdev_priv(dev);
585 586
587 spin_lock(&cp->lock);
588
586 status = cpr16(IntrStatus); 589 status = cpr16(IntrStatus);
587 if (!status || (status == 0xFFFF)) 590 if (!status || (status == 0xFFFF))
588 return IRQ_NONE; 591 goto out_unlock;
592
593 handled = 1;
589 594
590 netif_dbg(cp, intr, dev, "intr, status %04x cmd %02x cpcmd %04x\n", 595 netif_dbg(cp, intr, dev, "intr, status %04x cmd %02x cpcmd %04x\n",
591 status, cpr8(Cmd), cpr16(CpCmd)); 596 status, cpr8(Cmd), cpr16(CpCmd));
592 597
593 cpw16(IntrStatus, status & ~cp_rx_intr_mask); 598 cpw16(IntrStatus, status & ~cp_rx_intr_mask);
594 599
595 spin_lock(&cp->lock);
596
597 /* close possible race's with dev_close */ 600 /* close possible race's with dev_close */
598 if (unlikely(!netif_running(dev))) { 601 if (unlikely(!netif_running(dev))) {
599 cpw16(IntrMask, 0); 602 cpw16(IntrMask, 0);
600 spin_unlock(&cp->lock); 603 goto out_unlock;
601 return IRQ_HANDLED;
602 } 604 }
603 605
604 if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr)) 606 if (status & (RxOK | RxErr | RxEmpty | RxFIFOOvr))
@@ -612,7 +614,6 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance)
612 if (status & LinkChg) 614 if (status & LinkChg)
613 mii_check_media(&cp->mii_if, netif_msg_link(cp), false); 615 mii_check_media(&cp->mii_if, netif_msg_link(cp), false);
614 616
615 spin_unlock(&cp->lock);
616 617
617 if (status & PciErr) { 618 if (status & PciErr) {
618 u16 pci_status; 619 u16 pci_status;
@@ -625,7 +626,10 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance)
625 /* TODO: reset hardware */ 626 /* TODO: reset hardware */
626 } 627 }
627 628
628 return IRQ_HANDLED; 629out_unlock:
630 spin_unlock(&cp->lock);
631
632 return IRQ_RETVAL(handled);
629} 633}
630 634
631#ifdef CONFIG_NET_POLL_CONTROLLER 635#ifdef CONFIG_NET_POLL_CONTROLLER
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 022b45bc14ff..a670d23d9340 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -2386,8 +2386,6 @@ static const struct of_device_id smc91x_match[] = {
2386 {}, 2386 {},
2387}; 2387};
2388MODULE_DEVICE_TABLE(of, smc91x_match); 2388MODULE_DEVICE_TABLE(of, smc91x_match);
2389#else
2390#define smc91x_match NULL
2391#endif 2389#endif
2392 2390
2393static struct dev_pm_ops smc_drv_pm_ops = { 2391static struct dev_pm_ops smc_drv_pm_ops = {
@@ -2402,7 +2400,7 @@ static struct platform_driver smc_driver = {
2402 .name = CARDNAME, 2400 .name = CARDNAME,
2403 .owner = THIS_MODULE, 2401 .owner = THIS_MODULE,
2404 .pm = &smc_drv_pm_ops, 2402 .pm = &smc_drv_pm_ops,
2405 .of_match_table = smc91x_match, 2403 .of_match_table = of_match_ptr(smc91x_match),
2406 }, 2404 },
2407}; 2405};
2408 2406
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 4616bf27d515..e112877d15d3 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -2575,11 +2575,13 @@ static const struct dev_pm_ops smsc911x_pm_ops = {
2575#define SMSC911X_PM_OPS NULL 2575#define SMSC911X_PM_OPS NULL
2576#endif 2576#endif
2577 2577
2578#ifdef CONFIG_OF
2578static const struct of_device_id smsc911x_dt_ids[] = { 2579static const struct of_device_id smsc911x_dt_ids[] = {
2579 { .compatible = "smsc,lan9115", }, 2580 { .compatible = "smsc,lan9115", },
2580 { /* sentinel */ } 2581 { /* sentinel */ }
2581}; 2582};
2582MODULE_DEVICE_TABLE(of, smsc911x_dt_ids); 2583MODULE_DEVICE_TABLE(of, smsc911x_dt_ids);
2584#endif
2583 2585
2584static struct platform_driver smsc911x_driver = { 2586static struct platform_driver smsc911x_driver = {
2585 .probe = smsc911x_drv_probe, 2587 .probe = smsc911x_drv_probe,
@@ -2588,7 +2590,7 @@ static struct platform_driver smsc911x_driver = {
2588 .name = SMSC_CHIPNAME, 2590 .name = SMSC_CHIPNAME,
2589 .owner = THIS_MODULE, 2591 .owner = THIS_MODULE,
2590 .pm = SMSC911X_PM_OPS, 2592 .pm = SMSC911X_PM_OPS,
2591 .of_match_table = smsc911x_dt_ids, 2593 .of_match_table = of_match_ptr(smsc911x_dt_ids),
2592 }, 2594 },
2593}; 2595};
2594 2596
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 023a4fb4efa5..b05df8983be5 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -127,14 +127,14 @@ static inline int stmmac_register_platform(void)
127} 127}
128static inline void stmmac_unregister_platform(void) 128static inline void stmmac_unregister_platform(void)
129{ 129{
130 platform_driver_register(&stmmac_pltfr_driver); 130 platform_driver_unregister(&stmmac_pltfr_driver);
131} 131}
132#else 132#else
133static inline int stmmac_register_platform(void) 133static inline int stmmac_register_platform(void)
134{ 134{
135 pr_debug("stmmac: do not register the platf driver\n"); 135 pr_debug("stmmac: do not register the platf driver\n");
136 136
137 return -EINVAL; 137 return 0;
138} 138}
139static inline void stmmac_unregister_platform(void) 139static inline void stmmac_unregister_platform(void)
140{ 140{
@@ -162,7 +162,7 @@ static inline int stmmac_register_pci(void)
162{ 162{
163 pr_debug("stmmac: do not register the PCI driver\n"); 163 pr_debug("stmmac: do not register the PCI driver\n");
164 164
165 return -EINVAL; 165 return 0;
166} 166}
167static inline void stmmac_unregister_pci(void) 167static inline void stmmac_unregister_pci(void)
168{ 168{
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 542edbcd92c7..f07c0612abf6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -2194,18 +2194,20 @@ int stmmac_restore(struct net_device *ndev)
2194 */ 2194 */
2195static int __init stmmac_init(void) 2195static int __init stmmac_init(void)
2196{ 2196{
2197 int err_plt = 0; 2197 int ret;
2198 int err_pci = 0;
2199
2200 err_plt = stmmac_register_platform();
2201 err_pci = stmmac_register_pci();
2202
2203 if ((err_pci) && (err_plt)) {
2204 pr_err("stmmac: driver registration failed\n");
2205 return -EINVAL;
2206 }
2207 2198
2199 ret = stmmac_register_platform();
2200 if (ret)
2201 goto err;
2202 ret = stmmac_register_pci();
2203 if (ret)
2204 goto err_pci;
2208 return 0; 2205 return 0;
2206err_pci:
2207 stmmac_unregister_platform();
2208err:
2209 pr_err("stmmac: driver registration failed\n");
2210 return ret;
2209} 2211}
2210 2212
2211static void __exit stmmac_exit(void) 2213static void __exit stmmac_exit(void)
diff --git a/drivers/net/ethernet/ti/cpts.c b/drivers/net/ethernet/ti/cpts.c
index 337766738eca..5e62c1aeeffb 100644
--- a/drivers/net/ethernet/ti/cpts.c
+++ b/drivers/net/ethernet/ti/cpts.c
@@ -27,8 +27,6 @@
27#include <linux/uaccess.h> 27#include <linux/uaccess.h>
28#include <linux/workqueue.h> 28#include <linux/workqueue.h>
29 29
30#include <plat/clock.h>
31
32#include "cpts.h" 30#include "cpts.h"
33 31
34#ifdef CONFIG_TI_CPTS 32#ifdef CONFIG_TI_CPTS
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 40b426edc9e6..504f7f1cad94 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -138,6 +138,8 @@ struct tun_file {
138 /* only used for fasnyc */ 138 /* only used for fasnyc */
139 unsigned int flags; 139 unsigned int flags;
140 u16 queue_index; 140 u16 queue_index;
141 struct list_head next;
142 struct tun_struct *detached;
141}; 143};
142 144
143struct tun_flow_entry { 145struct tun_flow_entry {
@@ -182,6 +184,8 @@ struct tun_struct {
182 struct hlist_head flows[TUN_NUM_FLOW_ENTRIES]; 184 struct hlist_head flows[TUN_NUM_FLOW_ENTRIES];
183 struct timer_list flow_gc_timer; 185 struct timer_list flow_gc_timer;
184 unsigned long ageing_time; 186 unsigned long ageing_time;
187 unsigned int numdisabled;
188 struct list_head disabled;
185}; 189};
186 190
187static inline u32 tun_hashfn(u32 rxhash) 191static inline u32 tun_hashfn(u32 rxhash)
@@ -385,6 +389,23 @@ static void tun_set_real_num_queues(struct tun_struct *tun)
385 netif_set_real_num_rx_queues(tun->dev, tun->numqueues); 389 netif_set_real_num_rx_queues(tun->dev, tun->numqueues);
386} 390}
387 391
392static void tun_disable_queue(struct tun_struct *tun, struct tun_file *tfile)
393{
394 tfile->detached = tun;
395 list_add_tail(&tfile->next, &tun->disabled);
396 ++tun->numdisabled;
397}
398
399static struct tun_struct *tun_enable_queue(struct tun_file *tfile)
400{
401 struct tun_struct *tun = tfile->detached;
402
403 tfile->detached = NULL;
404 list_del_init(&tfile->next);
405 --tun->numdisabled;
406 return tun;
407}
408
388static void __tun_detach(struct tun_file *tfile, bool clean) 409static void __tun_detach(struct tun_file *tfile, bool clean)
389{ 410{
390 struct tun_file *ntfile; 411 struct tun_file *ntfile;
@@ -406,20 +427,25 @@ static void __tun_detach(struct tun_file *tfile, bool clean)
406 ntfile->queue_index = index; 427 ntfile->queue_index = index;
407 428
408 --tun->numqueues; 429 --tun->numqueues;
409 sock_put(&tfile->sk); 430 if (clean)
431 sock_put(&tfile->sk);
432 else
433 tun_disable_queue(tun, tfile);
410 434
411 synchronize_net(); 435 synchronize_net();
412 tun_flow_delete_by_queue(tun, tun->numqueues + 1); 436 tun_flow_delete_by_queue(tun, tun->numqueues + 1);
413 /* Drop read queue */ 437 /* Drop read queue */
414 skb_queue_purge(&tfile->sk.sk_receive_queue); 438 skb_queue_purge(&tfile->sk.sk_receive_queue);
415 tun_set_real_num_queues(tun); 439 tun_set_real_num_queues(tun);
416 440 } else if (tfile->detached && clean)
417 if (tun->numqueues == 0 && !(tun->flags & TUN_PERSIST)) 441 tun = tun_enable_queue(tfile);
418 if (dev->reg_state == NETREG_REGISTERED)
419 unregister_netdevice(dev);
420 }
421 442
422 if (clean) { 443 if (clean) {
444 if (tun && tun->numqueues == 0 && tun->numdisabled == 0 &&
445 !(tun->flags & TUN_PERSIST))
446 if (tun->dev->reg_state == NETREG_REGISTERED)
447 unregister_netdevice(tun->dev);
448
423 BUG_ON(!test_bit(SOCK_EXTERNALLY_ALLOCATED, 449 BUG_ON(!test_bit(SOCK_EXTERNALLY_ALLOCATED,
424 &tfile->socket.flags)); 450 &tfile->socket.flags));
425 sk_release_kernel(&tfile->sk); 451 sk_release_kernel(&tfile->sk);
@@ -436,7 +462,7 @@ static void tun_detach(struct tun_file *tfile, bool clean)
436static void tun_detach_all(struct net_device *dev) 462static void tun_detach_all(struct net_device *dev)
437{ 463{
438 struct tun_struct *tun = netdev_priv(dev); 464 struct tun_struct *tun = netdev_priv(dev);
439 struct tun_file *tfile; 465 struct tun_file *tfile, *tmp;
440 int i, n = tun->numqueues; 466 int i, n = tun->numqueues;
441 467
442 for (i = 0; i < n; i++) { 468 for (i = 0; i < n; i++) {
@@ -457,6 +483,12 @@ static void tun_detach_all(struct net_device *dev)
457 skb_queue_purge(&tfile->sk.sk_receive_queue); 483 skb_queue_purge(&tfile->sk.sk_receive_queue);
458 sock_put(&tfile->sk); 484 sock_put(&tfile->sk);
459 } 485 }
486 list_for_each_entry_safe(tfile, tmp, &tun->disabled, next) {
487 tun_enable_queue(tfile);
488 skb_queue_purge(&tfile->sk.sk_receive_queue);
489 sock_put(&tfile->sk);
490 }
491 BUG_ON(tun->numdisabled != 0);
460} 492}
461 493
462static int tun_attach(struct tun_struct *tun, struct file *file) 494static int tun_attach(struct tun_struct *tun, struct file *file)
@@ -473,7 +505,8 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
473 goto out; 505 goto out;
474 506
475 err = -E2BIG; 507 err = -E2BIG;
476 if (tun->numqueues == MAX_TAP_QUEUES) 508 if (!tfile->detached &&
509 tun->numqueues + tun->numdisabled == MAX_TAP_QUEUES)
477 goto out; 510 goto out;
478 511
479 err = 0; 512 err = 0;
@@ -487,9 +520,13 @@ static int tun_attach(struct tun_struct *tun, struct file *file)
487 tfile->queue_index = tun->numqueues; 520 tfile->queue_index = tun->numqueues;
488 rcu_assign_pointer(tfile->tun, tun); 521 rcu_assign_pointer(tfile->tun, tun);
489 rcu_assign_pointer(tun->tfiles[tun->numqueues], tfile); 522 rcu_assign_pointer(tun->tfiles[tun->numqueues], tfile);
490 sock_hold(&tfile->sk);
491 tun->numqueues++; 523 tun->numqueues++;
492 524
525 if (tfile->detached)
526 tun_enable_queue(tfile);
527 else
528 sock_hold(&tfile->sk);
529
493 tun_set_real_num_queues(tun); 530 tun_set_real_num_queues(tun);
494 531
495 /* device is allowed to go away first, so no need to hold extra 532 /* device is allowed to go away first, so no need to hold extra
@@ -1162,6 +1199,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
1162 skb_shinfo(skb)->tx_flags |= SKBTX_DEV_ZEROCOPY; 1199 skb_shinfo(skb)->tx_flags |= SKBTX_DEV_ZEROCOPY;
1163 } 1200 }
1164 1201
1202 skb_reset_network_header(skb);
1165 rxhash = skb_get_rxhash(skb); 1203 rxhash = skb_get_rxhash(skb);
1166 netif_rx_ni(skb); 1204 netif_rx_ni(skb);
1167 1205
@@ -1349,6 +1387,7 @@ static void tun_free_netdev(struct net_device *dev)
1349{ 1387{
1350 struct tun_struct *tun = netdev_priv(dev); 1388 struct tun_struct *tun = netdev_priv(dev);
1351 1389
1390 BUG_ON(!(list_empty(&tun->disabled)));
1352 tun_flow_uninit(tun); 1391 tun_flow_uninit(tun);
1353 free_netdev(dev); 1392 free_netdev(dev);
1354} 1393}
@@ -1543,6 +1582,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
1543 err = tun_attach(tun, file); 1582 err = tun_attach(tun, file);
1544 if (err < 0) 1583 if (err < 0)
1545 return err; 1584 return err;
1585
1586 if (tun->flags & TUN_TAP_MQ &&
1587 (tun->numqueues + tun->numdisabled > 1))
1588 return err;
1546 } 1589 }
1547 else { 1590 else {
1548 char *name; 1591 char *name;
@@ -1601,6 +1644,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
1601 TUN_USER_FEATURES; 1644 TUN_USER_FEATURES;
1602 dev->features = dev->hw_features; 1645 dev->features = dev->hw_features;
1603 1646
1647 INIT_LIST_HEAD(&tun->disabled);
1604 err = tun_attach(tun, file); 1648 err = tun_attach(tun, file);
1605 if (err < 0) 1649 if (err < 0)
1606 goto err_free_dev; 1650 goto err_free_dev;
@@ -1755,32 +1799,28 @@ static int tun_set_queue(struct file *file, struct ifreq *ifr)
1755{ 1799{
1756 struct tun_file *tfile = file->private_data; 1800 struct tun_file *tfile = file->private_data;
1757 struct tun_struct *tun; 1801 struct tun_struct *tun;
1758 struct net_device *dev;
1759 int ret = 0; 1802 int ret = 0;
1760 1803
1761 rtnl_lock(); 1804 rtnl_lock();
1762 1805
1763 if (ifr->ifr_flags & IFF_ATTACH_QUEUE) { 1806 if (ifr->ifr_flags & IFF_ATTACH_QUEUE) {
1764 dev = __dev_get_by_name(tfile->net, ifr->ifr_name); 1807 tun = tfile->detached;
1765 if (!dev) { 1808 if (!tun)
1766 ret = -EINVAL;
1767 goto unlock;
1768 }
1769
1770 tun = netdev_priv(dev);
1771 if (dev->netdev_ops != &tap_netdev_ops &&
1772 dev->netdev_ops != &tun_netdev_ops)
1773 ret = -EINVAL; 1809 ret = -EINVAL;
1774 else if (tun_not_capable(tun)) 1810 else if (tun_not_capable(tun))
1775 ret = -EPERM; 1811 ret = -EPERM;
1776 else 1812 else
1777 ret = tun_attach(tun, file); 1813 ret = tun_attach(tun, file);
1778 } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) 1814 } else if (ifr->ifr_flags & IFF_DETACH_QUEUE) {
1779 __tun_detach(tfile, false); 1815 tun = rcu_dereference_protected(tfile->tun,
1780 else 1816 lockdep_rtnl_is_held());
1817 if (!tun || !(tun->flags & TUN_TAP_MQ))
1818 ret = -EINVAL;
1819 else
1820 __tun_detach(tfile, false);
1821 } else
1781 ret = -EINVAL; 1822 ret = -EINVAL;
1782 1823
1783unlock:
1784 rtnl_unlock(); 1824 rtnl_unlock();
1785 return ret; 1825 return ret;
1786} 1826}
@@ -2092,6 +2132,7 @@ static int tun_chr_open(struct inode *inode, struct file * file)
2092 2132
2093 file->private_data = tfile; 2133 file->private_data = tfile;
2094 set_bit(SOCK_EXTERNALLY_ALLOCATED, &tfile->socket.flags); 2134 set_bit(SOCK_EXTERNALLY_ALLOCATED, &tfile->socket.flags);
2135 INIT_LIST_HEAD(&tfile->next);
2095 2136
2096 return 0; 2137 return 0;
2097} 2138}
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index d0129827602b..3f3d12d766e7 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -457,12 +457,6 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
457} 457}
458EXPORT_SYMBOL_GPL(usbnet_cdc_bind); 458EXPORT_SYMBOL_GPL(usbnet_cdc_bind);
459 459
460static int cdc_manage_power(struct usbnet *dev, int on)
461{
462 dev->intf->needs_remote_wakeup = on;
463 return 0;
464}
465
466static const struct driver_info cdc_info = { 460static const struct driver_info cdc_info = {
467 .description = "CDC Ethernet Device", 461 .description = "CDC Ethernet Device",
468 .flags = FLAG_ETHER | FLAG_POINTTOPOINT, 462 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
@@ -470,7 +464,7 @@ static const struct driver_info cdc_info = {
470 .bind = usbnet_cdc_bind, 464 .bind = usbnet_cdc_bind,
471 .unbind = usbnet_cdc_unbind, 465 .unbind = usbnet_cdc_unbind,
472 .status = usbnet_cdc_status, 466 .status = usbnet_cdc_status,
473 .manage_power = cdc_manage_power, 467 .manage_power = usbnet_manage_power,
474}; 468};
475 469
476static const struct driver_info wwan_info = { 470static const struct driver_info wwan_info = {
@@ -479,7 +473,7 @@ static const struct driver_info wwan_info = {
479 .bind = usbnet_cdc_bind, 473 .bind = usbnet_cdc_bind,
480 .unbind = usbnet_cdc_unbind, 474 .unbind = usbnet_cdc_unbind,
481 .status = usbnet_cdc_status, 475 .status = usbnet_cdc_status,
482 .manage_power = cdc_manage_power, 476 .manage_power = usbnet_manage_power,
483}; 477};
484 478
485/*-------------------------------------------------------------------------*/ 479/*-------------------------------------------------------------------------*/
@@ -487,6 +481,7 @@ static const struct driver_info wwan_info = {
487#define HUAWEI_VENDOR_ID 0x12D1 481#define HUAWEI_VENDOR_ID 0x12D1
488#define NOVATEL_VENDOR_ID 0x1410 482#define NOVATEL_VENDOR_ID 0x1410
489#define ZTE_VENDOR_ID 0x19D2 483#define ZTE_VENDOR_ID 0x19D2
484#define DELL_VENDOR_ID 0x413C
490 485
491static const struct usb_device_id products [] = { 486static const struct usb_device_id products [] = {
492/* 487/*
@@ -594,27 +589,29 @@ static const struct usb_device_id products [] = {
594 589
595/* Novatel USB551L and MC551 - handled by qmi_wwan */ 590/* Novatel USB551L and MC551 - handled by qmi_wwan */
596{ 591{
597 .match_flags = USB_DEVICE_ID_MATCH_VENDOR 592 USB_DEVICE_AND_INTERFACE_INFO(NOVATEL_VENDOR_ID, 0xB001, USB_CLASS_COMM,
598 | USB_DEVICE_ID_MATCH_PRODUCT 593 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
599 | USB_DEVICE_ID_MATCH_INT_INFO,
600 .idVendor = NOVATEL_VENDOR_ID,
601 .idProduct = 0xB001,
602 .bInterfaceClass = USB_CLASS_COMM,
603 .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
604 .bInterfaceProtocol = USB_CDC_PROTO_NONE,
605 .driver_info = 0, 594 .driver_info = 0,
606}, 595},
607 596
608/* Novatel E362 - handled by qmi_wwan */ 597/* Novatel E362 - handled by qmi_wwan */
609{ 598{
610 .match_flags = USB_DEVICE_ID_MATCH_VENDOR 599 USB_DEVICE_AND_INTERFACE_INFO(NOVATEL_VENDOR_ID, 0x9010, USB_CLASS_COMM,
611 | USB_DEVICE_ID_MATCH_PRODUCT 600 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
612 | USB_DEVICE_ID_MATCH_INT_INFO, 601 .driver_info = 0,
613 .idVendor = NOVATEL_VENDOR_ID, 602},
614 .idProduct = 0x9010, 603
615 .bInterfaceClass = USB_CLASS_COMM, 604/* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
616 .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, 605{
617 .bInterfaceProtocol = USB_CDC_PROTO_NONE, 606 USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8195, USB_CLASS_COMM,
607 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
608 .driver_info = 0,
609},
610
611/* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
612{
613 USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8196, USB_CLASS_COMM,
614 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
618 .driver_info = 0, 615 .driver_info = 0,
619}, 616},
620 617
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index d38bc20a60e2..71b6e92b8e9b 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1129,19 +1129,13 @@ static void cdc_ncm_disconnect(struct usb_interface *intf)
1129 usbnet_disconnect(intf); 1129 usbnet_disconnect(intf);
1130} 1130}
1131 1131
1132static int cdc_ncm_manage_power(struct usbnet *dev, int status)
1133{
1134 dev->intf->needs_remote_wakeup = status;
1135 return 0;
1136}
1137
1138static const struct driver_info cdc_ncm_info = { 1132static const struct driver_info cdc_ncm_info = {
1139 .description = "CDC NCM", 1133 .description = "CDC NCM",
1140 .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET, 1134 .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET,
1141 .bind = cdc_ncm_bind, 1135 .bind = cdc_ncm_bind,
1142 .unbind = cdc_ncm_unbind, 1136 .unbind = cdc_ncm_unbind,
1143 .check_connect = cdc_ncm_check_connect, 1137 .check_connect = cdc_ncm_check_connect,
1144 .manage_power = cdc_ncm_manage_power, 1138 .manage_power = usbnet_manage_power,
1145 .status = cdc_ncm_status, 1139 .status = cdc_ncm_status,
1146 .rx_fixup = cdc_ncm_rx_fixup, 1140 .rx_fixup = cdc_ncm_rx_fixup,
1147 .tx_fixup = cdc_ncm_tx_fixup, 1141 .tx_fixup = cdc_ncm_tx_fixup,
@@ -1155,7 +1149,7 @@ static const struct driver_info wwan_info = {
1155 .bind = cdc_ncm_bind, 1149 .bind = cdc_ncm_bind,
1156 .unbind = cdc_ncm_unbind, 1150 .unbind = cdc_ncm_unbind,
1157 .check_connect = cdc_ncm_check_connect, 1151 .check_connect = cdc_ncm_check_connect,
1158 .manage_power = cdc_ncm_manage_power, 1152 .manage_power = usbnet_manage_power,
1159 .status = cdc_ncm_status, 1153 .status = cdc_ncm_status,
1160 .rx_fixup = cdc_ncm_rx_fixup, 1154 .rx_fixup = cdc_ncm_rx_fixup,
1161 .tx_fixup = cdc_ncm_tx_fixup, 1155 .tx_fixup = cdc_ncm_tx_fixup,
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 1ea91f4237f0..91d7cb9728eb 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -383,6 +383,20 @@ static const struct usb_device_id products[] = {
383 USB_CDC_PROTO_NONE), 383 USB_CDC_PROTO_NONE),
384 .driver_info = (unsigned long)&qmi_wwan_info, 384 .driver_info = (unsigned long)&qmi_wwan_info,
385 }, 385 },
386 { /* Dell Wireless 5800 (Novatel E362) */
387 USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8195,
388 USB_CLASS_COMM,
389 USB_CDC_SUBCLASS_ETHERNET,
390 USB_CDC_PROTO_NONE),
391 .driver_info = (unsigned long)&qmi_wwan_info,
392 },
393 { /* Dell Wireless 5800 V2 (Novatel E362) */
394 USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8196,
395 USB_CLASS_COMM,
396 USB_CDC_SUBCLASS_ETHERNET,
397 USB_CDC_PROTO_NONE),
398 .driver_info = (unsigned long)&qmi_wwan_info,
399 },
386 400
387 /* 3. Combined interface devices matching on interface number */ 401 /* 3. Combined interface devices matching on interface number */
388 {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */ 402 {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */
@@ -419,6 +433,7 @@ static const struct usb_device_id products[] = {
419 {QMI_FIXED_INTF(0x19d2, 0x0199, 1)}, /* ZTE MF820S */ 433 {QMI_FIXED_INTF(0x19d2, 0x0199, 1)}, /* ZTE MF820S */
420 {QMI_FIXED_INTF(0x19d2, 0x0200, 1)}, 434 {QMI_FIXED_INTF(0x19d2, 0x0200, 1)},
421 {QMI_FIXED_INTF(0x19d2, 0x0257, 3)}, /* ZTE MF821 */ 435 {QMI_FIXED_INTF(0x19d2, 0x0257, 3)}, /* ZTE MF821 */
436 {QMI_FIXED_INTF(0x19d2, 0x0284, 4)}, /* ZTE MF880 */
422 {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */ 437 {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */
423 {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */ 438 {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */
424 {QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */ 439 {QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index c04110ba677f..3d4bf01641b4 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -719,7 +719,8 @@ int usbnet_stop (struct net_device *net)
719 dev->flags = 0; 719 dev->flags = 0;
720 del_timer_sync (&dev->delay); 720 del_timer_sync (&dev->delay);
721 tasklet_kill (&dev->bh); 721 tasklet_kill (&dev->bh);
722 if (info->manage_power) 722 if (info->manage_power &&
723 !test_and_clear_bit(EVENT_NO_RUNTIME_PM, &dev->flags))
723 info->manage_power(dev, 0); 724 info->manage_power(dev, 0);
724 else 725 else
725 usb_autopm_put_interface(dev->intf); 726 usb_autopm_put_interface(dev->intf);
@@ -794,14 +795,14 @@ int usbnet_open (struct net_device *net)
794 tasklet_schedule (&dev->bh); 795 tasklet_schedule (&dev->bh);
795 if (info->manage_power) { 796 if (info->manage_power) {
796 retval = info->manage_power(dev, 1); 797 retval = info->manage_power(dev, 1);
797 if (retval < 0) 798 if (retval < 0) {
798 goto done_manage_power_error; 799 retval = 0;
799 usb_autopm_put_interface(dev->intf); 800 set_bit(EVENT_NO_RUNTIME_PM, &dev->flags);
801 } else {
802 usb_autopm_put_interface(dev->intf);
803 }
800 } 804 }
801 return retval; 805 return retval;
802
803done_manage_power_error:
804 clear_bit(EVENT_DEV_OPEN, &dev->flags);
805done: 806done:
806 usb_autopm_put_interface(dev->intf); 807 usb_autopm_put_interface(dev->intf);
807done_nopm: 808done_nopm:
@@ -1615,6 +1616,16 @@ void usbnet_device_suggests_idle(struct usbnet *dev)
1615} 1616}
1616EXPORT_SYMBOL(usbnet_device_suggests_idle); 1617EXPORT_SYMBOL(usbnet_device_suggests_idle);
1617 1618
1619/*
1620 * For devices that can do without special commands
1621 */
1622int usbnet_manage_power(struct usbnet *dev, int on)
1623{
1624 dev->intf->needs_remote_wakeup = on;
1625 return 0;
1626}
1627EXPORT_SYMBOL(usbnet_manage_power);
1628
1618/*-------------------------------------------------------------------------*/ 1629/*-------------------------------------------------------------------------*/
1619static int __usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, 1630static int __usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
1620 u16 value, u16 index, void *data, u16 size) 1631 u16 value, u16 index, void *data, u16 size)
diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h
index 6650fde99e1d..9f1e947f3557 100644
--- a/drivers/net/wimax/i2400m/i2400m-usb.h
+++ b/drivers/net/wimax/i2400m/i2400m-usb.h
@@ -152,6 +152,9 @@ enum {
152 /* Device IDs */ 152 /* Device IDs */
153 USB_DEVICE_ID_I6050 = 0x0186, 153 USB_DEVICE_ID_I6050 = 0x0186,
154 USB_DEVICE_ID_I6050_2 = 0x0188, 154 USB_DEVICE_ID_I6050_2 = 0x0188,
155 USB_DEVICE_ID_I6150 = 0x07d6,
156 USB_DEVICE_ID_I6150_2 = 0x07d7,
157 USB_DEVICE_ID_I6150_3 = 0x07d9,
155 USB_DEVICE_ID_I6250 = 0x0187, 158 USB_DEVICE_ID_I6250 = 0x0187,
156}; 159};
157 160
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c
index 713d033891e6..080f36303a4f 100644
--- a/drivers/net/wimax/i2400m/usb.c
+++ b/drivers/net/wimax/i2400m/usb.c
@@ -510,6 +510,9 @@ int i2400mu_probe(struct usb_interface *iface,
510 switch (id->idProduct) { 510 switch (id->idProduct) {
511 case USB_DEVICE_ID_I6050: 511 case USB_DEVICE_ID_I6050:
512 case USB_DEVICE_ID_I6050_2: 512 case USB_DEVICE_ID_I6050_2:
513 case USB_DEVICE_ID_I6150:
514 case USB_DEVICE_ID_I6150_2:
515 case USB_DEVICE_ID_I6150_3:
513 case USB_DEVICE_ID_I6250: 516 case USB_DEVICE_ID_I6250:
514 i2400mu->i6050 = 1; 517 i2400mu->i6050 = 1;
515 break; 518 break;
@@ -759,6 +762,9 @@ static
759struct usb_device_id i2400mu_id_table[] = { 762struct usb_device_id i2400mu_id_table[] = {
760 { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) }, 763 { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050) },
761 { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) }, 764 { USB_DEVICE(0x8086, USB_DEVICE_ID_I6050_2) },
765 { USB_DEVICE(0x8087, USB_DEVICE_ID_I6150) },
766 { USB_DEVICE(0x8087, USB_DEVICE_ID_I6150_2) },
767 { USB_DEVICE(0x8087, USB_DEVICE_ID_I6150_3) },
762 { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) }, 768 { USB_DEVICE(0x8086, USB_DEVICE_ID_I6250) },
763 { USB_DEVICE(0x8086, 0x0181) }, 769 { USB_DEVICE(0x8086, 0x0181) },
764 { USB_DEVICE(0x8086, 0x1403) }, 770 { USB_DEVICE(0x8086, 0x1403) },
diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
index 062dfdff6364..67156efe14c4 100644
--- a/drivers/net/wireless/Makefile
+++ b/drivers/net/wireless/Makefile
@@ -47,7 +47,7 @@ obj-$(CONFIG_RT2X00) += rt2x00/
47 47
48obj-$(CONFIG_P54_COMMON) += p54/ 48obj-$(CONFIG_P54_COMMON) += p54/
49 49
50obj-$(CONFIG_ATH_COMMON) += ath/ 50obj-$(CONFIG_ATH_CARDS) += ath/
51 51
52obj-$(CONFIG_MAC80211_HWSIM) += mac80211_hwsim.o 52obj-$(CONFIG_MAC80211_HWSIM) += mac80211_hwsim.o
53 53
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 4ffb6a584cd0..44f8b3f3cbed 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -685,6 +685,14 @@ void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp)
685 * to mac80211. 685 * to mac80211.
686 */ 686 */
687 rx_status = IEEE80211_SKB_RXCB(entry->skb); 687 rx_status = IEEE80211_SKB_RXCB(entry->skb);
688
689 /* Ensure that all fields of rx_status are initialized
690 * properly. The skb->cb array was used for driver
691 * specific informations, so rx_status might contain
692 * garbage.
693 */
694 memset(rx_status, 0, sizeof(*rx_status));
695
688 rx_status->mactime = rxdesc.timestamp; 696 rx_status->mactime = rxdesc.timestamp;
689 rx_status->band = rt2x00dev->curr_band; 697 rx_status->band = rt2x00dev->curr_band;
690 rx_status->freq = rt2x00dev->curr_freq; 698 rx_status->freq = rt2x00dev->curr_freq;