diff -urN /mnt/disk/linux/drivers/net/3c505.c /linux/drivers/net/3c505.c --- /mnt/disk/linux/drivers/net/3c505.c Thu Nov 16 22:57:16 2000 +++ /linux/drivers/net/3c505.c Sun Nov 19 23:37:22 2000 @@ -121,16 +121,16 @@ static const char *filename = __FILE__; -static const char *timeout_msg = "*** timeout at %s:%s (line %d) ***\n"; +static const char *timeout_msg = KERN_ERR "*** timeout at %s:%s (line %d) ***\n"; #define TIMEOUT_MSG(lineno) \ printk(timeout_msg, filename,__FUNCTION__,(lineno)) static const char *invalid_pcb_msg = -"*** invalid pcb length %d at %s:%s (line %d) ***\n"; +KERN_ERR "*** invalid pcb length %d at %s:%s (line %d) ***\n"; #define INVALID_PCB_MSG(len) \ printk(invalid_pcb_msg, (len),filename,__FUNCTION__,__LINE__) -static char search_msg[] __initdata = "%s: Looking for 3c505 adapter at address %#x..."; +static char search_msg[] __initdata = KERN_INFO"%s: Looking for 3c505 adapter at address %#x..."; static char stilllooking_msg[] __initdata = "still looking..."; @@ -138,7 +138,7 @@ static char notfound_msg[] __initdata = "not found (reason = %d)\n"; -static char couldnot_msg[] __initdata = "%s: 3c505 not found\n"; +static char couldnot_msg[] __initdata = KERN_INFO"%s: 3c505 not found\n"; /********************************************************* * @@ -303,7 +303,7 @@ outb_control(orig_hcr, dev); if (!start_receive(dev, &adapter->tx_pcb)) - printk("%s: start receive command failed \n", dev->name); + printk(KERN_ERR "%s: start receive command failed \n", dev->name); } /* Check to make sure that a DMA transfer hasn't timed out. This should @@ -315,7 +315,9 @@ elp_device *adapter = dev->priv; if (adapter->dmaing && time_after(jiffies, adapter->current_dma.start_time + 10)) { unsigned long flags, f; - printk("%s: DMA %s timed out, %d bytes left\n", dev->name, adapter->current_dma.direction ? "download" : "upload", get_dma_residue(dev->dma)); + printk( KERN_ERR "%s: DMA %s timed out, %d bytes left\n", + dev->name, adapter->current_dma.direction ? "download" : "upload", + get_dma_residue(dev->dma)); save_flags(flags); cli(); adapter->dmaing = 0; @@ -341,7 +343,7 @@ if (inb_status(base_addr) & HCRE) return FALSE; } - printk("3c505: send_pcb_slow timed out\n"); + printk(KERN_ERR "3c505: send_pcb_slow timed out\n"); return TRUE; } @@ -353,7 +355,7 @@ if (inb_status(base_addr) & HCRE) return FALSE; } - printk("3c505: send_pcb_fast timed out\n"); + printk(KERN_ERR "3c505: send_pcb_fast timed out\n"); return TRUE; } @@ -405,7 +407,7 @@ /* Avoid contention */ if (test_and_set_bit(1, &adapter->send_pcb_semaphore)) { if (elp_debug >= 3) { - printk("%s: send_pcb entered while threaded\n", dev->name); + printk(KERN_DEBUG "%s: send_pcb entered while threaded\n", dev->name); } return FALSE; } @@ -451,7 +453,7 @@ } if (elp_debug >= 1) - printk("%s: timeout waiting for PCB acknowledge (status %02x)\n", dev->name, inb_status(dev->base_addr)); + printk(KERN_DEBUG "%s: timeout waiting for PCB acknowledge (status %02x)\n", dev->name, inb_status(dev->base_addr)); sti_abort: sti(); @@ -499,7 +501,7 @@ while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && time_before(jiffies, timeout)); if (time_after_eq(jiffies, timeout)) { TIMEOUT_MSG(__LINE__); - printk("%s: status %02x\n", dev->name, stat); + printk(KERN_DEBUG "%s: status %02x\n", dev->name, stat); return FALSE; } pcb->length = inb_command(dev->base_addr); @@ -530,7 +532,7 @@ /* safety check total length vs data length */ if (total_length != (pcb->length + 2)) { if (elp_debug >= 2) - printk("%s: mangled PCB received\n", dev->name); + printk(KERN_DEBUG "%s: mangled PCB received\n", dev->name); set_hsf(dev, HSF_PCB_NAK); return FALSE; } @@ -539,7 +541,7 @@ if (test_and_set_bit(0, (void *) &adapter->busy)) { if (backlog_next(adapter->rx_backlog.in) == adapter->rx_backlog.out) { set_hsf(dev, HSF_PCB_NAK); - printk("%s: PCB rejected, transfer in progress and backlog full\n", dev->name); + printk(KERN_DEBUG "%s: PCB rejected, transfer in progress and backlog full\n", dev->name); pcb->command = 0; return TRUE; } else { @@ -564,7 +566,7 @@ elp_device *adapter = dev->priv; if (elp_debug >= 3) - printk("%s: restarting receiver\n", dev->name); + printk(KERN_DEBUG "%s: restarting receiver\n", dev->name); tx_pcb->command = CMD_RECEIVE_PACKET; tx_pcb->length = sizeof(struct Rcv_pkt); tx_pcb->data.rcv_pkt.buf_seg @@ -598,7 +600,7 @@ skb = dev_alloc_skb(rlen + 2); if (!skb) { - printk("%s: memory squeeze, dropping packet\n", dev->name); + printk(KERN_WARNING "%s: memory squeeze, dropping packet\n", dev->name); target = adapter->dma_buffer; adapter->current_dma.target = NULL; } else { @@ -614,7 +616,7 @@ /* if this happens, we die */ if (test_and_set_bit(0, (void *) &adapter->dmaing)) - printk("%s: rx blocked, DMA in progress, dir %d\n", dev->name, adapter->current_dma.direction); + printk(KERN_ERR "%s: rx blocked, DMA in progress, dir %d\n", dev->name, adapter->current_dma.direction); skb->dev = dev; adapter->current_dma.direction = 0; @@ -634,14 +636,14 @@ release_dma_lock(flags); if (elp_debug >= 3) { - printk("%s: rx DMA transfer started\n", dev->name); + printk(KERN_DEBUG "%s: rx DMA transfer started\n", dev->name); } if (adapter->rx_active) adapter->rx_active--; if (!adapter->busy) - printk("%s: receive_packet called, busy not set.\n", dev->name); + printk(KERN_DEBUG "%s: receive_packet called, busy not set.\n", dev->name); } /****************************************************** @@ -670,10 +672,12 @@ */ if (inb_status(dev->base_addr) & DONE) { if (!adapter->dmaing) { - printk("%s: phantom DMA completed\n", dev->name); + printk(KERN_DEBUG "%s: phantom DMA completed\n", dev->name); } if (elp_debug >= 3) { - printk("%s: %s DMA complete, status %02x\n", dev->name, adapter->current_dma.direction ? "tx" : "rx", inb_status(dev->base_addr)); + printk( KERN_DEBUG "%s: %s DMA complete, status %02x\n", + dev->name, adapter->current_dma.direction ? "tx" : "rx", + inb_status(dev->base_addr)); } outb_control(adapter->hcr_val & ~(DMAE | TCEN | DIR), dev); @@ -696,7 +700,7 @@ int t = adapter->rx_backlog.length[adapter->rx_backlog.out]; adapter->rx_backlog.out = backlog_next(adapter->rx_backlog.out); if (elp_debug >= 2) - printk("%s: receiving backlogged packet (%d)\n", dev->name, t); + printk(KERN_DEBUG "%s: receiving backlogged packet (%d)\n", dev->name, t); receive_packet(dev, t); } else { adapter->busy = 0; @@ -730,18 +734,18 @@ printk(KERN_ERR "%s: interrupt - packet not received correctly\n", dev->name); } else { if (elp_debug >= 3) { - printk("%s: interrupt - packet received of length %i (%i)\n", dev->name, len, dlen); + printk(KERN_DEBUG "%s: interrupt - packet received of length %i (%i)\n", dev->name, len, dlen); } if (adapter->irx_pcb.command == 0xff) { if (elp_debug >= 2) - printk("%s: adding packet to backlog (len = %d)\n", dev->name, dlen); + printk(KERN_DEBUG "%s: adding packet to backlog (len = %d)\n", dev->name, dlen); adapter->rx_backlog.length[adapter->rx_backlog.in] = dlen; adapter->rx_backlog.in = backlog_next(adapter->rx_backlog.in); } else { receive_packet(dev, dlen); } if (elp_debug >= 3) - printk("%s: packet received\n", dev->name); + printk(KERN_DEBUG "%s: packet received\n", dev->name); } break; @@ -751,7 +755,7 @@ case CMD_CONFIGURE_82586_RESPONSE: adapter->got[CMD_CONFIGURE_82586] = 1; if (elp_debug >= 3) - printk("%s: interrupt - configure response received\n", dev->name); + printk(KERN_DEBUG "%s: interrupt - configure response received\n", dev->name); break; /* @@ -760,7 +764,7 @@ case CMD_CONFIGURE_ADAPTER_RESPONSE: adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] = 1; if (elp_debug >= 3) - printk("%s: Adapter memory configuration %s.\n", dev->name, + printk(KERN_DEBUG "%s: Adapter memory configuration %s.\n", dev->name, adapter->irx_pcb.data.failed ? "failed" : "succeeded"); break; @@ -770,7 +774,7 @@ case CMD_LOAD_MULTICAST_RESPONSE: adapter->got[CMD_LOAD_MULTICAST_LIST] = 1; if (elp_debug >= 3) - printk("%s: Multicast address list loading %s.\n", dev->name, + printk(KERN_DEBUG "%s: Multicast address list loading %s.\n", dev->name, adapter->irx_pcb.data.failed ? "failed" : "succeeded"); break; @@ -780,7 +784,7 @@ case CMD_SET_ADDRESS_RESPONSE: adapter->got[CMD_SET_STATION_ADDRESS] = 1; if (elp_debug >= 3) - printk("%s: Ethernet address setting %s.\n", dev->name, + printk(KERN_DEBUG "%s: Ethernet address setting %s.\n", dev->name, adapter->irx_pcb.data.failed ? "failed" : "succeeded"); break; @@ -797,7 +801,7 @@ adapter->stats.rx_over_errors += adapter->irx_pcb.data.netstat.err_res; adapter->got[CMD_NETWORK_STATISTICS] = 1; if (elp_debug >= 3) - printk("%s: interrupt - statistics response received\n", dev->name); + printk(KERN_DEBUG "%s: interrupt - statistics response received\n", dev->name); break; /* @@ -805,7 +809,7 @@ */ case CMD_TRANSMIT_PACKET_COMPLETE: if (elp_debug >= 3) - printk("%s: interrupt - packet sent\n", dev->name); + printk(KERN_DEBUG "%s: interrupt - packet sent\n", dev->name); if (!netif_running(dev)) break; switch (adapter->irx_pcb.data.xmit_resp.c_stat) { @@ -829,7 +833,7 @@ break; } } else { - printk("%s: failed to read PCB on interrupt\n", dev->name); + printk(KERN_ERR "%s: failed to read PCB on interrupt\n", dev->name); adapter_reset(dev); } } @@ -859,13 +863,13 @@ adapter = dev->priv; if (elp_debug >= 3) - printk("%s: request to open device\n", dev->name); + printk(KERN_DEBUG "%s: request to open device\n", dev->name); /* * make sure we actually found the device */ if (adapter == NULL) { - printk("%s: Opening a non-existent physical device\n", dev->name); + printk(KERN_ERR "%s: Opening a non-existent physical device\n", dev->name); return -EAGAIN; } /* @@ -932,7 +936,7 @@ adapter->tx_pcb.length = sizeof(struct Memconf); adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] = 0; if (!send_pcb(dev, &adapter->tx_pcb)) - printk("%s: couldn't send memory configuration command\n", dev->name); + printk(KERN_ERR "%s: couldn't send memory configuration command\n", dev->name); else { int timeout = jiffies + TIMEOUT; while (adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] == 0 && time_before(jiffies, timeout)); @@ -945,13 +949,13 @@ * configure adapter to receive broadcast messages and wait for response */ if (elp_debug >= 3) - printk("%s: sending 82586 configure command\n", dev->name); + printk(KERN_DEBUG "%s: sending 82586 configure command\n", dev->name); adapter->tx_pcb.command = CMD_CONFIGURE_82586; adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD; adapter->tx_pcb.length = 2; adapter->got[CMD_CONFIGURE_82586] = 0; if (!send_pcb(dev, &adapter->tx_pcb)) - printk("%s: couldn't send 82586 configure command\n", dev->name); + printk(KERN_ERR "%s: couldn't send 82586 configure command\n", dev->name); else { int timeout = jiffies + TIMEOUT; while (adapter->got[CMD_CONFIGURE_82586] == 0 && time_before(jiffies, timeout)); @@ -967,7 +971,7 @@ */ prime_rx(dev); if (elp_debug >= 3) - printk("%s: %d receive PCBs active\n", dev->name, adapter->rx_active); + printk(KERN_ERR "%s: %d receive PCBs active\n", dev->name, adapter->rx_active); /* * device is now officially open! @@ -997,7 +1001,7 @@ if (test_and_set_bit(0, (void *) &adapter->busy)) { if (elp_debug >= 2) - printk("%s: transmit blocked\n", dev->name); + printk(KERN_DEBUG "%s: transmit blocked\n", dev->name); return FALSE; } @@ -1019,7 +1023,7 @@ } /* if this happens, we die */ if (test_and_set_bit(0, (void *) &adapter->dmaing)) - printk("%s: tx: DMA %d in progress\n", dev->name, adapter->current_dma.direction); + printk(KERN_ERR "%s: tx: DMA %d in progress\n", dev->name, adapter->current_dma.direction); adapter->current_dma.direction = 1; adapter->current_dma.start_time = jiffies; @@ -1042,7 +1046,7 @@ release_dma_lock(flags); if (elp_debug >= 3) - printk("%s: DMA transfer started\n", dev->name); + printk(KERN_DEBUG "%s: DMA transfer started\n", dev->name); return TRUE; } @@ -1059,7 +1063,7 @@ stat = inb_status(dev->base_addr); printk(KERN_WARNING "%s: transmit timed out, lost %s?\n", dev->name, (stat & ACRF) ? "interrupt" : "command"); if (elp_debug >= 1) - printk("%s: status %#02x\n", dev->name, stat); + printk(KERN_DEBUG "%s: status %#02x\n", dev->name, stat); dev->trans_start = jiffies; adapter->stats.tx_dropped++; netif_wake_queue(dev); @@ -1081,7 +1085,7 @@ check_3c505_dma(dev); if (elp_debug >= 3) - printk("%s: request to send packet of length %d\n", dev->name, (int) skb->len); + printk(KERN_DEBUG "%s: request to send packet of length %d\n", dev->name, (int) skb->len); netif_stop_queue(dev); @@ -1090,13 +1094,13 @@ */ if (!send_packet(dev, skb)) { if (elp_debug >= 2) { - printk("%s: failed to transmit packet\n", dev->name); + printk(KERN_DEBUG "%s: failed to transmit packet\n", dev->name); } spin_unlock_irqrestore(&adapter->lock, flags); return 1; } if (elp_debug >= 3) - printk("%s: packet of length %d sent\n", dev->name, (int) skb->len); + printk(KERN_DEBUG "%s: packet of length %d sent\n", dev->name, (int) skb->len); /* * start the transmit timeout @@ -1120,7 +1124,7 @@ elp_device *adapter = (elp_device *) dev->priv; if (elp_debug >= 3) - printk("%s: request for stats\n", dev->name); + printk(KERN_DEBUG "%s: request for stats\n", dev->name); /* If the device is closed, just return the latest stats we have, - we cannot ask from the adapter without interrupts */ @@ -1132,7 +1136,7 @@ adapter->tx_pcb.length = 0; adapter->got[CMD_NETWORK_STATISTICS] = 0; if (!send_pcb(dev, &adapter->tx_pcb)) - printk("%s: couldn't send get statistics command\n", dev->name); + printk(KERN_ERR "%s: couldn't send get statistics command\n", dev->name); else { int timeout = jiffies + TIMEOUT; while (adapter->got[CMD_NETWORK_STATISTICS] == 0 && time_before(jiffies, timeout)); @@ -1159,7 +1163,7 @@ adapter = dev->priv; if (elp_debug >= 3) - printk("%s: request to close device\n", dev->name); + printk(KERN_DEBUG "%s: request to close device\n", dev->name); netif_stop_queue(dev); @@ -1203,7 +1207,7 @@ unsigned long flags; if (elp_debug >= 3) - printk("%s: request to set multicast list\n", dev->name); + printk(KERN_DEBUG "%s: request to set multicast list\n", dev->name); spin_lock_irqsave(&adapter->lock, flags); @@ -1218,7 +1222,7 @@ } adapter->got[CMD_LOAD_MULTICAST_LIST] = 0; if (!send_pcb(dev, &adapter->tx_pcb)) - printk("%s: couldn't send set_multicast command\n", dev->name); + printk(KERN_ERR "%s: couldn't send set_multicast command\n", dev->name); else { int timeout = jiffies + TIMEOUT; while (adapter->got[CMD_LOAD_MULTICAST_LIST] == 0 && time_before(jiffies, timeout)); @@ -1237,14 +1241,14 @@ * and wait for response */ if (elp_debug >= 3) - printk("%s: sending 82586 configure command\n", dev->name); + printk(KERN_DEBUG "%s: sending 82586 configure command\n", dev->name); adapter->tx_pcb.command = CMD_CONFIGURE_82586; adapter->tx_pcb.length = 2; adapter->got[CMD_CONFIGURE_82586] = 0; if (!send_pcb(dev, &adapter->tx_pcb)) { spin_unlock_irqrestore(&adapter->lock, flags); - printk("%s: couldn't send 82586 configure command\n", dev->name); + printk(KERN_ERR "%s: couldn't send 82586 configure command\n", dev->name); } else { int timeout = jiffies + TIMEOUT; @@ -1431,7 +1435,7 @@ */ adapter = (elp_device *) (dev->priv = kmalloc(sizeof(elp_device), GFP_KERNEL)); if (adapter == NULL) { - printk("%s: out of memory\n", dev->name); + printk(KERN_ERR "%s: out of memory\n", dev->name); return -ENODEV; } @@ -1456,7 +1460,7 @@ /* Nope, it's ignoring the command register. This means that * either it's still booting up, or it's died. */ - printk("%s: command register wouldn't drain, ", dev->name); + printk(KERN_WARNING "%s: command register wouldn't drain, ", dev->name); if ((inb_status(dev->base_addr) & 7) == 3) { /* If the adapter status is 3, it *could* still be booting. * Give it the benefit of the doubt for 10 seconds. @@ -1465,7 +1469,7 @@ timeout = jiffies + 10*HZ; while (time_before(jiffies, timeout) && (inb_status(dev->base_addr) & 7)); if (inb_status(dev->base_addr) & 7) { - printk("%s: 3c505 failed to start\n", dev->name); + printk(KERN_ERR "%s: 3c505 failed to start\n", dev->name); } else { okay = 1; /* It started */ } @@ -1473,7 +1477,7 @@ /* Otherwise, it must just be in a strange * state. We probably need to kick it. */ - printk("3c505 is sulking\n"); + printk(KERN_WARNING "3c505 is sulking\n"); } } for (tries = 0; tries < 5 && okay; tries++) { @@ -1486,18 +1490,18 @@ adapter->tx_pcb.length = 0; cookie = probe_irq_on(); if (!send_pcb(dev, &adapter->tx_pcb)) { - printk("%s: could not send first PCB\n", dev->name); + printk(KERN_ERR "%s: could not send first PCB\n", dev->name); probe_irq_off(cookie); continue; } if (!receive_pcb(dev, &adapter->rx_pcb)) { - printk("%s: could not read first PCB\n", dev->name); + printk(KERN_ERR "%s: could not read first PCB\n", dev->name); probe_irq_off(cookie); continue; } if ((adapter->rx_pcb.command != CMD_ADDRESS_RESPONSE) || (adapter->rx_pcb.length != 6)) { - printk("%s: first PCB wrong (%d, %d)\n", dev->name, adapter->rx_pcb.command, adapter->rx_pcb.length); + printk(KERN_ERR "%s: first PCB wrong (%d, %d)\n", dev->name, adapter->rx_pcb.command, adapter->rx_pcb.length); probe_irq_off(cookie); continue; } @@ -1510,7 +1514,7 @@ outb_control(adapter->hcr_val | FLSH | ATTN, dev); outb_control(adapter->hcr_val & ~(FLSH | ATTN), dev); } - printk("%s: failed to initialise 3c505\n", dev->name); + printk(KERN_ERR "%s: failed to initialise 3c505\n", dev->name); release_region(dev->base_addr, ELP_IO_EXTENT); return -ENODEV; @@ -1518,21 +1522,21 @@ if (dev->irq) { /* Is there a preset IRQ? */ int rpt = probe_irq_off(cookie); if (dev->irq != rpt) { - printk("%s: warning, irq %d configured but %d detected\n", dev->name, dev->irq, rpt); + printk(KERN_WARNING "%s: warning, irq %d configured but %d detected\n", dev->name, dev->irq, rpt); } /* if dev->irq == probe_irq_off(cookie), all is well */ } else /* No preset IRQ; just use what we can detect */ dev->irq = probe_irq_off(cookie); switch (dev->irq) { /* Legal, sane? */ case 0: - printk("%s: IRQ probe failed: check 3c505 jumpers.\n", + printk(KERN_ERR "%s: IRQ probe failed: check 3c505 jumpers.\n", dev->name); return -ENODEV; case 1: case 6: case 8: case 13: - printk("%s: Impossible IRQ %d reported by probe_irq_off().\n", + printk(KERN_ERR "%s: Impossible IRQ %d reported by probe_irq_off().\n", dev->name, dev->irq); return -ENODEV; } @@ -1562,7 +1566,7 @@ /* * print remainder of startup message */ - printk("%s: 3c505 at %#lx, irq %d, dma %d, ", + printk(KERN_INFO "%s: 3c505 at %#lx, irq %d, dma %d, ", dev->name, dev->base_addr, dev->irq, dev->dma); printk("addr %02x:%02x:%02x:%02x:%02x:%02x, ", dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], @@ -1597,10 +1601,10 @@ !receive_pcb(dev, &adapter->rx_pcb) || (adapter->rx_pcb.command != CMD_CONFIGURE_ADAPTER_RESPONSE) || (adapter->rx_pcb.length != 2)) { - printk("%s: could not configure adapter memory\n", dev->name); + printk(KERN_WARNING "%s: could not configure adapter memory\n", dev->name); } if (adapter->rx_pcb.data.configure) { - printk("%s: adapter configuration failed\n", dev->name); + printk(KERN_WARNING "%s: adapter configuration failed\n", dev->name); } /*