aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/atlx/atl1.c1
-rw-r--r--drivers/net/enc28j60.c87
-rw-r--r--drivers/net/ibm_newemac/Kconfig1
-rw-r--r--drivers/net/netxen/netxen_nic.h18
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c6
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c112
-rw-r--r--drivers/net/netxen/netxen_nic_init.c46
-rw-r--r--drivers/net/netxen/netxen_nic_isr.c4
-rw-r--r--drivers/net/netxen/netxen_nic_main.c133
-rw-r--r--drivers/net/netxen/netxen_nic_niu.c22
-rw-r--r--drivers/net/pppoe.c2
-rw-r--r--drivers/net/sky2.c1
-rw-r--r--drivers/net/tun.c15
-rw-r--r--drivers/net/wireless/b43/b43.h1
-rw-r--r--drivers/net/wireless/b43/dma.c65
-rw-r--r--drivers/net/wireless/b43/main.c16
-rw-r--r--drivers/net/wireless/rt2x00/Kconfig19
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c1
20 files changed, 265 insertions, 294 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 99e0b4cdc56f..3c798ae5c343 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -471,7 +471,6 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
471 memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN); 471 memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
472 return 0; 472 return 0;
473 } 473 }
474 return 1;
475 } 474 }
476 475
477 /* see if SPI FLAGS exist ? */ 476 /* see if SPI FLAGS exist ? */
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c
index 46a90e9ec563..c05cb159c772 100644
--- a/drivers/net/enc28j60.c
+++ b/drivers/net/enc28j60.c
@@ -400,26 +400,31 @@ enc28j60_packet_write(struct enc28j60_net *priv, int len, const u8 *data)
400 mutex_unlock(&priv->lock); 400 mutex_unlock(&priv->lock);
401} 401}
402 402
403/* 403static unsigned long msec20_to_jiffies;
404 * Wait until the PHY operation is complete. 404
405 */ 405static int poll_ready(struct enc28j60_net *priv, u8 reg, u8 mask, u8 val)
406static int wait_phy_ready(struct enc28j60_net *priv)
407{ 406{
408 unsigned long timeout = jiffies + 20 * HZ / 1000; 407 unsigned long timeout = jiffies + msec20_to_jiffies;
409 int ret = 1;
410 408
411 /* 20 msec timeout read */ 409 /* 20 msec timeout read */
412 while (nolock_regb_read(priv, MISTAT) & MISTAT_BUSY) { 410 while ((nolock_regb_read(priv, reg) & mask) != val) {
413 if (time_after(jiffies, timeout)) { 411 if (time_after(jiffies, timeout)) {
414 if (netif_msg_drv(priv)) 412 if (netif_msg_drv(priv))
415 printk(KERN_DEBUG DRV_NAME 413 dev_dbg(&priv->spi->dev,
416 ": PHY ready timeout!\n"); 414 "reg %02x ready timeout!\n", reg);
417 ret = 0; 415 return -ETIMEDOUT;
418 break;
419 } 416 }
420 cpu_relax(); 417 cpu_relax();
421 } 418 }
422 return ret; 419 return 0;
420}
421
422/*
423 * Wait until the PHY operation is complete.
424 */
425static int wait_phy_ready(struct enc28j60_net *priv)
426{
427 return poll_ready(priv, MISTAT, MISTAT_BUSY, 0) ? 0 : 1;
423} 428}
424 429
425/* 430/*
@@ -594,6 +599,32 @@ static void nolock_txfifo_init(struct enc28j60_net *priv, u16 start, u16 end)
594 nolock_regw_write(priv, ETXNDL, end); 599 nolock_regw_write(priv, ETXNDL, end);
595} 600}
596 601
602/*
603 * Low power mode shrinks power consumption about 100x, so we'd like
604 * the chip to be in that mode whenever it's inactive. (However, we
605 * can't stay in lowpower mode during suspend with WOL active.)
606 */
607static void enc28j60_lowpower(struct enc28j60_net *priv, bool is_low)
608{
609 if (netif_msg_drv(priv))
610 dev_dbg(&priv->spi->dev, "%s power...\n",
611 is_low ? "low" : "high");
612
613 mutex_lock(&priv->lock);
614 if (is_low) {
615 nolock_reg_bfclr(priv, ECON1, ECON1_RXEN);
616 poll_ready(priv, ESTAT, ESTAT_RXBUSY, 0);
617 poll_ready(priv, ECON1, ECON1_TXRTS, 0);
618 /* ECON2_VRPS was set during initialization */
619 nolock_reg_bfset(priv, ECON2, ECON2_PWRSV);
620 } else {
621 nolock_reg_bfclr(priv, ECON2, ECON2_PWRSV);
622 poll_ready(priv, ESTAT, ESTAT_CLKRDY, ESTAT_CLKRDY);
623 /* caller sets ECON1_RXEN */
624 }
625 mutex_unlock(&priv->lock);
626}
627
597static int enc28j60_hw_init(struct enc28j60_net *priv) 628static int enc28j60_hw_init(struct enc28j60_net *priv)
598{ 629{
599 u8 reg; 630 u8 reg;
@@ -612,8 +643,8 @@ static int enc28j60_hw_init(struct enc28j60_net *priv)
612 priv->tx_retry_count = 0; 643 priv->tx_retry_count = 0;
613 priv->max_pk_counter = 0; 644 priv->max_pk_counter = 0;
614 priv->rxfilter = RXFILTER_NORMAL; 645 priv->rxfilter = RXFILTER_NORMAL;
615 /* enable address auto increment */ 646 /* enable address auto increment and voltage regulator powersave */
616 nolock_regb_write(priv, ECON2, ECON2_AUTOINC); 647 nolock_regb_write(priv, ECON2, ECON2_AUTOINC | ECON2_VRPS);
617 648
618 nolock_rxfifo_init(priv, RXSTART_INIT, RXEND_INIT); 649 nolock_rxfifo_init(priv, RXSTART_INIT, RXEND_INIT);
619 nolock_txfifo_init(priv, TXSTART_INIT, TXEND_INIT); 650 nolock_txfifo_init(priv, TXSTART_INIT, TXEND_INIT);
@@ -690,7 +721,7 @@ static int enc28j60_hw_init(struct enc28j60_net *priv)
690 721
691static void enc28j60_hw_enable(struct enc28j60_net *priv) 722static void enc28j60_hw_enable(struct enc28j60_net *priv)
692{ 723{
693 /* enable interrutps */ 724 /* enable interrupts */
694 if (netif_msg_hw(priv)) 725 if (netif_msg_hw(priv))
695 printk(KERN_DEBUG DRV_NAME ": %s() enabling interrupts.\n", 726 printk(KERN_DEBUG DRV_NAME ": %s() enabling interrupts.\n",
696 __FUNCTION__); 727 __FUNCTION__);
@@ -726,15 +757,12 @@ enc28j60_setlink(struct net_device *ndev, u8 autoneg, u16 speed, u8 duplex)
726 int ret = 0; 757 int ret = 0;
727 758
728 if (!priv->hw_enable) { 759 if (!priv->hw_enable) {
729 if (autoneg == AUTONEG_DISABLE && speed == SPEED_10) { 760 /* link is in low power mode now; duplex setting
761 * will take effect on next enc28j60_hw_init().
762 */
763 if (autoneg == AUTONEG_DISABLE && speed == SPEED_10)
730 priv->full_duplex = (duplex == DUPLEX_FULL); 764 priv->full_duplex = (duplex == DUPLEX_FULL);
731 if (!enc28j60_hw_init(priv)) { 765 else {
732 if (netif_msg_drv(priv))
733 dev_err(&ndev->dev,
734 "hw_reset() failed\n");
735 ret = -EINVAL;
736 }
737 } else {
738 if (netif_msg_link(priv)) 766 if (netif_msg_link(priv))
739 dev_warn(&ndev->dev, 767 dev_warn(&ndev->dev,
740 "unsupported link setting\n"); 768 "unsupported link setting\n");
@@ -1307,7 +1335,8 @@ static int enc28j60_net_open(struct net_device *dev)
1307 } 1335 }
1308 return -EADDRNOTAVAIL; 1336 return -EADDRNOTAVAIL;
1309 } 1337 }
1310 /* Reset the hardware here */ 1338 /* Reset the hardware here (and take it out of low power mode) */
1339 enc28j60_lowpower(priv, false);
1311 enc28j60_hw_disable(priv); 1340 enc28j60_hw_disable(priv);
1312 if (!enc28j60_hw_init(priv)) { 1341 if (!enc28j60_hw_init(priv)) {
1313 if (netif_msg_ifup(priv)) 1342 if (netif_msg_ifup(priv))
@@ -1337,6 +1366,7 @@ static int enc28j60_net_close(struct net_device *dev)
1337 printk(KERN_DEBUG DRV_NAME ": %s() enter\n", __FUNCTION__); 1366 printk(KERN_DEBUG DRV_NAME ": %s() enter\n", __FUNCTION__);
1338 1367
1339 enc28j60_hw_disable(priv); 1368 enc28j60_hw_disable(priv);
1369 enc28j60_lowpower(priv, true);
1340 netif_stop_queue(dev); 1370 netif_stop_queue(dev);
1341 1371
1342 return 0; 1372 return 0;
@@ -1537,6 +1567,8 @@ static int __devinit enc28j60_probe(struct spi_device *spi)
1537 dev->watchdog_timeo = TX_TIMEOUT; 1567 dev->watchdog_timeo = TX_TIMEOUT;
1538 SET_ETHTOOL_OPS(dev, &enc28j60_ethtool_ops); 1568 SET_ETHTOOL_OPS(dev, &enc28j60_ethtool_ops);
1539 1569
1570 enc28j60_lowpower(priv, true);
1571
1540 ret = register_netdev(dev); 1572 ret = register_netdev(dev);
1541 if (ret) { 1573 if (ret) {
1542 if (netif_msg_probe(priv)) 1574 if (netif_msg_probe(priv))
@@ -1556,7 +1588,7 @@ error_alloc:
1556 return ret; 1588 return ret;
1557} 1589}
1558 1590
1559static int enc28j60_remove(struct spi_device *spi) 1591static int __devexit enc28j60_remove(struct spi_device *spi)
1560{ 1592{
1561 struct enc28j60_net *priv = dev_get_drvdata(&spi->dev); 1593 struct enc28j60_net *priv = dev_get_drvdata(&spi->dev);
1562 1594
@@ -1573,15 +1605,16 @@ static int enc28j60_remove(struct spi_device *spi)
1573static struct spi_driver enc28j60_driver = { 1605static struct spi_driver enc28j60_driver = {
1574 .driver = { 1606 .driver = {
1575 .name = DRV_NAME, 1607 .name = DRV_NAME,
1576 .bus = &spi_bus_type,
1577 .owner = THIS_MODULE, 1608 .owner = THIS_MODULE,
1578 }, 1609 },
1579 .probe = enc28j60_probe, 1610 .probe = enc28j60_probe,
1580 .remove = __devexit_p(enc28j60_remove), 1611 .remove = __devexit_p(enc28j60_remove),
1581}; 1612};
1582 1613
1583static int __init enc28j60_init(void) 1614static int __init enc28j60_init(void)
1584{ 1615{
1616 msec20_to_jiffies = msecs_to_jiffies(20);
1617
1585 return spi_register_driver(&enc28j60_driver); 1618 return spi_register_driver(&enc28j60_driver);
1586} 1619}
1587 1620
diff --git a/drivers/net/ibm_newemac/Kconfig b/drivers/net/ibm_newemac/Kconfig
index 0d3e7380bad0..70a3272ee998 100644
--- a/drivers/net/ibm_newemac/Kconfig
+++ b/drivers/net/ibm_newemac/Kconfig
@@ -1,6 +1,7 @@
1config IBM_NEW_EMAC 1config IBM_NEW_EMAC
2 tristate "IBM EMAC Ethernet support" 2 tristate "IBM EMAC Ethernet support"
3 depends on PPC_DCR && PPC_MERGE 3 depends on PPC_DCR && PPC_MERGE
4 select CRC32
4 help 5 help
5 This driver supports the IBM EMAC family of Ethernet controllers 6 This driver supports the IBM EMAC family of Ethernet controllers
6 typically found on 4xx embedded PowerPC chips, but also on the 7 typically found on 4xx embedded PowerPC chips, but also on the
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 8cb29f5b1038..da4c4fb97064 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -776,7 +776,6 @@ struct netxen_hardware_context {
776 776
777 u8 revision_id; 777 u8 revision_id;
778 u16 board_type; 778 u16 board_type;
779 u16 max_ports;
780 struct netxen_board_info boardcfg; 779 struct netxen_board_info boardcfg;
781 u32 xg_linkup; 780 u32 xg_linkup;
782 u32 qg_linksup; 781 u32 qg_linksup;
@@ -863,6 +862,7 @@ struct netxen_adapter {
863 unsigned char mac_addr[ETH_ALEN]; 862 unsigned char mac_addr[ETH_ALEN];
864 int mtu; 863 int mtu;
865 int portnum; 864 int portnum;
865 u8 physical_port;
866 866
867 struct work_struct watchdog_task; 867 struct work_struct watchdog_task;
868 struct timer_list watchdog_timer; 868 struct timer_list watchdog_timer;
@@ -1034,7 +1034,6 @@ int netxen_rom_se(struct netxen_adapter *adapter, int addr);
1034 1034
1035/* Functions from netxen_nic_isr.c */ 1035/* Functions from netxen_nic_isr.c */
1036void netxen_initialize_adapter_sw(struct netxen_adapter *adapter); 1036void netxen_initialize_adapter_sw(struct netxen_adapter *adapter);
1037void netxen_initialize_adapter_hw(struct netxen_adapter *adapter);
1038void *netxen_alloc(struct pci_dev *pdev, size_t sz, dma_addr_t * ptr, 1037void *netxen_alloc(struct pci_dev *pdev, size_t sz, dma_addr_t * ptr,
1039 struct pci_dev **used_dev); 1038 struct pci_dev **used_dev);
1040void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); 1039void netxen_initialize_adapter_ops(struct netxen_adapter *adapter);
@@ -1077,20 +1076,6 @@ static const struct netxen_brdinfo netxen_boards[] = {
1077 1076
1078#define NUM_SUPPORTED_BOARDS ARRAY_SIZE(netxen_boards) 1077#define NUM_SUPPORTED_BOARDS ARRAY_SIZE(netxen_boards)
1079 1078
1080static inline void get_brd_port_by_type(u32 type, int *ports)
1081{
1082 int i, found = 0;
1083 for (i = 0; i < NUM_SUPPORTED_BOARDS; ++i) {
1084 if (netxen_boards[i].brdtype == type) {
1085 *ports = netxen_boards[i].ports;
1086 found = 1;
1087 break;
1088 }
1089 }
1090 if (!found)
1091 *ports = 0;
1092}
1093
1094static inline void get_brd_name_by_type(u32 type, char *name) 1079static inline void get_brd_name_by_type(u32 type, char *name)
1095{ 1080{
1096 int i, found = 0; 1081 int i, found = 0;
@@ -1169,5 +1154,4 @@ extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr,
1169 1154
1170extern struct ethtool_ops netxen_nic_ethtool_ops; 1155extern struct ethtool_ops netxen_nic_ethtool_ops;
1171 1156
1172extern int physical_port[]; /* physical port # from virtual port.*/
1173#endif /* __NETXEN_NIC_H_ */ 1157#endif /* __NETXEN_NIC_H_ */
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 6e98d830eefb..723487bf200c 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -369,7 +369,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
369 for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) { 369 for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) {
370 /* GB: port specific registers */ 370 /* GB: port specific registers */
371 if (mode == 0 && i >= 19) 371 if (mode == 0 && i >= 19)
372 window = physical_port[adapter->portnum] * 372 window = adapter->physical_port *
373 NETXEN_NIC_PORT_WINDOW; 373 NETXEN_NIC_PORT_WINDOW;
374 374
375 NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode]. 375 NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode].
@@ -527,7 +527,7 @@ netxen_nic_get_pauseparam(struct net_device *dev,
527{ 527{
528 struct netxen_adapter *adapter = netdev_priv(dev); 528 struct netxen_adapter *adapter = netdev_priv(dev);
529 __u32 val; 529 __u32 val;
530 int port = physical_port[adapter->portnum]; 530 int port = adapter->physical_port;
531 531
532 if (adapter->ahw.board_type == NETXEN_NIC_GBE) { 532 if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
533 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) 533 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
@@ -573,7 +573,7 @@ netxen_nic_set_pauseparam(struct net_device *dev,
573{ 573{
574 struct netxen_adapter *adapter = netdev_priv(dev); 574 struct netxen_adapter *adapter = netdev_priv(dev);
575 __u32 val; 575 __u32 val;
576 int port = physical_port[adapter->portnum]; 576 int port = adapter->physical_port;
577 /* read mode */ 577 /* read mode */
578 if (adapter->ahw.board_type == NETXEN_NIC_GBE) { 578 if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
579 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) 579 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index af7356468251..c43d06b8de9b 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -396,11 +396,8 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
396 } 396 }
397 adapter->intr_scheme = readl( 397 adapter->intr_scheme = readl(
398 NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_FW)); 398 NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_FW));
399 printk(KERN_NOTICE "%s: FW capabilities:0x%x\n", netxen_nic_driver_name,
400 adapter->intr_scheme);
401 adapter->msi_mode = readl( 399 adapter->msi_mode = readl(
402 NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_MSI_MODE_FW)); 400 NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_MSI_MODE_FW));
403 DPRINTK(INFO, "Receive Peg ready too. starting stuff\n");
404 401
405 addr = netxen_alloc(adapter->ahw.pdev, 402 addr = netxen_alloc(adapter->ahw.pdev,
406 sizeof(struct netxen_ring_ctx) + 403 sizeof(struct netxen_ring_ctx) +
@@ -408,8 +405,6 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
408 (dma_addr_t *) & adapter->ctx_desc_phys_addr, 405 (dma_addr_t *) & adapter->ctx_desc_phys_addr,
409 &adapter->ctx_desc_pdev); 406 &adapter->ctx_desc_pdev);
410 407
411 printk(KERN_INFO "ctx_desc_phys_addr: 0x%llx\n",
412 (unsigned long long) adapter->ctx_desc_phys_addr);
413 if (addr == NULL) { 408 if (addr == NULL) {
414 DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); 409 DPRINTK(ERR, "bad return from pci_alloc_consistent\n");
415 err = -ENOMEM; 410 err = -ENOMEM;
@@ -429,8 +424,6 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
429 adapter->max_tx_desc_count, 424 adapter->max_tx_desc_count,
430 (dma_addr_t *) & hw->cmd_desc_phys_addr, 425 (dma_addr_t *) & hw->cmd_desc_phys_addr,
431 &adapter->ahw.cmd_desc_pdev); 426 &adapter->ahw.cmd_desc_pdev);
432 printk(KERN_INFO "cmd_desc_phys_addr: 0x%llx\n",
433 (unsigned long long) hw->cmd_desc_phys_addr);
434 427
435 if (addr == NULL) { 428 if (addr == NULL) {
436 DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); 429 DPRINTK(ERR, "bad return from pci_alloc_consistent\n");
@@ -1032,15 +1025,15 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter)
1032int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu) 1025int netxen_nic_set_mtu_gb(struct netxen_adapter *adapter, int new_mtu)
1033{ 1026{
1034 netxen_nic_write_w0(adapter, 1027 netxen_nic_write_w0(adapter,
1035 NETXEN_NIU_GB_MAX_FRAME_SIZE( 1028 NETXEN_NIU_GB_MAX_FRAME_SIZE(adapter->physical_port),
1036 physical_port[adapter->portnum]), new_mtu); 1029 new_mtu);
1037 return 0; 1030 return 0;
1038} 1031}
1039 1032
1040int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu) 1033int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu)
1041{ 1034{
1042 new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; 1035 new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE;
1043 if (physical_port[adapter->portnum] == 0) 1036 if (adapter->physical_port == 0)
1044 netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, 1037 netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE,
1045 new_mtu); 1038 new_mtu);
1046 else 1039 else
@@ -1051,7 +1044,7 @@ int netxen_nic_set_mtu_xgb(struct netxen_adapter *adapter, int new_mtu)
1051 1044
1052void netxen_nic_init_niu_gb(struct netxen_adapter *adapter) 1045void netxen_nic_init_niu_gb(struct netxen_adapter *adapter)
1053{ 1046{
1054 netxen_niu_gbe_init_port(adapter, physical_port[adapter->portnum]); 1047 netxen_niu_gbe_init_port(adapter, adapter->physical_port);
1055} 1048}
1056 1049
1057void 1050void
@@ -1127,7 +1120,6 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
1127 1120
1128void netxen_nic_flash_print(struct netxen_adapter *adapter) 1121void netxen_nic_flash_print(struct netxen_adapter *adapter)
1129{ 1122{
1130 int valid = 1;
1131 u32 fw_major = 0; 1123 u32 fw_major = 0;
1132 u32 fw_minor = 0; 1124 u32 fw_minor = 0;
1133 u32 fw_build = 0; 1125 u32 fw_build = 0;
@@ -1137,70 +1129,62 @@ void netxen_nic_flash_print(struct netxen_adapter *adapter)
1137 __le32 *ptr32; 1129 __le32 *ptr32;
1138 1130
1139 struct netxen_board_info *board_info = &(adapter->ahw.boardcfg); 1131 struct netxen_board_info *board_info = &(adapter->ahw.boardcfg);
1140 if (board_info->magic != NETXEN_BDINFO_MAGIC) { 1132
1141 printk 1133 adapter->driver_mismatch = 0;
1142 ("NetXen Unknown board config, Read 0x%x expected as 0x%x\n", 1134
1143 board_info->magic, NETXEN_BDINFO_MAGIC); 1135 ptr32 = (u32 *)&serial_num;
1144 valid = 0; 1136 addr = NETXEN_USER_START +
1145 } 1137 offsetof(struct netxen_new_user_info, serial_num);
1146 if (board_info->header_version != NETXEN_BDINFO_VERSION) { 1138 for (i = 0; i < 8; i++) {
1147 printk("NetXen Unknown board config version." 1139 if (netxen_rom_fast_read(adapter, addr, ptr32) == -1) {
1148 " Read %x, expected %x\n", 1140 printk("%s: ERROR reading %s board userarea.\n",
1149 board_info->header_version, NETXEN_BDINFO_VERSION); 1141 netxen_nic_driver_name,
1150 valid = 0; 1142 netxen_nic_driver_name);
1151 } 1143 adapter->driver_mismatch = 1;
1152 if (valid) { 1144 return;
1153 ptr32 = (u32 *)&serial_num;
1154 addr = NETXEN_USER_START +
1155 offsetof(struct netxen_new_user_info, serial_num);
1156 for (i = 0; i < 8; i++) {
1157 if (netxen_rom_fast_read(adapter, addr, ptr32) == -1) {
1158 printk("%s: ERROR reading %s board userarea.\n",
1159 netxen_nic_driver_name,
1160 netxen_nic_driver_name);
1161 return;
1162 }
1163 ptr32++;
1164 addr += sizeof(u32);
1165 } 1145 }
1146 ptr32++;
1147 addr += sizeof(u32);
1148 }
1149
1150 fw_major = readl(NETXEN_CRB_NORMALIZE(adapter,
1151 NETXEN_FW_VERSION_MAJOR));
1152 fw_minor = readl(NETXEN_CRB_NORMALIZE(adapter,
1153 NETXEN_FW_VERSION_MINOR));
1154 fw_build =
1155 readl(NETXEN_CRB_NORMALIZE(adapter, NETXEN_FW_VERSION_SUB));
1166 1156
1157 if (adapter->portnum == 0) {
1167 get_brd_name_by_type(board_info->board_type, brd_name); 1158 get_brd_name_by_type(board_info->board_type, brd_name);
1168 1159
1169 printk("NetXen %s Board S/N %s Chip id 0x%x\n", 1160 printk("NetXen %s Board S/N %s Chip id 0x%x\n",
1170 brd_name, serial_num, board_info->chip_id); 1161 brd_name, serial_num, board_info->chip_id);
1171 1162 printk("NetXen Firmware version %d.%d.%d\n", fw_major,
1172 printk("NetXen %s Board #%d, Chip id 0x%x\n", 1163 fw_minor, fw_build);
1173 board_info->board_type == 0x0b ? "XGB" : "GBE",
1174 board_info->board_num, board_info->chip_id);
1175 fw_major = readl(NETXEN_CRB_NORMALIZE(adapter,
1176 NETXEN_FW_VERSION_MAJOR));
1177 fw_minor = readl(NETXEN_CRB_NORMALIZE(adapter,
1178 NETXEN_FW_VERSION_MINOR));
1179 fw_build =
1180 readl(NETXEN_CRB_NORMALIZE(adapter, NETXEN_FW_VERSION_SUB));
1181
1182 printk("NetXen Firmware version %d.%d.%d\n", fw_major, fw_minor,
1183 fw_build);
1184 } 1164 }
1165
1185 if (fw_major != _NETXEN_NIC_LINUX_MAJOR) { 1166 if (fw_major != _NETXEN_NIC_LINUX_MAJOR) {
1186 printk(KERN_ERR "The mismatch in driver version and firmware "
1187 "version major number\n"
1188 "Driver version major number = %d \t"
1189 "Firmware version major number = %d \n",
1190 _NETXEN_NIC_LINUX_MAJOR, fw_major);
1191 adapter->driver_mismatch = 1; 1167 adapter->driver_mismatch = 1;
1192 } 1168 }
1193 if (fw_minor != _NETXEN_NIC_LINUX_MINOR && 1169 if (fw_minor != _NETXEN_NIC_LINUX_MINOR &&
1194 fw_minor != (_NETXEN_NIC_LINUX_MINOR + 1)) { 1170 fw_minor != (_NETXEN_NIC_LINUX_MINOR + 1)) {
1195 printk(KERN_ERR "The mismatch in driver version and firmware "
1196 "version minor number\n"
1197 "Driver version minor number = %d \t"
1198 "Firmware version minor number = %d \n",
1199 _NETXEN_NIC_LINUX_MINOR, fw_minor);
1200 adapter->driver_mismatch = 1; 1171 adapter->driver_mismatch = 1;
1201 } 1172 }
1202 if (adapter->driver_mismatch) 1173 if (adapter->driver_mismatch) {
1203 printk(KERN_INFO "Use the driver with version no %d.%d.xxx\n", 1174 printk(KERN_ERR "%s: driver and firmware version mismatch\n",
1204 fw_major, fw_minor); 1175 adapter->netdev->name);
1176 return;
1177 }
1178
1179 switch (adapter->ahw.board_type) {
1180 case NETXEN_NIC_GBE:
1181 dev_info(&adapter->pdev->dev, "%s: GbE port initialized\n",
1182 adapter->netdev->name);
1183 break;
1184 case NETXEN_NIC_XGBE:
1185 dev_info(&adapter->pdev->dev, "%s: XGbE port initialized\n",
1186 adapter->netdev->name);
1187 break;
1188 }
1205} 1189}
1206 1190
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 45fa33e0cb90..70d1b22ced22 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -203,21 +203,6 @@ void netxen_initialize_adapter_sw(struct netxen_adapter *adapter)
203 } 203 }
204} 204}
205 205
206void netxen_initialize_adapter_hw(struct netxen_adapter *adapter)
207{
208 int ports = 0;
209 struct netxen_board_info *board_info = &(adapter->ahw.boardcfg);
210
211 if (netxen_nic_get_board_info(adapter) != 0)
212 printk("%s: Error getting board config info.\n",
213 netxen_nic_driver_name);
214 get_brd_port_by_type(board_info->board_type, &ports);
215 if (ports == 0)
216 printk(KERN_ERR "%s: Unknown board type\n",
217 netxen_nic_driver_name);
218 adapter->ahw.max_ports = ports;
219}
220
221void netxen_initialize_adapter_ops(struct netxen_adapter *adapter) 206void netxen_initialize_adapter_ops(struct netxen_adapter *adapter)
222{ 207{
223 switch (adapter->ahw.board_type) { 208 switch (adapter->ahw.board_type) {
@@ -765,18 +750,13 @@ int netxen_flash_unlock(struct netxen_adapter *adapter)
765 750
766int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) 751int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
767{ 752{
768 int addr, val, status; 753 int addr, val;
769 int n, i; 754 int n, i;
770 int init_delay = 0; 755 int init_delay = 0;
771 struct crb_addr_pair *buf; 756 struct crb_addr_pair *buf;
772 u32 off; 757 u32 off;
773 758
774 /* resetall */ 759 /* resetall */
775 status = netxen_nic_get_board_info(adapter);
776 if (status)
777 printk("%s: netxen_pinit_from_rom: Error getting board info\n",
778 netxen_nic_driver_name);
779
780 netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET, 760 netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET,
781 NETXEN_ROMBUS_RESET); 761 NETXEN_ROMBUS_RESET);
782 762
@@ -860,10 +840,10 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose)
860 netxen_nic_pci_change_crbwindow(adapter, 1); 840 netxen_nic_pci_change_crbwindow(adapter, 1);
861 } 841 }
862 if (init_delay == 1) { 842 if (init_delay == 1) {
863 msleep(2000); 843 msleep(1000);
864 init_delay = 0; 844 init_delay = 0;
865 } 845 }
866 msleep(20); 846 msleep(1);
867 } 847 }
868 kfree(buf); 848 kfree(buf);
869 849
@@ -938,12 +918,28 @@ int netxen_initialize_adapter_offload(struct netxen_adapter *adapter)
938 918
939void netxen_free_adapter_offload(struct netxen_adapter *adapter) 919void netxen_free_adapter_offload(struct netxen_adapter *adapter)
940{ 920{
921 int i;
922
941 if (adapter->dummy_dma.addr) { 923 if (adapter->dummy_dma.addr) {
942 pci_free_consistent(adapter->ahw.pdev, 924 i = 100;
925 do {
926 if (dma_watchdog_shutdown_request(adapter) == 1)
927 break;
928 msleep(50);
929 if (dma_watchdog_shutdown_poll_result(adapter) == 1)
930 break;
931 } while (--i);
932
933 if (i) {
934 pci_free_consistent(adapter->ahw.pdev,
943 NETXEN_HOST_DUMMY_DMA_SIZE, 935 NETXEN_HOST_DUMMY_DMA_SIZE,
944 adapter->dummy_dma.addr, 936 adapter->dummy_dma.addr,
945 adapter->dummy_dma.phys_addr); 937 adapter->dummy_dma.phys_addr);
946 adapter->dummy_dma.addr = NULL; 938 adapter->dummy_dma.addr = NULL;
939 } else {
940 printk(KERN_ERR "%s: dma_watchdog_shutdown failed\n",
941 adapter->netdev->name);
942 }
947 } 943 }
948} 944}
949 945
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c
index f487615f4063..96cec41f9019 100644
--- a/drivers/net/netxen/netxen_nic_isr.c
+++ b/drivers/net/netxen/netxen_nic_isr.c
@@ -145,7 +145,7 @@ static void netxen_nic_isr_other(struct netxen_adapter *adapter)
145 145
146 /* verify the offset */ 146 /* verify the offset */
147 val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); 147 val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE));
148 val = val >> physical_port[adapter->portnum]; 148 val = val >> adapter->physical_port;
149 if (val == adapter->ahw.qg_linksup) 149 if (val == adapter->ahw.qg_linksup)
150 return; 150 return;
151 151
@@ -199,7 +199,7 @@ void netxen_nic_xgbe_handle_phy_intr(struct netxen_adapter *adapter)
199 199
200 /* WINDOW = 1 */ 200 /* WINDOW = 1 */
201 val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE)); 201 val = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_XG_STATE));
202 val >>= (physical_port[adapter->portnum] * 8); 202 val >>= (adapter->physical_port * 8);
203 val &= 0xff; 203 val &= 0xff;
204 204
205 if (adapter->ahw.xg_linkup == 1 && val != XG_LINK_UP) { 205 if (adapter->ahw.xg_linkup == 1 && val != XG_LINK_UP) {
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 7144c255ce54..6797ed069f1f 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -70,17 +70,15 @@ static void netxen_nic_poll_controller(struct net_device *netdev);
70static irqreturn_t netxen_intr(int irq, void *data); 70static irqreturn_t netxen_intr(int irq, void *data);
71static irqreturn_t netxen_msi_intr(int irq, void *data); 71static irqreturn_t netxen_msi_intr(int irq, void *data);
72 72
73int physical_port[] = {0, 1, 2, 3};
74
75/* PCI Device ID Table */ 73/* PCI Device ID Table */
76static struct pci_device_id netxen_pci_tbl[] __devinitdata = { 74static struct pci_device_id netxen_pci_tbl[] __devinitdata = {
77 {PCI_DEVICE(0x4040, 0x0001)}, 75 {PCI_DEVICE(0x4040, 0x0001), PCI_DEVICE_CLASS(0x020000, ~0)},
78 {PCI_DEVICE(0x4040, 0x0002)}, 76 {PCI_DEVICE(0x4040, 0x0002), PCI_DEVICE_CLASS(0x020000, ~0)},
79 {PCI_DEVICE(0x4040, 0x0003)}, 77 {PCI_DEVICE(0x4040, 0x0003), PCI_DEVICE_CLASS(0x020000, ~0)},
80 {PCI_DEVICE(0x4040, 0x0004)}, 78 {PCI_DEVICE(0x4040, 0x0004), PCI_DEVICE_CLASS(0x020000, ~0)},
81 {PCI_DEVICE(0x4040, 0x0005)}, 79 {PCI_DEVICE(0x4040, 0x0005), PCI_DEVICE_CLASS(0x020000, ~0)},
82 {PCI_DEVICE(0x4040, 0x0024)}, 80 {PCI_DEVICE(0x4040, 0x0024), PCI_DEVICE_CLASS(0x020000, ~0)},
83 {PCI_DEVICE(0x4040, 0x0025)}, 81 {PCI_DEVICE(0x4040, 0x0025), PCI_DEVICE_CLASS(0x020000, ~0)},
84 {0,} 82 {0,}
85}; 83};
86 84
@@ -288,10 +286,11 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
288 int pci_func_id = PCI_FUNC(pdev->devfn); 286 int pci_func_id = PCI_FUNC(pdev->devfn);
289 DECLARE_MAC_BUF(mac); 287 DECLARE_MAC_BUF(mac);
290 288
291 printk(KERN_INFO "%s \n", netxen_nic_driver_string); 289 if (pci_func_id == 0)
290 printk(KERN_INFO "%s \n", netxen_nic_driver_string);
292 291
293 if (pdev->class != 0x020000) { 292 if (pdev->class != 0x020000) {
294 printk(KERN_ERR"NetXen function %d, class %x will not " 293 printk(KERN_DEBUG "NetXen function %d, class %x will not "
295 "be enabled.\n",pci_func_id, pdev->class); 294 "be enabled.\n",pci_func_id, pdev->class);
296 return -ENODEV; 295 return -ENODEV;
297 } 296 }
@@ -450,8 +449,12 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
450 */ 449 */
451 adapter->curr_window = 255; 450 adapter->curr_window = 255;
452 451
453 /* initialize the adapter */ 452 if (netxen_nic_get_board_info(adapter) != 0) {
454 netxen_initialize_adapter_hw(adapter); 453 printk("%s: Error getting board config info.\n",
454 netxen_nic_driver_name);
455 err = -EIO;
456 goto err_out_iounmap;
457 }
455 458
456 /* 459 /*
457 * Adapter in our case is quad port so initialize it before 460 * Adapter in our case is quad port so initialize it before
@@ -530,17 +533,15 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
530 netxen_initialize_adapter_sw(adapter); /* initialize the buffers in adapter */ 533 netxen_initialize_adapter_sw(adapter); /* initialize the buffers in adapter */
531 534
532 /* Mezz cards have PCI function 0,2,3 enabled */ 535 /* Mezz cards have PCI function 0,2,3 enabled */
533 if ((adapter->ahw.boardcfg.board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) 536 switch (adapter->ahw.boardcfg.board_type) {
534 && (pci_func_id >= 2)) 537 case NETXEN_BRDTYPE_P2_SB31_10G_IMEZ:
538 case NETXEN_BRDTYPE_P2_SB31_10G_HMEZ:
539 if (pci_func_id >= 2)
535 adapter->portnum = pci_func_id - 2; 540 adapter->portnum = pci_func_id - 2;
536 541 break;
537#ifdef CONFIG_IA64 542 default:
538 if(adapter->portnum == 0) { 543 break;
539 netxen_pinit_from_rom(adapter, 0);
540 udelay(500);
541 netxen_load_firmware(adapter);
542 } 544 }
543#endif
544 545
545 init_timer(&adapter->watchdog_timer); 546 init_timer(&adapter->watchdog_timer);
546 adapter->ahw.xg_linkup = 0; 547 adapter->ahw.xg_linkup = 0;
@@ -613,11 +614,18 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
613 err = -ENODEV; 614 err = -ENODEV;
614 goto err_out_free_dev; 615 goto err_out_free_dev;
615 } 616 }
617 } else {
618 writel(0, NETXEN_CRB_NORMALIZE(adapter,
619 CRB_CMDPEG_STATE));
620 netxen_pinit_from_rom(adapter, 0);
621 msleep(1);
622 netxen_load_firmware(adapter);
623 netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
616 } 624 }
617 625
618 /* clear the register for future unloads/loads */ 626 /* clear the register for future unloads/loads */
619 writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); 627 writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc)));
620 printk(KERN_INFO "State: 0x%0x\n", 628 dev_info(&pdev->dev, "cmdpeg state: 0x%0x\n",
621 readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); 629 readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)));
622 630
623 /* 631 /*
@@ -639,9 +647,10 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
639 /* 647 /*
640 * See if the firmware gave us a virtual-physical port mapping. 648 * See if the firmware gave us a virtual-physical port mapping.
641 */ 649 */
650 adapter->physical_port = adapter->portnum;
642 i = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_V2P(adapter->portnum))); 651 i = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_V2P(adapter->portnum)));
643 if (i != 0x55555555) 652 if (i != 0x55555555)
644 physical_port[adapter->portnum] = i; 653 adapter->physical_port = i;
645 654
646 netif_carrier_off(netdev); 655 netif_carrier_off(netdev);
647 netif_stop_queue(netdev); 656 netif_stop_queue(netdev);
@@ -654,22 +663,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
654 goto err_out_free_dev; 663 goto err_out_free_dev;
655 } 664 }
656 665
666 netxen_nic_flash_print(adapter);
657 pci_set_drvdata(pdev, adapter); 667 pci_set_drvdata(pdev, adapter);
658 668
659 switch (adapter->ahw.board_type) {
660 case NETXEN_NIC_GBE:
661 printk(KERN_INFO "%s: QUAD GbE board initialized\n",
662 netxen_nic_driver_name);
663 break;
664
665 case NETXEN_NIC_XGBE:
666 printk(KERN_INFO "%s: XGbE board initialized\n",
667 netxen_nic_driver_name);
668 break;
669 }
670
671 adapter->driver_mismatch = 0;
672
673 return 0; 669 return 0;
674 670
675err_out_free_dev: 671err_out_free_dev:
@@ -760,55 +756,8 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
760 756
761 vfree(adapter->cmd_buf_arr); 757 vfree(adapter->cmd_buf_arr);
762 758
763 if (adapter->portnum == 0) { 759 if (adapter->portnum == 0)
764 if (init_firmware_done) { 760 netxen_free_adapter_offload(adapter);
765 i = 100;
766 do {
767 if (dma_watchdog_shutdown_request(adapter) == 1)
768 break;
769 msleep(100);
770 if (dma_watchdog_shutdown_poll_result(adapter) == 1)
771 break;
772 } while (--i);
773
774 if (i == 0)
775 printk(KERN_ERR "%s: dma_watchdog_shutdown failed\n",
776 netdev->name);
777
778 /* clear the register for future unloads/loads */
779 writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc)));
780 printk(KERN_INFO "State: 0x%0x\n",
781 readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)));
782
783 /* leave the hw in the same state as reboot */
784 writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE));
785 netxen_pinit_from_rom(adapter, 0);
786 msleep(1);
787 netxen_load_firmware(adapter);
788 netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE);
789 }
790
791 /* clear the register for future unloads/loads */
792 writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc)));
793 printk(KERN_INFO "State: 0x%0x\n",
794 readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)));
795
796 i = 100;
797 do {
798 if (dma_watchdog_shutdown_request(adapter) == 1)
799 break;
800 msleep(100);
801 if (dma_watchdog_shutdown_poll_result(adapter) == 1)
802 break;
803 } while (--i);
804
805 if (i) {
806 netxen_free_adapter_offload(adapter);
807 } else {
808 printk(KERN_ERR "%s: dma_watchdog_shutdown failed\n",
809 netdev->name);
810 }
811 }
812 761
813 if (adapter->irq) 762 if (adapter->irq)
814 free_irq(adapter->irq, adapter); 763 free_irq(adapter->irq, adapter);
@@ -840,13 +789,15 @@ static int netxen_nic_open(struct net_device *netdev)
840 irq_handler_t handler; 789 irq_handler_t handler;
841 unsigned long flags = IRQF_SAMPLE_RANDOM; 790 unsigned long flags = IRQF_SAMPLE_RANDOM;
842 791
792 if (adapter->driver_mismatch)
793 return -EIO;
794
843 if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) { 795 if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) {
844 err = netxen_init_firmware(adapter); 796 err = netxen_init_firmware(adapter);
845 if (err != 0) { 797 if (err != 0) {
846 printk(KERN_ERR "Failed to init firmware\n"); 798 printk(KERN_ERR "Failed to init firmware\n");
847 return -EIO; 799 return -EIO;
848 } 800 }
849 netxen_nic_flash_print(adapter);
850 801
851 /* setup all the resources for the Phantom... */ 802 /* setup all the resources for the Phantom... */
852 /* this include the descriptors for rcv, tx, and status */ 803 /* this include the descriptors for rcv, tx, and status */
@@ -895,14 +846,12 @@ static int netxen_nic_open(struct net_device *netdev)
895 if (adapter->set_mtu) 846 if (adapter->set_mtu)
896 adapter->set_mtu(adapter, netdev->mtu); 847 adapter->set_mtu(adapter, netdev->mtu);
897 848
898 if (!adapter->driver_mismatch) 849 mod_timer(&adapter->watchdog_timer, jiffies);
899 mod_timer(&adapter->watchdog_timer, jiffies);
900 850
901 napi_enable(&adapter->napi); 851 napi_enable(&adapter->napi);
902 netxen_nic_enable_int(adapter); 852 netxen_nic_enable_int(adapter);
903 853
904 if (!adapter->driver_mismatch) 854 netif_start_queue(netdev);
905 netif_start_queue(netdev);
906 855
907 return 0; 856 return 0;
908} 857}
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c
index 1c852a76c80d..a3bc7cc67a6f 100644
--- a/drivers/net/netxen/netxen_nic_niu.c
+++ b/drivers/net/netxen/netxen_nic_niu.c
@@ -94,7 +94,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long reg,
94 long timeout = 0; 94 long timeout = 0;
95 long result = 0; 95 long result = 0;
96 long restore = 0; 96 long restore = 0;
97 long phy = physical_port[adapter->portnum]; 97 long phy = adapter->physical_port;
98 __u32 address; 98 __u32 address;
99 __u32 command; 99 __u32 command;
100 __u32 status; 100 __u32 status;
@@ -190,7 +190,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long reg,
190 long timeout = 0; 190 long timeout = 0;
191 long result = 0; 191 long result = 0;
192 long restore = 0; 192 long restore = 0;
193 long phy = physical_port[adapter->portnum]; 193 long phy = adapter->physical_port;
194 __u32 address; 194 __u32 address;
195 __u32 command; 195 __u32 command;
196 __u32 status; 196 __u32 status;
@@ -456,7 +456,7 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)
456 456
457int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) 457int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port)
458{ 458{
459 u32 portnum = physical_port[adapter->portnum]; 459 u32 portnum = adapter->physical_port;
460 460
461 netxen_crb_writelit_adapter(adapter, 461 netxen_crb_writelit_adapter(adapter,
462 NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), 0x1447); 462 NETXEN_NIU_XGE_CONFIG_1+(0x10000*portnum), 0x1447);
@@ -573,7 +573,7 @@ static int netxen_niu_macaddr_get(struct netxen_adapter *adapter,
573{ 573{
574 u32 stationhigh; 574 u32 stationhigh;
575 u32 stationlow; 575 u32 stationlow;
576 int phy = physical_port[adapter->portnum]; 576 int phy = adapter->physical_port;
577 u8 val[8]; 577 u8 val[8];
578 578
579 if (addr == NULL) 579 if (addr == NULL)
@@ -604,7 +604,7 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
604{ 604{
605 u8 temp[4]; 605 u8 temp[4];
606 u32 val; 606 u32 val;
607 int phy = physical_port[adapter->portnum]; 607 int phy = adapter->physical_port;
608 unsigned char mac_addr[6]; 608 unsigned char mac_addr[6];
609 int i; 609 int i;
610 DECLARE_MAC_BUF(mac); 610 DECLARE_MAC_BUF(mac);
@@ -724,7 +724,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter,
724int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter) 724int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter)
725{ 725{
726 __u32 mac_cfg0; 726 __u32 mac_cfg0;
727 u32 port = physical_port[adapter->portnum]; 727 u32 port = adapter->physical_port;
728 728
729 if (port > NETXEN_NIU_MAX_GBE_PORTS) 729 if (port > NETXEN_NIU_MAX_GBE_PORTS)
730 return -EINVAL; 730 return -EINVAL;
@@ -740,7 +740,7 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter)
740int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) 740int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
741{ 741{
742 __u32 mac_cfg; 742 __u32 mac_cfg;
743 u32 port = physical_port[adapter->portnum]; 743 u32 port = adapter->physical_port;
744 744
745 if (port > NETXEN_NIU_MAX_XG_PORTS) 745 if (port > NETXEN_NIU_MAX_XG_PORTS)
746 return -EINVAL; 746 return -EINVAL;
@@ -757,7 +757,7 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
757 netxen_niu_prom_mode_t mode) 757 netxen_niu_prom_mode_t mode)
758{ 758{
759 __u32 reg; 759 __u32 reg;
760 u32 port = physical_port[adapter->portnum]; 760 u32 port = adapter->physical_port;
761 761
762 if (port > NETXEN_NIU_MAX_GBE_PORTS) 762 if (port > NETXEN_NIU_MAX_GBE_PORTS)
763 return -EINVAL; 763 return -EINVAL;
@@ -814,7 +814,7 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter,
814int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter, 814int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter,
815 netxen_ethernet_macaddr_t addr) 815 netxen_ethernet_macaddr_t addr)
816{ 816{
817 int phy = physical_port[adapter->portnum]; 817 int phy = adapter->physical_port;
818 u8 temp[4]; 818 u8 temp[4];
819 u32 val; 819 u32 val;
820 820
@@ -867,7 +867,7 @@ int netxen_niu_xg_macaddr_set(struct netxen_adapter *adapter,
867int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, 867int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter,
868 netxen_ethernet_macaddr_t * addr) 868 netxen_ethernet_macaddr_t * addr)
869{ 869{
870 int phy = physical_port[adapter->portnum]; 870 int phy = adapter->physical_port;
871 u32 stationhigh; 871 u32 stationhigh;
872 u32 stationlow; 872 u32 stationlow;
873 u8 val[8]; 873 u8 val[8];
@@ -896,7 +896,7 @@ int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
896 netxen_niu_prom_mode_t mode) 896 netxen_niu_prom_mode_t mode)
897{ 897{
898 __u32 reg; 898 __u32 reg;
899 u32 port = physical_port[adapter->portnum]; 899 u32 port = adapter->physical_port;
900 900
901 if (port > NETXEN_NIU_MAX_XG_PORTS) 901 if (port > NETXEN_NIU_MAX_XG_PORTS)
902 return -EINVAL; 902 return -EINVAL;
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index bafb69b6f7cb..fc6f4b8c64b3 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -942,7 +942,7 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
942 m->msg_namelen = 0; 942 m->msg_namelen = 0;
943 943
944 if (skb) { 944 if (skb) {
945 total_len = min(total_len, skb->len); 945 total_len = min_t(size_t, total_len, skb->len);
946 error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len); 946 error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
947 if (error == 0) 947 if (error == 0)
948 error = total_len; 948 error = total_len;
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 62436b3a18c6..c8a5ef2d75f4 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -118,6 +118,7 @@ static const struct pci_device_id sky2_id_table[] = {
118 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) }, /* 88E8038 */ 118 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) }, /* 88E8038 */
119 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */ 119 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4353) }, /* 88E8039 */
120 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */ 120 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4354) }, /* 88E8040 */
121 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4355) }, /* 88E8040T */
121 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */ 122 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4356) }, /* 88EC033 */
122 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */ 123 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4357) }, /* 88E8042 */
123 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */ 124 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x435A) }, /* 88E8048 */
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 0ce07a339c7e..7ab94c825b57 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -313,6 +313,21 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv,
313 313
314 switch (tun->flags & TUN_TYPE_MASK) { 314 switch (tun->flags & TUN_TYPE_MASK) {
315 case TUN_TUN_DEV: 315 case TUN_TUN_DEV:
316 if (tun->flags & TUN_NO_PI) {
317 switch (skb->data[0] & 0xf0) {
318 case 0x40:
319 pi.proto = htons(ETH_P_IP);
320 break;
321 case 0x60:
322 pi.proto = htons(ETH_P_IPV6);
323 break;
324 default:
325 tun->dev->stats.rx_dropped++;
326 kfree_skb(skb);
327 return -EINVAL;
328 }
329 }
330
316 skb_reset_mac_header(skb); 331 skb_reset_mac_header(skb);
317 skb->protocol = pi.proto; 332 skb->protocol = pi.proto;
318 skb->dev = tun->dev; 333 skb->dev = tun->dev;
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index dfa4bdd5597c..d3db298c05fc 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -630,7 +630,6 @@ struct b43_pio {
630 630
631/* Context information for a noise calculation (Link Quality). */ 631/* Context information for a noise calculation (Link Quality). */
632struct b43_noise_calculation { 632struct b43_noise_calculation {
633 u8 channel_at_start;
634 bool calculation_running; 633 bool calculation_running;
635 u8 nr_samples; 634 u8 nr_samples;
636 s8 samples[8][4]; 635 s8 samples[8][4];
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 6dcbb3c87e72..e23f2f172bd7 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -795,24 +795,49 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
795{ 795{
796 struct b43_dmaring *ring; 796 struct b43_dmaring *ring;
797 int err; 797 int err;
798 int nr_slots;
799 dma_addr_t dma_test; 798 dma_addr_t dma_test;
800 799
801 ring = kzalloc(sizeof(*ring), GFP_KERNEL); 800 ring = kzalloc(sizeof(*ring), GFP_KERNEL);
802 if (!ring) 801 if (!ring)
803 goto out; 802 goto out;
804 ring->type = type;
805 803
806 nr_slots = B43_RXRING_SLOTS; 804 ring->nr_slots = B43_RXRING_SLOTS;
807 if (for_tx) 805 if (for_tx)
808 nr_slots = B43_TXRING_SLOTS; 806 ring->nr_slots = B43_TXRING_SLOTS;
809 807
810 ring->meta = kcalloc(nr_slots, sizeof(struct b43_dmadesc_meta), 808 ring->meta = kcalloc(ring->nr_slots, sizeof(struct b43_dmadesc_meta),
811 GFP_KERNEL); 809 GFP_KERNEL);
812 if (!ring->meta) 810 if (!ring->meta)
813 goto err_kfree_ring; 811 goto err_kfree_ring;
812
813 ring->type = type;
814 ring->dev = dev;
815 ring->mmio_base = b43_dmacontroller_base(type, controller_index);
816 ring->index = controller_index;
817 if (type == B43_DMA_64BIT)
818 ring->ops = &dma64_ops;
819 else
820 ring->ops = &dma32_ops;
814 if (for_tx) { 821 if (for_tx) {
815 ring->txhdr_cache = kcalloc(nr_slots, 822 ring->tx = 1;
823 ring->current_slot = -1;
824 } else {
825 if (ring->index == 0) {
826 ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE;
827 ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET;
828 } else if (ring->index == 3) {
829 ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE;
830 ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET;
831 } else
832 B43_WARN_ON(1);
833 }
834 spin_lock_init(&ring->lock);
835#ifdef CONFIG_B43_DEBUG
836 ring->last_injected_overflow = jiffies;
837#endif
838
839 if (for_tx) {
840 ring->txhdr_cache = kcalloc(ring->nr_slots,
816 b43_txhdr_size(dev), 841 b43_txhdr_size(dev),
817 GFP_KERNEL); 842 GFP_KERNEL);
818 if (!ring->txhdr_cache) 843 if (!ring->txhdr_cache)
@@ -828,7 +853,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
828 b43_txhdr_size(dev), 1)) { 853 b43_txhdr_size(dev), 1)) {
829 /* ugh realloc */ 854 /* ugh realloc */
830 kfree(ring->txhdr_cache); 855 kfree(ring->txhdr_cache);
831 ring->txhdr_cache = kcalloc(nr_slots, 856 ring->txhdr_cache = kcalloc(ring->nr_slots,
832 b43_txhdr_size(dev), 857 b43_txhdr_size(dev),
833 GFP_KERNEL | GFP_DMA); 858 GFP_KERNEL | GFP_DMA);
834 if (!ring->txhdr_cache) 859 if (!ring->txhdr_cache)
@@ -853,32 +878,6 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
853 DMA_TO_DEVICE); 878 DMA_TO_DEVICE);
854 } 879 }
855 880
856 ring->dev = dev;
857 ring->nr_slots = nr_slots;
858 ring->mmio_base = b43_dmacontroller_base(type, controller_index);
859 ring->index = controller_index;
860 if (type == B43_DMA_64BIT)
861 ring->ops = &dma64_ops;
862 else
863 ring->ops = &dma32_ops;
864 if (for_tx) {
865 ring->tx = 1;
866 ring->current_slot = -1;
867 } else {
868 if (ring->index == 0) {
869 ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE;
870 ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET;
871 } else if (ring->index == 3) {
872 ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE;
873 ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET;
874 } else
875 B43_WARN_ON(1);
876 }
877 spin_lock_init(&ring->lock);
878#ifdef CONFIG_B43_DEBUG
879 ring->last_injected_overflow = jiffies;
880#endif
881
882 err = alloc_ringmemory(ring); 881 err = alloc_ringmemory(ring);
883 if (err) 882 if (err)
884 goto err_kfree_txhdr_cache; 883 goto err_kfree_txhdr_cache;
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 6c3d9ea0a9f8..fa4b0d8b74a2 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -1145,7 +1145,6 @@ static void b43_generate_noise_sample(struct b43_wldev *dev)
1145 b43_jssi_write(dev, 0x7F7F7F7F); 1145 b43_jssi_write(dev, 0x7F7F7F7F);
1146 b43_write32(dev, B43_MMIO_MACCMD, 1146 b43_write32(dev, B43_MMIO_MACCMD,
1147 b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE); 1147 b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE);
1148 B43_WARN_ON(dev->noisecalc.channel_at_start != dev->phy.channel);
1149} 1148}
1150 1149
1151static void b43_calculate_link_quality(struct b43_wldev *dev) 1150static void b43_calculate_link_quality(struct b43_wldev *dev)
@@ -1154,7 +1153,6 @@ static void b43_calculate_link_quality(struct b43_wldev *dev)
1154 1153
1155 if (dev->noisecalc.calculation_running) 1154 if (dev->noisecalc.calculation_running)
1156 return; 1155 return;
1157 dev->noisecalc.channel_at_start = dev->phy.channel;
1158 dev->noisecalc.calculation_running = 1; 1156 dev->noisecalc.calculation_running = 1;
1159 dev->noisecalc.nr_samples = 0; 1157 dev->noisecalc.nr_samples = 0;
1160 1158
@@ -1171,9 +1169,16 @@ static void handle_irq_noise(struct b43_wldev *dev)
1171 1169
1172 /* Bottom half of Link Quality calculation. */ 1170 /* Bottom half of Link Quality calculation. */
1173 1171
1172 /* Possible race condition: It might be possible that the user
1173 * changed to a different channel in the meantime since we
1174 * started the calculation. We ignore that fact, since it's
1175 * not really that much of a problem. The background noise is
1176 * an estimation only anyway. Slightly wrong results will get damped
1177 * by the averaging of the 8 sample rounds. Additionally the
1178 * value is shortlived. So it will be replaced by the next noise
1179 * calculation round soon. */
1180
1174 B43_WARN_ON(!dev->noisecalc.calculation_running); 1181 B43_WARN_ON(!dev->noisecalc.calculation_running);
1175 if (dev->noisecalc.channel_at_start != phy->channel)
1176 goto drop_calculation;
1177 *((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev)); 1182 *((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev));
1178 if (noise[0] == 0x7F || noise[1] == 0x7F || 1183 if (noise[0] == 0x7F || noise[1] == 0x7F ||
1179 noise[2] == 0x7F || noise[3] == 0x7F) 1184 noise[2] == 0x7F || noise[3] == 0x7F)
@@ -1214,11 +1219,10 @@ static void handle_irq_noise(struct b43_wldev *dev)
1214 average -= 48; 1219 average -= 48;
1215 1220
1216 dev->stats.link_noise = average; 1221 dev->stats.link_noise = average;
1217 drop_calculation:
1218 dev->noisecalc.calculation_running = 0; 1222 dev->noisecalc.calculation_running = 0;
1219 return; 1223 return;
1220 } 1224 }
1221 generate_new: 1225generate_new:
1222 b43_generate_noise_sample(dev); 1226 b43_generate_noise_sample(dev);
1223} 1227}
1224 1228
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig
index ab1029e79884..2d611876bbe0 100644
--- a/drivers/net/wireless/rt2x00/Kconfig
+++ b/drivers/net/wireless/rt2x00/Kconfig
@@ -32,12 +32,13 @@ config RT2X00_LIB_FIRMWARE
32config RT2X00_LIB_RFKILL 32config RT2X00_LIB_RFKILL
33 boolean 33 boolean
34 depends on RT2X00_LIB 34 depends on RT2X00_LIB
35 depends on INPUT
35 select RFKILL 36 select RFKILL
36 select INPUT_POLLDEV 37 select INPUT_POLLDEV
37 38
38config RT2X00_LIB_LEDS 39config RT2X00_LIB_LEDS
39 boolean 40 boolean
40 depends on RT2X00_LIB 41 depends on RT2X00_LIB && NEW_LEDS
41 42
42config RT2400PCI 43config RT2400PCI
43 tristate "Ralink rt2400 pci/pcmcia support" 44 tristate "Ralink rt2400 pci/pcmcia support"
@@ -51,7 +52,7 @@ config RT2400PCI
51 52
52config RT2400PCI_RFKILL 53config RT2400PCI_RFKILL
53 bool "RT2400 rfkill support" 54 bool "RT2400 rfkill support"
54 depends on RT2400PCI 55 depends on RT2400PCI && INPUT
55 select RT2X00_LIB_RFKILL 56 select RT2X00_LIB_RFKILL
56 ---help--- 57 ---help---
57 This adds support for integrated rt2400 devices that feature a 58 This adds support for integrated rt2400 devices that feature a
@@ -60,7 +61,7 @@ config RT2400PCI_RFKILL
60 61
61config RT2400PCI_LEDS 62config RT2400PCI_LEDS
62 bool "RT2400 leds support" 63 bool "RT2400 leds support"
63 depends on RT2400PCI 64 depends on RT2400PCI && NEW_LEDS
64 select LEDS_CLASS 65 select LEDS_CLASS
65 select RT2X00_LIB_LEDS 66 select RT2X00_LIB_LEDS
66 ---help--- 67 ---help---
@@ -78,7 +79,7 @@ config RT2500PCI
78 79
79config RT2500PCI_RFKILL 80config RT2500PCI_RFKILL
80 bool "RT2500 rfkill support" 81 bool "RT2500 rfkill support"
81 depends on RT2500PCI 82 depends on RT2500PCI && INPUT
82 select RT2X00_LIB_RFKILL 83 select RT2X00_LIB_RFKILL
83 ---help--- 84 ---help---
84 This adds support for integrated rt2500 devices that feature a 85 This adds support for integrated rt2500 devices that feature a
@@ -87,7 +88,7 @@ config RT2500PCI_RFKILL
87 88
88config RT2500PCI_LEDS 89config RT2500PCI_LEDS
89 bool "RT2500 leds support" 90 bool "RT2500 leds support"
90 depends on RT2500PCI 91 depends on RT2500PCI && NEW_LEDS
91 select LEDS_CLASS 92 select LEDS_CLASS
92 select RT2X00_LIB_LEDS 93 select RT2X00_LIB_LEDS
93 ---help--- 94 ---help---
@@ -107,7 +108,7 @@ config RT61PCI
107 108
108config RT61PCI_RFKILL 109config RT61PCI_RFKILL
109 bool "RT61 rfkill support" 110 bool "RT61 rfkill support"
110 depends on RT61PCI 111 depends on RT61PCI && INPUT
111 select RT2X00_LIB_RFKILL 112 select RT2X00_LIB_RFKILL
112 ---help--- 113 ---help---
113 This adds support for integrated rt61 devices that feature a 114 This adds support for integrated rt61 devices that feature a
@@ -116,7 +117,7 @@ config RT61PCI_RFKILL
116 117
117config RT61PCI_LEDS 118config RT61PCI_LEDS
118 bool "RT61 leds support" 119 bool "RT61 leds support"
119 depends on RT61PCI 120 depends on RT61PCI && NEW_LEDS
120 select LEDS_CLASS 121 select LEDS_CLASS
121 select RT2X00_LIB_LEDS 122 select RT2X00_LIB_LEDS
122 ---help--- 123 ---help---
@@ -133,7 +134,7 @@ config RT2500USB
133 134
134config RT2500USB_LEDS 135config RT2500USB_LEDS
135 bool "RT2500 leds support" 136 bool "RT2500 leds support"
136 depends on RT2500USB 137 depends on RT2500USB && NEW_LEDS
137 select LEDS_CLASS 138 select LEDS_CLASS
138 select RT2X00_LIB_LEDS 139 select RT2X00_LIB_LEDS
139 ---help--- 140 ---help---
@@ -152,7 +153,7 @@ config RT73USB
152 153
153config RT73USB_LEDS 154config RT73USB_LEDS
154 bool "RT73 leds support" 155 bool "RT73 leds support"
155 depends on RT73USB 156 depends on RT73USB && NEW_LEDS
156 select LEDS_CLASS 157 select LEDS_CLASS
157 select RT2X00_LIB_LEDS 158 select RT2X00_LIB_LEDS
158 ---help--- 159 ---help---
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 971af2546b59..60893de3bf8f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -412,8 +412,7 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
412 if (pci_set_mwi(pci_dev)) 412 if (pci_set_mwi(pci_dev))
413 ERROR_PROBE("MWI not available.\n"); 413 ERROR_PROBE("MWI not available.\n");
414 414
415 if (pci_set_dma_mask(pci_dev, DMA_64BIT_MASK) && 415 if (pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
416 pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
417 ERROR_PROBE("PCI DMA not supported.\n"); 416 ERROR_PROBE("PCI DMA not supported.\n");
418 retval = -EIO; 417 retval = -EIO;
419 goto exit_disable_device; 418 goto exit_disable_device;
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 5a331674dcb2..e5ceae805b57 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -362,6 +362,12 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)
362 } 362 }
363 } 363 }
364 364
365 /*
366 * Kill guardian urb (if required by driver).
367 */
368 if (!test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
369 return;
370
365 for (i = 0; i < rt2x00dev->bcn->limit; i++) { 371 for (i = 0; i < rt2x00dev->bcn->limit; i++) {
366 priv_bcn = rt2x00dev->bcn->entries[i].priv_data; 372 priv_bcn = rt2x00dev->bcn->entries[i].priv_data;
367 usb_kill_urb(priv_bcn->urb); 373 usb_kill_urb(priv_bcn->urb);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index da19a3a91f4d..fff8386e816b 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2131,6 +2131,7 @@ static struct usb_device_id rt73usb_device_table[] = {
2131 /* D-Link */ 2131 /* D-Link */
2132 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, 2132 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) },
2133 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, 2133 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) },
2134 { USB_DEVICE(0x07d1, 0x3c06), USB_DEVICE_DATA(&rt73usb_ops) },
2134 { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) }, 2135 { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) },
2135 /* Gemtek */ 2136 /* Gemtek */
2136 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) }, 2137 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) },