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

Commit 636b8116 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

drivers/net/pcmcia: Use pr_<level> and netdev_<level>



On Mon, 2010-08-09 at 17:34 +0200, Dominik Brodowski wrote:
> look good from a PCMCIA point of view, therefore:
> Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>

If PCMCIA is still being looked after, then here's
another for you, maybe for 2.6.37.

Use the more descriptive logging message styles.

There are whitespace/indentation errors in the original
sources that these changes do not modify, so checkpatch
errors were cheerfully ignored.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 00093fab
Loading
Loading
Loading
Loading
+35 −38
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ earlier 3Com products.

*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
@@ -373,8 +375,8 @@ static int tc574_config(struct pcmcia_device *link)
		for (i = 0; i < 3; i++)
			phys_addr[i] = htons(read_eeprom(ioaddr, i + 10));
		if (phys_addr[0] == htons(0x6060)) {
			printk(KERN_NOTICE "3c574_cs: IO port conflict at 0x%03lx"
				   "-0x%03lx\n", dev->base_addr, dev->base_addr+15);
			pr_notice("IO port conflict at 0x%03lx-0x%03lx\n",
				  dev->base_addr, dev->base_addr+15);
			goto failed;
		}
	}
@@ -388,7 +390,7 @@ static int tc574_config(struct pcmcia_device *link)
		outw(2<<11, ioaddr + RunnerRdCtrl);
		mcr = inb(ioaddr + 2);
		outw(0<<11, ioaddr + RunnerRdCtrl);
		printk(KERN_INFO "  ASIC rev %d,", mcr>>3);
		pr_info("  ASIC rev %d,", mcr>>3);
		EL3WINDOW(3);
		config = inl(ioaddr + Wn3_Config);
		lp->default_media = (config & Xcvr) >> Xcvr_shift;
@@ -425,7 +427,7 @@ static int tc574_config(struct pcmcia_device *link)
			}
		}
		if (phy > 32) {
			printk(KERN_NOTICE "  No MII transceivers found!\n");
			pr_notice("  No MII transceivers found!\n");
			goto failed;
		}
		i = mdio_read(ioaddr, lp->phys, 16) | 0x40;
@@ -441,15 +443,13 @@ static int tc574_config(struct pcmcia_device *link)
	SET_NETDEV_DEV(dev, &link->dev);

	if (register_netdev(dev) != 0) {
		printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n");
		pr_notice("register_netdev() failed\n");
		goto failed;
	}

	printk(KERN_INFO "%s: %s at io %#3lx, irq %d, "
	       "hw_addr %pM.\n",
	       dev->name, cardname, dev->base_addr, dev->irq,
	       dev->dev_addr);
	printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n",
	netdev_info(dev, "%s at io %#3lx, irq %d, hw_addr %pM\n",
		    cardname, dev->base_addr, dev->irq, dev->dev_addr);
	netdev_info(dev, " %dK FIFO split %s Rx:Tx, %sMII interface.\n",
		    8 << config & Ram_size,
		    ram_split[(config & Ram_split) >> Ram_split_shift],
		    config & Autoselect ? "autoselect " : "");
@@ -499,13 +499,13 @@ static void dump_status(struct net_device *dev)
{
	unsigned int ioaddr = dev->base_addr;
	EL3WINDOW(1);
	printk(KERN_INFO "  irq status %04x, rx status %04x, tx status "
		   "%02x, tx free %04x\n", inw(ioaddr+EL3_STATUS),
	netdev_info(dev, "  irq status %04x, rx status %04x, tx status %02x, tx free %04x\n",
		    inw(ioaddr+EL3_STATUS),
		    inw(ioaddr+RxStatus), inb(ioaddr+TxStatus),
		    inw(ioaddr+TxFree));
	EL3WINDOW(4);
	printk(KERN_INFO "  diagnostics: fifo %04x net %04x ethernet %04x"
		   " media %04x\n", inw(ioaddr+0x04), inw(ioaddr+0x06),
	netdev_info(dev, "  diagnostics: fifo %04x net %04x ethernet %04x media %04x\n",
		    inw(ioaddr+0x04), inw(ioaddr+0x06),
		    inw(ioaddr+0x08), inw(ioaddr+0x0a));
	EL3WINDOW(1);
}
@@ -520,7 +520,7 @@ static void tc574_wait_for_completion(struct net_device *dev, int cmd)
	while (--i > 0)
		if (!(inw(dev->base_addr + EL3_STATUS) & 0x1000)) break;
	if (i == 0)
		printk(KERN_NOTICE "%s: command 0x%04x did not complete!\n", dev->name, cmd);
		netdev_notice(dev, "command 0x%04x did not complete!\n", cmd);
}

/* Read a word from the EEPROM using the regular EEPROM access register.
@@ -722,7 +722,7 @@ static void el3_tx_timeout(struct net_device *dev)
{
	unsigned int ioaddr = dev->base_addr;
	
	printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name);
	netdev_notice(dev, "Transmit timed out!\n");
	dump_status(dev);
	dev->stats.tx_errors++;
	dev->trans_start = jiffies; /* prevent tx timeout */
@@ -845,8 +845,8 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
				EL3WINDOW(4);
				fifo_diag = inw(ioaddr + Wn4_FIFODiag);
				EL3WINDOW(1);
				printk(KERN_NOTICE "%s: adapter failure, FIFO diagnostic"
					   " register %04x.\n", dev->name, fifo_diag);
				netdev_notice(dev, "adapter failure, FIFO diagnostic register %04x\n",
					      fifo_diag);
				if (fifo_diag & 0x0400) {
					/* Tx overrun */
					tc574_wait_for_completion(dev, TxReset);
@@ -900,7 +900,7 @@ static void media_check(unsigned long arg)
	   this, we can limp along even if the interrupt is blocked */
	if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) {
		if (!lp->fast_poll)
			printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name);
			netdev_info(dev, "interrupt(s) dropped!\n");

		local_irq_save(flags);
		el3_interrupt(dev->irq, dev);
@@ -923,23 +923,21 @@ static void media_check(unsigned long arg)
	
	if (media != lp->media_status) {
		if ((media ^ lp->media_status) & 0x0004)
			printk(KERN_INFO "%s: %s link beat\n", dev->name,
			netdev_info(dev, "%s link beat\n",
				    (lp->media_status & 0x0004) ? "lost" : "found");
		if ((media ^ lp->media_status) & 0x0020) {
			lp->partner = 0;
			if (lp->media_status & 0x0020) {
				printk(KERN_INFO "%s: autonegotiation restarted\n",
					   dev->name);
				netdev_info(dev, "autonegotiation restarted\n");
			} else if (partner) {
				partner &= lp->advertising;
				lp->partner = partner;
				printk(KERN_INFO "%s: autonegotiation complete: "
					   "%sbaseT-%cD selected\n", dev->name,
					   ((partner & 0x0180) ? "100" : "10"),
					   ((partner & 0x0140) ? 'F' : 'H'));
				netdev_info(dev, "autonegotiation complete: "
					    "%dbaseT-%cD selected\n",
					    (partner & 0x0180) ? 100 : 10,
					    (partner & 0x0140) ? 'F' : 'H');
			} else {
				printk(KERN_INFO "%s: link partner did not autonegotiate\n",
					   dev->name);
				netdev_info(dev, "link partner did not autonegotiate\n");
			}

			EL3WINDOW(3);
@@ -949,10 +947,9 @@ static void media_check(unsigned long arg)

		}
		if (media & 0x0010)
			printk(KERN_INFO "%s: remote fault detected\n",
				   dev->name);
			netdev_info(dev, "remote fault detected\n");
		if (media & 0x0002)
			printk(KERN_INFO "%s: jabber detected\n", dev->name);
			netdev_info(dev, "jabber detected\n");
		lp->media_status = media;
	}
	spin_unlock_irqrestore(&lp->window_lock, flags);
+7 −6
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@

======================================================================*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#define DRV_NAME	"3c589_cs"
#define DRV_VERSION	"1.162-ac"

@@ -273,8 +275,7 @@ static int tc589_config(struct pcmcia_device *link)
    phys_addr = (__be16 *)dev->dev_addr;
    /* Is this a 3c562? */
    if (link->manf_id != MANFID_3COM)
	    printk(KERN_INFO "3c589_cs: hmmm, is this really a "
		   "3Com card??\n");
	    dev_info(&link->dev, "hmmm, is this really a 3Com card??\n");
    multi = (link->card_id == PRODID_3COM_3C562);

    link->io_lines = 16;
@@ -315,8 +316,8 @@ static int tc589_config(struct pcmcia_device *link)
	for (i = 0; i < 3; i++)
	    phys_addr[i] = htons(read_eeprom(ioaddr, i));
	if (phys_addr[0] == htons(0x6060)) {
	    printk(KERN_ERR "3c589_cs: IO port conflict at 0x%03lx"
		   "-0x%03lx\n", dev->base_addr, dev->base_addr+15);
	    dev_err(&link->dev, "IO port conflict at 0x%03lx-0x%03lx\n",
		    dev->base_addr, dev->base_addr+15);
	    goto failed;
	}
    }
@@ -330,12 +331,12 @@ static int tc589_config(struct pcmcia_device *link)
    if ((if_port >= 0) && (if_port <= 3))
	dev->if_port = if_port;
    else
	printk(KERN_ERR "3c589_cs: invalid if_port requested\n");
	dev_err(&link->dev, "invalid if_port requested\n");

    SET_NETDEV_DEV(dev, &link->dev);

    if (register_netdev(dev) != 0) {
	printk(KERN_ERR "3c589_cs: register_netdev() failed\n");
	    dev_err(&link->dev, "register_netdev() failed\n");
	goto failed;
    }

+88 −76
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@

======================================================================*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
@@ -344,8 +346,8 @@ static int axnet_config(struct pcmcia_device *link)
    dev->base_addr = link->resource[0]->start;

    if (!get_prom(link)) {
	printk(KERN_NOTICE "axnet_cs: this is not an AX88190 card!\n");
	printk(KERN_NOTICE "axnet_cs: use pcnet_cs instead.\n");
	pr_notice("this is not an AX88190 card!\n");
	pr_notice("use pcnet_cs instead.\n");
	goto failed;
    }

@@ -390,19 +392,18 @@ static int axnet_config(struct pcmcia_device *link)
    SET_NETDEV_DEV(dev, &link->dev);

    if (register_netdev(dev) != 0) {
	printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n");
	pr_notice("register_netdev() failed\n");
	goto failed;
    }

    printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, "
	   "hw_addr %pM\n",
	   dev->name, ((info->flags & IS_AX88790) ? 7 : 1),
	   dev->base_addr, dev->irq,
	   dev->dev_addr);
    netdev_info(dev, "Asix AX88%d90: io %#3lx, irq %d, hw_addr %pM\n",
		((info->flags & IS_AX88790) ? 7 : 1),
		dev->base_addr, dev->irq, dev->dev_addr);
    if (info->phy_id != -1) {
	dev_dbg(&link->dev, "  MII transceiver at index %d, status %x.\n", info->phy_id, j);
	netdev_dbg(dev, "  MII transceiver at index %d, status %x\n",
		   info->phy_id, j);
    } else {
	printk(KERN_NOTICE "  No MII transceivers found!\n");
	netdev_notice(dev, "  No MII transceivers found!\n");
    }
    return 0;

@@ -582,8 +583,7 @@ static void axnet_reset_8390(struct net_device *dev)
    outb_p(ENISR_RESET, nic_base + EN0_ISR); /* Ack intr. */
    
    if (i == 100)
	printk(KERN_ERR "%s: axnet_reset_8390() did not complete.\n",
	       dev->name);
	netdev_err(dev, "axnet_reset_8390() did not complete\n");
    
} /* axnet_reset_8390 */

@@ -610,7 +610,7 @@ static void ei_watchdog(u_long arg)
       this, we can limp along even if the interrupt is blocked */
    if (info->stale++ && (inb_p(nic_base + EN0_ISR) & ENISR_ALL)) {
	if (!info->fast_poll)
	    printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name);
	    netdev_info(dev, "interrupt(s) dropped!\n");
	ei_irq_wrapper(dev->irq, dev);
	info->fast_poll = HZ;
    }
@@ -625,7 +625,7 @@ static void ei_watchdog(u_long arg)
	goto reschedule;
    link = mdio_read(mii_addr, info->phy_id, 1);
    if (!link || (link == 0xffff)) {
	printk(KERN_INFO "%s: MII is missing!\n", dev->name);
	netdev_info(dev, "MII is missing!\n");
	info->phy_id = -1;
	goto reschedule;
    }
