Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21279
b: refs/heads/master
c: e72fd96
h: refs/heads/master
i:
  21277: 0cc0dc3
  21275: 2653483
  21271: 75905b3
  21263: b845e60
  21247: 08586e6
v: v3
  • Loading branch information
Mark Brown authored and Jeff Garzik committed Mar 4, 2006
1 parent 3a5954e commit 46f16d9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b27a16b7c4738ea16f6f0730caf382a3f57317bb
refs/heads/master: e72fd96e8ee3ff4dd80757172a4fe49bd92fea9c
42 changes: 42 additions & 0 deletions trunk/drivers/net/natsemi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,31 @@ static void natsemi_reset(struct net_device *dev)
writel(rfcr, ioaddr + RxFilterAddr);
}

static void reset_rx(struct net_device *dev)
{
int i;
struct netdev_private *np = netdev_priv(dev);
void __iomem *ioaddr = ns_ioaddr(dev);

np->intr_status &= ~RxResetDone;

writel(RxReset, ioaddr + ChipCmd);

for (i=0;i<NATSEMI_HW_TIMEOUT;i++) {
np->intr_status |= readl(ioaddr + IntrStatus);
if (np->intr_status & RxResetDone)
break;
udelay(15);
}
if (i==NATSEMI_HW_TIMEOUT) {
printk(KERN_WARNING "%s: RX reset did not complete in %d usec.\n",
dev->name, i*15);
} else if (netif_msg_hw(np)) {
printk(KERN_WARNING "%s: RX reset took %d usec.\n",
dev->name, i*15);
}
}

static void natsemi_reload_eeprom(struct net_device *dev)
{
struct netdev_private *np = netdev_priv(dev);
Expand Down Expand Up @@ -2292,6 +2317,23 @@ static void netdev_rx(struct net_device *dev, int *work_done, int work_to_do)
"status %#08x.\n", dev->name,
np->cur_rx, desc_status);
np->stats.rx_length_errors++;

/* The RX state machine has probably
* locked up beneath us. Follow the
* reset procedure documented in
* AN-1287. */

spin_lock_irq(&np->lock);
reset_rx(dev);
reinit_rx(dev);
writel(np->ring_dma, ioaddr + RxRingPtr);
check_link(dev);
spin_unlock_irq(&np->lock);

/* We'll enable RX on exit from this
* function. */
break;

} else {
/* There was an error. */
np->stats.rx_errors++;
Expand Down

0 comments on commit 46f16d9

Please sign in to comment.