diff options
author | Alexander Beregalov <a.beregalov@gmail.com> | 2009-05-26 08:35:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-26 23:35:02 -0400 |
commit | 646cdb32831eebe8c2f742c293d0d266326854d9 (patch) | |
tree | 43b2460ea3704f2b6e1ff0c53cc592ecaa4d3747 /drivers/net/3c509.c | |
parent | d3f65f7c3cf11b036bbc01f22ac5c958570e724c (diff) |
3c50x: 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/3c509.c')
-rw-r--r-- | drivers/net/3c509.c | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 393e4e711965..8d9aa49de145 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -257,7 +257,7 @@ static int el3_isa_id_sequence(__be16 *phys_addr) | |||
257 | && !memcmp(phys_addr, el3_devs[i]->dev_addr, | 257 | && !memcmp(phys_addr, el3_devs[i]->dev_addr, |
258 | ETH_ALEN)) { | 258 | ETH_ALEN)) { |
259 | if (el3_debug > 3) | 259 | if (el3_debug > 3) |
260 | printk(KERN_DEBUG "3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n", | 260 | pr_debug("3c509 with address %02x %02x %02x %02x %02x %02x was found by ISAPnP\n", |
261 | phys_addr[0] & 0xff, phys_addr[0] >> 8, | 261 | phys_addr[0] & 0xff, phys_addr[0] >> 8, |
262 | phys_addr[1] & 0xff, phys_addr[1] >> 8, | 262 | phys_addr[1] & 0xff, phys_addr[1] >> 8, |
263 | phys_addr[2] & 0xff, phys_addr[2] >> 8); | 263 | phys_addr[2] & 0xff, phys_addr[2] >> 8); |
@@ -574,19 +574,18 @@ static int __devinit el3_common_init(struct net_device *dev) | |||
574 | 574 | ||
575 | err = register_netdev(dev); | 575 | err = register_netdev(dev); |
576 | if (err) { | 576 | if (err) { |
577 | printk(KERN_ERR "Failed to register 3c5x9 at %#3.3lx, IRQ %d.\n", | 577 | pr_err("Failed to register 3c5x9 at %#3.3lx, IRQ %d.\n", |
578 | dev->base_addr, dev->irq); | 578 | dev->base_addr, dev->irq); |
579 | release_region(dev->base_addr, EL3_IO_EXTENT); | 579 | release_region(dev->base_addr, EL3_IO_EXTENT); |
580 | return err; | 580 | return err; |
581 | } | 581 | } |
582 | 582 | ||
583 | printk(KERN_INFO "%s: 3c5x9 found at %#3.3lx, %s port, " | 583 | pr_info("%s: 3c5x9 found at %#3.3lx, %s port, address %pM, IRQ %d.\n", |
584 | "address %pM, IRQ %d.\n", | ||
585 | dev->name, dev->base_addr, if_names[(dev->if_port & 0x03)], | 584 | dev->name, dev->base_addr, if_names[(dev->if_port & 0x03)], |
586 | dev->dev_addr, dev->irq); | 585 | dev->dev_addr, dev->irq); |
587 | 586 | ||
588 | if (el3_debug > 0) | 587 | if (el3_debug > 0) |
589 | printk(KERN_INFO "%s", version); | 588 | pr_info("%s", version); |
590 | return 0; | 589 | return 0; |
591 | 590 | ||
592 | } | 591 | } |
@@ -625,8 +624,8 @@ static int __init el3_mca_probe(struct device *device) | |||
625 | irq = pos5 & 0x0f; | 624 | irq = pos5 & 0x0f; |
626 | 625 | ||
627 | 626 | ||
628 | printk(KERN_INFO "3c529: found %s at slot %d\n", | 627 | pr_info("3c529: found %s at slot %d\n", |
629 | el3_mca_adapter_names[mdev->index], slot + 1); | 628 | el3_mca_adapter_names[mdev->index], slot + 1); |
630 | 629 | ||
631 | /* claim the slot */ | 630 | /* claim the slot */ |
632 | strncpy(mdev->name, el3_mca_adapter_names[mdev->index], | 631 | strncpy(mdev->name, el3_mca_adapter_names[mdev->index], |
@@ -638,7 +637,7 @@ static int __init el3_mca_probe(struct device *device) | |||
638 | irq = mca_device_transform_irq(mdev, irq); | 637 | irq = mca_device_transform_irq(mdev, irq); |
639 | ioaddr = mca_device_transform_ioport(mdev, ioaddr); | 638 | ioaddr = mca_device_transform_ioport(mdev, ioaddr); |
640 | if (el3_debug > 2) { | 639 | if (el3_debug > 2) { |
641 | printk(KERN_DEBUG "3c529: irq %d ioaddr 0x%x ifport %d\n", irq, ioaddr, if_port); | 640 | pr_debug("3c529: irq %d ioaddr 0x%x ifport %d\n", irq, ioaddr, if_port); |
642 | } | 641 | } |
643 | EL3WINDOW(0); | 642 | EL3WINDOW(0); |
644 | for (i = 0; i < 3; i++) | 643 | for (i = 0; i < 3; i++) |
@@ -761,7 +760,7 @@ static ushort id_read_eeprom(int index) | |||
761 | word = (word << 1) + (inb(id_port) & 0x01); | 760 | word = (word << 1) + (inb(id_port) & 0x01); |
762 | 761 | ||
763 | if (el3_debug > 3) | 762 | if (el3_debug > 3) |
764 | printk(KERN_DEBUG " 3c509 EEPROM word %d %#4.4x.\n", index, word); | 763 | pr_debug(" 3c509 EEPROM word %d %#4.4x.\n", index, word); |
765 | 764 | ||
766 | return word; | 765 | return word; |
767 | } | 766 | } |
@@ -783,13 +782,13 @@ el3_open(struct net_device *dev) | |||
783 | 782 | ||
784 | EL3WINDOW(0); | 783 | EL3WINDOW(0); |
785 | if (el3_debug > 3) | 784 | if (el3_debug > 3) |
786 | printk(KERN_DEBUG "%s: Opening, IRQ %d status@%x %4.4x.\n", dev->name, | 785 | pr_debug("%s: Opening, IRQ %d status@%x %4.4x.\n", dev->name, |
787 | dev->irq, ioaddr + EL3_STATUS, inw(ioaddr + EL3_STATUS)); | 786 | dev->irq, ioaddr + EL3_STATUS, inw(ioaddr + EL3_STATUS)); |
788 | 787 | ||
789 | el3_up(dev); | 788 | el3_up(dev); |
790 | 789 | ||
791 | if (el3_debug > 3) | 790 | if (el3_debug > 3) |
792 | printk(KERN_DEBUG "%s: Opened 3c509 IRQ %d status %4.4x.\n", | 791 | pr_debug("%s: Opened 3c509 IRQ %d status %4.4x.\n", |
793 | dev->name, dev->irq, inw(ioaddr + EL3_STATUS)); | 792 | dev->name, dev->irq, inw(ioaddr + EL3_STATUS)); |
794 | 793 | ||
795 | return 0; | 794 | return 0; |
@@ -801,8 +800,7 @@ el3_tx_timeout (struct net_device *dev) | |||
801 | int ioaddr = dev->base_addr; | 800 | int ioaddr = dev->base_addr; |
802 | 801 | ||
803 | /* Transmitter timeout, serious problems. */ | 802 | /* Transmitter timeout, serious problems. */ |
804 | printk(KERN_WARNING "%s: transmit timed out, Tx_status %2.2x status %4.4x " | 803 | pr_warning("%s: transmit timed out, Tx_status %2.2x status %4.4x Tx FIFO room %d.\n", |
805 | "Tx FIFO room %d.\n", | ||
806 | dev->name, inb(ioaddr + TX_STATUS), inw(ioaddr + EL3_STATUS), | 804 | dev->name, inb(ioaddr + TX_STATUS), inw(ioaddr + EL3_STATUS), |
807 | inw(ioaddr + TX_FREE)); | 805 | inw(ioaddr + TX_FREE)); |
808 | dev->stats.tx_errors++; | 806 | dev->stats.tx_errors++; |
@@ -826,7 +824,7 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
826 | dev->stats.tx_bytes += skb->len; | 824 | dev->stats.tx_bytes += skb->len; |
827 | 825 | ||
828 | if (el3_debug > 4) { | 826 | if (el3_debug > 4) { |
829 | printk(KERN_DEBUG "%s: el3_start_xmit(length = %u) called, status %4.4x.\n", | 827 | pr_debug("%s: el3_start_xmit(length = %u) called, status %4.4x.\n", |
830 | dev->name, skb->len, inw(ioaddr + EL3_STATUS)); | 828 | dev->name, skb->len, inw(ioaddr + EL3_STATUS)); |
831 | } | 829 | } |
832 | #if 0 | 830 | #if 0 |
@@ -835,7 +833,7 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
835 | ushort status = inw(ioaddr + EL3_STATUS); | 833 | ushort status = inw(ioaddr + EL3_STATUS); |
836 | if (status & 0x0001 /* IRQ line active, missed one. */ | 834 | if (status & 0x0001 /* IRQ line active, missed one. */ |
837 | && inw(ioaddr + EL3_STATUS) & 1) { /* Make sure. */ | 835 | && inw(ioaddr + EL3_STATUS) & 1) { /* Make sure. */ |
838 | printk(KERN_DEBUG "%s: Missed interrupt, status then %04x now %04x" | 836 | pr_debug("%s: Missed interrupt, status then %04x now %04x" |
839 | " Tx %2.2x Rx %4.4x.\n", dev->name, status, | 837 | " Tx %2.2x Rx %4.4x.\n", dev->name, status, |
840 | inw(ioaddr + EL3_STATUS), inb(ioaddr + TX_STATUS), | 838 | inw(ioaddr + EL3_STATUS), inb(ioaddr + TX_STATUS), |
841 | inw(ioaddr + RX_STATUS)); | 839 | inw(ioaddr + RX_STATUS)); |
@@ -909,7 +907,7 @@ el3_interrupt(int irq, void *dev_id) | |||
909 | 907 | ||
910 | if (el3_debug > 4) { | 908 | if (el3_debug > 4) { |
911 | status = inw(ioaddr + EL3_STATUS); | 909 | status = inw(ioaddr + EL3_STATUS); |
912 | printk(KERN_DEBUG "%s: interrupt, status %4.4x.\n", dev->name, status); | 910 | pr_debug("%s: interrupt, status %4.4x.\n", dev->name, status); |
913 | } | 911 | } |
914 | 912 | ||
915 | while ((status = inw(ioaddr + EL3_STATUS)) & | 913 | while ((status = inw(ioaddr + EL3_STATUS)) & |
@@ -920,7 +918,7 @@ el3_interrupt(int irq, void *dev_id) | |||
920 | 918 | ||
921 | if (status & TxAvailable) { | 919 | if (status & TxAvailable) { |
922 | if (el3_debug > 5) | 920 | if (el3_debug > 5) |
923 | printk(KERN_DEBUG " TX room bit was handled.\n"); | 921 | pr_debug(" TX room bit was handled.\n"); |
924 | /* There's room in the FIFO for a full-sized packet. */ | 922 | /* There's room in the FIFO for a full-sized packet. */ |
925 | outw(AckIntr | TxAvailable, ioaddr + EL3_CMD); | 923 | outw(AckIntr | TxAvailable, ioaddr + EL3_CMD); |
926 | netif_wake_queue (dev); | 924 | netif_wake_queue (dev); |
@@ -958,7 +956,7 @@ el3_interrupt(int irq, void *dev_id) | |||
958 | } | 956 | } |
959 | 957 | ||
960 | if (--i < 0) { | 958 | if (--i < 0) { |
961 | printk(KERN_ERR "%s: Infinite loop in interrupt, status %4.4x.\n", | 959 | pr_err("%s: Infinite loop in interrupt, status %4.4x.\n", |
962 | dev->name, status); | 960 | dev->name, status); |
963 | /* Clear all interrupts. */ | 961 | /* Clear all interrupts. */ |
964 | outw(AckIntr | 0xFF, ioaddr + EL3_CMD); | 962 | outw(AckIntr | 0xFF, ioaddr + EL3_CMD); |
@@ -969,7 +967,7 @@ el3_interrupt(int irq, void *dev_id) | |||
969 | } | 967 | } |
970 | 968 | ||
971 | if (el3_debug > 4) { | 969 | if (el3_debug > 4) { |
972 | printk(KERN_DEBUG "%s: exiting interrupt, status %4.4x.\n", dev->name, | 970 | pr_debug("%s: exiting interrupt, status %4.4x.\n", dev->name, |
973 | inw(ioaddr + EL3_STATUS)); | 971 | inw(ioaddr + EL3_STATUS)); |
974 | } | 972 | } |
975 | spin_unlock(&lp->lock); | 973 | spin_unlock(&lp->lock); |
@@ -1017,7 +1015,7 @@ static void update_stats(struct net_device *dev) | |||
1017 | int ioaddr = dev->base_addr; | 1015 | int ioaddr = dev->base_addr; |
1018 | 1016 | ||
1019 | if (el3_debug > 5) | 1017 | if (el3_debug > 5) |
1020 | printk(" Updating the statistics.\n"); | 1018 | pr_debug(" Updating the statistics.\n"); |
1021 | /* Turn off statistics updates while reading. */ | 1019 | /* Turn off statistics updates while reading. */ |
1022 | outw(StatsDisable, ioaddr + EL3_CMD); | 1020 | outw(StatsDisable, ioaddr + EL3_CMD); |
1023 | /* Switch to the stats window, and read everything. */ | 1021 | /* Switch to the stats window, and read everything. */ |
@@ -1047,7 +1045,7 @@ el3_rx(struct net_device *dev) | |||
1047 | short rx_status; | 1045 | short rx_status; |
1048 | 1046 | ||
1049 | if (el3_debug > 5) | 1047 | if (el3_debug > 5) |
1050 | printk(" In rx_packet(), status %4.4x, rx_status %4.4x.\n", | 1048 | pr_debug(" In rx_packet(), status %4.4x, rx_status %4.4x.\n", |
1051 | inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS)); | 1049 | inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS)); |
1052 | while ((rx_status = inw(ioaddr + RX_STATUS)) > 0) { | 1050 | while ((rx_status = inw(ioaddr + RX_STATUS)) > 0) { |
1053 | if (rx_status & 0x4000) { /* Error, update stats. */ | 1051 | if (rx_status & 0x4000) { /* Error, update stats. */ |
@@ -1069,7 +1067,7 @@ el3_rx(struct net_device *dev) | |||
1069 | 1067 | ||
1070 | skb = dev_alloc_skb(pkt_len+5); | 1068 | skb = dev_alloc_skb(pkt_len+5); |
1071 | if (el3_debug > 4) | 1069 | if (el3_debug > 4) |
1072 | printk("Receiving packet size %d status %4.4x.\n", | 1070 | pr_debug("Receiving packet size %d status %4.4x.\n", |
1073 | pkt_len, rx_status); | 1071 | pkt_len, rx_status); |
1074 | if (skb != NULL) { | 1072 | if (skb != NULL) { |
1075 | skb_reserve(skb, 2); /* Align IP on 16 byte */ | 1073 | skb_reserve(skb, 2); /* Align IP on 16 byte */ |
@@ -1088,12 +1086,12 @@ el3_rx(struct net_device *dev) | |||
1088 | outw(RxDiscard, ioaddr + EL3_CMD); | 1086 | outw(RxDiscard, ioaddr + EL3_CMD); |
1089 | dev->stats.rx_dropped++; | 1087 | dev->stats.rx_dropped++; |
1090 | if (el3_debug) | 1088 | if (el3_debug) |
1091 | printk("%s: Couldn't allocate a sk_buff of size %d.\n", | 1089 | pr_debug("%s: Couldn't allocate a sk_buff of size %d.\n", |
1092 | dev->name, pkt_len); | 1090 | dev->name, pkt_len); |
1093 | } | 1091 | } |
1094 | inw(ioaddr + EL3_STATUS); /* Delay. */ | 1092 | inw(ioaddr + EL3_STATUS); /* Delay. */ |
1095 | while (inw(ioaddr + EL3_STATUS) & 0x1000) | 1093 | while (inw(ioaddr + EL3_STATUS) & 0x1000) |
1096 | printk(KERN_DEBUG " Waiting for 3c509 to discard packet, status %x.\n", | 1094 | pr_debug(" Waiting for 3c509 to discard packet, status %x.\n", |
1097 | inw(ioaddr + EL3_STATUS) ); | 1095 | inw(ioaddr + EL3_STATUS) ); |
1098 | } | 1096 | } |
1099 | 1097 | ||
@@ -1114,7 +1112,7 @@ set_multicast_list(struct net_device *dev) | |||
1114 | static int old; | 1112 | static int old; |
1115 | if (old != dev->mc_count) { | 1113 | if (old != dev->mc_count) { |
1116 | old = dev->mc_count; | 1114 | old = dev->mc_count; |
1117 | printk("%s: Setting Rx mode to %d addresses.\n", dev->name, dev->mc_count); | 1115 | pr_debug("%s: Setting Rx mode to %d addresses.\n", dev->name, dev->mc_count); |
1118 | } | 1116 | } |
1119 | } | 1117 | } |
1120 | spin_lock_irqsave(&lp->lock, flags); | 1118 | spin_lock_irqsave(&lp->lock, flags); |
@@ -1137,7 +1135,7 @@ el3_close(struct net_device *dev) | |||
1137 | struct el3_private *lp = netdev_priv(dev); | 1135 | struct el3_private *lp = netdev_priv(dev); |
1138 | 1136 | ||
1139 | if (el3_debug > 2) | 1137 | if (el3_debug > 2) |
1140 | printk("%s: Shutting down ethercard.\n", dev->name); | 1138 | pr_debug("%s: Shutting down ethercard.\n", dev->name); |
1141 | 1139 | ||
1142 | el3_down(dev); | 1140 | el3_down(dev); |
1143 | 1141 | ||
@@ -1384,30 +1382,30 @@ el3_up(struct net_device *dev) | |||
1384 | EL3WINDOW(4); | 1382 | EL3WINDOW(4); |
1385 | net_diag = inw(ioaddr + WN4_NETDIAG); | 1383 | net_diag = inw(ioaddr + WN4_NETDIAG); |
1386 | net_diag = (net_diag | FD_ENABLE); /* temporarily assume full-duplex will be set */ | 1384 | net_diag = (net_diag | FD_ENABLE); /* temporarily assume full-duplex will be set */ |
1387 | printk("%s: ", dev->name); | 1385 | pr_info("%s: ", dev->name); |
1388 | switch (dev->if_port & 0x0c) { | 1386 | switch (dev->if_port & 0x0c) { |
1389 | case 12: | 1387 | case 12: |
1390 | /* force full-duplex mode if 3c5x9b */ | 1388 | /* force full-duplex mode if 3c5x9b */ |
1391 | if (sw_info & 0x000f) { | 1389 | if (sw_info & 0x000f) { |
1392 | printk("Forcing 3c5x9b full-duplex mode"); | 1390 | pr_cont("Forcing 3c5x9b full-duplex mode"); |
1393 | break; | 1391 | break; |
1394 | } | 1392 | } |
1395 | case 8: | 1393 | case 8: |
1396 | /* set full-duplex mode based on eeprom config setting */ | 1394 | /* set full-duplex mode based on eeprom config setting */ |
1397 | if ((sw_info & 0x000f) && (sw_info & 0x8000)) { | 1395 | if ((sw_info & 0x000f) && (sw_info & 0x8000)) { |
1398 | printk("Setting 3c5x9b full-duplex mode (from EEPROM configuration bit)"); | 1396 | pr_cont("Setting 3c5x9b full-duplex mode (from EEPROM configuration bit)"); |
1399 | break; | 1397 | break; |
1400 | } | 1398 | } |
1401 | default: | 1399 | default: |
1402 | /* xcvr=(0 || 4) OR user has an old 3c5x9 non "B" model */ | 1400 | /* xcvr=(0 || 4) OR user has an old 3c5x9 non "B" model */ |
1403 | printk("Setting 3c5x9/3c5x9B half-duplex mode"); | 1401 | pr_cont("Setting 3c5x9/3c5x9B half-duplex mode"); |
1404 | net_diag = (net_diag & ~FD_ENABLE); /* disable full duplex */ | 1402 | net_diag = (net_diag & ~FD_ENABLE); /* disable full duplex */ |
1405 | } | 1403 | } |
1406 | 1404 | ||
1407 | outw(net_diag, ioaddr + WN4_NETDIAG); | 1405 | outw(net_diag, ioaddr + WN4_NETDIAG); |
1408 | printk(" if_port: %d, sw_info: %4.4x\n", dev->if_port, sw_info); | 1406 | pr_cont(" if_port: %d, sw_info: %4.4x\n", dev->if_port, sw_info); |
1409 | if (el3_debug > 3) | 1407 | if (el3_debug > 3) |
1410 | printk("%s: 3c5x9 net diag word is now: %4.4x.\n", dev->name, net_diag); | 1408 | pr_debug("%s: 3c5x9 net diag word is now: %4.4x.\n", dev->name, net_diag); |
1411 | /* Enable link beat and jabber check. */ | 1409 | /* Enable link beat and jabber check. */ |
1412 | outw(inw(ioaddr + WN4_MEDIA) | MEDIA_TP, ioaddr + WN4_MEDIA); | 1410 | outw(inw(ioaddr + WN4_MEDIA) | MEDIA_TP, ioaddr + WN4_MEDIA); |
1413 | } | 1411 | } |
@@ -1535,7 +1533,7 @@ static int __init el3_init_module(void) | |||
1535 | } | 1533 | } |
1536 | if (id_port >= 0x200) { | 1534 | if (id_port >= 0x200) { |
1537 | id_port = 0; | 1535 | id_port = 0; |
1538 | printk(KERN_ERR "No I/O port available for 3c509 activation.\n"); | 1536 | pr_err("No I/O port available for 3c509 activation.\n"); |
1539 | } else { | 1537 | } else { |
1540 | ret = isa_register_driver(&el3_isa_driver, EL3_MAX_CARDS); | 1538 | ret = isa_register_driver(&el3_isa_driver, EL3_MAX_CARDS); |
1541 | if (!ret) | 1539 | if (!ret) |