diff -urN /mnt/disk/linux/drivers/net/3c507.c /linux/drivers/net/3c507.c --- /mnt/disk/linux/drivers/net/3c507.c Thu Nov 16 22:57:16 2000 +++ /linux/drivers/net/3c507.c Sun Nov 19 23:56:06 2000 @@ -323,8 +323,8 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr) { - static unsigned char init_ID_done = 0, version_printed = 0; - int i, irq, irqval, retval; + static unsigned char init_ID_done, version_printed; + int i, irq, retval; struct net_local *lp; if (init_ID_done == 0) { @@ -342,29 +342,28 @@ } if (!request_region(ioaddr, EL16_IO_EXTENT, dev->name)) - return -ENODEV; + return -EBUSY; if ((inb(ioaddr) != '*') || (inb(ioaddr + 1) != '3') || (inb(ioaddr + 2) != 'C') || (inb(ioaddr + 3) != 'O')) { retval = -ENODEV; - goto out; + goto err_out; } if (net_debug && version_printed++ == 0) - printk(version); + printk(KERN_INFO "%s", version); - printk("%s: 3c507 at %#x,", dev->name, ioaddr); + printk(KERN_INFO "%s: 3c507 at %#x, ", dev->name, ioaddr); /* We should make a few more checks here, like the first three octets of the S.A. for the manufacturer's code. */ irq = inb(ioaddr + IRQ_CONFIG) & 0x0f; - irqval = request_irq(irq, &el16_interrupt, 0, dev->name, dev); - if (irqval) { - printk ("unable to get IRQ %d (irqval=%d).\n", irq, irqval); - retval = -EAGAIN; - goto out; + retval = request_irq(irq, &el16_interrupt, 0, dev->name, dev); + if (retval) { + printk ("unable to get IRQ %d (irqval=%d).\n", irq, retval); + goto err_out; } /* We've committed to using the board, and can start filling in *dev. */ @@ -406,14 +405,11 @@ printk(", IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->irq, dev->if_port ? "ex" : "in", dev->mem_start, dev->mem_end-1); - if (net_debug) - printk(version); - /* Initialize the device structure. */ lp = dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); if (dev->priv == NULL) { retval = -ENOMEM; - goto out; + goto err_out; } memset(dev->priv, 0, sizeof(struct net_local)); spin_lock_init(&lp->lock); @@ -430,7 +426,8 @@ dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */ return 0; -out: + +err_out: release_region(ioaddr, EL16_IO_EXTENT); return retval; } @@ -452,19 +449,19 @@ unsigned long shmem = dev->mem_start; if (net_debug > 1) - printk ("%s: transmit timed out, %s? ", dev->name, + printk (KERN_DEBUG "%s: transmit timed out, %s? ", dev->name, isa_readw (shmem + iSCB_STATUS) & 0x8000 ? "IRQ conflict" : "network cable problem"); /* Try to restart the adaptor. */ if (lp->last_restart == lp->stats.tx_packets) { if (net_debug > 1) - printk ("Resetting board.\n"); + printk (KERN_DEBUG "Resetting board.\n"); /* Completely reset the adaptor. */ init_82586_mem (dev); } else { /* Issue the channel attention signal and hope it "gets better". */ if (net_debug > 1) - printk ("Kicking board.\n"); + printk (KERN_DEBUG "Kicking board.\n"); isa_writew (0xf000 | CUC_START | RX_START, shmem + iSCB_CMD); outb (0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */ lp->last_restart = lp->stats.tx_packets; @@ -516,7 +513,7 @@ unsigned long shmem; if (dev == NULL) { - printk ("net_interrupt(): irq %d for unknown device.\n", irq); + printk (KERN_ERR "net_interrupt(): irq %d for unknown device.\n", irq); return; } @@ -529,7 +526,7 @@ status = isa_readw(shmem+iSCB_STATUS); if (net_debug > 4) { - printk("%s: 3c507 interrupt, status %4.4x.\n", dev->name, status); + printk(KERN_DEBUG "%s: 3c507 interrupt, status %4.4x.\n", dev->name, status); } /* Disable the 82586's input to the interrupt line. */ @@ -540,7 +537,8 @@ unsigned short tx_status = isa_readw(shmem+lp->tx_reap); if (tx_status == 0) { - if (net_debug > 5) printk("Couldn't reap %#x.\n", lp->tx_reap); + if (net_debug > 5) + printk(KERN_DEBUG "Couldn't reap %#x.\n", lp->tx_reap); break; } if (tx_status & 0x2000) { @@ -555,7 +553,7 @@ if (tx_status & 0x0020) lp->stats.tx_aborted_errors++; } if (net_debug > 5) - printk("Reaped %x, Tx status %04x.\n" , lp->tx_reap, tx_status); + printk(KERN_DEBUG "Reaped %x, Tx status %04x.\n" , lp->tx_reap, tx_status); lp->tx_reap += TX_BUF_SIZE; if (lp->tx_reap > RX_BUF_START - TX_BUF_SIZE) lp->tx_reap = TX_BUF_START; @@ -565,7 +563,7 @@ if (status & 0x4000) { /* Packet received. */ if (net_debug > 5) - printk("Received packet, rx_head %04x.\n", lp->rx_head); + printk(KERN_DEBUG "Received packet, rx_head %04x.\n", lp->rx_head); el16_rx(dev); } @@ -574,7 +572,7 @@ if ((status & 0x0700) != 0x0200 && netif_running(dev)) { if (net_debug) - printk("%s: Command unit stopped, status %04x, restarting.\n", + printk(KERN_DEBUG "%s: Command unit stopped, status %04x, restarting.\n", dev->name, status); /* If this ever occurs we should really re-write the idle loop, reset the Tx list, and do a complete restart of the command unit. @@ -587,7 +585,7 @@ /* The Rx unit is not ready, it must be hung. Restart the receiver by initializing the rx buffers, and issuing an Rx start command. */ if (net_debug) - printk("%s: Rx unit stopped, status %04x, restarting.\n", + printk(KERN_DEBUG "%s: Rx unit stopped, status %04x, restarting.\n", dev->name, status); init_rx_bufs(dev); isa_writew(RX_BUF_START,shmem+iSCB_RFA); @@ -722,7 +720,7 @@ int boguscnt = 50; while (isa_readw(shmem+iSCB_STATUS) == 0) if (--boguscnt == 0) { - printk("%s: i82586 initialization timed out with status %04x," + printk(KERN_WARNING "%s: i82586 initialization timed out with status %04x," "cmd %04x.\n", dev->name, isa_readw(shmem+iSCB_STATUS), isa_readw(shmem+iSCB_CMD)); break; @@ -734,7 +732,7 @@ /* Disable loopback and enable interrupts. */ outb(0x84, ioaddr + MISC_CTRL); if (net_debug > 4) - printk("%s: Initialized 82586, status %04x.\n", dev->name, + printk(KERN_DEBUG "%s: Initialized 82586, status %04x.\n", dev->name, isa_readw(shmem+iSCB_STATUS)); return; } @@ -776,7 +774,7 @@ lp->tx_head = TX_BUF_START; if (net_debug > 4) { - printk("%s: 3c507 @%x send length = %d, tx_block %3x, next %3x.\n", + printk(KERN_DEBUG "%s: 3c507 @%x send length = %d, tx_block %3x, next %3x.\n", dev->name, ioaddr, length, tx_block, lp->tx_head); } @@ -803,7 +801,7 @@ if (rfd_cmd != 0 || data_buffer_addr != rx_head + 22 || (pkt_len & 0xC000) != 0xC000) { - printk("%s: Rx frame at %#x corrupted, status %04x cmd %04x" + printk(KERN_WARNING "%s: Rx frame at %#x corrupted, status %04x cmd %04x" "next %04x data-buf @%04x %04x.\n", dev->name, rx_head, frame_status, rfd_cmd, next_rx_frame, data_buffer_addr, pkt_len); @@ -822,7 +820,7 @@ pkt_len &= 0x3fff; skb = dev_alloc_skb(pkt_len+2); if (skb == NULL) { - printk("%s: Memory squeeze, dropping packet.\n", dev->name); + printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); lp->stats.rx_dropped++; break; } @@ -863,12 +861,12 @@ int init_module(void) { if (io == 0) - printk("3c507: You should not use auto-probing with insmod!\n"); + printk(KERN_NOTICE "3c507: You should not use auto-probing with insmod!\n"); dev_3c507.base_addr = io; dev_3c507.irq = irq; dev_3c507.init = el16_probe; if (register_netdev(&dev_3c507) != 0) { - printk("3c507: register_netdev() returned non-zero.\n"); + printk(KERN_ERR "3c507: register_netdev() returned non-zero.\n"); return -EIO; } return 0;