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>
        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);
 #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) ||
 
 # 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
 
 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. */
 
                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);
        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);
 
 
                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++;
                        } 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);
                }
        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);
        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);
 
        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);
 
 {
        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);
 
 
 #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. */
                        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;
                                        }
                               } 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))
        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;
 
                                /* 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))
 #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)) {
                                        /* 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)
        }
 
        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;
 }
 
                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);
                                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];
                                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
                                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;
                                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);
                } 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);
 
                /* 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);
                }
 
 
                        new_csr6 |= 0x00000200;
                }
                if (tulip_debug > 1)
-                       printk(KERN_DEBUG "%s: PNIC autonegotiated status %08x, %s\n",
-                              dev->name, phy_reg, medianame[dev->if_port]);
+                       netdev_dbg(dev, "PNIC autonegotiated status %08x, %s\n",
+                                  phy_reg, medianame[dev->if_port]);
                if (tp->csr6 != new_csr6) {
                        tp->csr6 = new_csr6;
                        /* Restart Tx */
        int phy_reg = ioread32(ioaddr + 0xB8);
 
        if (tulip_debug > 1)
-               printk(KERN_DEBUG "%s: PNIC link changed state %08x, CSR5 %08x\n",
-                      dev->name, phy_reg, csr5);
+               netdev_dbg(dev, "PNIC link changed state %08x, CSR5 %08x\n",
+                          phy_reg, csr5);
        if (ioread32(ioaddr + CSR5) & TPLnkFail) {
                iowrite32((ioread32(ioaddr + CSR7) & ~TPLnkFail) | TPLnkPass, ioaddr + CSR7);
                /* If we use an external MII, then we mustn't use the
                int csr5 = ioread32(ioaddr + CSR5);
 
                if (tulip_debug > 1)
-                       printk(KERN_DEBUG "%s: PNIC timer PHY status %08x, %s CSR5 %08x\n",
-                              dev->name, phy_reg, medianame[dev->if_port], csr5);
+                       netdev_dbg(dev, "PNIC timer PHY status %08x, %s CSR5 %08x\n",
+                                  phy_reg, medianame[dev->if_port], csr5);
                if (phy_reg & 0x04000000) {     /* Remote link fault */
                        iowrite32(0x0201F078, ioaddr + 0xB8);
                        next_tick = 1*HZ;
                        next_tick = 60*HZ;
                } else if (csr5 & TPLnkFail) { /* 100baseTx link beat */
                        if (tulip_debug > 1)
-                               printk(KERN_DEBUG "%s: %s link beat failed, CSR12 %04x, CSR5 %08x, PHY %03x\n",
-                                      dev->name, medianame[dev->if_port],
-                                      csr12,
-                                      ioread32(ioaddr + CSR5),
-                                      ioread32(ioaddr + 0xB8));
+                               netdev_dbg(dev, "%s link beat failed, CSR12 %04x, CSR5 %08x, PHY %03x\n",
+                                          medianame[dev->if_port],
+                                          csr12,
+                                          ioread32(ioaddr + CSR5),
+                                          ioread32(ioaddr + 0xB8));
                        next_tick = 3*HZ;
                        if (tp->medialock) {
                        } else if (tp->nwayset  &&  (dev->if_port & 1)) {
 
         csr14 |= 0x00001184;
 
        if (tulip_debug > 1)
-               printk(KERN_DEBUG "%s: Restarting PNIC2 autonegotiation, csr14=%08x\n",
-                      dev->name, csr14);
+               netdev_dbg(dev, "Restarting PNIC2 autonegotiation, csr14=%08x\n",
+                          csr14);
 
         /* tell pnic2_lnk_change we are doing an nway negotiation */
        dev->if_port = 0;
 
        tp->csr6 = ioread32(ioaddr + CSR6);
        if (tulip_debug > 1)
-               printk(KERN_DEBUG "%s: On Entry to Nway, csr6=%08x\n",
-                      dev->name, tp->csr6);
+               netdev_dbg(dev, "On Entry to Nway, csr6=%08x\n", tp->csr6);
 
         /* mask off any bits not to touch
          * comment at top of file explains mask value
                        iowrite32(1, ioaddr + CSR13);
 
                        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));
 
                        /* now the following actually writes out the
                         * new csr6 values
                /* Link blew? Maybe restart NWay. */
 
                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);
                pnic2_start_nway(dev);
 
        unsigned long flags;
 
        if (tulip_debug > 2) {
-               printk(KERN_DEBUG "%s: Media selection tick, %s, status %08x mode %08x SIA %08x %08x %08x %08x\n",
-                      dev->name, medianame[dev->if_port],
-                      ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR6),
-                      csr12, ioread32(ioaddr + CSR13),
-                      ioread32(ioaddr + CSR14), ioread32(ioaddr + CSR15));
+               netdev_dbg(dev, "Media selection tick, %s, status %08x mode %08x SIA %08x %08x %08x %08x\n",
+                          medianame[dev->if_port],
+                          ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR6),
+                          csr12, ioread32(ioaddr + CSR13),
+                          ioread32(ioaddr + CSR14), ioread32(ioaddr + CSR15));
        }
        switch (tp->chip_id) {
        case DC21140:
                           Assume this a generic MII or SYM transceiver. */
                        next_tick = 60*HZ;
                        if (tulip_debug > 2)
-                               printk(KERN_DEBUG "%s: network media monitor CSR6 %08x CSR12 0x%02x\n",
-                                      dev->name,
-                                      ioread32(ioaddr + CSR6), csr12 & 0xff);
+                               netdev_dbg(dev, "network media monitor CSR6 %08x CSR12 0x%02x\n",
+                                          ioread32(ioaddr + CSR6),
+                                          csr12 & 0xff);
                        break;
                }
                mleaf = &tp->mtable->mleaf[tp->cur_index];
                        s8 bitnum = p[offset];
                        if (p[offset+1] & 0x80) {
                                if (tulip_debug > 1)
-                                       printk(KERN_DEBUG "%s: Transceiver monitor tick CSR12=%#02x, no media sense\n",
-                                              dev->name, csr12);
+                                       netdev_dbg(dev, "Transceiver monitor tick CSR12=%#02x, no media sense\n",
+                                                  csr12);
                                if (mleaf->type == 4) {
                                        if (mleaf->media == 3 && (csr12 & 0x02))
                                                goto select_next_media;
                                break;
                        }
                        if (tulip_debug > 2)
-                               printk(KERN_DEBUG "%s: Transceiver monitor tick: CSR12=%#02x bit %d is %d, expecting %d\n",
-                                      dev->name, csr12, (bitnum >> 1) & 7,
-                                      (csr12 & (1 << ((bitnum >> 1) & 7))) != 0,
-                                      (bitnum >= 0));
+                               netdev_dbg(dev, "Transceiver monitor tick: CSR12=%#02x bit %d is %d, expecting %d\n",
+                                          csr12, (bitnum >> 1) & 7,
+                                          (csr12 & (1 << ((bitnum >> 1) & 7))) != 0,
+                                          (bitnum >= 0));
                        /* Check that the specified bit has the proper value. */
                        if ((bitnum < 0) !=
                                ((csr12 & (1 << ((bitnum >> 1) & 7))) != 0)) {
                                if (tulip_debug > 2)
-                                       printk(KERN_DEBUG "%s: Link beat detected for %s\n",
-                                              dev->name,
-                                              medianame[mleaf->media & MEDIA_MASK]);
+                                       netdev_dbg(dev, "Link beat detected for %s\n",
+                                                  medianame[mleaf->media & MEDIA_MASK]);
                                if ((p[2] & 0x61) == 0x01)      /* Bogus Znyx board. */
                                        goto actually_mii;
                                netif_carrier_on(dev);
                        if (tulip_media_cap[dev->if_port] & MediaIsFD)
                                goto select_next_media; /* Skip FD entries. */
                        if (tulip_debug > 1)
-                               printk(KERN_DEBUG "%s: No link beat on media %s, trying transceiver type %s\n",
-                                      dev->name,
-                                      medianame[mleaf->media & MEDIA_MASK],
-                                      medianame[tp->mtable->mleaf[tp->cur_index].media]);
+                               netdev_dbg(dev, "No link beat on media %s, trying transceiver type %s\n",
+                                          medianame[mleaf->media & MEDIA_MASK],
+                                          medianame[tp->mtable->mleaf[tp->cur_index].media]);
                        tulip_select_media(dev, 0);
                        /* Restart the transmit process. */
                        tulip_restart_rxtx(tp);
        int next_tick = 60*HZ;
 
        if (tulip_debug > 1)
-               printk(KERN_DEBUG "%s: 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], 5));
+               netdev_dbg(dev, "Comet link status %04x partner capability %04x\n",
+                          tulip_mdio_read(dev, tp->phys[0], 1),
+                          tulip_mdio_read(dev, tp->phys[0], 5));
        /* mod_timer synchronizes us with potential add_timer calls
         * from interrupts.
         */
 
                        udelay(10);
 
                if (!i)
-                       printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed"
-                                       " (CSR5 0x%x CSR6 0x%x)\n",
-                                       pci_name(tp->pdev),
-                                       ioread32(ioaddr + CSR5),
-                                       ioread32(ioaddr + CSR6));
+                       netdev_dbg(tp->dev, "tulip_stop_rxtx() failed (CSR5 0x%x CSR6 0x%x)\n",
+                                  ioread32(ioaddr + CSR5),
+                                  ioread32(ioaddr + CSR6));
        }
 }
 
 
        udelay(100);
 
        if (tulip_debug > 1)
