aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-01-28 15:59:22 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-01 02:26:54 -0500
commitabe02af8263ae17e201994a1be7fc5eac6642acf (patch)
tree039aed4a17e8d39eab150e687d33291ec94d496d /drivers/net/tulip
parente9cd1cbcda5e21706b03b543b1b73600b07f323f (diff)
tulip/interrupt.c: Use dev_<level> and pr_<level>
Convert printks to dev_<level> where a dev is available Convert printks to pr_<level> where not Coalesce format strings Change print formats with %d.dx to %0dx Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/interrupt.c100
1 files changed, 53 insertions, 47 deletions
diff --git a/drivers/net/tulip/interrupt.c b/drivers/net/tulip/interrupt.c
index 2e8e8ee893c7..1faf7a4d7202 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 %8.8x.\n", entry, 128 printk(KERN_DEBUG " In tulip_rx(), entry %d %08x\n",
129 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 printk(KERN_DEBUG " In tulip_poll(), hardware disappeared\n");
134 break; 134 break;
135 } 135 }
136 /* Acknowledge current RX interrupt sources. */ 136 /* Acknowledge current RX interrupt sources. */
@@ -146,7 +146,7 @@ int tulip_poll(struct napi_struct *napi, int budget)
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 %8.8x.\n", 149 printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %08x\n",
150 dev->name, entry, status); 150 dev->name, entry, status);
151 151
152 if (++work_done >= budget) 152 if (++work_done >= budget)
@@ -177,15 +177,15 @@ int tulip_poll(struct napi_struct *napi, int budget)
177 /* Ingore earlier buffers. */ 177 /* Ingore earlier buffers. */
178 if ((status & 0xffff) != 0x7fff) { 178 if ((status & 0xffff) != 0x7fff) {
179 if (tulip_debug > 1) 179 if (tulip_debug > 1)
180 printk(KERN_WARNING "%s: Oversized Ethernet frame " 180 dev_warn(&dev->dev,
181 "spanned multiple buffers, status %8.8x!\n", 181 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
182 dev->name, status); 182 status);
183 tp->stats.rx_length_errors++; 183 tp->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 %8.8x.\n", 188 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
189 dev->name, status); 189 dev->name, status);
190 tp->stats.rx_errors++; /* end of a packet.*/ 190 tp->stats.rx_errors++; /* end of a packet.*/
191 if (pkt_len > 1518 || 191 if (pkt_len > 1518 ||
@@ -226,12 +226,11 @@ int tulip_poll(struct napi_struct *napi, int budget)
226#ifndef final_version 226#ifndef final_version
227 if (tp->rx_buffers[entry].mapping != 227 if (tp->rx_buffers[entry].mapping !=
228 le32_to_cpu(tp->rx_ring[entry].buffer1)) { 228 le32_to_cpu(tp->rx_ring[entry].buffer1)) {
229 printk(KERN_ERR "%s: Internal fault: The skbuff addresses " 229 dev_err(&dev->dev,
230 "do not match in tulip_rx: %08x vs. %08llx %p / %p.\n", 230 "Internal fault: The skbuff addresses do not match in tulip_rx: %08x vs. %08llx %p / %p\n",
231 dev->name, 231 le32_to_cpu(tp->rx_ring[entry].buffer1),
232 le32_to_cpu(tp->rx_ring[entry].buffer1), 232 (unsigned long long)tp->rx_buffers[entry].mapping,
233 (unsigned long long)tp->rx_buffers[entry].mapping, 233 skb->head, temp);
234 skb->head, temp);
235 } 234 }
236#endif 235#endif
237 236
@@ -365,16 +364,16 @@ static int tulip_rx(struct net_device *dev)
365 int received = 0; 364 int received = 0;
366 365
367 if (tulip_debug > 4) 366 if (tulip_debug > 4)
368 printk(KERN_DEBUG " In tulip_rx(), entry %d %8.8x.\n", entry, 367 printk(KERN_DEBUG " In tulip_rx(), entry %d %08x\n",
369 tp->rx_ring[entry].status); 368 entry, tp->rx_ring[entry].status);
370 /* If we own the next entry, it is a new packet. Send it up. */ 369 /* If we own the next entry, it is a new packet. Send it up. */
371 while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) { 370 while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) {
372 s32 status = le32_to_cpu(tp->rx_ring[entry].status); 371 s32 status = le32_to_cpu(tp->rx_ring[entry].status);
373 short pkt_len; 372 short pkt_len;
374 373
375 if (tulip_debug > 5) 374 if (tulip_debug > 5)
376 printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n", 375 printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %08x\n",
377 dev->name, entry, status); 376 dev->name, entry, status);
378 if (--rx_work_limit < 0) 377 if (--rx_work_limit < 0)
379 break; 378 break;
380 379
@@ -402,16 +401,16 @@ static int tulip_rx(struct net_device *dev)
402 /* Ingore earlier buffers. */ 401 /* Ingore earlier buffers. */
403 if ((status & 0xffff) != 0x7fff) { 402 if ((status & 0xffff) != 0x7fff) {
404 if (tulip_debug > 1) 403 if (tulip_debug > 1)
405 printk(KERN_WARNING "%s: Oversized Ethernet frame " 404 dev_warn(&dev->dev,
406 "spanned multiple buffers, status %8.8x!\n", 405 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
407 dev->name, status); 406 status);
408 tp->stats.rx_length_errors++; 407 tp->stats.rx_length_errors++;
409 } 408 }
410 } else { 409 } else {
411 /* There was a fatal error. */ 410 /* There was a fatal error. */
412 if (tulip_debug > 2) 411 if (tulip_debug > 2)
413 printk(KERN_DEBUG "%s: Receive error, Rx status %8.8x.\n", 412 printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
414 dev->name, status); 413 dev->name, status);
415 tp->stats.rx_errors++; /* end of a packet.*/ 414 tp->stats.rx_errors++; /* end of a packet.*/
416 if (pkt_len > 1518 || 415 if (pkt_len > 1518 ||
417 (status & RxDescRunt)) 416 (status & RxDescRunt))
@@ -450,12 +449,11 @@ static int tulip_rx(struct net_device *dev)
450#ifndef final_version 449#ifndef final_version
451 if (tp->rx_buffers[entry].mapping != 450 if (tp->rx_buffers[entry].mapping !=
452 le32_to_cpu(tp->rx_ring[entry].buffer1)) { 451 le32_to_cpu(tp->rx_ring[entry].buffer1)) {
453 printk(KERN_ERR "%s: Internal fault: The skbuff addresses " 452 dev_err(&dev->dev,
454 "do not match in tulip_rx: %08x vs. %Lx %p / %p.\n", 453 "Internal fault: The skbuff addresses do not match in tulip_rx: %08x vs. %Lx %p / %p\n",
455 dev->name, 454 le32_to_cpu(tp->rx_ring[entry].buffer1),
456 le32_to_cpu(tp->rx_ring[entry].buffer1), 455 (long long)tp->rx_buffers[entry].mapping,
457 (long long)tp->rx_buffers[entry].mapping, 456 skb->head, temp);
458 skb->head, temp);
459 } 457 }
460#endif 458#endif
461 459
@@ -569,7 +567,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
569#endif /* CONFIG_TULIP_NAPI */ 567#endif /* CONFIG_TULIP_NAPI */
570 568
571 if (tulip_debug > 4) 569 if (tulip_debug > 4)
572 printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x.\n", 570 printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x\n",
573 dev->name, csr5, ioread32(ioaddr + CSR5)); 571 dev->name, csr5, ioread32(ioaddr + CSR5));
574 572
575 573
@@ -601,8 +599,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
601 /* There was an major error, log it. */ 599 /* There was an major error, log it. */
602#ifndef final_version 600#ifndef final_version
603 if (tulip_debug > 1) 601 if (tulip_debug > 1)
604 printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n", 602 printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n",
605 dev->name, status); 603 dev->name, status);
606#endif 604#endif
607 tp->stats.tx_errors++; 605 tp->stats.tx_errors++;
608 if (status & 0x4104) tp->stats.tx_aborted_errors++; 606 if (status & 0x4104) tp->stats.tx_aborted_errors++;
@@ -631,8 +629,9 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
631 629
632#ifndef final_version 630#ifndef final_version
633 if (tp->cur_tx - dirty_tx > TX_RING_SIZE) { 631 if (tp->cur_tx - dirty_tx > TX_RING_SIZE) {
634 printk(KERN_ERR "%s: Out-of-sync dirty pointer, %d vs. %d.\n", 632 dev_err(&dev->dev,
635 dev->name, dirty_tx, tp->cur_tx); 633 "Out-of-sync dirty pointer, %d vs. %d\n",
634 dirty_tx, tp->cur_tx);
636 dirty_tx += TX_RING_SIZE; 635 dirty_tx += TX_RING_SIZE;
637 } 636 }
638#endif 637#endif
@@ -643,9 +642,10 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
643 tp->dirty_tx = dirty_tx; 642 tp->dirty_tx = dirty_tx;
644 if (csr5 & TxDied) { 643 if (csr5 & TxDied) {
645 if (tulip_debug > 2) 644 if (tulip_debug > 2)
646 printk(KERN_WARNING "%s: The transmitter stopped." 645 dev_warn(&dev->dev,
647 " CSR5 is %x, CSR6 %x, new CSR6 %x.\n", 646 "The transmitter stopped. CSR5 is %x, CSR6 %x, new CSR6 %x\n",
648 dev->name, csr5, ioread32(ioaddr + CSR6), tp->csr6); 647 csr5, ioread32(ioaddr + CSR6),
648 tp->csr6);
649 tulip_restart_rxtx(tp); 649 tulip_restart_rxtx(tp);
650 } 650 }
651 spin_unlock(&tp->lock); 651 spin_unlock(&tp->lock);
@@ -696,8 +696,9 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
696 * to the 21142/3 docs that is). 696 * to the 21142/3 docs that is).
697 * -- rmk 697 * -- rmk
698 */ 698 */
699 printk(KERN_ERR "%s: (%lu) System Error occurred (%d)\n", 699 dev_err(&dev->dev,
700 dev->name, tp->nir, error); 700 "(%lu) System Error occurred (%d)\n",
701 tp->nir, error);
701 } 702 }
702 /* Clear all error sources, included undocumented ones! */ 703 /* Clear all error sources, included undocumented ones! */
703 iowrite32(0x0800f7ba, ioaddr + CSR5); 704 iowrite32(0x0800f7ba, ioaddr + CSR5);
@@ -706,16 +707,17 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
706 if (csr5 & TimerInt) { 707 if (csr5 & TimerInt) {
707 708
708 if (tulip_debug > 2) 709 if (tulip_debug > 2)
709 printk(KERN_ERR "%s: Re-enabling interrupts, %8.8x.\n", 710 dev_err(&dev->dev,
710 dev->name, csr5); 711 "Re-enabling interrupts, %08x\n",
712 csr5);
711 iowrite32(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7); 713 iowrite32(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7);
712 tp->ttimer = 0; 714 tp->ttimer = 0;
713 oi++; 715 oi++;
714 } 716 }
715 if (tx > maxtx || rx > maxrx || oi > maxoi) { 717 if (tx > maxtx || rx > maxrx || oi > maxoi) {
716 if (tulip_debug > 1) 718 if (tulip_debug > 1)
717 printk(KERN_WARNING "%s: Too much work during an interrupt, " 719 dev_warn(&dev->dev, "Too much work during an interrupt, csr5=0x%08x. (%lu) (%d,%d,%d)\n",
718 "csr5=0x%8.8x. (%lu) (%d,%d,%d)\n", dev->name, csr5, tp->nir, tx, rx, oi); 720 csr5, tp->nir, tx, rx, oi);
719 721
720 /* Acknowledge all interrupt sources. */ 722 /* Acknowledge all interrupt sources. */
721 iowrite32(0x8001ffff, ioaddr + CSR5); 723 iowrite32(0x8001ffff, ioaddr + CSR5);
@@ -764,14 +766,18 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
764 entry = tp->dirty_rx % RX_RING_SIZE; 766 entry = tp->dirty_rx % RX_RING_SIZE;
765 if (tp->rx_buffers[entry].skb == NULL) { 767 if (tp->rx_buffers[entry].skb == NULL) {
766 if (tulip_debug > 1) 768 if (tulip_debug > 1)
767 printk(KERN_WARNING "%s: in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n", dev->name, tp->nir, tp->cur_rx, tp->ttimer, rx); 769 dev_warn(&dev->dev,
770 "in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n",
771 tp->nir, tp->cur_rx, tp->ttimer, rx);
768 if (tp->chip_id == LC82C168) { 772 if (tp->chip_id == LC82C168) {
769 iowrite32(0x00, ioaddr + CSR7); 773 iowrite32(0x00, ioaddr + CSR7);
770 mod_timer(&tp->timer, RUN_AT(HZ/50)); 774 mod_timer(&tp->timer, RUN_AT(HZ/50));
771 } else { 775 } else {
772 if (tp->ttimer == 0 || (ioread32(ioaddr + CSR11) & 0xffff) == 0) { 776 if (tp->ttimer == 0 || (ioread32(ioaddr + CSR11) & 0xffff) == 0) {
773 if (tulip_debug > 1) 777 if (tulip_debug > 1)
774 printk(KERN_WARNING "%s: in rx suspend mode: (%lu) set timer\n", dev->name, tp->nir); 778 dev_warn(&dev->dev,
779 "in rx suspend mode: (%lu) set timer\n",
780 tp->nir);
775 iowrite32(tulip_tbl[tp->chip_id].valid_intrs | TimerInt, 781 iowrite32(tulip_tbl[tp->chip_id].valid_intrs | TimerInt,
776 ioaddr + CSR7); 782 ioaddr + CSR7);
777 iowrite32(TimerInt, ioaddr + CSR5); 783 iowrite32(TimerInt, ioaddr + CSR5);
@@ -787,8 +793,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
787 } 793 }
788 794
789 if (tulip_debug > 4) 795 if (tulip_debug > 4)
790 printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#4.4x.\n", 796 printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#04x\n",
791 dev->name, ioread32(ioaddr + CSR5)); 797 dev->name, ioread32(ioaddr + CSR5));
792 798
793 return IRQ_HANDLED; 799 return IRQ_HANDLED;
794} 800}