diff options
Diffstat (limited to 'drivers/net')
172 files changed, 2262 insertions, 1784 deletions
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c index c092c3929224..5b91a85fe107 100644 --- a/drivers/net/3c503.c +++ b/drivers/net/3c503.c | |||
@@ -177,6 +177,7 @@ static const struct net_device_ops el2_netdev_ops = { | |||
177 | .ndo_get_stats = eip_get_stats, | 177 | .ndo_get_stats = eip_get_stats, |
178 | .ndo_set_multicast_list = eip_set_multicast_list, | 178 | .ndo_set_multicast_list = eip_set_multicast_list, |
179 | .ndo_validate_addr = eth_validate_addr, | 179 | .ndo_validate_addr = eth_validate_addr, |
180 | .ndo_set_mac_address = eth_mac_addr, | ||
180 | .ndo_change_mtu = eth_change_mtu, | 181 | .ndo_change_mtu = eth_change_mtu, |
181 | #ifdef CONFIG_NET_POLL_CONTROLLER | 182 | #ifdef CONFIG_NET_POLL_CONTROLLER |
182 | .ndo_poll_controller = eip_poll, | 183 | .ndo_poll_controller = eip_poll, |
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 535c234286ea..8c694213035b 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -1475,6 +1475,7 @@ el3_resume(struct device *pdev) | |||
1475 | spin_lock_irqsave(&lp->lock, flags); | 1475 | spin_lock_irqsave(&lp->lock, flags); |
1476 | 1476 | ||
1477 | outw(PowerUp, ioaddr + EL3_CMD); | 1477 | outw(PowerUp, ioaddr + EL3_CMD); |
1478 | EL3WINDOW(0); | ||
1478 | el3_up(dev); | 1479 | el3_up(dev); |
1479 | 1480 | ||
1480 | if (netif_running(dev)) | 1481 | if (netif_running(dev)) |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 665e7fdf27a1..cdbbb6226fc5 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
@@ -3109,6 +3109,8 @@ static void acpi_set_WOL(struct net_device *dev) | |||
3109 | struct vortex_private *vp = netdev_priv(dev); | 3109 | struct vortex_private *vp = netdev_priv(dev); |
3110 | void __iomem *ioaddr = vp->ioaddr; | 3110 | void __iomem *ioaddr = vp->ioaddr; |
3111 | 3111 | ||
3112 | device_set_wakeup_enable(vp->gendev, vp->enable_wol); | ||
3113 | |||
3112 | if (vp->enable_wol) { | 3114 | if (vp->enable_wol) { |
3113 | /* Power up on: 1==Downloaded Filter, 2==Magic Packets, 4==Link Status. */ | 3115 | /* Power up on: 1==Downloaded Filter, 2==Magic Packets, 4==Link Status. */ |
3114 | EL3WINDOW(7); | 3116 | EL3WINDOW(7); |
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index dd7ac8290aec..4e19ae3ce6be 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1821,6 +1821,7 @@ static const struct net_device_ops cp_netdev_ops = { | |||
1821 | .ndo_open = cp_open, | 1821 | .ndo_open = cp_open, |
1822 | .ndo_stop = cp_close, | 1822 | .ndo_stop = cp_close, |
1823 | .ndo_validate_addr = eth_validate_addr, | 1823 | .ndo_validate_addr = eth_validate_addr, |
1824 | .ndo_set_mac_address = eth_mac_addr, | ||
1824 | .ndo_set_multicast_list = cp_set_rx_mode, | 1825 | .ndo_set_multicast_list = cp_set_rx_mode, |
1825 | .ndo_get_stats = cp_get_stats, | 1826 | .ndo_get_stats = cp_get_stats, |
1826 | .ndo_do_ioctl = cp_ioctl, | 1827 | .ndo_do_ioctl = cp_ioctl, |
@@ -1832,6 +1833,7 @@ static const struct net_device_ops cp_netdev_ops = { | |||
1832 | #ifdef BROKEN | 1833 | #ifdef BROKEN |
1833 | .ndo_change_mtu = cp_change_mtu, | 1834 | .ndo_change_mtu = cp_change_mtu, |
1834 | #endif | 1835 | #endif |
1836 | |||
1835 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1837 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1836 | .ndo_poll_controller = cp_poll_controller, | 1838 | .ndo_poll_controller = cp_poll_controller, |
1837 | #endif | 1839 | #endif |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index fe370f805793..a5b24202d564 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -917,6 +917,7 @@ static const struct net_device_ops rtl8139_netdev_ops = { | |||
917 | .ndo_stop = rtl8139_close, | 917 | .ndo_stop = rtl8139_close, |
918 | .ndo_get_stats = rtl8139_get_stats, | 918 | .ndo_get_stats = rtl8139_get_stats, |
919 | .ndo_validate_addr = eth_validate_addr, | 919 | .ndo_validate_addr = eth_validate_addr, |
920 | .ndo_set_mac_address = eth_mac_addr, | ||
920 | .ndo_start_xmit = rtl8139_start_xmit, | 921 | .ndo_start_xmit = rtl8139_start_xmit, |
921 | .ndo_set_multicast_list = rtl8139_set_rx_mode, | 922 | .ndo_set_multicast_list = rtl8139_set_rx_mode, |
922 | .ndo_do_ioctl = netdev_ioctl, | 923 | .ndo_do_ioctl = netdev_ioctl, |
@@ -924,7 +925,6 @@ static const struct net_device_ops rtl8139_netdev_ops = { | |||
924 | #ifdef CONFIG_NET_POLL_CONTROLLER | 925 | #ifdef CONFIG_NET_POLL_CONTROLLER |
925 | .ndo_poll_controller = rtl8139_poll_controller, | 926 | .ndo_poll_controller = rtl8139_poll_controller, |
926 | #endif | 927 | #endif |
927 | |||
928 | }; | 928 | }; |
929 | 929 | ||
930 | static int __devinit rtl8139_init_one (struct pci_dev *pdev, | 930 | static int __devinit rtl8139_init_one (struct pci_dev *pdev, |
diff --git a/drivers/net/8390.c b/drivers/net/8390.c index fbe609a51e02..ec3e22e6306f 100644 --- a/drivers/net/8390.c +++ b/drivers/net/8390.c | |||
@@ -63,6 +63,7 @@ const struct net_device_ops ei_netdev_ops = { | |||
63 | .ndo_get_stats = ei_get_stats, | 63 | .ndo_get_stats = ei_get_stats, |
64 | .ndo_set_multicast_list = ei_set_multicast_list, | 64 | .ndo_set_multicast_list = ei_set_multicast_list, |
65 | .ndo_validate_addr = eth_validate_addr, | 65 | .ndo_validate_addr = eth_validate_addr, |
66 | .ndo_set_mac_address = eth_mac_addr, | ||
66 | .ndo_change_mtu = eth_change_mtu, | 67 | .ndo_change_mtu = eth_change_mtu, |
67 | #ifdef CONFIG_NET_POLL_CONTROLLER | 68 | #ifdef CONFIG_NET_POLL_CONTROLLER |
68 | .ndo_poll_controller = ei_poll, | 69 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/8390p.c b/drivers/net/8390p.c index ee70b358a816..da863c91d1d0 100644 --- a/drivers/net/8390p.c +++ b/drivers/net/8390p.c | |||
@@ -68,6 +68,7 @@ const struct net_device_ops eip_netdev_ops = { | |||
68 | .ndo_get_stats = eip_get_stats, | 68 | .ndo_get_stats = eip_get_stats, |
69 | .ndo_set_multicast_list = eip_set_multicast_list, | 69 | .ndo_set_multicast_list = eip_set_multicast_list, |
70 | .ndo_validate_addr = eth_validate_addr, | 70 | .ndo_validate_addr = eth_validate_addr, |
71 | .ndo_set_mac_address = eth_mac_addr, | ||
71 | .ndo_change_mtu = eth_change_mtu, | 72 | .ndo_change_mtu = eth_change_mtu, |
72 | #ifdef CONFIG_NET_POLL_CONTROLLER | 73 | #ifdef CONFIG_NET_POLL_CONTROLLER |
73 | .ndo_poll_controller = eip_poll, | 74 | .ndo_poll_controller = eip_poll, |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 65afda4a62d9..6bdfd47d679d 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1600,7 +1600,7 @@ config 8139_OLD_RX_RESET | |||
1600 | old RX-reset behavior. If unsure, say N. | 1600 | old RX-reset behavior. If unsure, say N. |
1601 | 1601 | ||
1602 | config R6040 | 1602 | config R6040 |
1603 | tristate "RDC R6040 Fast Ethernet Adapter support (EXPERIMENTAL)" | 1603 | tristate "RDC R6040 Fast Ethernet Adapter support" |
1604 | depends on NET_PCI && PCI | 1604 | depends on NET_PCI && PCI |
1605 | select CRC32 | 1605 | select CRC32 |
1606 | select MII | 1606 | select MII |
@@ -1829,7 +1829,7 @@ config 68360_ENET | |||
1829 | 1829 | ||
1830 | config FEC | 1830 | config FEC |
1831 | bool "FEC ethernet controller (of ColdFire CPUs)" | 1831 | bool "FEC ethernet controller (of ColdFire CPUs)" |
1832 | depends on M523x || M527x || M5272 || M528x || M520x | 1832 | depends on M523x || M527x || M5272 || M528x || M520x || M532x |
1833 | help | 1833 | help |
1834 | Say Y here if you want to use the built-in 10/100 Fast ethernet | 1834 | Say Y here if you want to use the built-in 10/100 Fast ethernet |
1835 | controller on some Motorola ColdFire processors. | 1835 | controller on some Motorola ColdFire processors. |
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 5b396ff6c83f..9589d620639d 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c | |||
@@ -460,6 +460,7 @@ static const struct net_device_ops ace_netdev_ops = { | |||
460 | .ndo_get_stats = ace_get_stats, | 460 | .ndo_get_stats = ace_get_stats, |
461 | .ndo_start_xmit = ace_start_xmit, | 461 | .ndo_start_xmit = ace_start_xmit, |
462 | .ndo_set_multicast_list = ace_set_multicast_list, | 462 | .ndo_set_multicast_list = ace_set_multicast_list, |
463 | .ndo_validate_addr = eth_validate_addr, | ||
463 | .ndo_set_mac_address = ace_set_mac_addr, | 464 | .ndo_set_mac_address = ace_set_mac_addr, |
464 | .ndo_change_mtu = ace_change_mtu, | 465 | .ndo_change_mtu = ace_change_mtu, |
465 | #if ACENIC_DO_VLAN | 466 | #if ACENIC_DO_VLAN |
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c index 0c628a9e5339..c2d012fcc29b 100644 --- a/drivers/net/arm/am79c961a.c +++ b/drivers/net/arm/am79c961a.c | |||
@@ -208,9 +208,9 @@ am79c961_init_for_open(struct net_device *dev) | |||
208 | /* | 208 | /* |
209 | * Stop the chip. | 209 | * Stop the chip. |
210 | */ | 210 | */ |
211 | spin_lock_irqsave(priv->chip_lock, flags); | 211 | spin_lock_irqsave(&priv->chip_lock, flags); |
212 | write_rreg (dev->base_addr, CSR0, CSR0_BABL|CSR0_CERR|CSR0_MISS|CSR0_MERR|CSR0_TINT|CSR0_RINT|CSR0_STOP); | 212 | write_rreg (dev->base_addr, CSR0, CSR0_BABL|CSR0_CERR|CSR0_MISS|CSR0_MERR|CSR0_TINT|CSR0_RINT|CSR0_STOP); |
213 | spin_unlock_irqrestore(priv->chip_lock, flags); | 213 | spin_unlock_irqrestore(&priv->chip_lock, flags); |
214 | 214 | ||
215 | write_ireg (dev->base_addr, 5, 0x00a0); /* Receive address LED */ | 215 | write_ireg (dev->base_addr, 5, 0x00a0); /* Receive address LED */ |
216 | write_ireg (dev->base_addr, 6, 0x0081); /* Collision LED */ | 216 | write_ireg (dev->base_addr, 6, 0x0081); /* Collision LED */ |
@@ -332,10 +332,10 @@ am79c961_close(struct net_device *dev) | |||
332 | netif_stop_queue(dev); | 332 | netif_stop_queue(dev); |
333 | netif_carrier_off(dev); | 333 | netif_carrier_off(dev); |
334 | 334 | ||
335 | spin_lock_irqsave(priv->chip_lock, flags); | 335 | spin_lock_irqsave(&priv->chip_lock, flags); |
336 | write_rreg (dev->base_addr, CSR0, CSR0_STOP); | 336 | write_rreg (dev->base_addr, CSR0, CSR0_STOP); |
337 | write_rreg (dev->base_addr, CSR3, CSR3_MASKALL); | 337 | write_rreg (dev->base_addr, CSR3, CSR3_MASKALL); |
338 | spin_unlock_irqrestore(priv->chip_lock, flags); | 338 | spin_unlock_irqrestore(&priv->chip_lock, flags); |
339 | 339 | ||
340 | free_irq (dev->irq, dev); | 340 | free_irq (dev->irq, dev); |
341 | 341 | ||
@@ -391,7 +391,7 @@ static void am79c961_setmulticastlist (struct net_device *dev) | |||
391 | am79c961_mc_hash(dmi, multi_hash); | 391 | am79c961_mc_hash(dmi, multi_hash); |
392 | } | 392 | } |
393 | 393 | ||
394 | spin_lock_irqsave(priv->chip_lock, flags); | 394 | spin_lock_irqsave(&priv->chip_lock, flags); |
395 | 395 | ||
396 | stopped = read_rreg(dev->base_addr, CSR0) & CSR0_STOP; | 396 | stopped = read_rreg(dev->base_addr, CSR0) & CSR0_STOP; |
397 | 397 | ||
@@ -405,9 +405,9 @@ static void am79c961_setmulticastlist (struct net_device *dev) | |||
405 | * Spin waiting for chip to report suspend mode | 405 | * Spin waiting for chip to report suspend mode |
406 | */ | 406 | */ |
407 | while ((read_rreg(dev->base_addr, CTRL1) & CTRL1_SPND) == 0) { | 407 | while ((read_rreg(dev->base_addr, CTRL1) & CTRL1_SPND) == 0) { |
408 | spin_unlock_irqrestore(priv->chip_lock, flags); | 408 | spin_unlock_irqrestore(&priv->chip_lock, flags); |
409 | nop(); | 409 | nop(); |
410 | spin_lock_irqsave(priv->chip_lock, flags); | 410 | spin_lock_irqsave(&priv->chip_lock, flags); |
411 | } | 411 | } |
412 | } | 412 | } |
413 | 413 | ||
@@ -429,7 +429,7 @@ static void am79c961_setmulticastlist (struct net_device *dev) | |||
429 | write_rreg(dev->base_addr, CTRL1, 0); | 429 | write_rreg(dev->base_addr, CTRL1, 0); |
430 | } | 430 | } |
431 | 431 | ||
432 | spin_unlock_irqrestore(priv->chip_lock, flags); | 432 | spin_unlock_irqrestore(&priv->chip_lock, flags); |
433 | } | 433 | } |
434 | 434 | ||
435 | static void am79c961_timeout(struct net_device *dev) | 435 | static void am79c961_timeout(struct net_device *dev) |
@@ -467,10 +467,10 @@ am79c961_sendpacket(struct sk_buff *skb, struct net_device *dev) | |||
467 | am_writeword (dev, hdraddr + 2, TMD_OWN|TMD_STP|TMD_ENP); | 467 | am_writeword (dev, hdraddr + 2, TMD_OWN|TMD_STP|TMD_ENP); |
468 | priv->txhead = head; | 468 | priv->txhead = head; |
469 | 469 | ||
470 | spin_lock_irqsave(priv->chip_lock, flags); | 470 | spin_lock_irqsave(&priv->chip_lock, flags); |
471 | write_rreg (dev->base_addr, CSR0, CSR0_TDMD|CSR0_IENA); | 471 | write_rreg (dev->base_addr, CSR0, CSR0_TDMD|CSR0_IENA); |
472 | dev->trans_start = jiffies; | 472 | dev->trans_start = jiffies; |
473 | spin_unlock_irqrestore(priv->chip_lock, flags); | 473 | spin_unlock_irqrestore(&priv->chip_lock, flags); |
474 | 474 | ||
475 | /* | 475 | /* |
476 | * If the next packet is owned by the ethernet device, | 476 | * If the next packet is owned by the ethernet device, |
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c index 6278606d1049..54b52e5b1821 100644 --- a/drivers/net/arm/etherh.c +++ b/drivers/net/arm/etherh.c | |||
@@ -646,6 +646,7 @@ static const struct net_device_ops etherh_netdev_ops = { | |||
646 | .ndo_get_stats = ei_get_stats, | 646 | .ndo_get_stats = ei_get_stats, |
647 | .ndo_set_multicast_list = ei_set_multicast_list, | 647 | .ndo_set_multicast_list = ei_set_multicast_list, |
648 | .ndo_validate_addr = eth_validate_addr, | 648 | .ndo_validate_addr = eth_validate_addr, |
649 | .ndo_set_mac_address = eth_mac_addr, | ||
649 | .ndo_change_mtu = eth_change_mtu, | 650 | .ndo_change_mtu = eth_change_mtu, |
650 | #ifdef CONFIG_NET_POLL_CONTROLLER | 651 | #ifdef CONFIG_NET_POLL_CONTROLLER |
651 | .ndo_poll_controller = ei_poll, | 652 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/arm/ks8695net.c b/drivers/net/arm/ks8695net.c index 9ad22d1b00fd..1cf2f949c0b4 100644 --- a/drivers/net/arm/ks8695net.c +++ b/drivers/net/arm/ks8695net.c | |||
@@ -1357,6 +1357,7 @@ static const struct net_device_ops ks8695_netdev_ops = { | |||
1357 | .ndo_start_xmit = ks8695_start_xmit, | 1357 | .ndo_start_xmit = ks8695_start_xmit, |
1358 | .ndo_tx_timeout = ks8695_timeout, | 1358 | .ndo_tx_timeout = ks8695_timeout, |
1359 | .ndo_set_mac_address = ks8695_set_mac, | 1359 | .ndo_set_mac_address = ks8695_set_mac, |
1360 | .ndo_validate_addr = eth_validate_addr, | ||
1360 | .ndo_set_multicast_list = ks8695_set_multicast, | 1361 | .ndo_set_multicast_list = ks8695_set_multicast, |
1361 | }; | 1362 | }; |
1362 | 1363 | ||
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c index 337488ec707c..a4eb6c40678c 100644 --- a/drivers/net/ax88796.c +++ b/drivers/net/ax88796.c | |||
@@ -37,7 +37,10 @@ static int phy_debug = 0; | |||
37 | #define __ei_open ax_ei_open | 37 | #define __ei_open ax_ei_open |
38 | #define __ei_close ax_ei_close | 38 | #define __ei_close ax_ei_close |
39 | #define __ei_poll ax_ei_poll | 39 | #define __ei_poll ax_ei_poll |
40 | #define __ei_start_xmit ax_ei_start_xmit | ||
40 | #define __ei_tx_timeout ax_ei_tx_timeout | 41 | #define __ei_tx_timeout ax_ei_tx_timeout |
42 | #define __ei_get_stats ax_ei_get_stats | ||
43 | #define __ei_set_multicast_list ax_ei_set_multicast_list | ||
41 | #define __ei_interrupt ax_ei_interrupt | 44 | #define __ei_interrupt ax_ei_interrupt |
42 | #define ____alloc_ei_netdev ax__alloc_ei_netdev | 45 | #define ____alloc_ei_netdev ax__alloc_ei_netdev |
43 | #define __NS8390_init ax_NS8390_init | 46 | #define __NS8390_init ax_NS8390_init |
@@ -623,6 +626,23 @@ static void ax_eeprom_register_write(struct eeprom_93cx6 *eeprom) | |||
623 | } | 626 | } |
624 | #endif | 627 | #endif |
625 | 628 | ||
629 | static const struct net_device_ops ax_netdev_ops = { | ||
630 | .ndo_open = ax_open, | ||
631 | .ndo_stop = ax_close, | ||
632 | .ndo_do_ioctl = ax_ioctl, | ||
633 | |||
634 | .ndo_start_xmit = ax_ei_start_xmit, | ||
635 | .ndo_tx_timeout = ax_ei_tx_timeout, | ||
636 | .ndo_get_stats = ax_ei_get_stats, | ||
637 | .ndo_set_multicast_list = ax_ei_set_multicast_list, | ||
638 | .ndo_validate_addr = eth_validate_addr, | ||
639 | .ndo_set_mac_address = eth_mac_addr, | ||
640 | .ndo_change_mtu = eth_change_mtu, | ||
641 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
642 | .ndo_poll_controller = ax_ei_poll, | ||
643 | #endif | ||
644 | }; | ||
645 | |||
626 | /* setup code */ | 646 | /* setup code */ |
627 | 647 | ||
628 | static void ax_initial_setup(struct net_device *dev, struct ei_device *ei_local) | 648 | static void ax_initial_setup(struct net_device *dev, struct ei_device *ei_local) |
@@ -738,9 +758,7 @@ static int ax_init_dev(struct net_device *dev, int first_init) | |||
738 | ei_status.get_8390_hdr = &ax_get_8390_hdr; | 758 | ei_status.get_8390_hdr = &ax_get_8390_hdr; |
739 | ei_status.priv = 0; | 759 | ei_status.priv = 0; |
740 | 760 | ||
741 | dev->open = ax_open; | 761 | dev->netdev_ops = &ax_netdev_ops; |
742 | dev->stop = ax_close; | ||
743 | dev->do_ioctl = ax_ioctl; | ||
744 | dev->ethtool_ops = &ax_ethtool_ops; | 762 | dev->ethtool_ops = &ax_ethtool_ops; |
745 | 763 | ||
746 | ax->msg_enable = NETIF_MSG_LINK; | 764 | ax->msg_enable = NETIF_MSG_LINK; |
@@ -753,9 +771,6 @@ static int ax_init_dev(struct net_device *dev, int first_init) | |||
753 | ax->mii.mdio_write = ax_phy_write; | 771 | ax->mii.mdio_write = ax_phy_write; |
754 | ax->mii.dev = dev; | 772 | ax->mii.dev = dev; |
755 | 773 | ||
756 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
757 | dev->poll_controller = ax_ei_poll; | ||
758 | #endif | ||
759 | ax_NS8390_init(dev, 0); | 774 | ax_NS8390_init(dev, 0); |
760 | 775 | ||
761 | if (first_init) | 776 | if (first_init) |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 6926ebedfdc9..c38512ebcea6 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -73,8 +73,8 @@ | |||
73 | (BP)->tx_cons - (BP)->tx_prod - TX_RING_GAP(BP)) | 73 | (BP)->tx_cons - (BP)->tx_prod - TX_RING_GAP(BP)) |
74 | #define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1)) | 74 | #define NEXT_TX(N) (((N) + 1) & (B44_TX_RING_SIZE - 1)) |
75 | 75 | ||
76 | #define RX_PKT_OFFSET 30 | 76 | #define RX_PKT_OFFSET (RX_HEADER_LEN + 2) |
77 | #define RX_PKT_BUF_SZ (1536 + RX_PKT_OFFSET + 64) | 77 | #define RX_PKT_BUF_SZ (1536 + RX_PKT_OFFSET) |
78 | 78 | ||
79 | /* minimum number of free TX descriptors required to wake up TX process */ | 79 | /* minimum number of free TX descriptors required to wake up TX process */ |
80 | #define B44_TX_WAKEUP_THRESH (B44_TX_RING_SIZE / 4) | 80 | #define B44_TX_WAKEUP_THRESH (B44_TX_RING_SIZE / 4) |
@@ -679,10 +679,10 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
679 | dev_kfree_skb_any(skb); | 679 | dev_kfree_skb_any(skb); |
680 | return -ENOMEM; | 680 | return -ENOMEM; |
681 | } | 681 | } |
682 | bp->force_copybreak = 1; | ||
682 | } | 683 | } |
683 | 684 | ||
684 | rh = (struct rx_header *) skb->data; | 685 | rh = (struct rx_header *) skb->data; |
685 | skb_reserve(skb, RX_PKT_OFFSET); | ||
686 | 686 | ||
687 | rh->len = 0; | 687 | rh->len = 0; |
688 | rh->flags = 0; | 688 | rh->flags = 0; |
@@ -693,13 +693,13 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
693 | if (src_map != NULL) | 693 | if (src_map != NULL) |
694 | src_map->skb = NULL; | 694 | src_map->skb = NULL; |
695 | 695 | ||
696 | ctrl = (DESC_CTRL_LEN & (RX_PKT_BUF_SZ - RX_PKT_OFFSET)); | 696 | ctrl = (DESC_CTRL_LEN & RX_PKT_BUF_SZ); |
697 | if (dest_idx == (B44_RX_RING_SIZE - 1)) | 697 | if (dest_idx == (B44_RX_RING_SIZE - 1)) |
698 | ctrl |= DESC_CTRL_EOT; | 698 | ctrl |= DESC_CTRL_EOT; |
699 | 699 | ||
700 | dp = &bp->rx_ring[dest_idx]; | 700 | dp = &bp->rx_ring[dest_idx]; |
701 | dp->ctrl = cpu_to_le32(ctrl); | 701 | dp->ctrl = cpu_to_le32(ctrl); |
702 | dp->addr = cpu_to_le32((u32) mapping + RX_PKT_OFFSET + bp->dma_offset); | 702 | dp->addr = cpu_to_le32((u32) mapping + bp->dma_offset); |
703 | 703 | ||
704 | if (bp->flags & B44_FLAG_RX_RING_HACK) | 704 | if (bp->flags & B44_FLAG_RX_RING_HACK) |
705 | b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, | 705 | b44_sync_dma_desc_for_device(bp->sdev, bp->rx_ring_dma, |
@@ -801,7 +801,7 @@ static int b44_rx(struct b44 *bp, int budget) | |||
801 | /* Omit CRC. */ | 801 | /* Omit CRC. */ |
802 | len -= 4; | 802 | len -= 4; |
803 | 803 | ||
804 | if (len > RX_COPY_THRESHOLD) { | 804 | if (!bp->force_copybreak && len > RX_COPY_THRESHOLD) { |
805 | int skb_size; | 805 | int skb_size; |
806 | skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod); | 806 | skb_size = b44_alloc_rx_skb(bp, cons, bp->rx_prod); |
807 | if (skb_size < 0) | 807 | if (skb_size < 0) |
@@ -809,8 +809,8 @@ static int b44_rx(struct b44 *bp, int budget) | |||
809 | ssb_dma_unmap_single(bp->sdev, map, | 809 | ssb_dma_unmap_single(bp->sdev, map, |
810 | skb_size, DMA_FROM_DEVICE); | 810 | skb_size, DMA_FROM_DEVICE); |
811 | /* Leave out rx_header */ | 811 | /* Leave out rx_header */ |
812 | skb_put(skb, len + RX_PKT_OFFSET); | 812 | skb_put(skb, len + RX_PKT_OFFSET); |
813 | skb_pull(skb, RX_PKT_OFFSET); | 813 | skb_pull(skb, RX_PKT_OFFSET); |
814 | } else { | 814 | } else { |
815 | struct sk_buff *copy_skb; | 815 | struct sk_buff *copy_skb; |
816 | 816 | ||
@@ -2153,6 +2153,7 @@ static int __devinit b44_init_one(struct ssb_device *sdev, | |||
2153 | bp = netdev_priv(dev); | 2153 | bp = netdev_priv(dev); |
2154 | bp->sdev = sdev; | 2154 | bp->sdev = sdev; |
2155 | bp->dev = dev; | 2155 | bp->dev = dev; |
2156 | bp->force_copybreak = 0; | ||
2156 | 2157 | ||
2157 | bp->msg_enable = netif_msg_init(b44_debug, B44_DEF_MSG_ENABLE); | 2158 | bp->msg_enable = netif_msg_init(b44_debug, B44_DEF_MSG_ENABLE); |
2158 | 2159 | ||
diff --git a/drivers/net/b44.h b/drivers/net/b44.h index 7db0c84a7950..e678498de6db 100644 --- a/drivers/net/b44.h +++ b/drivers/net/b44.h | |||
@@ -395,7 +395,7 @@ struct b44 { | |||
395 | u32 rx_pending; | 395 | u32 rx_pending; |
396 | u32 tx_pending; | 396 | u32 tx_pending; |
397 | u8 phy_addr; | 397 | u8 phy_addr; |
398 | 398 | u8 force_copybreak; | |
399 | struct mii_if_info mii_if; | 399 | struct mii_if_info mii_if; |
400 | }; | 400 | }; |
401 | 401 | ||
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index fd705d1295a7..15a5cf0f676b 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* bnx2x.h: Broadcom Everest network driver. | 1 | /* bnx2x.h: Broadcom Everest network driver. |
2 | * | 2 | * |
3 | * Copyright (c) 2007-2008 Broadcom Corporation | 3 | * Copyright (c) 2007-2009 Broadcom Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -20,6 +20,11 @@ | |||
20 | * (you will need to reboot afterwards) */ | 20 | * (you will need to reboot afterwards) */ |
21 | /* #define BNX2X_STOP_ON_ERROR */ | 21 | /* #define BNX2X_STOP_ON_ERROR */ |
22 | 22 | ||
23 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
24 | #define BCM_VLAN 1 | ||
25 | #endif | ||
26 | |||
27 | |||
23 | /* error/debug prints */ | 28 | /* error/debug prints */ |
24 | 29 | ||
25 | #define DRV_MODULE_NAME "bnx2x" | 30 | #define DRV_MODULE_NAME "bnx2x" |
@@ -78,11 +83,6 @@ | |||
78 | #endif | 83 | #endif |
79 | 84 | ||
80 | 85 | ||
81 | #ifdef NETIF_F_HW_VLAN_TX | ||
82 | #define BCM_VLAN 1 | ||
83 | #endif | ||
84 | |||
85 | |||
86 | #define U64_LO(x) (u32)(((u64)(x)) & 0xffffffff) | 86 | #define U64_LO(x) (u32)(((u64)(x)) & 0xffffffff) |
87 | #define U64_HI(x) (u32)(((u64)(x)) >> 32) | 87 | #define U64_HI(x) (u32)(((u64)(x)) >> 32) |
88 | #define HILO_U64(hi, lo) ((((u64)(hi)) << 32) + (lo)) | 88 | #define HILO_U64(hi, lo) ((((u64)(hi)) << 32) + (lo)) |
@@ -150,6 +150,9 @@ struct sw_rx_page { | |||
150 | 150 | ||
151 | #define PAGES_PER_SGE_SHIFT 0 | 151 | #define PAGES_PER_SGE_SHIFT 0 |
152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) | 152 | #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) |
153 | #define SGE_PAGE_SIZE PAGE_SIZE | ||
154 | #define SGE_PAGE_SHIFT PAGE_SHIFT | ||
155 | #define SGE_PAGE_ALIGN(addr) PAGE_ALIGN(addr) | ||
153 | 156 | ||
154 | #define BCM_RX_ETH_PAYLOAD_ALIGN 64 | 157 | #define BCM_RX_ETH_PAYLOAD_ALIGN 64 |
155 | 158 | ||
@@ -268,14 +271,7 @@ struct bnx2x_fastpath { | |||
268 | 271 | ||
269 | #define bnx2x_fp(bp, nr, var) (bp->fp[nr].var) | 272 | #define bnx2x_fp(bp, nr, var) (bp->fp[nr].var) |
270 | 273 | ||
271 | #define BNX2X_HAS_TX_WORK(fp) \ | 274 | #define BNX2X_HAS_WORK(fp) (bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp)) |
272 | ((fp->tx_pkt_prod != le16_to_cpu(*fp->tx_cons_sb)) || \ | ||
273 | (fp->tx_pkt_prod != fp->tx_pkt_cons)) | ||
274 | |||
275 | #define BNX2X_HAS_RX_WORK(fp) \ | ||
276 | (fp->rx_comp_cons != rx_cons_sb) | ||
277 | |||
278 | #define BNX2X_HAS_WORK(fp) (BNX2X_HAS_RX_WORK(fp) || BNX2X_HAS_TX_WORK(fp)) | ||
279 | 275 | ||
280 | 276 | ||
281 | /* MC hsi */ | 277 | /* MC hsi */ |
@@ -736,7 +732,7 @@ struct bnx2x { | |||
736 | struct bnx2x_fastpath fp[MAX_CONTEXT]; | 732 | struct bnx2x_fastpath fp[MAX_CONTEXT]; |
737 | void __iomem *regview; | 733 | void __iomem *regview; |
738 | void __iomem *doorbells; | 734 | void __iomem *doorbells; |
739 | #define BNX2X_DB_SIZE (16*2048) | 735 | #define BNX2X_DB_SIZE (16*BCM_PAGE_SIZE) |
740 | 736 | ||
741 | struct net_device *dev; | 737 | struct net_device *dev; |
742 | struct pci_dev *pdev; | 738 | struct pci_dev *pdev; |
@@ -801,6 +797,8 @@ struct bnx2x { | |||
801 | #define TPA_ENABLE_FLAG 0x80 | 797 | #define TPA_ENABLE_FLAG 0x80 |
802 | #define NO_MCP_FLAG 0x100 | 798 | #define NO_MCP_FLAG 0x100 |
803 | #define BP_NOMCP(bp) (bp->flags & NO_MCP_FLAG) | 799 | #define BP_NOMCP(bp) (bp->flags & NO_MCP_FLAG) |
800 | #define HW_VLAN_TX_FLAG 0x400 | ||
801 | #define HW_VLAN_RX_FLAG 0x800 | ||
804 | 802 | ||
805 | int func; | 803 | int func; |
806 | #define BP_PORT(bp) (bp->func % PORT_MAX) | 804 | #define BP_PORT(bp) (bp->func % PORT_MAX) |
@@ -811,7 +809,7 @@ struct bnx2x { | |||
811 | int pm_cap; | 809 | int pm_cap; |
812 | int pcie_cap; | 810 | int pcie_cap; |
813 | 811 | ||
814 | struct work_struct sp_task; | 812 | struct delayed_work sp_task; |
815 | struct work_struct reset_task; | 813 | struct work_struct reset_task; |
816 | 814 | ||
817 | struct timer_list timer; | 815 | struct timer_list timer; |
diff --git a/drivers/net/bnx2x_link.c b/drivers/net/bnx2x_link.c index fefa6ab13064..aea26b4dc453 100644 --- a/drivers/net/bnx2x_link.c +++ b/drivers/net/bnx2x_link.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Copyright 2008 Broadcom Corporation | 1 | /* Copyright 2008-2009 Broadcom Corporation |
2 | * | 2 | * |
3 | * Unless you and Broadcom execute a separate written software license | 3 | * Unless you and Broadcom execute a separate written software license |
4 | * agreement governing use of this software, this software is licensed to you | 4 | * agreement governing use of this software, this software is licensed to you |
@@ -317,6 +317,9 @@ static u8 bnx2x_emac_enable(struct link_params *params, | |||
317 | val &= ~0x810; | 317 | val &= ~0x810; |
318 | EMAC_WR(bp, EMAC_REG_EMAC_MODE, val); | 318 | EMAC_WR(bp, EMAC_REG_EMAC_MODE, val); |
319 | 319 | ||
320 | /* enable emac */ | ||
321 | REG_WR(bp, NIG_REG_NIG_EMAC0_EN + port*4, 1); | ||
322 | |||
320 | /* enable emac for jumbo packets */ | 323 | /* enable emac for jumbo packets */ |
321 | EMAC_WR(bp, EMAC_REG_EMAC_RX_MTU_SIZE, | 324 | EMAC_WR(bp, EMAC_REG_EMAC_RX_MTU_SIZE, |
322 | (EMAC_RX_MTU_SIZE_JUMBO_ENA | | 325 | (EMAC_RX_MTU_SIZE_JUMBO_ENA | |
@@ -1609,7 +1612,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1609 | u32 gp_status) | 1612 | u32 gp_status) |
1610 | { | 1613 | { |
1611 | struct bnx2x *bp = params->bp; | 1614 | struct bnx2x *bp = params->bp; |
1612 | 1615 | u16 new_line_speed; | |
1613 | u8 rc = 0; | 1616 | u8 rc = 0; |
1614 | vars->link_status = 0; | 1617 | vars->link_status = 0; |
1615 | 1618 | ||
@@ -1629,7 +1632,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1629 | 1632 | ||
1630 | switch (gp_status & GP_STATUS_SPEED_MASK) { | 1633 | switch (gp_status & GP_STATUS_SPEED_MASK) { |
1631 | case GP_STATUS_10M: | 1634 | case GP_STATUS_10M: |
1632 | vars->line_speed = SPEED_10; | 1635 | new_line_speed = SPEED_10; |
1633 | if (vars->duplex == DUPLEX_FULL) | 1636 | if (vars->duplex == DUPLEX_FULL) |
1634 | vars->link_status |= LINK_10TFD; | 1637 | vars->link_status |= LINK_10TFD; |
1635 | else | 1638 | else |
@@ -1637,7 +1640,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1637 | break; | 1640 | break; |
1638 | 1641 | ||
1639 | case GP_STATUS_100M: | 1642 | case GP_STATUS_100M: |
1640 | vars->line_speed = SPEED_100; | 1643 | new_line_speed = SPEED_100; |
1641 | if (vars->duplex == DUPLEX_FULL) | 1644 | if (vars->duplex == DUPLEX_FULL) |
1642 | vars->link_status |= LINK_100TXFD; | 1645 | vars->link_status |= LINK_100TXFD; |
1643 | else | 1646 | else |
@@ -1646,7 +1649,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1646 | 1649 | ||
1647 | case GP_STATUS_1G: | 1650 | case GP_STATUS_1G: |
1648 | case GP_STATUS_1G_KX: | 1651 | case GP_STATUS_1G_KX: |
1649 | vars->line_speed = SPEED_1000; | 1652 | new_line_speed = SPEED_1000; |
1650 | if (vars->duplex == DUPLEX_FULL) | 1653 | if (vars->duplex == DUPLEX_FULL) |
1651 | vars->link_status |= LINK_1000TFD; | 1654 | vars->link_status |= LINK_1000TFD; |
1652 | else | 1655 | else |
@@ -1654,7 +1657,7 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1654 | break; | 1657 | break; |
1655 | 1658 | ||
1656 | case GP_STATUS_2_5G: | 1659 | case GP_STATUS_2_5G: |
1657 | vars->line_speed = SPEED_2500; | 1660 | new_line_speed = SPEED_2500; |
1658 | if (vars->duplex == DUPLEX_FULL) | 1661 | if (vars->duplex == DUPLEX_FULL) |
1659 | vars->link_status |= LINK_2500TFD; | 1662 | vars->link_status |= LINK_2500TFD; |
1660 | else | 1663 | else |
@@ -1671,32 +1674,32 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1671 | case GP_STATUS_10G_KX4: | 1674 | case GP_STATUS_10G_KX4: |
1672 | case GP_STATUS_10G_HIG: | 1675 | case GP_STATUS_10G_HIG: |
1673 | case GP_STATUS_10G_CX4: | 1676 | case GP_STATUS_10G_CX4: |
1674 | vars->line_speed = SPEED_10000; | 1677 | new_line_speed = SPEED_10000; |
1675 | vars->link_status |= LINK_10GTFD; | 1678 | vars->link_status |= LINK_10GTFD; |
1676 | break; | 1679 | break; |
1677 | 1680 | ||
1678 | case GP_STATUS_12G_HIG: | 1681 | case GP_STATUS_12G_HIG: |
1679 | vars->line_speed = SPEED_12000; | 1682 | new_line_speed = SPEED_12000; |
1680 | vars->link_status |= LINK_12GTFD; | 1683 | vars->link_status |= LINK_12GTFD; |
1681 | break; | 1684 | break; |
1682 | 1685 | ||
1683 | case GP_STATUS_12_5G: | 1686 | case GP_STATUS_12_5G: |
1684 | vars->line_speed = SPEED_12500; | 1687 | new_line_speed = SPEED_12500; |
1685 | vars->link_status |= LINK_12_5GTFD; | 1688 | vars->link_status |= LINK_12_5GTFD; |
1686 | break; | 1689 | break; |
1687 | 1690 | ||
1688 | case GP_STATUS_13G: | 1691 | case GP_STATUS_13G: |
1689 | vars->line_speed = SPEED_13000; | 1692 | new_line_speed = SPEED_13000; |
1690 | vars->link_status |= LINK_13GTFD; | 1693 | vars->link_status |= LINK_13GTFD; |
1691 | break; | 1694 | break; |
1692 | 1695 | ||
1693 | case GP_STATUS_15G: | 1696 | case GP_STATUS_15G: |
1694 | vars->line_speed = SPEED_15000; | 1697 | new_line_speed = SPEED_15000; |
1695 | vars->link_status |= LINK_15GTFD; | 1698 | vars->link_status |= LINK_15GTFD; |
1696 | break; | 1699 | break; |
1697 | 1700 | ||
1698 | case GP_STATUS_16G: | 1701 | case GP_STATUS_16G: |
1699 | vars->line_speed = SPEED_16000; | 1702 | new_line_speed = SPEED_16000; |
1700 | vars->link_status |= LINK_16GTFD; | 1703 | vars->link_status |= LINK_16GTFD; |
1701 | break; | 1704 | break; |
1702 | 1705 | ||
@@ -1708,6 +1711,15 @@ static u8 bnx2x_link_settings_status(struct link_params *params, | |||
1708 | break; | 1711 | break; |
1709 | } | 1712 | } |
1710 | 1713 | ||
1714 | /* Upon link speed change set the NIG into drain mode. | ||
1715 | Comes to deals with possible FIFO glitch due to clk change | ||
1716 | when speed is decreased without link down indicator */ | ||
1717 | if (new_line_speed != vars->line_speed) { | ||
1718 | REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE | ||
1719 | + params->port*4, 0); | ||
1720 | msleep(1); | ||
1721 | } | ||
1722 | vars->line_speed = new_line_speed; | ||
1711 | vars->link_status |= LINK_STATUS_SERDES_LINK; | 1723 | vars->link_status |= LINK_STATUS_SERDES_LINK; |
1712 | 1724 | ||
1713 | if ((params->req_line_speed == SPEED_AUTO_NEG) && | 1725 | if ((params->req_line_speed == SPEED_AUTO_NEG) && |
@@ -3571,7 +3583,7 @@ static void bnx2x_set_xgxs_loopback(struct link_params *params, | |||
3571 | (MDIO_REG_BANK_CL73_IEEEB0 + | 3583 | (MDIO_REG_BANK_CL73_IEEEB0 + |
3572 | (MDIO_CL73_IEEEB0_CL73_AN_CONTROL & 0xf)), | 3584 | (MDIO_CL73_IEEEB0_CL73_AN_CONTROL & 0xf)), |
3573 | 0x6041); | 3585 | 0x6041); |
3574 | 3586 | msleep(200); | |
3575 | /* set aer mmd back */ | 3587 | /* set aer mmd back */ |
3576 | bnx2x_set_aer_mmd(params, vars); | 3588 | bnx2x_set_aer_mmd(params, vars); |
3577 | 3589 | ||
@@ -3870,9 +3882,15 @@ static u8 bnx2x_link_initialize(struct link_params *params, | |||
3870 | } | 3882 | } |
3871 | 3883 | ||
3872 | if (vars->phy_flags & PHY_XGXS_FLAG) { | 3884 | if (vars->phy_flags & PHY_XGXS_FLAG) { |
3873 | if (params->req_line_speed && | 3885 | if ((params->req_line_speed && |
3874 | ((params->req_line_speed == SPEED_100) || | 3886 | ((params->req_line_speed == SPEED_100) || |
3875 | (params->req_line_speed == SPEED_10))) { | 3887 | (params->req_line_speed == SPEED_10))) || |
3888 | (!params->req_line_speed && | ||
3889 | (params->speed_cap_mask >= | ||
3890 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) && | ||
3891 | (params->speed_cap_mask < | ||
3892 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G) | ||
3893 | )) { | ||
3876 | vars->phy_flags |= PHY_SGMII_FLAG; | 3894 | vars->phy_flags |= PHY_SGMII_FLAG; |
3877 | } else { | 3895 | } else { |
3878 | vars->phy_flags &= ~PHY_SGMII_FLAG; | 3896 | vars->phy_flags &= ~PHY_SGMII_FLAG; |
@@ -4194,6 +4212,11 @@ static u8 bnx2x_update_link_down(struct link_params *params, | |||
4194 | /* activate nig drain */ | 4212 | /* activate nig drain */ |
4195 | REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + port*4, 1); | 4213 | REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + port*4, 1); |
4196 | 4214 | ||
4215 | /* disable emac */ | ||
4216 | REG_WR(bp, NIG_REG_NIG_EMAC0_EN + port*4, 0); | ||
4217 | |||
4218 | msleep(10); | ||
4219 | |||
4197 | /* reset BigMac */ | 4220 | /* reset BigMac */ |
4198 | bnx2x_bmac_rx_disable(bp, params->port); | 4221 | bnx2x_bmac_rx_disable(bp, params->port); |
4199 | REG_WR(bp, GRCBASE_MISC + | 4222 | REG_WR(bp, GRCBASE_MISC + |
@@ -4238,6 +4261,7 @@ static u8 bnx2x_update_link_up(struct link_params *params, | |||
4238 | 4261 | ||
4239 | /* update shared memory */ | 4262 | /* update shared memory */ |
4240 | bnx2x_update_mng(params, vars->link_status); | 4263 | bnx2x_update_mng(params, vars->link_status); |
4264 | msleep(20); | ||
4241 | return rc; | 4265 | return rc; |
4242 | } | 4266 | } |
4243 | /* This function should called upon link interrupt */ | 4267 | /* This function should called upon link interrupt */ |
@@ -4276,6 +4300,9 @@ u8 bnx2x_link_update(struct link_params *params, struct link_vars *vars) | |||
4276 | REG_RD(bp, NIG_REG_XGXS0_STATUS_LINK10G + port*0x68), | 4300 | REG_RD(bp, NIG_REG_XGXS0_STATUS_LINK10G + port*0x68), |
4277 | REG_RD(bp, NIG_REG_XGXS0_STATUS_LINK_STATUS + port*0x68)); | 4301 | REG_RD(bp, NIG_REG_XGXS0_STATUS_LINK_STATUS + port*0x68)); |
4278 | 4302 | ||
4303 | /* disable emac */ | ||
4304 | REG_WR(bp, NIG_REG_NIG_EMAC0_EN + port*4, 0); | ||
4305 | |||
4279 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 4306 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
4280 | 4307 | ||
4281 | /* Check external link change only for non-direct */ | 4308 | /* Check external link change only for non-direct */ |
@@ -4377,10 +4404,11 @@ static u8 bnx2x_8073_common_init_phy(struct bnx2x *bp, u32 shmem_base) | |||
4377 | ext_phy_addr[port], | 4404 | ext_phy_addr[port], |
4378 | MDIO_PMA_DEVAD, | 4405 | MDIO_PMA_DEVAD, |
4379 | MDIO_PMA_REG_ROM_VER1, &fw_ver1); | 4406 | MDIO_PMA_REG_ROM_VER1, &fw_ver1); |
4380 | if (fw_ver1 == 0) { | 4407 | if (fw_ver1 == 0 || fw_ver1 == 0x4321) { |
4381 | DP(NETIF_MSG_LINK, | 4408 | DP(NETIF_MSG_LINK, |
4382 | "bnx2x_8073_common_init_phy port %x " | 4409 | "bnx2x_8073_common_init_phy port %x:" |
4383 | "fw Download failed\n", port); | 4410 | "Download failed. fw version = 0x%x\n", |
4411 | port, fw_ver1); | ||
4384 | return -EINVAL; | 4412 | return -EINVAL; |
4385 | } | 4413 | } |
4386 | 4414 | ||
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 4be05847f86f..d3e7775a9ccf 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* bnx2x_main.c: Broadcom Everest network driver. | 1 | /* bnx2x_main.c: Broadcom Everest network driver. |
2 | * | 2 | * |
3 | * Copyright (c) 2007-2008 Broadcom Corporation | 3 | * Copyright (c) 2007-2009 Broadcom Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
@@ -38,9 +38,7 @@ | |||
38 | #include <linux/time.h> | 38 | #include <linux/time.h> |
39 | #include <linux/ethtool.h> | 39 | #include <linux/ethtool.h> |
40 | #include <linux/mii.h> | 40 | #include <linux/mii.h> |
41 | #ifdef NETIF_F_HW_VLAN_TX | 41 | #include <linux/if_vlan.h> |
42 | #include <linux/if_vlan.h> | ||
43 | #endif | ||
44 | #include <net/ip.h> | 42 | #include <net/ip.h> |
45 | #include <net/tcp.h> | 43 | #include <net/tcp.h> |
46 | #include <net/checksum.h> | 44 | #include <net/checksum.h> |
@@ -59,8 +57,8 @@ | |||
59 | #include "bnx2x.h" | 57 | #include "bnx2x.h" |
60 | #include "bnx2x_init.h" | 58 | #include "bnx2x_init.h" |
61 | 59 | ||
62 | #define DRV_MODULE_VERSION "1.45.23" | 60 | #define DRV_MODULE_VERSION "1.45.26" |
63 | #define DRV_MODULE_RELDATE "2008/11/03" | 61 | #define DRV_MODULE_RELDATE "2009/01/26" |
64 | #define BNX2X_BC_VER 0x040200 | 62 | #define BNX2X_BC_VER 0x040200 |
65 | 63 | ||
66 | /* Time in jiffies before concluding the transmitter is hung */ | 64 | /* Time in jiffies before concluding the transmitter is hung */ |
@@ -71,7 +69,7 @@ static char version[] __devinitdata = | |||
71 | DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; | 69 | DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; |
72 | 70 | ||
73 | MODULE_AUTHOR("Eliezer Tamir"); | 71 | MODULE_AUTHOR("Eliezer Tamir"); |
74 | MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710 Driver"); | 72 | MODULE_DESCRIPTION("Broadcom NetXtreme II BCM57710/57711/57711E Driver"); |
75 | MODULE_LICENSE("GPL"); | 73 | MODULE_LICENSE("GPL"); |
76 | MODULE_VERSION(DRV_MODULE_VERSION); | 74 | MODULE_VERSION(DRV_MODULE_VERSION); |
77 | 75 | ||
@@ -95,6 +93,7 @@ MODULE_PARM_DESC(debug, "default debug msglevel"); | |||
95 | module_param(use_multi, int, 0); | 93 | module_param(use_multi, int, 0); |
96 | MODULE_PARM_DESC(use_multi, "use per-CPU queues"); | 94 | MODULE_PARM_DESC(use_multi, "use per-CPU queues"); |
97 | #endif | 95 | #endif |
96 | static struct workqueue_struct *bnx2x_wq; | ||
98 | 97 | ||
99 | enum bnx2x_board_type { | 98 | enum bnx2x_board_type { |
100 | BCM57710 = 0, | 99 | BCM57710 = 0, |
@@ -671,7 +670,8 @@ static void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw) | |||
671 | synchronize_irq(bp->pdev->irq); | 670 | synchronize_irq(bp->pdev->irq); |
672 | 671 | ||
673 | /* make sure sp_task is not running */ | 672 | /* make sure sp_task is not running */ |
674 | cancel_work_sync(&bp->sp_task); | 673 | cancel_delayed_work(&bp->sp_task); |
674 | flush_workqueue(bnx2x_wq); | ||
675 | } | 675 | } |
676 | 676 | ||
677 | /* fast path */ | 677 | /* fast path */ |
@@ -733,6 +733,24 @@ static u16 bnx2x_ack_int(struct bnx2x *bp) | |||
733 | * fast path service functions | 733 | * fast path service functions |
734 | */ | 734 | */ |
735 | 735 | ||
736 | static inline int bnx2x_has_tx_work(struct bnx2x_fastpath *fp) | ||
737 | { | ||
738 | u16 tx_cons_sb; | ||
739 | |||
740 | /* Tell compiler that status block fields can change */ | ||
741 | barrier(); | ||
742 | tx_cons_sb = le16_to_cpu(*fp->tx_cons_sb); | ||
743 | return (fp->tx_pkt_cons != tx_cons_sb); | ||
744 | } | ||
745 | |||
746 | static inline int bnx2x_has_tx_work_unload(struct bnx2x_fastpath *fp) | ||
747 | { | ||
748 | /* Tell compiler that consumer and producer can change */ | ||
749 | barrier(); | ||
750 | return (fp->tx_pkt_prod != fp->tx_pkt_cons); | ||
751 | |||
752 | } | ||
753 | |||
736 | /* free skb in the packet ring at pos idx | 754 | /* free skb in the packet ring at pos idx |
737 | * return idx of last bd freed | 755 | * return idx of last bd freed |
738 | */ | 756 | */ |
@@ -972,7 +990,7 @@ static inline void bnx2x_free_rx_sge(struct bnx2x *bp, | |||
972 | return; | 990 | return; |
973 | 991 | ||
974 | pci_unmap_page(bp->pdev, pci_unmap_addr(sw_buf, mapping), | 992 | pci_unmap_page(bp->pdev, pci_unmap_addr(sw_buf, mapping), |
975 | BCM_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); | 993 | SGE_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); |
976 | __free_pages(page, PAGES_PER_SGE_SHIFT); | 994 | __free_pages(page, PAGES_PER_SGE_SHIFT); |
977 | 995 | ||
978 | sw_buf->page = NULL; | 996 | sw_buf->page = NULL; |
@@ -1000,7 +1018,7 @@ static inline int bnx2x_alloc_rx_sge(struct bnx2x *bp, | |||
1000 | if (unlikely(page == NULL)) | 1018 | if (unlikely(page == NULL)) |
1001 | return -ENOMEM; | 1019 | return -ENOMEM; |
1002 | 1020 | ||
1003 | mapping = pci_map_page(bp->pdev, page, 0, BCM_PAGE_SIZE*PAGES_PER_SGE, | 1021 | mapping = pci_map_page(bp->pdev, page, 0, SGE_PAGE_SIZE*PAGES_PER_SGE, |
1004 | PCI_DMA_FROMDEVICE); | 1022 | PCI_DMA_FROMDEVICE); |
1005 | if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { | 1023 | if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { |
1006 | __free_pages(page, PAGES_PER_SGE_SHIFT); | 1024 | __free_pages(page, PAGES_PER_SGE_SHIFT); |
@@ -1096,9 +1114,9 @@ static void bnx2x_update_sge_prod(struct bnx2x_fastpath *fp, | |||
1096 | struct eth_fast_path_rx_cqe *fp_cqe) | 1114 | struct eth_fast_path_rx_cqe *fp_cqe) |
1097 | { | 1115 | { |
1098 | struct bnx2x *bp = fp->bp; | 1116 | struct bnx2x *bp = fp->bp; |
1099 | u16 sge_len = BCM_PAGE_ALIGN(le16_to_cpu(fp_cqe->pkt_len) - | 1117 | u16 sge_len = SGE_PAGE_ALIGN(le16_to_cpu(fp_cqe->pkt_len) - |
1100 | le16_to_cpu(fp_cqe->len_on_bd)) >> | 1118 | le16_to_cpu(fp_cqe->len_on_bd)) >> |
1101 | BCM_PAGE_SHIFT; | 1119 | SGE_PAGE_SHIFT; |
1102 | u16 last_max, last_elem, first_elem; | 1120 | u16 last_max, last_elem, first_elem; |
1103 | u16 delta = 0; | 1121 | u16 delta = 0; |
1104 | u16 i; | 1122 | u16 i; |
@@ -1203,22 +1221,22 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1203 | u16 cqe_idx) | 1221 | u16 cqe_idx) |
1204 | { | 1222 | { |
1205 | struct sw_rx_page *rx_pg, old_rx_pg; | 1223 | struct sw_rx_page *rx_pg, old_rx_pg; |
1206 | struct page *sge; | ||
1207 | u16 len_on_bd = le16_to_cpu(fp_cqe->len_on_bd); | 1224 | u16 len_on_bd = le16_to_cpu(fp_cqe->len_on_bd); |
1208 | u32 i, frag_len, frag_size, pages; | 1225 | u32 i, frag_len, frag_size, pages; |
1209 | int err; | 1226 | int err; |
1210 | int j; | 1227 | int j; |
1211 | 1228 | ||
1212 | frag_size = le16_to_cpu(fp_cqe->pkt_len) - len_on_bd; | 1229 | frag_size = le16_to_cpu(fp_cqe->pkt_len) - len_on_bd; |
1213 | pages = BCM_PAGE_ALIGN(frag_size) >> BCM_PAGE_SHIFT; | 1230 | pages = SGE_PAGE_ALIGN(frag_size) >> SGE_PAGE_SHIFT; |
1214 | 1231 | ||
1215 | /* This is needed in order to enable forwarding support */ | 1232 | /* This is needed in order to enable forwarding support */ |
1216 | if (frag_size) | 1233 | if (frag_size) |
1217 | skb_shinfo(skb)->gso_size = min((u32)BCM_PAGE_SIZE, | 1234 | skb_shinfo(skb)->gso_size = min((u32)SGE_PAGE_SIZE, |
1218 | max(frag_size, (u32)len_on_bd)); | 1235 | max(frag_size, (u32)len_on_bd)); |
1219 | 1236 | ||
1220 | #ifdef BNX2X_STOP_ON_ERROR | 1237 | #ifdef BNX2X_STOP_ON_ERROR |
1221 | if (pages > 8*PAGES_PER_SGE) { | 1238 | if (pages > |
1239 | min((u32)8, (u32)MAX_SKB_FRAGS) * SGE_PAGE_SIZE * PAGES_PER_SGE) { | ||
1222 | BNX2X_ERR("SGL length is too long: %d. CQE index is %d\n", | 1240 | BNX2X_ERR("SGL length is too long: %d. CQE index is %d\n", |
1223 | pages, cqe_idx); | 1241 | pages, cqe_idx); |
1224 | BNX2X_ERR("fp_cqe->pkt_len = %d fp_cqe->len_on_bd = %d\n", | 1242 | BNX2X_ERR("fp_cqe->pkt_len = %d fp_cqe->len_on_bd = %d\n", |
@@ -1234,9 +1252,8 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1234 | 1252 | ||
1235 | /* FW gives the indices of the SGE as if the ring is an array | 1253 | /* FW gives the indices of the SGE as if the ring is an array |
1236 | (meaning that "next" element will consume 2 indices) */ | 1254 | (meaning that "next" element will consume 2 indices) */ |
1237 | frag_len = min(frag_size, (u32)(BCM_PAGE_SIZE*PAGES_PER_SGE)); | 1255 | frag_len = min(frag_size, (u32)(SGE_PAGE_SIZE*PAGES_PER_SGE)); |
1238 | rx_pg = &fp->rx_page_ring[sge_idx]; | 1256 | rx_pg = &fp->rx_page_ring[sge_idx]; |
1239 | sge = rx_pg->page; | ||
1240 | old_rx_pg = *rx_pg; | 1257 | old_rx_pg = *rx_pg; |
1241 | 1258 | ||
1242 | /* If we fail to allocate a substitute page, we simply stop | 1259 | /* If we fail to allocate a substitute page, we simply stop |
@@ -1249,7 +1266,7 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1249 | 1266 | ||
1250 | /* Unmap the page as we r going to pass it to the stack */ | 1267 | /* Unmap the page as we r going to pass it to the stack */ |
1251 | pci_unmap_page(bp->pdev, pci_unmap_addr(&old_rx_pg, mapping), | 1268 | pci_unmap_page(bp->pdev, pci_unmap_addr(&old_rx_pg, mapping), |
1252 | BCM_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); | 1269 | SGE_PAGE_SIZE*PAGES_PER_SGE, PCI_DMA_FROMDEVICE); |
1253 | 1270 | ||
1254 | /* Add one frag and update the appropriate fields in the skb */ | 1271 | /* Add one frag and update the appropriate fields in the skb */ |
1255 | skb_fill_page_desc(skb, j, old_rx_pg.page, 0, frag_len); | 1272 | skb_fill_page_desc(skb, j, old_rx_pg.page, 0, frag_len); |
@@ -1282,6 +1299,13 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1282 | if (likely(new_skb)) { | 1299 | if (likely(new_skb)) { |
1283 | /* fix ip xsum and give it to the stack */ | 1300 | /* fix ip xsum and give it to the stack */ |
1284 | /* (no need to map the new skb) */ | 1301 | /* (no need to map the new skb) */ |
1302 | #ifdef BCM_VLAN | ||
1303 | int is_vlan_cqe = | ||
1304 | (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & | ||
1305 | PARSING_FLAGS_VLAN); | ||
1306 | int is_not_hwaccel_vlan_cqe = | ||
1307 | (is_vlan_cqe && (!(bp->flags & HW_VLAN_RX_FLAG))); | ||
1308 | #endif | ||
1285 | 1309 | ||
1286 | prefetch(skb); | 1310 | prefetch(skb); |
1287 | prefetch(((char *)(skb)) + 128); | 1311 | prefetch(((char *)(skb)) + 128); |
@@ -1306,6 +1330,12 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1306 | struct iphdr *iph; | 1330 | struct iphdr *iph; |
1307 | 1331 | ||
1308 | iph = (struct iphdr *)skb->data; | 1332 | iph = (struct iphdr *)skb->data; |
1333 | #ifdef BCM_VLAN | ||
1334 | /* If there is no Rx VLAN offloading - | ||
1335 | take VLAN tag into an account */ | ||
1336 | if (unlikely(is_not_hwaccel_vlan_cqe)) | ||
1337 | iph = (struct iphdr *)((u8 *)iph + VLAN_HLEN); | ||
1338 | #endif | ||
1309 | iph->check = 0; | 1339 | iph->check = 0; |
1310 | iph->check = ip_fast_csum((u8 *)iph, iph->ihl); | 1340 | iph->check = ip_fast_csum((u8 *)iph, iph->ihl); |
1311 | } | 1341 | } |
@@ -1313,9 +1343,8 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
1313 | if (!bnx2x_fill_frag_skb(bp, fp, skb, | 1343 | if (!bnx2x_fill_frag_skb(bp, fp, skb, |
1314 | &cqe->fast_path_cqe, cqe_idx)) { | 1344 | &cqe->fast_path_cqe, cqe_idx)) { |
1315 | #ifdef BCM_VLAN | 1345 | #ifdef BCM_VLAN |
1316 | if ((bp->vlgrp != NULL) && | 1346 | if ((bp->vlgrp != NULL) && is_vlan_cqe && |
1317 | (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & | 1347 | (!is_not_hwaccel_vlan_cqe)) |
1318 | PARSING_FLAGS_VLAN)) | ||
1319 | vlan_hwaccel_receive_skb(skb, bp->vlgrp, | 1348 | vlan_hwaccel_receive_skb(skb, bp->vlgrp, |
1320 | le16_to_cpu(cqe->fast_path_cqe. | 1349 | le16_to_cpu(cqe->fast_path_cqe. |
1321 | vlan_tag)); | 1350 | vlan_tag)); |
@@ -1355,11 +1384,23 @@ static inline void bnx2x_update_rx_prod(struct bnx2x *bp, | |||
1355 | rx_prods.cqe_prod = rx_comp_prod; | 1384 | rx_prods.cqe_prod = rx_comp_prod; |
1356 | rx_prods.sge_prod = rx_sge_prod; | 1385 | rx_prods.sge_prod = rx_sge_prod; |
1357 | 1386 | ||
1387 | /* | ||
1388 | * Make sure that the BD and SGE data is updated before updating the | ||
1389 | * producers since FW might read the BD/SGE right after the producer | ||
1390 | * is updated. | ||
1391 | * This is only applicable for weak-ordered memory model archs such | ||
1392 | * as IA-64. The following barrier is also mandatory since FW will | ||
1393 | * assumes BDs must have buffers. | ||
1394 | */ | ||
1395 | wmb(); | ||
1396 | |||
1358 | for (i = 0; i < sizeof(struct tstorm_eth_rx_producers)/4; i++) | 1397 | for (i = 0; i < sizeof(struct tstorm_eth_rx_producers)/4; i++) |
1359 | REG_WR(bp, BAR_TSTRORM_INTMEM + | 1398 | REG_WR(bp, BAR_TSTRORM_INTMEM + |
1360 | TSTORM_RX_PRODS_OFFSET(BP_PORT(bp), FP_CL_ID(fp)) + i*4, | 1399 | TSTORM_RX_PRODS_OFFSET(BP_PORT(bp), FP_CL_ID(fp)) + i*4, |
1361 | ((u32 *)&rx_prods)[i]); | 1400 | ((u32 *)&rx_prods)[i]); |
1362 | 1401 | ||
1402 | mmiowb(); /* keep prod updates ordered */ | ||
1403 | |||
1363 | DP(NETIF_MSG_RX_STATUS, | 1404 | DP(NETIF_MSG_RX_STATUS, |
1364 | "Wrote: bd_prod %u cqe_prod %u sge_prod %u\n", | 1405 | "Wrote: bd_prod %u cqe_prod %u sge_prod %u\n", |
1365 | bd_prod, rx_comp_prod, rx_sge_prod); | 1406 | bd_prod, rx_comp_prod, rx_sge_prod); |
@@ -1415,7 +1456,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) | |||
1415 | DP(NETIF_MSG_RX_STATUS, "CQE type %x err %x status %x" | 1456 | DP(NETIF_MSG_RX_STATUS, "CQE type %x err %x status %x" |
1416 | " queue %x vlan %x len %u\n", CQE_TYPE(cqe_fp_flags), | 1457 | " queue %x vlan %x len %u\n", CQE_TYPE(cqe_fp_flags), |
1417 | cqe_fp_flags, cqe->fast_path_cqe.status_flags, | 1458 | cqe_fp_flags, cqe->fast_path_cqe.status_flags, |
1418 | cqe->fast_path_cqe.rss_hash_result, | 1459 | le32_to_cpu(cqe->fast_path_cqe.rss_hash_result), |
1419 | le16_to_cpu(cqe->fast_path_cqe.vlan_tag), | 1460 | le16_to_cpu(cqe->fast_path_cqe.vlan_tag), |
1420 | le16_to_cpu(cqe->fast_path_cqe.pkt_len)); | 1461 | le16_to_cpu(cqe->fast_path_cqe.pkt_len)); |
1421 | 1462 | ||
@@ -1547,7 +1588,7 @@ reuse_rx: | |||
1547 | } | 1588 | } |
1548 | 1589 | ||
1549 | #ifdef BCM_VLAN | 1590 | #ifdef BCM_VLAN |
1550 | if ((bp->vlgrp != NULL) && | 1591 | if ((bp->vlgrp != NULL) && (bp->flags & HW_VLAN_RX_FLAG) && |
1551 | (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & | 1592 | (le16_to_cpu(cqe->fast_path_cqe.pars_flags.flags) & |
1552 | PARSING_FLAGS_VLAN)) | 1593 | PARSING_FLAGS_VLAN)) |
1553 | vlan_hwaccel_receive_skb(skb, bp->vlgrp, | 1594 | vlan_hwaccel_receive_skb(skb, bp->vlgrp, |
@@ -1580,7 +1621,6 @@ next_cqe: | |||
1580 | /* Update producers */ | 1621 | /* Update producers */ |
1581 | bnx2x_update_rx_prod(bp, fp, bd_prod_fw, sw_comp_prod, | 1622 | bnx2x_update_rx_prod(bp, fp, bd_prod_fw, sw_comp_prod, |
1582 | fp->rx_sge_prod); | 1623 | fp->rx_sge_prod); |
1583 | mmiowb(); /* keep prod updates ordered */ | ||
1584 | 1624 | ||
1585 | fp->rx_pkt += rx_pkt; | 1625 | fp->rx_pkt += rx_pkt; |
1586 | fp->rx_calls++; | 1626 | fp->rx_calls++; |
@@ -1660,7 +1700,7 @@ static irqreturn_t bnx2x_interrupt(int irq, void *dev_instance) | |||
1660 | 1700 | ||
1661 | 1701 | ||
1662 | if (unlikely(status & 0x1)) { | 1702 | if (unlikely(status & 0x1)) { |
1663 | schedule_work(&bp->sp_task); | 1703 | queue_delayed_work(bnx2x_wq, &bp->sp_task, 0); |
1664 | 1704 | ||
1665 | status &= ~0x1; | 1705 | status &= ~0x1; |
1666 | if (!status) | 1706 | if (!status) |
@@ -1887,7 +1927,8 @@ static int bnx2x_set_spio(struct bnx2x *bp, int spio_num, u32 mode) | |||
1887 | 1927 | ||
1888 | static void bnx2x_calc_fc_adv(struct bnx2x *bp) | 1928 | static void bnx2x_calc_fc_adv(struct bnx2x *bp) |
1889 | { | 1929 | { |
1890 | switch (bp->link_vars.ieee_fc) { | 1930 | switch (bp->link_vars.ieee_fc & |
1931 | MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) { | ||
1891 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE: | 1932 | case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE: |
1892 | bp->port.advertising &= ~(ADVERTISED_Asym_Pause | | 1933 | bp->port.advertising &= ~(ADVERTISED_Asym_Pause | |
1893 | ADVERTISED_Pause); | 1934 | ADVERTISED_Pause); |
@@ -1957,10 +1998,11 @@ static u8 bnx2x_initial_phy_init(struct bnx2x *bp) | |||
1957 | rc = bnx2x_phy_init(&bp->link_params, &bp->link_vars); | 1998 | rc = bnx2x_phy_init(&bp->link_params, &bp->link_vars); |
1958 | bnx2x_release_phy_lock(bp); | 1999 | bnx2x_release_phy_lock(bp); |
1959 | 2000 | ||
2001 | bnx2x_calc_fc_adv(bp); | ||
2002 | |||
1960 | if (bp->link_vars.link_up) | 2003 | if (bp->link_vars.link_up) |
1961 | bnx2x_link_report(bp); | 2004 | bnx2x_link_report(bp); |
1962 | 2005 | ||
1963 | bnx2x_calc_fc_adv(bp); | ||
1964 | 2006 | ||
1965 | return rc; | 2007 | return rc; |
1966 | } | 2008 | } |
@@ -2220,9 +2262,7 @@ static void bnx2x_link_attn(struct bnx2x *bp) | |||
2220 | /* Make sure that we are synced with the current statistics */ | 2262 | /* Make sure that we are synced with the current statistics */ |
2221 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); | 2263 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); |
2222 | 2264 | ||
2223 | bnx2x_acquire_phy_lock(bp); | ||
2224 | bnx2x_link_update(&bp->link_params, &bp->link_vars); | 2265 | bnx2x_link_update(&bp->link_params, &bp->link_vars); |
2225 | bnx2x_release_phy_lock(bp); | ||
2226 | 2266 | ||
2227 | if (bp->link_vars.link_up) { | 2267 | if (bp->link_vars.link_up) { |
2228 | 2268 | ||
@@ -2471,6 +2511,8 @@ static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted) | |||
2471 | if (asserted & ATTN_HARD_WIRED_MASK) { | 2511 | if (asserted & ATTN_HARD_WIRED_MASK) { |
2472 | if (asserted & ATTN_NIG_FOR_FUNC) { | 2512 | if (asserted & ATTN_NIG_FOR_FUNC) { |
2473 | 2513 | ||
2514 | bnx2x_acquire_phy_lock(bp); | ||
2515 | |||
2474 | /* save nig interrupt mask */ | 2516 | /* save nig interrupt mask */ |
2475 | bp->nig_mask = REG_RD(bp, nig_int_mask_addr); | 2517 | bp->nig_mask = REG_RD(bp, nig_int_mask_addr); |
2476 | REG_WR(bp, nig_int_mask_addr, 0); | 2518 | REG_WR(bp, nig_int_mask_addr, 0); |
@@ -2526,8 +2568,10 @@ static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted) | |||
2526 | REG_WR(bp, hc_addr, asserted); | 2568 | REG_WR(bp, hc_addr, asserted); |
2527 | 2569 | ||
2528 | /* now set back the mask */ | 2570 | /* now set back the mask */ |
2529 | if (asserted & ATTN_NIG_FOR_FUNC) | 2571 | if (asserted & ATTN_NIG_FOR_FUNC) { |
2530 | REG_WR(bp, nig_int_mask_addr, bp->nig_mask); | 2572 | REG_WR(bp, nig_int_mask_addr, bp->nig_mask); |
2573 | bnx2x_release_phy_lock(bp); | ||
2574 | } | ||
2531 | } | 2575 | } |
2532 | 2576 | ||
2533 | static inline void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn) | 2577 | static inline void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn) |
@@ -2795,8 +2839,10 @@ static void bnx2x_attn_int_deasserted(struct bnx2x *bp, u32 deasserted) | |||
2795 | static void bnx2x_attn_int(struct bnx2x *bp) | 2839 | static void bnx2x_attn_int(struct bnx2x *bp) |
2796 | { | 2840 | { |
2797 | /* read local copy of bits */ | 2841 | /* read local copy of bits */ |
2798 | u32 attn_bits = bp->def_status_blk->atten_status_block.attn_bits; | 2842 | u32 attn_bits = le32_to_cpu(bp->def_status_blk->atten_status_block. |
2799 | u32 attn_ack = bp->def_status_blk->atten_status_block.attn_bits_ack; | 2843 | attn_bits); |
2844 | u32 attn_ack = le32_to_cpu(bp->def_status_blk->atten_status_block. | ||
2845 | attn_bits_ack); | ||
2800 | u32 attn_state = bp->attn_state; | 2846 | u32 attn_state = bp->attn_state; |
2801 | 2847 | ||
2802 | /* look for changed bits */ | 2848 | /* look for changed bits */ |
@@ -2820,7 +2866,7 @@ static void bnx2x_attn_int(struct bnx2x *bp) | |||
2820 | 2866 | ||
2821 | static void bnx2x_sp_task(struct work_struct *work) | 2867 | static void bnx2x_sp_task(struct work_struct *work) |
2822 | { | 2868 | { |
2823 | struct bnx2x *bp = container_of(work, struct bnx2x, sp_task); | 2869 | struct bnx2x *bp = container_of(work, struct bnx2x, sp_task.work); |
2824 | u16 status; | 2870 | u16 status; |
2825 | 2871 | ||
2826 | 2872 | ||
@@ -2844,7 +2890,7 @@ static void bnx2x_sp_task(struct work_struct *work) | |||
2844 | if (status & 0x2) | 2890 | if (status & 0x2) |
2845 | bp->stats_pending = 0; | 2891 | bp->stats_pending = 0; |
2846 | 2892 | ||
2847 | bnx2x_ack_sb(bp, DEF_SB_ID, ATTENTION_ID, bp->def_att_idx, | 2893 | bnx2x_ack_sb(bp, DEF_SB_ID, ATTENTION_ID, le16_to_cpu(bp->def_att_idx), |
2848 | IGU_INT_NOP, 1); | 2894 | IGU_INT_NOP, 1); |
2849 | bnx2x_ack_sb(bp, DEF_SB_ID, USTORM_ID, le16_to_cpu(bp->def_u_idx), | 2895 | bnx2x_ack_sb(bp, DEF_SB_ID, USTORM_ID, le16_to_cpu(bp->def_u_idx), |
2850 | IGU_INT_NOP, 1); | 2896 | IGU_INT_NOP, 1); |
@@ -2875,7 +2921,7 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) | |||
2875 | return IRQ_HANDLED; | 2921 | return IRQ_HANDLED; |
2876 | #endif | 2922 | #endif |
2877 | 2923 | ||
2878 | schedule_work(&bp->sp_task); | 2924 | queue_delayed_work(bnx2x_wq, &bp->sp_task, 0); |
2879 | 2925 | ||
2880 | return IRQ_HANDLED; | 2926 | return IRQ_HANDLED; |
2881 | } | 2927 | } |
@@ -2892,7 +2938,7 @@ static irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) | |||
2892 | #define ADD_64(s_hi, a_hi, s_lo, a_lo) \ | 2938 | #define ADD_64(s_hi, a_hi, s_lo, a_lo) \ |
2893 | do { \ | 2939 | do { \ |
2894 | s_lo += a_lo; \ | 2940 | s_lo += a_lo; \ |
2895 | s_hi += a_hi + (s_lo < a_lo) ? 1 : 0; \ | 2941 | s_hi += a_hi + ((s_lo < a_lo) ? 1 : 0); \ |
2896 | } while (0) | 2942 | } while (0) |
2897 | 2943 | ||
2898 | /* difference = minuend - subtrahend */ | 2944 | /* difference = minuend - subtrahend */ |
@@ -4496,7 +4542,7 @@ static void bnx2x_init_context(struct bnx2x *bp) | |||
4496 | 4542 | ||
4497 | static void bnx2x_init_ind_table(struct bnx2x *bp) | 4543 | static void bnx2x_init_ind_table(struct bnx2x *bp) |
4498 | { | 4544 | { |
4499 | int port = BP_PORT(bp); | 4545 | int func = BP_FUNC(bp); |
4500 | int i; | 4546 | int i; |
4501 | 4547 | ||
4502 | if (!is_multi(bp)) | 4548 | if (!is_multi(bp)) |
@@ -4505,10 +4551,8 @@ static void bnx2x_init_ind_table(struct bnx2x *bp) | |||
4505 | DP(NETIF_MSG_IFUP, "Initializing indirection table\n"); | 4551 | DP(NETIF_MSG_IFUP, "Initializing indirection table\n"); |
4506 | for (i = 0; i < TSTORM_INDIRECTION_TABLE_SIZE; i++) | 4552 | for (i = 0; i < TSTORM_INDIRECTION_TABLE_SIZE; i++) |
4507 | REG_WR8(bp, BAR_TSTRORM_INTMEM + | 4553 | REG_WR8(bp, BAR_TSTRORM_INTMEM + |
4508 | TSTORM_INDIRECTION_TABLE_OFFSET(port) + i, | 4554 | TSTORM_INDIRECTION_TABLE_OFFSET(func) + i, |
4509 | i % bp->num_queues); | 4555 | BP_CL_ID(bp) + (i % bp->num_queues)); |
4510 | |||
4511 | REG_WR(bp, PRS_REG_A_PRSU_20, 0xf); | ||
4512 | } | 4556 | } |
4513 | 4557 | ||
4514 | static void bnx2x_set_client_config(struct bnx2x *bp) | 4558 | static void bnx2x_set_client_config(struct bnx2x *bp) |
@@ -4517,12 +4561,12 @@ static void bnx2x_set_client_config(struct bnx2x *bp) | |||
4517 | int port = BP_PORT(bp); | 4561 | int port = BP_PORT(bp); |
4518 | int i; | 4562 | int i; |
4519 | 4563 | ||
4520 | tstorm_client.mtu = bp->dev->mtu + ETH_OVREHEAD; | 4564 | tstorm_client.mtu = bp->dev->mtu; |
4521 | tstorm_client.statistics_counter_id = BP_CL_ID(bp); | 4565 | tstorm_client.statistics_counter_id = BP_CL_ID(bp); |
4522 | tstorm_client.config_flags = | 4566 | tstorm_client.config_flags = |
4523 | TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE; | 4567 | TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE; |
4524 | #ifdef BCM_VLAN | 4568 | #ifdef BCM_VLAN |
4525 | if (bp->rx_mode && bp->vlgrp) { | 4569 | if (bp->rx_mode && bp->vlgrp && (bp->flags & HW_VLAN_RX_FLAG)) { |
4526 | tstorm_client.config_flags |= | 4570 | tstorm_client.config_flags |= |
4527 | TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE; | 4571 | TSTORM_ETH_CLIENT_CONFIG_VLAN_REMOVAL_ENABLE; |
4528 | DP(NETIF_MSG_IFUP, "vlan removal enabled\n"); | 4572 | DP(NETIF_MSG_IFUP, "vlan removal enabled\n"); |
@@ -4531,7 +4575,7 @@ static void bnx2x_set_client_config(struct bnx2x *bp) | |||
4531 | 4575 | ||
4532 | if (bp->flags & TPA_ENABLE_FLAG) { | 4576 | if (bp->flags & TPA_ENABLE_FLAG) { |
4533 | tstorm_client.max_sges_for_packet = | 4577 | tstorm_client.max_sges_for_packet = |
4534 | BCM_PAGE_ALIGN(tstorm_client.mtu) >> BCM_PAGE_SHIFT; | 4578 | SGE_PAGE_ALIGN(tstorm_client.mtu) >> SGE_PAGE_SHIFT; |
4535 | tstorm_client.max_sges_for_packet = | 4579 | tstorm_client.max_sges_for_packet = |
4536 | ((tstorm_client.max_sges_for_packet + | 4580 | ((tstorm_client.max_sges_for_packet + |
4537 | PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> | 4581 | PAGES_PER_SGE - 1) & (~(PAGES_PER_SGE - 1))) >> |
@@ -4714,10 +4758,11 @@ static void bnx2x_init_internal_func(struct bnx2x *bp) | |||
4714 | bp->e1hov); | 4758 | bp->e1hov); |
4715 | } | 4759 | } |
4716 | 4760 | ||
4717 | /* Init CQ ring mapping and aggregation size */ | 4761 | /* Init CQ ring mapping and aggregation size, the FW limit is 8 frags */ |
4718 | max_agg_size = min((u32)(bp->rx_buf_size + | 4762 | max_agg_size = |
4719 | 8*BCM_PAGE_SIZE*PAGES_PER_SGE), | 4763 | min((u32)(min((u32)8, (u32)MAX_SKB_FRAGS) * |
4720 | (u32)0xffff); | 4764 | SGE_PAGE_SIZE * PAGES_PER_SGE), |
4765 | (u32)0xffff); | ||
4721 | for_each_queue(bp, i) { | 4766 | for_each_queue(bp, i) { |
4722 | struct bnx2x_fastpath *fp = &bp->fp[i]; | 4767 | struct bnx2x_fastpath *fp = &bp->fp[i]; |
4723 | 4768 | ||
@@ -4785,6 +4830,15 @@ static void bnx2x_nic_init(struct bnx2x *bp, u32 load_code) | |||
4785 | bnx2x_init_context(bp); | 4830 | bnx2x_init_context(bp); |
4786 | bnx2x_init_internal(bp, load_code); | 4831 | bnx2x_init_internal(bp, load_code); |
4787 | bnx2x_init_ind_table(bp); | 4832 | bnx2x_init_ind_table(bp); |
4833 | bnx2x_stats_init(bp); | ||
4834 | |||
4835 | /* At this point, we are ready for interrupts */ | ||
4836 | atomic_set(&bp->intr_sem, 0); | ||
4837 | |||
4838 | /* flush all before enabling interrupts */ | ||
4839 | mb(); | ||
4840 | mmiowb(); | ||
4841 | |||
4788 | bnx2x_int_enable(bp); | 4842 | bnx2x_int_enable(bp); |
4789 | } | 4843 | } |
4790 | 4844 | ||
@@ -5101,12 +5155,21 @@ static void enable_blocks_attention(struct bnx2x *bp) | |||
5101 | } | 5155 | } |
5102 | 5156 | ||
5103 | 5157 | ||
5158 | static void bnx2x_reset_common(struct bnx2x *bp) | ||
5159 | { | ||
5160 | /* reset_common */ | ||
5161 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR, | ||
5162 | 0xd3ffff7f); | ||
5163 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403); | ||
5164 | } | ||
5165 | |||
5104 | static int bnx2x_init_common(struct bnx2x *bp) | 5166 | static int bnx2x_init_common(struct bnx2x *bp) |
5105 | { | 5167 | { |
5106 | u32 val, i; | 5168 | u32 val, i; |
5107 | 5169 | ||
5108 | DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_FUNC(bp)); | 5170 | DP(BNX2X_MSG_MCP, "starting common init func %d\n", BP_FUNC(bp)); |
5109 | 5171 | ||
5172 | bnx2x_reset_common(bp); | ||
5110 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff); | 5173 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_SET, 0xffffffff); |
5111 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, 0xfffc); | 5174 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_SET, 0xfffc); |
5112 | 5175 | ||
@@ -5134,7 +5197,6 @@ static int bnx2x_init_common(struct bnx2x *bp) | |||
5134 | REG_WR(bp, PXP2_REG_RQ_SRC_ENDIAN_M, 1); | 5197 | REG_WR(bp, PXP2_REG_RQ_SRC_ENDIAN_M, 1); |
5135 | REG_WR(bp, PXP2_REG_RQ_CDU_ENDIAN_M, 1); | 5198 | REG_WR(bp, PXP2_REG_RQ_CDU_ENDIAN_M, 1); |
5136 | REG_WR(bp, PXP2_REG_RQ_DBG_ENDIAN_M, 1); | 5199 | REG_WR(bp, PXP2_REG_RQ_DBG_ENDIAN_M, 1); |
5137 | REG_WR(bp, PXP2_REG_RQ_HC_ENDIAN_M, 1); | ||
5138 | 5200 | ||
5139 | /* REG_WR(bp, PXP2_REG_RD_PBF_SWAP_MODE, 1); */ | 5201 | /* REG_WR(bp, PXP2_REG_RD_PBF_SWAP_MODE, 1); */ |
5140 | REG_WR(bp, PXP2_REG_RD_QM_SWAP_MODE, 1); | 5202 | REG_WR(bp, PXP2_REG_RD_QM_SWAP_MODE, 1); |
@@ -5212,6 +5274,7 @@ static int bnx2x_init_common(struct bnx2x *bp) | |||
5212 | } | 5274 | } |
5213 | 5275 | ||
5214 | bnx2x_init_block(bp, PRS_COMMON_START, PRS_COMMON_END); | 5276 | bnx2x_init_block(bp, PRS_COMMON_START, PRS_COMMON_END); |
5277 | REG_WR(bp, PRS_REG_A_PRSU_20, 0xf); | ||
5215 | /* set NIC mode */ | 5278 | /* set NIC mode */ |
5216 | REG_WR(bp, PRS_REG_NIC_MODE, 1); | 5279 | REG_WR(bp, PRS_REG_NIC_MODE, 1); |
5217 | if (CHIP_IS_E1H(bp)) | 5280 | if (CHIP_IS_E1H(bp)) |
@@ -6087,8 +6150,8 @@ static void bnx2x_netif_start(struct bnx2x *bp) | |||
6087 | static void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) | 6150 | static void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) |
6088 | { | 6151 | { |
6089 | bnx2x_int_disable_sync(bp, disable_hw); | 6152 | bnx2x_int_disable_sync(bp, disable_hw); |
6153 | bnx2x_napi_disable(bp); | ||
6090 | if (netif_running(bp->dev)) { | 6154 | if (netif_running(bp->dev)) { |
6091 | bnx2x_napi_disable(bp); | ||
6092 | netif_tx_disable(bp->dev); | 6155 | netif_tx_disable(bp->dev); |
6093 | bp->dev->trans_start = jiffies; /* prevent tx timeout */ | 6156 | bp->dev->trans_start = jiffies; /* prevent tx timeout */ |
6094 | } | 6157 | } |
@@ -6108,7 +6171,7 @@ static void bnx2x_set_mac_addr_e1(struct bnx2x *bp, int set) | |||
6108 | * multicast 64-127:port0 128-191:port1 | 6171 | * multicast 64-127:port0 128-191:port1 |
6109 | */ | 6172 | */ |
6110 | config->hdr.length_6b = 2; | 6173 | config->hdr.length_6b = 2; |
6111 | config->hdr.offset = port ? 31 : 0; | 6174 | config->hdr.offset = port ? 32 : 0; |
6112 | config->hdr.client_id = BP_CL_ID(bp); | 6175 | config->hdr.client_id = BP_CL_ID(bp); |
6113 | config->hdr.reserved1 = 0; | 6176 | config->hdr.reserved1 = 0; |
6114 | 6177 | ||
@@ -6272,7 +6335,7 @@ static void bnx2x_set_rx_mode(struct net_device *dev); | |||
6272 | static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | 6335 | static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) |
6273 | { | 6336 | { |
6274 | u32 load_code; | 6337 | u32 load_code; |
6275 | int i, rc; | 6338 | int i, rc = 0; |
6276 | #ifdef BNX2X_STOP_ON_ERROR | 6339 | #ifdef BNX2X_STOP_ON_ERROR |
6277 | if (unlikely(bp->panic)) | 6340 | if (unlikely(bp->panic)) |
6278 | return -EPERM; | 6341 | return -EPERM; |
@@ -6280,48 +6343,6 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6280 | 6343 | ||
6281 | bp->state = BNX2X_STATE_OPENING_WAIT4_LOAD; | 6344 | bp->state = BNX2X_STATE_OPENING_WAIT4_LOAD; |
6282 | 6345 | ||
6283 | /* Send LOAD_REQUEST command to MCP | ||
6284 | Returns the type of LOAD command: | ||
6285 | if it is the first port to be initialized | ||
6286 | common blocks should be initialized, otherwise - not | ||
6287 | */ | ||
6288 | if (!BP_NOMCP(bp)) { | ||
6289 | load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ); | ||
6290 | if (!load_code) { | ||
6291 | BNX2X_ERR("MCP response failure, aborting\n"); | ||
6292 | return -EBUSY; | ||
6293 | } | ||
6294 | if (load_code == FW_MSG_CODE_DRV_LOAD_REFUSED) | ||
6295 | return -EBUSY; /* other port in diagnostic mode */ | ||
6296 | |||
6297 | } else { | ||
6298 | int port = BP_PORT(bp); | ||
6299 | |||
6300 | DP(NETIF_MSG_IFUP, "NO MCP load counts before us %d, %d, %d\n", | ||
6301 | load_count[0], load_count[1], load_count[2]); | ||
6302 | load_count[0]++; | ||
6303 | load_count[1 + port]++; | ||
6304 | DP(NETIF_MSG_IFUP, "NO MCP new load counts %d, %d, %d\n", | ||
6305 | load_count[0], load_count[1], load_count[2]); | ||
6306 | if (load_count[0] == 1) | ||
6307 | load_code = FW_MSG_CODE_DRV_LOAD_COMMON; | ||
6308 | else if (load_count[1 + port] == 1) | ||
6309 | load_code = FW_MSG_CODE_DRV_LOAD_PORT; | ||
6310 | else | ||
6311 | load_code = FW_MSG_CODE_DRV_LOAD_FUNCTION; | ||
6312 | } | ||
6313 | |||
6314 | if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) || | ||
6315 | (load_code == FW_MSG_CODE_DRV_LOAD_PORT)) | ||
6316 | bp->port.pmf = 1; | ||
6317 | else | ||
6318 | bp->port.pmf = 0; | ||
6319 | DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf); | ||
6320 | |||
6321 | /* if we can't use MSI-X we only need one fp, | ||
6322 | * so try to enable MSI-X with the requested number of fp's | ||
6323 | * and fallback to inta with one fp | ||
6324 | */ | ||
6325 | if (use_inta) { | 6346 | if (use_inta) { |
6326 | bp->num_queues = 1; | 6347 | bp->num_queues = 1; |
6327 | 6348 | ||
@@ -6336,7 +6357,15 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6336 | else | 6357 | else |
6337 | bp->num_queues = 1; | 6358 | bp->num_queues = 1; |
6338 | 6359 | ||
6339 | if (bnx2x_enable_msix(bp)) { | 6360 | DP(NETIF_MSG_IFUP, |
6361 | "set number of queues to %d\n", bp->num_queues); | ||
6362 | |||
6363 | /* if we can't use MSI-X we only need one fp, | ||
6364 | * so try to enable MSI-X with the requested number of fp's | ||
6365 | * and fallback to MSI or legacy INTx with one fp | ||
6366 | */ | ||
6367 | rc = bnx2x_enable_msix(bp); | ||
6368 | if (rc) { | ||
6340 | /* failed to enable MSI-X */ | 6369 | /* failed to enable MSI-X */ |
6341 | bp->num_queues = 1; | 6370 | bp->num_queues = 1; |
6342 | if (use_multi) | 6371 | if (use_multi) |
@@ -6344,8 +6373,6 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6344 | " to enable MSI-X\n"); | 6373 | " to enable MSI-X\n"); |
6345 | } | 6374 | } |
6346 | } | 6375 | } |
6347 | DP(NETIF_MSG_IFUP, | ||
6348 | "set number of queues to %d\n", bp->num_queues); | ||
6349 | 6376 | ||
6350 | if (bnx2x_alloc_mem(bp)) | 6377 | if (bnx2x_alloc_mem(bp)) |
6351 | return -ENOMEM; | 6378 | return -ENOMEM; |
@@ -6354,30 +6381,85 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6354 | bnx2x_fp(bp, i, disable_tpa) = | 6381 | bnx2x_fp(bp, i, disable_tpa) = |
6355 | ((bp->flags & TPA_ENABLE_FLAG) == 0); | 6382 | ((bp->flags & TPA_ENABLE_FLAG) == 0); |
6356 | 6383 | ||
6384 | for_each_queue(bp, i) | ||
6385 | netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi), | ||
6386 | bnx2x_poll, 128); | ||
6387 | |||
6388 | #ifdef BNX2X_STOP_ON_ERROR | ||
6389 | for_each_queue(bp, i) { | ||
6390 | struct bnx2x_fastpath *fp = &bp->fp[i]; | ||
6391 | |||
6392 | fp->poll_no_work = 0; | ||
6393 | fp->poll_calls = 0; | ||
6394 | fp->poll_max_calls = 0; | ||
6395 | fp->poll_complete = 0; | ||
6396 | fp->poll_exit = 0; | ||
6397 | } | ||
6398 | #endif | ||
6399 | bnx2x_napi_enable(bp); | ||
6400 | |||
6357 | if (bp->flags & USING_MSIX_FLAG) { | 6401 | if (bp->flags & USING_MSIX_FLAG) { |
6358 | rc = bnx2x_req_msix_irqs(bp); | 6402 | rc = bnx2x_req_msix_irqs(bp); |
6359 | if (rc) { | 6403 | if (rc) { |
6360 | pci_disable_msix(bp->pdev); | 6404 | pci_disable_msix(bp->pdev); |
6361 | goto load_error; | 6405 | goto load_error1; |
6362 | } | 6406 | } |
6407 | printk(KERN_INFO PFX "%s: using MSI-X\n", bp->dev->name); | ||
6363 | } else { | 6408 | } else { |
6364 | bnx2x_ack_int(bp); | 6409 | bnx2x_ack_int(bp); |
6365 | rc = bnx2x_req_irq(bp); | 6410 | rc = bnx2x_req_irq(bp); |
6366 | if (rc) { | 6411 | if (rc) { |
6367 | BNX2X_ERR("IRQ request failed, aborting\n"); | 6412 | BNX2X_ERR("IRQ request failed rc %d, aborting\n", rc); |
6368 | goto load_error; | 6413 | goto load_error1; |
6369 | } | 6414 | } |
6370 | } | 6415 | } |
6371 | 6416 | ||
6372 | for_each_queue(bp, i) | 6417 | /* Send LOAD_REQUEST command to MCP |
6373 | netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi), | 6418 | Returns the type of LOAD command: |
6374 | bnx2x_poll, 128); | 6419 | if it is the first port to be initialized |
6420 | common blocks should be initialized, otherwise - not | ||
6421 | */ | ||
6422 | if (!BP_NOMCP(bp)) { | ||
6423 | load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ); | ||
6424 | if (!load_code) { | ||
6425 | BNX2X_ERR("MCP response failure, aborting\n"); | ||
6426 | rc = -EBUSY; | ||
6427 | goto load_error2; | ||
6428 | } | ||
6429 | if (load_code == FW_MSG_CODE_DRV_LOAD_REFUSED) { | ||
6430 | rc = -EBUSY; /* other port in diagnostic mode */ | ||
6431 | goto load_error2; | ||
6432 | } | ||
6433 | |||
6434 | } else { | ||
6435 | int port = BP_PORT(bp); | ||
6436 | |||
6437 | DP(NETIF_MSG_IFUP, "NO MCP load counts before us %d, %d, %d\n", | ||
6438 | load_count[0], load_count[1], load_count[2]); | ||
6439 | load_count[0]++; | ||
6440 | load_count[1 + port]++; | ||
6441 | DP(NETIF_MSG_IFUP, "NO MCP new load counts %d, %d, %d\n", | ||
6442 | load_count[0], load_count[1], load_count[2]); | ||
6443 | if (load_count[0] == 1) | ||
6444 | load_code = FW_MSG_CODE_DRV_LOAD_COMMON; | ||
6445 | else if (load_count[1 + port] == 1) | ||
6446 | load_code = FW_MSG_CODE_DRV_LOAD_PORT; | ||
6447 | else | ||
6448 | load_code = FW_MSG_CODE_DRV_LOAD_FUNCTION; | ||
6449 | } | ||
6450 | |||
6451 | if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) || | ||
6452 | (load_code == FW_MSG_CODE_DRV_LOAD_PORT)) | ||
6453 | bp->port.pmf = 1; | ||
6454 | else | ||
6455 | bp->port.pmf = 0; | ||
6456 | DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf); | ||
6375 | 6457 | ||
6376 | /* Initialize HW */ | 6458 | /* Initialize HW */ |
6377 | rc = bnx2x_init_hw(bp, load_code); | 6459 | rc = bnx2x_init_hw(bp, load_code); |
6378 | if (rc) { | 6460 | if (rc) { |
6379 | BNX2X_ERR("HW init failed, aborting\n"); | 6461 | BNX2X_ERR("HW init failed, aborting\n"); |
6380 | goto load_int_disable; | 6462 | goto load_error2; |
6381 | } | 6463 | } |
6382 | 6464 | ||
6383 | /* Setup NIC internals and enable interrupts */ | 6465 | /* Setup NIC internals and enable interrupts */ |
@@ -6389,25 +6471,16 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6389 | if (!load_code) { | 6471 | if (!load_code) { |
6390 | BNX2X_ERR("MCP response failure, aborting\n"); | 6472 | BNX2X_ERR("MCP response failure, aborting\n"); |
6391 | rc = -EBUSY; | 6473 | rc = -EBUSY; |
6392 | goto load_rings_free; | 6474 | goto load_error3; |
6393 | } | 6475 | } |
6394 | } | 6476 | } |
6395 | 6477 | ||
6396 | bnx2x_stats_init(bp); | ||
6397 | |||
6398 | bp->state = BNX2X_STATE_OPENING_WAIT4_PORT; | 6478 | bp->state = BNX2X_STATE_OPENING_WAIT4_PORT; |
6399 | 6479 | ||
6400 | /* Enable Rx interrupt handling before sending the ramrod | ||
6401 | as it's completed on Rx FP queue */ | ||
6402 | bnx2x_napi_enable(bp); | ||
6403 | |||
6404 | /* Enable interrupt handling */ | ||
6405 | atomic_set(&bp->intr_sem, 0); | ||
6406 | |||
6407 | rc = bnx2x_setup_leading(bp); | 6480 | rc = bnx2x_setup_leading(bp); |
6408 | if (rc) { | 6481 | if (rc) { |
6409 | BNX2X_ERR("Setup leading failed!\n"); | 6482 | BNX2X_ERR("Setup leading failed!\n"); |
6410 | goto load_netif_stop; | 6483 | goto load_error3; |
6411 | } | 6484 | } |
6412 | 6485 | ||
6413 | if (CHIP_IS_E1H(bp)) | 6486 | if (CHIP_IS_E1H(bp)) |
@@ -6420,7 +6493,7 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6420 | for_each_nondefault_queue(bp, i) { | 6493 | for_each_nondefault_queue(bp, i) { |
6421 | rc = bnx2x_setup_multi(bp, i); | 6494 | rc = bnx2x_setup_multi(bp, i); |
6422 | if (rc) | 6495 | if (rc) |
6423 | goto load_netif_stop; | 6496 | goto load_error3; |
6424 | } | 6497 | } |
6425 | 6498 | ||
6426 | if (CHIP_IS_E1(bp)) | 6499 | if (CHIP_IS_E1(bp)) |
@@ -6436,18 +6509,18 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6436 | case LOAD_NORMAL: | 6509 | case LOAD_NORMAL: |
6437 | /* Tx queue should be only reenabled */ | 6510 | /* Tx queue should be only reenabled */ |
6438 | netif_wake_queue(bp->dev); | 6511 | netif_wake_queue(bp->dev); |
6512 | /* Initialize the receive filter. */ | ||
6439 | bnx2x_set_rx_mode(bp->dev); | 6513 | bnx2x_set_rx_mode(bp->dev); |
6440 | break; | 6514 | break; |
6441 | 6515 | ||
6442 | case LOAD_OPEN: | 6516 | case LOAD_OPEN: |
6443 | netif_start_queue(bp->dev); | 6517 | netif_start_queue(bp->dev); |
6518 | /* Initialize the receive filter. */ | ||
6444 | bnx2x_set_rx_mode(bp->dev); | 6519 | bnx2x_set_rx_mode(bp->dev); |
6445 | if (bp->flags & USING_MSIX_FLAG) | ||
6446 | printk(KERN_INFO PFX "%s: using MSI-X\n", | ||
6447 | bp->dev->name); | ||
6448 | break; | 6520 | break; |
6449 | 6521 | ||
6450 | case LOAD_DIAG: | 6522 | case LOAD_DIAG: |
6523 | /* Initialize the receive filter. */ | ||
6451 | bnx2x_set_rx_mode(bp->dev); | 6524 | bnx2x_set_rx_mode(bp->dev); |
6452 | bp->state = BNX2X_STATE_DIAG; | 6525 | bp->state = BNX2X_STATE_DIAG; |
6453 | break; | 6526 | break; |
@@ -6465,20 +6538,25 @@ static int bnx2x_nic_load(struct bnx2x *bp, int load_mode) | |||
6465 | 6538 | ||
6466 | return 0; | 6539 | return 0; |
6467 | 6540 | ||
6468 | load_netif_stop: | 6541 | load_error3: |
6469 | bnx2x_napi_disable(bp); | 6542 | bnx2x_int_disable_sync(bp, 1); |
6470 | load_rings_free: | 6543 | if (!BP_NOMCP(bp)) { |
6544 | bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP); | ||
6545 | bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE); | ||
6546 | } | ||
6547 | bp->port.pmf = 0; | ||
6471 | /* Free SKBs, SGEs, TPA pool and driver internals */ | 6548 | /* Free SKBs, SGEs, TPA pool and driver internals */ |
6472 | bnx2x_free_skbs(bp); | 6549 | bnx2x_free_skbs(bp); |
6473 | for_each_queue(bp, i) | 6550 | for_each_queue(bp, i) |
6474 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); | 6551 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); |
6475 | load_int_disable: | 6552 | load_error2: |
6476 | bnx2x_int_disable_sync(bp, 1); | ||
6477 | /* Release IRQs */ | 6553 | /* Release IRQs */ |
6478 | bnx2x_free_irq(bp); | 6554 | bnx2x_free_irq(bp); |
6479 | load_error: | 6555 | load_error1: |
6556 | bnx2x_napi_disable(bp); | ||
6557 | for_each_queue(bp, i) | ||
6558 | netif_napi_del(&bnx2x_fp(bp, i, napi)); | ||
6480 | bnx2x_free_mem(bp); | 6559 | bnx2x_free_mem(bp); |
6481 | bp->port.pmf = 0; | ||
6482 | 6560 | ||
6483 | /* TBD we really need to reset the chip | 6561 | /* TBD we really need to reset the chip |
6484 | if we want to recover from this */ | 6562 | if we want to recover from this */ |
@@ -6551,6 +6629,7 @@ static int bnx2x_stop_leading(struct bnx2x *bp) | |||
6551 | } | 6629 | } |
6552 | cnt--; | 6630 | cnt--; |
6553 | msleep(1); | 6631 | msleep(1); |
6632 | rmb(); /* Refresh the dsb_sp_prod */ | ||
6554 | } | 6633 | } |
6555 | bp->state = BNX2X_STATE_CLOSING_WAIT4_UNLOAD; | 6634 | bp->state = BNX2X_STATE_CLOSING_WAIT4_UNLOAD; |
6556 | bp->fp[0].state = BNX2X_FP_STATE_CLOSED; | 6635 | bp->fp[0].state = BNX2X_FP_STATE_CLOSED; |
@@ -6602,14 +6681,6 @@ static void bnx2x_reset_port(struct bnx2x *bp) | |||
6602 | /* TODO: Close Doorbell port? */ | 6681 | /* TODO: Close Doorbell port? */ |
6603 | } | 6682 | } |
6604 | 6683 | ||
6605 | static void bnx2x_reset_common(struct bnx2x *bp) | ||
6606 | { | ||
6607 | /* reset_common */ | ||
6608 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_1_CLEAR, | ||
6609 | 0xd3ffff7f); | ||
6610 | REG_WR(bp, GRCBASE_MISC + MISC_REGISTERS_RESET_REG_2_CLEAR, 0x1403); | ||
6611 | } | ||
6612 | |||
6613 | static void bnx2x_reset_chip(struct bnx2x *bp, u32 reset_code) | 6684 | static void bnx2x_reset_chip(struct bnx2x *bp, u32 reset_code) |
6614 | { | 6685 | { |
6615 | DP(BNX2X_MSG_MCP, "function %d reset_code %x\n", | 6686 | DP(BNX2X_MSG_MCP, "function %d reset_code %x\n", |
@@ -6650,20 +6721,22 @@ static int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode) | |||
6650 | bnx2x_set_storm_rx_mode(bp); | 6721 | bnx2x_set_storm_rx_mode(bp); |
6651 | 6722 | ||
6652 | bnx2x_netif_stop(bp, 1); | 6723 | bnx2x_netif_stop(bp, 1); |
6653 | if (!netif_running(bp->dev)) | 6724 | |
6654 | bnx2x_napi_disable(bp); | ||
6655 | del_timer_sync(&bp->timer); | 6725 | del_timer_sync(&bp->timer); |
6656 | SHMEM_WR(bp, func_mb[BP_FUNC(bp)].drv_pulse_mb, | 6726 | SHMEM_WR(bp, func_mb[BP_FUNC(bp)].drv_pulse_mb, |
6657 | (DRV_PULSE_ALWAYS_ALIVE | bp->fw_drv_pulse_wr_seq)); | 6727 | (DRV_PULSE_ALWAYS_ALIVE | bp->fw_drv_pulse_wr_seq)); |
6658 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); | 6728 | bnx2x_stats_handle(bp, STATS_EVENT_STOP); |
6659 | 6729 | ||
6730 | /* Release IRQs */ | ||
6731 | bnx2x_free_irq(bp); | ||
6732 | |||
6660 | /* Wait until tx fast path tasks complete */ | 6733 | /* Wait until tx fast path tasks complete */ |
6661 | for_each_queue(bp, i) { | 6734 | for_each_queue(bp, i) { |
6662 | struct bnx2x_fastpath *fp = &bp->fp[i]; | 6735 | struct bnx2x_fastpath *fp = &bp->fp[i]; |
6663 | 6736 | ||
6664 | cnt = 1000; | 6737 | cnt = 1000; |
6665 | smp_rmb(); | 6738 | smp_rmb(); |
6666 | while (BNX2X_HAS_TX_WORK(fp)) { | 6739 | while (bnx2x_has_tx_work_unload(fp)) { |
6667 | 6740 | ||
6668 | bnx2x_tx_int(fp, 1000); | 6741 | bnx2x_tx_int(fp, 1000); |
6669 | if (!cnt) { | 6742 | if (!cnt) { |
@@ -6684,9 +6757,6 @@ static int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode) | |||
6684 | /* Give HW time to discard old tx messages */ | 6757 | /* Give HW time to discard old tx messages */ |
6685 | msleep(1); | 6758 | msleep(1); |
6686 | 6759 | ||
6687 | /* Release IRQs */ | ||
6688 | bnx2x_free_irq(bp); | ||
6689 | |||
6690 | if (CHIP_IS_E1(bp)) { | 6760 | if (CHIP_IS_E1(bp)) { |
6691 | struct mac_configuration_cmd *config = | 6761 | struct mac_configuration_cmd *config = |
6692 | bnx2x_sp(bp, mcast_config); | 6762 | bnx2x_sp(bp, mcast_config); |
@@ -6795,6 +6865,8 @@ unload_error: | |||
6795 | bnx2x_free_skbs(bp); | 6865 | bnx2x_free_skbs(bp); |
6796 | for_each_queue(bp, i) | 6866 | for_each_queue(bp, i) |
6797 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); | 6867 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); |
6868 | for_each_queue(bp, i) | ||
6869 | netif_napi_del(&bnx2x_fp(bp, i, napi)); | ||
6798 | bnx2x_free_mem(bp); | 6870 | bnx2x_free_mem(bp); |
6799 | 6871 | ||
6800 | bp->state = BNX2X_STATE_CLOSED; | 6872 | bp->state = BNX2X_STATE_CLOSED; |
@@ -6847,10 +6919,6 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6847 | */ | 6919 | */ |
6848 | bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | 6920 | bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); |
6849 | val = REG_RD(bp, DORQ_REG_NORM_CID_OFST); | 6921 | val = REG_RD(bp, DORQ_REG_NORM_CID_OFST); |
6850 | if (val == 0x7) | ||
6851 | REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); | ||
6852 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | ||
6853 | |||
6854 | if (val == 0x7) { | 6922 | if (val == 0x7) { |
6855 | u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; | 6923 | u32 reset_code = DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS; |
6856 | /* save our func */ | 6924 | /* save our func */ |
@@ -6858,6 +6926,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6858 | u32 swap_en; | 6926 | u32 swap_en; |
6859 | u32 swap_val; | 6927 | u32 swap_val; |
6860 | 6928 | ||
6929 | /* clear the UNDI indication */ | ||
6930 | REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0); | ||
6931 | |||
6861 | BNX2X_DEV_INFO("UNDI is active! reset device\n"); | 6932 | BNX2X_DEV_INFO("UNDI is active! reset device\n"); |
6862 | 6933 | ||
6863 | /* try unload UNDI on port 0 */ | 6934 | /* try unload UNDI on port 0 */ |
@@ -6883,6 +6954,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6883 | bnx2x_fw_command(bp, reset_code); | 6954 | bnx2x_fw_command(bp, reset_code); |
6884 | } | 6955 | } |
6885 | 6956 | ||
6957 | /* now it's safe to release the lock */ | ||
6958 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | ||
6959 | |||
6886 | REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 : | 6960 | REG_WR(bp, (BP_PORT(bp) ? HC_REG_CONFIG_1 : |
6887 | HC_REG_CONFIG_0), 0x1000); | 6961 | HC_REG_CONFIG_0), 0x1000); |
6888 | 6962 | ||
@@ -6927,7 +7001,9 @@ static void __devinit bnx2x_undi_unload(struct bnx2x *bp) | |||
6927 | bp->fw_seq = | 7001 | bp->fw_seq = |
6928 | (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) & | 7002 | (SHMEM_RD(bp, func_mb[bp->func].drv_mb_header) & |
6929 | DRV_MSG_SEQ_NUMBER_MASK); | 7003 | DRV_MSG_SEQ_NUMBER_MASK); |
6930 | } | 7004 | |
7005 | } else | ||
7006 | bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_UNDI); | ||
6931 | } | 7007 | } |
6932 | } | 7008 | } |
6933 | 7009 | ||
@@ -6944,7 +7020,7 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) | |||
6944 | id |= ((val & 0xf) << 12); | 7020 | id |= ((val & 0xf) << 12); |
6945 | val = REG_RD(bp, MISC_REG_CHIP_METAL); | 7021 | val = REG_RD(bp, MISC_REG_CHIP_METAL); |
6946 | id |= ((val & 0xff) << 4); | 7022 | id |= ((val & 0xff) << 4); |
6947 | REG_RD(bp, MISC_REG_BOND_ID); | 7023 | val = REG_RD(bp, MISC_REG_BOND_ID); |
6948 | id |= (val & 0xf); | 7024 | id |= (val & 0xf); |
6949 | bp->common.chip_id = id; | 7025 | bp->common.chip_id = id; |
6950 | bp->link_params.chip_id = bp->common.chip_id; | 7026 | bp->link_params.chip_id = bp->common.chip_id; |
@@ -7501,7 +7577,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) | |||
7501 | 7577 | ||
7502 | mutex_init(&bp->port.phy_mutex); | 7578 | mutex_init(&bp->port.phy_mutex); |
7503 | 7579 | ||
7504 | INIT_WORK(&bp->sp_task, bnx2x_sp_task); | 7580 | INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task); |
7505 | INIT_WORK(&bp->reset_task, bnx2x_reset_task); | 7581 | INIT_WORK(&bp->reset_task, bnx2x_reset_task); |
7506 | 7582 | ||
7507 | rc = bnx2x_get_hwinfo(bp); | 7583 | rc = bnx2x_get_hwinfo(bp); |
@@ -8076,6 +8152,9 @@ static int bnx2x_get_eeprom(struct net_device *dev, | |||
8076 | struct bnx2x *bp = netdev_priv(dev); | 8152 | struct bnx2x *bp = netdev_priv(dev); |
8077 | int rc; | 8153 | int rc; |
8078 | 8154 | ||
8155 | if (!netif_running(dev)) | ||
8156 | return -EAGAIN; | ||
8157 | |||
8079 | DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n" | 8158 | DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n" |
8080 | DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n", | 8159 | DP_LEVEL " magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n", |
8081 | eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset, | 8160 | eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset, |
@@ -8678,18 +8757,17 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up) | |||
8678 | 8757 | ||
8679 | if (loopback_mode == BNX2X_MAC_LOOPBACK) { | 8758 | if (loopback_mode == BNX2X_MAC_LOOPBACK) { |
8680 | bp->link_params.loopback_mode = LOOPBACK_BMAC; | 8759 | bp->link_params.loopback_mode = LOOPBACK_BMAC; |
8681 | bnx2x_acquire_phy_lock(bp); | ||
8682 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); | 8760 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); |
8683 | bnx2x_release_phy_lock(bp); | ||
8684 | 8761 | ||
8685 | } else if (loopback_mode == BNX2X_PHY_LOOPBACK) { | 8762 | } else if (loopback_mode == BNX2X_PHY_LOOPBACK) { |
8763 | u16 cnt = 1000; | ||
8686 | bp->link_params.loopback_mode = LOOPBACK_XGXS_10; | 8764 | bp->link_params.loopback_mode = LOOPBACK_XGXS_10; |
8687 | bnx2x_acquire_phy_lock(bp); | ||
8688 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); | 8765 | bnx2x_phy_init(&bp->link_params, &bp->link_vars); |
8689 | bnx2x_release_phy_lock(bp); | ||
8690 | /* wait until link state is restored */ | 8766 | /* wait until link state is restored */ |
8691 | bnx2x_wait_for_link(bp, link_up); | 8767 | if (link_up) |
8692 | 8768 | while (cnt-- && bnx2x_test_link(&bp->link_params, | |
8769 | &bp->link_vars)) | ||
8770 | msleep(10); | ||
8693 | } else | 8771 | } else |
8694 | return -EINVAL; | 8772 | return -EINVAL; |
8695 | 8773 | ||
@@ -8727,6 +8805,8 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode, u8 link_up) | |||
8727 | tx_bd->general_data = ((UNICAST_ADDRESS << | 8805 | tx_bd->general_data = ((UNICAST_ADDRESS << |
8728 | ETH_TX_BD_ETH_ADDR_TYPE_SHIFT) | 1); | 8806 | ETH_TX_BD_ETH_ADDR_TYPE_SHIFT) | 1); |
8729 | 8807 | ||
8808 | wmb(); | ||
8809 | |||
8730 | fp->hw_tx_prods->bds_prod = | 8810 | fp->hw_tx_prods->bds_prod = |
8731 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + 1); | 8811 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + 1); |
8732 | mb(); /* FW restriction: must not reorder writing nbd and packets */ | 8812 | mb(); /* FW restriction: must not reorder writing nbd and packets */ |
@@ -8778,7 +8858,6 @@ test_loopback_rx_exit: | |||
8778 | /* Update producers */ | 8858 | /* Update producers */ |
8779 | bnx2x_update_rx_prod(bp, fp, fp->rx_bd_prod, fp->rx_comp_prod, | 8859 | bnx2x_update_rx_prod(bp, fp, fp->rx_bd_prod, fp->rx_comp_prod, |
8780 | fp->rx_sge_prod); | 8860 | fp->rx_sge_prod); |
8781 | mmiowb(); /* keep prod updates ordered */ | ||
8782 | 8861 | ||
8783 | test_loopback_exit: | 8862 | test_loopback_exit: |
8784 | bp->link_params.loopback_mode = LOOPBACK_NONE; | 8863 | bp->link_params.loopback_mode = LOOPBACK_NONE; |
@@ -8794,6 +8873,7 @@ static int bnx2x_test_loopback(struct bnx2x *bp, u8 link_up) | |||
8794 | return BNX2X_LOOPBACK_FAILED; | 8873 | return BNX2X_LOOPBACK_FAILED; |
8795 | 8874 | ||
8796 | bnx2x_netif_stop(bp, 1); | 8875 | bnx2x_netif_stop(bp, 1); |
8876 | bnx2x_acquire_phy_lock(bp); | ||
8797 | 8877 | ||
8798 | if (bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK, link_up)) { | 8878 | if (bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK, link_up)) { |
8799 | DP(NETIF_MSG_PROBE, "MAC loopback failed\n"); | 8879 | DP(NETIF_MSG_PROBE, "MAC loopback failed\n"); |
@@ -8805,6 +8885,7 @@ static int bnx2x_test_loopback(struct bnx2x *bp, u8 link_up) | |||
8805 | rc |= BNX2X_PHY_LOOPBACK_FAILED; | 8885 | rc |= BNX2X_PHY_LOOPBACK_FAILED; |
8806 | } | 8886 | } |
8807 | 8887 | ||
8888 | bnx2x_release_phy_lock(bp); | ||
8808 | bnx2x_netif_start(bp); | 8889 | bnx2x_netif_start(bp); |
8809 | 8890 | ||
8810 | return rc; | 8891 | return rc; |
@@ -8878,7 +8959,10 @@ static int bnx2x_test_intr(struct bnx2x *bp) | |||
8878 | return -ENODEV; | 8959 | return -ENODEV; |
8879 | 8960 | ||
8880 | config->hdr.length_6b = 0; | 8961 | config->hdr.length_6b = 0; |
8881 | config->hdr.offset = 0; | 8962 | if (CHIP_IS_E1(bp)) |
8963 | config->hdr.offset = (BP_PORT(bp) ? 32 : 0); | ||
8964 | else | ||
8965 | config->hdr.offset = BP_FUNC(bp); | ||
8882 | config->hdr.client_id = BP_CL_ID(bp); | 8966 | config->hdr.client_id = BP_CL_ID(bp); |
8883 | config->hdr.reserved1 = 0; | 8967 | config->hdr.reserved1 = 0; |
8884 | 8968 | ||
@@ -9243,6 +9327,18 @@ static int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state) | |||
9243 | return 0; | 9327 | return 0; |
9244 | } | 9328 | } |
9245 | 9329 | ||
9330 | static inline int bnx2x_has_rx_work(struct bnx2x_fastpath *fp) | ||
9331 | { | ||
9332 | u16 rx_cons_sb; | ||
9333 | |||
9334 | /* Tell compiler that status block fields can change */ | ||
9335 | barrier(); | ||
9336 | rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb); | ||
9337 | if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT) | ||
9338 | rx_cons_sb++; | ||
9339 | return (fp->rx_comp_cons != rx_cons_sb); | ||
9340 | } | ||
9341 | |||
9246 | /* | 9342 | /* |
9247 | * net_device service functions | 9343 | * net_device service functions |
9248 | */ | 9344 | */ |
@@ -9253,7 +9349,6 @@ static int bnx2x_poll(struct napi_struct *napi, int budget) | |||
9253 | napi); | 9349 | napi); |
9254 | struct bnx2x *bp = fp->bp; | 9350 | struct bnx2x *bp = fp->bp; |
9255 | int work_done = 0; | 9351 | int work_done = 0; |
9256 | u16 rx_cons_sb; | ||
9257 | 9352 | ||
9258 | #ifdef BNX2X_STOP_ON_ERROR | 9353 | #ifdef BNX2X_STOP_ON_ERROR |
9259 | if (unlikely(bp->panic)) | 9354 | if (unlikely(bp->panic)) |
@@ -9266,19 +9361,12 @@ static int bnx2x_poll(struct napi_struct *napi, int budget) | |||
9266 | 9361 | ||
9267 | bnx2x_update_fpsb_idx(fp); | 9362 | bnx2x_update_fpsb_idx(fp); |
9268 | 9363 | ||
9269 | if (BNX2X_HAS_TX_WORK(fp)) | 9364 | if (bnx2x_has_tx_work(fp)) |
9270 | bnx2x_tx_int(fp, budget); | 9365 | bnx2x_tx_int(fp, budget); |
9271 | 9366 | ||
9272 | rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb); | 9367 | if (bnx2x_has_rx_work(fp)) |
9273 | if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT) | ||
9274 | rx_cons_sb++; | ||
9275 | if (BNX2X_HAS_RX_WORK(fp)) | ||
9276 | work_done = bnx2x_rx_int(fp, budget); | 9368 | work_done = bnx2x_rx_int(fp, budget); |
9277 | |||
9278 | rmb(); /* BNX2X_HAS_WORK() reads the status block */ | 9369 | rmb(); /* BNX2X_HAS_WORK() reads the status block */ |
9279 | rx_cons_sb = le16_to_cpu(*fp->rx_cons_sb); | ||
9280 | if ((rx_cons_sb & MAX_RCQ_DESC_CNT) == MAX_RCQ_DESC_CNT) | ||
9281 | rx_cons_sb++; | ||
9282 | 9370 | ||
9283 | /* must not complete if we consumed full budget */ | 9371 | /* must not complete if we consumed full budget */ |
9284 | if ((work_done < budget) && !BNX2X_HAS_WORK(fp)) { | 9372 | if ((work_done < budget) && !BNX2X_HAS_WORK(fp)) { |
@@ -9389,6 +9477,7 @@ static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) | |||
9389 | return rc; | 9477 | return rc; |
9390 | } | 9478 | } |
9391 | 9479 | ||
9480 | #if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3) | ||
9392 | /* check if packet requires linearization (packet is too fragmented) */ | 9481 | /* check if packet requires linearization (packet is too fragmented) */ |
9393 | static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb, | 9482 | static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb, |
9394 | u32 xmit_type) | 9483 | u32 xmit_type) |
@@ -9466,6 +9555,7 @@ exit_lbl: | |||
9466 | 9555 | ||
9467 | return to_copy; | 9556 | return to_copy; |
9468 | } | 9557 | } |
9558 | #endif | ||
9469 | 9559 | ||
9470 | /* called with netif_tx_lock | 9560 | /* called with netif_tx_lock |
9471 | * bnx2x_tx_int() runs without netif_tx_lock unless it needs to call | 9561 | * bnx2x_tx_int() runs without netif_tx_lock unless it needs to call |
@@ -9506,6 +9596,7 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9506 | skb->ip_summed, skb->protocol, ipv6_hdr(skb)->nexthdr, | 9596 | skb->ip_summed, skb->protocol, ipv6_hdr(skb)->nexthdr, |
9507 | ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type); | 9597 | ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type); |
9508 | 9598 | ||
9599 | #if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3) | ||
9509 | /* First, check if we need to linearize the skb | 9600 | /* First, check if we need to linearize the skb |
9510 | (due to FW restrictions) */ | 9601 | (due to FW restrictions) */ |
9511 | if (bnx2x_pkt_req_lin(bp, skb, xmit_type)) { | 9602 | if (bnx2x_pkt_req_lin(bp, skb, xmit_type)) { |
@@ -9518,6 +9609,7 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9518 | return NETDEV_TX_OK; | 9609 | return NETDEV_TX_OK; |
9519 | } | 9610 | } |
9520 | } | 9611 | } |
9612 | #endif | ||
9521 | 9613 | ||
9522 | /* | 9614 | /* |
9523 | Please read carefully. First we use one BD which we mark as start, | 9615 | Please read carefully. First we use one BD which we mark as start, |
@@ -9549,11 +9641,14 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9549 | "sending pkt %u @%p next_idx %u bd %u @%p\n", | 9641 | "sending pkt %u @%p next_idx %u bd %u @%p\n", |
9550 | pkt_prod, tx_buf, fp->tx_pkt_prod, bd_prod, tx_bd); | 9642 | pkt_prod, tx_buf, fp->tx_pkt_prod, bd_prod, tx_bd); |
9551 | 9643 | ||
9552 | if ((bp->vlgrp != NULL) && vlan_tx_tag_present(skb)) { | 9644 | #ifdef BCM_VLAN |
9645 | if ((bp->vlgrp != NULL) && vlan_tx_tag_present(skb) && | ||
9646 | (bp->flags & HW_VLAN_TX_FLAG)) { | ||
9553 | tx_bd->vlan = cpu_to_le16(vlan_tx_tag_get(skb)); | 9647 | tx_bd->vlan = cpu_to_le16(vlan_tx_tag_get(skb)); |
9554 | tx_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_VLAN_TAG; | 9648 | tx_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_VLAN_TAG; |
9555 | vlan_off += 4; | 9649 | vlan_off += 4; |
9556 | } else | 9650 | } else |
9651 | #endif | ||
9557 | tx_bd->vlan = cpu_to_le16(pkt_prod); | 9652 | tx_bd->vlan = cpu_to_le16(pkt_prod); |
9558 | 9653 | ||
9559 | if (xmit_type) { | 9654 | if (xmit_type) { |
@@ -9705,6 +9800,15 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9705 | 9800 | ||
9706 | DP(NETIF_MSG_TX_QUEUED, "doorbell: nbd %d bd %u\n", nbd, bd_prod); | 9801 | DP(NETIF_MSG_TX_QUEUED, "doorbell: nbd %d bd %u\n", nbd, bd_prod); |
9707 | 9802 | ||
9803 | /* | ||
9804 | * Make sure that the BD data is updated before updating the producer | ||
9805 | * since FW might read the BD right after the producer is updated. | ||
9806 | * This is only applicable for weak-ordered memory model archs such | ||
9807 | * as IA-64. The following barrier is also mandatory since FW will | ||
9808 | * assumes packets must have BDs. | ||
9809 | */ | ||
9810 | wmb(); | ||
9811 | |||
9708 | fp->hw_tx_prods->bds_prod = | 9812 | fp->hw_tx_prods->bds_prod = |
9709 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + nbd); | 9813 | cpu_to_le16(le16_to_cpu(fp->hw_tx_prods->bds_prod) + nbd); |
9710 | mb(); /* FW restriction: must not reorder writing nbd and packets */ | 9814 | mb(); /* FW restriction: must not reorder writing nbd and packets */ |
@@ -9718,6 +9822,9 @@ static int bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
9718 | dev->trans_start = jiffies; | 9822 | dev->trans_start = jiffies; |
9719 | 9823 | ||
9720 | if (unlikely(bnx2x_tx_avail(fp) < MAX_SKB_FRAGS + 3)) { | 9824 | if (unlikely(bnx2x_tx_avail(fp) < MAX_SKB_FRAGS + 3)) { |
9825 | /* We want bnx2x_tx_int to "see" the updated tx_bd_prod | ||
9826 | if we put Tx into XOFF state. */ | ||
9827 | smp_mb(); | ||
9721 | netif_stop_queue(dev); | 9828 | netif_stop_queue(dev); |
9722 | bp->eth_stats.driver_xoff++; | 9829 | bp->eth_stats.driver_xoff++; |
9723 | if (bnx2x_tx_avail(fp) >= MAX_SKB_FRAGS + 3) | 9830 | if (bnx2x_tx_avail(fp) >= MAX_SKB_FRAGS + 3) |
@@ -9733,6 +9840,8 @@ static int bnx2x_open(struct net_device *dev) | |||
9733 | { | 9840 | { |
9734 | struct bnx2x *bp = netdev_priv(dev); | 9841 | struct bnx2x *bp = netdev_priv(dev); |
9735 | 9842 | ||
9843 | netif_carrier_off(dev); | ||
9844 | |||
9736 | bnx2x_set_power_state(bp, PCI_D0); | 9845 | bnx2x_set_power_state(bp, PCI_D0); |
9737 | 9846 | ||
9738 | return bnx2x_nic_load(bp, LOAD_OPEN); | 9847 | return bnx2x_nic_load(bp, LOAD_OPEN); |
@@ -9816,7 +9925,7 @@ static void bnx2x_set_rx_mode(struct net_device *dev) | |||
9816 | for (; i < old; i++) { | 9925 | for (; i < old; i++) { |
9817 | if (CAM_IS_INVALID(config-> | 9926 | if (CAM_IS_INVALID(config-> |
9818 | config_table[i])) { | 9927 | config_table[i])) { |
9819 | i--; /* already invalidated */ | 9928 | /* already invalidated */ |
9820 | break; | 9929 | break; |
9821 | } | 9930 | } |
9822 | /* invalidate */ | 9931 | /* invalidate */ |
@@ -9987,6 +10096,16 @@ static void bnx2x_vlan_rx_register(struct net_device *dev, | |||
9987 | struct bnx2x *bp = netdev_priv(dev); | 10096 | struct bnx2x *bp = netdev_priv(dev); |
9988 | 10097 | ||
9989 | bp->vlgrp = vlgrp; | 10098 | bp->vlgrp = vlgrp; |
10099 | |||
10100 | /* Set flags according to the required capabilities */ | ||
10101 | bp->flags &= ~(HW_VLAN_RX_FLAG | HW_VLAN_TX_FLAG); | ||
10102 | |||
10103 | if (dev->features & NETIF_F_HW_VLAN_TX) | ||
10104 | bp->flags |= HW_VLAN_TX_FLAG; | ||
10105 | |||
10106 | if (dev->features & NETIF_F_HW_VLAN_RX) | ||
10107 | bp->flags |= HW_VLAN_RX_FLAG; | ||
10108 | |||
9990 | if (netif_running(dev)) | 10109 | if (netif_running(dev)) |
9991 | bnx2x_set_client_config(bp); | 10110 | bnx2x_set_client_config(bp); |
9992 | } | 10111 | } |
@@ -10143,6 +10262,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev, | |||
10143 | dev->features |= NETIF_F_HIGHDMA; | 10262 | dev->features |= NETIF_F_HIGHDMA; |
10144 | #ifdef BCM_VLAN | 10263 | #ifdef BCM_VLAN |
10145 | dev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); | 10264 | dev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX); |
10265 | bp->flags |= (HW_VLAN_RX_FLAG | HW_VLAN_TX_FLAG); | ||
10146 | #endif | 10266 | #endif |
10147 | dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN); | 10267 | dev->features |= (NETIF_F_TSO | NETIF_F_TSO_ECN); |
10148 | dev->features |= NETIF_F_TSO6; | 10268 | dev->features |= NETIF_F_TSO6; |
@@ -10215,22 +10335,18 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, | |||
10215 | return rc; | 10335 | return rc; |
10216 | } | 10336 | } |
10217 | 10337 | ||
10218 | rc = register_netdev(dev); | ||
10219 | if (rc) { | ||
10220 | dev_err(&pdev->dev, "Cannot register net device\n"); | ||
10221 | goto init_one_exit; | ||
10222 | } | ||
10223 | |||
10224 | pci_set_drvdata(pdev, dev); | 10338 | pci_set_drvdata(pdev, dev); |
10225 | 10339 | ||
10226 | rc = bnx2x_init_bp(bp); | 10340 | rc = bnx2x_init_bp(bp); |
10341 | if (rc) | ||
10342 | goto init_one_exit; | ||
10343 | |||
10344 | rc = register_netdev(dev); | ||
10227 | if (rc) { | 10345 | if (rc) { |
10228 | unregister_netdev(dev); | 10346 | dev_err(&pdev->dev, "Cannot register net device\n"); |
10229 | goto init_one_exit; | 10347 | goto init_one_exit; |
10230 | } | 10348 | } |
10231 | 10349 | ||
10232 | netif_carrier_off(dev); | ||
10233 | |||
10234 | bp->common.name = board_info[ent->driver_data].name; | 10350 | bp->common.name = board_info[ent->driver_data].name; |
10235 | printk(KERN_INFO "%s: %s (%c%d) PCI-E x%d %s found at mem %lx," | 10351 | printk(KERN_INFO "%s: %s (%c%d) PCI-E x%d %s found at mem %lx," |
10236 | " IRQ %d, ", dev->name, bp->common.name, | 10352 | " IRQ %d, ", dev->name, bp->common.name, |
@@ -10378,6 +10494,8 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) | |||
10378 | bnx2x_free_skbs(bp); | 10494 | bnx2x_free_skbs(bp); |
10379 | for_each_queue(bp, i) | 10495 | for_each_queue(bp, i) |
10380 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); | 10496 | bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE); |
10497 | for_each_queue(bp, i) | ||
10498 | netif_napi_del(&bnx2x_fp(bp, i, napi)); | ||
10381 | bnx2x_free_mem(bp); | 10499 | bnx2x_free_mem(bp); |
10382 | 10500 | ||
10383 | bp->state = BNX2X_STATE_CLOSED; | 10501 | bp->state = BNX2X_STATE_CLOSED; |
@@ -10519,12 +10637,20 @@ static struct pci_driver bnx2x_pci_driver = { | |||
10519 | 10637 | ||
10520 | static int __init bnx2x_init(void) | 10638 | static int __init bnx2x_init(void) |
10521 | { | 10639 | { |
10640 | bnx2x_wq = create_singlethread_workqueue("bnx2x"); | ||
10641 | if (bnx2x_wq == NULL) { | ||
10642 | printk(KERN_ERR PFX "Cannot create workqueue\n"); | ||
10643 | return -ENOMEM; | ||
10644 | } | ||
10645 | |||
10522 | return pci_register_driver(&bnx2x_pci_driver); | 10646 | return pci_register_driver(&bnx2x_pci_driver); |
10523 | } | 10647 | } |
10524 | 10648 | ||
10525 | static void __exit bnx2x_cleanup(void) | 10649 | static void __exit bnx2x_cleanup(void) |
10526 | { | 10650 | { |
10527 | pci_unregister_driver(&bnx2x_pci_driver); | 10651 | pci_unregister_driver(&bnx2x_pci_driver); |
10652 | |||
10653 | destroy_workqueue(bnx2x_wq); | ||
10528 | } | 10654 | } |
10529 | 10655 | ||
10530 | module_init(bnx2x_init); | 10656 | module_init(bnx2x_init); |
diff --git a/drivers/net/bnx2x_reg.h b/drivers/net/bnx2x_reg.h index a67b0c358ae4..d084e5fc4b51 100644 --- a/drivers/net/bnx2x_reg.h +++ b/drivers/net/bnx2x_reg.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* bnx2x_reg.h: Broadcom Everest network driver. | 1 | /* bnx2x_reg.h: Broadcom Everest network driver. |
2 | * | 2 | * |
3 | * Copyright (c) 2007-2008 Broadcom Corporation | 3 | * Copyright (c) 2007-2009 Broadcom Corporation |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 840b3d1a22f5..bbbc3bb08aa5 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -806,7 +806,7 @@ static int cas_reset_mii_phy(struct cas *cp) | |||
806 | 806 | ||
807 | cas_phy_write(cp, MII_BMCR, BMCR_RESET); | 807 | cas_phy_write(cp, MII_BMCR, BMCR_RESET); |
808 | udelay(100); | 808 | udelay(100); |
809 | while (limit--) { | 809 | while (--limit) { |
810 | val = cas_phy_read(cp, MII_BMCR); | 810 | val = cas_phy_read(cp, MII_BMCR); |
811 | if ((val & BMCR_RESET) == 0) | 811 | if ((val & BMCR_RESET) == 0) |
812 | break; | 812 | break; |
@@ -979,7 +979,7 @@ static void cas_phy_init(struct cas *cp) | |||
979 | writel(val, cp->regs + REG_PCS_MII_CTRL); | 979 | writel(val, cp->regs + REG_PCS_MII_CTRL); |
980 | 980 | ||
981 | limit = STOP_TRIES; | 981 | limit = STOP_TRIES; |
982 | while (limit-- > 0) { | 982 | while (--limit > 0) { |
983 | udelay(10); | 983 | udelay(10); |
984 | if ((readl(cp->regs + REG_PCS_MII_CTRL) & | 984 | if ((readl(cp->regs + REG_PCS_MII_CTRL) & |
985 | PCS_MII_RESET) == 0) | 985 | PCS_MII_RESET) == 0) |
diff --git a/drivers/net/cxgb3/adapter.h b/drivers/net/cxgb3/adapter.h index 5b346f9eaa8b..a89d8cc51205 100644 --- a/drivers/net/cxgb3/adapter.h +++ b/drivers/net/cxgb3/adapter.h | |||
@@ -50,12 +50,17 @@ struct vlan_group; | |||
50 | struct adapter; | 50 | struct adapter; |
51 | struct sge_qset; | 51 | struct sge_qset; |
52 | 52 | ||
53 | enum { /* rx_offload flags */ | ||
54 | T3_RX_CSUM = 1 << 0, | ||
55 | T3_LRO = 1 << 1, | ||
56 | }; | ||
57 | |||
53 | struct port_info { | 58 | struct port_info { |
54 | struct adapter *adapter; | 59 | struct adapter *adapter; |
55 | struct vlan_group *vlan_grp; | 60 | struct vlan_group *vlan_grp; |
56 | struct sge_qset *qs; | 61 | struct sge_qset *qs; |
57 | u8 port_id; | 62 | u8 port_id; |
58 | u8 rx_csum_offload; | 63 | u8 rx_offload; |
59 | u8 nqsets; | 64 | u8 nqsets; |
60 | u8 first_qset; | 65 | u8 first_qset; |
61 | struct cphy phy; | 66 | struct cphy phy; |
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 2847f947499d..0089746b8d02 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -546,7 +546,7 @@ static int setup_sge_qsets(struct adapter *adap) | |||
546 | pi->qs = &adap->sge.qs[pi->first_qset]; | 546 | pi->qs = &adap->sge.qs[pi->first_qset]; |
547 | for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; | 547 | for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; |
548 | ++j, ++qset_idx) { | 548 | ++j, ++qset_idx) { |
549 | set_qset_lro(dev, qset_idx, pi->rx_csum_offload); | 549 | set_qset_lro(dev, qset_idx, pi->rx_offload & T3_LRO); |
550 | err = t3_sge_alloc_qset(adap, qset_idx, 1, | 550 | err = t3_sge_alloc_qset(adap, qset_idx, 1, |
551 | (adap->flags & USING_MSIX) ? qset_idx + 1 : | 551 | (adap->flags & USING_MSIX) ? qset_idx + 1 : |
552 | irq_idx, | 552 | irq_idx, |
@@ -1657,17 +1657,19 @@ static u32 get_rx_csum(struct net_device *dev) | |||
1657 | { | 1657 | { |
1658 | struct port_info *p = netdev_priv(dev); | 1658 | struct port_info *p = netdev_priv(dev); |
1659 | 1659 | ||
1660 | return p->rx_csum_offload; | 1660 | return p->rx_offload & T3_RX_CSUM; |
1661 | } | 1661 | } |
1662 | 1662 | ||
1663 | static int set_rx_csum(struct net_device *dev, u32 data) | 1663 | static int set_rx_csum(struct net_device *dev, u32 data) |
1664 | { | 1664 | { |
1665 | struct port_info *p = netdev_priv(dev); | 1665 | struct port_info *p = netdev_priv(dev); |
1666 | 1666 | ||
1667 | p->rx_csum_offload = data; | 1667 | if (data) { |
1668 | if (!data) { | 1668 | p->rx_offload |= T3_RX_CSUM; |
1669 | } else { | ||
1669 | int i; | 1670 | int i; |
1670 | 1671 | ||
1672 | p->rx_offload &= ~(T3_RX_CSUM | T3_LRO); | ||
1671 | for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) | 1673 | for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) |
1672 | set_qset_lro(dev, i, 0); | 1674 | set_qset_lro(dev, i, 0); |
1673 | } | 1675 | } |
@@ -1830,15 +1832,18 @@ static int cxgb3_set_flags(struct net_device *dev, u32 data) | |||
1830 | int i; | 1832 | int i; |
1831 | 1833 | ||
1832 | if (data & ETH_FLAG_LRO) { | 1834 | if (data & ETH_FLAG_LRO) { |
1833 | if (!pi->rx_csum_offload) | 1835 | if (!(pi->rx_offload & T3_RX_CSUM)) |
1834 | return -EINVAL; | 1836 | return -EINVAL; |
1835 | 1837 | ||
1838 | pi->rx_offload |= T3_LRO; | ||
1836 | for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) | 1839 | for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) |
1837 | set_qset_lro(dev, i, 1); | 1840 | set_qset_lro(dev, i, 1); |
1838 | 1841 | ||
1839 | } else | 1842 | } else { |
1843 | pi->rx_offload &= ~T3_LRO; | ||
1840 | for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) | 1844 | for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++) |
1841 | set_qset_lro(dev, i, 0); | 1845 | set_qset_lro(dev, i, 0); |
1846 | } | ||
1842 | 1847 | ||
1843 | return 0; | 1848 | return 0; |
1844 | } | 1849 | } |
@@ -1926,7 +1931,7 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr) | |||
1926 | pi = adap2pinfo(adapter, i); | 1931 | pi = adap2pinfo(adapter, i); |
1927 | if (t.qset_idx >= pi->first_qset && | 1932 | if (t.qset_idx >= pi->first_qset && |
1928 | t.qset_idx < pi->first_qset + pi->nqsets && | 1933 | t.qset_idx < pi->first_qset + pi->nqsets && |
1929 | !pi->rx_csum_offload) | 1934 | !(pi->rx_offload & T3_RX_CSUM)) |
1930 | return -EINVAL; | 1935 | return -EINVAL; |
1931 | } | 1936 | } |
1932 | 1937 | ||
@@ -2946,7 +2951,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
2946 | adapter->port[i] = netdev; | 2951 | adapter->port[i] = netdev; |
2947 | pi = netdev_priv(netdev); | 2952 | pi = netdev_priv(netdev); |
2948 | pi->adapter = adapter; | 2953 | pi->adapter = adapter; |
2949 | pi->rx_csum_offload = 1; | 2954 | pi->rx_offload = T3_RX_CSUM | T3_LRO; |
2950 | pi->port_id = i; | 2955 | pi->port_id = i; |
2951 | netif_carrier_off(netdev); | 2956 | netif_carrier_off(netdev); |
2952 | netif_tx_stop_all_queues(netdev); | 2957 | netif_tx_stop_all_queues(netdev); |
@@ -2955,6 +2960,7 @@ static int __devinit init_one(struct pci_dev *pdev, | |||
2955 | netdev->mem_end = mmio_start + mmio_len - 1; | 2960 | netdev->mem_end = mmio_start + mmio_len - 1; |
2956 | netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; | 2961 | netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO; |
2957 | netdev->features |= NETIF_F_LLTX; | 2962 | netdev->features |= NETIF_F_LLTX; |
2963 | netdev->features |= NETIF_F_LRO; | ||
2958 | if (pci_using_dac) | 2964 | if (pci_using_dac) |
2959 | netdev->features |= NETIF_F_HIGHDMA; | 2965 | netdev->features |= NETIF_F_HIGHDMA; |
2960 | 2966 | ||
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 6c641a889471..d31791f60292 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c | |||
@@ -1932,7 +1932,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq, | |||
1932 | skb_pull(skb, sizeof(*p) + pad); | 1932 | skb_pull(skb, sizeof(*p) + pad); |
1933 | skb->protocol = eth_type_trans(skb, adap->port[p->iff]); | 1933 | skb->protocol = eth_type_trans(skb, adap->port[p->iff]); |
1934 | pi = netdev_priv(skb->dev); | 1934 | pi = netdev_priv(skb->dev); |
1935 | if (pi->rx_csum_offload && p->csum_valid && p->csum == htons(0xffff) && | 1935 | if ((pi->rx_offload & T3_RX_CSUM) && p->csum_valid && p->csum == htons(0xffff) && |
1936 | !p->fragment) { | 1936 | !p->fragment) { |
1937 | qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++; | 1937 | qs->port_stats[SGE_PSTAT_RX_CSUM_GOOD]++; |
1938 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1938 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
@@ -2104,6 +2104,7 @@ static void init_lro_mgr(struct sge_qset *qs, struct net_lro_mgr *lro_mgr) | |||
2104 | { | 2104 | { |
2105 | lro_mgr->dev = qs->netdev; | 2105 | lro_mgr->dev = qs->netdev; |
2106 | lro_mgr->features = LRO_F_NAPI; | 2106 | lro_mgr->features = LRO_F_NAPI; |
2107 | lro_mgr->frag_align_pad = NET_IP_ALIGN; | ||
2107 | lro_mgr->ip_summed = CHECKSUM_UNNECESSARY; | 2108 | lro_mgr->ip_summed = CHECKSUM_UNNECESSARY; |
2108 | lro_mgr->ip_summed_aggr = CHECKSUM_UNNECESSARY; | 2109 | lro_mgr->ip_summed_aggr = CHECKSUM_UNNECESSARY; |
2109 | lro_mgr->max_desc = T3_MAX_LRO_SES; | 2110 | lro_mgr->max_desc = T3_MAX_LRO_SES; |
@@ -2275,8 +2276,7 @@ no_mem: | |||
2275 | } else if ((len = ntohl(r->len_cq)) != 0) { | 2276 | } else if ((len = ntohl(r->len_cq)) != 0) { |
2276 | struct sge_fl *fl; | 2277 | struct sge_fl *fl; |
2277 | 2278 | ||
2278 | if (eth) | 2279 | lro &= eth && is_eth_tcp(rss_hi); |
2279 | lro = qs->lro_enabled && is_eth_tcp(rss_hi); | ||
2280 | 2280 | ||
2281 | fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0]; | 2281 | fl = (len & F_RSPD_FLQ) ? &qs->fl[1] : &qs->fl[0]; |
2282 | if (fl->use_pages) { | 2282 | if (fl->use_pages) { |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 26474c92193f..6bd63cc67b3e 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | char e1000_driver_name[] = "e1000"; | 32 | char e1000_driver_name[] = "e1000"; |
33 | static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; | 33 | static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; |
34 | #define DRV_VERSION "7.3.20-k3-NAPI" | 34 | #define DRV_VERSION "7.3.21-k3-NAPI" |
35 | const char e1000_driver_version[] = DRV_VERSION; | 35 | const char e1000_driver_version[] = DRV_VERSION; |
36 | static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; | 36 | static const char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation."; |
37 | 37 | ||
@@ -940,7 +940,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, | |||
940 | err = pci_enable_device(pdev); | 940 | err = pci_enable_device(pdev); |
941 | } else { | 941 | } else { |
942 | bars = pci_select_bars(pdev, IORESOURCE_MEM); | 942 | bars = pci_select_bars(pdev, IORESOURCE_MEM); |
943 | err = pci_enable_device(pdev); | 943 | err = pci_enable_device_mem(pdev); |
944 | } | 944 | } |
945 | if (err) | 945 | if (err) |
946 | return err; | 946 | return err; |
@@ -3712,7 +3712,7 @@ static irqreturn_t e1000_intr(int irq, void *data) | |||
3712 | struct e1000_hw *hw = &adapter->hw; | 3712 | struct e1000_hw *hw = &adapter->hw; |
3713 | u32 rctl, icr = er32(ICR); | 3713 | u32 rctl, icr = er32(ICR); |
3714 | 3714 | ||
3715 | if (unlikely(!icr)) | 3715 | if (unlikely((!icr) || test_bit(__E1000_RESETTING, &adapter->flags))) |
3716 | return IRQ_NONE; /* Not our interrupt */ | 3716 | return IRQ_NONE; /* Not our interrupt */ |
3717 | 3717 | ||
3718 | /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is | 3718 | /* IMS will not auto-mask if INT_ASSERTED is not set, and if it is |
diff --git a/drivers/net/e1000e/82571.c b/drivers/net/e1000e/82571.c index cf43ee743b3c..0890162953e9 100644 --- a/drivers/net/e1000e/82571.c +++ b/drivers/net/e1000e/82571.c | |||
@@ -981,11 +981,15 @@ static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw) | |||
981 | ew32(PBA_ECC, reg); | 981 | ew32(PBA_ECC, reg); |
982 | } | 982 | } |
983 | 983 | ||
984 | /* PCI-Ex Control Register */ | 984 | /* PCI-Ex Control Registers */ |
985 | if (hw->mac.type == e1000_82574) { | 985 | if (hw->mac.type == e1000_82574) { |
986 | reg = er32(GCR); | 986 | reg = er32(GCR); |
987 | reg |= (1 << 22); | 987 | reg |= (1 << 22); |
988 | ew32(GCR, reg); | 988 | ew32(GCR, reg); |
989 | |||
990 | reg = er32(GCR2); | ||
991 | reg |= 1; | ||
992 | ew32(GCR2, reg); | ||
989 | } | 993 | } |
990 | 994 | ||
991 | return; | 995 | return; |
diff --git a/drivers/net/e1000e/hw.h b/drivers/net/e1000e/hw.h index f25e961c6b3b..2d4ce0492df0 100644 --- a/drivers/net/e1000e/hw.h +++ b/drivers/net/e1000e/hw.h | |||
@@ -206,6 +206,7 @@ enum e1e_registers { | |||
206 | E1000_MANC2H = 0x05860, /* Management Control To Host - RW */ | 206 | E1000_MANC2H = 0x05860, /* Management Control To Host - RW */ |
207 | E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */ | 207 | E1000_SW_FW_SYNC = 0x05B5C, /* Software-Firmware Synchronization - RW */ |
208 | E1000_GCR = 0x05B00, /* PCI-Ex Control */ | 208 | E1000_GCR = 0x05B00, /* PCI-Ex Control */ |
209 | E1000_GCR2 = 0x05B64, /* PCI-Ex Control #2 */ | ||
209 | E1000_FACTPS = 0x05B30, /* Function Active and Power State to MNG */ | 210 | E1000_FACTPS = 0x05B30, /* Function Active and Power State to MNG */ |
210 | E1000_SWSM = 0x05B50, /* SW Semaphore */ | 211 | E1000_SWSM = 0x05B50, /* SW Semaphore */ |
211 | E1000_FWSM = 0x05B54, /* FW Semaphore */ | 212 | E1000_FWSM = 0x05B54, /* FW Semaphore */ |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index f2a5963b5a95..e415e81ecd3e 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -390,7 +390,8 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) | |||
390 | } | 390 | } |
391 | 391 | ||
392 | static DEFINE_MUTEX(nvm_mutex); | 392 | static DEFINE_MUTEX(nvm_mutex); |
393 | static pid_t nvm_owner = -1; | 393 | static pid_t nvm_owner_pid = -1; |
394 | static char nvm_owner_name[TASK_COMM_LEN] = ""; | ||
394 | 395 | ||
395 | /** | 396 | /** |
396 | * e1000_acquire_swflag_ich8lan - Acquire software control flag | 397 | * e1000_acquire_swflag_ich8lan - Acquire software control flag |
@@ -408,11 +409,15 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) | |||
408 | might_sleep(); | 409 | might_sleep(); |
409 | 410 | ||
410 | if (!mutex_trylock(&nvm_mutex)) { | 411 | if (!mutex_trylock(&nvm_mutex)) { |
411 | WARN(1, KERN_ERR "e1000e mutex contention. Owned by pid %d\n", | 412 | WARN(1, KERN_ERR "e1000e mutex contention. Owned by process " |
412 | nvm_owner); | 413 | "%s (pid %d), required by process %s (pid %d)\n", |
414 | nvm_owner_name, nvm_owner_pid, | ||
415 | current->comm, current->pid); | ||
416 | |||
413 | mutex_lock(&nvm_mutex); | 417 | mutex_lock(&nvm_mutex); |
414 | } | 418 | } |
415 | nvm_owner = current->pid; | 419 | nvm_owner_pid = current->pid; |
420 | strncpy(nvm_owner_name, current->comm, TASK_COMM_LEN); | ||
416 | 421 | ||
417 | while (timeout) { | 422 | while (timeout) { |
418 | extcnf_ctrl = er32(EXTCNF_CTRL); | 423 | extcnf_ctrl = er32(EXTCNF_CTRL); |
@@ -430,7 +435,8 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) | |||
430 | hw_dbg(hw, "FW or HW has locked the resource for too long.\n"); | 435 | hw_dbg(hw, "FW or HW has locked the resource for too long.\n"); |
431 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; | 436 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; |
432 | ew32(EXTCNF_CTRL, extcnf_ctrl); | 437 | ew32(EXTCNF_CTRL, extcnf_ctrl); |
433 | nvm_owner = -1; | 438 | nvm_owner_pid = -1; |
439 | strcpy(nvm_owner_name, ""); | ||
434 | mutex_unlock(&nvm_mutex); | 440 | mutex_unlock(&nvm_mutex); |
435 | return -E1000_ERR_CONFIG; | 441 | return -E1000_ERR_CONFIG; |
436 | } | 442 | } |
@@ -454,7 +460,8 @@ static void e1000_release_swflag_ich8lan(struct e1000_hw *hw) | |||
454 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; | 460 | extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; |
455 | ew32(EXTCNF_CTRL, extcnf_ctrl); | 461 | ew32(EXTCNF_CTRL, extcnf_ctrl); |
456 | 462 | ||
457 | nvm_owner = -1; | 463 | nvm_owner_pid = -1; |
464 | strcpy(nvm_owner_name, ""); | ||
458 | mutex_unlock(&nvm_mutex); | 465 | mutex_unlock(&nvm_mutex); |
459 | } | 466 | } |
460 | 467 | ||
diff --git a/drivers/net/e2100.c b/drivers/net/e2100.c index 20eb05cddb83..b07ba1924de0 100644 --- a/drivers/net/e2100.c +++ b/drivers/net/e2100.c | |||
@@ -169,6 +169,7 @@ static const struct net_device_ops e21_netdev_ops = { | |||
169 | .ndo_get_stats = ei_get_stats, | 169 | .ndo_get_stats = ei_get_stats, |
170 | .ndo_set_multicast_list = ei_set_multicast_list, | 170 | .ndo_set_multicast_list = ei_set_multicast_list, |
171 | .ndo_validate_addr = eth_validate_addr, | 171 | .ndo_validate_addr = eth_validate_addr, |
172 | .ndo_set_mac_address = eth_mac_addr, | ||
172 | .ndo_change_mtu = eth_change_mtu, | 173 | .ndo_change_mtu = eth_change_mtu, |
173 | #ifdef CONFIG_NET_POLL_CONTROLLER | 174 | #ifdef CONFIG_NET_POLL_CONTROLLER |
174 | .ndo_poll_controller = ei_poll, | 175 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index e3131ea629cd..dfe92264e825 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -132,7 +132,7 @@ void ehea_dump(void *adr, int len, char *msg) | |||
132 | int x; | 132 | int x; |
133 | unsigned char *deb = adr; | 133 | unsigned char *deb = adr; |
134 | for (x = 0; x < len; x += 16) { | 134 | for (x = 0; x < len; x += 16) { |
135 | printk(DRV_NAME " %s adr=%p ofs=%04x %016lx %016lx\n", msg, | 135 | printk(DRV_NAME " %s adr=%p ofs=%04x %016llx %016llx\n", msg, |
136 | deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8])); | 136 | deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8])); |
137 | deb += 16; | 137 | deb += 16; |
138 | } | 138 | } |
@@ -883,7 +883,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param) | |||
883 | 883 | ||
884 | while (eqe) { | 884 | while (eqe) { |
885 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); | 885 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); |
886 | ehea_error("QP aff_err: entry=0x%lx, token=0x%x", | 886 | ehea_error("QP aff_err: entry=0x%llx, token=0x%x", |
887 | eqe->entry, qp_token); | 887 | eqe->entry, qp_token); |
888 | 888 | ||
889 | qp = port->port_res[qp_token].qp; | 889 | qp = port->port_res[qp_token].qp; |
@@ -1159,7 +1159,7 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe) | |||
1159 | netif_stop_queue(port->netdev); | 1159 | netif_stop_queue(port->netdev); |
1160 | break; | 1160 | break; |
1161 | default: | 1161 | default: |
1162 | ehea_error("unknown event code %x, eqe=0x%lX", ec, eqe); | 1162 | ehea_error("unknown event code %x, eqe=0x%llX", ec, eqe); |
1163 | break; | 1163 | break; |
1164 | } | 1164 | } |
1165 | } | 1165 | } |
@@ -1971,7 +1971,7 @@ static void ehea_set_multicast_list(struct net_device *dev) | |||
1971 | } | 1971 | } |
1972 | 1972 | ||
1973 | if (dev->mc_count > port->adapter->max_mc_mac) { | 1973 | if (dev->mc_count > port->adapter->max_mc_mac) { |
1974 | ehea_info("Mcast registration limit reached (0x%lx). " | 1974 | ehea_info("Mcast registration limit reached (0x%llx). " |
1975 | "Use ALLMULTI!", | 1975 | "Use ALLMULTI!", |
1976 | port->adapter->max_mc_mac); | 1976 | port->adapter->max_mc_mac); |
1977 | goto out; | 1977 | goto out; |
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index 225c692b5d99..49d766ebbcf4 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c | |||
@@ -168,7 +168,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
168 | cq->fw_handle, rpage, 1); | 168 | cq->fw_handle, rpage, 1); |
169 | if (hret < H_SUCCESS) { | 169 | if (hret < H_SUCCESS) { |
170 | ehea_error("register_rpage_cq failed ehea_cq=%p " | 170 | ehea_error("register_rpage_cq failed ehea_cq=%p " |
171 | "hret=%lx counter=%i act_pages=%i", | 171 | "hret=%llx counter=%i act_pages=%i", |
172 | cq, hret, counter, cq->attr.nr_pages); | 172 | cq, hret, counter, cq->attr.nr_pages); |
173 | goto out_kill_hwq; | 173 | goto out_kill_hwq; |
174 | } | 174 | } |
@@ -178,13 +178,13 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
178 | 178 | ||
179 | if ((hret != H_SUCCESS) || (vpage)) { | 179 | if ((hret != H_SUCCESS) || (vpage)) { |
180 | ehea_error("registration of pages not " | 180 | ehea_error("registration of pages not " |
181 | "complete hret=%lx\n", hret); | 181 | "complete hret=%llx\n", hret); |
182 | goto out_kill_hwq; | 182 | goto out_kill_hwq; |
183 | } | 183 | } |
184 | } else { | 184 | } else { |
185 | if (hret != H_PAGE_REGISTERED) { | 185 | if (hret != H_PAGE_REGISTERED) { |
186 | ehea_error("CQ: registration of page failed " | 186 | ehea_error("CQ: registration of page failed " |
187 | "hret=%lx\n", hret); | 187 | "hret=%llx\n", hret); |
188 | goto out_kill_hwq; | 188 | goto out_kill_hwq; |
189 | } | 189 | } |
190 | } | 190 | } |
@@ -986,15 +986,15 @@ void print_error_data(u64 *data) | |||
986 | length = EHEA_PAGESIZE; | 986 | length = EHEA_PAGESIZE; |
987 | 987 | ||
988 | if (type == 0x8) /* Queue Pair */ | 988 | if (type == 0x8) /* Queue Pair */ |
989 | ehea_error("QP (resource=%lX) state: AER=0x%lX, AERR=0x%lX, " | 989 | ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, " |
990 | "port=%lX", resource, data[6], data[12], data[22]); | 990 | "port=%llX", resource, data[6], data[12], data[22]); |
991 | 991 | ||
992 | if (type == 0x4) /* Completion Queue */ | 992 | if (type == 0x4) /* Completion Queue */ |
993 | ehea_error("CQ (resource=%lX) state: AER=0x%lX", resource, | 993 | ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource, |
994 | data[6]); | 994 | data[6]); |
995 | 995 | ||
996 | if (type == 0x3) /* Event Queue */ | 996 | if (type == 0x3) /* Event Queue */ |
997 | ehea_error("EQ (resource=%lX) state: AER=0x%lX", resource, | 997 | ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource, |
998 | data[6]); | 998 | data[6]); |
999 | 999 | ||
1000 | ehea_dump(data, length, "error data"); | 1000 | ehea_dump(data, length, "error data"); |
@@ -1016,11 +1016,11 @@ void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle) | |||
1016 | rblock); | 1016 | rblock); |
1017 | 1017 | ||
1018 | if (ret == H_R_STATE) | 1018 | if (ret == H_R_STATE) |
1019 | ehea_error("No error data is available: %lX.", res_handle); | 1019 | ehea_error("No error data is available: %llX.", res_handle); |
1020 | else if (ret == H_SUCCESS) | 1020 | else if (ret == H_SUCCESS) |
1021 | print_error_data(rblock); | 1021 | print_error_data(rblock); |
1022 | else | 1022 | else |
1023 | ehea_error("Error data could not be fetched: %lX", res_handle); | 1023 | ehea_error("Error data could not be fetched: %llX", res_handle); |
1024 | 1024 | ||
1025 | kfree(rblock); | 1025 | kfree(rblock); |
1026 | } | 1026 | } |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index d039e16f2763..7d60551d538f 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -1599,6 +1599,7 @@ static const struct net_device_ops enic_netdev_ops = { | |||
1599 | .ndo_start_xmit = enic_hard_start_xmit, | 1599 | .ndo_start_xmit = enic_hard_start_xmit, |
1600 | .ndo_get_stats = enic_get_stats, | 1600 | .ndo_get_stats = enic_get_stats, |
1601 | .ndo_validate_addr = eth_validate_addr, | 1601 | .ndo_validate_addr = eth_validate_addr, |
1602 | .ndo_set_mac_address = eth_mac_addr, | ||
1602 | .ndo_set_multicast_list = enic_set_multicast_list, | 1603 | .ndo_set_multicast_list = enic_set_multicast_list, |
1603 | .ndo_change_mtu = enic_change_mtu, | 1604 | .ndo_change_mtu = enic_change_mtu, |
1604 | .ndo_vlan_rx_register = enic_vlan_rx_register, | 1605 | .ndo_vlan_rx_register = enic_vlan_rx_register, |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 7e33c129d51c..2769083bfe83 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
@@ -1698,7 +1698,7 @@ static void __inline__ fec_set_mii(struct net_device *dev, struct fec_enet_priva | |||
1698 | /* | 1698 | /* |
1699 | * Set MII speed to 2.5 MHz | 1699 | * Set MII speed to 2.5 MHz |
1700 | */ | 1700 | */ |
1701 | fep->phy_speed = ((((MCF_CLK / 2) / (2500000 / 10)) + 5) / 10) * 2; | 1701 | fep->phy_speed = (MCF_CLK / 3) / (2500000 * 2 ) * 2; |
1702 | fecp->fec_mii_speed = fep->phy_speed; | 1702 | fecp->fec_mii_speed = fep->phy_speed; |
1703 | 1703 | ||
1704 | fec_restart(dev, 0); | 1704 | fec_restart(dev, 0); |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 5b68dc20168d..5b910cf63740 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -13,7 +13,7 @@ | |||
13 | * Copyright (C) 2004 Andrew de Quincey (wol support) | 13 | * Copyright (C) 2004 Andrew de Quincey (wol support) |
14 | * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane | 14 | * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane |
15 | * IRQ rate fixes, bigendian fixes, cleanups, verification) | 15 | * IRQ rate fixes, bigendian fixes, cleanups, verification) |
16 | * Copyright (c) 2004,2005,2006,2007,2008 NVIDIA Corporation | 16 | * Copyright (c) 2004,2005,2006,2007,2008,2009 NVIDIA Corporation |
17 | * | 17 | * |
18 | * This program is free software; you can redistribute it and/or modify | 18 | * This program is free software; you can redistribute it and/or modify |
19 | * it under the terms of the GNU General Public License as published by | 19 | * it under the terms of the GNU General Public License as published by |
@@ -39,7 +39,7 @@ | |||
39 | * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few | 39 | * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few |
40 | * superfluous timer interrupts from the nic. | 40 | * superfluous timer interrupts from the nic. |
41 | */ | 41 | */ |
42 | #define FORCEDETH_VERSION "0.61" | 42 | #define FORCEDETH_VERSION "0.62" |
43 | #define DRV_NAME "forcedeth" | 43 | #define DRV_NAME "forcedeth" |
44 | 44 | ||
45 | #include <linux/module.h> | 45 | #include <linux/module.h> |
@@ -2096,14 +2096,15 @@ static int nv_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2096 | ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); | 2096 | ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); |
2097 | } | 2097 | } |
2098 | 2098 | ||
2099 | spin_lock_irqsave(&np->lock, flags); | ||
2099 | empty_slots = nv_get_empty_tx_slots(np); | 2100 | empty_slots = nv_get_empty_tx_slots(np); |
2100 | if (unlikely(empty_slots <= entries)) { | 2101 | if (unlikely(empty_slots <= entries)) { |
2101 | spin_lock_irqsave(&np->lock, flags); | ||
2102 | netif_stop_queue(dev); | 2102 | netif_stop_queue(dev); |
2103 | np->tx_stop = 1; | 2103 | np->tx_stop = 1; |
2104 | spin_unlock_irqrestore(&np->lock, flags); | 2104 | spin_unlock_irqrestore(&np->lock, flags); |
2105 | return NETDEV_TX_BUSY; | 2105 | return NETDEV_TX_BUSY; |
2106 | } | 2106 | } |
2107 | spin_unlock_irqrestore(&np->lock, flags); | ||
2107 | 2108 | ||
2108 | start_tx = put_tx = np->put_tx.orig; | 2109 | start_tx = put_tx = np->put_tx.orig; |
2109 | 2110 | ||
@@ -2214,14 +2215,15 @@ static int nv_start_xmit_optimized(struct sk_buff *skb, struct net_device *dev) | |||
2214 | ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); | 2215 | ((skb_shinfo(skb)->frags[i].size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0); |
2215 | } | 2216 | } |
2216 | 2217 | ||
2218 | spin_lock_irqsave(&np->lock, flags); | ||
2217 | empty_slots = nv_get_empty_tx_slots(np); | 2219 | empty_slots = nv_get_empty_tx_slots(np); |
2218 | if (unlikely(empty_slots <= entries)) { | 2220 | if (unlikely(empty_slots <= entries)) { |
2219 | spin_lock_irqsave(&np->lock, flags); | ||
2220 | netif_stop_queue(dev); | 2221 | netif_stop_queue(dev); |
2221 | np->tx_stop = 1; | 2222 | np->tx_stop = 1; |
2222 | spin_unlock_irqrestore(&np->lock, flags); | 2223 | spin_unlock_irqrestore(&np->lock, flags); |
2223 | return NETDEV_TX_BUSY; | 2224 | return NETDEV_TX_BUSY; |
2224 | } | 2225 | } |
2226 | spin_unlock_irqrestore(&np->lock, flags); | ||
2225 | 2227 | ||
2226 | start_tx = put_tx = np->put_tx.ex; | 2228 | start_tx = put_tx = np->put_tx.ex; |
2227 | start_tx_ctx = np->put_tx_ctx; | 2229 | start_tx_ctx = np->put_tx_ctx; |
@@ -3403,10 +3405,10 @@ static irqreturn_t nv_nic_irq(int foo, void *data) | |||
3403 | 3405 | ||
3404 | #ifdef CONFIG_FORCEDETH_NAPI | 3406 | #ifdef CONFIG_FORCEDETH_NAPI |
3405 | if (events & NVREG_IRQ_RX_ALL) { | 3407 | if (events & NVREG_IRQ_RX_ALL) { |
3408 | spin_lock(&np->lock); | ||
3406 | netif_rx_schedule(&np->napi); | 3409 | netif_rx_schedule(&np->napi); |
3407 | 3410 | ||
3408 | /* Disable furthur receive irq's */ | 3411 | /* Disable furthur receive irq's */ |
3409 | spin_lock(&np->lock); | ||
3410 | np->irqmask &= ~NVREG_IRQ_RX_ALL; | 3412 | np->irqmask &= ~NVREG_IRQ_RX_ALL; |
3411 | 3413 | ||
3412 | if (np->msi_flags & NV_MSI_X_ENABLED) | 3414 | if (np->msi_flags & NV_MSI_X_ENABLED) |
@@ -3520,10 +3522,10 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data) | |||
3520 | 3522 | ||
3521 | #ifdef CONFIG_FORCEDETH_NAPI | 3523 | #ifdef CONFIG_FORCEDETH_NAPI |
3522 | if (events & NVREG_IRQ_RX_ALL) { | 3524 | if (events & NVREG_IRQ_RX_ALL) { |
3525 | spin_lock(&np->lock); | ||
3523 | netif_rx_schedule(&np->napi); | 3526 | netif_rx_schedule(&np->napi); |
3524 | 3527 | ||
3525 | /* Disable furthur receive irq's */ | 3528 | /* Disable furthur receive irq's */ |
3526 | spin_lock(&np->lock); | ||
3527 | np->irqmask &= ~NVREG_IRQ_RX_ALL; | 3529 | np->irqmask &= ~NVREG_IRQ_RX_ALL; |
3528 | 3530 | ||
3529 | if (np->msi_flags & NV_MSI_X_ENABLED) | 3531 | if (np->msi_flags & NV_MSI_X_ENABLED) |
@@ -6167,19 +6169,19 @@ static struct pci_device_id pci_tbl[] = { | |||
6167 | }, | 6169 | }, |
6168 | { /* MCP79 Ethernet Controller */ | 6170 | { /* MCP79 Ethernet Controller */ |
6169 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_36), | 6171 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_36), |
6170 | .driver_data = DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, | 6172 | .driver_data = DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, |
6171 | }, | 6173 | }, |
6172 | { /* MCP79 Ethernet Controller */ | 6174 | { /* MCP79 Ethernet Controller */ |
6173 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_37), | 6175 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_37), |
6174 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, | 6176 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, |
6175 | }, | 6177 | }, |
6176 | { /* MCP79 Ethernet Controller */ | 6178 | { /* MCP79 Ethernet Controller */ |
6177 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_38), | 6179 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_38), |
6178 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, | 6180 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, |
6179 | }, | 6181 | }, |
6180 | { /* MCP79 Ethernet Controller */ | 6182 | { /* MCP79 Ethernet Controller */ |
6181 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39), | 6183 | PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39), |
6182 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, | 6184 | .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_LARGEDESC|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX_V3|DEV_HAS_STATISTICS_V3|DEV_HAS_TEST_EXTENDED|DEV_HAS_CORRECT_MACADDR|DEV_HAS_COLLISION_FIX|DEV_NEED_TX_LIMIT|DEV_HAS_GEAR_MODE, |
6183 | }, | 6185 | }, |
6184 | {0,}, | 6186 | {0,}, |
6185 | }; | 6187 | }; |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index 4e6a9195fe5f..ce900e54d8d1 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -795,6 +795,7 @@ static int fs_enet_open(struct net_device *dev) | |||
795 | 795 | ||
796 | err = fs_init_phy(dev); | 796 | err = fs_init_phy(dev); |
797 | if (err) { | 797 | if (err) { |
798 | free_irq(fep->interrupt, dev); | ||
798 | if (fep->fpi->use_napi) | 799 | if (fep->fpi->use_napi) |
799 | napi_disable(&fep->napi); | 800 | napi_disable(&fep->napi); |
800 | return err; | 801 | return err; |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 1b8deca8b9f8..9b12a13a640f 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -296,6 +296,20 @@ err_out: | |||
296 | return err; | 296 | return err; |
297 | } | 297 | } |
298 | 298 | ||
299 | /* Ioctl MII Interface */ | ||
300 | static int gfar_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | ||
301 | { | ||
302 | struct gfar_private *priv = netdev_priv(dev); | ||
303 | |||
304 | if (!netif_running(dev)) | ||
305 | return -EINVAL; | ||
306 | |||
307 | if (!priv->phydev) | ||
308 | return -ENODEV; | ||
309 | |||
310 | return phy_mii_ioctl(priv->phydev, if_mii(rq), cmd); | ||
311 | } | ||
312 | |||
299 | /* Set up the ethernet device structure, private data, | 313 | /* Set up the ethernet device structure, private data, |
300 | * and anything else we need before we start */ | 314 | * and anything else we need before we start */ |
301 | static int gfar_probe(struct of_device *ofdev, | 315 | static int gfar_probe(struct of_device *ofdev, |
@@ -337,6 +351,9 @@ static int gfar_probe(struct of_device *ofdev, | |||
337 | /* Reset MAC layer */ | 351 | /* Reset MAC layer */ |
338 | gfar_write(&priv->regs->maccfg1, MACCFG1_SOFT_RESET); | 352 | gfar_write(&priv->regs->maccfg1, MACCFG1_SOFT_RESET); |
339 | 353 | ||
354 | /* We need to delay at least 3 TX clocks */ | ||
355 | udelay(2); | ||
356 | |||
340 | tempval = (MACCFG1_TX_FLOW | MACCFG1_RX_FLOW); | 357 | tempval = (MACCFG1_TX_FLOW | MACCFG1_RX_FLOW); |
341 | gfar_write(&priv->regs->maccfg1, tempval); | 358 | gfar_write(&priv->regs->maccfg1, tempval); |
342 | 359 | ||
@@ -366,6 +383,7 @@ static int gfar_probe(struct of_device *ofdev, | |||
366 | dev->set_multicast_list = gfar_set_multi; | 383 | dev->set_multicast_list = gfar_set_multi; |
367 | 384 | ||
368 | dev->ethtool_ops = &gfar_ethtool_ops; | 385 | dev->ethtool_ops = &gfar_ethtool_ops; |
386 | dev->do_ioctl = gfar_ioctl; | ||
369 | 387 | ||
370 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_CSUM) { | 388 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_CSUM) { |
371 | priv->rx_csum_enable = 1; | 389 | priv->rx_csum_enable = 1; |
@@ -1408,15 +1426,11 @@ static void gfar_vlan_rx_register(struct net_device *dev, | |||
1408 | { | 1426 | { |
1409 | struct gfar_private *priv = netdev_priv(dev); | 1427 | struct gfar_private *priv = netdev_priv(dev); |
1410 | unsigned long flags; | 1428 | unsigned long flags; |
1411 | struct vlan_group *old_grp; | ||
1412 | u32 tempval; | 1429 | u32 tempval; |
1413 | 1430 | ||
1414 | spin_lock_irqsave(&priv->rxlock, flags); | 1431 | spin_lock_irqsave(&priv->rxlock, flags); |
1415 | 1432 | ||
1416 | old_grp = priv->vlgrp; | 1433 | priv->vlgrp = grp; |
1417 | |||
1418 | if (old_grp == grp) | ||
1419 | return; | ||
1420 | 1434 | ||
1421 | if (grp) { | 1435 | if (grp) { |
1422 | /* Enable VLAN tag insertion */ | 1436 | /* Enable VLAN tag insertion */ |
@@ -1607,10 +1621,24 @@ static int gfar_clean_tx_ring(struct net_device *dev) | |||
1607 | static void gfar_schedule_cleanup(struct net_device *dev) | 1621 | static void gfar_schedule_cleanup(struct net_device *dev) |
1608 | { | 1622 | { |
1609 | struct gfar_private *priv = netdev_priv(dev); | 1623 | struct gfar_private *priv = netdev_priv(dev); |
1624 | unsigned long flags; | ||
1625 | |||
1626 | spin_lock_irqsave(&priv->txlock, flags); | ||
1627 | spin_lock(&priv->rxlock); | ||
1628 | |||
1610 | if (netif_rx_schedule_prep(&priv->napi)) { | 1629 | if (netif_rx_schedule_prep(&priv->napi)) { |
1611 | gfar_write(&priv->regs->imask, IMASK_RTX_DISABLED); | 1630 | gfar_write(&priv->regs->imask, IMASK_RTX_DISABLED); |
1612 | __netif_rx_schedule(&priv->napi); | 1631 | __netif_rx_schedule(&priv->napi); |
1632 | } else { | ||
1633 | /* | ||
1634 | * Clear IEVENT, so interrupts aren't called again | ||
1635 | * because of the packets that have already arrived. | ||
1636 | */ | ||
1637 | gfar_write(&priv->regs->ievent, IEVENT_RTX_MASK); | ||
1613 | } | 1638 | } |
1639 | |||
1640 | spin_unlock(&priv->rxlock); | ||
1641 | spin_unlock_irqrestore(&priv->txlock, flags); | ||
1614 | } | 1642 | } |
1615 | 1643 | ||
1616 | /* Interrupt Handler for Transmit complete */ | 1644 | /* Interrupt Handler for Transmit complete */ |
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index b1a83344acc7..eaa86897f5c3 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
@@ -312,7 +312,7 @@ extern const char gfar_driver_version[]; | |||
312 | #define ATTRELI_EI(x) (x) | 312 | #define ATTRELI_EI(x) (x) |
313 | 313 | ||
314 | #define BD_LFLAG(flags) ((flags) << 16) | 314 | #define BD_LFLAG(flags) ((flags) << 16) |
315 | #define BD_LENGTH_MASK 0x00ff | 315 | #define BD_LENGTH_MASK 0x0000ffff |
316 | 316 | ||
317 | /* TxBD status field bits */ | 317 | /* TxBD status field bits */ |
318 | #define TXBD_READY 0x8000 | 318 | #define TXBD_READY 0x8000 |
diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c index f3706e415b45..f49a426ad681 100644 --- a/drivers/net/gianfar_mii.c +++ b/drivers/net/gianfar_mii.c | |||
@@ -234,6 +234,8 @@ static int gfar_mdio_probe(struct of_device *ofdev, | |||
234 | if (NULL == new_bus) | 234 | if (NULL == new_bus) |
235 | return -ENOMEM; | 235 | return -ENOMEM; |
236 | 236 | ||
237 | device_init_wakeup(&ofdev->dev, 1); | ||
238 | |||
237 | new_bus->name = "Gianfar MII Bus", | 239 | new_bus->name = "Gianfar MII Bus", |
238 | new_bus->read = &gfar_mdio_read, | 240 | new_bus->read = &gfar_mdio_read, |
239 | new_bus->write = &gfar_mdio_write, | 241 | new_bus->write = &gfar_mdio_write, |
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c index 32200227c923..7e8b3c59a7d6 100644 --- a/drivers/net/hamachi.c +++ b/drivers/net/hamachi.c | |||
@@ -576,6 +576,7 @@ static const struct net_device_ops hamachi_netdev_ops = { | |||
576 | .ndo_set_multicast_list = set_rx_mode, | 576 | .ndo_set_multicast_list = set_rx_mode, |
577 | .ndo_change_mtu = eth_change_mtu, | 577 | .ndo_change_mtu = eth_change_mtu, |
578 | .ndo_validate_addr = eth_validate_addr, | 578 | .ndo_validate_addr = eth_validate_addr, |
579 | .ndo_set_mac_address = eth_mac_addr, | ||
579 | .ndo_tx_timeout = hamachi_tx_timeout, | 580 | .ndo_tx_timeout = hamachi_tx_timeout, |
580 | .ndo_do_ioctl = netdev_ioctl, | 581 | .ndo_do_ioctl = netdev_ioctl, |
581 | }; | 582 | }; |
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 50f1e172ee8f..2d4089894ec7 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -717,11 +717,12 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file, | |||
717 | unsigned int cmd, unsigned long arg) | 717 | unsigned int cmd, unsigned long arg) |
718 | { | 718 | { |
719 | struct sixpack *sp = sp_get(tty); | 719 | struct sixpack *sp = sp_get(tty); |
720 | struct net_device *dev = sp->dev; | 720 | struct net_device *dev; |
721 | unsigned int tmp, err; | 721 | unsigned int tmp, err; |
722 | 722 | ||
723 | if (!sp) | 723 | if (!sp) |
724 | return -ENXIO; | 724 | return -ENXIO; |
725 | dev = sp->dev; | ||
725 | 726 | ||
726 | switch(cmd) { | 727 | switch(cmd) { |
727 | case SIOCGIFNAME: | 728 | case SIOCGIFNAME: |
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c index b507dbc16e62..5e070f446635 100644 --- a/drivers/net/hp-plus.c +++ b/drivers/net/hp-plus.c | |||
@@ -166,6 +166,7 @@ static const struct net_device_ops hpp_netdev_ops = { | |||
166 | .ndo_get_stats = eip_get_stats, | 166 | .ndo_get_stats = eip_get_stats, |
167 | .ndo_set_multicast_list = eip_set_multicast_list, | 167 | .ndo_set_multicast_list = eip_set_multicast_list, |
168 | .ndo_validate_addr = eth_validate_addr, | 168 | .ndo_validate_addr = eth_validate_addr, |
169 | .ndo_set_mac_address = eth_mac_addr, | ||
169 | .ndo_change_mtu = eth_change_mtu, | 170 | .ndo_change_mtu = eth_change_mtu, |
170 | #ifdef CONFIG_NET_POLL_CONTROLLER | 171 | #ifdef CONFIG_NET_POLL_CONTROLLER |
171 | .ndo_poll_controller = eip_poll, | 172 | .ndo_poll_controller = eip_poll, |
diff --git a/drivers/net/hydra.c b/drivers/net/hydra.c index 9cb38a8d4387..8ac0930c183c 100644 --- a/drivers/net/hydra.c +++ b/drivers/net/hydra.c | |||
@@ -103,6 +103,7 @@ static const struct net_device_ops hydra_netdev_ops = { | |||
103 | .ndo_get_stats = ei_get_stats, | 103 | .ndo_get_stats = ei_get_stats, |
104 | .ndo_set_multicast_list = ei_set_multicast_list, | 104 | .ndo_set_multicast_list = ei_set_multicast_list, |
105 | .ndo_validate_addr = eth_validate_addr, | 105 | .ndo_validate_addr = eth_validate_addr, |
106 | .ndo_set_mac_address = eth_mac_addr, | ||
106 | .ndo_change_mtu = eth_change_mtu, | 107 | .ndo_change_mtu = eth_change_mtu, |
107 | #ifdef CONFIG_NET_POLL_CONTROLLER | 108 | #ifdef CONFIG_NET_POLL_CONTROLLER |
108 | .ndo_poll_controller = ei_poll, | 109 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/ibm_newemac/mal.c b/drivers/net/ibm_newemac/mal.c index ecf9798987fa..2a2fc17b2878 100644 --- a/drivers/net/ibm_newemac/mal.c +++ b/drivers/net/ibm_newemac/mal.c | |||
@@ -613,7 +613,9 @@ static int __devinit mal_probe(struct of_device *ofdev, | |||
613 | INIT_LIST_HEAD(&mal->list); | 613 | INIT_LIST_HEAD(&mal->list); |
614 | spin_lock_init(&mal->lock); | 614 | spin_lock_init(&mal->lock); |
615 | 615 | ||
616 | netif_napi_add(NULL, &mal->napi, mal_poll, | 616 | init_dummy_netdev(&mal->dummy_dev); |
617 | |||
618 | netif_napi_add(&mal->dummy_dev, &mal->napi, mal_poll, | ||
617 | CONFIG_IBM_NEW_EMAC_POLL_WEIGHT); | 619 | CONFIG_IBM_NEW_EMAC_POLL_WEIGHT); |
618 | 620 | ||
619 | /* Load power-on reset defaults */ | 621 | /* Load power-on reset defaults */ |
diff --git a/drivers/net/ibm_newemac/mal.h b/drivers/net/ibm_newemac/mal.h index 2f0a87360844..9ededfbf0726 100644 --- a/drivers/net/ibm_newemac/mal.h +++ b/drivers/net/ibm_newemac/mal.h | |||
@@ -214,6 +214,8 @@ struct mal_instance { | |||
214 | int index; | 214 | int index; |
215 | spinlock_t lock; | 215 | spinlock_t lock; |
216 | 216 | ||
217 | struct net_device dummy_dev; | ||
218 | |||
217 | unsigned int features; | 219 | unsigned int features; |
218 | }; | 220 | }; |
219 | 221 | ||
diff --git a/drivers/net/ibm_newemac/phy.c b/drivers/net/ibm_newemac/phy.c index c40cd8df2212..ac9d964e59ec 100644 --- a/drivers/net/ibm_newemac/phy.c +++ b/drivers/net/ibm_newemac/phy.c | |||
@@ -60,7 +60,7 @@ int emac_mii_reset_phy(struct mii_phy *phy) | |||
60 | 60 | ||
61 | udelay(300); | 61 | udelay(300); |
62 | 62 | ||
63 | while (limit--) { | 63 | while (--limit) { |
64 | val = phy_read(phy, MII_BMCR); | 64 | val = phy_read(phy, MII_BMCR); |
65 | if (val >= 0 && (val & BMCR_RESET) == 0) | 65 | if (val >= 0 && (val & BMCR_RESET) == 0) |
66 | break; | 66 | break; |
@@ -84,7 +84,7 @@ int emac_mii_reset_gpcs(struct mii_phy *phy) | |||
84 | 84 | ||
85 | udelay(300); | 85 | udelay(300); |
86 | 86 | ||
87 | while (limit--) { | 87 | while (--limit) { |
88 | val = gpcs_phy_read(phy, MII_BMCR); | 88 | val = gpcs_phy_read(phy, MII_BMCR); |
89 | if (val >= 0 && (val & BMCR_RESET) == 0) | 89 | if (val >= 0 && (val & BMCR_RESET) == 0) |
90 | break; | 90 | break; |
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index ca3bb9f7321b..dfa6348ac1dc 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -602,7 +602,7 @@ static int ibmveth_open(struct net_device *netdev) | |||
602 | 602 | ||
603 | if(lpar_rc != H_SUCCESS) { | 603 | if(lpar_rc != H_SUCCESS) { |
604 | ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); | 604 | ibmveth_error_printk("h_register_logical_lan failed with %ld\n", lpar_rc); |
605 | ibmveth_error_printk("buffer TCE:0x%lx filter TCE:0x%lx rxq desc:0x%lx MAC:0x%lx\n", | 605 | ibmveth_error_printk("buffer TCE:0x%llx filter TCE:0x%llx rxq desc:0x%llx MAC:0x%llx\n", |
606 | adapter->buffer_list_dma, | 606 | adapter->buffer_list_dma, |
607 | adapter->filter_list_dma, | 607 | adapter->filter_list_dma, |
608 | rxq_desc.desc, | 608 | rxq_desc.desc, |
@@ -1378,13 +1378,13 @@ static int ibmveth_show(struct seq_file *seq, void *v) | |||
1378 | seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac); | 1378 | seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac); |
1379 | 1379 | ||
1380 | seq_printf(seq, "\nAdapter Statistics:\n"); | 1380 | seq_printf(seq, "\nAdapter Statistics:\n"); |
1381 | seq_printf(seq, " TX: vio_map_single failres: %ld\n", adapter->tx_map_failed); | 1381 | seq_printf(seq, " TX: vio_map_single failres: %lld\n", adapter->tx_map_failed); |
1382 | seq_printf(seq, " send failures: %ld\n", adapter->tx_send_failed); | 1382 | seq_printf(seq, " send failures: %lld\n", adapter->tx_send_failed); |
1383 | seq_printf(seq, " RX: replenish task cycles: %ld\n", adapter->replenish_task_cycles); | 1383 | seq_printf(seq, " RX: replenish task cycles: %lld\n", adapter->replenish_task_cycles); |
1384 | seq_printf(seq, " alloc_skb_failures: %ld\n", adapter->replenish_no_mem); | 1384 | seq_printf(seq, " alloc_skb_failures: %lld\n", adapter->replenish_no_mem); |
1385 | seq_printf(seq, " add buffer failures: %ld\n", adapter->replenish_add_buff_failure); | 1385 | seq_printf(seq, " add buffer failures: %lld\n", adapter->replenish_add_buff_failure); |
1386 | seq_printf(seq, " invalid buffers: %ld\n", adapter->rx_invalid_buffer); | 1386 | seq_printf(seq, " invalid buffers: %lld\n", adapter->rx_invalid_buffer); |
1387 | seq_printf(seq, " no buffers: %ld\n", adapter->rx_no_buffer); | 1387 | seq_printf(seq, " no buffers: %lld\n", adapter->rx_no_buffer); |
1388 | 1388 | ||
1389 | return 0; | 1389 | return 0; |
1390 | } | 1390 | } |
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index f5e2e7235fcb..13ca73f96ec6 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
@@ -699,11 +699,18 @@ static s32 igb_check_for_link_82575(struct e1000_hw *hw) | |||
699 | 699 | ||
700 | /* SGMII link check is done through the PCS register. */ | 700 | /* SGMII link check is done through the PCS register. */ |
701 | if ((hw->phy.media_type != e1000_media_type_copper) || | 701 | if ((hw->phy.media_type != e1000_media_type_copper) || |
702 | (igb_sgmii_active_82575(hw))) | 702 | (igb_sgmii_active_82575(hw))) { |
703 | ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, | 703 | ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, |
704 | &duplex); | 704 | &duplex); |
705 | else | 705 | /* |
706 | * Use this flag to determine if link needs to be checked or | ||
707 | * not. If we have link clear the flag so that we do not | ||
708 | * continue to check for link. | ||
709 | */ | ||
710 | hw->mac.get_link_status = !hw->mac.serdes_has_link; | ||
711 | } else { | ||
706 | ret_val = igb_check_for_copper_link(hw); | 712 | ret_val = igb_check_for_copper_link(hw); |
713 | } | ||
707 | 714 | ||
708 | return ret_val; | 715 | return ret_val; |
709 | } | 716 | } |
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 5a27825cc48a..aebef8e48e76 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h | |||
@@ -300,11 +300,10 @@ struct igb_adapter { | |||
300 | 300 | ||
301 | #define IGB_FLAG_HAS_MSI (1 << 0) | 301 | #define IGB_FLAG_HAS_MSI (1 << 0) |
302 | #define IGB_FLAG_MSI_ENABLE (1 << 1) | 302 | #define IGB_FLAG_MSI_ENABLE (1 << 1) |
303 | #define IGB_FLAG_HAS_DCA (1 << 2) | 303 | #define IGB_FLAG_DCA_ENABLED (1 << 2) |
304 | #define IGB_FLAG_DCA_ENABLED (1 << 3) | 304 | #define IGB_FLAG_IN_NETPOLL (1 << 3) |
305 | #define IGB_FLAG_IN_NETPOLL (1 << 5) | 305 | #define IGB_FLAG_QUAD_PORT_A (1 << 4) |
306 | #define IGB_FLAG_QUAD_PORT_A (1 << 6) | 306 | #define IGB_FLAG_NEED_CTX_IDX (1 << 5) |
307 | #define IGB_FLAG_NEED_CTX_IDX (1 << 7) | ||
308 | 307 | ||
309 | enum e1000_state_t { | 308 | enum e1000_state_t { |
310 | __IGB_TESTING, | 309 | __IGB_TESTING, |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index b82b0fb2056c..a50db5398fa5 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -206,10 +206,11 @@ static int __init igb_init_module(void) | |||
206 | 206 | ||
207 | global_quad_port_a = 0; | 207 | global_quad_port_a = 0; |
208 | 208 | ||
209 | ret = pci_register_driver(&igb_driver); | ||
210 | #ifdef CONFIG_IGB_DCA | 209 | #ifdef CONFIG_IGB_DCA |
211 | dca_register_notify(&dca_notifier); | 210 | dca_register_notify(&dca_notifier); |
212 | #endif | 211 | #endif |
212 | |||
213 | ret = pci_register_driver(&igb_driver); | ||
213 | return ret; | 214 | return ret; |
214 | } | 215 | } |
215 | 216 | ||
@@ -1156,11 +1157,10 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1156 | 1157 | ||
1157 | /* set flags */ | 1158 | /* set flags */ |
1158 | switch (hw->mac.type) { | 1159 | switch (hw->mac.type) { |
1159 | case e1000_82576: | ||
1160 | case e1000_82575: | 1160 | case e1000_82575: |
1161 | adapter->flags |= IGB_FLAG_HAS_DCA; | ||
1162 | adapter->flags |= IGB_FLAG_NEED_CTX_IDX; | 1161 | adapter->flags |= IGB_FLAG_NEED_CTX_IDX; |
1163 | break; | 1162 | break; |
1163 | case e1000_82576: | ||
1164 | default: | 1164 | default: |
1165 | break; | 1165 | break; |
1166 | } | 1166 | } |
@@ -1310,8 +1310,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1310 | goto err_register; | 1310 | goto err_register; |
1311 | 1311 | ||
1312 | #ifdef CONFIG_IGB_DCA | 1312 | #ifdef CONFIG_IGB_DCA |
1313 | if ((adapter->flags & IGB_FLAG_HAS_DCA) && | 1313 | if (dca_add_requester(&pdev->dev) == 0) { |
1314 | (dca_add_requester(&pdev->dev) == 0)) { | ||
1315 | adapter->flags |= IGB_FLAG_DCA_ENABLED; | 1314 | adapter->flags |= IGB_FLAG_DCA_ENABLED; |
1316 | dev_info(&pdev->dev, "DCA enabled\n"); | 1315 | dev_info(&pdev->dev, "DCA enabled\n"); |
1317 | /* Always use CB2 mode, difference is masked | 1316 | /* Always use CB2 mode, difference is masked |
@@ -1835,11 +1834,11 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
1835 | rctl |= E1000_RCTL_SECRC; | 1834 | rctl |= E1000_RCTL_SECRC; |
1836 | 1835 | ||
1837 | /* | 1836 | /* |
1838 | * disable store bad packets, long packet enable, and clear size bits. | 1837 | * disable store bad packets and clear size bits. |
1839 | */ | 1838 | */ |
1840 | rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256); | 1839 | rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_SZ_256); |
1841 | 1840 | ||
1842 | if (adapter->netdev->mtu > ETH_DATA_LEN) | 1841 | /* enable LPE when to prevent packets larger than max_frame_size */ |
1843 | rctl |= E1000_RCTL_LPE; | 1842 | rctl |= E1000_RCTL_LPE; |
1844 | 1843 | ||
1845 | /* Setup buffer sizes */ | 1844 | /* Setup buffer sizes */ |
@@ -1865,7 +1864,7 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
1865 | */ | 1864 | */ |
1866 | /* allocations using alloc_page take too long for regular MTU | 1865 | /* allocations using alloc_page take too long for regular MTU |
1867 | * so only enable packet split for jumbo frames */ | 1866 | * so only enable packet split for jumbo frames */ |
1868 | if (rctl & E1000_RCTL_LPE) { | 1867 | if (adapter->netdev->mtu > ETH_DATA_LEN) { |
1869 | adapter->rx_ps_hdr_size = IGB_RXBUFFER_128; | 1868 | adapter->rx_ps_hdr_size = IGB_RXBUFFER_128; |
1870 | srrctl |= adapter->rx_ps_hdr_size << | 1869 | srrctl |= adapter->rx_ps_hdr_size << |
1871 | E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; | 1870 | E1000_SRRCTL_BSIZEHDRSIZE_SHIFT; |
@@ -3473,19 +3472,16 @@ static int __igb_notify_dca(struct device *dev, void *data) | |||
3473 | struct e1000_hw *hw = &adapter->hw; | 3472 | struct e1000_hw *hw = &adapter->hw; |
3474 | unsigned long event = *(unsigned long *)data; | 3473 | unsigned long event = *(unsigned long *)data; |
3475 | 3474 | ||
3476 | if (!(adapter->flags & IGB_FLAG_HAS_DCA)) | ||
3477 | goto out; | ||
3478 | |||
3479 | switch (event) { | 3475 | switch (event) { |
3480 | case DCA_PROVIDER_ADD: | 3476 | case DCA_PROVIDER_ADD: |
3481 | /* if already enabled, don't do it again */ | 3477 | /* if already enabled, don't do it again */ |
3482 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) | 3478 | if (adapter->flags & IGB_FLAG_DCA_ENABLED) |
3483 | break; | 3479 | break; |
3484 | adapter->flags |= IGB_FLAG_DCA_ENABLED; | ||
3485 | /* Always use CB2 mode, difference is masked | 3480 | /* Always use CB2 mode, difference is masked |
3486 | * in the CB driver. */ | 3481 | * in the CB driver. */ |
3487 | wr32(E1000_DCA_CTRL, 2); | 3482 | wr32(E1000_DCA_CTRL, 2); |
3488 | if (dca_add_requester(dev) == 0) { | 3483 | if (dca_add_requester(dev) == 0) { |
3484 | adapter->flags |= IGB_FLAG_DCA_ENABLED; | ||
3489 | dev_info(&adapter->pdev->dev, "DCA enabled\n"); | 3485 | dev_info(&adapter->pdev->dev, "DCA enabled\n"); |
3490 | igb_setup_dca(adapter); | 3486 | igb_setup_dca(adapter); |
3491 | break; | 3487 | break; |
@@ -3502,7 +3498,7 @@ static int __igb_notify_dca(struct device *dev, void *data) | |||
3502 | } | 3498 | } |
3503 | break; | 3499 | break; |
3504 | } | 3500 | } |
3505 | out: | 3501 | |
3506 | return 0; | 3502 | return 0; |
3507 | } | 3503 | } |
3508 | 3504 | ||
diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c index 75a1d0a86dee..941164076a2b 100644 --- a/drivers/net/irda/au1k_ir.c +++ b/drivers/net/irda/au1k_ir.c | |||
@@ -594,7 +594,7 @@ static int au1k_irda_rx(struct net_device *dev) | |||
594 | update_rx_stats(dev, flags, count); | 594 | update_rx_stats(dev, flags, count); |
595 | skb=alloc_skb(count+1,GFP_ATOMIC); | 595 | skb=alloc_skb(count+1,GFP_ATOMIC); |
596 | if (skb == NULL) { | 596 | if (skb == NULL) { |
597 | aup->stats.rx_dropped++; | 597 | aup->netdev->stats.rx_dropped++; |
598 | continue; | 598 | continue; |
599 | } | 599 | } |
600 | skb_reserve(skb, 1); | 600 | skb_reserve(skb, 1); |
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 687c2d53d4d2..6f3e7f71658d 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -1194,13 +1194,13 @@ toshoboe_interrupt (int irq, void *dev_id) | |||
1194 | txp = txpc; | 1194 | txp = txpc; |
1195 | txpc++; | 1195 | txpc++; |
1196 | txpc %= TX_SLOTS; | 1196 | txpc %= TX_SLOTS; |
1197 | self->stats.tx_packets++; | 1197 | self->netdev->stats.tx_packets++; |
1198 | if (self->ring->tx[txpc].control & OBOE_CTL_TX_HW_OWNS) | 1198 | if (self->ring->tx[txpc].control & OBOE_CTL_TX_HW_OWNS) |
1199 | self->ring->tx[txp].control &= ~OBOE_CTL_TX_RTCENTX; | 1199 | self->ring->tx[txp].control &= ~OBOE_CTL_TX_RTCENTX; |
1200 | } | 1200 | } |
1201 | self->stats.tx_packets--; | 1201 | self->netdev->stats.tx_packets--; |
1202 | #else | 1202 | #else |
1203 | self->stats.tx_packets++; | 1203 | self->netdev->stats.tx_packets++; |
1204 | #endif | 1204 | #endif |
1205 | toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); | 1205 | toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); |
1206 | } | 1206 | } |
@@ -1280,7 +1280,7 @@ dumpbufs(self->rx_bufs[self->rxs],len,'<'); | |||
1280 | skb_put (skb, len); | 1280 | skb_put (skb, len); |
1281 | skb_copy_to_linear_data(skb, self->rx_bufs[self->rxs], | 1281 | skb_copy_to_linear_data(skb, self->rx_bufs[self->rxs], |
1282 | len); | 1282 | len); |
1283 | self->stats.rx_packets++; | 1283 | self->netdev->stats.rx_packets++; |
1284 | skb->dev = self->netdev; | 1284 | skb->dev = self->netdev; |
1285 | skb_reset_mac_header(skb); | 1285 | skb_reset_mac_header(skb); |
1286 | skb->protocol = htons (ETH_P_IRDA); | 1286 | skb->protocol = htons (ETH_P_IRDA); |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 29118f58a141..3a22dc41b656 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1073,7 +1073,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self) | |||
1073 | { | 1073 | { |
1074 | unsigned int i; | 1074 | unsigned int i; |
1075 | int ret; | 1075 | int ret; |
1076 | char stir421x_fw_name[11]; | 1076 | char stir421x_fw_name[12]; |
1077 | const struct firmware *fw; | 1077 | const struct firmware *fw; |
1078 | const unsigned char *fw_version_ptr; /* pointer to version string */ | 1078 | const unsigned char *fw_version_ptr; /* pointer to version string */ |
1079 | unsigned long fw_version = 0; | 1079 | unsigned long fw_version = 0; |
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c index c7457f97259d..cb793c2bade2 100644 --- a/drivers/net/iseries_veth.c +++ b/drivers/net/iseries_veth.c | |||
@@ -429,7 +429,7 @@ SIMPLE_PORT_ATTR(promiscuous); | |||
429 | SIMPLE_PORT_ATTR(num_mcast); | 429 | SIMPLE_PORT_ATTR(num_mcast); |
430 | CUSTOM_PORT_ATTR(lpar_map, "0x%X\n", port->lpar_map); | 430 | CUSTOM_PORT_ATTR(lpar_map, "0x%X\n", port->lpar_map); |
431 | CUSTOM_PORT_ATTR(stopped_map, "0x%X\n", port->stopped_map); | 431 | CUSTOM_PORT_ATTR(stopped_map, "0x%X\n", port->stopped_map); |
432 | CUSTOM_PORT_ATTR(mac_addr, "0x%lX\n", port->mac_addr); | 432 | CUSTOM_PORT_ATTR(mac_addr, "0x%llX\n", port->mac_addr); |
433 | 433 | ||
434 | #define GET_PORT_ATTR(_name) (&veth_port_attr_##_name.attr) | 434 | #define GET_PORT_ATTR(_name) (&veth_port_attr_##_name.attr) |
435 | static struct attribute *veth_port_default_attrs[] = { | 435 | static struct attribute *veth_port_default_attrs[] = { |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index acef3c65cd2c..d2f4d5f508b7 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -318,6 +318,9 @@ static void ixgbe_update_rx_dca(struct ixgbe_adapter *adapter, | |||
318 | rxctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); | 318 | rxctrl |= dca3_get_tag(&adapter->pdev->dev, cpu); |
319 | rxctrl |= IXGBE_DCA_RXCTRL_DESC_DCA_EN; | 319 | rxctrl |= IXGBE_DCA_RXCTRL_DESC_DCA_EN; |
320 | rxctrl |= IXGBE_DCA_RXCTRL_HEAD_DCA_EN; | 320 | rxctrl |= IXGBE_DCA_RXCTRL_HEAD_DCA_EN; |
321 | rxctrl &= ~(IXGBE_DCA_RXCTRL_DESC_RRO_EN); | ||
322 | rxctrl &= ~(IXGBE_DCA_RXCTRL_DESC_WRO_EN | | ||
323 | IXGBE_DCA_RXCTRL_DESC_HSRO_EN); | ||
321 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_RXCTRL(q), rxctrl); | 324 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_RXCTRL(q), rxctrl); |
322 | rx_ring->cpu = cpu; | 325 | rx_ring->cpu = cpu; |
323 | } | 326 | } |
@@ -1741,6 +1744,32 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) | |||
1741 | IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); | 1744 | IXGBE_WRITE_REG(hw, IXGBE_RXCSUM, rxcsum); |
1742 | } | 1745 | } |
1743 | 1746 | ||
1747 | static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | ||
1748 | { | ||
1749 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1750 | struct ixgbe_hw *hw = &adapter->hw; | ||
1751 | |||
1752 | /* add VID to filter table */ | ||
1753 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, true); | ||
1754 | } | ||
1755 | |||
1756 | static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | ||
1757 | { | ||
1758 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1759 | struct ixgbe_hw *hw = &adapter->hw; | ||
1760 | |||
1761 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1762 | ixgbe_irq_disable(adapter); | ||
1763 | |||
1764 | vlan_group_set_device(adapter->vlgrp, vid, NULL); | ||
1765 | |||
1766 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1767 | ixgbe_irq_enable(adapter); | ||
1768 | |||
1769 | /* remove VID from filter table */ | ||
1770 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, false); | ||
1771 | } | ||
1772 | |||
1744 | static void ixgbe_vlan_rx_register(struct net_device *netdev, | 1773 | static void ixgbe_vlan_rx_register(struct net_device *netdev, |
1745 | struct vlan_group *grp) | 1774 | struct vlan_group *grp) |
1746 | { | 1775 | { |
@@ -1760,6 +1789,7 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev, | |||
1760 | ctrl |= IXGBE_VLNCTRL_VME; | 1789 | ctrl |= IXGBE_VLNCTRL_VME; |
1761 | ctrl &= ~IXGBE_VLNCTRL_CFIEN; | 1790 | ctrl &= ~IXGBE_VLNCTRL_CFIEN; |
1762 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl); | 1791 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_VLNCTRL, ctrl); |
1792 | ixgbe_vlan_rx_add_vid(netdev, 0); | ||
1763 | 1793 | ||
1764 | if (grp) { | 1794 | if (grp) { |
1765 | /* enable VLAN tag insert/strip */ | 1795 | /* enable VLAN tag insert/strip */ |
@@ -1773,32 +1803,6 @@ static void ixgbe_vlan_rx_register(struct net_device *netdev, | |||
1773 | ixgbe_irq_enable(adapter); | 1803 | ixgbe_irq_enable(adapter); |
1774 | } | 1804 | } |
1775 | 1805 | ||
1776 | static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | ||
1777 | { | ||
1778 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1779 | struct ixgbe_hw *hw = &adapter->hw; | ||
1780 | |||
1781 | /* add VID to filter table */ | ||
1782 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, true); | ||
1783 | } | ||
1784 | |||
1785 | static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | ||
1786 | { | ||
1787 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | ||
1788 | struct ixgbe_hw *hw = &adapter->hw; | ||
1789 | |||
1790 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1791 | ixgbe_irq_disable(adapter); | ||
1792 | |||
1793 | vlan_group_set_device(adapter->vlgrp, vid, NULL); | ||
1794 | |||
1795 | if (!test_bit(__IXGBE_DOWN, &adapter->state)) | ||
1796 | ixgbe_irq_enable(adapter); | ||
1797 | |||
1798 | /* remove VID from filter table */ | ||
1799 | hw->mac.ops.set_vfta(&adapter->hw, vid, 0, false); | ||
1800 | } | ||
1801 | |||
1802 | static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter) | 1806 | static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter) |
1803 | { | 1807 | { |
1804 | ixgbe_vlan_rx_register(adapter->netdev, adapter->vlgrp); | 1808 | ixgbe_vlan_rx_register(adapter->netdev, adapter->vlgrp); |
@@ -2074,6 +2078,9 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter) | |||
2074 | 2078 | ||
2075 | ixgbe_irq_enable(adapter); | 2079 | ixgbe_irq_enable(adapter); |
2076 | 2080 | ||
2081 | /* enable transmits */ | ||
2082 | netif_tx_start_all_queues(netdev); | ||
2083 | |||
2077 | /* bring the link up in the watchdog, this could race with our first | 2084 | /* bring the link up in the watchdog, this could race with our first |
2078 | * link up interrupt but shouldn't be a problem */ | 2085 | * link up interrupt but shouldn't be a problem */ |
2079 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; | 2086 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; |
@@ -3475,7 +3482,6 @@ static void ixgbe_watchdog_task(struct work_struct *work) | |||
3475 | (FLOW_TX ? "TX" : "None")))); | 3482 | (FLOW_TX ? "TX" : "None")))); |
3476 | 3483 | ||
3477 | netif_carrier_on(netdev); | 3484 | netif_carrier_on(netdev); |
3478 | netif_tx_wake_all_queues(netdev); | ||
3479 | } else { | 3485 | } else { |
3480 | /* Force detection of hung controller */ | 3486 | /* Force detection of hung controller */ |
3481 | adapter->detect_tx_hung = true; | 3487 | adapter->detect_tx_hung = true; |
@@ -3487,7 +3493,6 @@ static void ixgbe_watchdog_task(struct work_struct *work) | |||
3487 | printk(KERN_INFO "ixgbe: %s NIC Link is Down\n", | 3493 | printk(KERN_INFO "ixgbe: %s NIC Link is Down\n", |
3488 | netdev->name); | 3494 | netdev->name); |
3489 | netif_carrier_off(netdev); | 3495 | netif_carrier_off(netdev); |
3490 | netif_tx_stop_all_queues(netdev); | ||
3491 | } | 3496 | } |
3492 | } | 3497 | } |
3493 | 3498 | ||
@@ -4218,7 +4223,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
4218 | } | 4223 | } |
4219 | 4224 | ||
4220 | netif_carrier_off(netdev); | 4225 | netif_carrier_off(netdev); |
4221 | netif_tx_stop_all_queues(netdev); | ||
4222 | 4226 | ||
4223 | strcpy(netdev->name, "eth%d"); | 4227 | strcpy(netdev->name, "eth%d"); |
4224 | err = register_netdev(netdev); | 4228 | err = register_netdev(netdev); |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 83a11ff9ffd1..f011c57c9205 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -404,6 +404,9 @@ | |||
404 | #define IXGBE_DCA_RXCTRL_DESC_DCA_EN (1 << 5) /* DCA Rx Desc enable */ | 404 | #define IXGBE_DCA_RXCTRL_DESC_DCA_EN (1 << 5) /* DCA Rx Desc enable */ |
405 | #define IXGBE_DCA_RXCTRL_HEAD_DCA_EN (1 << 6) /* DCA Rx Desc header enable */ | 405 | #define IXGBE_DCA_RXCTRL_HEAD_DCA_EN (1 << 6) /* DCA Rx Desc header enable */ |
406 | #define IXGBE_DCA_RXCTRL_DATA_DCA_EN (1 << 7) /* DCA Rx Desc payload enable */ | 406 | #define IXGBE_DCA_RXCTRL_DATA_DCA_EN (1 << 7) /* DCA Rx Desc payload enable */ |
407 | #define IXGBE_DCA_RXCTRL_DESC_RRO_EN (1 << 9) /* DCA Rx rd Desc Relax Order */ | ||
408 | #define IXGBE_DCA_RXCTRL_DESC_WRO_EN (1 << 13) /* DCA Rx wr Desc Relax Order */ | ||
409 | #define IXGBE_DCA_RXCTRL_DESC_HSRO_EN (1 << 15) /* DCA Rx Split Header RO */ | ||
407 | 410 | ||
408 | #define IXGBE_DCA_TXCTRL_CPUID_MASK 0x0000001F /* Tx CPUID Mask */ | 411 | #define IXGBE_DCA_TXCTRL_CPUID_MASK 0x0000001F /* Tx CPUID Mask */ |
409 | #define IXGBE_DCA_TXCTRL_DESC_DCA_EN (1 << 5) /* DCA Tx Desc enable */ | 412 | #define IXGBE_DCA_TXCTRL_DESC_DCA_EN (1 << 5) /* DCA Tx Desc enable */ |
diff --git a/drivers/net/korina.c b/drivers/net/korina.c index 4a5580c1126a..75010cac76ac 100644 --- a/drivers/net/korina.c +++ b/drivers/net/korina.c | |||
@@ -84,7 +84,10 @@ | |||
84 | #define KORINA_NUM_RDS 64 /* number of receive descriptors */ | 84 | #define KORINA_NUM_RDS 64 /* number of receive descriptors */ |
85 | #define KORINA_NUM_TDS 64 /* number of transmit descriptors */ | 85 | #define KORINA_NUM_TDS 64 /* number of transmit descriptors */ |
86 | 86 | ||
87 | #define KORINA_RBSIZE 536 /* size of one resource buffer = Ether MTU */ | 87 | /* KORINA_RBSIZE is the hardware's default maximum receive |
88 | * frame size in bytes. Having this hardcoded means that there | ||
89 | * is no support for MTU sizes greater than 1500. */ | ||
90 | #define KORINA_RBSIZE 1536 /* size of one resource buffer = Ether MTU */ | ||
88 | #define KORINA_RDS_MASK (KORINA_NUM_RDS - 1) | 91 | #define KORINA_RDS_MASK (KORINA_NUM_RDS - 1) |
89 | #define KORINA_TDS_MASK (KORINA_NUM_TDS - 1) | 92 | #define KORINA_TDS_MASK (KORINA_NUM_TDS - 1) |
90 | #define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) | 93 | #define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) |
@@ -196,7 +199,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
196 | struct korina_private *lp = netdev_priv(dev); | 199 | struct korina_private *lp = netdev_priv(dev); |
197 | unsigned long flags; | 200 | unsigned long flags; |
198 | u32 length; | 201 | u32 length; |
199 | u32 chain_index; | 202 | u32 chain_prev, chain_next; |
200 | struct dma_desc *td; | 203 | struct dma_desc *td; |
201 | 204 | ||
202 | spin_lock_irqsave(&lp->lock, flags); | 205 | spin_lock_irqsave(&lp->lock, flags); |
@@ -228,8 +231,8 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
228 | /* Setup the transmit descriptor. */ | 231 | /* Setup the transmit descriptor. */ |
229 | dma_cache_inv((u32) td, sizeof(*td)); | 232 | dma_cache_inv((u32) td, sizeof(*td)); |
230 | td->ca = CPHYSADDR(skb->data); | 233 | td->ca = CPHYSADDR(skb->data); |
231 | chain_index = (lp->tx_chain_tail - 1) & | 234 | chain_prev = (lp->tx_chain_tail - 1) & KORINA_TDS_MASK; |
232 | KORINA_TDS_MASK; | 235 | chain_next = (lp->tx_chain_tail + 1) & KORINA_TDS_MASK; |
233 | 236 | ||
234 | if (readl(&(lp->tx_dma_regs->dmandptr)) == 0) { | 237 | if (readl(&(lp->tx_dma_regs->dmandptr)) == 0) { |
235 | if (lp->tx_chain_status == desc_empty) { | 238 | if (lp->tx_chain_status == desc_empty) { |
@@ -237,7 +240,7 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
237 | td->control = DMA_COUNT(length) | | 240 | td->control = DMA_COUNT(length) | |
238 | DMA_DESC_COF | DMA_DESC_IOF; | 241 | DMA_DESC_COF | DMA_DESC_IOF; |
239 | /* Move tail */ | 242 | /* Move tail */ |
240 | lp->tx_chain_tail = chain_index; | 243 | lp->tx_chain_tail = chain_next; |
241 | /* Write to NDPTR */ | 244 | /* Write to NDPTR */ |
242 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), | 245 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), |
243 | &lp->tx_dma_regs->dmandptr); | 246 | &lp->tx_dma_regs->dmandptr); |
@@ -248,12 +251,12 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
248 | td->control = DMA_COUNT(length) | | 251 | td->control = DMA_COUNT(length) | |
249 | DMA_DESC_COF | DMA_DESC_IOF; | 252 | DMA_DESC_COF | DMA_DESC_IOF; |
250 | /* Link to prev */ | 253 | /* Link to prev */ |
251 | lp->td_ring[chain_index].control &= | 254 | lp->td_ring[chain_prev].control &= |
252 | ~DMA_DESC_COF; | 255 | ~DMA_DESC_COF; |
253 | /* Link to prev */ | 256 | /* Link to prev */ |
254 | lp->td_ring[chain_index].link = CPHYSADDR(td); | 257 | lp->td_ring[chain_prev].link = CPHYSADDR(td); |
255 | /* Move tail */ | 258 | /* Move tail */ |
256 | lp->tx_chain_tail = chain_index; | 259 | lp->tx_chain_tail = chain_next; |
257 | /* Write to NDPTR */ | 260 | /* Write to NDPTR */ |
258 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), | 261 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), |
259 | &(lp->tx_dma_regs->dmandptr)); | 262 | &(lp->tx_dma_regs->dmandptr)); |
@@ -267,17 +270,16 @@ static int korina_send_packet(struct sk_buff *skb, struct net_device *dev) | |||
267 | td->control = DMA_COUNT(length) | | 270 | td->control = DMA_COUNT(length) | |
268 | DMA_DESC_COF | DMA_DESC_IOF; | 271 | DMA_DESC_COF | DMA_DESC_IOF; |
269 | /* Move tail */ | 272 | /* Move tail */ |
270 | lp->tx_chain_tail = chain_index; | 273 | lp->tx_chain_tail = chain_next; |
271 | lp->tx_chain_status = desc_filled; | 274 | lp->tx_chain_status = desc_filled; |
272 | netif_stop_queue(dev); | ||
273 | } else { | 275 | } else { |
274 | /* Update tail */ | 276 | /* Update tail */ |
275 | td->control = DMA_COUNT(length) | | 277 | td->control = DMA_COUNT(length) | |
276 | DMA_DESC_COF | DMA_DESC_IOF; | 278 | DMA_DESC_COF | DMA_DESC_IOF; |
277 | lp->td_ring[chain_index].control &= | 279 | lp->td_ring[chain_prev].control &= |
278 | ~DMA_DESC_COF; | 280 | ~DMA_DESC_COF; |
279 | lp->td_ring[chain_index].link = CPHYSADDR(td); | 281 | lp->td_ring[chain_prev].link = CPHYSADDR(td); |
280 | lp->tx_chain_tail = chain_index; | 282 | lp->tx_chain_tail = chain_next; |
281 | } | 283 | } |
282 | } | 284 | } |
283 | dma_cache_wback((u32) td, sizeof(*td)); | 285 | dma_cache_wback((u32) td, sizeof(*td)); |
@@ -327,13 +329,13 @@ static irqreturn_t korina_rx_dma_interrupt(int irq, void *dev_id) | |||
327 | 329 | ||
328 | dmas = readl(&lp->rx_dma_regs->dmas); | 330 | dmas = readl(&lp->rx_dma_regs->dmas); |
329 | if (dmas & (DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR)) { | 331 | if (dmas & (DMA_STAT_DONE | DMA_STAT_HALT | DMA_STAT_ERR)) { |
330 | netif_rx_schedule_prep(&lp->napi); | ||
331 | |||
332 | dmasm = readl(&lp->rx_dma_regs->dmasm); | 332 | dmasm = readl(&lp->rx_dma_regs->dmasm); |
333 | writel(dmasm | (DMA_STAT_DONE | | 333 | writel(dmasm | (DMA_STAT_DONE | |
334 | DMA_STAT_HALT | DMA_STAT_ERR), | 334 | DMA_STAT_HALT | DMA_STAT_ERR), |
335 | &lp->rx_dma_regs->dmasm); | 335 | &lp->rx_dma_regs->dmasm); |
336 | 336 | ||
337 | netif_rx_schedule(&lp->napi); | ||
338 | |||
337 | if (dmas & DMA_STAT_ERR) | 339 | if (dmas & DMA_STAT_ERR) |
338 | printk(KERN_ERR DRV_NAME "%s: DMA error\n", dev->name); | 340 | printk(KERN_ERR DRV_NAME "%s: DMA error\n", dev->name); |
339 | 341 | ||
@@ -350,15 +352,20 @@ static int korina_rx(struct net_device *dev, int limit) | |||
350 | struct dma_desc *rd = &lp->rd_ring[lp->rx_next_done]; | 352 | struct dma_desc *rd = &lp->rd_ring[lp->rx_next_done]; |
351 | struct sk_buff *skb, *skb_new; | 353 | struct sk_buff *skb, *skb_new; |
352 | u8 *pkt_buf; | 354 | u8 *pkt_buf; |
353 | u32 devcs, pkt_len, dmas, rx_free_desc; | 355 | u32 devcs, pkt_len, dmas; |
354 | int count; | 356 | int count; |
355 | 357 | ||
356 | dma_cache_inv((u32)rd, sizeof(*rd)); | 358 | dma_cache_inv((u32)rd, sizeof(*rd)); |
357 | 359 | ||
358 | for (count = 0; count < limit; count++) { | 360 | for (count = 0; count < limit; count++) { |
361 | skb = lp->rx_skb[lp->rx_next_done]; | ||
362 | skb_new = NULL; | ||
359 | 363 | ||
360 | devcs = rd->devcs; | 364 | devcs = rd->devcs; |
361 | 365 | ||
366 | if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0) | ||
367 | break; | ||
368 | |||
362 | /* Update statistics counters */ | 369 | /* Update statistics counters */ |
363 | if (devcs & ETH_RX_CRC) | 370 | if (devcs & ETH_RX_CRC) |
364 | dev->stats.rx_crc_errors++; | 371 | dev->stats.rx_crc_errors++; |
@@ -381,63 +388,58 @@ static int korina_rx(struct net_device *dev, int limit) | |||
381 | * in Rc32434 (errata ref #077) */ | 388 | * in Rc32434 (errata ref #077) */ |
382 | dev->stats.rx_errors++; | 389 | dev->stats.rx_errors++; |
383 | dev->stats.rx_dropped++; | 390 | dev->stats.rx_dropped++; |
384 | } | 391 | } else if ((devcs & ETH_RX_ROK)) { |
385 | |||
386 | while ((rx_free_desc = KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) != 0) { | ||
387 | /* init the var. used for the later | ||
388 | * operations within the while loop */ | ||
389 | skb_new = NULL; | ||
390 | pkt_len = RCVPKT_LENGTH(devcs); | 392 | pkt_len = RCVPKT_LENGTH(devcs); |
391 | skb = lp->rx_skb[lp->rx_next_done]; | 393 | |
392 | 394 | /* must be the (first and) last | |
393 | if ((devcs & ETH_RX_ROK)) { | 395 | * descriptor then */ |
394 | /* must be the (first and) last | 396 | pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data; |
395 | * descriptor then */ | 397 | |
396 | pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data; | 398 | /* invalidate the cache */ |
397 | 399 | dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4); | |
398 | /* invalidate the cache */ | 400 | |
399 | dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4); | 401 | /* Malloc up new buffer. */ |
400 | 402 | skb_new = netdev_alloc_skb(dev, KORINA_RBSIZE + 2); | |
401 | /* Malloc up new buffer. */ | 403 | |
402 | skb_new = netdev_alloc_skb(dev, KORINA_RBSIZE + 2); | 404 | if (!skb_new) |
403 | 405 | break; | |
404 | if (!skb_new) | 406 | /* Do not count the CRC */ |
405 | break; | 407 | skb_put(skb, pkt_len - 4); |
406 | /* Do not count the CRC */ | 408 | skb->protocol = eth_type_trans(skb, dev); |
407 | skb_put(skb, pkt_len - 4); | 409 | |
408 | skb->protocol = eth_type_trans(skb, dev); | 410 | /* Pass the packet to upper layers */ |
409 | 411 | netif_receive_skb(skb); | |
410 | /* Pass the packet to upper layers */ | 412 | dev->stats.rx_packets++; |
411 | netif_receive_skb(skb); | 413 | dev->stats.rx_bytes += pkt_len; |
412 | dev->stats.rx_packets++; | 414 | |
413 | dev->stats.rx_bytes += pkt_len; | 415 | /* Update the mcast stats */ |
414 | 416 | if (devcs & ETH_RX_MP) | |
415 | /* Update the mcast stats */ | 417 | dev->stats.multicast++; |
416 | if (devcs & ETH_RX_MP) | 418 | |
417 | dev->stats.multicast++; | 419 | /* 16 bit align */ |
418 | 420 | skb_reserve(skb_new, 2); | |
419 | lp->rx_skb[lp->rx_next_done] = skb_new; | 421 | |
420 | } | 422 | lp->rx_skb[lp->rx_next_done] = skb_new; |
421 | |||
422 | rd->devcs = 0; | ||
423 | |||
424 | /* Restore descriptor's curr_addr */ | ||
425 | if (skb_new) | ||
426 | rd->ca = CPHYSADDR(skb_new->data); | ||
427 | else | ||
428 | rd->ca = CPHYSADDR(skb->data); | ||
429 | |||
430 | rd->control = DMA_COUNT(KORINA_RBSIZE) | | ||
431 | DMA_DESC_COD | DMA_DESC_IOD; | ||
432 | lp->rd_ring[(lp->rx_next_done - 1) & | ||
433 | KORINA_RDS_MASK].control &= | ||
434 | ~DMA_DESC_COD; | ||
435 | |||
436 | lp->rx_next_done = (lp->rx_next_done + 1) & KORINA_RDS_MASK; | ||
437 | dma_cache_wback((u32)rd, sizeof(*rd)); | ||
438 | rd = &lp->rd_ring[lp->rx_next_done]; | ||
439 | writel(~DMA_STAT_DONE, &lp->rx_dma_regs->dmas); | ||
440 | } | 423 | } |
424 | |||
425 | rd->devcs = 0; | ||
426 | |||
427 | /* Restore descriptor's curr_addr */ | ||
428 | if (skb_new) | ||
429 | rd->ca = CPHYSADDR(skb_new->data); | ||
430 | else | ||
431 | rd->ca = CPHYSADDR(skb->data); | ||
432 | |||
433 | rd->control = DMA_COUNT(KORINA_RBSIZE) | | ||
434 | DMA_DESC_COD | DMA_DESC_IOD; | ||
435 | lp->rd_ring[(lp->rx_next_done - 1) & | ||
436 | KORINA_RDS_MASK].control &= | ||
437 | ~DMA_DESC_COD; | ||
438 | |||
439 | lp->rx_next_done = (lp->rx_next_done + 1) & KORINA_RDS_MASK; | ||
440 | dma_cache_wback((u32)rd, sizeof(*rd)); | ||
441 | rd = &lp->rd_ring[lp->rx_next_done]; | ||
442 | writel(~DMA_STAT_DONE, &lp->rx_dma_regs->dmas); | ||
441 | } | 443 | } |
442 | 444 | ||
443 | dmas = readl(&lp->rx_dma_regs->dmas); | 445 | dmas = readl(&lp->rx_dma_regs->dmas); |
@@ -623,12 +625,12 @@ korina_tx_dma_interrupt(int irq, void *dev_id) | |||
623 | dmas = readl(&lp->tx_dma_regs->dmas); | 625 | dmas = readl(&lp->tx_dma_regs->dmas); |
624 | 626 | ||
625 | if (dmas & (DMA_STAT_FINI | DMA_STAT_ERR)) { | 627 | if (dmas & (DMA_STAT_FINI | DMA_STAT_ERR)) { |
626 | korina_tx(dev); | ||
627 | |||
628 | dmasm = readl(&lp->tx_dma_regs->dmasm); | 628 | dmasm = readl(&lp->tx_dma_regs->dmasm); |
629 | writel(dmasm | (DMA_STAT_FINI | DMA_STAT_ERR), | 629 | writel(dmasm | (DMA_STAT_FINI | DMA_STAT_ERR), |
630 | &lp->tx_dma_regs->dmasm); | 630 | &lp->tx_dma_regs->dmasm); |
631 | 631 | ||
632 | korina_tx(dev); | ||
633 | |||
632 | if (lp->tx_chain_status == desc_filled && | 634 | if (lp->tx_chain_status == desc_filled && |
633 | (readl(&(lp->tx_dma_regs->dmandptr)) == 0)) { | 635 | (readl(&(lp->tx_dma_regs->dmandptr)) == 0)) { |
634 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), | 636 | writel(CPHYSADDR(&lp->td_ring[lp->tx_chain_head]), |
@@ -741,6 +743,7 @@ static struct ethtool_ops netdev_ethtool_ops = { | |||
741 | static void korina_alloc_ring(struct net_device *dev) | 743 | static void korina_alloc_ring(struct net_device *dev) |
742 | { | 744 | { |
743 | struct korina_private *lp = netdev_priv(dev); | 745 | struct korina_private *lp = netdev_priv(dev); |
746 | struct sk_buff *skb; | ||
744 | int i; | 747 | int i; |
745 | 748 | ||
746 | /* Initialize the transmit descriptors */ | 749 | /* Initialize the transmit descriptors */ |
@@ -756,8 +759,6 @@ static void korina_alloc_ring(struct net_device *dev) | |||
756 | 759 | ||
757 | /* Initialize the receive descriptors */ | 760 | /* Initialize the receive descriptors */ |
758 | for (i = 0; i < KORINA_NUM_RDS; i++) { | 761 | for (i = 0; i < KORINA_NUM_RDS; i++) { |
759 | struct sk_buff *skb = lp->rx_skb[i]; | ||
760 | |||
761 | skb = dev_alloc_skb(KORINA_RBSIZE + 2); | 762 | skb = dev_alloc_skb(KORINA_RBSIZE + 2); |
762 | if (!skb) | 763 | if (!skb) |
763 | break; | 764 | break; |
@@ -770,11 +771,12 @@ static void korina_alloc_ring(struct net_device *dev) | |||
770 | lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]); | 771 | lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]); |
771 | } | 772 | } |
772 | 773 | ||
773 | /* loop back */ | 774 | /* loop back receive descriptors, so the last |
774 | lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[0]); | 775 | * descriptor points to the first one */ |
775 | lp->rx_next_done = 0; | 776 | lp->rd_ring[i - 1].link = CPHYSADDR(&lp->rd_ring[0]); |
777 | lp->rd_ring[i - 1].control |= DMA_DESC_COD; | ||
776 | 778 | ||
777 | lp->rd_ring[i].control |= DMA_DESC_COD; | 779 | lp->rx_next_done = 0; |
778 | lp->rx_chain_head = 0; | 780 | lp->rx_chain_head = 0; |
779 | lp->rx_chain_tail = 0; | 781 | lp->rx_chain_tail = 0; |
780 | lp->rx_chain_status = desc_empty; | 782 | lp->rx_chain_status = desc_empty; |
@@ -901,6 +903,8 @@ static int korina_restart(struct net_device *dev) | |||
901 | 903 | ||
902 | korina_free_ring(dev); | 904 | korina_free_ring(dev); |
903 | 905 | ||
906 | napi_disable(&lp->napi); | ||
907 | |||
904 | ret = korina_init(dev); | 908 | ret = korina_init(dev); |
905 | if (ret < 0) { | 909 | if (ret < 0) { |
906 | printk(KERN_ERR DRV_NAME "%s: cannot restart device\n", | 910 | printk(KERN_ERR DRV_NAME "%s: cannot restart device\n", |
@@ -999,14 +1003,14 @@ static int korina_open(struct net_device *dev) | |||
999 | * that handles the Done Finished | 1003 | * that handles the Done Finished |
1000 | * Ovr and Und Events */ | 1004 | * Ovr and Und Events */ |
1001 | ret = request_irq(lp->rx_irq, &korina_rx_dma_interrupt, | 1005 | ret = request_irq(lp->rx_irq, &korina_rx_dma_interrupt, |
1002 | IRQF_SHARED | IRQF_DISABLED, "Korina ethernet Rx", dev); | 1006 | IRQF_DISABLED, "Korina ethernet Rx", dev); |
1003 | if (ret < 0) { | 1007 | if (ret < 0) { |
1004 | printk(KERN_ERR DRV_NAME "%s: unable to get Rx DMA IRQ %d\n", | 1008 | printk(KERN_ERR DRV_NAME "%s: unable to get Rx DMA IRQ %d\n", |
1005 | dev->name, lp->rx_irq); | 1009 | dev->name, lp->rx_irq); |
1006 | goto err_release; | 1010 | goto err_release; |
1007 | } | 1011 | } |
1008 | ret = request_irq(lp->tx_irq, &korina_tx_dma_interrupt, | 1012 | ret = request_irq(lp->tx_irq, &korina_tx_dma_interrupt, |
1009 | IRQF_SHARED | IRQF_DISABLED, "Korina ethernet Tx", dev); | 1013 | IRQF_DISABLED, "Korina ethernet Tx", dev); |
1010 | if (ret < 0) { | 1014 | if (ret < 0) { |
1011 | printk(KERN_ERR DRV_NAME "%s: unable to get Tx DMA IRQ %d\n", | 1015 | printk(KERN_ERR DRV_NAME "%s: unable to get Tx DMA IRQ %d\n", |
1012 | dev->name, lp->tx_irq); | 1016 | dev->name, lp->tx_irq); |
@@ -1015,7 +1019,7 @@ static int korina_open(struct net_device *dev) | |||
1015 | 1019 | ||
1016 | /* Install handler for overrun error. */ | 1020 | /* Install handler for overrun error. */ |
1017 | ret = request_irq(lp->ovr_irq, &korina_ovr_interrupt, | 1021 | ret = request_irq(lp->ovr_irq, &korina_ovr_interrupt, |
1018 | IRQF_SHARED | IRQF_DISABLED, "Ethernet Overflow", dev); | 1022 | IRQF_DISABLED, "Ethernet Overflow", dev); |
1019 | if (ret < 0) { | 1023 | if (ret < 0) { |
1020 | printk(KERN_ERR DRV_NAME"%s: unable to get OVR IRQ %d\n", | 1024 | printk(KERN_ERR DRV_NAME"%s: unable to get OVR IRQ %d\n", |
1021 | dev->name, lp->ovr_irq); | 1025 | dev->name, lp->ovr_irq); |
@@ -1024,7 +1028,7 @@ static int korina_open(struct net_device *dev) | |||
1024 | 1028 | ||
1025 | /* Install handler for underflow error. */ | 1029 | /* Install handler for underflow error. */ |
1026 | ret = request_irq(lp->und_irq, &korina_und_interrupt, | 1030 | ret = request_irq(lp->und_irq, &korina_und_interrupt, |
1027 | IRQF_SHARED | IRQF_DISABLED, "Ethernet Underflow", dev); | 1031 | IRQF_DISABLED, "Ethernet Underflow", dev); |
1028 | if (ret < 0) { | 1032 | if (ret < 0) { |
1029 | printk(KERN_ERR DRV_NAME "%s: unable to get UND IRQ %d\n", | 1033 | printk(KERN_ERR DRV_NAME "%s: unable to get UND IRQ %d\n", |
1030 | dev->name, lp->und_irq); | 1034 | dev->name, lp->und_irq); |
@@ -1067,6 +1071,8 @@ static int korina_close(struct net_device *dev) | |||
1067 | 1071 | ||
1068 | korina_free_ring(dev); | 1072 | korina_free_ring(dev); |
1069 | 1073 | ||
1074 | napi_disable(&lp->napi); | ||
1075 | |||
1070 | free_irq(lp->rx_irq, dev); | 1076 | free_irq(lp->rx_irq, dev); |
1071 | free_irq(lp->tx_irq, dev); | 1077 | free_irq(lp->tx_irq, dev); |
1072 | free_irq(lp->ovr_irq, dev); | 1078 | free_irq(lp->ovr_irq, dev); |
@@ -1089,7 +1095,6 @@ static int korina_probe(struct platform_device *pdev) | |||
1089 | return -ENOMEM; | 1095 | return -ENOMEM; |
1090 | } | 1096 | } |
1091 | SET_NETDEV_DEV(dev, &pdev->dev); | 1097 | SET_NETDEV_DEV(dev, &pdev->dev); |
1092 | platform_set_drvdata(pdev, dev); | ||
1093 | lp = netdev_priv(dev); | 1098 | lp = netdev_priv(dev); |
1094 | 1099 | ||
1095 | bif->dev = dev; | 1100 | bif->dev = dev; |
diff --git a/drivers/net/mac8390.c b/drivers/net/mac8390.c index 57716e22660c..8e884869a05b 100644 --- a/drivers/net/mac8390.c +++ b/drivers/net/mac8390.c | |||
@@ -486,6 +486,7 @@ static const struct net_device_ops mac8390_netdev_ops = { | |||
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_change_mtu = eth_change_mtu, | 490 | .ndo_change_mtu = eth_change_mtu, |
490 | #ifdef CONFIG_NET_POLL_CONTROLLER | 491 | #ifdef CONFIG_NET_POLL_CONTROLLER |
491 | .ndo_poll_controller = ei_poll, | 492 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index a04da4ecaa88..f6c4936e2fa8 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c | |||
@@ -321,6 +321,10 @@ static void macb_tx(struct macb *bp) | |||
321 | printk(KERN_ERR "%s: TX underrun, resetting buffers\n", | 321 | printk(KERN_ERR "%s: TX underrun, resetting buffers\n", |
322 | bp->dev->name); | 322 | bp->dev->name); |
323 | 323 | ||
324 | /* Transfer ongoing, disable transmitter, to avoid confusion */ | ||
325 | if (status & MACB_BIT(TGO)) | ||
326 | macb_writel(bp, NCR, macb_readl(bp, NCR) & ~MACB_BIT(TE)); | ||
327 | |||
324 | head = bp->tx_head; | 328 | head = bp->tx_head; |
325 | 329 | ||
326 | /*Mark all the buffer as used to avoid sending a lost buffer*/ | 330 | /*Mark all the buffer as used to avoid sending a lost buffer*/ |
@@ -343,6 +347,10 @@ static void macb_tx(struct macb *bp) | |||
343 | } | 347 | } |
344 | 348 | ||
345 | bp->tx_head = bp->tx_tail = 0; | 349 | bp->tx_head = bp->tx_tail = 0; |
350 | |||
351 | /* Enable the transmitter again */ | ||
352 | if (status & MACB_BIT(TGO)) | ||
353 | macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TE)); | ||
346 | } | 354 | } |
347 | 355 | ||
348 | if (!(status & MACB_BIT(COMP))) | 356 | if (!(status & MACB_BIT(COMP))) |
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index 15bb38d99304..9f6644a44030 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c | |||
@@ -952,6 +952,7 @@ static const struct net_device_ops mlx4_netdev_ops = { | |||
952 | .ndo_get_stats = mlx4_en_get_stats, | 952 | .ndo_get_stats = mlx4_en_get_stats, |
953 | .ndo_set_multicast_list = mlx4_en_set_multicast, | 953 | .ndo_set_multicast_list = mlx4_en_set_multicast, |
954 | .ndo_set_mac_address = mlx4_en_set_mac, | 954 | .ndo_set_mac_address = mlx4_en_set_mac, |
955 | .ndo_validate_addr = eth_validate_addr, | ||
955 | .ndo_change_mtu = mlx4_en_change_mtu, | 956 | .ndo_change_mtu = mlx4_en_change_mtu, |
956 | .ndo_tx_timeout = mlx4_en_tx_timeout, | 957 | .ndo_tx_timeout = mlx4_en_tx_timeout, |
957 | .ndo_vlan_rx_register = mlx4_en_vlan_rx_register, | 958 | .ndo_vlan_rx_register = mlx4_en_vlan_rx_register, |
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 710c79e7a2db..6ef2490d5c3e 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c | |||
@@ -912,8 +912,8 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev) | |||
912 | int i; | 912 | int i; |
913 | 913 | ||
914 | if (msi_x) { | 914 | if (msi_x) { |
915 | nreq = min(dev->caps.num_eqs - dev->caps.reserved_eqs, | 915 | nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, |
916 | num_possible_cpus() + 1); | 916 | num_possible_cpus() + 1); |
917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); | 917 | entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); |
918 | if (!entries) | 918 | if (!entries) |
919 | goto no_msi; | 919 | goto no_msi; |
diff --git a/drivers/net/mlx4/profile.c b/drivers/net/mlx4/profile.c index 919fb9eb1b62..cebdf3243ca1 100644 --- a/drivers/net/mlx4/profile.c +++ b/drivers/net/mlx4/profile.c | |||
@@ -107,9 +107,9 @@ u64 mlx4_make_profile(struct mlx4_dev *dev, | |||
107 | profile[MLX4_RES_AUXC].num = request->num_qp; | 107 | profile[MLX4_RES_AUXC].num = request->num_qp; |
108 | profile[MLX4_RES_SRQ].num = request->num_srq; | 108 | profile[MLX4_RES_SRQ].num = request->num_srq; |
109 | profile[MLX4_RES_CQ].num = request->num_cq; | 109 | profile[MLX4_RES_CQ].num = request->num_cq; |
110 | profile[MLX4_RES_EQ].num = min(dev_cap->max_eqs, | 110 | profile[MLX4_RES_EQ].num = min_t(unsigned, dev_cap->max_eqs, |
111 | dev_cap->reserved_eqs + | 111 | dev_cap->reserved_eqs + |
112 | num_possible_cpus() + 1); | 112 | num_possible_cpus() + 1); |
113 | profile[MLX4_RES_DMPT].num = request->num_mpt; | 113 | profile[MLX4_RES_DMPT].num = request->num_mpt; |
114 | profile[MLX4_RES_CMPT].num = MLX4_NUM_CMPTS; | 114 | profile[MLX4_RES_CMPT].num = MLX4_NUM_CMPTS; |
115 | profile[MLX4_RES_MTT].num = request->num_mtt; | 115 | profile[MLX4_RES_MTT].num = request->num_mtt; |
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 7253a499d9c8..5f31bbb614af 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -136,21 +136,23 @@ static char mv643xx_eth_driver_version[] = "1.4"; | |||
136 | /* | 136 | /* |
137 | * SDMA configuration register. | 137 | * SDMA configuration register. |
138 | */ | 138 | */ |
139 | #define RX_BURST_SIZE_4_64BIT (2 << 1) | ||
139 | #define RX_BURST_SIZE_16_64BIT (4 << 1) | 140 | #define RX_BURST_SIZE_16_64BIT (4 << 1) |
140 | #define BLM_RX_NO_SWAP (1 << 4) | 141 | #define BLM_RX_NO_SWAP (1 << 4) |
141 | #define BLM_TX_NO_SWAP (1 << 5) | 142 | #define BLM_TX_NO_SWAP (1 << 5) |
143 | #define TX_BURST_SIZE_4_64BIT (2 << 22) | ||
142 | #define TX_BURST_SIZE_16_64BIT (4 << 22) | 144 | #define TX_BURST_SIZE_16_64BIT (4 << 22) |
143 | 145 | ||
144 | #if defined(__BIG_ENDIAN) | 146 | #if defined(__BIG_ENDIAN) |
145 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ | 147 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ |
146 | (RX_BURST_SIZE_16_64BIT | \ | 148 | (RX_BURST_SIZE_4_64BIT | \ |
147 | TX_BURST_SIZE_16_64BIT) | 149 | TX_BURST_SIZE_4_64BIT) |
148 | #elif defined(__LITTLE_ENDIAN) | 150 | #elif defined(__LITTLE_ENDIAN) |
149 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ | 151 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ |
150 | (RX_BURST_SIZE_16_64BIT | \ | 152 | (RX_BURST_SIZE_4_64BIT | \ |
151 | BLM_RX_NO_SWAP | \ | 153 | BLM_RX_NO_SWAP | \ |
152 | BLM_TX_NO_SWAP | \ | 154 | BLM_TX_NO_SWAP | \ |
153 | TX_BURST_SIZE_16_64BIT) | 155 | TX_BURST_SIZE_4_64BIT) |
154 | #else | 156 | #else |
155 | #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined | 157 | #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined |
156 | #endif | 158 | #endif |
@@ -1594,7 +1596,7 @@ oom: | |||
1594 | entry = addr_crc(a); | 1596 | entry = addr_crc(a); |
1595 | } | 1597 | } |
1596 | 1598 | ||
1597 | table[entry >> 2] |= 1 << (entry & 3); | 1599 | table[entry >> 2] |= 1 << (8 * (entry & 3)); |
1598 | } | 1600 | } |
1599 | 1601 | ||
1600 | for (i = 0; i < 0x100; i += 4) { | 1602 | for (i = 0; i < 0x100; i += 4) { |
@@ -2210,6 +2212,7 @@ static int mv643xx_eth_stop(struct net_device *dev) | |||
2210 | struct mv643xx_eth_private *mp = netdev_priv(dev); | 2212 | struct mv643xx_eth_private *mp = netdev_priv(dev); |
2211 | int i; | 2213 | int i; |
2212 | 2214 | ||
2215 | wrlp(mp, INT_MASK_EXT, 0x00000000); | ||
2213 | wrlp(mp, INT_MASK, 0x00000000); | 2216 | wrlp(mp, INT_MASK, 0x00000000); |
2214 | rdlp(mp, INT_MASK); | 2217 | rdlp(mp, INT_MASK); |
2215 | 2218 | ||
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 6bb71b687f7b..e9c1296b267e 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /************************************************************************* | 1 | /************************************************************************* |
2 | * myri10ge.c: Myricom Myri-10G Ethernet driver. | 2 | * myri10ge.c: Myricom Myri-10G Ethernet driver. |
3 | * | 3 | * |
4 | * Copyright (C) 2005 - 2007 Myricom, Inc. | 4 | * Copyright (C) 2005 - 2009 Myricom, Inc. |
5 | * All rights reserved. | 5 | * All rights reserved. |
6 | * | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without |
@@ -75,7 +75,7 @@ | |||
75 | #include "myri10ge_mcp.h" | 75 | #include "myri10ge_mcp.h" |
76 | #include "myri10ge_mcp_gen_header.h" | 76 | #include "myri10ge_mcp_gen_header.h" |
77 | 77 | ||
78 | #define MYRI10GE_VERSION_STR "1.4.4-1.398" | 78 | #define MYRI10GE_VERSION_STR "1.4.4-1.401" |
79 | 79 | ||
80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 80 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
81 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 81 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -3786,7 +3786,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3786 | if (status != 0) { | 3786 | if (status != 0) { |
3787 | dev_err(&pdev->dev, "Error %d writing PCI_EXP_DEVCTL\n", | 3787 | dev_err(&pdev->dev, "Error %d writing PCI_EXP_DEVCTL\n", |
3788 | status); | 3788 | status); |
3789 | goto abort_with_netdev; | 3789 | goto abort_with_enabled; |
3790 | } | 3790 | } |
3791 | 3791 | ||
3792 | pci_set_master(pdev); | 3792 | pci_set_master(pdev); |
@@ -3801,13 +3801,13 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3801 | } | 3801 | } |
3802 | if (status != 0) { | 3802 | if (status != 0) { |
3803 | dev_err(&pdev->dev, "Error %d setting DMA mask\n", status); | 3803 | dev_err(&pdev->dev, "Error %d setting DMA mask\n", status); |
3804 | goto abort_with_netdev; | 3804 | goto abort_with_enabled; |
3805 | } | 3805 | } |
3806 | (void)pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); | 3806 | (void)pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); |
3807 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), | 3807 | mgp->cmd = dma_alloc_coherent(&pdev->dev, sizeof(*mgp->cmd), |
3808 | &mgp->cmd_bus, GFP_KERNEL); | 3808 | &mgp->cmd_bus, GFP_KERNEL); |
3809 | if (mgp->cmd == NULL) | 3809 | if (mgp->cmd == NULL) |
3810 | goto abort_with_netdev; | 3810 | goto abort_with_enabled; |
3811 | 3811 | ||
3812 | mgp->board_span = pci_resource_len(pdev, 0); | 3812 | mgp->board_span = pci_resource_len(pdev, 0); |
3813 | mgp->iomem_base = pci_resource_start(pdev, 0); | 3813 | mgp->iomem_base = pci_resource_start(pdev, 0); |
@@ -3943,8 +3943,10 @@ abort_with_mtrr: | |||
3943 | dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd), | 3943 | dma_free_coherent(&pdev->dev, sizeof(*mgp->cmd), |
3944 | mgp->cmd, mgp->cmd_bus); | 3944 | mgp->cmd, mgp->cmd_bus); |
3945 | 3945 | ||
3946 | abort_with_netdev: | 3946 | abort_with_enabled: |
3947 | pci_disable_device(pdev); | ||
3947 | 3948 | ||
3949 | abort_with_netdev: | ||
3948 | free_netdev(netdev); | 3950 | free_netdev(netdev); |
3949 | return status; | 3951 | return status; |
3950 | } | 3952 | } |
@@ -3990,6 +3992,7 @@ static void myri10ge_remove(struct pci_dev *pdev) | |||
3990 | mgp->cmd, mgp->cmd_bus); | 3992 | mgp->cmd, mgp->cmd_bus); |
3991 | 3993 | ||
3992 | free_netdev(netdev); | 3994 | free_netdev(netdev); |
3995 | pci_disable_device(pdev); | ||
3993 | pci_set_drvdata(pdev, NULL); | 3996 | pci_set_drvdata(pdev, NULL); |
3994 | } | 3997 | } |
3995 | 3998 | ||
diff --git a/drivers/net/ne-h8300.c b/drivers/net/ne-h8300.c index b57239171046..7bd6662d5b04 100644 --- a/drivers/net/ne-h8300.c +++ b/drivers/net/ne-h8300.c | |||
@@ -202,6 +202,7 @@ static const struct net_device_ops ne_netdev_ops = { | |||
202 | .ndo_get_stats = ei_get_stats, | 202 | .ndo_get_stats = ei_get_stats, |
203 | .ndo_set_multicast_list = ei_set_multicast_list, | 203 | .ndo_set_multicast_list = ei_set_multicast_list, |
204 | .ndo_validate_addr = eth_validate_addr, | 204 | .ndo_validate_addr = eth_validate_addr, |
205 | .ndo_set_mac_address = eth_mac_addr, | ||
205 | .ndo_change_mtu = eth_change_mtu, | 206 | .ndo_change_mtu = eth_change_mtu, |
206 | #ifdef CONFIG_NET_POLL_CONTROLLER | 207 | #ifdef CONFIG_NET_POLL_CONTROLLER |
207 | .ndo_poll_controller = ei_poll, | 208 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index 62f20ba211cb..f090d3b9ec94 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c | |||
@@ -208,6 +208,7 @@ static const struct net_device_ops ne2k_netdev_ops = { | |||
208 | .ndo_get_stats = ei_get_stats, | 208 | .ndo_get_stats = ei_get_stats, |
209 | .ndo_set_multicast_list = ei_set_multicast_list, | 209 | .ndo_set_multicast_list = ei_set_multicast_list, |
210 | .ndo_validate_addr = eth_validate_addr, | 210 | .ndo_validate_addr = eth_validate_addr, |
211 | .ndo_set_mac_address = eth_mac_addr, | ||
211 | .ndo_change_mtu = eth_change_mtu, | 212 | .ndo_change_mtu = eth_change_mtu, |
212 | #ifdef CONFIG_NET_POLL_CONTROLLER | 213 | #ifdef CONFIG_NET_POLL_CONTROLLER |
213 | .ndo_poll_controller = ei_poll, | 214 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/ne3210.c b/drivers/net/ne3210.c index fac43fd6fc87..6a843f7350ab 100644 --- a/drivers/net/ne3210.c +++ b/drivers/net/ne3210.c | |||
@@ -150,7 +150,8 @@ static int __init ne3210_eisa_probe (struct device *device) | |||
150 | if (phys_mem < virt_to_phys(high_memory)) { | 150 | if (phys_mem < virt_to_phys(high_memory)) { |
151 | printk(KERN_CRIT "ne3210.c: Card RAM overlaps with normal memory!!!\n"); | 151 | printk(KERN_CRIT "ne3210.c: Card RAM overlaps with normal memory!!!\n"); |
152 | printk(KERN_CRIT "ne3210.c: Use EISA SCU to set card memory below 1MB,\n"); | 152 | printk(KERN_CRIT "ne3210.c: Use EISA SCU to set card memory below 1MB,\n"); |
153 | printk(KERN_CRIT "ne3210.c: or to an address above 0x%lx.\n", virt_to_phys(high_memory)); | 153 | printk(KERN_CRIT "ne3210.c: or to an address above 0x%llx.\n", |
154 | (u64)virt_to_phys(high_memory)); | ||
154 | printk(KERN_CRIT "ne3210.c: Driver NOT installed.\n"); | 155 | printk(KERN_CRIT "ne3210.c: Driver NOT installed.\n"); |
155 | retval = -EINVAL; | 156 | retval = -EINVAL; |
156 | goto out3; | 157 | goto out3; |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index f8e601c51da7..f4dd9acb6877 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -146,7 +146,7 @@ | |||
146 | 146 | ||
147 | #define MAX_RX_BUFFER_LENGTH 1760 | 147 | #define MAX_RX_BUFFER_LENGTH 1760 |
148 | #define MAX_RX_JUMBO_BUFFER_LENGTH 8062 | 148 | #define MAX_RX_JUMBO_BUFFER_LENGTH 8062 |
149 | #define MAX_RX_LRO_BUFFER_LENGTH ((48*1024)-512) | 149 | #define MAX_RX_LRO_BUFFER_LENGTH (8062) |
150 | #define RX_DMA_MAP_LEN (MAX_RX_BUFFER_LENGTH - 2) | 150 | #define RX_DMA_MAP_LEN (MAX_RX_BUFFER_LENGTH - 2) |
151 | #define RX_JUMBO_DMA_MAP_LEN \ | 151 | #define RX_JUMBO_DMA_MAP_LEN \ |
152 | (MAX_RX_JUMBO_BUFFER_LENGTH - 2) | 152 | (MAX_RX_JUMBO_BUFFER_LENGTH - 2) |
@@ -207,11 +207,11 @@ | |||
207 | 207 | ||
208 | #define MAX_CMD_DESCRIPTORS 4096 | 208 | #define MAX_CMD_DESCRIPTORS 4096 |
209 | #define MAX_RCV_DESCRIPTORS 16384 | 209 | #define MAX_RCV_DESCRIPTORS 16384 |
210 | #define MAX_CMD_DESCRIPTORS_HOST (MAX_CMD_DESCRIPTORS / 4) | 210 | #define MAX_CMD_DESCRIPTORS_HOST 1024 |
211 | #define MAX_RCV_DESCRIPTORS_1G (MAX_RCV_DESCRIPTORS / 4) | 211 | #define MAX_RCV_DESCRIPTORS_1G 2048 |
212 | #define MAX_RCV_DESCRIPTORS_10G 8192 | 212 | #define MAX_RCV_DESCRIPTORS_10G 4096 |
213 | #define MAX_JUMBO_RCV_DESCRIPTORS 1024 | 213 | #define MAX_JUMBO_RCV_DESCRIPTORS 1024 |
214 | #define MAX_LRO_RCV_DESCRIPTORS 64 | 214 | #define MAX_LRO_RCV_DESCRIPTORS 8 |
215 | #define MAX_RCVSTATUS_DESCRIPTORS MAX_RCV_DESCRIPTORS | 215 | #define MAX_RCVSTATUS_DESCRIPTORS MAX_RCV_DESCRIPTORS |
216 | #define MAX_JUMBO_RCV_DESC MAX_JUMBO_RCV_DESCRIPTORS | 216 | #define MAX_JUMBO_RCV_DESC MAX_JUMBO_RCV_DESCRIPTORS |
217 | #define MAX_RCV_DESC MAX_RCV_DESCRIPTORS | 217 | #define MAX_RCV_DESC MAX_RCV_DESCRIPTORS |
@@ -308,27 +308,16 @@ struct netxen_ring_ctx { | |||
308 | #define netxen_set_cmd_desc_ctxid(cmd_desc, var) \ | 308 | #define netxen_set_cmd_desc_ctxid(cmd_desc, var) \ |
309 | ((cmd_desc)->port_ctxid |= ((var) << 4 & 0xF0)) | 309 | ((cmd_desc)->port_ctxid |= ((var) << 4 & 0xF0)) |
310 | 310 | ||
311 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ | 311 | #define netxen_set_tx_port(_desc, _port) \ |
312 | (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ | 312 | (_desc)->port_ctxid = ((_port) & 0xf) | (((_port) << 4) & 0xf0) |
313 | ~cpu_to_le16(0x7f)) | cpu_to_le16((val) & 0x7f) | 313 | |
314 | #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ | 314 | #define netxen_set_tx_flags_opcode(_desc, _flags, _opcode) \ |
315 | (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ | 315 | (_desc)->flags_opcode = \ |
316 | ~cpu_to_le16((u16)0x3f << 7)) | cpu_to_le16(((val) & 0x3f) << 7) | 316 | cpu_to_le16(((_flags) & 0x7f) | (((_opcode) & 0x3f) << 7)) |
317 | 317 | ||
318 | #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ | 318 | #define netxen_set_tx_frags_len(_desc, _frags, _len) \ |
319 | (cmd_desc)->num_of_buffers_total_length = \ | 319 | (_desc)->num_of_buffers_total_length = \ |
320 | ((cmd_desc)->num_of_buffers_total_length & \ | 320 | cpu_to_le32(((_frags) & 0xff) | (((_len) & 0xffffff) << 8)) |
321 | ~cpu_to_le32(0xff)) | cpu_to_le32((val) & 0xff) | ||
322 | #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ | ||
323 | (cmd_desc)->num_of_buffers_total_length = \ | ||
324 | ((cmd_desc)->num_of_buffers_total_length & \ | ||
325 | ~cpu_to_le32((u32)0xffffff << 8)) | \ | ||
326 | cpu_to_le32(((val) & 0xffffff) << 8) | ||
327 | |||
328 | #define netxen_get_cmd_desc_opcode(cmd_desc) \ | ||
329 | ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003f) | ||
330 | #define netxen_get_cmd_desc_totallength(cmd_desc) \ | ||
331 | ((le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) & 0xffffff) | ||
332 | 321 | ||
333 | struct cmd_desc_type0 { | 322 | struct cmd_desc_type0 { |
334 | u8 tcp_hdr_offset; /* For LSO only */ | 323 | u8 tcp_hdr_offset; /* For LSO only */ |
@@ -510,7 +499,8 @@ typedef enum { | |||
510 | NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a, | 499 | NETXEN_BRDTYPE_P3_10G_SFP_CT = 0x002a, |
511 | NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b, | 500 | NETXEN_BRDTYPE_P3_10G_SFP_QT = 0x002b, |
512 | NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031, | 501 | NETXEN_BRDTYPE_P3_10G_CX4 = 0x0031, |
513 | NETXEN_BRDTYPE_P3_10G_XFP = 0x0032 | 502 | NETXEN_BRDTYPE_P3_10G_XFP = 0x0032, |
503 | NETXEN_BRDTYPE_P3_10G_TP = 0x0080 | ||
514 | 504 | ||
515 | } netxen_brdtype_t; | 505 | } netxen_brdtype_t; |
516 | 506 | ||
@@ -757,7 +747,7 @@ extern char netxen_nic_driver_name[]; | |||
757 | */ | 747 | */ |
758 | struct netxen_skb_frag { | 748 | struct netxen_skb_frag { |
759 | u64 dma; | 749 | u64 dma; |
760 | u32 length; | 750 | ulong length; |
761 | }; | 751 | }; |
762 | 752 | ||
763 | #define _netxen_set_bits(config_word, start, bits, val) {\ | 753 | #define _netxen_set_bits(config_word, start, bits, val) {\ |
@@ -783,13 +773,7 @@ struct netxen_skb_frag { | |||
783 | struct netxen_cmd_buffer { | 773 | struct netxen_cmd_buffer { |
784 | struct sk_buff *skb; | 774 | struct sk_buff *skb; |
785 | struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; | 775 | struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; |
786 | u32 total_length; | 776 | u32 frag_count; |
787 | u32 mss; | ||
788 | u16 port; | ||
789 | u8 cmd; | ||
790 | u8 frag_count; | ||
791 | unsigned long time_stamp; | ||
792 | u32 state; | ||
793 | }; | 777 | }; |
794 | 778 | ||
795 | /* In rx_buffer, we do not need multiple fragments as is a single buffer */ | 779 | /* In rx_buffer, we do not need multiple fragments as is a single buffer */ |
@@ -876,7 +860,6 @@ struct nx_host_rds_ring { | |||
876 | u32 skb_size; | 860 | u32 skb_size; |
877 | struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */ | 861 | struct netxen_rx_buffer *rx_buf_arr; /* rx buffers for receive */ |
878 | struct list_head free_list; | 862 | struct list_head free_list; |
879 | int begin_alloc; | ||
880 | }; | 863 | }; |
881 | 864 | ||
882 | /* | 865 | /* |
@@ -995,31 +978,31 @@ struct netxen_recv_context { | |||
995 | */ | 978 | */ |
996 | 979 | ||
997 | typedef struct { | 980 | typedef struct { |
998 | u64 host_phys_addr; /* Ring base addr */ | 981 | __le64 host_phys_addr; /* Ring base addr */ |
999 | u32 ring_size; /* Ring entries */ | 982 | __le32 ring_size; /* Ring entries */ |
1000 | u16 msi_index; | 983 | __le16 msi_index; |
1001 | u16 rsvd; /* Padding */ | 984 | __le16 rsvd; /* Padding */ |
1002 | } nx_hostrq_sds_ring_t; | 985 | } nx_hostrq_sds_ring_t; |
1003 | 986 | ||
1004 | typedef struct { | 987 | typedef struct { |
1005 | u64 host_phys_addr; /* Ring base addr */ | 988 | __le64 host_phys_addr; /* Ring base addr */ |
1006 | u64 buff_size; /* Packet buffer size */ | 989 | __le64 buff_size; /* Packet buffer size */ |
1007 | u32 ring_size; /* Ring entries */ | 990 | __le32 ring_size; /* Ring entries */ |
1008 | u32 ring_kind; /* Class of ring */ | 991 | __le32 ring_kind; /* Class of ring */ |
1009 | } nx_hostrq_rds_ring_t; | 992 | } nx_hostrq_rds_ring_t; |
1010 | 993 | ||
1011 | typedef struct { | 994 | typedef struct { |
1012 | u64 host_rsp_dma_addr; /* Response dma'd here */ | 995 | __le64 host_rsp_dma_addr; /* Response dma'd here */ |
1013 | u32 capabilities[4]; /* Flag bit vector */ | 996 | __le32 capabilities[4]; /* Flag bit vector */ |
1014 | u32 host_int_crb_mode; /* Interrupt crb usage */ | 997 | __le32 host_int_crb_mode; /* Interrupt crb usage */ |
1015 | u32 host_rds_crb_mode; /* RDS crb usage */ | 998 | __le32 host_rds_crb_mode; /* RDS crb usage */ |
1016 | /* These ring offsets are relative to data[0] below */ | 999 | /* These ring offsets are relative to data[0] below */ |
1017 | u32 rds_ring_offset; /* Offset to RDS config */ | 1000 | __le32 rds_ring_offset; /* Offset to RDS config */ |
1018 | u32 sds_ring_offset; /* Offset to SDS config */ | 1001 | __le32 sds_ring_offset; /* Offset to SDS config */ |
1019 | u16 num_rds_rings; /* Count of RDS rings */ | 1002 | __le16 num_rds_rings; /* Count of RDS rings */ |
1020 | u16 num_sds_rings; /* Count of SDS rings */ | 1003 | __le16 num_sds_rings; /* Count of SDS rings */ |
1021 | u16 rsvd1; /* Padding */ | 1004 | __le16 rsvd1; /* Padding */ |
1022 | u16 rsvd2; /* Padding */ | 1005 | __le16 rsvd2; /* Padding */ |
1023 | u8 reserved[128]; /* reserve space for future expansion*/ | 1006 | u8 reserved[128]; /* reserve space for future expansion*/ |
1024 | /* MUST BE 64-bit aligned. | 1007 | /* MUST BE 64-bit aligned. |
1025 | The following is packed: | 1008 | The following is packed: |
@@ -1029,24 +1012,24 @@ typedef struct { | |||
1029 | } nx_hostrq_rx_ctx_t; | 1012 | } nx_hostrq_rx_ctx_t; |
1030 | 1013 | ||
1031 | typedef struct { | 1014 | typedef struct { |
1032 | u32 host_producer_crb; /* Crb to use */ | 1015 | __le32 host_producer_crb; /* Crb to use */ |
1033 | u32 rsvd1; /* Padding */ | 1016 | __le32 rsvd1; /* Padding */ |
1034 | } nx_cardrsp_rds_ring_t; | 1017 | } nx_cardrsp_rds_ring_t; |
1035 | 1018 | ||
1036 | typedef struct { | 1019 | typedef struct { |
1037 | u32 host_consumer_crb; /* Crb to use */ | 1020 | __le32 host_consumer_crb; /* Crb to use */ |
1038 | u32 interrupt_crb; /* Crb to use */ | 1021 | __le32 interrupt_crb; /* Crb to use */ |
1039 | } nx_cardrsp_sds_ring_t; | 1022 | } nx_cardrsp_sds_ring_t; |
1040 | 1023 | ||
1041 | typedef struct { | 1024 | typedef struct { |
1042 | /* These ring offsets are relative to data[0] below */ | 1025 | /* These ring offsets are relative to data[0] below */ |
1043 | u32 rds_ring_offset; /* Offset to RDS config */ | 1026 | __le32 rds_ring_offset; /* Offset to RDS config */ |
1044 | u32 sds_ring_offset; /* Offset to SDS config */ | 1027 | __le32 sds_ring_offset; /* Offset to SDS config */ |
1045 | u32 host_ctx_state; /* Starting State */ | 1028 | __le32 host_ctx_state; /* Starting State */ |
1046 | u32 num_fn_per_port; /* How many PCI fn share the port */ | 1029 | __le32 num_fn_per_port; /* How many PCI fn share the port */ |
1047 | u16 num_rds_rings; /* Count of RDS rings */ | 1030 | __le16 num_rds_rings; /* Count of RDS rings */ |
1048 | u16 num_sds_rings; /* Count of SDS rings */ | 1031 | __le16 num_sds_rings; /* Count of SDS rings */ |
1049 | u16 context_id; /* Handle for context */ | 1032 | __le16 context_id; /* Handle for context */ |
1050 | u8 phys_port; /* Physical id of port */ | 1033 | u8 phys_port; /* Physical id of port */ |
1051 | u8 virt_port; /* Virtual/Logical id of port */ | 1034 | u8 virt_port; /* Virtual/Logical id of port */ |
1052 | u8 reserved[128]; /* save space for future expansion */ | 1035 | u8 reserved[128]; /* save space for future expansion */ |
@@ -1072,34 +1055,34 @@ typedef struct { | |||
1072 | */ | 1055 | */ |
1073 | 1056 | ||
1074 | typedef struct { | 1057 | typedef struct { |
1075 | u64 host_phys_addr; /* Ring base addr */ | 1058 | __le64 host_phys_addr; /* Ring base addr */ |
1076 | u32 ring_size; /* Ring entries */ | 1059 | __le32 ring_size; /* Ring entries */ |
1077 | u32 rsvd; /* Padding */ | 1060 | __le32 rsvd; /* Padding */ |
1078 | } nx_hostrq_cds_ring_t; | 1061 | } nx_hostrq_cds_ring_t; |
1079 | 1062 | ||
1080 | typedef struct { | 1063 | typedef struct { |
1081 | u64 host_rsp_dma_addr; /* Response dma'd here */ | 1064 | __le64 host_rsp_dma_addr; /* Response dma'd here */ |
1082 | u64 cmd_cons_dma_addr; /* */ | 1065 | __le64 cmd_cons_dma_addr; /* */ |
1083 | u64 dummy_dma_addr; /* */ | 1066 | __le64 dummy_dma_addr; /* */ |
1084 | u32 capabilities[4]; /* Flag bit vector */ | 1067 | __le32 capabilities[4]; /* Flag bit vector */ |
1085 | u32 host_int_crb_mode; /* Interrupt crb usage */ | 1068 | __le32 host_int_crb_mode; /* Interrupt crb usage */ |
1086 | u32 rsvd1; /* Padding */ | 1069 | __le32 rsvd1; /* Padding */ |
1087 | u16 rsvd2; /* Padding */ | 1070 | __le16 rsvd2; /* Padding */ |
1088 | u16 interrupt_ctl; | 1071 | __le16 interrupt_ctl; |
1089 | u16 msi_index; | 1072 | __le16 msi_index; |
1090 | u16 rsvd3; /* Padding */ | 1073 | __le16 rsvd3; /* Padding */ |
1091 | nx_hostrq_cds_ring_t cds_ring; /* Desc of cds ring */ | 1074 | nx_hostrq_cds_ring_t cds_ring; /* Desc of cds ring */ |
1092 | u8 reserved[128]; /* future expansion */ | 1075 | u8 reserved[128]; /* future expansion */ |
1093 | } nx_hostrq_tx_ctx_t; | 1076 | } nx_hostrq_tx_ctx_t; |
1094 | 1077 | ||
1095 | typedef struct { | 1078 | typedef struct { |
1096 | u32 host_producer_crb; /* Crb to use */ | 1079 | __le32 host_producer_crb; /* Crb to use */ |
1097 | u32 interrupt_crb; /* Crb to use */ | 1080 | __le32 interrupt_crb; /* Crb to use */ |
1098 | } nx_cardrsp_cds_ring_t; | 1081 | } nx_cardrsp_cds_ring_t; |
1099 | 1082 | ||
1100 | typedef struct { | 1083 | typedef struct { |
1101 | u32 host_ctx_state; /* Starting state */ | 1084 | __le32 host_ctx_state; /* Starting state */ |
1102 | u16 context_id; /* Handle for context */ | 1085 | __le16 context_id; /* Handle for context */ |
1103 | u8 phys_port; /* Physical id of port */ | 1086 | u8 phys_port; /* Physical id of port */ |
1104 | u8 virt_port; /* Virtual/Logical id of port */ | 1087 | u8 virt_port; /* Virtual/Logical id of port */ |
1105 | nx_cardrsp_cds_ring_t cds_ring; /* Card cds settings */ | 1088 | nx_cardrsp_cds_ring_t cds_ring; /* Card cds settings */ |
@@ -1202,9 +1185,9 @@ enum { | |||
1202 | #define VPORT_MISS_MODE_ACCEPT_MULTI 2 /* accept unmatched multicast */ | 1185 | #define VPORT_MISS_MODE_ACCEPT_MULTI 2 /* accept unmatched multicast */ |
1203 | 1186 | ||
1204 | typedef struct { | 1187 | typedef struct { |
1205 | u64 qhdr; | 1188 | __le64 qhdr; |
1206 | u64 req_hdr; | 1189 | __le64 req_hdr; |
1207 | u64 words[6]; | 1190 | __le64 words[6]; |
1208 | } nx_nic_req_t; | 1191 | } nx_nic_req_t; |
1209 | 1192 | ||
1210 | typedef struct { | 1193 | typedef struct { |
@@ -1220,7 +1203,7 @@ typedef struct { | |||
1220 | #define NETXEN_IS_MSI_FAMILY(adapter) \ | 1203 | #define NETXEN_IS_MSI_FAMILY(adapter) \ |
1221 | ((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED)) | 1204 | ((adapter)->flags & (NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED)) |
1222 | 1205 | ||
1223 | #define MSIX_ENTRIES_PER_ADAPTER 8 | 1206 | #define MSIX_ENTRIES_PER_ADAPTER 1 |
1224 | #define NETXEN_MSIX_TBL_SPACE 8192 | 1207 | #define NETXEN_MSIX_TBL_SPACE 8192 |
1225 | #define NETXEN_PCI_REG_MSIX_TBL 0x44 | 1208 | #define NETXEN_PCI_REG_MSIX_TBL 0x44 |
1226 | 1209 | ||
@@ -1486,8 +1469,6 @@ void netxen_release_tx_buffers(struct netxen_adapter *adapter); | |||
1486 | 1469 | ||
1487 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); | 1470 | void netxen_initialize_adapter_ops(struct netxen_adapter *adapter); |
1488 | int netxen_init_firmware(struct netxen_adapter *adapter); | 1471 | int netxen_init_firmware(struct netxen_adapter *adapter); |
1489 | void netxen_tso_check(struct netxen_adapter *adapter, | ||
1490 | struct cmd_desc_type0 *desc, struct sk_buff *skb); | ||
1491 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); | 1472 | void netxen_nic_clear_stats(struct netxen_adapter *adapter); |
1492 | void netxen_watchdog_task(struct work_struct *work); | 1473 | void netxen_watchdog_task(struct work_struct *work); |
1493 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, | 1474 | void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, |
@@ -1496,6 +1477,7 @@ int netxen_process_cmd_ring(struct netxen_adapter *adapter); | |||
1496 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); | 1477 | u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctx, int max); |
1497 | void netxen_p2_nic_set_multi(struct net_device *netdev); | 1478 | void netxen_p2_nic_set_multi(struct net_device *netdev); |
1498 | void netxen_p3_nic_set_multi(struct net_device *netdev); | 1479 | void netxen_p3_nic_set_multi(struct net_device *netdev); |
1480 | void netxen_p3_free_mac_list(struct netxen_adapter *adapter); | ||
1499 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); | 1481 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32); |
1500 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); | 1482 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter); |
1501 | 1483 | ||
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c index 64b51643c626..746bdb470418 100644 --- a/drivers/net/netxen/netxen_nic_ctx.c +++ b/drivers/net/netxen/netxen_nic_ctx.c | |||
@@ -76,7 +76,7 @@ netxen_api_unlock(struct netxen_adapter *adapter) | |||
76 | static u32 | 76 | static u32 |
77 | netxen_poll_rsp(struct netxen_adapter *adapter) | 77 | netxen_poll_rsp(struct netxen_adapter *adapter) |
78 | { | 78 | { |
79 | u32 raw_rsp, rsp = NX_CDRP_RSP_OK; | 79 | u32 rsp = NX_CDRP_RSP_OK; |
80 | int timeout = 0; | 80 | int timeout = 0; |
81 | 81 | ||
82 | do { | 82 | do { |
@@ -86,10 +86,7 @@ netxen_poll_rsp(struct netxen_adapter *adapter) | |||
86 | if (++timeout > NX_OS_CRB_RETRY_COUNT) | 86 | if (++timeout > NX_OS_CRB_RETRY_COUNT) |
87 | return NX_CDRP_RSP_TIMEOUT; | 87 | return NX_CDRP_RSP_TIMEOUT; |
88 | 88 | ||
89 | netxen_nic_read_w1(adapter, NX_CDRP_CRB_OFFSET, | 89 | netxen_nic_read_w1(adapter, NX_CDRP_CRB_OFFSET, &rsp); |
90 | &raw_rsp); | ||
91 | |||
92 | rsp = le32_to_cpu(raw_rsp); | ||
93 | } while (!NX_CDRP_IS_RSP(rsp)); | 90 | } while (!NX_CDRP_IS_RSP(rsp)); |
94 | 91 | ||
95 | return rsp; | 92 | return rsp; |
@@ -109,20 +106,16 @@ netxen_issue_cmd(struct netxen_adapter *adapter, | |||
109 | if (netxen_api_lock(adapter)) | 106 | if (netxen_api_lock(adapter)) |
110 | return NX_RCODE_TIMEOUT; | 107 | return NX_RCODE_TIMEOUT; |
111 | 108 | ||
112 | netxen_nic_write_w1(adapter, NX_SIGN_CRB_OFFSET, | 109 | netxen_nic_write_w1(adapter, NX_SIGN_CRB_OFFSET, signature); |
113 | cpu_to_le32(signature)); | ||
114 | 110 | ||
115 | netxen_nic_write_w1(adapter, NX_ARG1_CRB_OFFSET, | 111 | netxen_nic_write_w1(adapter, NX_ARG1_CRB_OFFSET, arg1); |
116 | cpu_to_le32(arg1)); | ||
117 | 112 | ||
118 | netxen_nic_write_w1(adapter, NX_ARG2_CRB_OFFSET, | 113 | netxen_nic_write_w1(adapter, NX_ARG2_CRB_OFFSET, arg2); |
119 | cpu_to_le32(arg2)); | ||
120 | 114 | ||
121 | netxen_nic_write_w1(adapter, NX_ARG3_CRB_OFFSET, | 115 | netxen_nic_write_w1(adapter, NX_ARG3_CRB_OFFSET, arg3); |
122 | cpu_to_le32(arg3)); | ||
123 | 116 | ||
124 | netxen_nic_write_w1(adapter, NX_CDRP_CRB_OFFSET, | 117 | netxen_nic_write_w1(adapter, NX_CDRP_CRB_OFFSET, |
125 | cpu_to_le32(NX_CDRP_FORM_CMD(cmd))); | 118 | NX_CDRP_FORM_CMD(cmd)); |
126 | 119 | ||
127 | rsp = netxen_poll_rsp(adapter); | 120 | rsp = netxen_poll_rsp(adapter); |
128 | 121 | ||
@@ -133,7 +126,6 @@ netxen_issue_cmd(struct netxen_adapter *adapter, | |||
133 | rcode = NX_RCODE_TIMEOUT; | 126 | rcode = NX_RCODE_TIMEOUT; |
134 | } else if (rsp == NX_CDRP_RSP_FAIL) { | 127 | } else if (rsp == NX_CDRP_RSP_FAIL) { |
135 | netxen_nic_read_w1(adapter, NX_ARG1_CRB_OFFSET, &rcode); | 128 | netxen_nic_read_w1(adapter, NX_ARG1_CRB_OFFSET, &rcode); |
136 | rcode = le32_to_cpu(rcode); | ||
137 | 129 | ||
138 | printk(KERN_ERR "%s: failed card response code:0x%x\n", | 130 | printk(KERN_ERR "%s: failed card response code:0x%x\n", |
139 | netxen_nic_driver_name, rcode); | 131 | netxen_nic_driver_name, rcode); |
@@ -183,7 +175,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
183 | 175 | ||
184 | int i, nrds_rings, nsds_rings; | 176 | int i, nrds_rings, nsds_rings; |
185 | size_t rq_size, rsp_size; | 177 | size_t rq_size, rsp_size; |
186 | u32 cap, reg; | 178 | u32 cap, reg, val; |
187 | 179 | ||
188 | int err; | 180 | int err; |
189 | 181 | ||
@@ -225,11 +217,14 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
225 | 217 | ||
226 | prq->num_rds_rings = cpu_to_le16(nrds_rings); | 218 | prq->num_rds_rings = cpu_to_le16(nrds_rings); |
227 | prq->num_sds_rings = cpu_to_le16(nsds_rings); | 219 | prq->num_sds_rings = cpu_to_le16(nsds_rings); |
228 | prq->rds_ring_offset = 0; | 220 | prq->rds_ring_offset = cpu_to_le32(0); |
229 | prq->sds_ring_offset = prq->rds_ring_offset + | 221 | |
222 | val = le32_to_cpu(prq->rds_ring_offset) + | ||
230 | (sizeof(nx_hostrq_rds_ring_t) * nrds_rings); | 223 | (sizeof(nx_hostrq_rds_ring_t) * nrds_rings); |
224 | prq->sds_ring_offset = cpu_to_le32(val); | ||
231 | 225 | ||
232 | prq_rds = (nx_hostrq_rds_ring_t *)(prq->data + prq->rds_ring_offset); | 226 | prq_rds = (nx_hostrq_rds_ring_t *)(prq->data + |
227 | le32_to_cpu(prq->rds_ring_offset)); | ||
233 | 228 | ||
234 | for (i = 0; i < nrds_rings; i++) { | 229 | for (i = 0; i < nrds_rings; i++) { |
235 | 230 | ||
@@ -241,17 +236,14 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
241 | prq_rds[i].buff_size = cpu_to_le64(rds_ring->dma_size); | 236 | prq_rds[i].buff_size = cpu_to_le64(rds_ring->dma_size); |
242 | } | 237 | } |
243 | 238 | ||
244 | prq_sds = (nx_hostrq_sds_ring_t *)(prq->data + prq->sds_ring_offset); | 239 | prq_sds = (nx_hostrq_sds_ring_t *)(prq->data + |
240 | le32_to_cpu(prq->sds_ring_offset)); | ||
245 | 241 | ||
246 | prq_sds[0].host_phys_addr = | 242 | prq_sds[0].host_phys_addr = |
247 | cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr); | 243 | cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr); |
248 | prq_sds[0].ring_size = cpu_to_le32(adapter->max_rx_desc_count); | 244 | prq_sds[0].ring_size = cpu_to_le32(adapter->max_rx_desc_count); |
249 | /* only one msix vector for now */ | 245 | /* only one msix vector for now */ |
250 | prq_sds[0].msi_index = cpu_to_le32(0); | 246 | prq_sds[0].msi_index = cpu_to_le16(0); |
251 | |||
252 | /* now byteswap offsets */ | ||
253 | prq->rds_ring_offset = cpu_to_le32(prq->rds_ring_offset); | ||
254 | prq->sds_ring_offset = cpu_to_le32(prq->sds_ring_offset); | ||
255 | 247 | ||
256 | phys_addr = hostrq_phys_addr; | 248 | phys_addr = hostrq_phys_addr; |
257 | err = netxen_issue_cmd(adapter, | 249 | err = netxen_issue_cmd(adapter, |
@@ -269,9 +261,9 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
269 | 261 | ||
270 | 262 | ||
271 | prsp_rds = ((nx_cardrsp_rds_ring_t *) | 263 | prsp_rds = ((nx_cardrsp_rds_ring_t *) |
272 | &prsp->data[prsp->rds_ring_offset]); | 264 | &prsp->data[le32_to_cpu(prsp->rds_ring_offset)]); |
273 | 265 | ||
274 | for (i = 0; i < le32_to_cpu(prsp->num_rds_rings); i++) { | 266 | for (i = 0; i < le16_to_cpu(prsp->num_rds_rings); i++) { |
275 | rds_ring = &recv_ctx->rds_rings[i]; | 267 | rds_ring = &recv_ctx->rds_rings[i]; |
276 | 268 | ||
277 | reg = le32_to_cpu(prsp_rds[i].host_producer_crb); | 269 | reg = le32_to_cpu(prsp_rds[i].host_producer_crb); |
@@ -279,7 +271,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
279 | } | 271 | } |
280 | 272 | ||
281 | prsp_sds = ((nx_cardrsp_sds_ring_t *) | 273 | prsp_sds = ((nx_cardrsp_sds_ring_t *) |
282 | &prsp->data[prsp->sds_ring_offset]); | 274 | &prsp->data[le32_to_cpu(prsp->sds_ring_offset)]); |
283 | reg = le32_to_cpu(prsp_sds[0].host_consumer_crb); | 275 | reg = le32_to_cpu(prsp_sds[0].host_consumer_crb); |
284 | recv_ctx->crb_sts_consumer = NETXEN_NIC_REG(reg - 0x200); | 276 | recv_ctx->crb_sts_consumer = NETXEN_NIC_REG(reg - 0x200); |
285 | 277 | ||
@@ -288,7 +280,7 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter) | |||
288 | 280 | ||
289 | recv_ctx->state = le32_to_cpu(prsp->host_ctx_state); | 281 | recv_ctx->state = le32_to_cpu(prsp->host_ctx_state); |
290 | recv_ctx->context_id = le16_to_cpu(prsp->context_id); | 282 | recv_ctx->context_id = le16_to_cpu(prsp->context_id); |
291 | recv_ctx->virt_port = le16_to_cpu(prsp->virt_port); | 283 | recv_ctx->virt_port = prsp->virt_port; |
292 | 284 | ||
293 | out_free_rsp: | 285 | out_free_rsp: |
294 | pci_free_consistent(adapter->pdev, rsp_size, prsp, cardrsp_phys_addr); | 286 | pci_free_consistent(adapter->pdev, rsp_size, prsp, cardrsp_phys_addr); |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index e45ce2951729..0894a7be0225 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -136,11 +136,9 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
136 | 136 | ||
137 | ecmd->port = PORT_TP; | 137 | ecmd->port = PORT_TP; |
138 | 138 | ||
139 | if (netif_running(dev)) { | 139 | ecmd->speed = adapter->link_speed; |
140 | ecmd->speed = adapter->link_speed; | 140 | ecmd->duplex = adapter->link_duplex; |
141 | ecmd->duplex = adapter->link_duplex; | 141 | ecmd->autoneg = adapter->link_autoneg; |
142 | ecmd->autoneg = adapter->link_autoneg; | ||
143 | } | ||
144 | 142 | ||
145 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | 143 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { |
146 | u32 val; | 144 | u32 val; |
@@ -171,7 +169,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
171 | } else | 169 | } else |
172 | return -EIO; | 170 | return -EIO; |
173 | 171 | ||
174 | ecmd->phy_address = adapter->portnum; | 172 | ecmd->phy_address = adapter->physical_port; |
175 | ecmd->transceiver = XCVR_EXTERNAL; | 173 | ecmd->transceiver = XCVR_EXTERNAL; |
176 | 174 | ||
177 | switch ((netxen_brdtype_t) boardinfo->board_type) { | 175 | switch ((netxen_brdtype_t) boardinfo->board_type) { |
@@ -180,13 +178,13 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
180 | case NETXEN_BRDTYPE_P3_REF_QG: | 178 | case NETXEN_BRDTYPE_P3_REF_QG: |
181 | case NETXEN_BRDTYPE_P3_4_GB: | 179 | case NETXEN_BRDTYPE_P3_4_GB: |
182 | case NETXEN_BRDTYPE_P3_4_GB_MM: | 180 | case NETXEN_BRDTYPE_P3_4_GB_MM: |
183 | case NETXEN_BRDTYPE_P3_10000_BASE_T: | ||
184 | 181 | ||
185 | ecmd->supported |= SUPPORTED_Autoneg; | 182 | ecmd->supported |= SUPPORTED_Autoneg; |
186 | ecmd->advertising |= ADVERTISED_Autoneg; | 183 | ecmd->advertising |= ADVERTISED_Autoneg; |
187 | case NETXEN_BRDTYPE_P2_SB31_10G_CX4: | 184 | case NETXEN_BRDTYPE_P2_SB31_10G_CX4: |
188 | case NETXEN_BRDTYPE_P3_10G_CX4: | 185 | case NETXEN_BRDTYPE_P3_10G_CX4: |
189 | case NETXEN_BRDTYPE_P3_10G_CX4_LP: | 186 | case NETXEN_BRDTYPE_P3_10G_CX4_LP: |
187 | case NETXEN_BRDTYPE_P3_10000_BASE_T: | ||
190 | ecmd->supported |= SUPPORTED_TP; | 188 | ecmd->supported |= SUPPORTED_TP; |
191 | ecmd->advertising |= ADVERTISED_TP; | 189 | ecmd->advertising |= ADVERTISED_TP; |
192 | ecmd->port = PORT_TP; | 190 | ecmd->port = PORT_TP; |
@@ -204,16 +202,33 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
204 | ecmd->port = PORT_FIBRE; | 202 | ecmd->port = PORT_FIBRE; |
205 | ecmd->autoneg = AUTONEG_DISABLE; | 203 | ecmd->autoneg = AUTONEG_DISABLE; |
206 | break; | 204 | break; |
207 | case NETXEN_BRDTYPE_P2_SB31_10G: | ||
208 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: | 205 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: |
209 | case NETXEN_BRDTYPE_P3_10G_SFP_CT: | 206 | case NETXEN_BRDTYPE_P3_10G_SFP_CT: |
210 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: | 207 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: |
208 | ecmd->advertising |= ADVERTISED_TP; | ||
209 | ecmd->supported |= SUPPORTED_TP; | ||
210 | case NETXEN_BRDTYPE_P2_SB31_10G: | ||
211 | case NETXEN_BRDTYPE_P3_10G_XFP: | 211 | case NETXEN_BRDTYPE_P3_10G_XFP: |
212 | ecmd->supported |= SUPPORTED_FIBRE; | 212 | ecmd->supported |= SUPPORTED_FIBRE; |
213 | ecmd->advertising |= ADVERTISED_FIBRE; | 213 | ecmd->advertising |= ADVERTISED_FIBRE; |
214 | ecmd->port = PORT_FIBRE; | 214 | ecmd->port = PORT_FIBRE; |
215 | ecmd->autoneg = AUTONEG_DISABLE; | 215 | ecmd->autoneg = AUTONEG_DISABLE; |
216 | break; | 216 | break; |
217 | case NETXEN_BRDTYPE_P3_10G_TP: | ||
218 | if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { | ||
219 | ecmd->autoneg = AUTONEG_DISABLE; | ||
220 | ecmd->supported |= (SUPPORTED_FIBRE | SUPPORTED_TP); | ||
221 | ecmd->advertising |= | ||
222 | (ADVERTISED_FIBRE | ADVERTISED_TP); | ||
223 | ecmd->port = PORT_FIBRE; | ||
224 | } else { | ||
225 | ecmd->autoneg = AUTONEG_ENABLE; | ||
226 | ecmd->supported |= (SUPPORTED_TP |SUPPORTED_Autoneg); | ||
227 | ecmd->advertising |= | ||
228 | (ADVERTISED_TP | ADVERTISED_Autoneg); | ||
229 | ecmd->port = PORT_TP; | ||
230 | } | ||
231 | break; | ||
217 | default: | 232 | default: |
218 | printk(KERN_ERR "netxen-nic: Unsupported board model %d\n", | 233 | printk(KERN_ERR "netxen-nic: Unsupported board model %d\n", |
219 | (netxen_brdtype_t) boardinfo->board_type); | 234 | (netxen_brdtype_t) boardinfo->board_type); |
@@ -546,7 +561,10 @@ netxen_nic_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) | |||
546 | } | 561 | } |
547 | ring->tx_pending = adapter->max_tx_desc_count; | 562 | ring->tx_pending = adapter->max_tx_desc_count; |
548 | 563 | ||
549 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS; | 564 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) |
565 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_1G; | ||
566 | else | ||
567 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_10G; | ||
550 | ring->tx_max_pending = MAX_CMD_DESCRIPTORS_HOST; | 568 | ring->tx_max_pending = MAX_CMD_DESCRIPTORS_HOST; |
551 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS; | 569 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS; |
552 | ring->rx_mini_max_pending = 0; | 570 | ring->rx_mini_max_pending = 0; |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index aa6e603bfcbf..821cff68b3f3 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -503,17 +503,15 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter, | |||
503 | 503 | ||
504 | i = 0; | 504 | i = 0; |
505 | 505 | ||
506 | netif_tx_lock_bh(adapter->netdev); | ||
507 | |||
506 | producer = adapter->cmd_producer; | 508 | producer = adapter->cmd_producer; |
507 | do { | 509 | do { |
508 | cmd_desc = &cmd_desc_arr[i]; | 510 | cmd_desc = &cmd_desc_arr[i]; |
509 | 511 | ||
510 | pbuf = &adapter->cmd_buf_arr[producer]; | 512 | pbuf = &adapter->cmd_buf_arr[producer]; |
511 | pbuf->mss = 0; | ||
512 | pbuf->total_length = 0; | ||
513 | pbuf->skb = NULL; | 513 | pbuf->skb = NULL; |
514 | pbuf->cmd = 0; | ||
515 | pbuf->frag_count = 0; | 514 | pbuf->frag_count = 0; |
516 | pbuf->port = 0; | ||
517 | 515 | ||
518 | /* adapter->ahw.cmd_desc_head[producer] = *cmd_desc; */ | 516 | /* adapter->ahw.cmd_desc_head[producer] = *cmd_desc; */ |
519 | memcpy(&adapter->ahw.cmd_desc_head[producer], | 517 | memcpy(&adapter->ahw.cmd_desc_head[producer], |
@@ -531,6 +529,8 @@ netxen_send_cmd_descs(struct netxen_adapter *adapter, | |||
531 | 529 | ||
532 | netxen_nic_update_cmd_producer(adapter, adapter->cmd_producer); | 530 | netxen_nic_update_cmd_producer(adapter, adapter->cmd_producer); |
533 | 531 | ||
532 | netif_tx_unlock_bh(adapter->netdev); | ||
533 | |||
534 | return 0; | 534 | return 0; |
535 | } | 535 | } |
536 | 536 | ||
@@ -539,16 +539,19 @@ static int nx_p3_sre_macaddr_change(struct net_device *dev, | |||
539 | { | 539 | { |
540 | struct netxen_adapter *adapter = netdev_priv(dev); | 540 | struct netxen_adapter *adapter = netdev_priv(dev); |
541 | nx_nic_req_t req; | 541 | nx_nic_req_t req; |
542 | nx_mac_req_t mac_req; | 542 | nx_mac_req_t *mac_req; |
543 | u64 word; | ||
543 | int rv; | 544 | int rv; |
544 | 545 | ||
545 | memset(&req, 0, sizeof(nx_nic_req_t)); | 546 | memset(&req, 0, sizeof(nx_nic_req_t)); |
546 | req.qhdr |= (NX_NIC_REQUEST << 23); | 547 | req.qhdr = cpu_to_le64(NX_NIC_REQUEST << 23); |
547 | req.req_hdr |= NX_MAC_EVENT; | 548 | |
548 | req.req_hdr |= ((u64)adapter->portnum << 16); | 549 | word = NX_MAC_EVENT | ((u64)adapter->portnum << 16); |
549 | mac_req.op = op; | 550 | req.req_hdr = cpu_to_le64(word); |
550 | memcpy(&mac_req.mac_addr, addr, 6); | 551 | |
551 | req.words[0] = cpu_to_le64(*(u64 *)&mac_req); | 552 | mac_req = (nx_mac_req_t *)&req.words[0]; |
553 | mac_req->op = op; | ||
554 | memcpy(mac_req->mac_addr, addr, 6); | ||
552 | 555 | ||
553 | rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); | 556 | rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); |
554 | if (rv != 0) { | 557 | if (rv != 0) { |
@@ -612,18 +615,35 @@ send_fw_cmd: | |||
612 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) | 615 | int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) |
613 | { | 616 | { |
614 | nx_nic_req_t req; | 617 | nx_nic_req_t req; |
618 | u64 word; | ||
615 | 619 | ||
616 | memset(&req, 0, sizeof(nx_nic_req_t)); | 620 | memset(&req, 0, sizeof(nx_nic_req_t)); |
617 | 621 | ||
618 | req.qhdr |= (NX_HOST_REQUEST << 23); | 622 | req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23); |
619 | req.req_hdr |= NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE; | 623 | |
620 | req.req_hdr |= ((u64)adapter->portnum << 16); | 624 | word = NX_NIC_H2C_OPCODE_PROXY_SET_VPORT_MISS_MODE | |
625 | ((u64)adapter->portnum << 16); | ||
626 | req.req_hdr = cpu_to_le64(word); | ||
627 | |||
621 | req.words[0] = cpu_to_le64(mode); | 628 | req.words[0] = cpu_to_le64(mode); |
622 | 629 | ||
623 | return netxen_send_cmd_descs(adapter, | 630 | return netxen_send_cmd_descs(adapter, |
624 | (struct cmd_desc_type0 *)&req, 1); | 631 | (struct cmd_desc_type0 *)&req, 1); |
625 | } | 632 | } |
626 | 633 | ||
634 | void netxen_p3_free_mac_list(struct netxen_adapter *adapter) | ||
635 | { | ||
636 | nx_mac_list_t *cur, *next; | ||
637 | |||
638 | cur = adapter->mac_list; | ||
639 | |||
640 | while (cur) { | ||
641 | next = cur->next; | ||
642 | kfree(cur); | ||
643 | cur = next; | ||
644 | } | ||
645 | } | ||
646 | |||
627 | #define NETXEN_CONFIG_INTR_COALESCE 3 | 647 | #define NETXEN_CONFIG_INTR_COALESCE 3 |
628 | 648 | ||
629 | /* | 649 | /* |
@@ -632,13 +652,15 @@ int netxen_p3_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) | |||
632 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter) | 652 | int netxen_config_intr_coalesce(struct netxen_adapter *adapter) |
633 | { | 653 | { |
634 | nx_nic_req_t req; | 654 | nx_nic_req_t req; |
655 | u64 word; | ||
635 | int rv; | 656 | int rv; |
636 | 657 | ||
637 | memset(&req, 0, sizeof(nx_nic_req_t)); | 658 | memset(&req, 0, sizeof(nx_nic_req_t)); |
638 | 659 | ||
639 | req.qhdr |= (NX_NIC_REQUEST << 23); | 660 | req.qhdr = cpu_to_le64(NX_NIC_REQUEST << 23); |
640 | req.req_hdr |= NETXEN_CONFIG_INTR_COALESCE; | 661 | |
641 | req.req_hdr |= ((u64)adapter->portnum << 16); | 662 | word = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16); |
663 | req.req_hdr = cpu_to_le64(word); | ||
642 | 664 | ||
643 | memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal)); | 665 | memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal)); |
644 | 666 | ||
@@ -772,13 +794,10 @@ int netxen_p3_get_mac_addr(struct netxen_adapter *adapter, __le64 *mac) | |||
772 | adapter->hw_read_wx(adapter, crbaddr, &mac_lo, 4); | 794 | adapter->hw_read_wx(adapter, crbaddr, &mac_lo, 4); |
773 | adapter->hw_read_wx(adapter, crbaddr+4, &mac_hi, 4); | 795 | adapter->hw_read_wx(adapter, crbaddr+4, &mac_hi, 4); |
774 | 796 | ||
775 | mac_hi = cpu_to_le32(mac_hi); | ||
776 | mac_lo = cpu_to_le32(mac_lo); | ||
777 | |||
778 | if (pci_func & 1) | 797 | if (pci_func & 1) |
779 | *mac = ((mac_lo >> 16) | ((u64)mac_hi << 16)); | 798 | *mac = le64_to_cpu((mac_lo >> 16) | ((u64)mac_hi << 16)); |
780 | else | 799 | else |
781 | *mac = ((mac_lo) | ((u64)mac_hi << 32)); | 800 | *mac = le64_to_cpu((u64)mac_lo | ((u64)mac_hi << 32)); |
782 | 801 | ||
783 | return 0; | 802 | return 0; |
784 | } | 803 | } |
@@ -937,7 +956,7 @@ int netxen_load_firmware(struct netxen_adapter *adapter) | |||
937 | { | 956 | { |
938 | int i; | 957 | int i; |
939 | u32 data, size = 0; | 958 | u32 data, size = 0; |
940 | u32 flashaddr = NETXEN_BOOTLD_START, memaddr = NETXEN_BOOTLD_START; | 959 | u32 flashaddr = NETXEN_BOOTLD_START; |
941 | 960 | ||
942 | size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START)/4; | 961 | size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START)/4; |
943 | 962 | ||
@@ -949,10 +968,8 @@ int netxen_load_firmware(struct netxen_adapter *adapter) | |||
949 | if (netxen_rom_fast_read(adapter, flashaddr, (int *)&data) != 0) | 968 | if (netxen_rom_fast_read(adapter, flashaddr, (int *)&data) != 0) |
950 | return -EIO; | 969 | return -EIO; |
951 | 970 | ||
952 | adapter->pci_mem_write(adapter, memaddr, &data, 4); | 971 | adapter->pci_mem_write(adapter, flashaddr, &data, 4); |
953 | flashaddr += 4; | 972 | flashaddr += 4; |
954 | memaddr += 4; | ||
955 | cond_resched(); | ||
956 | } | 973 | } |
957 | msleep(1); | 974 | msleep(1); |
958 | 975 | ||
@@ -2034,7 +2051,13 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
2034 | rv = -1; | 2051 | rv = -1; |
2035 | } | 2052 | } |
2036 | 2053 | ||
2037 | DPRINTK(INFO, "Discovered board type:0x%x ", boardinfo->board_type); | 2054 | if (boardinfo->board_type == NETXEN_BRDTYPE_P3_4_GB_MM) { |
2055 | u32 gpio = netxen_nic_reg_read(adapter, | ||
2056 | NETXEN_ROMUSB_GLB_PAD_GPIO_I); | ||
2057 | if ((gpio & 0x8000) == 0) | ||
2058 | boardinfo->board_type = NETXEN_BRDTYPE_P3_10G_TP; | ||
2059 | } | ||
2060 | |||
2038 | switch ((netxen_brdtype_t) boardinfo->board_type) { | 2061 | switch ((netxen_brdtype_t) boardinfo->board_type) { |
2039 | case NETXEN_BRDTYPE_P2_SB35_4G: | 2062 | case NETXEN_BRDTYPE_P2_SB35_4G: |
2040 | adapter->ahw.board_type = NETXEN_NIC_GBE; | 2063 | adapter->ahw.board_type = NETXEN_NIC_GBE; |
@@ -2053,7 +2076,6 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
2053 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: | 2076 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: |
2054 | case NETXEN_BRDTYPE_P3_10G_XFP: | 2077 | case NETXEN_BRDTYPE_P3_10G_XFP: |
2055 | case NETXEN_BRDTYPE_P3_10000_BASE_T: | 2078 | case NETXEN_BRDTYPE_P3_10000_BASE_T: |
2056 | |||
2057 | adapter->ahw.board_type = NETXEN_NIC_XGBE; | 2079 | adapter->ahw.board_type = NETXEN_NIC_XGBE; |
2058 | break; | 2080 | break; |
2059 | case NETXEN_BRDTYPE_P1_BD: | 2081 | case NETXEN_BRDTYPE_P1_BD: |
@@ -2063,9 +2085,12 @@ int netxen_nic_get_board_info(struct netxen_adapter *adapter) | |||
2063 | case NETXEN_BRDTYPE_P3_REF_QG: | 2085 | case NETXEN_BRDTYPE_P3_REF_QG: |
2064 | case NETXEN_BRDTYPE_P3_4_GB: | 2086 | case NETXEN_BRDTYPE_P3_4_GB: |
2065 | case NETXEN_BRDTYPE_P3_4_GB_MM: | 2087 | case NETXEN_BRDTYPE_P3_4_GB_MM: |
2066 | |||
2067 | adapter->ahw.board_type = NETXEN_NIC_GBE; | 2088 | adapter->ahw.board_type = NETXEN_NIC_GBE; |
2068 | break; | 2089 | break; |
2090 | case NETXEN_BRDTYPE_P3_10G_TP: | ||
2091 | adapter->ahw.board_type = (adapter->portnum < 2) ? | ||
2092 | NETXEN_NIC_XGBE : NETXEN_NIC_GBE; | ||
2093 | break; | ||
2069 | default: | 2094 | default: |
2070 | printk("%s: Unknown(%x)\n", netxen_nic_driver_name, | 2095 | printk("%s: Unknown(%x)\n", netxen_nic_driver_name, |
2071 | boardinfo->board_type); | 2096 | boardinfo->board_type); |
@@ -2110,12 +2135,16 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
2110 | { | 2135 | { |
2111 | __u32 status; | 2136 | __u32 status; |
2112 | __u32 autoneg; | 2137 | __u32 autoneg; |
2113 | __u32 mode; | ||
2114 | __u32 port_mode; | 2138 | __u32 port_mode; |
2115 | 2139 | ||
2116 | netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); | 2140 | if (!netif_carrier_ok(adapter->netdev)) { |
2117 | if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ | 2141 | adapter->link_speed = 0; |
2142 | adapter->link_duplex = -1; | ||
2143 | adapter->link_autoneg = AUTONEG_ENABLE; | ||
2144 | return; | ||
2145 | } | ||
2118 | 2146 | ||
2147 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | ||
2119 | adapter->hw_read_wx(adapter, | 2148 | adapter->hw_read_wx(adapter, |
2120 | NETXEN_PORT_MODE_ADDR, &port_mode, 4); | 2149 | NETXEN_PORT_MODE_ADDR, &port_mode, 4); |
2121 | if (port_mode == NETXEN_PORT_MODE_802_3_AP) { | 2150 | if (port_mode == NETXEN_PORT_MODE_802_3_AP) { |
@@ -2141,7 +2170,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
2141 | adapter->link_speed = SPEED_1000; | 2170 | adapter->link_speed = SPEED_1000; |
2142 | break; | 2171 | break; |
2143 | default: | 2172 | default: |
2144 | adapter->link_speed = -1; | 2173 | adapter->link_speed = 0; |
2145 | break; | 2174 | break; |
2146 | } | 2175 | } |
2147 | switch (netxen_get_phy_duplex(status)) { | 2176 | switch (netxen_get_phy_duplex(status)) { |
@@ -2164,7 +2193,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter) | |||
2164 | goto link_down; | 2193 | goto link_down; |
2165 | } else { | 2194 | } else { |
2166 | link_down: | 2195 | link_down: |
2167 | adapter->link_speed = -1; | 2196 | adapter->link_speed = 0; |
2168 | adapter->link_duplex = -1; | 2197 | adapter->link_duplex = -1; |
2169 | } | 2198 | } |
2170 | } | 2199 | } |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index d924468e506e..ffd37bea1628 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -308,7 +308,6 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) | |||
308 | } | 308 | } |
309 | memset(rds_ring->rx_buf_arr, 0, RCV_BUFFSIZE); | 309 | memset(rds_ring->rx_buf_arr, 0, RCV_BUFFSIZE); |
310 | INIT_LIST_HEAD(&rds_ring->free_list); | 310 | INIT_LIST_HEAD(&rds_ring->free_list); |
311 | rds_ring->begin_alloc = 0; | ||
312 | /* | 311 | /* |
313 | * Now go through all of them, set reference handles | 312 | * Now go through all of them, set reference handles |
314 | * and put them in the queues. | 313 | * and put them in the queues. |
@@ -439,6 +438,8 @@ static int netxen_wait_rom_done(struct netxen_adapter *adapter) | |||
439 | long timeout = 0; | 438 | long timeout = 0; |
440 | long done = 0; | 439 | long done = 0; |
441 | 440 | ||
441 | cond_resched(); | ||
442 | |||
442 | while (done == 0) { | 443 | while (done == 0) { |
443 | done = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_GLB_STATUS); | 444 | done = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_GLB_STATUS); |
444 | done &= 2; | 445 | done &= 2; |
@@ -533,12 +534,9 @@ static int do_rom_fast_write(struct netxen_adapter *adapter, int addr, | |||
533 | static int do_rom_fast_read(struct netxen_adapter *adapter, | 534 | static int do_rom_fast_read(struct netxen_adapter *adapter, |
534 | int addr, int *valp) | 535 | int addr, int *valp) |
535 | { | 536 | { |
536 | cond_resched(); | ||
537 | |||
538 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); | 537 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); |
539 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); | ||
540 | udelay(100); /* prevent bursting on CRB */ | ||
541 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 538 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
539 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); | ||
542 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); | 540 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); |
543 | if (netxen_wait_rom_done(adapter)) { | 541 | if (netxen_wait_rom_done(adapter)) { |
544 | printk("Error waiting for rom done\n"); | 542 | printk("Error waiting for rom done\n"); |
@@ -546,7 +544,7 @@ static int do_rom_fast_read(struct netxen_adapter *adapter, | |||
546 | } | 544 | } |
547 | /* reset abyte_cnt and dummy_byte_cnt */ | 545 | /* reset abyte_cnt and dummy_byte_cnt */ |
548 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); | 546 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); |
549 | udelay(100); /* prevent bursting on CRB */ | 547 | udelay(10); |
550 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 548 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
551 | 549 | ||
552 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); | 550 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); |
@@ -884,14 +882,16 @@ int netxen_flash_unlock(struct netxen_adapter *adapter) | |||
884 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | 882 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) |
885 | { | 883 | { |
886 | int addr, val; | 884 | int addr, val; |
887 | int i, init_delay = 0; | 885 | int i, n, init_delay = 0; |
888 | struct crb_addr_pair *buf; | 886 | struct crb_addr_pair *buf; |
889 | unsigned offset, n; | 887 | unsigned offset; |
890 | u32 off; | 888 | u32 off; |
891 | 889 | ||
892 | /* resetall */ | 890 | /* resetall */ |
891 | rom_lock(adapter); | ||
893 | netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET, | 892 | netxen_crb_writelit_adapter(adapter, NETXEN_ROMUSB_GLB_SW_RESET, |
894 | 0xffffffff); | 893 | 0xffffffff); |
894 | netxen_rom_unlock(adapter); | ||
895 | 895 | ||
896 | if (verbose) { | 896 | if (verbose) { |
897 | if (netxen_rom_fast_read(adapter, NETXEN_BOARDTYPE, &val) == 0) | 897 | if (netxen_rom_fast_read(adapter, NETXEN_BOARDTYPE, &val) == 0) |
@@ -910,7 +910,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
910 | 910 | ||
911 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { | 911 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { |
912 | if (netxen_rom_fast_read(adapter, 0, &n) != 0 || | 912 | if (netxen_rom_fast_read(adapter, 0, &n) != 0 || |
913 | (n != 0xcafecafeUL) || | 913 | (n != 0xcafecafe) || |
914 | netxen_rom_fast_read(adapter, 4, &n) != 0) { | 914 | netxen_rom_fast_read(adapter, 4, &n) != 0) { |
915 | printk(KERN_ERR "%s: ERROR Reading crb_init area: " | 915 | printk(KERN_ERR "%s: ERROR Reading crb_init area: " |
916 | "n: %08x\n", netxen_nic_driver_name, n); | 916 | "n: %08x\n", netxen_nic_driver_name, n); |
@@ -947,8 +947,10 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
947 | } | 947 | } |
948 | for (i = 0; i < n; i++) { | 948 | for (i = 0; i < n; i++) { |
949 | if (netxen_rom_fast_read(adapter, 8*i + 4*offset, &val) != 0 || | 949 | if (netxen_rom_fast_read(adapter, 8*i + 4*offset, &val) != 0 || |
950 | netxen_rom_fast_read(adapter, 8*i + 4*offset + 4, &addr) != 0) | 950 | netxen_rom_fast_read(adapter, 8*i + 4*offset + 4, &addr) != 0) { |
951 | kfree(buf); | ||
951 | return -EIO; | 952 | return -EIO; |
953 | } | ||
952 | 954 | ||
953 | buf[i].addr = addr; | 955 | buf[i].addr = addr; |
954 | buf[i].data = val; | 956 | buf[i].data = val; |
@@ -975,6 +977,14 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
975 | /* do not reset PCI */ | 977 | /* do not reset PCI */ |
976 | if (off == (ROMUSB_GLB + 0xbc)) | 978 | if (off == (ROMUSB_GLB + 0xbc)) |
977 | continue; | 979 | continue; |
980 | if (off == (ROMUSB_GLB + 0xa8)) | ||
981 | continue; | ||
982 | if (off == (ROMUSB_GLB + 0xc8)) /* core clock */ | ||
983 | continue; | ||
984 | if (off == (ROMUSB_GLB + 0x24)) /* MN clock */ | ||
985 | continue; | ||
986 | if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */ | ||
987 | continue; | ||
978 | if (off == (NETXEN_CRB_PEG_NET_1 + 0x18)) | 988 | if (off == (NETXEN_CRB_PEG_NET_1 + 0x18)) |
979 | buf[i].data = 0x1020; | 989 | buf[i].data = 0x1020; |
980 | /* skip the function enable register */ | 990 | /* skip the function enable register */ |
@@ -992,23 +1002,21 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
992 | continue; | 1002 | continue; |
993 | } | 1003 | } |
994 | 1004 | ||
1005 | init_delay = 1; | ||
995 | /* After writing this register, HW needs time for CRB */ | 1006 | /* After writing this register, HW needs time for CRB */ |
996 | /* to quiet down (else crb_window returns 0xffffffff) */ | 1007 | /* to quiet down (else crb_window returns 0xffffffff) */ |
997 | if (off == NETXEN_ROMUSB_GLB_SW_RESET) { | 1008 | if (off == NETXEN_ROMUSB_GLB_SW_RESET) { |
998 | init_delay = 1; | 1009 | init_delay = 1000; |
999 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { | 1010 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
1000 | /* hold xdma in reset also */ | 1011 | /* hold xdma in reset also */ |
1001 | buf[i].data = NETXEN_NIC_XDMA_RESET; | 1012 | buf[i].data = NETXEN_NIC_XDMA_RESET; |
1013 | buf[i].data = 0x8000ff; | ||
1002 | } | 1014 | } |
1003 | } | 1015 | } |
1004 | 1016 | ||
1005 | adapter->hw_write_wx(adapter, off, &buf[i].data, 4); | 1017 | adapter->hw_write_wx(adapter, off, &buf[i].data, 4); |
1006 | 1018 | ||
1007 | if (init_delay == 1) { | 1019 | msleep(init_delay); |
1008 | msleep(1000); | ||
1009 | init_delay = 0; | ||
1010 | } | ||
1011 | msleep(1); | ||
1012 | } | 1020 | } |
1013 | kfree(buf); | 1021 | kfree(buf); |
1014 | 1022 | ||
@@ -1277,7 +1285,7 @@ static void netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
1277 | 1285 | ||
1278 | dev_kfree_skb_any(skb); | 1286 | dev_kfree_skb_any(skb); |
1279 | for (i = 0; i < nr_frags; i++) { | 1287 | for (i = 0; i < nr_frags; i++) { |
1280 | index = frag_desc->frag_handles[i]; | 1288 | index = le16_to_cpu(frag_desc->frag_handles[i]); |
1281 | skb = netxen_process_rxbuf(adapter, | 1289 | skb = netxen_process_rxbuf(adapter, |
1282 | rds_ring, index, cksum); | 1290 | rds_ring, index, cksum); |
1283 | if (skb) | 1291 | if (skb) |
@@ -1428,7 +1436,6 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid) | |||
1428 | struct rcv_desc *pdesc; | 1436 | struct rcv_desc *pdesc; |
1429 | struct netxen_rx_buffer *buffer; | 1437 | struct netxen_rx_buffer *buffer; |
1430 | int count = 0; | 1438 | int count = 0; |
1431 | int index = 0; | ||
1432 | netxen_ctx_msg msg = 0; | 1439 | netxen_ctx_msg msg = 0; |
1433 | dma_addr_t dma; | 1440 | dma_addr_t dma; |
1434 | struct list_head *head; | 1441 | struct list_head *head; |
@@ -1436,7 +1443,6 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid) | |||
1436 | rds_ring = &recv_ctx->rds_rings[ringid]; | 1443 | rds_ring = &recv_ctx->rds_rings[ringid]; |
1437 | 1444 | ||
1438 | producer = rds_ring->producer; | 1445 | producer = rds_ring->producer; |
1439 | index = rds_ring->begin_alloc; | ||
1440 | head = &rds_ring->free_list; | 1446 | head = &rds_ring->free_list; |
1441 | 1447 | ||
1442 | /* We can start writing rx descriptors into the phantom memory. */ | 1448 | /* We can start writing rx descriptors into the phantom memory. */ |
@@ -1444,39 +1450,37 @@ void netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ctx, u32 ringid) | |||
1444 | 1450 | ||
1445 | skb = dev_alloc_skb(rds_ring->skb_size); | 1451 | skb = dev_alloc_skb(rds_ring->skb_size); |
1446 | if (unlikely(!skb)) { | 1452 | if (unlikely(!skb)) { |
1447 | rds_ring->begin_alloc = index; | ||
1448 | break; | 1453 | break; |
1449 | } | 1454 | } |
1450 | 1455 | ||
1456 | if (!adapter->ahw.cut_through) | ||
1457 | skb_reserve(skb, 2); | ||
1458 | |||
1459 | dma = pci_map_single(pdev, skb->data, | ||
1460 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); | ||
1461 | if (pci_dma_mapping_error(pdev, dma)) { | ||
1462 | dev_kfree_skb_any(skb); | ||
1463 | break; | ||
1464 | } | ||
1465 | |||
1466 | count++; | ||
1451 | buffer = list_entry(head->next, struct netxen_rx_buffer, list); | 1467 | buffer = list_entry(head->next, struct netxen_rx_buffer, list); |
1452 | list_del(&buffer->list); | 1468 | list_del(&buffer->list); |
1453 | 1469 | ||
1454 | count++; /* now there should be no failure */ | ||
1455 | pdesc = &rds_ring->desc_head[producer]; | ||
1456 | |||
1457 | if (!adapter->ahw.cut_through) | ||
1458 | skb_reserve(skb, 2); | ||
1459 | /* This will be setup when we receive the | ||
1460 | * buffer after it has been filled FSL TBD TBD | ||
1461 | * skb->dev = netdev; | ||
1462 | */ | ||
1463 | dma = pci_map_single(pdev, skb->data, rds_ring->dma_size, | ||
1464 | PCI_DMA_FROMDEVICE); | ||
1465 | pdesc->addr_buffer = cpu_to_le64(dma); | ||
1466 | buffer->skb = skb; | 1470 | buffer->skb = skb; |
1467 | buffer->state = NETXEN_BUFFER_BUSY; | 1471 | buffer->state = NETXEN_BUFFER_BUSY; |
1468 | buffer->dma = dma; | 1472 | buffer->dma = dma; |
1473 | |||
1469 | /* make a rcv descriptor */ | 1474 | /* make a rcv descriptor */ |
1475 | pdesc = &rds_ring->desc_head[producer]; | ||
1476 | pdesc->addr_buffer = cpu_to_le64(dma); | ||
1470 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); | 1477 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); |
1471 | pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); | 1478 | pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); |
1472 | DPRINTK(INFO, "done writing descripter\n"); | 1479 | |
1473 | producer = | 1480 | producer = get_next_index(producer, rds_ring->max_rx_desc_count); |
1474 | get_next_index(producer, rds_ring->max_rx_desc_count); | ||
1475 | index = get_next_index(index, rds_ring->max_rx_desc_count); | ||
1476 | } | 1481 | } |
1477 | /* if we did allocate buffers, then write the count to Phantom */ | 1482 | /* if we did allocate buffers, then write the count to Phantom */ |
1478 | if (count) { | 1483 | if (count) { |
1479 | rds_ring->begin_alloc = index; | ||
1480 | rds_ring->producer = producer; | 1484 | rds_ring->producer = producer; |
1481 | /* Window = 1 */ | 1485 | /* Window = 1 */ |
1482 | adapter->pci_write_normalize(adapter, | 1486 | adapter->pci_write_normalize(adapter, |
@@ -1515,49 +1519,50 @@ static void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, | |||
1515 | struct rcv_desc *pdesc; | 1519 | struct rcv_desc *pdesc; |
1516 | struct netxen_rx_buffer *buffer; | 1520 | struct netxen_rx_buffer *buffer; |
1517 | int count = 0; | 1521 | int count = 0; |
1518 | int index = 0; | ||
1519 | struct list_head *head; | 1522 | struct list_head *head; |
1523 | dma_addr_t dma; | ||
1520 | 1524 | ||
1521 | rds_ring = &recv_ctx->rds_rings[ringid]; | 1525 | rds_ring = &recv_ctx->rds_rings[ringid]; |
1522 | 1526 | ||
1523 | producer = rds_ring->producer; | 1527 | producer = rds_ring->producer; |
1524 | index = rds_ring->begin_alloc; | ||
1525 | head = &rds_ring->free_list; | 1528 | head = &rds_ring->free_list; |
1526 | /* We can start writing rx descriptors into the phantom memory. */ | 1529 | /* We can start writing rx descriptors into the phantom memory. */ |
1527 | while (!list_empty(head)) { | 1530 | while (!list_empty(head)) { |
1528 | 1531 | ||
1529 | skb = dev_alloc_skb(rds_ring->skb_size); | 1532 | skb = dev_alloc_skb(rds_ring->skb_size); |
1530 | if (unlikely(!skb)) { | 1533 | if (unlikely(!skb)) { |
1531 | rds_ring->begin_alloc = index; | ||
1532 | break; | 1534 | break; |
1533 | } | 1535 | } |
1534 | 1536 | ||
1537 | if (!adapter->ahw.cut_through) | ||
1538 | skb_reserve(skb, 2); | ||
1539 | |||
1540 | dma = pci_map_single(pdev, skb->data, | ||
1541 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); | ||
1542 | if (pci_dma_mapping_error(pdev, dma)) { | ||
1543 | dev_kfree_skb_any(skb); | ||
1544 | break; | ||
1545 | } | ||
1546 | |||
1547 | count++; | ||
1535 | buffer = list_entry(head->next, struct netxen_rx_buffer, list); | 1548 | buffer = list_entry(head->next, struct netxen_rx_buffer, list); |
1536 | list_del(&buffer->list); | 1549 | list_del(&buffer->list); |
1537 | 1550 | ||
1538 | count++; /* now there should be no failure */ | ||
1539 | pdesc = &rds_ring->desc_head[producer]; | ||
1540 | if (!adapter->ahw.cut_through) | ||
1541 | skb_reserve(skb, 2); | ||
1542 | buffer->skb = skb; | 1551 | buffer->skb = skb; |
1543 | buffer->state = NETXEN_BUFFER_BUSY; | 1552 | buffer->state = NETXEN_BUFFER_BUSY; |
1544 | buffer->dma = pci_map_single(pdev, skb->data, | 1553 | buffer->dma = dma; |
1545 | rds_ring->dma_size, | ||
1546 | PCI_DMA_FROMDEVICE); | ||
1547 | 1554 | ||
1548 | /* make a rcv descriptor */ | 1555 | /* make a rcv descriptor */ |
1556 | pdesc = &rds_ring->desc_head[producer]; | ||
1549 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); | 1557 | pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); |
1550 | pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); | 1558 | pdesc->buffer_length = cpu_to_le32(rds_ring->dma_size); |
1551 | pdesc->addr_buffer = cpu_to_le64(buffer->dma); | 1559 | pdesc->addr_buffer = cpu_to_le64(buffer->dma); |
1552 | producer = | 1560 | |
1553 | get_next_index(producer, rds_ring->max_rx_desc_count); | 1561 | producer = get_next_index(producer, rds_ring->max_rx_desc_count); |
1554 | index = get_next_index(index, rds_ring->max_rx_desc_count); | ||
1555 | buffer = &rds_ring->rx_buf_arr[index]; | ||
1556 | } | 1562 | } |
1557 | 1563 | ||
1558 | /* if we did allocate buffers, then write the count to Phantom */ | 1564 | /* if we did allocate buffers, then write the count to Phantom */ |
1559 | if (count) { | 1565 | if (count) { |
1560 | rds_ring->begin_alloc = index; | ||
1561 | rds_ring->producer = producer; | 1566 | rds_ring->producer = producer; |
1562 | /* Window = 1 */ | 1567 | /* Window = 1 */ |
1563 | adapter->pci_write_normalize(adapter, | 1568 | adapter->pci_write_normalize(adapter, |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index ba01524b5531..3b17a7936147 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -39,7 +39,9 @@ | |||
39 | #include "netxen_nic_phan_reg.h" | 39 | #include "netxen_nic_phan_reg.h" |
40 | 40 | ||
41 | #include <linux/dma-mapping.h> | 41 | #include <linux/dma-mapping.h> |
42 | #include <linux/if_vlan.h> | ||
42 | #include <net/ip.h> | 43 | #include <net/ip.h> |
44 | #include <linux/ipv6.h> | ||
43 | 45 | ||
44 | MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); | 46 | MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver"); |
45 | MODULE_LICENSE("GPL"); | 47 | MODULE_LICENSE("GPL"); |
@@ -74,6 +76,7 @@ static void netxen_nic_poll_controller(struct net_device *netdev); | |||
74 | #endif | 76 | #endif |
75 | static irqreturn_t netxen_intr(int irq, void *data); | 77 | static irqreturn_t netxen_intr(int irq, void *data); |
76 | static irqreturn_t netxen_msi_intr(int irq, void *data); | 78 | static irqreturn_t netxen_msi_intr(int irq, void *data); |
79 | static irqreturn_t netxen_msix_intr(int irq, void *data); | ||
77 | 80 | ||
78 | /* PCI Device ID Table */ | 81 | /* PCI Device ID Table */ |
79 | #define ENTRY(device) \ | 82 | #define ENTRY(device) \ |
@@ -242,7 +245,7 @@ static void netxen_check_options(struct netxen_adapter *adapter) | |||
242 | case NETXEN_BRDTYPE_P3_4_GB: | 245 | case NETXEN_BRDTYPE_P3_4_GB: |
243 | case NETXEN_BRDTYPE_P3_4_GB_MM: | 246 | case NETXEN_BRDTYPE_P3_4_GB_MM: |
244 | adapter->msix_supported = !!use_msi_x; | 247 | adapter->msix_supported = !!use_msi_x; |
245 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G; | 248 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; |
246 | break; | 249 | break; |
247 | 250 | ||
248 | case NETXEN_BRDTYPE_P2_SB35_4G: | 251 | case NETXEN_BRDTYPE_P2_SB35_4G: |
@@ -251,6 +254,14 @@ static void netxen_check_options(struct netxen_adapter *adapter) | |||
251 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; | 254 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; |
252 | break; | 255 | break; |
253 | 256 | ||
257 | case NETXEN_BRDTYPE_P3_10G_TP: | ||
258 | adapter->msix_supported = !!use_msi_x; | ||
259 | if (adapter->ahw.board_type == NETXEN_NIC_XGBE) | ||
260 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_10G; | ||
261 | else | ||
262 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; | ||
263 | break; | ||
264 | |||
254 | default: | 265 | default: |
255 | adapter->msix_supported = 0; | 266 | adapter->msix_supported = 0; |
256 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; | 267 | adapter->max_rx_desc_count = MAX_RCV_DESCRIPTORS_1G; |
@@ -271,10 +282,15 @@ static void netxen_check_options(struct netxen_adapter *adapter) | |||
271 | static int | 282 | static int |
272 | netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot) | 283 | netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot) |
273 | { | 284 | { |
274 | int ret = 0; | 285 | u32 val, timeout; |
275 | 286 | ||
276 | if (first_boot == 0x55555555) { | 287 | if (first_boot == 0x55555555) { |
277 | /* This is the first boot after power up */ | 288 | /* This is the first boot after power up */ |
289 | adapter->pci_write_normalize(adapter, | ||
290 | NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC); | ||
291 | |||
292 | if (!NX_IS_REVISION_P2(adapter->ahw.revision_id)) | ||
293 | return 0; | ||
278 | 294 | ||
279 | /* PCI bus master workaround */ | 295 | /* PCI bus master workaround */ |
280 | adapter->hw_read_wx(adapter, | 296 | adapter->hw_read_wx(adapter, |
@@ -294,18 +310,26 @@ netxen_check_hw_init(struct netxen_adapter *adapter, int first_boot) | |||
294 | /* clear the register for future unloads/loads */ | 310 | /* clear the register for future unloads/loads */ |
295 | adapter->pci_write_normalize(adapter, | 311 | adapter->pci_write_normalize(adapter, |
296 | NETXEN_CAM_RAM(0x1fc), 0); | 312 | NETXEN_CAM_RAM(0x1fc), 0); |
297 | ret = -1; | 313 | return -EIO; |
298 | } | 314 | } |
299 | 315 | ||
300 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { | 316 | /* Start P2 boot loader */ |
301 | /* Start P2 boot loader */ | 317 | val = adapter->pci_read_normalize(adapter, |
302 | adapter->pci_write_normalize(adapter, | 318 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE); |
303 | NETXEN_CAM_RAM(0x1fc), NETXEN_BDINFO_MAGIC); | 319 | adapter->pci_write_normalize(adapter, |
304 | adapter->pci_write_normalize(adapter, | 320 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE, val | 0x1); |
305 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE, 1); | 321 | timeout = 0; |
306 | } | 322 | do { |
323 | msleep(1); | ||
324 | val = adapter->pci_read_normalize(adapter, | ||
325 | NETXEN_CAM_RAM(0x1fc)); | ||
326 | |||
327 | if (++timeout > 5000) | ||
328 | return -EIO; | ||
329 | |||
330 | } while (val == NETXEN_BDINFO_MAGIC); | ||
307 | } | 331 | } |
308 | return ret; | 332 | return 0; |
309 | } | 333 | } |
310 | 334 | ||
311 | static void netxen_set_port_mode(struct netxen_adapter *adapter) | 335 | static void netxen_set_port_mode(struct netxen_adapter *adapter) |
@@ -712,17 +736,18 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
712 | 736 | ||
713 | SET_ETHTOOL_OPS(netdev, &netxen_nic_ethtool_ops); | 737 | SET_ETHTOOL_OPS(netdev, &netxen_nic_ethtool_ops); |
714 | 738 | ||
715 | /* ScatterGather support */ | 739 | netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO); |
716 | netdev->features = NETIF_F_SG; | 740 | netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO); |
717 | netdev->features |= NETIF_F_IP_CSUM; | 741 | |
718 | netdev->features |= NETIF_F_TSO; | ||
719 | if (NX_IS_REVISION_P3(revision_id)) { | 742 | if (NX_IS_REVISION_P3(revision_id)) { |
720 | netdev->features |= NETIF_F_IPV6_CSUM; | 743 | netdev->features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6); |
721 | netdev->features |= NETIF_F_TSO6; | 744 | netdev->vlan_features |= (NETIF_F_IPV6_CSUM | NETIF_F_TSO6); |
722 | } | 745 | } |
723 | 746 | ||
724 | if (adapter->pci_using_dac) | 747 | if (adapter->pci_using_dac) { |
725 | netdev->features |= NETIF_F_HIGHDMA; | 748 | netdev->features |= NETIF_F_HIGHDMA; |
749 | netdev->vlan_features |= NETIF_F_HIGHDMA; | ||
750 | } | ||
726 | 751 | ||
727 | /* | 752 | /* |
728 | * Set the CRB window to invalid. If any register in window 0 is | 753 | * Set the CRB window to invalid. If any register in window 0 is |
@@ -784,8 +809,8 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
784 | CRB_CMDPEG_STATE, 0); | 809 | CRB_CMDPEG_STATE, 0); |
785 | netxen_pinit_from_rom(adapter, 0); | 810 | netxen_pinit_from_rom(adapter, 0); |
786 | msleep(1); | 811 | msleep(1); |
787 | netxen_load_firmware(adapter); | ||
788 | } | 812 | } |
813 | netxen_load_firmware(adapter); | ||
789 | 814 | ||
790 | if (NX_IS_REVISION_P3(revision_id)) | 815 | if (NX_IS_REVISION_P3(revision_id)) |
791 | netxen_pcie_strap_init(adapter); | 816 | netxen_pcie_strap_init(adapter); |
@@ -801,13 +826,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
801 | 826 | ||
802 | } | 827 | } |
803 | 828 | ||
804 | if ((first_boot == 0x55555555) && | ||
805 | (NX_IS_REVISION_P2(revision_id))) { | ||
806 | /* Unlock the HW, prompting the boot sequence */ | ||
807 | adapter->pci_write_normalize(adapter, | ||
808 | NETXEN_ROMUSB_GLB_PEGTUNE_DONE, 1); | ||
809 | } | ||
810 | |||
811 | err = netxen_initialize_adapter_offload(adapter); | 829 | err = netxen_initialize_adapter_offload(adapter); |
812 | if (err) | 830 | if (err) |
813 | goto err_out_iounmap; | 831 | goto err_out_iounmap; |
@@ -821,7 +839,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
821 | adapter->pci_write_normalize(adapter, CRB_DRIVER_VERSION, i); | 839 | adapter->pci_write_normalize(adapter, CRB_DRIVER_VERSION, i); |
822 | 840 | ||
823 | /* Handshake with the card before we register the devices. */ | 841 | /* Handshake with the card before we register the devices. */ |
824 | netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); | 842 | err = netxen_phantom_init(adapter, NETXEN_NIC_PEG_TUNE); |
843 | if (err) | ||
844 | goto err_out_free_offload; | ||
825 | 845 | ||
826 | } /* first_driver */ | 846 | } /* first_driver */ |
827 | 847 | ||
@@ -925,6 +945,7 @@ err_out_disable_msi: | |||
925 | if (adapter->flags & NETXEN_NIC_MSI_ENABLED) | 945 | if (adapter->flags & NETXEN_NIC_MSI_ENABLED) |
926 | pci_disable_msi(pdev); | 946 | pci_disable_msi(pdev); |
927 | 947 | ||
948 | err_out_free_offload: | ||
928 | if (first_driver) | 949 | if (first_driver) |
929 | netxen_free_adapter_offload(adapter); | 950 | netxen_free_adapter_offload(adapter); |
930 | 951 | ||
@@ -968,6 +989,9 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
968 | netxen_free_hw_resources(adapter); | 989 | netxen_free_hw_resources(adapter); |
969 | netxen_release_rx_buffers(adapter); | 990 | netxen_release_rx_buffers(adapter); |
970 | netxen_free_sw_resources(adapter); | 991 | netxen_free_sw_resources(adapter); |
992 | |||
993 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | ||
994 | netxen_p3_free_mac_list(adapter); | ||
971 | } | 995 | } |
972 | 996 | ||
973 | if (adapter->portnum == 0) | 997 | if (adapter->portnum == 0) |
@@ -983,8 +1007,10 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
983 | 1007 | ||
984 | iounmap(adapter->ahw.db_base); | 1008 | iounmap(adapter->ahw.db_base); |
985 | iounmap(adapter->ahw.pci_base0); | 1009 | iounmap(adapter->ahw.pci_base0); |
986 | iounmap(adapter->ahw.pci_base1); | 1010 | if (adapter->ahw.pci_base1 != NULL) |
987 | iounmap(adapter->ahw.pci_base2); | 1011 | iounmap(adapter->ahw.pci_base1); |
1012 | if (adapter->ahw.pci_base2 != NULL) | ||
1013 | iounmap(adapter->ahw.pci_base2); | ||
988 | 1014 | ||
989 | pci_release_regions(pdev); | 1015 | pci_release_regions(pdev); |
990 | pci_disable_device(pdev); | 1016 | pci_disable_device(pdev); |
@@ -1059,7 +1085,9 @@ static int netxen_nic_open(struct net_device *netdev) | |||
1059 | for (ring = 0; ring < adapter->max_rds_rings; ring++) | 1085 | for (ring = 0; ring < adapter->max_rds_rings; ring++) |
1060 | netxen_post_rx_buffers(adapter, ctx, ring); | 1086 | netxen_post_rx_buffers(adapter, ctx, ring); |
1061 | } | 1087 | } |
1062 | if (NETXEN_IS_MSI_FAMILY(adapter)) | 1088 | if (adapter->flags & NETXEN_NIC_MSIX_ENABLED) |
1089 | handler = netxen_msix_intr; | ||
1090 | else if (adapter->flags & NETXEN_NIC_MSI_ENABLED) | ||
1063 | handler = netxen_msi_intr; | 1091 | handler = netxen_msi_intr; |
1064 | else { | 1092 | else { |
1065 | flags |= IRQF_SHARED; | 1093 | flags |= IRQF_SHARED; |
@@ -1137,29 +1165,72 @@ static int netxen_nic_close(struct net_device *netdev) | |||
1137 | return 0; | 1165 | return 0; |
1138 | } | 1166 | } |
1139 | 1167 | ||
1140 | void netxen_tso_check(struct netxen_adapter *adapter, | 1168 | static bool netxen_tso_check(struct net_device *netdev, |
1141 | struct cmd_desc_type0 *desc, struct sk_buff *skb) | 1169 | struct cmd_desc_type0 *desc, struct sk_buff *skb) |
1142 | { | 1170 | { |
1143 | if (desc->mss) { | 1171 | bool tso = false; |
1144 | desc->total_hdr_length = (sizeof(struct ethhdr) + | 1172 | u8 opcode = TX_ETHER_PKT; |
1145 | ip_hdrlen(skb) + tcp_hdrlen(skb)); | 1173 | __be16 protocol = skb->protocol; |
1174 | u16 flags = 0; | ||
1175 | |||
1176 | if (protocol == __constant_htons(ETH_P_8021Q)) { | ||
1177 | struct vlan_ethhdr *vh = (struct vlan_ethhdr *)skb->data; | ||
1178 | protocol = vh->h_vlan_encapsulated_proto; | ||
1179 | flags = FLAGS_VLAN_TAGGED; | ||
1180 | } | ||
1146 | 1181 | ||
1147 | if ((NX_IS_REVISION_P3(adapter->ahw.revision_id)) && | 1182 | if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) && |
1148 | (skb->protocol == htons(ETH_P_IPV6))) | 1183 | skb_shinfo(skb)->gso_size > 0) { |
1149 | netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO6); | 1184 | |
1150 | else | 1185 | desc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); |
1151 | netxen_set_cmd_desc_opcode(desc, TX_TCP_LSO); | 1186 | desc->total_hdr_length = |
1187 | skb_transport_offset(skb) + tcp_hdrlen(skb); | ||
1188 | |||
1189 | opcode = (protocol == __constant_htons(ETH_P_IPV6)) ? | ||
1190 | TX_TCP_LSO6 : TX_TCP_LSO; | ||
1191 | tso = true; | ||
1152 | 1192 | ||
1153 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { | 1193 | } else if (skb->ip_summed == CHECKSUM_PARTIAL) { |
1154 | if (ip_hdr(skb)->protocol == IPPROTO_TCP) | 1194 | u8 l4proto; |
1155 | netxen_set_cmd_desc_opcode(desc, TX_TCP_PKT); | 1195 | |
1156 | else if (ip_hdr(skb)->protocol == IPPROTO_UDP) | 1196 | if (protocol == __constant_htons(ETH_P_IP)) { |
1157 | netxen_set_cmd_desc_opcode(desc, TX_UDP_PKT); | 1197 | l4proto = ip_hdr(skb)->protocol; |
1158 | else | 1198 | |
1159 | return; | 1199 | if (l4proto == IPPROTO_TCP) |
1200 | opcode = TX_TCP_PKT; | ||
1201 | else if(l4proto == IPPROTO_UDP) | ||
1202 | opcode = TX_UDP_PKT; | ||
1203 | } else if (protocol == __constant_htons(ETH_P_IPV6)) { | ||
1204 | l4proto = ipv6_hdr(skb)->nexthdr; | ||
1205 | |||
1206 | if (l4proto == IPPROTO_TCP) | ||
1207 | opcode = TX_TCPV6_PKT; | ||
1208 | else if(l4proto == IPPROTO_UDP) | ||
1209 | opcode = TX_UDPV6_PKT; | ||
1210 | } | ||
1160 | } | 1211 | } |
1161 | desc->tcp_hdr_offset = skb_transport_offset(skb); | 1212 | desc->tcp_hdr_offset = skb_transport_offset(skb); |
1162 | desc->ip_hdr_offset = skb_network_offset(skb); | 1213 | desc->ip_hdr_offset = skb_network_offset(skb); |
1214 | netxen_set_tx_flags_opcode(desc, flags, opcode); | ||
1215 | return tso; | ||
1216 | } | ||
1217 | |||
1218 | static void | ||
1219 | netxen_clean_tx_dma_mapping(struct pci_dev *pdev, | ||
1220 | struct netxen_cmd_buffer *pbuf, int last) | ||
1221 | { | ||
1222 | int k; | ||
1223 | struct netxen_skb_frag *buffrag; | ||
1224 | |||
1225 | buffrag = &pbuf->frag_array[0]; | ||
1226 | pci_unmap_single(pdev, buffrag->dma, | ||
1227 | buffrag->length, PCI_DMA_TODEVICE); | ||
1228 | |||
1229 | for (k = 1; k < last; k++) { | ||
1230 | buffrag = &pbuf->frag_array[k]; | ||
1231 | pci_unmap_page(pdev, buffrag->dma, | ||
1232 | buffrag->length, PCI_DMA_TODEVICE); | ||
1233 | } | ||
1163 | } | 1234 | } |
1164 | 1235 | ||
1165 | static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | 1236 | static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) |
@@ -1167,33 +1238,22 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1167 | struct netxen_adapter *adapter = netdev_priv(netdev); | 1238 | struct netxen_adapter *adapter = netdev_priv(netdev); |
1168 | struct netxen_hardware_context *hw = &adapter->ahw; | 1239 | struct netxen_hardware_context *hw = &adapter->ahw; |
1169 | unsigned int first_seg_len = skb->len - skb->data_len; | 1240 | unsigned int first_seg_len = skb->len - skb->data_len; |
1241 | struct netxen_cmd_buffer *pbuf; | ||
1170 | struct netxen_skb_frag *buffrag; | 1242 | struct netxen_skb_frag *buffrag; |
1171 | unsigned int i; | 1243 | struct cmd_desc_type0 *hwdesc; |
1244 | struct pci_dev *pdev = adapter->pdev; | ||
1245 | dma_addr_t temp_dma; | ||
1246 | int i, k; | ||
1172 | 1247 | ||
1173 | u32 producer, consumer; | 1248 | u32 producer, consumer; |
1174 | u32 saved_producer = 0; | 1249 | int frag_count, no_of_desc; |
1175 | struct cmd_desc_type0 *hwdesc; | ||
1176 | int k; | ||
1177 | struct netxen_cmd_buffer *pbuf = NULL; | ||
1178 | int frag_count; | ||
1179 | int no_of_desc; | ||
1180 | u32 num_txd = adapter->max_tx_desc_count; | 1250 | u32 num_txd = adapter->max_tx_desc_count; |
1251 | bool is_tso = false; | ||
1181 | 1252 | ||
1182 | frag_count = skb_shinfo(skb)->nr_frags + 1; | 1253 | frag_count = skb_shinfo(skb)->nr_frags + 1; |
1183 | 1254 | ||
1184 | /* There 4 fragments per descriptor */ | 1255 | /* There 4 fragments per descriptor */ |
1185 | no_of_desc = (frag_count + 3) >> 2; | 1256 | no_of_desc = (frag_count + 3) >> 2; |
1186 | if (netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) { | ||
1187 | if (skb_shinfo(skb)->gso_size > 0) { | ||
1188 | |||
1189 | no_of_desc++; | ||
1190 | if ((ip_hdrlen(skb) + tcp_hdrlen(skb) + | ||
1191 | sizeof(struct ethhdr)) > | ||
1192 | (sizeof(struct cmd_desc_type0) - 2)) { | ||
1193 | no_of_desc++; | ||
1194 | } | ||
1195 | } | ||
1196 | } | ||
1197 | 1257 | ||
1198 | producer = adapter->cmd_producer; | 1258 | producer = adapter->cmd_producer; |
1199 | smp_mb(); | 1259 | smp_mb(); |
@@ -1205,34 +1265,26 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1205 | } | 1265 | } |
1206 | 1266 | ||
1207 | /* Copy the descriptors into the hardware */ | 1267 | /* Copy the descriptors into the hardware */ |
1208 | saved_producer = producer; | ||
1209 | hwdesc = &hw->cmd_desc_head[producer]; | 1268 | hwdesc = &hw->cmd_desc_head[producer]; |
1210 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); | 1269 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); |
1211 | /* Take skb->data itself */ | 1270 | /* Take skb->data itself */ |
1212 | pbuf = &adapter->cmd_buf_arr[producer]; | 1271 | pbuf = &adapter->cmd_buf_arr[producer]; |
1213 | if ((netdev->features & (NETIF_F_TSO | NETIF_F_TSO6)) && | 1272 | |
1214 | skb_shinfo(skb)->gso_size > 0) { | 1273 | is_tso = netxen_tso_check(netdev, hwdesc, skb); |
1215 | pbuf->mss = skb_shinfo(skb)->gso_size; | 1274 | |
1216 | hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); | ||
1217 | } else { | ||
1218 | pbuf->mss = 0; | ||
1219 | hwdesc->mss = 0; | ||
1220 | } | ||
1221 | pbuf->total_length = skb->len; | ||
1222 | pbuf->skb = skb; | 1275 | pbuf->skb = skb; |
1223 | pbuf->cmd = TX_ETHER_PKT; | ||
1224 | pbuf->frag_count = frag_count; | 1276 | pbuf->frag_count = frag_count; |
1225 | pbuf->port = adapter->portnum; | ||
1226 | buffrag = &pbuf->frag_array[0]; | 1277 | buffrag = &pbuf->frag_array[0]; |
1227 | buffrag->dma = pci_map_single(adapter->pdev, skb->data, first_seg_len, | 1278 | temp_dma = pci_map_single(pdev, skb->data, first_seg_len, |
1228 | PCI_DMA_TODEVICE); | 1279 | PCI_DMA_TODEVICE); |
1280 | if (pci_dma_mapping_error(pdev, temp_dma)) | ||
1281 | goto drop_packet; | ||
1282 | |||
1283 | buffrag->dma = temp_dma; | ||
1229 | buffrag->length = first_seg_len; | 1284 | buffrag->length = first_seg_len; |
1230 | netxen_set_cmd_desc_totallength(hwdesc, skb->len); | 1285 | netxen_set_tx_frags_len(hwdesc, frag_count, skb->len); |
1231 | netxen_set_cmd_desc_num_of_buff(hwdesc, frag_count); | 1286 | netxen_set_tx_port(hwdesc, adapter->portnum); |
1232 | netxen_set_cmd_desc_opcode(hwdesc, TX_ETHER_PKT); | ||
1233 | 1287 | ||
1234 | netxen_set_cmd_desc_port(hwdesc, adapter->portnum); | ||
1235 | netxen_set_cmd_desc_ctxid(hwdesc, adapter->portnum); | ||
1236 | hwdesc->buffer1_length = cpu_to_le16(first_seg_len); | 1288 | hwdesc->buffer1_length = cpu_to_le16(first_seg_len); |
1237 | hwdesc->addr_buffer1 = cpu_to_le64(buffrag->dma); | 1289 | hwdesc->addr_buffer1 = cpu_to_le64(buffrag->dma); |
1238 | 1290 | ||
@@ -1240,7 +1292,6 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1240 | struct skb_frag_struct *frag; | 1292 | struct skb_frag_struct *frag; |
1241 | int len, temp_len; | 1293 | int len, temp_len; |
1242 | unsigned long offset; | 1294 | unsigned long offset; |
1243 | dma_addr_t temp_dma; | ||
1244 | 1295 | ||
1245 | /* move to next desc. if there is a need */ | 1296 | /* move to next desc. if there is a need */ |
1246 | if ((i & 0x3) == 0) { | 1297 | if ((i & 0x3) == 0) { |
@@ -1256,8 +1307,12 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1256 | offset = frag->page_offset; | 1307 | offset = frag->page_offset; |
1257 | 1308 | ||
1258 | temp_len = len; | 1309 | temp_len = len; |
1259 | temp_dma = pci_map_page(adapter->pdev, frag->page, offset, | 1310 | temp_dma = pci_map_page(pdev, frag->page, offset, |
1260 | len, PCI_DMA_TODEVICE); | 1311 | len, PCI_DMA_TODEVICE); |
1312 | if (pci_dma_mapping_error(pdev, temp_dma)) { | ||
1313 | netxen_clean_tx_dma_mapping(pdev, pbuf, i); | ||
1314 | goto drop_packet; | ||
1315 | } | ||
1261 | 1316 | ||
1262 | buffrag++; | 1317 | buffrag++; |
1263 | buffrag->dma = temp_dma; | 1318 | buffrag->dma = temp_dma; |
@@ -1285,16 +1340,12 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1285 | } | 1340 | } |
1286 | producer = get_next_index(producer, num_txd); | 1341 | producer = get_next_index(producer, num_txd); |
1287 | 1342 | ||
1288 | /* might change opcode to TX_TCP_LSO */ | ||
1289 | netxen_tso_check(adapter, &hw->cmd_desc_head[saved_producer], skb); | ||
1290 | |||
1291 | /* For LSO, we need to copy the MAC/IP/TCP headers into | 1343 | /* For LSO, we need to copy the MAC/IP/TCP headers into |
1292 | * the descriptor ring | 1344 | * the descriptor ring |
1293 | */ | 1345 | */ |
1294 | if (netxen_get_cmd_desc_opcode(&hw->cmd_desc_head[saved_producer]) | 1346 | if (is_tso) { |
1295 | == TX_TCP_LSO) { | ||
1296 | int hdr_len, first_hdr_len, more_hdr; | 1347 | int hdr_len, first_hdr_len, more_hdr; |
1297 | hdr_len = hw->cmd_desc_head[saved_producer].total_hdr_length; | 1348 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
1298 | if (hdr_len > (sizeof(struct cmd_desc_type0) - 2)) { | 1349 | if (hdr_len > (sizeof(struct cmd_desc_type0) - 2)) { |
1299 | first_hdr_len = sizeof(struct cmd_desc_type0) - 2; | 1350 | first_hdr_len = sizeof(struct cmd_desc_type0) - 2; |
1300 | more_hdr = 1; | 1351 | more_hdr = 1; |
@@ -1336,6 +1387,11 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1336 | netdev->trans_start = jiffies; | 1387 | netdev->trans_start = jiffies; |
1337 | 1388 | ||
1338 | return NETDEV_TX_OK; | 1389 | return NETDEV_TX_OK; |
1390 | |||
1391 | drop_packet: | ||
1392 | adapter->stats.txdropped++; | ||
1393 | dev_kfree_skb_any(skb); | ||
1394 | return NETDEV_TX_OK; | ||
1339 | } | 1395 | } |
1340 | 1396 | ||
1341 | static int netxen_nic_check_temp(struct netxen_adapter *adapter) | 1397 | static int netxen_nic_check_temp(struct netxen_adapter *adapter) |
@@ -1407,6 +1463,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter) | |||
1407 | netif_carrier_off(netdev); | 1463 | netif_carrier_off(netdev); |
1408 | netif_stop_queue(netdev); | 1464 | netif_stop_queue(netdev); |
1409 | } | 1465 | } |
1466 | |||
1467 | netxen_nic_set_link_parameters(adapter); | ||
1410 | } else if (!adapter->ahw.linkup && linkup) { | 1468 | } else if (!adapter->ahw.linkup && linkup) { |
1411 | printk(KERN_INFO "%s: %s NIC Link is up\n", | 1469 | printk(KERN_INFO "%s: %s NIC Link is up\n", |
1412 | netxen_nic_driver_name, netdev->name); | 1470 | netxen_nic_driver_name, netdev->name); |
@@ -1415,6 +1473,8 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter) | |||
1415 | netif_carrier_on(netdev); | 1473 | netif_carrier_on(netdev); |
1416 | netif_wake_queue(netdev); | 1474 | netif_wake_queue(netdev); |
1417 | } | 1475 | } |
1476 | |||
1477 | netxen_nic_set_link_parameters(adapter); | ||
1418 | } | 1478 | } |
1419 | } | 1479 | } |
1420 | 1480 | ||
@@ -1555,6 +1615,14 @@ static irqreturn_t netxen_msi_intr(int irq, void *data) | |||
1555 | return IRQ_HANDLED; | 1615 | return IRQ_HANDLED; |
1556 | } | 1616 | } |
1557 | 1617 | ||
1618 | static irqreturn_t netxen_msix_intr(int irq, void *data) | ||
1619 | { | ||
1620 | struct netxen_adapter *adapter = data; | ||
1621 | |||
1622 | napi_schedule(&adapter->napi); | ||
1623 | return IRQ_HANDLED; | ||
1624 | } | ||
1625 | |||
1558 | static int netxen_nic_poll(struct napi_struct *napi, int budget) | 1626 | static int netxen_nic_poll(struct napi_struct *napi, int budget) |
1559 | { | 1627 | { |
1560 | struct netxen_adapter *adapter = container_of(napi, struct netxen_adapter, napi); | 1628 | struct netxen_adapter *adapter = container_of(napi, struct netxen_adapter, napi); |
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 42021aca1ddd..e80294d8cc19 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -1956,6 +1956,7 @@ static const struct net_device_ops netdev_ops = { | |||
1956 | .ndo_change_mtu = ns83820_change_mtu, | 1956 | .ndo_change_mtu = ns83820_change_mtu, |
1957 | .ndo_set_multicast_list = ns83820_set_multicast, | 1957 | .ndo_set_multicast_list = ns83820_set_multicast, |
1958 | .ndo_validate_addr = eth_validate_addr, | 1958 | .ndo_validate_addr = eth_validate_addr, |
1959 | .ndo_set_mac_address = eth_mac_addr, | ||
1959 | .ndo_tx_timeout = ns83820_tx_timeout, | 1960 | .ndo_tx_timeout = ns83820_tx_timeout, |
1960 | #ifdef NS83820_VLAN_ACCEL_SUPPORT | 1961 | #ifdef NS83820_VLAN_ACCEL_SUPPORT |
1961 | .ndo_vlan_rx_register = ns83820_vlan_rx_register, | 1962 | .ndo_vlan_rx_register = ns83820_vlan_rx_register, |
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 5b7a574ce571..d0349e7d73ea 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -712,7 +712,7 @@ static inline void pasemi_mac_rx_error(const struct pasemi_mac *mac, | |||
712 | rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if)); | 712 | rcmdsta = read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if)); |
713 | ccmdsta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno)); | 713 | ccmdsta = read_dma_reg(PAS_DMA_RXCHAN_CCMDSTA(chan->chno)); |
714 | 714 | ||
715 | printk(KERN_ERR "pasemi_mac: rx error. macrx %016lx, rx status %lx\n", | 715 | printk(KERN_ERR "pasemi_mac: rx error. macrx %016llx, rx status %llx\n", |
716 | macrx, *chan->status); | 716 | macrx, *chan->status); |
717 | 717 | ||
718 | printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n", | 718 | printk(KERN_ERR "pasemi_mac: rcmdsta %08x ccmdsta %08x\n", |
@@ -730,8 +730,8 @@ static inline void pasemi_mac_tx_error(const struct pasemi_mac *mac, | |||
730 | 730 | ||
731 | cmdsta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(chan->chno)); | 731 | cmdsta = read_dma_reg(PAS_DMA_TXCHAN_TCMDSTA(chan->chno)); |
732 | 732 | ||
733 | printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016lx, "\ | 733 | printk(KERN_ERR "pasemi_mac: tx error. mactx 0x%016llx, "\ |
734 | "tx status 0x%016lx\n", mactx, *chan->status); | 734 | "tx status 0x%016llx\n", mactx, *chan->status); |
735 | 735 | ||
736 | printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta); | 736 | printk(KERN_ERR "pasemi_mac: tcmdsta 0x%08x\n", cmdsta); |
737 | } | 737 | } |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index c38ed777f0a8..a6999403f37b 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
@@ -586,7 +586,7 @@ static int pcnet_config(struct pcmcia_device *link) | |||
586 | } | 586 | } |
587 | 587 | ||
588 | if ((link->conf.ConfigBase == 0x03c0) | 588 | if ((link->conf.ConfigBase == 0x03c0) |
589 | && (link->manf_id == 0x149) && (link->card_id = 0xc1ab)) { | 589 | && (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) { |
590 | printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n"); | 590 | printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n"); |
591 | printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n"); | 591 | printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n"); |
592 | goto failed; | 592 | goto failed; |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 11adf6ed4628..811a637695ca 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -296,9 +296,8 @@ static int mdio_bus_suspend(struct device * dev, pm_message_t state) | |||
296 | struct phy_driver *phydrv = to_phy_driver(drv); | 296 | struct phy_driver *phydrv = to_phy_driver(drv); |
297 | struct phy_device *phydev = to_phy_device(dev); | 297 | struct phy_device *phydev = to_phy_device(dev); |
298 | 298 | ||
299 | if ((!device_may_wakeup(phydev->dev.parent)) && | 299 | if (drv && phydrv->suspend && !device_may_wakeup(phydev->dev.parent)) |
300 | (phydrv && phydrv->suspend)) | 300 | ret = phydrv->suspend(phydev); |
301 | ret = phydrv->suspend(phydev); | ||
302 | 301 | ||
303 | return ret; | 302 | return ret; |
304 | } | 303 | } |
@@ -310,8 +309,7 @@ static int mdio_bus_resume(struct device * dev) | |||
310 | struct phy_driver *phydrv = to_phy_driver(drv); | 309 | struct phy_driver *phydrv = to_phy_driver(drv); |
311 | struct phy_device *phydev = to_phy_device(dev); | 310 | struct phy_device *phydev = to_phy_device(dev); |
312 | 311 | ||
313 | if ((!device_may_wakeup(phydev->dev.parent)) && | 312 | if (drv && phydrv->resume && !device_may_wakeup(phydev->dev.parent)) |
314 | (phydrv && phydrv->resume)) | ||
315 | ret = phydrv->resume(phydev); | 313 | ret = phydrv->resume(phydev); |
316 | 314 | ||
317 | return ret; | 315 | return ret; |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index e35460165bf7..0a06e4fd37d9 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -231,15 +231,6 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr) | |||
231 | if ((phy_id & 0x1fffffff) == 0x1fffffff) | 231 | if ((phy_id & 0x1fffffff) == 0x1fffffff) |
232 | return NULL; | 232 | return NULL; |
233 | 233 | ||
234 | /* | ||
235 | * Broken hardware is sometimes missing the pull-up resistor on the | ||
236 | * MDIO line, which results in reads to non-existent devices returning | ||
237 | * 0 rather than 0xffff. Catch this here and treat 0 as a non-existent | ||
238 | * device as well. | ||
239 | */ | ||
240 | if (phy_id == 0) | ||
241 | return NULL; | ||
242 | |||
243 | dev = phy_device_create(bus, addr, phy_id); | 234 | dev = phy_device_create(bus, addr, phy_id); |
244 | 235 | ||
245 | return dev; | 236 | return dev; |
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index c05d38d46350..1387187543e4 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c | |||
@@ -81,6 +81,9 @@ static struct phy_driver lan83c185_driver = { | |||
81 | .ack_interrupt = smsc_phy_ack_interrupt, | 81 | .ack_interrupt = smsc_phy_ack_interrupt, |
82 | .config_intr = smsc_phy_config_intr, | 82 | .config_intr = smsc_phy_config_intr, |
83 | 83 | ||
84 | .suspend = genphy_suspend, | ||
85 | .resume = genphy_resume, | ||
86 | |||
84 | .driver = { .owner = THIS_MODULE, } | 87 | .driver = { .owner = THIS_MODULE, } |
85 | }; | 88 | }; |
86 | 89 | ||
@@ -102,6 +105,9 @@ static struct phy_driver lan8187_driver = { | |||
102 | .ack_interrupt = smsc_phy_ack_interrupt, | 105 | .ack_interrupt = smsc_phy_ack_interrupt, |
103 | .config_intr = smsc_phy_config_intr, | 106 | .config_intr = smsc_phy_config_intr, |
104 | 107 | ||
108 | .suspend = genphy_suspend, | ||
109 | .resume = genphy_resume, | ||
110 | |||
105 | .driver = { .owner = THIS_MODULE, } | 111 | .driver = { .owner = THIS_MODULE, } |
106 | }; | 112 | }; |
107 | 113 | ||
@@ -123,6 +129,9 @@ static struct phy_driver lan8700_driver = { | |||
123 | .ack_interrupt = smsc_phy_ack_interrupt, | 129 | .ack_interrupt = smsc_phy_ack_interrupt, |
124 | .config_intr = smsc_phy_config_intr, | 130 | .config_intr = smsc_phy_config_intr, |
125 | 131 | ||
132 | .suspend = genphy_suspend, | ||
133 | .resume = genphy_resume, | ||
134 | |||
126 | .driver = { .owner = THIS_MODULE, } | 135 | .driver = { .owner = THIS_MODULE, } |
127 | }; | 136 | }; |
128 | 137 | ||
@@ -144,6 +153,9 @@ static struct phy_driver lan911x_int_driver = { | |||
144 | .ack_interrupt = smsc_phy_ack_interrupt, | 153 | .ack_interrupt = smsc_phy_ack_interrupt, |
145 | .config_intr = smsc_phy_config_intr, | 154 | .config_intr = smsc_phy_config_intr, |
146 | 155 | ||
156 | .suspend = genphy_suspend, | ||
157 | .resume = genphy_resume, | ||
158 | |||
147 | .driver = { .owner = THIS_MODULE, } | 159 | .driver = { .owner = THIS_MODULE, } |
148 | }; | 160 | }; |
149 | 161 | ||
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 06b448285eb5..7b2728b8f1b7 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -250,6 +250,7 @@ static int ppp_connect_channel(struct channel *pch, int unit); | |||
250 | static int ppp_disconnect_channel(struct channel *pch); | 250 | static int ppp_disconnect_channel(struct channel *pch); |
251 | static void ppp_destroy_channel(struct channel *pch); | 251 | static void ppp_destroy_channel(struct channel *pch); |
252 | static int unit_get(struct idr *p, void *ptr); | 252 | static int unit_get(struct idr *p, void *ptr); |
253 | static int unit_set(struct idr *p, void *ptr, int n); | ||
253 | static void unit_put(struct idr *p, int n); | 254 | static void unit_put(struct idr *p, int n); |
254 | static void *unit_find(struct idr *p, int n); | 255 | static void *unit_find(struct idr *p, int n); |
255 | 256 | ||
@@ -2432,11 +2433,18 @@ ppp_create_interface(int unit, int *retp) | |||
2432 | } else { | 2433 | } else { |
2433 | if (unit_find(&ppp_units_idr, unit)) | 2434 | if (unit_find(&ppp_units_idr, unit)) |
2434 | goto out2; /* unit already exists */ | 2435 | goto out2; /* unit already exists */ |
2435 | else { | 2436 | /* |
2436 | /* darn, someone is cheating us? */ | 2437 | * if caller need a specified unit number |
2437 | *retp = -EINVAL; | 2438 | * lets try to satisfy him, otherwise -- |
2439 | * he should better ask us for new unit number | ||
2440 | * | ||
2441 | * NOTE: yes I know that returning EEXIST it's not | ||
2442 | * fair but at least pppd will ask us to allocate | ||
2443 | * new unit in this case so user is happy :) | ||
2444 | */ | ||
2445 | unit = unit_set(&ppp_units_idr, ppp, unit); | ||
2446 | if (unit < 0) | ||
2438 | goto out2; | 2447 | goto out2; |
2439 | } | ||
2440 | } | 2448 | } |
2441 | 2449 | ||
2442 | /* Initialize the new ppp unit */ | 2450 | /* Initialize the new ppp unit */ |
@@ -2677,14 +2685,37 @@ static void __exit ppp_cleanup(void) | |||
2677 | * by holding all_ppp_mutex | 2685 | * by holding all_ppp_mutex |
2678 | */ | 2686 | */ |
2679 | 2687 | ||
2688 | /* associate pointer with specified number */ | ||
2689 | static int unit_set(struct idr *p, void *ptr, int n) | ||
2690 | { | ||
2691 | int unit, err; | ||
2692 | |||
2693 | again: | ||
2694 | if (!idr_pre_get(p, GFP_KERNEL)) { | ||
2695 | printk(KERN_ERR "PPP: No free memory for idr\n"); | ||
2696 | return -ENOMEM; | ||
2697 | } | ||
2698 | |||
2699 | err = idr_get_new_above(p, ptr, n, &unit); | ||
2700 | if (err == -EAGAIN) | ||
2701 | goto again; | ||
2702 | |||
2703 | if (unit != n) { | ||
2704 | idr_remove(p, unit); | ||
2705 | return -EINVAL; | ||
2706 | } | ||
2707 | |||
2708 | return unit; | ||
2709 | } | ||
2710 | |||
2680 | /* get new free unit number and associate pointer with it */ | 2711 | /* get new free unit number and associate pointer with it */ |
2681 | static int unit_get(struct idr *p, void *ptr) | 2712 | static int unit_get(struct idr *p, void *ptr) |
2682 | { | 2713 | { |
2683 | int unit, err; | 2714 | int unit, err; |
2684 | 2715 | ||
2685 | again: | 2716 | again: |
2686 | if (idr_pre_get(p, GFP_KERNEL) == 0) { | 2717 | if (!idr_pre_get(p, GFP_KERNEL)) { |
2687 | printk(KERN_ERR "Out of memory expanding drawable idr\n"); | 2718 | printk(KERN_ERR "PPP: No free memory for idr\n"); |
2688 | return -ENOMEM; | 2719 | return -ENOMEM; |
2689 | } | 2720 | } |
2690 | 2721 | ||
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c index ec2314246682..335da4831ab3 100644 --- a/drivers/net/ps3_gelic_wireless.c +++ b/drivers/net/ps3_gelic_wireless.c | |||
@@ -2168,7 +2168,7 @@ static void gelic_wl_connected_event(struct gelic_wl_info *wl, | |||
2168 | complete(&wl->assoc_done); | 2168 | complete(&wl->assoc_done); |
2169 | netif_carrier_on(port_to_netdev(wl_port(wl))); | 2169 | netif_carrier_on(port_to_netdev(wl_port(wl))); |
2170 | } else | 2170 | } else |
2171 | pr_debug("%s: event %#lx under wpa\n", | 2171 | pr_debug("%s: event %#llx under wpa\n", |
2172 | __func__, event); | 2172 | __func__, event); |
2173 | } | 2173 | } |
2174 | 2174 | ||
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index 459663a4023d..e6fdce9206cc 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -28,11 +28,11 @@ | |||
28 | } while (0) | 28 | } while (0) |
29 | 29 | ||
30 | #define QLGE_VENDOR_ID 0x1077 | 30 | #define QLGE_VENDOR_ID 0x1077 |
31 | #define QLGE_DEVICE_ID1 0x8012 | 31 | #define QLGE_DEVICE_ID 0x8012 |
32 | #define QLGE_DEVICE_ID 0x8000 | ||
33 | 32 | ||
34 | #define MAX_RX_RINGS 128 | 33 | #define MAX_CPUS 8 |
35 | #define MAX_TX_RINGS 128 | 34 | #define MAX_TX_RINGS MAX_CPUS |
35 | #define MAX_RX_RINGS ((MAX_CPUS * 2) + 1) | ||
36 | 36 | ||
37 | #define NUM_TX_RING_ENTRIES 256 | 37 | #define NUM_TX_RING_ENTRIES 256 |
38 | #define NUM_RX_RING_ENTRIES 256 | 38 | #define NUM_RX_RING_ENTRIES 256 |
@@ -45,6 +45,7 @@ | |||
45 | #define MAX_SPLIT_SIZE 1023 | 45 | #define MAX_SPLIT_SIZE 1023 |
46 | #define QLGE_SB_PAD 32 | 46 | #define QLGE_SB_PAD 32 |
47 | 47 | ||
48 | #define MAX_CQ 128 | ||
48 | #define DFLT_COALESCE_WAIT 100 /* 100 usec wait for coalescing */ | 49 | #define DFLT_COALESCE_WAIT 100 /* 100 usec wait for coalescing */ |
49 | #define MAX_INTER_FRAME_WAIT 10 /* 10 usec max interframe-wait for coalescing */ | 50 | #define MAX_INTER_FRAME_WAIT 10 /* 10 usec max interframe-wait for coalescing */ |
50 | #define DFLT_INTER_FRAME_WAIT (MAX_INTER_FRAME_WAIT/2) | 51 | #define DFLT_INTER_FRAME_WAIT (MAX_INTER_FRAME_WAIT/2) |
@@ -786,12 +787,12 @@ struct mbox_params { | |||
786 | 787 | ||
787 | struct flash_params { | 788 | struct flash_params { |
788 | u8 dev_id_str[4]; | 789 | u8 dev_id_str[4]; |
789 | u16 size; | 790 | __le16 size; |
790 | u16 csum; | 791 | __le16 csum; |
791 | u16 ver; | 792 | __le16 ver; |
792 | u16 sub_dev_id; | 793 | __le16 sub_dev_id; |
793 | u8 mac_addr[6]; | 794 | u8 mac_addr[6]; |
794 | u16 res; | 795 | __le16 res; |
795 | }; | 796 | }; |
796 | 797 | ||
797 | 798 | ||
@@ -961,8 +962,7 @@ struct ib_mac_iocb_rsp { | |||
961 | #define IB_MAC_IOCB_RSP_DS 0x40 /* data is in small buffer */ | 962 | #define IB_MAC_IOCB_RSP_DS 0x40 /* data is in small buffer */ |
962 | #define IB_MAC_IOCB_RSP_DL 0x80 /* data is in large buffer */ | 963 | #define IB_MAC_IOCB_RSP_DL 0x80 /* data is in large buffer */ |
963 | __le32 data_len; /* */ | 964 | __le32 data_len; /* */ |
964 | __le32 data_addr_lo; /* */ | 965 | __le64 data_addr; /* */ |
965 | __le32 data_addr_hi; /* */ | ||
966 | __le32 rss; /* */ | 966 | __le32 rss; /* */ |
967 | __le16 vlan_id; /* 12 bits */ | 967 | __le16 vlan_id; /* 12 bits */ |
968 | #define IB_MAC_IOCB_RSP_C 0x1000 /* VLAN CFI bit */ | 968 | #define IB_MAC_IOCB_RSP_C 0x1000 /* VLAN CFI bit */ |
@@ -976,8 +976,7 @@ struct ib_mac_iocb_rsp { | |||
976 | #define IB_MAC_IOCB_RSP_HS 0x40 | 976 | #define IB_MAC_IOCB_RSP_HS 0x40 |
977 | #define IB_MAC_IOCB_RSP_HL 0x80 | 977 | #define IB_MAC_IOCB_RSP_HL 0x80 |
978 | __le32 hdr_len; /* */ | 978 | __le32 hdr_len; /* */ |
979 | __le32 hdr_addr_lo; /* */ | 979 | __le64 hdr_addr; /* */ |
980 | __le32 hdr_addr_hi; /* */ | ||
981 | } __attribute((packed)); | 980 | } __attribute((packed)); |
982 | 981 | ||
983 | struct ib_ae_iocb_rsp { | 982 | struct ib_ae_iocb_rsp { |
@@ -1042,10 +1041,8 @@ struct wqicb { | |||
1042 | __le16 cq_id_rss; | 1041 | __le16 cq_id_rss; |
1043 | #define Q_CQ_ID_RSS_RV 0x8000 | 1042 | #define Q_CQ_ID_RSS_RV 0x8000 |
1044 | __le16 rid; | 1043 | __le16 rid; |
1045 | __le32 addr_lo; | 1044 | __le64 addr; |
1046 | __le32 addr_hi; | 1045 | __le64 cnsmr_idx_addr; |
1047 | __le32 cnsmr_idx_addr_lo; | ||
1048 | __le32 cnsmr_idx_addr_hi; | ||
1049 | } __attribute((packed)); | 1046 | } __attribute((packed)); |
1050 | 1047 | ||
1051 | /* | 1048 | /* |
@@ -1070,18 +1067,14 @@ struct cqicb { | |||
1070 | #define LEN_CPP_64 0x0002 | 1067 | #define LEN_CPP_64 0x0002 |
1071 | #define LEN_CPP_128 0x0003 | 1068 | #define LEN_CPP_128 0x0003 |
1072 | __le16 rid; | 1069 | __le16 rid; |
1073 | __le32 addr_lo; | 1070 | __le64 addr; |
1074 | __le32 addr_hi; | 1071 | __le64 prod_idx_addr; |
1075 | __le32 prod_idx_addr_lo; | ||
1076 | __le32 prod_idx_addr_hi; | ||
1077 | __le16 pkt_delay; | 1072 | __le16 pkt_delay; |
1078 | __le16 irq_delay; | 1073 | __le16 irq_delay; |
1079 | __le32 lbq_addr_lo; | 1074 | __le64 lbq_addr; |
1080 | __le32 lbq_addr_hi; | ||
1081 | __le16 lbq_buf_size; | 1075 | __le16 lbq_buf_size; |
1082 | __le16 lbq_len; /* entry count */ | 1076 | __le16 lbq_len; /* entry count */ |
1083 | __le32 sbq_addr_lo; | 1077 | __le64 sbq_addr; |
1084 | __le32 sbq_addr_hi; | ||
1085 | __le16 sbq_buf_size; | 1078 | __le16 sbq_buf_size; |
1086 | __le16 sbq_len; /* entry count */ | 1079 | __le16 sbq_len; /* entry count */ |
1087 | } __attribute((packed)); | 1080 | } __attribute((packed)); |
@@ -1145,7 +1138,7 @@ struct tx_ring { | |||
1145 | struct wqicb wqicb; /* structure used to inform chip of new queue */ | 1138 | struct wqicb wqicb; /* structure used to inform chip of new queue */ |
1146 | void *wq_base; /* pci_alloc:virtual addr for tx */ | 1139 | void *wq_base; /* pci_alloc:virtual addr for tx */ |
1147 | dma_addr_t wq_base_dma; /* pci_alloc:dma addr for tx */ | 1140 | dma_addr_t wq_base_dma; /* pci_alloc:dma addr for tx */ |
1148 | u32 *cnsmr_idx_sh_reg; /* shadow copy of consumer idx */ | 1141 | __le32 *cnsmr_idx_sh_reg; /* shadow copy of consumer idx */ |
1149 | dma_addr_t cnsmr_idx_sh_reg_dma; /* dma-shadow copy of consumer */ | 1142 | dma_addr_t cnsmr_idx_sh_reg_dma; /* dma-shadow copy of consumer */ |
1150 | u32 wq_size; /* size in bytes of queue area */ | 1143 | u32 wq_size; /* size in bytes of queue area */ |
1151 | u32 wq_len; /* number of entries in queue */ | 1144 | u32 wq_len; /* number of entries in queue */ |
@@ -1181,7 +1174,7 @@ struct rx_ring { | |||
1181 | u32 cq_size; | 1174 | u32 cq_size; |
1182 | u32 cq_len; | 1175 | u32 cq_len; |
1183 | u16 cq_id; | 1176 | u16 cq_id; |
1184 | volatile __le32 *prod_idx_sh_reg; /* Shadowed producer register. */ | 1177 | __le32 *prod_idx_sh_reg; /* Shadowed producer register. */ |
1185 | dma_addr_t prod_idx_sh_reg_dma; | 1178 | dma_addr_t prod_idx_sh_reg_dma; |
1186 | void __iomem *cnsmr_idx_db_reg; /* PCI doorbell mem area + 0 */ | 1179 | void __iomem *cnsmr_idx_db_reg; /* PCI doorbell mem area + 0 */ |
1187 | u32 cnsmr_idx; /* current sw idx */ | 1180 | u32 cnsmr_idx; /* current sw idx */ |
@@ -1402,9 +1395,11 @@ struct ql_adapter { | |||
1402 | int rx_ring_count; | 1395 | int rx_ring_count; |
1403 | int ring_mem_size; | 1396 | int ring_mem_size; |
1404 | void *ring_mem; | 1397 | void *ring_mem; |
1405 | struct rx_ring *rx_ring; | 1398 | |
1399 | struct rx_ring rx_ring[MAX_RX_RINGS]; | ||
1400 | struct tx_ring tx_ring[MAX_TX_RINGS]; | ||
1401 | |||
1406 | int rx_csum; | 1402 | int rx_csum; |
1407 | struct tx_ring *tx_ring; | ||
1408 | u32 default_rx_queue; | 1403 | u32 default_rx_queue; |
1409 | 1404 | ||
1410 | u16 rx_coalesce_usecs; /* cqicb->int_delay */ | 1405 | u16 rx_coalesce_usecs; /* cqicb->int_delay */ |
@@ -1459,6 +1454,24 @@ static inline void ql_write_db_reg(u32 val, void __iomem *addr) | |||
1459 | mmiowb(); | 1454 | mmiowb(); |
1460 | } | 1455 | } |
1461 | 1456 | ||
1457 | /* | ||
1458 | * Shadow Registers: | ||
1459 | * Outbound queues have a consumer index that is maintained by the chip. | ||
1460 | * Inbound queues have a producer index that is maintained by the chip. | ||
1461 | * For lower overhead, these registers are "shadowed" to host memory | ||
1462 | * which allows the device driver to track the queue progress without | ||
1463 | * PCI reads. When an entry is placed on an inbound queue, the chip will | ||
1464 | * update the relevant index register and then copy the value to the | ||
1465 | * shadow register in host memory. | ||
1466 | */ | ||
1467 | static inline u32 ql_read_sh_reg(__le32 *addr) | ||
1468 | { | ||
1469 | u32 reg; | ||
1470 | reg = le32_to_cpu(*addr); | ||
1471 | rmb(); | ||
1472 | return reg; | ||
1473 | } | ||
1474 | |||
1462 | extern char qlge_driver_name[]; | 1475 | extern char qlge_driver_name[]; |
1463 | extern const char qlge_driver_version[]; | 1476 | extern const char qlge_driver_version[]; |
1464 | extern const struct ethtool_ops qlge_ethtool_ops; | 1477 | extern const struct ethtool_ops qlge_ethtool_ops; |
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c index 3f5e02d2e4a9..379b895ed6e6 100644 --- a/drivers/net/qlge/qlge_dbg.c +++ b/drivers/net/qlge/qlge_dbg.c | |||
@@ -435,14 +435,10 @@ void ql_dump_wqicb(struct wqicb *wqicb) | |||
435 | printk(KERN_ERR PFX "wqicb->cq_id_rss = %d.\n", | 435 | printk(KERN_ERR PFX "wqicb->cq_id_rss = %d.\n", |
436 | le16_to_cpu(wqicb->cq_id_rss)); | 436 | le16_to_cpu(wqicb->cq_id_rss)); |
437 | printk(KERN_ERR PFX "wqicb->rid = 0x%x.\n", le16_to_cpu(wqicb->rid)); | 437 | printk(KERN_ERR PFX "wqicb->rid = 0x%x.\n", le16_to_cpu(wqicb->rid)); |
438 | printk(KERN_ERR PFX "wqicb->wq_addr_lo = 0x%.08x.\n", | 438 | printk(KERN_ERR PFX "wqicb->wq_addr = 0x%llx.\n", |
439 | le32_to_cpu(wqicb->addr_lo)); | 439 | (unsigned long long) le64_to_cpu(wqicb->addr)); |
440 | printk(KERN_ERR PFX "wqicb->wq_addr_hi = 0x%.08x.\n", | 440 | printk(KERN_ERR PFX "wqicb->wq_cnsmr_idx_addr = 0x%llx.\n", |
441 | le32_to_cpu(wqicb->addr_hi)); | 441 | (unsigned long long) le64_to_cpu(wqicb->cnsmr_idx_addr)); |
442 | printk(KERN_ERR PFX "wqicb->wq_cnsmr_idx_addr_lo = 0x%.08x.\n", | ||
443 | le32_to_cpu(wqicb->cnsmr_idx_addr_lo)); | ||
444 | printk(KERN_ERR PFX "wqicb->wq_cnsmr_idx_addr_hi = 0x%.08x.\n", | ||
445 | le32_to_cpu(wqicb->cnsmr_idx_addr_hi)); | ||
446 | } | 442 | } |
447 | 443 | ||
448 | void ql_dump_tx_ring(struct tx_ring *tx_ring) | 444 | void ql_dump_tx_ring(struct tx_ring *tx_ring) |
@@ -455,10 +451,11 @@ void ql_dump_tx_ring(struct tx_ring *tx_ring) | |||
455 | printk(KERN_ERR PFX "tx_ring->base = %p.\n", tx_ring->wq_base); | 451 | printk(KERN_ERR PFX "tx_ring->base = %p.\n", tx_ring->wq_base); |
456 | printk(KERN_ERR PFX "tx_ring->base_dma = 0x%llx.\n", | 452 | printk(KERN_ERR PFX "tx_ring->base_dma = 0x%llx.\n", |
457 | (unsigned long long) tx_ring->wq_base_dma); | 453 | (unsigned long long) tx_ring->wq_base_dma); |
458 | printk(KERN_ERR PFX "tx_ring->cnsmr_idx_sh_reg = %p.\n", | 454 | printk(KERN_ERR PFX |
459 | tx_ring->cnsmr_idx_sh_reg); | 455 | "tx_ring->cnsmr_idx_sh_reg, addr = 0x%p, value = %d.\n", |
460 | printk(KERN_ERR PFX "tx_ring->cnsmr_idx_sh_reg_dma = 0x%llx.\n", | 456 | tx_ring->cnsmr_idx_sh_reg, |
461 | (unsigned long long) tx_ring->cnsmr_idx_sh_reg_dma); | 457 | tx_ring->cnsmr_idx_sh_reg |
458 | ? ql_read_sh_reg(tx_ring->cnsmr_idx_sh_reg) : 0); | ||
462 | printk(KERN_ERR PFX "tx_ring->size = %d.\n", tx_ring->wq_size); | 459 | printk(KERN_ERR PFX "tx_ring->size = %d.\n", tx_ring->wq_size); |
463 | printk(KERN_ERR PFX "tx_ring->len = %d.\n", tx_ring->wq_len); | 460 | printk(KERN_ERR PFX "tx_ring->len = %d.\n", tx_ring->wq_len); |
464 | printk(KERN_ERR PFX "tx_ring->prod_idx_db_reg = %p.\n", | 461 | printk(KERN_ERR PFX "tx_ring->prod_idx_db_reg = %p.\n", |
@@ -510,30 +507,22 @@ void ql_dump_cqicb(struct cqicb *cqicb) | |||
510 | printk(KERN_ERR PFX "cqicb->msix_vect = %d.\n", cqicb->msix_vect); | 507 | printk(KERN_ERR PFX "cqicb->msix_vect = %d.\n", cqicb->msix_vect); |
511 | printk(KERN_ERR PFX "cqicb->flags = %x.\n", cqicb->flags); | 508 | printk(KERN_ERR PFX "cqicb->flags = %x.\n", cqicb->flags); |
512 | printk(KERN_ERR PFX "cqicb->len = %d.\n", le16_to_cpu(cqicb->len)); | 509 | printk(KERN_ERR PFX "cqicb->len = %d.\n", le16_to_cpu(cqicb->len)); |
513 | printk(KERN_ERR PFX "cqicb->addr_lo = %x.\n", | 510 | printk(KERN_ERR PFX "cqicb->addr = 0x%llx.\n", |
514 | le32_to_cpu(cqicb->addr_lo)); | 511 | (unsigned long long) le64_to_cpu(cqicb->addr)); |
515 | printk(KERN_ERR PFX "cqicb->addr_hi = %x.\n", | 512 | printk(KERN_ERR PFX "cqicb->prod_idx_addr = 0x%llx.\n", |
516 | le32_to_cpu(cqicb->addr_hi)); | 513 | (unsigned long long) le64_to_cpu(cqicb->prod_idx_addr)); |
517 | printk(KERN_ERR PFX "cqicb->prod_idx_addr_lo = %x.\n", | ||
518 | le32_to_cpu(cqicb->prod_idx_addr_lo)); | ||
519 | printk(KERN_ERR PFX "cqicb->prod_idx_addr_hi = %x.\n", | ||
520 | le32_to_cpu(cqicb->prod_idx_addr_hi)); | ||
521 | printk(KERN_ERR PFX "cqicb->pkt_delay = 0x%.04x.\n", | 514 | printk(KERN_ERR PFX "cqicb->pkt_delay = 0x%.04x.\n", |
522 | le16_to_cpu(cqicb->pkt_delay)); | 515 | le16_to_cpu(cqicb->pkt_delay)); |
523 | printk(KERN_ERR PFX "cqicb->irq_delay = 0x%.04x.\n", | 516 | printk(KERN_ERR PFX "cqicb->irq_delay = 0x%.04x.\n", |
524 | le16_to_cpu(cqicb->irq_delay)); | 517 | le16_to_cpu(cqicb->irq_delay)); |
525 | printk(KERN_ERR PFX "cqicb->lbq_addr_lo = %x.\n", | 518 | printk(KERN_ERR PFX "cqicb->lbq_addr = 0x%llx.\n", |
526 | le32_to_cpu(cqicb->lbq_addr_lo)); | 519 | (unsigned long long) le64_to_cpu(cqicb->lbq_addr)); |
527 | printk(KERN_ERR PFX "cqicb->lbq_addr_hi = %x.\n", | ||
528 | le32_to_cpu(cqicb->lbq_addr_hi)); | ||
529 | printk(KERN_ERR PFX "cqicb->lbq_buf_size = 0x%.04x.\n", | 520 | printk(KERN_ERR PFX "cqicb->lbq_buf_size = 0x%.04x.\n", |
530 | le16_to_cpu(cqicb->lbq_buf_size)); | 521 | le16_to_cpu(cqicb->lbq_buf_size)); |
531 | printk(KERN_ERR PFX "cqicb->lbq_len = 0x%.04x.\n", | 522 | printk(KERN_ERR PFX "cqicb->lbq_len = 0x%.04x.\n", |
532 | le16_to_cpu(cqicb->lbq_len)); | 523 | le16_to_cpu(cqicb->lbq_len)); |
533 | printk(KERN_ERR PFX "cqicb->sbq_addr_lo = %x.\n", | 524 | printk(KERN_ERR PFX "cqicb->sbq_addr = 0x%llx.\n", |
534 | le32_to_cpu(cqicb->sbq_addr_lo)); | 525 | (unsigned long long) le64_to_cpu(cqicb->sbq_addr)); |
535 | printk(KERN_ERR PFX "cqicb->sbq_addr_hi = %x.\n", | ||
536 | le32_to_cpu(cqicb->sbq_addr_hi)); | ||
537 | printk(KERN_ERR PFX "cqicb->sbq_buf_size = 0x%.04x.\n", | 526 | printk(KERN_ERR PFX "cqicb->sbq_buf_size = 0x%.04x.\n", |
538 | le16_to_cpu(cqicb->sbq_buf_size)); | 527 | le16_to_cpu(cqicb->sbq_buf_size)); |
539 | printk(KERN_ERR PFX "cqicb->sbq_len = 0x%.04x.\n", | 528 | printk(KERN_ERR PFX "cqicb->sbq_len = 0x%.04x.\n", |
@@ -558,9 +547,10 @@ void ql_dump_rx_ring(struct rx_ring *rx_ring) | |||
558 | printk(KERN_ERR PFX "rx_ring->cq_size = %d.\n", rx_ring->cq_size); | 547 | printk(KERN_ERR PFX "rx_ring->cq_size = %d.\n", rx_ring->cq_size); |
559 | printk(KERN_ERR PFX "rx_ring->cq_len = %d.\n", rx_ring->cq_len); | 548 | printk(KERN_ERR PFX "rx_ring->cq_len = %d.\n", rx_ring->cq_len); |
560 | printk(KERN_ERR PFX | 549 | printk(KERN_ERR PFX |
561 | "rx_ring->prod_idx_sh_reg, addr = %p, value = %d.\n", | 550 | "rx_ring->prod_idx_sh_reg, addr = 0x%p, value = %d.\n", |
562 | rx_ring->prod_idx_sh_reg, | 551 | rx_ring->prod_idx_sh_reg, |
563 | rx_ring->prod_idx_sh_reg ? *(rx_ring->prod_idx_sh_reg) : 0); | 552 | rx_ring->prod_idx_sh_reg |
553 | ? ql_read_sh_reg(rx_ring->prod_idx_sh_reg) : 0); | ||
564 | printk(KERN_ERR PFX "rx_ring->prod_idx_sh_reg_dma = %llx.\n", | 554 | printk(KERN_ERR PFX "rx_ring->prod_idx_sh_reg_dma = %llx.\n", |
565 | (unsigned long long) rx_ring->prod_idx_sh_reg_dma); | 555 | (unsigned long long) rx_ring->prod_idx_sh_reg_dma); |
566 | printk(KERN_ERR PFX "rx_ring->cnsmr_idx_db_reg = %p.\n", | 556 | printk(KERN_ERR PFX "rx_ring->cnsmr_idx_db_reg = %p.\n", |
@@ -809,10 +799,8 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp) | |||
809 | 799 | ||
810 | printk(KERN_ERR PFX "data_len = %d\n", | 800 | printk(KERN_ERR PFX "data_len = %d\n", |
811 | le32_to_cpu(ib_mac_rsp->data_len)); | 801 | le32_to_cpu(ib_mac_rsp->data_len)); |
812 | printk(KERN_ERR PFX "data_addr_hi = 0x%x\n", | 802 | printk(KERN_ERR PFX "data_addr = 0x%llx\n", |
813 | le32_to_cpu(ib_mac_rsp->data_addr_hi)); | 803 | (unsigned long long) le64_to_cpu(ib_mac_rsp->data_addr)); |
814 | printk(KERN_ERR PFX "data_addr_lo = 0x%x\n", | ||
815 | le32_to_cpu(ib_mac_rsp->data_addr_lo)); | ||
816 | if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) | 804 | if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) |
817 | printk(KERN_ERR PFX "rss = %x\n", | 805 | printk(KERN_ERR PFX "rss = %x\n", |
818 | le32_to_cpu(ib_mac_rsp->rss)); | 806 | le32_to_cpu(ib_mac_rsp->rss)); |
@@ -828,10 +816,8 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp) | |||
828 | if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { | 816 | if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { |
829 | printk(KERN_ERR PFX "hdr length = %d.\n", | 817 | printk(KERN_ERR PFX "hdr length = %d.\n", |
830 | le32_to_cpu(ib_mac_rsp->hdr_len)); | 818 | le32_to_cpu(ib_mac_rsp->hdr_len)); |
831 | printk(KERN_ERR PFX "hdr addr_hi = 0x%x.\n", | 819 | printk(KERN_ERR PFX "hdr addr = 0x%llx.\n", |
832 | le32_to_cpu(ib_mac_rsp->hdr_addr_hi)); | 820 | (unsigned long long) le64_to_cpu(ib_mac_rsp->hdr_addr)); |
833 | printk(KERN_ERR PFX "hdr addr_lo = 0x%x.\n", | ||
834 | le32_to_cpu(ib_mac_rsp->hdr_addr_lo)); | ||
835 | } | 821 | } |
836 | } | 822 | } |
837 | #endif | 823 | #endif |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index f4c016012f18..3d1d7b6e55aa 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -76,7 +76,6 @@ MODULE_PARM_DESC(irq_type, "0 = MSI-X, 1 = MSI, 2 = Legacy."); | |||
76 | 76 | ||
77 | static struct pci_device_id qlge_pci_tbl[] __devinitdata = { | 77 | static struct pci_device_id qlge_pci_tbl[] __devinitdata = { |
78 | {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QLGE_DEVICE_ID)}, | 78 | {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QLGE_DEVICE_ID)}, |
79 | {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QLGE_DEVICE_ID1)}, | ||
80 | /* required last entry */ | 79 | /* required last entry */ |
81 | {0,} | 80 | {0,} |
82 | }; | 81 | }; |
@@ -127,12 +126,12 @@ static int ql_sem_trylock(struct ql_adapter *qdev, u32 sem_mask) | |||
127 | 126 | ||
128 | int ql_sem_spinlock(struct ql_adapter *qdev, u32 sem_mask) | 127 | int ql_sem_spinlock(struct ql_adapter *qdev, u32 sem_mask) |
129 | { | 128 | { |
130 | unsigned int seconds = 3; | 129 | unsigned int wait_count = 30; |
131 | do { | 130 | do { |
132 | if (!ql_sem_trylock(qdev, sem_mask)) | 131 | if (!ql_sem_trylock(qdev, sem_mask)) |
133 | return 0; | 132 | return 0; |
134 | ssleep(1); | 133 | udelay(100); |
135 | } while (--seconds); | 134 | } while (--wait_count); |
136 | return -ETIMEDOUT; | 135 | return -ETIMEDOUT; |
137 | } | 136 | } |
138 | 137 | ||
@@ -642,7 +641,7 @@ static void ql_enable_all_completion_interrupts(struct ql_adapter *qdev) | |||
642 | 641 | ||
643 | } | 642 | } |
644 | 643 | ||
645 | static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data) | 644 | static int ql_read_flash_word(struct ql_adapter *qdev, int offset, __le32 *data) |
646 | { | 645 | { |
647 | int status = 0; | 646 | int status = 0; |
648 | /* wait for reg to come ready */ | 647 | /* wait for reg to come ready */ |
@@ -657,8 +656,11 @@ static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data) | |||
657 | FLASH_ADDR, FLASH_ADDR_RDY, FLASH_ADDR_ERR); | 656 | FLASH_ADDR, FLASH_ADDR_RDY, FLASH_ADDR_ERR); |
658 | if (status) | 657 | if (status) |
659 | goto exit; | 658 | goto exit; |
660 | /* get the data */ | 659 | /* This data is stored on flash as an array of |
661 | *data = ql_read32(qdev, FLASH_DATA); | 660 | * __le32. Since ql_read32() returns cpu endian |
661 | * we need to swap it back. | ||
662 | */ | ||
663 | *data = cpu_to_le32(ql_read32(qdev, FLASH_DATA)); | ||
662 | exit: | 664 | exit: |
663 | return status; | 665 | return status; |
664 | } | 666 | } |
@@ -667,13 +669,20 @@ static int ql_get_flash_params(struct ql_adapter *qdev) | |||
667 | { | 669 | { |
668 | int i; | 670 | int i; |
669 | int status; | 671 | int status; |
670 | u32 *p = (u32 *)&qdev->flash; | 672 | __le32 *p = (__le32 *)&qdev->flash; |
673 | u32 offset = 0; | ||
674 | |||
675 | /* Second function's parameters follow the first | ||
676 | * function's. | ||
677 | */ | ||
678 | if (qdev->func) | ||
679 | offset = sizeof(qdev->flash) / sizeof(u32); | ||
671 | 680 | ||
672 | if (ql_sem_spinlock(qdev, SEM_FLASH_MASK)) | 681 | if (ql_sem_spinlock(qdev, SEM_FLASH_MASK)) |
673 | return -ETIMEDOUT; | 682 | return -ETIMEDOUT; |
674 | 683 | ||
675 | for (i = 0; i < sizeof(qdev->flash) / sizeof(u32); i++, p++) { | 684 | for (i = 0; i < sizeof(qdev->flash) / sizeof(u32); i++, p++) { |
676 | status = ql_read_flash_word(qdev, i, p); | 685 | status = ql_read_flash_word(qdev, i+offset, p); |
677 | if (status) { | 686 | if (status) { |
678 | QPRINTK(qdev, IFUP, ERR, "Error reading flash.\n"); | 687 | QPRINTK(qdev, IFUP, ERR, "Error reading flash.\n"); |
679 | goto exit; | 688 | goto exit; |
@@ -1545,7 +1554,7 @@ static void ql_process_chip_ae_intr(struct ql_adapter *qdev, | |||
1545 | static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) | 1554 | static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) |
1546 | { | 1555 | { |
1547 | struct ql_adapter *qdev = rx_ring->qdev; | 1556 | struct ql_adapter *qdev = rx_ring->qdev; |
1548 | u32 prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); | 1557 | u32 prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); |
1549 | struct ob_mac_iocb_rsp *net_rsp = NULL; | 1558 | struct ob_mac_iocb_rsp *net_rsp = NULL; |
1550 | int count = 0; | 1559 | int count = 0; |
1551 | 1560 | ||
@@ -1571,7 +1580,7 @@ static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) | |||
1571 | } | 1580 | } |
1572 | count++; | 1581 | count++; |
1573 | ql_update_cq(rx_ring); | 1582 | ql_update_cq(rx_ring); |
1574 | prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); | 1583 | prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); |
1575 | } | 1584 | } |
1576 | ql_write_cq_idx(rx_ring); | 1585 | ql_write_cq_idx(rx_ring); |
1577 | if (netif_queue_stopped(qdev->ndev) && net_rsp != NULL) { | 1586 | if (netif_queue_stopped(qdev->ndev) && net_rsp != NULL) { |
@@ -1591,7 +1600,7 @@ static int ql_clean_outbound_rx_ring(struct rx_ring *rx_ring) | |||
1591 | static int ql_clean_inbound_rx_ring(struct rx_ring *rx_ring, int budget) | 1600 | static int ql_clean_inbound_rx_ring(struct rx_ring *rx_ring, int budget) |
1592 | { | 1601 | { |
1593 | struct ql_adapter *qdev = rx_ring->qdev; | 1602 | struct ql_adapter *qdev = rx_ring->qdev; |
1594 | u32 prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); | 1603 | u32 prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); |
1595 | struct ql_net_rsp_iocb *net_rsp; | 1604 | struct ql_net_rsp_iocb *net_rsp; |
1596 | int count = 0; | 1605 | int count = 0; |
1597 | 1606 | ||
@@ -1624,7 +1633,7 @@ static int ql_clean_inbound_rx_ring(struct rx_ring *rx_ring, int budget) | |||
1624 | } | 1633 | } |
1625 | count++; | 1634 | count++; |
1626 | ql_update_cq(rx_ring); | 1635 | ql_update_cq(rx_ring); |
1627 | prod = le32_to_cpu(*rx_ring->prod_idx_sh_reg); | 1636 | prod = ql_read_sh_reg(rx_ring->prod_idx_sh_reg); |
1628 | if (count == budget) | 1637 | if (count == budget) |
1629 | break; | 1638 | break; |
1630 | } | 1639 | } |
@@ -1787,7 +1796,7 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
1787 | * Check the default queue and wake handler if active. | 1796 | * Check the default queue and wake handler if active. |
1788 | */ | 1797 | */ |
1789 | rx_ring = &qdev->rx_ring[0]; | 1798 | rx_ring = &qdev->rx_ring[0]; |
1790 | if (le32_to_cpu(*rx_ring->prod_idx_sh_reg) != rx_ring->cnsmr_idx) { | 1799 | if (ql_read_sh_reg(rx_ring->prod_idx_sh_reg) != rx_ring->cnsmr_idx) { |
1791 | QPRINTK(qdev, INTR, INFO, "Waking handler for rx_ring[0].\n"); | 1800 | QPRINTK(qdev, INTR, INFO, "Waking handler for rx_ring[0].\n"); |
1792 | ql_disable_completion_interrupt(qdev, intr_context->intr); | 1801 | ql_disable_completion_interrupt(qdev, intr_context->intr); |
1793 | queue_delayed_work_on(smp_processor_id(), qdev->q_workqueue, | 1802 | queue_delayed_work_on(smp_processor_id(), qdev->q_workqueue, |
@@ -1801,7 +1810,7 @@ static irqreturn_t qlge_isr(int irq, void *dev_id) | |||
1801 | */ | 1810 | */ |
1802 | for (i = 1; i < qdev->rx_ring_count; i++) { | 1811 | for (i = 1; i < qdev->rx_ring_count; i++) { |
1803 | rx_ring = &qdev->rx_ring[i]; | 1812 | rx_ring = &qdev->rx_ring[i]; |
1804 | if (le32_to_cpu(*rx_ring->prod_idx_sh_reg) != | 1813 | if (ql_read_sh_reg(rx_ring->prod_idx_sh_reg) != |
1805 | rx_ring->cnsmr_idx) { | 1814 | rx_ring->cnsmr_idx) { |
1806 | QPRINTK(qdev, INTR, INFO, | 1815 | QPRINTK(qdev, INTR, INFO, |
1807 | "Waking handler for rx_ring[%d].\n", i); | 1816 | "Waking handler for rx_ring[%d].\n", i); |
@@ -2356,28 +2365,6 @@ static void ql_tx_ring_clean(struct ql_adapter *qdev) | |||
2356 | } | 2365 | } |
2357 | } | 2366 | } |
2358 | 2367 | ||
2359 | static void ql_free_ring_cb(struct ql_adapter *qdev) | ||
2360 | { | ||
2361 | kfree(qdev->ring_mem); | ||
2362 | } | ||
2363 | |||
2364 | static int ql_alloc_ring_cb(struct ql_adapter *qdev) | ||
2365 | { | ||
2366 | /* Allocate space for tx/rx ring control blocks. */ | ||
2367 | qdev->ring_mem_size = | ||
2368 | (qdev->tx_ring_count * sizeof(struct tx_ring)) + | ||
2369 | (qdev->rx_ring_count * sizeof(struct rx_ring)); | ||
2370 | qdev->ring_mem = kmalloc(qdev->ring_mem_size, GFP_KERNEL); | ||
2371 | if (qdev->ring_mem == NULL) { | ||
2372 | return -ENOMEM; | ||
2373 | } else { | ||
2374 | qdev->rx_ring = qdev->ring_mem; | ||
2375 | qdev->tx_ring = qdev->ring_mem + | ||
2376 | (qdev->rx_ring_count * sizeof(struct rx_ring)); | ||
2377 | } | ||
2378 | return 0; | ||
2379 | } | ||
2380 | |||
2381 | static void ql_free_mem_resources(struct ql_adapter *qdev) | 2368 | static void ql_free_mem_resources(struct ql_adapter *qdev) |
2382 | { | 2369 | { |
2383 | int i; | 2370 | int i; |
@@ -2467,12 +2454,9 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2467 | bq_len = (rx_ring->cq_len == 65536) ? 0 : (u16) rx_ring->cq_len; | 2454 | bq_len = (rx_ring->cq_len == 65536) ? 0 : (u16) rx_ring->cq_len; |
2468 | cqicb->len = cpu_to_le16(bq_len | LEN_V | LEN_CPP_CONT); | 2455 | cqicb->len = cpu_to_le16(bq_len | LEN_V | LEN_CPP_CONT); |
2469 | 2456 | ||
2470 | cqicb->addr_lo = cpu_to_le32(rx_ring->cq_base_dma); | 2457 | cqicb->addr = cpu_to_le64(rx_ring->cq_base_dma); |
2471 | cqicb->addr_hi = cpu_to_le32((u64) rx_ring->cq_base_dma >> 32); | ||
2472 | 2458 | ||
2473 | cqicb->prod_idx_addr_lo = cpu_to_le32(rx_ring->prod_idx_sh_reg_dma); | 2459 | cqicb->prod_idx_addr = cpu_to_le64(rx_ring->prod_idx_sh_reg_dma); |
2474 | cqicb->prod_idx_addr_hi = | ||
2475 | cpu_to_le32((u64) rx_ring->prod_idx_sh_reg_dma >> 32); | ||
2476 | 2460 | ||
2477 | /* | 2461 | /* |
2478 | * Set up the control block load flags. | 2462 | * Set up the control block load flags. |
@@ -2483,10 +2467,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2483 | if (rx_ring->lbq_len) { | 2467 | if (rx_ring->lbq_len) { |
2484 | cqicb->flags |= FLAGS_LL; /* Load lbq values */ | 2468 | cqicb->flags |= FLAGS_LL; /* Load lbq values */ |
2485 | *((u64 *) rx_ring->lbq_base_indirect) = rx_ring->lbq_base_dma; | 2469 | *((u64 *) rx_ring->lbq_base_indirect) = rx_ring->lbq_base_dma; |
2486 | cqicb->lbq_addr_lo = | 2470 | cqicb->lbq_addr = |
2487 | cpu_to_le32(rx_ring->lbq_base_indirect_dma); | 2471 | cpu_to_le64(rx_ring->lbq_base_indirect_dma); |
2488 | cqicb->lbq_addr_hi = | ||
2489 | cpu_to_le32((u64) rx_ring->lbq_base_indirect_dma >> 32); | ||
2490 | bq_len = (rx_ring->lbq_buf_size == 65536) ? 0 : | 2472 | bq_len = (rx_ring->lbq_buf_size == 65536) ? 0 : |
2491 | (u16) rx_ring->lbq_buf_size; | 2473 | (u16) rx_ring->lbq_buf_size; |
2492 | cqicb->lbq_buf_size = cpu_to_le16(bq_len); | 2474 | cqicb->lbq_buf_size = cpu_to_le16(bq_len); |
@@ -2501,10 +2483,8 @@ static int ql_start_rx_ring(struct ql_adapter *qdev, struct rx_ring *rx_ring) | |||
2501 | if (rx_ring->sbq_len) { | 2483 | if (rx_ring->sbq_len) { |
2502 | cqicb->flags |= FLAGS_LS; /* Load sbq values */ | 2484 | cqicb->flags |= FLAGS_LS; /* Load sbq values */ |
2503 | *((u64 *) rx_ring->sbq_base_indirect) = rx_ring->sbq_base_dma; | 2485 | *((u64 *) rx_ring->sbq_base_indirect) = rx_ring->sbq_base_dma; |
2504 | cqicb->sbq_addr_lo = | 2486 | cqicb->sbq_addr = |
2505 | cpu_to_le32(rx_ring->sbq_base_indirect_dma); | 2487 | cpu_to_le64(rx_ring->sbq_base_indirect_dma); |
2506 | cqicb->sbq_addr_hi = | ||
2507 | cpu_to_le32((u64) rx_ring->sbq_base_indirect_dma >> 32); | ||
2508 | cqicb->sbq_buf_size = | 2488 | cqicb->sbq_buf_size = |
2509 | cpu_to_le16(((rx_ring->sbq_buf_size / 2) + 8) & 0xfffffff8); | 2489 | cpu_to_le16(((rx_ring->sbq_buf_size / 2) + 8) & 0xfffffff8); |
2510 | bq_len = (rx_ring->sbq_len == 65536) ? 0 : | 2490 | bq_len = (rx_ring->sbq_len == 65536) ? 0 : |
@@ -2611,12 +2591,9 @@ static int ql_start_tx_ring(struct ql_adapter *qdev, struct tx_ring *tx_ring) | |||
2611 | Q_FLAGS_LB | Q_FLAGS_LI | Q_FLAGS_LO); | 2591 | Q_FLAGS_LB | Q_FLAGS_LI | Q_FLAGS_LO); |
2612 | wqicb->cq_id_rss = cpu_to_le16(tx_ring->cq_id); | 2592 | wqicb->cq_id_rss = cpu_to_le16(tx_ring->cq_id); |
2613 | wqicb->rid = 0; | 2593 | wqicb->rid = 0; |
2614 | wqicb->addr_lo = cpu_to_le32(tx_ring->wq_base_dma); | 2594 | wqicb->addr = cpu_to_le64(tx_ring->wq_base_dma); |
2615 | wqicb->addr_hi = cpu_to_le32((u64) tx_ring->wq_base_dma >> 32); | ||
2616 | 2595 | ||
2617 | wqicb->cnsmr_idx_addr_lo = cpu_to_le32(tx_ring->cnsmr_idx_sh_reg_dma); | 2596 | wqicb->cnsmr_idx_addr = cpu_to_le64(tx_ring->cnsmr_idx_sh_reg_dma); |
2618 | wqicb->cnsmr_idx_addr_hi = | ||
2619 | cpu_to_le32((u64) tx_ring->cnsmr_idx_sh_reg_dma >> 32); | ||
2620 | 2597 | ||
2621 | ql_init_tx_ring(qdev, tx_ring); | 2598 | ql_init_tx_ring(qdev, tx_ring); |
2622 | 2599 | ||
@@ -2746,14 +2723,14 @@ static void ql_resolve_queues_to_irqs(struct ql_adapter *qdev) | |||
2746 | * Outbound queue is for outbound completions only. | 2723 | * Outbound queue is for outbound completions only. |
2747 | */ | 2724 | */ |
2748 | intr_context->handler = qlge_msix_tx_isr; | 2725 | intr_context->handler = qlge_msix_tx_isr; |
2749 | sprintf(intr_context->name, "%s-txq-%d", | 2726 | sprintf(intr_context->name, "%s-tx-%d", |
2750 | qdev->ndev->name, i); | 2727 | qdev->ndev->name, i); |
2751 | } else { | 2728 | } else { |
2752 | /* | 2729 | /* |
2753 | * Inbound queues handle unicast frames only. | 2730 | * Inbound queues handle unicast frames only. |
2754 | */ | 2731 | */ |
2755 | intr_context->handler = qlge_msix_rx_isr; | 2732 | intr_context->handler = qlge_msix_rx_isr; |
2756 | sprintf(intr_context->name, "%s-rxq-%d", | 2733 | sprintf(intr_context->name, "%s-rx-%d", |
2757 | qdev->ndev->name, i); | 2734 | qdev->ndev->name, i); |
2758 | } | 2735 | } |
2759 | } | 2736 | } |
@@ -3247,7 +3224,6 @@ static int qlge_close(struct net_device *ndev) | |||
3247 | msleep(1); | 3224 | msleep(1); |
3248 | ql_adapter_down(qdev); | 3225 | ql_adapter_down(qdev); |
3249 | ql_release_adapter_resources(qdev); | 3226 | ql_release_adapter_resources(qdev); |
3250 | ql_free_ring_cb(qdev); | ||
3251 | return 0; | 3227 | return 0; |
3252 | } | 3228 | } |
3253 | 3229 | ||
@@ -3273,8 +3249,8 @@ static int ql_configure_rings(struct ql_adapter *qdev) | |||
3273 | * This limitation can be removed when requested. | 3249 | * This limitation can be removed when requested. |
3274 | */ | 3250 | */ |
3275 | 3251 | ||
3276 | if (cpu_cnt > 8) | 3252 | if (cpu_cnt > MAX_CPUS) |
3277 | cpu_cnt = 8; | 3253 | cpu_cnt = MAX_CPUS; |
3278 | 3254 | ||
3279 | /* | 3255 | /* |
3280 | * rx_ring[0] is always the default queue. | 3256 | * rx_ring[0] is always the default queue. |
@@ -3294,9 +3270,6 @@ static int ql_configure_rings(struct ql_adapter *qdev) | |||
3294 | */ | 3270 | */ |
3295 | qdev->rx_ring_count = qdev->tx_ring_count + qdev->rss_ring_count + 1; | 3271 | qdev->rx_ring_count = qdev->tx_ring_count + qdev->rss_ring_count + 1; |
3296 | 3272 | ||
3297 | if (ql_alloc_ring_cb(qdev)) | ||
3298 | return -ENOMEM; | ||
3299 | |||
3300 | for (i = 0; i < qdev->tx_ring_count; i++) { | 3273 | for (i = 0; i < qdev->tx_ring_count; i++) { |
3301 | tx_ring = &qdev->tx_ring[i]; | 3274 | tx_ring = &qdev->tx_ring[i]; |
3302 | memset((void *)tx_ring, 0, sizeof(tx_ring)); | 3275 | memset((void *)tx_ring, 0, sizeof(tx_ring)); |
@@ -3393,7 +3366,6 @@ static int qlge_open(struct net_device *ndev) | |||
3393 | 3366 | ||
3394 | error_up: | 3367 | error_up: |
3395 | ql_release_adapter_resources(qdev); | 3368 | ql_release_adapter_resources(qdev); |
3396 | ql_free_ring_cb(qdev); | ||
3397 | return err; | 3369 | return err; |
3398 | } | 3370 | } |
3399 | 3371 | ||
@@ -3864,7 +3836,7 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3864 | { | 3836 | { |
3865 | struct net_device *ndev = pci_get_drvdata(pdev); | 3837 | struct net_device *ndev = pci_get_drvdata(pdev); |
3866 | struct ql_adapter *qdev = netdev_priv(ndev); | 3838 | struct ql_adapter *qdev = netdev_priv(ndev); |
3867 | int err; | 3839 | int err, i; |
3868 | 3840 | ||
3869 | netif_device_detach(ndev); | 3841 | netif_device_detach(ndev); |
3870 | 3842 | ||
@@ -3874,6 +3846,9 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state) | |||
3874 | return err; | 3846 | return err; |
3875 | } | 3847 | } |
3876 | 3848 | ||
3849 | for (i = qdev->rss_ring_first_cq_id; i < qdev->rx_ring_count; i++) | ||
3850 | netif_napi_del(&qdev->rx_ring[i].napi); | ||
3851 | |||
3877 | err = pci_save_state(pdev); | 3852 | err = pci_save_state(pdev); |
3878 | if (err) | 3853 | if (err) |
3879 | return err; | 3854 | return err; |
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c index cf3a082bc89d..b2dcdb5ed8bd 100644 --- a/drivers/net/r6040.c +++ b/drivers/net/r6040.c | |||
@@ -49,8 +49,8 @@ | |||
49 | #include <asm/processor.h> | 49 | #include <asm/processor.h> |
50 | 50 | ||
51 | #define DRV_NAME "r6040" | 51 | #define DRV_NAME "r6040" |
52 | #define DRV_VERSION "0.20" | 52 | #define DRV_VERSION "0.21" |
53 | #define DRV_RELDATE "07Jan2009" | 53 | #define DRV_RELDATE "09Jan2009" |
54 | 54 | ||
55 | /* PHY CHIP Address */ | 55 | /* PHY CHIP Address */ |
56 | #define PHY1_ADDR 1 /* For MAC1 */ | 56 | #define PHY1_ADDR 1 /* For MAC1 */ |
@@ -438,7 +438,6 @@ static void r6040_down(struct net_device *dev) | |||
438 | { | 438 | { |
439 | struct r6040_private *lp = netdev_priv(dev); | 439 | struct r6040_private *lp = netdev_priv(dev); |
440 | void __iomem *ioaddr = lp->base; | 440 | void __iomem *ioaddr = lp->base; |
441 | struct pci_dev *pdev = lp->pdev; | ||
442 | int limit = 2048; | 441 | int limit = 2048; |
443 | u16 *adrp; | 442 | u16 *adrp; |
444 | u16 cmd; | 443 | u16 cmd; |
@@ -457,22 +456,12 @@ static void r6040_down(struct net_device *dev) | |||
457 | iowrite16(adrp[0], ioaddr + MID_0L); | 456 | iowrite16(adrp[0], ioaddr + MID_0L); |
458 | iowrite16(adrp[1], ioaddr + MID_0M); | 457 | iowrite16(adrp[1], ioaddr + MID_0M); |
459 | iowrite16(adrp[2], ioaddr + MID_0H); | 458 | iowrite16(adrp[2], ioaddr + MID_0H); |
460 | free_irq(dev->irq, dev); | ||
461 | |||
462 | /* Free RX buffer */ | ||
463 | r6040_free_rxbufs(dev); | ||
464 | |||
465 | /* Free TX buffer */ | ||
466 | r6040_free_txbufs(dev); | ||
467 | |||
468 | /* Free Descriptor memory */ | ||
469 | pci_free_consistent(pdev, RX_DESC_SIZE, lp->rx_ring, lp->rx_ring_dma); | ||
470 | pci_free_consistent(pdev, TX_DESC_SIZE, lp->tx_ring, lp->tx_ring_dma); | ||
471 | } | 459 | } |
472 | 460 | ||
473 | static int r6040_close(struct net_device *dev) | 461 | static int r6040_close(struct net_device *dev) |
474 | { | 462 | { |
475 | struct r6040_private *lp = netdev_priv(dev); | 463 | struct r6040_private *lp = netdev_priv(dev); |
464 | struct pci_dev *pdev = lp->pdev; | ||
476 | 465 | ||
477 | /* deleted timer */ | 466 | /* deleted timer */ |
478 | del_timer_sync(&lp->timer); | 467 | del_timer_sync(&lp->timer); |
@@ -481,8 +470,28 @@ static int r6040_close(struct net_device *dev) | |||
481 | napi_disable(&lp->napi); | 470 | napi_disable(&lp->napi); |
482 | netif_stop_queue(dev); | 471 | netif_stop_queue(dev); |
483 | r6040_down(dev); | 472 | r6040_down(dev); |
473 | |||
474 | free_irq(dev->irq, dev); | ||
475 | |||
476 | /* Free RX buffer */ | ||
477 | r6040_free_rxbufs(dev); | ||
478 | |||
479 | /* Free TX buffer */ | ||
480 | r6040_free_txbufs(dev); | ||
481 | |||
484 | spin_unlock_irq(&lp->lock); | 482 | spin_unlock_irq(&lp->lock); |
485 | 483 | ||
484 | /* Free Descriptor memory */ | ||
485 | if (lp->rx_ring) { | ||
486 | pci_free_consistent(pdev, RX_DESC_SIZE, lp->rx_ring, lp->rx_ring_dma); | ||
487 | lp->rx_ring = 0; | ||
488 | } | ||
489 | |||
490 | if (lp->tx_ring) { | ||
491 | pci_free_consistent(pdev, TX_DESC_SIZE, lp->tx_ring, lp->tx_ring_dma); | ||
492 | lp->tx_ring = 0; | ||
493 | } | ||
494 | |||
486 | return 0; | 495 | return 0; |
487 | } | 496 | } |
488 | 497 | ||
@@ -1049,6 +1058,7 @@ static const struct net_device_ops r6040_netdev_ops = { | |||
1049 | .ndo_set_multicast_list = r6040_multicast_list, | 1058 | .ndo_set_multicast_list = r6040_multicast_list, |
1050 | .ndo_change_mtu = eth_change_mtu, | 1059 | .ndo_change_mtu = eth_change_mtu, |
1051 | .ndo_validate_addr = eth_validate_addr, | 1060 | .ndo_validate_addr = eth_validate_addr, |
1061 | .ndo_set_mac_address = eth_mac_addr, | ||
1052 | .ndo_do_ioctl = r6040_ioctl, | 1062 | .ndo_do_ioctl = r6040_ioctl, |
1053 | .ndo_tx_timeout = r6040_tx_timeout, | 1063 | .ndo_tx_timeout = r6040_tx_timeout, |
1054 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1064 | #ifdef CONFIG_NET_POLL_CONTROLLER |
@@ -1143,8 +1153,10 @@ static int __devinit r6040_init_one(struct pci_dev *pdev, | |||
1143 | 1153 | ||
1144 | /* Some bootloader/BIOSes do not initialize | 1154 | /* Some bootloader/BIOSes do not initialize |
1145 | * MAC address, warn about that */ | 1155 | * MAC address, warn about that */ |
1146 | if (!(adrp[0] || adrp[1] || adrp[2])) | 1156 | if (!(adrp[0] || adrp[1] || adrp[2])) { |
1147 | printk(KERN_WARNING DRV_NAME ": MAC address not initialized\n"); | 1157 | printk(KERN_WARNING DRV_NAME ": MAC address not initialized, generating random\n"); |
1158 | random_ether_addr(dev->dev_addr); | ||
1159 | } | ||
1148 | 1160 | ||
1149 | /* Link new device into r6040_root_dev */ | 1161 | /* Link new device into r6040_root_dev */ |
1150 | lp->pdev = pdev; | 1162 | lp->pdev = pdev; |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 2c73ca606b35..0771eb6fc6eb 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -437,6 +437,22 @@ enum features { | |||
437 | RTL_FEATURE_GMII = (1 << 2), | 437 | RTL_FEATURE_GMII = (1 << 2), |
438 | }; | 438 | }; |
439 | 439 | ||
440 | struct rtl8169_counters { | ||
441 | __le64 tx_packets; | ||
442 | __le64 rx_packets; | ||
443 | __le64 tx_errors; | ||
444 | __le32 rx_errors; | ||
445 | __le16 rx_missed; | ||
446 | __le16 align_errors; | ||
447 | __le32 tx_one_collision; | ||
448 | __le32 tx_multi_collision; | ||
449 | __le64 rx_unicast; | ||
450 | __le64 rx_broadcast; | ||
451 | __le32 rx_multicast; | ||
452 | __le16 tx_aborted; | ||
453 | __le16 tx_underun; | ||
454 | }; | ||
455 | |||
440 | struct rtl8169_private { | 456 | struct rtl8169_private { |
441 | void __iomem *mmio_addr; /* memory map physical address */ | 457 | void __iomem *mmio_addr; /* memory map physical address */ |
442 | struct pci_dev *pci_dev; /* Index of PCI device */ | 458 | struct pci_dev *pci_dev; /* Index of PCI device */ |
@@ -480,6 +496,7 @@ struct rtl8169_private { | |||
480 | unsigned features; | 496 | unsigned features; |
481 | 497 | ||
482 | struct mii_if_info mii; | 498 | struct mii_if_info mii; |
499 | struct rtl8169_counters counters; | ||
483 | }; | 500 | }; |
484 | 501 | ||
485 | MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>"); | 502 | MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@vger.kernel.org>"); |
@@ -1100,22 +1117,6 @@ static const char rtl8169_gstrings[][ETH_GSTRING_LEN] = { | |||
1100 | "tx_underrun", | 1117 | "tx_underrun", |
1101 | }; | 1118 | }; |
1102 | 1119 | ||
1103 | struct rtl8169_counters { | ||
1104 | __le64 tx_packets; | ||
1105 | __le64 rx_packets; | ||
1106 | __le64 tx_errors; | ||
1107 | __le32 rx_errors; | ||
1108 | __le16 rx_missed; | ||
1109 | __le16 align_errors; | ||
1110 | __le32 tx_one_collision; | ||
1111 | __le32 tx_multi_collision; | ||
1112 | __le64 rx_unicast; | ||
1113 | __le64 rx_broadcast; | ||
1114 | __le32 rx_multicast; | ||
1115 | __le16 tx_aborted; | ||
1116 | __le16 tx_underun; | ||
1117 | }; | ||
1118 | |||
1119 | static int rtl8169_get_sset_count(struct net_device *dev, int sset) | 1120 | static int rtl8169_get_sset_count(struct net_device *dev, int sset) |
1120 | { | 1121 | { |
1121 | switch (sset) { | 1122 | switch (sset) { |
@@ -1126,16 +1127,21 @@ static int rtl8169_get_sset_count(struct net_device *dev, int sset) | |||
1126 | } | 1127 | } |
1127 | } | 1128 | } |
1128 | 1129 | ||
1129 | static void rtl8169_get_ethtool_stats(struct net_device *dev, | 1130 | static void rtl8169_update_counters(struct net_device *dev) |
1130 | struct ethtool_stats *stats, u64 *data) | ||
1131 | { | 1131 | { |
1132 | struct rtl8169_private *tp = netdev_priv(dev); | 1132 | struct rtl8169_private *tp = netdev_priv(dev); |
1133 | void __iomem *ioaddr = tp->mmio_addr; | 1133 | void __iomem *ioaddr = tp->mmio_addr; |
1134 | struct rtl8169_counters *counters; | 1134 | struct rtl8169_counters *counters; |
1135 | dma_addr_t paddr; | 1135 | dma_addr_t paddr; |
1136 | u32 cmd; | 1136 | u32 cmd; |
1137 | int wait = 1000; | ||
1137 | 1138 | ||
1138 | ASSERT_RTNL(); | 1139 | /* |
1140 | * Some chips are unable to dump tally counters when the receiver | ||
1141 | * is disabled. | ||
1142 | */ | ||
1143 | if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0) | ||
1144 | return; | ||
1139 | 1145 | ||
1140 | counters = pci_alloc_consistent(tp->pci_dev, sizeof(*counters), &paddr); | 1146 | counters = pci_alloc_consistent(tp->pci_dev, sizeof(*counters), &paddr); |
1141 | if (!counters) | 1147 | if (!counters) |
@@ -1146,31 +1152,45 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev, | |||
1146 | RTL_W32(CounterAddrLow, cmd); | 1152 | RTL_W32(CounterAddrLow, cmd); |
1147 | RTL_W32(CounterAddrLow, cmd | CounterDump); | 1153 | RTL_W32(CounterAddrLow, cmd | CounterDump); |
1148 | 1154 | ||
1149 | while (RTL_R32(CounterAddrLow) & CounterDump) { | 1155 | while (wait--) { |
1150 | if (msleep_interruptible(1)) | 1156 | if ((RTL_R32(CounterAddrLow) & CounterDump) == 0) { |
1157 | /* copy updated counters */ | ||
1158 | memcpy(&tp->counters, counters, sizeof(*counters)); | ||
1151 | break; | 1159 | break; |
1160 | } | ||
1161 | udelay(10); | ||
1152 | } | 1162 | } |
1153 | 1163 | ||
1154 | RTL_W32(CounterAddrLow, 0); | 1164 | RTL_W32(CounterAddrLow, 0); |
1155 | RTL_W32(CounterAddrHigh, 0); | 1165 | RTL_W32(CounterAddrHigh, 0); |
1156 | 1166 | ||
1157 | data[0] = le64_to_cpu(counters->tx_packets); | ||
1158 | data[1] = le64_to_cpu(counters->rx_packets); | ||
1159 | data[2] = le64_to_cpu(counters->tx_errors); | ||
1160 | data[3] = le32_to_cpu(counters->rx_errors); | ||
1161 | data[4] = le16_to_cpu(counters->rx_missed); | ||
1162 | data[5] = le16_to_cpu(counters->align_errors); | ||
1163 | data[6] = le32_to_cpu(counters->tx_one_collision); | ||
1164 | data[7] = le32_to_cpu(counters->tx_multi_collision); | ||
1165 | data[8] = le64_to_cpu(counters->rx_unicast); | ||
1166 | data[9] = le64_to_cpu(counters->rx_broadcast); | ||
1167 | data[10] = le32_to_cpu(counters->rx_multicast); | ||
1168 | data[11] = le16_to_cpu(counters->tx_aborted); | ||
1169 | data[12] = le16_to_cpu(counters->tx_underun); | ||
1170 | |||
1171 | pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr); | 1167 | pci_free_consistent(tp->pci_dev, sizeof(*counters), counters, paddr); |
1172 | } | 1168 | } |
1173 | 1169 | ||
1170 | static void rtl8169_get_ethtool_stats(struct net_device *dev, | ||
1171 | struct ethtool_stats *stats, u64 *data) | ||
1172 | { | ||
1173 | struct rtl8169_private *tp = netdev_priv(dev); | ||
1174 | |||
1175 | ASSERT_RTNL(); | ||
1176 | |||
1177 | rtl8169_update_counters(dev); | ||
1178 | |||
1179 | data[0] = le64_to_cpu(tp->counters.tx_packets); | ||
1180 | data[1] = le64_to_cpu(tp->counters.rx_packets); | ||
1181 | data[2] = le64_to_cpu(tp->counters.tx_errors); | ||
1182 | data[3] = le32_to_cpu(tp->counters.rx_errors); | ||
1183 | data[4] = le16_to_cpu(tp->counters.rx_missed); | ||
1184 | data[5] = le16_to_cpu(tp->counters.align_errors); | ||
1185 | data[6] = le32_to_cpu(tp->counters.tx_one_collision); | ||
1186 | data[7] = le32_to_cpu(tp->counters.tx_multi_collision); | ||
1187 | data[8] = le64_to_cpu(tp->counters.rx_unicast); | ||
1188 | data[9] = le64_to_cpu(tp->counters.rx_broadcast); | ||
1189 | data[10] = le32_to_cpu(tp->counters.rx_multicast); | ||
1190 | data[11] = le16_to_cpu(tp->counters.tx_aborted); | ||
1191 | data[12] = le16_to_cpu(tp->counters.tx_underun); | ||
1192 | } | ||
1193 | |||
1174 | static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data) | 1194 | static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data) |
1175 | { | 1195 | { |
1176 | switch(stringset) { | 1196 | switch(stringset) { |
@@ -3682,6 +3702,9 @@ static int rtl8169_close(struct net_device *dev) | |||
3682 | struct rtl8169_private *tp = netdev_priv(dev); | 3702 | struct rtl8169_private *tp = netdev_priv(dev); |
3683 | struct pci_dev *pdev = tp->pci_dev; | 3703 | struct pci_dev *pdev = tp->pci_dev; |
3684 | 3704 | ||
3705 | /* update counters before going down */ | ||
3706 | rtl8169_update_counters(dev); | ||
3707 | |||
3685 | rtl8169_down(dev); | 3708 | rtl8169_down(dev); |
3686 | 3709 | ||
3687 | free_irq(dev->irq, dev); | 3710 | free_irq(dev->irq, dev); |
diff --git a/drivers/net/sc92031.c b/drivers/net/sc92031.c index 42fd31276602..8b75bef4a841 100644 --- a/drivers/net/sc92031.c +++ b/drivers/net/sc92031.c | |||
@@ -1408,6 +1408,7 @@ static const struct net_device_ops sc92031_netdev_ops = { | |||
1408 | .ndo_set_multicast_list = sc92031_set_multicast_list, | 1408 | .ndo_set_multicast_list = sc92031_set_multicast_list, |
1409 | .ndo_change_mtu = eth_change_mtu, | 1409 | .ndo_change_mtu = eth_change_mtu, |
1410 | .ndo_validate_addr = eth_validate_addr, | 1410 | .ndo_validate_addr = eth_validate_addr, |
1411 | .ndo_set_mac_address = eth_mac_addr, | ||
1411 | .ndo_tx_timeout = sc92031_tx_timeout, | 1412 | .ndo_tx_timeout = sc92031_tx_timeout, |
1412 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1413 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1413 | .ndo_poll_controller = sc92031_poll_controller, | 1414 | .ndo_poll_controller = sc92031_poll_controller, |
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 7673fd92eaf5..847e9bb0098f 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -676,9 +676,8 @@ static int efx_init_port(struct efx_nic *efx) | |||
676 | rc = efx->phy_op->init(efx); | 676 | rc = efx->phy_op->init(efx); |
677 | if (rc) | 677 | if (rc) |
678 | return rc; | 678 | return rc; |
679 | efx->phy_op->reconfigure(efx); | ||
680 | |||
681 | mutex_lock(&efx->mac_lock); | 679 | mutex_lock(&efx->mac_lock); |
680 | efx->phy_op->reconfigure(efx); | ||
682 | rc = falcon_switch_mac(efx); | 681 | rc = falcon_switch_mac(efx); |
683 | mutex_unlock(&efx->mac_lock); | 682 | mutex_unlock(&efx->mac_lock); |
684 | if (rc) | 683 | if (rc) |
@@ -686,7 +685,7 @@ static int efx_init_port(struct efx_nic *efx) | |||
686 | efx->mac_op->reconfigure(efx); | 685 | efx->mac_op->reconfigure(efx); |
687 | 686 | ||
688 | efx->port_initialized = true; | 687 | efx->port_initialized = true; |
689 | efx->stats_enabled = true; | 688 | efx_stats_enable(efx); |
690 | return 0; | 689 | return 0; |
691 | 690 | ||
692 | fail: | 691 | fail: |
@@ -735,6 +734,7 @@ static void efx_fini_port(struct efx_nic *efx) | |||
735 | if (!efx->port_initialized) | 734 | if (!efx->port_initialized) |
736 | return; | 735 | return; |
737 | 736 | ||
737 | efx_stats_disable(efx); | ||
738 | efx->phy_op->fini(efx); | 738 | efx->phy_op->fini(efx); |
739 | efx->port_initialized = false; | 739 | efx->port_initialized = false; |
740 | 740 | ||
@@ -854,20 +854,27 @@ static void efx_fini_io(struct efx_nic *efx) | |||
854 | * interrupts across them. */ | 854 | * interrupts across them. */ |
855 | static int efx_wanted_rx_queues(void) | 855 | static int efx_wanted_rx_queues(void) |
856 | { | 856 | { |
857 | cpumask_t core_mask; | 857 | cpumask_var_t core_mask; |
858 | int count; | 858 | int count; |
859 | int cpu; | 859 | int cpu; |
860 | 860 | ||
861 | cpus_clear(core_mask); | 861 | if (!alloc_cpumask_var(&core_mask, GFP_KERNEL)) { |
862 | printk(KERN_WARNING | ||
863 | "efx.c: allocation failure, irq balancing hobbled\n"); | ||
864 | return 1; | ||
865 | } | ||
866 | |||
867 | cpumask_clear(core_mask); | ||
862 | count = 0; | 868 | count = 0; |
863 | for_each_online_cpu(cpu) { | 869 | for_each_online_cpu(cpu) { |
864 | if (!cpu_isset(cpu, core_mask)) { | 870 | if (!cpumask_test_cpu(cpu, core_mask)) { |
865 | ++count; | 871 | ++count; |
866 | cpus_or(core_mask, core_mask, | 872 | cpumask_or(core_mask, core_mask, |
867 | topology_core_siblings(cpu)); | 873 | topology_core_cpumask(cpu)); |
868 | } | 874 | } |
869 | } | 875 | } |
870 | 876 | ||
877 | free_cpumask_var(core_mask); | ||
871 | return count; | 878 | return count; |
872 | } | 879 | } |
873 | 880 | ||
@@ -1361,6 +1368,20 @@ static int efx_net_stop(struct net_device *net_dev) | |||
1361 | return 0; | 1368 | return 0; |
1362 | } | 1369 | } |
1363 | 1370 | ||
1371 | void efx_stats_disable(struct efx_nic *efx) | ||
1372 | { | ||
1373 | spin_lock(&efx->stats_lock); | ||
1374 | ++efx->stats_disable_count; | ||
1375 | spin_unlock(&efx->stats_lock); | ||
1376 | } | ||
1377 | |||
1378 | void efx_stats_enable(struct efx_nic *efx) | ||
1379 | { | ||
1380 | spin_lock(&efx->stats_lock); | ||
1381 | --efx->stats_disable_count; | ||
1382 | spin_unlock(&efx->stats_lock); | ||
1383 | } | ||
1384 | |||
1364 | /* Context: process, dev_base_lock or RTNL held, non-blocking. */ | 1385 | /* Context: process, dev_base_lock or RTNL held, non-blocking. */ |
1365 | static struct net_device_stats *efx_net_stats(struct net_device *net_dev) | 1386 | static struct net_device_stats *efx_net_stats(struct net_device *net_dev) |
1366 | { | 1387 | { |
@@ -1369,12 +1390,12 @@ static struct net_device_stats *efx_net_stats(struct net_device *net_dev) | |||
1369 | struct net_device_stats *stats = &net_dev->stats; | 1390 | struct net_device_stats *stats = &net_dev->stats; |
1370 | 1391 | ||
1371 | /* Update stats if possible, but do not wait if another thread | 1392 | /* Update stats if possible, but do not wait if another thread |
1372 | * is updating them (or resetting the NIC); slightly stale | 1393 | * is updating them or if MAC stats fetches are temporarily |
1373 | * stats are acceptable. | 1394 | * disabled; slightly stale stats are acceptable. |
1374 | */ | 1395 | */ |
1375 | if (!spin_trylock(&efx->stats_lock)) | 1396 | if (!spin_trylock(&efx->stats_lock)) |
1376 | return stats; | 1397 | return stats; |
1377 | if (efx->stats_enabled) { | 1398 | if (!efx->stats_disable_count) { |
1378 | efx->mac_op->update_stats(efx); | 1399 | efx->mac_op->update_stats(efx); |
1379 | falcon_update_nic_stats(efx); | 1400 | falcon_update_nic_stats(efx); |
1380 | } | 1401 | } |
@@ -1622,16 +1643,12 @@ static void efx_unregister_netdev(struct efx_nic *efx) | |||
1622 | 1643 | ||
1623 | /* Tears down the entire software state and most of the hardware state | 1644 | /* Tears down the entire software state and most of the hardware state |
1624 | * before reset. */ | 1645 | * before reset. */ |
1625 | void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd) | 1646 | void efx_reset_down(struct efx_nic *efx, enum reset_type method, |
1647 | struct ethtool_cmd *ecmd) | ||
1626 | { | 1648 | { |
1627 | EFX_ASSERT_RESET_SERIALISED(efx); | 1649 | EFX_ASSERT_RESET_SERIALISED(efx); |
1628 | 1650 | ||
1629 | /* The net_dev->get_stats handler is quite slow, and will fail | 1651 | efx_stats_disable(efx); |
1630 | * if a fetch is pending over reset. Serialise against it. */ | ||
1631 | spin_lock(&efx->stats_lock); | ||
1632 | efx->stats_enabled = false; | ||
1633 | spin_unlock(&efx->stats_lock); | ||
1634 | |||
1635 | efx_stop_all(efx); | 1652 | efx_stop_all(efx); |
1636 | mutex_lock(&efx->mac_lock); | 1653 | mutex_lock(&efx->mac_lock); |
1637 | mutex_lock(&efx->spi_lock); | 1654 | mutex_lock(&efx->spi_lock); |
@@ -1639,6 +1656,8 @@ void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd) | |||
1639 | efx->phy_op->get_settings(efx, ecmd); | 1656 | efx->phy_op->get_settings(efx, ecmd); |
1640 | 1657 | ||
1641 | efx_fini_channels(efx); | 1658 | efx_fini_channels(efx); |
1659 | if (efx->port_initialized && method != RESET_TYPE_INVISIBLE) | ||
1660 | efx->phy_op->fini(efx); | ||
1642 | } | 1661 | } |
1643 | 1662 | ||
1644 | /* This function will always ensure that the locks acquired in | 1663 | /* This function will always ensure that the locks acquired in |
@@ -1646,7 +1665,8 @@ void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd) | |||
1646 | * that we were unable to reinitialise the hardware, and the | 1665 | * that we were unable to reinitialise the hardware, and the |
1647 | * driver should be disabled. If ok is false, then the rx and tx | 1666 | * driver should be disabled. If ok is false, then the rx and tx |
1648 | * engines are not restarted, pending a RESET_DISABLE. */ | 1667 | * engines are not restarted, pending a RESET_DISABLE. */ |
1649 | int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd, bool ok) | 1668 | int efx_reset_up(struct efx_nic *efx, enum reset_type method, |
1669 | struct ethtool_cmd *ecmd, bool ok) | ||
1650 | { | 1670 | { |
1651 | int rc; | 1671 | int rc; |
1652 | 1672 | ||
@@ -1658,6 +1678,15 @@ int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd, bool ok) | |||
1658 | ok = false; | 1678 | ok = false; |
1659 | } | 1679 | } |
1660 | 1680 | ||
1681 | if (efx->port_initialized && method != RESET_TYPE_INVISIBLE) { | ||
1682 | if (ok) { | ||
1683 | rc = efx->phy_op->init(efx); | ||
1684 | if (rc) | ||
1685 | ok = false; | ||
1686 | } else | ||
1687 | efx->port_initialized = false; | ||
1688 | } | ||
1689 | |||
1661 | if (ok) { | 1690 | if (ok) { |
1662 | efx_init_channels(efx); | 1691 | efx_init_channels(efx); |
1663 | 1692 | ||
@@ -1670,7 +1699,7 @@ int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd, bool ok) | |||
1670 | 1699 | ||
1671 | if (ok) { | 1700 | if (ok) { |
1672 | efx_start_all(efx); | 1701 | efx_start_all(efx); |
1673 | efx->stats_enabled = true; | 1702 | efx_stats_enable(efx); |
1674 | } | 1703 | } |
1675 | return rc; | 1704 | return rc; |
1676 | } | 1705 | } |
@@ -1702,7 +1731,7 @@ static int efx_reset(struct efx_nic *efx) | |||
1702 | 1731 | ||
1703 | EFX_INFO(efx, "resetting (%d)\n", method); | 1732 | EFX_INFO(efx, "resetting (%d)\n", method); |
1704 | 1733 | ||
1705 | efx_reset_down(efx, &ecmd); | 1734 | efx_reset_down(efx, method, &ecmd); |
1706 | 1735 | ||
1707 | rc = falcon_reset_hw(efx, method); | 1736 | rc = falcon_reset_hw(efx, method); |
1708 | if (rc) { | 1737 | if (rc) { |
@@ -1721,10 +1750,10 @@ static int efx_reset(struct efx_nic *efx) | |||
1721 | 1750 | ||
1722 | /* Leave device stopped if necessary */ | 1751 | /* Leave device stopped if necessary */ |
1723 | if (method == RESET_TYPE_DISABLE) { | 1752 | if (method == RESET_TYPE_DISABLE) { |
1724 | efx_reset_up(efx, &ecmd, false); | 1753 | efx_reset_up(efx, method, &ecmd, false); |
1725 | rc = -EIO; | 1754 | rc = -EIO; |
1726 | } else { | 1755 | } else { |
1727 | rc = efx_reset_up(efx, &ecmd, true); | 1756 | rc = efx_reset_up(efx, method, &ecmd, true); |
1728 | } | 1757 | } |
1729 | 1758 | ||
1730 | out_disable: | 1759 | out_disable: |
@@ -1876,6 +1905,7 @@ static int efx_init_struct(struct efx_nic *efx, struct efx_nic_type *type, | |||
1876 | efx->rx_checksum_enabled = true; | 1905 | efx->rx_checksum_enabled = true; |
1877 | spin_lock_init(&efx->netif_stop_lock); | 1906 | spin_lock_init(&efx->netif_stop_lock); |
1878 | spin_lock_init(&efx->stats_lock); | 1907 | spin_lock_init(&efx->stats_lock); |
1908 | efx->stats_disable_count = 1; | ||
1879 | mutex_init(&efx->mac_lock); | 1909 | mutex_init(&efx->mac_lock); |
1880 | efx->mac_op = &efx_dummy_mac_operations; | 1910 | efx->mac_op = &efx_dummy_mac_operations; |
1881 | efx->phy_op = &efx_dummy_phy_operations; | 1911 | efx->phy_op = &efx_dummy_phy_operations; |
diff --git a/drivers/net/sfc/efx.h b/drivers/net/sfc/efx.h index 0dd7a532c78a..55d0f131b0e9 100644 --- a/drivers/net/sfc/efx.h +++ b/drivers/net/sfc/efx.h | |||
@@ -36,13 +36,16 @@ extern void efx_process_channel_now(struct efx_channel *channel); | |||
36 | extern void efx_flush_queues(struct efx_nic *efx); | 36 | extern void efx_flush_queues(struct efx_nic *efx); |
37 | 37 | ||
38 | /* Ports */ | 38 | /* Ports */ |
39 | extern void efx_stats_disable(struct efx_nic *efx); | ||
40 | extern void efx_stats_enable(struct efx_nic *efx); | ||
39 | extern void efx_reconfigure_port(struct efx_nic *efx); | 41 | extern void efx_reconfigure_port(struct efx_nic *efx); |
40 | extern void __efx_reconfigure_port(struct efx_nic *efx); | 42 | extern void __efx_reconfigure_port(struct efx_nic *efx); |
41 | 43 | ||
42 | /* Reset handling */ | 44 | /* Reset handling */ |
43 | extern void efx_reset_down(struct efx_nic *efx, struct ethtool_cmd *ecmd); | 45 | extern void efx_reset_down(struct efx_nic *efx, enum reset_type method, |
44 | extern int efx_reset_up(struct efx_nic *efx, struct ethtool_cmd *ecmd, | 46 | struct ethtool_cmd *ecmd); |
45 | bool ok); | 47 | extern int efx_reset_up(struct efx_nic *efx, enum reset_type method, |
48 | struct ethtool_cmd *ecmd, bool ok); | ||
46 | 49 | ||
47 | /* Global */ | 50 | /* Global */ |
48 | extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type); | 51 | extern void efx_schedule_reset(struct efx_nic *efx, enum reset_type type); |
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index 53d259e90187..7b5924c039b3 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -219,9 +219,6 @@ int efx_ethtool_set_settings(struct net_device *net_dev, | |||
219 | struct efx_nic *efx = netdev_priv(net_dev); | 219 | struct efx_nic *efx = netdev_priv(net_dev); |
220 | int rc; | 220 | int rc; |
221 | 221 | ||
222 | if (EFX_WORKAROUND_13963(efx) && !ecmd->autoneg) | ||
223 | return -EINVAL; | ||
224 | |||
225 | /* Falcon GMAC does not support 1000Mbps HD */ | 222 | /* Falcon GMAC does not support 1000Mbps HD */ |
226 | if (ecmd->speed == SPEED_1000 && ecmd->duplex != DUPLEX_FULL) { | 223 | if (ecmd->speed == SPEED_1000 && ecmd->duplex != DUPLEX_FULL) { |
227 | EFX_LOG(efx, "rejecting unsupported 1000Mbps HD" | 224 | EFX_LOG(efx, "rejecting unsupported 1000Mbps HD" |
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c index 5b9f2d9cc4ed..064307c2277e 100644 --- a/drivers/net/sfc/falcon.c +++ b/drivers/net/sfc/falcon.c | |||
@@ -338,10 +338,10 @@ static int falcon_alloc_special_buffer(struct efx_nic *efx, | |||
338 | nic_data->next_buffer_table += buffer->entries; | 338 | nic_data->next_buffer_table += buffer->entries; |
339 | 339 | ||
340 | EFX_LOG(efx, "allocating special buffers %d-%d at %llx+%x " | 340 | EFX_LOG(efx, "allocating special buffers %d-%d at %llx+%x " |
341 | "(virt %p phys %lx)\n", buffer->index, | 341 | "(virt %p phys %llx)\n", buffer->index, |
342 | buffer->index + buffer->entries - 1, | 342 | buffer->index + buffer->entries - 1, |
343 | (unsigned long long)buffer->dma_addr, len, | 343 | (u64)buffer->dma_addr, len, |
344 | buffer->addr, virt_to_phys(buffer->addr)); | 344 | buffer->addr, (u64)virt_to_phys(buffer->addr)); |
345 | 345 | ||
346 | return 0; | 346 | return 0; |
347 | } | 347 | } |
@@ -353,10 +353,10 @@ static void falcon_free_special_buffer(struct efx_nic *efx, | |||
353 | return; | 353 | return; |
354 | 354 | ||
355 | EFX_LOG(efx, "deallocating special buffers %d-%d at %llx+%x " | 355 | EFX_LOG(efx, "deallocating special buffers %d-%d at %llx+%x " |
356 | "(virt %p phys %lx)\n", buffer->index, | 356 | "(virt %p phys %llx)\n", buffer->index, |
357 | buffer->index + buffer->entries - 1, | 357 | buffer->index + buffer->entries - 1, |
358 | (unsigned long long)buffer->dma_addr, buffer->len, | 358 | (u64)buffer->dma_addr, buffer->len, |
359 | buffer->addr, virt_to_phys(buffer->addr)); | 359 | buffer->addr, (u64)virt_to_phys(buffer->addr)); |
360 | 360 | ||
361 | pci_free_consistent(efx->pci_dev, buffer->len, buffer->addr, | 361 | pci_free_consistent(efx->pci_dev, buffer->len, buffer->addr, |
362 | buffer->dma_addr); | 362 | buffer->dma_addr); |
@@ -824,10 +824,6 @@ static void falcon_handle_rx_not_ok(struct efx_rx_queue *rx_queue, | |||
824 | rx_ev_pause_frm ? " [PAUSE]" : ""); | 824 | rx_ev_pause_frm ? " [PAUSE]" : ""); |
825 | } | 825 | } |
826 | #endif | 826 | #endif |
827 | |||
828 | if (unlikely(rx_ev_eth_crc_err && EFX_WORKAROUND_10750(efx) && | ||
829 | efx->phy_type == PHY_TYPE_SFX7101)) | ||
830 | tenxpress_crc_err(efx); | ||
831 | } | 827 | } |
832 | 828 | ||
833 | /* Handle receive events that are not in-order. */ | 829 | /* Handle receive events that are not in-order. */ |
@@ -1887,7 +1883,7 @@ static int falcon_reset_macs(struct efx_nic *efx) | |||
1887 | 1883 | ||
1888 | /* MAC stats will fail whilst the TX fifo is draining. Serialise | 1884 | /* MAC stats will fail whilst the TX fifo is draining. Serialise |
1889 | * the drain sequence with the statistics fetch */ | 1885 | * the drain sequence with the statistics fetch */ |
1890 | spin_lock(&efx->stats_lock); | 1886 | efx_stats_disable(efx); |
1891 | 1887 | ||
1892 | falcon_read(efx, ®, MAC0_CTRL_REG_KER); | 1888 | falcon_read(efx, ®, MAC0_CTRL_REG_KER); |
1893 | EFX_SET_OWORD_FIELD(reg, TXFIFO_DRAIN_EN_B0, 1); | 1889 | EFX_SET_OWORD_FIELD(reg, TXFIFO_DRAIN_EN_B0, 1); |
@@ -1917,7 +1913,7 @@ static int falcon_reset_macs(struct efx_nic *efx) | |||
1917 | udelay(10); | 1913 | udelay(10); |
1918 | } | 1914 | } |
1919 | 1915 | ||
1920 | spin_unlock(&efx->stats_lock); | 1916 | efx_stats_enable(efx); |
1921 | 1917 | ||
1922 | /* If we've reset the EM block and the link is up, then | 1918 | /* If we've reset the EM block and the link is up, then |
1923 | * we'll have to kick the XAUI link so the PHY can recover */ | 1919 | * we'll have to kick the XAUI link so the PHY can recover */ |
@@ -2277,6 +2273,10 @@ int falcon_switch_mac(struct efx_nic *efx) | |||
2277 | struct efx_mac_operations *old_mac_op = efx->mac_op; | 2273 | struct efx_mac_operations *old_mac_op = efx->mac_op; |
2278 | efx_oword_t nic_stat; | 2274 | efx_oword_t nic_stat; |
2279 | unsigned strap_val; | 2275 | unsigned strap_val; |
2276 | int rc = 0; | ||
2277 | |||
2278 | /* Don't try to fetch MAC stats while we're switching MACs */ | ||
2279 | efx_stats_disable(efx); | ||
2280 | 2280 | ||
2281 | /* Internal loopbacks override the phy speed setting */ | 2281 | /* Internal loopbacks override the phy speed setting */ |
2282 | if (efx->loopback_mode == LOOPBACK_GMAC) { | 2282 | if (efx->loopback_mode == LOOPBACK_GMAC) { |
@@ -2287,16 +2287,12 @@ int falcon_switch_mac(struct efx_nic *efx) | |||
2287 | efx->link_fd = true; | 2287 | efx->link_fd = true; |
2288 | } | 2288 | } |
2289 | 2289 | ||
2290 | WARN_ON(!mutex_is_locked(&efx->mac_lock)); | ||
2290 | efx->mac_op = (EFX_IS10G(efx) ? | 2291 | efx->mac_op = (EFX_IS10G(efx) ? |
2291 | &falcon_xmac_operations : &falcon_gmac_operations); | 2292 | &falcon_xmac_operations : &falcon_gmac_operations); |
2292 | if (old_mac_op == efx->mac_op) | ||
2293 | return 0; | ||
2294 | |||
2295 | WARN_ON(!mutex_is_locked(&efx->mac_lock)); | ||
2296 | |||
2297 | /* Not all macs support a mac-level link state */ | ||
2298 | efx->mac_up = true; | ||
2299 | 2293 | ||
2294 | /* Always push the NIC_STAT_REG setting even if the mac hasn't | ||
2295 | * changed, because this function is run post online reset */ | ||
2300 | falcon_read(efx, &nic_stat, NIC_STAT_REG); | 2296 | falcon_read(efx, &nic_stat, NIC_STAT_REG); |
2301 | strap_val = EFX_IS10G(efx) ? 5 : 3; | 2297 | strap_val = EFX_IS10G(efx) ? 5 : 3; |
2302 | if (falcon_rev(efx) >= FALCON_REV_B0) { | 2298 | if (falcon_rev(efx) >= FALCON_REV_B0) { |
@@ -2309,9 +2305,17 @@ int falcon_switch_mac(struct efx_nic *efx) | |||
2309 | BUG_ON(EFX_OWORD_FIELD(nic_stat, STRAP_PINS) != strap_val); | 2305 | BUG_ON(EFX_OWORD_FIELD(nic_stat, STRAP_PINS) != strap_val); |
2310 | } | 2306 | } |
2311 | 2307 | ||
2308 | if (old_mac_op == efx->mac_op) | ||
2309 | goto out; | ||
2312 | 2310 | ||
2313 | EFX_LOG(efx, "selected %cMAC\n", EFX_IS10G(efx) ? 'X' : 'G'); | 2311 | EFX_LOG(efx, "selected %cMAC\n", EFX_IS10G(efx) ? 'X' : 'G'); |
2314 | return falcon_reset_macs(efx); | 2312 | /* Not all macs support a mac-level link state */ |
2313 | efx->mac_up = true; | ||
2314 | |||
2315 | rc = falcon_reset_macs(efx); | ||
2316 | out: | ||
2317 | efx_stats_enable(efx); | ||
2318 | return rc; | ||
2315 | } | 2319 | } |
2316 | 2320 | ||
2317 | /* This call is responsible for hooking in the MAC and PHY operations */ | 2321 | /* This call is responsible for hooking in the MAC and PHY operations */ |
@@ -2339,10 +2343,10 @@ int falcon_probe_port(struct efx_nic *efx) | |||
2339 | FALCON_MAC_STATS_SIZE); | 2343 | FALCON_MAC_STATS_SIZE); |
2340 | if (rc) | 2344 | if (rc) |
2341 | return rc; | 2345 | return rc; |
2342 | EFX_LOG(efx, "stats buffer at %llx (virt %p phys %lx)\n", | 2346 | EFX_LOG(efx, "stats buffer at %llx (virt %p phys %llx)\n", |
2343 | (unsigned long long)efx->stats_buffer.dma_addr, | 2347 | (u64)efx->stats_buffer.dma_addr, |
2344 | efx->stats_buffer.addr, | 2348 | efx->stats_buffer.addr, |
2345 | virt_to_phys(efx->stats_buffer.addr)); | 2349 | (u64)virt_to_phys(efx->stats_buffer.addr)); |
2346 | 2350 | ||
2347 | return 0; | 2351 | return 0; |
2348 | } | 2352 | } |
@@ -2917,9 +2921,9 @@ int falcon_probe_nic(struct efx_nic *efx) | |||
2917 | goto fail4; | 2921 | goto fail4; |
2918 | BUG_ON(efx->irq_status.dma_addr & 0x0f); | 2922 | BUG_ON(efx->irq_status.dma_addr & 0x0f); |
2919 | 2923 | ||
2920 | EFX_LOG(efx, "INT_KER at %llx (virt %p phys %lx)\n", | 2924 | EFX_LOG(efx, "INT_KER at %llx (virt %p phys %llx)\n", |
2921 | (unsigned long long)efx->irq_status.dma_addr, | 2925 | (u64)efx->irq_status.dma_addr, |
2922 | efx->irq_status.addr, virt_to_phys(efx->irq_status.addr)); | 2926 | efx->irq_status.addr, (u64)virt_to_phys(efx->irq_status.addr)); |
2923 | 2927 | ||
2924 | falcon_probe_spi_devices(efx); | 2928 | falcon_probe_spi_devices(efx); |
2925 | 2929 | ||
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c index f6a16428113d..f9e2f95c3b48 100644 --- a/drivers/net/sfc/mdio_10g.c +++ b/drivers/net/sfc/mdio_10g.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include "net_driver.h" | 15 | #include "net_driver.h" |
16 | #include "mdio_10g.h" | 16 | #include "mdio_10g.h" |
17 | #include "boards.h" | 17 | #include "boards.h" |
18 | #include "workarounds.h" | ||
18 | 19 | ||
19 | int mdio_clause45_reset_mmd(struct efx_nic *port, int mmd, | 20 | int mdio_clause45_reset_mmd(struct efx_nic *port, int mmd, |
20 | int spins, int spintime) | 21 | int spins, int spintime) |
@@ -179,17 +180,12 @@ bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask) | |||
179 | return false; | 180 | return false; |
180 | else if (efx_phy_mode_disabled(efx->phy_mode)) | 181 | else if (efx_phy_mode_disabled(efx->phy_mode)) |
181 | return false; | 182 | return false; |
182 | else if (efx->loopback_mode == LOOPBACK_PHYXS) { | 183 | else if (efx->loopback_mode == LOOPBACK_PHYXS) |
183 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PHYXS | | 184 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PHYXS | |
184 | MDIO_MMDREG_DEVS_PCS | | 185 | MDIO_MMDREG_DEVS_PCS | |
185 | MDIO_MMDREG_DEVS_PMAPMD | | 186 | MDIO_MMDREG_DEVS_PMAPMD | |
186 | MDIO_MMDREG_DEVS_AN); | 187 | MDIO_MMDREG_DEVS_AN); |
187 | if (!mmd_mask) { | 188 | else if (efx->loopback_mode == LOOPBACK_PCS) |
188 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PHYXS, | ||
189 | MDIO_PHYXS_STATUS2); | ||
190 | return !(reg & (1 << MDIO_PHYXS_STATUS2_RX_FAULT_LBN)); | ||
191 | } | ||
192 | } else if (efx->loopback_mode == LOOPBACK_PCS) | ||
193 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PCS | | 189 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PCS | |
194 | MDIO_MMDREG_DEVS_PMAPMD | | 190 | MDIO_MMDREG_DEVS_PMAPMD | |
195 | MDIO_MMDREG_DEVS_AN); | 191 | MDIO_MMDREG_DEVS_AN); |
@@ -197,6 +193,13 @@ bool mdio_clause45_links_ok(struct efx_nic *efx, unsigned int mmd_mask) | |||
197 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PMAPMD | | 193 | mmd_mask &= ~(MDIO_MMDREG_DEVS_PMAPMD | |
198 | MDIO_MMDREG_DEVS_AN); | 194 | MDIO_MMDREG_DEVS_AN); |
199 | 195 | ||
196 | if (!mmd_mask) { | ||
197 | /* Use presence of XGMII faults in leui of link state */ | ||
198 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PHYXS, | ||
199 | MDIO_PHYXS_STATUS2); | ||
200 | return !(reg & (1 << MDIO_PHYXS_STATUS2_RX_FAULT_LBN)); | ||
201 | } | ||
202 | |||
200 | while (mmd_mask) { | 203 | while (mmd_mask) { |
201 | if (mmd_mask & 1) { | 204 | if (mmd_mask & 1) { |
202 | /* Double reads because link state is latched, and a | 205 | /* Double reads because link state is latched, and a |
@@ -263,7 +266,7 @@ void mdio_clause45_set_mmds_lpower(struct efx_nic *efx, | |||
263 | } | 266 | } |
264 | } | 267 | } |
265 | 268 | ||
266 | static u32 mdio_clause45_get_an(struct efx_nic *efx, u16 addr, u32 xnp) | 269 | static u32 mdio_clause45_get_an(struct efx_nic *efx, u16 addr) |
267 | { | 270 | { |
268 | int phy_id = efx->mii.phy_id; | 271 | int phy_id = efx->mii.phy_id; |
269 | u32 result = 0; | 272 | u32 result = 0; |
@@ -278,9 +281,6 @@ static u32 mdio_clause45_get_an(struct efx_nic *efx, u16 addr, u32 xnp) | |||
278 | result |= ADVERTISED_100baseT_Half; | 281 | result |= ADVERTISED_100baseT_Half; |
279 | if (reg & ADVERTISE_100FULL) | 282 | if (reg & ADVERTISE_100FULL) |
280 | result |= ADVERTISED_100baseT_Full; | 283 | result |= ADVERTISED_100baseT_Full; |
281 | if (reg & LPA_RESV) | ||
282 | result |= xnp; | ||
283 | |||
284 | return result; | 284 | return result; |
285 | } | 285 | } |
286 | 286 | ||
@@ -310,7 +310,7 @@ void mdio_clause45_get_settings(struct efx_nic *efx, | |||
310 | */ | 310 | */ |
311 | void mdio_clause45_get_settings_ext(struct efx_nic *efx, | 311 | void mdio_clause45_get_settings_ext(struct efx_nic *efx, |
312 | struct ethtool_cmd *ecmd, | 312 | struct ethtool_cmd *ecmd, |
313 | u32 xnp, u32 xnp_lpa) | 313 | u32 npage_adv, u32 npage_lpa) |
314 | { | 314 | { |
315 | int phy_id = efx->mii.phy_id; | 315 | int phy_id = efx->mii.phy_id; |
316 | int reg; | 316 | int reg; |
@@ -361,8 +361,8 @@ void mdio_clause45_get_settings_ext(struct efx_nic *efx, | |||
361 | ecmd->autoneg = AUTONEG_ENABLE; | 361 | ecmd->autoneg = AUTONEG_ENABLE; |
362 | ecmd->advertising |= | 362 | ecmd->advertising |= |
363 | ADVERTISED_Autoneg | | 363 | ADVERTISED_Autoneg | |
364 | mdio_clause45_get_an(efx, | 364 | mdio_clause45_get_an(efx, MDIO_AN_ADVERTISE) | |
365 | MDIO_AN_ADVERTISE, xnp); | 365 | npage_adv; |
366 | } else | 366 | } else |
367 | ecmd->autoneg = AUTONEG_DISABLE; | 367 | ecmd->autoneg = AUTONEG_DISABLE; |
368 | } else | 368 | } else |
@@ -371,27 +371,30 @@ void mdio_clause45_get_settings_ext(struct efx_nic *efx, | |||
371 | if (ecmd->autoneg) { | 371 | if (ecmd->autoneg) { |
372 | /* If AN is complete, report best common mode, | 372 | /* If AN is complete, report best common mode, |
373 | * otherwise report best advertised mode. */ | 373 | * otherwise report best advertised mode. */ |
374 | u32 common = ecmd->advertising; | 374 | u32 modes = 0; |
375 | if (mdio_clause45_read(efx, phy_id, MDIO_MMD_AN, | 375 | if (mdio_clause45_read(efx, phy_id, MDIO_MMD_AN, |
376 | MDIO_MMDREG_STAT1) & | 376 | MDIO_MMDREG_STAT1) & |
377 | (1 << MDIO_AN_STATUS_AN_DONE_LBN)) { | 377 | (1 << MDIO_AN_STATUS_AN_DONE_LBN)) |
378 | common &= mdio_clause45_get_an(efx, MDIO_AN_LPA, | 378 | modes = (ecmd->advertising & |
379 | xnp_lpa); | 379 | (mdio_clause45_get_an(efx, MDIO_AN_LPA) | |
380 | } | 380 | npage_lpa)); |
381 | if (common & ADVERTISED_10000baseT_Full) { | 381 | if (modes == 0) |
382 | modes = ecmd->advertising; | ||
383 | |||
384 | if (modes & ADVERTISED_10000baseT_Full) { | ||
382 | ecmd->speed = SPEED_10000; | 385 | ecmd->speed = SPEED_10000; |
383 | ecmd->duplex = DUPLEX_FULL; | 386 | ecmd->duplex = DUPLEX_FULL; |
384 | } else if (common & (ADVERTISED_1000baseT_Full | | 387 | } else if (modes & (ADVERTISED_1000baseT_Full | |
385 | ADVERTISED_1000baseT_Half)) { | 388 | ADVERTISED_1000baseT_Half)) { |
386 | ecmd->speed = SPEED_1000; | 389 | ecmd->speed = SPEED_1000; |
387 | ecmd->duplex = !!(common & ADVERTISED_1000baseT_Full); | 390 | ecmd->duplex = !!(modes & ADVERTISED_1000baseT_Full); |
388 | } else if (common & (ADVERTISED_100baseT_Full | | 391 | } else if (modes & (ADVERTISED_100baseT_Full | |
389 | ADVERTISED_100baseT_Half)) { | 392 | ADVERTISED_100baseT_Half)) { |
390 | ecmd->speed = SPEED_100; | 393 | ecmd->speed = SPEED_100; |
391 | ecmd->duplex = !!(common & ADVERTISED_100baseT_Full); | 394 | ecmd->duplex = !!(modes & ADVERTISED_100baseT_Full); |
392 | } else { | 395 | } else { |
393 | ecmd->speed = SPEED_10; | 396 | ecmd->speed = SPEED_10; |
394 | ecmd->duplex = !!(common & ADVERTISED_10baseT_Full); | 397 | ecmd->duplex = !!(modes & ADVERTISED_10baseT_Full); |
395 | } | 398 | } |
396 | } else { | 399 | } else { |
397 | /* Report forced settings */ | 400 | /* Report forced settings */ |
@@ -415,7 +418,7 @@ int mdio_clause45_set_settings(struct efx_nic *efx, | |||
415 | int phy_id = efx->mii.phy_id; | 418 | int phy_id = efx->mii.phy_id; |
416 | struct ethtool_cmd prev; | 419 | struct ethtool_cmd prev; |
417 | u32 required; | 420 | u32 required; |
418 | int ctrl1_bits, reg; | 421 | int reg; |
419 | 422 | ||
420 | efx->phy_op->get_settings(efx, &prev); | 423 | efx->phy_op->get_settings(efx, &prev); |
421 | 424 | ||
@@ -430,99 +433,83 @@ int mdio_clause45_set_settings(struct efx_nic *efx, | |||
430 | if (prev.port != PORT_TP || ecmd->port != PORT_TP) | 433 | if (prev.port != PORT_TP || ecmd->port != PORT_TP) |
431 | return -EINVAL; | 434 | return -EINVAL; |
432 | 435 | ||
433 | /* Check that PHY supports these settings and work out the | 436 | /* Check that PHY supports these settings */ |
434 | * basic control bits */ | 437 | if (ecmd->autoneg) { |
435 | if (ecmd->duplex) { | 438 | required = SUPPORTED_Autoneg; |
439 | } else if (ecmd->duplex) { | ||
436 | switch (ecmd->speed) { | 440 | switch (ecmd->speed) { |
437 | case SPEED_10: | 441 | case SPEED_10: required = SUPPORTED_10baseT_Full; break; |
438 | ctrl1_bits = BMCR_FULLDPLX; | 442 | case SPEED_100: required = SUPPORTED_100baseT_Full; break; |
439 | required = SUPPORTED_10baseT_Full; | 443 | default: return -EINVAL; |
440 | break; | ||
441 | case SPEED_100: | ||
442 | ctrl1_bits = BMCR_SPEED100 | BMCR_FULLDPLX; | ||
443 | required = SUPPORTED_100baseT_Full; | ||
444 | break; | ||
445 | case SPEED_1000: | ||
446 | ctrl1_bits = BMCR_SPEED1000 | BMCR_FULLDPLX; | ||
447 | required = SUPPORTED_1000baseT_Full; | ||
448 | break; | ||
449 | case SPEED_10000: | ||
450 | ctrl1_bits = (BMCR_SPEED1000 | BMCR_SPEED100 | | ||
451 | BMCR_FULLDPLX); | ||
452 | required = SUPPORTED_10000baseT_Full; | ||
453 | break; | ||
454 | default: | ||
455 | return -EINVAL; | ||
456 | } | 444 | } |
457 | } else { | 445 | } else { |
458 | switch (ecmd->speed) { | 446 | switch (ecmd->speed) { |
459 | case SPEED_10: | 447 | case SPEED_10: required = SUPPORTED_10baseT_Half; break; |
460 | ctrl1_bits = 0; | 448 | case SPEED_100: required = SUPPORTED_100baseT_Half; break; |
461 | required = SUPPORTED_10baseT_Half; | 449 | default: return -EINVAL; |
462 | break; | ||
463 | case SPEED_100: | ||
464 | ctrl1_bits = BMCR_SPEED100; | ||
465 | required = SUPPORTED_100baseT_Half; | ||
466 | break; | ||
467 | case SPEED_1000: | ||
468 | ctrl1_bits = BMCR_SPEED1000; | ||
469 | required = SUPPORTED_1000baseT_Half; | ||
470 | break; | ||
471 | default: | ||
472 | return -EINVAL; | ||
473 | } | 450 | } |
474 | } | 451 | } |
475 | if (ecmd->autoneg) | ||
476 | required |= SUPPORTED_Autoneg; | ||
477 | required |= ecmd->advertising; | 452 | required |= ecmd->advertising; |
478 | if (required & ~prev.supported) | 453 | if (required & ~prev.supported) |
479 | return -EINVAL; | 454 | return -EINVAL; |
480 | 455 | ||
481 | /* Set the basic control bits */ | 456 | if (ecmd->autoneg) { |
482 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PMAPMD, | 457 | bool xnp = (ecmd->advertising & ADVERTISED_10000baseT_Full |
483 | MDIO_MMDREG_CTRL1); | 458 | || EFX_WORKAROUND_13204(efx)); |
484 | reg &= ~(BMCR_SPEED1000 | BMCR_SPEED100 | BMCR_FULLDPLX | 0x003c); | 459 | |
485 | reg |= ctrl1_bits; | 460 | /* Set up the base page */ |
486 | mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD, MDIO_MMDREG_CTRL1, | 461 | reg = ADVERTISE_CSMA; |
487 | reg); | 462 | if (ecmd->advertising & ADVERTISED_10baseT_Half) |
488 | 463 | reg |= ADVERTISE_10HALF; | |
489 | /* Set the AN registers */ | 464 | if (ecmd->advertising & ADVERTISED_10baseT_Full) |
490 | if (ecmd->autoneg != prev.autoneg || | 465 | reg |= ADVERTISE_10FULL; |
491 | ecmd->advertising != prev.advertising) { | 466 | if (ecmd->advertising & ADVERTISED_100baseT_Half) |
492 | bool xnp = false; | 467 | reg |= ADVERTISE_100HALF; |
493 | 468 | if (ecmd->advertising & ADVERTISED_100baseT_Full) | |
494 | if (efx->phy_op->set_xnp_advertise) | 469 | reg |= ADVERTISE_100FULL; |
495 | xnp = efx->phy_op->set_xnp_advertise(efx, | 470 | if (xnp) |
496 | ecmd->advertising); | 471 | reg |= ADVERTISE_RESV; |
497 | 472 | else if (ecmd->advertising & (ADVERTISED_1000baseT_Half | | |
498 | if (ecmd->autoneg) { | 473 | ADVERTISED_1000baseT_Full)) |
499 | reg = 0; | 474 | reg |= ADVERTISE_NPAGE; |
500 | if (ecmd->advertising & ADVERTISED_10baseT_Half) | 475 | reg |= efx_fc_advertise(efx->wanted_fc); |
501 | reg |= ADVERTISE_10HALF; | 476 | mdio_clause45_write(efx, phy_id, MDIO_MMD_AN, |
502 | if (ecmd->advertising & ADVERTISED_10baseT_Full) | 477 | MDIO_AN_ADVERTISE, reg); |
503 | reg |= ADVERTISE_10FULL; | 478 | |
504 | if (ecmd->advertising & ADVERTISED_100baseT_Half) | 479 | /* Set up the (extended) next page if necessary */ |
505 | reg |= ADVERTISE_100HALF; | 480 | if (efx->phy_op->set_npage_adv) |
506 | if (ecmd->advertising & ADVERTISED_100baseT_Full) | 481 | efx->phy_op->set_npage_adv(efx, ecmd->advertising); |
507 | reg |= ADVERTISE_100FULL; | ||
508 | if (xnp) | ||
509 | reg |= ADVERTISE_RESV; | ||
510 | mdio_clause45_write(efx, phy_id, MDIO_MMD_AN, | ||
511 | MDIO_AN_ADVERTISE, reg); | ||
512 | } | ||
513 | 482 | ||
483 | /* Enable and restart AN */ | ||
514 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN, | 484 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN, |
515 | MDIO_MMDREG_CTRL1); | 485 | MDIO_MMDREG_CTRL1); |
516 | if (ecmd->autoneg) | 486 | reg |= BMCR_ANENABLE; |
517 | reg |= BMCR_ANENABLE | BMCR_ANRESTART; | 487 | if (!(EFX_WORKAROUND_15195(efx) && |
518 | else | 488 | LOOPBACK_MASK(efx) & efx->phy_op->loopbacks)) |
519 | reg &= ~BMCR_ANENABLE; | 489 | reg |= BMCR_ANRESTART; |
520 | if (xnp) | 490 | if (xnp) |
521 | reg |= 1 << MDIO_AN_CTRL_XNP_LBN; | 491 | reg |= 1 << MDIO_AN_CTRL_XNP_LBN; |
522 | else | 492 | else |
523 | reg &= ~(1 << MDIO_AN_CTRL_XNP_LBN); | 493 | reg &= ~(1 << MDIO_AN_CTRL_XNP_LBN); |
524 | mdio_clause45_write(efx, phy_id, MDIO_MMD_AN, | 494 | mdio_clause45_write(efx, phy_id, MDIO_MMD_AN, |
525 | MDIO_MMDREG_CTRL1, reg); | 495 | MDIO_MMDREG_CTRL1, reg); |
496 | } else { | ||
497 | /* Disable AN */ | ||
498 | mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_AN, | ||
499 | MDIO_MMDREG_CTRL1, | ||
500 | __ffs(BMCR_ANENABLE), false); | ||
501 | |||
502 | /* Set the basic control bits */ | ||
503 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PMAPMD, | ||
504 | MDIO_MMDREG_CTRL1); | ||
505 | reg &= ~(BMCR_SPEED1000 | BMCR_SPEED100 | BMCR_FULLDPLX | | ||
506 | 0x003c); | ||
507 | if (ecmd->speed == SPEED_100) | ||
508 | reg |= BMCR_SPEED100; | ||
509 | if (ecmd->duplex) | ||
510 | reg |= BMCR_FULLDPLX; | ||
511 | mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD, | ||
512 | MDIO_MMDREG_CTRL1, reg); | ||
526 | } | 513 | } |
527 | 514 | ||
528 | return 0; | 515 | return 0; |
diff --git a/drivers/net/sfc/mdio_10g.h b/drivers/net/sfc/mdio_10g.h index 09bf801d0569..8ba49773ce7e 100644 --- a/drivers/net/sfc/mdio_10g.h +++ b/drivers/net/sfc/mdio_10g.h | |||
@@ -155,7 +155,8 @@ | |||
155 | #define MDIO_AN_XNP 22 | 155 | #define MDIO_AN_XNP 22 |
156 | #define MDIO_AN_LPA_XNP 25 | 156 | #define MDIO_AN_LPA_XNP 25 |
157 | 157 | ||
158 | #define MDIO_AN_10GBT_ADVERTISE 32 | 158 | #define MDIO_AN_10GBT_CTRL 32 |
159 | #define MDIO_AN_10GBT_CTRL_ADV_10G_LBN 12 | ||
159 | #define MDIO_AN_10GBT_STATUS (33) | 160 | #define MDIO_AN_10GBT_STATUS (33) |
160 | #define MDIO_AN_10GBT_STATUS_MS_FLT_LBN (15) /* MASTER/SLAVE config fault */ | 161 | #define MDIO_AN_10GBT_STATUS_MS_FLT_LBN (15) /* MASTER/SLAVE config fault */ |
161 | #define MDIO_AN_10GBT_STATUS_MS_LBN (14) /* MASTER/SLAVE config */ | 162 | #define MDIO_AN_10GBT_STATUS_MS_LBN (14) /* MASTER/SLAVE config */ |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 5f255f75754e..e019ad1fb9a0 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -566,7 +566,7 @@ struct efx_mac_operations { | |||
566 | * @poll: Poll for hardware state. Serialised by the mac_lock. | 566 | * @poll: Poll for hardware state. Serialised by the mac_lock. |
567 | * @get_settings: Get ethtool settings. Serialised by the mac_lock. | 567 | * @get_settings: Get ethtool settings. Serialised by the mac_lock. |
568 | * @set_settings: Set ethtool settings. Serialised by the mac_lock. | 568 | * @set_settings: Set ethtool settings. Serialised by the mac_lock. |
569 | * @set_xnp_advertise: Set abilities advertised in Extended Next Page | 569 | * @set_npage_adv: Set abilities advertised in (Extended) Next Page |
570 | * (only needed where AN bit is set in mmds) | 570 | * (only needed where AN bit is set in mmds) |
571 | * @num_tests: Number of PHY-specific tests/results | 571 | * @num_tests: Number of PHY-specific tests/results |
572 | * @test_names: Names of the tests/results | 572 | * @test_names: Names of the tests/results |
@@ -586,7 +586,7 @@ struct efx_phy_operations { | |||
586 | struct ethtool_cmd *ecmd); | 586 | struct ethtool_cmd *ecmd); |
587 | int (*set_settings) (struct efx_nic *efx, | 587 | int (*set_settings) (struct efx_nic *efx, |
588 | struct ethtool_cmd *ecmd); | 588 | struct ethtool_cmd *ecmd); |
589 | bool (*set_xnp_advertise) (struct efx_nic *efx, u32); | 589 | void (*set_npage_adv) (struct efx_nic *efx, u32); |
590 | u32 num_tests; | 590 | u32 num_tests; |
591 | const char *const *test_names; | 591 | const char *const *test_names; |
592 | int (*run_tests) (struct efx_nic *efx, int *results, unsigned flags); | 592 | int (*run_tests) (struct efx_nic *efx, int *results, unsigned flags); |
@@ -754,8 +754,7 @@ union efx_multicast_hash { | |||
754 | * &struct net_device_stats. | 754 | * &struct net_device_stats. |
755 | * @stats_buffer: DMA buffer for statistics | 755 | * @stats_buffer: DMA buffer for statistics |
756 | * @stats_lock: Statistics update lock. Serialises statistics fetches | 756 | * @stats_lock: Statistics update lock. Serialises statistics fetches |
757 | * @stats_enabled: Temporarily disable statistics fetches. | 757 | * @stats_disable_count: Nest count for disabling statistics fetches |
758 | * Serialised by @stats_lock | ||
759 | * @mac_op: MAC interface | 758 | * @mac_op: MAC interface |
760 | * @mac_address: Permanent MAC address | 759 | * @mac_address: Permanent MAC address |
761 | * @phy_type: PHY type | 760 | * @phy_type: PHY type |
@@ -837,7 +836,7 @@ struct efx_nic { | |||
837 | struct efx_mac_stats mac_stats; | 836 | struct efx_mac_stats mac_stats; |
838 | struct efx_buffer stats_buffer; | 837 | struct efx_buffer stats_buffer; |
839 | spinlock_t stats_lock; | 838 | spinlock_t stats_lock; |
840 | bool stats_enabled; | 839 | unsigned int stats_disable_count; |
841 | 840 | ||
842 | struct efx_mac_operations *mac_op; | 841 | struct efx_mac_operations *mac_op; |
843 | unsigned char mac_address[ETH_ALEN]; | 842 | unsigned char mac_address[ETH_ALEN]; |
diff --git a/drivers/net/sfc/phy.h b/drivers/net/sfc/phy.h index 58c493ef81bb..07e855c148bc 100644 --- a/drivers/net/sfc/phy.h +++ b/drivers/net/sfc/phy.h | |||
@@ -17,7 +17,6 @@ extern struct efx_phy_operations falcon_sfx7101_phy_ops; | |||
17 | extern struct efx_phy_operations falcon_sft9001_phy_ops; | 17 | extern struct efx_phy_operations falcon_sft9001_phy_ops; |
18 | 18 | ||
19 | extern void tenxpress_phy_blink(struct efx_nic *efx, bool blink); | 19 | extern void tenxpress_phy_blink(struct efx_nic *efx, bool blink); |
20 | extern void tenxpress_crc_err(struct efx_nic *efx); | ||
21 | 20 | ||
22 | /**************************************************************************** | 21 | /**************************************************************************** |
23 | * Exported functions from the driver for XFP optical PHYs | 22 | * Exported functions from the driver for XFP optical PHYs |
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c index dba0d64d50cd..0a598084c513 100644 --- a/drivers/net/sfc/selftest.c +++ b/drivers/net/sfc/selftest.c | |||
@@ -665,6 +665,7 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, | |||
665 | { | 665 | { |
666 | enum efx_loopback_mode loopback_mode = efx->loopback_mode; | 666 | enum efx_loopback_mode loopback_mode = efx->loopback_mode; |
667 | int phy_mode = efx->phy_mode; | 667 | int phy_mode = efx->phy_mode; |
668 | enum reset_type reset_method = RESET_TYPE_INVISIBLE; | ||
668 | struct ethtool_cmd ecmd; | 669 | struct ethtool_cmd ecmd; |
669 | struct efx_channel *channel; | 670 | struct efx_channel *channel; |
670 | int rc_test = 0, rc_reset = 0, rc; | 671 | int rc_test = 0, rc_reset = 0, rc; |
@@ -718,21 +719,21 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, | |||
718 | mutex_unlock(&efx->mac_lock); | 719 | mutex_unlock(&efx->mac_lock); |
719 | 720 | ||
720 | /* free up all consumers of SRAM (including all the queues) */ | 721 | /* free up all consumers of SRAM (including all the queues) */ |
721 | efx_reset_down(efx, &ecmd); | 722 | efx_reset_down(efx, reset_method, &ecmd); |
722 | 723 | ||
723 | rc = efx_test_chip(efx, tests); | 724 | rc = efx_test_chip(efx, tests); |
724 | if (rc && !rc_test) | 725 | if (rc && !rc_test) |
725 | rc_test = rc; | 726 | rc_test = rc; |
726 | 727 | ||
727 | /* reset the chip to recover from the register test */ | 728 | /* reset the chip to recover from the register test */ |
728 | rc_reset = falcon_reset_hw(efx, RESET_TYPE_ALL); | 729 | rc_reset = falcon_reset_hw(efx, reset_method); |
729 | 730 | ||
730 | /* Ensure that the phy is powered and out of loopback | 731 | /* Ensure that the phy is powered and out of loopback |
731 | * for the bist and loopback tests */ | 732 | * for the bist and loopback tests */ |
732 | efx->phy_mode &= ~PHY_MODE_LOW_POWER; | 733 | efx->phy_mode &= ~PHY_MODE_LOW_POWER; |
733 | efx->loopback_mode = LOOPBACK_NONE; | 734 | efx->loopback_mode = LOOPBACK_NONE; |
734 | 735 | ||
735 | rc = efx_reset_up(efx, &ecmd, rc_reset == 0); | 736 | rc = efx_reset_up(efx, reset_method, &ecmd, rc_reset == 0); |
736 | if (rc && !rc_reset) | 737 | if (rc && !rc_reset) |
737 | rc_reset = rc; | 738 | rc_reset = rc; |
738 | 739 | ||
diff --git a/drivers/net/sfc/sfe4001.c b/drivers/net/sfc/sfe4001.c index 16b80acb9992..cb25ae5b257a 100644 --- a/drivers/net/sfc/sfe4001.c +++ b/drivers/net/sfc/sfe4001.c | |||
@@ -186,19 +186,22 @@ static int sfn4111t_reset(struct efx_nic *efx) | |||
186 | { | 186 | { |
187 | efx_oword_t reg; | 187 | efx_oword_t reg; |
188 | 188 | ||
189 | /* GPIO pins are also used for I2C, so block that temporarily */ | 189 | /* GPIO 3 and the GPIO register are shared with I2C, so block that */ |
190 | mutex_lock(&efx->i2c_adap.bus_lock); | 190 | mutex_lock(&efx->i2c_adap.bus_lock); |
191 | 191 | ||
192 | /* Pull RST_N (GPIO 2) low then let it up again, setting the | ||
193 | * FLASH_CFG_1 strap (GPIO 3) appropriately. Only change the | ||
194 | * output enables; the output levels should always be 0 (low) | ||
195 | * and we rely on external pull-ups. */ | ||
192 | falcon_read(efx, ®, GPIO_CTL_REG_KER); | 196 | falcon_read(efx, ®, GPIO_CTL_REG_KER); |
193 | EFX_SET_OWORD_FIELD(reg, GPIO2_OEN, true); | 197 | EFX_SET_OWORD_FIELD(reg, GPIO2_OEN, true); |
194 | EFX_SET_OWORD_FIELD(reg, GPIO2_OUT, false); | ||
195 | falcon_write(efx, ®, GPIO_CTL_REG_KER); | 198 | falcon_write(efx, ®, GPIO_CTL_REG_KER); |
196 | msleep(1000); | 199 | msleep(1000); |
197 | EFX_SET_OWORD_FIELD(reg, GPIO2_OUT, true); | 200 | EFX_SET_OWORD_FIELD(reg, GPIO2_OEN, false); |
198 | EFX_SET_OWORD_FIELD(reg, GPIO3_OEN, true); | 201 | EFX_SET_OWORD_FIELD(reg, GPIO3_OEN, |
199 | EFX_SET_OWORD_FIELD(reg, GPIO3_OUT, | 202 | !!(efx->phy_mode & PHY_MODE_SPECIAL)); |
200 | !(efx->phy_mode & PHY_MODE_SPECIAL)); | ||
201 | falcon_write(efx, ®, GPIO_CTL_REG_KER); | 203 | falcon_write(efx, ®, GPIO_CTL_REG_KER); |
204 | msleep(1); | ||
202 | 205 | ||
203 | mutex_unlock(&efx->i2c_adap.bus_lock); | 206 | mutex_unlock(&efx->i2c_adap.bus_lock); |
204 | 207 | ||
@@ -232,12 +235,18 @@ static ssize_t set_phy_flash_cfg(struct device *dev, | |||
232 | } else if (efx->state != STATE_RUNNING || netif_running(efx->net_dev)) { | 235 | } else if (efx->state != STATE_RUNNING || netif_running(efx->net_dev)) { |
233 | err = -EBUSY; | 236 | err = -EBUSY; |
234 | } else { | 237 | } else { |
238 | /* Reset the PHY, reconfigure the MAC and enable/disable | ||
239 | * MAC stats accordingly. */ | ||
235 | efx->phy_mode = new_mode; | 240 | efx->phy_mode = new_mode; |
241 | if (new_mode & PHY_MODE_SPECIAL) | ||
242 | efx_stats_disable(efx); | ||
236 | if (efx->board_info.type == EFX_BOARD_SFE4001) | 243 | if (efx->board_info.type == EFX_BOARD_SFE4001) |
237 | err = sfe4001_poweron(efx); | 244 | err = sfe4001_poweron(efx); |
238 | else | 245 | else |
239 | err = sfn4111t_reset(efx); | 246 | err = sfn4111t_reset(efx); |
240 | efx_reconfigure_port(efx); | 247 | efx_reconfigure_port(efx); |
248 | if (!(new_mode & PHY_MODE_SPECIAL)) | ||
249 | efx_stats_enable(efx); | ||
241 | } | 250 | } |
242 | rtnl_unlock(); | 251 | rtnl_unlock(); |
243 | 252 | ||
@@ -326,6 +335,11 @@ int sfe4001_init(struct efx_nic *efx) | |||
326 | efx->board_info.monitor = sfe4001_check_hw; | 335 | efx->board_info.monitor = sfe4001_check_hw; |
327 | efx->board_info.fini = sfe4001_fini; | 336 | efx->board_info.fini = sfe4001_fini; |
328 | 337 | ||
338 | if (efx->phy_mode & PHY_MODE_SPECIAL) { | ||
339 | /* PHY won't generate a 156.25 MHz clock and MAC stats fetch | ||
340 | * will fail. */ | ||
341 | efx_stats_disable(efx); | ||
342 | } | ||
329 | rc = sfe4001_poweron(efx); | 343 | rc = sfe4001_poweron(efx); |
330 | if (rc) | 344 | if (rc) |
331 | goto fail_ioexp; | 345 | goto fail_ioexp; |
@@ -372,17 +386,25 @@ static void sfn4111t_fini(struct efx_nic *efx) | |||
372 | i2c_unregister_device(efx->board_info.hwmon_client); | 386 | i2c_unregister_device(efx->board_info.hwmon_client); |
373 | } | 387 | } |
374 | 388 | ||
375 | static struct i2c_board_info sfn4111t_hwmon_info = { | 389 | static struct i2c_board_info sfn4111t_a0_hwmon_info = { |
376 | I2C_BOARD_INFO("max6647", 0x4e), | 390 | I2C_BOARD_INFO("max6647", 0x4e), |
377 | .irq = -1, | 391 | .irq = -1, |
378 | }; | 392 | }; |
379 | 393 | ||
394 | static struct i2c_board_info sfn4111t_r5_hwmon_info = { | ||
395 | I2C_BOARD_INFO("max6646", 0x4d), | ||
396 | .irq = -1, | ||
397 | }; | ||
398 | |||
380 | int sfn4111t_init(struct efx_nic *efx) | 399 | int sfn4111t_init(struct efx_nic *efx) |
381 | { | 400 | { |
382 | int rc; | 401 | int rc; |
383 | 402 | ||
384 | efx->board_info.hwmon_client = | 403 | efx->board_info.hwmon_client = |
385 | i2c_new_device(&efx->i2c_adap, &sfn4111t_hwmon_info); | 404 | i2c_new_device(&efx->i2c_adap, |
405 | (efx->board_info.minor < 5) ? | ||
406 | &sfn4111t_a0_hwmon_info : | ||
407 | &sfn4111t_r5_hwmon_info); | ||
386 | if (!efx->board_info.hwmon_client) | 408 | if (!efx->board_info.hwmon_client) |
387 | return -EIO; | 409 | return -EIO; |
388 | 410 | ||
@@ -394,8 +416,10 @@ int sfn4111t_init(struct efx_nic *efx) | |||
394 | if (rc) | 416 | if (rc) |
395 | goto fail_hwmon; | 417 | goto fail_hwmon; |
396 | 418 | ||
397 | if (efx->phy_mode & PHY_MODE_SPECIAL) | 419 | if (efx->phy_mode & PHY_MODE_SPECIAL) { |
420 | efx_stats_disable(efx); | ||
398 | sfn4111t_reset(efx); | 421 | sfn4111t_reset(efx); |
422 | } | ||
399 | 423 | ||
400 | return 0; | 424 | return 0; |
401 | 425 | ||
diff --git a/drivers/net/sfc/tenxpress.c b/drivers/net/sfc/tenxpress.c index b9768760fae7..f0efd246962c 100644 --- a/drivers/net/sfc/tenxpress.c +++ b/drivers/net/sfc/tenxpress.c | |||
@@ -67,6 +67,8 @@ | |||
67 | #define PMA_PMD_EXT_CLK312_WIDTH 1 | 67 | #define PMA_PMD_EXT_CLK312_WIDTH 1 |
68 | #define PMA_PMD_EXT_LPOWER_LBN 12 | 68 | #define PMA_PMD_EXT_LPOWER_LBN 12 |
69 | #define PMA_PMD_EXT_LPOWER_WIDTH 1 | 69 | #define PMA_PMD_EXT_LPOWER_WIDTH 1 |
70 | #define PMA_PMD_EXT_ROBUST_LBN 14 | ||
71 | #define PMA_PMD_EXT_ROBUST_WIDTH 1 | ||
70 | #define PMA_PMD_EXT_SSR_LBN 15 | 72 | #define PMA_PMD_EXT_SSR_LBN 15 |
71 | #define PMA_PMD_EXT_SSR_WIDTH 1 | 73 | #define PMA_PMD_EXT_SSR_WIDTH 1 |
72 | 74 | ||
@@ -177,35 +179,24 @@ | |||
177 | #define C22EXT_STATUS_LINK_LBN 2 | 179 | #define C22EXT_STATUS_LINK_LBN 2 |
178 | #define C22EXT_STATUS_LINK_WIDTH 1 | 180 | #define C22EXT_STATUS_LINK_WIDTH 1 |
179 | 181 | ||
180 | #define C22EXT_MSTSLV_REG 49162 | 182 | #define C22EXT_MSTSLV_CTRL 49161 |
181 | #define C22EXT_MSTSLV_1000_HD_LBN 10 | 183 | #define C22EXT_MSTSLV_CTRL_ADV_1000_HD_LBN 8 |
182 | #define C22EXT_MSTSLV_1000_HD_WIDTH 1 | 184 | #define C22EXT_MSTSLV_CTRL_ADV_1000_FD_LBN 9 |
183 | #define C22EXT_MSTSLV_1000_FD_LBN 11 | 185 | |
184 | #define C22EXT_MSTSLV_1000_FD_WIDTH 1 | 186 | #define C22EXT_MSTSLV_STATUS 49162 |
187 | #define C22EXT_MSTSLV_STATUS_LP_1000_HD_LBN 10 | ||
188 | #define C22EXT_MSTSLV_STATUS_LP_1000_FD_LBN 11 | ||
185 | 189 | ||
186 | /* Time to wait between powering down the LNPGA and turning off the power | 190 | /* Time to wait between powering down the LNPGA and turning off the power |
187 | * rails */ | 191 | * rails */ |
188 | #define LNPGA_PDOWN_WAIT (HZ / 5) | 192 | #define LNPGA_PDOWN_WAIT (HZ / 5) |
189 | 193 | ||
190 | static int crc_error_reset_threshold = 100; | ||
191 | module_param(crc_error_reset_threshold, int, 0644); | ||
192 | MODULE_PARM_DESC(crc_error_reset_threshold, | ||
193 | "Max number of CRC errors before XAUI reset"); | ||
194 | |||
195 | struct tenxpress_phy_data { | 194 | struct tenxpress_phy_data { |
196 | enum efx_loopback_mode loopback_mode; | 195 | enum efx_loopback_mode loopback_mode; |
197 | atomic_t bad_crc_count; | ||
198 | enum efx_phy_mode phy_mode; | 196 | enum efx_phy_mode phy_mode; |
199 | int bad_lp_tries; | 197 | int bad_lp_tries; |
200 | }; | 198 | }; |
201 | 199 | ||
202 | void tenxpress_crc_err(struct efx_nic *efx) | ||
203 | { | ||
204 | struct tenxpress_phy_data *phy_data = efx->phy_data; | ||
205 | if (phy_data != NULL) | ||
206 | atomic_inc(&phy_data->bad_crc_count); | ||
207 | } | ||
208 | |||
209 | static ssize_t show_phy_short_reach(struct device *dev, | 200 | static ssize_t show_phy_short_reach(struct device *dev, |
210 | struct device_attribute *attr, char *buf) | 201 | struct device_attribute *attr, char *buf) |
211 | { | 202 | { |
@@ -284,7 +275,9 @@ static int tenxpress_init(struct efx_nic *efx) | |||
284 | PMA_PMD_XCONTROL_REG); | 275 | PMA_PMD_XCONTROL_REG); |
285 | reg |= ((1 << PMA_PMD_EXT_GMII_EN_LBN) | | 276 | reg |= ((1 << PMA_PMD_EXT_GMII_EN_LBN) | |
286 | (1 << PMA_PMD_EXT_CLK_OUT_LBN) | | 277 | (1 << PMA_PMD_EXT_CLK_OUT_LBN) | |
287 | (1 << PMA_PMD_EXT_CLK312_LBN)); | 278 | (1 << PMA_PMD_EXT_CLK312_LBN) | |
279 | (1 << PMA_PMD_EXT_ROBUST_LBN)); | ||
280 | |||
288 | mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD, | 281 | mdio_clause45_write(efx, phy_id, MDIO_MMD_PMAPMD, |
289 | PMA_PMD_XCONTROL_REG, reg); | 282 | PMA_PMD_XCONTROL_REG, reg); |
290 | mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT, | 283 | mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT, |
@@ -346,6 +339,7 @@ static int tenxpress_phy_init(struct efx_nic *efx) | |||
346 | rc = tenxpress_init(efx); | 339 | rc = tenxpress_init(efx); |
347 | if (rc < 0) | 340 | if (rc < 0) |
348 | goto fail; | 341 | goto fail; |
342 | mdio_clause45_set_pause(efx); | ||
349 | 343 | ||
350 | if (efx->phy_type == PHY_TYPE_SFT9001B) { | 344 | if (efx->phy_type == PHY_TYPE_SFT9001B) { |
351 | rc = device_create_file(&efx->pci_dev->dev, | 345 | rc = device_create_file(&efx->pci_dev->dev, |
@@ -376,8 +370,8 @@ static int tenxpress_special_reset(struct efx_nic *efx) | |||
376 | 370 | ||
377 | /* The XGMAC clock is driven from the SFC7101/SFT9001 312MHz clock, so | 371 | /* The XGMAC clock is driven from the SFC7101/SFT9001 312MHz clock, so |
378 | * a special software reset can glitch the XGMAC sufficiently for stats | 372 | * a special software reset can glitch the XGMAC sufficiently for stats |
379 | * requests to fail. Since we don't often special_reset, just lock. */ | 373 | * requests to fail. */ |
380 | spin_lock(&efx->stats_lock); | 374 | efx_stats_disable(efx); |
381 | 375 | ||
382 | /* Initiate reset */ | 376 | /* Initiate reset */ |
383 | reg = mdio_clause45_read(efx, efx->mii.phy_id, | 377 | reg = mdio_clause45_read(efx, efx->mii.phy_id, |
@@ -392,17 +386,17 @@ static int tenxpress_special_reset(struct efx_nic *efx) | |||
392 | rc = mdio_clause45_wait_reset_mmds(efx, | 386 | rc = mdio_clause45_wait_reset_mmds(efx, |
393 | TENXPRESS_REQUIRED_DEVS); | 387 | TENXPRESS_REQUIRED_DEVS); |
394 | if (rc < 0) | 388 | if (rc < 0) |
395 | goto unlock; | 389 | goto out; |
396 | 390 | ||
397 | /* Try and reconfigure the device */ | 391 | /* Try and reconfigure the device */ |
398 | rc = tenxpress_init(efx); | 392 | rc = tenxpress_init(efx); |
399 | if (rc < 0) | 393 | if (rc < 0) |
400 | goto unlock; | 394 | goto out; |
401 | 395 | ||
402 | /* Wait for the XGXS state machine to churn */ | 396 | /* Wait for the XGXS state machine to churn */ |
403 | mdelay(10); | 397 | mdelay(10); |
404 | unlock: | 398 | out: |
405 | spin_unlock(&efx->stats_lock); | 399 | efx_stats_enable(efx); |
406 | return rc; | 400 | return rc; |
407 | } | 401 | } |
408 | 402 | ||
@@ -520,7 +514,7 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx) | |||
520 | { | 514 | { |
521 | struct tenxpress_phy_data *phy_data = efx->phy_data; | 515 | struct tenxpress_phy_data *phy_data = efx->phy_data; |
522 | struct ethtool_cmd ecmd; | 516 | struct ethtool_cmd ecmd; |
523 | bool phy_mode_change, loop_reset, loop_toggle, loopback; | 517 | bool phy_mode_change, loop_reset; |
524 | 518 | ||
525 | if (efx->phy_mode & (PHY_MODE_OFF | PHY_MODE_SPECIAL)) { | 519 | if (efx->phy_mode & (PHY_MODE_OFF | PHY_MODE_SPECIAL)) { |
526 | phy_data->phy_mode = efx->phy_mode; | 520 | phy_data->phy_mode = efx->phy_mode; |
@@ -531,12 +525,10 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx) | |||
531 | 525 | ||
532 | phy_mode_change = (efx->phy_mode == PHY_MODE_NORMAL && | 526 | phy_mode_change = (efx->phy_mode == PHY_MODE_NORMAL && |
533 | phy_data->phy_mode != PHY_MODE_NORMAL); | 527 | phy_data->phy_mode != PHY_MODE_NORMAL); |
534 | loopback = LOOPBACK_MASK(efx) & efx->phy_op->loopbacks; | ||
535 | loop_toggle = LOOPBACK_CHANGED(phy_data, efx, efx->phy_op->loopbacks); | ||
536 | loop_reset = (LOOPBACK_OUT_OF(phy_data, efx, efx->phy_op->loopbacks) || | 528 | loop_reset = (LOOPBACK_OUT_OF(phy_data, efx, efx->phy_op->loopbacks) || |
537 | LOOPBACK_CHANGED(phy_data, efx, 1 << LOOPBACK_GPHY)); | 529 | LOOPBACK_CHANGED(phy_data, efx, 1 << LOOPBACK_GPHY)); |
538 | 530 | ||
539 | if (loop_reset || loop_toggle || loopback || phy_mode_change) { | 531 | if (loop_reset || phy_mode_change) { |
540 | int rc; | 532 | int rc; |
541 | 533 | ||
542 | efx->phy_op->get_settings(efx, &ecmd); | 534 | efx->phy_op->get_settings(efx, &ecmd); |
@@ -551,20 +543,6 @@ static void tenxpress_phy_reconfigure(struct efx_nic *efx) | |||
551 | falcon_reset_xaui(efx); | 543 | falcon_reset_xaui(efx); |
552 | } | 544 | } |
553 | 545 | ||
554 | if (efx->phy_type != PHY_TYPE_SFX7101) { | ||
555 | /* Only change autoneg once, on coming out or | ||
556 | * going into loopback */ | ||
557 | if (loop_toggle) | ||
558 | ecmd.autoneg = !loopback; | ||
559 | if (loopback) { | ||
560 | ecmd.duplex = DUPLEX_FULL; | ||
561 | if (efx->loopback_mode == LOOPBACK_GPHY) | ||
562 | ecmd.speed = SPEED_1000; | ||
563 | else | ||
564 | ecmd.speed = SPEED_10000; | ||
565 | } | ||
566 | } | ||
567 | |||
568 | rc = efx->phy_op->set_settings(efx, &ecmd); | 546 | rc = efx->phy_op->set_settings(efx, &ecmd); |
569 | WARN_ON(rc); | 547 | WARN_ON(rc); |
570 | } | 548 | } |
@@ -623,23 +601,17 @@ static void tenxpress_phy_poll(struct efx_nic *efx) | |||
623 | 601 | ||
624 | if (phy_data->phy_mode != PHY_MODE_NORMAL) | 602 | if (phy_data->phy_mode != PHY_MODE_NORMAL) |
625 | return; | 603 | return; |
626 | |||
627 | if (EFX_WORKAROUND_10750(efx) && | ||
628 | atomic_read(&phy_data->bad_crc_count) > crc_error_reset_threshold) { | ||
629 | EFX_ERR(efx, "Resetting XAUI due to too many CRC errors\n"); | ||
630 | falcon_reset_xaui(efx); | ||
631 | atomic_set(&phy_data->bad_crc_count, 0); | ||
632 | } | ||
633 | } | 604 | } |
634 | 605 | ||
635 | static void tenxpress_phy_fini(struct efx_nic *efx) | 606 | static void tenxpress_phy_fini(struct efx_nic *efx) |
636 | { | 607 | { |
637 | int reg; | 608 | int reg; |
638 | 609 | ||
639 | if (efx->phy_type == PHY_TYPE_SFT9001B) { | 610 | if (efx->phy_type == PHY_TYPE_SFT9001B) |
640 | device_remove_file(&efx->pci_dev->dev, | 611 | device_remove_file(&efx->pci_dev->dev, |
641 | &dev_attr_phy_short_reach); | 612 | &dev_attr_phy_short_reach); |
642 | } else { | 613 | |
614 | if (efx->phy_type == PHY_TYPE_SFX7101) { | ||
643 | /* Power down the LNPGA */ | 615 | /* Power down the LNPGA */ |
644 | reg = (1 << PMA_PMD_LNPGA_POWERDOWN_LBN); | 616 | reg = (1 << PMA_PMD_LNPGA_POWERDOWN_LBN); |
645 | mdio_clause45_write(efx, efx->mii.phy_id, MDIO_MMD_PMAPMD, | 617 | mdio_clause45_write(efx, efx->mii.phy_id, MDIO_MMD_PMAPMD, |
@@ -771,107 +743,76 @@ reset: | |||
771 | return rc; | 743 | return rc; |
772 | } | 744 | } |
773 | 745 | ||
774 | static u32 tenxpress_get_xnp_lpa(struct efx_nic *efx) | 746 | static void |
747 | tenxpress_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd) | ||
775 | { | 748 | { |
776 | int phy = efx->mii.phy_id; | 749 | int phy_id = efx->mii.phy_id; |
777 | u32 lpa = 0; | 750 | u32 adv = 0, lpa = 0; |
778 | int reg; | 751 | int reg; |
779 | 752 | ||
780 | if (efx->phy_type != PHY_TYPE_SFX7101) { | 753 | if (efx->phy_type != PHY_TYPE_SFX7101) { |
781 | reg = mdio_clause45_read(efx, phy, MDIO_MMD_C22EXT, | 754 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT, |
782 | C22EXT_MSTSLV_REG); | 755 | C22EXT_MSTSLV_CTRL); |
783 | if (reg & (1 << C22EXT_MSTSLV_1000_HD_LBN)) | 756 | if (reg & (1 << C22EXT_MSTSLV_CTRL_ADV_1000_FD_LBN)) |
757 | adv |= ADVERTISED_1000baseT_Full; | ||
758 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT, | ||
759 | C22EXT_MSTSLV_STATUS); | ||
760 | if (reg & (1 << C22EXT_MSTSLV_STATUS_LP_1000_HD_LBN)) | ||
784 | lpa |= ADVERTISED_1000baseT_Half; | 761 | lpa |= ADVERTISED_1000baseT_Half; |
785 | if (reg & (1 << C22EXT_MSTSLV_1000_FD_LBN)) | 762 | if (reg & (1 << C22EXT_MSTSLV_STATUS_LP_1000_FD_LBN)) |
786 | lpa |= ADVERTISED_1000baseT_Full; | 763 | lpa |= ADVERTISED_1000baseT_Full; |
787 | } | 764 | } |
788 | reg = mdio_clause45_read(efx, phy, MDIO_MMD_AN, MDIO_AN_10GBT_STATUS); | 765 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN, |
766 | MDIO_AN_10GBT_CTRL); | ||
767 | if (reg & (1 << MDIO_AN_10GBT_CTRL_ADV_10G_LBN)) | ||
768 | adv |= ADVERTISED_10000baseT_Full; | ||
769 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_AN, | ||
770 | MDIO_AN_10GBT_STATUS); | ||
789 | if (reg & (1 << MDIO_AN_10GBT_STATUS_LP_10G_LBN)) | 771 | if (reg & (1 << MDIO_AN_10GBT_STATUS_LP_10G_LBN)) |
790 | lpa |= ADVERTISED_10000baseT_Full; | 772 | lpa |= ADVERTISED_10000baseT_Full; |
791 | return lpa; | ||
792 | } | ||
793 | 773 | ||
794 | static void sfx7101_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd) | 774 | mdio_clause45_get_settings_ext(efx, ecmd, adv, lpa); |
795 | { | 775 | |
796 | mdio_clause45_get_settings_ext(efx, ecmd, ADVERTISED_10000baseT_Full, | 776 | if (efx->phy_type != PHY_TYPE_SFX7101) |
797 | tenxpress_get_xnp_lpa(efx)); | 777 | ecmd->supported |= (SUPPORTED_100baseT_Full | |
798 | ecmd->supported |= SUPPORTED_10000baseT_Full; | 778 | SUPPORTED_1000baseT_Full); |
799 | ecmd->advertising |= ADVERTISED_10000baseT_Full; | 779 | |
780 | /* In loopback, the PHY automatically brings up the correct interface, | ||
781 | * but doesn't advertise the correct speed. So override it */ | ||
782 | if (efx->loopback_mode == LOOPBACK_GPHY) | ||
783 | ecmd->speed = SPEED_1000; | ||
784 | else if (LOOPBACK_MASK(efx) & efx->phy_op->loopbacks) | ||
785 | ecmd->speed = SPEED_10000; | ||
800 | } | 786 | } |
801 | 787 | ||
802 | static void sft9001_get_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd) | 788 | static int tenxpress_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd) |
803 | { | 789 | { |
804 | int phy_id = efx->mii.phy_id; | 790 | if (!ecmd->autoneg) |
805 | u32 xnp_adv = 0; | 791 | return -EINVAL; |
806 | int reg; | ||
807 | |||
808 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_PMAPMD, | ||
809 | PMA_PMD_SPEED_ENABLE_REG); | ||
810 | if (EFX_WORKAROUND_13204(efx) && (reg & (1 << PMA_PMD_100TX_ADV_LBN))) | ||
811 | xnp_adv |= ADVERTISED_100baseT_Full; | ||
812 | if (reg & (1 << PMA_PMD_1000T_ADV_LBN)) | ||
813 | xnp_adv |= ADVERTISED_1000baseT_Full; | ||
814 | if (reg & (1 << PMA_PMD_10000T_ADV_LBN)) | ||
815 | xnp_adv |= ADVERTISED_10000baseT_Full; | ||
816 | 792 | ||
817 | mdio_clause45_get_settings_ext(efx, ecmd, xnp_adv, | 793 | return mdio_clause45_set_settings(efx, ecmd); |
818 | tenxpress_get_xnp_lpa(efx)); | ||
819 | |||
820 | ecmd->supported |= (SUPPORTED_100baseT_Half | | ||
821 | SUPPORTED_100baseT_Full | | ||
822 | SUPPORTED_1000baseT_Full); | ||
823 | |||
824 | /* Use the vendor defined C22ext register for duplex settings */ | ||
825 | if (ecmd->speed != SPEED_10000 && !ecmd->autoneg) { | ||
826 | reg = mdio_clause45_read(efx, phy_id, MDIO_MMD_C22EXT, | ||
827 | GPHY_XCONTROL_REG); | ||
828 | ecmd->duplex = (reg & (1 << GPHY_DUPLEX_LBN) ? | ||
829 | DUPLEX_FULL : DUPLEX_HALF); | ||
830 | } | ||
831 | } | 794 | } |
832 | 795 | ||
833 | static int sft9001_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd) | 796 | static void sfx7101_set_npage_adv(struct efx_nic *efx, u32 advertising) |
834 | { | 797 | { |
835 | int phy_id = efx->mii.phy_id; | 798 | mdio_clause45_set_flag(efx, efx->mii.phy_id, MDIO_MMD_AN, |
836 | int rc; | 799 | MDIO_AN_10GBT_CTRL, |
837 | 800 | MDIO_AN_10GBT_CTRL_ADV_10G_LBN, | |
838 | rc = mdio_clause45_set_settings(efx, ecmd); | 801 | advertising & ADVERTISED_10000baseT_Full); |
839 | if (rc) | ||
840 | return rc; | ||
841 | |||
842 | if (ecmd->speed != SPEED_10000 && !ecmd->autoneg) | ||
843 | mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT, | ||
844 | GPHY_XCONTROL_REG, GPHY_DUPLEX_LBN, | ||
845 | ecmd->duplex == DUPLEX_FULL); | ||
846 | |||
847 | return rc; | ||
848 | } | 802 | } |
849 | 803 | ||
850 | static bool sft9001_set_xnp_advertise(struct efx_nic *efx, u32 advertising) | 804 | static void sft9001_set_npage_adv(struct efx_nic *efx, u32 advertising) |
851 | { | 805 | { |
852 | int phy = efx->mii.phy_id; | 806 | int phy_id = efx->mii.phy_id; |
853 | int reg = mdio_clause45_read(efx, phy, MDIO_MMD_PMAPMD, | 807 | |
854 | PMA_PMD_SPEED_ENABLE_REG); | 808 | mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_C22EXT, |
855 | bool enabled; | 809 | C22EXT_MSTSLV_CTRL, |
856 | 810 | C22EXT_MSTSLV_CTRL_ADV_1000_FD_LBN, | |
857 | reg &= ~((1 << 2) | (1 << 3)); | 811 | advertising & ADVERTISED_1000baseT_Full); |
858 | if (EFX_WORKAROUND_13204(efx) && | 812 | mdio_clause45_set_flag(efx, phy_id, MDIO_MMD_AN, |
859 | (advertising & ADVERTISED_100baseT_Full)) | 813 | MDIO_AN_10GBT_CTRL, |
860 | reg |= 1 << PMA_PMD_100TX_ADV_LBN; | 814 | MDIO_AN_10GBT_CTRL_ADV_10G_LBN, |
861 | if (advertising & ADVERTISED_1000baseT_Full) | 815 | advertising & ADVERTISED_10000baseT_Full); |
862 | reg |= 1 << PMA_PMD_1000T_ADV_LBN; | ||
863 | if (advertising & ADVERTISED_10000baseT_Full) | ||
864 | reg |= 1 << PMA_PMD_10000T_ADV_LBN; | ||
865 | mdio_clause45_write(efx, phy, MDIO_MMD_PMAPMD, | ||
866 | PMA_PMD_SPEED_ENABLE_REG, reg); | ||
867 | |||
868 | enabled = (advertising & | ||
869 | (ADVERTISED_1000baseT_Half | | ||
870 | ADVERTISED_1000baseT_Full | | ||
871 | ADVERTISED_10000baseT_Full)); | ||
872 | if (EFX_WORKAROUND_13204(efx)) | ||
873 | enabled |= (advertising & ADVERTISED_100baseT_Full); | ||
874 | return enabled; | ||
875 | } | 816 | } |
876 | 817 | ||
877 | struct efx_phy_operations falcon_sfx7101_phy_ops = { | 818 | struct efx_phy_operations falcon_sfx7101_phy_ops = { |
@@ -881,8 +822,9 @@ struct efx_phy_operations falcon_sfx7101_phy_ops = { | |||
881 | .poll = tenxpress_phy_poll, | 822 | .poll = tenxpress_phy_poll, |
882 | .fini = tenxpress_phy_fini, | 823 | .fini = tenxpress_phy_fini, |
883 | .clear_interrupt = efx_port_dummy_op_void, | 824 | .clear_interrupt = efx_port_dummy_op_void, |
884 | .get_settings = sfx7101_get_settings, | 825 | .get_settings = tenxpress_get_settings, |
885 | .set_settings = mdio_clause45_set_settings, | 826 | .set_settings = tenxpress_set_settings, |
827 | .set_npage_adv = sfx7101_set_npage_adv, | ||
886 | .num_tests = ARRAY_SIZE(sfx7101_test_names), | 828 | .num_tests = ARRAY_SIZE(sfx7101_test_names), |
887 | .test_names = sfx7101_test_names, | 829 | .test_names = sfx7101_test_names, |
888 | .run_tests = sfx7101_run_tests, | 830 | .run_tests = sfx7101_run_tests, |
@@ -897,9 +839,9 @@ struct efx_phy_operations falcon_sft9001_phy_ops = { | |||
897 | .poll = tenxpress_phy_poll, | 839 | .poll = tenxpress_phy_poll, |
898 | .fini = tenxpress_phy_fini, | 840 | .fini = tenxpress_phy_fini, |
899 | .clear_interrupt = efx_port_dummy_op_void, | 841 | .clear_interrupt = efx_port_dummy_op_void, |
900 | .get_settings = sft9001_get_settings, | 842 | .get_settings = tenxpress_get_settings, |
901 | .set_settings = sft9001_set_settings, | 843 | .set_settings = tenxpress_set_settings, |
902 | .set_xnp_advertise = sft9001_set_xnp_advertise, | 844 | .set_npage_adv = sft9001_set_npage_adv, |
903 | .num_tests = ARRAY_SIZE(sft9001_test_names), | 845 | .num_tests = ARRAY_SIZE(sft9001_test_names), |
904 | .test_names = sft9001_test_names, | 846 | .test_names = sft9001_test_names, |
905 | .run_tests = sft9001_run_tests, | 847 | .run_tests = sft9001_run_tests, |
diff --git a/drivers/net/sfc/workarounds.h b/drivers/net/sfc/workarounds.h index 82e03e1d7371..78de68f4a95b 100644 --- a/drivers/net/sfc/workarounds.h +++ b/drivers/net/sfc/workarounds.h | |||
@@ -18,8 +18,8 @@ | |||
18 | #define EFX_WORKAROUND_ALWAYS(efx) 1 | 18 | #define EFX_WORKAROUND_ALWAYS(efx) 1 |
19 | #define EFX_WORKAROUND_FALCON_A(efx) (falcon_rev(efx) <= FALCON_REV_A1) | 19 | #define EFX_WORKAROUND_FALCON_A(efx) (falcon_rev(efx) <= FALCON_REV_A1) |
20 | #define EFX_WORKAROUND_10G(efx) EFX_IS10G(efx) | 20 | #define EFX_WORKAROUND_10G(efx) EFX_IS10G(efx) |
21 | #define EFX_WORKAROUND_SFX7101(efx) ((efx)->phy_type == PHY_TYPE_SFX7101) | 21 | #define EFX_WORKAROUND_SFT9001(efx) ((efx)->phy_type == PHY_TYPE_SFT9001A || \ |
22 | #define EFX_WORKAROUND_SFT9001A(efx) ((efx)->phy_type == PHY_TYPE_SFT9001A) | 22 | (efx)->phy_type == PHY_TYPE_SFT9001B) |
23 | 23 | ||
24 | /* XAUI resets if link not detected */ | 24 | /* XAUI resets if link not detected */ |
25 | #define EFX_WORKAROUND_5147 EFX_WORKAROUND_ALWAYS | 25 | #define EFX_WORKAROUND_5147 EFX_WORKAROUND_ALWAYS |
@@ -29,8 +29,6 @@ | |||
29 | #define EFX_WORKAROUND_7884 EFX_WORKAROUND_10G | 29 | #define EFX_WORKAROUND_7884 EFX_WORKAROUND_10G |
30 | /* TX pkt parser problem with <= 16 byte TXes */ | 30 | /* TX pkt parser problem with <= 16 byte TXes */ |
31 | #define EFX_WORKAROUND_9141 EFX_WORKAROUND_ALWAYS | 31 | #define EFX_WORKAROUND_9141 EFX_WORKAROUND_ALWAYS |
32 | /* Low rate CRC errors require XAUI reset */ | ||
33 | #define EFX_WORKAROUND_10750 EFX_WORKAROUND_SFX7101 | ||
34 | /* TX_EV_PKT_ERR can be caused by a dangling TX descriptor | 32 | /* TX_EV_PKT_ERR can be caused by a dangling TX descriptor |
35 | * or a PCIe error (bug 11028) */ | 33 | * or a PCIe error (bug 11028) */ |
36 | #define EFX_WORKAROUND_10727 EFX_WORKAROUND_ALWAYS | 34 | #define EFX_WORKAROUND_10727 EFX_WORKAROUND_ALWAYS |
@@ -55,8 +53,8 @@ | |||
55 | #define EFX_WORKAROUND_8071 EFX_WORKAROUND_FALCON_A | 53 | #define EFX_WORKAROUND_8071 EFX_WORKAROUND_FALCON_A |
56 | 54 | ||
57 | /* Need to send XNP pages for 100BaseT */ | 55 | /* Need to send XNP pages for 100BaseT */ |
58 | #define EFX_WORKAROUND_13204 EFX_WORKAROUND_SFT9001A | 56 | #define EFX_WORKAROUND_13204 EFX_WORKAROUND_SFT9001 |
59 | /* Need to keep AN enabled */ | 57 | /* Don't restart AN in near-side loopback */ |
60 | #define EFX_WORKAROUND_13963 EFX_WORKAROUND_SFT9001A | 58 | #define EFX_WORKAROUND_15195 EFX_WORKAROUND_SFT9001 |
61 | 59 | ||
62 | #endif /* EFX_WORKAROUNDS_H */ | 60 | #endif /* EFX_WORKAROUNDS_H */ |
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index 4acd41a093ad..be4465bc0a69 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -389,6 +389,7 @@ static const struct net_device_ops sis900_netdev_ops = { | |||
389 | .ndo_set_multicast_list = set_rx_mode, | 389 | .ndo_set_multicast_list = set_rx_mode, |
390 | .ndo_change_mtu = eth_change_mtu, | 390 | .ndo_change_mtu = eth_change_mtu, |
391 | .ndo_validate_addr = eth_validate_addr, | 391 | .ndo_validate_addr = eth_validate_addr, |
392 | .ndo_set_mac_address = eth_mac_addr, | ||
392 | .ndo_do_ioctl = mii_ioctl, | 393 | .ndo_do_ioctl = mii_ioctl, |
393 | .ndo_tx_timeout = sis900_tx_timeout, | 394 | .ndo_tx_timeout = sis900_tx_timeout, |
394 | #ifdef CONFIG_NET_POLL_CONTROLLER | 395 | #ifdef CONFIG_NET_POLL_CONTROLLER |
@@ -508,10 +509,10 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev, | |||
508 | else | 509 | else |
509 | ret = sis900_get_mac_addr(pci_dev, net_dev); | 510 | ret = sis900_get_mac_addr(pci_dev, net_dev); |
510 | 511 | ||
511 | if (ret == 0) { | 512 | if (!ret || !is_valid_ether_addr(net_dev->dev_addr)) { |
512 | printk(KERN_WARNING "%s: Cannot read MAC address.\n", dev_name); | 513 | random_ether_addr(net_dev->dev_addr); |
513 | ret = -ENODEV; | 514 | printk(KERN_WARNING "%s: Unreadable or invalid MAC address," |
514 | goto err_unmap_rx; | 515 | "using random generated one\n", dev_name); |
515 | } | 516 | } |
516 | 517 | ||
517 | /* 630ET : set the mii access mode as software-mode */ | 518 | /* 630ET : set the mii access mode as software-mode */ |
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c index 607efeaf0bc5..9a00e5566af7 100644 --- a/drivers/net/skfp/skfddi.c +++ b/drivers/net/skfp/skfddi.c | |||
@@ -1003,9 +1003,9 @@ static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
1003 | break; | 1003 | break; |
1004 | case SKFP_CLR_STATS: /* Zero out the driver statistics */ | 1004 | case SKFP_CLR_STATS: /* Zero out the driver statistics */ |
1005 | if (!capable(CAP_NET_ADMIN)) { | 1005 | if (!capable(CAP_NET_ADMIN)) { |
1006 | memset(&lp->MacStat, 0, sizeof(lp->MacStat)); | ||
1007 | } else { | ||
1008 | status = -EPERM; | 1006 | status = -EPERM; |
1007 | } else { | ||
1008 | memset(&lp->MacStat, 0, sizeof(lp->MacStat)); | ||
1009 | } | 1009 | } |
1010 | break; | 1010 | break; |
1011 | default: | 1011 | default: |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 3668e81e474d..994703cc0db3 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1403,9 +1403,6 @@ static int sky2_up(struct net_device *dev) | |||
1403 | 1403 | ||
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | if (netif_msg_ifup(sky2)) | ||
1407 | printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); | ||
1408 | |||
1409 | netif_carrier_off(dev); | 1406 | netif_carrier_off(dev); |
1410 | 1407 | ||
1411 | /* must be power of 2 */ | 1408 | /* must be power of 2 */ |
@@ -1484,6 +1481,9 @@ static int sky2_up(struct net_device *dev) | |||
1484 | sky2_write32(hw, B0_IMSK, imask); | 1481 | sky2_write32(hw, B0_IMSK, imask); |
1485 | 1482 | ||
1486 | sky2_set_multicast(dev); | 1483 | sky2_set_multicast(dev); |
1484 | |||
1485 | if (netif_msg_ifup(sky2)) | ||
1486 | printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); | ||
1487 | return 0; | 1487 | return 0; |
1488 | 1488 | ||
1489 | err_out: | 1489 | err_out: |
diff --git a/drivers/net/smc-mca.c b/drivers/net/smc-mca.c index 404b80e5ba11..8d36d40649ef 100644 --- a/drivers/net/smc-mca.c +++ b/drivers/net/smc-mca.c | |||
@@ -192,6 +192,7 @@ static const struct net_device_ops ultramca_netdev_ops = { | |||
192 | .ndo_get_stats = ei_get_stats, | 192 | .ndo_get_stats = ei_get_stats, |
193 | .ndo_set_multicast_list = ei_set_multicast_list, | 193 | .ndo_set_multicast_list = ei_set_multicast_list, |
194 | .ndo_validate_addr = eth_validate_addr, | 194 | .ndo_validate_addr = eth_validate_addr, |
195 | .ndo_set_mac_address = eth_mac_addr, | ||
195 | .ndo_change_mtu = eth_change_mtu, | 196 | .ndo_change_mtu = eth_change_mtu, |
196 | #ifdef CONFIG_NET_POLL_CONTROLLER | 197 | #ifdef CONFIG_NET_POLL_CONTROLLER |
197 | .ndo_poll_controller = ei_poll, | 198 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c index b3866089a206..2033fee3143a 100644 --- a/drivers/net/smc-ultra.c +++ b/drivers/net/smc-ultra.c | |||
@@ -196,6 +196,7 @@ static const struct net_device_ops ultra_netdev_ops = { | |||
196 | .ndo_get_stats = ei_get_stats, | 196 | .ndo_get_stats = ei_get_stats, |
197 | .ndo_set_multicast_list = ei_set_multicast_list, | 197 | .ndo_set_multicast_list = ei_set_multicast_list, |
198 | .ndo_validate_addr = eth_validate_addr, | 198 | .ndo_validate_addr = eth_validate_addr, |
199 | .ndo_set_mac_address = eth_mac_addr, | ||
199 | .ndo_change_mtu = eth_change_mtu, | 200 | .ndo_change_mtu = eth_change_mtu, |
200 | #ifdef CONFIG_NET_POLL_CONTROLLER | 201 | #ifdef CONFIG_NET_POLL_CONTROLLER |
201 | .ndo_poll_controller = ei_poll, | 202 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index bf3aa2a1effe..223cde0d43be 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
@@ -220,9 +220,9 @@ static void smc911x_reset(struct net_device *dev) | |||
220 | 220 | ||
221 | /* make sure EEPROM has finished loading before setting GPIO_CFG */ | 221 | /* make sure EEPROM has finished loading before setting GPIO_CFG */ |
222 | timeout=1000; | 222 | timeout=1000; |
223 | while ( timeout-- && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) { | 223 | while (--timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) |
224 | udelay(10); | 224 | udelay(10); |
225 | } | 225 | |
226 | if (timeout == 0){ | 226 | if (timeout == 0){ |
227 | PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name); | 227 | PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name); |
228 | return; | 228 | return; |
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index dc3f1108884d..783c1a7b869e 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -144,6 +144,7 @@ static inline u32 smsc911x_reg_read(struct smsc911x_data *pdata, u32 reg) | |||
144 | } | 144 | } |
145 | 145 | ||
146 | BUG(); | 146 | BUG(); |
147 | return 0; | ||
147 | } | 148 | } |
148 | 149 | ||
149 | static inline void smsc911x_reg_write(struct smsc911x_data *pdata, u32 reg, | 150 | static inline void smsc911x_reg_write(struct smsc911x_data *pdata, u32 reg, |
@@ -952,7 +953,7 @@ smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes) | |||
952 | do { | 953 | do { |
953 | udelay(1); | 954 | udelay(1); |
954 | val = smsc911x_reg_read(pdata, RX_DP_CTRL); | 955 | val = smsc911x_reg_read(pdata, RX_DP_CTRL); |
955 | } while (timeout-- && (val & RX_DP_CTRL_RX_FFWD_)); | 956 | } while (--timeout && (val & RX_DP_CTRL_RX_FFWD_)); |
956 | 957 | ||
957 | if (unlikely(timeout == 0)) | 958 | if (unlikely(timeout == 0)) |
958 | SMSC_WARNING(HW, "Timed out waiting for " | 959 | SMSC_WARNING(HW, "Timed out waiting for " |
@@ -1740,6 +1741,7 @@ static const struct net_device_ops smsc911x_netdev_ops = { | |||
1740 | .ndo_set_multicast_list = smsc911x_set_multicast_list, | 1741 | .ndo_set_multicast_list = smsc911x_set_multicast_list, |
1741 | .ndo_do_ioctl = smsc911x_do_ioctl, | 1742 | .ndo_do_ioctl = smsc911x_do_ioctl, |
1742 | .ndo_validate_addr = eth_validate_addr, | 1743 | .ndo_validate_addr = eth_validate_addr, |
1744 | .ndo_set_mac_address = eth_mac_addr, | ||
1743 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1745 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1744 | .ndo_poll_controller = smsc911x_poll_controller, | 1746 | .ndo_poll_controller = smsc911x_poll_controller, |
1745 | #endif | 1747 | #endif |
@@ -1967,7 +1969,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev) | |||
1967 | smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF); | 1969 | smsc911x_reg_write(pdata, INT_STS, 0xFFFFFFFF); |
1968 | 1970 | ||
1969 | retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED, | 1971 | retval = request_irq(dev->irq, smsc911x_irqhandler, IRQF_DISABLED, |
1970 | SMSC_CHIPNAME, dev); | 1972 | dev->name, dev); |
1971 | if (retval) { | 1973 | if (retval) { |
1972 | SMSC_WARNING(PROBE, | 1974 | SMSC_WARNING(PROBE, |
1973 | "Unable to claim requested irq: %d", dev->irq); | 1975 | "Unable to claim requested irq: %d", dev->irq); |
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c index 27e017d96966..a1e4b3895b33 100644 --- a/drivers/net/smsc9420.c +++ b/drivers/net/smsc9420.c | |||
@@ -498,7 +498,7 @@ static void smsc9420_check_mac_address(struct net_device *dev) | |||
498 | static void smsc9420_stop_tx(struct smsc9420_pdata *pd) | 498 | static void smsc9420_stop_tx(struct smsc9420_pdata *pd) |
499 | { | 499 | { |
500 | u32 dmac_control, mac_cr, dma_intr_ena; | 500 | u32 dmac_control, mac_cr, dma_intr_ena; |
501 | int timeOut = 1000; | 501 | int timeout = 1000; |
502 | 502 | ||
503 | /* disable TX DMAC */ | 503 | /* disable TX DMAC */ |
504 | dmac_control = smsc9420_reg_read(pd, DMAC_CONTROL); | 504 | dmac_control = smsc9420_reg_read(pd, DMAC_CONTROL); |
@@ -506,13 +506,13 @@ static void smsc9420_stop_tx(struct smsc9420_pdata *pd) | |||
506 | smsc9420_reg_write(pd, DMAC_CONTROL, dmac_control); | 506 | smsc9420_reg_write(pd, DMAC_CONTROL, dmac_control); |
507 | 507 | ||
508 | /* Wait max 10ms for transmit process to stop */ | 508 | /* Wait max 10ms for transmit process to stop */ |
509 | while (timeOut--) { | 509 | while (--timeout) { |
510 | if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_TS_) | 510 | if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_TS_) |
511 | break; | 511 | break; |
512 | udelay(10); | 512 | udelay(10); |
513 | } | 513 | } |
514 | 514 | ||
515 | if (!timeOut) | 515 | if (!timeout) |
516 | smsc_warn(IFDOWN, "TX DMAC failed to stop"); | 516 | smsc_warn(IFDOWN, "TX DMAC failed to stop"); |
517 | 517 | ||
518 | /* ACK Tx DMAC stop bit */ | 518 | /* ACK Tx DMAC stop bit */ |
@@ -596,7 +596,7 @@ static void smsc9420_free_rx_ring(struct smsc9420_pdata *pd) | |||
596 | 596 | ||
597 | static void smsc9420_stop_rx(struct smsc9420_pdata *pd) | 597 | static void smsc9420_stop_rx(struct smsc9420_pdata *pd) |
598 | { | 598 | { |
599 | int timeOut = 1000; | 599 | int timeout = 1000; |
600 | u32 mac_cr, dmac_control, dma_intr_ena; | 600 | u32 mac_cr, dmac_control, dma_intr_ena; |
601 | 601 | ||
602 | /* mask RX DMAC interrupts */ | 602 | /* mask RX DMAC interrupts */ |
@@ -617,13 +617,13 @@ static void smsc9420_stop_rx(struct smsc9420_pdata *pd) | |||
617 | smsc9420_pci_flush_write(pd); | 617 | smsc9420_pci_flush_write(pd); |
618 | 618 | ||
619 | /* wait up to 10ms for receive to stop */ | 619 | /* wait up to 10ms for receive to stop */ |
620 | while (timeOut--) { | 620 | while (--timeout) { |
621 | if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_RS_) | 621 | if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_RS_) |
622 | break; | 622 | break; |
623 | udelay(10); | 623 | udelay(10); |
624 | } | 624 | } |
625 | 625 | ||
626 | if (!timeOut) | 626 | if (!timeout) |
627 | smsc_warn(IFDOWN, "RX DMAC did not stop! timeout."); | 627 | smsc_warn(IFDOWN, "RX DMAC did not stop! timeout."); |
628 | 628 | ||
629 | /* ACK the Rx DMAC stop bit */ | 629 | /* ACK the Rx DMAC stop bit */ |
@@ -1378,6 +1378,7 @@ static int smsc9420_open(struct net_device *dev) | |||
1378 | 1378 | ||
1379 | /* test the IRQ connection to the ISR */ | 1379 | /* test the IRQ connection to the ISR */ |
1380 | smsc_dbg(IFUP, "Testing ISR using IRQ %d", dev->irq); | 1380 | smsc_dbg(IFUP, "Testing ISR using IRQ %d", dev->irq); |
1381 | pd->software_irq_signal = false; | ||
1381 | 1382 | ||
1382 | spin_lock_irqsave(&pd->int_lock, flags); | 1383 | spin_lock_irqsave(&pd->int_lock, flags); |
1383 | /* configure interrupt deassertion timer and enable interrupts */ | 1384 | /* configure interrupt deassertion timer and enable interrupts */ |
@@ -1393,8 +1394,6 @@ static int smsc9420_open(struct net_device *dev) | |||
1393 | smsc9420_pci_flush_write(pd); | 1394 | smsc9420_pci_flush_write(pd); |
1394 | 1395 | ||
1395 | timeout = 1000; | 1396 | timeout = 1000; |
1396 | pd->software_irq_signal = false; | ||
1397 | smp_wmb(); | ||
1398 | while (timeout--) { | 1397 | while (timeout--) { |
1399 | if (pd->software_irq_signal) | 1398 | if (pd->software_irq_signal) |
1400 | break; | 1399 | break; |
@@ -1551,6 +1550,7 @@ static const struct net_device_ops smsc9420_netdev_ops = { | |||
1551 | .ndo_set_multicast_list = smsc9420_set_multicast_list, | 1550 | .ndo_set_multicast_list = smsc9420_set_multicast_list, |
1552 | .ndo_do_ioctl = smsc9420_do_ioctl, | 1551 | .ndo_do_ioctl = smsc9420_do_ioctl, |
1553 | .ndo_validate_addr = eth_validate_addr, | 1552 | .ndo_validate_addr = eth_validate_addr, |
1553 | .ndo_set_mac_address = eth_mac_addr, | ||
1554 | #ifdef CONFIG_NET_POLL_CONTROLLER | 1554 | #ifdef CONFIG_NET_POLL_CONTROLLER |
1555 | .ndo_poll_controller = smsc9420_poll_controller, | 1555 | .ndo_poll_controller = smsc9420_poll_controller, |
1556 | #endif /* CONFIG_NET_POLL_CONTROLLER */ | 1556 | #endif /* CONFIG_NET_POLL_CONTROLLER */ |
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 86c765d83de1..491876341068 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -148,7 +148,7 @@ static u16 __phy_read(struct gem *gp, int phy_addr, int reg) | |||
148 | cmd |= (MIF_FRAME_TAMSB); | 148 | cmd |= (MIF_FRAME_TAMSB); |
149 | writel(cmd, gp->regs + MIF_FRAME); | 149 | writel(cmd, gp->regs + MIF_FRAME); |
150 | 150 | ||
151 | while (limit--) { | 151 | while (--limit) { |
152 | cmd = readl(gp->regs + MIF_FRAME); | 152 | cmd = readl(gp->regs + MIF_FRAME); |
153 | if (cmd & MIF_FRAME_TALSB) | 153 | if (cmd & MIF_FRAME_TALSB) |
154 | break; | 154 | break; |
@@ -2221,6 +2221,8 @@ static int gem_do_start(struct net_device *dev) | |||
2221 | 2221 | ||
2222 | gp->running = 1; | 2222 | gp->running = 1; |
2223 | 2223 | ||
2224 | napi_enable(&gp->napi); | ||
2225 | |||
2224 | if (gp->lstate == link_up) { | 2226 | if (gp->lstate == link_up) { |
2225 | netif_carrier_on(gp->dev); | 2227 | netif_carrier_on(gp->dev); |
2226 | gem_set_link_modes(gp); | 2228 | gem_set_link_modes(gp); |
@@ -2238,6 +2240,8 @@ static int gem_do_start(struct net_device *dev) | |||
2238 | spin_lock_irqsave(&gp->lock, flags); | 2240 | spin_lock_irqsave(&gp->lock, flags); |
2239 | spin_lock(&gp->tx_lock); | 2241 | spin_lock(&gp->tx_lock); |
2240 | 2242 | ||
2243 | napi_disable(&gp->napi); | ||
2244 | |||
2241 | gp->running = 0; | 2245 | gp->running = 0; |
2242 | gem_reset(gp); | 2246 | gem_reset(gp); |
2243 | gem_clean_rings(gp); | 2247 | gem_clean_rings(gp); |
@@ -2338,8 +2342,6 @@ static int gem_open(struct net_device *dev) | |||
2338 | if (!gp->asleep) | 2342 | if (!gp->asleep) |
2339 | rc = gem_do_start(dev); | 2343 | rc = gem_do_start(dev); |
2340 | gp->opened = (rc == 0); | 2344 | gp->opened = (rc == 0); |
2341 | if (gp->opened) | ||
2342 | napi_enable(&gp->napi); | ||
2343 | 2345 | ||
2344 | mutex_unlock(&gp->pm_mutex); | 2346 | mutex_unlock(&gp->pm_mutex); |
2345 | 2347 | ||
@@ -2476,8 +2478,6 @@ static int gem_resume(struct pci_dev *pdev) | |||
2476 | 2478 | ||
2477 | /* Re-attach net device */ | 2479 | /* Re-attach net device */ |
2478 | netif_device_attach(dev); | 2480 | netif_device_attach(dev); |
2479 | |||
2480 | napi_enable(&gp->napi); | ||
2481 | } | 2481 | } |
2482 | 2482 | ||
2483 | spin_lock_irqsave(&gp->lock, flags); | 2483 | spin_lock_irqsave(&gp->lock, flags); |
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c index 61843fd57525..78f8cee5fd74 100644 --- a/drivers/net/sungem_phy.c +++ b/drivers/net/sungem_phy.c | |||
@@ -79,7 +79,7 @@ static int reset_one_mii_phy(struct mii_phy* phy, int phy_id) | |||
79 | 79 | ||
80 | udelay(100); | 80 | udelay(100); |
81 | 81 | ||
82 | while (limit--) { | 82 | while (--limit) { |
83 | val = __phy_read(phy, phy_id, MII_BMCR); | 83 | val = __phy_read(phy, phy_id, MII_BMCR); |
84 | if ((val & BMCR_RESET) == 0) | 84 | if ((val & BMCR_RESET) == 0) |
85 | break; | 85 | break; |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 7a72a3112f0a..cc4013be5e18 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -2629,6 +2629,14 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe) | |||
2629 | int i, qfe_slot = -1; | 2629 | int i, qfe_slot = -1; |
2630 | int err = -ENODEV; | 2630 | int err = -ENODEV; |
2631 | 2631 | ||
2632 | sbus_dp = to_of_device(op->dev.parent)->node; | ||
2633 | if (is_qfe) | ||
2634 | sbus_dp = to_of_device(op->dev.parent->parent)->node; | ||
2635 | |||
2636 | /* We can match PCI devices too, do not accept those here. */ | ||
2637 | if (strcmp(sbus_dp->name, "sbus")) | ||
2638 | return err; | ||
2639 | |||
2632 | if (is_qfe) { | 2640 | if (is_qfe) { |
2633 | qp = quattro_sbus_find(op); | 2641 | qp = quattro_sbus_find(op); |
2634 | if (qp == NULL) | 2642 | if (qp == NULL) |
@@ -2734,10 +2742,6 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe) | |||
2734 | if (qp != NULL) | 2742 | if (qp != NULL) |
2735 | hp->happy_flags |= HFLAG_QUATTRO; | 2743 | hp->happy_flags |= HFLAG_QUATTRO; |
2736 | 2744 | ||
2737 | sbus_dp = to_of_device(op->dev.parent)->node; | ||
2738 | if (is_qfe) | ||
2739 | sbus_dp = to_of_device(op->dev.parent->parent)->node; | ||
2740 | |||
2741 | /* Get the supported DVMA burst sizes from our Happy SBUS. */ | 2745 | /* Get the supported DVMA burst sizes from our Happy SBUS. */ |
2742 | hp->happy_bursts = of_getintprop_default(sbus_dp, | 2746 | hp->happy_bursts = of_getintprop_default(sbus_dp, |
2743 | "burst-sizes", 0x00); | 2747 | "burst-sizes", 0x00); |
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c index 6e8f377355fe..fe0c3f244562 100644 --- a/drivers/net/sunqe.c +++ b/drivers/net/sunqe.c | |||
@@ -227,7 +227,7 @@ static int qe_init(struct sunqe *qep, int from_irq) | |||
227 | if (!(sbus_readb(mregs + MREGS_PHYCONFIG) & MREGS_PHYCONFIG_LTESTDIS)) { | 227 | if (!(sbus_readb(mregs + MREGS_PHYCONFIG) & MREGS_PHYCONFIG_LTESTDIS)) { |
228 | int tries = 50; | 228 | int tries = 50; |
229 | 229 | ||
230 | while (tries--) { | 230 | while (--tries) { |
231 | u8 tmp; | 231 | u8 tmp; |
232 | 232 | ||
233 | mdelay(5); | 233 | mdelay(5); |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 5e2dbaee125b..8b3f84685387 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -7535,11 +7535,58 @@ static int tg3_test_msi(struct tg3 *tp) | |||
7535 | return err; | 7535 | return err; |
7536 | } | 7536 | } |
7537 | 7537 | ||
7538 | static int tg3_request_firmware(struct tg3 *tp) | ||
7539 | { | ||
7540 | const __be32 *fw_data; | ||
7541 | |||
7542 | if (request_firmware(&tp->fw, tp->fw_needed, &tp->pdev->dev)) { | ||
7543 | printk(KERN_ERR "%s: Failed to load firmware \"%s\"\n", | ||
7544 | tp->dev->name, tp->fw_needed); | ||
7545 | return -ENOENT; | ||
7546 | } | ||
7547 | |||
7548 | fw_data = (void *)tp->fw->data; | ||
7549 | |||
7550 | /* Firmware blob starts with version numbers, followed by | ||
7551 | * start address and _full_ length including BSS sections | ||
7552 | * (which must be longer than the actual data, of course | ||
7553 | */ | ||
7554 | |||
7555 | tp->fw_len = be32_to_cpu(fw_data[2]); /* includes bss */ | ||
7556 | if (tp->fw_len < (tp->fw->size - 12)) { | ||
7557 | printk(KERN_ERR "%s: bogus length %d in \"%s\"\n", | ||
7558 | tp->dev->name, tp->fw_len, tp->fw_needed); | ||
7559 | release_firmware(tp->fw); | ||
7560 | tp->fw = NULL; | ||
7561 | return -EINVAL; | ||
7562 | } | ||
7563 | |||
7564 | /* We no longer need firmware; we have it. */ | ||
7565 | tp->fw_needed = NULL; | ||
7566 | return 0; | ||
7567 | } | ||
7568 | |||
7538 | static int tg3_open(struct net_device *dev) | 7569 | static int tg3_open(struct net_device *dev) |
7539 | { | 7570 | { |
7540 | struct tg3 *tp = netdev_priv(dev); | 7571 | struct tg3 *tp = netdev_priv(dev); |
7541 | int err; | 7572 | int err; |
7542 | 7573 | ||
7574 | if (tp->fw_needed) { | ||
7575 | err = tg3_request_firmware(tp); | ||
7576 | if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) { | ||
7577 | if (err) | ||
7578 | return err; | ||
7579 | } else if (err) { | ||
7580 | printk(KERN_WARNING "%s: TSO capability disabled.\n", | ||
7581 | tp->dev->name); | ||
7582 | tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE; | ||
7583 | } else if (!(tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE)) { | ||
7584 | printk(KERN_NOTICE "%s: TSO capability restored.\n", | ||
7585 | tp->dev->name); | ||
7586 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; | ||
7587 | } | ||
7588 | } | ||
7589 | |||
7543 | netif_carrier_off(tp->dev); | 7590 | netif_carrier_off(tp->dev); |
7544 | 7591 | ||
7545 | err = tg3_set_power_state(tp, PCI_D0); | 7592 | err = tg3_set_power_state(tp, PCI_D0); |
@@ -12934,7 +12981,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
12934 | struct net_device *dev; | 12981 | struct net_device *dev; |
12935 | struct tg3 *tp; | 12982 | struct tg3 *tp; |
12936 | int err, pm_cap; | 12983 | int err, pm_cap; |
12937 | const char *fw_name = NULL; | ||
12938 | char str[40]; | 12984 | char str[40]; |
12939 | u64 dma_mask, persist_dma_mask; | 12985 | u64 dma_mask, persist_dma_mask; |
12940 | 12986 | ||
@@ -13091,7 +13137,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13091 | tg3_init_bufmgr_config(tp); | 13137 | tg3_init_bufmgr_config(tp); |
13092 | 13138 | ||
13093 | if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) | 13139 | if (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0) |
13094 | fw_name = FIRMWARE_TG3; | 13140 | tp->fw_needed = FIRMWARE_TG3; |
13095 | 13141 | ||
13096 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { | 13142 | if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) { |
13097 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; | 13143 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE; |
@@ -13104,37 +13150,10 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, | |||
13104 | tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE; | 13150 | tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE; |
13105 | } else { | 13151 | } else { |
13106 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE | TG3_FLG2_TSO_BUG; | 13152 | tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE | TG3_FLG2_TSO_BUG; |
13107 | } | ||
13108 | if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) { | ||
13109 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) | 13153 | if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) |
13110 | fw_name = FIRMWARE_TG3TSO5; | 13154 | tp->fw_needed = FIRMWARE_TG3TSO5; |
13111 | else | 13155 | else |
13112 | fw_name = FIRMWARE_TG3TSO; | 13156 | tp->fw_needed = FIRMWARE_TG3TSO; |
13113 | } | ||
13114 | |||
13115 | if (fw_name) { | ||
13116 | const __be32 *fw_data; | ||
13117 | |||
13118 | err = request_firmware(&tp->fw, fw_name, &tp->pdev->dev); | ||
13119 | if (err) { | ||
13120 | printk(KERN_ERR "tg3: Failed to load firmware \"%s\"\n", | ||
13121 | fw_name); | ||
13122 | goto err_out_iounmap; | ||
13123 | } | ||
13124 | |||
13125 | fw_data = (void *)tp->fw->data; | ||
13126 | |||
13127 | /* Firmware blob starts with version numbers, followed by | ||
13128 | start address and _full_ length including BSS sections | ||
13129 | (which must be longer than the actual data, of course */ | ||
13130 | |||
13131 | tp->fw_len = be32_to_cpu(fw_data[2]); /* includes bss */ | ||
13132 | if (tp->fw_len < (tp->fw->size - 12)) { | ||
13133 | printk(KERN_ERR "tg3: bogus length %d in \"%s\"\n", | ||
13134 | tp->fw_len, fw_name); | ||
13135 | err = -EINVAL; | ||
13136 | goto err_out_fw; | ||
13137 | } | ||
13138 | } | 13157 | } |
13139 | 13158 | ||
13140 | /* TSO is on by default on chips that support hardware TSO. | 13159 | /* TSO is on by default on chips that support hardware TSO. |
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h index ae5da603c6af..508def3e077f 100644 --- a/drivers/net/tg3.h +++ b/drivers/net/tg3.h | |||
@@ -2764,6 +2764,7 @@ struct tg3 { | |||
2764 | struct ethtool_coalesce coal; | 2764 | struct ethtool_coalesce coal; |
2765 | 2765 | ||
2766 | /* firmware info */ | 2766 | /* firmware info */ |
2767 | const char *fw_needed; | ||
2767 | const struct firmware *fw; | 2768 | const struct firmware *fw; |
2768 | u32 fw_len; /* includes BSS */ | 2769 | u32 fw_len; /* includes BSS */ |
2769 | }; | 2770 | }; |
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c index 75461dbd4876..a9fd2b2ccaf6 100644 --- a/drivers/net/tsi108_eth.c +++ b/drivers/net/tsi108_eth.c | |||
@@ -1237,7 +1237,7 @@ static void tsi108_init_phy(struct net_device *dev) | |||
1237 | spin_lock_irqsave(&phy_lock, flags); | 1237 | spin_lock_irqsave(&phy_lock, flags); |
1238 | 1238 | ||
1239 | tsi108_write_mii(data, MII_BMCR, BMCR_RESET); | 1239 | tsi108_write_mii(data, MII_BMCR, BMCR_RESET); |
1240 | while (i--){ | 1240 | while (--i) { |
1241 | if(!(tsi108_read_mii(data, MII_BMCR) & BMCR_RESET)) | 1241 | if(!(tsi108_read_mii(data, MII_BMCR) & BMCR_RESET)) |
1242 | break; | 1242 | break; |
1243 | udelay(10); | 1243 | udelay(10); |
diff --git a/drivers/net/tulip/21142.c b/drivers/net/tulip/21142.c index 1210fb3748a7..db7d5e11855d 100644 --- a/drivers/net/tulip/21142.c +++ b/drivers/net/tulip/21142.c | |||
@@ -9,6 +9,11 @@ | |||
9 | 9 | ||
10 | Please refer to Documentation/DocBook/tulip-user.{pdf,ps,html} | 10 | Please refer to Documentation/DocBook/tulip-user.{pdf,ps,html} |
11 | for more information on this driver. | 11 | for more information on this driver. |
12 | |||
13 | DC21143 manual "21143 PCI/CardBus 10/100Mb/s Ethernet LAN Controller | ||
14 | Hardware Reference Manual" is currently available at : | ||
15 | http://developer.intel.com/design/network/manuals/278074.htm | ||
16 | |||
12 | Please submit bugs to http://bugzilla.kernel.org/ . | 17 | Please submit bugs to http://bugzilla.kernel.org/ . |
13 | */ | 18 | */ |
14 | 19 | ||
@@ -32,7 +37,11 @@ void t21142_media_task(struct work_struct *work) | |||
32 | int csr12 = ioread32(ioaddr + CSR12); | 37 | int csr12 = ioread32(ioaddr + CSR12); |
33 | int next_tick = 60*HZ; | 38 | int next_tick = 60*HZ; |
34 | int new_csr6 = 0; | 39 | int new_csr6 = 0; |
40 | int csr14 = ioread32(ioaddr + CSR14); | ||
35 | 41 | ||
42 | /* CSR12[LS10,LS100] are not reliable during autonegotiation */ | ||
43 | if ((csr14 & 0x80) && (csr12 & 0x7000) != 0x5000) | ||
44 | csr12 |= 6; | ||
36 | if (tulip_debug > 2) | 45 | if (tulip_debug > 2) |
37 | printk(KERN_INFO"%s: 21143 negotiation status %8.8x, %s.\n", | 46 | printk(KERN_INFO"%s: 21143 negotiation status %8.8x, %s.\n", |
38 | dev->name, csr12, medianame[dev->if_port]); | 47 | dev->name, csr12, medianame[dev->if_port]); |
@@ -76,7 +85,7 @@ void t21142_media_task(struct work_struct *work) | |||
76 | new_csr6 = 0x83860000; | 85 | new_csr6 = 0x83860000; |
77 | dev->if_port = 3; | 86 | dev->if_port = 3; |
78 | iowrite32(0, ioaddr + CSR13); | 87 | iowrite32(0, ioaddr + CSR13); |
79 | iowrite32(0x0003FF7F, ioaddr + CSR14); | 88 | iowrite32(0x0003FFFF, ioaddr + CSR14); |
80 | iowrite16(8, ioaddr + CSR15); | 89 | iowrite16(8, ioaddr + CSR15); |
81 | iowrite32(1, ioaddr + CSR13); | 90 | iowrite32(1, ioaddr + CSR13); |
82 | } | 91 | } |
@@ -132,10 +141,14 @@ void t21142_lnk_change(struct net_device *dev, int csr5) | |||
132 | struct tulip_private *tp = netdev_priv(dev); | 141 | struct tulip_private *tp = netdev_priv(dev); |
133 | void __iomem *ioaddr = tp->base_addr; | 142 | void __iomem *ioaddr = tp->base_addr; |
134 | int csr12 = ioread32(ioaddr + CSR12); | 143 | int csr12 = ioread32(ioaddr + CSR12); |
144 | int csr14 = ioread32(ioaddr + CSR14); | ||
135 | 145 | ||
146 | /* CSR12[LS10,LS100] are not reliable during autonegotiation */ | ||
147 | if ((csr14 & 0x80) && (csr12 & 0x7000) != 0x5000) | ||
148 | csr12 |= 6; | ||
136 | if (tulip_debug > 1) | 149 | if (tulip_debug > 1) |
137 | printk(KERN_INFO"%s: 21143 link status interrupt %8.8x, CSR5 %x, " | 150 | printk(KERN_INFO"%s: 21143 link status interrupt %8.8x, CSR5 %x, " |
138 | "%8.8x.\n", dev->name, csr12, csr5, ioread32(ioaddr + CSR14)); | 151 | "%8.8x.\n", dev->name, csr12, csr5, csr14); |
139 | 152 | ||
140 | /* If NWay finished and we have a negotiated partner capability. */ | 153 | /* If NWay finished and we have a negotiated partner capability. */ |
141 | if (tp->nway && !tp->nwayset && (csr12 & 0x7000) == 0x5000) { | 154 | if (tp->nway && !tp->nwayset && (csr12 & 0x7000) == 0x5000) { |
@@ -143,7 +156,9 @@ void t21142_lnk_change(struct net_device *dev, int csr5) | |||
143 | int negotiated = tp->sym_advertise & (csr12 >> 16); | 156 | int negotiated = tp->sym_advertise & (csr12 >> 16); |
144 | tp->lpar = csr12 >> 16; | 157 | tp->lpar = csr12 >> 16; |
145 | tp->nwayset = 1; | 158 | tp->nwayset = 1; |
146 | if (negotiated & 0x0100) dev->if_port = 5; | 159 | /* If partner cannot negotiate, it is 10Mbps Half Duplex */ |
160 | if (!(csr12 & 0x8000)) dev->if_port = 0; | ||
161 | else if (negotiated & 0x0100) dev->if_port = 5; | ||
147 | else if (negotiated & 0x0080) dev->if_port = 3; | 162 | else if (negotiated & 0x0080) dev->if_port = 3; |
148 | else if (negotiated & 0x0040) dev->if_port = 4; | 163 | else if (negotiated & 0x0040) dev->if_port = 4; |
149 | else if (negotiated & 0x0020) dev->if_port = 0; | 164 | else if (negotiated & 0x0020) dev->if_port = 0; |
@@ -214,7 +229,7 @@ void t21142_lnk_change(struct net_device *dev, int csr5) | |||
214 | tp->timer.expires = RUN_AT(3*HZ); | 229 | tp->timer.expires = RUN_AT(3*HZ); |
215 | add_timer(&tp->timer); | 230 | add_timer(&tp->timer); |
216 | } else if (dev->if_port == 5) | 231 | } else if (dev->if_port == 5) |
217 | iowrite32(ioread32(ioaddr + CSR14) & ~0x080, ioaddr + CSR14); | 232 | iowrite32(csr14 & ~0x080, ioaddr + CSR14); |
218 | } else if (dev->if_port == 0 || dev->if_port == 4) { | 233 | } else if (dev->if_port == 0 || dev->if_port == 4) { |
219 | if ((csr12 & 4) == 0) | 234 | if ((csr12 & 4) == 0) |
220 | printk(KERN_INFO"%s: 21143 10baseT link beat good.\n", | 235 | printk(KERN_INFO"%s: 21143 10baseT link beat good.\n", |
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index d5d53b633cf8..d4c5ecc51f77 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -392,7 +392,7 @@ static void de_rx (struct de_private *de) | |||
392 | unsigned drop = 0; | 392 | unsigned drop = 0; |
393 | int rc; | 393 | int rc; |
394 | 394 | ||
395 | while (rx_work--) { | 395 | while (--rx_work) { |
396 | u32 status, len; | 396 | u32 status, len; |
397 | dma_addr_t mapping; | 397 | dma_addr_t mapping; |
398 | struct sk_buff *skb, *copy_skb; | 398 | struct sk_buff *skb, *copy_skb; |
@@ -464,13 +464,14 @@ static void de_rx (struct de_private *de) | |||
464 | drop = 1; | 464 | drop = 1; |
465 | 465 | ||
466 | rx_next: | 466 | rx_next: |
467 | de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn); | ||
468 | if (rx_tail == (DE_RX_RING_SIZE - 1)) | 467 | if (rx_tail == (DE_RX_RING_SIZE - 1)) |
469 | de->rx_ring[rx_tail].opts2 = | 468 | de->rx_ring[rx_tail].opts2 = |
470 | cpu_to_le32(RingEnd | de->rx_buf_sz); | 469 | cpu_to_le32(RingEnd | de->rx_buf_sz); |
471 | else | 470 | else |
472 | de->rx_ring[rx_tail].opts2 = cpu_to_le32(de->rx_buf_sz); | 471 | de->rx_ring[rx_tail].opts2 = cpu_to_le32(de->rx_buf_sz); |
473 | de->rx_ring[rx_tail].addr1 = cpu_to_le32(mapping); | 472 | de->rx_ring[rx_tail].addr1 = cpu_to_le32(mapping); |
473 | wmb(); | ||
474 | de->rx_ring[rx_tail].opts1 = cpu_to_le32(DescOwn); | ||
474 | rx_tail = NEXT_RX(rx_tail); | 475 | rx_tail = NEXT_RX(rx_tail); |
475 | } | 476 | } |
476 | 477 | ||
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index d7b81e4fdd56..09fea31d3e36 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -157,10 +157,16 @@ static int update_filter(struct tap_filter *filter, void __user *arg) | |||
157 | 157 | ||
158 | nexact = n; | 158 | nexact = n; |
159 | 159 | ||
160 | /* The rest is hashed */ | 160 | /* Remaining multicast addresses are hashed, |
161 | * unicast will leave the filter disabled. */ | ||
161 | memset(filter->mask, 0, sizeof(filter->mask)); | 162 | memset(filter->mask, 0, sizeof(filter->mask)); |
162 | for (; n < uf.count; n++) | 163 | for (; n < uf.count; n++) { |
164 | if (!is_multicast_ether_addr(addr[n].u)) { | ||
165 | err = 0; /* no filter */ | ||
166 | goto done; | ||
167 | } | ||
163 | addr_hash_set(filter->mask, addr[n].u); | 168 | addr_hash_set(filter->mask, addr[n].u); |
169 | } | ||
164 | 170 | ||
165 | /* For ALLMULTI just set the mask to all ones. | 171 | /* For ALLMULTI just set the mask to all ones. |
166 | * This overrides the mask populated above. */ | 172 | * This overrides the mask populated above. */ |
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 7d5a1303e30d..e87986867ba5 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -442,40 +442,30 @@ static void magic_packet_detection_enable(struct ucc_geth_private *ugeth) | |||
442 | { | 442 | { |
443 | struct ucc_fast_private *uccf; | 443 | struct ucc_fast_private *uccf; |
444 | struct ucc_geth __iomem *ug_regs; | 444 | struct ucc_geth __iomem *ug_regs; |
445 | u32 maccfg2, uccm; | ||
446 | 445 | ||
447 | uccf = ugeth->uccf; | 446 | uccf = ugeth->uccf; |
448 | ug_regs = ugeth->ug_regs; | 447 | ug_regs = ugeth->ug_regs; |
449 | 448 | ||
450 | /* Enable interrupts for magic packet detection */ | 449 | /* Enable interrupts for magic packet detection */ |
451 | uccm = in_be32(uccf->p_uccm); | 450 | setbits32(uccf->p_uccm, UCC_GETH_UCCE_MPD); |
452 | uccm |= UCCE_MPD; | ||
453 | out_be32(uccf->p_uccm, uccm); | ||
454 | 451 | ||
455 | /* Enable magic packet detection */ | 452 | /* Enable magic packet detection */ |
456 | maccfg2 = in_be32(&ug_regs->maccfg2); | 453 | setbits32(&ug_regs->maccfg2, MACCFG2_MPE); |
457 | maccfg2 |= MACCFG2_MPE; | ||
458 | out_be32(&ug_regs->maccfg2, maccfg2); | ||
459 | } | 454 | } |
460 | 455 | ||
461 | static void magic_packet_detection_disable(struct ucc_geth_private *ugeth) | 456 | static void magic_packet_detection_disable(struct ucc_geth_private *ugeth) |
462 | { | 457 | { |
463 | struct ucc_fast_private *uccf; | 458 | struct ucc_fast_private *uccf; |
464 | struct ucc_geth __iomem *ug_regs; | 459 | struct ucc_geth __iomem *ug_regs; |
465 | u32 maccfg2, uccm; | ||
466 | 460 | ||
467 | uccf = ugeth->uccf; | 461 | uccf = ugeth->uccf; |
468 | ug_regs = ugeth->ug_regs; | 462 | ug_regs = ugeth->ug_regs; |
469 | 463 | ||
470 | /* Disable interrupts for magic packet detection */ | 464 | /* Disable interrupts for magic packet detection */ |
471 | uccm = in_be32(uccf->p_uccm); | 465 | clrbits32(uccf->p_uccm, UCC_GETH_UCCE_MPD); |
472 | uccm &= ~UCCE_MPD; | ||
473 | out_be32(uccf->p_uccm, uccm); | ||
474 | 466 | ||
475 | /* Disable magic packet detection */ | 467 | /* Disable magic packet detection */ |
476 | maccfg2 = in_be32(&ug_regs->maccfg2); | 468 | clrbits32(&ug_regs->maccfg2, MACCFG2_MPE); |
477 | maccfg2 &= ~MACCFG2_MPE; | ||
478 | out_be32(&ug_regs->maccfg2, maccfg2); | ||
479 | } | 469 | } |
480 | #endif /* MAGIC_PACKET */ | 470 | #endif /* MAGIC_PACKET */ |
481 | 471 | ||
@@ -585,7 +575,8 @@ static void get_statistics(struct ucc_geth_private *ugeth, | |||
585 | 575 | ||
586 | /* Hardware only if user handed pointer and driver actually | 576 | /* Hardware only if user handed pointer and driver actually |
587 | gathers hardware statistics */ | 577 | gathers hardware statistics */ |
588 | if (hardware_statistics && (in_be32(&uf_regs->upsmr) & UPSMR_HSE)) { | 578 | if (hardware_statistics && |
579 | (in_be32(&uf_regs->upsmr) & UCC_GETH_UPSMR_HSE)) { | ||
589 | hardware_statistics->tx64 = in_be32(&ug_regs->tx64); | 580 | hardware_statistics->tx64 = in_be32(&ug_regs->tx64); |
590 | hardware_statistics->tx127 = in_be32(&ug_regs->tx127); | 581 | hardware_statistics->tx127 = in_be32(&ug_regs->tx127); |
591 | hardware_statistics->tx255 = in_be32(&ug_regs->tx255); | 582 | hardware_statistics->tx255 = in_be32(&ug_regs->tx255); |
@@ -1181,9 +1172,7 @@ int init_flow_control_params(u32 automatic_flow_control_mode, | |||
1181 | out_be32(uempr_register, value); | 1172 | out_be32(uempr_register, value); |
1182 | 1173 | ||
1183 | /* Set UPSMR register */ | 1174 | /* Set UPSMR register */ |
1184 | value = in_be32(upsmr_register); | 1175 | setbits32(upsmr_register, automatic_flow_control_mode); |
1185 | value |= automatic_flow_control_mode; | ||
1186 | out_be32(upsmr_register, value); | ||
1187 | 1176 | ||
1188 | value = in_be32(maccfg1_register); | 1177 | value = in_be32(maccfg1_register); |
1189 | if (rx_flow_control_enable) | 1178 | if (rx_flow_control_enable) |
@@ -1200,14 +1189,11 @@ static int init_hw_statistics_gathering_mode(int enable_hardware_statistics, | |||
1200 | u32 __iomem *upsmr_register, | 1189 | u32 __iomem *upsmr_register, |
1201 | u16 __iomem *uescr_register) | 1190 | u16 __iomem *uescr_register) |
1202 | { | 1191 | { |
1203 | u32 upsmr_value = 0; | ||
1204 | u16 uescr_value = 0; | 1192 | u16 uescr_value = 0; |
1193 | |||
1205 | /* Enable hardware statistics gathering if requested */ | 1194 | /* Enable hardware statistics gathering if requested */ |
1206 | if (enable_hardware_statistics) { | 1195 | if (enable_hardware_statistics) |
1207 | upsmr_value = in_be32(upsmr_register); | 1196 | setbits32(upsmr_register, UCC_GETH_UPSMR_HSE); |
1208 | upsmr_value |= UPSMR_HSE; | ||
1209 | out_be32(upsmr_register, upsmr_value); | ||
1210 | } | ||
1211 | 1197 | ||
1212 | /* Clear hardware statistics counters */ | 1198 | /* Clear hardware statistics counters */ |
1213 | uescr_value = in_be16(uescr_register); | 1199 | uescr_value = in_be16(uescr_register); |
@@ -1233,23 +1219,17 @@ static int init_firmware_statistics_gathering_mode(int | |||
1233 | { | 1219 | { |
1234 | /* Note: this function does not check if */ | 1220 | /* Note: this function does not check if */ |
1235 | /* the parameters it receives are NULL */ | 1221 | /* the parameters it receives are NULL */ |
1236 | u16 temoder_value; | ||
1237 | u32 remoder_value; | ||
1238 | 1222 | ||
1239 | if (enable_tx_firmware_statistics) { | 1223 | if (enable_tx_firmware_statistics) { |
1240 | out_be32(tx_rmon_base_ptr, | 1224 | out_be32(tx_rmon_base_ptr, |
1241 | tx_firmware_statistics_structure_address); | 1225 | tx_firmware_statistics_structure_address); |
1242 | temoder_value = in_be16(temoder_register); | 1226 | setbits16(temoder_register, TEMODER_TX_RMON_STATISTICS_ENABLE); |
1243 | temoder_value |= TEMODER_TX_RMON_STATISTICS_ENABLE; | ||
1244 | out_be16(temoder_register, temoder_value); | ||
1245 | } | 1227 | } |
1246 | 1228 | ||
1247 | if (enable_rx_firmware_statistics) { | 1229 | if (enable_rx_firmware_statistics) { |
1248 | out_be32(rx_rmon_base_ptr, | 1230 | out_be32(rx_rmon_base_ptr, |
1249 | rx_firmware_statistics_structure_address); | 1231 | rx_firmware_statistics_structure_address); |
1250 | remoder_value = in_be32(remoder_register); | 1232 | setbits32(remoder_register, REMODER_RX_RMON_STATISTICS_ENABLE); |
1251 | remoder_value |= REMODER_RX_RMON_STATISTICS_ENABLE; | ||
1252 | out_be32(remoder_register, remoder_value); | ||
1253 | } | 1233 | } |
1254 | 1234 | ||
1255 | return 0; | 1235 | return 0; |
@@ -1316,15 +1296,12 @@ static int init_check_frame_length_mode(int length_check, | |||
1316 | static int init_preamble_length(u8 preamble_length, | 1296 | static int init_preamble_length(u8 preamble_length, |
1317 | u32 __iomem *maccfg2_register) | 1297 | u32 __iomem *maccfg2_register) |
1318 | { | 1298 | { |
1319 | u32 value = 0; | ||
1320 | |||
1321 | if ((preamble_length < 3) || (preamble_length > 7)) | 1299 | if ((preamble_length < 3) || (preamble_length > 7)) |
1322 | return -EINVAL; | 1300 | return -EINVAL; |
1323 | 1301 | ||
1324 | value = in_be32(maccfg2_register); | 1302 | clrsetbits_be32(maccfg2_register, MACCFG2_PREL_MASK, |
1325 | value &= ~MACCFG2_PREL_MASK; | 1303 | preamble_length << MACCFG2_PREL_SHIFT); |
1326 | value |= (preamble_length << MACCFG2_PREL_SHIFT); | 1304 | |
1327 | out_be32(maccfg2_register, value); | ||
1328 | return 0; | 1305 | return 0; |
1329 | } | 1306 | } |
1330 | 1307 | ||
@@ -1337,19 +1314,19 @@ static int init_rx_parameters(int reject_broadcast, | |||
1337 | value = in_be32(upsmr_register); | 1314 | value = in_be32(upsmr_register); |
1338 | 1315 | ||
1339 | if (reject_broadcast) | 1316 | if (reject_broadcast) |
1340 | value |= UPSMR_BRO; | 1317 | value |= UCC_GETH_UPSMR_BRO; |
1341 | else | 1318 | else |
1342 | value &= ~UPSMR_BRO; | 1319 | value &= ~UCC_GETH_UPSMR_BRO; |
1343 | 1320 | ||
1344 | if (receive_short_frames) | 1321 | if (receive_short_frames) |
1345 | value |= UPSMR_RSH; | 1322 | value |= UCC_GETH_UPSMR_RSH; |
1346 | else | 1323 | else |
1347 | value &= ~UPSMR_RSH; | 1324 | value &= ~UCC_GETH_UPSMR_RSH; |
1348 | 1325 | ||
1349 | if (promiscuous) | 1326 | if (promiscuous) |
1350 | value |= UPSMR_PRO; | 1327 | value |= UCC_GETH_UPSMR_PRO; |
1351 | else | 1328 | else |
1352 | value &= ~UPSMR_PRO; | 1329 | value &= ~UCC_GETH_UPSMR_PRO; |
1353 | 1330 | ||
1354 | out_be32(upsmr_register, value); | 1331 | out_be32(upsmr_register, value); |
1355 | 1332 | ||
@@ -1410,26 +1387,27 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth) | |||
1410 | 1387 | ||
1411 | /* Set UPSMR */ | 1388 | /* Set UPSMR */ |
1412 | upsmr = in_be32(&uf_regs->upsmr); | 1389 | upsmr = in_be32(&uf_regs->upsmr); |
1413 | upsmr &= ~(UPSMR_RPM | UPSMR_R10M | UPSMR_TBIM | UPSMR_RMM); | 1390 | upsmr &= ~(UCC_GETH_UPSMR_RPM | UCC_GETH_UPSMR_R10M | |
1391 | UCC_GETH_UPSMR_TBIM | UCC_GETH_UPSMR_RMM); | ||
1414 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_RMII) || | 1392 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_RMII) || |
1415 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII) || | 1393 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII) || |
1416 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_ID) || | 1394 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_ID) || |
1417 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID) || | 1395 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_RXID) || |
1418 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || | 1396 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || |
1419 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { | 1397 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { |
1420 | upsmr |= UPSMR_RPM; | 1398 | upsmr |= UCC_GETH_UPSMR_RPM; |
1421 | switch (ugeth->max_speed) { | 1399 | switch (ugeth->max_speed) { |
1422 | case SPEED_10: | 1400 | case SPEED_10: |
1423 | upsmr |= UPSMR_R10M; | 1401 | upsmr |= UCC_GETH_UPSMR_R10M; |
1424 | /* FALLTHROUGH */ | 1402 | /* FALLTHROUGH */ |
1425 | case SPEED_100: | 1403 | case SPEED_100: |
1426 | if (ugeth->phy_interface != PHY_INTERFACE_MODE_RTBI) | 1404 | if (ugeth->phy_interface != PHY_INTERFACE_MODE_RTBI) |
1427 | upsmr |= UPSMR_RMM; | 1405 | upsmr |= UCC_GETH_UPSMR_RMM; |
1428 | } | 1406 | } |
1429 | } | 1407 | } |
1430 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_TBI) || | 1408 | if ((ugeth->phy_interface == PHY_INTERFACE_MODE_TBI) || |
1431 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { | 1409 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { |
1432 | upsmr |= UPSMR_TBIM; | 1410 | upsmr |= UCC_GETH_UPSMR_TBIM; |
1433 | } | 1411 | } |
1434 | out_be32(&uf_regs->upsmr, upsmr); | 1412 | out_be32(&uf_regs->upsmr, upsmr); |
1435 | 1413 | ||
@@ -1517,9 +1495,9 @@ static void adjust_link(struct net_device *dev) | |||
1517 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || | 1495 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RGMII_TXID) || |
1518 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { | 1496 | (ugeth->phy_interface == PHY_INTERFACE_MODE_RTBI)) { |
1519 | if (phydev->speed == SPEED_10) | 1497 | if (phydev->speed == SPEED_10) |
1520 | upsmr |= UPSMR_R10M; | 1498 | upsmr |= UCC_GETH_UPSMR_R10M; |
1521 | else | 1499 | else |
1522 | upsmr &= ~(UPSMR_R10M); | 1500 | upsmr &= ~UCC_GETH_UPSMR_R10M; |
1523 | } | 1501 | } |
1524 | break; | 1502 | break; |
1525 | default: | 1503 | default: |
@@ -1558,6 +1536,11 @@ static void adjust_link(struct net_device *dev) | |||
1558 | static int init_phy(struct net_device *dev) | 1536 | static int init_phy(struct net_device *dev) |
1559 | { | 1537 | { |
1560 | struct ucc_geth_private *priv = netdev_priv(dev); | 1538 | struct ucc_geth_private *priv = netdev_priv(dev); |
1539 | struct device_node *np = priv->node; | ||
1540 | struct device_node *phy, *mdio; | ||
1541 | const phandle *ph; | ||
1542 | char bus_name[MII_BUS_ID_SIZE]; | ||
1543 | const unsigned int *id; | ||
1561 | struct phy_device *phydev; | 1544 | struct phy_device *phydev; |
1562 | char phy_id[BUS_ID_SIZE]; | 1545 | char phy_id[BUS_ID_SIZE]; |
1563 | 1546 | ||
@@ -1565,8 +1548,18 @@ static int init_phy(struct net_device *dev) | |||
1565 | priv->oldspeed = 0; | 1548 | priv->oldspeed = 0; |
1566 | priv->oldduplex = -1; | 1549 | priv->oldduplex = -1; |
1567 | 1550 | ||
1568 | snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, priv->ug_info->mdio_bus, | 1551 | ph = of_get_property(np, "phy-handle", NULL); |
1569 | priv->ug_info->phy_address); | 1552 | phy = of_find_node_by_phandle(*ph); |
1553 | mdio = of_get_parent(phy); | ||
1554 | |||
1555 | id = of_get_property(phy, "reg", NULL); | ||
1556 | |||
1557 | of_node_put(phy); | ||
1558 | of_node_put(mdio); | ||
1559 | |||
1560 | uec_mdio_bus_name(bus_name, mdio); | ||
1561 | snprintf(phy_id, sizeof(phy_id), "%s:%02x", | ||
1562 | bus_name, *id); | ||
1570 | 1563 | ||
1571 | phydev = phy_connect(dev, phy_id, &adjust_link, 0, priv->phy_interface); | 1564 | phydev = phy_connect(dev, phy_id, &adjust_link, 0, priv->phy_interface); |
1572 | 1565 | ||
@@ -1602,10 +1595,8 @@ static int ugeth_graceful_stop_tx(struct ucc_geth_private *ugeth) | |||
1602 | uccf = ugeth->uccf; | 1595 | uccf = ugeth->uccf; |
1603 | 1596 | ||
1604 | /* Mask GRACEFUL STOP TX interrupt bit and clear it */ | 1597 | /* Mask GRACEFUL STOP TX interrupt bit and clear it */ |
1605 | temp = in_be32(uccf->p_uccm); | 1598 | clrbits32(uccf->p_uccm, UCC_GETH_UCCE_GRA); |
1606 | temp &= ~UCCE_GRA; | 1599 | out_be32(uccf->p_ucce, UCC_GETH_UCCE_GRA); /* clear by writing 1 */ |
1607 | out_be32(uccf->p_uccm, temp); | ||
1608 | out_be32(uccf->p_ucce, UCCE_GRA); /* clear by writing 1 */ | ||
1609 | 1600 | ||
1610 | /* Issue host command */ | 1601 | /* Issue host command */ |
1611 | cecr_subblock = | 1602 | cecr_subblock = |
@@ -1617,7 +1608,7 @@ static int ugeth_graceful_stop_tx(struct ucc_geth_private *ugeth) | |||
1617 | do { | 1608 | do { |
1618 | msleep(10); | 1609 | msleep(10); |
1619 | temp = in_be32(uccf->p_ucce); | 1610 | temp = in_be32(uccf->p_ucce); |
1620 | } while (!(temp & UCCE_GRA) && --i); | 1611 | } while (!(temp & UCC_GETH_UCCE_GRA) && --i); |
1621 | 1612 | ||
1622 | uccf->stopped_tx = 1; | 1613 | uccf->stopped_tx = 1; |
1623 | 1614 | ||
@@ -1975,12 +1966,9 @@ static void ucc_geth_set_multi(struct net_device *dev) | |||
1975 | uf_regs = ugeth->uccf->uf_regs; | 1966 | uf_regs = ugeth->uccf->uf_regs; |
1976 | 1967 | ||
1977 | if (dev->flags & IFF_PROMISC) { | 1968 | if (dev->flags & IFF_PROMISC) { |
1978 | 1969 | setbits32(&uf_regs->upsmr, UCC_GETH_UPSMR_PRO); | |
1979 | out_be32(&uf_regs->upsmr, in_be32(&uf_regs->upsmr) | UPSMR_PRO); | ||
1980 | |||
1981 | } else { | 1970 | } else { |
1982 | 1971 | clrbits32(&uf_regs->upsmr, UCC_GETH_UPSMR_PRO); | |
1983 | out_be32(&uf_regs->upsmr, in_be32(&uf_regs->upsmr)&~UPSMR_PRO); | ||
1984 | 1972 | ||
1985 | p_82xx_addr_filt = | 1973 | p_82xx_addr_filt = |
1986 | (struct ucc_geth_82xx_address_filtering_pram __iomem *) ugeth-> | 1974 | (struct ucc_geth_82xx_address_filtering_pram __iomem *) ugeth-> |
@@ -2020,7 +2008,6 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth) | |||
2020 | { | 2008 | { |
2021 | struct ucc_geth __iomem *ug_regs = ugeth->ug_regs; | 2009 | struct ucc_geth __iomem *ug_regs = ugeth->ug_regs; |
2022 | struct phy_device *phydev = ugeth->phydev; | 2010 | struct phy_device *phydev = ugeth->phydev; |
2023 | u32 tempval; | ||
2024 | 2011 | ||
2025 | ugeth_vdbg("%s: IN", __func__); | 2012 | ugeth_vdbg("%s: IN", __func__); |
2026 | 2013 | ||
@@ -2037,9 +2024,7 @@ static void ucc_geth_stop(struct ucc_geth_private *ugeth) | |||
2037 | out_be32(ugeth->uccf->p_ucce, 0xffffffff); | 2024 | out_be32(ugeth->uccf->p_ucce, 0xffffffff); |
2038 | 2025 | ||
2039 | /* Disable Rx and Tx */ | 2026 | /* Disable Rx and Tx */ |
2040 | tempval = in_be32(&ug_regs->maccfg1); | 2027 | clrbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); |
2041 | tempval &= ~(MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); | ||
2042 | out_be32(&ug_regs->maccfg1, tempval); | ||
2043 | 2028 | ||
2044 | ucc_geth_memclean(ugeth); | 2029 | ucc_geth_memclean(ugeth); |
2045 | } | 2030 | } |
@@ -2153,10 +2138,10 @@ static int ucc_struct_init(struct ucc_geth_private *ugeth) | |||
2153 | /* Generate uccm_mask for receive */ | 2138 | /* Generate uccm_mask for receive */ |
2154 | uf_info->uccm_mask = ug_info->eventRegMask & UCCE_OTHER;/* Errors */ | 2139 | uf_info->uccm_mask = ug_info->eventRegMask & UCCE_OTHER;/* Errors */ |
2155 | for (i = 0; i < ug_info->numQueuesRx; i++) | 2140 | for (i = 0; i < ug_info->numQueuesRx; i++) |
2156 | uf_info->uccm_mask |= (UCCE_RXBF_SINGLE_MASK << i); | 2141 | uf_info->uccm_mask |= (UCC_GETH_UCCE_RXF0 << i); |
2157 | 2142 | ||
2158 | for (i = 0; i < ug_info->numQueuesTx; i++) | 2143 | for (i = 0; i < ug_info->numQueuesTx; i++) |
2159 | uf_info->uccm_mask |= (UCCE_TXBF_SINGLE_MASK << i); | 2144 | uf_info->uccm_mask |= (UCC_GETH_UCCE_TXB0 << i); |
2160 | /* Initialize the general fast UCC block. */ | 2145 | /* Initialize the general fast UCC block. */ |
2161 | if (ucc_fast_init(uf_info, &ugeth->uccf)) { | 2146 | if (ucc_fast_init(uf_info, &ugeth->uccf)) { |
2162 | if (netif_msg_probe(ugeth)) | 2147 | if (netif_msg_probe(ugeth)) |
@@ -2185,7 +2170,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) | |||
2185 | struct ucc_geth __iomem *ug_regs; | 2170 | struct ucc_geth __iomem *ug_regs; |
2186 | int ret_val = -EINVAL; | 2171 | int ret_val = -EINVAL; |
2187 | u32 remoder = UCC_GETH_REMODER_INIT; | 2172 | u32 remoder = UCC_GETH_REMODER_INIT; |
2188 | u32 init_enet_pram_offset, cecr_subblock, command, maccfg1; | 2173 | u32 init_enet_pram_offset, cecr_subblock, command; |
2189 | u32 ifstat, i, j, size, l2qt, l3qt, length; | 2174 | u32 ifstat, i, j, size, l2qt, l3qt, length; |
2190 | u16 temoder = UCC_GETH_TEMODER_INIT; | 2175 | u16 temoder = UCC_GETH_TEMODER_INIT; |
2191 | u16 test; | 2176 | u16 test; |
@@ -2281,10 +2266,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) | |||
2281 | &uf_regs->upsmr, | 2266 | &uf_regs->upsmr, |
2282 | &ug_regs->uempr, &ug_regs->maccfg1); | 2267 | &ug_regs->uempr, &ug_regs->maccfg1); |
2283 | 2268 | ||
2284 | maccfg1 = in_be32(&ug_regs->maccfg1); | 2269 | setbits32(&ug_regs->maccfg1, MACCFG1_ENABLE_RX | MACCFG1_ENABLE_TX); |
2285 | maccfg1 |= MACCFG1_ENABLE_RX; | ||
2286 | maccfg1 |= MACCFG1_ENABLE_TX; | ||
2287 | out_be32(&ug_regs->maccfg1, maccfg1); | ||
2288 | 2270 | ||
2289 | /* Set IPGIFG */ | 2271 | /* Set IPGIFG */ |
2290 | /* For more details see the hardware spec. */ | 2272 | /* For more details see the hardware spec. */ |
@@ -3274,7 +3256,6 @@ static int ucc_geth_tx(struct net_device *dev, u8 txQ) | |||
3274 | static int ucc_geth_poll(struct napi_struct *napi, int budget) | 3256 | static int ucc_geth_poll(struct napi_struct *napi, int budget) |
3275 | { | 3257 | { |
3276 | struct ucc_geth_private *ugeth = container_of(napi, struct ucc_geth_private, napi); | 3258 | struct ucc_geth_private *ugeth = container_of(napi, struct ucc_geth_private, napi); |
3277 | struct net_device *dev = ugeth->dev; | ||
3278 | struct ucc_geth_info *ug_info; | 3259 | struct ucc_geth_info *ug_info; |
3279 | int howmany, i; | 3260 | int howmany, i; |
3280 | 3261 | ||
@@ -3285,14 +3266,8 @@ static int ucc_geth_poll(struct napi_struct *napi, int budget) | |||
3285 | howmany += ucc_geth_rx(ugeth, i, budget - howmany); | 3266 | howmany += ucc_geth_rx(ugeth, i, budget - howmany); |
3286 | 3267 | ||
3287 | if (howmany < budget) { | 3268 | if (howmany < budget) { |
3288 | struct ucc_fast_private *uccf; | ||
3289 | u32 uccm; | ||
3290 | |||
3291 | netif_rx_complete(napi); | 3269 | netif_rx_complete(napi); |
3292 | uccf = ugeth->uccf; | 3270 | setbits32(ugeth->uccf->p_uccm, UCCE_RX_EVENTS); |
3293 | uccm = in_be32(uccf->p_uccm); | ||
3294 | uccm |= UCCE_RX_EVENTS; | ||
3295 | out_be32(uccf->p_uccm, uccm); | ||
3296 | } | 3271 | } |
3297 | 3272 | ||
3298 | return howmany; | 3273 | return howmany; |
@@ -3332,7 +3307,7 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info) | |||
3332 | /* Tx event processing */ | 3307 | /* Tx event processing */ |
3333 | if (ucce & UCCE_TX_EVENTS) { | 3308 | if (ucce & UCCE_TX_EVENTS) { |
3334 | spin_lock(&ugeth->lock); | 3309 | spin_lock(&ugeth->lock); |
3335 | tx_mask = UCCE_TXBF_SINGLE_MASK; | 3310 | tx_mask = UCC_GETH_UCCE_TXB0; |
3336 | for (i = 0; i < ug_info->numQueuesTx; i++) { | 3311 | for (i = 0; i < ug_info->numQueuesTx; i++) { |
3337 | if (ucce & tx_mask) | 3312 | if (ucce & tx_mask) |
3338 | ucc_geth_tx(dev, i); | 3313 | ucc_geth_tx(dev, i); |
@@ -3344,12 +3319,10 @@ static irqreturn_t ucc_geth_irq_handler(int irq, void *info) | |||
3344 | 3319 | ||
3345 | /* Errors and other events */ | 3320 | /* Errors and other events */ |
3346 | if (ucce & UCCE_OTHER) { | 3321 | if (ucce & UCCE_OTHER) { |
3347 | if (ucce & UCCE_BSY) { | 3322 | if (ucce & UCC_GETH_UCCE_BSY) |
3348 | dev->stats.rx_errors++; | 3323 | dev->stats.rx_errors++; |
3349 | } | 3324 | if (ucce & UCC_GETH_UCCE_TXE) |
3350 | if (ucce & UCCE_TXE) { | ||
3351 | dev->stats.tx_errors++; | 3325 | dev->stats.tx_errors++; |
3352 | } | ||
3353 | } | 3326 | } |
3354 | 3327 | ||
3355 | return IRQ_HANDLED; | 3328 | return IRQ_HANDLED; |
@@ -3790,6 +3763,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma | |||
3790 | 3763 | ||
3791 | ugeth->ug_info = ug_info; | 3764 | ugeth->ug_info = ug_info; |
3792 | ugeth->dev = dev; | 3765 | ugeth->dev = dev; |
3766 | ugeth->node = np; | ||
3793 | 3767 | ||
3794 | return 0; | 3768 | return 0; |
3795 | } | 3769 | } |
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h index d74d2f7cb739..16cbe42ba43c 100644 --- a/drivers/net/ucc_geth.h +++ b/drivers/net/ucc_geth.h | |||
@@ -162,92 +162,27 @@ struct ucc_geth { | |||
162 | boundary */ | 162 | boundary */ |
163 | 163 | ||
164 | /* UCC GETH Event Register */ | 164 | /* UCC GETH Event Register */ |
165 | #define UCCE_MPD 0x80000000 /* Magic packet | 165 | #define UCCE_TXB (UCC_GETH_UCCE_TXB7 | UCC_GETH_UCCE_TXB6 | \ |
166 | detection */ | 166 | UCC_GETH_UCCE_TXB5 | UCC_GETH_UCCE_TXB4 | \ |
167 | #define UCCE_SCAR 0x40000000 | 167 | UCC_GETH_UCCE_TXB3 | UCC_GETH_UCCE_TXB2 | \ |
168 | #define UCCE_GRA 0x20000000 /* Tx graceful | 168 | UCC_GETH_UCCE_TXB1 | UCC_GETH_UCCE_TXB0) |
169 | stop | 169 | |
170 | complete */ | 170 | #define UCCE_RXB (UCC_GETH_UCCE_RXB7 | UCC_GETH_UCCE_RXB6 | \ |
171 | #define UCCE_CBPR 0x10000000 | 171 | UCC_GETH_UCCE_RXB5 | UCC_GETH_UCCE_RXB4 | \ |
172 | #define UCCE_BSY 0x08000000 | 172 | UCC_GETH_UCCE_RXB3 | UCC_GETH_UCCE_RXB2 | \ |
173 | #define UCCE_RXC 0x04000000 | 173 | UCC_GETH_UCCE_RXB1 | UCC_GETH_UCCE_RXB0) |
174 | #define UCCE_TXC 0x02000000 | 174 | |
175 | #define UCCE_TXE 0x01000000 | 175 | #define UCCE_RXF (UCC_GETH_UCCE_RXF7 | UCC_GETH_UCCE_RXF6 | \ |
176 | #define UCCE_TXB7 0x00800000 | 176 | UCC_GETH_UCCE_RXF5 | UCC_GETH_UCCE_RXF4 | \ |
177 | #define UCCE_TXB6 0x00400000 | 177 | UCC_GETH_UCCE_RXF3 | UCC_GETH_UCCE_RXF2 | \ |
178 | #define UCCE_TXB5 0x00200000 | 178 | UCC_GETH_UCCE_RXF1 | UCC_GETH_UCCE_RXF0) |
179 | #define UCCE_TXB4 0x00100000 | 179 | |
180 | #define UCCE_TXB3 0x00080000 | 180 | #define UCCE_OTHER (UCC_GETH_UCCE_SCAR | UCC_GETH_UCCE_GRA | \ |
181 | #define UCCE_TXB2 0x00040000 | 181 | UCC_GETH_UCCE_CBPR | UCC_GETH_UCCE_BSY | \ |
182 | #define UCCE_TXB1 0x00020000 | 182 | UCC_GETH_UCCE_RXC | UCC_GETH_UCCE_TXC | UCC_GETH_UCCE_TXE) |
183 | #define UCCE_TXB0 0x00010000 | 183 | |
184 | #define UCCE_RXB7 0x00008000 | 184 | #define UCCE_RX_EVENTS (UCCE_RXF | UCC_GETH_UCCE_BSY) |
185 | #define UCCE_RXB6 0x00004000 | 185 | #define UCCE_TX_EVENTS (UCCE_TXB | UCC_GETH_UCCE_TXE) |
186 | #define UCCE_RXB5 0x00002000 | ||
187 | #define UCCE_RXB4 0x00001000 | ||
188 | #define UCCE_RXB3 0x00000800 | ||
189 | #define UCCE_RXB2 0x00000400 | ||
190 | #define UCCE_RXB1 0x00000200 | ||
191 | #define UCCE_RXB0 0x00000100 | ||
192 | #define UCCE_RXF7 0x00000080 | ||
193 | #define UCCE_RXF6 0x00000040 | ||
194 | #define UCCE_RXF5 0x00000020 | ||
195 | #define UCCE_RXF4 0x00000010 | ||
196 | #define UCCE_RXF3 0x00000008 | ||
197 | #define UCCE_RXF2 0x00000004 | ||
198 | #define UCCE_RXF1 0x00000002 | ||
199 | #define UCCE_RXF0 0x00000001 | ||
200 | |||
201 | #define UCCE_RXBF_SINGLE_MASK (UCCE_RXF0) | ||
202 | #define UCCE_TXBF_SINGLE_MASK (UCCE_TXB0) | ||
203 | |||
204 | #define UCCE_TXB (UCCE_TXB7 | UCCE_TXB6 | UCCE_TXB5 | UCCE_TXB4 |\ | ||
205 | UCCE_TXB3 | UCCE_TXB2 | UCCE_TXB1 | UCCE_TXB0) | ||
206 | #define UCCE_RXB (UCCE_RXB7 | UCCE_RXB6 | UCCE_RXB5 | UCCE_RXB4 |\ | ||
207 | UCCE_RXB3 | UCCE_RXB2 | UCCE_RXB1 | UCCE_RXB0) | ||
208 | #define UCCE_RXF (UCCE_RXF7 | UCCE_RXF6 | UCCE_RXF5 | UCCE_RXF4 |\ | ||
209 | UCCE_RXF3 | UCCE_RXF2 | UCCE_RXF1 | UCCE_RXF0) | ||
210 | #define UCCE_OTHER (UCCE_SCAR | UCCE_GRA | UCCE_CBPR | UCCE_BSY |\ | ||
211 | UCCE_RXC | UCCE_TXC | UCCE_TXE) | ||
212 | |||
213 | #define UCCE_RX_EVENTS (UCCE_RXF | UCCE_BSY) | ||
214 | #define UCCE_TX_EVENTS (UCCE_TXB | UCCE_TXE) | ||
215 | |||
216 | /* UCC GETH UPSMR (Protocol Specific Mode Register) */ | ||
217 | #define UPSMR_ECM 0x04000000 /* Enable CAM | ||
218 | Miss or | ||
219 | Enable | ||
220 | Filtering | ||
221 | Miss */ | ||
222 | #define UPSMR_HSE 0x02000000 /* Hardware | ||
223 | Statistics | ||
224 | Enable */ | ||
225 | #define UPSMR_PRO 0x00400000 /* Promiscuous*/ | ||
226 | #define UPSMR_CAP 0x00200000 /* CAM polarity | ||
227 | */ | ||
228 | #define UPSMR_RSH 0x00100000 /* Receive | ||
229 | Short Frames | ||
230 | */ | ||
231 | #define UPSMR_RPM 0x00080000 /* Reduced Pin | ||
232 | Mode | ||
233 | interfaces */ | ||
234 | #define UPSMR_R10M 0x00040000 /* RGMII/RMII | ||
235 | 10 Mode */ | ||
236 | #define UPSMR_RLPB 0x00020000 /* RMII | ||
237 | Loopback | ||
238 | Mode */ | ||
239 | #define UPSMR_TBIM 0x00010000 /* Ten-bit | ||
240 | Interface | ||
241 | Mode */ | ||
242 | #define UPSMR_RMM 0x00001000 /* RMII/RGMII | ||
243 | Mode */ | ||
244 | #define UPSMR_CAM 0x00000400 /* CAM Address | ||
245 | Matching */ | ||
246 | #define UPSMR_BRO 0x00000200 /* Broadcast | ||
247 | Address */ | ||
248 | #define UPSMR_RES1 0x00002000 /* Reserved | ||
249 | feild - must | ||
250 | be 1 */ | ||
251 | 186 | ||
252 | /* UCC GETH MACCFG1 (MAC Configuration 1 Register) */ | 187 | /* UCC GETH MACCFG1 (MAC Configuration 1 Register) */ |
253 | #define MACCFG1_FLOW_RX 0x00000020 /* Flow Control | 188 | #define MACCFG1_FLOW_RX 0x00000020 /* Flow Control |
@@ -945,9 +880,10 @@ struct ucc_geth_hardware_statistics { | |||
945 | #define UCC_GETH_REMODER_INIT 0 /* bits that must be | 880 | #define UCC_GETH_REMODER_INIT 0 /* bits that must be |
946 | set */ | 881 | set */ |
947 | #define UCC_GETH_TEMODER_INIT 0xC000 /* bits that must */ | 882 | #define UCC_GETH_TEMODER_INIT 0xC000 /* bits that must */ |
948 | #define UCC_GETH_UPSMR_INIT (UPSMR_RES1) /* Start value | 883 | |
949 | for this | 884 | /* Initial value for UPSMR */ |
950 | register */ | 885 | #define UCC_GETH_UPSMR_INIT UCC_GETH_UPSMR_RES1 |
886 | |||
951 | #define UCC_GETH_MACCFG1_INIT 0 | 887 | #define UCC_GETH_MACCFG1_INIT 0 |
952 | #define UCC_GETH_MACCFG2_INIT (MACCFG2_RESERVED_1) | 888 | #define UCC_GETH_MACCFG2_INIT (MACCFG2_RESERVED_1) |
953 | 889 | ||
@@ -1250,6 +1186,8 @@ struct ucc_geth_private { | |||
1250 | int oldspeed; | 1186 | int oldspeed; |
1251 | int oldduplex; | 1187 | int oldduplex; |
1252 | int oldlink; | 1188 | int oldlink; |
1189 | |||
1190 | struct device_node *node; | ||
1253 | }; | 1191 | }; |
1254 | 1192 | ||
1255 | void uec_set_ethtool_ops(struct net_device *netdev); | 1193 | void uec_set_ethtool_ops(struct net_device *netdev); |
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c index c001d261366b..54635911305c 100644 --- a/drivers/net/ucc_geth_mii.c +++ b/drivers/net/ucc_geth_mii.c | |||
@@ -156,7 +156,7 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma | |||
156 | if (err) | 156 | if (err) |
157 | goto reg_map_fail; | 157 | goto reg_map_fail; |
158 | 158 | ||
159 | snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start); | 159 | uec_mdio_bus_name(new_bus->id, np); |
160 | 160 | ||
161 | new_bus->irq = kmalloc(32 * sizeof(int), GFP_KERNEL); | 161 | new_bus->irq = kmalloc(32 * sizeof(int), GFP_KERNEL); |
162 | 162 | ||
@@ -283,3 +283,13 @@ void uec_mdio_exit(void) | |||
283 | { | 283 | { |
284 | of_unregister_platform_driver(&uec_mdio_driver); | 284 | of_unregister_platform_driver(&uec_mdio_driver); |
285 | } | 285 | } |
286 | |||
287 | void uec_mdio_bus_name(char *name, struct device_node *np) | ||
288 | { | ||
289 | const u32 *reg; | ||
290 | |||
291 | reg = of_get_property(np, "reg", NULL); | ||
292 | |||
293 | snprintf(name, MII_BUS_ID_SIZE, "%s@%x", np->name, reg ? *reg : 0); | ||
294 | } | ||
295 | |||
diff --git a/drivers/net/ucc_geth_mii.h b/drivers/net/ucc_geth_mii.h index 1e45b2028a50..840cf80235b7 100644 --- a/drivers/net/ucc_geth_mii.h +++ b/drivers/net/ucc_geth_mii.h | |||
@@ -97,4 +97,5 @@ int uec_mdio_read(struct mii_bus *bus, int mii_id, int regnum); | |||
97 | int uec_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value); | 97 | int uec_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value); |
98 | int __init uec_mdio_init(void); | 98 | int __init uec_mdio_init(void); |
99 | void uec_mdio_exit(void); | 99 | void uec_mdio_exit(void); |
100 | void uec_mdio_bus_name(char *name, struct device_node *np); | ||
100 | #endif /* __UEC_MII_H */ | 101 | #endif /* __UEC_MII_H */ |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index c4918b86ed19..fe98acaead97 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -455,6 +455,7 @@ static const struct usb_device_id hso_ids[] = { | |||
455 | {icon321_port_device(0x0af0, 0xd033)}, /* Icon-322 */ | 455 | {icon321_port_device(0x0af0, 0xd033)}, /* Icon-322 */ |
456 | {USB_DEVICE(0x0af0, 0x7301)}, /* GE40x */ | 456 | {USB_DEVICE(0x0af0, 0x7301)}, /* GE40x */ |
457 | {USB_DEVICE(0x0af0, 0x7361)}, /* GE40x */ | 457 | {USB_DEVICE(0x0af0, 0x7361)}, /* GE40x */ |
458 | {USB_DEVICE(0x0af0, 0x7381)}, /* GE40x */ | ||
458 | {USB_DEVICE(0x0af0, 0x7401)}, /* GI 0401 */ | 459 | {USB_DEVICE(0x0af0, 0x7401)}, /* GI 0401 */ |
459 | {USB_DEVICE(0x0af0, 0x7501)}, /* GTM 382 */ | 460 | {USB_DEVICE(0x0af0, 0x7501)}, /* GTM 382 */ |
460 | {USB_DEVICE(0x0af0, 0x7601)}, /* GE40x */ | 461 | {USB_DEVICE(0x0af0, 0x7601)}, /* GE40x */ |
@@ -462,7 +463,8 @@ static const struct usb_device_id hso_ids[] = { | |||
462 | {USB_DEVICE(0x0af0, 0x7801)}, | 463 | {USB_DEVICE(0x0af0, 0x7801)}, |
463 | {USB_DEVICE(0x0af0, 0x7901)}, | 464 | {USB_DEVICE(0x0af0, 0x7901)}, |
464 | {USB_DEVICE(0x0af0, 0x7361)}, | 465 | {USB_DEVICE(0x0af0, 0x7361)}, |
465 | {icon321_port_device(0x0af0, 0xd051)}, | 466 | {USB_DEVICE(0x0af0, 0xd057)}, |
467 | {USB_DEVICE(0x0af0, 0xd055)}, | ||
466 | {} | 468 | {} |
467 | }; | 469 | }; |
468 | MODULE_DEVICE_TABLE(usb, hso_ids); | 470 | MODULE_DEVICE_TABLE(usb, hso_ids); |
@@ -1297,6 +1299,7 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) | |||
1297 | /* setup */ | 1299 | /* setup */ |
1298 | spin_lock_irq(&serial->serial_lock); | 1300 | spin_lock_irq(&serial->serial_lock); |
1299 | tty->driver_data = serial; | 1301 | tty->driver_data = serial; |
1302 | tty_kref_put(serial->tty); | ||
1300 | serial->tty = tty_kref_get(tty); | 1303 | serial->tty = tty_kref_get(tty); |
1301 | spin_unlock_irq(&serial->serial_lock); | 1304 | spin_unlock_irq(&serial->serial_lock); |
1302 | 1305 | ||
@@ -1792,8 +1795,8 @@ static int mux_device_request(struct hso_serial *serial, u8 type, u16 port, | |||
1792 | 1795 | ||
1793 | /* initialize */ | 1796 | /* initialize */ |
1794 | ctrl_req->wValue = 0; | 1797 | ctrl_req->wValue = 0; |
1795 | ctrl_req->wIndex = hso_port_to_mux(port); | 1798 | ctrl_req->wIndex = cpu_to_le16(hso_port_to_mux(port)); |
1796 | ctrl_req->wLength = size; | 1799 | ctrl_req->wLength = cpu_to_le16(size); |
1797 | 1800 | ||
1798 | if (type == USB_CDC_GET_ENCAPSULATED_RESPONSE) { | 1801 | if (type == USB_CDC_GET_ENCAPSULATED_RESPONSE) { |
1799 | /* Reading command */ | 1802 | /* Reading command */ |
@@ -2043,9 +2046,8 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial) | |||
2043 | return -2; | 2046 | return -2; |
2044 | } | 2047 | } |
2045 | 2048 | ||
2046 | spin_lock(&serial->serial_lock); | 2049 | /* All callers to put_rxbuf_data hold serial_lock */ |
2047 | tty = tty_kref_get(serial->tty); | 2050 | tty = tty_kref_get(serial->tty); |
2048 | spin_unlock(&serial->serial_lock); | ||
2049 | 2051 | ||
2050 | /* Push data to tty */ | 2052 | /* Push data to tty */ |
2051 | if (tty) { | 2053 | if (tty) { |
@@ -2053,8 +2055,10 @@ static int put_rxbuf_data(struct urb *urb, struct hso_serial *serial) | |||
2053 | serial->curr_rx_urb_offset; | 2055 | serial->curr_rx_urb_offset; |
2054 | D1("data to push to tty"); | 2056 | D1("data to push to tty"); |
2055 | while (write_length_remaining) { | 2057 | while (write_length_remaining) { |
2056 | if (test_bit(TTY_THROTTLED, &tty->flags)) | 2058 | if (test_bit(TTY_THROTTLED, &tty->flags)) { |
2059 | tty_kref_put(tty); | ||
2057 | return -1; | 2060 | return -1; |
2061 | } | ||
2058 | curr_write_len = tty_insert_flip_string | 2062 | curr_write_len = tty_insert_flip_string |
2059 | (tty, urb->transfer_buffer + | 2063 | (tty, urb->transfer_buffer + |
2060 | serial->curr_rx_urb_offset, | 2064 | serial->curr_rx_urb_offset, |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index 5385d66b306e..ced8f36ebd01 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -94,10 +94,18 @@ static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data) | |||
94 | { | 94 | { |
95 | struct usb_device *xdev = dev->udev; | 95 | struct usb_device *xdev = dev->udev; |
96 | int ret; | 96 | int ret; |
97 | void *buffer; | ||
98 | |||
99 | buffer = kmalloc(size, GFP_NOIO); | ||
100 | if (buffer == NULL) | ||
101 | return -ENOMEM; | ||
97 | 102 | ||
98 | ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ, | 103 | ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ, |
99 | MCS7830_RD_BMREQ, 0x0000, index, data, | 104 | MCS7830_RD_BMREQ, 0x0000, index, buffer, |
100 | size, MCS7830_CTRL_TIMEOUT); | 105 | size, MCS7830_CTRL_TIMEOUT); |
106 | memcpy(data, buffer, size); | ||
107 | kfree(buffer); | ||
108 | |||
101 | return ret; | 109 | return ret; |
102 | } | 110 | } |
103 | 111 | ||
@@ -105,10 +113,18 @@ static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, void *data) | |||
105 | { | 113 | { |
106 | struct usb_device *xdev = dev->udev; | 114 | struct usb_device *xdev = dev->udev; |
107 | int ret; | 115 | int ret; |
116 | void *buffer; | ||
117 | |||
118 | buffer = kmalloc(size, GFP_NOIO); | ||
119 | if (buffer == NULL) | ||
120 | return -ENOMEM; | ||
121 | |||
122 | memcpy(buffer, data, size); | ||
108 | 123 | ||
109 | ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ, | 124 | ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ, |
110 | MCS7830_WR_BMREQ, 0x0000, index, data, | 125 | MCS7830_WR_BMREQ, 0x0000, index, buffer, |
111 | size, MCS7830_CTRL_TIMEOUT); | 126 | size, MCS7830_CTRL_TIMEOUT); |
127 | kfree(buffer); | ||
112 | return ret; | 128 | return ret; |
113 | } | 129 | } |
114 | 130 | ||
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index ac07cc6e3cb2..3b8e63254277 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -622,6 +622,7 @@ static const struct net_device_ops rhine_netdev_ops = { | |||
622 | .ndo_get_stats = rhine_get_stats, | 622 | .ndo_get_stats = rhine_get_stats, |
623 | .ndo_set_multicast_list = rhine_set_rx_mode, | 623 | .ndo_set_multicast_list = rhine_set_rx_mode, |
624 | .ndo_validate_addr = eth_validate_addr, | 624 | .ndo_validate_addr = eth_validate_addr, |
625 | .ndo_set_mac_address = eth_mac_addr, | ||
625 | .ndo_do_ioctl = netdev_ioctl, | 626 | .ndo_do_ioctl = netdev_ioctl, |
626 | .ndo_tx_timeout = rhine_tx_timeout, | 627 | .ndo_tx_timeout = rhine_tx_timeout, |
627 | #ifdef CONFIG_NET_POLL_CONTROLLER | 628 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 58e25d090ae0..c5691fdb7079 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -855,6 +855,7 @@ static const struct net_device_ops velocity_netdev_ops = { | |||
855 | .ndo_start_xmit = velocity_xmit, | 855 | .ndo_start_xmit = velocity_xmit, |
856 | .ndo_get_stats = velocity_get_stats, | 856 | .ndo_get_stats = velocity_get_stats, |
857 | .ndo_validate_addr = eth_validate_addr, | 857 | .ndo_validate_addr = eth_validate_addr, |
858 | .ndo_set_mac_address = eth_mac_addr, | ||
858 | .ndo_set_multicast_list = velocity_set_multi, | 859 | .ndo_set_multicast_list = velocity_set_multi, |
859 | .ndo_change_mtu = velocity_change_mtu, | 860 | .ndo_change_mtu = velocity_change_mtu, |
860 | .ndo_do_ioctl = velocity_ioctl, | 861 | .ndo_do_ioctl = velocity_ioctl, |
@@ -1301,7 +1302,7 @@ static void velocity_free_rd_ring(struct velocity_info *vptr) | |||
1301 | static int velocity_init_td_ring(struct velocity_info *vptr) | 1302 | static int velocity_init_td_ring(struct velocity_info *vptr) |
1302 | { | 1303 | { |
1303 | dma_addr_t curr; | 1304 | dma_addr_t curr; |
1304 | unsigned int j; | 1305 | int j; |
1305 | 1306 | ||
1306 | /* Init the TD ring entries */ | 1307 | /* Init the TD ring entries */ |
1307 | for (j = 0; j < vptr->tx.numq; j++) { | 1308 | for (j = 0; j < vptr->tx.numq; j++) { |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 43f6523c40be..c68808336c8c 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/virtio.h> | 24 | #include <linux/virtio.h> |
25 | #include <linux/virtio_net.h> | 25 | #include <linux/virtio_net.h> |
26 | #include <linux/scatterlist.h> | 26 | #include <linux/scatterlist.h> |
27 | #include <linux/if_vlan.h> | ||
27 | 28 | ||
28 | static int napi_weight = 128; | 29 | static int napi_weight = 128; |
29 | module_param(napi_weight, int, 0444); | 30 | module_param(napi_weight, int, 0444); |
@@ -33,7 +34,7 @@ module_param(csum, bool, 0444); | |||
33 | module_param(gso, bool, 0444); | 34 | module_param(gso, bool, 0444); |
34 | 35 | ||
35 | /* FIXME: MTU in config. */ | 36 | /* FIXME: MTU in config. */ |
36 | #define MAX_PACKET_LEN (ETH_HLEN+ETH_DATA_LEN) | 37 | #define MAX_PACKET_LEN (ETH_HLEN + VLAN_HLEN + ETH_DATA_LEN) |
37 | #define GOOD_COPY_LEN 128 | 38 | #define GOOD_COPY_LEN 128 |
38 | 39 | ||
39 | struct virtnet_info | 40 | struct virtnet_info |
@@ -286,7 +287,7 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi) | |||
286 | skb_put(skb, MAX_PACKET_LEN); | 287 | skb_put(skb, MAX_PACKET_LEN); |
287 | 288 | ||
288 | hdr = skb_vnet_hdr(skb); | 289 | hdr = skb_vnet_hdr(skb); |
289 | sg_init_one(sg, hdr, sizeof(*hdr)); | 290 | sg_set_buf(sg, hdr, sizeof(*hdr)); |
290 | 291 | ||
291 | if (vi->big_packets) { | 292 | if (vi->big_packets) { |
292 | for (i = 0; i < MAX_SKB_FRAGS; i++) { | 293 | for (i = 0; i < MAX_SKB_FRAGS; i++) { |
@@ -487,9 +488,9 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb) | |||
487 | 488 | ||
488 | /* Encode metadata header at front. */ | 489 | /* Encode metadata header at front. */ |
489 | if (vi->mergeable_rx_bufs) | 490 | if (vi->mergeable_rx_bufs) |
490 | sg_init_one(sg, mhdr, sizeof(*mhdr)); | 491 | sg_set_buf(sg, mhdr, sizeof(*mhdr)); |
491 | else | 492 | else |
492 | sg_init_one(sg, hdr, sizeof(*hdr)); | 493 | sg_set_buf(sg, hdr, sizeof(*hdr)); |
493 | 494 | ||
494 | num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; | 495 | num = skb_to_sgvec(skb, sg+1, 0, skb->len) + 1; |
495 | 496 | ||
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c index 2dc241689d37..0dbd85b0162d 100644 --- a/drivers/net/wan/ixp4xx_hss.c +++ b/drivers/net/wan/ixp4xx_hss.c | |||
@@ -622,7 +622,7 @@ static void hss_hdlc_rx_irq(void *pdev) | |||
622 | printk(KERN_DEBUG "%s: hss_hdlc_rx_irq\n", dev->name); | 622 | printk(KERN_DEBUG "%s: hss_hdlc_rx_irq\n", dev->name); |
623 | #endif | 623 | #endif |
624 | qmgr_disable_irq(queue_ids[port->id].rx); | 624 | qmgr_disable_irq(queue_ids[port->id].rx); |
625 | netif_rx_schedule(dev, &port->napi); | 625 | netif_rx_schedule(&port->napi); |
626 | } | 626 | } |
627 | 627 | ||
628 | static int hss_hdlc_poll(struct napi_struct *napi, int budget) | 628 | static int hss_hdlc_poll(struct napi_struct *napi, int budget) |
@@ -651,7 +651,7 @@ static int hss_hdlc_poll(struct napi_struct *napi, int budget) | |||
651 | printk(KERN_DEBUG "%s: hss_hdlc_poll" | 651 | printk(KERN_DEBUG "%s: hss_hdlc_poll" |
652 | " netif_rx_complete\n", dev->name); | 652 | " netif_rx_complete\n", dev->name); |
653 | #endif | 653 | #endif |
654 | netif_rx_complete(dev, napi); | 654 | netif_rx_complete(napi); |
655 | qmgr_enable_irq(rxq); | 655 | qmgr_enable_irq(rxq); |
656 | if (!qmgr_stat_empty(rxq) && | 656 | if (!qmgr_stat_empty(rxq) && |
657 | netif_rx_reschedule(napi)) { | 657 | netif_rx_reschedule(napi)) { |
@@ -1069,7 +1069,7 @@ static int hss_hdlc_open(struct net_device *dev) | |||
1069 | hss_start_hdlc(port); | 1069 | hss_start_hdlc(port); |
1070 | 1070 | ||
1071 | /* we may already have RX data, enables IRQ */ | 1071 | /* we may already have RX data, enables IRQ */ |
1072 | netif_rx_schedule(dev, &port->napi); | 1072 | netif_rx_schedule(&port->napi); |
1073 | return 0; | 1073 | return 0; |
1074 | 1074 | ||
1075 | err_unlock: | 1075 | err_unlock: |
diff --git a/drivers/net/wd.c b/drivers/net/wd.c index 3c1edda08d3d..d8322d2d1e29 100644 --- a/drivers/net/wd.c +++ b/drivers/net/wd.c | |||
@@ -155,6 +155,7 @@ static const struct net_device_ops wd_netdev_ops = { | |||
155 | .ndo_get_stats = ei_get_stats, | 155 | .ndo_get_stats = ei_get_stats, |
156 | .ndo_set_multicast_list = ei_set_multicast_list, | 156 | .ndo_set_multicast_list = ei_set_multicast_list, |
157 | .ndo_validate_addr = eth_validate_addr, | 157 | .ndo_validate_addr = eth_validate_addr, |
158 | .ndo_set_mac_address = eth_mac_addr, | ||
158 | .ndo_change_mtu = eth_change_mtu, | 159 | .ndo_change_mtu = eth_change_mtu, |
159 | #ifdef CONFIG_NET_POLL_CONTROLLER | 160 | #ifdef CONFIG_NET_POLL_CONTROLLER |
160 | .ndo_poll_controller = ei_poll, | 161 | .ndo_poll_controller = ei_poll, |
diff --git a/drivers/net/wimax/i2400m/control.c b/drivers/net/wimax/i2400m/control.c index d3d37fed6893..15d9f51b292c 100644 --- a/drivers/net/wimax/i2400m/control.c +++ b/drivers/net/wimax/i2400m/control.c | |||
@@ -609,7 +609,7 @@ void i2400m_msg_to_dev_cancel_wait(struct i2400m *i2400m, int code) | |||
609 | spin_lock_irqsave(&i2400m->rx_lock, flags); | 609 | spin_lock_irqsave(&i2400m->rx_lock, flags); |
610 | ack_skb = i2400m->ack_skb; | 610 | ack_skb = i2400m->ack_skb; |
611 | if (ack_skb && !IS_ERR(ack_skb)) | 611 | if (ack_skb && !IS_ERR(ack_skb)) |
612 | kfree(ack_skb); | 612 | kfree_skb(ack_skb); |
613 | i2400m->ack_skb = ERR_PTR(code); | 613 | i2400m->ack_skb = ERR_PTR(code); |
614 | spin_unlock_irqrestore(&i2400m->rx_lock, flags); | 614 | spin_unlock_irqrestore(&i2400m->rx_lock, flags); |
615 | } | 615 | } |
diff --git a/drivers/net/wimax/i2400m/debugfs.c b/drivers/net/wimax/i2400m/debugfs.c index 626632985977..9b81af3f80a9 100644 --- a/drivers/net/wimax/i2400m/debugfs.c +++ b/drivers/net/wimax/i2400m/debugfs.c | |||
@@ -234,20 +234,6 @@ struct dentry *debugfs_create_i2400m_reset( | |||
234 | &fops_i2400m_reset); | 234 | &fops_i2400m_reset); |
235 | } | 235 | } |
236 | 236 | ||
237 | /* | ||
238 | * Debug levels control; see debug.h | ||
239 | */ | ||
240 | struct d_level D_LEVEL[] = { | ||
241 | D_SUBMODULE_DEFINE(control), | ||
242 | D_SUBMODULE_DEFINE(driver), | ||
243 | D_SUBMODULE_DEFINE(debugfs), | ||
244 | D_SUBMODULE_DEFINE(fw), | ||
245 | D_SUBMODULE_DEFINE(netdev), | ||
246 | D_SUBMODULE_DEFINE(rfkill), | ||
247 | D_SUBMODULE_DEFINE(rx), | ||
248 | D_SUBMODULE_DEFINE(tx), | ||
249 | }; | ||
250 | size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL); | ||
251 | 237 | ||
252 | #define __debugfs_register(prefix, name, parent) \ | 238 | #define __debugfs_register(prefix, name, parent) \ |
253 | do { \ | 239 | do { \ |
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c index 5f98047e18cf..e80a0b65a754 100644 --- a/drivers/net/wimax/i2400m/driver.c +++ b/drivers/net/wimax/i2400m/driver.c | |||
@@ -707,6 +707,22 @@ void i2400m_release(struct i2400m *i2400m) | |||
707 | EXPORT_SYMBOL_GPL(i2400m_release); | 707 | EXPORT_SYMBOL_GPL(i2400m_release); |
708 | 708 | ||
709 | 709 | ||
710 | /* | ||
711 | * Debug levels control; see debug.h | ||
712 | */ | ||
713 | struct d_level D_LEVEL[] = { | ||
714 | D_SUBMODULE_DEFINE(control), | ||
715 | D_SUBMODULE_DEFINE(driver), | ||
716 | D_SUBMODULE_DEFINE(debugfs), | ||
717 | D_SUBMODULE_DEFINE(fw), | ||
718 | D_SUBMODULE_DEFINE(netdev), | ||
719 | D_SUBMODULE_DEFINE(rfkill), | ||
720 | D_SUBMODULE_DEFINE(rx), | ||
721 | D_SUBMODULE_DEFINE(tx), | ||
722 | }; | ||
723 | size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL); | ||
724 | |||
725 | |||
710 | static | 726 | static |
711 | int __init i2400m_driver_init(void) | 727 | int __init i2400m_driver_init(void) |
712 | { | 728 | { |
diff --git a/drivers/net/wimax/i2400m/usb-rx.c b/drivers/net/wimax/i2400m/usb-rx.c index 074cc1f89853..a314799967cf 100644 --- a/drivers/net/wimax/i2400m/usb-rx.c +++ b/drivers/net/wimax/i2400m/usb-rx.c | |||
@@ -184,6 +184,8 @@ void i2400mu_rx_size_maybe_shrink(struct i2400mu *i2400mu) | |||
184 | * NOTE: this function might realloc the skb (if it is too small), | 184 | * NOTE: this function might realloc the skb (if it is too small), |
185 | * so always update with the one returned. | 185 | * so always update with the one returned. |
186 | * ERR_PTR() is < 0 on error. | 186 | * ERR_PTR() is < 0 on error. |
187 | * Will return NULL if it cannot reallocate -- this can be | ||
188 | * considered a transient retryable error. | ||
187 | */ | 189 | */ |
188 | static | 190 | static |
189 | struct sk_buff *i2400mu_rx(struct i2400mu *i2400mu, struct sk_buff *rx_skb) | 191 | struct sk_buff *i2400mu_rx(struct i2400mu *i2400mu, struct sk_buff *rx_skb) |
@@ -243,8 +245,8 @@ retry: | |||
243 | if (printk_ratelimit()) | 245 | if (printk_ratelimit()) |
244 | dev_err(dev, "RX: Can't reallocate skb to %d; " | 246 | dev_err(dev, "RX: Can't reallocate skb to %d; " |
245 | "RX dropped\n", rx_size); | 247 | "RX dropped\n", rx_size); |
246 | kfree(rx_skb); | 248 | kfree_skb(rx_skb); |
247 | result = 0; | 249 | rx_skb = NULL; |
248 | goto out; /* drop it...*/ | 250 | goto out; /* drop it...*/ |
249 | } | 251 | } |
250 | kfree_skb(rx_skb); | 252 | kfree_skb(rx_skb); |
@@ -344,7 +346,8 @@ int i2400mu_rxd(void *_i2400mu) | |||
344 | if (IS_ERR(rx_skb)) | 346 | if (IS_ERR(rx_skb)) |
345 | goto out; | 347 | goto out; |
346 | atomic_dec(&i2400mu->rx_pending_count); | 348 | atomic_dec(&i2400mu->rx_pending_count); |
347 | if (rx_skb->len == 0) { /* some ignorable condition */ | 349 | if (rx_skb == NULL || rx_skb->len == 0) { |
350 | /* some "ignorable" condition */ | ||
348 | kfree_skb(rx_skb); | 351 | kfree_skb(rx_skb); |
349 | continue; | 352 | continue; |
350 | } | 353 | } |
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig index ea543fcf2687..e4f9f747de88 100644 --- a/drivers/net/wireless/Kconfig +++ b/drivers/net/wireless/Kconfig | |||
@@ -111,7 +111,7 @@ config WLAN_80211 | |||
111 | lets you choose drivers. | 111 | lets you choose drivers. |
112 | 112 | ||
113 | config PCMCIA_RAYCS | 113 | config PCMCIA_RAYCS |
114 | tristate "Aviator/Raytheon 2.4MHz wireless support" | 114 | tristate "Aviator/Raytheon 2.4GHz wireless support" |
115 | depends on PCMCIA && WLAN_80211 | 115 | depends on PCMCIA && WLAN_80211 |
116 | select WIRELESS_EXT | 116 | select WIRELESS_EXT |
117 | ---help--- | 117 | ---help--- |
diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c index bfca15da6f0f..14c11656e82c 100644 --- a/drivers/net/wireless/arlan-main.c +++ b/drivers/net/wireless/arlan-main.c | |||
@@ -1082,8 +1082,8 @@ static int __init arlan_probe_here(struct net_device *dev, | |||
1082 | if (arlan_check_fingerprint(memaddr)) | 1082 | if (arlan_check_fingerprint(memaddr)) |
1083 | return -ENODEV; | 1083 | return -ENODEV; |
1084 | 1084 | ||
1085 | printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, | 1085 | printk(KERN_NOTICE "%s: Arlan found at %llx, \n ", dev->name, |
1086 | (int) virt_to_phys((void*)memaddr)); | 1086 | (u64) virt_to_phys((void*)memaddr)); |
1087 | 1087 | ||
1088 | ap->card = (void *) memaddr; | 1088 | ap->card = (void *) memaddr; |
1089 | dev->mem_start = memaddr; | 1089 | dev->mem_start = memaddr; |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 4af2607deec0..a533ed60bb4d 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -1028,6 +1028,8 @@ ath5k_setup_bands(struct ieee80211_hw *hw) | |||
1028 | * it's done by reseting the chip. To accomplish this we must | 1028 | * it's done by reseting the chip. To accomplish this we must |
1029 | * first cleanup any pending DMA, then restart stuff after a la | 1029 | * first cleanup any pending DMA, then restart stuff after a la |
1030 | * ath5k_init. | 1030 | * ath5k_init. |
1031 | * | ||
1032 | * Called with sc->lock. | ||
1031 | */ | 1033 | */ |
1032 | static int | 1034 | static int |
1033 | ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan) | 1035 | ath5k_chan_set(struct ath5k_softc *sc, struct ieee80211_channel *chan) |
@@ -2644,7 +2646,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2644 | if (skb_headroom(skb) < padsize) { | 2646 | if (skb_headroom(skb) < padsize) { |
2645 | ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough" | 2647 | ATH5K_ERR(sc, "tx hdrlen not %%4: %d not enough" |
2646 | " headroom to pad %d\n", hdrlen, padsize); | 2648 | " headroom to pad %d\n", hdrlen, padsize); |
2647 | return -1; | 2649 | return NETDEV_TX_BUSY; |
2648 | } | 2650 | } |
2649 | skb_push(skb, padsize); | 2651 | skb_push(skb, padsize); |
2650 | memmove(skb->data, skb->data+padsize, hdrlen); | 2652 | memmove(skb->data, skb->data+padsize, hdrlen); |
@@ -2655,7 +2657,7 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2655 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); | 2657 | ATH5K_ERR(sc, "no further txbuf available, dropping packet\n"); |
2656 | spin_unlock_irqrestore(&sc->txbuflock, flags); | 2658 | spin_unlock_irqrestore(&sc->txbuflock, flags); |
2657 | ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); | 2659 | ieee80211_stop_queue(hw, skb_get_queue_mapping(skb)); |
2658 | return -1; | 2660 | return NETDEV_TX_BUSY; |
2659 | } | 2661 | } |
2660 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); | 2662 | bf = list_first_entry(&sc->txbuf, struct ath5k_buf, list); |
2661 | list_del(&bf->list); | 2663 | list_del(&bf->list); |
@@ -2673,10 +2675,10 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2673 | sc->txbuf_len++; | 2675 | sc->txbuf_len++; |
2674 | spin_unlock_irqrestore(&sc->txbuflock, flags); | 2676 | spin_unlock_irqrestore(&sc->txbuflock, flags); |
2675 | dev_kfree_skb_any(skb); | 2677 | dev_kfree_skb_any(skb); |
2676 | return 0; | 2678 | return NETDEV_TX_OK; |
2677 | } | 2679 | } |
2678 | 2680 | ||
2679 | return 0; | 2681 | return NETDEV_TX_OK; |
2680 | } | 2682 | } |
2681 | 2683 | ||
2682 | static int | 2684 | static int |
@@ -2814,11 +2816,17 @@ ath5k_config(struct ieee80211_hw *hw, u32 changed) | |||
2814 | { | 2816 | { |
2815 | struct ath5k_softc *sc = hw->priv; | 2817 | struct ath5k_softc *sc = hw->priv; |
2816 | struct ieee80211_conf *conf = &hw->conf; | 2818 | struct ieee80211_conf *conf = &hw->conf; |
2819 | int ret; | ||
2820 | |||
2821 | mutex_lock(&sc->lock); | ||
2817 | 2822 | ||
2818 | sc->bintval = conf->beacon_int; | 2823 | sc->bintval = conf->beacon_int; |
2819 | sc->power_level = conf->power_level; | 2824 | sc->power_level = conf->power_level; |
2820 | 2825 | ||
2821 | return ath5k_chan_set(sc, conf->channel); | 2826 | ret = ath5k_chan_set(sc, conf->channel); |
2827 | |||
2828 | mutex_unlock(&sc->lock); | ||
2829 | return ret; | ||
2822 | } | 2830 | } |
2823 | 2831 | ||
2824 | static int | 2832 | static int |
diff --git a/drivers/net/wireless/ath5k/pcu.c b/drivers/net/wireless/ath5k/pcu.c index 0cac05c6a9ce..75eb9f43c741 100644 --- a/drivers/net/wireless/ath5k/pcu.c +++ b/drivers/net/wireless/ath5k/pcu.c | |||
@@ -65,7 +65,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah) | |||
65 | if (ah->ah_version == AR5K_AR5210) | 65 | if (ah->ah_version == AR5K_AR5210) |
66 | pcu_reg |= AR5K_STA_ID1_NO_PSPOLL; | 66 | pcu_reg |= AR5K_STA_ID1_NO_PSPOLL; |
67 | else | 67 | else |
68 | AR5K_REG_DISABLE_BITS(ah, AR5K_CFG, AR5K_CFG_ADHOC); | 68 | AR5K_REG_ENABLE_BITS(ah, AR5K_CFG, AR5K_CFG_IBSS); |
69 | break; | 69 | break; |
70 | 70 | ||
71 | case NL80211_IFTYPE_AP: | 71 | case NL80211_IFTYPE_AP: |
@@ -75,7 +75,7 @@ int ath5k_hw_set_opmode(struct ath5k_hw *ah) | |||
75 | if (ah->ah_version == AR5K_AR5210) | 75 | if (ah->ah_version == AR5K_AR5210) |
76 | pcu_reg |= AR5K_STA_ID1_NO_PSPOLL; | 76 | pcu_reg |= AR5K_STA_ID1_NO_PSPOLL; |
77 | else | 77 | else |
78 | AR5K_REG_ENABLE_BITS(ah, AR5K_CFG, AR5K_CFG_ADHOC); | 78 | AR5K_REG_DISABLE_BITS(ah, AR5K_CFG, AR5K_CFG_IBSS); |
79 | break; | 79 | break; |
80 | 80 | ||
81 | case NL80211_IFTYPE_STATION: | 81 | case NL80211_IFTYPE_STATION: |
diff --git a/drivers/net/wireless/ath5k/reg.h b/drivers/net/wireless/ath5k/reg.h index 91aaeaf88199..9189ab13286c 100644 --- a/drivers/net/wireless/ath5k/reg.h +++ b/drivers/net/wireless/ath5k/reg.h | |||
@@ -73,7 +73,7 @@ | |||
73 | #define AR5K_CFG_SWRD 0x00000004 /* Byte-swap RX descriptor */ | 73 | #define AR5K_CFG_SWRD 0x00000004 /* Byte-swap RX descriptor */ |
74 | #define AR5K_CFG_SWRB 0x00000008 /* Byte-swap RX buffer */ | 74 | #define AR5K_CFG_SWRB 0x00000008 /* Byte-swap RX buffer */ |
75 | #define AR5K_CFG_SWRG 0x00000010 /* Byte-swap Register access */ | 75 | #define AR5K_CFG_SWRG 0x00000010 /* Byte-swap Register access */ |
76 | #define AR5K_CFG_ADHOC 0x00000020 /* AP/Adhoc indication [5211+] */ | 76 | #define AR5K_CFG_IBSS 0x00000020 /* 0-BSS, 1-IBSS [5211+] */ |
77 | #define AR5K_CFG_PHY_OK 0x00000100 /* [5211+] */ | 77 | #define AR5K_CFG_PHY_OK 0x00000100 /* [5211+] */ |
78 | #define AR5K_CFG_EEBS 0x00000200 /* EEPROM is busy */ | 78 | #define AR5K_CFG_EEBS 0x00000200 /* EEPROM is busy */ |
79 | #define AR5K_CFG_CLKGD 0x00000400 /* Clock gated (Disable dynamic clock) */ | 79 | #define AR5K_CFG_CLKGD 0x00000400 /* Clock gated (Disable dynamic clock) */ |
diff --git a/drivers/net/wireless/ath9k/Kconfig b/drivers/net/wireless/ath9k/Kconfig index c43bd321f97f..90a8dd873786 100644 --- a/drivers/net/wireless/ath9k/Kconfig +++ b/drivers/net/wireless/ath9k/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config ATH9K | 1 | config ATH9K |
2 | tristate "Atheros 802.11n wireless cards support" | 2 | tristate "Atheros 802.11n wireless cards support" |
3 | depends on PCI && MAC80211 && WLAN_80211 | 3 | depends on PCI && MAC80211 && WLAN_80211 |
4 | depends on RFKILL || RFKILL=n | ||
4 | select MAC80211_LEDS | 5 | select MAC80211_LEDS |
5 | select LEDS_CLASS | 6 | select LEDS_CLASS |
6 | select NEW_LEDS | 7 | select NEW_LEDS |
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c index 191eec50dc75..727f067aca4f 100644 --- a/drivers/net/wireless/ath9k/main.c +++ b/drivers/net/wireless/ath9k/main.c | |||
@@ -2164,13 +2164,13 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
2164 | conf->ht.channel_type); | 2164 | conf->ht.channel_type); |
2165 | } | 2165 | } |
2166 | 2166 | ||
2167 | ath_update_chainmask(sc, conf->ht.enabled); | ||
2168 | |||
2167 | if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0) { | 2169 | if (ath_set_channel(sc, &sc->sc_ah->ah_channels[pos]) < 0) { |
2168 | DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel\n"); | 2170 | DPRINTF(sc, ATH_DBG_FATAL, "Unable to set channel\n"); |
2169 | mutex_unlock(&sc->mutex); | 2171 | mutex_unlock(&sc->mutex); |
2170 | return -EINVAL; | 2172 | return -EINVAL; |
2171 | } | 2173 | } |
2172 | |||
2173 | ath_update_chainmask(sc, conf->ht.enabled); | ||
2174 | } | 2174 | } |
2175 | 2175 | ||
2176 | if (changed & IEEE80211_CONF_CHANGE_POWER) | 2176 | if (changed & IEEE80211_CONF_CHANGE_POWER) |
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c index 04ab457a8faa..1b71b934bb5e 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -490,7 +490,7 @@ static inline int ath_rc_get_nextvalid_txrate(struct ath_rate_table *rate_table, | |||
490 | 490 | ||
491 | static int ath_rc_valid_phyrate(u32 phy, u32 capflag, int ignore_cw) | 491 | static int ath_rc_valid_phyrate(u32 phy, u32 capflag, int ignore_cw) |
492 | { | 492 | { |
493 | if (WLAN_RC_PHY_HT(phy) & !(capflag & WLAN_RC_HT_FLAG)) | 493 | if (WLAN_RC_PHY_HT(phy) && !(capflag & WLAN_RC_HT_FLAG)) |
494 | return 0; | 494 | return 0; |
495 | if (WLAN_RC_PHY_DS(phy) && !(capflag & WLAN_RC_DS_FLAG)) | 495 | if (WLAN_RC_PHY_DS(phy) && !(capflag & WLAN_RC_DS_FLAG)) |
496 | return 0; | 496 | return 0; |
diff --git a/drivers/net/wireless/ath9k/regd_common.h b/drivers/net/wireless/ath9k/regd_common.h index 9112c030b1e8..6df1b3b77c25 100644 --- a/drivers/net/wireless/ath9k/regd_common.h +++ b/drivers/net/wireless/ath9k/regd_common.h | |||
@@ -228,7 +228,7 @@ enum { | |||
228 | }; | 228 | }; |
229 | 229 | ||
230 | #define REG_DOMAIN_2GHZ_MASK (REQ_MASK & \ | 230 | #define REG_DOMAIN_2GHZ_MASK (REQ_MASK & \ |
231 | (!(ADHOC_NO_11A | DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB))) | 231 | (~(ADHOC_NO_11A | DISALLOW_ADHOC_11A | DISALLOW_ADHOC_11A_TURB))) |
232 | #define REG_DOMAIN_5GHZ_MASK REQ_MASK | 232 | #define REG_DOMAIN_5GHZ_MASK REQ_MASK |
233 | 233 | ||
234 | static struct reg_dmn_pair_mapping regDomainPairs[] = { | 234 | static struct reg_dmn_pair_mapping regDomainPairs[] = { |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 3bfc3b90f256..c92f0c6e4adc 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -126,15 +126,7 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, | |||
126 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | 126 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
127 | } | 127 | } |
128 | 128 | ||
129 | tx_info->status.rates[0].count = tx_status->retries; | 129 | tx_info->status.rates[0].count = tx_status->retries + 1; |
130 | if (tx_info->status.rates[0].flags & IEEE80211_TX_RC_MCS) { | ||
131 | /* Change idx from internal table index to MCS index */ | ||
132 | int idx = tx_info->status.rates[0].idx; | ||
133 | struct ath_rate_table *rate_table = sc->cur_rate_table; | ||
134 | if (idx >= 0 && idx < rate_table->rate_cnt) | ||
135 | tx_info->status.rates[0].idx = | ||
136 | rate_table->info[idx].ratecode & 0x7f; | ||
137 | } | ||
138 | 130 | ||
139 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 131 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
140 | padsize = hdrlen & 3; | 132 | padsize = hdrlen & 3; |
@@ -264,25 +256,22 @@ static void assign_aggr_tid_seqno(struct sk_buff *skb, | |||
264 | } | 256 | } |
265 | 257 | ||
266 | /* Get seqno */ | 258 | /* Get seqno */ |
267 | 259 | /* For HT capable stations, we save tidno for later use. | |
268 | if (ieee80211_is_data(fc) && !is_pae(skb)) { | 260 | * We also override seqno set by upper layer with the one |
269 | /* For HT capable stations, we save tidno for later use. | 261 | * in tx aggregation state. |
270 | * We also override seqno set by upper layer with the one | 262 | * |
271 | * in tx aggregation state. | 263 | * If fragmentation is on, the sequence number is |
272 | * | 264 | * not overridden, since it has been |
273 | * If fragmentation is on, the sequence number is | 265 | * incremented by the fragmentation routine. |
274 | * not overridden, since it has been | 266 | * |
275 | * incremented by the fragmentation routine. | 267 | * FIXME: check if the fragmentation threshold exceeds |
276 | * | 268 | * IEEE80211 max. |
277 | * FIXME: check if the fragmentation threshold exceeds | 269 | */ |
278 | * IEEE80211 max. | 270 | tid = ATH_AN_2_TID(an, bf->bf_tidno); |
279 | */ | 271 | hdr->seq_ctrl = cpu_to_le16(tid->seq_next << |
280 | tid = ATH_AN_2_TID(an, bf->bf_tidno); | 272 | IEEE80211_SEQ_SEQ_SHIFT); |
281 | hdr->seq_ctrl = cpu_to_le16(tid->seq_next << | 273 | bf->bf_seqno = tid->seq_next; |
282 | IEEE80211_SEQ_SEQ_SHIFT); | 274 | INCR(tid->seq_next, IEEE80211_SEQ_MAX); |
283 | bf->bf_seqno = tid->seq_next; | ||
284 | INCR(tid->seq_next, IEEE80211_SEQ_MAX); | ||
285 | } | ||
286 | } | 275 | } |
287 | 276 | ||
288 | static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb, | 277 | static int setup_tx_flags(struct ath_softc *sc, struct sk_buff *skb, |
@@ -1718,11 +1707,10 @@ static int ath_tx_setup_buffer(struct ath_softc *sc, struct ath_buf *bf, | |||
1718 | 1707 | ||
1719 | /* Assign seqno, tidno */ | 1708 | /* Assign seqno, tidno */ |
1720 | 1709 | ||
1721 | if (bf_isht(bf) && (sc->sc_flags & SC_OP_TXAGGR)) | 1710 | if (ieee80211_is_data_qos(fc) && (sc->sc_flags & SC_OP_TXAGGR)) |
1722 | assign_aggr_tid_seqno(skb, bf); | 1711 | assign_aggr_tid_seqno(skb, bf); |
1723 | 1712 | ||
1724 | /* DMA setup */ | 1713 | /* DMA setup */ |
1725 | |||
1726 | bf->bf_mpdu = skb; | 1714 | bf->bf_mpdu = skb; |
1727 | 1715 | ||
1728 | bf->bf_dmacontext = pci_map_single(sc->pdev, skb->data, | 1716 | bf->bf_dmacontext = pci_map_single(sc->pdev, skb->data, |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 7b31a327b24a..c788bad10661 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -3261,7 +3261,7 @@ static int b43_switch_band(struct b43_wl *wl, struct ieee80211_channel *chan) | |||
3261 | struct b43_wldev *down_dev; | 3261 | struct b43_wldev *down_dev; |
3262 | struct b43_wldev *d; | 3262 | struct b43_wldev *d; |
3263 | int err; | 3263 | int err; |
3264 | bool gmode; | 3264 | bool uninitialized_var(gmode); |
3265 | int prev_status; | 3265 | int prev_status; |
3266 | 3266 | ||
3267 | /* Find a device and PHY which supports the band. */ | 3267 | /* Find a device and PHY which supports the band. */ |
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index c1324e31d2f6..fb996c27a19b 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -2465,7 +2465,7 @@ static void b43legacy_put_phy_into_reset(struct b43legacy_wldev *dev) | |||
2465 | static int b43legacy_switch_phymode(struct b43legacy_wl *wl, | 2465 | static int b43legacy_switch_phymode(struct b43legacy_wl *wl, |
2466 | unsigned int new_mode) | 2466 | unsigned int new_mode) |
2467 | { | 2467 | { |
2468 | struct b43legacy_wldev *up_dev; | 2468 | struct b43legacy_wldev *uninitialized_var(up_dev); |
2469 | struct b43legacy_wldev *down_dev; | 2469 | struct b43legacy_wldev *down_dev; |
2470 | int err; | 2470 | int err; |
2471 | bool gmode = 0; | 2471 | bool gmode = 0; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c index 9b60a0c5de5f..21c841847d88 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c | |||
@@ -638,12 +638,16 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
638 | s8 scale_action = 0; | 638 | s8 scale_action = 0; |
639 | unsigned long flags; | 639 | unsigned long flags; |
640 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 640 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
641 | u16 fc, rate_mask; | 641 | u16 fc; |
642 | u16 rate_mask = 0; | ||
642 | struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r; | 643 | struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r; |
643 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 644 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
644 | 645 | ||
645 | IWL_DEBUG_RATE("enter\n"); | 646 | IWL_DEBUG_RATE("enter\n"); |
646 | 647 | ||
648 | if (sta) | ||
649 | rate_mask = sta->supp_rates[sband->band]; | ||
650 | |||
647 | /* Send management frames and broadcast/multicast data using lowest | 651 | /* Send management frames and broadcast/multicast data using lowest |
648 | * rate. */ | 652 | * rate. */ |
649 | fc = le16_to_cpu(hdr->frame_control); | 653 | fc = le16_to_cpu(hdr->frame_control); |
@@ -651,11 +655,15 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, | |||
651 | is_multicast_ether_addr(hdr->addr1) || | 655 | is_multicast_ether_addr(hdr->addr1) || |
652 | !sta || !priv_sta) { | 656 | !sta || !priv_sta) { |
653 | IWL_DEBUG_RATE("leave: No STA priv data to update!\n"); | 657 | IWL_DEBUG_RATE("leave: No STA priv data to update!\n"); |
654 | info->control.rates[0].idx = rate_lowest_index(sband, sta); | 658 | if (!rate_mask) |
659 | info->control.rates[0].idx = | ||
660 | rate_lowest_index(sband, NULL); | ||
661 | else | ||
662 | info->control.rates[0].idx = | ||
663 | rate_lowest_index(sband, sta); | ||
655 | return; | 664 | return; |
656 | } | 665 | } |
657 | 666 | ||
658 | rate_mask = sta->supp_rates[sband->band]; | ||
659 | index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1); | 667 | index = min(rs_sta->last_txrate_idx & 0xffff, IWL_RATE_COUNT - 1); |
660 | 668 | ||
661 | if (sband->band == IEEE80211_BAND_5GHZ) | 669 | if (sband->band == IEEE80211_BAND_5GHZ) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 8fdb34222c0a..45cfa1cf194a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -2219,7 +2219,7 @@ int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv) | |||
2219 | /* set tx power value for all OFDM rates */ | 2219 | /* set tx power value for all OFDM rates */ |
2220 | for (rate_index = 0; rate_index < IWL_OFDM_RATES; | 2220 | for (rate_index = 0; rate_index < IWL_OFDM_RATES; |
2221 | rate_index++) { | 2221 | rate_index++) { |
2222 | s32 power_idx; | 2222 | s32 uninitialized_var(power_idx); |
2223 | int rc; | 2223 | int rc; |
2224 | 2224 | ||
2225 | /* use channel group's clip-power table, | 2225 | /* use channel group's clip-power table, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index f3f17929ca0b..27f50471aed8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -944,7 +944,8 @@ static void rs_tx_status(void *priv_r, struct ieee80211_supported_band *sband, | |||
944 | } | 944 | } |
945 | 945 | ||
946 | /* See if there's a better rate or modulation mode to try. */ | 946 | /* See if there's a better rate or modulation mode to try. */ |
947 | rs_rate_scale_perform(priv, hdr, sta, lq_sta); | 947 | if (sta && sta->supp_rates[sband->band]) |
948 | rs_rate_scale_perform(priv, hdr, sta, lq_sta); | ||
948 | out: | 949 | out: |
949 | return; | 950 | return; |
950 | } | 951 | } |
@@ -2101,14 +2102,23 @@ static void rs_get_rate(void *priv_r, struct ieee80211_sta *sta, void *priv_sta, | |||
2101 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); | 2102 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); |
2102 | struct iwl_lq_sta *lq_sta = priv_sta; | 2103 | struct iwl_lq_sta *lq_sta = priv_sta; |
2103 | int rate_idx; | 2104 | int rate_idx; |
2105 | u64 mask_bit = 0; | ||
2104 | 2106 | ||
2105 | IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); | 2107 | IWL_DEBUG_RATE_LIMIT("rate scale calculate new rate for skb\n"); |
2106 | 2108 | ||
2109 | if (sta) | ||
2110 | mask_bit = sta->supp_rates[sband->band]; | ||
2111 | |||
2107 | /* Send management frames and broadcast/multicast data using lowest | 2112 | /* Send management frames and broadcast/multicast data using lowest |
2108 | * rate. */ | 2113 | * rate. */ |
2109 | if (!ieee80211_is_data(hdr->frame_control) || | 2114 | if (!ieee80211_is_data(hdr->frame_control) || |
2110 | is_multicast_ether_addr(hdr->addr1) || !sta || !lq_sta) { | 2115 | is_multicast_ether_addr(hdr->addr1) || !sta || !lq_sta) { |
2111 | info->control.rates[0].idx = rate_lowest_index(sband, sta); | 2116 | if (!mask_bit) |
2117 | info->control.rates[0].idx = | ||
2118 | rate_lowest_index(sband, NULL); | ||
2119 | else | ||
2120 | info->control.rates[0].idx = | ||
2121 | rate_lowest_index(sband, sta); | ||
2112 | return; | 2122 | return; |
2113 | } | 2123 | } |
2114 | 2124 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 5da6b35cd26d..c01ea48da5fe 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1719,6 +1719,10 @@ static int iwl_read_ucode(struct iwl_priv *priv) | |||
1719 | priv->ucode_data_backup.len = data_size; | 1719 | priv->ucode_data_backup.len = data_size; |
1720 | iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_data_backup); | 1720 | iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_data_backup); |
1721 | 1721 | ||
1722 | if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr || | ||
1723 | !priv->ucode_data_backup.v_addr) | ||
1724 | goto err_pci_alloc; | ||
1725 | |||
1722 | /* Initialization instructions and data */ | 1726 | /* Initialization instructions and data */ |
1723 | if (init_size && init_data_size) { | 1727 | if (init_size && init_data_size) { |
1724 | priv->ucode_init.len = init_size; | 1728 | priv->ucode_init.len = init_size; |
@@ -2482,7 +2486,7 @@ static int iwl_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
2482 | dev_kfree_skb_any(skb); | 2486 | dev_kfree_skb_any(skb); |
2483 | 2487 | ||
2484 | IWL_DEBUG_MACDUMP("leave\n"); | 2488 | IWL_DEBUG_MACDUMP("leave\n"); |
2485 | return 0; | 2489 | return NETDEV_TX_OK; |
2486 | } | 2490 | } |
2487 | 2491 | ||
2488 | static int iwl_mac_add_interface(struct ieee80211_hw *hw, | 2492 | static int iwl_mac_add_interface(struct ieee80211_hw *hw, |
@@ -4038,6 +4042,7 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4038 | priv->is_open = 1; | 4042 | priv->is_open = 1; |
4039 | } | 4043 | } |
4040 | 4044 | ||
4045 | pci_save_state(pdev); | ||
4041 | pci_set_power_state(pdev, PCI_D3hot); | 4046 | pci_set_power_state(pdev, PCI_D3hot); |
4042 | 4047 | ||
4043 | return 0; | 4048 | return 0; |
@@ -4048,6 +4053,7 @@ static int iwl_pci_resume(struct pci_dev *pdev) | |||
4048 | struct iwl_priv *priv = pci_get_drvdata(pdev); | 4053 | struct iwl_priv *priv = pci_get_drvdata(pdev); |
4049 | 4054 | ||
4050 | pci_set_power_state(pdev, PCI_D0); | 4055 | pci_set_power_state(pdev, PCI_D0); |
4056 | pci_restore_state(pdev); | ||
4051 | 4057 | ||
4052 | if (priv->is_open) | 4058 | if (priv->is_open) |
4053 | iwl_mac_start(priv->hw); | 4059 | iwl_mac_start(priv->hw); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 52966ffbef6e..ba997204c8d4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -255,7 +255,7 @@ struct iwl_cmd_header { | |||
255 | * 0x3) 54 Mbps | 255 | * 0x3) 54 Mbps |
256 | * | 256 | * |
257 | * Legacy CCK rate format for bits 7:0 (bit 8 must be "0", bit 9 "1"): | 257 | * Legacy CCK rate format for bits 7:0 (bit 8 must be "0", bit 9 "1"): |
258 | * 3-0: 10) 1 Mbps | 258 | * 6-0: 10) 1 Mbps |
259 | * 20) 2 Mbps | 259 | * 20) 2 Mbps |
260 | * 55) 5.5 Mbps | 260 | * 55) 5.5 Mbps |
261 | * 110) 11 Mbps | 261 | * 110) 11 Mbps |
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c index 01a2169cecec..4b35b30e493e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c | |||
@@ -51,6 +51,7 @@ const char *get_cmd_string(u8 cmd) | |||
51 | IWL_CMD(REPLY_REMOVE_STA); | 51 | IWL_CMD(REPLY_REMOVE_STA); |
52 | IWL_CMD(REPLY_REMOVE_ALL_STA); | 52 | IWL_CMD(REPLY_REMOVE_ALL_STA); |
53 | IWL_CMD(REPLY_WEPKEY); | 53 | IWL_CMD(REPLY_WEPKEY); |
54 | IWL_CMD(REPLY_3945_RX); | ||
54 | IWL_CMD(REPLY_TX); | 55 | IWL_CMD(REPLY_TX); |
55 | IWL_CMD(REPLY_RATE_SCALE); | 56 | IWL_CMD(REPLY_RATE_SCALE); |
56 | IWL_CMD(REPLY_LEDS_CMD); | 57 | IWL_CMD(REPLY_LEDS_CMD); |
@@ -223,7 +224,7 @@ int iwl_send_cmd_sync(struct iwl_priv *priv, struct iwl_host_cmd *cmd) | |||
223 | IWL_ERROR("Error: Response NULL in '%s'\n", | 224 | IWL_ERROR("Error: Response NULL in '%s'\n", |
224 | get_cmd_string(cmd->id)); | 225 | get_cmd_string(cmd->id)); |
225 | ret = -EIO; | 226 | ret = -EIO; |
226 | goto out; | 227 | goto cancel; |
227 | } | 228 | } |
228 | 229 | ||
229 | ret = 0; | 230 | ret = 0; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 412f66bac1af..70a8b21ca39b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -480,6 +480,9 @@ void iwl_clear_stations_table(struct iwl_priv *priv) | |||
480 | priv->num_stations = 0; | 480 | priv->num_stations = 0; |
481 | memset(priv->stations, 0, sizeof(priv->stations)); | 481 | memset(priv->stations, 0, sizeof(priv->stations)); |
482 | 482 | ||
483 | /* clean ucode key table bit map */ | ||
484 | priv->ucode_key_table = 0; | ||
485 | |||
483 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 486 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
484 | } | 487 | } |
485 | EXPORT_SYMBOL(iwl_clear_stations_table); | 488 | EXPORT_SYMBOL(iwl_clear_stations_table); |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index d64580805d6e..5b44d322b99f 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -745,7 +745,7 @@ static int iwl3945_send_cmd_sync(struct iwl3945_priv *priv, struct iwl3945_host_ | |||
745 | IWL_ERROR("Error: Response NULL in '%s'\n", | 745 | IWL_ERROR("Error: Response NULL in '%s'\n", |
746 | get_cmd_string(cmd->id)); | 746 | get_cmd_string(cmd->id)); |
747 | ret = -EIO; | 747 | ret = -EIO; |
748 | goto out; | 748 | goto cancel; |
749 | } | 749 | } |
750 | 750 | ||
751 | ret = 0; | 751 | ret = 0; |
@@ -6538,7 +6538,7 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
6538 | dev_kfree_skb_any(skb); | 6538 | dev_kfree_skb_any(skb); |
6539 | 6539 | ||
6540 | IWL_DEBUG_MAC80211("leave\n"); | 6540 | IWL_DEBUG_MAC80211("leave\n"); |
6541 | return 0; | 6541 | return NETDEV_TX_OK; |
6542 | } | 6542 | } |
6543 | 6543 | ||
6544 | static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, | 6544 | static int iwl3945_mac_add_interface(struct ieee80211_hw *hw, |
@@ -8143,6 +8143,7 @@ static int iwl3945_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
8143 | priv->is_open = 1; | 8143 | priv->is_open = 1; |
8144 | } | 8144 | } |
8145 | 8145 | ||
8146 | pci_save_state(pdev); | ||
8146 | pci_set_power_state(pdev, PCI_D3hot); | 8147 | pci_set_power_state(pdev, PCI_D3hot); |
8147 | 8148 | ||
8148 | return 0; | 8149 | return 0; |
@@ -8153,6 +8154,7 @@ static int iwl3945_pci_resume(struct pci_dev *pdev) | |||
8153 | struct iwl3945_priv *priv = pci_get_drvdata(pdev); | 8154 | struct iwl3945_priv *priv = pci_get_drvdata(pdev); |
8154 | 8155 | ||
8155 | pci_set_power_state(pdev, PCI_D0); | 8156 | pci_set_power_state(pdev, PCI_D0); |
8157 | pci_restore_state(pdev); | ||
8156 | 8158 | ||
8157 | if (priv->is_open) | 8159 | if (priv->is_open) |
8158 | iwl3945_mac_start(priv->hw); | 8160 | iwl3945_mac_start(priv->hw); |
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h index e173b1b46c23..f6a79a653b7b 100644 --- a/drivers/net/wireless/libertas/hostcmd.h +++ b/drivers/net/wireless/libertas/hostcmd.h | |||
@@ -32,7 +32,7 @@ struct txpd { | |||
32 | u8 pktdelay_2ms; | 32 | u8 pktdelay_2ms; |
33 | /* reserved */ | 33 | /* reserved */ |
34 | u8 reserved1; | 34 | u8 reserved1; |
35 | }; | 35 | } __attribute__ ((packed)); |
36 | 36 | ||
37 | /* RxPD Descriptor */ | 37 | /* RxPD Descriptor */ |
38 | struct rxpd { | 38 | struct rxpd { |
@@ -63,7 +63,7 @@ struct rxpd { | |||
63 | /* Pkt Priority */ | 63 | /* Pkt Priority */ |
64 | u8 priority; | 64 | u8 priority; |
65 | u8 reserved[3]; | 65 | u8 reserved[3]; |
66 | }; | 66 | } __attribute__ ((packed)); |
67 | 67 | ||
68 | struct cmd_header { | 68 | struct cmd_header { |
69 | __le16 command; | 69 | __le16 command; |
@@ -97,7 +97,7 @@ struct enc_key { | |||
97 | struct lbs_offset_value { | 97 | struct lbs_offset_value { |
98 | u32 offset; | 98 | u32 offset; |
99 | u32 value; | 99 | u32 value; |
100 | }; | 100 | } __attribute__ ((packed)); |
101 | 101 | ||
102 | /* Define general data structure */ | 102 | /* Define general data structure */ |
103 | /* cmd_DS_GEN */ | 103 | /* cmd_DS_GEN */ |
@@ -107,7 +107,7 @@ struct cmd_ds_gen { | |||
107 | __le16 seqnum; | 107 | __le16 seqnum; |
108 | __le16 result; | 108 | __le16 result; |
109 | void *cmdresp[0]; | 109 | void *cmdresp[0]; |
110 | }; | 110 | } __attribute__ ((packed)); |
111 | 111 | ||
112 | #define S_DS_GEN sizeof(struct cmd_ds_gen) | 112 | #define S_DS_GEN sizeof(struct cmd_ds_gen) |
113 | 113 | ||
@@ -163,7 +163,7 @@ struct cmd_ds_802_11_subscribe_event { | |||
163 | * bump this up a bit. | 163 | * bump this up a bit. |
164 | */ | 164 | */ |
165 | uint8_t tlv[128]; | 165 | uint8_t tlv[128]; |
166 | }; | 166 | } __attribute__ ((packed)); |
167 | 167 | ||
168 | /* | 168 | /* |
169 | * This scan handle Country Information IE(802.11d compliant) | 169 | * This scan handle Country Information IE(802.11d compliant) |
@@ -180,7 +180,7 @@ struct cmd_ds_802_11_scan { | |||
180 | mrvlietypes_chanlistparamset_t ChanListParamSet; | 180 | mrvlietypes_chanlistparamset_t ChanListParamSet; |
181 | mrvlietypes_ratesparamset_t OpRateSet; | 181 | mrvlietypes_ratesparamset_t OpRateSet; |
182 | #endif | 182 | #endif |
183 | }; | 183 | } __attribute__ ((packed)); |
184 | 184 | ||
185 | struct cmd_ds_802_11_scan_rsp { | 185 | struct cmd_ds_802_11_scan_rsp { |
186 | struct cmd_header hdr; | 186 | struct cmd_header hdr; |
@@ -188,7 +188,7 @@ struct cmd_ds_802_11_scan_rsp { | |||
188 | __le16 bssdescriptsize; | 188 | __le16 bssdescriptsize; |
189 | uint8_t nr_sets; | 189 | uint8_t nr_sets; |
190 | uint8_t bssdesc_and_tlvbuffer[0]; | 190 | uint8_t bssdesc_and_tlvbuffer[0]; |
191 | }; | 191 | } __attribute__ ((packed)); |
192 | 192 | ||
193 | struct cmd_ds_802_11_get_log { | 193 | struct cmd_ds_802_11_get_log { |
194 | struct cmd_header hdr; | 194 | struct cmd_header hdr; |
@@ -206,33 +206,33 @@ struct cmd_ds_802_11_get_log { | |||
206 | __le32 fcserror; | 206 | __le32 fcserror; |
207 | __le32 txframe; | 207 | __le32 txframe; |
208 | __le32 wepundecryptable; | 208 | __le32 wepundecryptable; |
209 | }; | 209 | } __attribute__ ((packed)); |
210 | 210 | ||
211 | struct cmd_ds_mac_control { | 211 | struct cmd_ds_mac_control { |
212 | struct cmd_header hdr; | 212 | struct cmd_header hdr; |
213 | __le16 action; | 213 | __le16 action; |
214 | u16 reserved; | 214 | u16 reserved; |
215 | }; | 215 | } __attribute__ ((packed)); |
216 | 216 | ||
217 | struct cmd_ds_mac_multicast_adr { | 217 | struct cmd_ds_mac_multicast_adr { |
218 | struct cmd_header hdr; | 218 | struct cmd_header hdr; |
219 | __le16 action; | 219 | __le16 action; |
220 | __le16 nr_of_adrs; | 220 | __le16 nr_of_adrs; |
221 | u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE]; | 221 | u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE]; |
222 | }; | 222 | } __attribute__ ((packed)); |
223 | 223 | ||
224 | struct cmd_ds_802_11_authenticate { | 224 | struct cmd_ds_802_11_authenticate { |
225 | u8 macaddr[ETH_ALEN]; | 225 | u8 macaddr[ETH_ALEN]; |
226 | u8 authtype; | 226 | u8 authtype; |
227 | u8 reserved[10]; | 227 | u8 reserved[10]; |
228 | }; | 228 | } __attribute__ ((packed)); |
229 | 229 | ||
230 | struct cmd_ds_802_11_deauthenticate { | 230 | struct cmd_ds_802_11_deauthenticate { |
231 | struct cmd_header hdr; | 231 | struct cmd_header hdr; |
232 | 232 | ||
233 | u8 macaddr[ETH_ALEN]; | 233 | u8 macaddr[ETH_ALEN]; |
234 | __le16 reasoncode; | 234 | __le16 reasoncode; |
235 | }; | 235 | } __attribute__ ((packed)); |
236 | 236 | ||
237 | struct cmd_ds_802_11_associate { | 237 | struct cmd_ds_802_11_associate { |
238 | u8 peerstaaddr[6]; | 238 | u8 peerstaaddr[6]; |
@@ -251,7 +251,7 @@ struct cmd_ds_802_11_associate { | |||
251 | 251 | ||
252 | struct cmd_ds_802_11_associate_rsp { | 252 | struct cmd_ds_802_11_associate_rsp { |
253 | struct ieeetypes_assocrsp assocRsp; | 253 | struct ieeetypes_assocrsp assocRsp; |
254 | }; | 254 | } __attribute__ ((packed)); |
255 | 255 | ||
256 | struct cmd_ds_802_11_set_wep { | 256 | struct cmd_ds_802_11_set_wep { |
257 | struct cmd_header hdr; | 257 | struct cmd_header hdr; |
@@ -265,7 +265,7 @@ struct cmd_ds_802_11_set_wep { | |||
265 | /* 40, 128bit or TXWEP */ | 265 | /* 40, 128bit or TXWEP */ |
266 | uint8_t keytype[4]; | 266 | uint8_t keytype[4]; |
267 | uint8_t keymaterial[4][16]; | 267 | uint8_t keymaterial[4][16]; |
268 | }; | 268 | } __attribute__ ((packed)); |
269 | 269 | ||
270 | struct cmd_ds_802_3_get_stat { | 270 | struct cmd_ds_802_3_get_stat { |
271 | __le32 xmitok; | 271 | __le32 xmitok; |
@@ -274,7 +274,7 @@ struct cmd_ds_802_3_get_stat { | |||
274 | __le32 rcverror; | 274 | __le32 rcverror; |
275 | __le32 rcvnobuffer; | 275 | __le32 rcvnobuffer; |
276 | __le32 rcvcrcerror; | 276 | __le32 rcvcrcerror; |
277 | }; | 277 | } __attribute__ ((packed)); |
278 | 278 | ||
279 | struct cmd_ds_802_11_get_stat { | 279 | struct cmd_ds_802_11_get_stat { |
280 | __le32 txfragmentcnt; | 280 | __le32 txfragmentcnt; |
@@ -294,7 +294,7 @@ struct cmd_ds_802_11_get_stat { | |||
294 | __le32 txbeacon; | 294 | __le32 txbeacon; |
295 | __le32 rxbeacon; | 295 | __le32 rxbeacon; |
296 | __le32 wepundecryptable; | 296 | __le32 wepundecryptable; |
297 | }; | 297 | } __attribute__ ((packed)); |
298 | 298 | ||
299 | struct cmd_ds_802_11_snmp_mib { | 299 | struct cmd_ds_802_11_snmp_mib { |
300 | struct cmd_header hdr; | 300 | struct cmd_header hdr; |
@@ -303,58 +303,58 @@ struct cmd_ds_802_11_snmp_mib { | |||
303 | __le16 oid; | 303 | __le16 oid; |
304 | __le16 bufsize; | 304 | __le16 bufsize; |
305 | u8 value[128]; | 305 | u8 value[128]; |
306 | }; | 306 | } __attribute__ ((packed)); |
307 | 307 | ||
308 | struct cmd_ds_mac_reg_map { | 308 | struct cmd_ds_mac_reg_map { |
309 | __le16 buffersize; | 309 | __le16 buffersize; |
310 | u8 regmap[128]; | 310 | u8 regmap[128]; |
311 | __le16 reserved; | 311 | __le16 reserved; |
312 | }; | 312 | } __attribute__ ((packed)); |
313 | 313 | ||
314 | struct cmd_ds_bbp_reg_map { | 314 | struct cmd_ds_bbp_reg_map { |
315 | __le16 buffersize; | 315 | __le16 buffersize; |
316 | u8 regmap[128]; | 316 | u8 regmap[128]; |
317 | __le16 reserved; | 317 | __le16 reserved; |
318 | }; | 318 | } __attribute__ ((packed)); |
319 | 319 | ||
320 | struct cmd_ds_rf_reg_map { | 320 | struct cmd_ds_rf_reg_map { |
321 | __le16 buffersize; | 321 | __le16 buffersize; |
322 | u8 regmap[64]; | 322 | u8 regmap[64]; |
323 | __le16 reserved; | 323 | __le16 reserved; |
324 | }; | 324 | } __attribute__ ((packed)); |
325 | 325 | ||
326 | struct cmd_ds_mac_reg_access { | 326 | struct cmd_ds_mac_reg_access { |
327 | __le16 action; | 327 | __le16 action; |
328 | __le16 offset; | 328 | __le16 offset; |
329 | __le32 value; | 329 | __le32 value; |
330 | }; | 330 | } __attribute__ ((packed)); |
331 | 331 | ||
332 | struct cmd_ds_bbp_reg_access { | 332 | struct cmd_ds_bbp_reg_access { |
333 | __le16 action; | 333 | __le16 action; |
334 | __le16 offset; | 334 | __le16 offset; |
335 | u8 value; | 335 | u8 value; |
336 | u8 reserved[3]; | 336 | u8 reserved[3]; |
337 | }; | 337 | } __attribute__ ((packed)); |
338 | 338 | ||
339 | struct cmd_ds_rf_reg_access { | 339 | struct cmd_ds_rf_reg_access { |
340 | __le16 action; | 340 | __le16 action; |
341 | __le16 offset; | 341 | __le16 offset; |
342 | u8 value; | 342 | u8 value; |
343 | u8 reserved[3]; | 343 | u8 reserved[3]; |
344 | }; | 344 | } __attribute__ ((packed)); |
345 | 345 | ||
346 | struct cmd_ds_802_11_radio_control { | 346 | struct cmd_ds_802_11_radio_control { |
347 | struct cmd_header hdr; | 347 | struct cmd_header hdr; |
348 | 348 | ||
349 | __le16 action; | 349 | __le16 action; |
350 | __le16 control; | 350 | __le16 control; |
351 | }; | 351 | } __attribute__ ((packed)); |
352 | 352 | ||
353 | struct cmd_ds_802_11_beacon_control { | 353 | struct cmd_ds_802_11_beacon_control { |
354 | __le16 action; | 354 | __le16 action; |
355 | __le16 beacon_enable; | 355 | __le16 beacon_enable; |
356 | __le16 beacon_period; | 356 | __le16 beacon_period; |
357 | }; | 357 | } __attribute__ ((packed)); |
358 | 358 | ||
359 | struct cmd_ds_802_11_sleep_params { | 359 | struct cmd_ds_802_11_sleep_params { |
360 | struct cmd_header hdr; | 360 | struct cmd_header hdr; |
@@ -379,7 +379,7 @@ struct cmd_ds_802_11_sleep_params { | |||
379 | 379 | ||
380 | /* reserved field, should be set to zero */ | 380 | /* reserved field, should be set to zero */ |
381 | __le16 reserved; | 381 | __le16 reserved; |
382 | }; | 382 | } __attribute__ ((packed)); |
383 | 383 | ||
384 | struct cmd_ds_802_11_inactivity_timeout { | 384 | struct cmd_ds_802_11_inactivity_timeout { |
385 | struct cmd_header hdr; | 385 | struct cmd_header hdr; |
@@ -389,7 +389,7 @@ struct cmd_ds_802_11_inactivity_timeout { | |||
389 | 389 | ||
390 | /* Inactivity timeout in msec */ | 390 | /* Inactivity timeout in msec */ |
391 | __le16 timeout; | 391 | __le16 timeout; |
392 | }; | 392 | } __attribute__ ((packed)); |
393 | 393 | ||
394 | struct cmd_ds_802_11_rf_channel { | 394 | struct cmd_ds_802_11_rf_channel { |
395 | struct cmd_header hdr; | 395 | struct cmd_header hdr; |
@@ -399,7 +399,7 @@ struct cmd_ds_802_11_rf_channel { | |||
399 | __le16 rftype; /* unused */ | 399 | __le16 rftype; /* unused */ |
400 | __le16 reserved; /* unused */ | 400 | __le16 reserved; /* unused */ |
401 | u8 channellist[32]; /* unused */ | 401 | u8 channellist[32]; /* unused */ |
402 | }; | 402 | } __attribute__ ((packed)); |
403 | 403 | ||
404 | struct cmd_ds_802_11_rssi { | 404 | struct cmd_ds_802_11_rssi { |
405 | /* weighting factor */ | 405 | /* weighting factor */ |
@@ -408,21 +408,21 @@ struct cmd_ds_802_11_rssi { | |||
408 | __le16 reserved_0; | 408 | __le16 reserved_0; |
409 | __le16 reserved_1; | 409 | __le16 reserved_1; |
410 | __le16 reserved_2; | 410 | __le16 reserved_2; |
411 | }; | 411 | } __attribute__ ((packed)); |
412 | 412 | ||
413 | struct cmd_ds_802_11_rssi_rsp { | 413 | struct cmd_ds_802_11_rssi_rsp { |
414 | __le16 SNR; | 414 | __le16 SNR; |
415 | __le16 noisefloor; | 415 | __le16 noisefloor; |
416 | __le16 avgSNR; | 416 | __le16 avgSNR; |
417 | __le16 avgnoisefloor; | 417 | __le16 avgnoisefloor; |
418 | }; | 418 | } __attribute__ ((packed)); |
419 | 419 | ||
420 | struct cmd_ds_802_11_mac_address { | 420 | struct cmd_ds_802_11_mac_address { |
421 | struct cmd_header hdr; | 421 | struct cmd_header hdr; |
422 | 422 | ||
423 | __le16 action; | 423 | __le16 action; |
424 | u8 macadd[ETH_ALEN]; | 424 | u8 macadd[ETH_ALEN]; |
425 | }; | 425 | } __attribute__ ((packed)); |
426 | 426 | ||
427 | struct cmd_ds_802_11_rf_tx_power { | 427 | struct cmd_ds_802_11_rf_tx_power { |
428 | struct cmd_header hdr; | 428 | struct cmd_header hdr; |
@@ -431,7 +431,7 @@ struct cmd_ds_802_11_rf_tx_power { | |||
431 | __le16 curlevel; | 431 | __le16 curlevel; |
432 | s8 maxlevel; | 432 | s8 maxlevel; |
433 | s8 minlevel; | 433 | s8 minlevel; |
434 | }; | 434 | } __attribute__ ((packed)); |
435 | 435 | ||
436 | struct cmd_ds_802_11_rf_antenna { | 436 | struct cmd_ds_802_11_rf_antenna { |
437 | __le16 action; | 437 | __le16 action; |
@@ -439,33 +439,33 @@ struct cmd_ds_802_11_rf_antenna { | |||
439 | /* Number of antennas or 0xffff(diversity) */ | 439 | /* Number of antennas or 0xffff(diversity) */ |
440 | __le16 antennamode; | 440 | __le16 antennamode; |
441 | 441 | ||
442 | }; | 442 | } __attribute__ ((packed)); |
443 | 443 | ||
444 | struct cmd_ds_802_11_monitor_mode { | 444 | struct cmd_ds_802_11_monitor_mode { |
445 | __le16 action; | 445 | __le16 action; |
446 | __le16 mode; | 446 | __le16 mode; |
447 | }; | 447 | } __attribute__ ((packed)); |
448 | 448 | ||
449 | struct cmd_ds_set_boot2_ver { | 449 | struct cmd_ds_set_boot2_ver { |
450 | struct cmd_header hdr; | 450 | struct cmd_header hdr; |
451 | 451 | ||
452 | __le16 action; | 452 | __le16 action; |
453 | __le16 version; | 453 | __le16 version; |
454 | }; | 454 | } __attribute__ ((packed)); |
455 | 455 | ||
456 | struct cmd_ds_802_11_fw_wake_method { | 456 | struct cmd_ds_802_11_fw_wake_method { |
457 | struct cmd_header hdr; | 457 | struct cmd_header hdr; |
458 | 458 | ||
459 | __le16 action; | 459 | __le16 action; |
460 | __le16 method; | 460 | __le16 method; |
461 | }; | 461 | } __attribute__ ((packed)); |
462 | 462 | ||
463 | struct cmd_ds_802_11_sleep_period { | 463 | struct cmd_ds_802_11_sleep_period { |
464 | struct cmd_header hdr; | 464 | struct cmd_header hdr; |
465 | 465 | ||
466 | __le16 action; | 466 | __le16 action; |
467 | __le16 period; | 467 | __le16 period; |
468 | }; | 468 | } __attribute__ ((packed)); |
469 | 469 | ||
470 | struct cmd_ds_802_11_ps_mode { | 470 | struct cmd_ds_802_11_ps_mode { |
471 | __le16 action; | 471 | __le16 action; |
@@ -473,7 +473,7 @@ struct cmd_ds_802_11_ps_mode { | |||
473 | __le16 multipledtim; | 473 | __le16 multipledtim; |
474 | __le16 reserved; | 474 | __le16 reserved; |
475 | __le16 locallisteninterval; | 475 | __le16 locallisteninterval; |
476 | }; | 476 | } __attribute__ ((packed)); |
477 | 477 | ||
478 | struct cmd_confirm_sleep { | 478 | struct cmd_confirm_sleep { |
479 | struct cmd_header hdr; | 479 | struct cmd_header hdr; |
@@ -483,7 +483,7 @@ struct cmd_confirm_sleep { | |||
483 | __le16 multipledtim; | 483 | __le16 multipledtim; |
484 | __le16 reserved; | 484 | __le16 reserved; |
485 | __le16 locallisteninterval; | 485 | __le16 locallisteninterval; |
486 | }; | 486 | } __attribute__ ((packed)); |
487 | 487 | ||
488 | struct cmd_ds_802_11_data_rate { | 488 | struct cmd_ds_802_11_data_rate { |
489 | struct cmd_header hdr; | 489 | struct cmd_header hdr; |
@@ -491,14 +491,14 @@ struct cmd_ds_802_11_data_rate { | |||
491 | __le16 action; | 491 | __le16 action; |
492 | __le16 reserved; | 492 | __le16 reserved; |
493 | u8 rates[MAX_RATES]; | 493 | u8 rates[MAX_RATES]; |
494 | }; | 494 | } __attribute__ ((packed)); |
495 | 495 | ||
496 | struct cmd_ds_802_11_rate_adapt_rateset { | 496 | struct cmd_ds_802_11_rate_adapt_rateset { |
497 | struct cmd_header hdr; | 497 | struct cmd_header hdr; |
498 | __le16 action; | 498 | __le16 action; |
499 | __le16 enablehwauto; | 499 | __le16 enablehwauto; |
500 | __le16 bitmap; | 500 | __le16 bitmap; |
501 | }; | 501 | } __attribute__ ((packed)); |
502 | 502 | ||
503 | struct cmd_ds_802_11_ad_hoc_start { | 503 | struct cmd_ds_802_11_ad_hoc_start { |
504 | struct cmd_header hdr; | 504 | struct cmd_header hdr; |
@@ -520,7 +520,7 @@ struct cmd_ds_802_11_ad_hoc_result { | |||
520 | 520 | ||
521 | u8 pad[3]; | 521 | u8 pad[3]; |
522 | u8 bssid[ETH_ALEN]; | 522 | u8 bssid[ETH_ALEN]; |
523 | }; | 523 | } __attribute__ ((packed)); |
524 | 524 | ||
525 | struct adhoc_bssdesc { | 525 | struct adhoc_bssdesc { |
526 | u8 bssid[ETH_ALEN]; | 526 | u8 bssid[ETH_ALEN]; |
@@ -578,7 +578,7 @@ struct MrvlIEtype_keyParamSet { | |||
578 | 578 | ||
579 | /* key material of size keylen */ | 579 | /* key material of size keylen */ |
580 | u8 key[32]; | 580 | u8 key[32]; |
581 | }; | 581 | } __attribute__ ((packed)); |
582 | 582 | ||
583 | #define MAX_WOL_RULES 16 | 583 | #define MAX_WOL_RULES 16 |
584 | 584 | ||
@@ -590,7 +590,7 @@ struct host_wol_rule { | |||
590 | __le16 reserve; | 590 | __le16 reserve; |
591 | __be32 sig_mask; | 591 | __be32 sig_mask; |
592 | __be32 signature; | 592 | __be32 signature; |
593 | }; | 593 | } __attribute__ ((packed)); |
594 | 594 | ||
595 | struct wol_config { | 595 | struct wol_config { |
596 | uint8_t action; | 596 | uint8_t action; |
@@ -598,8 +598,7 @@ struct wol_config { | |||
598 | uint8_t no_rules_in_cmd; | 598 | uint8_t no_rules_in_cmd; |
599 | uint8_t result; | 599 | uint8_t result; |
600 | struct host_wol_rule rule[MAX_WOL_RULES]; | 600 | struct host_wol_rule rule[MAX_WOL_RULES]; |
601 | }; | 601 | } __attribute__ ((packed)); |
602 | |||
603 | 602 | ||
604 | struct cmd_ds_host_sleep { | 603 | struct cmd_ds_host_sleep { |
605 | struct cmd_header hdr; | 604 | struct cmd_header hdr; |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 3dba83679444..4e0007d20030 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -1369,7 +1369,7 @@ EXPORT_SYMBOL_GPL(lbs_start_card); | |||
1369 | 1369 | ||
1370 | void lbs_stop_card(struct lbs_private *priv) | 1370 | void lbs_stop_card(struct lbs_private *priv) |
1371 | { | 1371 | { |
1372 | struct net_device *dev = priv->dev; | 1372 | struct net_device *dev; |
1373 | struct cmd_ctrl_node *cmdnode; | 1373 | struct cmd_ctrl_node *cmdnode; |
1374 | unsigned long flags; | 1374 | unsigned long flags; |
1375 | 1375 | ||
@@ -1377,9 +1377,10 @@ void lbs_stop_card(struct lbs_private *priv) | |||
1377 | 1377 | ||
1378 | if (!priv) | 1378 | if (!priv) |
1379 | goto out; | 1379 | goto out; |
1380 | dev = priv->dev; | ||
1380 | 1381 | ||
1381 | netif_stop_queue(priv->dev); | 1382 | netif_stop_queue(dev); |
1382 | netif_carrier_off(priv->dev); | 1383 | netif_carrier_off(dev); |
1383 | 1384 | ||
1384 | lbs_debugfs_remove_one(priv); | 1385 | lbs_debugfs_remove_one(priv); |
1385 | if (priv->mesh_tlv) { | 1386 | if (priv->mesh_tlv) { |
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c index d1fc305de5fe..e7289e2e7f16 100644 --- a/drivers/net/wireless/libertas_tf/main.c +++ b/drivers/net/wireless/libertas_tf/main.c | |||
@@ -206,7 +206,7 @@ static int lbtf_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
206 | * there are no buffered multicast frames to send | 206 | * there are no buffered multicast frames to send |
207 | */ | 207 | */ |
208 | ieee80211_stop_queues(priv->hw); | 208 | ieee80211_stop_queues(priv->hw); |
209 | return 0; | 209 | return NETDEV_TX_OK; |
210 | } | 210 | } |
211 | 211 | ||
212 | static void lbtf_tx_work(struct work_struct *work) | 212 | static void lbtf_tx_work(struct work_struct *work) |
diff --git a/drivers/net/wireless/orinoco/orinoco.c b/drivers/net/wireless/orinoco/orinoco.c index bc84e2792f8a..45a04faa7818 100644 --- a/drivers/net/wireless/orinoco/orinoco.c +++ b/drivers/net/wireless/orinoco/orinoco.c | |||
@@ -1610,6 +1610,16 @@ static void orinoco_rx_isr_tasklet(unsigned long data) | |||
1610 | struct orinoco_rx_data *rx_data, *temp; | 1610 | struct orinoco_rx_data *rx_data, *temp; |
1611 | struct hermes_rx_descriptor *desc; | 1611 | struct hermes_rx_descriptor *desc; |
1612 | struct sk_buff *skb; | 1612 | struct sk_buff *skb; |
1613 | unsigned long flags; | ||
1614 | |||
1615 | /* orinoco_rx requires the driver lock, and we also need to | ||
1616 | * protect priv->rx_list, so just hold the lock over the | ||
1617 | * lot. | ||
1618 | * | ||
1619 | * If orinoco_lock fails, we've unplugged the card. In this | ||
1620 | * case just abort. */ | ||
1621 | if (orinoco_lock(priv, &flags) != 0) | ||
1622 | return; | ||
1613 | 1623 | ||
1614 | /* extract desc and skb from queue */ | 1624 | /* extract desc and skb from queue */ |
1615 | list_for_each_entry_safe(rx_data, temp, &priv->rx_list, list) { | 1625 | list_for_each_entry_safe(rx_data, temp, &priv->rx_list, list) { |
@@ -1622,6 +1632,8 @@ static void orinoco_rx_isr_tasklet(unsigned long data) | |||
1622 | 1632 | ||
1623 | kfree(desc); | 1633 | kfree(desc); |
1624 | } | 1634 | } |
1635 | |||
1636 | orinoco_unlock(priv, &flags); | ||
1625 | } | 1637 | } |
1626 | 1638 | ||
1627 | /********************************************************************/ | 1639 | /********************************************************************/ |
@@ -1661,7 +1673,7 @@ static void print_linkstatus(struct net_device *dev, u16 status) | |||
1661 | s = "UNKNOWN"; | 1673 | s = "UNKNOWN"; |
1662 | } | 1674 | } |
1663 | 1675 | ||
1664 | printk(KERN_INFO "%s: New link status: %s (%04x)\n", | 1676 | printk(KERN_DEBUG "%s: New link status: %s (%04x)\n", |
1665 | dev->name, s, status); | 1677 | dev->name, s, status); |
1666 | } | 1678 | } |
1667 | 1679 | ||
@@ -3645,12 +3657,22 @@ struct net_device | |||
3645 | void free_orinocodev(struct net_device *dev) | 3657 | void free_orinocodev(struct net_device *dev) |
3646 | { | 3658 | { |
3647 | struct orinoco_private *priv = netdev_priv(dev); | 3659 | struct orinoco_private *priv = netdev_priv(dev); |
3660 | struct orinoco_rx_data *rx_data, *temp; | ||
3648 | 3661 | ||
3649 | /* No need to empty priv->rx_list: if the tasklet is scheduled | 3662 | /* If the tasklet is scheduled when we call tasklet_kill it |
3650 | * when we call tasklet_kill it will run one final time, | 3663 | * will run one final time. However the tasklet will only |
3651 | * emptying the list */ | 3664 | * drain priv->rx_list if the hw is still available. */ |
3652 | tasklet_kill(&priv->rx_tasklet); | 3665 | tasklet_kill(&priv->rx_tasklet); |
3653 | 3666 | ||
3667 | /* Explicitly drain priv->rx_list */ | ||
3668 | list_for_each_entry_safe(rx_data, temp, &priv->rx_list, list) { | ||
3669 | list_del(&rx_data->list); | ||
3670 | |||
3671 | dev_kfree_skb(rx_data->skb); | ||
3672 | kfree(rx_data->desc); | ||
3673 | kfree(rx_data); | ||
3674 | } | ||
3675 | |||
3654 | unregister_pm_notifier(&priv->pm_notifier); | 3676 | unregister_pm_notifier(&priv->pm_notifier); |
3655 | orinoco_uncache_fw(priv); | 3677 | orinoco_uncache_fw(priv); |
3656 | 3678 | ||
@@ -5046,33 +5068,30 @@ static int orinoco_ioctl_set_genie(struct net_device *dev, | |||
5046 | struct orinoco_private *priv = netdev_priv(dev); | 5068 | struct orinoco_private *priv = netdev_priv(dev); |
5047 | u8 *buf; | 5069 | u8 *buf; |
5048 | unsigned long flags; | 5070 | unsigned long flags; |
5049 | int err = 0; | ||
5050 | 5071 | ||
5051 | /* cut off at IEEE80211_MAX_DATA_LEN */ | 5072 | /* cut off at IEEE80211_MAX_DATA_LEN */ |
5052 | if ((wrqu->data.length > IEEE80211_MAX_DATA_LEN) || | 5073 | if ((wrqu->data.length > IEEE80211_MAX_DATA_LEN) || |
5053 | (wrqu->data.length && (extra == NULL))) | 5074 | (wrqu->data.length && (extra == NULL))) |
5054 | return -EINVAL; | 5075 | return -EINVAL; |
5055 | 5076 | ||
5056 | if (orinoco_lock(priv, &flags) != 0) | ||
5057 | return -EBUSY; | ||
5058 | |||
5059 | if (wrqu->data.length) { | 5077 | if (wrqu->data.length) { |
5060 | buf = kmalloc(wrqu->data.length, GFP_KERNEL); | 5078 | buf = kmalloc(wrqu->data.length, GFP_KERNEL); |
5061 | if (buf == NULL) { | 5079 | if (buf == NULL) |
5062 | err = -ENOMEM; | 5080 | return -ENOMEM; |
5063 | goto out; | ||
5064 | } | ||
5065 | 5081 | ||
5066 | memcpy(buf, extra, wrqu->data.length); | 5082 | memcpy(buf, extra, wrqu->data.length); |
5067 | kfree(priv->wpa_ie); | 5083 | } else |
5068 | priv->wpa_ie = buf; | 5084 | buf = NULL; |
5069 | priv->wpa_ie_len = wrqu->data.length; | 5085 | |
5070 | } else { | 5086 | if (orinoco_lock(priv, &flags) != 0) { |
5071 | kfree(priv->wpa_ie); | 5087 | kfree(buf); |
5072 | priv->wpa_ie = NULL; | 5088 | return -EBUSY; |
5073 | priv->wpa_ie_len = 0; | ||
5074 | } | 5089 | } |
5075 | 5090 | ||
5091 | kfree(priv->wpa_ie); | ||
5092 | priv->wpa_ie = buf; | ||
5093 | priv->wpa_ie_len = wrqu->data.length; | ||
5094 | |||
5076 | if (priv->wpa_ie) { | 5095 | if (priv->wpa_ie) { |
5077 | /* Looks like wl_lkm wants to check the auth alg, and | 5096 | /* Looks like wl_lkm wants to check the auth alg, and |
5078 | * somehow pass it to the firmware. | 5097 | * somehow pass it to the firmware. |
@@ -5081,9 +5100,8 @@ static int orinoco_ioctl_set_genie(struct net_device *dev, | |||
5081 | */ | 5100 | */ |
5082 | } | 5101 | } |
5083 | 5102 | ||
5084 | out: | ||
5085 | orinoco_unlock(priv, &flags); | 5103 | orinoco_unlock(priv, &flags); |
5086 | return err; | 5104 | return 0; |
5087 | } | 5105 | } |
5088 | 5106 | ||
5089 | static int orinoco_ioctl_get_genie(struct net_device *dev, | 5107 | static int orinoco_ioctl_get_genie(struct net_device *dev, |
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c index f127602670ec..0b32215d3f5d 100644 --- a/drivers/net/wireless/orinoco/orinoco_cs.c +++ b/drivers/net/wireless/orinoco/orinoco_cs.c | |||
@@ -435,6 +435,7 @@ static struct pcmcia_device_id orinoco_cs_ids[] = { | |||
435 | PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), /* Samsung SWL2000-N 11Mb/s WLAN Card */ | 435 | PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), /* Samsung SWL2000-N 11Mb/s WLAN Card */ |
436 | PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002), /* AirWay 802.11 Adapter (PCMCIA) */ | 436 | PCMCIA_DEVICE_MANF_CARD(0x0261, 0x0002), /* AirWay 802.11 Adapter (PCMCIA) */ |
437 | PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0001), /* ARtem Onair */ | 437 | PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0001), /* ARtem Onair */ |
438 | PCMCIA_DEVICE_MANF_CARD(0x0268, 0x0003), /* ARtem Onair Comcard 11 */ | ||
438 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0305), /* Buffalo WLI-PCM-S11 */ | 439 | PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0305), /* Buffalo WLI-PCM-S11 */ |
439 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), /* Linksys WPC11 Version 2.5 */ | 440 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), /* Linksys WPC11 Version 2.5 */ |
440 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), /* Linksys WPC11 Version 3 */ | 441 | PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1613), /* Linksys WPC11 Version 3 */ |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 82354b974a04..34561e6e816b 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -138,6 +138,7 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) | |||
138 | u8 *fw_version = NULL; | 138 | u8 *fw_version = NULL; |
139 | size_t len; | 139 | size_t len; |
140 | int i; | 140 | int i; |
141 | int maxlen; | ||
141 | 142 | ||
142 | if (priv->rx_start) | 143 | if (priv->rx_start) |
143 | return 0; | 144 | return 0; |
@@ -195,6 +196,16 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) | |||
195 | else | 196 | else |
196 | priv->rx_mtu = (size_t) | 197 | priv->rx_mtu = (size_t) |
197 | 0x620 - priv->tx_hdr_len; | 198 | 0x620 - priv->tx_hdr_len; |
199 | maxlen = priv->tx_hdr_len + /* USB devices */ | ||
200 | sizeof(struct p54_rx_data) + | ||
201 | 4 + /* rx alignment */ | ||
202 | IEEE80211_MAX_FRAG_THRESHOLD; | ||
203 | if (priv->rx_mtu > maxlen && PAGE_SIZE == 4096) { | ||
204 | printk(KERN_INFO "p54: rx_mtu reduced from %d " | ||
205 | "to %d\n", priv->rx_mtu, | ||
206 | maxlen); | ||
207 | priv->rx_mtu = maxlen; | ||
208 | } | ||
198 | break; | 209 | break; |
199 | } | 210 | } |
200 | case BR_CODE_EXPOSED_IF: | 211 | case BR_CODE_EXPOSED_IF: |
@@ -440,8 +451,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
440 | } | 451 | } |
441 | if (err) | 452 | if (err) |
442 | goto err; | 453 | goto err; |
443 | 454 | } | |
444 | } | 455 | break; |
445 | case PDR_PRISM_ZIF_TX_IQ_CALIBRATION: | 456 | case PDR_PRISM_ZIF_TX_IQ_CALIBRATION: |
446 | priv->iq_autocal = kmalloc(data_len, GFP_KERNEL); | 457 | priv->iq_autocal = kmalloc(data_len, GFP_KERNEL); |
447 | if (!priv->iq_autocal) { | 458 | if (!priv->iq_autocal) { |
@@ -575,6 +586,7 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
575 | u16 freq = le16_to_cpu(hdr->freq); | 586 | u16 freq = le16_to_cpu(hdr->freq); |
576 | size_t header_len = sizeof(*hdr); | 587 | size_t header_len = sizeof(*hdr); |
577 | u32 tsf32; | 588 | u32 tsf32; |
589 | u8 rate = hdr->rate & 0xf; | ||
578 | 590 | ||
579 | /* | 591 | /* |
580 | * If the device is in a unspecified state we have to | 592 | * If the device is in a unspecified state we have to |
@@ -603,8 +615,11 @@ static int p54_rx_data(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
603 | rx_status.qual = (100 * hdr->rssi) / 127; | 615 | rx_status.qual = (100 * hdr->rssi) / 127; |
604 | if (hdr->rate & 0x10) | 616 | if (hdr->rate & 0x10) |
605 | rx_status.flag |= RX_FLAG_SHORTPRE; | 617 | rx_status.flag |= RX_FLAG_SHORTPRE; |
606 | rx_status.rate_idx = (dev->conf.channel->band == IEEE80211_BAND_2GHZ ? | 618 | if (dev->conf.channel->band == IEEE80211_BAND_5GHZ) |
607 | hdr->rate : (hdr->rate - 4)) & 0xf; | 619 | rx_status.rate_idx = (rate < 4) ? 0 : rate - 4; |
620 | else | ||
621 | rx_status.rate_idx = rate; | ||
622 | |||
608 | rx_status.freq = freq; | 623 | rx_status.freq = freq; |
609 | rx_status.band = dev->conf.channel->band; | 624 | rx_status.band = dev->conf.channel->band; |
610 | rx_status.antenna = hdr->antenna; | 625 | rx_status.antenna = hdr->antenna; |
@@ -730,7 +745,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
730 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry); | 745 | struct ieee80211_tx_info *info = IEEE80211_SKB_CB(entry); |
731 | struct p54_hdr *entry_hdr; | 746 | struct p54_hdr *entry_hdr; |
732 | struct p54_tx_data *entry_data; | 747 | struct p54_tx_data *entry_data; |
733 | int pad = 0; | 748 | unsigned int pad = 0, frame_len; |
734 | 749 | ||
735 | range = (void *)info->rate_driver_data; | 750 | range = (void *)info->rate_driver_data; |
736 | if (range->start_addr != addr) { | 751 | if (range->start_addr != addr) { |
@@ -753,6 +768,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
753 | __skb_unlink(entry, &priv->tx_queue); | 768 | __skb_unlink(entry, &priv->tx_queue); |
754 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); | 769 | spin_unlock_irqrestore(&priv->tx_queue.lock, flags); |
755 | 770 | ||
771 | frame_len = entry->len; | ||
756 | entry_hdr = (struct p54_hdr *) entry->data; | 772 | entry_hdr = (struct p54_hdr *) entry->data; |
757 | entry_data = (struct p54_tx_data *) entry_hdr->data; | 773 | entry_data = (struct p54_tx_data *) entry_hdr->data; |
758 | priv->tx_stats[entry_data->hw_queue].len--; | 774 | priv->tx_stats[entry_data->hw_queue].len--; |
@@ -798,6 +814,29 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
798 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; | 814 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
799 | info->status.ack_signal = p54_rssi_to_dbm(dev, | 815 | info->status.ack_signal = p54_rssi_to_dbm(dev, |
800 | (int)payload->ack_rssi); | 816 | (int)payload->ack_rssi); |
817 | |||
818 | /* Undo all changes to the frame. */ | ||
819 | switch (entry_data->key_type) { | ||
820 | case P54_CRYPTO_TKIPMICHAEL: { | ||
821 | u8 *iv = (u8 *)(entry_data->align + pad + | ||
822 | entry_data->crypt_offset); | ||
823 | |||
824 | /* Restore the original TKIP IV. */ | ||
825 | iv[2] = iv[0]; | ||
826 | iv[0] = iv[1]; | ||
827 | iv[1] = (iv[0] | 0x20) & 0x7f; /* WEPSeed - 8.3.2.2 */ | ||
828 | |||
829 | frame_len -= 12; /* remove TKIP_MMIC + TKIP_ICV */ | ||
830 | break; | ||
831 | } | ||
832 | case P54_CRYPTO_AESCCMP: | ||
833 | frame_len -= 8; /* remove CCMP_MIC */ | ||
834 | break; | ||
835 | case P54_CRYPTO_WEP: | ||
836 | frame_len -= 4; /* remove WEP_ICV */ | ||
837 | break; | ||
838 | } | ||
839 | skb_trim(entry, frame_len); | ||
801 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); | 840 | skb_pull(entry, sizeof(*hdr) + pad + sizeof(*entry_data)); |
802 | ieee80211_tx_status_irqsafe(dev, entry); | 841 | ieee80211_tx_status_irqsafe(dev, entry); |
803 | goto out; | 842 | goto out; |
@@ -1122,7 +1161,7 @@ static int p54_set_tim(struct ieee80211_hw *dev, struct ieee80211_sta *sta, | |||
1122 | 1161 | ||
1123 | skb = p54_alloc_skb(dev, P54_HDR_FLAG_CONTROL_OPSET, | 1162 | skb = p54_alloc_skb(dev, P54_HDR_FLAG_CONTROL_OPSET, |
1124 | sizeof(struct p54_hdr) + sizeof(*tim), | 1163 | sizeof(struct p54_hdr) + sizeof(*tim), |
1125 | P54_CONTROL_TYPE_TIM, GFP_KERNEL); | 1164 | P54_CONTROL_TYPE_TIM, GFP_ATOMIC); |
1126 | if (!skb) | 1165 | if (!skb) |
1127 | return -ENOMEM; | 1166 | return -ENOMEM; |
1128 | 1167 | ||
@@ -1383,7 +1422,6 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
1383 | hdr->tries = ridx; | 1422 | hdr->tries = ridx; |
1384 | txhdr->rts_rate_idx = 0; | 1423 | txhdr->rts_rate_idx = 0; |
1385 | if (info->control.hw_key) { | 1424 | if (info->control.hw_key) { |
1386 | crypt_offset += info->control.hw_key->iv_len; | ||
1387 | txhdr->key_type = p54_convert_algo(info->control.hw_key->alg); | 1425 | txhdr->key_type = p54_convert_algo(info->control.hw_key->alg); |
1388 | txhdr->key_len = min((u8)16, info->control.hw_key->keylen); | 1426 | txhdr->key_len = min((u8)16, info->control.hw_key->keylen); |
1389 | memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len); | 1427 | memcpy(txhdr->key, info->control.hw_key->key, txhdr->key_len); |
@@ -1397,6 +1435,8 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
1397 | } | 1435 | } |
1398 | /* reserve some space for ICV */ | 1436 | /* reserve some space for ICV */ |
1399 | len += info->control.hw_key->icv_len; | 1437 | len += info->control.hw_key->icv_len; |
1438 | memset(skb_put(skb, info->control.hw_key->icv_len), 0, | ||
1439 | info->control.hw_key->icv_len); | ||
1400 | } else { | 1440 | } else { |
1401 | txhdr->key_type = 0; | 1441 | txhdr->key_type = 0; |
1402 | txhdr->key_len = 0; | 1442 | txhdr->key_len = 0; |
@@ -1584,7 +1624,7 @@ static int p54_scan(struct ieee80211_hw *dev, u16 mode, u16 dwell) | |||
1584 | 1624 | ||
1585 | err: | 1625 | err: |
1586 | printk(KERN_ERR "%s: frequency change failed\n", wiphy_name(dev->wiphy)); | 1626 | printk(KERN_ERR "%s: frequency change failed\n", wiphy_name(dev->wiphy)); |
1587 | kfree_skb(skb); | 1627 | p54_free_skb(dev, skb); |
1588 | return -EINVAL; | 1628 | return -EINVAL; |
1589 | } | 1629 | } |
1590 | 1630 | ||
@@ -1824,7 +1864,7 @@ static void p54_remove_interface(struct ieee80211_hw *dev, | |||
1824 | 1864 | ||
1825 | static int p54_config(struct ieee80211_hw *dev, u32 changed) | 1865 | static int p54_config(struct ieee80211_hw *dev, u32 changed) |
1826 | { | 1866 | { |
1827 | int ret; | 1867 | int ret = 0; |
1828 | struct p54_common *priv = dev->priv; | 1868 | struct p54_common *priv = dev->priv; |
1829 | struct ieee80211_conf *conf = &dev->conf; | 1869 | struct ieee80211_conf *conf = &dev->conf; |
1830 | 1870 | ||
@@ -2051,7 +2091,7 @@ static int p54_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd, | |||
2051 | algo = P54_CRYPTO_AESCCMP; | 2091 | algo = P54_CRYPTO_AESCCMP; |
2052 | break; | 2092 | break; |
2053 | default: | 2093 | default: |
2054 | return -EINVAL; | 2094 | return -EOPNOTSUPP; |
2055 | } | 2095 | } |
2056 | } | 2096 | } |
2057 | 2097 | ||
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index c44a200059d2..5de2ebfb28c7 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -56,6 +56,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
56 | {USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */ | 56 | {USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */ |
57 | {USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */ | 57 | {USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */ |
58 | {USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */ | 58 | {USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */ |
59 | {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ | ||
59 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ | 60 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ |
60 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ | 61 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ |
61 | {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */ | 62 | {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */ |
@@ -143,11 +144,8 @@ static void p54u_tx_cb(struct urb *urb) | |||
143 | struct sk_buff *skb = urb->context; | 144 | struct sk_buff *skb = urb->context; |
144 | struct ieee80211_hw *dev = (struct ieee80211_hw *) | 145 | struct ieee80211_hw *dev = (struct ieee80211_hw *) |
145 | usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); | 146 | usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0)); |
146 | struct p54u_priv *priv = dev->priv; | ||
147 | 147 | ||
148 | skb_pull(skb, priv->common.tx_hdr_len); | 148 | p54_free_skb(dev, skb); |
149 | if (FREE_AFTER_TX(skb)) | ||
150 | p54_free_skb(dev, skb); | ||
151 | } | 149 | } |
152 | 150 | ||
153 | static void p54u_tx_dummy_cb(struct urb *urb) { } | 151 | static void p54u_tx_dummy_cb(struct urb *urb) { } |
@@ -229,7 +227,10 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
229 | p54u_tx_dummy_cb, dev); | 227 | p54u_tx_dummy_cb, dev); |
230 | usb_fill_bulk_urb(data_urb, priv->udev, | 228 | usb_fill_bulk_urb(data_urb, priv->udev, |
231 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), | 229 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), |
232 | skb->data, skb->len, p54u_tx_cb, skb); | 230 | skb->data, skb->len, FREE_AFTER_TX(skb) ? |
231 | p54u_tx_cb : p54u_tx_dummy_cb, skb); | ||
232 | addr_urb->transfer_flags |= URB_ZERO_PACKET; | ||
233 | data_urb->transfer_flags |= URB_ZERO_PACKET; | ||
233 | 234 | ||
234 | usb_anchor_urb(addr_urb, &priv->submitted); | 235 | usb_anchor_urb(addr_urb, &priv->submitted); |
235 | err = usb_submit_urb(addr_urb, GFP_ATOMIC); | 236 | err = usb_submit_urb(addr_urb, GFP_ATOMIC); |
@@ -238,7 +239,7 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
238 | goto out; | 239 | goto out; |
239 | } | 240 | } |
240 | 241 | ||
241 | usb_anchor_urb(addr_urb, &priv->submitted); | 242 | usb_anchor_urb(data_urb, &priv->submitted); |
242 | err = usb_submit_urb(data_urb, GFP_ATOMIC); | 243 | err = usb_submit_urb(data_urb, GFP_ATOMIC); |
243 | if (err) | 244 | if (err) |
244 | usb_unanchor_urb(data_urb); | 245 | usb_unanchor_urb(data_urb); |
@@ -268,27 +269,24 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
268 | { | 269 | { |
269 | struct p54u_priv *priv = dev->priv; | 270 | struct p54u_priv *priv = dev->priv; |
270 | struct urb *data_urb; | 271 | struct urb *data_urb; |
271 | struct lm87_tx_hdr *hdr; | 272 | struct lm87_tx_hdr *hdr = (void *)skb->data - sizeof(*hdr); |
272 | __le32 checksum; | ||
273 | __le32 addr = ((struct p54_hdr *)skb->data)->req_id; | ||
274 | 273 | ||
275 | data_urb = usb_alloc_urb(0, GFP_ATOMIC); | 274 | data_urb = usb_alloc_urb(0, GFP_ATOMIC); |
276 | if (!data_urb) | 275 | if (!data_urb) |
277 | return; | 276 | return; |
278 | 277 | ||
279 | checksum = p54u_lm87_chksum((__le32 *)skb->data, skb->len); | 278 | hdr->chksum = p54u_lm87_chksum((__le32 *)skb->data, skb->len); |
280 | hdr = (struct lm87_tx_hdr *)skb_push(skb, sizeof(*hdr)); | 279 | hdr->device_addr = ((struct p54_hdr *)skb->data)->req_id; |
281 | hdr->chksum = checksum; | ||
282 | hdr->device_addr = addr; | ||
283 | 280 | ||
284 | usb_fill_bulk_urb(data_urb, priv->udev, | 281 | usb_fill_bulk_urb(data_urb, priv->udev, |
285 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), | 282 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), |
286 | skb->data, skb->len, p54u_tx_cb, skb); | 283 | hdr, skb->len + sizeof(*hdr), FREE_AFTER_TX(skb) ? |
284 | p54u_tx_cb : p54u_tx_dummy_cb, skb); | ||
285 | data_urb->transfer_flags |= URB_ZERO_PACKET; | ||
287 | 286 | ||
288 | usb_anchor_urb(data_urb, &priv->submitted); | 287 | usb_anchor_urb(data_urb, &priv->submitted); |
289 | if (usb_submit_urb(data_urb, GFP_ATOMIC)) { | 288 | if (usb_submit_urb(data_urb, GFP_ATOMIC)) { |
290 | usb_unanchor_urb(data_urb); | 289 | usb_unanchor_urb(data_urb); |
291 | skb_pull(skb, sizeof(*hdr)); | ||
292 | p54_free_skb(dev, skb); | 290 | p54_free_skb(dev, skb); |
293 | } | 291 | } |
294 | usb_free_urb(data_urb); | 292 | usb_free_urb(data_urb); |
@@ -298,11 +296,9 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
298 | { | 296 | { |
299 | struct p54u_priv *priv = dev->priv; | 297 | struct p54u_priv *priv = dev->priv; |
300 | struct urb *int_urb, *data_urb; | 298 | struct urb *int_urb, *data_urb; |
301 | struct net2280_tx_hdr *hdr; | 299 | struct net2280_tx_hdr *hdr = (void *)skb->data - sizeof(*hdr); |
302 | struct net2280_reg_write *reg; | 300 | struct net2280_reg_write *reg; |
303 | int err = 0; | 301 | int err = 0; |
304 | __le32 addr = ((struct p54_hdr *) skb->data)->req_id; | ||
305 | __le16 len = cpu_to_le16(skb->len); | ||
306 | 302 | ||
307 | reg = kmalloc(sizeof(*reg), GFP_ATOMIC); | 303 | reg = kmalloc(sizeof(*reg), GFP_ATOMIC); |
308 | if (!reg) | 304 | if (!reg) |
@@ -325,10 +321,9 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
325 | reg->addr = cpu_to_le32(P54U_DEV_BASE); | 321 | reg->addr = cpu_to_le32(P54U_DEV_BASE); |
326 | reg->val = cpu_to_le32(ISL38XX_DEV_INT_DATA); | 322 | reg->val = cpu_to_le32(ISL38XX_DEV_INT_DATA); |
327 | 323 | ||
328 | hdr = (void *)skb_push(skb, sizeof(*hdr)); | ||
329 | memset(hdr, 0, sizeof(*hdr)); | 324 | memset(hdr, 0, sizeof(*hdr)); |
330 | hdr->len = len; | 325 | hdr->len = cpu_to_le16(skb->len); |
331 | hdr->device_addr = addr; | 326 | hdr->device_addr = ((struct p54_hdr *) skb->data)->req_id; |
332 | 327 | ||
333 | usb_fill_bulk_urb(int_urb, priv->udev, | 328 | usb_fill_bulk_urb(int_urb, priv->udev, |
334 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DEV), reg, sizeof(*reg), | 329 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DEV), reg, sizeof(*reg), |
@@ -339,11 +334,13 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
339 | * free what's inside the transfer_buffer after the callback routine | 334 | * free what's inside the transfer_buffer after the callback routine |
340 | * has completed. | 335 | * has completed. |
341 | */ | 336 | */ |
342 | int_urb->transfer_flags |= URB_FREE_BUFFER; | 337 | int_urb->transfer_flags |= URB_FREE_BUFFER | URB_ZERO_PACKET; |
343 | 338 | ||
344 | usb_fill_bulk_urb(data_urb, priv->udev, | 339 | usb_fill_bulk_urb(data_urb, priv->udev, |
345 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), | 340 | usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), |
346 | skb->data, skb->len, p54u_tx_cb, skb); | 341 | hdr, skb->len + sizeof(*hdr), FREE_AFTER_TX(skb) ? |
342 | p54u_tx_cb : p54u_tx_dummy_cb, skb); | ||
343 | data_urb->transfer_flags |= URB_ZERO_PACKET; | ||
347 | 344 | ||
348 | usb_anchor_urb(int_urb, &priv->submitted); | 345 | usb_anchor_urb(int_urb, &priv->submitted); |
349 | err = usb_submit_urb(int_urb, GFP_ATOMIC); | 346 | err = usb_submit_urb(int_urb, GFP_ATOMIC); |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 607ce9f61b54..ed93ac41297f 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -1649,9 +1649,7 @@ static char *rndis_translate_scan(struct net_device *dev, | |||
1649 | char *end_buf, | 1649 | char *end_buf, |
1650 | struct ndis_80211_bssid_ex *bssid) | 1650 | struct ndis_80211_bssid_ex *bssid) |
1651 | { | 1651 | { |
1652 | #ifdef DEBUG | ||
1653 | struct usbnet *usbdev = netdev_priv(dev); | 1652 | struct usbnet *usbdev = netdev_priv(dev); |
1654 | #endif | ||
1655 | u8 *ie; | 1653 | u8 *ie; |
1656 | char *current_val; | 1654 | char *current_val; |
1657 | int bssid_len, ie_len, i; | 1655 | int bssid_len, ie_len, i; |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 30028e2422fc..af6b5847be5c 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -38,7 +38,7 @@ | |||
38 | /* | 38 | /* |
39 | * Allow hardware encryption to be disabled. | 39 | * Allow hardware encryption to be disabled. |
40 | */ | 40 | */ |
41 | static int modparam_nohwcrypt = 1; | 41 | static int modparam_nohwcrypt = 0; |
42 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); | 42 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); |
43 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); | 43 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); |
44 | 44 | ||
@@ -376,11 +376,11 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev, | |||
376 | 376 | ||
377 | /* | 377 | /* |
378 | * The driver does not support the IV/EIV generation | 378 | * The driver does not support the IV/EIV generation |
379 | * in hardware. However it doesn't support the IV/EIV | 379 | * in hardware. However it demands the data to be provided |
380 | * inside the ieee80211 frame either, but requires it | 380 | * both seperately as well as inside the frame. |
381 | * to be provided seperately for the descriptor. | 381 | * We already provided the CONFIG_CRYPTO_COPY_IV to rt2x00lib |
382 | * rt2x00lib will cut the IV/EIV data out of all frames | 382 | * to ensure rt2x00lib will not strip the data from the |
383 | * given to us by mac80211, but we must tell mac80211 | 383 | * frame after the copy, now we must tell mac80211 |
384 | * to generate the IV/EIV data. | 384 | * to generate the IV/EIV data. |
385 | */ | 385 | */ |
386 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; | 386 | key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; |
@@ -1181,7 +1181,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1181 | test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)); | 1181 | test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)); |
1182 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | 1182 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); |
1183 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len); | 1183 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, skb->len); |
1184 | rt2x00_set_field32(&word, TXD_W0_CIPHER, txdesc->cipher); | 1184 | rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher); |
1185 | rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx); | 1185 | rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx); |
1186 | rt2x00_desc_write(txd, 0, word); | 1186 | rt2x00_desc_write(txd, 0, word); |
1187 | } | 1187 | } |
@@ -1334,14 +1334,7 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry, | |||
1334 | 1334 | ||
1335 | /* ICV is located at the end of frame */ | 1335 | /* ICV is located at the end of frame */ |
1336 | 1336 | ||
1337 | /* | 1337 | rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; |
1338 | * Hardware has stripped IV/EIV data from 802.11 frame during | ||
1339 | * decryption. It has provided the data seperately but rt2x00lib | ||
1340 | * should decide if it should be reinserted. | ||
1341 | */ | ||
1342 | rxdesc->flags |= RX_FLAG_IV_STRIPPED; | ||
1343 | if (rxdesc->cipher != CIPHER_TKIP) | ||
1344 | rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; | ||
1345 | if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) | 1338 | if (rxdesc->cipher_status == RX_CRYPTO_SUCCESS) |
1346 | rxdesc->flags |= RX_FLAG_DECRYPTED; | 1339 | rxdesc->flags |= RX_FLAG_DECRYPTED; |
1347 | else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) | 1340 | else if (rxdesc->cipher_status == RX_CRYPTO_FAIL_MIC) |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 6d92542fcf0d..87c0f2c83077 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -807,13 +807,11 @@ static void rt2x00lib_rate(struct ieee80211_rate *entry, | |||
807 | { | 807 | { |
808 | entry->flags = 0; | 808 | entry->flags = 0; |
809 | entry->bitrate = rate->bitrate; | 809 | entry->bitrate = rate->bitrate; |
810 | entry->hw_value = rt2x00_create_rate_hw_value(index, 0); | 810 | entry->hw_value =index; |
811 | entry->hw_value_short = entry->hw_value; | 811 | entry->hw_value_short = index; |
812 | 812 | ||
813 | if (rate->flags & DEV_RATE_SHORT_PREAMBLE) { | 813 | if (rate->flags & DEV_RATE_SHORT_PREAMBLE) |
814 | entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE; | 814 | entry->flags |= IEEE80211_RATE_SHORT_PREAMBLE; |
815 | entry->hw_value_short |= rt2x00_create_rate_hw_value(index, 1); | ||
816 | } | ||
817 | } | 815 | } |
818 | 816 | ||
819 | static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, | 817 | static int rt2x00lib_probe_hw_modes(struct rt2x00_dev *rt2x00dev, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00leds.c b/drivers/net/wireless/rt2x00/rt2x00leds.c index 68f4e0fc35b9..a0cd35b6beb5 100644 --- a/drivers/net/wireless/rt2x00/rt2x00leds.c +++ b/drivers/net/wireless/rt2x00/rt2x00leds.c | |||
@@ -97,7 +97,7 @@ void rt2x00leds_led_assoc(struct rt2x00_dev *rt2x00dev, bool enabled) | |||
97 | 97 | ||
98 | void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled) | 98 | void rt2x00leds_led_radio(struct rt2x00_dev *rt2x00dev, bool enabled) |
99 | { | 99 | { |
100 | if (rt2x00dev->led_radio.type == LED_TYPE_ASSOC) | 100 | if (rt2x00dev->led_radio.type == LED_TYPE_RADIO) |
101 | rt2x00led_led_simple(&rt2x00dev->led_radio, enabled); | 101 | rt2x00led_led_simple(&rt2x00dev->led_radio, enabled); |
102 | } | 102 | } |
103 | 103 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h index 03024327767b..86cd26fbf769 100644 --- a/drivers/net/wireless/rt2x00/rt2x00lib.h +++ b/drivers/net/wireless/rt2x00/rt2x00lib.h | |||
@@ -52,22 +52,11 @@ struct rt2x00_rate { | |||
52 | 52 | ||
53 | extern const struct rt2x00_rate rt2x00_supported_rates[12]; | 53 | extern const struct rt2x00_rate rt2x00_supported_rates[12]; |
54 | 54 | ||
55 | static inline u16 rt2x00_create_rate_hw_value(const u16 index, | ||
56 | const u16 short_preamble) | ||
57 | { | ||
58 | return (short_preamble << 8) | (index & 0xff); | ||
59 | } | ||
60 | |||
61 | static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value) | 55 | static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value) |
62 | { | 56 | { |
63 | return &rt2x00_supported_rates[hw_value & 0xff]; | 57 | return &rt2x00_supported_rates[hw_value & 0xff]; |
64 | } | 58 | } |
65 | 59 | ||
66 | static inline int rt2x00_get_rate_preamble(const u16 hw_value) | ||
67 | { | ||
68 | return (hw_value & 0xff00); | ||
69 | } | ||
70 | |||
71 | /* | 60 | /* |
72 | * Radio control handlers. | 61 | * Radio control handlers. |
73 | */ | 62 | */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index eaec6bd93ed5..0709decec9c2 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -154,6 +154,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
154 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 154 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
155 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); | 155 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); |
156 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; | 156 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data; |
157 | struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; | ||
157 | struct ieee80211_rate *rate = | 158 | struct ieee80211_rate *rate = |
158 | ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); | 159 | ieee80211_get_tx_rate(rt2x00dev->hw, tx_info); |
159 | const struct rt2x00_rate *hwrate; | 160 | const struct rt2x00_rate *hwrate; |
@@ -313,7 +314,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, | |||
313 | * When preamble is enabled we should set the | 314 | * When preamble is enabled we should set the |
314 | * preamble bit for the signal. | 315 | * preamble bit for the signal. |
315 | */ | 316 | */ |
316 | if (rt2x00_get_rate_preamble(rate->hw_value)) | 317 | if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) |
317 | txdesc->signal |= 0x08; | 318 | txdesc->signal |= 0x08; |
318 | } | 319 | } |
319 | } | 320 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00rfkill.c b/drivers/net/wireless/rt2x00/rt2x00rfkill.c index c3f53a92180a..3298cae1e12d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00rfkill.c +++ b/drivers/net/wireless/rt2x00/rt2x00rfkill.c | |||
@@ -162,7 +162,7 @@ void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev) | |||
162 | 162 | ||
163 | void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev) | 163 | void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev) |
164 | { | 164 | { |
165 | if (!test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->flags)) | 165 | if (!test_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state)) |
166 | return; | 166 | return; |
167 | 167 | ||
168 | cancel_delayed_work_sync(&rt2x00dev->rfkill_work); | 168 | cancel_delayed_work_sync(&rt2x00dev->rfkill_work); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 83df312ac56f..0b29d767a258 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -434,11 +434,11 @@ static int rt2x00usb_find_endpoints(struct rt2x00_dev *rt2x00dev) | |||
434 | 434 | ||
435 | if (usb_endpoint_is_bulk_in(ep_desc)) { | 435 | if (usb_endpoint_is_bulk_in(ep_desc)) { |
436 | rt2x00usb_assign_endpoint(rt2x00dev->rx, ep_desc); | 436 | rt2x00usb_assign_endpoint(rt2x00dev->rx, ep_desc); |
437 | } else if (usb_endpoint_is_bulk_out(ep_desc)) { | 437 | } else if (usb_endpoint_is_bulk_out(ep_desc) && |
438 | (queue != queue_end(rt2x00dev))) { | ||
438 | rt2x00usb_assign_endpoint(queue, ep_desc); | 439 | rt2x00usb_assign_endpoint(queue, ep_desc); |
440 | queue = queue_next(queue); | ||
439 | 441 | ||
440 | if (queue != queue_end(rt2x00dev)) | ||
441 | queue = queue_next(queue); | ||
442 | tx_ep_desc = ep_desc; | 442 | tx_ep_desc = ep_desc; |
443 | } | 443 | } |
444 | } | 444 | } |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index d638a8a59370..96a8d69f8790 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2321,6 +2321,7 @@ static struct usb_device_id rt73usb_device_table[] = { | |||
2321 | /* Linksys */ | 2321 | /* Linksys */ |
2322 | { USB_DEVICE(0x13b1, 0x0020), USB_DEVICE_DATA(&rt73usb_ops) }, | 2322 | { USB_DEVICE(0x13b1, 0x0020), USB_DEVICE_DATA(&rt73usb_ops) }, |
2323 | { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) }, | 2323 | { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) }, |
2324 | { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2324 | /* MSI */ | 2325 | /* MSI */ |
2325 | { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) }, | 2326 | { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) }, |
2326 | { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) }, | 2327 | { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) }, |
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c index 5f887fb137a9..387c133ec0f2 100644 --- a/drivers/net/wireless/rtl818x/rtl8180_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c | |||
@@ -897,6 +897,7 @@ static int __devinit rtl8180_probe(struct pci_dev *pdev, | |||
897 | dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | | 897 | dev->flags = IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | |
898 | IEEE80211_HW_RX_INCLUDES_FCS | | 898 | IEEE80211_HW_RX_INCLUDES_FCS | |
899 | IEEE80211_HW_SIGNAL_UNSPEC; | 899 | IEEE80211_HW_SIGNAL_UNSPEC; |
900 | dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); | ||
900 | dev->queues = 1; | 901 | dev->queues = 1; |
901 | dev->max_signal = 65; | 902 | dev->max_signal = 65; |
902 | 903 | ||
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index 00ce3ef39abe..22bc07ef2f37 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -213,7 +213,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
213 | urb = usb_alloc_urb(0, GFP_ATOMIC); | 213 | urb = usb_alloc_urb(0, GFP_ATOMIC); |
214 | if (!urb) { | 214 | if (!urb) { |
215 | kfree_skb(skb); | 215 | kfree_skb(skb); |
216 | return -ENOMEM; | 216 | return NETDEV_TX_OK; |
217 | } | 217 | } |
218 | 218 | ||
219 | flags = skb->len; | 219 | flags = skb->len; |
@@ -273,6 +273,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
273 | 273 | ||
274 | usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, ep), | 274 | usb_fill_bulk_urb(urb, priv->udev, usb_sndbulkpipe(priv->udev, ep), |
275 | buf, skb->len, rtl8187_tx_cb, skb); | 275 | buf, skb->len, rtl8187_tx_cb, skb); |
276 | urb->transfer_flags |= URB_ZERO_PACKET; | ||
276 | usb_anchor_urb(urb, &priv->anchored); | 277 | usb_anchor_urb(urb, &priv->anchored); |
277 | rc = usb_submit_urb(urb, GFP_ATOMIC); | 278 | rc = usb_submit_urb(urb, GFP_ATOMIC); |
278 | if (rc < 0) { | 279 | if (rc < 0) { |
@@ -281,7 +282,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
281 | } | 282 | } |
282 | usb_free_urb(urb); | 283 | usb_free_urb(urb); |
283 | 284 | ||
284 | return rc; | 285 | return NETDEV_TX_OK; |
285 | } | 286 | } |
286 | 287 | ||
287 | static void rtl8187_rx_cb(struct urb *urb) | 288 | static void rtl8187_rx_cb(struct urb *urb) |
@@ -1471,6 +1472,7 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf) | |||
1471 | ieee80211_unregister_hw(dev); | 1472 | ieee80211_unregister_hw(dev); |
1472 | 1473 | ||
1473 | priv = dev->priv; | 1474 | priv = dev->priv; |
1475 | usb_reset_device(priv->udev); | ||
1474 | usb_put_dev(interface_to_usbdev(intf)); | 1476 | usb_put_dev(interface_to_usbdev(intf)); |
1475 | ieee80211_free_hw(dev); | 1477 | ieee80211_free_hw(dev); |
1476 | } | 1478 | } |
diff --git a/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c b/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c index 4e75e8e7fa90..78df281b297a 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c +++ b/drivers/net/wireless/rtl818x/rtl8187_rtl8225.c | |||
@@ -285,7 +285,10 @@ static void rtl8225_rf_set_tx_power(struct ieee80211_hw *dev, int channel) | |||
285 | ofdm_power = priv->channels[channel - 1].hw_value >> 4; | 285 | ofdm_power = priv->channels[channel - 1].hw_value >> 4; |
286 | 286 | ||
287 | cck_power = min(cck_power, (u8)11); | 287 | cck_power = min(cck_power, (u8)11); |
288 | ofdm_power = min(ofdm_power, (u8)35); | 288 | if (ofdm_power > (u8)15) |
289 | ofdm_power = 25; | ||
290 | else | ||
291 | ofdm_power += 10; | ||
289 | 292 | ||
290 | rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK, | 293 | rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK, |
291 | rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1); | 294 | rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1); |
@@ -536,7 +539,10 @@ static void rtl8225z2_rf_set_tx_power(struct ieee80211_hw *dev, int channel) | |||
536 | cck_power += priv->txpwr_base & 0xF; | 539 | cck_power += priv->txpwr_base & 0xF; |
537 | cck_power = min(cck_power, (u8)35); | 540 | cck_power = min(cck_power, (u8)35); |
538 | 541 | ||
539 | ofdm_power = min(ofdm_power, (u8)15); | 542 | if (ofdm_power > (u8)15) |
543 | ofdm_power = 25; | ||
544 | else | ||
545 | ofdm_power += 10; | ||
540 | ofdm_power += priv->txpwr_base >> 4; | 546 | ofdm_power += priv->txpwr_base >> 4; |
541 | ofdm_power = min(ofdm_power, (u8)35); | 547 | ofdm_power = min(ofdm_power, (u8)35); |
542 | 548 | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index b5db57d2fcf5..17527f765b39 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -84,6 +84,7 @@ static struct usb_device_id usb_ids[] = { | |||
84 | { USB_DEVICE(0x0586, 0x340a), .driver_info = DEVICE_ZD1211B }, | 84 | { USB_DEVICE(0x0586, 0x340a), .driver_info = DEVICE_ZD1211B }, |
85 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, | 85 | { USB_DEVICE(0x0471, 0x1237), .driver_info = DEVICE_ZD1211B }, |
86 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, | 86 | { USB_DEVICE(0x07fa, 0x1196), .driver_info = DEVICE_ZD1211B }, |
87 | { USB_DEVICE(0x0df6, 0x0036), .driver_info = DEVICE_ZD1211B }, | ||
87 | /* "Driverless" devices that need ejecting */ | 88 | /* "Driverless" devices that need ejecting */ |
88 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, | 89 | { USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER }, |
89 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, | 90 | { USB_DEVICE(0x0ace, 0x20ff), .driver_info = DEVICE_INSTALLER }, |
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c index cf9712922778..2f1645dcb8c8 100644 --- a/drivers/net/yellowfin.c +++ b/drivers/net/yellowfin.c | |||
@@ -362,6 +362,7 @@ static const struct net_device_ops netdev_ops = { | |||
362 | .ndo_set_multicast_list = set_rx_mode, | 362 | .ndo_set_multicast_list = set_rx_mode, |
363 | .ndo_change_mtu = eth_change_mtu, | 363 | .ndo_change_mtu = eth_change_mtu, |
364 | .ndo_validate_addr = eth_validate_addr, | 364 | .ndo_validate_addr = eth_validate_addr, |
365 | .ndo_set_mac_address = eth_mac_addr, | ||
365 | .ndo_do_ioctl = netdev_ioctl, | 366 | .ndo_do_ioctl = netdev_ioctl, |
366 | .ndo_tx_timeout = yellowfin_tx_timeout, | 367 | .ndo_tx_timeout = yellowfin_tx_timeout, |
367 | }; | 368 | }; |
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c index affd904deafc..37c84e3b8be0 100644 --- a/drivers/net/zorro8390.c +++ b/drivers/net/zorro8390.c | |||
@@ -147,6 +147,7 @@ static const struct net_device_ops zorro8390_netdev_ops = { | |||
147 | .ndo_get_stats = ei_get_stats, | 147 | .ndo_get_stats = ei_get_stats, |
148 | .ndo_set_multicast_list = ei_set_multicast_list, | 148 | .ndo_set_multicast_list = ei_set_multicast_list, |
149 | .ndo_validate_addr = eth_validate_addr, | 149 | .ndo_validate_addr = eth_validate_addr, |
150 | .ndo_set_mac_address = eth_mac_addr, | ||
150 | .ndo_change_mtu = eth_change_mtu, | 151 | .ndo_change_mtu = eth_change_mtu, |
151 | #ifdef CONFIG_NET_POLL_CONTROLLER | 152 | #ifdef CONFIG_NET_POLL_CONTROLLER |
152 | .ndo_poll_controller = ei_poll, | 153 | .ndo_poll_controller = ei_poll, |