-               printk(KERN_DEBUG "%s: tulip_up(), irq==%d\n",
-                      dev->name, dev->irq);
+               netdev_dbg(dev, "tulip_up(), irq==%d\n", dev->irq);
 
        iowrite32(tp->rx_ring_dma, ioaddr + CSR3);
        iowrite32(tp->tx_ring_dma, ioaddr + CSR4);
        iowrite32(0, ioaddr + CSR2);            /* Rx poll demand */
 
        if (tulip_debug > 2) {
-               printk(KERN_DEBUG "%s: Done tulip_up(), CSR0 %08x, CSR5 %08x CSR6 %08x\n",
-                      dev->name, ioread32(ioaddr + CSR0),
-                      ioread32(ioaddr + CSR5),
-                      ioread32(ioaddr + CSR6));
+               netdev_dbg(dev, "Done tulip_up(), CSR0 %08x, CSR5 %08x CSR6 %08x\n",
+                          ioread32(ioaddr + CSR0),
+                          ioread32(ioaddr + CSR5),
+                          ioread32(ioaddr + CSR6));
        }
 
        /* Set the timer to switch to check for link beat and perhaps switch
        tulip_down (dev);
 
        if (tulip_debug > 1)
-               dev_printk(KERN_DEBUG, &dev->dev,
-                          "Shutting down ethercard, status was %02x\n",
+               netdev_dbg(dev, "Shutting down ethercard, status was %02x\n",
                           ioread32 (ioaddr + CSR5));
 
        free_irq (dev->irq, dev);
        u32 csr0;
 
        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;
 
 out:
        tp->csr0 = csr0;
        if (tulip_debug > 2)
-               printk(KERN_DEBUG "%s: MWI config cacheline=%d, csr0=%08x\n",
-                      pci_name(pdev), cache, csr0);
+               netdev_dbg(dev, "MWI config cacheline=%d, csr0=%08x\n",
+                          cache, csr0);
 }
 #endif
 
 
                goto out_err;
 
        if (debug > 1)
-               printk(KERN_DEBUG "%s: w89c840_open() irq %d\n",
-                      dev->name, dev->irq);
+               netdev_dbg(dev, "w89c840_open() irq %d\n", dev->irq);
 
        if((i=alloc_ringdesc(dev)))
                goto out_err;
 
        netif_start_queue(dev);
        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. */
        init_timer(&np->timer);
        void __iomem *ioaddr = np->base_addr;
 
        if (debug > 2)
