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

drivers/net/skge.c: Use netif_printk macros

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ae9540f7
...@@ -1074,13 +1074,11 @@ static void skge_link_up(struct skge_port *skge) ...@@ -1074,13 +1074,11 @@ static void skge_link_up(struct skge_port *skge)
netif_carrier_on(skge->netdev); netif_carrier_on(skge->netdev);
netif_wake_queue(skge->netdev); netif_wake_queue(skge->netdev);
if (netif_msg_link(skge)) { netif_info(skge, link, skge->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", skge->speed,
skge->netdev->name, skge->speed,
skge->duplex == DUPLEX_FULL ? "full" : "half", skge->duplex == DUPLEX_FULL ? "full" : "half",
skge_pause(skge->flow_status)); skge_pause(skge->flow_status));
}
} }
static void skge_link_down(struct skge_port *skge) static void skge_link_down(struct skge_port *skge)
...@@ -1089,8 +1087,7 @@ static void skge_link_down(struct skge_port *skge) ...@@ -1089,8 +1087,7 @@ static void skge_link_down(struct skge_port *skge)
netif_carrier_off(skge->netdev); netif_carrier_off(skge->netdev);
netif_stop_queue(skge->netdev); netif_stop_queue(skge->netdev);
if (netif_msg_link(skge)) netif_info(skge, link, skge->netdev, "Link is down\n");
printk(KERN_INFO PFX "%s: Link is down.\n", skge->netdev->name);
} }
...@@ -1792,9 +1789,8 @@ static void genesis_mac_intr(struct skge_hw *hw, int port) ...@@ -1792,9 +1789,8 @@ static void genesis_mac_intr(struct skge_hw *hw, int port)
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = netdev_priv(dev);
u16 status = xm_read16(hw, port, XM_ISRC); u16 status = xm_read16(hw, port, XM_ISRC);
if (netif_msg_intr(skge)) netif_printk(skge, intr, KERN_DEBUG, skge->netdev,
printk(KERN_DEBUG PFX "%s: mac interrupt status 0x%x\n", "mac interrupt status 0x%x\n", status);
dev->name, status);
if (hw->phy_type == SK_PHY_XMAC && (status & XM_IS_INP_ASS)) { if (hw->phy_type == SK_PHY_XMAC && (status & XM_IS_INP_ASS)) {
xm_link_down(hw, port); xm_link_down(hw, port);
...@@ -1898,9 +1894,8 @@ static inline void bcom_phy_intr(struct skge_port *skge) ...@@ -1898,9 +1894,8 @@ static inline void bcom_phy_intr(struct skge_port *skge)
u16 isrc; u16 isrc;
isrc = xm_phy_read(hw, port, PHY_BCOM_INT_STAT); isrc = xm_phy_read(hw, port, PHY_BCOM_INT_STAT);
if (netif_msg_intr(skge)) netif_printk(skge, intr, KERN_DEBUG, skge->netdev,
printk(KERN_DEBUG PFX "%s: phy interrupt status 0x%x\n", "phy interrupt status 0x%x\n", isrc);
skge->netdev->name, isrc);
if (isrc & PHY_B_IS_PSE) if (isrc & PHY_B_IS_PSE)
printk(KERN_ERR PFX "%s: uncorrectable pair swap error\n", printk(KERN_ERR PFX "%s: uncorrectable pair swap error\n",
...@@ -2298,9 +2293,8 @@ static void yukon_mac_intr(struct skge_hw *hw, int port) ...@@ -2298,9 +2293,8 @@ static void yukon_mac_intr(struct skge_hw *hw, int port)
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = netdev_priv(dev);
u8 status = skge_read8(hw, SK_REG(port, GMAC_IRQ_SRC)); u8 status = skge_read8(hw, SK_REG(port, GMAC_IRQ_SRC));
if (netif_msg_intr(skge)) netif_printk(skge, intr, KERN_DEBUG, skge->netdev,
printk(KERN_DEBUG PFX "%s: mac interrupt status 0x%x\n", "mac interrupt status 0x%x\n", status);
dev->name, status);
if (status & GM_IS_RX_FF_OR) { if (status & GM_IS_RX_FF_OR) {
++dev->stats.rx_fifo_errors; ++dev->stats.rx_fifo_errors;
...@@ -2379,9 +2373,8 @@ static void yukon_phy_intr(struct skge_port *skge) ...@@ -2379,9 +2373,8 @@ static void yukon_phy_intr(struct skge_port *skge)
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(skge)) netif_printk(skge, intr, KERN_DEBUG, skge->netdev,
printk(KERN_DEBUG PFX "%s: phy interrupt status 0x%x 0x%x\n", "phy interrupt status 0x%x 0x%x\n", istatus, phystat);
skge->netdev->name, istatus, phystat);
if (istatus & PHY_M_IS_AN_COMPL) { if (istatus & PHY_M_IS_AN_COMPL) {
if (gm_phy_read(hw, port, PHY_MARV_AUNE_LP) if (gm_phy_read(hw, port, PHY_MARV_AUNE_LP)
...@@ -2571,8 +2564,7 @@ static int skge_up(struct net_device *dev) ...@@ -2571,8 +2564,7 @@ static int skge_up(struct net_device *dev)
if (!is_valid_ether_addr(dev->dev_addr)) if (!is_valid_ether_addr(dev->dev_addr))
return -EINVAL; return -EINVAL;
if (netif_msg_ifup(skge)) netif_info(skge, ifup, skge->netdev, "enabling interface\n");
printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
if (dev->mtu > RX_BUF_SIZE) if (dev->mtu > RX_BUF_SIZE)
skge->rx_buf_size = dev->mtu + ETH_HLEN; skge->rx_buf_size = dev->mtu + ETH_HLEN;
...@@ -2670,8 +2662,7 @@ static int skge_down(struct net_device *dev) ...@@ -2670,8 +2662,7 @@ static int skge_down(struct net_device *dev)
if (skge->mem == NULL) if (skge->mem == NULL)
return 0; return 0;
if (netif_msg_ifdown(skge)) netif_info(skge, ifdown, skge->netdev, "disabling interface\n");
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
netif_tx_disable(dev); netif_tx_disable(dev);
...@@ -2825,9 +2816,9 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, ...@@ -2825,9 +2816,9 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
skge_write8(hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_START); skge_write8(hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_START);
if (unlikely(netif_msg_tx_queued(skge))) netif_printk(skge, tx_queued, KERN_DEBUG, skge->netdev,
printk(KERN_DEBUG "%s: tx queued, slot %td, len %d\n", "tx queued, slot %td, len %d\n",
dev->name, e - skge->tx_ring.start, skb->len); e - skge->tx_ring.start, skb->len);
skge->tx_ring.to_use = e->next; skge->tx_ring.to_use = e->next;
smp_wmb(); smp_wmb();
...@@ -2858,9 +2849,8 @@ static void skge_tx_free(struct skge_port *skge, struct skge_element *e, ...@@ -2858,9 +2849,8 @@ static void skge_tx_free(struct skge_port *skge, struct skge_element *e,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
if (control & BMU_EOF) { if (control & BMU_EOF) {
if (unlikely(netif_msg_tx_done(skge))) netif_printk(skge, tx_done, KERN_DEBUG, skge->netdev,
printk(KERN_DEBUG PFX "%s: tx done slot %td\n", "tx done slot %td\n", e - skge->tx_ring.start);
skge->netdev->name, e - skge->tx_ring.start);
dev_kfree_skb(e->skb); dev_kfree_skb(e->skb);
} }
...@@ -2885,8 +2875,7 @@ static void skge_tx_timeout(struct net_device *dev) ...@@ -2885,8 +2875,7 @@ static void skge_tx_timeout(struct net_device *dev)
{ {
struct skge_port *skge = netdev_priv(dev); struct skge_port *skge = netdev_priv(dev);
if (netif_msg_timer(skge)) netif_printk(skge, timer, KERN_DEBUG, skge->netdev, "tx timeout\n");
printk(KERN_DEBUG PFX "%s: tx timeout\n", dev->name);
skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_STOP); skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_STOP);
skge_tx_clean(dev); skge_tx_clean(dev);
...@@ -3054,10 +3043,9 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, ...@@ -3054,10 +3043,9 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
struct sk_buff *skb; struct sk_buff *skb;
u16 len = control & BMU_BBC; u16 len = control & BMU_BBC;
if (unlikely(netif_msg_rx_status(skge))) netif_printk(skge, rx_status, KERN_DEBUG, skge->netdev,
printk(KERN_DEBUG PFX "%s: rx slot %td status 0x%x len %d\n", "rx slot %td status 0x%x len %d\n",
dev->name, e - skge->rx_ring.start, e - skge->rx_ring.start, status, len);
status, len);
if (len > skge->rx_buf_size) if (len > skge->rx_buf_size)
goto error; goto error;
...@@ -3111,10 +3099,9 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, ...@@ -3111,10 +3099,9 @@ static struct sk_buff *skge_rx_get(struct net_device *dev,
return skb; return skb;
error: error:
if (netif_msg_rx_err(skge)) netif_printk(skge, rx_err, KERN_DEBUG, skge->netdev,
printk(KERN_DEBUG PFX "%s: rx err, slot %td control 0x%x status 0x%x\n", "rx err, slot %td control 0x%x status 0x%x\n",
dev->name, e - skge->rx_ring.start, e - skge->rx_ring.start, control, status);
control, status);
if (skge->hw->chip_id == CHIP_ID_GENESIS) { if (skge->hw->chip_id == CHIP_ID_GENESIS) {
if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR)) if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR))
...@@ -3885,9 +3872,7 @@ static void __devinit skge_show_addr(struct net_device *dev) ...@@ -3885,9 +3872,7 @@ static void __devinit skge_show_addr(struct net_device *dev)
{ {
const struct skge_port *skge = netdev_priv(dev); const struct skge_port *skge = netdev_priv(dev);
if (netif_msg_probe(skge)) netif_info(skge, probe, skge->netdev, "addr %pM\n", dev->dev_addr);
printk(KERN_INFO PFX "%s: addr %pM\n",
dev->name, dev->dev_addr);
} }
static int __devinit skge_probe(struct pci_dev *pdev, static int __devinit skge_probe(struct pci_dev *pdev,
......
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