diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2012-01-07 16:39:37 -0500 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2012-01-07 17:02:38 -0500 |
commit | fc3e0f8aec05dd812cba2c1e31c3d1f5fc85e55c (patch) | |
tree | 080fdb2ce9efb232296727d1c84e9cc3eb2ed3f1 /drivers/net/ethernet/via | |
parent | a384a33bb1c9ec2d99db2046b41f57023fa7d77b (diff) |
via-rhine: per device debug level.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/ethernet/via')
-rw-r--r-- | drivers/net/ethernet/via/via-rhine.c | 169 |
1 files changed, 79 insertions, 90 deletions
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index 98ec14ebfef3..e39802f37b21 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
@@ -39,9 +39,9 @@ | |||
39 | 39 | ||
40 | /* A few user-configurable values. | 40 | /* A few user-configurable values. |
41 | These may be modified when a driver module is loaded. */ | 41 | These may be modified when a driver module is loaded. */ |
42 | 42 | static int debug = 0; | |
43 | #define DEBUG | 43 | #define RHINE_MSG_DEFAULT \ |
44 | static int debug = 1; /* 1 normal messages, 0 quiet .. 7 verbose. */ | 44 | (0x0000) |
45 | 45 | ||
46 | /* Set the copy breakpoint for the copy-only-tiny-frames scheme. | 46 | /* Set the copy breakpoint for the copy-only-tiny-frames scheme. |
47 | Setting to > 1518 effectively disables this feature. */ | 47 | Setting to > 1518 effectively disables this feature. */ |
@@ -130,7 +130,7 @@ MODULE_LICENSE("GPL"); | |||
130 | module_param(debug, int, 0); | 130 | module_param(debug, int, 0); |
131 | module_param(rx_copybreak, int, 0); | 131 | module_param(rx_copybreak, int, 0); |
132 | module_param(avoid_D3, bool, 0); | 132 | module_param(avoid_D3, bool, 0); |
133 | MODULE_PARM_DESC(debug, "VIA Rhine debug level (0-7)"); | 133 | MODULE_PARM_DESC(debug, "VIA Rhine debug message flags"); |
134 | MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames"); | 134 | MODULE_PARM_DESC(rx_copybreak, "VIA Rhine copy breakpoint for copy-only-tiny-frames"); |
135 | MODULE_PARM_DESC(avoid_D3, "Avoid power state D3 (work-around for broken BIOSes)"); | 135 | MODULE_PARM_DESC(avoid_D3, "Avoid power state D3 (work-around for broken BIOSes)"); |
136 | 136 | ||
@@ -450,6 +450,8 @@ struct rhine_private { | |||
450 | struct work_struct slow_event_task; | 450 | struct work_struct slow_event_task; |
451 | struct work_struct reset_task; | 451 | struct work_struct reset_task; |
452 | 452 | ||
453 | u32 msg_enable; | ||
454 | |||
453 | /* Frequently used values: keep some adjacent for cache effect. */ | 455 | /* Frequently used values: keep some adjacent for cache effect. */ |
454 | u32 quirks; | 456 | u32 quirks; |
455 | struct rx_desc *rx_head_desc; | 457 | struct rx_desc *rx_head_desc; |
@@ -512,8 +514,8 @@ static void rhine_wait_bit(struct rhine_private *rp, u8 reg, u8 mask, bool high) | |||
512 | udelay(10); | 514 | udelay(10); |
513 | } | 515 | } |
514 | if (i > 64) { | 516 | if (i > 64) { |
515 | netdev_dbg(rp->dev, "%s bit wait (%02x/%02x) cycle " | 517 | netif_dbg(rp, hw, rp->dev, "%s bit wait (%02x/%02x) cycle " |
516 | "count: %04d\n", high ? "high" : "low", reg, mask, i); | 518 | "count: %04d\n", high ? "high" : "low", reg, mask, i); |
517 | } | 519 | } |
518 | } | 520 | } |
519 | 521 | ||
@@ -613,6 +615,7 @@ static void rhine_chip_reset(struct net_device *dev) | |||
613 | { | 615 | { |
614 | struct rhine_private *rp = netdev_priv(dev); | 616 | struct rhine_private *rp = netdev_priv(dev); |
615 | void __iomem *ioaddr = rp->base; | 617 | void __iomem *ioaddr = rp->base; |
618 | u8 cmd1; | ||
616 | 619 | ||
617 | iowrite8(Cmd1Reset, ioaddr + ChipCmd1); | 620 | iowrite8(Cmd1Reset, ioaddr + ChipCmd1); |
618 | IOSYNC; | 621 | IOSYNC; |
@@ -628,10 +631,9 @@ static void rhine_chip_reset(struct net_device *dev) | |||
628 | rhine_wait_bit_low(rp, ChipCmd1, Cmd1Reset); | 631 | rhine_wait_bit_low(rp, ChipCmd1, Cmd1Reset); |
629 | } | 632 | } |
630 | 633 | ||
631 | if (debug > 1) | 634 | cmd1 = ioread8(ioaddr + ChipCmd1); |
632 | netdev_info(dev, "Reset %s\n", | 635 | netif_info(rp, hw, dev, "Reset %s\n", (cmd1 & Cmd1Reset) ? |
633 | (ioread8(ioaddr + ChipCmd1) & Cmd1Reset) ? | 636 | "failed" : "succeeded"); |
634 | "failed" : "succeeded"); | ||
635 | } | 637 | } |
636 | 638 | ||
637 | #ifdef USE_MMIO | 639 | #ifdef USE_MMIO |
@@ -706,28 +708,24 @@ static void rhine_tx_err(struct rhine_private *rp, u32 status) | |||
706 | struct net_device *dev = rp->dev; | 708 | struct net_device *dev = rp->dev; |
707 | 709 | ||
708 | if (status & IntrTxAborted) { | 710 | if (status & IntrTxAborted) { |
709 | if (debug > 1) | 711 | netif_info(rp, tx_err, dev, |
710 | netdev_info(dev, "Abort %08x, frame dropped\n", status); | 712 | "Abort %08x, frame dropped\n", status); |
711 | } | 713 | } |
712 | 714 | ||
713 | if (status & IntrTxUnderrun) { | 715 | if (status & IntrTxUnderrun) { |
714 | rhine_kick_tx_threshold(rp); | 716 | rhine_kick_tx_threshold(rp); |
715 | if (debug > 1) | 717 | netif_info(rp, tx_err ,dev, "Transmitter underrun, " |
716 | netdev_info(dev, "Transmitter underrun, Tx threshold now %02x\n", | 718 | "Tx threshold now %02x\n", rp->tx_thresh); |
717 | rp->tx_thresh); | ||
718 | } | 719 | } |
719 | 720 | ||
720 | if (status & IntrTxDescRace) { | 721 | if (status & IntrTxDescRace) |
721 | if (debug > 2) | 722 | netif_info(rp, tx_err, dev, "Tx descriptor write-back race\n"); |
722 | netdev_info(dev, "Tx descriptor write-back race\n"); | ||
723 | } | ||
724 | 723 | ||
725 | if ((status & IntrTxError) && | 724 | if ((status & IntrTxError) && |
726 | (status & (IntrTxAborted | IntrTxUnderrun | IntrTxDescRace)) == 0) { | 725 | (status & (IntrTxAborted | IntrTxUnderrun | IntrTxDescRace)) == 0) { |
727 | rhine_kick_tx_threshold(rp); | 726 | rhine_kick_tx_threshold(rp); |
728 | if (debug > 1) | 727 | netif_info(rp, tx_err, dev, "Unspecified error. " |
729 | netdev_info(dev, "Unspecified error. Tx threshold now %02x\n", | 728 | "Tx threshold now %02x\n", rp->tx_thresh); |
730 | rp->tx_thresh); | ||
731 | } | 729 | } |
732 | 730 | ||
733 | rhine_restart_tx(dev); | 731 | rhine_restart_tx(dev); |
@@ -789,16 +787,12 @@ static int rhine_napipoll(struct napi_struct *napi, int budget) | |||
789 | 787 | ||
790 | if (status & RHINE_EVENT_NAPI_TX) { | 788 | if (status & RHINE_EVENT_NAPI_TX) { |
791 | if (status & RHINE_EVENT_NAPI_TX_ERR) { | 789 | if (status & RHINE_EVENT_NAPI_TX_ERR) { |
792 | u8 cmd; | ||
793 | |||
794 | /* Avoid scavenging before Tx engine turned off */ | 790 | /* Avoid scavenging before Tx engine turned off */ |
795 | rhine_wait_bit_low(rp, ChipCmd, CmdTxOn); | 791 | rhine_wait_bit_low(rp, ChipCmd, CmdTxOn); |
796 | cmd = ioread8(ioaddr + ChipCmd); | 792 | if (ioread8(ioaddr + ChipCmd) & CmdTxOn) |
797 | if ((cmd & CmdTxOn) && (debug > 2)) { | 793 | netif_warn(rp, tx_err, dev, "Tx still on\n"); |
798 | netdev_warn(dev, "%s: Tx engine still on\n", | ||
799 | __func__); | ||
800 | } | ||
801 | } | 794 | } |
795 | |||
802 | rhine_tx(dev); | 796 | rhine_tx(dev); |
803 | 797 | ||
804 | if (status & RHINE_EVENT_NAPI_TX_ERR) | 798 | if (status & RHINE_EVENT_NAPI_TX_ERR) |
@@ -943,6 +937,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, | |||
943 | rp->quirks = quirks; | 937 | rp->quirks = quirks; |
944 | rp->pioaddr = pioaddr; | 938 | rp->pioaddr = pioaddr; |
945 | rp->pdev = pdev; | 939 | rp->pdev = pdev; |
940 | rp->msg_enable = netif_msg_init(debug, RHINE_MSG_DEFAULT); | ||
946 | 941 | ||
947 | rc = pci_request_regions(pdev, DRV_NAME); | 942 | rc = pci_request_regions(pdev, DRV_NAME); |
948 | if (rc) | 943 | if (rc) |
@@ -1064,8 +1059,8 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, | |||
1064 | } | 1059 | } |
1065 | } | 1060 | } |
1066 | rp->mii_if.phy_id = phy_id; | 1061 | rp->mii_if.phy_id = phy_id; |
1067 | if (debug > 1 && avoid_D3) | 1062 | if (avoid_D3) |
1068 | netdev_info(dev, "No D3 power state at shutdown\n"); | 1063 | netif_info(rp, probe, dev, "No D3 power state at shutdown\n"); |
1069 | 1064 | ||
1070 | return 0; | 1065 | return 0; |
1071 | 1066 | ||
@@ -1241,7 +1236,7 @@ static void rhine_check_media(struct net_device *dev, unsigned int init_media) | |||
1241 | struct rhine_private *rp = netdev_priv(dev); | 1236 | struct rhine_private *rp = netdev_priv(dev); |
1242 | void __iomem *ioaddr = rp->base; | 1237 | void __iomem *ioaddr = rp->base; |
1243 | 1238 | ||
1244 | mii_check_media(&rp->mii_if, debug, init_media); | 1239 | mii_check_media(&rp->mii_if, netif_msg_link(rp), init_media); |
1245 | 1240 | ||
1246 | if (rp->mii_if.full_duplex) | 1241 | if (rp->mii_if.full_duplex) |
1247 | iowrite8(ioread8(ioaddr + ChipCmd1) | Cmd1FDuplex, | 1242 | iowrite8(ioread8(ioaddr + ChipCmd1) | Cmd1FDuplex, |
@@ -1249,24 +1244,26 @@ static void rhine_check_media(struct net_device *dev, unsigned int init_media) | |||
1249 | else | 1244 | else |
1250 | iowrite8(ioread8(ioaddr + ChipCmd1) & ~Cmd1FDuplex, | 1245 | iowrite8(ioread8(ioaddr + ChipCmd1) & ~Cmd1FDuplex, |
1251 | ioaddr + ChipCmd1); | 1246 | ioaddr + ChipCmd1); |
1252 | if (debug > 1) | 1247 | |
1253 | netdev_info(dev, "force_media %d, carrier %d\n", | 1248 | netif_info(rp, link, dev, "force_media %d, carrier %d\n", |
1254 | rp->mii_if.force_media, netif_carrier_ok(dev)); | 1249 | rp->mii_if.force_media, netif_carrier_ok(dev)); |
1255 | } | 1250 | } |
1256 | 1251 | ||
1257 | /* Called after status of force_media possibly changed */ | 1252 | /* Called after status of force_media possibly changed */ |
1258 | static void rhine_set_carrier(struct mii_if_info *mii) | 1253 | static void rhine_set_carrier(struct mii_if_info *mii) |
1259 | { | 1254 | { |
1255 | struct net_device *dev = mii->dev; | ||
1256 | struct rhine_private *rp = netdev_priv(dev); | ||
1257 | |||
1260 | if (mii->force_media) { | 1258 | if (mii->force_media) { |
1261 | /* autoneg is off: Link is always assumed to be up */ | 1259 | /* autoneg is off: Link is always assumed to be up */ |
1262 | if (!netif_carrier_ok(mii->dev)) | 1260 | if (!netif_carrier_ok(dev)) |
1263 | netif_carrier_on(mii->dev); | 1261 | netif_carrier_on(dev); |
1264 | } | 1262 | } else /* Let MMI library update carrier status */ |
1265 | else /* Let MMI library update carrier status */ | 1263 | rhine_check_media(dev, 0); |
1266 | rhine_check_media(mii->dev, 0); | 1264 | |
1267 | if (debug > 1) | 1265 | netif_info(rp, link, dev, "force_media %d, carrier %d\n", |
1268 | netdev_info(mii->dev, "force_media %d, carrier %d\n", | 1266 | mii->force_media, netif_carrier_ok(dev)); |
1269 | mii->force_media, netif_carrier_ok(mii->dev)); | ||
1270 | } | 1267 | } |
1271 | 1268 | ||
1272 | /** | 1269 | /** |
@@ -1570,8 +1567,7 @@ static int rhine_open(struct net_device *dev) | |||
1570 | if (rc) | 1567 | if (rc) |
1571 | return rc; | 1568 | return rc; |
1572 | 1569 | ||
1573 | if (debug > 1) | 1570 | netif_dbg(rp, ifup, dev, "%s() irq %d\n", __func__, rp->pdev->irq); |
1574 | netdev_dbg(dev, "%s() irq %d\n", __func__, rp->pdev->irq); | ||
1575 | 1571 | ||
1576 | rc = alloc_ring(dev); | 1572 | rc = alloc_ring(dev); |
1577 | if (rc) { | 1573 | if (rc) { |
@@ -1583,10 +1579,10 @@ static int rhine_open(struct net_device *dev) | |||
1583 | rhine_chip_reset(dev); | 1579 | rhine_chip_reset(dev); |
1584 | rhine_task_enable(rp); | 1580 | rhine_task_enable(rp); |
1585 | init_registers(dev); | 1581 | init_registers(dev); |
1586 | if (debug > 2) | 1582 | |
1587 | netdev_dbg(dev, "%s() Done - status %04x MII status: %04x\n", | 1583 | netif_dbg(rp, ifup, dev, "%s() Done - status %04x MII status: %04x\n", |
1588 | __func__, ioread16(ioaddr + ChipCmd), | 1584 | __func__, ioread16(ioaddr + ChipCmd), |
1589 | mdio_read(dev, rp->mii_if.phy_id, MII_BMSR)); | 1585 | mdio_read(dev, rp->mii_if.phy_id, MII_BMSR)); |
1590 | 1586 | ||
1591 | netif_start_queue(dev); | 1587 | netif_start_queue(dev); |
1592 | 1588 | ||
@@ -1716,10 +1712,9 @@ static netdev_tx_t rhine_start_tx(struct sk_buff *skb, | |||
1716 | if (rp->cur_tx == rp->dirty_tx + TX_QUEUE_LEN) | 1712 | if (rp->cur_tx == rp->dirty_tx + TX_QUEUE_LEN) |
1717 | netif_stop_queue(dev); | 1713 | netif_stop_queue(dev); |
1718 | 1714 | ||
1719 | if (debug > 4) { | 1715 | netif_dbg(rp, tx_queued, dev, "Transmit frame #%d queued in slot %d\n", |
1720 | netdev_dbg(dev, "Transmit frame #%d queued in slot %d\n", | 1716 | rp->cur_tx - 1, entry); |
1721 | rp->cur_tx-1, entry); | 1717 | |
1722 | } | ||
1723 | return NETDEV_TX_OK; | 1718 | return NETDEV_TX_OK; |
1724 | } | 1719 | } |
1725 | 1720 | ||
@@ -1740,8 +1735,7 @@ static irqreturn_t rhine_interrupt(int irq, void *dev_instance) | |||
1740 | 1735 | ||
1741 | status = rhine_get_events(rp); | 1736 | status = rhine_get_events(rp); |
1742 | 1737 | ||
1743 | if (debug > 4) | 1738 | netif_dbg(rp, intr, dev, "Interrupt, status %08x\n", status); |
1744 | netdev_dbg(dev, "Interrupt, status %08x\n", status); | ||
1745 | 1739 | ||
1746 | if (status & RHINE_EVENT) { | 1740 | if (status & RHINE_EVENT) { |
1747 | handled = 1; | 1741 | handled = 1; |
@@ -1751,9 +1745,8 @@ static irqreturn_t rhine_interrupt(int irq, void *dev_instance) | |||
1751 | } | 1745 | } |
1752 | 1746 | ||
1753 | if (status & ~(IntrLinkChange | IntrStatsMax | RHINE_EVENT_NAPI)) { | 1747 | if (status & ~(IntrLinkChange | IntrStatsMax | RHINE_EVENT_NAPI)) { |
1754 | if (debug > 1) | 1748 | netif_err(rp, intr, dev, "Something Wicked happened! %08x\n", |
1755 | netdev_err(dev, "Something Wicked happened! %08x\n", | 1749 | status); |
1756 | status); | ||
1757 | } | 1750 | } |
1758 | 1751 | ||
1759 | return IRQ_RETVAL(handled); | 1752 | return IRQ_RETVAL(handled); |
@@ -1769,15 +1762,13 @@ static void rhine_tx(struct net_device *dev) | |||
1769 | /* find and cleanup dirty tx descriptors */ | 1762 | /* find and cleanup dirty tx descriptors */ |
1770 | while (rp->dirty_tx != rp->cur_tx) { | 1763 | while (rp->dirty_tx != rp->cur_tx) { |
1771 | txstatus = le32_to_cpu(rp->tx_ring[entry].tx_status); | 1764 | txstatus = le32_to_cpu(rp->tx_ring[entry].tx_status); |
1772 | if (debug > 6) | 1765 | netif_dbg(rp, tx_done, dev, "Tx scavenge %d status %08x\n", |
1773 | netdev_dbg(dev, "Tx scavenge %d status %08x\n", | 1766 | entry, txstatus); |
1774 | entry, txstatus); | ||
1775 | if (txstatus & DescOwn) | 1767 | if (txstatus & DescOwn) |
1776 | break; | 1768 | break; |
1777 | if (txstatus & 0x8000) { | 1769 | if (txstatus & 0x8000) { |
1778 | if (debug > 1) | 1770 | netif_dbg(rp, tx_done, dev, |
1779 | netdev_dbg(dev, "Transmit error, Tx status %08x\n", | 1771 | "Transmit error, Tx status %08x\n", txstatus); |
1780 | txstatus); | ||
1781 | dev->stats.tx_errors++; | 1772 | dev->stats.tx_errors++; |
1782 | if (txstatus & 0x0400) | 1773 | if (txstatus & 0x0400) |
1783 | dev->stats.tx_carrier_errors++; | 1774 | dev->stats.tx_carrier_errors++; |
@@ -1799,10 +1790,8 @@ static void rhine_tx(struct net_device *dev) | |||
1799 | dev->stats.collisions += (txstatus >> 3) & 0x0F; | 1790 | dev->stats.collisions += (txstatus >> 3) & 0x0F; |
1800 | else | 1791 | else |
1801 | dev->stats.collisions += txstatus & 0x0F; | 1792 | dev->stats.collisions += txstatus & 0x0F; |
1802 | if (debug > 6) | 1793 | netif_dbg(rp, tx_done, dev, "collisions: %1.1x:%1.1x\n", |
1803 | netdev_dbg(dev, "collisions: %1.1x:%1.1x\n", | 1794 | (txstatus >> 3) & 0xF, txstatus & 0xF); |
1804 | (txstatus >> 3) & 0xF, | ||
1805 | txstatus & 0xF); | ||
1806 | dev->stats.tx_bytes += rp->tx_skbuff[entry]->len; | 1795 | dev->stats.tx_bytes += rp->tx_skbuff[entry]->len; |
1807 | dev->stats.tx_packets++; | 1796 | dev->stats.tx_packets++; |
1808 | } | 1797 | } |
@@ -1843,11 +1832,8 @@ static int rhine_rx(struct net_device *dev, int limit) | |||
1843 | int count; | 1832 | int count; |
1844 | int entry = rp->cur_rx % RX_RING_SIZE; | 1833 | int entry = rp->cur_rx % RX_RING_SIZE; |
1845 | 1834 | ||
1846 | if (debug > 4) { | 1835 | netif_dbg(rp, rx_status, dev, "%s(), entry %d status %08x\n", __func__, |
1847 | netdev_dbg(dev, "%s(), entry %d status %08x\n", | 1836 | entry, le32_to_cpu(rp->rx_head_desc->rx_status)); |
1848 | __func__, entry, | ||
1849 | le32_to_cpu(rp->rx_head_desc->rx_status)); | ||
1850 | } | ||
1851 | 1837 | ||
1852 | /* If EOP is set on the next entry, it's a new packet. Send it up. */ | 1838 | /* If EOP is set on the next entry, it's a new packet. Send it up. */ |
1853 | for (count = 0; count < limit; ++count) { | 1839 | for (count = 0; count < limit; ++count) { |
@@ -1859,9 +1845,8 @@ static int rhine_rx(struct net_device *dev, int limit) | |||
1859 | if (desc_status & DescOwn) | 1845 | if (desc_status & DescOwn) |
1860 | break; | 1846 | break; |
1861 | 1847 | ||
1862 | if (debug > 4) | 1848 | netif_dbg(rp, rx_status, dev, "%s() status %08x\n", __func__, |
1863 | netdev_dbg(dev, "%s() status is %08x\n", | 1849 | desc_status); |
1864 | __func__, desc_status); | ||
1865 | 1850 | ||
1866 | if ((desc_status & (RxWholePkt | RxErr)) != RxWholePkt) { | 1851 | if ((desc_status & (RxWholePkt | RxErr)) != RxWholePkt) { |
1867 | if ((desc_status & RxWholePkt) != RxWholePkt) { | 1852 | if ((desc_status & RxWholePkt) != RxWholePkt) { |
@@ -1877,9 +1862,9 @@ static int rhine_rx(struct net_device *dev, int limit) | |||
1877 | dev->stats.rx_length_errors++; | 1862 | dev->stats.rx_length_errors++; |
1878 | } else if (desc_status & RxErr) { | 1863 | } else if (desc_status & RxErr) { |
1879 | /* There was a error. */ | 1864 | /* There was a error. */ |
1880 | if (debug > 2) | 1865 | netif_dbg(rp, rx_err, dev, |
1881 | netdev_dbg(dev, "%s() Rx error was %08x\n", | 1866 | "%s() Rx error %08x\n", __func__, |
1882 | __func__, desc_status); | 1867 | desc_status); |
1883 | dev->stats.rx_errors++; | 1868 | dev->stats.rx_errors++; |
1884 | if (desc_status & 0x0030) | 1869 | if (desc_status & 0x0030) |
1885 | dev->stats.rx_length_errors++; | 1870 | dev->stats.rx_length_errors++; |
@@ -2000,9 +1985,8 @@ static void rhine_restart_tx(struct net_device *dev) { | |||
2000 | } | 1985 | } |
2001 | else { | 1986 | else { |
2002 | /* This should never happen */ | 1987 | /* This should never happen */ |
2003 | if (debug > 1) | 1988 | netif_warn(rp, tx_err, dev, "another error occurred %08x\n", |
2004 | netdev_warn(dev, "%s() Another error occurred %08x\n", | 1989 | intr_status); |
2005 | __func__, intr_status); | ||
2006 | } | 1990 | } |
2007 | 1991 | ||
2008 | } | 1992 | } |
@@ -2025,6 +2009,9 @@ static void rhine_slow_event_task(struct work_struct *work) | |||
2025 | if (intr_status & IntrLinkChange) | 2009 | if (intr_status & IntrLinkChange) |
2026 | rhine_check_media(dev, 0); | 2010 | rhine_check_media(dev, 0); |
2027 | 2011 | ||
2012 | if (intr_status & IntrPCIErr) | ||
2013 | netif_warn(rp, hw, dev, "PCI error\n"); | ||
2014 | |||
2028 | napi_disable(&rp->napi); | 2015 | napi_disable(&rp->napi); |
2029 | rhine_irq_disable(rp); | 2016 | rhine_irq_disable(rp); |
2030 | /* Slow and safe. Consider __napi_schedule as a replacement ? */ | 2017 | /* Slow and safe. Consider __napi_schedule as a replacement ? */ |
@@ -2144,12 +2131,16 @@ static u32 netdev_get_link(struct net_device *dev) | |||
2144 | 2131 | ||
2145 | static u32 netdev_get_msglevel(struct net_device *dev) | 2132 | static u32 netdev_get_msglevel(struct net_device *dev) |
2146 | { | 2133 | { |
2147 | return debug; | 2134 | struct rhine_private *rp = netdev_priv(dev); |
2135 | |||
2136 | return rp->msg_enable; | ||
2148 | } | 2137 | } |
2149 | 2138 | ||
2150 | static void netdev_set_msglevel(struct net_device *dev, u32 value) | 2139 | static void netdev_set_msglevel(struct net_device *dev, u32 value) |
2151 | { | 2140 | { |
2152 | debug = value; | 2141 | struct rhine_private *rp = netdev_priv(dev); |
2142 | |||
2143 | rp->msg_enable = value; | ||
2153 | } | 2144 | } |
2154 | 2145 | ||
2155 | static void rhine_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 2146 | static void rhine_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
@@ -2222,9 +2213,8 @@ static int rhine_close(struct net_device *dev) | |||
2222 | napi_disable(&rp->napi); | 2213 | napi_disable(&rp->napi); |
2223 | netif_stop_queue(dev); | 2214 | netif_stop_queue(dev); |
2224 | 2215 | ||
2225 | if (debug > 1) | 2216 | netif_dbg(rp, ifdown, dev, "Shutting down ethercard, status was %04x\n", |
2226 | netdev_dbg(dev, "Shutting down ethercard, status was %04x\n", | 2217 | ioread16(ioaddr + ChipCmd)); |
2227 | ioread16(ioaddr + ChipCmd)); | ||
2228 | 2218 | ||
2229 | /* Switch to loopback mode to avoid hardware races. */ | 2219 | /* Switch to loopback mode to avoid hardware races. */ |
2230 | iowrite8(rp->tx_thresh | 0x02, ioaddr + TxConfig); | 2220 | iowrite8(rp->tx_thresh | 0x02, ioaddr + TxConfig); |
@@ -2340,9 +2330,8 @@ static int rhine_resume(struct pci_dev *pdev) | |||
2340 | return 0; | 2330 | return 0; |
2341 | 2331 | ||
2342 | ret = pci_set_power_state(pdev, PCI_D0); | 2332 | ret = pci_set_power_state(pdev, PCI_D0); |
2343 | if (debug > 1) | 2333 | netif_info(rp, drv, dev, "Entering power state D0 %s (%d)\n", |
2344 | netdev_info(dev, "Entering power state D0 %s (%d)\n", | 2334 | ret ? "failed" : "succeeded", ret); |
2345 | ret ? "failed" : "succeeded", ret); | ||
2346 | 2335 | ||
2347 | pci_restore_state(pdev); | 2336 | pci_restore_state(pdev); |
2348 | 2337 | ||