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

tulip: Convert uses of KERN_DEBUG

Convert logging messages to more current styles.

Added -DDEBUG to Makefile to maintain current message logging.
This could be converted to a specific CONFIG_TULIP_DEBUG option.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 163ef0b5
...@@ -122,8 +122,8 @@ void t21142_start_nway(struct net_device *dev) ...@@ -122,8 +122,8 @@ void t21142_start_nway(struct net_device *dev)
tp->nway = tp->mediasense = 1; tp->nway = tp->mediasense = 1;
tp->nwayset = tp->lpar = 0; tp->nwayset = tp->lpar = 0;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Restarting 21143 autonegotiation, csr14=%08x\n", netdev_dbg(dev, "Restarting 21143 autonegotiation, csr14=%08x\n",
dev->name, csr14); csr14);
iowrite32(0x0001, ioaddr + CSR13); iowrite32(0x0001, ioaddr + CSR13);
udelay(100); udelay(100);
iowrite32(csr14, ioaddr + CSR14); iowrite32(csr14, ioaddr + CSR14);
...@@ -206,14 +206,14 @@ void t21142_lnk_change(struct net_device *dev, int csr5) ...@@ -206,14 +206,14 @@ void t21142_lnk_change(struct net_device *dev, int csr5)
#if 0 /* Restart shouldn't be needed. */ #if 0 /* Restart shouldn't be needed. */
iowrite32(tp->csr6 | RxOn, ioaddr + CSR6); iowrite32(tp->csr6 | RxOn, ioaddr + CSR6);
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Restarting Tx and Rx, CSR5 is %08x\n", netdev_dbg(dev, " Restarting Tx and Rx, CSR5 is %08x\n",
dev->name, ioread32(ioaddr + CSR5)); ioread32(ioaddr + CSR5));
#endif #endif
tulip_start_rxtx(tp); tulip_start_rxtx(tp);
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Setting CSR6 %08x/%x CSR12 %08x\n", netdev_dbg(dev, " Setting CSR6 %08x/%x CSR12 %08x\n",
dev->name, tp->csr6, ioread32(ioaddr + CSR6), tp->csr6, ioread32(ioaddr + CSR6),
ioread32(ioaddr + CSR12)); ioread32(ioaddr + CSR12));
} else if ((tp->nwayset && (csr5 & 0x08000000) && } else if ((tp->nwayset && (csr5 & 0x08000000) &&
(dev->if_port == 3 || dev->if_port == 5) && (dev->if_port == 3 || dev->if_port == 5) &&
(csr12 & 2) == 2) || (csr12 & 2) == 2) ||
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# Makefile for the Linux "Tulip" family network device drivers. # Makefile for the Linux "Tulip" family network device drivers.
# #
ccflags-$(CONFIG_NET_TULIP) := -DDEBUG
obj-$(CONFIG_PCMCIA_XIRCOM) += xircom_cb.o obj-$(CONFIG_PCMCIA_XIRCOM) += xircom_cb.o
obj-$(CONFIG_DM9102) += dmfe.o obj-$(CONFIG_DM9102) += dmfe.o
obj-$(CONFIG_WINBOND_840) += winbond-840.o obj-$(CONFIG_WINBOND_840) += winbond-840.o
......
...@@ -377,9 +377,9 @@ static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, }; ...@@ -377,9 +377,9 @@ static u16 t21041_csr15[] = { 0x0008, 0x0006, 0x000E, 0x0008, 0x0008, };
static void de_rx_err_acct (struct de_private *de, unsigned rx_tail, static void de_rx_err_acct (struct de_private *de, unsigned rx_tail,
u32 status, u32 len) u32 status, u32 len)
{ {
netif_printk(de, rx_err, KERN_DEBUG, de->dev, netif_dbg(de, rx_err, de->dev,
"rx err, slot %d status 0x%x len %d\n", "rx err, slot %d status 0x%x len %d\n",
rx_tail, status, len); rx_tail, status, len);
if ((status & 0x38000300) != 0x0300) { if ((status & 0x38000300) != 0x0300) {
/* Ingore earlier buffers. */ /* Ingore earlier buffers. */
...@@ -433,10 +433,9 @@ static void de_rx (struct de_private *de) ...@@ -433,10 +433,9 @@ static void de_rx (struct de_private *de)
copying_skb = (len <= rx_copybreak); copying_skb = (len <= rx_copybreak);
if (unlikely(netif_msg_rx_status(de))) netif_dbg(de, rx_status, de->dev,
printk(KERN_DEBUG "%s: rx slot %d status 0x%x len %d copying? %d\n", "rx slot %d status 0x%x len %d copying? %d\n",
de->dev->name, rx_tail, status, len, rx_tail, status, len, copying_skb);
copying_skb);
buflen = copying_skb ? (len + RX_OFFSET) : de->rx_buf_sz; buflen = copying_skb ? (len + RX_OFFSET) : de->rx_buf_sz;
copy_skb = dev_alloc_skb (buflen); copy_skb = dev_alloc_skb (buflen);
...@@ -504,10 +503,9 @@ static irqreturn_t de_interrupt (int irq, void *dev_instance) ...@@ -504,10 +503,9 @@ static irqreturn_t de_interrupt (int irq, void *dev_instance)
if ((!(status & (IntrOK|IntrErr))) || (status == 0xFFFF)) if ((!(status & (IntrOK|IntrErr))) || (status == 0xFFFF))
return IRQ_NONE; return IRQ_NONE;
if (netif_msg_intr(de)) netif_dbg(de, intr, dev, "intr, status %08x mode %08x desc %u/%u/%u\n",
printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n", status, dr32(MacMode),
dev->name, status, dr32(MacMode), de->rx_tail, de->tx_head, de->tx_tail);
de->rx_tail, de->tx_head, de->tx_tail);
dw32(MacStatus, status); dw32(MacStatus, status);
...@@ -570,9 +568,9 @@ static void de_tx (struct de_private *de) ...@@ -570,9 +568,9 @@ static void de_tx (struct de_private *de)
if (status & LastFrag) { if (status & LastFrag) {
if (status & TxError) { if (status & TxError) {
if (netif_msg_tx_err(de)) netif_dbg(de, tx_err, de->dev,
printk(KERN_DEBUG "%s: tx err, status 0x%x\n", "tx err, status 0x%x\n",
de->dev->name, status); status);
de->net_stats.tx_errors++; de->net_stats.tx_errors++;
if (status & TxOWC) if (status & TxOWC)
de->net_stats.tx_window_errors++; de->net_stats.tx_window_errors++;
...@@ -585,9 +583,8 @@ static void de_tx (struct de_private *de) ...@@ -585,9 +583,8 @@ static void de_tx (struct de_private *de)
} else { } else {
de->net_stats.tx_packets++; de->net_stats.tx_packets++;
de->net_stats.tx_bytes += skb->len; de->net_stats.tx_bytes += skb->len;
if (netif_msg_tx_done(de)) netif_dbg(de, tx_done, de->dev,
printk(KERN_DEBUG "%s: tx done, slot %d\n", "tx done, slot %d\n", tx_tail);
de->dev->name, tx_tail);
} }
dev_kfree_skb_irq(skb); dev_kfree_skb_irq(skb);
} }
...@@ -644,9 +641,8 @@ static netdev_tx_t de_start_xmit (struct sk_buff *skb, ...@@ -644,9 +641,8 @@ static netdev_tx_t de_start_xmit (struct sk_buff *skb,
wmb(); wmb();
de->tx_head = NEXT_TX(entry); de->tx_head = NEXT_TX(entry);
if (netif_msg_tx_queued(de)) netif_dbg(de, tx_queued, dev, "tx queued, slot %d, skblen %d\n",
printk(KERN_DEBUG "%s: tx queued, slot %d, skblen %d\n", entry, skb->len);
dev->name, entry, skb->len);
if (tx_free == 0) if (tx_free == 0)
netif_stop_queue(dev); netif_stop_queue(dev);
...@@ -1387,7 +1383,7 @@ static int de_open (struct net_device *dev) ...@@ -1387,7 +1383,7 @@ static int de_open (struct net_device *dev)
struct de_private *de = netdev_priv(dev); struct de_private *de = netdev_priv(dev);
int rc; int rc;
netif_printk(de, ifup, KERN_DEBUG, dev, "enabling interface\n"); netif_dbg(de, ifup, dev, "enabling interface\n");
de->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32); de->rx_buf_sz = (dev->mtu <= 1500 ? PKT_BUF_SZ : dev->mtu + 32);
...@@ -1429,7 +1425,7 @@ static int de_close (struct net_device *dev) ...@@ -1429,7 +1425,7 @@ static int de_close (struct net_device *dev)
struct de_private *de = netdev_priv(dev); struct de_private *de = netdev_priv(dev);
unsigned long flags; unsigned long flags;
netif_printk(de, ifdown, KERN_DEBUG, dev, "disabling interface\n"); netif_dbg(de, ifdown, dev, "disabling interface\n");
del_timer_sync(&de->media_timer); del_timer_sync(&de->media_timer);
...@@ -1450,10 +1446,9 @@ static void de_tx_timeout (struct net_device *dev) ...@@ -1450,10 +1446,9 @@ static void de_tx_timeout (struct net_device *dev)
{ {
struct de_private *de = netdev_priv(dev); struct de_private *de = netdev_priv(dev);
netdev_printk(KERN_DEBUG, dev, netdev_dbg(dev, "NIC status %08x mode %08x sia %08x desc %u/%u/%u\n",
"NIC status %08x mode %08x sia %08x desc %u/%u/%u\n", dr32(MacStatus), dr32(MacMode), dr32(SIAStatus),
dr32(MacStatus), dr32(MacMode), dr32(SIAStatus), de->rx_tail, de->tx_head, de->tx_tail);
de->rx_tail, de->tx_head, de->tx_tail);
del_timer_sync(&de->media_timer); del_timer_sync(&de->media_timer);
......
...@@ -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 %08x\n", netdev_dbg(dev, " In tulip_rx(), entry %d %08x\n",
entry, 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"); netdev_dbg(dev, " In tulip_poll(), hardware disappeared\n");
break; break;
} }
/* Acknowledge current RX interrupt sources. */ /* Acknowledge current RX interrupt sources. */
...@@ -145,9 +145,9 @@ int tulip_poll(struct napi_struct *napi, int budget) ...@@ -145,9 +145,9 @@ int tulip_poll(struct napi_struct *napi, int budget)
if (tp->dirty_rx + RX_RING_SIZE == tp->cur_rx) if (tp->dirty_rx + RX_RING_SIZE == tp->cur_rx)
break; break;
if (tulip_debug > 5) if (tulip_debug > 5)
printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %08x\n", netdev_dbg(dev, "In tulip_rx(), entry %d %08x\n",
dev->name, entry, status); entry, status);
if (++work_done >= budget) if (++work_done >= budget)
goto not_done; goto not_done;
...@@ -184,9 +184,9 @@ int tulip_poll(struct napi_struct *napi, int budget) ...@@ -184,9 +184,9 @@ int tulip_poll(struct napi_struct *napi, int budget)
} }
} 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 %08x\n", netdev_dbg(dev, "Receive error, Rx status %08x\n",
dev->name, status); status);
dev->stats.rx_errors++; /* end of a packet.*/ dev->stats.rx_errors++; /* end of a packet.*/
if (pkt_len > 1518 || if (pkt_len > 1518 ||
(status & RxDescRunt)) (status & RxDescRunt))
...@@ -367,16 +367,16 @@ static int tulip_rx(struct net_device *dev) ...@@ -367,16 +367,16 @@ 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 %08x\n", netdev_dbg(dev, "In tulip_rx(), entry %d %08x\n",
entry, 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 %08x\n", netdev_dbg(dev, "In tulip_rx(), entry %d %08x\n",
dev->name, entry, status); entry, status);
if (--rx_work_limit < 0) if (--rx_work_limit < 0)
break; break;
...@@ -404,16 +404,16 @@ static int tulip_rx(struct net_device *dev) ...@@ -404,16 +404,16 @@ 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)
dev_warn(&dev->dev, netdev_warn(dev,
"Oversized Ethernet frame spanned multiple buffers, status %08x!\n", "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
status); status);
dev->stats.rx_length_errors++; dev->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 %08x\n", netdev_dbg(dev, "Receive error, Rx status %08x\n",
dev->name, status); status);
dev->stats.rx_errors++; /* end of a packet.*/ dev->stats.rx_errors++; /* end of a packet.*/
if (pkt_len > 1518 || if (pkt_len > 1518 ||
(status & RxDescRunt)) (status & RxDescRunt))
...@@ -573,8 +573,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -573,8 +573,8 @@ 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", netdev_dbg(dev, "interrupt csr5=%#8.8x new csr5=%#8.8x\n",
dev->name, csr5, ioread32(ioaddr + CSR5)); csr5, ioread32(ioaddr + CSR5));
if (csr5 & (TxNoBuf | TxDied | TxIntr | TimerInt)) { if (csr5 & (TxNoBuf | TxDied | TxIntr | TimerInt)) {
...@@ -605,8 +605,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -605,8 +605,8 @@ 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 %08x\n", netdev_dbg(dev, "Transmit error, Tx status %08x\n",
dev->name, status); status);
#endif #endif
dev->stats.tx_errors++; dev->stats.tx_errors++;
if (status & 0x4104) if (status & 0x4104)
...@@ -804,8 +804,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) ...@@ -804,8 +804,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
} }
if (tulip_debug > 4) if (tulip_debug > 4)
printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#04x\n", netdev_dbg(dev, "exiting interrupt, csr5=%#04x\n",
dev->name, ioread32(ioaddr + CSR5)); ioread32(ioaddr + CSR5));
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -182,8 +182,8 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -182,8 +182,8 @@ void tulip_select_media(struct net_device *dev, int startup)
switch (mleaf->type) { switch (mleaf->type) {
case 0: /* 21140 non-MII xcvr. */ case 0: /* 21140 non-MII xcvr. */
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Using a 21140 non-MII transceiver with control setting %02x\n", netdev_dbg(dev, "Using a 21140 non-MII transceiver with control setting %02x\n",
dev->name, p[1]); p[1]);
dev->if_port = p[0]; dev->if_port = p[0];
if (startup) if (startup)
iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12); iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12);
...@@ -204,15 +204,14 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -204,15 +204,14 @@ void tulip_select_media(struct net_device *dev, int startup)
struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
unsigned char *rst = rleaf->leafdata; unsigned char *rst = rleaf->leafdata;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Resetting the transceiver\n", netdev_dbg(dev, "Resetting the transceiver\n");
dev->name);
for (i = 0; i < rst[0]; i++) for (i = 0; i < rst[0]; i++)
iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
} }
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: 21143 non-MII %s transceiver control %04x/%04x\n", netdev_dbg(dev, "21143 non-MII %s transceiver control %04x/%04x\n",
dev->name, medianame[dev->if_port], medianame[dev->if_port],
setup[0], setup[1]); setup[0], setup[1]);
if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */ if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */
csr13val = setup[0]; csr13val = setup[0];
csr14val = setup[1]; csr14val = setup[1];
...@@ -239,8 +238,8 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -239,8 +238,8 @@ void tulip_select_media(struct net_device *dev, int startup)
if (startup) iowrite32(csr13val, ioaddr + CSR13); if (startup) iowrite32(csr13val, ioaddr + CSR13);
} }
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Setting CSR15 to %08x/%08x\n", netdev_dbg(dev, "Setting CSR15 to %08x/%08x\n",
dev->name, csr15dir, csr15val); csr15dir, csr15val);
if (mleaf->type == 4) if (mleaf->type == 4)
new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18); new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18);
else else
...@@ -316,9 +315,9 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -316,9 +315,9 @@ void tulip_select_media(struct net_device *dev, int startup)
if (tp->mii_advertise == 0) if (tp->mii_advertise == 0)
tp->mii_advertise = tp->advertising[phy_num]; tp->mii_advertise = tp->advertising[phy_num];
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Advertising %04x on MII %d\n", netdev_dbg(dev, " Advertising %04x on MII %d\n",
dev->name, tp->mii_advertise, tp->mii_advertise,
tp->phys[phy_num]); tp->phys[phy_num]);
tulip_mdio_write(dev, tp->phys[phy_num], 4, tp->mii_advertise); tulip_mdio_write(dev, tp->phys[phy_num], 4, tp->mii_advertise);
} }
break; break;
...@@ -335,8 +334,7 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -335,8 +334,7 @@ void tulip_select_media(struct net_device *dev, int startup)
struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset]; struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
unsigned char *rst = rleaf->leafdata; unsigned char *rst = rleaf->leafdata;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Resetting the transceiver\n", netdev_dbg(dev, "Resetting the transceiver\n");
dev->name);
for (i = 0; i < rst[0]; i++) for (i = 0; i < rst[0]; i++)
iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15); iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
} }
...@@ -344,20 +342,21 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -344,20 +342,21 @@ void tulip_select_media(struct net_device *dev, int startup)
break; break;
} }
default: default:
printk(KERN_DEBUG "%s: Invalid media table selection %d\n", netdev_dbg(dev, " Invalid media table selection %d\n",
dev->name, mleaf->type); mleaf->type);
new_csr6 = 0x020E0000; new_csr6 = 0x020E0000;
} }
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Using media type %s, CSR12 is %02x\n", netdev_dbg(dev, "Using media type %s, CSR12 is %02x\n",
dev->name, medianame[dev->if_port], medianame[dev->if_port],
ioread32(ioaddr + CSR12) & 0xff); ioread32(ioaddr + CSR12) & 0xff);
} else if (tp->chip_id == LC82C168) { } else if (tp->chip_id == LC82C168) {
if (startup && ! tp->medialock) if (startup && ! tp->medialock)
dev->if_port = tp->mii_cnt ? 11 : 0; dev->if_port = tp->mii_cnt ? 11 : 0;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: PNIC PHY status is %3.3x, media %s\n", netdev_dbg(dev, "PNIC PHY status is %3.3x, media %s\n",
dev->name, ioread32(ioaddr + 0xB8), medianame[dev->if_port]); ioread32(ioaddr + 0xB8),
medianame[dev->if_port]);
if (tp->mii_cnt) { if (tp->mii_cnt) {
new_csr6 = 0x810C0000; new_csr6 = 0x810C0000;
iowrite32(0x0001, ioaddr + CSR15); iowrite32(0x0001, ioaddr + CSR15);
...@@ -388,9 +387,9 @@ void tulip_select_media(struct net_device *dev, int startup) ...@@ -388,9 +387,9 @@ void tulip_select_media(struct net_device *dev, int startup)
} else } else
new_csr6 = 0x03860000; new_csr6 = 0x03860000;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: No media description table, assuming %s transceiver, CSR12 %02x\n", netdev_dbg(dev, "No media description table, assuming %s transceiver, CSR12 %02x\n",
dev->name, medianame[dev->if_port], medianame[dev->if_port],
ioread32(ioaddr + CSR12)); ioread32(ioaddr + CSR12));
} }
tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0); tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0);
...@@ -504,8 +503,8 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx) ...@@ -504,8 +503,8 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx)
/* Fixup for DLink with miswired PHY. */ /* Fixup for DLink with miswired PHY. */
if (mii_advert != to_advert) { if (mii_advert != to_advert) {
printk(KERN_DEBUG "tulip%d: Advertising %04x on PHY %d, previously advertising %04x\n", pr_debug("tulip%d: Advertising %04x on PHY %d, previously advertising %04x\n",
board_idx, to_advert, phy, mii_advert); board_idx, to_advert, phy, mii_advert);
tulip_mdio_write (dev, phy, 4, to_advert); tulip_mdio_write (dev, phy, 4, to_advert);
} }
......
...@@ -40,8 +40,8 @@ void pnic_do_nway(struct net_device *dev) ...@@ -40,8 +40,8 @@ void pnic_do_nway(struct net_device *dev)
new_csr6 |= 0x00000200; new_csr6 |= 0x00000200;
} }
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: PNIC autonegotiated status %08x, %s\n", netdev_dbg(dev, "PNIC autonegotiated status %08x, %s\n",
dev->name, phy_reg, medianame[dev->if_port]); phy_reg, medianame[dev->if_port]);
if (tp->csr6 != new_csr6) { if (tp->csr6 != new_csr6) {
tp->csr6 = new_csr6; tp->csr6 = new_csr6;
/* Restart Tx */ /* Restart Tx */
...@@ -58,8 +58,8 @@ void pnic_lnk_change(struct net_device *dev, int csr5) ...@@ -58,8 +58,8 @@ void pnic_lnk_change(struct net_device *dev, int csr5)
int phy_reg = ioread32(ioaddr + 0xB8); int phy_reg = ioread32(ioaddr + 0xB8);
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: PNIC link changed state %08x, CSR5 %08x\n", netdev_dbg(dev, "PNIC link changed state %08x, CSR5 %08x\n",
dev->name, phy_reg, csr5); phy_reg, csr5);
if (ioread32(ioaddr + CSR5) & TPLnkFail) { if (ioread32(ioaddr + CSR5) & TPLnkFail) {
iowrite32((ioread32(ioaddr + CSR7) & ~TPLnkFail) | TPLnkPass, ioaddr + CSR7); iowrite32((ioread32(ioaddr + CSR7) & ~TPLnkFail) | TPLnkPass, ioaddr + CSR7);
/* If we use an external MII, then we mustn't use the /* If we use an external MII, then we mustn't use the
...@@ -114,8 +114,8 @@ void pnic_timer(unsigned long data) ...@@ -114,8 +114,8 @@ void pnic_timer(unsigned long data)
int csr5 = ioread32(ioaddr + CSR5); int csr5 = ioread32(ioaddr + CSR5);
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: PNIC timer PHY status %08x, %s CSR5 %08x\n", netdev_dbg(dev, "PNIC timer PHY status %08x, %s CSR5 %08x\n",
dev->name, phy_reg, medianame[dev->if_port], csr5); phy_reg, medianame[dev->if_port], csr5);
if (phy_reg & 0x04000000) { /* Remote link fault */ if (phy_reg & 0x04000000) { /* Remote link fault */
iowrite32(0x0201F078, ioaddr + 0xB8); iowrite32(0x0201F078, ioaddr + 0xB8);
next_tick = 1*HZ; next_tick = 1*HZ;
...@@ -125,11 +125,11 @@ void pnic_timer(unsigned long data) ...@@ -125,11 +125,11 @@ void pnic_timer(unsigned long data)
next_tick = 60*HZ; next_tick = 60*HZ;
} else if (csr5 & TPLnkFail) { /* 100baseTx link beat */ } else if (csr5 & TPLnkFail) { /* 100baseTx link beat */
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: %s link beat failed, CSR12 %04x, CSR5 %08x, PHY %03x\n", netdev_dbg(dev, "%s link beat failed, CSR12 %04x, CSR5 %08x, PHY %03x\n",
dev->name, medianame[dev->if_port], medianame[dev->if_port],
csr12, csr12,
ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR5),
ioread32(ioaddr + 0xB8)); ioread32(ioaddr + 0xB8));
next_tick = 3*HZ; next_tick = 3*HZ;
if (tp->medialock) { if (tp->medialock) {
} else if (tp->nwayset && (dev->if_port & 1)) { } else if (tp->nwayset && (dev->if_port & 1)) {
......
...@@ -125,8 +125,8 @@ void pnic2_start_nway(struct net_device *dev) ...@@ -125,8 +125,8 @@ void pnic2_start_nway(struct net_device *dev)
csr14 |= 0x00001184; csr14 |= 0x00001184;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Restarting PNIC2 autonegotiation, csr14=%08x\n", netdev_dbg(dev, "Restarting PNIC2 autonegotiation, csr14=%08x\n",
dev->name, csr14); csr14);
/* tell pnic2_lnk_change we are doing an nway negotiation */ /* tell pnic2_lnk_change we are doing an nway negotiation */
dev->if_port = 0; dev->if_port = 0;
...@@ -137,8 +137,7 @@ void pnic2_start_nway(struct net_device *dev) ...@@ -137,8 +137,7 @@ void pnic2_start_nway(struct net_device *dev)
tp->csr6 = ioread32(ioaddr + CSR6); tp->csr6 = ioread32(ioaddr + CSR6);
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: On Entry to Nway, csr6=%08x\n", netdev_dbg(dev, "On Entry to Nway, csr6=%08x\n", tp->csr6);
dev->name, tp->csr6);
/* mask off any bits not to touch /* mask off any bits not to touch
* comment at top of file explains mask value * comment at top of file explains mask value
...@@ -271,9 +270,10 @@ void pnic2_lnk_change(struct net_device *dev, int csr5) ...@@ -271,9 +270,10 @@ void pnic2_lnk_change(struct net_device *dev, int csr5)
iowrite32(1, ioaddr + CSR13); iowrite32(1, ioaddr + CSR13);
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Setting CSR6 %08x/%x CSR12 %08x\n", netdev_dbg(dev, "Setting CSR6 %08x/%x CSR12 %08x\n",
dev->name, tp->csr6, tp->csr6,
ioread32(ioaddr + CSR6), ioread32(ioaddr + CSR12)); ioread32(ioaddr + CSR6),
ioread32(ioaddr + CSR12));
/* now the following actually writes out the /* now the following actually writes out the
* new csr6 values * new csr6 values
...@@ -324,7 +324,7 @@ void pnic2_lnk_change(struct net_device *dev, int csr5) ...@@ -324,7 +324,7 @@ void pnic2_lnk_change(struct net_device *dev, int csr5)
/* Link blew? Maybe restart NWay. */ /* Link blew? Maybe restart NWay. */
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Ugh! Link blew?\n", dev->name); netdev_dbg(dev, "Ugh! Link blew?\n");
del_timer_sync(&tp->timer); del_timer_sync(&tp->timer);
pnic2_start_nway(dev); pnic2_start_nway(dev);
......
...@@ -28,11 +28,11 @@ void tulip_media_task(struct work_struct *work) ...@@ -28,11 +28,11 @@ void tulip_media_task(struct work_struct *work)
unsigned long flags; unsigned long flags;
if (tulip_debug > 2) { if (tulip_debug > 2) {
printk(KERN_DEBUG "%s: Media selection tick, %s, status %08x mode %08x SIA %08x %08x %08x %08x\n", netdev_dbg(dev, "Media selection tick, %s, status %08x mode %08x SIA %08x %08x %08x %08x\n",
dev->name, medianame[dev->if_port], medianame[dev->if_port],
ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR6), ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR6),
csr12, ioread32(ioaddr + CSR13), csr12, ioread32(ioaddr + CSR13),
ioread32(ioaddr + CSR14), ioread32(ioaddr + CSR15)); ioread32(ioaddr + CSR14), ioread32(ioaddr + CSR15));
} }
switch (tp->chip_id) { switch (tp->chip_id) {
case DC21140: case DC21140:
...@@ -48,9 +48,9 @@ void tulip_media_task(struct work_struct *work) ...@@ -48,9 +48,9 @@ void tulip_media_task(struct work_struct *work)
Assume this a generic MII or SYM transceiver. */ Assume this a generic MII or SYM transceiver. */
next_tick = 60*HZ; next_tick = 60*HZ;
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: network media monitor CSR6 %08x CSR12 0x%02x\n", netdev_dbg(dev, "network media monitor CSR6 %08x CSR12 0x%02x\n",
dev->name, ioread32(ioaddr + CSR6),
ioread32(ioaddr + CSR6), csr12 & 0xff); csr12 & 0xff);
break; break;
} }
mleaf = &tp->mtable->mleaf[tp->cur_index]; mleaf = &tp->mtable->mleaf[tp->cur_index];
...@@ -62,8 +62,8 @@ void tulip_media_task(struct work_struct *work) ...@@ -62,8 +62,8 @@ void tulip_media_task(struct work_struct *work)
s8 bitnum = p[offset]; s8 bitnum = p[offset];
if (p[offset+1] & 0x80) { if (p[offset+1] & 0x80) {
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Transceiver monitor tick CSR12=%#02x, no media sense\n", netdev_dbg(dev, "Transceiver monitor tick CSR12=%#02x, no media sense\n",
dev->name, csr12); csr12);
if (mleaf->type == 4) { if (mleaf->type == 4) {
if (mleaf->media == 3 && (csr12 & 0x02)) if (mleaf->media == 3 && (csr12 & 0x02))
goto select_next_media; goto select_next_media;
...@@ -71,17 +71,16 @@ void tulip_media_task(struct work_struct *work) ...@@ -71,17 +71,16 @@ void tulip_media_task(struct work_struct *work)
break; break;
} }
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Transceiver monitor tick: CSR12=%#02x bit %d is %d, expecting %d\n", netdev_dbg(dev, "Transceiver monitor tick: CSR12=%#02x bit %d is %d, expecting %d\n",
dev->name, csr12, (bitnum >> 1) & 7, csr12, (bitnum >> 1) & 7,
(csr12 & (1 << ((bitnum >> 1) & 7))) != 0, (csr12 & (1 << ((bitnum >> 1) & 7))) != 0,
(bitnum >= 0)); (bitnum >= 0));
/* Check that the specified bit has the proper value. */ /* Check that the specified bit has the proper value. */
if ((bitnum < 0) != if ((bitnum < 0) !=
((csr12 & (1 << ((bitnum >> 1) & 7))) != 0)) { ((csr12 & (1 << ((bitnum >> 1) & 7))) != 0)) {
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Link beat detected for %s\n", netdev_dbg(dev, "Link beat detected for %s\n",
dev->name, medianame[mleaf->media & MEDIA_MASK]);
medianame[mleaf->media & MEDIA_MASK]);
if ((p[2] & 0x61) == 0x01) /* Bogus Znyx board. */ if ((p[2] & 0x61) == 0x01) /* Bogus Znyx board. */
goto actually_mii; goto actually_mii;
netif_carrier_on(dev); netif_carrier_on(dev);
...@@ -99,10 +98,9 @@ void tulip_media_task(struct work_struct *work) ...@@ -99,10 +98,9 @@ void tulip_media_task(struct work_struct *work)
if (tulip_media_cap[dev->if_port] & MediaIsFD) if (tulip_media_cap[dev->if_port] & MediaIsFD)
goto select_next_media; /* Skip FD entries. */ goto select_next_media; /* Skip FD entries. */
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: No link beat on media %s, trying transceiver type %s\n", netdev_dbg(dev, "No link beat on media %s, trying transceiver type %s\n",
dev->name, medianame[mleaf->media & MEDIA_MASK],
medianame[mleaf->media & MEDIA_MASK], medianame[tp->mtable->mleaf[tp->cur_index].media]);
medianame[tp->mtable->mleaf[tp->cur_index].media]);
tulip_select_media(dev, 0); tulip_select_media(dev, 0);
/* Restart the transmit process. */ /* Restart the transmit process. */
tulip_restart_rxtx(tp); tulip_restart_rxtx(tp);
...@@ -166,10 +164,9 @@ void comet_timer(unsigned long data) ...@@ -166,10 +164,9 @@ void comet_timer(unsigned long data)
int next_tick = 60*HZ; int next_tick = 60*HZ;
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Comet link status %04x partner capability %04x\n", netdev_dbg(dev, "Comet link status %04x partner capability %04x\n",
dev->name, tulip_mdio_read(dev, tp->phys[0], 1),
tulip_mdio_read(dev, tp->phys[0], 1), tulip_mdio_read(dev, tp->phys[0], 5));
tulip_mdio_read(dev, tp->phys[0], 5));
/* mod_timer synchronizes us with potential add_timer calls /* mod_timer synchronizes us with potential add_timer calls
* from interrupts. * from interrupts.
*/ */
......
...@@ -547,11 +547,9 @@ static inline void tulip_stop_rxtx(struct tulip_private *tp) ...@@ -547,11 +547,9 @@ static inline void tulip_stop_rxtx(struct tulip_private *tp)
udelay(10); udelay(10);
if (!i) if (!i)
printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed" netdev_dbg(tp->dev, "tulip_stop_rxtx() failed (CSR5 0x%x CSR6 0x%x)\n",
" (CSR5 0x%x CSR6 0x%x)\n", ioread32(ioaddr + CSR5),
pci_name(tp->pdev), ioread32(ioaddr + CSR6));
ioread32(ioaddr + CSR5),
ioread32(ioaddr + CSR6));
} }
} }
......
...@@ -330,8 +330,7 @@ static void tulip_up(struct net_device *dev) ...@@ -330,8 +330,7 @@ static void tulip_up(struct net_device *dev)
udelay(100); udelay(100);
if (tulip_debug > 1) if (tulip_debug > 1)
printk(KERN_DEBUG "%s: tulip_up(), irq==%d\n", netdev_dbg(dev, "tulip_up(), irq==%d\n", dev->irq);
dev->name, dev->irq);
iowrite32(tp->rx_ring_dma, ioaddr + CSR3); iowrite32(tp->rx_ring_dma, ioaddr + CSR3);
iowrite32(tp->tx_ring_dma, ioaddr + CSR4); iowrite32(tp->tx_ring_dma, ioaddr + CSR4);
...@@ -498,10 +497,10 @@ static void tulip_up(struct net_device *dev) ...@@ -498,10 +497,10 @@ static void tulip_up(struct net_device *dev)
iowrite32(0, ioaddr + CSR2); /* Rx poll demand */ iowrite32(0, ioaddr + CSR2); /* Rx poll demand */
if (tulip_debug > 2) { if (tulip_debug > 2) {
printk(KERN_DEBUG "%s: Done tulip_up(), CSR0 %08x, CSR5 %08x CSR6 %08x\n", netdev_dbg(dev, "Done tulip_up(), CSR0 %08x, CSR5 %08x CSR6 %08x\n",
dev->name, ioread32(ioaddr + CSR0), ioread32(ioaddr + CSR0),
ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR5),
ioread32(ioaddr + CSR6)); ioread32(ioaddr + CSR6));
} }
/* Set the timer to switch to check for link beat and perhaps switch /* Set the timer to switch to check for link beat and perhaps switch
...@@ -842,8 +841,7 @@ static int tulip_close (struct net_device *dev) ...@@ -842,8 +841,7 @@ static int tulip_close (struct net_device *dev)
tulip_down (dev); tulip_down (dev);
if (tulip_debug > 1) if (tulip_debug > 1)
dev_printk(KERN_DEBUG, &dev->dev, netdev_dbg(dev, "Shutting down ethercard, status was %02x\n",
"Shutting down ethercard, status was %02x\n",
ioread32 (ioaddr + CSR5)); ioread32 (ioaddr + CSR5));
free_irq (dev->irq, dev); free_irq (dev->irq, dev);
...@@ -1206,7 +1204,7 @@ static void __devinit tulip_mwi_config (struct pci_dev *pdev, ...@@ -1206,7 +1204,7 @@ static void __devinit tulip_mwi_config (struct pci_dev *pdev,
u32 csr0; u32 csr0;
if (tulip_debug > 3) if (tulip_debug > 3)
printk(KERN_DEBUG "%s: tulip_mwi_config()\n", pci_name(pdev)); netdev_dbg(dev, "tulip_mwi_config()\n");
tp->csr0 = csr0 = 0; tp->csr0 = csr0 = 0;
...@@ -1268,8 +1266,8 @@ static void __devinit tulip_mwi_config (struct pci_dev *pdev, ...@@ -1268,8 +1266,8 @@ static void __devinit tulip_mwi_config (struct pci_dev *pdev,
out: out:
tp->csr0 = csr0; tp->csr0 = csr0;
if (tulip_debug > 2) if (tulip_debug > 2)
printk(KERN_DEBUG "%s: MWI config cacheline=%d, csr0=%08x\n", netdev_dbg(dev, "MWI config cacheline=%d, csr0=%08x\n",
pci_name(pdev), cache, csr0); cache, csr0);
} }
#endif #endif
......
...@@ -645,8 +645,7 @@ static int netdev_open(struct net_device *dev) ...@@ -645,8 +645,7 @@ static int netdev_open(struct net_device *dev)
goto out_err; goto out_err;
if (debug > 1) if (debug > 1)
printk(KERN_DEBUG "%s: w89c840_open() irq %d\n", netdev_dbg(dev, "w89c840_open() irq %d\n", dev->irq);
dev->name, dev->irq);
if((i=alloc_ringdesc(dev))) if((i=alloc_ringdesc(dev)))
goto out_err; goto out_err;
...@@ -658,7 +657,7 @@ static int netdev_open(struct net_device *dev) ...@@ -658,7 +657,7 @@ static int netdev_open(struct net_device *dev)
netif_start_queue(dev); netif_start_queue(dev);
if (debug > 2) if (debug > 2)
printk(KERN_DEBUG "%s: Done netdev_open()\n", dev->name); netdev_dbg(dev, "Done netdev_open()\n");
/* Set the timer to check for link beat. */ /* Set the timer to check for link beat. */
init_timer(&np->timer); init_timer(&np->timer);
...@@ -787,9 +786,9 @@ static void netdev_timer(unsigned long data) ...@@ -787,9 +786,9 @@ static void netdev_timer(unsigned long data)
void __iomem *ioaddr = np->base_addr; void __iomem *ioaddr = np->base_addr;
if (debug > 2) if (debug > 2)
printk(KERN_DEBUG "%s: Media selection timer tick, status %08x config %08x\n", netdev_dbg(dev, "Media selection timer tick, status %08x config %08x\n",
dev->name, ioread32(ioaddr + IntrStatus), ioread32(ioaddr + IntrStatus),
ioread32(ioaddr + NetworkConfig)); ioread32(ioaddr + NetworkConfig));
spin_lock_irq(&np->lock); spin_lock_irq(&np->lock);
update_csr6(dev, update_link(dev)); update_csr6(dev, update_link(dev));
spin_unlock_irq(&np->lock); spin_unlock_irq(&np->lock);
...@@ -1056,8 +1055,8 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -1056,8 +1055,8 @@ static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
spin_unlock_irq(&np->lock); spin_unlock_irq(&np->lock);
if (debug > 4) { if (debug > 4) {
printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d\n", netdev_dbg(dev, "Transmit frame #%d queued in slot %d\n",
dev->name, np->cur_tx, entry); np->cur_tx, entry);
} }
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
...@@ -1074,8 +1073,8 @@ static void netdev_tx_done(struct net_device *dev) ...@@ -1074,8 +1073,8 @@ static void netdev_tx_done(struct net_device *dev)
if (tx_status & 0x8000) { /* There was an error, log it. */ if (tx_status & 0x8000) { /* There was an error, log it. */
#ifndef final_version #ifndef final_version
if (debug > 1) if (debug > 1)
printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n", netdev_dbg(dev, "Transmit error, Tx status %08x\n",
dev->name, tx_status); tx_status);
#endif #endif
np->stats.tx_errors++; np->stats.tx_errors++;
if (tx_status & 0x0104) np->stats.tx_aborted_errors++; if (tx_status & 0x0104) np->stats.tx_aborted_errors++;
...@@ -1087,8 +1086,8 @@ static void netdev_tx_done(struct net_device *dev) ...@@ -1087,8 +1086,8 @@ static void netdev_tx_done(struct net_device *dev)
} else { } else {
#ifndef final_version #ifndef final_version
if (debug > 3) if (debug > 3)
printk(KERN_DEBUG "%s: Transmit slot %d ok, Tx status %08x\n", netdev_dbg(dev, "Transmit slot %d ok, Tx status %08x\n",
dev->name, entry, tx_status); entry, tx_status);
#endif #endif
np->stats.tx_bytes += np->tx_skbuff[entry]->len; np->stats.tx_bytes += np->tx_skbuff[entry]->len;
np->stats.collisions += (tx_status >> 3) & 15; np->stats.collisions += (tx_status >> 3) & 15;
...@@ -1131,8 +1130,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) ...@@ -1131,8 +1130,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
iowrite32(intr_status & 0x001ffff, ioaddr + IntrStatus); iowrite32(intr_status & 0x001ffff, ioaddr + IntrStatus);
if (debug > 4) if (debug > 4)
printk(KERN_DEBUG "%s: Interrupt, status %04x\n", netdev_dbg(dev, "Interrupt, status %04x\n", intr_status);
dev->name, intr_status);
if ((intr_status & (NormalIntr|AbnormalIntr)) == 0) if ((intr_status & (NormalIntr|AbnormalIntr)) == 0)
break; break;
...@@ -1173,8 +1171,8 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) ...@@ -1173,8 +1171,8 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
} while (1); } while (1);
if (debug > 3) if (debug > 3)
printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x\n", netdev_dbg(dev, "exiting interrupt, status=%#4.4x\n",
dev->name, ioread32(ioaddr + IntrStatus)); ioread32(ioaddr + IntrStatus));
return IRQ_RETVAL(handled); return IRQ_RETVAL(handled);
} }
...@@ -1187,8 +1185,8 @@ static int netdev_rx(struct net_device *dev) ...@@ -1187,8 +1185,8 @@ static int netdev_rx(struct net_device *dev)
int work_limit = np->dirty_rx + RX_RING_SIZE - np->cur_rx; int work_limit = np->dirty_rx + RX_RING_SIZE - np->cur_rx;
if (debug > 4) { if (debug > 4) {
printk(KERN_DEBUG " In netdev_rx(), entry %d status %04x\n", netdev_dbg(dev, " In netdev_rx(), entry %d status %04x\n",
entry, np->rx_ring[entry].status); entry, np->rx_ring[entry].status);
} }
/* If EOP is set on the next entry, it's a new packet. Send it up. */ /* If EOP is set on the next entry, it's a new packet. Send it up. */
...@@ -1197,8 +1195,8 @@ static int netdev_rx(struct net_device *dev) ...@@ -1197,8 +1195,8 @@ static int netdev_rx(struct net_device *dev)
s32 status = desc->status; s32 status = desc->status;
if (debug > 4) if (debug > 4)
printk(KERN_DEBUG " netdev_rx() status was %08x\n", netdev_dbg(dev, " netdev_rx() status was %08x\n",
status); status);
if (status < 0) if (status < 0)
break; break;
if ((status & 0x38008300) != 0x0300) { if ((status & 0x38008300) != 0x0300) {
...@@ -1213,8 +1211,8 @@ static int netdev_rx(struct net_device *dev) ...@@ -1213,8 +1211,8 @@ static int netdev_rx(struct net_device *dev)
} else if (status & 0x8000) { } else if (status & 0x8000) {
/* There was a fatal error. */ /* There was a fatal error. */
if (debug > 2) if (debug > 2)
printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n", netdev_dbg(dev, "Receive error, Rx status %08x\n",
dev->name, status); status);
np->stats.rx_errors++; /* end of a packet.*/ np->stats.rx_errors++; /* end of a packet.*/
if (status & 0x0890) np->stats.rx_length_errors++; if (status & 0x0890) np->stats.rx_length_errors++;
if (status & 0x004C) np->stats.rx_frame_errors++; if (status & 0x004C) np->stats.rx_frame_errors++;
...@@ -1227,8 +1225,8 @@ static int netdev_rx(struct net_device *dev) ...@@ -1227,8 +1225,8 @@ static int netdev_rx(struct net_device *dev)
#ifndef final_version #ifndef final_version
if (debug > 4) if (debug > 4)
printk(KERN_DEBUG " netdev_rx() normal Rx pkt length %d status %x\n", netdev_dbg(dev, " netdev_rx() normal Rx pkt length %d status %x\n",
pkt_len, status); pkt_len, status);
#endif #endif
/* Check if the packet is long enough to accept without copying /* Check if the packet is long enough to accept without copying
to a minimally-sized skbuff. */ to a minimally-sized skbuff. */
...@@ -1253,10 +1251,10 @@ static int netdev_rx(struct net_device *dev) ...@@ -1253,10 +1251,10 @@ static int netdev_rx(struct net_device *dev)
#ifndef final_version /* Remove after testing. */ #ifndef final_version /* Remove after testing. */
/* You will want this info for the initial debug. */ /* You will want this info for the initial debug. */
if (debug > 5) if (debug > 5)
printk(KERN_DEBUG " Rx data %pM %pM %02x%02x %pI4\n", netdev_dbg(dev, " Rx data %pM %pM %02x%02x %pI4\n",
&skb->data[0], &skb->data[6], &skb->data[0], &skb->data[6],
skb->data[12], skb->data[13], skb->data[12], skb->data[13],
&skb->data[14]); &skb->data[14]);
#endif #endif
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb); netif_rx(skb);
...@@ -1294,8 +1292,7 @@ static void netdev_error(struct net_device *dev, int intr_status) ...@@ -1294,8 +1292,7 @@ static void netdev_error(struct net_device *dev, int intr_status)
void __iomem *ioaddr = np->base_addr; void __iomem *ioaddr = np->base_addr;
if (debug > 2) if (debug > 2)
printk(KERN_DEBUG "%s: Abnormal event, %08x\n", netdev_dbg(dev, "Abnormal event, %08x\n", intr_status);
dev->name, intr_status);
if (intr_status == 0xffffffff) if (intr_status == 0xffffffff)
return; return;
spin_lock(&np->lock); spin_lock(&np->lock);
...@@ -1315,8 +1312,7 @@ static void netdev_error(struct net_device *dev, int intr_status) ...@@ -1315,8 +1312,7 @@ static void netdev_error(struct net_device *dev, int intr_status)
new = 127; /* load full packet before starting */ new = 127; /* load full packet before starting */
new = (np->csr6 & ~(0x7F << 14)) | (new<<14); new = (np->csr6 & ~(0x7F << 14)) | (new<<14);
#endif #endif
printk(KERN_DEBUG "%s: Tx underflow, new csr6 %08x\n", netdev_dbg(dev, "Tx underflow, new csr6 %08x\n", new);
dev->name, new);
update_csr6(dev, new); update_csr6(dev, new);
} }
if (intr_status & RxDied) { /* Missed a Rx frame. */ if (intr_status & RxDied) { /* Missed a Rx frame. */
...@@ -1489,13 +1485,12 @@ static int netdev_close(struct net_device *dev) ...@@ -1489,13 +1485,12 @@ static int netdev_close(struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
if (debug > 1) { if (debug > 1) {
printk(KERN_DEBUG "%s: Shutting down ethercard, status was %08x Config %08x\n", netdev_dbg(dev, "Shutting down ethercard, status was %08x Config %08x\n",
dev->name, ioread32(ioaddr + IntrStatus), ioread32(ioaddr + IntrStatus),
ioread32(ioaddr + NetworkConfig)); ioread32(ioaddr + NetworkConfig));
printk(KERN_DEBUG "%s: Queue pointers were Tx %d / %d, Rx %d / %d\n", netdev_dbg(dev, "Queue pointers were Tx %d / %d, Rx %d / %d\n",
dev->name, np->cur_tx, np->dirty_tx,
np->cur_tx, np->dirty_tx, np->cur_rx, np->dirty_rx);
np->cur_rx, np->dirty_rx);
} }
/* Stop the chip's Tx and Rx processes. */ /* Stop the chip's Tx and Rx processes. */
......
...@@ -333,7 +333,7 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance) ...@@ -333,7 +333,7 @@ static irqreturn_t xircom_interrupt(int irq, void *dev_instance)
if (link_status_changed(card)) { if (link_status_changed(card)) {
int newlink; int newlink;
printk(KERN_DEBUG "xircom_cb: Link status has changed\n"); netdev_dbg(dev, "Link status has changed\n");
newlink = link_status(card); newlink = link_status(card);
netdev_info(dev, "Link is %d mbit\n", newlink); netdev_info(dev, "Link is %d mbit\n", newlink);
if (newlink) if (newlink)
......
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