aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFlorian Fainelli <florian.fainelli@telecomint.eu>2008-07-13 08:35:32 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-22 19:59:46 -0400
commite24ddf3aa8a2c4c14df1136e762c315c436488e7 (patch)
treea55450bc8f3ce7250ceb9dca2875239e438ffcdb /drivers
parent31718dedf62fd62e807001138ab5ac76e9b11064 (diff)
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 <florian.fainelli@telecomint.eu> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/r6040.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index b68781d35928..99dbe4633fc7 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -163,9 +163,9 @@ MODULE_LICENSE("GPL");
163MODULE_DESCRIPTION("RDC R6040 NAPI PCI FastEthernet driver"); 163MODULE_DESCRIPTION("RDC R6040 NAPI PCI FastEthernet driver");
164 164
165/* RX and TX interrupts that we handle */ 165/* RX and TX interrupts that we handle */
166#define RX_INT (RX_FINISH) 166#define RX_INTS (RX_FIFO_FULL | RX_NO_DESC | RX_FINISH)
167#define TX_INT (TX_FINISH) 167#define TX_INTS (TX_FINISH)
168#define INT_MASK (RX_INT | TX_INT) 168#define INT_MASK (RX_INTS | TX_INTS)
169 169
170struct r6040_descriptor { 170struct r6040_descriptor {
171 u16 status, len; /* 0-3 */ 171 u16 status, len; /* 0-3 */
@@ -671,7 +671,7 @@ static int r6040_poll(struct napi_struct *napi, int budget)
671 if (work_done < budget) { 671 if (work_done < budget) {
672 netif_rx_complete(dev, napi); 672 netif_rx_complete(dev, napi);
673 /* Enable RX interrupt */ 673 /* Enable RX interrupt */
674 iowrite16(ioread16(ioaddr + MIER) | RX_INT, ioaddr + MIER); 674 iowrite16(ioread16(ioaddr + MIER) | RX_INTS, ioaddr + MIER);
675 } 675 }
676 return work_done; 676 return work_done;
677} 677}
@@ -693,14 +693,22 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
693 return IRQ_NONE; 693 return IRQ_NONE;
694 694
695 /* RX interrupt request */ 695 /* 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
697 /* Mask off RX interrupt */ 705 /* Mask off RX interrupt */
698 iowrite16(ioread16(ioaddr + MIER) & ~RX_INT, ioaddr + MIER); 706 iowrite16(ioread16(ioaddr + MIER) & ~RX_INTS, ioaddr + MIER);
699 netif_rx_schedule(dev, &lp->napi); 707 netif_rx_schedule(dev, &lp->napi);
700 } 708 }
701 709
702 /* TX interrupt request */ 710 /* TX interrupt request */
703 if (status & 0x10) 711 if (status & TX_INTS)
704 r6040_tx(dev); 712 r6040_tx(dev);
705 713
706 return IRQ_HANDLED; 714 return IRQ_HANDLED;