Commit 6c35abae authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6909c66d
...@@ -1613,8 +1613,7 @@ static int sky2_up(struct net_device *dev) ...@@ -1613,8 +1613,7 @@ static int sky2_up(struct net_device *dev)
sky2_write32(hw, B0_IMSK, imask); sky2_write32(hw, B0_IMSK, imask);
sky2_read32(hw, B0_IMSK); sky2_read32(hw, B0_IMSK);
if (netif_msg_ifup(sky2)) netif_info(sky2, ifup, dev, "enabling interface\n");
printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
return 0; return 0;
...@@ -1697,9 +1696,8 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb, ...@@ -1697,9 +1696,8 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
goto mapping_error; goto mapping_error;
slot = sky2->tx_prod; slot = sky2->tx_prod;
if (unlikely(netif_msg_tx_queued(sky2))) netif_printk(sky2, tx_queued, KERN_DEBUG, dev,
printk(KERN_DEBUG "%s: tx queued, slot %u, len %d\n", "tx queued, slot %u, len %d\n", slot, skb->len);
dev->name, slot, skb->len);
/* Send high bits if needed */ /* Send high bits if needed */
upper = upper_32_bits(mapping); upper = upper_32_bits(mapping);
...@@ -1864,9 +1862,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) ...@@ -1864,9 +1862,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
sky2_tx_unmap(sky2->hw->pdev, re); sky2_tx_unmap(sky2->hw->pdev, re);
if (skb) { if (skb) {
if (unlikely(netif_msg_tx_done(sky2))) netif_printk(sky2, tx_done, KERN_DEBUG, dev,
printk(KERN_DEBUG "%s: tx done %u\n", "tx done %u\n", idx);
dev->name, idx);
dev->stats.tx_packets++; dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len; dev->stats.tx_bytes += skb->len;
...@@ -1961,8 +1958,7 @@ static int sky2_down(struct net_device *dev) ...@@ -1961,8 +1958,7 @@ static int sky2_down(struct net_device *dev)
if (!sky2->tx_le) if (!sky2->tx_le)
return 0; return 0;
if (netif_msg_ifdown(sky2)) netif_info(sky2, ifdown, dev, "disabling interface\n");
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
/* Disable port IRQ */ /* Disable port IRQ */
sky2_write32(hw, B0_IMSK, sky2_write32(hw, B0_IMSK,
...@@ -2028,10 +2024,9 @@ static void sky2_link_up(struct sky2_port *sky2) ...@@ -2028,10 +2024,9 @@ static void sky2_link_up(struct sky2_port *sky2)
sky2_write8(hw, SK_REG(port, LNK_LED_REG), sky2_write8(hw, SK_REG(port, LNK_LED_REG),
LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF);
if (netif_msg_link(sky2)) netif_info(sky2, link, sky2->netdev,
printk(KERN_INFO PFX "Link is up at %d Mbps, %s duplex, flow control %s\n",
"%s: Link is up at %d Mbps, %s duplex, flow control %s\n", sky2->speed,
sky2->netdev->name, sky2->speed,
sky2->duplex == DUPLEX_FULL ? "full" : "half", sky2->duplex == DUPLEX_FULL ? "full" : "half",
fc_name[sky2->flow_status]); fc_name[sky2->flow_status]);
} }
...@@ -2053,8 +2048,7 @@ static void sky2_link_down(struct sky2_port *sky2) ...@@ -2053,8 +2048,7 @@ static void sky2_link_down(struct sky2_port *sky2)
/* Turn off link LED */ /* Turn off link LED */
sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF); sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF);
if (netif_msg_link(sky2)) netif_info(sky2, link, sky2->netdev, "Link is down\n");
printk(KERN_INFO PFX "%s: Link is down.\n", sky2->netdev->name);
sky2_phy_init(hw, port); sky2_phy_init(hw, port);
} }
...@@ -2144,9 +2138,8 @@ static void sky2_phy_intr(struct sky2_hw *hw, unsigned port) ...@@ -2144,9 +2138,8 @@ static void sky2_phy_intr(struct sky2_hw *hw, unsigned port)
istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT); istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT);
phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT); phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT);
if (netif_msg_intr(sky2)) netif_info(sky2, intr, sky2->netdev, "phy interrupt status 0x%x 0x%x\n",
printk(KERN_INFO PFX "%s: phy interrupt status 0x%x 0x%x\n", istatus, phystat);
sky2->netdev->name, istatus, phystat);
if (istatus & PHY_M_IS_AN_COMPL) { if (istatus & PHY_M_IS_AN_COMPL) {
if (sky2_autoneg_done(sky2, phystat) == 0) if (sky2_autoneg_done(sky2, phystat) == 0)
...@@ -2200,8 +2193,7 @@ static void sky2_tx_timeout(struct net_device *dev) ...@@ -2200,8 +2193,7 @@ static void sky2_tx_timeout(struct net_device *dev)
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = netdev_priv(dev);
struct sky2_hw *hw = sky2->hw; struct sky2_hw *hw = sky2->hw;
if (netif_msg_timer(sky2)) netif_err(sky2, timer, dev, "tx timeout\n");
printk(KERN_ERR PFX "%s: tx timeout\n", dev->name);
printk(KERN_DEBUG PFX "%s: transmit ring %u .. %u report=%u done=%u\n", printk(KERN_DEBUG PFX "%s: transmit ring %u .. %u report=%u done=%u\n",
dev->name, sky2->tx_cons, sky2->tx_prod, dev->name, sky2->tx_cons, sky2->tx_prod,
...@@ -2396,9 +2388,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev, ...@@ -2396,9 +2388,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
count -= VLAN_HLEN; count -= VLAN_HLEN;
#endif #endif
if (unlikely(netif_msg_rx_status(sky2))) netif_printk(sky2, rx_status, KERN_DEBUG, dev,
printk(KERN_DEBUG PFX "%s: rx slot %u status 0x%x len %d\n", "rx slot %u status 0x%x len %d\n",
dev->name, sky2->rx_next, status, length); sky2->rx_next, status, length);
sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
prefetch(sky2->rx_ring + sky2->rx_next); prefetch(sky2->rx_ring + sky2->rx_next);
...@@ -2439,9 +2431,10 @@ static struct sk_buff *sky2_receive(struct net_device *dev, ...@@ -2439,9 +2431,10 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
/* Truncation of overlength packets /* Truncation of overlength packets
causes PHY length to not match MAC length */ causes PHY length to not match MAC length */
++dev->stats.rx_length_errors; ++dev->stats.rx_length_errors;
if (netif_msg_rx_err(sky2) && net_ratelimit()) if (net_ratelimit())
pr_info(PFX "%s: rx length error: status %#x length %d\n", netif_info(sky2, rx_err, dev,
dev->name, status, length); "rx length error: status %#x length %d\n",
status, length);
goto resubmit; goto resubmit;
error: error:
...@@ -2451,9 +2444,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev, ...@@ -2451,9 +2444,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
goto resubmit; goto resubmit;
} }
if (netif_msg_rx_err(sky2) && net_ratelimit()) if (net_ratelimit())
printk(KERN_INFO PFX "%s: rx error, status 0x%x length %d\n", netif_info(sky2, rx_err, dev,
dev->name, status, length); "rx error, status 0x%x length %d\n", status, length);
if (status & (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE)) if (status & (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE))
dev->stats.rx_length_errors++; dev->stats.rx_length_errors++;
...@@ -2733,9 +2726,7 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port) ...@@ -2733,9 +2726,7 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port)
struct sky2_port *sky2 = netdev_priv(dev); struct sky2_port *sky2 = netdev_priv(dev);
u8 status = sky2_read8(hw, SK_REG(port, GMAC_IRQ_SRC)); u8 status = sky2_read8(hw, SK_REG(port, GMAC_IRQ_SRC));
if (netif_msg_intr(sky2)) netif_info(sky2, intr, dev, "mac interrupt status 0x%x\n", status);
printk(KERN_INFO PFX "%s: mac interrupt status 0x%x\n",
dev->name, status);
if (status & GM_IS_RX_CO_OV) if (status & GM_IS_RX_CO_OV)
gma_read16(hw, port, GM_RX_IRQ_SRC); gma_read16(hw, port, GM_RX_IRQ_SRC);
...@@ -4529,9 +4520,7 @@ static void __devinit sky2_show_addr(struct net_device *dev) ...@@ -4529,9 +4520,7 @@ static void __devinit sky2_show_addr(struct net_device *dev)
{ {
const struct sky2_port *sky2 = netdev_priv(dev); const struct sky2_port *sky2 = netdev_priv(dev);
if (netif_msg_probe(sky2)) netif_info(sky2, probe, dev, "addr %pM\n", dev->dev_addr);
printk(KERN_INFO PFX "%s: addr %pM\n",
dev->name, dev->dev_addr);
} }
/* Handle software interrupt used during MSI test */ /* Handle software interrupt used during MSI test */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment