aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/8139too.c
diff options
context:
space:
mode:
authorAlexander Beregalov <a.beregalov@gmail.com>2009-05-26 08:35:27 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-26 23:35:04 -0400
commitb93d584772347323334253d5b21c4d720718d7da (patch)
tree699d8849876f11362fa80a4792762049b1b0568b /drivers/net/8139too.c
parent39738e161f7315bfa8f31a91d2262f93d818a7cd (diff)
8139*: convert printk() to pr_<foo>()
Also convert DPRINTK to pr_debug and dev_printk to dev_<foo>. Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/8139too.c')
-rw-r--r--drivers/net/8139too.c118
1 files changed, 51 insertions, 67 deletions
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
790retry: 783retry:
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
874match: 865match:
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);