-               printk(KERN_DEBUG "%s: Media selection timer tick, status %08x config %08x\n",
-                      dev->name, ioread32(ioaddr + IntrStatus),
-                      ioread32(ioaddr + NetworkConfig));
+               netdev_dbg(dev, "Media selection timer tick, status %08x config %08x\n",
+                          ioread32(ioaddr + IntrStatus),
+                          ioread32(ioaddr + NetworkConfig));
        spin_lock_irq(&np->lock);
        update_csr6(dev, update_link(dev));
        spin_unlock_irq(&np->lock);
        spin_unlock_irq(&np->lock);
 
        if (debug > 4) {
-               printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot %d\n",
-                      dev->name, np->cur_tx, entry);
+               netdev_dbg(dev, "Transmit frame #%d queued in slot %d\n",
+                          np->cur_tx, entry);
        }
        return NETDEV_TX_OK;
 }
                if (tx_status & 0x8000) {       /* There was an error, log it. */
 #ifndef final_version
                        if (debug > 1)
-                               printk(KERN_DEBUG "%s: Transmit error, Tx status %08x\n",
-                                      dev->name, tx_status);
+                               netdev_dbg(dev, "Transmit error, Tx status %08x\n",
+                                          tx_status);
 #endif
                        np->stats.tx_errors++;
                        if (tx_status & 0x0104) np->stats.tx_aborted_errors++;
                } else {
 #ifndef final_version
                        if (debug > 3)
-                               printk(KERN_DEBUG "%s: Transmit slot %d ok, Tx status %08x\n",
-                                      dev->name, entry, tx_status);
+                               netdev_dbg(dev, "Transmit slot %d ok, Tx status %08x\n",
+                                          entry, tx_status);
 #endif
                        np->stats.tx_bytes += np->tx_skbuff[entry]->len;
                        np->stats.collisions += (tx_status >> 3) & 15;
                iowrite32(intr_status & 0x001ffff, ioaddr + IntrStatus);
 
                if (debug > 4)
-                       printk(KERN_DEBUG "%s: Interrupt, status %04x\n",
-                              dev->name, intr_status);
+                       netdev_dbg(dev, "Interrupt, status %04x\n", intr_status);
 
                if ((intr_status & (NormalIntr|AbnormalIntr)) == 0)
                        break;
        } while (1);
 
        if (debug > 3)
