Skip to content

Commit

Permalink
tulip: Convert uses of KERN_DEBUG
Browse files Browse the repository at this point in the history
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: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joe Perches authored and David S. Miller committed May 9, 2011
1 parent 163ef0b commit 726b65a
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 182 deletions.
14 changes: 7 additions & 7 deletions drivers/net/tulip/21142.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ void t21142_start_nway(struct net_device *dev)
tp->nway = tp->mediasense = 1;
tp->nwayset = tp->lpar = 0;
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Restarting 21143 autonegotiation, csr14=%08x\n",
dev->name, csr14);
netdev_dbg(dev, "Restarting 21143 autonegotiation, csr14=%08x\n",
csr14);
iowrite32(0x0001, ioaddr + CSR13);
udelay(100);
iowrite32(csr14, ioaddr + CSR14);
Expand Down Expand Up @@ -206,14 +206,14 @@ void t21142_lnk_change(struct net_device *dev, int csr5)
#if 0 /* Restart shouldn't be needed. */
iowrite32(tp->csr6 | RxOn, ioaddr + CSR6);
if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Restarting Tx and Rx, CSR5 is %08x\n",
dev->name, ioread32(ioaddr + CSR5));
netdev_dbg(dev, " Restarting Tx and Rx, CSR5 is %08x\n",
ioread32(ioaddr + CSR5));
#endif
tulip_start_rxtx(tp);
if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Setting CSR6 %08x/%x CSR12 %08x\n",
dev->name, tp->csr6, ioread32(ioaddr + CSR6),
ioread32(ioaddr + CSR12));
netdev_dbg(dev, " Setting CSR6 %08x/%x CSR12 %08x\n",
tp->csr6, ioread32(ioaddr + CSR6),
ioread32(ioaddr + CSR12));
} else if ((tp->nwayset && (csr5 & 0x08000000) &&
(dev->if_port == 3 || dev->if_port == 5) &&
(csr12 & 2) == 2) ||
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/tulip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Makefile for the Linux "Tulip" family network device drivers.
#

ccflags-$(CONFIG_NET_TULIP) := -DDEBUG

obj-$(CONFIG_PCMCIA_XIRCOM) += xircom_cb.o
obj-$(CONFIG_DM9102) += dmfe.o
obj-$(CONFIG_WINBOND_840) += winbond-840.o
Expand Down
47 changes: 21 additions & 26 deletions drivers/net/tulip/de2104x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
u32 status, u32 len)
{
netif_printk(de, rx_err, KERN_DEBUG, de->dev,
"rx err, slot %d status 0x%x len %d\n",
rx_tail, status, len);
netif_dbg(de, rx_err, de->dev,
"rx err, slot %d status 0x%x len %d\n",
rx_tail, status, len);

if ((status & 0x38000300) != 0x0300) {
/* Ingore earlier buffers. */
Expand Down Expand Up @@ -433,10 +433,9 @@ static void de_rx (struct de_private *de)

copying_skb = (len <= rx_copybreak);

if (unlikely(netif_msg_rx_status(de)))
printk(KERN_DEBUG "%s: rx slot %d status 0x%x len %d copying? %d\n",
de->dev->name, rx_tail, status, len,
copying_skb);
netif_dbg(de, rx_status, de->dev,
"rx slot %d status 0x%x len %d copying? %d\n",
rx_tail, status, len, copying_skb);

buflen = copying_skb ? (len + RX_OFFSET) : de->rx_buf_sz;
copy_skb = dev_alloc_skb (buflen);
Expand Down Expand Up @@ -504,10 +503,9 @@ static irqreturn_t de_interrupt (int irq, void *dev_instance)
if ((!(status & (IntrOK|IntrErr))) || (status == 0xFFFF))
return IRQ_NONE;

if (netif_msg_intr(de))
printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n",
dev->name, status, dr32(MacMode),
de->rx_tail, de->tx_head, de->tx_tail);
netif_dbg(de, intr, dev, "intr, status %08x mode %08x desc %u/%u/%u\n",
status, dr32(MacMode),
de->rx_tail, de->tx_head, de->tx_tail);

dw32(MacStatus, status);

Expand Down Expand Up @@ -570,9 +568,9 @@ static void de_tx (struct de_private *de)

if (status & LastFrag) {
if (status & TxError) {
if (netif_msg_tx_err(de))
printk(KERN_DEBUG "%s: tx err, status 0x%x\n",
de->dev->name, status);
netif_dbg(de, tx_err, de->dev,
"tx err, status 0x%x\n",
status);
de->net_stats.tx_errors++;
if (status & TxOWC)
de->net_stats.tx_window_errors++;
Expand All @@ -585,9 +583,8 @@ static void de_tx (struct de_private *de)
} else {
de->net_stats.tx_packets++;
de->net_stats.tx_bytes += skb->len;
if (netif_msg_tx_done(de))
printk(KERN_DEBUG "%s: tx done, slot %d\n",
de->dev->name, tx_tail);
netif_dbg(de, tx_done, de->dev,
"tx done, slot %d\n", tx_tail);
}
dev_kfree_skb_irq(skb);
}
Expand Down Expand Up @@ -644,9 +641,8 @@ static netdev_tx_t de_start_xmit (struct sk_buff *skb,
wmb();

de->tx_head = NEXT_TX(entry);
if (netif_msg_tx_queued(de))
printk(KERN_DEBUG "%s: tx queued, slot %d, skblen %d\n",
dev->name, entry, skb->len);
netif_dbg(de, tx_queued, dev, "tx queued, slot %d, skblen %d\n",
entry, skb->len);

if (tx_free == 0)
netif_stop_queue(dev);
Expand Down Expand Up @@ -1387,7 +1383,7 @@ static int de_open (struct net_device *dev)
struct de_private *de = netdev_priv(dev);
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);

Expand Down Expand Up @@ -1429,7 +1425,7 @@ static int de_close (struct net_device *dev)
struct de_private *de = netdev_priv(dev);
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);

