diff options
-rw-r--r-- | drivers/net/8139cp.c | 32 | ||||
-rw-r--r-- | drivers/net/8139too.c | 118 |
2 files changed, 66 insertions, 84 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 02330f3d5a55..c9fc0ff14a4d 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -471,8 +471,7 @@ static void cp_rx_err_acct (struct cp_private *cp, unsigned rx_tail, | |||
471 | u32 status, u32 len) | 471 | u32 status, u32 len) |
472 | { | 472 | { |
473 | if (netif_msg_rx_err (cp)) | 473 | if (netif_msg_rx_err (cp)) |
474 | printk (KERN_DEBUG | 474 | pr_debug("%s: rx err, slot %d status 0x%x len %d\n", |
475 | "%s: rx err, slot %d status 0x%x len %d\n", | ||
476 | cp->dev->name, rx_tail, status, len); | 475 | cp->dev->name, rx_tail, status, len); |
477 | cp->dev->stats.rx_errors++; | 476 | cp->dev->stats.rx_errors++; |
478 | if (status & RxErrFrame) | 477 | if (status & RxErrFrame) |
@@ -547,7 +546,7 @@ rx_status_loop: | |||
547 | } | 546 | } |
548 | 547 | ||
549 | if (netif_msg_rx_status(cp)) | 548 | if (netif_msg_rx_status(cp)) |
550 | printk(KERN_DEBUG "%s: rx slot %d status 0x%x len %d\n", | 549 | pr_debug("%s: rx slot %d status 0x%x len %d\n", |
551 | dev->name, rx_tail, status, len); | 550 | dev->name, rx_tail, status, len); |
552 | 551 | ||
553 | buflen = cp->rx_buf_sz + NET_IP_ALIGN; | 552 | buflen = cp->rx_buf_sz + NET_IP_ALIGN; |
@@ -626,7 +625,7 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance) | |||
626 | return IRQ_NONE; | 625 | return IRQ_NONE; |
627 | 626 | ||
628 | if (netif_msg_intr(cp)) | 627 | if (netif_msg_intr(cp)) |
629 | printk(KERN_DEBUG "%s: intr, status %04x cmd %02x cpcmd %04x\n", | 628 | pr_debug("%s: intr, status %04x cmd %02x cpcmd %04x\n", |
630 | dev->name, status, cpr8(Cmd), cpr16(CpCmd)); | 629 | dev->name, status, cpr8(Cmd), cpr16(CpCmd)); |
631 | 630 | ||
632 | cpw16(IntrStatus, status & ~cp_rx_intr_mask); | 631 | cpw16(IntrStatus, status & ~cp_rx_intr_mask); |
@@ -658,7 +657,7 @@ static irqreturn_t cp_interrupt (int irq, void *dev_instance) | |||
658 | 657 | ||
659 | pci_read_config_word(cp->pdev, PCI_STATUS, &pci_status); | 658 | pci_read_config_word(cp->pdev, PCI_STATUS, &pci_status); |
660 | pci_write_config_word(cp->pdev, PCI_STATUS, pci_status); | 659 | pci_write_config_word(cp->pdev, PCI_STATUS, pci_status); |
661 | printk(KERN_ERR "%s: PCI bus error, status=%04x, PCI status=%04x\n", | 660 | pr_err("%s: PCI bus error, status=%04x, PCI status=%04x\n", |
662 | dev->name, status, pci_status); | 661 | dev->name, status, pci_status); |
663 | 662 | ||
664 | /* TODO: reset hardware */ | 663 | /* TODO: reset hardware */ |
@@ -705,7 +704,7 @@ static void cp_tx (struct cp_private *cp) | |||
705 | if (status & LastFrag) { | 704 | if (status & LastFrag) { |
706 | if (status & (TxError | TxFIFOUnder)) { | 705 | if (status & (TxError | TxFIFOUnder)) { |
707 | if (netif_msg_tx_err(cp)) | 706 | if (netif_msg_tx_err(cp)) |
708 | printk(KERN_DEBUG "%s: tx err, status 0x%x\n", | 707 | pr_debug("%s: tx err, status 0x%x\n", |
709 | cp->dev->name, status); | 708 | cp->dev->name, status); |
710 | cp->dev->stats.tx_errors++; | 709 | cp->dev->stats.tx_errors++; |
711 | if (status & TxOWC) | 710 | if (status & TxOWC) |
@@ -722,7 +721,7 @@ static void cp_tx (struct cp_private *cp) | |||
722 | cp->dev->stats.tx_packets++; | 721 | cp->dev->stats.tx_packets++; |
723 | cp->dev->stats.tx_bytes += skb->len; | 722 | cp->dev->stats.tx_bytes += skb->len; |
724 | if (netif_msg_tx_done(cp)) | 723 | if (netif_msg_tx_done(cp)) |
725 | printk(KERN_DEBUG "%s: tx done, slot %d\n", cp->dev->name, tx_tail); | 724 | pr_debug("%s: tx done, slot %d\n", cp->dev->name, tx_tail); |
726 | } | 725 | } |
727 | dev_kfree_skb_irq(skb); | 726 | dev_kfree_skb_irq(skb); |
728 | } | 727 | } |
@@ -755,7 +754,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
755 | if (TX_BUFFS_AVAIL(cp) <= (skb_shinfo(skb)->nr_frags + 1)) { | 754 | if (TX_BUFFS_AVAIL(cp) <= (skb_shinfo(skb)->nr_frags + 1)) { |
756 | netif_stop_queue(dev); | 755 | netif_stop_queue(dev); |
757 | spin_unlock_irqrestore(&cp->lock, intr_flags); | 756 | spin_unlock_irqrestore(&cp->lock, intr_flags); |
758 | printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", | 757 | pr_err(PFX "%s: BUG! Tx Ring full when queue awake!\n", |
759 | dev->name); | 758 | dev->name); |
760 | return 1; | 759 | return 1; |
761 | } | 760 | } |
@@ -882,7 +881,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
882 | } | 881 | } |
883 | cp->tx_head = entry; | 882 | cp->tx_head = entry; |
884 | if (netif_msg_tx_queued(cp)) | 883 | if (netif_msg_tx_queued(cp)) |
885 | printk(KERN_DEBUG "%s: tx queued, slot %d, skblen %d\n", | 884 | pr_debug("%s: tx queued, slot %d, skblen %d\n", |
886 | dev->name, entry, skb->len); | 885 | dev->name, entry, skb->len); |
887 | if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1)) | 886 | if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1)) |
888 | netif_stop_queue(dev); | 887 | netif_stop_queue(dev); |
@@ -996,7 +995,7 @@ static void cp_reset_hw (struct cp_private *cp) | |||
996 | schedule_timeout_uninterruptible(10); | 995 | schedule_timeout_uninterruptible(10); |
997 | } | 996 | } |
998 | 997 | ||
999 | printk(KERN_ERR "%s: hardware reset timeout\n", cp->dev->name); | 998 | pr_err("%s: hardware reset timeout\n", cp->dev->name); |
1000 | } | 999 | } |
1001 | 1000 | ||
1002 | static inline void cp_start_hw (struct cp_private *cp) | 1001 | static inline void cp_start_hw (struct cp_private *cp) |
@@ -1166,7 +1165,7 @@ static int cp_open (struct net_device *dev) | |||
1166 | int rc; | 1165 | int rc; |
1167 | 1166 | ||
1168 | if (netif_msg_ifup(cp)) | 1167 | if (netif_msg_ifup(cp)) |
1169 | printk(KERN_DEBUG "%s: enabling interface\n", dev->name); | 1168 | pr_debug("%s: enabling interface\n", dev->name); |
1170 | 1169 | ||
1171 | rc = cp_alloc_rings(cp); | 1170 | rc = cp_alloc_rings(cp); |
1172 | if (rc) | 1171 | if (rc) |
@@ -1201,7 +1200,7 @@ static int cp_close (struct net_device *dev) | |||
1201 | napi_disable(&cp->napi); | 1200 | napi_disable(&cp->napi); |
1202 | 1201 | ||
1203 | if (netif_msg_ifdown(cp)) | 1202 | if (netif_msg_ifdown(cp)) |
1204 | printk(KERN_DEBUG "%s: disabling interface\n", dev->name); | 1203 | pr_debug("%s: disabling interface\n", dev->name); |
1205 | 1204 | ||
1206 | spin_lock_irqsave(&cp->lock, flags); | 1205 | spin_lock_irqsave(&cp->lock, flags); |
1207 | 1206 | ||
@@ -1224,7 +1223,7 @@ static void cp_tx_timeout(struct net_device *dev) | |||
1224 | unsigned long flags; | 1223 | unsigned long flags; |
1225 | int rc; | 1224 | int rc; |
1226 | 1225 | ||
1227 | printk(KERN_WARNING "%s: Transmit timeout, status %2x %4x %4x %4x\n", | 1226 | pr_warning("%s: Transmit timeout, status %2x %4x %4x %4x\n", |
1228 | dev->name, cpr8(Cmd), cpr16(CpCmd), | 1227 | dev->name, cpr8(Cmd), cpr16(CpCmd), |
1229 | cpr16(IntrStatus), cpr16(IntrMask)); | 1228 | cpr16(IntrStatus), cpr16(IntrMask)); |
1230 | 1229 | ||
@@ -1873,7 +1872,7 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1873 | #ifndef MODULE | 1872 | #ifndef MODULE |
1874 | static int version_printed; | 1873 | static int version_printed; |
1875 | if (version_printed++ == 0) | 1874 | if (version_printed++ == 0) |
1876 | printk("%s", version); | 1875 | pr_info("%s", version); |
1877 | #endif | 1876 | #endif |
1878 | 1877 | ||
1879 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && | 1878 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && |
@@ -1995,8 +1994,7 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1995 | if (rc) | 1994 | if (rc) |
1996 | goto err_out_iomap; | 1995 | goto err_out_iomap; |
1997 | 1996 | ||
1998 | printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, " | 1997 | pr_info("%s: RTL-8139C+ at 0x%lx, %pM, IRQ %d\n", |
1999 | "%pM, IRQ %d\n", | ||
2000 | dev->name, | 1998 | dev->name, |
2001 | dev->base_addr, | 1999 | dev->base_addr, |
2002 | dev->dev_addr, | 2000 | dev->dev_addr, |
@@ -2113,7 +2111,7 @@ static struct pci_driver cp_driver = { | |||
2113 | static int __init cp_init (void) | 2111 | static int __init cp_init (void) |
2114 | { | 2112 | { |
2115 | #ifdef MODULE | 2113 | #ifdef MODULE |
2116 | printk("%s", version); | 2114 | pr_info("%s", version); |
2117 | #endif | 2115 | #endif |
2118 | return pci_register_driver(&cp_driver); | 2116 | return pci_register_driver(&cp_driver); |
2119 | } | 2117 | } |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index d90177509bf6..8ae72ec14456 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -126,19 +126,12 @@ | |||
126 | #undef RTL8139_NDEBUG | 126 | #undef RTL8139_NDEBUG |
127 | 127 | ||
128 | 128 | ||
129 | #if RTL8139_DEBUG | ||
130 | /* note: prints function name for you */ | ||
131 | # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args) | ||
132 | #else | ||
133 | # define DPRINTK(fmt, args...) | ||
134 | #endif | ||
135 | |||
136 | #ifdef RTL8139_NDEBUG | 129 | #ifdef RTL8139_NDEBUG |
137 | # define assert(expr) do {} while (0) | 130 | # define assert(expr) do {} while (0) |
138 | #else | 131 | #else |
139 | # define assert(expr) \ | 132 | # define assert(expr) \ |
140 | if(unlikely(!(expr))) { \ | 133 | if(unlikely(!(expr))) { \ |
141 | printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ | 134 | pr_err("Assertion failed! %s,%s,%s,line=%d\n", \ |
142 | #expr, __FILE__, __func__, __LINE__); \ | 135 | #expr, __FILE__, __func__, __LINE__); \ |
143 | } | 136 | } |
144 | #endif | 137 | #endif |
@@ -784,8 +777,8 @@ static __devinit struct net_device * rtl8139_init_board (struct pci_dev *pdev) | |||
784 | 777 | ||
785 | /* set this immediately, we need to know before | 778 | /* set this immediately, we need to know before |
786 | * we talk to the chip directly */ | 779 | * we talk to the chip directly */ |
787 | DPRINTK("PIO region size == 0x%02X\n", pio_len); | 780 | pr_debug("PIO region size == 0x%02lX\n", pio_len); |
788 | DPRINTK("MMIO region size == 0x%02lX\n", mmio_len); | 781 | pr_debug("MMIO region size == 0x%02lX\n", mmio_len); |
789 | 782 | ||
790 | retry: | 783 | retry: |
791 | if (use_io) { | 784 | if (use_io) { |
@@ -865,19 +858,17 @@ retry: | |||
865 | } | 858 | } |
866 | 859 | ||
867 | /* if unknown chip, assume array element #0, original RTL-8139 in this case */ | 860 | /* if unknown chip, assume array element #0, original RTL-8139 in this case */ |
868 | dev_printk (KERN_DEBUG, &pdev->dev, | 861 | dev_dbg(&pdev->dev, "unknown chip version, assuming RTL-8139\n"); |
869 | "unknown chip version, assuming RTL-8139\n"); | 862 | dev_dbg(&pdev->dev, "TxConfig = 0x%lx\n", RTL_R32 (TxConfig)); |
870 | dev_printk (KERN_DEBUG, &pdev->dev, | ||
871 | "TxConfig = 0x%lx\n", RTL_R32 (TxConfig)); | ||
872 | tp->chipset = 0; | 863 | tp->chipset = 0; |
873 | 864 | ||
874 | match: | 865 | match: |
875 | DPRINTK ("chipset id (%d) == index %d, '%s'\n", | 866 | pr_debug("chipset id (%d) == index %d, '%s'\n", |
876 | version, i, rtl_chip_info[i].name); | 867 | version, i, rtl_chip_info[i].name); |
877 | 868 | ||
878 | if (tp->chipset >= CH_8139B) { | 869 | if (tp->chipset >= CH_8139B) { |
879 | u8 new_tmp8 = tmp8 = RTL_R8 (Config1); | 870 | u8 new_tmp8 = tmp8 = RTL_R8 (Config1); |
880 | DPRINTK("PCI PM wakeup\n"); | 871 | pr_debug("PCI PM wakeup\n"); |
881 | if ((rtl_chip_info[tp->chipset].flags & HasLWake) && | 872 | if ((rtl_chip_info[tp->chipset].flags & HasLWake) && |
882 | (tmp8 & LWAKE)) | 873 | (tmp8 & LWAKE)) |
883 | new_tmp8 &= ~LWAKE; | 874 | new_tmp8 &= ~LWAKE; |
@@ -896,7 +887,7 @@ match: | |||
896 | } | 887 | } |
897 | } | 888 | } |
898 | } else { | 889 | } else { |
899 | DPRINTK("Old chip wakeup\n"); | 890 | pr_debug("Old chip wakeup\n"); |
900 | tmp8 = RTL_R8 (Config1); | 891 | tmp8 = RTL_R8 (Config1); |
901 | tmp8 &= ~(SLEEP | PWRDN); | 892 | tmp8 &= ~(SLEEP | PWRDN); |
902 | RTL_W8 (Config1, tmp8); | 893 | RTL_W8 (Config1, tmp8); |
@@ -949,7 +940,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
949 | { | 940 | { |
950 | static int printed_version; | 941 | static int printed_version; |
951 | if (!printed_version++) | 942 | if (!printed_version++) |
952 | printk (KERN_INFO RTL8139_DRIVER_NAME "\n"); | 943 | pr_info(RTL8139_DRIVER_NAME "\n"); |
953 | } | 944 | } |
954 | #endif | 945 | #endif |
955 | 946 | ||
@@ -965,7 +956,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
965 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && | 956 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && |
966 | pdev->subsystem_vendor == PCI_VENDOR_ID_ATHEROS && | 957 | pdev->subsystem_vendor == PCI_VENDOR_ID_ATHEROS && |
967 | pdev->subsystem_device == PCI_DEVICE_ID_REALTEK_8139) { | 958 | pdev->subsystem_device == PCI_DEVICE_ID_REALTEK_8139) { |
968 | printk(KERN_INFO "8139too: OQO Model 2 detected. Forcing PIO\n"); | 959 | pr_info("8139too: OQO Model 2 detected. Forcing PIO\n"); |
969 | use_io = 1; | 960 | use_io = 1; |
970 | } | 961 | } |
971 | 962 | ||
@@ -1018,21 +1009,20 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
1018 | tp->mii.reg_num_mask = 0x1f; | 1009 | tp->mii.reg_num_mask = 0x1f; |
1019 | 1010 | ||
1020 | /* dev is fully set up and ready to use now */ | 1011 | /* dev is fully set up and ready to use now */ |
1021 | DPRINTK("about to register device named %s (%p)...\n", dev->name, dev); | 1012 | pr_debug("about to register device named %s (%p)...\n", dev->name, dev); |
1022 | i = register_netdev (dev); | 1013 | i = register_netdev (dev); |
1023 | if (i) goto err_out; | 1014 | if (i) goto err_out; |
1024 | 1015 | ||
1025 | pci_set_drvdata (pdev, dev); | 1016 | pci_set_drvdata (pdev, dev); |
1026 | 1017 | ||
1027 | printk (KERN_INFO "%s: %s at 0x%lx, " | 1018 | pr_info("%s: %s at 0x%lx, %pM, IRQ %d\n", |
1028 | "%pM, IRQ %d\n", | ||
1029 | dev->name, | 1019 | dev->name, |
1030 | board_info[ent->driver_data].name, | 1020 | board_info[ent->driver_data].name, |
1031 | dev->base_addr, | 1021 | dev->base_addr, |
1032 | dev->dev_addr, | 1022 | dev->dev_addr, |
1033 | dev->irq); | 1023 | dev->irq); |
1034 | 1024 | ||
1035 | printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n", | 1025 | pr_debug("%s: Identified 8139 chip type '%s'\n", |
1036 | dev->name, rtl_chip_info[tp->chipset].name); | 1026 | dev->name, rtl_chip_info[tp->chipset].name); |
1037 | 1027 | ||
1038 | /* Find the connected MII xcvrs. | 1028 | /* Find the connected MII xcvrs. |
@@ -1046,14 +1036,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
1046 | if (mii_status != 0xffff && mii_status != 0x0000) { | 1036 | if (mii_status != 0xffff && mii_status != 0x0000) { |
1047 | u16 advertising = mdio_read(dev, phy, 4); | 1037 | u16 advertising = mdio_read(dev, phy, 4); |
1048 | tp->phys[phy_idx++] = phy; | 1038 | tp->phys[phy_idx++] = phy; |
1049 | printk(KERN_INFO "%s: MII transceiver %d status 0x%4.4x " | 1039 | pr_info("%s: MII transceiver %d status 0x%4.4x advertising %4.4x.\n", |
1050 | "advertising %4.4x.\n", | ||
1051 | dev->name, phy, mii_status, advertising); | 1040 | dev->name, phy, mii_status, advertising); |
1052 | } | 1041 | } |
1053 | } | 1042 | } |
1054 | if (phy_idx == 0) { | 1043 | if (phy_idx == 0) { |
1055 | printk(KERN_INFO "%s: No MII transceivers found! Assuming SYM " | 1044 | pr_info("%s: No MII transceivers found! Assuming SYM transceiver.\n", |
1056 | "transceiver.\n", | ||
1057 | dev->name); | 1045 | dev->name); |
1058 | tp->phys[0] = 32; | 1046 | tp->phys[0] = 32; |
1059 | } | 1047 | } |
@@ -1073,13 +1061,13 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
1073 | if (board_idx < MAX_UNITS && full_duplex[board_idx] > 0) | 1061 | if (board_idx < MAX_UNITS && full_duplex[board_idx] > 0) |
1074 | tp->mii.full_duplex = full_duplex[board_idx]; | 1062 | tp->mii.full_duplex = full_duplex[board_idx]; |
1075 | if (tp->mii.full_duplex) { | 1063 | if (tp->mii.full_duplex) { |
1076 | printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name); | 1064 | pr_info("%s: Media type forced to Full Duplex.\n", dev->name); |
1077 | /* Changing the MII-advertised media because might prevent | 1065 | /* Changing the MII-advertised media because might prevent |
1078 | re-connection. */ | 1066 | re-connection. */ |
1079 | tp->mii.force_media = 1; | 1067 | tp->mii.force_media = 1; |
1080 | } | 1068 | } |
1081 | if (tp->default_port) { | 1069 | if (tp->default_port) { |
1082 | printk(KERN_INFO " Forcing %dMbps %s-duplex operation.\n", | 1070 | pr_info(" Forcing %dMbps %s-duplex operation.\n", |
1083 | (option & 0x20 ? 100 : 10), | 1071 | (option & 0x20 ? 100 : 10), |
1084 | (option & 0x10 ? "full" : "half")); | 1072 | (option & 0x10 ? "full" : "half")); |
1085 | mdio_write(dev, tp->phys[0], 0, | 1073 | mdio_write(dev, tp->phys[0], 0, |
@@ -1342,7 +1330,7 @@ static int rtl8139_open (struct net_device *dev) | |||
1342 | netif_start_queue (dev); | 1330 | netif_start_queue (dev); |
1343 | 1331 | ||
1344 | if (netif_msg_ifup(tp)) | 1332 | if (netif_msg_ifup(tp)) |
1345 | printk(KERN_DEBUG "%s: rtl8139_open() ioaddr %#llx IRQ %d" | 1333 | pr_debug("%s: rtl8139_open() ioaddr %#llx IRQ %d" |
1346 | " GP Pins %2.2x %s-duplex.\n", dev->name, | 1334 | " GP Pins %2.2x %s-duplex.\n", dev->name, |
1347 | (unsigned long long)pci_resource_start (tp->pci_dev, 1), | 1335 | (unsigned long long)pci_resource_start (tp->pci_dev, 1), |
1348 | dev->irq, RTL_R8 (MediaStatus), | 1336 | dev->irq, RTL_R8 (MediaStatus), |
@@ -1404,7 +1392,7 @@ static void rtl8139_hw_start (struct net_device *dev) | |||
1404 | RTL_W8 (Config3, RTL_R8 (Config3) & ~Cfg3_Magic); | 1392 | RTL_W8 (Config3, RTL_R8 (Config3) & ~Cfg3_Magic); |
1405 | } | 1393 | } |
1406 | 1394 | ||
1407 | DPRINTK("init buffer addresses\n"); | 1395 | pr_debug("init buffer addresses\n"); |
1408 | 1396 | ||
1409 | /* Lock Config[01234] and BMCR register writes */ | 1397 | /* Lock Config[01234] and BMCR register writes */ |
1410 | RTL_W8 (Cfg9346, Cfg9346_Lock); | 1398 | RTL_W8 (Cfg9346, Cfg9346_Lock); |
@@ -1566,14 +1554,13 @@ static inline void rtl8139_thread_iter (struct net_device *dev, | |||
1566 | tp->mii.full_duplex = duplex; | 1554 | tp->mii.full_duplex = duplex; |
1567 | 1555 | ||
1568 | if (mii_lpa) { | 1556 | if (mii_lpa) { |
1569 | printk (KERN_INFO | 1557 | pr_info("%s: Setting %s-duplex based on MII #%d link" |
1570 | "%s: Setting %s-duplex based on MII #%d link" | ||
1571 | " partner ability of %4.4x.\n", | 1558 | " partner ability of %4.4x.\n", |
1572 | dev->name, | 1559 | dev->name, |
1573 | tp->mii.full_duplex ? "full" : "half", | 1560 | tp->mii.full_duplex ? "full" : "half", |
1574 | tp->phys[0], mii_lpa); | 1561 | tp->phys[0], mii_lpa); |
1575 | } else { | 1562 | } else { |
1576 | printk(KERN_INFO"%s: media is unconnected, link down, or incompatible connection\n", | 1563 | pr_info("%s: media is unconnected, link down, or incompatible connection\n", |
1577 | dev->name); | 1564 | dev->name); |
1578 | } | 1565 | } |
1579 | #if 0 | 1566 | #if 0 |
@@ -1588,11 +1575,11 @@ static inline void rtl8139_thread_iter (struct net_device *dev, | |||
1588 | 1575 | ||
1589 | rtl8139_tune_twister (dev, tp); | 1576 | rtl8139_tune_twister (dev, tp); |
1590 | 1577 | ||
1591 | DPRINTK ("%s: Media selection tick, Link partner %4.4x.\n", | 1578 | pr_debug("%s: Media selection tick, Link partner %4.4x.\n", |
1592 | dev->name, RTL_R16 (NWayLPAR)); | 1579 | dev->name, RTL_R16 (NWayLPAR)); |
1593 | DPRINTK ("%s: Other registers are IntMask %4.4x IntStatus %4.4x\n", | 1580 | pr_debug("%s: Other registers are IntMask %4.4x IntStatus %4.4x\n", |
1594 | dev->name, RTL_R16 (IntrMask), RTL_R16 (IntrStatus)); | 1581 | dev->name, RTL_R16 (IntrMask), RTL_R16 (IntrStatus)); |
1595 | DPRINTK ("%s: Chip config %2.2x %2.2x.\n", | 1582 | pr_debug("%s: Chip config %2.2x %2.2x.\n", |
1596 | dev->name, RTL_R8 (Config0), | 1583 | dev->name, RTL_R8 (Config0), |
1597 | RTL_R8 (Config1)); | 1584 | RTL_R8 (Config1)); |
1598 | } | 1585 | } |
@@ -1652,14 +1639,14 @@ static void rtl8139_tx_timeout_task (struct work_struct *work) | |||
1652 | int i; | 1639 | int i; |
1653 | u8 tmp8; | 1640 | u8 tmp8; |
1654 | 1641 | ||
1655 | printk (KERN_DEBUG "%s: Transmit timeout, status %2.2x %4.4x %4.4x " | 1642 | pr_debug("%s: Transmit timeout, status %2.2x %4.4x %4.4x media %2.2x.\n", |
1656 | "media %2.2x.\n", dev->name, RTL_R8 (ChipCmd), | 1643 | dev->name, RTL_R8 (ChipCmd), |
1657 | RTL_R16(IntrStatus), RTL_R16(IntrMask), RTL_R8(MediaStatus)); | 1644 | RTL_R16(IntrStatus), RTL_R16(IntrMask), RTL_R8(MediaStatus)); |
1658 | /* Emit info to figure out what went wrong. */ | 1645 | /* Emit info to figure out what went wrong. */ |
1659 | printk (KERN_DEBUG "%s: Tx queue start entry %ld dirty entry %ld.\n", | 1646 | pr_debug("%s: Tx queue start entry %ld dirty entry %ld.\n", |
1660 | dev->name, tp->cur_tx, tp->dirty_tx); | 1647 | dev->name, tp->cur_tx, tp->dirty_tx); |
1661 | for (i = 0; i < NUM_TX_DESC; i++) | 1648 | for (i = 0; i < NUM_TX_DESC; i++) |
1662 | printk (KERN_DEBUG "%s: Tx descriptor %d is %8.8lx.%s\n", | 1649 | pr_debug("%s: Tx descriptor %d is %8.8lx.%s\n", |
1663 | dev->name, i, RTL_R32 (TxStatus0 + (i * 4)), | 1650 | dev->name, i, RTL_R32 (TxStatus0 + (i * 4)), |
1664 | i == tp->dirty_tx % NUM_TX_DESC ? | 1651 | i == tp->dirty_tx % NUM_TX_DESC ? |
1665 | " (queue head)" : ""); | 1652 | " (queue head)" : ""); |
@@ -1741,7 +1728,7 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) | |||
1741 | spin_unlock_irqrestore(&tp->lock, flags); | 1728 | spin_unlock_irqrestore(&tp->lock, flags); |
1742 | 1729 | ||
1743 | if (netif_msg_tx_queued(tp)) | 1730 | if (netif_msg_tx_queued(tp)) |
1744 | printk (KERN_DEBUG "%s: Queued Tx packet size %u to slot %d.\n", | 1731 | pr_debug("%s: Queued Tx packet size %u to slot %d.\n", |
1745 | dev->name, len, entry); | 1732 | dev->name, len, entry); |
1746 | 1733 | ||
1747 | return 0; | 1734 | return 0; |
@@ -1772,7 +1759,7 @@ static void rtl8139_tx_interrupt (struct net_device *dev, | |||
1772 | if (txstatus & (TxOutOfWindow | TxAborted)) { | 1759 | if (txstatus & (TxOutOfWindow | TxAborted)) { |
1773 | /* There was an major error, log it. */ | 1760 | /* There was an major error, log it. */ |
1774 | if (netif_msg_tx_err(tp)) | 1761 | if (netif_msg_tx_err(tp)) |
1775 | printk(KERN_DEBUG "%s: Transmit error, Tx status %8.8x.\n", | 1762 | pr_debug("%s: Transmit error, Tx status %8.8x.\n", |
1776 | dev->name, txstatus); | 1763 | dev->name, txstatus); |
1777 | dev->stats.tx_errors++; | 1764 | dev->stats.tx_errors++; |
1778 | if (txstatus & TxAborted) { | 1765 | if (txstatus & TxAborted) { |
@@ -1803,7 +1790,7 @@ static void rtl8139_tx_interrupt (struct net_device *dev, | |||
1803 | 1790 | ||
1804 | #ifndef RTL8139_NDEBUG | 1791 | #ifndef RTL8139_NDEBUG |
1805 | if (tp->cur_tx - dirty_tx > NUM_TX_DESC) { | 1792 | if (tp->cur_tx - dirty_tx > NUM_TX_DESC) { |
1806 | printk (KERN_ERR "%s: Out-of-sync dirty pointer, %ld vs. %ld.\n", | 1793 | pr_err("%s: Out-of-sync dirty pointer, %ld vs. %ld.\n", |
1807 | dev->name, dirty_tx, tp->cur_tx); | 1794 | dev->name, dirty_tx, tp->cur_tx); |
1808 | dirty_tx += NUM_TX_DESC; | 1795 | dirty_tx += NUM_TX_DESC; |
1809 | } | 1796 | } |
@@ -1828,12 +1815,12 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1828 | #endif | 1815 | #endif |
1829 | 1816 | ||
1830 | if (netif_msg_rx_err (tp)) | 1817 | if (netif_msg_rx_err (tp)) |
1831 | printk(KERN_DEBUG "%s: Ethernet frame had errors, status %8.8x.\n", | 1818 | pr_debug("%s: Ethernet frame had errors, status %8.8x.\n", |
1832 | dev->name, rx_status); | 1819 | dev->name, rx_status); |
1833 | dev->stats.rx_errors++; | 1820 | dev->stats.rx_errors++; |
1834 | if (!(rx_status & RxStatusOK)) { | 1821 | if (!(rx_status & RxStatusOK)) { |
1835 | if (rx_status & RxTooLong) { | 1822 | if (rx_status & RxTooLong) { |
1836 | DPRINTK ("%s: Oversized Ethernet frame, status %4.4x!\n", | 1823 | pr_debug("%s: Oversized Ethernet frame, status %4.4x!\n", |
1837 | dev->name, rx_status); | 1824 | dev->name, rx_status); |
1838 | /* A.C.: The chip hangs here. */ | 1825 | /* A.C.: The chip hangs here. */ |
1839 | } | 1826 | } |
@@ -1866,7 +1853,7 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1866 | break; | 1853 | break; |
1867 | } | 1854 | } |
1868 | if (tmp_work <= 0) | 1855 | if (tmp_work <= 0) |
1869 | printk (KERN_WARNING PFX "rx stop wait too long\n"); | 1856 | pr_warning(PFX "rx stop wait too long\n"); |
1870 | /* restart receive */ | 1857 | /* restart receive */ |
1871 | tmp_work = 200; | 1858 | tmp_work = 200; |
1872 | while (--tmp_work > 0) { | 1859 | while (--tmp_work > 0) { |
@@ -1877,7 +1864,7 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1877 | break; | 1864 | break; |
1878 | } | 1865 | } |
1879 | if (tmp_work <= 0) | 1866 | if (tmp_work <= 0) |
1880 | printk (KERN_WARNING PFX "tx/rx enable wait too long\n"); | 1867 | pr_warning(PFX "tx/rx enable wait too long\n"); |
1881 | 1868 | ||
1882 | /* and reinitialize all rx related registers */ | 1869 | /* and reinitialize all rx related registers */ |
1883 | RTL_W8_F (Cfg9346, Cfg9346_Unlock); | 1870 | RTL_W8_F (Cfg9346, Cfg9346_Unlock); |
@@ -1888,7 +1875,7 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1888 | RTL_W32 (RxConfig, tp->rx_config); | 1875 | RTL_W32 (RxConfig, tp->rx_config); |
1889 | tp->cur_rx = 0; | 1876 | tp->cur_rx = 0; |
1890 | 1877 | ||
1891 | DPRINTK("init buffer addresses\n"); | 1878 | pr_debug("init buffer addresses\n"); |
1892 | 1879 | ||
1893 | /* Lock Config[01234] and BMCR register writes */ | 1880 | /* Lock Config[01234] and BMCR register writes */ |
1894 | RTL_W8 (Cfg9346, Cfg9346_Lock); | 1881 | RTL_W8 (Cfg9346, Cfg9346_Lock); |
@@ -1942,7 +1929,7 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, | |||
1942 | unsigned int cur_rx = tp->cur_rx; | 1929 | unsigned int cur_rx = tp->cur_rx; |
1943 | unsigned int rx_size = 0; | 1930 | unsigned int rx_size = 0; |
1944 | 1931 | ||
1945 | DPRINTK ("%s: In rtl8139_rx(), current %4.4x BufAddr %4.4x," | 1932 | pr_debug("%s: In rtl8139_rx(), current %4.4x BufAddr %4.4x," |
1946 | " free to %4.4x, Cmd %2.2x.\n", dev->name, (u16)cur_rx, | 1933 | " free to %4.4x, Cmd %2.2x.\n", dev->name, (u16)cur_rx, |
1947 | RTL_R16 (RxBufAddr), | 1934 | RTL_R16 (RxBufAddr), |
1948 | RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); | 1935 | RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); |
@@ -1962,17 +1949,17 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, | |||
1962 | pkt_size = rx_size - 4; | 1949 | pkt_size = rx_size - 4; |
1963 | 1950 | ||
1964 | if (netif_msg_rx_status(tp)) | 1951 | if (netif_msg_rx_status(tp)) |
1965 | printk(KERN_DEBUG "%s: rtl8139_rx() status %4.4x, size %4.4x," | 1952 | pr_debug("%s: rtl8139_rx() status %4.4x, size %4.4x," |
1966 | " cur %4.4x.\n", dev->name, rx_status, | 1953 | " cur %4.4x.\n", dev->name, rx_status, |
1967 | rx_size, cur_rx); | 1954 | rx_size, cur_rx); |
1968 | #if RTL8139_DEBUG > 2 | 1955 | #if RTL8139_DEBUG > 2 |
1969 | { | 1956 | { |
1970 | int i; | 1957 | int i; |
1971 | DPRINTK ("%s: Frame contents ", dev->name); | 1958 | pr_debug("%s: Frame contents ", dev->name); |
1972 | for (i = 0; i < 70; i++) | 1959 | for (i = 0; i < 70; i++) |
1973 | printk (" %2.2x", | 1960 | pr_cont(" %2.2x", |
1974 | rx_ring[ring_offset + i]); | 1961 | rx_ring[ring_offset + i]); |
1975 | printk (".\n"); | 1962 | pr_cont(".\n"); |
1976 | } | 1963 | } |
1977 | #endif | 1964 | #endif |
1978 | 1965 | ||
@@ -1984,12 +1971,12 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, | |||
1984 | if (!tp->fifo_copy_timeout) | 1971 | if (!tp->fifo_copy_timeout) |
1985 | tp->fifo_copy_timeout = jiffies + 2; | 1972 | tp->fifo_copy_timeout = jiffies + 2; |
1986 | else if (time_after(jiffies, tp->fifo_copy_timeout)) { | 1973 | else if (time_after(jiffies, tp->fifo_copy_timeout)) { |
1987 | DPRINTK ("%s: hung FIFO. Reset.", dev->name); | 1974 | pr_debug("%s: hung FIFO. Reset.", dev->name); |
1988 | rx_size = 0; | 1975 | rx_size = 0; |
1989 | goto no_early_rx; | 1976 | goto no_early_rx; |
1990 | } | 1977 | } |
1991 | if (netif_msg_intr(tp)) { | 1978 | if (netif_msg_intr(tp)) { |
1992 | printk(KERN_DEBUG "%s: fifo copy in progress.", | 1979 | pr_debug("%s: fifo copy in progress.", |
1993 | dev->name); | 1980 | dev->name); |
1994 | } | 1981 | } |
1995 | tp->xstats.early_rx++; | 1982 | tp->xstats.early_rx++; |
@@ -2033,8 +2020,7 @@ no_early_rx: | |||
2033 | netif_receive_skb (skb); | 2020 | netif_receive_skb (skb); |
2034 | } else { | 2021 | } else { |
2035 | if (net_ratelimit()) | 2022 | if (net_ratelimit()) |
2036 | printk (KERN_WARNING | 2023 | pr_warning("%s: Memory squeeze, dropping packet.\n", |
2037 | "%s: Memory squeeze, dropping packet.\n", | ||
2038 | dev->name); | 2024 | dev->name); |
2039 | dev->stats.rx_dropped++; | 2025 | dev->stats.rx_dropped++; |
2040 | } | 2026 | } |
@@ -2049,12 +2035,10 @@ no_early_rx: | |||
2049 | if (unlikely(!received || rx_size == 0xfff0)) | 2035 | if (unlikely(!received || rx_size == 0xfff0)) |
2050 | rtl8139_isr_ack(tp); | 2036 | rtl8139_isr_ack(tp); |
2051 | 2037 | ||
2052 | #if RTL8139_DEBUG > 1 | 2038 | pr_debug("%s: Done rtl8139_rx(), current %4.4x BufAddr %4.4x," |
2053 | DPRINTK ("%s: Done rtl8139_rx(), current %4.4x BufAddr %4.4x," | ||
2054 | " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, | 2039 | " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, |
2055 | RTL_R16 (RxBufAddr), | 2040 | RTL_R16 (RxBufAddr), |
2056 | RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); | 2041 | RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); |
2057 | #endif | ||
2058 | 2042 | ||
2059 | tp->cur_rx = cur_rx; | 2043 | tp->cur_rx = cur_rx; |
2060 | 2044 | ||
@@ -2075,7 +2059,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev, | |||
2075 | void __iomem *ioaddr, | 2059 | void __iomem *ioaddr, |
2076 | int status, int link_changed) | 2060 | int status, int link_changed) |
2077 | { | 2061 | { |
2078 | DPRINTK ("%s: Abnormal interrupt, status %8.8x.\n", | 2062 | pr_debug("%s: Abnormal interrupt, status %8.8x.\n", |
2079 | dev->name, status); | 2063 | dev->name, status); |
2080 | 2064 | ||
2081 | assert (dev != NULL); | 2065 | assert (dev != NULL); |
@@ -2104,7 +2088,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev, | |||
2104 | pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status); | 2088 | pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status); |
2105 | pci_write_config_word (tp->pci_dev, PCI_STATUS, pci_cmd_status); | 2089 | pci_write_config_word (tp->pci_dev, PCI_STATUS, pci_cmd_status); |
2106 | 2090 | ||
2107 | printk (KERN_ERR "%s: PCI Bus error %4.4x.\n", | 2091 | pr_err("%s: PCI Bus error %4.4x.\n", |
2108 | dev->name, pci_cmd_status); | 2092 | dev->name, pci_cmd_status); |
2109 | } | 2093 | } |
2110 | } | 2094 | } |
@@ -2198,7 +2182,7 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance) | |||
2198 | out: | 2182 | out: |
2199 | spin_unlock (&tp->lock); | 2183 | spin_unlock (&tp->lock); |
2200 | 2184 | ||
2201 | DPRINTK ("%s: exiting interrupt, intr_status=%#4.4x.\n", | 2185 | pr_debug("%s: exiting interrupt, intr_status=%#4.4x.\n", |
2202 | dev->name, RTL_R16 (IntrStatus)); | 2186 | dev->name, RTL_R16 (IntrStatus)); |
2203 | return IRQ_RETVAL(handled); | 2187 | return IRQ_RETVAL(handled); |
2204 | } | 2188 | } |
@@ -2249,7 +2233,7 @@ static int rtl8139_close (struct net_device *dev) | |||
2249 | napi_disable(&tp->napi); | 2233 | napi_disable(&tp->napi); |
2250 | 2234 | ||
2251 | if (netif_msg_ifdown(tp)) | 2235 | if (netif_msg_ifdown(tp)) |
2252 | printk(KERN_DEBUG "%s: Shutting down ethercard, status was 0x%4.4x.\n", | 2236 | pr_debug("%s: Shutting down ethercard, status was 0x%4.4x.\n", |
2253 | dev->name, RTL_R16 (IntrStatus)); | 2237 | dev->name, RTL_R16 (IntrStatus)); |
2254 | 2238 | ||
2255 | spin_lock_irqsave (&tp->lock, flags); | 2239 | spin_lock_irqsave (&tp->lock, flags); |
@@ -2527,7 +2511,7 @@ static void __set_rx_mode (struct net_device *dev) | |||
2527 | int i, rx_mode; | 2511 | int i, rx_mode; |
2528 | u32 tmp; | 2512 | u32 tmp; |
2529 | 2513 | ||
2530 | DPRINTK ("%s: rtl8139_set_rx_mode(%4.4x) done -- Rx config %8.8lx.\n", | 2514 | pr_debug("%s: rtl8139_set_rx_mode(%4.4x) done -- Rx config %8.8lx.\n", |
2531 | dev->name, dev->flags, RTL_R32 (RxConfig)); | 2515 | dev->name, dev->flags, RTL_R32 (RxConfig)); |
2532 | 2516 | ||
2533 | /* Note: do not reorder, GCC is clever about common statements. */ | 2517 | /* Note: do not reorder, GCC is clever about common statements. */ |
@@ -2643,7 +2627,7 @@ static int __init rtl8139_init_module (void) | |||
2643 | * even if no 8139 board is found. | 2627 | * even if no 8139 board is found. |
2644 | */ | 2628 | */ |
2645 | #ifdef MODULE | 2629 | #ifdef MODULE |
2646 | printk (KERN_INFO RTL8139_DRIVER_NAME "\n"); | 2630 | pr_info(RTL8139_DRIVER_NAME "\n"); |
2647 | #endif | 2631 | #endif |
2648 | 2632 | ||
2649 | return pci_register_driver(&rtl8139_pci_driver); | 2633 | return pci_register_driver(&rtl8139_pci_driver); |