diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-05 18:22:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-05 18:22:26 -0500 |
commit | 28b4d5cc17c20786848cdc07b7ea237a309776bb (patch) | |
tree | bae406a4b17229dcce7c11be5073f7a67665e477 /drivers/net/pcmcia/nmclan_cs.c | |
parent | d29cecda036f251aee4947f47eea0fe9ed8cc931 (diff) | |
parent | 96fa2b508d2d3fe040cf4ef2fffb955f0a537ea1 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
drivers/net/pcmcia/fmvj18x_cs.c
drivers/net/pcmcia/nmclan_cs.c
drivers/net/pcmcia/xirc2ps_cs.c
drivers/net/wireless/ray_cs.c
Diffstat (limited to 'drivers/net/pcmcia/nmclan_cs.c')
-rw-r--r-- | drivers/net/pcmcia/nmclan_cs.c | 173 |
1 files changed, 71 insertions, 102 deletions
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c index b12e69592d18..8a5ae3b182ed 100644 --- a/drivers/net/pcmcia/nmclan_cs.c +++ b/drivers/net/pcmcia/nmclan_cs.c | |||
@@ -381,13 +381,6 @@ typedef struct _mace_private { | |||
381 | Private Global Variables | 381 | Private Global Variables |
382 | ---------------------------------------------------------------------------- */ | 382 | ---------------------------------------------------------------------------- */ |
383 | 383 | ||
384 | #ifdef PCMCIA_DEBUG | ||
385 | static char rcsid[] = | ||
386 | "nmclan_cs.c,v 0.16 1995/07/01 06:42:17 rpao Exp rpao"; | ||
387 | static char *version = | ||
388 | DRV_NAME " " DRV_VERSION " (Roger C. Pao)"; | ||
389 | #endif | ||
390 | |||
391 | static const char *if_names[]={ | 384 | static const char *if_names[]={ |
392 | "Auto", "10baseT", "BNC", | 385 | "Auto", "10baseT", "BNC", |
393 | }; | 386 | }; |
@@ -406,12 +399,6 @@ MODULE_LICENSE("GPL"); | |||
406 | /* 0=auto, 1=10baseT, 2 = 10base2, default=auto */ | 399 | /* 0=auto, 1=10baseT, 2 = 10base2, default=auto */ |
407 | INT_MODULE_PARM(if_port, 0); | 400 | INT_MODULE_PARM(if_port, 0); |
408 | 401 | ||
409 | #ifdef PCMCIA_DEBUG | ||
410 | INT_MODULE_PARM(pc_debug, PCMCIA_DEBUG); | ||
411 | #define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) | ||
412 | #else | ||
413 | #define DEBUG(n, args...) | ||
414 | #endif | ||
415 | 402 | ||
416 | /* ---------------------------------------------------------------------------- | 403 | /* ---------------------------------------------------------------------------- |
417 | Function Prototypes | 404 | Function Prototypes |
@@ -462,8 +449,7 @@ static int nmclan_probe(struct pcmcia_device *link) | |||
462 | mace_private *lp; | 449 | mace_private *lp; |
463 | struct net_device *dev; | 450 | struct net_device *dev; |
464 | 451 | ||
465 | DEBUG(0, "nmclan_attach()\n"); | 452 | dev_dbg(&link->dev, "nmclan_attach()\n"); |
466 | DEBUG(1, "%s\n", rcsid); | ||
467 | 453 | ||
468 | /* Create new ethernet device */ | 454 | /* Create new ethernet device */ |
469 | dev = alloc_etherdev(sizeof(mace_private)); | 455 | dev = alloc_etherdev(sizeof(mace_private)); |
@@ -477,10 +463,8 @@ static int nmclan_probe(struct pcmcia_device *link) | |||
477 | link->io.NumPorts1 = 32; | 463 | link->io.NumPorts1 = 32; |
478 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 464 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
479 | link->io.IOAddrLines = 5; | 465 | link->io.IOAddrLines = 5; |
480 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; | 466 | link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; |
481 | link->irq.IRQInfo1 = IRQ_LEVEL_ID; | ||
482 | link->irq.Handler = mace_interrupt; | 467 | link->irq.Handler = mace_interrupt; |
483 | link->irq.Instance = dev; | ||
484 | link->conf.Attributes = CONF_ENABLE_IRQ; | 468 | link->conf.Attributes = CONF_ENABLE_IRQ; |
485 | link->conf.IntType = INT_MEMORY_AND_IO; | 469 | link->conf.IntType = INT_MEMORY_AND_IO; |
486 | link->conf.ConfigIndex = 1; | 470 | link->conf.ConfigIndex = 1; |
@@ -507,7 +491,7 @@ static void nmclan_detach(struct pcmcia_device *link) | |||
507 | { | 491 | { |
508 | struct net_device *dev = link->priv; | 492 | struct net_device *dev = link->priv; |
509 | 493 | ||
510 | DEBUG(0, "nmclan_detach(0x%p)\n", link); | 494 | dev_dbg(&link->dev, "nmclan_detach\n"); |
511 | 495 | ||
512 | if (link->dev_node) | 496 | if (link->dev_node) |
513 | unregister_netdev(dev); | 497 | unregister_netdev(dev); |
@@ -654,37 +638,40 @@ nmclan_config | |||
654 | ethernet device available to the system. | 638 | ethernet device available to the system. |
655 | ---------------------------------------------------------------------------- */ | 639 | ---------------------------------------------------------------------------- */ |
656 | 640 | ||
657 | #define CS_CHECK(fn, ret) \ | ||
658 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | ||
659 | |||
660 | static int nmclan_config(struct pcmcia_device *link) | 641 | static int nmclan_config(struct pcmcia_device *link) |
661 | { | 642 | { |
662 | struct net_device *dev = link->priv; | 643 | struct net_device *dev = link->priv; |
663 | mace_private *lp = netdev_priv(dev); | 644 | mace_private *lp = netdev_priv(dev); |
664 | tuple_t tuple; | 645 | u8 *buf; |
665 | u_char buf[64]; | 646 | size_t len; |
666 | int i, last_ret, last_fn; | 647 | int i, ret; |
667 | unsigned int ioaddr; | 648 | unsigned int ioaddr; |
668 | 649 | ||
669 | DEBUG(0, "nmclan_config(0x%p)\n", link); | 650 | dev_dbg(&link->dev, "nmclan_config\n"); |
651 | |||
652 | ret = pcmcia_request_io(link, &link->io); | ||
653 | if (ret) | ||
654 | goto failed; | ||
655 | ret = pcmcia_request_irq(link, &link->irq); | ||
656 | if (ret) | ||
657 | goto failed; | ||
658 | ret = pcmcia_request_configuration(link, &link->conf); | ||
659 | if (ret) | ||
660 | goto failed; | ||
670 | 661 | ||
671 | CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); | ||
672 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); | ||
673 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); | ||
674 | dev->irq = link->irq.AssignedIRQ; | 662 | dev->irq = link->irq.AssignedIRQ; |
675 | dev->base_addr = link->io.BasePort1; | 663 | dev->base_addr = link->io.BasePort1; |
676 | 664 | ||
677 | ioaddr = dev->base_addr; | 665 | ioaddr = dev->base_addr; |
678 | 666 | ||
679 | /* Read the ethernet address from the CIS. */ | 667 | /* Read the ethernet address from the CIS. */ |
680 | tuple.DesiredTuple = 0x80 /* CISTPL_CFTABLE_ENTRY_MISC */; | 668 | len = pcmcia_get_tuple(link, 0x80, &buf); |
681 | tuple.TupleData = buf; | 669 | if (!buf || len < ETHER_ADDR_LEN) { |
682 | tuple.TupleDataMax = 64; | 670 | kfree(buf); |
683 | tuple.TupleOffset = 0; | 671 | goto failed; |
684 | tuple.Attributes = 0; | 672 | } |
685 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); | 673 | memcpy(dev->dev_addr, buf, ETHER_ADDR_LEN); |
686 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); | 674 | kfree(buf); |
687 | memcpy(dev->dev_addr, tuple.TupleData, ETHER_ADDR_LEN); | ||
688 | 675 | ||
689 | /* Verify configuration by reading the MACE ID. */ | 676 | /* Verify configuration by reading the MACE ID. */ |
690 | { | 677 | { |
@@ -693,7 +680,7 @@ static int nmclan_config(struct pcmcia_device *link) | |||
693 | sig[0] = mace_read(lp, ioaddr, MACE_CHIPIDL); | 680 | sig[0] = mace_read(lp, ioaddr, MACE_CHIPIDL); |
694 | sig[1] = mace_read(lp, ioaddr, MACE_CHIPIDH); | 681 | sig[1] = mace_read(lp, ioaddr, MACE_CHIPIDH); |
695 | if ((sig[0] == 0x40) && ((sig[1] & 0x0F) == 0x09)) { | 682 | if ((sig[0] == 0x40) && ((sig[1] & 0x0F) == 0x09)) { |
696 | DEBUG(0, "nmclan_cs configured: mace id=%x %x\n", | 683 | dev_dbg(&link->dev, "nmclan_cs configured: mace id=%x %x\n", |
697 | sig[0], sig[1]); | 684 | sig[0], sig[1]); |
698 | } else { | 685 | } else { |
699 | printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" | 686 | printk(KERN_NOTICE "nmclan_cs: mace id not found: %x %x should" |
@@ -712,7 +699,7 @@ static int nmclan_config(struct pcmcia_device *link) | |||
712 | printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); | 699 | printk(KERN_NOTICE "nmclan_cs: invalid if_port requested\n"); |
713 | 700 | ||
714 | link->dev_node = &lp->node; | 701 | link->dev_node = &lp->node; |
715 | SET_NETDEV_DEV(dev, &handle_to_dev(link)); | 702 | SET_NETDEV_DEV(dev, &link->dev); |
716 | 703 | ||
717 | i = register_netdev(dev); | 704 | i = register_netdev(dev); |
718 | if (i != 0) { | 705 | if (i != 0) { |
@@ -729,8 +716,6 @@ static int nmclan_config(struct pcmcia_device *link) | |||
729 | dev->dev_addr); | 716 | dev->dev_addr); |
730 | return 0; | 717 | return 0; |
731 | 718 | ||
732 | cs_failed: | ||
733 | cs_error(link, last_fn, last_ret); | ||
734 | failed: | 719 | failed: |
735 | nmclan_release(link); | 720 | nmclan_release(link); |
736 | return -ENODEV; | 721 | return -ENODEV; |
@@ -744,7 +729,7 @@ nmclan_release | |||
744 | ---------------------------------------------------------------------------- */ | 729 | ---------------------------------------------------------------------------- */ |
745 | static void nmclan_release(struct pcmcia_device *link) | 730 | static void nmclan_release(struct pcmcia_device *link) |
746 | { | 731 | { |
747 | DEBUG(0, "nmclan_release(0x%p)\n", link); | 732 | dev_dbg(&link->dev, "nmclan_release\n"); |
748 | pcmcia_disable_device(link); | 733 | pcmcia_disable_device(link); |
749 | } | 734 | } |
750 | 735 | ||
@@ -795,7 +780,7 @@ static void nmclan_reset(struct net_device *dev) | |||
795 | /* Reset Xilinx */ | 780 | /* Reset Xilinx */ |
796 | reg.Action = CS_WRITE; | 781 | reg.Action = CS_WRITE; |
797 | reg.Offset = CISREG_COR; | 782 | reg.Offset = CISREG_COR; |
798 | DEBUG(1, "nmclan_reset: OrigCorValue=0x%lX, resetting...\n", | 783 | dev_dbg(&link->dev, "nmclan_reset: OrigCorValue=0x%lX, resetting...\n", |
799 | OrigCorValue); | 784 | OrigCorValue); |
800 | reg.Value = COR_SOFT_RESET; | 785 | reg.Value = COR_SOFT_RESET; |
801 | pcmcia_access_configuration_register(link, ®); | 786 | pcmcia_access_configuration_register(link, ®); |
@@ -872,7 +857,7 @@ static int mace_close(struct net_device *dev) | |||
872 | mace_private *lp = netdev_priv(dev); | 857 | mace_private *lp = netdev_priv(dev); |
873 | struct pcmcia_device *link = lp->p_dev; | 858 | struct pcmcia_device *link = lp->p_dev; |
874 | 859 | ||
875 | DEBUG(2, "%s: shutting down ethercard.\n", dev->name); | 860 | dev_dbg(&link->dev, "%s: shutting down ethercard.\n", dev->name); |
876 | 861 | ||
877 | /* Mask off all interrupts from the MACE chip. */ | 862 | /* Mask off all interrupts from the MACE chip. */ |
878 | outb(0xFF, ioaddr + AM2150_MACE_BASE + MACE_IMR); | 863 | outb(0xFF, ioaddr + AM2150_MACE_BASE + MACE_IMR); |
@@ -891,24 +876,8 @@ static void netdev_get_drvinfo(struct net_device *dev, | |||
891 | sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr); | 876 | sprintf(info->bus_info, "PCMCIA 0x%lx", dev->base_addr); |
892 | } | 877 | } |
893 | 878 | ||
894 | #ifdef PCMCIA_DEBUG | ||
895 | static u32 netdev_get_msglevel(struct net_device *dev) | ||
896 | { | ||
897 | return pc_debug; | ||
898 | } | ||
899 | |||
900 | static void netdev_set_msglevel(struct net_device *dev, u32 level) | ||
901 | { | ||
902 | pc_debug = level; | ||
903 | } | ||
904 | #endif /* PCMCIA_DEBUG */ | ||
905 | |||
906 | static const struct ethtool_ops netdev_ethtool_ops = { | 879 | static const struct ethtool_ops netdev_ethtool_ops = { |
907 | .get_drvinfo = netdev_get_drvinfo, | 880 | .get_drvinfo = netdev_get_drvinfo, |
908 | #ifdef PCMCIA_DEBUG | ||
909 | .get_msglevel = netdev_get_msglevel, | ||
910 | .set_msglevel = netdev_set_msglevel, | ||
911 | #endif /* PCMCIA_DEBUG */ | ||
912 | }; | 881 | }; |
913 | 882 | ||
914 | /* ---------------------------------------------------------------------------- | 883 | /* ---------------------------------------------------------------------------- |
@@ -946,7 +915,7 @@ static netdev_tx_t mace_start_xmit(struct sk_buff *skb, | |||
946 | 915 | ||
947 | netif_stop_queue(dev); | 916 | netif_stop_queue(dev); |
948 | 917 | ||
949 | DEBUG(3, "%s: mace_start_xmit(length = %ld) called.\n", | 918 | pr_debug("%s: mace_start_xmit(length = %ld) called.\n", |
950 | dev->name, (long)skb->len); | 919 | dev->name, (long)skb->len); |
951 | 920 | ||
952 | #if (!TX_INTERRUPTABLE) | 921 | #if (!TX_INTERRUPTABLE) |
@@ -1008,7 +977,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id) | |||
1008 | int IntrCnt = MACE_MAX_IR_ITERATIONS; | 977 | int IntrCnt = MACE_MAX_IR_ITERATIONS; |
1009 | 978 | ||
1010 | if (dev == NULL) { | 979 | if (dev == NULL) { |
1011 | DEBUG(2, "mace_interrupt(): irq 0x%X for unknown device.\n", | 980 | pr_debug("mace_interrupt(): irq 0x%X for unknown device.\n", |
1012 | irq); | 981 | irq); |
1013 | return IRQ_NONE; | 982 | return IRQ_NONE; |
1014 | } | 983 | } |
@@ -1031,7 +1000,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id) | |||
1031 | } | 1000 | } |
1032 | 1001 | ||
1033 | if (!netif_device_present(dev)) { | 1002 | if (!netif_device_present(dev)) { |
1034 | DEBUG(2, "%s: interrupt from dead card\n", dev->name); | 1003 | pr_debug("%s: interrupt from dead card\n", dev->name); |
1035 | return IRQ_NONE; | 1004 | return IRQ_NONE; |
1036 | } | 1005 | } |
1037 | 1006 | ||
@@ -1039,7 +1008,7 @@ static irqreturn_t mace_interrupt(int irq, void *dev_id) | |||
1039 | /* WARNING: MACE_IR is a READ/CLEAR port! */ | 1008 | /* WARNING: MACE_IR is a READ/CLEAR port! */ |
1040 | status = inb(ioaddr + AM2150_MACE_BASE + MACE_IR); | 1009 | status = inb(ioaddr + AM2150_MACE_BASE + MACE_IR); |
1041 | 1010 | ||
1042 | DEBUG(3, "mace_interrupt: irq 0x%X status 0x%X.\n", irq, status); | 1011 | pr_debug("mace_interrupt: irq 0x%X status 0x%X.\n", irq, status); |
1043 | 1012 | ||
1044 | if (status & MACE_IR_RCVINT) { | 1013 | if (status & MACE_IR_RCVINT) { |
1045 | mace_rx(dev, MACE_MAX_RX_ITERATIONS); | 1014 | mace_rx(dev, MACE_MAX_RX_ITERATIONS); |
@@ -1158,7 +1127,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt) | |||
1158 | ) { | 1127 | ) { |
1159 | rx_status = inw(ioaddr + AM2150_RCV); | 1128 | rx_status = inw(ioaddr + AM2150_RCV); |
1160 | 1129 | ||
1161 | DEBUG(3, "%s: in mace_rx(), framecnt 0x%X, rx_status" | 1130 | pr_debug("%s: in mace_rx(), framecnt 0x%X, rx_status" |
1162 | " 0x%X.\n", dev->name, rx_framecnt, rx_status); | 1131 | " 0x%X.\n", dev->name, rx_framecnt, rx_status); |
1163 | 1132 | ||
1164 | if (rx_status & MACE_RCVFS_RCVSTS) { /* Error, update stats. */ | 1133 | if (rx_status & MACE_RCVFS_RCVSTS) { /* Error, update stats. */ |
@@ -1185,7 +1154,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt) | |||
1185 | lp->mace_stats.rfs_rcvcc += inb(ioaddr + AM2150_RCV); | 1154 | lp->mace_stats.rfs_rcvcc += inb(ioaddr + AM2150_RCV); |
1186 | /* rcv collision count */ | 1155 | /* rcv collision count */ |
1187 | 1156 | ||
1188 | DEBUG(3, " receiving packet size 0x%X rx_status" | 1157 | pr_debug(" receiving packet size 0x%X rx_status" |
1189 | " 0x%X.\n", pkt_len, rx_status); | 1158 | " 0x%X.\n", pkt_len, rx_status); |
1190 | 1159 | ||
1191 | skb = dev_alloc_skb(pkt_len+2); | 1160 | skb = dev_alloc_skb(pkt_len+2); |
@@ -1204,7 +1173,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt) | |||
1204 | outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */ | 1173 | outb(0xFF, ioaddr + AM2150_RCV_NEXT); /* skip to next frame */ |
1205 | continue; | 1174 | continue; |
1206 | } else { | 1175 | } else { |
1207 | DEBUG(1, "%s: couldn't allocate a sk_buff of size" | 1176 | pr_debug("%s: couldn't allocate a sk_buff of size" |
1208 | " %d.\n", dev->name, pkt_len); | 1177 | " %d.\n", dev->name, pkt_len); |
1209 | lp->linux_stats.rx_dropped++; | 1178 | lp->linux_stats.rx_dropped++; |
1210 | } | 1179 | } |
@@ -1220,28 +1189,28 @@ pr_linux_stats | |||
1220 | ---------------------------------------------------------------------------- */ | 1189 | ---------------------------------------------------------------------------- */ |
1221 | static void pr_linux_stats(struct net_device_stats *pstats) | 1190 | static void pr_linux_stats(struct net_device_stats *pstats) |
1222 | { | 1191 | { |
1223 | DEBUG(2, "pr_linux_stats\n"); | 1192 | pr_debug("pr_linux_stats\n"); |
1224 | DEBUG(2, " rx_packets=%-7ld tx_packets=%ld\n", | 1193 | pr_debug(" rx_packets=%-7ld tx_packets=%ld\n", |
1225 | (long)pstats->rx_packets, (long)pstats->tx_packets); | 1194 | (long)pstats->rx_packets, (long)pstats->tx_packets); |
1226 | DEBUG(2, " rx_errors=%-7ld tx_errors=%ld\n", | 1195 | pr_debug(" rx_errors=%-7ld tx_errors=%ld\n", |
1227 | (long)pstats->rx_errors, (long)pstats->tx_errors); | 1196 | (long)pstats->rx_errors, (long)pstats->tx_errors); |
1228 | DEBUG(2, " rx_dropped=%-7ld tx_dropped=%ld\n", | 1197 | pr_debug(" rx_dropped=%-7ld tx_dropped=%ld\n", |
1229 | (long)pstats->rx_dropped, (long)pstats->tx_dropped); | 1198 | (long)pstats->rx_dropped, (long)pstats->tx_dropped); |
1230 | DEBUG(2, " multicast=%-7ld collisions=%ld\n", | 1199 | pr_debug(" multicast=%-7ld collisions=%ld\n", |
1231 | (long)pstats->multicast, (long)pstats->collisions); | 1200 | (long)pstats->multicast, (long)pstats->collisions); |
1232 | 1201 | ||
1233 | DEBUG(2, " rx_length_errors=%-7ld rx_over_errors=%ld\n", | 1202 | pr_debug(" rx_length_errors=%-7ld rx_over_errors=%ld\n", |
1234 | (long)pstats->rx_length_errors, (long)pstats->rx_over_errors); | 1203 | (long)pstats->rx_length_errors, (long)pstats->rx_over_errors); |
1235 | DEBUG(2, " rx_crc_errors=%-7ld rx_frame_errors=%ld\n", | 1204 | pr_debug(" rx_crc_errors=%-7ld rx_frame_errors=%ld\n", |
1236 | (long)pstats->rx_crc_errors, (long)pstats->rx_frame_errors); | 1205 | (long)pstats->rx_crc_errors, (long)pstats->rx_frame_errors); |
1237 | DEBUG(2, " rx_fifo_errors=%-7ld rx_missed_errors=%ld\n", | 1206 | pr_debug(" rx_fifo_errors=%-7ld rx_missed_errors=%ld\n", |
1238 | (long)pstats->rx_fifo_errors, (long)pstats->rx_missed_errors); | 1207 | (long)pstats->rx_fifo_errors, (long)pstats->rx_missed_errors); |
1239 | 1208 | ||
1240 | DEBUG(2, " tx_aborted_errors=%-7ld tx_carrier_errors=%ld\n", | 1209 | pr_debug(" tx_aborted_errors=%-7ld tx_carrier_errors=%ld\n", |
1241 | (long)pstats->tx_aborted_errors, (long)pstats->tx_carrier_errors); | 1210 | (long)pstats->tx_aborted_errors, (long)pstats->tx_carrier_errors); |
1242 | DEBUG(2, " tx_fifo_errors=%-7ld tx_heartbeat_errors=%ld\n", | 1211 | pr_debug(" tx_fifo_errors=%-7ld tx_heartbeat_errors=%ld\n", |
1243 | (long)pstats->tx_fifo_errors, (long)pstats->tx_heartbeat_errors); | 1212 | (long)pstats->tx_fifo_errors, (long)pstats->tx_heartbeat_errors); |
1244 | DEBUG(2, " tx_window_errors=%ld\n", | 1213 | pr_debug(" tx_window_errors=%ld\n", |
1245 | (long)pstats->tx_window_errors); | 1214 | (long)pstats->tx_window_errors); |
1246 | } /* pr_linux_stats */ | 1215 | } /* pr_linux_stats */ |
1247 | 1216 | ||
@@ -1250,48 +1219,48 @@ pr_mace_stats | |||
1250 | ---------------------------------------------------------------------------- */ | 1219 | ---------------------------------------------------------------------------- */ |
1251 | static void pr_mace_stats(mace_statistics *pstats) | 1220 | static void pr_mace_stats(mace_statistics *pstats) |
1252 | { | 1221 | { |
1253 | DEBUG(2, "pr_mace_stats\n"); | 1222 | pr_debug("pr_mace_stats\n"); |
1254 | 1223 | ||
1255 | DEBUG(2, " xmtsv=%-7d uflo=%d\n", | 1224 | pr_debug(" xmtsv=%-7d uflo=%d\n", |
1256 | pstats->xmtsv, pstats->uflo); | 1225 | pstats->xmtsv, pstats->uflo); |
1257 | DEBUG(2, " lcol=%-7d more=%d\n", | 1226 | pr_debug(" lcol=%-7d more=%d\n", |
1258 | pstats->lcol, pstats->more); | 1227 | pstats->lcol, pstats->more); |
1259 | DEBUG(2, " one=%-7d defer=%d\n", | 1228 | pr_debug(" one=%-7d defer=%d\n", |
1260 | pstats->one, pstats->defer); | 1229 | pstats->one, pstats->defer); |
1261 | DEBUG(2, " lcar=%-7d rtry=%d\n", | 1230 | pr_debug(" lcar=%-7d rtry=%d\n", |
1262 | pstats->lcar, pstats->rtry); | 1231 | pstats->lcar, pstats->rtry); |
1263 | 1232 | ||
1264 | /* MACE_XMTRC */ | 1233 | /* MACE_XMTRC */ |
1265 | DEBUG(2, " exdef=%-7d xmtrc=%d\n", | 1234 | pr_debug(" exdef=%-7d xmtrc=%d\n", |
1266 | pstats->exdef, pstats->xmtrc); | 1235 | pstats->exdef, pstats->xmtrc); |
1267 | 1236 | ||
1268 | /* RFS1--Receive Status (RCVSTS) */ | 1237 | /* RFS1--Receive Status (RCVSTS) */ |
1269 | DEBUG(2, " oflo=%-7d clsn=%d\n", | 1238 | pr_debug(" oflo=%-7d clsn=%d\n", |
1270 | pstats->oflo, pstats->clsn); | 1239 | pstats->oflo, pstats->clsn); |
1271 | DEBUG(2, " fram=%-7d fcs=%d\n", | 1240 | pr_debug(" fram=%-7d fcs=%d\n", |
1272 | pstats->fram, pstats->fcs); | 1241 | pstats->fram, pstats->fcs); |
1273 | 1242 | ||
1274 | /* RFS2--Runt Packet Count (RNTPC) */ | 1243 | /* RFS2--Runt Packet Count (RNTPC) */ |
1275 | /* RFS3--Receive Collision Count (RCVCC) */ | 1244 | /* RFS3--Receive Collision Count (RCVCC) */ |
1276 | DEBUG(2, " rfs_rntpc=%-7d rfs_rcvcc=%d\n", | 1245 | pr_debug(" rfs_rntpc=%-7d rfs_rcvcc=%d\n", |
1277 | pstats->rfs_rntpc, pstats->rfs_rcvcc); | 1246 | pstats->rfs_rntpc, pstats->rfs_rcvcc); |
1278 | 1247 | ||
1279 | /* MACE_IR */ | 1248 | /* MACE_IR */ |
1280 | DEBUG(2, " jab=%-7d babl=%d\n", | 1249 | pr_debug(" jab=%-7d babl=%d\n", |
1281 | pstats->jab, pstats->babl); | 1250 | pstats->jab, pstats->babl); |
1282 | DEBUG(2, " cerr=%-7d rcvcco=%d\n", | 1251 | pr_debug(" cerr=%-7d rcvcco=%d\n", |
1283 | pstats->cerr, pstats->rcvcco); | 1252 | pstats->cerr, pstats->rcvcco); |
1284 | DEBUG(2, " rntpco=%-7d mpco=%d\n", | 1253 | pr_debug(" rntpco=%-7d mpco=%d\n", |
1285 | pstats->rntpco, pstats->mpco); | 1254 | pstats->rntpco, pstats->mpco); |
1286 | 1255 | ||
1287 | /* MACE_MPC */ | 1256 | /* MACE_MPC */ |
1288 | DEBUG(2, " mpc=%d\n", pstats->mpc); | 1257 | pr_debug(" mpc=%d\n", pstats->mpc); |
1289 | 1258 | ||
1290 | /* MACE_RNTPC */ | 1259 | /* MACE_RNTPC */ |
1291 | DEBUG(2, " rntpc=%d\n", pstats->rntpc); | 1260 | pr_debug(" rntpc=%d\n", pstats->rntpc); |
1292 | 1261 | ||
1293 | /* MACE_RCVCC */ | 1262 | /* MACE_RCVCC */ |
1294 | DEBUG(2, " rcvcc=%d\n", pstats->rcvcc); | 1263 | pr_debug(" rcvcc=%d\n", pstats->rcvcc); |
1295 | 1264 | ||
1296 | } /* pr_mace_stats */ | 1265 | } /* pr_mace_stats */ |
1297 | 1266 | ||
@@ -1360,7 +1329,7 @@ static struct net_device_stats *mace_get_stats(struct net_device *dev) | |||
1360 | 1329 | ||
1361 | update_stats(dev->base_addr, dev); | 1330 | update_stats(dev->base_addr, dev); |
1362 | 1331 | ||
1363 | DEBUG(1, "%s: updating the statistics.\n", dev->name); | 1332 | pr_debug("%s: updating the statistics.\n", dev->name); |
1364 | pr_linux_stats(&lp->linux_stats); | 1333 | pr_linux_stats(&lp->linux_stats); |
1365 | pr_mace_stats(&lp->mace_stats); | 1334 | pr_mace_stats(&lp->mace_stats); |
1366 | 1335 | ||
@@ -1427,7 +1396,7 @@ static void BuildLAF(int *ladrf, int *adr) | |||
1427 | ladrf[byte] |= (1 << (hashcode & 7)); | 1396 | ladrf[byte] |= (1 << (hashcode & 7)); |
1428 | 1397 | ||
1429 | #ifdef PCMCIA_DEBUG | 1398 | #ifdef PCMCIA_DEBUG |
1430 | if (pc_debug > 2) | 1399 | if (0) |
1431 | printk(KERN_DEBUG " adr =%pM\n", adr); | 1400 | printk(KERN_DEBUG " adr =%pM\n", adr); |
1432 | printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); | 1401 | printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode); |
1433 | for (i = 0; i < 8; i++) | 1402 | for (i = 0; i < 8; i++) |
@@ -1454,12 +1423,12 @@ static void restore_multicast_list(struct net_device *dev) | |||
1454 | unsigned int ioaddr = dev->base_addr; | 1423 | unsigned int ioaddr = dev->base_addr; |
1455 | int i; | 1424 | int i; |
1456 | 1425 | ||
1457 | DEBUG(2, "%s: restoring Rx mode to %d addresses.\n", | 1426 | pr_debug("%s: restoring Rx mode to %d addresses.\n", |
1458 | dev->name, num_addrs); | 1427 | dev->name, num_addrs); |
1459 | 1428 | ||
1460 | if (num_addrs > 0) { | 1429 | if (num_addrs > 0) { |
1461 | 1430 | ||
1462 | DEBUG(1, "Attempt to restore multicast list detected.\n"); | 1431 | pr_debug("Attempt to restore multicast list detected.\n"); |
1463 | 1432 | ||
1464 | mace_write(lp, ioaddr, MACE_IAC, MACE_IAC_ADDRCHG | MACE_IAC_LOGADDR); | 1433 | mace_write(lp, ioaddr, MACE_IAC, MACE_IAC_ADDRCHG | MACE_IAC_LOGADDR); |
1465 | /* Poll ADDRCHG bit */ | 1434 | /* Poll ADDRCHG bit */ |
@@ -1511,11 +1480,11 @@ static void set_multicast_list(struct net_device *dev) | |||
1511 | struct dev_mc_list *dmi = dev->mc_list; | 1480 | struct dev_mc_list *dmi = dev->mc_list; |
1512 | 1481 | ||
1513 | #ifdef PCMCIA_DEBUG | 1482 | #ifdef PCMCIA_DEBUG |
1514 | if (pc_debug > 1) { | 1483 | { |
1515 | static int old; | 1484 | static int old; |
1516 | if (dev->mc_count != old) { | 1485 | if (dev->mc_count != old) { |
1517 | old = dev->mc_count; | 1486 | old = dev->mc_count; |
1518 | DEBUG(0, "%s: setting Rx mode to %d addresses.\n", | 1487 | pr_debug("%s: setting Rx mode to %d addresses.\n", |
1519 | dev->name, old); | 1488 | dev->name, old); |
1520 | } | 1489 | } |
1521 | } | 1490 | } |
@@ -1546,7 +1515,7 @@ static void restore_multicast_list(struct net_device *dev) | |||
1546 | unsigned int ioaddr = dev->base_addr; | 1515 | unsigned int ioaddr = dev->base_addr; |
1547 | mace_private *lp = netdev_priv(dev); | 1516 | mace_private *lp = netdev_priv(dev); |
1548 | 1517 | ||
1549 | DEBUG(2, "%s: restoring Rx mode to %d addresses.\n", dev->name, | 1518 | pr_debug("%s: restoring Rx mode to %d addresses.\n", dev->name, |
1550 | lp->multicast_num_addrs); | 1519 | lp->multicast_num_addrs); |
1551 | 1520 | ||
1552 | if (dev->flags & IFF_PROMISC) { | 1521 | if (dev->flags & IFF_PROMISC) { |
@@ -1567,11 +1536,11 @@ static void set_multicast_list(struct net_device *dev) | |||
1567 | mace_private *lp = netdev_priv(dev); | 1536 | mace_private *lp = netdev_priv(dev); |
1568 | 1537 | ||
1569 | #ifdef PCMCIA_DEBUG | 1538 | #ifdef PCMCIA_DEBUG |
1570 | if (pc_debug > 1) { | 1539 | { |
1571 | static int old; | 1540 | static int old; |
1572 | if (dev->mc_count != old) { | 1541 | if (dev->mc_count != old) { |
1573 | old = dev->mc_count; | 1542 | old = dev->mc_count; |
1574 | DEBUG(0, "%s: setting Rx mode to %d addresses.\n", | 1543 | pr_debug("%s: setting Rx mode to %d addresses.\n", |
1575 | dev->name, old); | 1544 | dev->name, old); |
1576 | } | 1545 | } |
1577 | } | 1546 | } |