Skip to content

Commit e24ddf3

Browse files
Florian FainelliJeff Garzik
authored andcommitted
r6040: handle RX fifo full and no descriptor interrupts
This patch allows the MAC to handle the RX FIFO full and no descriptor available interrupts. While we are at it replace the TX interrupt with its corresponding definition. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Jeff Garzik <[email protected]>
1 parent 31718de commit e24ddf3

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

drivers/net/r6040.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ MODULE_LICENSE("GPL");
163163
MODULE_DESCRIPTION("RDC R6040 NAPI PCI FastEthernet driver");
164164

165165
/* RX and TX interrupts that we handle */
166-
#define RX_INT (RX_FINISH)
167-
#define TX_INT (TX_FINISH)
168-
#define INT_MASK (RX_INT | TX_INT)
166+
#define RX_INTS (RX_FIFO_FULL | RX_NO_DESC | RX_FINISH)
167+
#define TX_INTS (TX_FINISH)
168+
#define INT_MASK (RX_INTS | TX_INTS)
169169

170170
struct r6040_descriptor {
171171
u16 status, len; /* 0-3 */
@@ -671,7 +671,7 @@ static int r6040_poll(struct napi_struct *napi, int budget)
671671
if (work_done < budget) {
672672
netif_rx_complete(dev, napi);
673673
/* Enable RX interrupt */
674-
iowrite16(ioread16(ioaddr + MIER) | RX_INT, ioaddr + MIER);
674+
iowrite16(ioread16(ioaddr + MIER) | RX_INTS, ioaddr + MIER);
675675
}
676676
return work_done;
677677
}
@@ -693,14 +693,22 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
693693
return IRQ_NONE;
694694

695695
/* RX interrupt request */
696-
if (status & 0x01) {
696+
if (status & RX_INTS) {
697+
if (status & RX_NO_DESC) {
698+
/* RX descriptor unavailable */
699+
dev->stats.rx_dropped++;
700+
dev->stats.rx_missed_errors++;
701+
}
702+
if (status & RX_FIFO_FULL)
703+
dev->stats.rx_fifo_errors++;
704+
697705
/* Mask off RX interrupt */
698-
iowrite16(ioread16(ioaddr + MIER) & ~RX_INT, ioaddr + MIER);
706+
iowrite16(ioread16(ioaddr + MIER) & ~RX_INTS, ioaddr + MIER);
699707
netif_rx_schedule(dev, &lp->napi);
700708
}
701709

702710
/* TX interrupt request */
703-
if (status & 0x10)
711+
if (status & TX_INTS)
704712
r6040_tx(dev);
705713

706714
return IRQ_HANDLED;

0 commit comments

Comments
 (0)