Commit abe02af8 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e9cd1cbc
...@@ -125,12 +125,12 @@ int tulip_poll(struct napi_struct *napi, int budget) ...@@ -125,12 +125,12 @@ int tulip_poll(struct napi_struct *napi, int budget)
#endif #endif
if (tulip_debug > 4) if (tulip_debug > 4)
printk(KERN_DEBUG " In tulip_rx(), entry %d %8.8x.\n", entry, printk(KERN_DEBUG " In tulip_rx(), entry %d %08x\n",
tp->rx_ring[entry].status); entry, tp->rx_ring[entry].status);
do { do {
if (ioread32(tp->base_addr + CSR5) == 0xffffffff) { if (ioread32(tp->base_addr + CSR5) == 0xffffffff) {
printk(KERN_DEBUG " In tulip_poll(), hardware disappeared.\n"); printk(KERN_DEBUG " In tulip_poll(), hardware disappeared\n");
break; break;
} }
/* Acknowledge current RX interrupt sources. */ /* Acknowledge current RX interrupt sources. */
...@@ -146,7 +146,7 @@ int tulip_poll(struct napi_struct *napi, int budget) ...@@ -146,7 +146,7 @@ int tulip_poll(struct napi_struct *napi, int budget)
break; break;
if (tulip_debug > 5) if (tulip_debug > 5)
printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n", printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %08x\n",
dev->name, entry, status); dev->name, entry, status);
if (++work_done >= budget) if (++work_done >= budget)
...@@ -177,15 +177,15 @@ int tulip_poll(struct napi_struct *napi, int budget) ...@@ -177,15 +177,15 @@ int tulip_poll(struct napi_struct *napi, int budget)
/* Ingore earlier buffers. */ /* Ingore earlier buffers. */
if ((status & 0xffff) != 0x7fff) { if ((status & 0xffff) != 0x7fff) {
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_WARNING "%s: Oversized Ethernet frame " dev_warn(&dev->dev,
"spanned multiple buffers, status %8.8x!\n", "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
dev->name, status); status);
tp->stats.rx_length_errors++; tp->stats.rx_length_errors++;
} }
} else { } else {
/* There was a fatal error. */ /* There was a fatal error. */
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Receive error, Rx status %8.8x.\n", printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
dev->name, status); dev->name, status);
tp->stats.rx_errors++; /* end of a packet.*/ tp->stats.rx_errors++; /* end of a packet.*/
if (pkt_len > 1518 || if (pkt_len > 1518 ||
...@@ -226,9 +226,8 @@ int tulip_poll(struct napi_struct *napi, int budget) ...@@ -226,9 +226,8 @@ int tulip_poll(struct napi_struct *napi, int budget)
#ifndef final_version #ifndef final_version
if (tp->rx_buffers[entry].mapping != if (tp->rx_buffers[entry].mapping !=
le32_to_cpu(tp->rx_ring[entry].buffer1)) { le32_to_cpu(tp->rx_ring[entry].buffer1)) {
printk(KERN_ERR "%s: Internal fault: The skbuff addresses " dev_err(&dev->dev,
"do not match in tulip_rx: %08x vs. %08llx %p / %p.\n", "Internal fault: The skbuff addresses do not match in tulip_rx: %08x vs. %08llx %p / %p\n",
dev->name,
le32_to_cpu(tp->rx_ring[entry].buffer1), le32_to_cpu(tp->rx_ring[entry].buffer1),
(unsigned long long)tp->rx_buffers[entry].mapping, (unsigned long long)tp->rx_buffers[entry].mapping,
skb->head, temp); skb->head, temp);
...@@ -365,15 +364,15 @@ static int tulip_rx(struct net_device *dev) ...@@ -365,15 +364,15 @@ static int tulip_rx(struct net_device *dev)
int received = 0; int received = 0;
if (tulip_debug > 4) if (tulip_debug > 4)
printk(KERN_DEBUG " In tulip_rx(), entry %d %8.8x.\n", entry, printk(KERN_DEBUG " In tulip_rx(), entry %d %08x\n",
tp->rx_ring[entry].status); entry, tp->rx_ring[entry].status);
/* If we own the next entry, it is a new packet. Send it up. */ /* If we own the next entry, it is a new packet. Send it up. */
while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) { while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) {
s32 status = le32_to_cpu(tp->rx_ring[entry].status); s32 status = le32_to_cpu(tp->rx_ring[entry].status);
short pkt_len; short pkt_len;
if (tulip_debug > 5) if (tulip_debug > 5)
printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n", printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %08x\n",
dev->name, entry, status); dev->name, entry, status);
if (--rx_work_limit < 0) if (--rx_work_limit < 0)
break; break;
...@@ -402,15 +401,15 @@ static int tulip_rx(struct net_device *dev) ...@@ -402,15 +401,15 @@ static int tulip_rx(struct net_device *dev)
/* Ingore earlier buffers. */ /* Ingore earlier buffers. */
if ((status & 0xffff) != 0x7fff) { if ((status & 0xffff) != 0x7fff) {
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_WARNING "%s: Oversized Ethernet frame " dev_warn(&dev->dev,
"spanned multiple buffers, status %8.8x!\n", "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
dev->name, status); status);
tp->stats.rx_length_errors++; tp->stats.rx_length_errors++;
} }
} else { } else {
/* There was a fatal error. */ /* There was a fatal error. */
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Receive error, Rx status %8.8x.\n", printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
dev->name, status); dev->name, status);
tp->stats.rx_errors++; /* end of a packet.*/ tp->stats.rx_errors++; /* end of a packet.*/
if (pkt_len > 1518 || if (pkt_len > 1518 ||
...@@ -450,9 +449,8 @@ static int tulip_rx(struct net_device *dev) ...@@ -450,9 +449,8 @@ static int tulip_rx(struct net_device *dev)
#ifndef final_version #ifndef final_version
if (tp->rx_buffers[entry].mapping != if (tp->rx_buffers[entry].mapping !=
le32_to_cpu(tp->rx_ring[entry].buffer1)) { le32_to_cpu(tp->rx_ring[entry].buffer1)) {
printk(KERN_ERR "%s: Internal fault: The skbuff addresses " dev_err(&dev->dev,
"do not match in tulip_rx: %08x vs. %Lx %p / %p.\n", "Internal fault: The skbuff addresses do not match in tulip_rx: %08x vs. %Lx %p / %p\n",
dev->name,
le32_to_cpu(tp->rx_ring[entry].buffer1), le32_to_cpu(tp->rx_ring[entry].buffer1),
(long long)tp->rx_buffers[entry].mapping, (long long)tp->rx_buffers[entry].mapping,
skb->head, temp); skb->head, temp);
...@@ -569,7 +567,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -569,7 +567,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
#endif /* CONFIG_TULIP_NAPI */ #endif /* CONFIG_TULIP_NAPI */
if (tulip_debug > 4) if (tulip_debug > 4)
printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x.\n", printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x\n",
dev->name, csr5, ioread32(ioaddr + CSR5)); dev->name, csr5, ioread32(ioaddr + CSR5));
...@@ -601,7 +599,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -601,7 +599,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
/* There was an major error, log it. */ /* There was an major error, log it. */
#ifndef final_version #ifndef final_version
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n", printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n",
dev->name, status); dev->name, status);
#endif #endif
tp->stats.tx_errors++; tp->stats.tx_errors++;
...@@ -631,8 +629,9 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -631,8 +629,9 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
#ifndef final_version #ifndef final_version
if (tp->cur_tx - dirty_tx > TX_RING_SIZE) { if (tp->cur_tx - dirty_tx > TX_RING_SIZE) {
printk(KERN_ERR "%s: Out-of-sync dirty pointer, %d vs. %d.\n", dev_err(&dev->dev,
dev->name, dirty_tx, tp->cur_tx); "Out-of-sync dirty pointer, %d vs. %d\n",
dirty_tx, tp->cur_tx);
dirty_tx += TX_RING_SIZE; dirty_tx += TX_RING_SIZE;
} }
#endif #endif
...@@ -643,9 +642,10 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -643,9 +642,10 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
tp->dirty_tx = dirty_tx; tp->dirty_tx = dirty_tx;
if (csr5 & TxDied) { if (csr5 & TxDied) {
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_WARNING "%s: The transmitter stopped." dev_warn(&dev->dev,
" CSR5 is %x, CSR6 %x, new CSR6 %x.\n", "The transmitter stopped. CSR5 is %x, CSR6 %x, new CSR6 %x\n",
dev->name, csr5, ioread32(ioaddr + CSR6), tp->csr6); csr5, ioread32(ioaddr + CSR6),
tp->csr6);
tulip_restart_rxtx(tp); tulip_restart_rxtx(tp);
} }
spin_unlock(&tp->lock); spin_unlock(&tp->lock);
...@@ -696,8 +696,9 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -696,8 +696,9 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
* to the 21142/3 docs that is). * to the 21142/3 docs that is).
* -- rmk * -- rmk
*/ */
printk(KERN_ERR "%s: (%lu) System Error occurred (%d)\n", dev_err(&dev->dev,
dev->name, tp->nir, error); "(%lu) System Error occurred (%d)\n",
tp->nir, error);
} }
/* Clear all error sources, included undocumented ones! */ /* Clear all error sources, included undocumented ones! */
iowrite32(0x0800f7ba, ioaddr + CSR5); iowrite32(0x0800f7ba, ioaddr + CSR5);
...@@ -706,16 +707,17 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -706,16 +707,17 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
if (csr5 & TimerInt) { if (csr5 & TimerInt) {
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_ERR "%s: Re-enabling interrupts, %8.8x.\n", dev_err(&dev->dev,
dev->name, csr5); "Re-enabling interrupts, %08x\n",
csr5);
iowrite32(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7); iowrite32(tulip_tbl[tp->chip_id].valid_intrs, ioaddr + CSR7);
tp->ttimer = 0; tp->ttimer = 0;
oi++; oi++;
} }
if (tx > maxtx || rx > maxrx || oi > maxoi) { if (tx > maxtx || rx > maxrx || oi > maxoi) {
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_WARNING "%s: Too much work during an interrupt, " dev_warn(&dev->dev, "Too much work during an interrupt, csr5=0x%08x. (%lu) (%d,%d,%d)\n",
"csr5=0x%8.8x. (%lu) (%d,%d,%d)\n", dev->name, csr5, tp->nir, tx, rx, oi); csr5, tp->nir, tx, rx, oi);
/* Acknowledge all interrupt sources. */ /* Acknowledge all interrupt sources. */
iowrite32(0x8001ffff, ioaddr + CSR5); iowrite32(0x8001ffff, ioaddr + CSR5);
...@@ -764,14 +766,18 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -764,14 +766,18 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
entry = tp->dirty_rx % RX_RING_SIZE; entry = tp->dirty_rx % RX_RING_SIZE;
if (tp->rx_buffers[entry].skb == NULL) { if (tp->rx_buffers[entry].skb == NULL) {
if (tulip_debug > 1) if (tulip_debug > 1)
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); dev_warn(&dev->dev,
"in rx suspend mode: (%lu) (tp->cur_rx = %u, ttimer = %d, rx = %d) go/stay in suspend mode\n",
tp->nir, tp->cur_rx, tp->ttimer, rx);
if (tp->chip_id == LC82C168) { if (tp->chip_id == LC82C168) {
iowrite32(0x00, ioaddr + CSR7); iowrite32(0x00, ioaddr + CSR7);
mod_timer(&tp->timer, RUN_AT(HZ/50)); mod_timer(&tp->timer, RUN_AT(HZ/50));
} else { } else {
if (tp->ttimer == 0 || (ioread32(ioaddr + CSR11) & 0xffff) == 0) { if (tp->ttimer == 0 || (ioread32(ioaddr + CSR11) & 0xffff) == 0) {
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_WARNING "%s: in rx suspend mode: (%lu) set timer\n", dev->name, tp->nir); dev_warn(&dev->dev,
"in rx suspend mode: (%lu) set timer\n",
tp->nir);
iowrite32(tulip_tbl[tp->chip_id].valid_intrs | TimerInt, iowrite32(tulip_tbl[tp->chip_id].valid_intrs | TimerInt,
ioaddr + CSR7); ioaddr + CSR7);
iowrite32(TimerInt, ioaddr + CSR5); iowrite32(TimerInt, ioaddr + CSR5);
...@@ -787,7 +793,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -787,7 +793,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
} }
if (tulip_debug > 4) if (tulip_debug > 4)
printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#4.4x.\n", printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#04x\n",
dev->name, ioread32(ioaddr + CSR5)); dev->name, ioread32(ioaddr + CSR5));
return IRQ_HANDLED; return IRQ_HANDLED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment