diff options
author | Joe Perches <joe@perches.com> | 2010-02-09 06:49:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-12 16:27:47 -0500 |
commit | d707204c1fd21ab49242aad17f92f949538e1507 (patch) | |
tree | b344c37ffb8a714e37c1d468d3698acbe26cd36a /drivers/net/skge.c | |
parent | ae9540f75d5a69e7604cc5391cc0726b3aa82ff6 (diff) |
drivers/net/skge.c: Use netif_printk macros
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/skge.c')
-rw-r--r-- | drivers/net/skge.c | 73 |
1 files changed, 29 insertions, 44 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index 36ead52dea71..ffa55df4d607 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -1074,13 +1074,11 @@ static void skge_link_up(struct skge_port *skge) | |||
1074 | netif_carrier_on(skge->netdev); | 1074 | netif_carrier_on(skge->netdev); |
1075 | netif_wake_queue(skge->netdev); | 1075 | netif_wake_queue(skge->netdev); |
1076 | 1076 | ||
1077 | if (netif_msg_link(skge)) { | 1077 | netif_info(skge, link, skge->netdev, |
1078 | printk(KERN_INFO PFX | 1078 | "Link is up at %d Mbps, %s duplex, flow control %s\n", |
1079 | "%s: Link is up at %d Mbps, %s duplex, flow control %s\n", | 1079 | skge->speed, |
1080 | skge->netdev->name, skge->speed, | 1080 | skge->duplex == DUPLEX_FULL ? "full" : "half", |
1081 | skge->duplex == DUPLEX_FULL ? "full" : "half", | 1081 | skge_pause(skge->flow_status)); |
1082 | skge_pause(skge->flow_status)); | ||
1083 | } | ||
1084 | } | 1082 | } |
1085 | 1083 | ||
1086 | static void skge_link_down(struct skge_port *skge) | 1084 | static void skge_link_down(struct skge_port *skge) |
@@ -1089,8 +1087,7 @@ static void skge_link_down(struct skge_port *skge) | |||
1089 | netif_carrier_off(skge->netdev); | 1087 | netif_carrier_off(skge->netdev); |
1090 | netif_stop_queue(skge->netdev); | 1088 | netif_stop_queue(skge->netdev); |
1091 | 1089 | ||
1092 | if (netif_msg_link(skge)) | 1090 | netif_info(skge, link, skge->netdev, "Link is down\n"); |
1093 | printk(KERN_INFO PFX "%s: Link is down.\n", skge->netdev->name); | ||
1094 | } | 1091 | } |
1095 | 1092 | ||
1096 | 1093 | ||
@@ -1792,9 +1789,8 @@ static void genesis_mac_intr(struct skge_hw *hw, int port) | |||
1792 | struct skge_port *skge = netdev_priv(dev); | 1789 | struct skge_port *skge = netdev_priv(dev); |
1793 | u16 status = xm_read16(hw, port, XM_ISRC); | 1790 | u16 status = xm_read16(hw, port, XM_ISRC); |
1794 | 1791 | ||
1795 | if (netif_msg_intr(skge)) | 1792 | netif_printk(skge, intr, KERN_DEBUG, skge->netdev, |
1796 | printk(KERN_DEBUG PFX "%s: mac interrupt status 0x%x\n", | 1793 | "mac interrupt status 0x%x\n", status); |
1797 | dev->name, status); | ||
1798 | 1794 | ||
1799 | if (hw->phy_type == SK_PHY_XMAC && (status & XM_IS_INP_ASS)) { | 1795 | if (hw->phy_type == SK_PHY_XMAC && (status & XM_IS_INP_ASS)) { |
1800 | xm_link_down(hw, port); | 1796 | xm_link_down(hw, port); |
@@ -1898,9 +1894,8 @@ static inline void bcom_phy_intr(struct skge_port *skge) | |||
1898 | u16 isrc; | 1894 | u16 isrc; |
1899 | 1895 | ||
1900 | isrc = xm_phy_read(hw, port, PHY_BCOM_INT_STAT); | 1896 | isrc = xm_phy_read(hw, port, PHY_BCOM_INT_STAT); |
1901 | if (netif_msg_intr(skge)) | 1897 | netif_printk(skge, intr, KERN_DEBUG, skge->netdev, |
1902 | printk(KERN_DEBUG PFX "%s: phy interrupt status 0x%x\n", | 1898 | "phy interrupt status 0x%x\n", isrc); |
1903 | skge->netdev->name, isrc); | ||
1904 | 1899 | ||
1905 | if (isrc & PHY_B_IS_PSE) | 1900 | if (isrc & PHY_B_IS_PSE) |
1906 | printk(KERN_ERR PFX "%s: uncorrectable pair swap error\n", | 1901 | 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 | struct skge_port *skge = netdev_priv(dev); | 2293 | struct skge_port *skge = netdev_priv(dev); |
2299 | u8 status = skge_read8(hw, SK_REG(port, GMAC_IRQ_SRC)); | 2294 | u8 status = skge_read8(hw, SK_REG(port, GMAC_IRQ_SRC)); |
2300 | 2295 | ||
2301 | if (netif_msg_intr(skge)) | 2296 | netif_printk(skge, intr, KERN_DEBUG, skge->netdev, |
2302 | printk(KERN_DEBUG PFX "%s: mac interrupt status 0x%x\n", | 2297 | "mac interrupt status 0x%x\n", status); |
2303 | dev->name, status); | ||
2304 | 2298 | ||
2305 | if (status & GM_IS_RX_FF_OR) { | 2299 | if (status & GM_IS_RX_FF_OR) { |
2306 | ++dev->stats.rx_fifo_errors; | 2300 | ++dev->stats.rx_fifo_errors; |
@@ -2379,9 +2373,8 @@ static void yukon_phy_intr(struct skge_port *skge) | |||
2379 | istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT); | 2373 | istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT); |
2380 | phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT); | 2374 | phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT); |
2381 | 2375 | ||
2382 | if (netif_msg_intr(skge)) | 2376 | netif_printk(skge, intr, KERN_DEBUG, skge->netdev, |
2383 | printk(KERN_DEBUG PFX "%s: phy interrupt status 0x%x 0x%x\n", | 2377 | "phy interrupt status 0x%x 0x%x\n", istatus, phystat); |
2384 | skge->netdev->name, istatus, phystat); | ||
2385 | 2378 | ||
2386 | if (istatus & PHY_M_IS_AN_COMPL) { | 2379 | if (istatus & PHY_M_IS_AN_COMPL) { |
2387 | if (gm_phy_read(hw, port, PHY_MARV_AUNE_LP) | 2380 | if (gm_phy_read(hw, port, PHY_MARV_AUNE_LP) |
@@ -2571,8 +2564,7 @@ static int skge_up(struct net_device *dev) | |||
2571 | if (!is_valid_ether_addr(dev->dev_addr)) | 2564 | if (!is_valid_ether_addr(dev->dev_addr)) |
2572 | return -EINVAL; | 2565 | return -EINVAL; |
2573 | 2566 | ||
2574 | if (netif_msg_ifup(skge)) | 2567 | netif_info(skge, ifup, skge->netdev, "enabling interface\n"); |
2575 | printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); | ||
2576 | 2568 | ||
2577 | if (dev->mtu > RX_BUF_SIZE) | 2569 | if (dev->mtu > RX_BUF_SIZE) |
2578 | skge->rx_buf_size = dev->mtu + ETH_HLEN; | 2570 | skge->rx_buf_size = dev->mtu + ETH_HLEN; |
@@ -2670,8 +2662,7 @@ static int skge_down(struct net_device *dev) | |||
2670 | if (skge->mem == NULL) | 2662 | if (skge->mem == NULL) |
2671 | return 0; | 2663 | return 0; |
2672 | 2664 | ||
2673 | if (netif_msg_ifdown(skge)) | 2665 | netif_info(skge, ifdown, skge->netdev, "disabling interface\n"); |
2674 | printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); | ||
2675 | 2666 | ||
2676 | netif_tx_disable(dev); | 2667 | netif_tx_disable(dev); |
2677 | 2668 | ||
@@ -2825,9 +2816,9 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb, | |||
2825 | 2816 | ||
2826 | skge_write8(hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_START); | 2817 | skge_write8(hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_START); |
2827 | 2818 | ||
2828 | if (unlikely(netif_msg_tx_queued(skge))) | 2819 | netif_printk(skge, tx_queued, KERN_DEBUG, skge->netdev, |
2829 | printk(KERN_DEBUG "%s: tx queued, slot %td, len %d\n", | 2820 | "tx queued, slot %td, len %d\n", |
2830 | dev->name, e - skge->tx_ring.start, skb->len); | 2821 | e - skge->tx_ring.start, skb->len); |
2831 | 2822 | ||
2832 | skge->tx_ring.to_use = e->next; | 2823 | skge->tx_ring.to_use = e->next; |
2833 | smp_wmb(); | 2824 | smp_wmb(); |
@@ -2858,9 +2849,8 @@ static void skge_tx_free(struct skge_port *skge, struct skge_element *e, | |||
2858 | PCI_DMA_TODEVICE); | 2849 | PCI_DMA_TODEVICE); |
2859 | 2850 | ||
2860 | if (control & BMU_EOF) { | 2851 | if (control & BMU_EOF) { |
2861 | if (unlikely(netif_msg_tx_done(skge))) | 2852 | netif_printk(skge, tx_done, KERN_DEBUG, skge->netdev, |
2862 | printk(KERN_DEBUG PFX "%s: tx done slot %td\n", | 2853 | "tx done slot %td\n", e - skge->tx_ring.start); |
2863 | skge->netdev->name, e - skge->tx_ring.start); | ||
2864 | 2854 | ||
2865 | dev_kfree_skb(e->skb); | 2855 | dev_kfree_skb(e->skb); |
2866 | } | 2856 | } |
@@ -2885,8 +2875,7 @@ static void skge_tx_timeout(struct net_device *dev) | |||
2885 | { | 2875 | { |
2886 | struct skge_port *skge = netdev_priv(dev); | 2876 | struct skge_port *skge = netdev_priv(dev); |
2887 | 2877 | ||
2888 | if (netif_msg_timer(skge)) | 2878 | netif_printk(skge, timer, KERN_DEBUG, skge->netdev, "tx timeout\n"); |
2889 | printk(KERN_DEBUG PFX "%s: tx timeout\n", dev->name); | ||
2890 | 2879 | ||
2891 | skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_STOP); | 2880 | skge_write8(skge->hw, Q_ADDR(txqaddr[skge->port], Q_CSR), CSR_STOP); |
2892 | skge_tx_clean(dev); | 2881 | skge_tx_clean(dev); |
@@ -3054,10 +3043,9 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, | |||
3054 | struct sk_buff *skb; | 3043 | struct sk_buff *skb; |
3055 | u16 len = control & BMU_BBC; | 3044 | u16 len = control & BMU_BBC; |
3056 | 3045 | ||
3057 | if (unlikely(netif_msg_rx_status(skge))) | 3046 | netif_printk(skge, rx_status, KERN_DEBUG, skge->netdev, |
3058 | printk(KERN_DEBUG PFX "%s: rx slot %td status 0x%x len %d\n", | 3047 | "rx slot %td status 0x%x len %d\n", |
3059 | dev->name, e - skge->rx_ring.start, | 3048 | e - skge->rx_ring.start, status, len); |
3060 | status, len); | ||
3061 | 3049 | ||
3062 | if (len > skge->rx_buf_size) | 3050 | if (len > skge->rx_buf_size) |
3063 | goto error; | 3051 | goto error; |
@@ -3111,10 +3099,9 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, | |||
3111 | return skb; | 3099 | return skb; |
3112 | error: | 3100 | error: |
3113 | 3101 | ||
3114 | if (netif_msg_rx_err(skge)) | 3102 | netif_printk(skge, rx_err, KERN_DEBUG, skge->netdev, |
3115 | printk(KERN_DEBUG PFX "%s: rx err, slot %td control 0x%x status 0x%x\n", | 3103 | "rx err, slot %td control 0x%x status 0x%x\n", |
3116 | dev->name, e - skge->rx_ring.start, | 3104 | e - skge->rx_ring.start, control, status); |
3117 | control, status); | ||
3118 | 3105 | ||
3119 | if (skge->hw->chip_id == CHIP_ID_GENESIS) { | 3106 | if (skge->hw->chip_id == CHIP_ID_GENESIS) { |
3120 | if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR)) | 3107 | if (status & (XMR_FS_RUNT|XMR_FS_LNG_ERR)) |
@@ -3885,9 +3872,7 @@ static void __devinit skge_show_addr(struct net_device *dev) | |||
3885 | { | 3872 | { |
3886 | const struct skge_port *skge = netdev_priv(dev); | 3873 | const struct skge_port *skge = netdev_priv(dev); |
3887 | 3874 | ||
3888 | if (netif_msg_probe(skge)) | 3875 | netif_info(skge, probe, skge->netdev, "addr %pM\n", dev->dev_addr); |
3889 | printk(KERN_INFO PFX "%s: addr %pM\n", | ||
3890 | dev->name, dev->dev_addr); | ||
3891 | } | 3876 | } |
3892 | 3877 | ||
3893 | static int __devinit skge_probe(struct pci_dev *pdev, | 3878 | static int __devinit skge_probe(struct pci_dev *pdev, |