aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/3c523.c
diff options
context:
space:
mode:
authorAlexander Beregalov <a.beregalov@gmail.com>2009-05-26 08:35:26 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-26 23:35:03 -0400
commit39738e161f7315bfa8f31a91d2262f93d818a7cd (patch)
tree97777f397e4b2ef76a44d8eb539b2c3e39718337 /drivers/net/3c523.c
parent646cdb32831eebe8c2f742c293d0d266326854d9 (diff)
3c5xx: convert printk() to pr_<foo>()
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/3c523.c')
-rw-r--r--drivers/net/3c523.c91
1 files changed, 48 insertions, 43 deletions
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index 8f734d74b513..cdd955c4014c 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -176,7 +176,7 @@ sizeof(nop_cmd) = 8;
176 if(!p->scb->cmd) break; \ 176 if(!p->scb->cmd) break; \
177 DELAY_16(); \ 177 DELAY_16(); \
178 if(i == 1023) { \ 178 if(i == 1023) { \
179 printk(KERN_WARNING "%s:%d: scb_cmd timed out .. resetting i82586\n",\ 179 pr_warning("%s:%d: scb_cmd timed out .. resetting i82586\n",\
180 dev->name,__LINE__); \ 180 dev->name,__LINE__); \
181 elmc_id_reset586(); } } } 181 elmc_id_reset586(); } } }
182 182
@@ -291,7 +291,7 @@ static int elmc_open(struct net_device *dev)
291 ret = request_irq(dev->irq, &elmc_interrupt, IRQF_SHARED | IRQF_SAMPLE_RANDOM, 291 ret = request_irq(dev->irq, &elmc_interrupt, IRQF_SHARED | IRQF_SAMPLE_RANDOM,
292 dev->name, dev); 292 dev->name, dev);
293 if (ret) { 293 if (ret) {
294 printk(KERN_ERR "%s: couldn't get irq %d\n", dev->name, dev->irq); 294 pr_err("%s: couldn't get irq %d\n", dev->name, dev->irq);
295 elmc_id_reset586(); 295 elmc_id_reset586();
296 return ret; 296 return ret;
297 } 297 }
@@ -371,9 +371,9 @@ static void alloc586(struct net_device *dev)
371 371
372 DELAY(2); 372 DELAY(2);
373 373
374 if (p->iscp->busy) { 374 if (p->iscp->busy)
375 printk(KERN_ERR "%s: Init-Problems (alloc).\n", dev->name); 375 pr_err("%s: Init-Problems (alloc).\n", dev->name);
376 } 376
377 memset((char *) p->scb, 0, sizeof(struct scb_struct)); 377 memset((char *) p->scb, 0, sizeof(struct scb_struct));
378} 378}
379 379
@@ -470,7 +470,7 @@ static int __init do_elmc_probe(struct net_device *dev)
470 mca_set_adapter_procfn(slot, (MCA_ProcFn) elmc_getinfo, dev); 470 mca_set_adapter_procfn(slot, (MCA_ProcFn) elmc_getinfo, dev);
471 471
472 /* if we get this far, adapter has been found - carry on */ 472 /* if we get this far, adapter has been found - carry on */
473 printk(KERN_INFO "%s: 3c523 adapter found in slot %d\n", dev->name, slot + 1); 473 pr_info("%s: 3c523 adapter found in slot %d\n", dev->name, slot + 1);
474 474
475 /* Now we extract configuration info from the card. 475 /* Now we extract configuration info from the card.
476 The 3c523 provides information in two of the POS registers, but 476 The 3c523 provides information in two of the POS registers, but
@@ -507,7 +507,7 @@ static int __init do_elmc_probe(struct net_device *dev)
507 memset(pr, 0, sizeof(struct priv)); 507 memset(pr, 0, sizeof(struct priv));
508 pr->slot = slot; 508 pr->slot = slot;
509 509
510 printk(KERN_INFO "%s: 3Com 3c523 Rev 0x%x at %#lx\n", dev->name, (int) revision, 510 pr_info("%s: 3Com 3c523 Rev 0x%x at %#lx\n", dev->name, (int) revision,
511 dev->base_addr); 511 dev->base_addr);
512 512
513 /* Determine if we're using the on-board transceiver (i.e. coax) or 513 /* Determine if we're using the on-board transceiver (i.e. coax) or
@@ -529,7 +529,7 @@ static int __init do_elmc_probe(struct net_device *dev)
529 529
530 size = 0x4000; /* check for 16K mem */ 530 size = 0x4000; /* check for 16K mem */
531 if (!check586(dev, dev->mem_start, size)) { 531 if (!check586(dev, dev->mem_start, size)) {
532 printk(KERN_ERR "%s: memprobe, Can't find memory at 0x%lx!\n", dev->name, 532 pr_err("%s: memprobe, Can't find memory at 0x%lx!\n", dev->name,
533 dev->mem_start); 533 dev->mem_start);
534 retval = -ENODEV; 534 retval = -ENODEV;
535 goto err_out; 535 goto err_out;
@@ -546,7 +546,7 @@ static int __init do_elmc_probe(struct net_device *dev)
546 pr->num_recv_buffs = NUM_RECV_BUFFS_16; 546 pr->num_recv_buffs = NUM_RECV_BUFFS_16;
547 547
548 /* dump all the assorted information */ 548 /* dump all the assorted information */
549 printk(KERN_INFO "%s: IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->name, 549 pr_info("%s: IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->name,
550 dev->irq, dev->if_port ? "ex" : "in", 550 dev->irq, dev->if_port ? "ex" : "in",
551 dev->mem_start, dev->mem_end - 1); 551 dev->mem_start, dev->mem_end - 1);
552 552
@@ -555,7 +555,7 @@ static int __init do_elmc_probe(struct net_device *dev)
555 for (i = 0; i < 6; i++) 555 for (i = 0; i < 6; i++)
556 dev->dev_addr[i] = inb(dev->base_addr + i); 556 dev->dev_addr[i] = inb(dev->base_addr + i);
557 557
558 printk(KERN_INFO "%s: hardware address %pM\n", 558 pr_info("%s: hardware address %pM\n",
559 dev->name, dev->dev_addr); 559 dev->name, dev->dev_addr);
560 560
561 dev->netdev_ops = &netdev_ops; 561 dev->netdev_ops = &netdev_ops;
@@ -660,7 +660,7 @@ static int init586(struct net_device *dev)
660 } 660 }
661 661
662 if ((cfg_cmd->cmd_status & (STAT_OK | STAT_COMPL)) != (STAT_COMPL | STAT_OK)) { 662 if ((cfg_cmd->cmd_status & (STAT_OK | STAT_COMPL)) != (STAT_COMPL | STAT_OK)) {
663 printk(KERN_WARNING "%s (elmc): configure command failed: %x\n", dev->name, cfg_cmd->cmd_status); 663 pr_warning("%s (elmc): configure command failed: %x\n", dev->name, cfg_cmd->cmd_status);
664 return 1; 664 return 1;
665 } 665 }
666 /* 666 /*
@@ -686,7 +686,8 @@ static int init586(struct net_device *dev)
686 } 686 }
687 687
688 if ((ias_cmd->cmd_status & (STAT_OK | STAT_COMPL)) != (STAT_OK | STAT_COMPL)) { 688 if ((ias_cmd->cmd_status & (STAT_OK | STAT_COMPL)) != (STAT_OK | STAT_COMPL)) {
689 printk(KERN_WARNING "%s (elmc): individual address setup command failed: %04x\n", dev->name, ias_cmd->cmd_status); 689 pr_warning("%s (elmc): individual address setup command failed: %04x\n",
690 dev->name, ias_cmd->cmd_status);
690 return 1; 691 return 1;
691 } 692 }
692 /* 693 /*
@@ -707,7 +708,7 @@ static int init586(struct net_device *dev)
707 s = jiffies; 708 s = jiffies;
708 while (!(tdr_cmd->cmd_status & STAT_COMPL)) { 709 while (!(tdr_cmd->cmd_status & STAT_COMPL)) {
709 if (time_after(jiffies, s + 30*HZ/100)) { 710 if (time_after(jiffies, s + 30*HZ/100)) {
710 printk(KERN_WARNING "%s: %d Problems while running the TDR.\n", dev->name, __LINE__); 711 pr_warning("%s: %d Problems while running the TDR.\n", dev->name, __LINE__);
711 result = 1; 712 result = 1;
712 break; 713 break;
713 } 714 }
@@ -723,14 +724,14 @@ static int init586(struct net_device *dev)
723 if (result & TDR_LNK_OK) { 724 if (result & TDR_LNK_OK) {
724 /* empty */ 725 /* empty */
725 } else if (result & TDR_XCVR_PRB) { 726 } else if (result & TDR_XCVR_PRB) {
726 printk(KERN_WARNING "%s: TDR: Transceiver problem!\n", dev->name); 727 pr_warning("%s: TDR: Transceiver problem!\n", dev->name);
727 } else if (result & TDR_ET_OPN) { 728 } else if (result & TDR_ET_OPN) {
728 printk(KERN_WARNING "%s: TDR: No correct termination %d clocks away.\n", dev->name, result & TDR_TIMEMASK); 729 pr_warning("%s: TDR: No correct termination %d clocks away.\n", dev->name, result & TDR_TIMEMASK);
729 } else if (result & TDR_ET_SRT) { 730 } else if (result & TDR_ET_SRT) {
730 if (result & TDR_TIMEMASK) /* time == 0 -> strange :-) */ 731 if (result & TDR_TIMEMASK) /* time == 0 -> strange :-) */
731 printk(KERN_WARNING "%s: TDR: Detected a short circuit %d clocks away.\n", dev->name, result & TDR_TIMEMASK); 732 pr_warning("%s: TDR: Detected a short circuit %d clocks away.\n", dev->name, result & TDR_TIMEMASK);
732 } else { 733 } else {
733 printk(KERN_WARNING "%s: TDR: Unknown status %04x\n", dev->name, result); 734 pr_warning("%s: TDR: Unknown status %04x\n", dev->name, result);
734 } 735 }
735 } 736 }
736 /* 737 /*
@@ -774,11 +775,11 @@ static int init586(struct net_device *dev)
774 /* I don't understand this: do we really need memory after the init? */ 775 /* I don't understand this: do we really need memory after the init? */
775 int len = ((char *) p->iscp - (char *) ptr - 8) / 6; 776 int len = ((char *) p->iscp - (char *) ptr - 8) / 6;
776 if (len <= 0) { 777 if (len <= 0) {
777 printk(KERN_ERR "%s: Ooooops, no memory for MC-Setup!\n", dev->name); 778 pr_err("%s: Ooooops, no memory for MC-Setup!\n", dev->name);
778 } else { 779 } else {
779 if (len < num_addrs) { 780 if (len < num_addrs) {
780 num_addrs = len; 781 num_addrs = len;
781 printk(KERN_WARNING "%s: Sorry, can only apply %d MC-Address(es).\n", 782 pr_warning("%s: Sorry, can only apply %d MC-Address(es).\n",
782 dev->name, num_addrs); 783 dev->name, num_addrs);
783 } 784 }
784 mc_cmd = (struct mcsetup_cmd_struct *) ptr; 785 mc_cmd = (struct mcsetup_cmd_struct *) ptr;
@@ -799,7 +800,7 @@ static int init586(struct net_device *dev)
799 break; 800 break;
800 } 801 }
801 if (!(mc_cmd->cmd_status & STAT_COMPL)) { 802 if (!(mc_cmd->cmd_status & STAT_COMPL)) {
802 printk(KERN_WARNING "%s: Can't apply multicast-address-list.\n", dev->name); 803 pr_warning("%s: Can't apply multicast-address-list.\n", dev->name);
803 } 804 }
804 } 805 }
805 } 806 }
@@ -812,7 +813,7 @@ static int init586(struct net_device *dev)
812 p->xmit_buffs[i] = (struct tbd_struct *) ptr; /* TBD */ 813 p->xmit_buffs[i] = (struct tbd_struct *) ptr; /* TBD */
813 ptr = (char *) ptr + sizeof(struct tbd_struct); 814 ptr = (char *) ptr + sizeof(struct tbd_struct);
814 if ((void *) ptr > (void *) p->iscp) { 815 if ((void *) ptr > (void *) p->iscp) {
815 printk(KERN_ERR "%s: not enough shared-mem for your configuration!\n", dev->name); 816 pr_err("%s: not enough shared-mem for your configuration!\n", dev->name);
816 return 1; 817 return 1;
817 } 818 }
818 memset((char *) (p->xmit_cmds[i]), 0, sizeof(struct transmit_cmd_struct)); 819 memset((char *) (p->xmit_cmds[i]), 0, sizeof(struct transmit_cmd_struct));
@@ -936,7 +937,8 @@ elmc_interrupt(int irq, void *dev_id)
936 if (stat & STAT_CNA) { 937 if (stat & STAT_CNA) {
937 /* CU went 'not ready' */ 938 /* CU went 'not ready' */
938 if (netif_running(dev)) { 939 if (netif_running(dev)) {
939 printk(KERN_WARNING "%s: oops! CU has left active state. stat: %04x/%04x.\n", dev->name, (int) stat, (int) p->scb->status); 940 pr_warning("%s: oops! CU has left active state. stat: %04x/%04x.\n",
941 dev->name, (int) stat, (int) p->scb->status);
940 } 942 }
941 } 943 }
942#endif 944#endif
@@ -951,7 +953,8 @@ elmc_interrupt(int irq, void *dev_id)
951 p->scb->cmd = RUC_RESUME; 953 p->scb->cmd = RUC_RESUME;
952 elmc_attn586(); 954 elmc_attn586();
953 } else { 955 } else {
954 printk(KERN_WARNING "%s: Receiver-Unit went 'NOT READY': %04x/%04x.\n", dev->name, (int) stat, (int) p->scb->status); 956 pr_warning("%s: Receiver-Unit went 'NOT READY': %04x/%04x.\n",
957 dev->name, (int) stat, (int) p->scb->status);
955 elmc_rnr_int(dev); 958 elmc_rnr_int(dev);
956 } 959 }
957 } 960 }
@@ -995,11 +998,11 @@ static void elmc_rcv_int(struct net_device *dev)
995 dev->stats.rx_dropped++; 998 dev->stats.rx_dropped++;
996 } 999 }
997 } else { 1000 } else {
998 printk(KERN_WARNING "%s: received oversized frame.\n", dev->name); 1001 pr_warning("%s: received oversized frame.\n", dev->name);
999 dev->stats.rx_dropped++; 1002 dev->stats.rx_dropped++;
1000 } 1003 }
1001 } else { /* frame !(ok), only with 'save-bad-frames' */ 1004 } else { /* frame !(ok), only with 'save-bad-frames' */
1002 printk(KERN_WARNING "%s: oops! rfd-error-status: %04x\n", dev->name, status); 1005 pr_warning("%s: oops! rfd-error-status: %04x\n", dev->name, status);
1003 dev->stats.rx_errors++; 1006 dev->stats.rx_errors++;
1004 } 1007 }
1005 p->rfd_top->status = 0; 1008 p->rfd_top->status = 0;
@@ -1028,7 +1031,7 @@ static void elmc_rnr_int(struct net_device *dev)
1028 alloc_rfa(dev, (char *) p->rfd_first); 1031 alloc_rfa(dev, (char *) p->rfd_first);
1029 startrecv586(dev); /* restart RU */ 1032 startrecv586(dev); /* restart RU */
1030 1033
1031 printk(KERN_WARNING "%s: Receive-Unit restarted. Status: %04x\n", dev->name, p->scb->status); 1034 pr_warning("%s: Receive-Unit restarted. Status: %04x\n", dev->name, p->scb->status);
1032 1035
1033} 1036}
1034 1037
@@ -1043,7 +1046,7 @@ static void elmc_xmt_int(struct net_device *dev)
1043 1046
1044 status = p->xmit_cmds[p->xmit_last]->cmd_status; 1047 status = p->xmit_cmds[p->xmit_last]->cmd_status;
1045 if (!(status & STAT_COMPL)) { 1048 if (!(status & STAT_COMPL)) {
1046 printk(KERN_WARNING "%s: strange .. xmit-int without a 'COMPLETE'\n", dev->name); 1049 pr_warning("%s: strange .. xmit-int without a 'COMPLETE'\n", dev->name);
1047 } 1050 }
1048 if (status & STAT_OK) { 1051 if (status & STAT_OK) {
1049 dev->stats.tx_packets++; 1052 dev->stats.tx_packets++;
@@ -1051,18 +1054,18 @@ static void elmc_xmt_int(struct net_device *dev)
1051 } else { 1054 } else {
1052 dev->stats.tx_errors++; 1055 dev->stats.tx_errors++;
1053 if (status & TCMD_LATECOLL) { 1056 if (status & TCMD_LATECOLL) {
1054 printk(KERN_WARNING "%s: late collision detected.\n", dev->name); 1057 pr_warning("%s: late collision detected.\n", dev->name);
1055 dev->stats.collisions++; 1058 dev->stats.collisions++;
1056 } else if (status & TCMD_NOCARRIER) { 1059 } else if (status & TCMD_NOCARRIER) {
1057 dev->stats.tx_carrier_errors++; 1060 dev->stats.tx_carrier_errors++;
1058 printk(KERN_WARNING "%s: no carrier detected.\n", dev->name); 1061 pr_warning("%s: no carrier detected.\n", dev->name);
1059 } else if (status & TCMD_LOSTCTS) { 1062 } else if (status & TCMD_LOSTCTS) {
1060 printk(KERN_WARNING "%s: loss of CTS detected.\n", dev->name); 1063 pr_warning("%s: loss of CTS detected.\n", dev->name);
1061 } else if (status & TCMD_UNDERRUN) { 1064 } else if (status & TCMD_UNDERRUN) {
1062 dev->stats.tx_fifo_errors++; 1065 dev->stats.tx_fifo_errors++;
1063 printk(KERN_WARNING "%s: DMA underrun detected.\n", dev->name); 1066 pr_warning("%s: DMA underrun detected.\n", dev->name);
1064 } else if (status & TCMD_MAXCOLL) { 1067 } else if (status & TCMD_MAXCOLL) {
1065 printk(KERN_WARNING "%s: Max. collisions exceeded.\n", dev->name); 1068 pr_warning("%s: Max. collisions exceeded.\n", dev->name);
1066 dev->stats.collisions += 16; 1069 dev->stats.collisions += 16;
1067 } 1070 }
1068 } 1071 }
@@ -1099,10 +1102,11 @@ static void elmc_timeout(struct net_device *dev)
1099 struct priv *p = netdev_priv(dev); 1102 struct priv *p = netdev_priv(dev);
1100 /* COMMAND-UNIT active? */ 1103 /* COMMAND-UNIT active? */
1101 if (p->scb->status & CU_ACTIVE) { 1104 if (p->scb->status & CU_ACTIVE) {
1102#ifdef DEBUG 1105 pr_debug("%s: strange ... timeout with CU active?!?\n", dev->name);
1103 printk("%s: strange ... timeout with CU active?!?\n", dev->name); 1106 pr_debug("%s: X0: %04x N0: %04x N1: %04x %d\n", dev->name,
1104 printk("%s: X0: %04x N0: %04x N1: %04x %d\n", dev->name, (int) p->xmit_cmds[0]->cmd_status, (int) p->nop_cmds[0]->cmd_status, (int) p->nop_cmds[1]->cmd_status, (int) p->nop_point); 1107 (int)p->xmit_cmds[0]->cmd_status,
1105#endif 1108 (int)p->nop_cmds[0]->cmd_status,
1109 (int)p->nop_cmds[1]->cmd_status, (int)p->nop_point);
1106 p->scb->cmd = CUC_ABORT; 1110 p->scb->cmd = CUC_ABORT;
1107 elmc_attn586(); 1111 elmc_attn586();
1108 WAIT_4_SCB_CMD(); 1112 WAIT_4_SCB_CMD();
@@ -1112,10 +1116,10 @@ static void elmc_timeout(struct net_device *dev)
1112 WAIT_4_SCB_CMD(); 1116 WAIT_4_SCB_CMD();
1113 netif_wake_queue(dev); 1117 netif_wake_queue(dev);
1114 } else { 1118 } else {
1115#ifdef DEBUG 1119 pr_debug("%s: xmitter timed out, try to restart! stat: %04x\n",
1116 printk("%s: xmitter timed out, try to restart! stat: %04x\n", dev->name, p->scb->status); 1120 dev->name, p->scb->status);
1117 printk("%s: command-stats: %04x %04x\n", dev->name, p->xmit_cmds[0]->cmd_status, p->xmit_cmds[1]->cmd_status); 1121 pr_debug("%s: command-stats: %04x %04x\n", dev->name,
1118#endif 1122 p->xmit_cmds[0]->cmd_status, p->xmit_cmds[1]->cmd_status);
1119 elmc_close(dev); 1123 elmc_close(dev);
1120 elmc_open(dev); 1124 elmc_open(dev);
1121 } 1125 }
@@ -1162,7 +1166,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
1162 break; 1166 break;
1163 } 1167 }
1164 if (i == 15) { 1168 if (i == 15) {
1165 printk(KERN_WARNING "%s: Can't start transmit-command.\n", dev->name); 1169 pr_warning("%s: Can't start transmit-command.\n", dev->name);
1166 } 1170 }
1167 } 1171 }
1168#else 1172#else
@@ -1287,11 +1291,12 @@ int __init init_module(void)
1287 free_netdev(dev); 1291 free_netdev(dev);
1288 if (io[this_dev]==0) 1292 if (io[this_dev]==0)
1289 break; 1293 break;
1290 printk(KERN_WARNING "3c523.c: No 3c523 card found at io=%#x\n",io[this_dev]); 1294 pr_warning("3c523.c: No 3c523 card found at io=%#x\n",io[this_dev]);
1291 } 1295 }
1292 1296
1293 if(found==0) { 1297 if(found==0) {
1294 if(io[0]==0) printk(KERN_NOTICE "3c523.c: No 3c523 cards found\n"); 1298 if (io[0]==0)
1299 pr_notice("3c523.c: No 3c523 cards found\n");
1295 return -ENXIO; 1300 return -ENXIO;
1296 } else return 0; 1301 } else return 0;
1297} 1302}