diff options
author | Joe Perches <joe@perches.com> | 2010-02-17 10:01:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 20:45:18 -0500 |
commit | 497159aff6c81b61fe88463a64e7dad6f86297e3 (patch) | |
tree | 43836646d96183eea8c3a5dc98243fbb78f0afaf /drivers/net/8139too.c | |
parent | b4f18b3faccae13c0530ae8f7f20fe81d18f2bd5 (diff) |
drivers/net/8139too.c: Use (pr|netdev|netif)_<level> macro helpers
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove #define PFX
Use pr_<level>
Use netdev_<level>
Use netif_<level>
Convert formats like %8.8 to %08
Remove periods from formats
Coalesce long formats
Use print_hex_dump
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/8139too.c')
-rw-r--r-- | drivers/net/8139too.c | 187 |
1 files changed, 81 insertions, 106 deletions
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index c7d6f094cc7a..b4efc913978b 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -89,6 +89,8 @@ | |||
89 | 89 | ||
90 | */ | 90 | */ |
91 | 91 | ||
92 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
93 | |||
92 | #define DRV_NAME "8139too" | 94 | #define DRV_NAME "8139too" |
93 | #define DRV_VERSION "0.9.28" | 95 | #define DRV_VERSION "0.9.28" |
94 | 96 | ||
@@ -111,7 +113,6 @@ | |||
111 | #include <asm/irq.h> | 113 | #include <asm/irq.h> |
112 | 114 | ||
113 | #define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION | 115 | #define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION |
114 | #define PFX DRV_NAME ": " | ||
115 | 116 | ||
116 | /* Default Message level */ | 117 | /* Default Message level */ |
117 | #define RTL8139_DEF_MSG_ENABLE (NETIF_MSG_DRV | \ | 118 | #define RTL8139_DEF_MSG_ENABLE (NETIF_MSG_DRV | \ |
@@ -130,9 +131,9 @@ | |||
130 | # define assert(expr) do {} while (0) | 131 | # define assert(expr) do {} while (0) |
131 | #else | 132 | #else |
132 | # define assert(expr) \ | 133 | # define assert(expr) \ |
133 | if(unlikely(!(expr))) { \ | 134 | if (unlikely(!(expr))) { \ |
134 | pr_err("Assertion failed! %s,%s,%s,line=%d\n", \ | 135 | pr_err("Assertion failed! %s,%s,%s,line=%d\n", \ |
135 | #expr, __FILE__, __func__, __LINE__); \ | 136 | #expr, __FILE__, __func__, __LINE__); \ |
136 | } | 137 | } |
137 | #endif | 138 | #endif |
138 | 139 | ||
@@ -957,7 +958,7 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
957 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && | 958 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && |
958 | pdev->subsystem_vendor == PCI_VENDOR_ID_ATHEROS && | 959 | pdev->subsystem_vendor == PCI_VENDOR_ID_ATHEROS && |
959 | pdev->subsystem_device == PCI_DEVICE_ID_REALTEK_8139) { | 960 | pdev->subsystem_device == PCI_DEVICE_ID_REALTEK_8139) { |
960 | pr_info("8139too: OQO Model 2 detected. Forcing PIO\n"); | 961 | pr_info("OQO Model 2 detected. Forcing PIO\n"); |
961 | use_io = 1; | 962 | use_io = 1; |
962 | } | 963 | } |
963 | 964 | ||
@@ -1010,21 +1011,19 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
1010 | tp->mii.reg_num_mask = 0x1f; | 1011 | tp->mii.reg_num_mask = 0x1f; |
1011 | 1012 | ||
1012 | /* dev is fully set up and ready to use now */ | 1013 | /* dev is fully set up and ready to use now */ |
1013 | pr_debug("about to register device named %s (%p)...\n", dev->name, dev); | 1014 | pr_debug("about to register device named %s (%p)...\n", |
1015 | dev->name, dev); | ||
1014 | i = register_netdev (dev); | 1016 | i = register_netdev (dev); |
1015 | if (i) goto err_out; | 1017 | if (i) goto err_out; |
1016 | 1018 | ||
1017 | pci_set_drvdata (pdev, dev); | 1019 | pci_set_drvdata (pdev, dev); |
1018 | 1020 | ||
1019 | pr_info("%s: %s at 0x%lx, %pM, IRQ %d\n", | 1021 | netdev_info(dev, "%s at 0x%lx, %pM, IRQ %d\n", |
1020 | dev->name, | 1022 | board_info[ent->driver_data].name, |
1021 | board_info[ent->driver_data].name, | 1023 | dev->base_addr, dev->dev_addr, dev->irq); |
1022 | dev->base_addr, | ||
1023 | dev->dev_addr, | ||
1024 | dev->irq); | ||
1025 | 1024 | ||
1026 | pr_debug("%s: Identified 8139 chip type '%s'\n", | 1025 | netdev_dbg(dev, "Identified 8139 chip type '%s'\n", |
1027 | dev->name, rtl_chip_info[tp->chipset].name); | 1026 | rtl_chip_info[tp->chipset].name); |
1028 | 1027 | ||
1029 | /* Find the connected MII xcvrs. | 1028 | /* Find the connected MII xcvrs. |
1030 | Doing this in open() would allow detecting external xcvrs later, but | 1029 | Doing this in open() would allow detecting external xcvrs later, but |
@@ -1037,13 +1036,12 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
1037 | if (mii_status != 0xffff && mii_status != 0x0000) { | 1036 | if (mii_status != 0xffff && mii_status != 0x0000) { |
1038 | u16 advertising = mdio_read(dev, phy, 4); | 1037 | u16 advertising = mdio_read(dev, phy, 4); |
1039 | tp->phys[phy_idx++] = phy; | 1038 | tp->phys[phy_idx++] = phy; |
1040 | pr_info("%s: MII transceiver %d status 0x%4.4x advertising %4.4x.\n", | 1039 | netdev_info(dev, "MII transceiver %d status 0x%04x advertising %04x\n", |
1041 | dev->name, phy, mii_status, advertising); | 1040 | phy, mii_status, advertising); |
1042 | } | 1041 | } |
1043 | } | 1042 | } |
1044 | if (phy_idx == 0) { | 1043 | if (phy_idx == 0) { |
1045 | pr_info("%s: No MII transceivers found! Assuming SYM transceiver.\n", | 1044 | netdev_info(dev, "No MII transceivers found! Assuming SYM transceiver\n"); |
1046 | dev->name); | ||
1047 | tp->phys[0] = 32; | 1045 | tp->phys[0] = 32; |
1048 | } | 1046 | } |
1049 | } else | 1047 | } else |
@@ -1062,15 +1060,15 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
1062 | if (board_idx < MAX_UNITS && full_duplex[board_idx] > 0) | 1060 | if (board_idx < MAX_UNITS && full_duplex[board_idx] > 0) |
1063 | tp->mii.full_duplex = full_duplex[board_idx]; | 1061 | tp->mii.full_duplex = full_duplex[board_idx]; |
1064 | if (tp->mii.full_duplex) { | 1062 | if (tp->mii.full_duplex) { |
1065 | pr_info("%s: Media type forced to Full Duplex.\n", dev->name); | 1063 | netdev_info(dev, "Media type forced to Full Duplex\n"); |
1066 | /* Changing the MII-advertised media because might prevent | 1064 | /* Changing the MII-advertised media because might prevent |
1067 | re-connection. */ | 1065 | re-connection. */ |
1068 | tp->mii.force_media = 1; | 1066 | tp->mii.force_media = 1; |
1069 | } | 1067 | } |
1070 | if (tp->default_port) { | 1068 | if (tp->default_port) { |
1071 | pr_info(" Forcing %dMbps %s-duplex operation.\n", | 1069 | netdev_info(dev, " Forcing %dMbps %s-duplex operation\n", |
1072 | (option & 0x20 ? 100 : 10), | 1070 | (option & 0x20 ? 100 : 10), |
1073 | (option & 0x10 ? "full" : "half")); | 1071 | (option & 0x10 ? "full" : "half")); |
1074 | mdio_write(dev, tp->phys[0], 0, | 1072 | mdio_write(dev, tp->phys[0], 0, |
1075 | ((option & 0x20) ? 0x2000 : 0) | /* 100Mbps? */ | 1073 | ((option & 0x20) ? 0x2000 : 0) | /* 100Mbps? */ |
1076 | ((option & 0x10) ? 0x0100 : 0)); /* Full duplex? */ | 1074 | ((option & 0x10) ? 0x0100 : 0)); /* Full duplex? */ |
@@ -1330,12 +1328,12 @@ static int rtl8139_open (struct net_device *dev) | |||
1330 | rtl8139_hw_start (dev); | 1328 | rtl8139_hw_start (dev); |
1331 | netif_start_queue (dev); | 1329 | netif_start_queue (dev); |
1332 | 1330 | ||
1333 | if (netif_msg_ifup(tp)) | 1331 | netif_dbg(tp, ifup, dev, |
1334 | pr_debug("%s: rtl8139_open() ioaddr %#llx IRQ %d" | 1332 | "%s() ioaddr %#llx IRQ %d GP Pins %02x %s-duplex\n", |
1335 | " GP Pins %2.2x %s-duplex.\n", dev->name, | 1333 | __func__, |
1336 | (unsigned long long)pci_resource_start (tp->pci_dev, 1), | 1334 | (unsigned long long)pci_resource_start (tp->pci_dev, 1), |
1337 | dev->irq, RTL_R8 (MediaStatus), | 1335 | dev->irq, RTL_R8 (MediaStatus), |
1338 | tp->mii.full_duplex ? "full" : "half"); | 1336 | tp->mii.full_duplex ? "full" : "half"); |
1339 | 1337 | ||
1340 | rtl8139_start_thread(tp); | 1338 | rtl8139_start_thread(tp); |
1341 | 1339 | ||
@@ -1393,7 +1391,7 @@ static void rtl8139_hw_start (struct net_device *dev) | |||
1393 | RTL_W8 (Config3, RTL_R8 (Config3) & ~Cfg3_Magic); | 1391 | RTL_W8 (Config3, RTL_R8 (Config3) & ~Cfg3_Magic); |
1394 | } | 1392 | } |
1395 | 1393 | ||
1396 | pr_debug("init buffer addresses\n"); | 1394 | netdev_dbg(dev, "init buffer addresses\n"); |
1397 | 1395 | ||
1398 | /* Lock Config[01234] and BMCR register writes */ | 1396 | /* Lock Config[01234] and BMCR register writes */ |
1399 | RTL_W8 (Cfg9346, Cfg9346_Lock); | 1397 | RTL_W8 (Cfg9346, Cfg9346_Lock); |
@@ -1555,14 +1553,11 @@ static inline void rtl8139_thread_iter (struct net_device *dev, | |||
1555 | tp->mii.full_duplex = duplex; | 1553 | tp->mii.full_duplex = duplex; |
1556 | 1554 | ||
1557 | if (mii_lpa) { | 1555 | if (mii_lpa) { |
1558 | pr_info("%s: Setting %s-duplex based on MII #%d link" | 1556 | netdev_info(dev, "Setting %s-duplex based on MII #%d link partner ability of %04x\n", |
1559 | " partner ability of %4.4x.\n", | 1557 | tp->mii.full_duplex ? "full" : "half", |
1560 | dev->name, | 1558 | tp->phys[0], mii_lpa); |
1561 | tp->mii.full_duplex ? "full" : "half", | ||
1562 | tp->phys[0], mii_lpa); | ||
1563 | } else { | 1559 | } else { |
1564 | pr_info("%s: media is unconnected, link down, or incompatible connection\n", | 1560 | netdev_info(dev, "media is unconnected, link down, or incompatible connection\n"); |
1565 | dev->name); | ||
1566 | } | 1561 | } |
1567 | #if 0 | 1562 | #if 0 |
1568 | RTL_W8 (Cfg9346, Cfg9346_Unlock); | 1563 | RTL_W8 (Cfg9346, Cfg9346_Unlock); |
@@ -1576,13 +1571,12 @@ static inline void rtl8139_thread_iter (struct net_device *dev, | |||
1576 | 1571 | ||
1577 | rtl8139_tune_twister (dev, tp); | 1572 | rtl8139_tune_twister (dev, tp); |
1578 | 1573 | ||
1579 | pr_debug("%s: Media selection tick, Link partner %4.4x.\n", | 1574 | netdev_dbg(dev, "Media selection tick, Link partner %04x\n", |
1580 | dev->name, RTL_R16 (NWayLPAR)); | 1575 | RTL_R16(NWayLPAR)); |
1581 | pr_debug("%s: Other registers are IntMask %4.4x IntStatus %4.4x\n", | 1576 | netdev_dbg(dev, "Other registers are IntMask %04x IntStatus %04x\n", |
1582 | dev->name, RTL_R16 (IntrMask), RTL_R16 (IntrStatus)); | 1577 | RTL_R16(IntrMask), RTL_R16(IntrStatus)); |
1583 | pr_debug("%s: Chip config %2.2x %2.2x.\n", | 1578 | netdev_dbg(dev, "Chip config %02x %02x\n", |
1584 | dev->name, RTL_R8 (Config0), | 1579 | RTL_R8(Config0), RTL_R8(Config1)); |
1585 | RTL_R8 (Config1)); | ||
1586 | } | 1580 | } |
1587 | 1581 | ||
1588 | static void rtl8139_thread (struct work_struct *work) | 1582 | static void rtl8139_thread (struct work_struct *work) |
@@ -1640,17 +1634,17 @@ static void rtl8139_tx_timeout_task (struct work_struct *work) | |||
1640 | int i; | 1634 | int i; |
1641 | u8 tmp8; | 1635 | u8 tmp8; |
1642 | 1636 | ||
1643 | pr_debug("%s: Transmit timeout, status %2.2x %4.4x %4.4x media %2.2x.\n", | 1637 | netdev_dbg(dev, "Transmit timeout, status %02x %04x %04x media %02x\n", |
1644 | dev->name, RTL_R8 (ChipCmd), | 1638 | RTL_R8(ChipCmd), RTL_R16(IntrStatus), |
1645 | RTL_R16(IntrStatus), RTL_R16(IntrMask), RTL_R8(MediaStatus)); | 1639 | RTL_R16(IntrMask), RTL_R8(MediaStatus)); |
1646 | /* Emit info to figure out what went wrong. */ | 1640 | /* Emit info to figure out what went wrong. */ |
1647 | pr_debug("%s: Tx queue start entry %ld dirty entry %ld.\n", | 1641 | netdev_dbg(dev, "Tx queue start entry %ld dirty entry %ld\n", |
1648 | dev->name, tp->cur_tx, tp->dirty_tx); | 1642 | tp->cur_tx, tp->dirty_tx); |
1649 | for (i = 0; i < NUM_TX_DESC; i++) | 1643 | for (i = 0; i < NUM_TX_DESC; i++) |
1650 | pr_debug("%s: Tx descriptor %d is %8.8lx.%s\n", | 1644 | netdev_dbg(dev, "Tx descriptor %d is %08lx%s\n", |
1651 | dev->name, i, RTL_R32 (TxStatus0 + (i * 4)), | 1645 | i, RTL_R32(TxStatus0 + (i * 4)), |
1652 | i == tp->dirty_tx % NUM_TX_DESC ? | 1646 | i == tp->dirty_tx % NUM_TX_DESC ? |
1653 | " (queue head)" : ""); | 1647 | " (queue head)" : ""); |
1654 | 1648 | ||
1655 | tp->xstats.tx_timeouts++; | 1649 | tp->xstats.tx_timeouts++; |
1656 | 1650 | ||
@@ -1729,9 +1723,8 @@ static netdev_tx_t rtl8139_start_xmit (struct sk_buff *skb, | |||
1729 | netif_stop_queue (dev); | 1723 | netif_stop_queue (dev); |
1730 | spin_unlock_irqrestore(&tp->lock, flags); | 1724 | spin_unlock_irqrestore(&tp->lock, flags); |
1731 | 1725 | ||
1732 | if (netif_msg_tx_queued(tp)) | 1726 | netif_dbg(tp, tx_queued, dev, "Queued Tx packet size %u to slot %d\n", |
1733 | pr_debug("%s: Queued Tx packet size %u to slot %d.\n", | 1727 | len, entry); |
1734 | dev->name, len, entry); | ||
1735 | 1728 | ||
1736 | return NETDEV_TX_OK; | 1729 | return NETDEV_TX_OK; |
1737 | } | 1730 | } |
@@ -1760,9 +1753,8 @@ static void rtl8139_tx_interrupt (struct net_device *dev, | |||
1760 | /* Note: TxCarrierLost is always asserted at 100mbps. */ | 1753 | /* Note: TxCarrierLost is always asserted at 100mbps. */ |
1761 | if (txstatus & (TxOutOfWindow | TxAborted)) { | 1754 | if (txstatus & (TxOutOfWindow | TxAborted)) { |
1762 | /* There was an major error, log it. */ | 1755 | /* There was an major error, log it. */ |
1763 | if (netif_msg_tx_err(tp)) | 1756 | netif_dbg(tp, tx_err, dev, "Transmit error, Tx status %08x\n", |
1764 | pr_debug("%s: Transmit error, Tx status %8.8x.\n", | 1757 | txstatus); |
1765 | dev->name, txstatus); | ||
1766 | dev->stats.tx_errors++; | 1758 | dev->stats.tx_errors++; |
1767 | if (txstatus & TxAborted) { | 1759 | if (txstatus & TxAborted) { |
1768 | dev->stats.tx_aborted_errors++; | 1760 | dev->stats.tx_aborted_errors++; |
@@ -1792,8 +1784,8 @@ static void rtl8139_tx_interrupt (struct net_device *dev, | |||
1792 | 1784 | ||
1793 | #ifndef RTL8139_NDEBUG | 1785 | #ifndef RTL8139_NDEBUG |
1794 | if (tp->cur_tx - dirty_tx > NUM_TX_DESC) { | 1786 | if (tp->cur_tx - dirty_tx > NUM_TX_DESC) { |
1795 | pr_err("%s: Out-of-sync dirty pointer, %ld vs. %ld.\n", | 1787 | netdev_err(dev, "Out-of-sync dirty pointer, %ld vs. %ld\n", |
1796 | dev->name, dirty_tx, tp->cur_tx); | 1788 | dirty_tx, tp->cur_tx); |
1797 | dirty_tx += NUM_TX_DESC; | 1789 | dirty_tx += NUM_TX_DESC; |
1798 | } | 1790 | } |
1799 | #endif /* RTL8139_NDEBUG */ | 1791 | #endif /* RTL8139_NDEBUG */ |
@@ -1816,14 +1808,13 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1816 | int tmp_work; | 1808 | int tmp_work; |
1817 | #endif | 1809 | #endif |
1818 | 1810 | ||
1819 | if (netif_msg_rx_err (tp)) | 1811 | netif_dbg(tp, rx_err, dev, "Ethernet frame had errors, status %08x\n", |
1820 | pr_debug("%s: Ethernet frame had errors, status %8.8x.\n", | 1812 | rx_status); |
1821 | dev->name, rx_status); | ||
1822 | dev->stats.rx_errors++; | 1813 | dev->stats.rx_errors++; |
1823 | if (!(rx_status & RxStatusOK)) { | 1814 | if (!(rx_status & RxStatusOK)) { |
1824 | if (rx_status & RxTooLong) { | 1815 | if (rx_status & RxTooLong) { |
1825 | pr_debug("%s: Oversized Ethernet frame, status %4.4x!\n", | 1816 | netdev_dbg(dev, "Oversized Ethernet frame, status %04x!\n", |
1826 | dev->name, rx_status); | 1817 | rx_status); |
1827 | /* A.C.: The chip hangs here. */ | 1818 | /* A.C.: The chip hangs here. */ |
1828 | } | 1819 | } |
1829 | if (rx_status & (RxBadSymbol | RxBadAlign)) | 1820 | if (rx_status & (RxBadSymbol | RxBadAlign)) |
@@ -1855,7 +1846,7 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1855 | break; | 1846 | break; |
1856 | } | 1847 | } |
1857 | if (tmp_work <= 0) | 1848 | if (tmp_work <= 0) |
1858 | pr_warning(PFX "rx stop wait too long\n"); | 1849 | netdev_warn(dev, "rx stop wait too long\n"); |
1859 | /* restart receive */ | 1850 | /* restart receive */ |
1860 | tmp_work = 200; | 1851 | tmp_work = 200; |
1861 | while (--tmp_work > 0) { | 1852 | while (--tmp_work > 0) { |
@@ -1866,7 +1857,7 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1866 | break; | 1857 | break; |
1867 | } | 1858 | } |
1868 | if (tmp_work <= 0) | 1859 | if (tmp_work <= 0) |
1869 | pr_warning(PFX "tx/rx enable wait too long\n"); | 1860 | netdev_warn(dev, "tx/rx enable wait too long\n"); |
1870 | 1861 | ||
1871 | /* and reinitialize all rx related registers */ | 1862 | /* and reinitialize all rx related registers */ |
1872 | RTL_W8_F (Cfg9346, Cfg9346_Unlock); | 1863 | RTL_W8_F (Cfg9346, Cfg9346_Unlock); |
@@ -1877,7 +1868,7 @@ static void rtl8139_rx_err (u32 rx_status, struct net_device *dev, | |||
1877 | RTL_W32 (RxConfig, tp->rx_config); | 1868 | RTL_W32 (RxConfig, tp->rx_config); |
1878 | tp->cur_rx = 0; | 1869 | tp->cur_rx = 0; |
1879 | 1870 | ||
1880 | pr_debug("init buffer addresses\n"); | 1871 | netdev_dbg(dev, "init buffer addresses\n"); |
1881 | 1872 | ||
1882 | /* Lock Config[01234] and BMCR register writes */ | 1873 | /* Lock Config[01234] and BMCR register writes */ |
1883 | RTL_W8 (Cfg9346, Cfg9346_Lock); | 1874 | RTL_W8 (Cfg9346, Cfg9346_Lock); |
@@ -1931,10 +1922,9 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, | |||
1931 | unsigned int cur_rx = tp->cur_rx; | 1922 | unsigned int cur_rx = tp->cur_rx; |
1932 | unsigned int rx_size = 0; | 1923 | unsigned int rx_size = 0; |
1933 | 1924 | ||
1934 | pr_debug("%s: In rtl8139_rx(), current %4.4x BufAddr %4.4x," | 1925 | netdev_dbg(dev, "In %s(), current %04x BufAddr %04x, free to %04x, Cmd %02x\n", |
1935 | " free to %4.4x, Cmd %2.2x.\n", dev->name, (u16)cur_rx, | 1926 | __func__, (u16)cur_rx, |
1936 | RTL_R16 (RxBufAddr), | 1927 | RTL_R16(RxBufAddr), RTL_R16(RxBufPtr), RTL_R8(ChipCmd)); |
1937 | RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); | ||
1938 | 1928 | ||
1939 | while (netif_running(dev) && received < budget && | 1929 | while (netif_running(dev) && received < budget && |
1940 | (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { | 1930 | (RTL_R8 (ChipCmd) & RxBufEmpty) == 0) { |
@@ -1950,19 +1940,12 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, | |||
1950 | rx_size = rx_status >> 16; | 1940 | rx_size = rx_status >> 16; |
1951 | pkt_size = rx_size - 4; | 1941 | pkt_size = rx_size - 4; |
1952 | 1942 | ||
1953 | if (netif_msg_rx_status(tp)) | 1943 | netif_dbg(tp, rx_status, dev, "%s() status %04x, size %04x, cur %04x\n", |
1954 | pr_debug("%s: rtl8139_rx() status %4.4x, size %4.4x," | 1944 | __func__, rx_status, rx_size, cur_rx); |
1955 | " cur %4.4x.\n", dev->name, rx_status, | ||
1956 | rx_size, cur_rx); | ||
1957 | #if RTL8139_DEBUG > 2 | 1945 | #if RTL8139_DEBUG > 2 |
1958 | { | 1946 | print_dump_hex(KERN_DEBUG, "Frame contents: ", |
1959 | int i; | 1947 | DUMP_PREFIX_OFFSET, 16, 1, |
1960 | pr_debug("%s: Frame contents ", dev->name); | 1948 | &rx_ring[ring_offset], 70, true); |
1961 | for (i = 0; i < 70; i++) | ||
1962 | pr_cont(" %2.2x", | ||
1963 | rx_ring[ring_offset + i]); | ||
1964 | pr_cont(".\n"); | ||
1965 | } | ||
1966 | #endif | 1949 | #endif |
1967 | 1950 | ||
1968 | /* Packet copy from FIFO still in progress. | 1951 | /* Packet copy from FIFO still in progress. |
@@ -1973,14 +1956,11 @@ static int rtl8139_rx(struct net_device *dev, struct rtl8139_private *tp, | |||
1973 | if (!tp->fifo_copy_timeout) | 1956 | if (!tp->fifo_copy_timeout) |
1974 | tp->fifo_copy_timeout = jiffies + 2; | 1957 | tp->fifo_copy_timeout = jiffies + 2; |
1975 | else if (time_after(jiffies, tp->fifo_copy_timeout)) { | 1958 | else if (time_after(jiffies, tp->fifo_copy_timeout)) { |
1976 | pr_debug("%s: hung FIFO. Reset.", dev->name); | 1959 | netdev_dbg(dev, "hung FIFO. Reset\n"); |
1977 | rx_size = 0; | 1960 | rx_size = 0; |
1978 | goto no_early_rx; | 1961 | goto no_early_rx; |
1979 | } | 1962 | } |
1980 | if (netif_msg_intr(tp)) { | 1963 | netif_dbg(tp, intr, dev, "fifo copy in progress\n"); |
1981 | pr_debug("%s: fifo copy in progress.", | ||
1982 | dev->name); | ||
1983 | } | ||
1984 | tp->xstats.early_rx++; | 1964 | tp->xstats.early_rx++; |
1985 | break; | 1965 | break; |
1986 | } | 1966 | } |
@@ -2021,8 +2001,7 @@ no_early_rx: | |||
2021 | netif_receive_skb (skb); | 2001 | netif_receive_skb (skb); |
2022 | } else { | 2002 | } else { |
2023 | if (net_ratelimit()) | 2003 | if (net_ratelimit()) |
2024 | pr_warning("%s: Memory squeeze, dropping packet.\n", | 2004 | netdev_warn(dev, "Memory squeeze, dropping packet\n"); |
2025 | dev->name); | ||
2026 | dev->stats.rx_dropped++; | 2005 | dev->stats.rx_dropped++; |
2027 | } | 2006 | } |
2028 | received++; | 2007 | received++; |
@@ -2036,10 +2015,9 @@ no_early_rx: | |||
2036 | if (unlikely(!received || rx_size == 0xfff0)) | 2015 | if (unlikely(!received || rx_size == 0xfff0)) |
2037 | rtl8139_isr_ack(tp); | 2016 | rtl8139_isr_ack(tp); |
2038 | 2017 | ||
2039 | pr_debug("%s: Done rtl8139_rx(), current %4.4x BufAddr %4.4x," | 2018 | netdev_dbg(dev, "Done %s(), current %04x BufAddr %04x, free to %04x, Cmd %02x\n", |
2040 | " free to %4.4x, Cmd %2.2x.\n", dev->name, cur_rx, | 2019 | __func__, cur_rx, |
2041 | RTL_R16 (RxBufAddr), | 2020 | RTL_R16(RxBufAddr), RTL_R16(RxBufPtr), RTL_R8(ChipCmd)); |
2042 | RTL_R16 (RxBufPtr), RTL_R8 (ChipCmd)); | ||
2043 | 2021 | ||
2044 | tp->cur_rx = cur_rx; | 2022 | tp->cur_rx = cur_rx; |
2045 | 2023 | ||
@@ -2060,8 +2038,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev, | |||
2060 | void __iomem *ioaddr, | 2038 | void __iomem *ioaddr, |
2061 | int status, int link_changed) | 2039 | int status, int link_changed) |
2062 | { | 2040 | { |
2063 | pr_debug("%s: Abnormal interrupt, status %8.8x.\n", | 2041 | netdev_dbg(dev, "Abnormal interrupt, status %08x\n", status); |
2064 | dev->name, status); | ||
2065 | 2042 | ||
2066 | assert (dev != NULL); | 2043 | assert (dev != NULL); |
2067 | assert (tp != NULL); | 2044 | assert (tp != NULL); |
@@ -2089,8 +2066,7 @@ static void rtl8139_weird_interrupt (struct net_device *dev, | |||
2089 | pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status); | 2066 | pci_read_config_word (tp->pci_dev, PCI_STATUS, &pci_cmd_status); |
2090 | pci_write_config_word (tp->pci_dev, PCI_STATUS, pci_cmd_status); | 2067 | pci_write_config_word (tp->pci_dev, PCI_STATUS, pci_cmd_status); |
2091 | 2068 | ||
2092 | pr_err("%s: PCI Bus error %4.4x.\n", | 2069 | netdev_err(dev, "PCI Bus error %04x\n", pci_cmd_status); |
2093 | dev->name, pci_cmd_status); | ||
2094 | } | 2070 | } |
2095 | } | 2071 | } |
2096 | 2072 | ||
@@ -2183,8 +2159,8 @@ static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance) | |||
2183 | out: | 2159 | out: |
2184 | spin_unlock (&tp->lock); | 2160 | spin_unlock (&tp->lock); |
2185 | 2161 | ||
2186 | pr_debug("%s: exiting interrupt, intr_status=%#4.4x.\n", | 2162 | netdev_dbg(dev, "exiting interrupt, intr_status=%#4.4x\n", |
2187 | dev->name, RTL_R16 (IntrStatus)); | 2163 | RTL_R16(IntrStatus)); |
2188 | return IRQ_RETVAL(handled); | 2164 | return IRQ_RETVAL(handled); |
2189 | } | 2165 | } |
2190 | 2166 | ||
@@ -2233,9 +2209,8 @@ static int rtl8139_close (struct net_device *dev) | |||
2233 | netif_stop_queue(dev); | 2209 | netif_stop_queue(dev); |
2234 | napi_disable(&tp->napi); | 2210 | napi_disable(&tp->napi); |
2235 | 2211 | ||
2236 | if (netif_msg_ifdown(tp)) | 2212 | netif_dbg(tp, ifdown, dev, "Shutting down ethercard, status was 0x%04x\n", |
2237 | pr_debug("%s: Shutting down ethercard, status was 0x%4.4x.\n", | 2213 | RTL_R16(IntrStatus)); |
2238 | dev->name, RTL_R16 (IntrStatus)); | ||
2239 | 2214 | ||
2240 | spin_lock_irqsave (&tp->lock, flags); | 2215 | spin_lock_irqsave (&tp->lock, flags); |
2241 | 2216 | ||
@@ -2512,8 +2487,8 @@ static void __set_rx_mode (struct net_device *dev) | |||
2512 | int rx_mode; | 2487 | int rx_mode; |
2513 | u32 tmp; | 2488 | u32 tmp; |
2514 | 2489 | ||
2515 | pr_debug("%s: rtl8139_set_rx_mode(%4.4x) done -- Rx config %8.8lx.\n", | 2490 | netdev_dbg(dev, "rtl8139_set_rx_mode(%04x) done -- Rx config %08lx\n", |
2516 | dev->name, dev->flags, RTL_R32 (RxConfig)); | 2491 | dev->flags, RTL_R32(RxConfig)); |
2517 | 2492 | ||
2518 | /* Note: do not reorder, GCC is clever about common statements. */ | 2493 | /* Note: do not reorder, GCC is clever about common statements. */ |
2519 | if (dev->flags & IFF_PROMISC) { | 2494 | if (dev->flags & IFF_PROMISC) { |