Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 49031
b: refs/heads/master
c: 538cc7e
h: refs/heads/master
i:
  49029: afcf915
  49027: c098b67
  49023: bd37e83
v: v3
  • Loading branch information
Sergei Shtylyov authored and Jeff Garzik committed Feb 17, 2007
1 parent 8a9897e commit 7a4fc61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 71 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 825811749b00f670b53e35ed342d5dc10d71c9de
refs/heads/master: 538cc7ee7dddaedf9442f32ec4cc617a070ef341
85 changes: 15 additions & 70 deletions trunk/drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Maintainer: Kumar Gala
*
* Copyright (c) 2002-2006 Freescale Semiconductor, Inc.
* Copyright (c) 2007 MontaVista Software, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -1612,71 +1613,17 @@ static irqreturn_t gfar_interrupt(int irq, void *dev_id)
/* Save ievent for future reference */
u32 events = gfar_read(&priv->regs->ievent);

/* Clear IEVENT */
gfar_write(&priv->regs->ievent, events);

/* Check for reception */
if ((events & IEVENT_RXF0) || (events & IEVENT_RXB0))
if (events & IEVENT_RX_MASK)
gfar_receive(irq, dev_id);

/* Check for transmit completion */
if ((events & IEVENT_TXF) || (events & IEVENT_TXB))
if (events & IEVENT_TX_MASK)
gfar_transmit(irq, dev_id);

/* Update error statistics */
if (events & IEVENT_TXE) {
priv->stats.tx_errors++;

if (events & IEVENT_LC)
priv->stats.tx_window_errors++;
if (events & IEVENT_CRL)
priv->stats.tx_aborted_errors++;
if (events & IEVENT_XFUN) {
if (netif_msg_tx_err(priv))
printk(KERN_WARNING "%s: tx underrun. dropped packet\n", dev->name);
priv->stats.tx_dropped++;
priv->extra_stats.tx_underrun++;

/* Reactivate the Tx Queues */
gfar_write(&priv->regs->tstat, TSTAT_CLEAR_THALT);
}
}
if (events & IEVENT_BSY) {
priv->stats.rx_errors++;
priv->extra_stats.rx_bsy++;

gfar_receive(irq, dev_id);

#ifndef CONFIG_GFAR_NAPI
/* Clear the halt bit in RSTAT */
gfar_write(&priv->regs->rstat, RSTAT_CLEAR_RHALT);
#endif

if (netif_msg_rx_err(priv))
printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n",
dev->name,
gfar_read(&priv->regs->rstat));
}
if (events & IEVENT_BABR) {
priv->stats.rx_errors++;
priv->extra_stats.rx_babr++;

if (netif_msg_rx_err(priv))
printk(KERN_DEBUG "%s: babbling error\n", dev->name);
}
if (events & IEVENT_EBERR) {
priv->extra_stats.eberr++;
if (netif_msg_rx_err(priv))
printk(KERN_DEBUG "%s: EBERR\n", dev->name);
}
if ((events & IEVENT_RXC) && (netif_msg_rx_err(priv)))
printk(KERN_DEBUG "%s: control frame\n", dev->name);

if (events & IEVENT_BABT) {
priv->extra_stats.tx_babt++;
if (netif_msg_rx_err(priv))
printk(KERN_DEBUG "%s: babt error\n", dev->name);
}
/* Check for errors */
if (events & IEVENT_ERR_MASK)
gfar_error(irq, dev_id);

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -1938,7 +1885,7 @@ static irqreturn_t gfar_error(int irq, void *dev_id)
/* Hmm... */
if (netif_msg_rx_err(priv) || netif_msg_tx_err(priv))
printk(KERN_DEBUG "%s: error interrupt (ievent=0x%08x imask=0x%08x)\n",
dev->name, events, gfar_read(&priv->regs->imask));
dev->name, events, gfar_read(&priv->regs->imask));

/* Update the error counters */
if (events & IEVENT_TXE) {
Expand All @@ -1950,8 +1897,8 @@ static irqreturn_t gfar_error(int irq, void *dev_id)
priv->stats.tx_aborted_errors++;
if (events & IEVENT_XFUN) {
if (netif_msg_tx_err(priv))
printk(KERN_DEBUG "%s: underrun. packet dropped.\n",
dev->name);
printk(KERN_DEBUG "%s: TX FIFO underrun, "
"packet dropped.\n", dev->name);
priv->stats.tx_dropped++;
priv->extra_stats.tx_underrun++;

Expand All @@ -1973,30 +1920,28 @@ static irqreturn_t gfar_error(int irq, void *dev_id)
#endif

if (netif_msg_rx_err(priv))
printk(KERN_DEBUG "%s: busy error (rhalt: %x)\n",
dev->name,
gfar_read(&priv->regs->rstat));
printk(KERN_DEBUG "%s: busy error (rstat: %x)\n",
dev->name, gfar_read(&priv->regs->rstat));
}
if (events & IEVENT_BABR) {
priv->stats.rx_errors++;
priv->extra_stats.rx_babr++;

if (netif_msg_rx_err(priv))
printk(KERN_DEBUG "%s: babbling error\n", dev->name);
printk(KERN_DEBUG "%s: babbling RX error\n", dev->name);
}
if (events & IEVENT_EBERR) {
priv->extra_stats.eberr++;
if (netif_msg_rx_err(priv))
printk(KERN_DEBUG "%s: EBERR\n", dev->name);
printk(KERN_DEBUG "%s: bus error\n", dev->name);
}
if ((events & IEVENT_RXC) && netif_msg_rx_status(priv))
if (netif_msg_rx_status(priv))
printk(KERN_DEBUG "%s: control frame\n", dev->name);
printk(KERN_DEBUG "%s: control frame\n", dev->name);

if (events & IEVENT_BABT) {
priv->extra_stats.tx_babt++;
if (netif_msg_tx_err(priv))
printk(KERN_DEBUG "%s: babt error\n", dev->name);
printk(KERN_DEBUG "%s: babbling TX error\n", dev->name);
}
return IRQ_HANDLED;
}
Expand Down

0 comments on commit 7a4fc61

Please sign in to comment.