diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/tulip/interrupt.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/tulip/interrupt.c')
-rw-r--r-- | drivers/net/tulip/interrupt.c | 125 |
1 files changed, 68 insertions, 57 deletions
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c index 1faf7a4d7202..5350d753e0ff 100644 --- a/drivers/net/tulip/interrupt.c +++ b/drivers/net/tulip/interrupt.c | |||
@@ -125,12 +125,12 @@ int tulip_poll(struct napi_struct *napi, int budget) | |||
125 | #endif | 125 | #endif |
126 | 126 | ||
127 | if (tulip_debug > 4) | 127 | if (tulip_debug > 4) |
128 | printk(KERN_DEBUG " In tulip_rx(), entry %d %08x\n", | 128 | netdev_dbg(dev, " In tulip_rx(), entry %d %08x\n", |
129 | entry, tp->rx_ring[entry].status); | 129 | entry, tp->rx_ring[entry].status); |
130 | 130 | ||
131 | do { | 131 | do { |
132 | if (ioread32(tp->base_addr + CSR5) == 0xffffffff) { | 132 | if (ioread32(tp->base_addr + CSR5) == 0xffffffff) { |
133 | printk(KERN_DEBUG " In tulip_poll(), hardware disappeared\n"); | 133 | netdev_dbg(dev, " In tulip_poll(), hardware disappeared\n"); |
134 | break; | 134 | break; |
135 | } | 135 | } |
136 | /* Acknowledge current RX interrupt sources. */ | 136 | /* Acknowledge current RX interrupt sources. */ |
@@ -145,9 +145,9 @@ int tulip_poll(struct napi_struct *napi, int budget) | |||
145 | if (tp->dirty_rx + RX_RING_SIZE == tp->cur_rx) | 145 | if (tp->dirty_rx + RX_RING_SIZE == tp->cur_rx) |
146 | break; | 146 | break; |
147 | 147 | ||
148 | if (tulip_debug > 5) | 148 | if (tulip_debug > 5) |
149 | printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %08x\n", | 149 | netdev_dbg(dev, "In tulip_rx(), entry %d %08x\n", |
150 | dev->name, entry, status); | 150 | entry, status); |
151 | 151 | ||
152 | if (++work_done >= budget) | 152 | if (++work_done >= budget) |
153 | goto not_done; | 153 | goto not_done; |
@@ -180,21 +180,24 @@ int tulip_poll(struct napi_struct *napi, int budget) | |||
180 | dev_warn(&dev->dev, | 180 | dev_warn(&dev->dev, |
181 | "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", | 181 | "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", |
182 | status); | 182 | status); |
183 | tp->stats.rx_length_errors++; | 183 | dev->stats.rx_length_errors++; |
184 | } | 184 | } |
185 | } else { | 185 | } else { |
186 | /* There was a fatal error. */ | 186 | /* There was a fatal error. */ |
187 | if (tulip_debug > 2) | 187 | if (tulip_debug > 2) |
188 | printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n", | 188 | netdev_dbg(dev, "Receive error, Rx status %08x\n", |
189 | dev->name, status); | 189 | status); |
190 | tp->stats.rx_errors++; /* end of a packet.*/ | 190 | dev->stats.rx_errors++; /* end of a packet.*/ |
191 | if (pkt_len > 1518 || | 191 | if (pkt_len > 1518 || |
192 | (status & RxDescRunt)) | 192 | (status & RxDescRunt)) |
193 | tp->stats.rx_length_errors++; | 193 | dev->stats.rx_length_errors++; |
194 | 194 | ||
195 | if (status & 0x0004) tp->stats.rx_frame_errors++; | 195 | if (status & 0x0004) |
196 | if (status & 0x0002) tp->stats.rx_crc_errors++; | 196 | dev->stats.rx_frame_errors++; |
197 | if (status & 0x0001) tp->stats.rx_fifo_errors++; | 197 | if (status & 0x0002) |
198 | dev->stats.rx_crc_errors++; | ||
199 | if (status & 0x0001) | ||
200 | dev->stats.rx_fifo_errors++; | ||
198 | } | 201 | } |
199 | } else { | 202 | } else { |
200 | struct sk_buff *skb; | 203 | struct sk_buff *skb; |
@@ -244,8 +247,8 @@ int tulip_poll(struct napi_struct *napi, int budget) | |||
244 | 247 | ||
245 | netif_receive_skb(skb); | 248 | netif_receive_skb(skb); |
246 | 249 | ||
247 | tp->stats.rx_packets++; | 250 | dev->stats.rx_packets++; |
248 | tp->stats.rx_bytes += pkt_len; | 251 | dev->stats.rx_bytes += pkt_len; |
249 | } | 252 | } |
250 | #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION | 253 | #ifdef CONFIG_TULIP_NAPI_HW_MITIGATION |
251 | received++; | 254 | received++; |
@@ -364,16 +367,16 @@ static int tulip_rx(struct net_device *dev) | |||
364 | int received = 0; | 367 | int received = 0; |
365 | 368 | ||
366 | if (tulip_debug > 4) | 369 | if (tulip_debug > 4) |
367 | printk(KERN_DEBUG " In tulip_rx(), entry %d %08x\n", | 370 | netdev_dbg(dev, "In tulip_rx(), entry %d %08x\n", |
368 | entry, tp->rx_ring[entry].status); | 371 | entry, tp->rx_ring[entry].status); |
369 | /* If we own the next entry, it is a new packet. Send it up. */ | 372 | /* If we own the next entry, it is a new packet. Send it up. */ |
370 | while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) { | 373 | while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) { |
371 | s32 status = le32_to_cpu(tp->rx_ring[entry].status); | 374 | s32 status = le32_to_cpu(tp->rx_ring[entry].status); |
372 | short pkt_len; | 375 | short pkt_len; |
373 | 376 | ||
374 | if (tulip_debug > 5) | 377 | if (tulip_debug > 5) |
375 | printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %08x\n", | 378 | netdev_dbg(dev, "In tulip_rx(), entry %d %08x\n", |
376 | dev->name, entry, status); | 379 | entry, status); |
377 | if (--rx_work_limit < 0) | 380 | if (--rx_work_limit < 0) |
378 | break; | 381 | break; |
379 | 382 | ||
@@ -401,23 +404,26 @@ static int tulip_rx(struct net_device *dev) | |||
401 | /* Ingore earlier buffers. */ | 404 | /* Ingore earlier buffers. */ |
402 | if ((status & 0xffff) != 0x7fff) { | 405 | if ((status & 0xffff) != 0x7fff) { |
403 | if (tulip_debug > 1) | 406 | if (tulip_debug > 1) |
404 | dev_warn(&dev->dev, | 407 | netdev_warn(dev, |
405 | "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", | 408 | "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", |
406 | status); | 409 | status); |
407 | tp->stats.rx_length_errors++; | 410 | dev->stats.rx_length_errors++; |
408 | } | 411 | } |
409 | } else { | 412 | } else { |
410 | /* There was a fatal error. */ | 413 | /* There was a fatal error. */ |
411 | if (tulip_debug > 2) | 414 | if (tulip_debug > 2) |
412 | printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n", | 415 | netdev_dbg(dev, "Receive error, Rx status %08x\n", |
413 | dev->name, status); | 416 | status); |
414 | tp->stats.rx_errors++; /* end of a packet.*/ | 417 | dev->stats.rx_errors++; /* end of a packet.*/ |
415 | if (pkt_len > 1518 || | 418 | if (pkt_len > 1518 || |
416 | (status & RxDescRunt)) | 419 | (status & RxDescRunt)) |
417 | tp->stats.rx_length_errors++; | 420 | dev->stats.rx_length_errors++; |
418 | if (status & 0x0004) tp->stats.rx_frame_errors++; | 421 | if (status & 0x0004) |
419 | if (status & 0x0002) tp->stats.rx_crc_errors++; | 422 | dev->stats.rx_frame_errors++; |
420 | if (status & 0x0001) tp->stats.rx_fifo_errors++; | 423 | if (status & 0x0002) |
424 | dev->stats.rx_crc_errors++; | ||
425 | if (status & 0x0001) | ||
426 | dev->stats.rx_fifo_errors++; | ||
421 | } | 427 | } |
422 | } else { | 428 | } else { |
423 | struct sk_buff *skb; | 429 | struct sk_buff *skb; |
@@ -467,8 +473,8 @@ static int tulip_rx(struct net_device *dev) | |||
467 | 473 | ||
468 | netif_rx(skb); | 474 | netif_rx(skb); |
469 | 475 | ||
470 | tp->stats.rx_packets++; | 476 | dev->stats.rx_packets++; |
471 | tp->stats.rx_bytes += pkt_len; | 477 | dev->stats.rx_bytes += pkt_len; |
472 | } | 478 | } |
473 | received++; | 479 | received++; |
474 | entry = (++tp->cur_rx) % RX_RING_SIZE; | 480 | entry = (++tp->cur_rx) % RX_RING_SIZE; |
@@ -567,8 +573,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) | |||
567 | #endif /* CONFIG_TULIP_NAPI */ | 573 | #endif /* CONFIG_TULIP_NAPI */ |
568 | 574 | ||
569 | if (tulip_debug > 4) | 575 | if (tulip_debug > 4) |
570 | printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x\n", | 576 | netdev_dbg(dev, "interrupt csr5=%#8.8x new csr5=%#8.8x\n", |
571 | dev->name, csr5, ioread32(ioaddr + CSR5)); | 577 | csr5, ioread32(ioaddr + CSR5)); |
572 | 578 | ||
573 | 579 | ||
574 | if (csr5 & (TxNoBuf | TxDied | TxIntr | TimerInt)) { | 580 | if (csr5 & (TxNoBuf | TxDied | TxIntr | TimerInt)) { |
@@ -599,21 +605,25 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) | |||
599 | /* There was an major error, log it. */ | 605 | /* There was an major error, log it. */ |
600 | #ifndef final_version | 606 | #ifndef final_version |
601 | if (tulip_debug > 1) | 607 | if (tulip_debug > 1) |
602 | printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n", | 608 | netdev_dbg(dev, "Transmit error, Tx status %08x\n", |
603 | dev->name, status); | 609 | status); |
604 | #endif | 610 | #endif |
605 | tp->stats.tx_errors++; | 611 | dev->stats.tx_errors++; |
606 | if (status & 0x4104) tp->stats.tx_aborted_errors++; | 612 | if (status & 0x4104) |
607 | if (status & 0x0C00) tp->stats.tx_carrier_errors++; | 613 | dev->stats.tx_aborted_errors++; |
608 | if (status & 0x0200) tp->stats.tx_window_errors++; | 614 | if (status & 0x0C00) |
609 | if (status & 0x0002) tp->stats.tx_fifo_errors++; | 615 | dev->stats.tx_carrier_errors++; |
616 | if (status & 0x0200) | ||
617 | dev->stats.tx_window_errors++; | ||
618 | if (status & 0x0002) | ||
619 | dev->stats.tx_fifo_errors++; | ||
610 | if ((status & 0x0080) && tp->full_duplex == 0) | 620 | if ((status & 0x0080) && tp->full_duplex == 0) |
611 | tp->stats.tx_heartbeat_errors++; | 621 | dev->stats.tx_heartbeat_errors++; |
612 | } else { | 622 | } else { |
613 | tp->stats.tx_bytes += | 623 | dev->stats.tx_bytes += |
614 | tp->tx_buffers[entry].skb->len; | 624 | tp->tx_buffers[entry].skb->len; |
615 | tp->stats.collisions += (status >> 3) & 15; | 625 | dev->stats.collisions += (status >> 3) & 15; |
616 | tp->stats.tx_packets++; | 626 | dev->stats.tx_packets++; |
617 | } | 627 | } |
618 | 628 | ||
619 | pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping, | 629 | pci_unmap_single(tp->pdev, tp->tx_buffers[entry].mapping, |
@@ -655,7 +665,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) | |||
655 | if (csr5 & AbnormalIntr) { /* Abnormal error summary bit. */ | 665 | if (csr5 & AbnormalIntr) { /* Abnormal error summary bit. */ |
656 | if (csr5 == 0xffffffff) | 666 | if (csr5 == 0xffffffff) |
657 | break; | 667 | break; |
658 | if (csr5 & TxJabber) tp->stats.tx_errors++; | 668 | if (csr5 & TxJabber) |
669 | dev->stats.tx_errors++; | ||
659 | if (csr5 & TxFIFOUnderflow) { | 670 | if (csr5 & TxFIFOUnderflow) { |
660 | if ((tp->csr6 & 0xC000) != 0xC000) | 671 | if ((tp->csr6 & 0xC000) != 0xC000) |
661 | tp->csr6 += 0x4000; /* Bump up the Tx threshold */ | 672 | tp->csr6 += 0x4000; /* Bump up the Tx threshold */ |
@@ -672,8 +683,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) | |||
672 | } | 683 | } |
673 | } | 684 | } |
674 | if (csr5 & RxDied) { /* Missed a Rx frame. */ | 685 | if (csr5 & RxDied) { /* Missed a Rx frame. */ |
675 | tp->stats.rx_missed_errors += ioread32(ioaddr + CSR8) & 0xffff; | 686 | dev->stats.rx_missed_errors += ioread32(ioaddr + CSR8) & 0xffff; |
676 | tp->stats.rx_errors++; | 687 | dev->stats.rx_errors++; |
677 | tulip_start_rxtx(tp); | 688 | tulip_start_rxtx(tp); |
678 | } | 689 | } |
679 | /* | 690 | /* |
@@ -789,12 +800,12 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) | |||
789 | #endif /* CONFIG_TULIP_NAPI */ | 800 | #endif /* CONFIG_TULIP_NAPI */ |
790 | 801 | ||
791 | if ((missed = ioread32(ioaddr + CSR8) & 0x1ffff)) { | 802 | if ((missed = ioread32(ioaddr + CSR8) & 0x1ffff)) { |
792 | tp->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed; | 803 | dev->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed; |
793 | } | 804 | } |
794 | 805 | ||
795 | if (tulip_debug > 4) | 806 | if (tulip_debug > 4) |
796 | printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#04x\n", | 807 | netdev_dbg(dev, "exiting interrupt, csr5=%#04x\n", |
797 | dev->name, ioread32(ioaddr + CSR5)); | 808 | ioread32(ioaddr + CSR5)); |
798 | 809 | ||
799 | return IRQ_HANDLED; | 810 | return IRQ_HANDLED; |
800 | } | 811 | } |