aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/3c505.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/3c505.c')
-rw-r--r--drivers/net/3c505.c215
1 files changed, 111 insertions, 104 deletions
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c
index 2de1c9cd7bde..b28499459cd6 100644
--- a/drivers/net/3c505.c
+++ b/drivers/net/3c505.c
@@ -126,26 +126,25 @@
126 * 126 *
127 *********************************************************/ 127 *********************************************************/
128 128
129static const char filename[] = __FILE__; 129#define filename __FILE__
130 130
131static const char timeout_msg[] = "*** timeout at %s:%s (line %d) ***\n"; 131#define timeout_msg "*** timeout at %s:%s (line %d) ***\n"
132#define TIMEOUT_MSG(lineno) \ 132#define TIMEOUT_MSG(lineno) \
133 printk(timeout_msg, filename,__func__,(lineno)) 133 pr_notice(timeout_msg, filename, __func__, (lineno))
134 134
135static const char invalid_pcb_msg[] = 135#define invalid_pcb_msg "*** invalid pcb length %d at %s:%s (line %d) ***\n"
136"*** invalid pcb length %d at %s:%s (line %d) ***\n";
137#define INVALID_PCB_MSG(len) \ 136#define INVALID_PCB_MSG(len) \
138 printk(invalid_pcb_msg, (len),filename,__func__,__LINE__) 137 pr_notice(invalid_pcb_msg, (len), filename, __func__, __LINE__)
139 138
140static char search_msg[] __initdata = KERN_INFO "%s: Looking for 3c505 adapter at address %#x..."; 139#define search_msg "%s: Looking for 3c505 adapter at address %#x..."
141 140
142static char stilllooking_msg[] __initdata = "still looking..."; 141#define stilllooking_msg "still looking..."
143 142
144static char found_msg[] __initdata = "found.\n"; 143#define found_msg "found.\n"
145 144
146static char notfound_msg[] __initdata = "not found (reason = %d)\n"; 145#define notfound_msg "not found (reason = %d)\n"
147 146
148static char couldnot_msg[] __initdata = KERN_INFO "%s: 3c505 not found\n"; 147#define couldnot_msg "%s: 3c505 not found\n"
149 148
150/********************************************************* 149/*********************************************************
151 * 150 *
@@ -284,7 +283,7 @@ static inline void adapter_reset(struct net_device *dev)
284 283
285 outb_control(orig_hcr, dev); 284 outb_control(orig_hcr, dev);
286 if (!start_receive(dev, &adapter->tx_pcb)) 285 if (!start_receive(dev, &adapter->tx_pcb))
287 printk(KERN_ERR "%s: start receive command failed \n", dev->name); 286 pr_err("%s: start receive command failed\n", dev->name);
288} 287}
289 288
290/* Check to make sure that a DMA transfer hasn't timed out. This should 289/* Check to make sure that a DMA transfer hasn't timed out. This should
@@ -296,7 +295,9 @@ static inline void check_3c505_dma(struct net_device *dev)
296 elp_device *adapter = netdev_priv(dev); 295 elp_device *adapter = netdev_priv(dev);
297 if (adapter->dmaing && time_after(jiffies, adapter->current_dma.start_time + 10)) { 296 if (adapter->dmaing && time_after(jiffies, adapter->current_dma.start_time + 10)) {
298 unsigned long flags, f; 297 unsigned long flags, f;
299 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)); 298 pr_err("%s: DMA %s timed out, %d bytes left\n", dev->name,
299 adapter->current_dma.direction ? "download" : "upload",
300 get_dma_residue(dev->dma));
300 spin_lock_irqsave(&adapter->lock, flags); 301 spin_lock_irqsave(&adapter->lock, flags);
301 adapter->dmaing = 0; 302 adapter->dmaing = 0;
302 adapter->busy = 0; 303 adapter->busy = 0;
@@ -321,7 +322,7 @@ static inline bool send_pcb_slow(unsigned int base_addr, unsigned char byte)
321 if (inb_status(base_addr) & HCRE) 322 if (inb_status(base_addr) & HCRE)
322 return false; 323 return false;
323 } 324 }
324 printk(KERN_WARNING "3c505: send_pcb_slow timed out\n"); 325 pr_warning("3c505: send_pcb_slow timed out\n");
325 return true; 326 return true;
326} 327}
327 328
@@ -333,7 +334,7 @@ static inline bool send_pcb_fast(unsigned int base_addr, unsigned char byte)
333 if (inb_status(base_addr) & HCRE) 334 if (inb_status(base_addr) & HCRE)
334 return false; 335 return false;
335 } 336 }
336 printk(KERN_WARNING "3c505: send_pcb_fast timed out\n"); 337 pr_warning("3c505: send_pcb_fast timed out\n");
337 return true; 338 return true;
338} 339}
339 340
@@ -386,7 +387,7 @@ static bool send_pcb(struct net_device *dev, pcb_struct * pcb)
386 /* Avoid contention */ 387 /* Avoid contention */
387 if (test_and_set_bit(1, &adapter->send_pcb_semaphore)) { 388 if (test_and_set_bit(1, &adapter->send_pcb_semaphore)) {
388 if (elp_debug >= 3) { 389 if (elp_debug >= 3) {
389 printk(KERN_DEBUG "%s: send_pcb entered while threaded\n", dev->name); 390 pr_debug("%s: send_pcb entered while threaded\n", dev->name);
390 } 391 }
391 return false; 392 return false;
392 } 393 }
@@ -424,14 +425,15 @@ static bool send_pcb(struct net_device *dev, pcb_struct * pcb)
424 425
425 case ASF_PCB_NAK: 426 case ASF_PCB_NAK:
426#ifdef ELP_DEBUG 427#ifdef ELP_DEBUG
427 printk(KERN_DEBUG "%s: send_pcb got NAK\n", dev->name); 428 pr_debug("%s: send_pcb got NAK\n", dev->name);
428#endif 429#endif
429 goto abort; 430 goto abort;
430 } 431 }
431 } 432 }
432 433
433 if (elp_debug >= 1) 434 if (elp_debug >= 1)
434 printk(KERN_DEBUG "%s: timeout waiting for PCB acknowledge (status %02x)\n", dev->name, inb_status(dev->base_addr)); 435 pr_debug("%s: timeout waiting for PCB acknowledge (status %02x)\n",
436 dev->name, inb_status(dev->base_addr));
435 goto abort; 437 goto abort;
436 438
437 sti_abort: 439 sti_abort:
@@ -481,7 +483,7 @@ static bool receive_pcb(struct net_device *dev, pcb_struct * pcb)
481 while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && time_before(jiffies, timeout)); 483 while (((stat = get_status(dev->base_addr)) & ACRF) == 0 && time_before(jiffies, timeout));
482 if (time_after_eq(jiffies, timeout)) { 484 if (time_after_eq(jiffies, timeout)) {
483 TIMEOUT_MSG(__LINE__); 485 TIMEOUT_MSG(__LINE__);
484 printk(KERN_INFO "%s: status %02x\n", dev->name, stat); 486 pr_info("%s: status %02x\n", dev->name, stat);
485 return false; 487 return false;
486 } 488 }
487 pcb->length = inb_command(dev->base_addr); 489 pcb->length = inb_command(dev->base_addr);
@@ -518,7 +520,7 @@ static bool receive_pcb(struct net_device *dev, pcb_struct * pcb)
518 /* safety check total length vs data length */ 520 /* safety check total length vs data length */
519 if (total_length != (pcb->length + 2)) { 521 if (total_length != (pcb->length + 2)) {
520 if (elp_debug >= 2) 522 if (elp_debug >= 2)
521 printk(KERN_WARNING "%s: mangled PCB received\n", dev->name); 523 pr_warning("%s: mangled PCB received\n", dev->name);
522 set_hsf(dev, HSF_PCB_NAK); 524 set_hsf(dev, HSF_PCB_NAK);
523 return false; 525 return false;
524 } 526 }
@@ -527,7 +529,7 @@ static bool receive_pcb(struct net_device *dev, pcb_struct * pcb)
527 if (test_and_set_bit(0, (void *) &adapter->busy)) { 529 if (test_and_set_bit(0, (void *) &adapter->busy)) {
528 if (backlog_next(adapter->rx_backlog.in) == adapter->rx_backlog.out) { 530 if (backlog_next(adapter->rx_backlog.in) == adapter->rx_backlog.out) {
529 set_hsf(dev, HSF_PCB_NAK); 531 set_hsf(dev, HSF_PCB_NAK);
530 printk(KERN_WARNING "%s: PCB rejected, transfer in progress and backlog full\n", dev->name); 532 pr_warning("%s: PCB rejected, transfer in progress and backlog full\n", dev->name);
531 pcb->command = 0; 533 pcb->command = 0;
532 return true; 534 return true;
533 } else { 535 } else {
@@ -552,7 +554,7 @@ static bool start_receive(struct net_device *dev, pcb_struct * tx_pcb)
552 elp_device *adapter = netdev_priv(dev); 554 elp_device *adapter = netdev_priv(dev);
553 555
554 if (elp_debug >= 3) 556 if (elp_debug >= 3)
555 printk(KERN_DEBUG "%s: restarting receiver\n", dev->name); 557 pr_debug("%s: restarting receiver\n", dev->name);
556 tx_pcb->command = CMD_RECEIVE_PACKET; 558 tx_pcb->command = CMD_RECEIVE_PACKET;
557 tx_pcb->length = sizeof(struct Rcv_pkt); 559 tx_pcb->length = sizeof(struct Rcv_pkt);
558 tx_pcb->data.rcv_pkt.buf_seg 560 tx_pcb->data.rcv_pkt.buf_seg
@@ -586,7 +588,7 @@ static void receive_packet(struct net_device *dev, int len)
586 skb = dev_alloc_skb(rlen + 2); 588 skb = dev_alloc_skb(rlen + 2);
587 589
588 if (!skb) { 590 if (!skb) {
589 printk(KERN_WARNING "%s: memory squeeze, dropping packet\n", dev->name); 591 pr_warning("%s: memory squeeze, dropping packet\n", dev->name);
590 target = adapter->dma_buffer; 592 target = adapter->dma_buffer;
591 adapter->current_dma.target = NULL; 593 adapter->current_dma.target = NULL;
592 /* FIXME: stats */ 594 /* FIXME: stats */
@@ -604,7 +606,8 @@ static void receive_packet(struct net_device *dev, int len)
604 606
605 /* if this happens, we die */ 607 /* if this happens, we die */
606 if (test_and_set_bit(0, (void *) &adapter->dmaing)) 608 if (test_and_set_bit(0, (void *) &adapter->dmaing))
607 printk(KERN_ERR "%s: rx blocked, DMA in progress, dir %d\n", dev->name, adapter->current_dma.direction); 609 pr_err("%s: rx blocked, DMA in progress, dir %d\n",
610 dev->name, adapter->current_dma.direction);
608 611
609 adapter->current_dma.direction = 0; 612 adapter->current_dma.direction = 0;
610 adapter->current_dma.length = rlen; 613 adapter->current_dma.length = rlen;
@@ -623,14 +626,14 @@ static void receive_packet(struct net_device *dev, int len)
623 release_dma_lock(flags); 626 release_dma_lock(flags);
624 627
625 if (elp_debug >= 3) { 628 if (elp_debug >= 3) {
626 printk(KERN_DEBUG "%s: rx DMA transfer started\n", dev->name); 629 pr_debug("%s: rx DMA transfer started\n", dev->name);
627 } 630 }
628 631
629 if (adapter->rx_active) 632 if (adapter->rx_active)
630 adapter->rx_active--; 633 adapter->rx_active--;
631 634
632 if (!adapter->busy) 635 if (!adapter->busy)
633 printk(KERN_WARNING "%s: receive_packet called, busy not set.\n", dev->name); 636 pr_warning("%s: receive_packet called, busy not set.\n", dev->name);
634} 637}
635 638
636/****************************************************** 639/******************************************************
@@ -655,12 +658,13 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
655 * has a DMA transfer finished? 658 * has a DMA transfer finished?
656 */ 659 */
657 if (inb_status(dev->base_addr) & DONE) { 660 if (inb_status(dev->base_addr) & DONE) {
658 if (!adapter->dmaing) { 661 if (!adapter->dmaing)
659 printk(KERN_WARNING "%s: phantom DMA completed\n", dev->name); 662 pr_warning("%s: phantom DMA completed\n", dev->name);
660 } 663
661 if (elp_debug >= 3) { 664 if (elp_debug >= 3)
662 printk(KERN_DEBUG "%s: %s DMA complete, status %02x\n", dev->name, adapter->current_dma.direction ? "tx" : "rx", inb_status(dev->base_addr)); 665 pr_debug("%s: %s DMA complete, status %02x\n", dev->name,
663 } 666 adapter->current_dma.direction ? "tx" : "rx",
667 inb_status(dev->base_addr));
664 668
665 outb_control(adapter->hcr_val & ~(DMAE | TCEN | DIR), dev); 669 outb_control(adapter->hcr_val & ~(DMAE | TCEN | DIR), dev);
666 if (adapter->current_dma.direction) { 670 if (adapter->current_dma.direction) {
@@ -682,7 +686,7 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
682 int t = adapter->rx_backlog.length[adapter->rx_backlog.out]; 686 int t = adapter->rx_backlog.length[adapter->rx_backlog.out];
683 adapter->rx_backlog.out = backlog_next(adapter->rx_backlog.out); 687 adapter->rx_backlog.out = backlog_next(adapter->rx_backlog.out);
684 if (elp_debug >= 2) 688 if (elp_debug >= 2)
685 printk(KERN_DEBUG "%s: receiving backlogged packet (%d)\n", dev->name, t); 689 pr_debug("%s: receiving backlogged packet (%d)\n", dev->name, t);
686 receive_packet(dev, t); 690 receive_packet(dev, t);
687 } else { 691 } else {
688 adapter->busy = 0; 692 adapter->busy = 0;
@@ -713,21 +717,23 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
713 len = adapter->irx_pcb.data.rcv_resp.pkt_len; 717 len = adapter->irx_pcb.data.rcv_resp.pkt_len;
714 dlen = adapter->irx_pcb.data.rcv_resp.buf_len; 718 dlen = adapter->irx_pcb.data.rcv_resp.buf_len;
715 if (adapter->irx_pcb.data.rcv_resp.timeout != 0) { 719 if (adapter->irx_pcb.data.rcv_resp.timeout != 0) {
716 printk(KERN_ERR "%s: interrupt - packet not received correctly\n", dev->name); 720 pr_err("%s: interrupt - packet not received correctly\n", dev->name);
717 } else { 721 } else {
718 if (elp_debug >= 3) { 722 if (elp_debug >= 3) {
719 printk(KERN_DEBUG "%s: interrupt - packet received of length %i (%i)\n", dev->name, len, dlen); 723 pr_debug("%s: interrupt - packet received of length %i (%i)\n",
724 dev->name, len, dlen);
720 } 725 }
721 if (adapter->irx_pcb.command == 0xff) { 726 if (adapter->irx_pcb.command == 0xff) {
722 if (elp_debug >= 2) 727 if (elp_debug >= 2)
723 printk(KERN_DEBUG "%s: adding packet to backlog (len = %d)\n", dev->name, dlen); 728 pr_debug("%s: adding packet to backlog (len = %d)\n",
729 dev->name, dlen);
724 adapter->rx_backlog.length[adapter->rx_backlog.in] = dlen; 730 adapter->rx_backlog.length[adapter->rx_backlog.in] = dlen;
725 adapter->rx_backlog.in = backlog_next(adapter->rx_backlog.in); 731 adapter->rx_backlog.in = backlog_next(adapter->rx_backlog.in);
726 } else { 732 } else {
727 receive_packet(dev, dlen); 733 receive_packet(dev, dlen);
728 } 734 }
729 if (elp_debug >= 3) 735 if (elp_debug >= 3)
730 printk(KERN_DEBUG "%s: packet received\n", dev->name); 736 pr_debug("%s: packet received\n", dev->name);
731 } 737 }
732 break; 738 break;
733 739
@@ -737,7 +743,7 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
737 case CMD_CONFIGURE_82586_RESPONSE: 743 case CMD_CONFIGURE_82586_RESPONSE:
738 adapter->got[CMD_CONFIGURE_82586] = 1; 744 adapter->got[CMD_CONFIGURE_82586] = 1;
739 if (elp_debug >= 3) 745 if (elp_debug >= 3)
740 printk(KERN_DEBUG "%s: interrupt - configure response received\n", dev->name); 746 pr_debug("%s: interrupt - configure response received\n", dev->name);
741 break; 747 break;
742 748
743 /* 749 /*
@@ -746,7 +752,7 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
746 case CMD_CONFIGURE_ADAPTER_RESPONSE: 752 case CMD_CONFIGURE_ADAPTER_RESPONSE:
747 adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] = 1; 753 adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] = 1;
748 if (elp_debug >= 3) 754 if (elp_debug >= 3)
749 printk(KERN_DEBUG "%s: Adapter memory configuration %s.\n", dev->name, 755 pr_debug("%s: Adapter memory configuration %s.\n", dev->name,
750 adapter->irx_pcb.data.failed ? "failed" : "succeeded"); 756 adapter->irx_pcb.data.failed ? "failed" : "succeeded");
751 break; 757 break;
752 758
@@ -756,7 +762,7 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
756 case CMD_LOAD_MULTICAST_RESPONSE: 762 case CMD_LOAD_MULTICAST_RESPONSE:
757 adapter->got[CMD_LOAD_MULTICAST_LIST] = 1; 763 adapter->got[CMD_LOAD_MULTICAST_LIST] = 1;
758 if (elp_debug >= 3) 764 if (elp_debug >= 3)
759 printk(KERN_DEBUG "%s: Multicast address list loading %s.\n", dev->name, 765 pr_debug("%s: Multicast address list loading %s.\n", dev->name,
760 adapter->irx_pcb.data.failed ? "failed" : "succeeded"); 766 adapter->irx_pcb.data.failed ? "failed" : "succeeded");
761 break; 767 break;
762 768
@@ -766,7 +772,7 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
766 case CMD_SET_ADDRESS_RESPONSE: 772 case CMD_SET_ADDRESS_RESPONSE:
767 adapter->got[CMD_SET_STATION_ADDRESS] = 1; 773 adapter->got[CMD_SET_STATION_ADDRESS] = 1;
768 if (elp_debug >= 3) 774 if (elp_debug >= 3)
769 printk(KERN_DEBUG "%s: Ethernet address setting %s.\n", dev->name, 775 pr_debug("%s: Ethernet address setting %s.\n", dev->name,
770 adapter->irx_pcb.data.failed ? "failed" : "succeeded"); 776 adapter->irx_pcb.data.failed ? "failed" : "succeeded");
771 break; 777 break;
772 778
@@ -783,7 +789,7 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
783 dev->stats.rx_over_errors += adapter->irx_pcb.data.netstat.err_res; 789 dev->stats.rx_over_errors += adapter->irx_pcb.data.netstat.err_res;
784 adapter->got[CMD_NETWORK_STATISTICS] = 1; 790 adapter->got[CMD_NETWORK_STATISTICS] = 1;
785 if (elp_debug >= 3) 791 if (elp_debug >= 3)
786 printk(KERN_DEBUG "%s: interrupt - statistics response received\n", dev->name); 792 pr_debug("%s: interrupt - statistics response received\n", dev->name);
787 break; 793 break;
788 794
789 /* 795 /*
@@ -791,17 +797,17 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
791 */ 797 */
792 case CMD_TRANSMIT_PACKET_COMPLETE: 798 case CMD_TRANSMIT_PACKET_COMPLETE:
793 if (elp_debug >= 3) 799 if (elp_debug >= 3)
794 printk(KERN_DEBUG "%s: interrupt - packet sent\n", dev->name); 800 pr_debug("%s: interrupt - packet sent\n", dev->name);
795 if (!netif_running(dev)) 801 if (!netif_running(dev))
796 break; 802 break;
797 switch (adapter->irx_pcb.data.xmit_resp.c_stat) { 803 switch (adapter->irx_pcb.data.xmit_resp.c_stat) {
798 case 0xffff: 804 case 0xffff:
799 dev->stats.tx_aborted_errors++; 805 dev->stats.tx_aborted_errors++;
800 printk(KERN_INFO "%s: transmit timed out, network cable problem?\n", dev->name); 806 pr_info("%s: transmit timed out, network cable problem?\n", dev->name);
801 break; 807 break;
802 case 0xfffe: 808 case 0xfffe:
803 dev->stats.tx_fifo_errors++; 809 dev->stats.tx_fifo_errors++;
804 printk(KERN_INFO "%s: transmit timed out, FIFO underrun\n", dev->name); 810 pr_info("%s: transmit timed out, FIFO underrun\n", dev->name);
805 break; 811 break;
806 } 812 }
807 netif_wake_queue(dev); 813 netif_wake_queue(dev);
@@ -811,11 +817,12 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id)
811 * some unknown PCB 817 * some unknown PCB
812 */ 818 */
813 default: 819 default:
814 printk(KERN_DEBUG "%s: unknown PCB received - %2.2x\n", dev->name, adapter->irx_pcb.command); 820 pr_debug("%s: unknown PCB received - %2.2x\n",
821 dev->name, adapter->irx_pcb.command);
815 break; 822 break;
816 } 823 }
817 } else { 824 } else {
818 printk(KERN_WARNING "%s: failed to read PCB on interrupt\n", dev->name); 825 pr_warning("%s: failed to read PCB on interrupt\n", dev->name);
819 adapter_reset(dev); 826 adapter_reset(dev);
820 } 827 }
821 } 828 }
@@ -844,13 +851,13 @@ static int elp_open(struct net_device *dev)
844 int retval; 851 int retval;
845 852
846 if (elp_debug >= 3) 853 if (elp_debug >= 3)
847 printk(KERN_DEBUG "%s: request to open device\n", dev->name); 854 pr_debug("%s: request to open device\n", dev->name);
848 855
849 /* 856 /*
850 * make sure we actually found the device 857 * make sure we actually found the device
851 */ 858 */
852 if (adapter == NULL) { 859 if (adapter == NULL) {
853 printk(KERN_ERR "%s: Opening a non-existent physical device\n", dev->name); 860 pr_err("%s: Opening a non-existent physical device\n", dev->name);
854 return -EAGAIN; 861 return -EAGAIN;
855 } 862 }
856 /* 863 /*
@@ -880,17 +887,17 @@ static int elp_open(struct net_device *dev)
880 * install our interrupt service routine 887 * install our interrupt service routine
881 */ 888 */
882 if ((retval = request_irq(dev->irq, &elp_interrupt, 0, dev->name, dev))) { 889 if ((retval = request_irq(dev->irq, &elp_interrupt, 0, dev->name, dev))) {
883 printk(KERN_ERR "%s: could not allocate IRQ%d\n", dev->name, dev->irq); 890 pr_err("%s: could not allocate IRQ%d\n", dev->name, dev->irq);
884 return retval; 891 return retval;
885 } 892 }
886 if ((retval = request_dma(dev->dma, dev->name))) { 893 if ((retval = request_dma(dev->dma, dev->name))) {
887 free_irq(dev->irq, dev); 894 free_irq(dev->irq, dev);
888 printk(KERN_ERR "%s: could not allocate DMA%d channel\n", dev->name, dev->dma); 895 pr_err("%s: could not allocate DMA%d channel\n", dev->name, dev->dma);
889 return retval; 896 return retval;
890 } 897 }
891 adapter->dma_buffer = (void *) dma_mem_alloc(DMA_BUFFER_SIZE); 898 adapter->dma_buffer = (void *) dma_mem_alloc(DMA_BUFFER_SIZE);
892 if (!adapter->dma_buffer) { 899 if (!adapter->dma_buffer) {
893 printk(KERN_ERR "%s: could not allocate DMA buffer\n", dev->name); 900 pr_err("%s: could not allocate DMA buffer\n", dev->name);
894 free_dma(dev->dma); 901 free_dma(dev->dma);
895 free_irq(dev->irq, dev); 902 free_irq(dev->irq, dev);
896 return -ENOMEM; 903 return -ENOMEM;
@@ -906,7 +913,7 @@ static int elp_open(struct net_device *dev)
906 * configure adapter memory: we need 10 multicast addresses, default==0 913 * configure adapter memory: we need 10 multicast addresses, default==0
907 */ 914 */
908 if (elp_debug >= 3) 915 if (elp_debug >= 3)
909 printk(KERN_DEBUG "%s: sending 3c505 memory configuration command\n", dev->name); 916 pr_debug("%s: sending 3c505 memory configuration command\n", dev->name);
910 adapter->tx_pcb.command = CMD_CONFIGURE_ADAPTER_MEMORY; 917 adapter->tx_pcb.command = CMD_CONFIGURE_ADAPTER_MEMORY;
911 adapter->tx_pcb.data.memconf.cmd_q = 10; 918 adapter->tx_pcb.data.memconf.cmd_q = 10;
912 adapter->tx_pcb.data.memconf.rcv_q = 20; 919 adapter->tx_pcb.data.memconf.rcv_q = 20;
@@ -917,7 +924,7 @@ static int elp_open(struct net_device *dev)
917 adapter->tx_pcb.length = sizeof(struct Memconf); 924 adapter->tx_pcb.length = sizeof(struct Memconf);
918 adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] = 0; 925 adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] = 0;
919 if (!send_pcb(dev, &adapter->tx_pcb)) 926 if (!send_pcb(dev, &adapter->tx_pcb))
920 printk(KERN_ERR "%s: couldn't send memory configuration command\n", dev->name); 927 pr_err("%s: couldn't send memory configuration command\n", dev->name);
921 else { 928 else {
922 unsigned long timeout = jiffies + TIMEOUT; 929 unsigned long timeout = jiffies + TIMEOUT;
923 while (adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] == 0 && time_before(jiffies, timeout)); 930 while (adapter->got[CMD_CONFIGURE_ADAPTER_MEMORY] == 0 && time_before(jiffies, timeout));
@@ -930,13 +937,13 @@ static int elp_open(struct net_device *dev)
930 * configure adapter to receive broadcast messages and wait for response 937 * configure adapter to receive broadcast messages and wait for response
931 */ 938 */
932 if (elp_debug >= 3) 939 if (elp_debug >= 3)
933 printk(KERN_DEBUG "%s: sending 82586 configure command\n", dev->name); 940 pr_debug("%s: sending 82586 configure command\n", dev->name);
934 adapter->tx_pcb.command = CMD_CONFIGURE_82586; 941 adapter->tx_pcb.command = CMD_CONFIGURE_82586;
935 adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD; 942 adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD;
936 adapter->tx_pcb.length = 2; 943 adapter->tx_pcb.length = 2;
937 adapter->got[CMD_CONFIGURE_82586] = 0; 944 adapter->got[CMD_CONFIGURE_82586] = 0;
938 if (!send_pcb(dev, &adapter->tx_pcb)) 945 if (!send_pcb(dev, &adapter->tx_pcb))
939 printk(KERN_ERR "%s: couldn't send 82586 configure command\n", dev->name); 946 pr_err("%s: couldn't send 82586 configure command\n", dev->name);
940 else { 947 else {
941 unsigned long timeout = jiffies + TIMEOUT; 948 unsigned long timeout = jiffies + TIMEOUT;
942 while (adapter->got[CMD_CONFIGURE_82586] == 0 && time_before(jiffies, timeout)); 949 while (adapter->got[CMD_CONFIGURE_82586] == 0 && time_before(jiffies, timeout));
@@ -952,7 +959,7 @@ static int elp_open(struct net_device *dev)
952 */ 959 */
953 prime_rx(dev); 960 prime_rx(dev);
954 if (elp_debug >= 3) 961 if (elp_debug >= 3)
955 printk(KERN_DEBUG "%s: %d receive PCBs active\n", dev->name, adapter->rx_active); 962 pr_debug("%s: %d receive PCBs active\n", dev->name, adapter->rx_active);
956 963
957 /* 964 /*
958 * device is now officially open! 965 * device is now officially open!
@@ -982,7 +989,7 @@ static bool send_packet(struct net_device *dev, struct sk_buff *skb)
982 989
983 if (test_and_set_bit(0, (void *) &adapter->busy)) { 990 if (test_and_set_bit(0, (void *) &adapter->busy)) {
984 if (elp_debug >= 2) 991 if (elp_debug >= 2)
985 printk(KERN_DEBUG "%s: transmit blocked\n", dev->name); 992 pr_debug("%s: transmit blocked\n", dev->name);
986 return false; 993 return false;
987 } 994 }
988 995
@@ -1004,7 +1011,7 @@ static bool send_packet(struct net_device *dev, struct sk_buff *skb)
1004 } 1011 }
1005 /* if this happens, we die */ 1012 /* if this happens, we die */
1006 if (test_and_set_bit(0, (void *) &adapter->dmaing)) 1013 if (test_and_set_bit(0, (void *) &adapter->dmaing))
1007 printk(KERN_DEBUG "%s: tx: DMA %d in progress\n", dev->name, adapter->current_dma.direction); 1014 pr_debug("%s: tx: DMA %d in progress\n", dev->name, adapter->current_dma.direction);
1008 1015
1009 adapter->current_dma.direction = 1; 1016 adapter->current_dma.direction = 1;
1010 adapter->current_dma.start_time = jiffies; 1017 adapter->current_dma.start_time = jiffies;
@@ -1030,7 +1037,7 @@ static bool send_packet(struct net_device *dev, struct sk_buff *skb)
1030 release_dma_lock(flags); 1037 release_dma_lock(flags);
1031 1038
1032 if (elp_debug >= 3) 1039 if (elp_debug >= 3)
1033 printk(KERN_DEBUG "%s: DMA transfer started\n", dev->name); 1040 pr_debug("%s: DMA transfer started\n", dev->name);
1034 1041
1035 return true; 1042 return true;
1036} 1043}
@@ -1044,9 +1051,10 @@ static void elp_timeout(struct net_device *dev)
1044 int stat; 1051 int stat;
1045 1052
1046 stat = inb_status(dev->base_addr); 1053 stat = inb_status(dev->base_addr);
1047 printk(KERN_WARNING "%s: transmit timed out, lost %s?\n", dev->name, (stat & ACRF) ? "interrupt" : "command"); 1054 pr_warning("%s: transmit timed out, lost %s?\n", dev->name,
1055 (stat & ACRF) ? "interrupt" : "command");
1048 if (elp_debug >= 1) 1056 if (elp_debug >= 1)
1049 printk(KERN_DEBUG "%s: status %#02x\n", dev->name, stat); 1057 pr_debug("%s: status %#02x\n", dev->name, stat);
1050 dev->trans_start = jiffies; 1058 dev->trans_start = jiffies;
1051 dev->stats.tx_dropped++; 1059 dev->stats.tx_dropped++;
1052 netif_wake_queue(dev); 1060 netif_wake_queue(dev);
@@ -1068,7 +1076,7 @@ static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev)
1068 check_3c505_dma(dev); 1076 check_3c505_dma(dev);
1069 1077
1070 if (elp_debug >= 3) 1078 if (elp_debug >= 3)
1071 printk(KERN_DEBUG "%s: request to send packet of length %d\n", dev->name, (int) skb->len); 1079 pr_debug("%s: request to send packet of length %d\n", dev->name, (int) skb->len);
1072 1080
1073 netif_stop_queue(dev); 1081 netif_stop_queue(dev);
1074 1082
@@ -1077,13 +1085,13 @@ static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev)
1077 */ 1085 */
1078 if (!send_packet(dev, skb)) { 1086 if (!send_packet(dev, skb)) {
1079 if (elp_debug >= 2) { 1087 if (elp_debug >= 2) {
1080 printk(KERN_DEBUG "%s: failed to transmit packet\n", dev->name); 1088 pr_debug("%s: failed to transmit packet\n", dev->name);
1081 } 1089 }
1082 spin_unlock_irqrestore(&adapter->lock, flags); 1090 spin_unlock_irqrestore(&adapter->lock, flags);
1083 return 1; 1091 return 1;
1084 } 1092 }
1085 if (elp_debug >= 3) 1093 if (elp_debug >= 3)
1086 printk(KERN_DEBUG "%s: packet of length %d sent\n", dev->name, (int) skb->len); 1094 pr_debug("%s: packet of length %d sent\n", dev->name, (int) skb->len);
1087 1095
1088 /* 1096 /*
1089 * start the transmit timeout 1097 * start the transmit timeout
@@ -1107,7 +1115,7 @@ static struct net_device_stats *elp_get_stats(struct net_device *dev)
1107 elp_device *adapter = netdev_priv(dev); 1115 elp_device *adapter = netdev_priv(dev);
1108 1116
1109 if (elp_debug >= 3) 1117 if (elp_debug >= 3)
1110 printk(KERN_DEBUG "%s: request for stats\n", dev->name); 1118 pr_debug("%s: request for stats\n", dev->name);
1111 1119
1112 /* If the device is closed, just return the latest stats we have, 1120 /* If the device is closed, just return the latest stats we have,
1113 - we cannot ask from the adapter without interrupts */ 1121 - we cannot ask from the adapter without interrupts */
@@ -1119,7 +1127,7 @@ static struct net_device_stats *elp_get_stats(struct net_device *dev)
1119 adapter->tx_pcb.length = 0; 1127 adapter->tx_pcb.length = 0;
1120 adapter->got[CMD_NETWORK_STATISTICS] = 0; 1128 adapter->got[CMD_NETWORK_STATISTICS] = 0;
1121 if (!send_pcb(dev, &adapter->tx_pcb)) 1129 if (!send_pcb(dev, &adapter->tx_pcb))
1122 printk(KERN_ERR "%s: couldn't send get statistics command\n", dev->name); 1130 pr_err("%s: couldn't send get statistics command\n", dev->name);
1123 else { 1131 else {
1124 unsigned long timeout = jiffies + TIMEOUT; 1132 unsigned long timeout = jiffies + TIMEOUT;
1125 while (adapter->got[CMD_NETWORK_STATISTICS] == 0 && time_before(jiffies, timeout)); 1133 while (adapter->got[CMD_NETWORK_STATISTICS] == 0 && time_before(jiffies, timeout));
@@ -1169,7 +1177,7 @@ static int elp_close(struct net_device *dev)
1169 elp_device *adapter = netdev_priv(dev); 1177 elp_device *adapter = netdev_priv(dev);
1170 1178
1171 if (elp_debug >= 3) 1179 if (elp_debug >= 3)
1172 printk(KERN_DEBUG "%s: request to close device\n", dev->name); 1180 pr_debug("%s: request to close device\n", dev->name);
1173 1181
1174 netif_stop_queue(dev); 1182 netif_stop_queue(dev);
1175 1183
@@ -1213,7 +1221,7 @@ static void elp_set_mc_list(struct net_device *dev)
1213 unsigned long flags; 1221 unsigned long flags;
1214 1222
1215 if (elp_debug >= 3) 1223 if (elp_debug >= 3)
1216 printk(KERN_DEBUG "%s: request to set multicast list\n", dev->name); 1224 pr_debug("%s: request to set multicast list\n", dev->name);
1217 1225
1218 spin_lock_irqsave(&adapter->lock, flags); 1226 spin_lock_irqsave(&adapter->lock, flags);
1219 1227
@@ -1228,7 +1236,7 @@ static void elp_set_mc_list(struct net_device *dev)
1228 } 1236 }
1229 adapter->got[CMD_LOAD_MULTICAST_LIST] = 0; 1237 adapter->got[CMD_LOAD_MULTICAST_LIST] = 0;
1230 if (!send_pcb(dev, &adapter->tx_pcb)) 1238 if (!send_pcb(dev, &adapter->tx_pcb))
1231 printk(KERN_ERR "%s: couldn't send set_multicast command\n", dev->name); 1239 pr_err("%s: couldn't send set_multicast command\n", dev->name);
1232 else { 1240 else {
1233 unsigned long timeout = jiffies + TIMEOUT; 1241 unsigned long timeout = jiffies + TIMEOUT;
1234 while (adapter->got[CMD_LOAD_MULTICAST_LIST] == 0 && time_before(jiffies, timeout)); 1242 while (adapter->got[CMD_LOAD_MULTICAST_LIST] == 0 && time_before(jiffies, timeout));
@@ -1247,14 +1255,14 @@ static void elp_set_mc_list(struct net_device *dev)
1247 * and wait for response 1255 * and wait for response
1248 */ 1256 */
1249 if (elp_debug >= 3) 1257 if (elp_debug >= 3)
1250 printk(KERN_DEBUG "%s: sending 82586 configure command\n", dev->name); 1258 pr_debug("%s: sending 82586 configure command\n", dev->name);
1251 adapter->tx_pcb.command = CMD_CONFIGURE_82586; 1259 adapter->tx_pcb.command = CMD_CONFIGURE_82586;
1252 adapter->tx_pcb.length = 2; 1260 adapter->tx_pcb.length = 2;
1253 adapter->got[CMD_CONFIGURE_82586] = 0; 1261 adapter->got[CMD_CONFIGURE_82586] = 0;
1254 if (!send_pcb(dev, &adapter->tx_pcb)) 1262 if (!send_pcb(dev, &adapter->tx_pcb))
1255 { 1263 {
1256 spin_unlock_irqrestore(&adapter->lock, flags); 1264 spin_unlock_irqrestore(&adapter->lock, flags);
1257 printk(KERN_ERR "%s: couldn't send 82586 configure command\n", dev->name); 1265 pr_err("%s: couldn't send 82586 configure command\n", dev->name);
1258 } 1266 }
1259 else { 1267 else {
1260 unsigned long timeout = jiffies + TIMEOUT; 1268 unsigned long timeout = jiffies + TIMEOUT;
@@ -1283,17 +1291,17 @@ static int __init elp_sense(struct net_device *dev)
1283 orig_HSR = inb_status(addr); 1291 orig_HSR = inb_status(addr);
1284 1292
1285 if (elp_debug > 0) 1293 if (elp_debug > 0)
1286 printk(search_msg, name, addr); 1294 pr_debug(search_msg, name, addr);
1287 1295
1288 if (orig_HSR == 0xff) { 1296 if (orig_HSR == 0xff) {
1289 if (elp_debug > 0) 1297 if (elp_debug > 0)
1290 printk(notfound_msg, 1); 1298 pr_cont(notfound_msg, 1);
1291 goto out; 1299 goto out;
1292 } 1300 }
1293 1301
1294 /* Wait for a while; the adapter may still be booting up */ 1302 /* Wait for a while; the adapter may still be booting up */
1295 if (elp_debug > 0) 1303 if (elp_debug > 0)
1296 printk(stilllooking_msg); 1304 pr_cont(stilllooking_msg);
1297 1305
1298 if (orig_HSR & DIR) { 1306 if (orig_HSR & DIR) {
1299 /* If HCR.DIR is up, we pull it down. HSR.DIR should follow. */ 1307 /* If HCR.DIR is up, we pull it down. HSR.DIR should follow. */
@@ -1301,7 +1309,7 @@ static int __init elp_sense(struct net_device *dev)
1301 msleep(300); 1309 msleep(300);
1302 if (inb_status(addr) & DIR) { 1310 if (inb_status(addr) & DIR) {
1303 if (elp_debug > 0) 1311 if (elp_debug > 0)
1304 printk(notfound_msg, 2); 1312 pr_cont(notfound_msg, 2);
1305 goto out; 1313 goto out;
1306 } 1314 }
1307 } else { 1315 } else {
@@ -1310,7 +1318,7 @@ static int __init elp_sense(struct net_device *dev)
1310 msleep(300); 1318 msleep(300);
1311 if (!(inb_status(addr) & DIR)) { 1319 if (!(inb_status(addr) & DIR)) {
1312 if (elp_debug > 0) 1320 if (elp_debug > 0)
1313 printk(notfound_msg, 3); 1321 pr_cont(notfound_msg, 3);
1314 goto out; 1322 goto out;
1315 } 1323 }
1316 } 1324 }
@@ -1318,7 +1326,7 @@ static int __init elp_sense(struct net_device *dev)
1318 * It certainly looks like a 3c505. 1326 * It certainly looks like a 3c505.
1319 */ 1327 */
1320 if (elp_debug > 0) 1328 if (elp_debug > 0)
1321 printk(found_msg); 1329 pr_cont(found_msg);
1322 1330
1323 return 0; 1331 return 0;
1324out: 1332out:
@@ -1349,7 +1357,7 @@ static int __init elp_autodetect(struct net_device *dev)
1349 1357
1350 /* could not find an adapter */ 1358 /* could not find an adapter */
1351 if (elp_debug > 0) 1359 if (elp_debug > 0)
1352 printk(couldnot_msg, dev->name); 1360 pr_debug(couldnot_msg, dev->name);
1353 1361
1354 return 0; /* Because of this, the layer above will return -ENODEV */ 1362 return 0; /* Because of this, the layer above will return -ENODEV */
1355} 1363}
@@ -1424,16 +1432,16 @@ static int __init elplus_setup(struct net_device *dev)
1424 /* Nope, it's ignoring the command register. This means that 1432 /* Nope, it's ignoring the command register. This means that
1425 * either it's still booting up, or it's died. 1433 * either it's still booting up, or it's died.
1426 */ 1434 */
1427 printk(KERN_ERR "%s: command register wouldn't drain, ", dev->name); 1435 pr_err("%s: command register wouldn't drain, ", dev->name);
1428 if ((inb_status(dev->base_addr) & 7) == 3) { 1436 if ((inb_status(dev->base_addr) & 7) == 3) {
1429 /* If the adapter status is 3, it *could* still be booting. 1437 /* If the adapter status is 3, it *could* still be booting.
1430 * Give it the benefit of the doubt for 10 seconds. 1438 * Give it the benefit of the doubt for 10 seconds.
1431 */ 1439 */
1432 printk("assuming 3c505 still starting\n"); 1440 pr_cont("assuming 3c505 still starting\n");
1433 timeout = jiffies + 10*HZ; 1441 timeout = jiffies + 10*HZ;
1434 while (time_before(jiffies, timeout) && (inb_status(dev->base_addr) & 7)); 1442 while (time_before(jiffies, timeout) && (inb_status(dev->base_addr) & 7));
1435 if (inb_status(dev->base_addr) & 7) { 1443 if (inb_status(dev->base_addr) & 7) {
1436 printk(KERN_ERR "%s: 3c505 failed to start\n", dev->name); 1444 pr_err("%s: 3c505 failed to start\n", dev->name);
1437 } else { 1445 } else {
1438 okay = 1; /* It started */ 1446 okay = 1; /* It started */
1439 } 1447 }
@@ -1441,7 +1449,7 @@ static int __init elplus_setup(struct net_device *dev)
1441 /* Otherwise, it must just be in a strange 1449 /* Otherwise, it must just be in a strange
1442 * state. We probably need to kick it. 1450 * state. We probably need to kick it.
1443 */ 1451 */
1444 printk("3c505 is sulking\n"); 1452 pr_cont("3c505 is sulking\n");
1445 } 1453 }
1446 } 1454 }
1447 for (tries = 0; tries < 5 && okay; tries++) { 1455 for (tries = 0; tries < 5 && okay; tries++) {
@@ -1454,18 +1462,19 @@ static int __init elplus_setup(struct net_device *dev)
1454 adapter->tx_pcb.length = 0; 1462 adapter->tx_pcb.length = 0;
1455 cookie = probe_irq_on(); 1463 cookie = probe_irq_on();
1456 if (!send_pcb(dev, &adapter->tx_pcb)) { 1464 if (!send_pcb(dev, &adapter->tx_pcb)) {
1457 printk(KERN_ERR "%s: could not send first PCB\n", dev->name); 1465 pr_err("%s: could not send first PCB\n", dev->name);
1458 probe_irq_off(cookie); 1466 probe_irq_off(cookie);
1459 continue; 1467 continue;
1460 } 1468 }
1461 if (!receive_pcb(dev, &adapter->rx_pcb)) { 1469 if (!receive_pcb(dev, &adapter->rx_pcb)) {
1462 printk(KERN_ERR "%s: could not read first PCB\n", dev->name); 1470 pr_err("%s: could not read first PCB\n", dev->name);
1463 probe_irq_off(cookie); 1471 probe_irq_off(cookie);
1464 continue; 1472 continue;
1465 } 1473 }
1466 if ((adapter->rx_pcb.command != CMD_ADDRESS_RESPONSE) || 1474 if ((adapter->rx_pcb.command != CMD_ADDRESS_RESPONSE) ||
1467 (adapter->rx_pcb.length != 6)) { 1475 (adapter->rx_pcb.length != 6)) {
1468 printk(KERN_ERR "%s: first PCB wrong (%d, %d)\n", dev->name, adapter->rx_pcb.command, adapter->rx_pcb.length); 1476 pr_err("%s: first PCB wrong (%d, %d)\n", dev->name,
1477 adapter->rx_pcb.command, adapter->rx_pcb.length);
1469 probe_irq_off(cookie); 1478 probe_irq_off(cookie);
1470 continue; 1479 continue;
1471 } 1480 }
@@ -1474,32 +1483,32 @@ static int __init elplus_setup(struct net_device *dev)
1474 /* It's broken. Do a hard reset to re-initialise the board, 1483 /* It's broken. Do a hard reset to re-initialise the board,
1475 * and try again. 1484 * and try again.
1476 */ 1485 */
1477 printk(KERN_INFO "%s: resetting adapter\n", dev->name); 1486 pr_info("%s: resetting adapter\n", dev->name);
1478 outb_control(adapter->hcr_val | FLSH | ATTN, dev); 1487 outb_control(adapter->hcr_val | FLSH | ATTN, dev);
1479 outb_control(adapter->hcr_val & ~(FLSH | ATTN), dev); 1488 outb_control(adapter->hcr_val & ~(FLSH | ATTN), dev);
1480 } 1489 }
1481 printk(KERN_ERR "%s: failed to initialise 3c505\n", dev->name); 1490 pr_err("%s: failed to initialise 3c505\n", dev->name);
1482 goto out; 1491 goto out;
1483 1492
1484 okay: 1493 okay:
1485 if (dev->irq) { /* Is there a preset IRQ? */ 1494 if (dev->irq) { /* Is there a preset IRQ? */
1486 int rpt = probe_irq_off(cookie); 1495 int rpt = probe_irq_off(cookie);
1487 if (dev->irq != rpt) { 1496 if (dev->irq != rpt) {
1488 printk(KERN_WARNING "%s: warning, irq %d configured but %d detected\n", dev->name, dev->irq, rpt); 1497 pr_warning("%s: warning, irq %d configured but %d detected\n", dev->name, dev->irq, rpt);
1489 } 1498 }
1490 /* if dev->irq == probe_irq_off(cookie), all is well */ 1499 /* if dev->irq == probe_irq_off(cookie), all is well */
1491 } else /* No preset IRQ; just use what we can detect */ 1500 } else /* No preset IRQ; just use what we can detect */
1492 dev->irq = probe_irq_off(cookie); 1501 dev->irq = probe_irq_off(cookie);
1493 switch (dev->irq) { /* Legal, sane? */ 1502 switch (dev->irq) { /* Legal, sane? */
1494 case 0: 1503 case 0:
1495 printk(KERN_ERR "%s: IRQ probe failed: check 3c505 jumpers.\n", 1504 pr_err("%s: IRQ probe failed: check 3c505 jumpers.\n",
1496 dev->name); 1505 dev->name);
1497 goto out; 1506 goto out;
1498 case 1: 1507 case 1:
1499 case 6: 1508 case 6:
1500 case 8: 1509 case 8:
1501 case 13: 1510 case 13:
1502 printk(KERN_ERR "%s: Impossible IRQ %d reported by probe_irq_off().\n", 1511 pr_err("%s: Impossible IRQ %d reported by probe_irq_off().\n",
1503 dev->name, dev->irq); 1512 dev->name, dev->irq);
1504 goto out; 1513 goto out;
1505 } 1514 }
@@ -1521,7 +1530,7 @@ static int __init elplus_setup(struct net_device *dev)
1521 dev->dma = dev->mem_start & 7; 1530 dev->dma = dev->mem_start & 7;
1522 } 1531 }
1523 else { 1532 else {
1524 printk(KERN_WARNING "%s: warning, DMA channel not specified, using default\n", dev->name); 1533 pr_warning("%s: warning, DMA channel not specified, using default\n", dev->name);
1525 dev->dma = ELP_DMA; 1534 dev->dma = ELP_DMA;
1526 } 1535 }
1527 } 1536 }
@@ -1529,11 +1538,8 @@ static int __init elplus_setup(struct net_device *dev)
1529 /* 1538 /*
1530 * print remainder of startup message 1539 * print remainder of startup message
1531 */ 1540 */
1532 printk(KERN_INFO "%s: 3c505 at %#lx, irq %d, dma %d, " 1541 pr_info("%s: 3c505 at %#lx, irq %d, dma %d, addr %pM, ",
1533 "addr %pM, ", 1542 dev->name, dev->base_addr, dev->irq, dev->dma, dev->dev_addr);
1534 dev->name, dev->base_addr, dev->irq, dev->dma,
1535 dev->dev_addr);
1536
1537 /* 1543 /*
1538 * read more information from the adapter 1544 * read more information from the adapter
1539 */ 1545 */
@@ -1544,9 +1550,10 @@ static int __init elplus_setup(struct net_device *dev)
1544 !receive_pcb(dev, &adapter->rx_pcb) || 1550 !receive_pcb(dev, &adapter->rx_pcb) ||
1545 (adapter->rx_pcb.command != CMD_ADAPTER_INFO_RESPONSE) || 1551 (adapter->rx_pcb.command != CMD_ADAPTER_INFO_RESPONSE) ||
1546 (adapter->rx_pcb.length != 10)) { 1552 (adapter->rx_pcb.length != 10)) {
1547 printk("not responding to second PCB\n"); 1553 pr_cont("not responding to second PCB\n");
1548 } 1554 }
1549 printk("rev %d.%d, %dk\n", adapter->rx_pcb.data.info.major_vers, adapter->rx_pcb.data.info.minor_vers, adapter->rx_pcb.data.info.RAM_sz); 1555 pr_cont("rev %d.%d, %dk\n", adapter->rx_pcb.data.info.major_vers,
1556 adapter->rx_pcb.data.info.minor_vers, adapter->rx_pcb.data.info.RAM_sz);
1550 1557
1551 /* 1558 /*
1552 * reconfigure the adapter memory to better suit our purposes 1559 * reconfigure the adapter memory to better suit our purposes
@@ -1563,10 +1570,10 @@ static int __init elplus_setup(struct net_device *dev)
1563 !receive_pcb(dev, &adapter->rx_pcb) || 1570 !receive_pcb(dev, &adapter->rx_pcb) ||
1564 (adapter->rx_pcb.command != CMD_CONFIGURE_ADAPTER_RESPONSE) || 1571 (adapter->rx_pcb.command != CMD_CONFIGURE_ADAPTER_RESPONSE) ||
1565 (adapter->rx_pcb.length != 2)) { 1572 (adapter->rx_pcb.length != 2)) {
1566 printk(KERN_ERR "%s: could not configure adapter memory\n", dev->name); 1573 pr_err("%s: could not configure adapter memory\n", dev->name);
1567 } 1574 }
1568 if (adapter->rx_pcb.data.configure) { 1575 if (adapter->rx_pcb.data.configure) {
1569 printk(KERN_ERR "%s: adapter configuration failed\n", dev->name); 1576 pr_err("%s: adapter configuration failed\n", dev->name);
1570 } 1577 }
1571 1578
1572 dev->netdev_ops = &elp_netdev_ops; 1579 dev->netdev_ops = &elp_netdev_ops;
@@ -1631,17 +1638,17 @@ int __init init_module(void)
1631 dev->dma = dma[this_dev]; 1638 dev->dma = dma[this_dev];
1632 } else { 1639 } else {
1633 dev->dma = ELP_DMA; 1640 dev->dma = ELP_DMA;
1634 printk(KERN_WARNING "3c505.c: warning, using default DMA channel,\n"); 1641 pr_warning("3c505.c: warning, using default DMA channel,\n");
1635 } 1642 }
1636 if (io[this_dev] == 0) { 1643 if (io[this_dev] == 0) {
1637 if (this_dev) { 1644 if (this_dev) {
1638 free_netdev(dev); 1645 free_netdev(dev);
1639 break; 1646 break;
1640 } 1647 }
1641 printk(KERN_NOTICE "3c505.c: module autoprobe not recommended, give io=xx.\n"); 1648 pr_notice("3c505.c: module autoprobe not recommended, give io=xx.\n");
1642 } 1649 }
1643 if (elplus_setup(dev) != 0) { 1650 if (elplus_setup(dev) != 0) {
1644 printk(KERN_WARNING "3c505.c: Failed to register card at 0x%x.\n", io[this_dev]); 1651 pr_warning("3c505.c: Failed to register card at 0x%x.\n", io[this_dev]);
1645 free_netdev(dev); 1652 free_netdev(dev);
1646 break; 1653 break;
1647 } 1654 }