Expand All @@ -1450,10 +1446,9 @@ static void de_tx_timeout (struct net_device *dev)
{
struct de_private *de = netdev_priv(dev);

netdev_printk(KERN_DEBUG, dev,
"NIC status %08x mode %08x sia %08x desc %u/%u/%u\n",
dr32(MacStatus), dr32(MacMode), dr32(SIAStatus),
de->rx_tail, de->tx_head, de->tx_tail);
netdev_dbg(dev, "NIC status %08x mode %08x sia %08x desc %u/%u/%u\n",
dr32(MacStatus), dr32(MacMode), dr32(SIAStatus),
de->rx_tail, de->tx_head, de->tx_tail);

del_timer_sync(&de->media_timer);

Expand Down
48 changes: 24 additions & 24 deletions drivers/net/tulip/interrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ int tulip_poll(struct napi_struct *napi, int budget)
#endif

if (tulip_debug > 4)
printk(KERN_DEBUG " In tulip_rx(), entry %d %08x\n",
entry, tp->rx_ring[entry].status);
netdev_dbg(dev, " In tulip_rx(), entry %d %08x\n",
entry, tp->rx_ring[entry].status);

do {
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;
}
/* Acknowledge current RX interrupt sources. */
Expand All @@ -145,9 +145,9 @@ int tulip_poll(struct napi_struct *napi, int budget)
if (tp->dirty_rx + RX_RING_SIZE == tp->cur_rx)
break;

if (tulip_debug > 5)
printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %08x\n",
dev->name, entry, status);
if (tulip_debug > 5)
netdev_dbg(dev, "In tulip_rx(), entry %d %08x\n",
entry, status);

if (++work_done >= budget)
goto not_done;
Expand Down Expand Up @@ -184,9 +184,9 @@ int tulip_poll(struct napi_struct *napi, int budget)
}
} else {
/* There was a fatal error. */
if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
dev->name, status);
if (tulip_debug > 2)
netdev_dbg(dev, "Receive error, Rx status %08x\n",
status);
dev->stats.rx_errors++; /* end of a packet.*/
if (pkt_len > 1518 ||
(status & RxDescRunt))
Expand Down Expand Up @@ -367,16 +367,16 @@ static int tulip_rx(struct net_device *dev)
int received = 0;

