diff options
author | Joe Perches <joe@perches.com> | 2010-02-15 03:34:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-16 18:45:42 -0500 |
commit | 6c35abaedc191e2c7c8fa40a2b4c2b01d553b768 (patch) | |
tree | 84d8cd747c02df07e267b8cf63cc77348d10b3e3 /drivers | |
parent | 6909c66dfbbab99dbbd9931627c9f6e8c45bfbdb (diff) |
drivers/net/sky2: Convert to use netif_printk macros
Some unlikely(netif_msg_<foo>(sky2)) tests are also
removed by this change.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/sky2.c | 65 |
1 files changed, 27 insertions, 38 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index dfff8e56a51e..a1198f141996 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -1613,8 +1613,7 @@ static int sky2_up(struct net_device *dev) | |||
1613 | sky2_write32(hw, B0_IMSK, imask); | 1613 | sky2_write32(hw, B0_IMSK, imask); |
1614 | sky2_read32(hw, B0_IMSK); | 1614 | sky2_read32(hw, B0_IMSK); |
1615 | 1615 | ||
1616 | if (netif_msg_ifup(sky2)) | 1616 | netif_info(sky2, ifup, dev, "enabling interface\n"); |
1617 | printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); | ||
1618 | 1617 | ||
1619 | return 0; | 1618 | return 0; |
1620 | 1619 | ||
@@ -1697,9 +1696,8 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb, | |||
1697 | goto mapping_error; | 1696 | goto mapping_error; |
1698 | 1697 | ||
1699 | slot = sky2->tx_prod; | 1698 | slot = sky2->tx_prod; |
1700 | if (unlikely(netif_msg_tx_queued(sky2))) | 1699 | netif_printk(sky2, tx_queued, KERN_DEBUG, dev, |
1701 | printk(KERN_DEBUG "%s: tx queued, slot %u, len %d\n", | 1700 | "tx queued, slot %u, len %d\n", slot, skb->len); |
1702 | dev->name, slot, skb->len); | ||
1703 | 1701 | ||
1704 | /* Send high bits if needed */ | 1702 | /* Send high bits if needed */ |
1705 | upper = upper_32_bits(mapping); | 1703 | upper = upper_32_bits(mapping); |
@@ -1864,9 +1862,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) | |||
1864 | sky2_tx_unmap(sky2->hw->pdev, re); | 1862 | sky2_tx_unmap(sky2->hw->pdev, re); |
1865 | 1863 | ||
1866 | if (skb) { | 1864 | if (skb) { |
1867 | if (unlikely(netif_msg_tx_done(sky2))) | 1865 | netif_printk(sky2, tx_done, KERN_DEBUG, dev, |
1868 | printk(KERN_DEBUG "%s: tx done %u\n", | 1866 | "tx done %u\n", idx); |
1869 | dev->name, idx); | ||
1870 | 1867 | ||
1871 | dev->stats.tx_packets++; | 1868 | dev->stats.tx_packets++; |
1872 | dev->stats.tx_bytes += skb->len; | 1869 | dev->stats.tx_bytes += skb->len; |
@@ -1961,8 +1958,7 @@ static int sky2_down(struct net_device *dev) | |||
1961 | if (!sky2->tx_le) | 1958 | if (!sky2->tx_le) |
1962 | return 0; | 1959 | return 0; |
1963 | 1960 | ||
1964 | if (netif_msg_ifdown(sky2)) | 1961 | netif_info(sky2, ifdown, dev, "disabling interface\n"); |
1965 | printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); | ||
1966 | 1962 | ||
1967 | /* Disable port IRQ */ | 1963 | /* Disable port IRQ */ |
1968 | sky2_write32(hw, B0_IMSK, | 1964 | sky2_write32(hw, B0_IMSK, |
@@ -2028,12 +2024,11 @@ static void sky2_link_up(struct sky2_port *sky2) | |||
2028 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), | 2024 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), |
2029 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); | 2025 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); |
2030 | 2026 | ||
2031 | if (netif_msg_link(sky2)) | 2027 | netif_info(sky2, link, sky2->netdev, |
2032 | printk(KERN_INFO PFX | 2028 | "Link is up at %d Mbps, %s duplex, flow control %s\n", |
2033 | "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", | 2029 | sky2->speed, |
2034 | sky2->netdev->name, sky2->speed, | 2030 | sky2->duplex == DUPLEX_FULL ? "full" : "half", |
2035 | sky2->duplex == DUPLEX_FULL ? "full" : "half", | 2031 | fc_name[sky2->flow_status]); |
2036 | fc_name[sky2->flow_status]); | ||
2037 | } | 2032 | } |
2038 | 2033 | ||
2039 | static void sky2_link_down(struct sky2_port *sky2) | 2034 | static void sky2_link_down(struct sky2_port *sky2) |
@@ -2053,8 +2048,7 @@ static void sky2_link_down(struct sky2_port *sky2) | |||
2053 | /* Turn off link LED */ | 2048 | /* Turn off link LED */ |
2054 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF); | 2049 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF); |
2055 | 2050 | ||
2056 | if (netif_msg_link(sky2)) | 2051 | netif_info(sky2, link, sky2->netdev, "Link is down\n"); |
2057 | printk(KERN_INFO PFX "%s: Link is down.\n", sky2->netdev->name); | ||
2058 | 2052 | ||
2059 | sky2_phy_init(hw, port); | 2053 | sky2_phy_init(hw, port); |
2060 | } | 2054 | } |
@@ -2144,9 +2138,8 @@ static void sky2_phy_intr(struct sky2_hw *hw, unsigned port) | |||
2144 | istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT); | 2138 | istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT); |
2145 | phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT); | 2139 | phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT); |
2146 | 2140 | ||
2147 | if (netif_msg_intr(sky2)) | 2141 | netif_info(sky2, intr, sky2->netdev, "phy interrupt status 0x%x 0x%x\n", |
2148 | printk(KERN_INFO PFX "%s: phy interrupt status 0x%x 0x%x\n", | 2142 | istatus, phystat); |
2149 | sky2->netdev->name, istatus, phystat); | ||
2150 | 2143 | ||
2151 | if (istatus & PHY_M_IS_AN_COMPL) { | 2144 | if (istatus & PHY_M_IS_AN_COMPL) { |
2152 | if (sky2_autoneg_done(sky2, phystat) == 0) | 2145 | if (sky2_autoneg_done(sky2, phystat) == 0) |
@@ -2200,8 +2193,7 @@ static void sky2_tx_timeout(struct net_device *dev) | |||
2200 | struct sky2_port *sky2 = netdev_priv(dev); | 2193 | struct sky2_port *sky2 = netdev_priv(dev); |
2201 | struct sky2_hw *hw = sky2->hw; | 2194 | struct sky2_hw *hw = sky2->hw; |
2202 | 2195 | ||
2203 | if (netif_msg_timer(sky2)) | 2196 | netif_err(sky2, timer, dev, "tx timeout\n"); |
2204 | printk(KERN_ERR PFX "%s: tx timeout\n", dev->name); | ||
2205 | 2197 | ||
2206 | printk(KERN_DEBUG PFX "%s: transmit ring %u .. %u report=%u done=%u\n", | 2198 | printk(KERN_DEBUG PFX "%s: transmit ring %u .. %u report=%u done=%u\n", |
2207 | dev->name, sky2->tx_cons, sky2->tx_prod, | 2199 | dev->name, sky2->tx_cons, sky2->tx_prod, |
@@ -2396,9 +2388,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev, | |||
2396 | count -= VLAN_HLEN; | 2388 | count -= VLAN_HLEN; |
2397 | #endif | 2389 | #endif |
2398 | 2390 | ||
2399 | if (unlikely(netif_msg_rx_status(sky2))) | 2391 | netif_printk(sky2, rx_status, KERN_DEBUG, dev, |
2400 | printk(KERN_DEBUG PFX "%s: rx slot %u status 0x%x len %d\n", | 2392 | "rx slot %u status 0x%x len %d\n", |
2401 | dev->name, sky2->rx_next, status, length); | 2393 | sky2->rx_next, status, length); |
2402 | 2394 | ||
2403 | sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; | 2395 | sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; |
2404 | prefetch(sky2->rx_ring + sky2->rx_next); | 2396 | prefetch(sky2->rx_ring + sky2->rx_next); |
@@ -2439,9 +2431,10 @@ len_error: | |||
2439 | /* Truncation of overlength packets | 2431 | /* Truncation of overlength packets |
2440 | causes PHY length to not match MAC length */ | 2432 | causes PHY length to not match MAC length */ |
2441 | ++dev->stats.rx_length_errors; | 2433 | ++dev->stats.rx_length_errors; |
2442 | if (netif_msg_rx_err(sky2) && net_ratelimit()) | 2434 | if (net_ratelimit()) |
2443 | pr_info(PFX "%s: rx length error: status %#x length %d\n", | 2435 | netif_info(sky2, rx_err, dev, |
2444 | dev->name, status, length); | 2436 | "rx length error: status %#x length %d\n", |
2437 | status, length); | ||
2445 | goto resubmit; | 2438 | goto resubmit; |
2446 | 2439 | ||
2447 | error: | 2440 | error: |
@@ -2451,9 +2444,9 @@ error: | |||
2451 | goto resubmit; | 2444 | goto resubmit; |
2452 | } | 2445 | } |
2453 | 2446 | ||
2454 | if (netif_msg_rx_err(sky2) && net_ratelimit()) | 2447 | if (net_ratelimit()) |
2455 | printk(KERN_INFO PFX "%s: rx error, status 0x%x length %d\n", | 2448 | netif_info(sky2, rx_err, dev, |
2456 | dev->name, status, length); | 2449 | "rx error, status 0x%x length %d\n", status, length); |
2457 | 2450 | ||
2458 | if (status & (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE)) | 2451 | if (status & (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE)) |
2459 | dev->stats.rx_length_errors++; | 2452 | dev->stats.rx_length_errors++; |
@@ -2733,9 +2726,7 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port) | |||
2733 | struct sky2_port *sky2 = netdev_priv(dev); | 2726 | struct sky2_port *sky2 = netdev_priv(dev); |
2734 | u8 status = sky2_read8(hw, SK_REG(port, GMAC_IRQ_SRC)); | 2727 | u8 status = sky2_read8(hw, SK_REG(port, GMAC_IRQ_SRC)); |
2735 | 2728 | ||
2736 | if (netif_msg_intr(sky2)) | 2729 | netif_info(sky2, intr, dev, "mac interrupt status 0x%x\n", status); |
2737 | printk(KERN_INFO PFX "%s: mac interrupt status 0x%x\n", | ||
2738 | dev->name, status); | ||
2739 | 2730 | ||
2740 | if (status & GM_IS_RX_CO_OV) | 2731 | if (status & GM_IS_RX_CO_OV) |
2741 | gma_read16(hw, port, GM_RX_IRQ_SRC); | 2732 | gma_read16(hw, port, GM_RX_IRQ_SRC); |
@@ -4529,9 +4520,7 @@ static void __devinit sky2_show_addr(struct net_device *dev) | |||
4529 | { | 4520 | { |
4530 | const struct sky2_port *sky2 = netdev_priv(dev); | 4521 | const struct sky2_port *sky2 = netdev_priv(dev); |
4531 | 4522 | ||
4532 | if (netif_msg_probe(sky2)) | 4523 | netif_info(sky2, probe, dev, "addr %pM\n", dev->dev_addr); |
4533 | printk(KERN_INFO PFX "%s: addr %pM\n", | ||
4534 | dev->name, dev->dev_addr); | ||
4535 | } | 4524 | } |
4536 | 4525 | ||
4537 | /* Handle software interrupt used during MSI test */ | 4526 | /* Handle software interrupt used during MSI test */ |