-               printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x\n",
-                      dev->name, ioread32(ioaddr + IntrStatus));
+               netdev_dbg(dev, "exiting interrupt, status=%#4.4x\n",
+                          ioread32(ioaddr + IntrStatus));
        return IRQ_RETVAL(handled);
 }
 
        int work_limit = np->dirty_rx + RX_RING_SIZE - np->cur_rx;
 
        if (debug > 4) {
-               printk(KERN_DEBUG " In netdev_rx(), entry %d status %04x\n",
-                      entry, np->rx_ring[entry].status);
+               netdev_dbg(dev, " In netdev_rx(), entry %d status %04x\n",
+                          entry, np->rx_ring[entry].status);
        }
 
        /* If EOP is set on the next entry, it's a new packet. Send it up. */
                s32 status = desc->status;
 
                if (debug > 4)
-                       printk(KERN_DEBUG "  netdev_rx() status was %08x\n",
-                              status);
+                       netdev_dbg(dev, "  netdev_rx() status was %08x\n",
+                                  status);
                if (status < 0)
                        break;
                if ((status & 0x38008300) != 0x0300) {
                        } else if (status & 0x8000) {
                                /* There was a fatal error. */
                                if (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);
                                np->stats.rx_errors++; /* end of a packet.*/
                                if (status & 0x0890) np->stats.rx_length_errors++;
                                if (status & 0x004C) np->stats.rx_frame_errors++;
 
 #ifndef final_version
                        if (debug > 4)
-                               printk(KERN_DEBUG "  netdev_rx() normal Rx pkt length %d status %x\n",
-                                      pkt_len, status);
+                               netdev_dbg(dev, "  netdev_rx() normal Rx pkt length %d status %x\n",
+                                          pkt_len, status);
 #endif
                        /* Check if the packet is long enough to accept without copying
                           to a minimally-sized skbuff. */
 #ifndef final_version                          /* Remove after testing. */
                        /* You will want this info for the initial debug. */
                        if (debug > 5)
-                               printk(KERN_DEBUG "  Rx data %pM %pM %02x%02x %pI4\n",
-                                      &skb->data[0], &skb->data[6],
-                                      skb->data[12], skb->data[13],
-                                      &skb->data[14]);
+                               netdev_dbg(dev, "  Rx data %pM %pM %02x%02x %pI4\n",
+                                          &skb->data[0], &skb->data[6],
+                                          skb->data[12], skb->data[13],
+                                          &skb->data[14]);
 #endif
                        skb->protocol = eth_type_trans(skb, dev);
                        netif_rx(skb);
        void __iomem *ioaddr = np->base_addr;
 
        if (debug > 2)
-               printk(KERN_DEBUG "%s: Abnormal event, %08x\n",
-                      dev->name, intr_status);
+               netdev_dbg(dev, "Abnormal event, %08x\n", intr_status);
        if (intr_status == 0xffffffff)
                return;
        spin_lock(&np->lock);
                        new = 127; /* load full packet before starting */
                new = (np->csr6 & ~(0x7F << 14)) | (new<<14);
 #endif
-               printk(KERN_DEBUG "%s: Tx underflow, new csr6 %08x\n",
-                      dev->name, new);
+               netdev_dbg(dev, "Tx underflow, new csr6 %08x\n", new);
                update_csr6(dev, new);
        }
        if (intr_status & RxDied) {             /* Missed a Rx frame. */
        netif_stop_queue(dev);
 
        if (debug > 1) {
-               printk(KERN_DEBUG "%s: Shutting down ethercard, status was %08x Config %08x\n",
-                      dev->name, ioread32(ioaddr + IntrStatus),
-                      ioread32(ioaddr + NetworkConfig));
-               printk(KERN_DEBUG "%s: Queue pointers were Tx %d / %d,  Rx %d / %d\n",
-                      dev->name,
-                      np->cur_tx, np->dirty_tx,
-                      np->cur_rx, np->dirty_rx);
+               netdev_dbg(dev, "Shutting down ethercard, status was %08x Config %08x\n",
+                          ioread32(ioaddr + IntrStatus),
+                          ioread32(ioaddr + NetworkConfig));
+               netdev_dbg(dev, "Queue pointers were Tx %d / %d,  Rx %d / %d\n",
+                          np->cur_tx, np->dirty_tx,
+                          np->cur_rx, np->dirty_rx);
        }
 
        /* Stop the chip's Tx and Rx processes. */
 
 
        if (link_status_changed(card)) {
                int newlink;
-               printk(KERN_DEBUG "xircom_cb: Link status has changed\n");
+               netdev_dbg(dev, "Link status has changed\n");
                newlink = link_status(card);
                netdev_info(dev, "Link is %d mbit\n", newlink);
                if (newlink)