if (tulip_debug > 4)
printk(KERN_DEBUG " In tulip_rx(), entry %d %08x\n",
entry, tp->rx_ring[entry].status);
netdev_dbg(dev, "In tulip_rx(), entry %d %08x\n",
entry, tp->rx_ring[entry].status);
/* If we own the next entry, it is a new packet. Send it up. */
while ( ! (tp->rx_ring[entry].status & cpu_to_le32(DescOwned))) {
s32 status = le32_to_cpu(tp->rx_ring[entry].status);
short pkt_len;

if (tulip_debug > 5)
printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %08x\n",
dev->name, entry, status);
netdev_dbg(dev, "In tulip_rx(), entry %d %08x\n",
entry, status);
if (--rx_work_limit < 0)
break;

Expand Down Expand Up @@ -404,16 +404,16 @@ static int tulip_rx(struct net_device *dev)
/* Ingore earlier buffers. */
if ((status & 0xffff) != 0x7fff) {
if (tulip_debug > 1)
dev_warn(&dev->dev,
"Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
status);
netdev_warn(dev,
"Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
status);
dev->stats.rx_length_errors++;
}
} else {
/* There was a fatal error. */
if (tulip_debug > 2)
printk(KERN_DEBUG "%s: Receive error, Rx status %08x\n",
dev->name, status);
netdev_dbg(dev, "Receive error, Rx status %08x\n",
status);
dev->stats.rx_errors++; /* end of a packet.*/
if (pkt_len > 1518 ||
(status & RxDescRunt))
Expand Down Expand Up @@ -573,8 +573,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
#endif /* CONFIG_TULIP_NAPI */

if (tulip_debug > 4)
printk(KERN_DEBUG "%s: interrupt csr5=%#8.8x new csr5=%#8.8x\n",
dev->name, csr5, ioread32(ioaddr + CSR5));
netdev_dbg(dev, "interrupt csr5=%#8.8x new csr5=%#8.8x\n",
csr5, ioread32(ioaddr + CSR5));


if (csr5 & (TxNoBuf | TxDied | TxIntr | TimerInt)) {
Expand Down Expand Up @@ -605,8 +605,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
/* There was an major error, log it. */
#ifndef final_version
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n",
dev->name, status);
netdev_dbg(dev, "Transmit error, Tx status %08x\n",
status);
#endif
dev->stats.tx_errors++;
if (status & 0x4104)
Expand Down Expand Up @@ -804,8 +804,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance)
}

if (tulip_debug > 4)
printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#04x\n",
dev->name, ioread32(ioaddr + CSR5));
netdev_dbg(dev, "exiting interrupt, csr5=%#04x\n",
ioread32(ioaddr + CSR5));

