Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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);
@@ -206,13 +206,13 @@ 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),
			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) &&
+2 −0
Original line number Diff line number Diff line
@@ -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
+21 −26
Original line number Diff line number Diff line
@@ -377,7 +377,7 @@ 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,
	netif_dbg(de, rx_err, de->dev,
		  "rx err, slot %d status 0x%x len %d\n",
		  rx_tail, status, len);

@@ -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);
@@ -504,9 +503,8 @@ 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),
	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);
@@ -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++;
@@ -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);
		}
@@ -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);
@@ -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);

@@ -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);

@@ -1450,8 +1446,7 @@ 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",
	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);

+24 −24
Original line number Diff line number Diff line
@@ -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",
		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. */
@@ -146,8 +146,8 @@ int tulip_poll(struct napi_struct *napi, int budget)
                               break;

		       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 (++work_done >= budget)
                               goto not_done;
@@ -185,8 +185,8 @@ 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);
						netdev_dbg(dev, "Receive error, Rx status %08x\n",
							   status);
					dev->stats.rx_errors++; /* end of a packet.*/
					if (pkt_len > 1518 ||
					    (status & RxDescRunt))
@@ -367,7 +367,7 @@ 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",
		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))) {
@@ -375,8 +375,8 @@ static int tulip_rx(struct net_device *dev)
		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;

@@ -404,7 +404,7 @@ static int tulip_rx(struct net_device *dev)
				/* Ingore earlier buffers. */
				if ((status & 0xffff) != 0x7fff) {
					if (tulip_debug > 1)
						dev_warn(&dev->dev,
						netdev_warn(dev,
							    "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
							    status);
					dev->stats.rx_length_errors++;
@@ -412,8 +412,8 @@ static int tulip_rx(struct net_device *dev)
			} 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))
@@ -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)) {
@@ -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)
@@ -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;
}
+24 −25
Original line number Diff line number Diff line
@@ -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);
@@ -204,14 +204,13 @@ 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],
				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];
@@ -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
@@ -316,8 +315,8 @@ 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,
					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);
			}
@@ -335,8 +334,7 @@ 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);
			}
@@ -344,20 +342,21 @@ void tulip_select_media(struct net_device *dev, int startup)
			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);
@@ -388,8 +387,8 @@ 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],
			netdev_dbg(dev, "No media description table, assuming %s transceiver, CSR12 %02x\n",
				   medianame[dev->if_port],
				   ioread32(ioaddr + CSR12));
	}

@@ -504,7 +503,7 @@ 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",
			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);
		}
Loading