aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/natsemi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/natsemi.c')
-rw-r--r--drivers/net/natsemi.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index e363f9bb35ea..8d4999837b65 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -1498,6 +1498,31 @@ static void natsemi_reset(struct net_device *dev)
1498 writel(rfcr, ioaddr + RxFilterAddr); 1498 writel(rfcr, ioaddr + RxFilterAddr);
1499} 1499}
1500 1500
1501static void reset_rx(struct net_device *dev)
1502{
1503 int i;
1504 struct netdev_private *np = netdev_priv(dev);
1505 void __iomem *ioaddr = ns_ioaddr(dev);
1506
1507 np->intr_status &= ~RxResetDone;
1508
1509 writel(RxReset, ioaddr + ChipCmd);
1510
1511 for (i=0;i<NATSEMI_HW_TIMEOUT;i++) {
1512 np->intr_status |= readl(ioaddr + IntrStatus);
1513 if (np->intr_status & RxResetDone)
1514 break;
1515 udelay(15);
1516 }
1517 if (i==NATSEMI_HW_TIMEOUT) {
1518 printk(KERN_WARNING "%s: RX reset did not complete in %d usec.\n",
1519 dev->name, i*15);
1520 } else if (netif_msg_hw(np)) {
1521 printk(KERN_WARNING "%s: RX reset took %d usec.\n",
1522 dev->name, i*15);
1523 }
1524}
1525
1501static void natsemi_reload_eeprom(struct net_device *dev) 1526static void natsemi_reload_eeprom(struct net_device *dev)
1502{ 1527{
1503 struct netdev_private *np = netdev_priv(dev); 1528 struct netdev_private *np = netdev_priv(dev);
@@ -2292,6 +2317,23 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
2292 "status %#08x.\n", dev->name, 2317 "status %#08x.\n", dev->name,
2293 np->cur_rx, desc_status); 2318 np->cur_rx, desc_status);
2294 np->stats.rx_length_errors++; 2319 np->stats.rx_length_errors++;
2320
2321 /* The RX state machine has probably
2322 * locked up beneath us. Follow the
2323 * reset procedure documented in
2324 * AN-1287. */
2325
2326 spin_lock_irq(&np->lock);
2327 reset_rx(dev);
2328 reinit_rx(dev);
2329 writel(np->ring_dma, ioaddr + RxRingPtr);
2330 check_link(dev);
2331 spin_unlock_irq(&np->lock);
2332
2333 /* We'll enable RX on exit from this
2334 * function. */
2335 break;
2336
2295 } else { 2337 } else {
2296 /* There was an error. */ 2338 /* There was an error. */
2297 np->stats.rx_errors++; 2339 np->stats.rx_errors++;