return IRQ_HANDLED;
}
49 changes: 24 additions & 25 deletions drivers/net/tulip/media.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ void tulip_select_media(struct net_device *dev, int startup)
switch (mleaf->type) {
case 0: /* 21140 non-MII xcvr. */
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Using a 21140 non-MII transceiver with control setting %02x\n",
dev->name, p[1]);
netdev_dbg(dev, "Using a 21140 non-MII transceiver with control setting %02x\n",
p[1]);
dev->if_port = p[0];
if (startup)
iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12);
Expand All @@ -204,15 +204,14 @@ void tulip_select_media(struct net_device *dev, int startup)
struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
unsigned char *rst = rleaf->leafdata;
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Resetting the transceiver\n",
dev->name);
netdev_dbg(dev, "Resetting the transceiver\n");
for (i = 0; i < rst[0]; i++)
iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
}
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: 21143 non-MII %s transceiver control %04x/%04x\n",
dev->name, medianame[dev->if_port],
setup[0], setup[1]);
netdev_dbg(dev, "21143 non-MII %s transceiver control %04x/%04x\n",
medianame[dev->if_port],
setup[0], setup[1]);
if (p[0] & 0x40) { /* SIA (CSR13-15) setup values are provided. */
csr13val = setup[0];
csr14val = setup[1];
Expand All @@ -239,8 +238,8 @@ void tulip_select_media(struct net_device *dev, int startup)
if (startup) iowrite32(csr13val, ioaddr + CSR13);
}
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Setting CSR15 to %08x/%08x\n",
dev->name, csr15dir, csr15val);
netdev_dbg(dev, "Setting CSR15 to %08x/%08x\n",
csr15dir, csr15val);
if (mleaf->type == 4)
new_csr6 = 0x82020000 | ((setup[2] & 0x71) << 18);
else
Expand Down Expand Up @@ -316,9 +315,9 @@ void tulip_select_media(struct net_device *dev, int startup)
if (tp->mii_advertise == 0)
tp->mii_advertise = tp->advertising[phy_num];
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Advertising %04x on MII %d\n",
dev->name, tp->mii_advertise,
tp->phys[phy_num]);
netdev_dbg(dev, " Advertising %04x on MII %d\n",
tp->mii_advertise,
tp->phys[phy_num]);
tulip_mdio_write(dev, tp->phys[phy_num], 4, tp->mii_advertise);
}
break;
Expand All @@ -335,29 +334,29 @@ void tulip_select_media(struct net_device *dev, int startup)
struct medialeaf *rleaf = &mtable->mleaf[mtable->has_reset];
unsigned char *rst = rleaf->leafdata;
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Resetting the transceiver\n",
dev->name);
netdev_dbg(dev, "Resetting the transceiver\n");
for (i = 0; i < rst[0]; i++)
iowrite32(get_u16(rst + 1 + (i<<1)) << 16, ioaddr + CSR15);
}

break;
}
default:
printk(KERN_DEBUG "%s: Invalid media table selection %d\n",
dev->name, mleaf->type);
netdev_dbg(dev, " Invalid media table selection %d\n",
mleaf->type);
new_csr6 = 0x020E0000;
}
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: Using media type %s, CSR12 is %02x\n",
dev->name, medianame[dev->if_port],
netdev_dbg(dev, "Using media type %s, CSR12 is %02x\n",
medianame[dev->if_port],
ioread32(ioaddr + CSR12) & 0xff);
} else if (tp->chip_id == LC82C168) {
if (startup && ! tp->medialock)
dev->if_port = tp->mii_cnt ? 11 : 0;
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: PNIC PHY status is %3.3x, media %s\n",
dev->name, ioread32(ioaddr + 0xB8), medianame[dev->if_port]);
netdev_dbg(dev, "PNIC PHY status is %3.3x, media %s\n",
ioread32(ioaddr + 0xB8),
medianame[dev->if_port]);
if (tp->mii_cnt) {
new_csr6 = 0x810C0000;
iowrite32(0x0001, ioaddr + CSR15);
Expand Down Expand Up @@ -388,9 +387,9 @@ void tulip_select_media(struct net_device *dev, int startup)
} else
new_csr6 = 0x03860000;
if (tulip_debug > 1)
printk(KERN_DEBUG "%s: No media description table, assuming %s transceiver, CSR12 %02x\n",
dev->name, medianame[dev->if_port],
ioread32(ioaddr + CSR12));
netdev_dbg(dev, "No media description table, assuming %s transceiver, CSR12 %02x\n",
medianame[dev->if_port],
ioread32(ioaddr + CSR12));
}

tp->csr6 = new_csr6 | (tp->csr6 & 0xfdff) | (tp->full_duplex ? 0x0200 : 0);
Expand Down Expand Up @@ -504,8 +503,8 @@ void __devinit tulip_find_mii (struct net_device *dev, int board_idx)

/* Fixup for DLink with miswired PHY. */
if (mii_advert != to_advert) {
printk(KERN_DEBUG "tulip%d: Advertising %04x on PHY %d, previously advertising %04x\n",
board_idx, to_advert, phy, mii_advert);
pr_debug("tulip%d: Advertising %04x on PHY %d, previously advertising %04x\n",
board_idx, to_advert, phy, mii_advert);
tulip_mdio_write (dev, phy, 4, to_advert);
}

Expand Down
Loading

0 comments on commit 726b65a

Please sign in to comment.