Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 104949
b: refs/heads/master
c: e24ddf3
h: refs/heads/master
i:
  104947: 11c01a5
v: v3
  • Loading branch information
Florian Fainelli authored and Jeff Garzik committed Jul 22, 2008
1 parent 1968313 commit 7a2615e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 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: 31718dedf62fd62e807001138ab5ac76e9b11064
refs/heads/master: e24ddf3aa8a2c4c14df1136e762c315c436488e7
22 changes: 15 additions & 7 deletions trunk/drivers/net/r6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("RDC R6040 NAPI PCI FastEthernet driver");

/* RX and TX interrupts that we handle */
#define RX_INT (RX_FINISH)
#define TX_INT (TX_FINISH)
#define INT_MASK (RX_INT | TX_INT)
#define RX_INTS (RX_FIFO_FULL | RX_NO_DESC | RX_FINISH)
#define TX_INTS (TX_FINISH)
#define INT_MASK (RX_INTS | TX_INTS)

struct r6040_descriptor {
u16 status, len; /* 0-3 */
Expand Down Expand Up @@ -671,7 +671,7 @@ static int r6040_poll(struct napi_struct *napi, int budget)
if (work_done < budget) {
netif_rx_complete(dev, napi);
/* Enable RX interrupt */
iowrite16(ioread16(ioaddr + MIER) | RX_INT, ioaddr + MIER);
iowrite16(ioread16(ioaddr + MIER) | RX_INTS, ioaddr + MIER);
}
return work_done;
}
Expand All @@ -693,14 +693,22 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
return IRQ_NONE;

/* RX interrupt request */
if (status & 0x01) {
if (status & RX_INTS) {
if (status & RX_NO_DESC) {
/* RX descriptor unavailable */
dev->stats.rx_dropped++;
dev->stats.rx_missed_errors++;
}
if (status & RX_FIFO_FULL)
dev->stats.rx_fifo_errors++;

/* Mask off RX interrupt */
iowrite16(ioread16(ioaddr + MIER) & ~RX_INT, ioaddr + MIER);
iowrite16(ioread16(ioaddr + MIER) & ~RX_INTS, ioaddr + MIER);
netif_rx_schedule(dev, &lp->napi);
}

/* TX interrupt request */
if (status & 0x10)
if (status & TX_INTS)
r6040_tx(dev);

return IRQ_HANDLED;
Expand Down

0 comments on commit 7a2615e

Please sign in to comment.