diff options
Diffstat (limited to 'drivers/net')
39 files changed, 304 insertions, 373 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index edda6e10ebe5..8fafac987e0b 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -385,6 +385,7 @@ static int __init el3_probe(int card_idx) | |||
385 | #if defined(__ISAPNP__) | 385 | #if defined(__ISAPNP__) |
386 | static int pnp_cards; | 386 | static int pnp_cards; |
387 | struct pnp_dev *idev = NULL; | 387 | struct pnp_dev *idev = NULL; |
388 | int pnp_found = 0; | ||
388 | 389 | ||
389 | if (nopnp == 1) | 390 | if (nopnp == 1) |
390 | goto no_pnp; | 391 | goto no_pnp; |
@@ -430,6 +431,7 @@ __again: | |||
430 | pnp_cards++; | 431 | pnp_cards++; |
431 | 432 | ||
432 | netdev_boot_setup_check(dev); | 433 | netdev_boot_setup_check(dev); |
434 | pnp_found = 1; | ||
433 | goto found; | 435 | goto found; |
434 | } | 436 | } |
435 | } | 437 | } |
@@ -560,6 +562,8 @@ no_pnp: | |||
560 | lp = netdev_priv(dev); | 562 | lp = netdev_priv(dev); |
561 | #if defined(__ISAPNP__) | 563 | #if defined(__ISAPNP__) |
562 | lp->dev = &idev->dev; | 564 | lp->dev = &idev->dev; |
565 | if (pnp_found) | ||
566 | lp->type = EL3_PNP; | ||
563 | #endif | 567 | #endif |
564 | err = el3_common_init(dev); | 568 | err = el3_common_init(dev); |
565 | 569 | ||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index d9107e542dfa..114771a2a133 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -166,16 +166,6 @@ config NET_SB1000 | |||
166 | 166 | ||
167 | If you don't have this card, of course say N. | 167 | If you don't have this card, of course say N. |
168 | 168 | ||
169 | config IP1000 | ||
170 | tristate "IP1000 Gigabit Ethernet support" | ||
171 | depends on PCI && EXPERIMENTAL | ||
172 | select MII | ||
173 | ---help--- | ||
174 | This driver supports IP1000 gigabit Ethernet cards. | ||
175 | |||
176 | To compile this driver as a module, choose M here: the module | ||
177 | will be called ipg. This is recommended. | ||
178 | |||
179 | source "drivers/net/arcnet/Kconfig" | 169 | source "drivers/net/arcnet/Kconfig" |
180 | 170 | ||
181 | source "drivers/net/phy/Kconfig" | 171 | source "drivers/net/phy/Kconfig" |
@@ -1992,6 +1982,16 @@ config E1000E | |||
1992 | To compile this driver as a module, choose M here. The module | 1982 | To compile this driver as a module, choose M here. The module |
1993 | will be called e1000e. | 1983 | will be called e1000e. |
1994 | 1984 | ||
1985 | config IP1000 | ||
1986 | tristate "IP1000 Gigabit Ethernet support" | ||
1987 | depends on PCI && EXPERIMENTAL | ||
1988 | select MII | ||
1989 | ---help--- | ||
1990 | This driver supports IP1000 gigabit Ethernet cards. | ||
1991 | |||
1992 | To compile this driver as a module, choose M here: the module | ||
1993 | will be called ipg. This is recommended. | ||
1994 | |||
1995 | source "drivers/net/ixp2000/Kconfig" | 1995 | source "drivers/net/ixp2000/Kconfig" |
1996 | 1996 | ||
1997 | config MYRI_SBUS | 1997 | config MYRI_SBUS |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 2b06e4b4dabc..b87402bc8308 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -1991,13 +1991,12 @@ static int e100_poll(struct napi_struct *napi, int budget) | |||
1991 | struct nic *nic = container_of(napi, struct nic, napi); | 1991 | struct nic *nic = container_of(napi, struct nic, napi); |
1992 | struct net_device *netdev = nic->netdev; | 1992 | struct net_device *netdev = nic->netdev; |
1993 | unsigned int work_done = 0; | 1993 | unsigned int work_done = 0; |
1994 | int tx_cleaned; | ||
1995 | 1994 | ||
1996 | e100_rx_clean(nic, &work_done, budget); | 1995 | e100_rx_clean(nic, &work_done, budget); |
1997 | tx_cleaned = e100_tx_clean(nic); | 1996 | e100_tx_clean(nic); |
1998 | 1997 | ||
1999 | /* If no Rx and Tx cleanup work was done, exit polling mode. */ | 1998 | /* If budget not fully consumed, exit the polling mode */ |
2000 | if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) { | 1999 | if (work_done < budget) { |
2001 | netif_rx_complete(netdev, napi); | 2000 | netif_rx_complete(netdev, napi); |
2002 | e100_enable_irq(nic); | 2001 | e100_enable_irq(nic); |
2003 | } | 2002 | } |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 4f37506ad374..13d57b0a88fa 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3919,32 +3919,26 @@ e1000_clean(struct napi_struct *napi, int budget) | |||
3919 | { | 3919 | { |
3920 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); | 3920 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); |
3921 | struct net_device *poll_dev = adapter->netdev; | 3921 | struct net_device *poll_dev = adapter->netdev; |
3922 | int tx_cleaned = 0, work_done = 0; | 3922 | int work_done = 0; |
3923 | 3923 | ||
3924 | /* Must NOT use netdev_priv macro here. */ | 3924 | /* Must NOT use netdev_priv macro here. */ |
3925 | adapter = poll_dev->priv; | 3925 | adapter = poll_dev->priv; |
3926 | 3926 | ||
3927 | /* Keep link state information with original netdev */ | ||
3928 | if (!netif_carrier_ok(poll_dev)) | ||
3929 | goto quit_polling; | ||
3930 | |||
3931 | /* e1000_clean is called per-cpu. This lock protects | 3927 | /* e1000_clean is called per-cpu. This lock protects |
3932 | * tx_ring[0] from being cleaned by multiple cpus | 3928 | * tx_ring[0] from being cleaned by multiple cpus |
3933 | * simultaneously. A failure obtaining the lock means | 3929 | * simultaneously. A failure obtaining the lock means |
3934 | * tx_ring[0] is currently being cleaned anyway. */ | 3930 | * tx_ring[0] is currently being cleaned anyway. */ |
3935 | if (spin_trylock(&adapter->tx_queue_lock)) { | 3931 | if (spin_trylock(&adapter->tx_queue_lock)) { |
3936 | tx_cleaned = e1000_clean_tx_irq(adapter, | 3932 | e1000_clean_tx_irq(adapter, |
3937 | &adapter->tx_ring[0]); | 3933 | &adapter->tx_ring[0]); |
3938 | spin_unlock(&adapter->tx_queue_lock); | 3934 | spin_unlock(&adapter->tx_queue_lock); |
3939 | } | 3935 | } |
3940 | 3936 | ||
3941 | adapter->clean_rx(adapter, &adapter->rx_ring[0], | 3937 | adapter->clean_rx(adapter, &adapter->rx_ring[0], |
3942 | &work_done, budget); | 3938 | &work_done, budget); |
3943 | 3939 | ||
3944 | /* If no Tx and not enough Rx work done, exit the polling mode */ | 3940 | /* If budget not fully consumed, exit the polling mode */ |
3945 | if ((!tx_cleaned && (work_done == 0)) || | 3941 | if (work_done < budget) { |
3946 | !netif_running(poll_dev)) { | ||
3947 | quit_polling: | ||
3948 | if (likely(adapter->itr_setting & 3)) | 3942 | if (likely(adapter->itr_setting & 3)) |
3949 | e1000_set_itr(adapter); | 3943 | e1000_set_itr(adapter); |
3950 | netif_rx_complete(poll_dev, napi); | 3944 | netif_rx_complete(poll_dev, napi); |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 4fd2e23720b6..4a6fc7453776 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -1384,30 +1384,24 @@ static int e1000_clean(struct napi_struct *napi, int budget) | |||
1384 | { | 1384 | { |
1385 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); | 1385 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); |
1386 | struct net_device *poll_dev = adapter->netdev; | 1386 | struct net_device *poll_dev = adapter->netdev; |
1387 | int tx_cleaned = 0, work_done = 0; | 1387 | int work_done = 0; |
1388 | 1388 | ||
1389 | /* Must NOT use netdev_priv macro here. */ | 1389 | /* Must NOT use netdev_priv macro here. */ |
1390 | adapter = poll_dev->priv; | 1390 | adapter = poll_dev->priv; |
1391 | 1391 | ||
1392 | /* Keep link state information with original netdev */ | ||
1393 | if (!netif_carrier_ok(poll_dev)) | ||
1394 | goto quit_polling; | ||
1395 | |||
1396 | /* e1000_clean is called per-cpu. This lock protects | 1392 | /* e1000_clean is called per-cpu. This lock protects |
1397 | * tx_ring from being cleaned by multiple cpus | 1393 | * tx_ring from being cleaned by multiple cpus |
1398 | * simultaneously. A failure obtaining the lock means | 1394 | * simultaneously. A failure obtaining the lock means |
1399 | * tx_ring is currently being cleaned anyway. */ | 1395 | * tx_ring is currently being cleaned anyway. */ |
1400 | if (spin_trylock(&adapter->tx_queue_lock)) { | 1396 | if (spin_trylock(&adapter->tx_queue_lock)) { |
1401 | tx_cleaned = e1000_clean_tx_irq(adapter); | 1397 | e1000_clean_tx_irq(adapter); |
1402 | spin_unlock(&adapter->tx_queue_lock); | 1398 | spin_unlock(&adapter->tx_queue_lock); |
1403 | } | 1399 | } |
1404 | 1400 | ||
1405 | adapter->clean_rx(adapter, &work_done, budget); | 1401 | adapter->clean_rx(adapter, &work_done, budget); |
1406 | 1402 | ||
1407 | /* If no Tx and not enough Rx work done, exit the polling mode */ | 1403 | /* If budget not fully consumed, exit the polling mode */ |
1408 | if ((!tx_cleaned && (work_done < budget)) || | 1404 | if (work_done < budget) { |
1409 | !netif_running(poll_dev)) { | ||
1410 | quit_polling: | ||
1411 | if (adapter->itr_setting & 3) | 1405 | if (adapter->itr_setting & 3) |
1412 | e1000_set_itr(adapter); | 1406 | e1000_set_itr(adapter); |
1413 | netif_rx_complete(poll_dev, napi); | 1407 | netif_rx_complete(poll_dev, napi); |
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index ecdd3fc8d70c..0b365b8d947b 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -1273,7 +1273,7 @@ rx_action: | |||
1273 | 1273 | ||
1274 | epic_rx_err(dev, ep); | 1274 | epic_rx_err(dev, ep); |
1275 | 1275 | ||
1276 | if (netif_running(dev) && (work_done < budget)) { | 1276 | if (work_done < budget) { |
1277 | unsigned long flags; | 1277 | unsigned long flags; |
1278 | int more; | 1278 | int more; |
1279 | 1279 | ||
diff --git a/drivers/net/fec_8xx/fec_main.c b/drivers/net/fec_8xx/fec_main.c index 8d2904fa5789..ab9637ab3a8d 100644 --- a/drivers/net/fec_8xx/fec_main.c +++ b/drivers/net/fec_8xx/fec_main.c | |||
@@ -476,11 +476,6 @@ static int fec_enet_rx_common(struct fec_enet_private *ep, | |||
476 | __u16 pkt_len, sc; | 476 | __u16 pkt_len, sc; |
477 | int curidx; | 477 | int curidx; |
478 | 478 | ||
479 | if (fpi->use_napi) { | ||
480 | if (!netif_running(dev)) | ||
481 | return 0; | ||
482 | } | ||
483 | |||
484 | /* | 479 | /* |
485 | * First, grab all of the stats for the incoming packet. | 480 | * First, grab all of the stats for the incoming packet. |
486 | * These get messed up if we get called due to a busy condition. | 481 | * These get messed up if we get called due to a busy condition. |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index a96583cceb5e..f84c752997a4 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -5199,10 +5199,6 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5199 | dev->dev_addr[3] = (np->orig_mac[0] >> 16) & 0xff; | 5199 | dev->dev_addr[3] = (np->orig_mac[0] >> 16) & 0xff; |
5200 | dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff; | 5200 | dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff; |
5201 | dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff; | 5201 | dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff; |
5202 | /* set permanent address to be correct aswell */ | ||
5203 | np->orig_mac[0] = (dev->dev_addr[0] << 0) + (dev->dev_addr[1] << 8) + | ||
5204 | (dev->dev_addr[2] << 16) + (dev->dev_addr[3] << 24); | ||
5205 | np->orig_mac[1] = (dev->dev_addr[4] << 0) + (dev->dev_addr[5] << 8); | ||
5206 | writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll); | 5202 | writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll); |
5207 | } | 5203 | } |
5208 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); | 5204 | memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); |
@@ -5414,6 +5410,8 @@ static void __devexit nv_remove(struct pci_dev *pci_dev) | |||
5414 | */ | 5410 | */ |
5415 | writel(np->orig_mac[0], base + NvRegMacAddrA); | 5411 | writel(np->orig_mac[0], base + NvRegMacAddrA); |
5416 | writel(np->orig_mac[1], base + NvRegMacAddrB); | 5412 | writel(np->orig_mac[1], base + NvRegMacAddrB); |
5413 | writel(readl(base + NvRegTransmitPoll) & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV, | ||
5414 | base + NvRegTransmitPoll); | ||
5417 | 5415 | ||
5418 | /* free all structures */ | 5416 | /* free all structures */ |
5419 | free_rings(dev); | 5417 | free_rings(dev); |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index f2a4d399a6e5..3e1a57a42f11 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -96,9 +96,6 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget) | |||
96 | u16 pkt_len, sc; | 96 | u16 pkt_len, sc; |
97 | int curidx; | 97 | int curidx; |
98 | 98 | ||
99 | if (!netif_running(dev)) | ||
100 | return 0; | ||
101 | |||
102 | /* | 99 | /* |
103 | * First, grab all of the stats for the incoming packet. | 100 | * First, grab all of the stats for the incoming packet. |
104 | * These get messed up if we get called due to a busy condition. | 101 | * These get messed up if we get called due to a busy condition. |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index bf9085fe035a..d2fb88d5cda2 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -1787,14 +1787,13 @@ ixgb_clean(struct napi_struct *napi, int budget) | |||
1787 | { | 1787 | { |
1788 | struct ixgb_adapter *adapter = container_of(napi, struct ixgb_adapter, napi); | 1788 | struct ixgb_adapter *adapter = container_of(napi, struct ixgb_adapter, napi); |
1789 | struct net_device *netdev = adapter->netdev; | 1789 | struct net_device *netdev = adapter->netdev; |
1790 | int tx_cleaned; | ||
1791 | int work_done = 0; | 1790 | int work_done = 0; |
1792 | 1791 | ||
1793 | tx_cleaned = ixgb_clean_tx_irq(adapter); | 1792 | ixgb_clean_tx_irq(adapter); |
1794 | ixgb_clean_rx_irq(adapter, &work_done, budget); | 1793 | ixgb_clean_rx_irq(adapter, &work_done, budget); |
1795 | 1794 | ||
1796 | /* if no Tx and not enough Rx work done, exit the polling mode */ | 1795 | /* If budget not fully consumed, exit the polling mode */ |
1797 | if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) { | 1796 | if (work_done < budget) { |
1798 | netif_rx_complete(netdev, napi); | 1797 | netif_rx_complete(netdev, napi); |
1799 | ixgb_irq_enable(adapter); | 1798 | ixgb_irq_enable(adapter); |
1800 | } | 1799 | } |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 00bc525c6560..a56491617661 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -1468,21 +1468,15 @@ static int ixgbe_clean(struct napi_struct *napi, int budget) | |||
1468 | struct ixgbe_adapter *adapter = container_of(napi, | 1468 | struct ixgbe_adapter *adapter = container_of(napi, |
1469 | struct ixgbe_adapter, napi); | 1469 | struct ixgbe_adapter, napi); |
1470 | struct net_device *netdev = adapter->netdev; | 1470 | struct net_device *netdev = adapter->netdev; |
1471 | int tx_cleaned = 0, work_done = 0; | 1471 | int work_done = 0; |
1472 | |||
1473 | /* Keep link state information with original netdev */ | ||
1474 | if (!netif_carrier_ok(adapter->netdev)) | ||
1475 | goto quit_polling; | ||
1476 | 1472 | ||
1477 | /* In non-MSIX case, there is no multi-Tx/Rx queue */ | 1473 | /* In non-MSIX case, there is no multi-Tx/Rx queue */ |
1478 | tx_cleaned = ixgbe_clean_tx_irq(adapter, adapter->tx_ring); | 1474 | ixgbe_clean_tx_irq(adapter, adapter->tx_ring); |
1479 | ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done, | 1475 | ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done, |
1480 | budget); | 1476 | budget); |
1481 | 1477 | ||
1482 | /* If no Tx and not enough Rx work done, exit the polling mode */ | 1478 | /* If budget not fully consumed, exit the polling mode */ |
1483 | if ((!tx_cleaned && (work_done < budget)) || | 1479 | if (work_done < budget) { |
1484 | !netif_running(adapter->netdev)) { | ||
1485 | quit_polling: | ||
1486 | netif_rx_complete(netdev, napi); | 1480 | netif_rx_complete(netdev, napi); |
1487 | ixgbe_irq_enable(adapter); | 1481 | ixgbe_irq_enable(adapter); |
1488 | } | 1482 | } |
diff --git a/drivers/net/ixp2000/ixpdev.c b/drivers/net/ixp2000/ixpdev.c index 6c0dd49149d0..484cb2ba717f 100644 --- a/drivers/net/ixp2000/ixpdev.c +++ b/drivers/net/ixp2000/ixpdev.c | |||
@@ -135,8 +135,6 @@ static int ixpdev_poll(struct napi_struct *napi, int budget) | |||
135 | struct net_device *dev = ip->dev; | 135 | struct net_device *dev = ip->dev; |
136 | int rx; | 136 | int rx; |
137 | 137 | ||
138 | /* @@@ Have to stop polling when nds[0] is administratively | ||
139 | * downed while we are polling. */ | ||
140 | rx = 0; | 138 | rx = 0; |
141 | do { | 139 | do { |
142 | ixp2000_reg_write(IXP2000_IRQ_THD_RAW_STATUS_A_0, 0x00ff); | 140 | ixp2000_reg_write(IXP2000_IRQ_THD_RAW_STATUS_A_0, 0x00ff); |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 662b8d16803c..fa147cd5d68c 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -242,7 +242,7 @@ static void loopback_setup(struct net_device *dev) | |||
242 | | NETIF_F_NO_CSUM | 242 | | NETIF_F_NO_CSUM |
243 | | NETIF_F_HIGHDMA | 243 | | NETIF_F_HIGHDMA |
244 | | NETIF_F_LLTX | 244 | | NETIF_F_LLTX |
245 | | NETIF_F_NETNS_LOCAL, | 245 | | NETIF_F_NETNS_LOCAL; |
246 | dev->ethtool_ops = &loopback_ethtool_ops; | 246 | dev->ethtool_ops = &loopback_ethtool_ops; |
247 | dev->header_ops = ð_header_ops; | 247 | dev->header_ops = ð_header_ops; |
248 | dev->init = loopback_dev_init; | 248 | dev->init = loopback_dev_init; |
diff --git a/drivers/net/meth.c b/drivers/net/meth.c index 0c89b028a80c..cdaa8fc21809 100644 --- a/drivers/net/meth.c +++ b/drivers/net/meth.c | |||
@@ -95,11 +95,14 @@ static inline void load_eaddr(struct net_device *dev) | |||
95 | { | 95 | { |
96 | int i; | 96 | int i; |
97 | DECLARE_MAC_BUF(mac); | 97 | DECLARE_MAC_BUF(mac); |
98 | u64 macaddr; | ||
98 | 99 | ||
99 | for (i = 0; i < 6; i++) | ||
100 | dev->dev_addr[i] = o2meth_eaddr[i]; | ||
101 | DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr)); | 100 | DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr)); |
102 | mace->eth.mac_addr = (*(unsigned long*)o2meth_eaddr) >> 16; | 101 | macaddr = 0; |
102 | for (i = 0; i < 6; i++) | ||
103 | macaddr |= dev->dev_addr[i] << ((5 - i) * 8); | ||
104 | |||
105 | mace->eth.mac_addr = macaddr; | ||
103 | } | 106 | } |
104 | 107 | ||
105 | /* | 108 | /* |
@@ -794,6 +797,7 @@ static int __init meth_probe(struct platform_device *pdev) | |||
794 | #endif | 797 | #endif |
795 | dev->irq = MACE_ETHERNET_IRQ; | 798 | dev->irq = MACE_ETHERNET_IRQ; |
796 | dev->base_addr = (unsigned long)&mace->eth; | 799 | dev->base_addr = (unsigned long)&mace->eth; |
800 | memcpy(dev->dev_addr, o2meth_eaddr, 6); | ||
797 | 801 | ||
798 | priv = netdev_priv(dev); | 802 | priv = netdev_priv(dev); |
799 | spin_lock_init(&priv->meth_lock); | 803 | spin_lock_init(&priv->meth_lock); |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 8def8657251f..c90958f6d3fe 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -1239,7 +1239,7 @@ static int myri10ge_poll(struct napi_struct *napi, int budget) | |||
1239 | /* process as many rx events as NAPI will allow */ | 1239 | /* process as many rx events as NAPI will allow */ |
1240 | work_done = myri10ge_clean_rx_done(mgp, budget); | 1240 | work_done = myri10ge_clean_rx_done(mgp, budget); |
1241 | 1241 | ||
1242 | if (work_done < budget || !netif_running(netdev)) { | 1242 | if (work_done < budget) { |
1243 | netif_rx_complete(netdev, napi); | 1243 | netif_rx_complete(netdev, napi); |
1244 | put_be32(htonl(3), mgp->irq_claim); | 1244 | put_be32(htonl(3), mgp->irq_claim); |
1245 | } | 1245 | } |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index 87cde062fd63..c329a4f5840c 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -2266,7 +2266,7 @@ static int natsemi_poll(struct napi_struct *napi, int budget) | |||
2266 | /* Reenable interrupts providing nothing is trying to shut | 2266 | /* Reenable interrupts providing nothing is trying to shut |
2267 | * the chip down. */ | 2267 | * the chip down. */ |
2268 | spin_lock(&np->lock); | 2268 | spin_lock(&np->lock); |
2269 | if (!np->hands_off && netif_running(dev)) | 2269 | if (!np->hands_off) |
2270 | natsemi_irq_enable(dev); | 2270 | natsemi_irq_enable(dev); |
2271 | spin_unlock(&np->lock); | 2271 | spin_unlock(&np->lock); |
2272 | 2272 | ||
diff --git a/drivers/net/netx-eth.c b/drivers/net/netx-eth.c index 5267e031daa0..78d34af13a1c 100644 --- a/drivers/net/netx-eth.c +++ b/drivers/net/netx-eth.c | |||
@@ -169,8 +169,8 @@ static void netx_eth_receive(struct net_device *ndev) | |||
169 | ndev->last_rx = jiffies; | 169 | ndev->last_rx = jiffies; |
170 | skb->protocol = eth_type_trans(skb, ndev); | 170 | skb->protocol = eth_type_trans(skb, ndev); |
171 | netif_rx(skb); | 171 | netif_rx(skb); |
172 | dev->stats.rx_packets++; | 172 | ndev->stats.rx_packets++; |
173 | dev->stats.rx_bytes += len; | 173 | ndev->stats.rx_bytes += len; |
174 | } | 174 | } |
175 | 175 | ||
176 | static irqreturn_t | 176 | static irqreturn_t |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index fbc2553275dc..a8f63c47b3cd 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -65,8 +65,8 @@ | |||
65 | 65 | ||
66 | #define _NETXEN_NIC_LINUX_MAJOR 3 | 66 | #define _NETXEN_NIC_LINUX_MAJOR 3 |
67 | #define _NETXEN_NIC_LINUX_MINOR 4 | 67 | #define _NETXEN_NIC_LINUX_MINOR 4 |
68 | #define _NETXEN_NIC_LINUX_SUBVERSION 2 | 68 | #define _NETXEN_NIC_LINUX_SUBVERSION 18 |
69 | #define NETXEN_NIC_LINUX_VERSIONID "3.4.2" | 69 | #define NETXEN_NIC_LINUX_VERSIONID "3.4.18" |
70 | 70 | ||
71 | #define NETXEN_NUM_FLASH_SECTORS (64) | 71 | #define NETXEN_NUM_FLASH_SECTORS (64) |
72 | #define NETXEN_FLASH_SECTOR_SIZE (64 * 1024) | 72 | #define NETXEN_FLASH_SECTOR_SIZE (64 * 1024) |
@@ -309,23 +309,26 @@ struct netxen_ring_ctx { | |||
309 | ((cmd_desc)->port_ctxid |= ((var) & 0xF0)) | 309 | ((cmd_desc)->port_ctxid |= ((var) & 0xF0)) |
310 | 310 | ||
311 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ | 311 | #define netxen_set_cmd_desc_flags(cmd_desc, val) \ |
312 | ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \ | 312 | (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ |
313 | (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f)) | 313 | ~cpu_to_le16(0x7f)) | cpu_to_le16((val) & 0x7f) |
314 | #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ | 314 | #define netxen_set_cmd_desc_opcode(cmd_desc, val) \ |
315 | ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \ | 315 | (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \ |
316 | (cmd_desc)->flags_opcode |= cpu_to_le16(((val & 0x3f)<<7))) | 316 | ~cpu_to_le16((u16)0x3f << 7)) | cpu_to_le16(((val) & 0x3f) << 7) |
317 | 317 | ||
318 | #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ | 318 | #define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ |
319 | ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \ | 319 | (cmd_desc)->num_of_buffers_total_length = \ |
320 | (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff)) | 320 | ((cmd_desc)->num_of_buffers_total_length & \ |
321 | ~cpu_to_le32(0xff)) | cpu_to_le32((val) & 0xff) | ||
321 | #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ | 322 | #define netxen_set_cmd_desc_totallength(cmd_desc, val) \ |
322 | ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xffffff00), \ | 323 | (cmd_desc)->num_of_buffers_total_length = \ |
323 | (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 8)) | 324 | ((cmd_desc)->num_of_buffers_total_length & \ |
325 | ~cpu_to_le32((u32)0xffffff << 8)) | \ | ||
326 | cpu_to_le32(((val) & 0xffffff) << 8) | ||
324 | 327 | ||
325 | #define netxen_get_cmd_desc_opcode(cmd_desc) \ | 328 | #define netxen_get_cmd_desc_opcode(cmd_desc) \ |
326 | ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F) | 329 | ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003f) |
327 | #define netxen_get_cmd_desc_totallength(cmd_desc) \ | 330 | #define netxen_get_cmd_desc_totallength(cmd_desc) \ |
328 | (le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) | 331 | ((le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) & 0xffffff) |
329 | 332 | ||
330 | struct cmd_desc_type0 { | 333 | struct cmd_desc_type0 { |
331 | u8 tcp_hdr_offset; /* For LSO only */ | 334 | u8 tcp_hdr_offset; /* For LSO only */ |
@@ -412,29 +415,29 @@ struct rcv_desc { | |||
412 | #define netxen_get_sts_desc_lro_last_frag(status_desc) \ | 415 | #define netxen_get_sts_desc_lro_last_frag(status_desc) \ |
413 | (((status_desc)->lro & 0x80) >> 7) | 416 | (((status_desc)->lro & 0x80) >> 7) |
414 | 417 | ||
415 | #define netxen_get_sts_port(status_desc) \ | 418 | #define netxen_get_sts_port(sts_data) \ |
416 | (le64_to_cpu((status_desc)->status_desc_data) & 0x0F) | 419 | ((sts_data) & 0x0F) |
417 | #define netxen_get_sts_status(status_desc) \ | 420 | #define netxen_get_sts_status(sts_data) \ |
418 | ((le64_to_cpu((status_desc)->status_desc_data) >> 4) & 0x0F) | 421 | (((sts_data) >> 4) & 0x0F) |
419 | #define netxen_get_sts_type(status_desc) \ | 422 | #define netxen_get_sts_type(sts_data) \ |
420 | ((le64_to_cpu((status_desc)->status_desc_data) >> 8) & 0x0F) | 423 | (((sts_data) >> 8) & 0x0F) |
421 | #define netxen_get_sts_totallength(status_desc) \ | 424 | #define netxen_get_sts_totallength(sts_data) \ |
422 | ((le64_to_cpu((status_desc)->status_desc_data) >> 12) & 0xFFFF) | 425 | (((sts_data) >> 12) & 0xFFFF) |
423 | #define netxen_get_sts_refhandle(status_desc) \ | 426 | #define netxen_get_sts_refhandle(sts_data) \ |
424 | ((le64_to_cpu((status_desc)->status_desc_data) >> 28) & 0xFFFF) | 427 | (((sts_data) >> 28) & 0xFFFF) |
425 | #define netxen_get_sts_prot(status_desc) \ | 428 | #define netxen_get_sts_prot(sts_data) \ |
426 | ((le64_to_cpu((status_desc)->status_desc_data) >> 44) & 0x0F) | 429 | (((sts_data) >> 44) & 0x0F) |
430 | #define netxen_get_sts_opcode(sts_data) \ | ||
431 | (((sts_data) >> 58) & 0x03F) | ||
432 | |||
427 | #define netxen_get_sts_owner(status_desc) \ | 433 | #define netxen_get_sts_owner(status_desc) \ |
428 | ((le64_to_cpu((status_desc)->status_desc_data) >> 56) & 0x03) | 434 | ((le64_to_cpu((status_desc)->status_desc_data) >> 56) & 0x03) |
429 | #define netxen_get_sts_opcode(status_desc) \ | 435 | #define netxen_set_sts_owner(status_desc, val) { \ |
430 | ((le64_to_cpu((status_desc)->status_desc_data) >> 58) & 0x03F) | 436 | (status_desc)->status_desc_data = \ |
431 | 437 | ((status_desc)->status_desc_data & \ | |
432 | #define netxen_clear_sts_owner(status_desc) \ | 438 | ~cpu_to_le64(0x3ULL << 56)) | \ |
433 | ((status_desc)->status_desc_data &= \ | 439 | cpu_to_le64((u64)((val) & 0x3) << 56); \ |
434 | ~cpu_to_le64(((unsigned long long)3) << 56 )) | 440 | } |
435 | #define netxen_set_sts_owner(status_desc, val) \ | ||
436 | ((status_desc)->status_desc_data |= \ | ||
437 | cpu_to_le64(((unsigned long long)((val) & 0x3)) << 56 )) | ||
438 | 441 | ||
439 | struct status_desc { | 442 | struct status_desc { |
440 | /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length | 443 | /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 37589265297e..485ff9398910 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -1070,16 +1070,17 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
1070 | { | 1070 | { |
1071 | struct pci_dev *pdev = adapter->pdev; | 1071 | struct pci_dev *pdev = adapter->pdev; |
1072 | struct net_device *netdev = adapter->netdev; | 1072 | struct net_device *netdev = adapter->netdev; |
1073 | int index = netxen_get_sts_refhandle(desc); | 1073 | u64 sts_data = le64_to_cpu(desc->status_desc_data); |
1074 | int index = netxen_get_sts_refhandle(sts_data); | ||
1074 | struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); | 1075 | struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); |
1075 | struct netxen_rx_buffer *buffer; | 1076 | struct netxen_rx_buffer *buffer; |
1076 | struct sk_buff *skb; | 1077 | struct sk_buff *skb; |
1077 | u32 length = netxen_get_sts_totallength(desc); | 1078 | u32 length = netxen_get_sts_totallength(sts_data); |
1078 | u32 desc_ctx; | 1079 | u32 desc_ctx; |
1079 | struct netxen_rcv_desc_ctx *rcv_desc; | 1080 | struct netxen_rcv_desc_ctx *rcv_desc; |
1080 | int ret; | 1081 | int ret; |
1081 | 1082 | ||
1082 | desc_ctx = netxen_get_sts_type(desc); | 1083 | desc_ctx = netxen_get_sts_type(sts_data); |
1083 | if (unlikely(desc_ctx >= NUM_RCV_DESC_RINGS)) { | 1084 | if (unlikely(desc_ctx >= NUM_RCV_DESC_RINGS)) { |
1084 | printk("%s: %s Bad Rcv descriptor ring\n", | 1085 | printk("%s: %s Bad Rcv descriptor ring\n", |
1085 | netxen_nic_driver_name, netdev->name); | 1086 | netxen_nic_driver_name, netdev->name); |
@@ -1119,7 +1120,7 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid, | |||
1119 | skb = (struct sk_buff *)buffer->skb; | 1120 | skb = (struct sk_buff *)buffer->skb; |
1120 | 1121 | ||
1121 | if (likely(adapter->rx_csum && | 1122 | if (likely(adapter->rx_csum && |
1122 | netxen_get_sts_status(desc) == STATUS_CKSUM_OK)) { | 1123 | netxen_get_sts_status(sts_data) == STATUS_CKSUM_OK)) { |
1123 | adapter->stats.csummed++; | 1124 | adapter->stats.csummed++; |
1124 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 1125 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
1125 | } else | 1126 | } else |
@@ -1209,7 +1210,6 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max) | |||
1209 | break; | 1210 | break; |
1210 | } | 1211 | } |
1211 | netxen_process_rcv(adapter, ctxid, desc); | 1212 | netxen_process_rcv(adapter, ctxid, desc); |
1212 | netxen_clear_sts_owner(desc); | ||
1213 | netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM); | 1213 | netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM); |
1214 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); | 1214 | consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); |
1215 | count++; | 1215 | count++; |
@@ -1248,7 +1248,6 @@ int netxen_process_cmd_ring(unsigned long data) | |||
1248 | struct pci_dev *pdev; | 1248 | struct pci_dev *pdev; |
1249 | struct netxen_skb_frag *frag; | 1249 | struct netxen_skb_frag *frag; |
1250 | u32 i; | 1250 | u32 i; |
1251 | struct sk_buff *skb = NULL; | ||
1252 | int done; | 1251 | int done; |
1253 | 1252 | ||
1254 | spin_lock(&adapter->tx_lock); | 1253 | spin_lock(&adapter->tx_lock); |
@@ -1278,9 +1277,8 @@ int netxen_process_cmd_ring(unsigned long data) | |||
1278 | while ((last_consumer != consumer) && (count1 < MAX_STATUS_HANDLE)) { | 1277 | while ((last_consumer != consumer) && (count1 < MAX_STATUS_HANDLE)) { |
1279 | buffer = &adapter->cmd_buf_arr[last_consumer]; | 1278 | buffer = &adapter->cmd_buf_arr[last_consumer]; |
1280 | pdev = adapter->pdev; | 1279 | pdev = adapter->pdev; |
1281 | frag = &buffer->frag_array[0]; | 1280 | if (buffer->skb) { |
1282 | skb = buffer->skb; | 1281 | frag = &buffer->frag_array[0]; |
1283 | if (skb && (cmpxchg(&buffer->skb, skb, 0) == skb)) { | ||
1284 | pci_unmap_single(pdev, frag->dma, frag->length, | 1282 | pci_unmap_single(pdev, frag->dma, frag->length, |
1285 | PCI_DMA_TODEVICE); | 1283 | PCI_DMA_TODEVICE); |
1286 | frag->dma = 0ULL; | 1284 | frag->dma = 0ULL; |
@@ -1293,8 +1291,8 @@ int netxen_process_cmd_ring(unsigned long data) | |||
1293 | } | 1291 | } |
1294 | 1292 | ||
1295 | adapter->stats.skbfreed++; | 1293 | adapter->stats.skbfreed++; |
1296 | dev_kfree_skb_any(skb); | 1294 | dev_kfree_skb_any(buffer->skb); |
1297 | skb = NULL; | 1295 | buffer->skb = NULL; |
1298 | } else if (adapter->proc_cmd_buf_counter == 1) { | 1296 | } else if (adapter->proc_cmd_buf_counter == 1) { |
1299 | adapter->stats.txnullskb++; | 1297 | adapter->stats.txnullskb++; |
1300 | } | 1298 | } |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index a80f0cd6b528..263b55e36c7a 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -732,11 +732,6 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
732 | 732 | ||
733 | unregister_netdev(netdev); | 733 | unregister_netdev(netdev); |
734 | 734 | ||
735 | if (adapter->stop_port) | ||
736 | adapter->stop_port(adapter); | ||
737 | |||
738 | netxen_nic_disable_int(adapter); | ||
739 | |||
740 | if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) { | 735 | if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) { |
741 | init_firmware_done++; | 736 | init_firmware_done++; |
742 | netxen_free_hw_resources(adapter); | 737 | netxen_free_hw_resources(adapter); |
@@ -919,6 +914,9 @@ static int netxen_nic_close(struct net_device *netdev) | |||
919 | netif_stop_queue(netdev); | 914 | netif_stop_queue(netdev); |
920 | napi_disable(&adapter->napi); | 915 | napi_disable(&adapter->napi); |
921 | 916 | ||
917 | if (adapter->stop_port) | ||
918 | adapter->stop_port(adapter); | ||
919 | |||
922 | netxen_nic_disable_int(adapter); | 920 | netxen_nic_disable_int(adapter); |
923 | 921 | ||
924 | cmd_buff = adapter->cmd_buf_arr; | 922 | cmd_buff = adapter->cmd_buf_arr; |
@@ -996,28 +994,6 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
996 | return NETDEV_TX_OK; | 994 | return NETDEV_TX_OK; |
997 | } | 995 | } |
998 | 996 | ||
999 | /* | ||
1000 | * Everything is set up. Now, we just need to transmit it out. | ||
1001 | * Note that we have to copy the contents of buffer over to | ||
1002 | * right place. Later on, this can be optimized out by de-coupling the | ||
1003 | * producer index from the buffer index. | ||
1004 | */ | ||
1005 | retry_getting_window: | ||
1006 | spin_lock_bh(&adapter->tx_lock); | ||
1007 | if (adapter->total_threads >= MAX_XMIT_PRODUCERS) { | ||
1008 | spin_unlock_bh(&adapter->tx_lock); | ||
1009 | /* | ||
1010 | * Yield CPU | ||
1011 | */ | ||
1012 | if (!in_atomic()) | ||
1013 | schedule(); | ||
1014 | else { | ||
1015 | for (i = 0; i < 20; i++) | ||
1016 | cpu_relax(); /*This a nop instr on i386 */ | ||
1017 | } | ||
1018 | goto retry_getting_window; | ||
1019 | } | ||
1020 | local_producer = adapter->cmd_producer; | ||
1021 | /* There 4 fragments per descriptor */ | 997 | /* There 4 fragments per descriptor */ |
1022 | no_of_desc = (frag_count + 3) >> 2; | 998 | no_of_desc = (frag_count + 3) >> 2; |
1023 | if (netdev->features & NETIF_F_TSO) { | 999 | if (netdev->features & NETIF_F_TSO) { |
@@ -1031,16 +1007,19 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1031 | } | 1007 | } |
1032 | } | 1008 | } |
1033 | } | 1009 | } |
1010 | |||
1011 | spin_lock_bh(&adapter->tx_lock); | ||
1012 | if (adapter->total_threads >= MAX_XMIT_PRODUCERS) { | ||
1013 | goto out_requeue; | ||
1014 | } | ||
1015 | local_producer = adapter->cmd_producer; | ||
1034 | k = adapter->cmd_producer; | 1016 | k = adapter->cmd_producer; |
1035 | max_tx_desc_count = adapter->max_tx_desc_count; | 1017 | max_tx_desc_count = adapter->max_tx_desc_count; |
1036 | last_cmd_consumer = adapter->last_cmd_consumer; | 1018 | last_cmd_consumer = adapter->last_cmd_consumer; |
1037 | if ((k + no_of_desc) >= | 1019 | if ((k + no_of_desc) >= |
1038 | ((last_cmd_consumer <= k) ? last_cmd_consumer + max_tx_desc_count : | 1020 | ((last_cmd_consumer <= k) ? last_cmd_consumer + max_tx_desc_count : |
1039 | last_cmd_consumer)) { | 1021 | last_cmd_consumer)) { |
1040 | netif_stop_queue(netdev); | 1022 | goto out_requeue; |
1041 | adapter->flags |= NETXEN_NETDEV_STATUS; | ||
1042 | spin_unlock_bh(&adapter->tx_lock); | ||
1043 | return NETDEV_TX_BUSY; | ||
1044 | } | 1023 | } |
1045 | k = get_index_range(k, max_tx_desc_count, no_of_desc); | 1024 | k = get_index_range(k, max_tx_desc_count, no_of_desc); |
1046 | adapter->cmd_producer = k; | 1025 | adapter->cmd_producer = k; |
@@ -1093,6 +1072,8 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1093 | adapter->max_tx_desc_count); | 1072 | adapter->max_tx_desc_count); |
1094 | hwdesc = &hw->cmd_desc_head[producer]; | 1073 | hwdesc = &hw->cmd_desc_head[producer]; |
1095 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); | 1074 | memset(hwdesc, 0, sizeof(struct cmd_desc_type0)); |
1075 | pbuf = &adapter->cmd_buf_arr[producer]; | ||
1076 | pbuf->skb = NULL; | ||
1096 | } | 1077 | } |
1097 | frag = &skb_shinfo(skb)->frags[i - 1]; | 1078 | frag = &skb_shinfo(skb)->frags[i - 1]; |
1098 | len = frag->size; | 1079 | len = frag->size; |
@@ -1148,6 +1129,8 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1148 | } | 1129 | } |
1149 | /* copy the MAC/IP/TCP headers to the cmd descriptor list */ | 1130 | /* copy the MAC/IP/TCP headers to the cmd descriptor list */ |
1150 | hwdesc = &hw->cmd_desc_head[producer]; | 1131 | hwdesc = &hw->cmd_desc_head[producer]; |
1132 | pbuf = &adapter->cmd_buf_arr[producer]; | ||
1133 | pbuf->skb = NULL; | ||
1151 | 1134 | ||
1152 | /* copy the first 64 bytes */ | 1135 | /* copy the first 64 bytes */ |
1153 | memcpy(((void *)hwdesc) + 2, | 1136 | memcpy(((void *)hwdesc) + 2, |
@@ -1156,6 +1139,8 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1156 | 1139 | ||
1157 | if (more_hdr) { | 1140 | if (more_hdr) { |
1158 | hwdesc = &hw->cmd_desc_head[producer]; | 1141 | hwdesc = &hw->cmd_desc_head[producer]; |
1142 | pbuf = &adapter->cmd_buf_arr[producer]; | ||
1143 | pbuf->skb = NULL; | ||
1159 | /* copy the next 64 bytes - should be enough except | 1144 | /* copy the next 64 bytes - should be enough except |
1160 | * for pathological case | 1145 | * for pathological case |
1161 | */ | 1146 | */ |
@@ -1167,16 +1152,8 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1167 | } | 1152 | } |
1168 | } | 1153 | } |
1169 | 1154 | ||
1170 | i = netxen_get_cmd_desc_totallength(&hw->cmd_desc_head[saved_producer]); | ||
1171 | |||
1172 | hw->cmd_desc_head[saved_producer].flags_opcode = | ||
1173 | cpu_to_le16(hw->cmd_desc_head[saved_producer].flags_opcode); | ||
1174 | hw->cmd_desc_head[saved_producer].num_of_buffers_total_length = | ||
1175 | cpu_to_le32(hw->cmd_desc_head[saved_producer]. | ||
1176 | num_of_buffers_total_length); | ||
1177 | |||
1178 | spin_lock_bh(&adapter->tx_lock); | 1155 | spin_lock_bh(&adapter->tx_lock); |
1179 | adapter->stats.txbytes += i; | 1156 | adapter->stats.txbytes += skb->len; |
1180 | 1157 | ||
1181 | /* Code to update the adapter considering how many producer threads | 1158 | /* Code to update the adapter considering how many producer threads |
1182 | are currently working */ | 1159 | are currently working */ |
@@ -1189,14 +1166,17 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1189 | } | 1166 | } |
1190 | 1167 | ||
1191 | adapter->stats.xmitfinished++; | 1168 | adapter->stats.xmitfinished++; |
1192 | spin_unlock_bh(&adapter->tx_lock); | ||
1193 | |||
1194 | netdev->trans_start = jiffies; | 1169 | netdev->trans_start = jiffies; |
1195 | 1170 | ||
1196 | DPRINTK(INFO, "wrote CMD producer %x to phantom\n", producer); | 1171 | spin_unlock_bh(&adapter->tx_lock); |
1197 | |||
1198 | DPRINTK(INFO, "Done. Send\n"); | ||
1199 | return NETDEV_TX_OK; | 1172 | return NETDEV_TX_OK; |
1173 | |||
1174 | out_requeue: | ||
1175 | netif_stop_queue(netdev); | ||
1176 | adapter->flags |= NETXEN_NETDEV_STATUS; | ||
1177 | |||
1178 | spin_unlock_bh(&adapter->tx_lock); | ||
1179 | return NETDEV_TX_BUSY; | ||
1200 | } | 1180 | } |
1201 | 1181 | ||
1202 | static void netxen_watchdog(unsigned long v) | 1182 | static void netxen_watchdog(unsigned long v) |
@@ -1321,7 +1301,7 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget) | |||
1321 | budget / MAX_RCV_CTX); | 1301 | budget / MAX_RCV_CTX); |
1322 | } | 1302 | } |
1323 | 1303 | ||
1324 | if (work_done >= budget && netxen_nic_rx_has_work(adapter) != 0) | 1304 | if (work_done >= budget) |
1325 | done = 0; | 1305 | done = 0; |
1326 | 1306 | ||
1327 | if (netxen_process_cmd_ring((unsigned long)adapter) == 0) | 1307 | if (netxen_process_cmd_ring((unsigned long)adapter) == 0) |
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c index 5b9e1b300fab..d04ecb77d08c 100644 --- a/drivers/net/netxen/netxen_nic_niu.c +++ b/drivers/net/netxen/netxen_nic_niu.c | |||
@@ -736,12 +736,12 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) | |||
736 | __u32 mac_cfg; | 736 | __u32 mac_cfg; |
737 | u32 port = physical_port[adapter->portnum]; | 737 | u32 port = physical_port[adapter->portnum]; |
738 | 738 | ||
739 | if (port != 0) | 739 | if (port > NETXEN_NIU_MAX_XG_PORTS) |
740 | return -EINVAL; | 740 | return -EINVAL; |
741 | |||
741 | mac_cfg = 0; | 742 | mac_cfg = 0; |
742 | netxen_xg_soft_reset(mac_cfg); | 743 | if (netxen_nic_hw_write_wx(adapter, |
743 | if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_CONFIG_0, | 744 | NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), &mac_cfg, 4)) |
744 | &mac_cfg, 4)) | ||
745 | return -EIO; | 745 | return -EIO; |
746 | return 0; | 746 | return 0; |
747 | } | 747 | } |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index abfc61c3a38c..9a0c6d3adfe9 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -33,8 +33,8 @@ | |||
33 | 33 | ||
34 | #define DRV_MODULE_NAME "niu" | 34 | #define DRV_MODULE_NAME "niu" |
35 | #define PFX DRV_MODULE_NAME ": " | 35 | #define PFX DRV_MODULE_NAME ": " |
36 | #define DRV_MODULE_VERSION "0.5" | 36 | #define DRV_MODULE_VERSION "0.6" |
37 | #define DRV_MODULE_RELDATE "October 5, 2007" | 37 | #define DRV_MODULE_RELDATE "January 5, 2008" |
38 | 38 | ||
39 | static char version[] __devinitdata = | 39 | static char version[] __devinitdata = |
40 | DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; | 40 | DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n"; |
@@ -2241,6 +2241,8 @@ static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp) | |||
2241 | skb->protocol = eth_type_trans(skb, np->dev); | 2241 | skb->protocol = eth_type_trans(skb, np->dev); |
2242 | netif_receive_skb(skb); | 2242 | netif_receive_skb(skb); |
2243 | 2243 | ||
2244 | np->dev->last_rx = jiffies; | ||
2245 | |||
2244 | return num_rcr; | 2246 | return num_rcr; |
2245 | } | 2247 | } |
2246 | 2248 | ||
@@ -2508,15 +2510,19 @@ static int niu_rx_error(struct niu *np, struct rx_ring_info *rp) | |||
2508 | u64 stat = nr64(RX_DMA_CTL_STAT(rp->rx_channel)); | 2510 | u64 stat = nr64(RX_DMA_CTL_STAT(rp->rx_channel)); |
2509 | int err = 0; | 2511 | int err = 0; |
2510 | 2512 | ||
2511 | dev_err(np->device, PFX "%s: RX channel %u error, stat[%llx]\n", | ||
2512 | np->dev->name, rp->rx_channel, (unsigned long long) stat); | ||
2513 | |||
2514 | niu_log_rxchan_errors(np, rp, stat); | ||
2515 | 2513 | ||
2516 | if (stat & (RX_DMA_CTL_STAT_CHAN_FATAL | | 2514 | if (stat & (RX_DMA_CTL_STAT_CHAN_FATAL | |
2517 | RX_DMA_CTL_STAT_PORT_FATAL)) | 2515 | RX_DMA_CTL_STAT_PORT_FATAL)) |
2518 | err = -EINVAL; | 2516 | err = -EINVAL; |
2519 | 2517 | ||
2518 | if (err) { | ||
2519 | dev_err(np->device, PFX "%s: RX channel %u error, stat[%llx]\n", | ||
2520 | np->dev->name, rp->rx_channel, | ||
2521 | (unsigned long long) stat); | ||
2522 | |||
2523 | niu_log_rxchan_errors(np, rp, stat); | ||
2524 | } | ||
2525 | |||
2520 | nw64(RX_DMA_CTL_STAT(rp->rx_channel), | 2526 | nw64(RX_DMA_CTL_STAT(rp->rx_channel), |
2521 | stat & RX_DMA_CTL_WRITE_CLEAR_ERRS); | 2527 | stat & RX_DMA_CTL_WRITE_CLEAR_ERRS); |
2522 | 2528 | ||
@@ -2749,13 +2755,16 @@ static int niu_device_error(struct niu *np) | |||
2749 | return -ENODEV; | 2755 | return -ENODEV; |
2750 | } | 2756 | } |
2751 | 2757 | ||
2752 | static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp) | 2758 | static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp, |
2759 | u64 v0, u64 v1, u64 v2) | ||
2753 | { | 2760 | { |
2754 | u64 v0 = lp->v0; | 2761 | |
2755 | u64 v1 = lp->v1; | ||
2756 | u64 v2 = lp->v2; | ||
2757 | int i, err = 0; | 2762 | int i, err = 0; |
2758 | 2763 | ||
2764 | lp->v0 = v0; | ||
2765 | lp->v1 = v1; | ||
2766 | lp->v2 = v2; | ||
2767 | |||
2759 | if (v1 & 0x00000000ffffffffULL) { | 2768 | if (v1 & 0x00000000ffffffffULL) { |
2760 | u32 rx_vec = (v1 & 0xffffffff); | 2769 | u32 rx_vec = (v1 & 0xffffffff); |
2761 | 2770 | ||
@@ -2764,8 +2773,13 @@ static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp) | |||
2764 | 2773 | ||
2765 | if (rx_vec & (1 << rp->rx_channel)) { | 2774 | if (rx_vec & (1 << rp->rx_channel)) { |
2766 | int r = niu_rx_error(np, rp); | 2775 | int r = niu_rx_error(np, rp); |
2767 | if (r) | 2776 | if (r) { |
2768 | err = r; | 2777 | err = r; |
2778 | } else { | ||
2779 | if (!v0) | ||
2780 | nw64(RX_DMA_CTL_STAT(rp->rx_channel), | ||
2781 | RX_DMA_CTL_STAT_MEX); | ||
2782 | } | ||
2769 | } | 2783 | } |
2770 | } | 2784 | } |
2771 | } | 2785 | } |
@@ -2803,7 +2817,7 @@ static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp) | |||
2803 | if (err) | 2817 | if (err) |
2804 | niu_enable_interrupts(np, 0); | 2818 | niu_enable_interrupts(np, 0); |
2805 | 2819 | ||
2806 | return -EINVAL; | 2820 | return err; |
2807 | } | 2821 | } |
2808 | 2822 | ||
2809 | static void niu_rxchan_intr(struct niu *np, struct rx_ring_info *rp, | 2823 | static void niu_rxchan_intr(struct niu *np, struct rx_ring_info *rp, |
@@ -2905,7 +2919,7 @@ static irqreturn_t niu_interrupt(int irq, void *dev_id) | |||
2905 | } | 2919 | } |
2906 | 2920 | ||
2907 | if (unlikely((v0 & ((u64)1 << LDN_MIF)) || v1 || v2)) { | 2921 | if (unlikely((v0 & ((u64)1 << LDN_MIF)) || v1 || v2)) { |
2908 | int err = niu_slowpath_interrupt(np, lp); | 2922 | int err = niu_slowpath_interrupt(np, lp, v0, v1, v2); |
2909 | if (err) | 2923 | if (err) |
2910 | goto out; | 2924 | goto out; |
2911 | } | 2925 | } |
@@ -5194,7 +5208,8 @@ static int niu_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
5194 | } | 5208 | } |
5195 | kfree_skb(skb); | 5209 | kfree_skb(skb); |
5196 | skb = skb_new; | 5210 | skb = skb_new; |
5197 | } | 5211 | } else |
5212 | skb_orphan(skb); | ||
5198 | 5213 | ||
5199 | align = ((unsigned long) skb->data & (16 - 1)); | 5214 | align = ((unsigned long) skb->data & (16 - 1)); |
5200 | headroom = align + sizeof(struct tx_pkt_hdr); | 5215 | headroom = align + sizeof(struct tx_pkt_hdr); |
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c index ff92aca0a7b3..90498ffe26f2 100644 --- a/drivers/net/pcnet32.c +++ b/drivers/net/pcnet32.c | |||
@@ -455,9 +455,14 @@ static void pcnet32_netif_start(struct net_device *dev) | |||
455 | { | 455 | { |
456 | #ifdef CONFIG_PCNET32_NAPI | 456 | #ifdef CONFIG_PCNET32_NAPI |
457 | struct pcnet32_private *lp = netdev_priv(dev); | 457 | struct pcnet32_private *lp = netdev_priv(dev); |
458 | ulong ioaddr = dev->base_addr; | ||
459 | u16 val; | ||
458 | #endif | 460 | #endif |
459 | netif_wake_queue(dev); | 461 | netif_wake_queue(dev); |
460 | #ifdef CONFIG_PCNET32_NAPI | 462 | #ifdef CONFIG_PCNET32_NAPI |
463 | val = lp->a.read_csr(ioaddr, CSR3); | ||
464 | val &= 0x00ff; | ||
465 | lp->a.write_csr(ioaddr, CSR3, val); | ||
461 | napi_enable(&lp->napi); | 466 | napi_enable(&lp->napi); |
462 | #endif | 467 | #endif |
463 | } | 468 | } |
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index a5791114b7bd..cf0774de6c41 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c | |||
@@ -2320,14 +2320,9 @@ static int ql_poll(struct napi_struct *napi, int budget) | |||
2320 | unsigned long hw_flags; | 2320 | unsigned long hw_flags; |
2321 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; | 2321 | struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; |
2322 | 2322 | ||
2323 | if (!netif_carrier_ok(ndev)) | ||
2324 | goto quit_polling; | ||
2325 | |||
2326 | ql_tx_rx_clean(qdev, &tx_cleaned, &rx_cleaned, budget); | 2323 | ql_tx_rx_clean(qdev, &tx_cleaned, &rx_cleaned, budget); |
2327 | 2324 | ||
2328 | if (tx_cleaned + rx_cleaned != budget || | 2325 | if (tx_cleaned + rx_cleaned != budget) { |
2329 | !netif_running(ndev)) { | ||
2330 | quit_polling: | ||
2331 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); | 2326 | spin_lock_irqsave(&qdev->hw_lock, hw_flags); |
2332 | __netif_rx_complete(ndev, napi); | 2327 | __netif_rx_complete(ndev, napi); |
2333 | ql_update_small_bufq_prod_index(qdev); | 2328 | ql_update_small_bufq_prod_index(qdev); |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 5863190894cc..3acfeeabdee1 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -2002,7 +2002,7 @@ static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) | |||
2002 | u32 clk; | 2002 | u32 clk; |
2003 | 2003 | ||
2004 | clk = RTL_R8(Config2) & PCI_Clock_66MHz; | 2004 | clk = RTL_R8(Config2) & PCI_Clock_66MHz; |
2005 | for (i = 0; i < ARRAY_SIZE(cfg2_info); i++) { | 2005 | for (i = 0; i < ARRAY_SIZE(cfg2_info); i++, p++) { |
2006 | if ((p->mac_version == mac_version) && (p->clk == clk)) { | 2006 | if ((p->mac_version == mac_version) && (p->clk == clk)) { |
2007 | RTL_W32(0x7c, p->val); | 2007 | RTL_W32(0x7c, p->val); |
2008 | break; | 2008 | break; |
@@ -2398,6 +2398,8 @@ static void rtl8169_wait_for_quiescence(struct net_device *dev) | |||
2398 | rtl8169_irq_mask_and_ack(ioaddr); | 2398 | rtl8169_irq_mask_and_ack(ioaddr); |
2399 | 2399 | ||
2400 | #ifdef CONFIG_R8169_NAPI | 2400 | #ifdef CONFIG_R8169_NAPI |
2401 | tp->intr_mask = 0xffff; | ||
2402 | RTL_W16(IntrMask, tp->intr_event); | ||
2401 | napi_enable(&tp->napi); | 2403 | napi_enable(&tp->napi); |
2402 | #endif | 2404 | #endif |
2403 | } | 2405 | } |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 9d80f1cf73ac..fa57c49c0c51 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -2704,9 +2704,6 @@ static int s2io_poll(struct napi_struct *napi, int budget) | |||
2704 | struct XENA_dev_config __iomem *bar0 = nic->bar0; | 2704 | struct XENA_dev_config __iomem *bar0 = nic->bar0; |
2705 | int i; | 2705 | int i; |
2706 | 2706 | ||
2707 | if (!is_s2io_card_up(nic)) | ||
2708 | return 0; | ||
2709 | |||
2710 | mac_control = &nic->mac_control; | 2707 | mac_control = &nic->mac_control; |
2711 | config = &nic->config; | 2708 | config = &nic->config; |
2712 | 2709 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index a74fc11a6482..52ec89b82f64 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1168,6 +1168,7 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp | |||
1168 | TX_VLAN_TAG_OFF); | 1168 | TX_VLAN_TAG_OFF); |
1169 | } | 1169 | } |
1170 | 1170 | ||
1171 | sky2_read32(hw, B0_Y2_SP_LISR); | ||
1171 | napi_enable(&hw->napi); | 1172 | napi_enable(&hw->napi); |
1172 | netif_tx_unlock_bh(dev); | 1173 | netif_tx_unlock_bh(dev); |
1173 | } | 1174 | } |
@@ -2043,6 +2044,7 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) | |||
2043 | err = sky2_rx_start(sky2); | 2044 | err = sky2_rx_start(sky2); |
2044 | sky2_write32(hw, B0_IMSK, imask); | 2045 | sky2_write32(hw, B0_IMSK, imask); |
2045 | 2046 | ||
2047 | sky2_read32(hw, B0_Y2_SP_LISR); | ||
2046 | napi_enable(&hw->napi); | 2048 | napi_enable(&hw->napi); |
2047 | 2049 | ||
2048 | if (err) | 2050 | if (err) |
@@ -3861,6 +3863,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v) | |||
3861 | last = sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX)), | 3863 | last = sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX)), |
3862 | sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_LAST_IDX))); | 3864 | sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_LAST_IDX))); |
3863 | 3865 | ||
3866 | sky2_read32(hw, B0_Y2_SP_LISR); | ||
3864 | napi_enable(&hw->napi); | 3867 | napi_enable(&hw->napi); |
3865 | return 0; | 3868 | return 0; |
3866 | } | 3869 | } |
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c index 41f34bb91cad..6e8b18a3b3cc 100644 --- a/drivers/net/tulip/de4x5.c +++ b/drivers/net/tulip/de4x5.c | |||
@@ -911,7 +911,7 @@ static int de4x5_init(struct net_device *dev); | |||
911 | static int de4x5_sw_reset(struct net_device *dev); | 911 | static int de4x5_sw_reset(struct net_device *dev); |
912 | static int de4x5_rx(struct net_device *dev); | 912 | static int de4x5_rx(struct net_device *dev); |
913 | static int de4x5_tx(struct net_device *dev); | 913 | static int de4x5_tx(struct net_device *dev); |
914 | static int de4x5_ast(struct net_device *dev); | 914 | static void de4x5_ast(struct net_device *dev); |
915 | static int de4x5_txur(struct net_device *dev); | 915 | static int de4x5_txur(struct net_device *dev); |
916 | static int de4x5_rx_ovfc(struct net_device *dev); | 916 | static int de4x5_rx_ovfc(struct net_device *dev); |
917 | 917 | ||
@@ -984,11 +984,9 @@ static int test_bad_enet(struct net_device *dev, int status); | |||
984 | static int an_exception(struct de4x5_private *lp); | 984 | static int an_exception(struct de4x5_private *lp); |
985 | static char *build_setup_frame(struct net_device *dev, int mode); | 985 | static char *build_setup_frame(struct net_device *dev, int mode); |
986 | static void disable_ast(struct net_device *dev); | 986 | static void disable_ast(struct net_device *dev); |
987 | static void enable_ast(struct net_device *dev, u32 time_out); | ||
988 | static long de4x5_switch_mac_port(struct net_device *dev); | 987 | static long de4x5_switch_mac_port(struct net_device *dev); |
989 | static int gep_rd(struct net_device *dev); | 988 | static int gep_rd(struct net_device *dev); |
990 | static void gep_wr(s32 data, struct net_device *dev); | 989 | static void gep_wr(s32 data, struct net_device *dev); |
991 | static void timeout(struct net_device *dev, void (*fn)(u_long data), u_long data, u_long msec); | ||
992 | static void yawn(struct net_device *dev, int state); | 990 | static void yawn(struct net_device *dev, int state); |
993 | static void de4x5_parse_params(struct net_device *dev); | 991 | static void de4x5_parse_params(struct net_device *dev); |
994 | static void de4x5_dbg_open(struct net_device *dev); | 992 | static void de4x5_dbg_open(struct net_device *dev); |
@@ -1139,6 +1137,8 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev) | |||
1139 | lp->gendev = gendev; | 1137 | lp->gendev = gendev; |
1140 | spin_lock_init(&lp->lock); | 1138 | spin_lock_init(&lp->lock); |
1141 | init_timer(&lp->timer); | 1139 | init_timer(&lp->timer); |
1140 | lp->timer.function = (void (*)(unsigned long))de4x5_ast; | ||
1141 | lp->timer.data = (unsigned long)dev; | ||
1142 | de4x5_parse_params(dev); | 1142 | de4x5_parse_params(dev); |
1143 | 1143 | ||
1144 | /* | 1144 | /* |
@@ -1311,7 +1311,7 @@ de4x5_open(struct net_device *dev) | |||
1311 | lp->state = OPEN; | 1311 | lp->state = OPEN; |
1312 | de4x5_dbg_open(dev); | 1312 | de4x5_dbg_open(dev); |
1313 | 1313 | ||
1314 | if (request_irq(dev->irq, (void *)de4x5_interrupt, IRQF_SHARED, | 1314 | if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED, |
1315 | lp->adapter_name, dev)) { | 1315 | lp->adapter_name, dev)) { |
1316 | printk("de4x5_open(): Requested IRQ%d is busy - attemping FAST/SHARE...", dev->irq); | 1316 | printk("de4x5_open(): Requested IRQ%d is busy - attemping FAST/SHARE...", dev->irq); |
1317 | if (request_irq(dev->irq, de4x5_interrupt, IRQF_DISABLED | IRQF_SHARED, | 1317 | if (request_irq(dev->irq, de4x5_interrupt, IRQF_DISABLED | IRQF_SHARED, |
@@ -1737,27 +1737,29 @@ de4x5_tx(struct net_device *dev) | |||
1737 | return 0; | 1737 | return 0; |
1738 | } | 1738 | } |
1739 | 1739 | ||
1740 | static int | 1740 | static void |
1741 | de4x5_ast(struct net_device *dev) | 1741 | de4x5_ast(struct net_device *dev) |
1742 | { | 1742 | { |
1743 | struct de4x5_private *lp = netdev_priv(dev); | 1743 | struct de4x5_private *lp = netdev_priv(dev); |
1744 | int next_tick = DE4X5_AUTOSENSE_MS; | 1744 | int next_tick = DE4X5_AUTOSENSE_MS; |
1745 | int dt; | ||
1745 | 1746 | ||
1746 | disable_ast(dev); | 1747 | if (lp->useSROM) |
1748 | next_tick = srom_autoconf(dev); | ||
1749 | else if (lp->chipset == DC21140) | ||
1750 | next_tick = dc21140m_autoconf(dev); | ||
1751 | else if (lp->chipset == DC21041) | ||
1752 | next_tick = dc21041_autoconf(dev); | ||
1753 | else if (lp->chipset == DC21040) | ||
1754 | next_tick = dc21040_autoconf(dev); | ||
1755 | lp->linkOK = 0; | ||
1747 | 1756 | ||
1748 | if (lp->useSROM) { | 1757 | dt = (next_tick * HZ) / 1000; |
1749 | next_tick = srom_autoconf(dev); | ||
1750 | } else if (lp->chipset == DC21140) { | ||
1751 | next_tick = dc21140m_autoconf(dev); | ||
1752 | } else if (lp->chipset == DC21041) { | ||
1753 | next_tick = dc21041_autoconf(dev); | ||
1754 | } else if (lp->chipset == DC21040) { | ||
1755 | next_tick = dc21040_autoconf(dev); | ||
1756 | } | ||
1757 | lp->linkOK = 0; | ||
1758 | enable_ast(dev, next_tick); | ||
1759 | 1758 | ||
1760 | return 0; | 1759 | if (!dt) |
1760 | dt = 1; | ||
1761 | |||
1762 | mod_timer(&lp->timer, jiffies + dt); | ||
1761 | } | 1763 | } |
1762 | 1764 | ||
1763 | static int | 1765 | static int |
@@ -2174,7 +2176,7 @@ srom_search(struct net_device *dev, struct pci_dev *pdev) | |||
2174 | for (j=0, i=0; i<ETH_ALEN; i++) { | 2176 | for (j=0, i=0; i<ETH_ALEN; i++) { |
2175 | j += (u_char) *((u_char *)&lp->srom + SROM_HWADD + i); | 2177 | j += (u_char) *((u_char *)&lp->srom + SROM_HWADD + i); |
2176 | } | 2178 | } |
2177 | if ((j != 0) && (j != 0x5fa)) { | 2179 | if (j != 0 && j != 6 * 0xff) { |
2178 | last.chipset = device; | 2180 | last.chipset = device; |
2179 | last.bus = pb; | 2181 | last.bus = pb; |
2180 | last.irq = irq; | 2182 | last.irq = irq; |
@@ -2371,30 +2373,19 @@ static struct pci_driver de4x5_pci_driver = { | |||
2371 | static int | 2373 | static int |
2372 | autoconf_media(struct net_device *dev) | 2374 | autoconf_media(struct net_device *dev) |
2373 | { | 2375 | { |
2374 | struct de4x5_private *lp = netdev_priv(dev); | 2376 | struct de4x5_private *lp = netdev_priv(dev); |
2375 | u_long iobase = dev->base_addr; | 2377 | u_long iobase = dev->base_addr; |
2376 | int next_tick = DE4X5_AUTOSENSE_MS; | ||
2377 | 2378 | ||
2378 | lp->linkOK = 0; | 2379 | disable_ast(dev); |
2379 | lp->c_media = AUTO; /* Bogus last media */ | ||
2380 | disable_ast(dev); | ||
2381 | inl(DE4X5_MFC); /* Zero the lost frames counter */ | ||
2382 | lp->media = INIT; | ||
2383 | lp->tcount = 0; | ||
2384 | 2380 | ||
2385 | if (lp->useSROM) { | 2381 | lp->c_media = AUTO; /* Bogus last media */ |
2386 | next_tick = srom_autoconf(dev); | 2382 | inl(DE4X5_MFC); /* Zero the lost frames counter */ |
2387 | } else if (lp->chipset == DC21040) { | 2383 | lp->media = INIT; |
2388 | next_tick = dc21040_autoconf(dev); | 2384 | lp->tcount = 0; |
2389 | } else if (lp->chipset == DC21041) { | ||
2390 | next_tick = dc21041_autoconf(dev); | ||
2391 | } else if (lp->chipset == DC21140) { | ||
2392 | next_tick = dc21140m_autoconf(dev); | ||
2393 | } | ||
2394 | 2385 | ||
2395 | enable_ast(dev, next_tick); | 2386 | de4x5_ast(dev); |
2396 | 2387 | ||
2397 | return (lp->media); | 2388 | return lp->media; |
2398 | } | 2389 | } |
2399 | 2390 | ||
2400 | /* | 2391 | /* |
@@ -4018,20 +4009,22 @@ DevicePresent(struct net_device *dev, u_long aprom_addr) | |||
4018 | outl(0, aprom_addr); /* Reset Ethernet Address ROM Pointer */ | 4009 | outl(0, aprom_addr); /* Reset Ethernet Address ROM Pointer */ |
4019 | } | 4010 | } |
4020 | } else { /* Read new srom */ | 4011 | } else { /* Read new srom */ |
4021 | u_short tmp, *p = (short *)((char *)&lp->srom + SROM_HWADD); | 4012 | u_short tmp; |
4013 | __le16 *p = (__le16 *)((char *)&lp->srom + SROM_HWADD); | ||
4022 | for (i=0; i<(ETH_ALEN>>1); i++) { | 4014 | for (i=0; i<(ETH_ALEN>>1); i++) { |
4023 | tmp = srom_rd(aprom_addr, (SROM_HWADD>>1) + i); | 4015 | tmp = srom_rd(aprom_addr, (SROM_HWADD>>1) + i); |
4024 | *p = le16_to_cpu(tmp); | 4016 | j += tmp; /* for check for 0:0:0:0:0:0 or ff:ff:ff:ff:ff:ff */ |
4025 | j += *p++; | 4017 | *p = cpu_to_le16(tmp); |
4026 | } | 4018 | } |
4027 | if ((j == 0) || (j == 0x2fffd)) { | 4019 | if (j == 0 || j == 3 * 0xffff) { |
4028 | return; | 4020 | /* could get 0 only from all-0 and 3 * 0xffff only from all-1 */ |
4021 | return; | ||
4029 | } | 4022 | } |
4030 | 4023 | ||
4031 | p=(short *)&lp->srom; | 4024 | p = (__le16 *)&lp->srom; |
4032 | for (i=0; i<(sizeof(struct de4x5_srom)>>1); i++) { | 4025 | for (i=0; i<(sizeof(struct de4x5_srom)>>1); i++) { |
4033 | tmp = srom_rd(aprom_addr, i); | 4026 | tmp = srom_rd(aprom_addr, i); |
4034 | *p++ = le16_to_cpu(tmp); | 4027 | *p++ = cpu_to_le16(tmp); |
4035 | } | 4028 | } |
4036 | de4x5_dbg_srom((struct de4x5_srom *)&lp->srom); | 4029 | de4x5_dbg_srom((struct de4x5_srom *)&lp->srom); |
4037 | } | 4030 | } |
@@ -5161,21 +5154,10 @@ build_setup_frame(struct net_device *dev, int mode) | |||
5161 | } | 5154 | } |
5162 | 5155 | ||
5163 | static void | 5156 | static void |
5164 | enable_ast(struct net_device *dev, u32 time_out) | ||
5165 | { | ||
5166 | timeout(dev, (void *)&de4x5_ast, (u_long)dev, time_out); | ||
5167 | |||
5168 | return; | ||
5169 | } | ||
5170 | |||
5171 | static void | ||
5172 | disable_ast(struct net_device *dev) | 5157 | disable_ast(struct net_device *dev) |
5173 | { | 5158 | { |
5174 | struct de4x5_private *lp = netdev_priv(dev); | 5159 | struct de4x5_private *lp = netdev_priv(dev); |
5175 | 5160 | del_timer_sync(&lp->timer); | |
5176 | del_timer(&lp->timer); | ||
5177 | |||
5178 | return; | ||
5179 | } | 5161 | } |
5180 | 5162 | ||
5181 | static long | 5163 | static long |
@@ -5245,29 +5227,6 @@ gep_rd(struct net_device *dev) | |||
5245 | } | 5227 | } |
5246 | 5228 | ||
5247 | static void | 5229 | static void |
5248 | timeout(struct net_device *dev, void (*fn)(u_long data), u_long data, u_long msec) | ||
5249 | { | ||
5250 | struct de4x5_private *lp = netdev_priv(dev); | ||
5251 | int dt; | ||
5252 | |||
5253 | /* First, cancel any pending timer events */ | ||
5254 | del_timer(&lp->timer); | ||
5255 | |||
5256 | /* Convert msec to ticks */ | ||
5257 | dt = (msec * HZ) / 1000; | ||
5258 | if (dt==0) dt=1; | ||
5259 | |||
5260 | /* Set up timer */ | ||
5261 | init_timer(&lp->timer); | ||
5262 | lp->timer.expires = jiffies + dt; | ||
5263 | lp->timer.function = fn; | ||
5264 | lp->timer.data = data; | ||
5265 | add_timer(&lp->timer); | ||
5266 | |||
5267 | return; | ||
5268 | } | ||
5269 | |||
5270 | static void | ||
5271 | yawn(struct net_device *dev, int state) | 5230 | yawn(struct net_device *dev, int state) |
5272 | { | 5231 | { |
5273 | struct de4x5_private *lp = netdev_priv(dev); | 5232 | struct de4x5_private *lp = netdev_priv(dev); |
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c index 365331446387..6284afd14bbb 100644 --- a/drivers/net/tulip/interrupt.c +++ b/drivers/net/tulip/interrupt.c | |||
@@ -117,9 +117,6 @@ int tulip_poll(struct napi_struct *napi, int budget) | |||
117 | int received = 0; | 117 | int received = 0; |
118 | #endif | 118 | #endif |
119 | 119 | ||
120 | if (!netif_running(dev)) | ||
121 | goto done; | ||
122 | |||
123 | #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION | 120 | #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION |
124 | 121 | ||
125 | /* that one buffer is needed for mit activation; or might be a | 122 | /* that one buffer is needed for mit activation; or might be a |
@@ -151,7 +148,8 @@ int tulip_poll(struct napi_struct *napi, int budget) | |||
151 | if (tulip_debug > 5) | 148 | if (tulip_debug > 5) |
152 | printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n", | 149 | printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n", |
153 | dev->name, entry, status); | 150 | dev->name, entry, status); |
154 | if (work_done++ >= budget) | 151 | |
152 | if (++work_done >= budget) | ||
155 | goto not_done; | 153 | goto not_done; |
156 | 154 | ||
157 | if ((status & 0x38008300) != 0x0300) { | 155 | if ((status & 0x38008300) != 0x0300) { |
@@ -260,8 +258,6 @@ int tulip_poll(struct napi_struct *napi, int budget) | |||
260 | * finally: amount of IO did not increase at all. */ | 258 | * finally: amount of IO did not increase at all. */ |
261 | } while ((ioread32(tp->base_addr + CSR5) & RxIntr)); | 259 | } while ((ioread32(tp->base_addr + CSR5) & RxIntr)); |
262 | 260 | ||
263 | done: | ||
264 | |||
265 | #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION | 261 | #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION |
266 | 262 | ||
267 | /* We use this simplistic scheme for IM. It's proven by | 263 | /* We use this simplistic scheme for IM. It's proven by |
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index e5e2c9c4ebfe..ed600bf56e78 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -797,7 +797,8 @@ static int tulip_close (struct net_device *dev) | |||
797 | 797 | ||
798 | tp->rx_ring[i].status = 0; /* Not owned by Tulip chip. */ | 798 | tp->rx_ring[i].status = 0; /* Not owned by Tulip chip. */ |
799 | tp->rx_ring[i].length = 0; | 799 | tp->rx_ring[i].length = 0; |
800 | tp->rx_ring[i].buffer1 = 0xBADF00D0; /* An invalid address. */ | 800 | /* An invalid address. */ |
801 | tp->rx_ring[i].buffer1 = cpu_to_le32(0xBADF00D0); | ||
801 | if (skb) { | 802 | if (skb) { |
802 | pci_unmap_single(tp->pdev, mapping, PKT_BUF_SZ, | 803 | pci_unmap_single(tp->pdev, mapping, PKT_BUF_SZ, |
803 | PCI_DMA_FROMDEVICE); | 804 | PCI_DMA_FROMDEVICE); |
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c index 70befe33e454..8fc7274642eb 100644 --- a/drivers/net/tulip/xircom_cb.c +++ b/drivers/net/tulip/xircom_cb.c | |||
@@ -83,8 +83,8 @@ static int bufferoffsets[NUMDESCRIPTORS] = {128,2048,4096,6144}; | |||
83 | struct xircom_private { | 83 | struct xircom_private { |
84 | /* Send and receive buffers, kernel-addressable and dma addressable forms */ | 84 | /* Send and receive buffers, kernel-addressable and dma addressable forms */ |
85 | 85 | ||
86 | unsigned int *rx_buffer; | 86 | __le32 *rx_buffer; |
87 | unsigned int *tx_buffer; | 87 | __le32 *tx_buffer; |
88 | 88 | ||
89 | dma_addr_t rx_dma_handle; | 89 | dma_addr_t rx_dma_handle; |
90 | dma_addr_t tx_dma_handle; | 90 | dma_addr_t tx_dma_handle; |
@@ -412,19 +412,20 @@ static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
412 | /* FIXME: The specification tells us that the length we send HAS to be a multiple of | 412 | /* FIXME: The specification tells us that the length we send HAS to be a multiple of |
413 | 4 bytes. */ | 413 | 4 bytes. */ |
414 | 414 | ||
415 | card->tx_buffer[4*desc+1] = skb->len; | 415 | card->tx_buffer[4*desc+1] = cpu_to_le32(skb->len); |
416 | if (desc == NUMDESCRIPTORS-1) | 416 | if (desc == NUMDESCRIPTORS - 1) /* bit 25: last descriptor of the ring */ |
417 | card->tx_buffer[4*desc+1] |= (1<<25); /* bit 25: last descriptor of the ring */ | 417 | card->tx_buffer[4*desc+1] |= cpu_to_le32(1<<25); |
418 | 418 | ||
419 | card->tx_buffer[4*desc+1] |= 0xF0000000; | 419 | card->tx_buffer[4*desc+1] |= cpu_to_le32(0xF0000000); |
420 | /* 0xF0... means want interrupts*/ | 420 | /* 0xF0... means want interrupts*/ |
421 | card->tx_skb[desc] = skb; | 421 | card->tx_skb[desc] = skb; |
422 | 422 | ||
423 | wmb(); | 423 | wmb(); |
424 | /* This gives the descriptor to the card */ | 424 | /* This gives the descriptor to the card */ |
425 | card->tx_buffer[4*desc] = 0x80000000; | 425 | card->tx_buffer[4*desc] = cpu_to_le32(0x80000000); |
426 | trigger_transmit(card); | 426 | trigger_transmit(card); |
427 | if (((int)card->tx_buffer[nextdescriptor*4])<0) { /* next descriptor is occupied... */ | 427 | if (card->tx_buffer[nextdescriptor*4] & cpu_to_le32(0x8000000)) { |
428 | /* next descriptor is occupied... */ | ||
428 | netif_stop_queue(dev); | 429 | netif_stop_queue(dev); |
429 | } | 430 | } |
430 | card->transmit_used = nextdescriptor; | 431 | card->transmit_used = nextdescriptor; |
@@ -590,8 +591,7 @@ descriptors and programs the addresses into the card. | |||
590 | */ | 591 | */ |
591 | static void setup_descriptors(struct xircom_private *card) | 592 | static void setup_descriptors(struct xircom_private *card) |
592 | { | 593 | { |
593 | unsigned int val; | 594 | u32 address; |
594 | unsigned int address; | ||
595 | int i; | 595 | int i; |
596 | enter("setup_descriptors"); | 596 | enter("setup_descriptors"); |
597 | 597 | ||
@@ -604,16 +604,16 @@ static void setup_descriptors(struct xircom_private *card) | |||
604 | for (i=0;i<NUMDESCRIPTORS;i++ ) { | 604 | for (i=0;i<NUMDESCRIPTORS;i++ ) { |
605 | 605 | ||
606 | /* Rx Descr0: It's empty, let the card own it, no errors -> 0x80000000 */ | 606 | /* Rx Descr0: It's empty, let the card own it, no errors -> 0x80000000 */ |
607 | card->rx_buffer[i*4 + 0] = 0x80000000; | 607 | card->rx_buffer[i*4 + 0] = cpu_to_le32(0x80000000); |
608 | /* Rx Descr1: buffer 1 is 1536 bytes, buffer 2 is 0 bytes */ | 608 | /* Rx Descr1: buffer 1 is 1536 bytes, buffer 2 is 0 bytes */ |
609 | card->rx_buffer[i*4 + 1] = 1536; | 609 | card->rx_buffer[i*4 + 1] = cpu_to_le32(1536); |
610 | if (i==NUMDESCRIPTORS-1) | 610 | if (i == NUMDESCRIPTORS - 1) /* bit 25 is "last descriptor" */ |
611 | card->rx_buffer[i*4 + 1] |= (1 << 25); /* bit 25 is "last descriptor" */ | 611 | card->rx_buffer[i*4 + 1] |= cpu_to_le32(1 << 25); |
612 | 612 | ||
613 | /* Rx Descr2: address of the buffer | 613 | /* Rx Descr2: address of the buffer |
614 | we store the buffer at the 2nd half of the page */ | 614 | we store the buffer at the 2nd half of the page */ |
615 | 615 | ||
616 | address = (unsigned long) card->rx_dma_handle; | 616 | address = card->rx_dma_handle; |
617 | card->rx_buffer[i*4 + 2] = cpu_to_le32(address + bufferoffsets[i]); | 617 | card->rx_buffer[i*4 + 2] = cpu_to_le32(address + bufferoffsets[i]); |
618 | /* Rx Desc3: address of 2nd buffer -> 0 */ | 618 | /* Rx Desc3: address of 2nd buffer -> 0 */ |
619 | card->rx_buffer[i*4 + 3] = 0; | 619 | card->rx_buffer[i*4 + 3] = 0; |
@@ -621,9 +621,8 @@ static void setup_descriptors(struct xircom_private *card) | |||
621 | 621 | ||
622 | wmb(); | 622 | wmb(); |
623 | /* Write the receive descriptor ring address to the card */ | 623 | /* Write the receive descriptor ring address to the card */ |
624 | address = (unsigned long) card->rx_dma_handle; | 624 | address = card->rx_dma_handle; |
625 | val = cpu_to_le32(address); | 625 | outl(address, card->io_port + CSR3); /* Receive descr list address */ |
626 | outl(val, card->io_port + CSR3); /* Receive descr list address */ | ||
627 | 626 | ||
628 | 627 | ||
629 | /* transmit descriptors */ | 628 | /* transmit descriptors */ |
@@ -633,13 +632,13 @@ static void setup_descriptors(struct xircom_private *card) | |||
633 | /* Tx Descr0: Empty, we own it, no errors -> 0x00000000 */ | 632 | /* Tx Descr0: Empty, we own it, no errors -> 0x00000000 */ |
634 | card->tx_buffer[i*4 + 0] = 0x00000000; | 633 | card->tx_buffer[i*4 + 0] = 0x00000000; |
635 | /* Tx Descr1: buffer 1 is 1536 bytes, buffer 2 is 0 bytes */ | 634 | /* Tx Descr1: buffer 1 is 1536 bytes, buffer 2 is 0 bytes */ |
636 | card->tx_buffer[i*4 + 1] = 1536; | 635 | card->tx_buffer[i*4 + 1] = cpu_to_le32(1536); |
637 | if (i==NUMDESCRIPTORS-1) | 636 | if (i == NUMDESCRIPTORS - 1) /* bit 25 is "last descriptor" */ |
638 | card->tx_buffer[i*4 + 1] |= (1 << 25); /* bit 25 is "last descriptor" */ | 637 | card->tx_buffer[i*4 + 1] |= cpu_to_le32(1 << 25); |
639 | 638 | ||
640 | /* Tx Descr2: address of the buffer | 639 | /* Tx Descr2: address of the buffer |
641 | we store the buffer at the 2nd half of the page */ | 640 | we store the buffer at the 2nd half of the page */ |
642 | address = (unsigned long) card->tx_dma_handle; | 641 | address = card->tx_dma_handle; |
643 | card->tx_buffer[i*4 + 2] = cpu_to_le32(address + bufferoffsets[i]); | 642 | card->tx_buffer[i*4 + 2] = cpu_to_le32(address + bufferoffsets[i]); |
644 | /* Tx Desc3: address of 2nd buffer -> 0 */ | 643 | /* Tx Desc3: address of 2nd buffer -> 0 */ |
645 | card->tx_buffer[i*4 + 3] = 0; | 644 | card->tx_buffer[i*4 + 3] = 0; |
@@ -647,9 +646,8 @@ static void setup_descriptors(struct xircom_private *card) | |||
647 | 646 | ||
648 | wmb(); | 647 | wmb(); |
649 | /* wite the transmit descriptor ring to the card */ | 648 | /* wite the transmit descriptor ring to the card */ |
650 | address = (unsigned long) card->tx_dma_handle; | 649 | address = card->tx_dma_handle; |
651 | val =cpu_to_le32(address); | 650 | outl(address, card->io_port + CSR4); /* xmit descr list address */ |
652 | outl(val, card->io_port + CSR4); /* xmit descr list address */ | ||
653 | 651 | ||
654 | leave("setup_descriptors"); | 652 | leave("setup_descriptors"); |
655 | } | 653 | } |
@@ -1180,7 +1178,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri | |||
1180 | int status; | 1178 | int status; |
1181 | 1179 | ||
1182 | enter("investigate_read_descriptor"); | 1180 | enter("investigate_read_descriptor"); |
1183 | status = card->rx_buffer[4*descnr]; | 1181 | status = le32_to_cpu(card->rx_buffer[4*descnr]); |
1184 | 1182 | ||
1185 | if ((status > 0)) { /* packet received */ | 1183 | if ((status > 0)) { /* packet received */ |
1186 | 1184 | ||
@@ -1210,7 +1208,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri | |||
1210 | 1208 | ||
1211 | out: | 1209 | out: |
1212 | /* give the buffer back to the card */ | 1210 | /* give the buffer back to the card */ |
1213 | card->rx_buffer[4*descnr] = 0x80000000; | 1211 | card->rx_buffer[4*descnr] = cpu_to_le32(0x80000000); |
1214 | trigger_receive(card); | 1212 | trigger_receive(card); |
1215 | } | 1213 | } |
1216 | 1214 | ||
@@ -1226,7 +1224,7 @@ static void investigate_write_descriptor(struct net_device *dev, struct xircom_p | |||
1226 | 1224 | ||
1227 | enter("investigate_write_descriptor"); | 1225 | enter("investigate_write_descriptor"); |
1228 | 1226 | ||
1229 | status = card->tx_buffer[4*descnr]; | 1227 | status = le32_to_cpu(card->tx_buffer[4*descnr]); |
1230 | #if 0 | 1228 | #if 0 |
1231 | if (status & 0x8000) { /* Major error */ | 1229 | if (status & 0x8000) { /* Major error */ |
1232 | printk(KERN_ERR "Major transmit error status %x \n", status); | 1230 | printk(KERN_ERR "Major transmit error status %x \n", status); |
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 1249f444039e..569028b2baf2 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -202,10 +202,10 @@ static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, | |||
202 | buf, | 202 | buf, |
203 | size, | 203 | size, |
204 | USB_CTRL_GET_TIMEOUT); | 204 | USB_CTRL_GET_TIMEOUT); |
205 | if (err >= 0 && err < size) | 205 | if (err == size) |
206 | err = -EINVAL; | ||
207 | if (!err) | ||
208 | memcpy(data, buf, size); | 206 | memcpy(data, buf, size); |
207 | else if (err >= 0) | ||
208 | err = -EINVAL; | ||
209 | kfree(buf); | 209 | kfree(buf); |
210 | 210 | ||
211 | out: | 211 | out: |
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index 58a53a641754..569ad8bfd383 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
@@ -70,7 +70,7 @@ | |||
70 | #define KAWETH_TX_TIMEOUT (5 * HZ) | 70 | #define KAWETH_TX_TIMEOUT (5 * HZ) |
71 | #define KAWETH_SCRATCH_SIZE 32 | 71 | #define KAWETH_SCRATCH_SIZE 32 |
72 | #define KAWETH_FIRMWARE_BUF_SIZE 4096 | 72 | #define KAWETH_FIRMWARE_BUF_SIZE 4096 |
73 | #define KAWETH_CONTROL_TIMEOUT (30 * HZ) | 73 | #define KAWETH_CONTROL_TIMEOUT (30000) |
74 | 74 | ||
75 | #define KAWETH_STATUS_BROKEN 0x0000001 | 75 | #define KAWETH_STATUS_BROKEN 0x0000001 |
76 | #define KAWETH_STATUS_CLOSING 0x0000002 | 76 | #define KAWETH_STATUS_CLOSING 0x0000002 |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index f55a5951733a..5ea7411e1337 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -94,7 +94,7 @@ static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data) | |||
94 | 94 | ||
95 | ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ, | 95 | ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ, |
96 | MCS7830_RD_BMREQ, 0x0000, index, data, | 96 | MCS7830_RD_BMREQ, 0x0000, index, data, |
97 | size, msecs_to_jiffies(MCS7830_CTRL_TIMEOUT)); | 97 | size, MCS7830_CTRL_TIMEOUT); |
98 | return ret; | 98 | return ret; |
99 | } | 99 | } |
100 | 100 | ||
@@ -105,7 +105,7 @@ static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, void *data) | |||
105 | 105 | ||
106 | ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ, | 106 | ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ, |
107 | MCS7830_WR_BMREQ, 0x0000, index, data, | 107 | MCS7830_WR_BMREQ, 0x0000, index, data, |
108 | size, msecs_to_jiffies(MCS7830_CTRL_TIMEOUT)); | 108 | size, MCS7830_CTRL_TIMEOUT); |
109 | return ret; | 109 | return ret; |
110 | } | 110 | } |
111 | 111 | ||
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index a28ad230d63e..7b6fc1ab2b90 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h | |||
@@ -273,6 +273,8 @@ enum { | |||
273 | #define B43_PHYTYPE_A 0x00 | 273 | #define B43_PHYTYPE_A 0x00 |
274 | #define B43_PHYTYPE_B 0x01 | 274 | #define B43_PHYTYPE_B 0x01 |
275 | #define B43_PHYTYPE_G 0x02 | 275 | #define B43_PHYTYPE_G 0x02 |
276 | #define B43_PHYTYPE_N 0x04 | ||
277 | #define B43_PHYTYPE_LP 0x05 | ||
276 | 278 | ||
277 | /* PHYRegisters */ | 279 | /* PHYRegisters */ |
278 | #define B43_PHY_ILT_A_CTRL 0x0072 | 280 | #define B43_PHY_ILT_A_CTRL 0x0072 |
diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h index 284d17da17d1..08e2e56e48f4 100644 --- a/drivers/net/wireless/b43/main.h +++ b/drivers/net/wireless/b43/main.h | |||
@@ -39,11 +39,11 @@ | |||
39 | #define PAD_BYTES(nr_bytes) P4D_BYTES( __LINE__ , (nr_bytes)) | 39 | #define PAD_BYTES(nr_bytes) P4D_BYTES( __LINE__ , (nr_bytes)) |
40 | 40 | ||
41 | /* Lightweight function to convert a frequency (in Mhz) to a channel number. */ | 41 | /* Lightweight function to convert a frequency (in Mhz) to a channel number. */ |
42 | static inline u8 b43_freq_to_channel_a(int freq) | 42 | static inline u8 b43_freq_to_channel_5ghz(int freq) |
43 | { | 43 | { |
44 | return ((freq - 5000) / 5); | 44 | return ((freq - 5000) / 5); |
45 | } | 45 | } |
46 | static inline u8 b43_freq_to_channel_bg(int freq) | 46 | static inline u8 b43_freq_to_channel_2ghz(int freq) |
47 | { | 47 | { |
48 | u8 channel; | 48 | u8 channel; |
49 | 49 | ||
@@ -54,19 +54,13 @@ static inline u8 b43_freq_to_channel_bg(int freq) | |||
54 | 54 | ||
55 | return channel; | 55 | return channel; |
56 | } | 56 | } |
57 | static inline u8 b43_freq_to_channel(struct b43_wldev *dev, int freq) | ||
58 | { | ||
59 | if (dev->phy.type == B43_PHYTYPE_A) | ||
60 | return b43_freq_to_channel_a(freq); | ||
61 | return b43_freq_to_channel_bg(freq); | ||
62 | } | ||
63 | 57 | ||
64 | /* Lightweight function to convert a channel number to a frequency (in Mhz). */ | 58 | /* Lightweight function to convert a channel number to a frequency (in Mhz). */ |
65 | static inline int b43_channel_to_freq_a(u8 channel) | 59 | static inline int b43_channel_to_freq_5ghz(u8 channel) |
66 | { | 60 | { |
67 | return (5000 + (5 * channel)); | 61 | return (5000 + (5 * channel)); |
68 | } | 62 | } |
69 | static inline int b43_channel_to_freq_bg(u8 channel) | 63 | static inline int b43_channel_to_freq_2ghz(u8 channel) |
70 | { | 64 | { |
71 | int freq; | 65 | int freq; |
72 | 66 | ||
@@ -77,12 +71,6 @@ static inline int b43_channel_to_freq_bg(u8 channel) | |||
77 | 71 | ||
78 | return freq; | 72 | return freq; |
79 | } | 73 | } |
80 | static inline int b43_channel_to_freq(struct b43_wldev *dev, u8 channel) | ||
81 | { | ||
82 | if (dev->phy.type == B43_PHYTYPE_A) | ||
83 | return b43_channel_to_freq_a(channel); | ||
84 | return b43_channel_to_freq_bg(channel); | ||
85 | } | ||
86 | 74 | ||
87 | static inline int b43_is_cck_rate(int rate) | 75 | static inline int b43_is_cck_rate(int rate) |
88 | { | 76 | { |
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c index 0bd6f8a348a8..3307ba1856b1 100644 --- a/drivers/net/wireless/b43/xmit.c +++ b/drivers/net/wireless/b43/xmit.c | |||
@@ -531,21 +531,32 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr) | |||
531 | switch (chanstat & B43_RX_CHAN_PHYTYPE) { | 531 | switch (chanstat & B43_RX_CHAN_PHYTYPE) { |
532 | case B43_PHYTYPE_A: | 532 | case B43_PHYTYPE_A: |
533 | status.phymode = MODE_IEEE80211A; | 533 | status.phymode = MODE_IEEE80211A; |
534 | status.freq = chanid; | 534 | B43_WARN_ON(1); |
535 | status.channel = b43_freq_to_channel_a(chanid); | 535 | /* FIXME: We don't really know which value the "chanid" contains. |
536 | break; | 536 | * So the following assignment might be wrong. */ |
537 | case B43_PHYTYPE_B: | 537 | status.channel = chanid; |
538 | status.phymode = MODE_IEEE80211B; | 538 | status.freq = b43_channel_to_freq_5ghz(status.channel); |
539 | status.freq = chanid + 2400; | ||
540 | status.channel = b43_freq_to_channel_bg(chanid + 2400); | ||
541 | break; | 539 | break; |
542 | case B43_PHYTYPE_G: | 540 | case B43_PHYTYPE_G: |
543 | status.phymode = MODE_IEEE80211G; | 541 | status.phymode = MODE_IEEE80211G; |
542 | /* chanid is the radio channel cookie value as used | ||
543 | * to tune the radio. */ | ||
544 | status.freq = chanid + 2400; | 544 | status.freq = chanid + 2400; |
545 | status.channel = b43_freq_to_channel_bg(chanid + 2400); | 545 | status.channel = b43_freq_to_channel_2ghz(status.freq); |
546 | break; | ||
547 | case B43_PHYTYPE_N: | ||
548 | status.phymode = 0xDEAD /*FIXME MODE_IEEE80211N*/; | ||
549 | /* chanid is the SHM channel cookie. Which is the plain | ||
550 | * channel number in b43. */ | ||
551 | status.channel = chanid; | ||
552 | if (chanstat & B43_RX_CHAN_5GHZ) | ||
553 | status.freq = b43_freq_to_channel_5ghz(status.freq); | ||
554 | else | ||
555 | status.freq = b43_freq_to_channel_2ghz(status.freq); | ||
546 | break; | 556 | break; |
547 | default: | 557 | default: |
548 | B43_WARN_ON(1); | 558 | B43_WARN_ON(1); |
559 | goto drop; | ||
549 | } | 560 | } |
550 | 561 | ||
551 | dev->stats.last_rx = jiffies; | 562 | dev->stats.last_rx = jiffies; |
diff --git a/drivers/net/wireless/b43/xmit.h b/drivers/net/wireless/b43/xmit.h index 03bddd251618..6dc079382f7f 100644 --- a/drivers/net/wireless/b43/xmit.h +++ b/drivers/net/wireless/b43/xmit.h | |||
@@ -142,49 +142,56 @@ struct b43_rxhdr_fw4 { | |||
142 | } __attribute__ ((__packed__)); | 142 | } __attribute__ ((__packed__)); |
143 | 143 | ||
144 | /* PHY RX Status 0 */ | 144 | /* PHY RX Status 0 */ |
145 | #define B43_RX_PHYST0_GAINCTL 0x4000 /* Gain Control */ | 145 | #define B43_RX_PHYST0_GAINCTL 0x4000 /* Gain Control */ |
146 | #define B43_RX_PHYST0_PLCPHCF 0x0200 | 146 | #define B43_RX_PHYST0_PLCPHCF 0x0200 |
147 | #define B43_RX_PHYST0_PLCPFV 0x0100 | 147 | #define B43_RX_PHYST0_PLCPFV 0x0100 |
148 | #define B43_RX_PHYST0_SHORTPRMBL 0x0080 /* Received with Short Preamble */ | 148 | #define B43_RX_PHYST0_SHORTPRMBL 0x0080 /* Received with Short Preamble */ |
149 | #define B43_RX_PHYST0_LCRS 0x0040 | 149 | #define B43_RX_PHYST0_LCRS 0x0040 |
150 | #define B43_RX_PHYST0_ANT 0x0020 /* Antenna */ | 150 | #define B43_RX_PHYST0_ANT 0x0020 /* Antenna */ |
151 | #define B43_RX_PHYST0_UNSRATE 0x0010 | 151 | #define B43_RX_PHYST0_UNSRATE 0x0010 |
152 | #define B43_RX_PHYST0_CLIP 0x000C | 152 | #define B43_RX_PHYST0_CLIP 0x000C |
153 | #define B43_RX_PHYST0_CLIP_SHIFT 2 | 153 | #define B43_RX_PHYST0_CLIP_SHIFT 2 |
154 | #define B43_RX_PHYST0_FTYPE 0x0003 /* Frame type */ | 154 | #define B43_RX_PHYST0_FTYPE 0x0003 /* Frame type */ |
155 | #define B43_RX_PHYST0_CCK 0x0000 /* Frame type: CCK */ | 155 | #define B43_RX_PHYST0_CCK 0x0000 /* Frame type: CCK */ |
156 | #define B43_RX_PHYST0_OFDM 0x0001 /* Frame type: OFDM */ | 156 | #define B43_RX_PHYST0_OFDM 0x0001 /* Frame type: OFDM */ |
157 | #define B43_RX_PHYST0_PRE_N 0x0002 /* Pre-standard N-PHY frame */ | 157 | #define B43_RX_PHYST0_PRE_N 0x0002 /* Pre-standard N-PHY frame */ |
158 | #define B43_RX_PHYST0_STD_N 0x0003 /* Standard N-PHY frame */ | 158 | #define B43_RX_PHYST0_STD_N 0x0003 /* Standard N-PHY frame */ |
159 | 159 | ||
160 | /* PHY RX Status 2 */ | 160 | /* PHY RX Status 2 */ |
161 | #define B43_RX_PHYST2_LNAG 0xC000 /* LNA Gain */ | 161 | #define B43_RX_PHYST2_LNAG 0xC000 /* LNA Gain */ |
162 | #define B43_RX_PHYST2_LNAG_SHIFT 14 | 162 | #define B43_RX_PHYST2_LNAG_SHIFT 14 |
163 | #define B43_RX_PHYST2_PNAG 0x3C00 /* PNA Gain */ | 163 | #define B43_RX_PHYST2_PNAG 0x3C00 /* PNA Gain */ |
164 | #define B43_RX_PHYST2_PNAG_SHIFT 10 | 164 | #define B43_RX_PHYST2_PNAG_SHIFT 10 |
165 | #define B43_RX_PHYST2_FOFF 0x03FF /* F offset */ | 165 | #define B43_RX_PHYST2_FOFF 0x03FF /* F offset */ |
166 | 166 | ||
167 | /* PHY RX Status 3 */ | 167 | /* PHY RX Status 3 */ |
168 | #define B43_RX_PHYST3_DIGG 0x1800 /* DIG Gain */ | 168 | #define B43_RX_PHYST3_DIGG 0x1800 /* DIG Gain */ |
169 | #define B43_RX_PHYST3_DIGG_SHIFT 11 | 169 | #define B43_RX_PHYST3_DIGG_SHIFT 11 |
170 | #define B43_RX_PHYST3_TRSTATE 0x0400 /* TR state */ | 170 | #define B43_RX_PHYST3_TRSTATE 0x0400 /* TR state */ |
171 | 171 | ||
172 | /* MAC RX Status */ | 172 | /* MAC RX Status */ |
173 | #define B43_RX_MAC_BEACONSENT 0x00008000 /* Beacon send flag */ | 173 | #define B43_RX_MAC_RXST_VALID 0x01000000 /* PHY RXST valid */ |
174 | #define B43_RX_MAC_KEYIDX 0x000007E0 /* Key index */ | 174 | #define B43_RX_MAC_TKIP_MICERR 0x00100000 /* TKIP MIC error */ |
175 | #define B43_RX_MAC_KEYIDX_SHIFT 5 | 175 | #define B43_RX_MAC_TKIP_MICATT 0x00080000 /* TKIP MIC attempted */ |
176 | #define B43_RX_MAC_DECERR 0x00000010 /* Decrypt error */ | 176 | #define B43_RX_MAC_AGGTYPE 0x00060000 /* Aggregation type */ |
177 | #define B43_RX_MAC_DEC 0x00000008 /* Decryption attempted */ | 177 | #define B43_RX_MAC_AGGTYPE_SHIFT 17 |
178 | #define B43_RX_MAC_PADDING 0x00000004 /* Pad bytes present */ | 178 | #define B43_RX_MAC_AMSDU 0x00010000 /* A-MSDU mask */ |
179 | #define B43_RX_MAC_RESP 0x00000002 /* Response frame transmitted */ | 179 | #define B43_RX_MAC_BEACONSENT 0x00008000 /* Beacon sent flag */ |
180 | #define B43_RX_MAC_FCSERR 0x00000001 /* FCS error */ | 180 | #define B43_RX_MAC_KEYIDX 0x000007E0 /* Key index */ |
181 | #define B43_RX_MAC_KEYIDX_SHIFT 5 | ||
182 | #define B43_RX_MAC_DECERR 0x00000010 /* Decrypt error */ | ||
183 | #define B43_RX_MAC_DEC 0x00000008 /* Decryption attempted */ | ||
184 | #define B43_RX_MAC_PADDING 0x00000004 /* Pad bytes present */ | ||
185 | #define B43_RX_MAC_RESP 0x00000002 /* Response frame transmitted */ | ||
186 | #define B43_RX_MAC_FCSERR 0x00000001 /* FCS error */ | ||
181 | 187 | ||
182 | /* RX channel */ | 188 | /* RX channel */ |
183 | #define B43_RX_CHAN_GAIN 0xFC00 /* Gain */ | 189 | #define B43_RX_CHAN_40MHZ 0x1000 /* 40 Mhz channel width */ |
184 | #define B43_RX_CHAN_GAIN_SHIFT 10 | 190 | #define B43_RX_CHAN_5GHZ 0x0800 /* 5 Ghz band */ |
185 | #define B43_RX_CHAN_ID 0x03FC /* Channel ID */ | 191 | #define B43_RX_CHAN_ID 0x07F8 /* Channel ID */ |
186 | #define B43_RX_CHAN_ID_SHIFT 2 | 192 | #define B43_RX_CHAN_ID_SHIFT 3 |
187 | #define B43_RX_CHAN_PHYTYPE 0x0003 /* PHY type */ | 193 | #define B43_RX_CHAN_PHYTYPE 0x0007 /* PHY type */ |
194 | |||
188 | 195 | ||
189 | u8 b43_plcp_get_ratecode_cck(const u8 bitrate); | 196 | u8 b43_plcp_get_ratecode_cck(const u8 bitrate); |
190 | u8 b43_plcp_get_ratecode_ofdm(const u8 bitrate); | 197 | u8 b43_plcp_get_ratecode_ofdm(const u8 bitrate); |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 2a8fc431099f..bca37bf0f545 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -852,11 +852,6 @@ static int xennet_poll(struct napi_struct *napi, int budget) | |||
852 | 852 | ||
853 | spin_lock(&np->rx_lock); | 853 | spin_lock(&np->rx_lock); |
854 | 854 | ||
855 | if (unlikely(!netif_carrier_ok(dev))) { | ||
856 | spin_unlock(&np->rx_lock); | ||
857 | return 0; | ||
858 | } | ||
859 | |||
860 | skb_queue_head_init(&rxq); | 855 | skb_queue_head_init(&rxq); |
861 | skb_queue_head_init(&errq); | 856 | skb_queue_head_init(&errq); |
862 | skb_queue_head_init(&tmpq); | 857 | skb_queue_head_init(&tmpq); |