aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-12 11:02:03 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-12 11:02:03 -0400
commit82681a318f9f028ea64e61f24bbd9ac535531921 (patch)
tree529b6a5b4fd040fb54b7672b1a224ebd47445876 /drivers/net
parent3860c97bd60a4525bb62eb90e3e7d2f02662ac59 (diff)
parent8ebf975608aaebd7feb33d77f07ba21a6380e086 (diff)
[SCSI] Merge branch 'linus'
Conflicts: drivers/message/fusion/mptsas.c fixed up conflict between req->data_len accessors and mptsas driver updates. Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c509.c4
-rw-r--r--drivers/net/Makefile2
-rw-r--r--drivers/net/atl1e/atl1e_main.c1
-rw-r--r--drivers/net/atlx/atl1.c6
-rw-r--r--drivers/net/atlx/atlx.h6
-rw-r--r--drivers/net/benet/be.h14
-rw-r--r--drivers/net/benet/be_main.c10
-rw-r--r--drivers/net/bfin_mac.c29
-rw-r--r--drivers/net/bonding/bond_3ad.c11
-rw-r--r--drivers/net/cxgb3/adapter.h4
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c8
-rw-r--r--drivers/net/cxgb3/sge.c11
-rw-r--r--drivers/net/cxgb3/t3_hw.c5
-rw-r--r--drivers/net/e1000/e1000_main.c5
-rw-r--r--drivers/net/forcedeth.c15
-rw-r--r--drivers/net/gianfar.c11
-rw-r--r--drivers/net/gianfar.h2
-rw-r--r--drivers/net/mac8390.c12
-rw-r--r--drivers/net/meth.c27
-rw-r--r--drivers/net/mlx4/en_cq.c4
-rw-r--r--drivers/net/mlx4/en_tx.c8
-rw-r--r--drivers/net/mv643xx_eth.c41
-rw-r--r--drivers/net/r8169.c113
-rw-r--r--drivers/net/vxge/vxge-traffic.c2
-rw-r--r--drivers/net/wimax/i2400m/rx.c5
-rw-r--r--drivers/net/wimax/i2400m/usb.c35
-rw-r--r--drivers/net/wireless/Kconfig1
-rw-r--r--drivers/net/wireless/airo.c23
-rw-r--r--drivers/net/wireless/at76c50x-usb.c12
-rw-r--r--drivers/net/wireless/ath5k/phy.c49
-rw-r--r--drivers/net/wireless/ath5k/reset.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00debug.c2
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_dev.c2
37 files changed, 304 insertions, 209 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index fbb371921991..682aad897081 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -480,9 +480,13 @@ static int pnp_registered;
480 480
481#ifdef CONFIG_EISA 481#ifdef CONFIG_EISA
482static struct eisa_device_id el3_eisa_ids[] = { 482static struct eisa_device_id el3_eisa_ids[] = {
483 { "TCM5090" },
484 { "TCM5091" },
483 { "TCM5092" }, 485 { "TCM5092" },
484 { "TCM5093" }, 486 { "TCM5093" },
487 { "TCM5094" },
485 { "TCM5095" }, 488 { "TCM5095" },
489 { "TCM5098" },
486 { "" } 490 { "" }
487}; 491};
488MODULE_DEVICE_TABLE(eisa, el3_eisa_ids); 492MODULE_DEVICE_TABLE(eisa, el3_eisa_ids);
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index e6f1f8c3f8d4..db30ebd7b262 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -103,7 +103,7 @@ obj-$(CONFIG_HAMACHI) += hamachi.o
103obj-$(CONFIG_NET) += Space.o loopback.o 103obj-$(CONFIG_NET) += Space.o loopback.o
104obj-$(CONFIG_SEEQ8005) += seeq8005.o 104obj-$(CONFIG_SEEQ8005) += seeq8005.o
105obj-$(CONFIG_NET_SB1000) += sb1000.o 105obj-$(CONFIG_NET_SB1000) += sb1000.o
106obj-$(CONFIG_MAC8390) += mac8390.o 8390.o 106obj-$(CONFIG_MAC8390) += mac8390.o
107obj-$(CONFIG_APNE) += apne.o 8390.o 107obj-$(CONFIG_APNE) += apne.o 8390.o
108obj-$(CONFIG_PCMCIA_PCNET) += 8390.o 108obj-$(CONFIG_PCMCIA_PCNET) += 8390.o
109obj-$(CONFIG_HP100) += hp100.o 109obj-$(CONFIG_HP100) += hp100.o
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index fb57b750866b..1342418fb209 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -37,6 +37,7 @@ char atl1e_driver_version[] = DRV_VERSION;
37 */ 37 */
38static struct pci_device_id atl1e_pci_tbl[] = { 38static struct pci_device_id atl1e_pci_tbl[] = {
39 {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATTANSIC_L1E)}, 39 {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, PCI_DEVICE_ID_ATTANSIC_L1E)},
40 {PCI_DEVICE(PCI_VENDOR_ID_ATTANSIC, 0x1066)},
40 /* required last entry */ 41 /* required last entry */
41 { 0 } 42 { 0 }
42}; 43};
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 0ab22540bf59..4e817126e280 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -82,6 +82,12 @@
82 82
83#include "atl1.h" 83#include "atl1.h"
84 84
85#define ATLX_DRIVER_VERSION "2.1.3"
86MODULE_AUTHOR("Xiong Huang <xiong.huang@atheros.com>, \
87 Chris Snook <csnook@redhat.com>, Jay Cliburn <jcliburn@gmail.com>");
88MODULE_LICENSE("GPL");
89MODULE_VERSION(ATLX_DRIVER_VERSION);
90
85/* Temporary hack for merging atl1 and atl2 */ 91/* Temporary hack for merging atl1 and atl2 */
86#include "atlx.c" 92#include "atlx.c"
87 93
diff --git a/drivers/net/atlx/atlx.h b/drivers/net/atlx/atlx.h
index 297a03da6b7f..14054b75aa62 100644
--- a/drivers/net/atlx/atlx.h
+++ b/drivers/net/atlx/atlx.h
@@ -29,12 +29,6 @@
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/types.h> 30#include <linux/types.h>
31 31
32#define ATLX_DRIVER_VERSION "2.1.3"
33MODULE_AUTHOR("Xiong Huang <xiong.huang@atheros.com>, \
34 Chris Snook <csnook@redhat.com>, Jay Cliburn <jcliburn@gmail.com>");
35MODULE_LICENSE("GPL");
36MODULE_VERSION(ATLX_DRIVER_VERSION);
37
38#define ATLX_ERR_PHY 2 32#define ATLX_ERR_PHY 2
39#define ATLX_ERR_PHY_SPEED 7 33#define ATLX_ERR_PHY_SPEED 7
40#define ATLX_ERR_PHY_RES 8 34#define ATLX_ERR_PHY_RES 8
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index c49ddd08b2aa..b4bb06fdf307 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -35,8 +35,22 @@
35#define DRV_VER "2.0.348" 35#define DRV_VER "2.0.348"
36#define DRV_NAME "be2net" 36#define DRV_NAME "be2net"
37#define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC" 37#define BE_NAME "ServerEngines BladeEngine2 10Gbps NIC"
38#define OC_NAME "Emulex OneConnect 10Gbps NIC"
38#define DRV_DESC BE_NAME "Driver" 39#define DRV_DESC BE_NAME "Driver"
39 40
41#define BE_VENDOR_ID 0x19a2
42#define BE_DEVICE_ID1 0x211
43#define OC_DEVICE_ID1 0x700
44#define OC_DEVICE_ID2 0x701
45
46static inline char *nic_name(struct pci_dev *pdev)
47{
48 if (pdev->device == OC_DEVICE_ID1 || pdev->device == OC_DEVICE_ID2)
49 return OC_NAME;
50 else
51 return BE_NAME;
52}
53
40/* Number of bytes of an RX frame that are copied to skb->data */ 54/* Number of bytes of an RX frame that are copied to skb->data */
41#define BE_HDR_LEN 64 55#define BE_HDR_LEN 64
42#define BE_MAX_JUMBO_FRAME_SIZE 9018 56#define BE_MAX_JUMBO_FRAME_SIZE 9018
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 30d0c81c989e..5c378b5e8e41 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -28,10 +28,10 @@ static unsigned int rx_frag_size = 2048;
28module_param(rx_frag_size, uint, S_IRUGO); 28module_param(rx_frag_size, uint, S_IRUGO);
29MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data."); 29MODULE_PARM_DESC(rx_frag_size, "Size of a fragment that holds rcvd data.");
30 30
31#define BE_VENDOR_ID 0x19a2
32#define BE2_DEVICE_ID_1 0x0211
33static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = { 31static DEFINE_PCI_DEVICE_TABLE(be_dev_ids) = {
34 { PCI_DEVICE(BE_VENDOR_ID, BE2_DEVICE_ID_1) }, 32 { PCI_DEVICE(BE_VENDOR_ID, BE_DEVICE_ID1) },
33 { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID1) },
34 { PCI_DEVICE(BE_VENDOR_ID, OC_DEVICE_ID2) },
35 { 0 } 35 { 0 }
36}; 36};
37MODULE_DEVICE_TABLE(pci, be_dev_ids); 37MODULE_DEVICE_TABLE(pci, be_dev_ids);
@@ -1859,7 +1859,7 @@ static int __devinit be_probe(struct pci_dev *pdev,
1859 if (status != 0) 1859 if (status != 0)
1860 goto stats_clean; 1860 goto stats_clean;
1861 1861
1862 dev_info(&pdev->dev, BE_NAME " port %d\n", adapter->port_num); 1862 dev_info(&pdev->dev, "%s port %d\n", nic_name(pdev), adapter->port_num);
1863 return 0; 1863 return 0;
1864 1864
1865stats_clean: 1865stats_clean:
@@ -1873,7 +1873,7 @@ rel_reg:
1873disable_dev: 1873disable_dev:
1874 pci_disable_device(pdev); 1874 pci_disable_device(pdev);
1875do_none: 1875do_none:
1876 dev_warn(&pdev->dev, BE_NAME " initialization failed\n"); 1876 dev_err(&pdev->dev, "%s initialization failed\n", nic_name(pdev));
1877 return status; 1877 return status;
1878} 1878}
1879 1879
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 9f971ed6b58d..b4da18213324 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -979,22 +979,7 @@ static int bfin_mac_open(struct net_device *dev)
979 return 0; 979 return 0;
980} 980}
981 981
982static const struct net_device_ops bfin_mac_netdev_ops = {
983 .ndo_open = bfin_mac_open,
984 .ndo_stop = bfin_mac_close,
985 .ndo_start_xmit = bfin_mac_hard_start_xmit,
986 .ndo_set_mac_address = bfin_mac_set_mac_address,
987 .ndo_tx_timeout = bfin_mac_timeout,
988 .ndo_set_multicast_list = bfin_mac_set_multicast_list,
989 .ndo_validate_addr = eth_validate_addr,
990 .ndo_change_mtu = eth_change_mtu,
991#ifdef CONFIG_NET_POLL_CONTROLLER
992 .ndo_poll_controller = bfin_mac_poll,
993#endif
994};
995
996/* 982/*
997 *
998 * this makes the board clean up everything that it can 983 * this makes the board clean up everything that it can
999 * and not talk to the outside world. Caused by 984 * and not talk to the outside world. Caused by
1000 * an 'ifconfig ethX down' 985 * an 'ifconfig ethX down'
@@ -1019,6 +1004,20 @@ static int bfin_mac_close(struct net_device *dev)
1019 return 0; 1004 return 0;
1020} 1005}
1021 1006
1007static const struct net_device_ops bfin_mac_netdev_ops = {
1008 .ndo_open = bfin_mac_open,
1009 .ndo_stop = bfin_mac_close,
1010 .ndo_start_xmit = bfin_mac_hard_start_xmit,
1011 .ndo_set_mac_address = bfin_mac_set_mac_address,
1012 .ndo_tx_timeout = bfin_mac_timeout,
1013 .ndo_set_multicast_list = bfin_mac_set_multicast_list,
1014 .ndo_validate_addr = eth_validate_addr,
1015 .ndo_change_mtu = eth_change_mtu,
1016#ifdef CONFIG_NET_POLL_CONTROLLER
1017 .ndo_poll_controller = bfin_mac_poll,
1018#endif
1019};
1020
1022static int __devinit bfin_mac_probe(struct platform_device *pdev) 1021static int __devinit bfin_mac_probe(struct platform_device *pdev)
1023{ 1022{
1024 struct net_device *ndev; 1023 struct net_device *ndev;
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 8c2e5ab51f08..faf094abef7f 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1465,6 +1465,12 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
1465 return best; 1465 return best;
1466} 1466}
1467 1467
1468static int agg_device_up(const struct aggregator *agg)
1469{
1470 return (netif_running(agg->slave->dev) &&
1471 netif_carrier_ok(agg->slave->dev));
1472}
1473
1468/** 1474/**
1469 * ad_agg_selection_logic - select an aggregation group for a team 1475 * ad_agg_selection_logic - select an aggregation group for a team
1470 * @aggregator: the aggregator we're looking at 1476 * @aggregator: the aggregator we're looking at
@@ -1496,14 +1502,13 @@ static void ad_agg_selection_logic(struct aggregator *agg)
1496 struct port *port; 1502 struct port *port;
1497 1503
1498 origin = agg; 1504 origin = agg;
1499
1500 active = __get_active_agg(agg); 1505 active = __get_active_agg(agg);
1501 best = active; 1506 best = (active && agg_device_up(active)) ? active : NULL;
1502 1507
1503 do { 1508 do {
1504 agg->is_active = 0; 1509 agg->is_active = 0;
1505 1510
1506 if (agg->num_of_ports) 1511 if (agg->num_of_ports && agg_device_up(agg))
1507 best = ad_agg_selection_test(best, agg); 1512 best = ad_agg_selection_test(best, agg);
1508 1513
1509 } while ((agg = __get_next_agg(agg))); 1514 } while ((agg = __get_next_agg(agg)));
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h
index 714df2b675e6..c888e97c9671 100644
--- a/drivers/net/cxgb3/adapter.h
+++ b/drivers/net/cxgb3/adapter.h
@@ -85,8 +85,8 @@ struct fl_pg_chunk {
85 struct page *page; 85 struct page *page;
86 void *va; 86 void *va;
87 unsigned int offset; 87 unsigned int offset;
88 u64 *p_cnt; 88 unsigned long *p_cnt;
89 DECLARE_PCI_UNMAP_ADDR(mapping); 89 dma_addr_t mapping;
90}; 90};
91 91
92struct rx_desc; 92struct rx_desc;
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 7ea48414c6cb..17858b9a5830 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2496,14 +2496,16 @@ static void check_link_status(struct adapter *adapter)
2496 for_each_port(adapter, i) { 2496 for_each_port(adapter, i) {
2497 struct net_device *dev = adapter->port[i]; 2497 struct net_device *dev = adapter->port[i];
2498 struct port_info *p = netdev_priv(dev); 2498 struct port_info *p = netdev_priv(dev);
2499 int link_fault;
2499 2500
2500 spin_lock_irq(&adapter->work_lock); 2501 spin_lock_irq(&adapter->work_lock);
2501 if (p->link_fault) { 2502 link_fault = p->link_fault;
2503 spin_unlock_irq(&adapter->work_lock);
2504
2505 if (link_fault) {
2502 t3_link_fault(adapter, i); 2506 t3_link_fault(adapter, i);
2503 spin_unlock_irq(&adapter->work_lock);
2504 continue; 2507 continue;
2505 } 2508 }
2506 spin_unlock_irq(&adapter->work_lock);
2507 2509
2508 if (!(p->phy.caps & SUPPORTED_IRQ) && netif_running(dev)) { 2510 if (!(p->phy.caps & SUPPORTED_IRQ) && netif_running(dev)) {
2509 t3_xgm_intr_disable(adapter, i); 2511 t3_xgm_intr_disable(adapter, i);
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index 26d3587f3399..b3ee2bc1a005 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -355,7 +355,7 @@ static void clear_rx_desc(struct pci_dev *pdev, const struct sge_fl *q,
355 (*d->pg_chunk.p_cnt)--; 355 (*d->pg_chunk.p_cnt)--;
356 if (!*d->pg_chunk.p_cnt) 356 if (!*d->pg_chunk.p_cnt)
357 pci_unmap_page(pdev, 357 pci_unmap_page(pdev,
358 pci_unmap_addr(&d->pg_chunk, mapping), 358 d->pg_chunk.mapping,
359 q->alloc_size, PCI_DMA_FROMDEVICE); 359 q->alloc_size, PCI_DMA_FROMDEVICE);
360 360
361 put_page(d->pg_chunk.page); 361 put_page(d->pg_chunk.page);
@@ -454,7 +454,7 @@ static int alloc_pg_chunk(struct adapter *adapter, struct sge_fl *q,
454 q->pg_chunk.offset = 0; 454 q->pg_chunk.offset = 0;
455 mapping = pci_map_page(adapter->pdev, q->pg_chunk.page, 455 mapping = pci_map_page(adapter->pdev, q->pg_chunk.page,
456 0, q->alloc_size, PCI_DMA_FROMDEVICE); 456 0, q->alloc_size, PCI_DMA_FROMDEVICE);
457 pci_unmap_addr_set(&q->pg_chunk, mapping, mapping); 457 q->pg_chunk.mapping = mapping;
458 } 458 }
459 sd->pg_chunk = q->pg_chunk; 459 sd->pg_chunk = q->pg_chunk;
460 460
@@ -511,8 +511,7 @@ static int refill_fl(struct adapter *adap, struct sge_fl *q, int n, gfp_t gfp)
511nomem: q->alloc_failed++; 511nomem: q->alloc_failed++;
512 break; 512 break;
513 } 513 }
514 mapping = pci_unmap_addr(&sd->pg_chunk, mapping) + 514 mapping = sd->pg_chunk.mapping + sd->pg_chunk.offset;
515 sd->pg_chunk.offset;
516 pci_unmap_addr_set(sd, dma_addr, mapping); 515 pci_unmap_addr_set(sd, dma_addr, mapping);
517 516
518 add_one_rx_chunk(mapping, d, q->gen); 517 add_one_rx_chunk(mapping, d, q->gen);
@@ -881,7 +880,7 @@ recycle:
881 (*sd->pg_chunk.p_cnt)--; 880 (*sd->pg_chunk.p_cnt)--;
882 if (!*sd->pg_chunk.p_cnt) 881 if (!*sd->pg_chunk.p_cnt)
883 pci_unmap_page(adap->pdev, 882 pci_unmap_page(adap->pdev,
884 pci_unmap_addr(&sd->pg_chunk, mapping), 883 sd->pg_chunk.mapping,
885 fl->alloc_size, 884 fl->alloc_size,
886 PCI_DMA_FROMDEVICE); 885 PCI_DMA_FROMDEVICE);
887 if (!skb) { 886 if (!skb) {
@@ -2096,7 +2095,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
2096 (*sd->pg_chunk.p_cnt)--; 2095 (*sd->pg_chunk.p_cnt)--;
2097 if (!*sd->pg_chunk.p_cnt) 2096 if (!*sd->pg_chunk.p_cnt)
2098 pci_unmap_page(adap->pdev, 2097 pci_unmap_page(adap->pdev,
2099 pci_unmap_addr(&sd->pg_chunk, mapping), 2098 sd->pg_chunk.mapping,
2100 fl->alloc_size, 2099 fl->alloc_size,
2101 PCI_DMA_FROMDEVICE); 2100 PCI_DMA_FROMDEVICE);
2102 2101
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index 4f68aeb2679a..4950d5d789ae 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -1274,6 +1274,11 @@ void t3_link_fault(struct adapter *adapter, int port_id)
1274 A_XGM_INT_STATUS + mac->offset); 1274 A_XGM_INT_STATUS + mac->offset);
1275 link_fault &= F_LINKFAULTCHANGE; 1275 link_fault &= F_LINKFAULTCHANGE;
1276 1276
1277 link_ok = lc->link_ok;
1278 speed = lc->speed;
1279 duplex = lc->duplex;
1280 fc = lc->fc;
1281
1277 phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc); 1282 phy->ops->get_link_status(phy, &link_ok, &speed, &duplex, &fc);
1278 1283
1279 if (link_fault) { 1284 if (link_fault) {
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index b1419e21b46b..fffb006b7d95 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -4027,8 +4027,9 @@ static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
4027 PCI_DMA_FROMDEVICE); 4027 PCI_DMA_FROMDEVICE);
4028 4028
4029 length = le16_to_cpu(rx_desc->length); 4029 length = le16_to_cpu(rx_desc->length);
4030 4030 /* !EOP means multiple descriptors were used to store a single
4031 if (unlikely(!(status & E1000_RXD_STAT_EOP))) { 4031 * packet, also make sure the frame isn't just CRC only */
4032 if (unlikely(!(status & E1000_RXD_STAT_EOP) || (length <= 4))) {
4032 /* All receives must fit into a single buffer */ 4033 /* All receives must fit into a single buffer */
4033 E1000_DBG("%s: Receive packet consumed multiple" 4034 E1000_DBG("%s: Receive packet consumed multiple"
4034 " buffers\n", netdev->name); 4035 " buffers\n", netdev->name);
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index f9a846b1b92f..9f6a68fb7b45 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -897,6 +897,12 @@ enum {
897}; 897};
898static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED; 898static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED;
899 899
900/*
901 * Power down phy when interface is down (persists through reboot;
902 * older Linux and other OSes may not power it up again)
903 */
904static int phy_power_down = 0;
905
900static inline struct fe_priv *get_nvpriv(struct net_device *dev) 906static inline struct fe_priv *get_nvpriv(struct net_device *dev)
901{ 907{
902 return netdev_priv(dev); 908 return netdev_priv(dev);
@@ -1485,7 +1491,10 @@ static int phy_init(struct net_device *dev)
1485 1491
1486 /* restart auto negotiation, power down phy */ 1492 /* restart auto negotiation, power down phy */
1487 mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ); 1493 mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
1488 mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN); 1494 mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
1495 if (phy_power_down) {
1496 mii_control |= BMCR_PDOWN;
1497 }
1489 if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) { 1498 if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
1490 return PHY_ERROR; 1499 return PHY_ERROR;
1491 } 1500 }
@@ -5513,7 +5522,7 @@ static int nv_close(struct net_device *dev)
5513 5522
5514 nv_drain_rxtx(dev); 5523 nv_drain_rxtx(dev);
5515 5524
5516 if (np->wolenabled) { 5525 if (np->wolenabled || !phy_power_down) {
5517 writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags); 5526 writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);
5518 nv_start_rx(dev); 5527 nv_start_rx(dev);
5519 } else { 5528 } else {
@@ -6367,6 +6376,8 @@ module_param(dma_64bit, int, 0);
6367MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0."); 6376MODULE_PARM_DESC(dma_64bit, "High DMA is enabled by setting to 1 and disabled by setting to 0.");
6368module_param(phy_cross, int, 0); 6377module_param(phy_cross, int, 0);
6369MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0."); 6378MODULE_PARM_DESC(phy_cross, "Phy crossover detection for Realtek 8201 phy is enabled by setting to 1 and disabled by setting to 0.");
6379module_param(phy_power_down, int, 0);
6380MODULE_PARM_DESC(phy_power_down, "Power down phy and disable link when interface is down (1), or leave phy powered up (0).");
6370 6381
6371MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>"); 6382MODULE_AUTHOR("Manfred Spraul <manfred@colorfullife.com>");
6372MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver"); 6383MODULE_DESCRIPTION("Reverse Engineered nForce ethernet driver");
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index b2c49679bba7..a0519184e54e 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -1885,8 +1885,17 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
1885 1885
1886 if (unlikely(!newskb)) 1886 if (unlikely(!newskb))
1887 newskb = skb; 1887 newskb = skb;
1888 else if (skb) 1888 else if (skb) {
1889 /*
1890 * We need to reset ->data to what it
1891 * was before gfar_new_skb() re-aligned
1892 * it to an RXBUF_ALIGNMENT boundary
1893 * before we put the skb back on the
1894 * recycle list.
1895 */
1896 skb->data = skb->head + NET_SKB_PAD;
1889 __skb_queue_head(&priv->rx_recycle, skb); 1897 __skb_queue_head(&priv->rx_recycle, skb);
1898 }
1890 } else { 1899 } else {
1891 /* Increment the number of packets */ 1900 /* Increment the number of packets */
1892 dev->stats.rx_packets++; 1901 dev->stats.rx_packets++;
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 0642d52aef5c..cf352961ae9b 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -259,7 +259,7 @@ extern const char gfar_driver_version[];
259(IEVENT_RXC | IEVENT_BSY | IEVENT_EBERR | IEVENT_MSRO | \ 259(IEVENT_RXC | IEVENT_BSY | IEVENT_EBERR | IEVENT_MSRO | \
260 IEVENT_BABT | IEVENT_TXC | IEVENT_TXE | IEVENT_LC \ 260 IEVENT_BABT | IEVENT_TXC | IEVENT_TXE | IEVENT_LC \
261 | IEVENT_CRL | IEVENT_XFUN | IEVENT_DPE | IEVENT_PERR \ 261 | IEVENT_CRL | IEVENT_XFUN | IEVENT_DPE | IEVENT_PERR \
262 | IEVENT_MAG) 262 | IEVENT_MAG | IEVENT_BABR)
263 263
264#define IMASK_INIT_CLEAR 0x00000000 264#define IMASK_INIT_CLEAR 0x00000000
265#define IMASK_BABR 0x80000000 265#define IMASK_BABR 0x80000000
diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c
index 8e884869a05b..22e74a0e0361 100644
--- a/drivers/net/mac8390.c
+++ b/drivers/net/mac8390.c
@@ -304,7 +304,7 @@ struct net_device * __init mac8390_probe(int unit)
304 if (!MACH_IS_MAC) 304 if (!MACH_IS_MAC)
305 return ERR_PTR(-ENODEV); 305 return ERR_PTR(-ENODEV);
306 306
307 dev = alloc_ei_netdev(); 307 dev = ____alloc_ei_netdev(0);
308 if (!dev) 308 if (!dev)
309 return ERR_PTR(-ENOMEM); 309 return ERR_PTR(-ENOMEM);
310 310
@@ -481,15 +481,15 @@ void cleanup_module(void)
481static const struct net_device_ops mac8390_netdev_ops = { 481static const struct net_device_ops mac8390_netdev_ops = {
482 .ndo_open = mac8390_open, 482 .ndo_open = mac8390_open,
483 .ndo_stop = mac8390_close, 483 .ndo_stop = mac8390_close,
484 .ndo_start_xmit = ei_start_xmit, 484 .ndo_start_xmit = __ei_start_xmit,
485 .ndo_tx_timeout = ei_tx_timeout, 485 .ndo_tx_timeout = __ei_tx_timeout,
486 .ndo_get_stats = ei_get_stats, 486 .ndo_get_stats = __ei_get_stats,
487 .ndo_set_multicast_list = ei_set_multicast_list, 487 .ndo_set_multicast_list = __ei_set_multicast_list,
488 .ndo_validate_addr = eth_validate_addr, 488 .ndo_validate_addr = eth_validate_addr,
489 .ndo_set_mac_address = eth_mac_addr, 489 .ndo_set_mac_address = eth_mac_addr,
490 .ndo_change_mtu = eth_change_mtu, 490 .ndo_change_mtu = eth_change_mtu,
491#ifdef CONFIG_NET_POLL_CONTROLLER 491#ifdef CONFIG_NET_POLL_CONTROLLER
492 .ndo_poll_controller = ei_poll, 492 .ndo_poll_controller = __ei_poll,
493#endif 493#endif
494}; 494};
495 495
diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index aa08987f6e81..dbd3436912b8 100644
--- a/drivers/net/meth.c
+++ b/drivers/net/meth.c
@@ -127,11 +127,11 @@ static unsigned long mdio_read(struct meth_private *priv, unsigned long phyreg)
127static int mdio_probe(struct meth_private *priv) 127static int mdio_probe(struct meth_private *priv)
128{ 128{
129 int i; 129 int i;
130 unsigned long p2, p3; 130 unsigned long p2, p3, flags;
131 /* check if phy is detected already */ 131 /* check if phy is detected already */
132 if(priv->phy_addr>=0&&priv->phy_addr<32) 132 if(priv->phy_addr>=0&&priv->phy_addr<32)
133 return 0; 133 return 0;
134 spin_lock(&priv->meth_lock); 134 spin_lock_irqsave(&priv->meth_lock, flags);
135 for (i=0;i<32;++i){ 135 for (i=0;i<32;++i){
136 priv->phy_addr=i; 136 priv->phy_addr=i;
137 p2=mdio_read(priv,2); 137 p2=mdio_read(priv,2);
@@ -157,7 +157,7 @@ static int mdio_probe(struct meth_private *priv)
157 break; 157 break;
158 } 158 }
159 } 159 }
160 spin_unlock(&priv->meth_lock); 160 spin_unlock_irqrestore(&priv->meth_lock, flags);
161 if(priv->phy_addr<32) { 161 if(priv->phy_addr<32) {
162 return 0; 162 return 0;
163 } 163 }
@@ -373,14 +373,14 @@ static int meth_release(struct net_device *dev)
373static void meth_rx(struct net_device* dev, unsigned long int_status) 373static void meth_rx(struct net_device* dev, unsigned long int_status)
374{ 374{
375 struct sk_buff *skb; 375 struct sk_buff *skb;
376 unsigned long status; 376 unsigned long status, flags;
377 struct meth_private *priv = netdev_priv(dev); 377 struct meth_private *priv = netdev_priv(dev);
378 unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8; 378 unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8;
379 379
380 spin_lock(&priv->meth_lock); 380 spin_lock_irqsave(&priv->meth_lock, flags);
381 priv->dma_ctrl &= ~METH_DMA_RX_INT_EN; 381 priv->dma_ctrl &= ~METH_DMA_RX_INT_EN;
382 mace->eth.dma_ctrl = priv->dma_ctrl; 382 mace->eth.dma_ctrl = priv->dma_ctrl;
383 spin_unlock(&priv->meth_lock); 383 spin_unlock_irqrestore(&priv->meth_lock, flags);
384 384
385 if (int_status & METH_INT_RX_UNDERFLOW) { 385 if (int_status & METH_INT_RX_UNDERFLOW) {
386 fifo_rptr = (fifo_rptr - 1) & 0x0f; 386 fifo_rptr = (fifo_rptr - 1) & 0x0f;
@@ -452,12 +452,12 @@ static void meth_rx(struct net_device* dev, unsigned long int_status)
452 mace->eth.rx_fifo = priv->rx_ring_dmas[priv->rx_write]; 452 mace->eth.rx_fifo = priv->rx_ring_dmas[priv->rx_write];
453 ADVANCE_RX_PTR(priv->rx_write); 453 ADVANCE_RX_PTR(priv->rx_write);
454 } 454 }
455 spin_lock(&priv->meth_lock); 455 spin_lock_irqsave(&priv->meth_lock, flags);
456 /* In case there was underflow, and Rx DMA was disabled */ 456 /* In case there was underflow, and Rx DMA was disabled */
457 priv->dma_ctrl |= METH_DMA_RX_INT_EN | METH_DMA_RX_EN; 457 priv->dma_ctrl |= METH_DMA_RX_INT_EN | METH_DMA_RX_EN;
458 mace->eth.dma_ctrl = priv->dma_ctrl; 458 mace->eth.dma_ctrl = priv->dma_ctrl;
459 mace->eth.int_stat = METH_INT_RX_THRESHOLD; 459 mace->eth.int_stat = METH_INT_RX_THRESHOLD;
460 spin_unlock(&priv->meth_lock); 460 spin_unlock_irqrestore(&priv->meth_lock, flags);
461} 461}
462 462
463static int meth_tx_full(struct net_device *dev) 463static int meth_tx_full(struct net_device *dev)
@@ -470,11 +470,11 @@ static int meth_tx_full(struct net_device *dev)
470static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) 470static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status)
471{ 471{
472 struct meth_private *priv = netdev_priv(dev); 472 struct meth_private *priv = netdev_priv(dev);
473 unsigned long status; 473 unsigned long status, flags;
474 struct sk_buff *skb; 474 struct sk_buff *skb;
475 unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16; 475 unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16;
476 476
477 spin_lock(&priv->meth_lock); 477 spin_lock_irqsave(&priv->meth_lock, flags);
478 478
479 /* Stop DMA notification */ 479 /* Stop DMA notification */
480 priv->dma_ctrl &= ~(METH_DMA_TX_INT_EN); 480 priv->dma_ctrl &= ~(METH_DMA_TX_INT_EN);
@@ -527,12 +527,13 @@ static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status)
527 } 527 }
528 528
529 mace->eth.int_stat = METH_INT_TX_EMPTY | METH_INT_TX_PKT; 529 mace->eth.int_stat = METH_INT_TX_EMPTY | METH_INT_TX_PKT;
530 spin_unlock(&priv->meth_lock); 530 spin_unlock_irqrestore(&priv->meth_lock, flags);
531} 531}
532 532
533static void meth_error(struct net_device* dev, unsigned status) 533static void meth_error(struct net_device* dev, unsigned status)
534{ 534{
535 struct meth_private *priv = netdev_priv(dev); 535 struct meth_private *priv = netdev_priv(dev);
536 unsigned long flags;
536 537
537 printk(KERN_WARNING "meth: error status: 0x%08x\n",status); 538 printk(KERN_WARNING "meth: error status: 0x%08x\n",status);
538 /* check for errors too... */ 539 /* check for errors too... */
@@ -547,7 +548,7 @@ static void meth_error(struct net_device* dev, unsigned status)
547 printk(KERN_WARNING "meth: Rx overflow\n"); 548 printk(KERN_WARNING "meth: Rx overflow\n");
548 if (status & (METH_INT_RX_UNDERFLOW)) { 549 if (status & (METH_INT_RX_UNDERFLOW)) {
549 printk(KERN_WARNING "meth: Rx underflow\n"); 550 printk(KERN_WARNING "meth: Rx underflow\n");
550 spin_lock(&priv->meth_lock); 551 spin_lock_irqsave(&priv->meth_lock, flags);
551 mace->eth.int_stat = METH_INT_RX_UNDERFLOW; 552 mace->eth.int_stat = METH_INT_RX_UNDERFLOW;
552 /* more underflow interrupts will be delivered, 553 /* more underflow interrupts will be delivered,
553 * effectively throwing us into an infinite loop. 554 * effectively throwing us into an infinite loop.
@@ -555,7 +556,7 @@ static void meth_error(struct net_device* dev, unsigned status)
555 priv->dma_ctrl &= ~METH_DMA_RX_EN; 556 priv->dma_ctrl &= ~METH_DMA_RX_EN;
556 mace->eth.dma_ctrl = priv->dma_ctrl; 557 mace->eth.dma_ctrl = priv->dma_ctrl;
557 DPRINTK("Disabled meth Rx DMA temporarily\n"); 558 DPRINTK("Disabled meth Rx DMA temporarily\n");
558 spin_unlock(&priv->meth_lock); 559 spin_unlock_irqrestore(&priv->meth_lock, flags);
559 } 560 }
560 mace->eth.int_stat = METH_INT_ERROR; 561 mace->eth.int_stat = METH_INT_ERROR;
561} 562}
diff --git a/drivers/net/mlx4/en_cq.c b/drivers/net/mlx4/en_cq.c
index 91f50de84be9..a276125b709b 100644
--- a/drivers/net/mlx4/en_cq.c
+++ b/drivers/net/mlx4/en_cq.c
@@ -125,8 +125,10 @@ void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq)
125 125
126 if (cq->is_tx) 126 if (cq->is_tx)
127 del_timer(&cq->timer); 127 del_timer(&cq->timer);
128 else 128 else {
129 napi_disable(&cq->napi); 129 napi_disable(&cq->napi);
130 netif_napi_del(&cq->napi);
131 }
130 132
131 mlx4_cq_free(mdev->dev, &cq->mcq); 133 mlx4_cq_free(mdev->dev, &cq->mcq);
132} 134}
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c
index ac6fc499b280..e5c98a98ad37 100644
--- a/drivers/net/mlx4/en_tx.c
+++ b/drivers/net/mlx4/en_tx.c
@@ -426,7 +426,7 @@ void mlx4_en_poll_tx_cq(unsigned long data)
426 426
427 INC_PERF_COUNTER(priv->pstats.tx_poll); 427 INC_PERF_COUNTER(priv->pstats.tx_poll);
428 428
429 if (!spin_trylock(&ring->comp_lock)) { 429 if (!spin_trylock_irq(&ring->comp_lock)) {
430 mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT); 430 mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT);
431 return; 431 return;
432 } 432 }
@@ -439,7 +439,7 @@ void mlx4_en_poll_tx_cq(unsigned long data)
439 if (inflight && priv->port_up) 439 if (inflight && priv->port_up)
440 mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT); 440 mod_timer(&cq->timer, jiffies + MLX4_EN_TX_POLL_TIMEOUT);
441 441
442 spin_unlock(&ring->comp_lock); 442 spin_unlock_irq(&ring->comp_lock);
443} 443}
444 444
445static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv, 445static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv,
@@ -482,9 +482,9 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind)
482 482
483 /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */ 483 /* Poll the CQ every mlx4_en_TX_MODER_POLL packets */
484 if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0) 484 if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0)
485 if (spin_trylock(&ring->comp_lock)) { 485 if (spin_trylock_irq(&ring->comp_lock)) {
486 mlx4_en_process_tx_cq(priv->dev, cq); 486 mlx4_en_process_tx_cq(priv->dev, cq);
487 spin_unlock(&ring->comp_lock); 487 spin_unlock_irq(&ring->comp_lock);
488 } 488 }
489} 489}
490 490
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index a400d7115f78..6bb5af35eda6 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -569,7 +569,7 @@ static int rxq_process(struct rx_queue *rxq, int budget)
569 if (rxq->rx_curr_desc == rxq->rx_ring_size) 569 if (rxq->rx_curr_desc == rxq->rx_ring_size)
570 rxq->rx_curr_desc = 0; 570 rxq->rx_curr_desc = 0;
571 571
572 dma_unmap_single(NULL, rx_desc->buf_ptr, 572 dma_unmap_single(mp->dev->dev.parent, rx_desc->buf_ptr,
573 rx_desc->buf_size, DMA_FROM_DEVICE); 573 rx_desc->buf_size, DMA_FROM_DEVICE);
574 rxq->rx_desc_count--; 574 rxq->rx_desc_count--;
575 rx++; 575 rx++;
@@ -678,8 +678,9 @@ static int rxq_refill(struct rx_queue *rxq, int budget)
678 678
679 rx_desc = rxq->rx_desc_area + rx; 679 rx_desc = rxq->rx_desc_area + rx;
680 680
681 rx_desc->buf_ptr = dma_map_single(NULL, skb->data, 681 rx_desc->buf_ptr = dma_map_single(mp->dev->dev.parent,
682 mp->skb_size, DMA_FROM_DEVICE); 682 skb->data, mp->skb_size,
683 DMA_FROM_DEVICE);
683 rx_desc->buf_size = mp->skb_size; 684 rx_desc->buf_size = mp->skb_size;
684 rxq->rx_skb[rx] = skb; 685 rxq->rx_skb[rx] = skb;
685 wmb(); 686 wmb();
@@ -718,6 +719,7 @@ static inline unsigned int has_tiny_unaligned_frags(struct sk_buff *skb)
718 719
719static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb) 720static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb)
720{ 721{
722 struct mv643xx_eth_private *mp = txq_to_mp(txq);
721 int nr_frags = skb_shinfo(skb)->nr_frags; 723 int nr_frags = skb_shinfo(skb)->nr_frags;
722 int frag; 724 int frag;
723 725
@@ -746,10 +748,10 @@ static void txq_submit_frag_skb(struct tx_queue *txq, struct sk_buff *skb)
746 748
747 desc->l4i_chk = 0; 749 desc->l4i_chk = 0;
748 desc->byte_cnt = this_frag->size; 750 desc->byte_cnt = this_frag->size;
749 desc->buf_ptr = dma_map_page(NULL, this_frag->page, 751 desc->buf_ptr = dma_map_page(mp->dev->dev.parent,
750 this_frag->page_offset, 752 this_frag->page,
751 this_frag->size, 753 this_frag->page_offset,
752 DMA_TO_DEVICE); 754 this_frag->size, DMA_TO_DEVICE);
753 } 755 }
754} 756}
755 757
@@ -826,7 +828,8 @@ no_csum:
826 828
827 desc->l4i_chk = l4i_chk; 829 desc->l4i_chk = l4i_chk;
828 desc->byte_cnt = length; 830 desc->byte_cnt = length;
829 desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE); 831 desc->buf_ptr = dma_map_single(mp->dev->dev.parent, skb->data,
832 length, DMA_TO_DEVICE);
830 833
831 __skb_queue_tail(&txq->tx_skb, skb); 834 __skb_queue_tail(&txq->tx_skb, skb);
832 835
@@ -956,10 +959,10 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
956 } 959 }
957 960
958 if (cmd_sts & TX_FIRST_DESC) { 961 if (cmd_sts & TX_FIRST_DESC) {
959 dma_unmap_single(NULL, desc->buf_ptr, 962 dma_unmap_single(mp->dev->dev.parent, desc->buf_ptr,
960 desc->byte_cnt, DMA_TO_DEVICE); 963 desc->byte_cnt, DMA_TO_DEVICE);
961 } else { 964 } else {
962 dma_unmap_page(NULL, desc->buf_ptr, 965 dma_unmap_page(mp->dev->dev.parent, desc->buf_ptr,
963 desc->byte_cnt, DMA_TO_DEVICE); 966 desc->byte_cnt, DMA_TO_DEVICE);
964 } 967 }
965 968
@@ -1894,9 +1897,9 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index)
1894 mp->rx_desc_sram_size); 1897 mp->rx_desc_sram_size);
1895 rxq->rx_desc_dma = mp->rx_desc_sram_addr; 1898 rxq->rx_desc_dma = mp->rx_desc_sram_addr;
1896 } else { 1899 } else {
1897 rxq->rx_desc_area = dma_alloc_coherent(NULL, size, 1900 rxq->rx_desc_area = dma_alloc_coherent(mp->dev->dev.parent,
1898 &rxq->rx_desc_dma, 1901 size, &rxq->rx_desc_dma,
1899 GFP_KERNEL); 1902 GFP_KERNEL);
1900 } 1903 }
1901 1904
1902 if (rxq->rx_desc_area == NULL) { 1905 if (rxq->rx_desc_area == NULL) {
@@ -1947,7 +1950,7 @@ out_free:
1947 if (index == 0 && size <= mp->rx_desc_sram_size) 1950 if (index == 0 && size <= mp->rx_desc_sram_size)
1948 iounmap(rxq->rx_desc_area); 1951 iounmap(rxq->rx_desc_area);
1949 else 1952 else
1950 dma_free_coherent(NULL, size, 1953 dma_free_coherent(mp->dev->dev.parent, size,
1951 rxq->rx_desc_area, 1954 rxq->rx_desc_area,
1952 rxq->rx_desc_dma); 1955 rxq->rx_desc_dma);
1953 1956
@@ -1979,7 +1982,7 @@ static void rxq_deinit(struct rx_queue *rxq)
1979 rxq->rx_desc_area_size <= mp->rx_desc_sram_size) 1982 rxq->rx_desc_area_size <= mp->rx_desc_sram_size)
1980 iounmap(rxq->rx_desc_area); 1983 iounmap(rxq->rx_desc_area);
1981 else 1984 else
1982 dma_free_coherent(NULL, rxq->rx_desc_area_size, 1985 dma_free_coherent(mp->dev->dev.parent, rxq->rx_desc_area_size,
1983 rxq->rx_desc_area, rxq->rx_desc_dma); 1986 rxq->rx_desc_area, rxq->rx_desc_dma);
1984 1987
1985 kfree(rxq->rx_skb); 1988 kfree(rxq->rx_skb);
@@ -2007,9 +2010,9 @@ static int txq_init(struct mv643xx_eth_private *mp, int index)
2007 mp->tx_desc_sram_size); 2010 mp->tx_desc_sram_size);
2008 txq->tx_desc_dma = mp->tx_desc_sram_addr; 2011 txq->tx_desc_dma = mp->tx_desc_sram_addr;
2009 } else { 2012 } else {
2010 txq->tx_desc_area = dma_alloc_coherent(NULL, size, 2013 txq->tx_desc_area = dma_alloc_coherent(mp->dev->dev.parent,
2011 &txq->tx_desc_dma, 2014 size, &txq->tx_desc_dma,
2012 GFP_KERNEL); 2015 GFP_KERNEL);
2013 } 2016 }
2014 2017
2015 if (txq->tx_desc_area == NULL) { 2018 if (txq->tx_desc_area == NULL) {
@@ -2053,7 +2056,7 @@ static void txq_deinit(struct tx_queue *txq)
2053 txq->tx_desc_area_size <= mp->tx_desc_sram_size) 2056 txq->tx_desc_area_size <= mp->tx_desc_sram_size)
2054 iounmap(txq->tx_desc_area); 2057 iounmap(txq->tx_desc_area);
2055 else 2058 else
2056 dma_free_coherent(NULL, txq->tx_desc_area_size, 2059 dma_free_coherent(mp->dev->dev.parent, txq->tx_desc_area_size,
2057 txq->tx_desc_area, txq->tx_desc_dma); 2060 txq->tx_desc_area, txq->tx_desc_dma);
2058} 2061}
2059 2062
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 0b6e8c896835..3b19e0ce290f 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -66,7 +66,6 @@ static const int multicast_filter_limit = 32;
66#define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ 66#define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */
67#define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ 67#define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */
68#define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ 68#define EarlyTxThld 0x3F /* 0x3F means NO early transmit */
69#define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC... */
70#define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */ 69#define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */
71#define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ 70#define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */
72 71
@@ -2357,10 +2356,10 @@ static u16 rtl_rw_cpluscmd(void __iomem *ioaddr)
2357 return cmd; 2356 return cmd;
2358} 2357}
2359 2358
2360static void rtl_set_rx_max_size(void __iomem *ioaddr) 2359static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz)
2361{ 2360{
2362 /* Low hurts. Let's disable the filtering. */ 2361 /* Low hurts. Let's disable the filtering. */
2363 RTL_W16(RxMaxSize, 16383); 2362 RTL_W16(RxMaxSize, rx_buf_sz);
2364} 2363}
2365 2364
2366static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) 2365static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version)
@@ -2407,7 +2406,7 @@ static void rtl_hw_start_8169(struct net_device *dev)
2407 2406
2408 RTL_W8(EarlyTxThres, EarlyTxThld); 2407 RTL_W8(EarlyTxThres, EarlyTxThld);
2409 2408
2410 rtl_set_rx_max_size(ioaddr); 2409 rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
2411 2410
2412 if ((tp->mac_version == RTL_GIGA_MAC_VER_01) || 2411 if ((tp->mac_version == RTL_GIGA_MAC_VER_01) ||
2413 (tp->mac_version == RTL_GIGA_MAC_VER_02) || 2412 (tp->mac_version == RTL_GIGA_MAC_VER_02) ||
@@ -2668,7 +2667,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
2668 2667
2669 RTL_W8(EarlyTxThres, EarlyTxThld); 2668 RTL_W8(EarlyTxThres, EarlyTxThld);
2670 2669
2671 rtl_set_rx_max_size(ioaddr); 2670 rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
2672 2671
2673 tp->cp_cmd |= RTL_R16(CPlusCmd) | PktCntrDisable | INTT_1; 2672 tp->cp_cmd |= RTL_R16(CPlusCmd) | PktCntrDisable | INTT_1;
2674 2673
@@ -2846,7 +2845,7 @@ static void rtl_hw_start_8101(struct net_device *dev)
2846 2845
2847 RTL_W8(EarlyTxThres, EarlyTxThld); 2846 RTL_W8(EarlyTxThres, EarlyTxThld);
2848 2847
2849 rtl_set_rx_max_size(ioaddr); 2848 rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz);
2850 2849
2851 tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; 2850 tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW;
2852 2851
@@ -3554,54 +3553,64 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
3554 int handled = 0; 3553 int handled = 0;
3555 int status; 3554 int status;
3556 3555
3556 /* loop handling interrupts until we have no new ones or
3557 * we hit a invalid/hotplug case.
3558 */
3557 status = RTL_R16(IntrStatus); 3559 status = RTL_R16(IntrStatus);
3560 while (status && status != 0xffff) {
3561 handled = 1;
3558 3562
3559 /* hotplug/major error/no more work/shared irq */ 3563 /* Handle all of the error cases first. These will reset
3560 if ((status == 0xffff) || !status) 3564 * the chip, so just exit the loop.
3561 goto out; 3565 */
3562 3566 if (unlikely(!netif_running(dev))) {
3563 handled = 1; 3567 rtl8169_asic_down(ioaddr);
3568 break;
3569 }
3564 3570
3565 if (unlikely(!netif_running(dev))) { 3571 /* Work around for rx fifo overflow */
3566 rtl8169_asic_down(ioaddr); 3572 if (unlikely(status & RxFIFOOver) &&
3567 goto out; 3573 (tp->mac_version == RTL_GIGA_MAC_VER_11)) {
3568 } 3574 netif_stop_queue(dev);
3575 rtl8169_tx_timeout(dev);
3576 break;
3577 }
3569 3578
3570 status &= tp->intr_mask; 3579 if (unlikely(status & SYSErr)) {
3571 RTL_W16(IntrStatus, 3580 rtl8169_pcierr_interrupt(dev);
3572 (status & RxFIFOOver) ? (status | RxOverflow) : status); 3581 break;
3582 }
3573 3583
3574 if (!(status & tp->intr_event)) 3584 if (status & LinkChg)
3575 goto out; 3585 rtl8169_check_link_status(dev, tp, ioaddr);
3576 3586
3577 /* Work around for rx fifo overflow */ 3587 /* We need to see the lastest version of tp->intr_mask to
3578 if (unlikely(status & RxFIFOOver) && 3588 * avoid ignoring an MSI interrupt and having to wait for
3579 (tp->mac_version == RTL_GIGA_MAC_VER_11)) { 3589 * another event which may never come.
3580 netif_stop_queue(dev); 3590 */
3581 rtl8169_tx_timeout(dev); 3591 smp_rmb();
3582 goto out; 3592 if (status & tp->intr_mask & tp->napi_event) {
3583 } 3593 RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
3594 tp->intr_mask = ~tp->napi_event;
3595
3596 if (likely(napi_schedule_prep(&tp->napi)))
3597 __napi_schedule(&tp->napi);
3598 else if (netif_msg_intr(tp)) {
3599 printk(KERN_INFO "%s: interrupt %04x in poll\n",
3600 dev->name, status);
3601 }
3602 }
3584 3603
3585 if (unlikely(status & SYSErr)) { 3604 /* We only get a new MSI interrupt when all active irq
3586 rtl8169_pcierr_interrupt(dev); 3605 * sources on the chip have been acknowledged. So, ack
3587 goto out; 3606 * everything we've seen and check if new sources have become
3607 * active to avoid blocking all interrupts from the chip.
3608 */
3609 RTL_W16(IntrStatus,
3610 (status & RxFIFOOver) ? (status | RxOverflow) : status);
3611 status = RTL_R16(IntrStatus);
3588 } 3612 }
3589 3613
3590 if (status & LinkChg)
3591 rtl8169_check_link_status(dev, tp, ioaddr);
3592
3593 if (status & tp->napi_event) {
3594 RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
3595 tp->intr_mask = ~tp->napi_event;
3596
3597 if (likely(napi_schedule_prep(&tp->napi)))
3598 __napi_schedule(&tp->napi);
3599 else if (netif_msg_intr(tp)) {
3600 printk(KERN_INFO "%s: interrupt %04x in poll\n",
3601 dev->name, status);
3602 }
3603 }
3604out:
3605 return IRQ_RETVAL(handled); 3614 return IRQ_RETVAL(handled);
3606} 3615}
3607 3616
@@ -3617,13 +3626,15 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
3617 3626
3618 if (work_done < budget) { 3627 if (work_done < budget) {
3619 napi_complete(napi); 3628 napi_complete(napi);
3620 tp->intr_mask = 0xffff; 3629
3621 /* 3630 /* We need for force the visibility of tp->intr_mask
3622 * 20040426: the barrier is not strictly required but the 3631 * for other CPUs, as we can loose an MSI interrupt
3623 * behavior of the irq handler could be less predictable 3632 * and potentially wait for a retransmit timeout if we don't.
3624 * without it. Btw, the lack of flush for the posted pci 3633 * The posted write to IntrMask is safe, as it will
3625 * write is safe - FR 3634 * eventually make it to the chip and we won't loose anything
3635 * until it does.
3626 */ 3636 */
3637 tp->intr_mask = 0xffff;
3627 smp_wmb(); 3638 smp_wmb();
3628 RTL_W16(IntrMask, tp->intr_event); 3639 RTL_W16(IntrMask, tp->intr_event);
3629 } 3640 }
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c
index 7be0ae10d69b..c2eeac4125f3 100644
--- a/drivers/net/vxge/vxge-traffic.c
+++ b/drivers/net/vxge/vxge-traffic.c
@@ -115,7 +115,7 @@ enum vxge_hw_status vxge_hw_vpath_intr_enable(struct __vxge_hw_vpath_handle *vp)
115 VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_POISON| 115 VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_POISON|
116 VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO2_POISON| 116 VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO2_POISON|
117 VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_DMA_ERR| 117 VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_DMA_ERR|
118 VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO1_DMA_ERR), 0, 32), 118 VXGE_HW_KDFCCTL_ERRORS_REG_KDFCCTL_FIFO2_DMA_ERR), 0, 32),
119 &vp_reg->kdfcctl_errors_mask); 119 &vp_reg->kdfcctl_errors_mask);
120 120
121 __vxge_hw_pio_mem_write32_upper(0, &vp_reg->vpath_ppif_int_mask); 121 __vxge_hw_pio_mem_write32_upper(0, &vp_reg->vpath_ppif_int_mask);
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c
index 02419bfd64b5..f9fc38902322 100644
--- a/drivers/net/wimax/i2400m/rx.c
+++ b/drivers/net/wimax/i2400m/rx.c
@@ -819,10 +819,9 @@ void i2400m_roq_queue_update_ws(struct i2400m *i2400m, struct i2400m_roq *roq,
819 roq_data = (struct i2400m_roq_data *) &skb->cb; 819 roq_data = (struct i2400m_roq_data *) &skb->cb;
820 i2400m_net_erx(i2400m, skb, roq_data->cs); 820 i2400m_net_erx(i2400m, skb, roq_data->cs);
821 } 821 }
822 else { 822 else
823 __i2400m_roq_queue(i2400m, roq, skb, sn, nsn); 823 __i2400m_roq_queue(i2400m, roq, skb, sn, nsn);
824 __i2400m_roq_update_ws(i2400m, roq, sn + 1); 824 __i2400m_roq_update_ws(i2400m, roq, sn + 1);
825 }
826 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_PACKET_WS, 825 i2400m_roq_log_add(i2400m, roq, I2400M_RO_TYPE_PACKET_WS,
827 old_ws, len, sn, nsn, roq->ws); 826 old_ws, len, sn, nsn, roq->ws);
828 } 827 }
diff --git a/drivers/net/wimax/i2400m/usb.c b/drivers/net/wimax/i2400m/usb.c
index ca4151a9e222..17851321b7fd 100644
--- a/drivers/net/wimax/i2400m/usb.c
+++ b/drivers/net/wimax/i2400m/usb.c
@@ -505,27 +505,52 @@ int i2400mu_suspend(struct usb_interface *iface, pm_message_t pm_msg)
505#ifdef CONFIG_PM 505#ifdef CONFIG_PM
506 struct usb_device *usb_dev = i2400mu->usb_dev; 506 struct usb_device *usb_dev = i2400mu->usb_dev;
507#endif 507#endif
508 unsigned is_autosuspend = 0;
508 struct i2400m *i2400m = &i2400mu->i2400m; 509 struct i2400m *i2400m = &i2400mu->i2400m;
509 510
511#ifdef CONFIG_PM
512 if (usb_dev->auto_pm > 0)
513 is_autosuspend = 1;
514#endif
515
510 d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event); 516 d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event);
511 if (i2400m->updown == 0) 517 if (i2400m->updown == 0)
512 goto no_firmware; 518 goto no_firmware;
513 d_printf(1, dev, "fw up, requesting standby\n"); 519 if (i2400m->state == I2400M_SS_DATA_PATH_CONNECTED && is_autosuspend) {
520 /* ugh -- the device is connected and this suspend
521 * request is an autosuspend one (not a system standby
522 * / hibernate).
523 *
524 * The only way the device can go to standby is if the
525 * link with the base station is in IDLE mode; that
526 * were the case, we'd be in status
527 * I2400M_SS_CONNECTED_IDLE. But we are not.
528 *
529 * If we *tell* him to go power save now, it'll reset
530 * as a precautionary measure, so if this is an
531 * autosuspend thing, say no and it'll come back
532 * later, when the link is IDLE
533 */
534 result = -EBADF;
535 d_printf(1, dev, "fw up, link up, not-idle, autosuspend: "
536 "not entering powersave\n");
537 goto error_not_now;
538 }
539 d_printf(1, dev, "fw up: entering powersave\n");
514 atomic_dec(&i2400mu->do_autopm); 540 atomic_dec(&i2400mu->do_autopm);
515 result = i2400m_cmd_enter_powersave(i2400m); 541 result = i2400m_cmd_enter_powersave(i2400m);
516 atomic_inc(&i2400mu->do_autopm); 542 atomic_inc(&i2400mu->do_autopm);
517#ifdef CONFIG_PM 543 if (result < 0 && !is_autosuspend) {
518 if (result < 0 && usb_dev->auto_pm == 0) {
519 /* System suspend, can't fail */ 544 /* System suspend, can't fail */
520 dev_err(dev, "failed to suspend, will reset on resume\n"); 545 dev_err(dev, "failed to suspend, will reset on resume\n");
521 result = 0; 546 result = 0;
522 } 547 }
523#endif
524 if (result < 0) 548 if (result < 0)
525 goto error_enter_powersave; 549 goto error_enter_powersave;
526 i2400mu_notification_release(i2400mu); 550 i2400mu_notification_release(i2400mu);
527 d_printf(1, dev, "fw up, got standby\n"); 551 d_printf(1, dev, "powersave requested\n");
528error_enter_powersave: 552error_enter_powersave:
553error_not_now:
529no_firmware: 554no_firmware:
530 d_fnend(3, dev, "(iface %p pm_msg %u) = %d\n", 555 d_fnend(3, dev, "(iface %p pm_msg %u) = %d\n",
531 iface, pm_msg.event, result); 556 iface, pm_msg.event, result);
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 8a0823588c51..3d94e7dfea69 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -430,6 +430,7 @@ config RTL8187
430 ASUS P5B Deluxe 430 ASUS P5B Deluxe
431 Toshiba Satellite Pro series of laptops 431 Toshiba Satellite Pro series of laptops
432 Asus Wireless Link 432 Asus Wireless Link
433 Linksys WUSB54GC-EU
433 434
434 Thanks to Realtek for their support! 435 Thanks to Realtek for their support!
435 436
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index d73475739127..9eabf4d1f2e7 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -6467,6 +6467,7 @@ static int airo_get_encode(struct net_device *dev,
6467{ 6467{
6468 struct airo_info *local = dev->ml_priv; 6468 struct airo_info *local = dev->ml_priv;
6469 int index = (dwrq->flags & IW_ENCODE_INDEX) - 1; 6469 int index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
6470 int wep_key_len;
6470 u8 buf[16]; 6471 u8 buf[16];
6471 6472
6472 if (!local->wep_capable) 6473 if (!local->wep_capable)
@@ -6500,11 +6501,13 @@ static int airo_get_encode(struct net_device *dev,
6500 dwrq->flags |= index + 1; 6501 dwrq->flags |= index + 1;
6501 6502
6502 /* Copy the key to the user buffer */ 6503 /* Copy the key to the user buffer */
6503 dwrq->length = get_wep_key(local, index, &buf[0], sizeof(buf)); 6504 wep_key_len = get_wep_key(local, index, &buf[0], sizeof(buf));
6504 if (dwrq->length != -1) 6505 if (wep_key_len < 0) {
6505 memcpy(extra, buf, dwrq->length);
6506 else
6507 dwrq->length = 0; 6506 dwrq->length = 0;
6507 } else {
6508 dwrq->length = wep_key_len;
6509 memcpy(extra, buf, dwrq->length);
6510 }
6508 6511
6509 return 0; 6512 return 0;
6510} 6513}
@@ -6617,7 +6620,7 @@ static int airo_get_encodeext(struct net_device *dev,
6617 struct airo_info *local = dev->ml_priv; 6620 struct airo_info *local = dev->ml_priv;
6618 struct iw_point *encoding = &wrqu->encoding; 6621 struct iw_point *encoding = &wrqu->encoding;
6619 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 6622 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
6620 int idx, max_key_len; 6623 int idx, max_key_len, wep_key_len;
6621 u8 buf[16]; 6624 u8 buf[16];
6622 6625
6623 if (!local->wep_capable) 6626 if (!local->wep_capable)
@@ -6661,11 +6664,13 @@ static int airo_get_encodeext(struct net_device *dev,
6661 memset(extra, 0, 16); 6664 memset(extra, 0, 16);
6662 6665
6663 /* Copy the key to the user buffer */ 6666 /* Copy the key to the user buffer */
6664 ext->key_len = get_wep_key(local, idx, &buf[0], sizeof(buf)); 6667 wep_key_len = get_wep_key(local, idx, &buf[0], sizeof(buf));
6665 if (ext->key_len != -1) 6668 if (wep_key_len < 0) {
6666 memcpy(extra, buf, ext->key_len);
6667 else
6668 ext->key_len = 0; 6669 ext->key_len = 0;
6670 } else {
6671 ext->key_len = wep_key_len;
6672 memcpy(extra, buf, ext->key_len);
6673 }
6669 6674
6670 return 0; 6675 return 0;
6671} 6676}
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 744f4f4dd3d1..8d93ca4651b9 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -1873,18 +1873,18 @@ static void at76_dwork_hw_scan(struct work_struct *work)
1873 if (ret != CMD_STATUS_COMPLETE) { 1873 if (ret != CMD_STATUS_COMPLETE) {
1874 queue_delayed_work(priv->hw->workqueue, &priv->dwork_hw_scan, 1874 queue_delayed_work(priv->hw->workqueue, &priv->dwork_hw_scan,
1875 SCAN_POLL_INTERVAL); 1875 SCAN_POLL_INTERVAL);
1876 goto exit; 1876 mutex_unlock(&priv->mtx);
1877 return;
1877 } 1878 }
1878 1879
1879 ieee80211_scan_completed(priv->hw, false);
1880
1881 if (is_valid_ether_addr(priv->bssid)) 1880 if (is_valid_ether_addr(priv->bssid))
1882 at76_join(priv); 1881 at76_join(priv);
1883 1882
1884 ieee80211_wake_queues(priv->hw);
1885
1886exit:
1887 mutex_unlock(&priv->mtx); 1883 mutex_unlock(&priv->mtx);
1884
1885 ieee80211_scan_completed(priv->hw, false);
1886
1887 ieee80211_wake_queues(priv->hw);
1888} 1888}
1889 1889
1890static int at76_hw_scan(struct ieee80211_hw *hw, 1890static int at76_hw_scan(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/ath5k/phy.c b/drivers/net/wireless/ath5k/phy.c
index 9e2faae5ae94..b48b29dca3d2 100644
--- a/drivers/net/wireless/ath5k/phy.c
+++ b/drivers/net/wireless/ath5k/phy.c
@@ -1487,28 +1487,35 @@ ath5k_get_linear_pcdac_min(const u8 *stepL, const u8 *stepR,
1487{ 1487{
1488 s8 tmp; 1488 s8 tmp;
1489 s16 min_pwrL, min_pwrR; 1489 s16 min_pwrL, min_pwrR;
1490 s16 pwr_i = pwrL[0]; 1490 s16 pwr_i;
1491 1491
1492 do { 1492 if (pwrL[0] == pwrL[1])
1493 pwr_i--; 1493 min_pwrL = pwrL[0];
1494 tmp = (s8) ath5k_get_interpolated_value(pwr_i, 1494 else {
1495 pwrL[0], pwrL[1], 1495 pwr_i = pwrL[0];
1496 stepL[0], stepL[1]); 1496 do {
1497 1497 pwr_i--;
1498 } while (tmp > 1); 1498 tmp = (s8) ath5k_get_interpolated_value(pwr_i,
1499 1499 pwrL[0], pwrL[1],
1500 min_pwrL = pwr_i; 1500 stepL[0], stepL[1]);
1501 1501 } while (tmp > 1);
1502 pwr_i = pwrR[0]; 1502
1503 do { 1503 min_pwrL = pwr_i;
1504 pwr_i--; 1504 }
1505 tmp = (s8) ath5k_get_interpolated_value(pwr_i,
1506 pwrR[0], pwrR[1],
1507 stepR[0], stepR[1]);
1508
1509 } while (tmp > 1);
1510 1505
1511 min_pwrR = pwr_i; 1506 if (pwrR[0] == pwrR[1])
1507 min_pwrR = pwrR[0];
1508 else {
1509 pwr_i = pwrR[0];
1510 do {
1511 pwr_i--;
1512 tmp = (s8) ath5k_get_interpolated_value(pwr_i,
1513 pwrR[0], pwrR[1],
1514 stepR[0], stepR[1]);
1515 } while (tmp > 1);
1516
1517 min_pwrR = pwr_i;
1518 }
1512 1519
1513 /* Keep the right boundary so that it works for both curves */ 1520 /* Keep the right boundary so that it works for both curves */
1514 return max(min_pwrL, min_pwrR); 1521 return max(min_pwrL, min_pwrR);
diff --git a/drivers/net/wireless/ath5k/reset.c b/drivers/net/wireless/ath5k/reset.c
index 7a17d31b2fd9..5f72c111c2e8 100644
--- a/drivers/net/wireless/ath5k/reset.c
+++ b/drivers/net/wireless/ath5k/reset.c
@@ -26,7 +26,7 @@
26\*****************************/ 26\*****************************/
27 27
28#include <linux/pci.h> /* To determine if a card is pci-e */ 28#include <linux/pci.h> /* To determine if a card is pci-e */
29#include <linux/bitops.h> /* For get_bitmask_order */ 29#include <linux/log2.h>
30#include "ath5k.h" 30#include "ath5k.h"
31#include "reg.h" 31#include "reg.h"
32#include "base.h" 32#include "base.h"
@@ -69,10 +69,10 @@ static inline int ath5k_hw_write_ofdm_timings(struct ath5k_hw *ah,
69 69
70 /* Get exponent 70 /* Get exponent
71 * ALGO: coef_exp = 14 - highest set bit position */ 71 * ALGO: coef_exp = 14 - highest set bit position */
72 coef_exp = get_bitmask_order(coef_scaled); 72 coef_exp = ilog2(coef_scaled);
73 73
74 /* Doesn't make sense if it's zero*/ 74 /* Doesn't make sense if it's zero*/
75 if (!coef_exp) 75 if (!coef_scaled || !coef_exp)
76 return -EINVAL; 76 return -EINVAL;
77 77
78 /* Note: we've shifted coef_scaled by 24 */ 78 /* Note: we've shifted coef_scaled by 24 */
@@ -359,7 +359,7 @@ int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, bool initial)
359 mode |= AR5K_PHY_MODE_FREQ_5GHZ; 359 mode |= AR5K_PHY_MODE_FREQ_5GHZ;
360 360
361 if (ah->ah_radio == AR5K_RF5413) 361 if (ah->ah_radio == AR5K_RF5413)
362 clock |= AR5K_PHY_PLL_40MHZ_5413; 362 clock = AR5K_PHY_PLL_40MHZ_5413;
363 else 363 else
364 clock |= AR5K_PHY_PLL_40MHZ; 364 clock |= AR5K_PHY_PLL_40MHZ;
365 365
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index e5ca2511a81a..9452461ce864 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -46,7 +46,7 @@
46#include "iwl-6000-hw.h" 46#include "iwl-6000-hw.h"
47 47
48/* Highest firmware API version supported */ 48/* Highest firmware API version supported */
49#define IWL5000_UCODE_API_MAX 1 49#define IWL5000_UCODE_API_MAX 2
50#define IWL5150_UCODE_API_MAX 2 50#define IWL5150_UCODE_API_MAX 2
51 51
52/* Lowest firmware API version supported */ 52/* Lowest firmware API version supported */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 3bb28db4a40f..f46ba2475776 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -669,13 +669,6 @@ static int iwl_set_mode(struct iwl_priv *priv, int mode)
669 if (!iwl_is_ready_rf(priv)) 669 if (!iwl_is_ready_rf(priv))
670 return -EAGAIN; 670 return -EAGAIN;
671 671
672 cancel_delayed_work(&priv->scan_check);
673 if (iwl_scan_cancel_timeout(priv, 100)) {
674 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
675 IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
676 return -EAGAIN;
677 }
678
679 iwl_commit_rxon(priv); 672 iwl_commit_rxon(priv);
680 673
681 return 0; 674 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index e7c65c4f741b..6330b91e37ce 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -227,9 +227,6 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv,
227 /* The HW is no longer scanning */ 227 /* The HW is no longer scanning */
228 clear_bit(STATUS_SCAN_HW, &priv->status); 228 clear_bit(STATUS_SCAN_HW, &priv->status);
229 229
230 /* The scan completion notification came in, so kill that timer... */
231 cancel_delayed_work(&priv->scan_check);
232
233 IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n", 230 IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n",
234 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ? 231 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?
235 "2.4" : "5.2", 232 "2.4" : "5.2",
@@ -712,6 +709,8 @@ static void iwl_bg_request_scan(struct work_struct *data)
712 709
713 mutex_lock(&priv->mutex); 710 mutex_lock(&priv->mutex);
714 711
712 cancel_delayed_work(&priv->scan_check);
713
715 if (!iwl_is_ready(priv)) { 714 if (!iwl_is_ready(priv)) {
716 IWL_WARN(priv, "request scan called when driver not ready.\n"); 715 IWL_WARN(priv, "request scan called when driver not ready.\n");
717 goto done; 716 goto done;
@@ -925,6 +924,8 @@ void iwl_bg_scan_completed(struct work_struct *work)
925 924
926 IWL_DEBUG_SCAN(priv, "SCAN complete scan\n"); 925 IWL_DEBUG_SCAN(priv, "SCAN complete scan\n");
927 926
927 cancel_delayed_work(&priv->scan_check);
928
928 ieee80211_scan_completed(priv->hw, false); 929 ieee80211_scan_completed(priv->hw, false);
929 930
930 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 931 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 4cce66133500..ff4d0e41d7c4 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -782,13 +782,6 @@ static int iwl3945_set_mode(struct iwl_priv *priv, int mode)
782 if (!iwl_is_ready_rf(priv)) 782 if (!iwl_is_ready_rf(priv))
783 return -EAGAIN; 783 return -EAGAIN;
784 784
785 cancel_delayed_work(&priv->scan_check);
786 if (iwl_scan_cancel_timeout(priv, 100)) {
787 IWL_WARN(priv, "Aborted scan still in progress after 100ms\n");
788 IWL_DEBUG_MAC80211(priv, "leaving - scan abort failed.\n");
789 return -EAGAIN;
790 }
791
792 iwl3945_commit_rxon(priv); 785 iwl3945_commit_rxon(priv);
793 786
794 return 0; 787 return 0;
@@ -3298,6 +3291,8 @@ static void iwl3945_bg_request_scan(struct work_struct *data)
3298 3291
3299 mutex_lock(&priv->mutex); 3292 mutex_lock(&priv->mutex);
3300 3293
3294 cancel_delayed_work(&priv->scan_check);
3295
3301 if (!iwl_is_ready(priv)) { 3296 if (!iwl_is_ready(priv)) {
3302 IWL_WARN(priv, "request scan called when driver not ready.\n"); 3297 IWL_WARN(priv, "request scan called when driver not ready.\n");
3303 goto done; 3298 goto done;
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index 07d378ef0b46..7b3ee8c2eaef 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -138,7 +138,7 @@ void rt2x00debug_update_crypto(struct rt2x00_dev *rt2x00dev,
138 138
139 if (cipher == CIPHER_TKIP_NO_MIC) 139 if (cipher == CIPHER_TKIP_NO_MIC)
140 cipher = CIPHER_TKIP; 140 cipher = CIPHER_TKIP;
141 if (cipher == CIPHER_NONE || cipher > CIPHER_MAX) 141 if (cipher == CIPHER_NONE || cipher >= CIPHER_MAX)
142 return; 142 return;
143 143
144 /* Remove CIPHER_NONE index */ 144 /* Remove CIPHER_NONE index */
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index bac6cfba6abd..d51ba0a88c23 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -71,6 +71,8 @@ static struct usb_device_id rtl8187_table[] __devinitdata = {
71 {USB_DEVICE(0x18E8, 0x6232), .driver_info = DEVICE_RTL8187}, 71 {USB_DEVICE(0x18E8, 0x6232), .driver_info = DEVICE_RTL8187},
72 /* AirLive */ 72 /* AirLive */
73 {USB_DEVICE(0x1b75, 0x8187), .driver_info = DEVICE_RTL8187}, 73 {USB_DEVICE(0x1b75, 0x8187), .driver_info = DEVICE_RTL8187},
74 /* Linksys */
75 {USB_DEVICE(0x1737, 0x0073), .driver_info = DEVICE_RTL8187B},
74 {} 76 {}
75}; 77};
76 78