@@ -633,18 +633,14 @@ static void ei_watchdog(u_long arg)
    link &= 0x0004;
    if (link != info->link_status) {
	u_short p = mdio_read(mii_addr, info->phy_id, 5);
	printk(KERN_INFO "%s: %s link beat\n", dev->name,
	       (link) ? "found" : "lost");
	netdev_info(dev, "%s link beat\n", link ? "found" : "lost");
	if (link) {
	    info->duplex_flag = (p & 0x0140) ? 0x80 : 0x00;
	    if (p)
		printk(KERN_INFO "%s: autonegotiation complete: "
		       "%sbaseT-%cD selected\n", dev->name,
		       ((p & 0x0180) ? "100" : "10"),
		       ((p & 0x0140) ? 'F' : 'H'));
		netdev_info(dev, "autonegotiation complete: %dbaseT-%cD selected\n",
			    (p & 0x0180) ? 100 : 10, (p & 0x0140) ? 'F' : 'H');
	    else
		printk(KERN_INFO "%s: link partner did not autonegotiate\n",
		       dev->name);
		netdev_info(dev, "link partner did not autonegotiate\n");
	    AX88190_init(dev, 1);
	}
	info->link_status = link;
@@ -842,9 +838,6 @@ module_exit(exit_axnet_cs);

  */

static const char version_8390[] = KERN_INFO \
    "8390.c:v1.10cvs 9/23/94 Donald Becker (becker@scyld.com)\n";

#include <linux/bitops.h>
#include <asm/irq.h>
#include <linux/fcntl.h>
@@ -991,9 +984,11 @@ static void axnet_tx_timeout(struct net_device *dev)
	isr = inb(e8390_base+EN0_ISR);
	spin_unlock_irqrestore(&ei_local->page_lock, flags);

	printk(KERN_DEBUG "%s: Tx timed out, %s TSR=%#2x, ISR=%#2x, t=%d.\n",
		dev->name, (txsr & ENTSR_ABT) ? "excess collisions." :
		(isr) ? "lost interrupt?" : "cable problem?", txsr, isr, tickssofar);
	netdev_printk(KERN_DEBUG, dev,
		      "Tx timed out, %s TSR=%#2x, ISR=%#2x, t=%d.\n",
		      (txsr & ENTSR_ABT) ? "excess collisions." :
		      (isr) ? "lost interrupt?" : "cable problem?",
		      txsr, isr, tickssofar);

	if (!isr && !dev->stats.tx_packets) 
	{
@@ -1063,22 +1058,28 @@ static netdev_tx_t axnet_start_xmit(struct sk_buff *skb,
		output_page = ei_local->tx_start_page;
		ei_local->tx1 = send_length;
		if (ei_debug  &&  ei_local->tx2 > 0)
			printk(KERN_DEBUG "%s: idle transmitter tx2=%d, lasttx=%d, txing=%d.\n",
				dev->name, ei_local->tx2, ei_local->lasttx, ei_local->txing);
			netdev_printk(KERN_DEBUG, dev,
				      "idle transmitter tx2=%d, lasttx=%d, txing=%d\n",
				      ei_local->tx2, ei_local->lasttx,
				      ei_local->txing);
	}
	else if (ei_local->tx2 == 0) 
	{
		output_page = ei_local->tx_start_page + TX_PAGES/2;
		ei_local->tx2 = send_length;
		if (ei_debug  &&  ei_local->tx1 > 0)
			printk(KERN_DEBUG "%s: idle transmitter, tx1=%d, lasttx=%d, txing=%d.\n",
				dev->name, ei_local->tx1, ei_local->lasttx, ei_local->txing);
			netdev_printk(KERN_DEBUG, dev,
				      "idle transmitter, tx1=%d, lasttx=%d, txing=%d\n",
				      ei_local->tx1, ei_local->lasttx,
				      ei_local->txing);
	}
	else
	{	/* We should never get here. */
		if (ei_debug)
			printk(KERN_DEBUG "%s: No Tx buffers free! tx1=%d tx2=%d last=%d\n",
				dev->name, ei_local->tx1, ei_local->tx2, ei_local->lasttx);
			netdev_printk(KERN_DEBUG, dev,
				      "No Tx buffers free! tx1=%d tx2=%d last=%d\n",
				      ei_local->tx1, ei_local->tx2,
				      ei_local->lasttx);
		ei_local->irqlock = 0;
		netif_stop_queue(dev);
		outb_p(ENISR_ALL, e8390_base + EN0_IMR);
@@ -1166,14 +1167,17 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
	 
	spin_lock_irqsave(&ei_local->page_lock, flags);

	if (ei_local->irqlock) 
	{
	if (ei_local->irqlock) {
#if 1 /* This might just be an interrupt for a PCI device sharing this line */
		const char *msg;
		/* The "irqlock" check is only for testing. */
		printk(ei_local->irqlock
			   ? "%s: Interrupted while interrupts are masked! isr=%#2x imr=%#2x.\n"
			   : "%s: Reentering the interrupt handler! isr=%#2x imr=%#2x.\n",
			   dev->name, inb_p(e8390_base + EN0_ISR),
		if (ei_local->irqlock)
			msg = "Interrupted while interrupts are masked!";
		else
			msg = "Reentering the interrupt handler!";
		netdev_info(dev, "%s, isr=%#2x imr=%#2x\n",
			    msg,
			    inb_p(e8390_base + EN0_ISR),
			    inb_p(e8390_base + EN0_IMR));
#endif
		spin_unlock_irqrestore(&ei_local->page_lock, flags);
@@ -1181,7 +1185,7 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
	}
    
	if (ei_debug > 3)
		printk(KERN_DEBUG "%s: interrupt(isr=%#2.2x).\n", dev->name,
		netdev_printk(KERN_DEBUG, dev, "interrupt(isr=%#2.2x)\n",
			      inb_p(e8390_base + EN0_ISR));

	outb_p(0x00, e8390_base + EN0_ISR);
@@ -1193,7 +1197,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
	{
		if (!netif_running(dev) || (interrupts == 0xff)) {
			if (ei_debug > 1)
				printk(KERN_WARNING "%s: interrupt from stopped card\n", dev->name);
				netdev_warn(dev,
					    "interrupt from stopped card\n");
			outb_p(interrupts, e8390_base + EN0_ISR);
			interrupts = 0;
			break;
@@ -1236,11 +1241,12 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
		{
			/* 0xFF is valid for a card removal */
			if(interrupts!=0xFF)
				printk(KERN_WARNING "%s: Too much work at interrupt, status %#2.2x\n",
				   dev->name, interrupts);
				netdev_warn(dev, "Too much work at interrupt, status %#2.2x\n",
					    interrupts);
			outb_p(ENISR_ALL, e8390_base + EN0_ISR); /* Ack. most intrs. */
		} else {
			printk(KERN_WARNING "%s: unknown interrupt %#2x\n", dev->name, interrupts);
			netdev_warn(dev, "unknown interrupt %#2x\n",
				    interrupts);
			outb_p(0xff, e8390_base + EN0_ISR); /* Ack. all intrs. */
		}
	}
@@ -1274,18 +1280,19 @@ static void ei_tx_err(struct net_device *dev)
	unsigned char tx_was_aborted = txsr & (ENTSR_ABT+ENTSR_FU);

#ifdef VERBOSE_ERROR_DUMP
	printk(KERN_DEBUG "%s: transmitter error (%#2x): ", dev->name, txsr);
	netdev_printk(KERN_DEBUG, dev,
		      "transmitter error (%#2x):", txsr);
	if (txsr & ENTSR_ABT)
		printk("excess-collisions ");
		pr_cont(" excess-collisions");
	if (txsr & ENTSR_ND)
		printk("non-deferral ");
		pr_cont(" non-deferral");
	if (txsr & ENTSR_CRS)
		printk("lost-carrier ");
		pr_cont(" lost-carrier");
	if (txsr & ENTSR_FU)
		printk("FIFO-underrun ");
		pr_cont(" FIFO-underrun");
	if (txsr & ENTSR_CDH)
		printk("lost-heartbeat ");
	printk("\n");
		pr_cont(" lost-heartbeat");
	pr_cont("\n");
#endif

	if (tx_was_aborted)
@@ -1322,8 +1329,9 @@ static void ei_tx_intr(struct net_device *dev)
	if (ei_local->tx1 < 0) 
	{
		if (ei_local->lasttx != 1 && ei_local->lasttx != -1)
			printk(KERN_ERR "%s: bogus last_tx_buffer %d, tx1=%d.\n",
				ei_local->name, ei_local->lasttx, ei_local->tx1);
			netdev_err(dev, "%s: bogus last_tx_buffer %d, tx1=%d\n",
				   ei_local->name, ei_local->lasttx,
				   ei_local->tx1);
		ei_local->tx1 = 0;
		if (ei_local->tx2 > 0) 
		{
@@ -1338,8 +1346,9 @@ static void ei_tx_intr(struct net_device *dev)
	else if (ei_local->tx2 < 0) 
	{
		if (ei_local->lasttx != 2  &&  ei_local->lasttx != -2)
			printk("%s: bogus last_tx_buffer %d, tx2=%d.\n",
				ei_local->name, ei_local->lasttx, ei_local->tx2);
			netdev_info(dev, "%s: bogus last_tx_buffer %d, tx2=%d\n",
				    ei_local->name, ei_local->lasttx,
				    ei_local->tx2);
		ei_local->tx2 = 0;
		if (ei_local->tx1 > 0) 
		{
@@ -1352,8 +1361,9 @@ static void ei_tx_intr(struct net_device *dev)
		else
			ei_local->lasttx = 10, ei_local->txing = 0;
	}
//	else printk(KERN_WARNING "%s: unexpected TX-done interrupt, lasttx=%d.\n",
//			dev->name, ei_local->lasttx);
//	else
//		netdev_warn(dev, "unexpected TX-done interrupt, lasttx=%d\n",
//			    ei_local->lasttx);

	/* Minimize Tx latency: update the statistics after we restart TXing. */
	if (status & ENTSR_COL)
@@ -1416,8 +1426,8 @@ static void ei_receive(struct net_device *dev)
		   is that some clones crash in roughly the same way.
		 */
		if (ei_debug > 0  &&  this_frame != ei_local->current_page && (this_frame!=0x0 || rxing_page!=0xFF))
			printk(KERN_ERR "%s: mismatched read page pointers %2x vs %2x.\n",
				   dev->name, this_frame, ei_local->current_page);
		    netdev_err(dev, "mismatched read page pointers %2x vs %2x\n",
			       this_frame, ei_local->current_page);
		
		if (this_frame == rxing_page)	/* Read all the frames? */
			break;				/* Done for now */
@@ -1433,8 +1443,9 @@ static void ei_receive(struct net_device *dev)
		if (pkt_len < 60  ||  pkt_len > 1518) 
		{
			if (ei_debug)
				printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n",
					   dev->name, rx_frame.count, rx_frame.status,
				netdev_printk(KERN_DEBUG, dev,
					      "bogus packet size: %d, status=%#2x nxpg=%#2x\n",
					      rx_frame.count, rx_frame.status,
					      rx_frame.next);
			dev->stats.rx_errors++;
			dev->stats.rx_length_errors++;
@@ -1447,8 +1458,9 @@ static void ei_receive(struct net_device *dev)
			if (skb == NULL) 
			{
				if (ei_debug > 1)
					printk(KERN_DEBUG "%s: Couldn't allocate a sk_buff of size %d.\n",
						   dev->name, pkt_len);
					netdev_printk(KERN_DEBUG, dev,
						      "Couldn't allocate a sk_buff of size %d\n",
						      pkt_len);
				dev->stats.rx_dropped++;
				break;
			}
@@ -1468,8 +1480,9 @@ static void ei_receive(struct net_device *dev)
		else 
		{
			if (ei_debug)
				printk(KERN_DEBUG "%s: bogus packet: status=%#2x nxpg=%#2x size=%d\n",
					   dev->name, rx_frame.status, rx_frame.next,
				netdev_printk(KERN_DEBUG, dev,
					      "bogus packet: status=%#2x nxpg=%#2x size=%d\n",
					      rx_frame.status, rx_frame.next,
					      rx_frame.count);
			dev->stats.rx_errors++;
			/* NB: The NIC counts CRC, frame and missed errors. */
@@ -1480,7 +1493,7 @@ static void ei_receive(struct net_device *dev)
		
		/* This _should_ never happen: it's here for avoiding bad clones. */
		if (next_frame >= ei_local->stop_page) {
			printk("%s: next frame inconsistency, %#2x\n", dev->name,
			netdev_info(dev, "next frame inconsistency, %#2x\n",
				    next_frame);
			next_frame = ei_local->rx_start_page;
		}
@@ -1516,7 +1529,7 @@ static void ei_rx_overrun(struct net_device *dev)
	outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD);
    
	if (ei_debug > 1)
		printk(KERN_DEBUG "%s: Receiver overrun.\n", dev->name);
		netdev_printk(KERN_DEBUG, dev, "Receiver overrun\n");
	dev->stats.rx_over_errors++;
    
	/* 
@@ -1713,7 +1726,7 @@ static void AX88190_init(struct net_device *dev, int startp)
	{
		outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i));
		if(inb_p(e8390_base + EN1_PHYS_SHIFT(i))!=dev->dev_addr[i])
			printk(KERN_ERR "Hw. address read/write mismap %d\n",i);
			netdev_err(dev, "Hw. address read/write mismap %d\n", i);
	}

	outb_p(ei_local->rx_start_page, e8390_base + EN1_CURPAG);
@@ -1750,8 +1763,7 @@ static void NS8390_trigger_send(struct net_device *dev, unsigned int length,
    
	if (inb_p(e8390_base) & E8390_TRANS) 
	{
		printk(KERN_WARNING "%s: trigger_send() called with the transmitter busy.\n",
			dev->name);
		netdev_warn(dev, "trigger_send() called with the transmitter busy\n");
		return;
	}
	outb_p(length & 0xff, e8390_base + EN0_TCNTLO);
+14 −18
Original line number Diff line number Diff line
@@ -52,23 +52,23 @@

#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n"

#ifdef DEBUG

static void regdump(struct net_device *dev)
{
#ifdef DEBUG
    int ioaddr = dev->base_addr;
    int count;
    
    printk("com20020 register dump:\n");
    netdev_dbg(dev, "register dump:\n");
    for (count = ioaddr; count < ioaddr + 16; count++)
    {
	if (!(count % 16))
	    printk("\n%04X: ", count);
	printk("%02X ", inb(count));
	    pr_cont("%04X:", count);
	pr_cont(" %02X", inb(count));
    }
    printk("\n");
    pr_cont("\n");
    
    printk("buffer0 dump:\n");
    netdev_dbg(dev, "buffer0 dump:\n");
	/* set up the address register */
        count = 0;
	outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI);
@@ -77,19 +77,15 @@ static void regdump(struct net_device *dev)
    for (count = 0; count < 256+32; count++)
    {
	if (!(count % 16))
	    printk("\n%04X: ", count);
	    pr_cont("%04X:", count);
	
	/* copy the data */
	printk("%02X ", inb(_MEMDATA));
	pr_cont(" %02X", inb(_MEMDATA));
    }
    printk("\n");
    pr_cont("\n");
#endif
}

#else

static inline void regdump(struct net_device *dev) { }

#endif


/*====================================================================*/
@@ -301,13 +297,13 @@ static int com20020_config(struct pcmcia_device *link)
    i = com20020_found(dev, 0);	/* calls register_netdev */
    
    if (i != 0) {
	dev_printk(KERN_NOTICE, &link->dev,
		"com20020_cs: com20020_found() failed\n");
	dev_notice(&link->dev,
		   "com20020_found() failed\n");
	goto failed;
    }

    dev_dbg(&link->dev,KERN_INFO "%s: port %#3lx, irq %d\n",
           dev->name, dev->base_addr, dev->irq);
    netdev_dbg(dev, "port %#3lx, irq %d\n",
	       dev->base_addr, dev->irq);
    return 0;

failed:
+30 −30
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@
   
======================================================================*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#define DRV_NAME	"fmvj18x_cs"
#define DRV_VERSION	"2.9"

@@ -291,7 +293,7 @@ static int mfc_try_io_port(struct pcmcia_device *link)
	link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
	if (link->resource[1]->start == 0) {
	    link->resource[1]->end = 0;
	    printk(KERN_NOTICE "fmvj18x_cs: out of resource for serial\n");
	    pr_notice("out of resource for serial\n");
	}
	ret = pcmcia_request_io(link);
	if (ret == 0)
@@ -503,7 +505,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
    case XXX10304:
	/* Read MACID from Buggy CIS */
	if (fmvj18x_get_hwinfo(link, buggybuf) == -1) {
	    printk(KERN_NOTICE "fmvj18x_cs: unable to read hardware net address.\n");
	    pr_notice("unable to read hardware net address\n");
	    goto failed;
	}
	for (i = 0 ; i < 6; i++) {
@@ -524,14 +526,13 @@ static int fmvj18x_config(struct pcmcia_device *link)
    SET_NETDEV_DEV(dev, &link->dev);

    if (register_netdev(dev) != 0) {
	printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n");
	pr_notice("register_netdev() failed\n");
	goto failed;
    }

    /* print current configuration */
    printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, "
	   "hw_addr %pM\n",
	   dev->name, card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2", 
    netdev_info(dev, "%s, sram %s, port %#3lx, irq %d, hw_addr %pM\n",
		card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2",
		dev->base_addr, dev->irq, dev->dev_addr);

    return 0;
@@ -606,7 +607,7 @@ static int fmvj18x_setup_mfc(struct pcmcia_device *link)

    lp->base = ioremap(req.Base, req.Size);
    if (lp->base == NULL) {
	printk(KERN_NOTICE "fmvj18x_cs: ioremap failed\n");
	netdev_notice(dev, "ioremap failed\n");
	return -1;
    }

@@ -800,17 +801,16 @@ static void fjn_tx_timeout(struct net_device *dev)
    struct local_info_t *lp = netdev_priv(dev);
    unsigned int ioaddr = dev->base_addr;

    printk(KERN_NOTICE "%s: transmit timed out with status %04x, %s?\n",
	   dev->name, htons(inw(ioaddr + TX_STATUS)),
    netdev_notice(dev, "transmit timed out with status %04x, %s?\n",
		  htons(inw(ioaddr + TX_STATUS)),
		  inb(ioaddr + TX_STATUS) & F_TMT_RDY
		  ? "IRQ conflict" : "network cable problem");
    printk(KERN_NOTICE "%s: timeout registers: %04x %04x %04x "
    netdev_notice(dev, "timeout registers: %04x %04x %04x "
		  "%04x %04x %04x %04x %04x.\n",
	   dev->name, htons(inw(ioaddr + 0)),
	   htons(inw(ioaddr + 2)), htons(inw(ioaddr + 4)),
	   htons(inw(ioaddr + 6)), htons(inw(ioaddr + 8)),
	   htons(inw(ioaddr +10)), htons(inw(ioaddr +12)),
	   htons(inw(ioaddr +14)));
		  htons(inw(ioaddr + 0)), htons(inw(ioaddr + 2)),
		  htons(inw(ioaddr + 4)), htons(inw(ioaddr + 6)),
		  htons(inw(ioaddr + 8)), htons(inw(ioaddr + 10)),
		  htons(inw(ioaddr + 12)), htons(inw(ioaddr + 14)));
    dev->stats.tx_errors++;
    /* ToDo: We should try to restart the adaptor... */
    local_irq_disable();
@@ -845,13 +845,13 @@ static netdev_tx_t fjn_start_xmit(struct sk_buff *skb,
	unsigned char *buf = skb->data;

	if (length > ETH_FRAME_LEN) {
	    printk(KERN_NOTICE "%s: Attempting to send a large packet"
		   " (%d bytes).\n", dev->name, length);
	    netdev_notice(dev, "Attempting to send a large packet (%d bytes)\n",
			  length);
	    return NETDEV_TX_BUSY;
	}

	pr_debug("%s: Transmitting a packet of length %lu.\n",
	      dev->name, (unsigned long)skb->len);
	netdev_dbg(dev, "Transmitting a packet of length %lu\n",
		   (unsigned long)skb->len);
	dev->stats.tx_bytes += skb->len;

	/* Disable both interrupts. */
@@ -904,7 +904,7 @@ static void fjn_reset(struct net_device *dev)
    unsigned int ioaddr = dev->base_addr;
    int i;

    pr_debug("fjn_reset(%s) called.\n",dev->name);
    netdev_dbg(dev, "fjn_reset() called\n");

    /* Reset controller */
    if( sram_config == 0 ) 
@@ -988,8 +988,8 @@ static void fjn_rx(struct net_device *dev)
    while ((inb(ioaddr + RX_MODE) & F_BUF_EMP) == 0) {
	u_short status = inw(ioaddr + DATAPORT);

	pr_debug("%s: Rxing packet mode %02x status %04x.\n",
	      dev->name, inb(ioaddr + RX_MODE), status);
	netdev_dbg(dev, "Rxing packet mode %02x status %04x.\n",
		   inb(ioaddr + RX_MODE), status);
#ifndef final_version
	if (status == 0) {
	    outb(F_SKP_PKT, ioaddr + RX_SKIP);
@@ -1008,16 +1008,16 @@ static void fjn_rx(struct net_device *dev)
	    struct sk_buff *skb;

	    if (pkt_len > 1550) {
		printk(KERN_NOTICE "%s: The FMV-18x claimed a very "
		       "large packet, size %d.\n", dev->name, pkt_len);
		netdev_notice(dev, "The FMV-18x claimed a very large packet, size %d\n",
			      pkt_len);
		outb(F_SKP_PKT, ioaddr + RX_SKIP);
		dev->stats.rx_errors++;
		break;
	    }
	    skb = dev_alloc_skb(pkt_len+2);
	    if (skb == NULL) {
		printk(KERN_NOTICE "%s: Memory squeeze, dropping "
		       "packet (len %d).\n", dev->name, pkt_len);
		netdev_notice(dev, "Memory squeeze, dropping packet (len %d)\n",
			      pkt_len);
		outb(F_SKP_PKT, ioaddr + RX_SKIP);
		dev->stats.rx_dropped++;
		break;
Loading