aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/forcedeth.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-11-29 02:41:53 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-29 14:44:52 -0500
commit6b80858d2c0a378894b9df35d3703d62b0b12dbc (patch)
treefb649c4d75a305d897a49da0b20dbcd2419791cb /drivers/net/forcedeth.c
parent344d0dce5164d0bf2d73cf10510fe08ed8cf8248 (diff)
forcedeth: convert dprintk(KERN_DEBUG to netdev_dbg
Use the more standard macro to preface netdev->name. Fix casting on resource use. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r--drivers/net/forcedeth.c176
1 files changed, 87 insertions, 89 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index e5f9d4b5ee05..767d1eb87c94 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -1139,22 +1139,22 @@ static int mii_rw(struct net_device *dev, int addr, int miireg, int value)
1139 1139
1140 if (reg_delay(dev, NvRegMIIControl, NVREG_MIICTL_INUSE, 0, 1140 if (reg_delay(dev, NvRegMIIControl, NVREG_MIICTL_INUSE, 0,
1141 NV_MIIPHY_DELAY, NV_MIIPHY_DELAYMAX)) { 1141 NV_MIIPHY_DELAY, NV_MIIPHY_DELAYMAX)) {
1142 dprintk(KERN_DEBUG "%s: mii_rw of reg %d at PHY %d timed out.\n", 1142 netdev_dbg(dev, "mii_rw of reg %d at PHY %d timed out\n",
1143 dev->name, miireg, addr); 1143 miireg, addr);
1144 retval = -1; 1144 retval = -1;
1145 } else if (value != MII_READ) { 1145 } else if (value != MII_READ) {
1146 /* it was a write operation - fewer failures are detectable */ 1146 /* it was a write operation - fewer failures are detectable */
1147 dprintk(KERN_DEBUG "%s: mii_rw wrote 0x%x to reg %d at PHY %d\n", 1147 netdev_dbg(dev, "mii_rw wrote 0x%x to reg %d at PHY %d\n",
1148 dev->name, value, miireg, addr); 1148 value, miireg, addr);
1149 retval = 0; 1149 retval = 0;
1150 } else if (readl(base + NvRegMIIStatus) & NVREG_MIISTAT_ERROR) { 1150 } else if (readl(base + NvRegMIIStatus) & NVREG_MIISTAT_ERROR) {
1151 dprintk(KERN_DEBUG "%s: mii_rw of reg %d at PHY %d failed.\n", 1151 netdev_dbg(dev, "mii_rw of reg %d at PHY %d failed\n",
1152 dev->name, miireg, addr); 1152 miireg, addr);
1153 retval = -1; 1153 retval = -1;
1154 } else { 1154 } else {
1155 retval = readl(base + NvRegMIIData); 1155 retval = readl(base + NvRegMIIData);
1156 dprintk(KERN_DEBUG "%s: mii_rw read from reg %d at PHY %d: 0x%x.\n", 1156 netdev_dbg(dev, "mii_rw read from reg %d at PHY %d: 0x%x\n",
1157 dev->name, miireg, addr, retval); 1157 miireg, addr, retval);
1158 } 1158 }
1159 1159
1160 return retval; 1160 return retval;
@@ -1506,7 +1506,7 @@ static void nv_start_rx(struct net_device *dev)
1506 u8 __iomem *base = get_hwbase(dev); 1506 u8 __iomem *base = get_hwbase(dev);
1507 u32 rx_ctrl = readl(base + NvRegReceiverControl); 1507 u32 rx_ctrl = readl(base + NvRegReceiverControl);
1508 1508
1509 dprintk(KERN_DEBUG "%s: nv_start_rx\n", dev->name); 1509 netdev_dbg(dev, "%s\n", __func__);
1510 /* Already running? Stop it. */ 1510 /* Already running? Stop it. */
1511 if ((readl(base + NvRegReceiverControl) & NVREG_RCVCTL_START) && !np->mac_in_use) { 1511 if ((readl(base + NvRegReceiverControl) & NVREG_RCVCTL_START) && !np->mac_in_use) {
1512 rx_ctrl &= ~NVREG_RCVCTL_START; 1512 rx_ctrl &= ~NVREG_RCVCTL_START;
@@ -1519,8 +1519,8 @@ static void nv_start_rx(struct net_device *dev)
1519 if (np->mac_in_use) 1519 if (np->mac_in_use)
1520 rx_ctrl &= ~NVREG_RCVCTL_RX_PATH_EN; 1520 rx_ctrl &= ~NVREG_RCVCTL_RX_PATH_EN;
1521 writel(rx_ctrl, base + NvRegReceiverControl); 1521 writel(rx_ctrl, base + NvRegReceiverControl);
1522 dprintk(KERN_DEBUG "%s: nv_start_rx to duplex %d, speed 0x%08x.\n", 1522 netdev_dbg(dev, "%s: duplex %d, speed 0x%08x\n",
1523 dev->name, np->duplex, np->linkspeed); 1523 __func__, np->duplex, np->linkspeed);
1524 pci_push(base); 1524 pci_push(base);
1525} 1525}
1526 1526
@@ -1530,7 +1530,7 @@ static void nv_stop_rx(struct net_device *dev)
1530 u8 __iomem *base = get_hwbase(dev); 1530 u8 __iomem *base = get_hwbase(dev);
1531 u32 rx_ctrl = readl(base + NvRegReceiverControl); 1531 u32 rx_ctrl = readl(base + NvRegReceiverControl);
1532 1532
1533 dprintk(KERN_DEBUG "%s: nv_stop_rx\n", dev->name); 1533 netdev_dbg(dev, "%s\n", __func__);
1534 if (!np->mac_in_use) 1534 if (!np->mac_in_use)
1535 rx_ctrl &= ~NVREG_RCVCTL_START; 1535 rx_ctrl &= ~NVREG_RCVCTL_START;
1536 else 1536 else
@@ -1551,7 +1551,7 @@ static void nv_start_tx(struct net_device *dev)
1551 u8 __iomem *base = get_hwbase(dev); 1551 u8 __iomem *base = get_hwbase(dev);
1552 u32 tx_ctrl = readl(base + NvRegTransmitterControl); 1552 u32 tx_ctrl = readl(base + NvRegTransmitterControl);
1553 1553
1554 dprintk(KERN_DEBUG "%s: nv_start_tx\n", dev->name); 1554 netdev_dbg(dev, "%s\n", __func__);
1555 tx_ctrl |= NVREG_XMITCTL_START; 1555 tx_ctrl |= NVREG_XMITCTL_START;
1556 if (np->mac_in_use) 1556 if (np->mac_in_use)
1557 tx_ctrl &= ~NVREG_XMITCTL_TX_PATH_EN; 1557 tx_ctrl &= ~NVREG_XMITCTL_TX_PATH_EN;
@@ -1565,7 +1565,7 @@ static void nv_stop_tx(struct net_device *dev)
1565 u8 __iomem *base = get_hwbase(dev); 1565 u8 __iomem *base = get_hwbase(dev);
1566 u32 tx_ctrl = readl(base + NvRegTransmitterControl); 1566 u32 tx_ctrl = readl(base + NvRegTransmitterControl);
1567 1567
1568 dprintk(KERN_DEBUG "%s: nv_stop_tx\n", dev->name); 1568 netdev_dbg(dev, "%s\n", __func__);
1569 if (!np->mac_in_use) 1569 if (!np->mac_in_use)
1570 tx_ctrl &= ~NVREG_XMITCTL_START; 1570 tx_ctrl &= ~NVREG_XMITCTL_START;
1571 else 1571 else
@@ -1598,7 +1598,7 @@ static void nv_txrx_reset(struct net_device *dev)
1598 struct fe_priv *np = netdev_priv(dev); 1598 struct fe_priv *np = netdev_priv(dev);
1599 u8 __iomem *base = get_hwbase(dev); 1599 u8 __iomem *base = get_hwbase(dev);
1600 1600
1601 dprintk(KERN_DEBUG "%s: nv_txrx_reset\n", dev->name); 1601 netdev_dbg(dev, "%s\n", __func__);
1602 writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl); 1602 writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
1603 pci_push(base); 1603 pci_push(base);
1604 udelay(NV_TXRX_RESET_DELAY); 1604 udelay(NV_TXRX_RESET_DELAY);
@@ -1612,7 +1612,7 @@ static void nv_mac_reset(struct net_device *dev)
1612 u8 __iomem *base = get_hwbase(dev); 1612 u8 __iomem *base = get_hwbase(dev);
1613 u32 temp1, temp2, temp3; 1613 u32 temp1, temp2, temp3;
1614 1614
1615 dprintk(KERN_DEBUG "%s: nv_mac_reset\n", dev->name); 1615 netdev_dbg(dev, "%s\n", __func__);
1616 1616
1617 writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl); 1617 writel(NVREG_TXRXCTL_BIT2 | NVREG_TXRXCTL_RESET | np->txrxctl_bits, base + NvRegTxRxControl);
1618 pci_push(base); 1618 pci_push(base);
@@ -2190,8 +2190,8 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
2190 2190
2191 spin_unlock_irqrestore(&np->lock, flags); 2191 spin_unlock_irqrestore(&np->lock, flags);
2192 2192
2193 dprintk(KERN_DEBUG "%s: nv_start_xmit: entries %d queued for transmission. tx_flags_extra: %x\n", 2193 netdev_dbg(dev, "%s: entries %d queued for transmission. tx_flags_extra: %x\n",
2194 dev->name, entries, tx_flags_extra); 2194 __func__, entries, tx_flags_extra);
2195 { 2195 {
2196 int j; 2196 int j;
2197 for (j = 0; j < 64; j++) { 2197 for (j = 0; j < 64; j++) {
@@ -2341,8 +2341,8 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
2341 2341
2342 spin_unlock_irqrestore(&np->lock, flags); 2342 spin_unlock_irqrestore(&np->lock, flags);
2343 2343
2344 dprintk(KERN_DEBUG "%s: nv_start_xmit_optimized: entries %d queued for transmission. tx_flags_extra: %x\n", 2344 netdev_dbg(dev, "%s: entries %d queued for transmission. tx_flags_extra: %x\n",
2345 dev->name, entries, tx_flags_extra); 2345 __func__, entries, tx_flags_extra);
2346 { 2346 {
2347 int j; 2347 int j;
2348 for (j = 0; j < 64; j++) { 2348 for (j = 0; j < 64; j++) {
@@ -2391,8 +2391,7 @@ static int nv_tx_done(struct net_device *dev, int limit)
2391 !((flags = le32_to_cpu(np->get_tx.orig->flaglen)) & NV_TX_VALID) && 2391 !((flags = le32_to_cpu(np->get_tx.orig->flaglen)) & NV_TX_VALID) &&
2392 (tx_work < limit)) { 2392 (tx_work < limit)) {
2393 2393
2394 dprintk(KERN_DEBUG "%s: nv_tx_done: flags 0x%x.\n", 2394 netdev_dbg(dev, "%s: flags 0x%x\n", __func__, flags);
2395 dev->name, flags);
2396 2395
2397 nv_unmap_txskb(np, np->get_tx_ctx); 2396 nv_unmap_txskb(np, np->get_tx_ctx);
2398 2397
@@ -2456,8 +2455,7 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)
2456 !((flags = le32_to_cpu(np->get_tx.ex->flaglen)) & NV_TX2_VALID) && 2455 !((flags = le32_to_cpu(np->get_tx.ex->flaglen)) & NV_TX2_VALID) &&
2457 (tx_work < limit)) { 2456 (tx_work < limit)) {
2458 2457
2459 dprintk(KERN_DEBUG "%s: nv_tx_done_optimized: flags 0x%x.\n", 2458 netdev_dbg(dev, "%s: flags 0x%x\n", __func__, flags);
2460 dev->name, flags);
2461 2459
2462 nv_unmap_txskb(np, np->get_tx_ctx); 2460 nv_unmap_txskb(np, np->get_tx_ctx);
2463 2461
@@ -2608,8 +2606,8 @@ static int nv_getlen(struct net_device *dev, void *packet, int datalen)
2608 protolen = ntohs(((struct ethhdr *)packet)->h_proto); 2606 protolen = ntohs(((struct ethhdr *)packet)->h_proto);
2609 hdrlen = ETH_HLEN; 2607 hdrlen = ETH_HLEN;
2610 } 2608 }
2611 dprintk(KERN_DEBUG "%s: nv_getlen: datalen %d, protolen %d, hdrlen %d\n", 2609 netdev_dbg(dev, "%s: datalen %d, protolen %d, hdrlen %d\n",
2612 dev->name, datalen, protolen, hdrlen); 2610 __func__, datalen, protolen, hdrlen);
2613 if (protolen > ETH_DATA_LEN) 2611 if (protolen > ETH_DATA_LEN)
2614 return datalen; /* Value in proto field not a len, no checks possible */ 2612 return datalen; /* Value in proto field not a len, no checks possible */
2615 2613
@@ -2620,26 +2618,25 @@ static int nv_getlen(struct net_device *dev, void *packet, int datalen)
2620 /* more data on wire than in 802 header, trim of 2618 /* more data on wire than in 802 header, trim of
2621 * additional data. 2619 * additional data.
2622 */ 2620 */
2623 dprintk(KERN_DEBUG "%s: nv_getlen: accepting %d bytes.\n", 2621 netdev_dbg(dev, "%s: accepting %d bytes\n",
2624 dev->name, protolen); 2622 __func__, protolen);
2625 return protolen; 2623 return protolen;
2626 } else { 2624 } else {
2627 /* less data on wire than mentioned in header. 2625 /* less data on wire than mentioned in header.
2628 * Discard the packet. 2626 * Discard the packet.
2629 */ 2627 */
2630 dprintk(KERN_DEBUG "%s: nv_getlen: discarding long packet.\n", 2628 netdev_dbg(dev, "%s: discarding long packet\n",
2631 dev->name); 2629 __func__);
2632 return -1; 2630 return -1;
2633 } 2631 }
2634 } else { 2632 } else {
2635 /* short packet. Accept only if 802 values are also short */ 2633 /* short packet. Accept only if 802 values are also short */
2636 if (protolen > ETH_ZLEN) { 2634 if (protolen > ETH_ZLEN) {
2637 dprintk(KERN_DEBUG "%s: nv_getlen: discarding short packet.\n", 2635 netdev_dbg(dev, "%s: discarding short packet\n",
2638 dev->name); 2636 __func__);
2639 return -1; 2637 return -1;
2640 } 2638 }
2641 dprintk(KERN_DEBUG "%s: nv_getlen: accepting %d bytes.\n", 2639 netdev_dbg(dev, "%s: accepting %d bytes\n", __func__, datalen);
2642 dev->name, datalen);
2643 return datalen; 2640 return datalen;
2644 } 2641 }
2645} 2642}
@@ -2656,8 +2653,7 @@ static int nv_rx_process(struct net_device *dev, int limit)
2656 !((flags = le32_to_cpu(np->get_rx.orig->flaglen)) & NV_RX_AVAIL) && 2653 !((flags = le32_to_cpu(np->get_rx.orig->flaglen)) & NV_RX_AVAIL) &&
2657 (rx_work < limit)) { 2654 (rx_work < limit)) {
2658 2655
2659 dprintk(KERN_DEBUG "%s: nv_rx_process: flags 0x%x.\n", 2656 netdev_dbg(dev, "%s: flags 0x%x\n", __func__, flags);
2660 dev->name, flags);
2661 2657
2662 /* 2658 /*
2663 * the packet is for us - immediately tear down the pci mapping. 2659 * the packet is for us - immediately tear down the pci mapping.
@@ -2672,9 +2668,9 @@ static int nv_rx_process(struct net_device *dev, int limit)
2672 2668
2673 { 2669 {
2674 int j; 2670 int j;
2675 dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).", flags); 2671 netdev_dbg(dev, "Dumping packet (flags 0x%x)\n", flags);
2676 for (j = 0; j < 64; j++) { 2672 for (j = 0; j < 64; j++) {
2677 if ((j%16) == 0) 2673 if ((j%16) == 0 && j)
2678 dprintk("\n%03x:", j); 2674 dprintk("\n%03x:", j);
2679 dprintk(" %02x", ((unsigned char *)skb->data)[j]); 2675 dprintk(" %02x", ((unsigned char *)skb->data)[j]);
2680 } 2676 }
@@ -2754,8 +2750,8 @@ static int nv_rx_process(struct net_device *dev, int limit)
2754 /* got a valid packet - forward it to the network core */ 2750 /* got a valid packet - forward it to the network core */
2755 skb_put(skb, len); 2751 skb_put(skb, len);
2756 skb->protocol = eth_type_trans(skb, dev); 2752 skb->protocol = eth_type_trans(skb, dev);
2757 dprintk(KERN_DEBUG "%s: nv_rx_process: %d bytes, proto %d accepted.\n", 2753 netdev_dbg(dev, "%s: %d bytes, proto %d accepted\n",
2758 dev->name, len, skb->protocol); 2754 __func__, len, skb->protocol);
2759 napi_gro_receive(&np->napi, skb); 2755 napi_gro_receive(&np->napi, skb);
2760 dev->stats.rx_packets++; 2756 dev->stats.rx_packets++;
2761 dev->stats.rx_bytes += len; 2757 dev->stats.rx_bytes += len;
@@ -2784,8 +2780,7 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
2784 !((flags = le32_to_cpu(np->get_rx.ex->flaglen)) & NV_RX2_AVAIL) && 2780 !((flags = le32_to_cpu(np->get_rx.ex->flaglen)) & NV_RX2_AVAIL) &&
2785 (rx_work < limit)) { 2781 (rx_work < limit)) {
2786 2782
2787 dprintk(KERN_DEBUG "%s: nv_rx_process_optimized: flags 0x%x.\n", 2783 netdev_dbg(dev, "%s: flags 0x%x\n", __func__, flags);
2788 dev->name, flags);
2789 2784
2790 /* 2785 /*
2791 * the packet is for us - immediately tear down the pci mapping. 2786 * the packet is for us - immediately tear down the pci mapping.
@@ -2800,9 +2795,9 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
2800 2795
2801 { 2796 {
2802 int j; 2797 int j;
2803 dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).", flags); 2798 netdev_dbg(dev, "Dumping packet (flags 0x%x)\n", flags);
2804 for (j = 0; j < 64; j++) { 2799 for (j = 0; j < 64; j++) {
2805 if ((j%16) == 0) 2800 if ((j%16) == 0 && j)
2806 dprintk("\n%03x:", j); 2801 dprintk("\n%03x:", j);
2807 dprintk(" %02x", ((unsigned char *)skb->data)[j]); 2802 dprintk(" %02x", ((unsigned char *)skb->data)[j]);
2808 } 2803 }
@@ -2840,8 +2835,8 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
2840 skb->protocol = eth_type_trans(skb, dev); 2835 skb->protocol = eth_type_trans(skb, dev);
2841 prefetch(skb->data); 2836 prefetch(skb->data);
2842 2837
2843 dprintk(KERN_DEBUG "%s: nv_rx_process_optimized: %d bytes, proto %d accepted.\n", 2838 netdev_dbg(dev, "%s: %d bytes, proto %d accepted\n",
2844 dev->name, len, skb->protocol); 2839 __func__, len, skb->protocol);
2845 2840
2846 if (likely(!np->vlangrp)) { 2841 if (likely(!np->vlangrp)) {
2847 napi_gro_receive(&np->napi, skb); 2842 napi_gro_receive(&np->napi, skb);
@@ -3134,8 +3129,8 @@ static int nv_update_linkspeed(struct net_device *dev)
3134 mii_status = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ); 3129 mii_status = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
3135 3130
3136 if (!(mii_status & BMSR_LSTATUS)) { 3131 if (!(mii_status & BMSR_LSTATUS)) {
3137 dprintk(KERN_DEBUG "%s: no link detected by phy - falling back to 10HD.\n", 3132 netdev_dbg(dev,
3138 dev->name); 3133 "no link detected by phy - falling back to 10HD\n");
3139 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; 3134 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
3140 newdup = 0; 3135 newdup = 0;
3141 retval = 0; 3136 retval = 0;
@@ -3143,8 +3138,8 @@ static int nv_update_linkspeed(struct net_device *dev)
3143 } 3138 }
3144 3139
3145 if (np->autoneg == 0) { 3140 if (np->autoneg == 0) {
3146 dprintk(KERN_DEBUG "%s: nv_update_linkspeed: autoneg off, PHY set to 0x%04x.\n", 3141 netdev_dbg(dev, "%s: autoneg off, PHY set to 0x%04x\n",
3147 dev->name, np->fixed_mode); 3142 __func__, np->fixed_mode);
3148 if (np->fixed_mode & LPA_100FULL) { 3143 if (np->fixed_mode & LPA_100FULL) {
3149 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_100; 3144 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_100;
3150 newdup = 1; 3145 newdup = 1;
@@ -3167,14 +3162,15 @@ static int nv_update_linkspeed(struct net_device *dev)
3167 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; 3162 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
3168 newdup = 0; 3163 newdup = 0;
3169 retval = 0; 3164 retval = 0;
3170 dprintk(KERN_DEBUG "%s: autoneg not completed - falling back to 10HD.\n", dev->name); 3165 netdev_dbg(dev,
3166 "autoneg not completed - falling back to 10HD\n");
3171 goto set_speed; 3167 goto set_speed;
3172 } 3168 }
3173 3169
3174 adv = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ); 3170 adv = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ);
3175 lpa = mii_rw(dev, np->phyaddr, MII_LPA, MII_READ); 3171 lpa = mii_rw(dev, np->phyaddr, MII_LPA, MII_READ);
3176 dprintk(KERN_DEBUG "%s: nv_update_linkspeed: PHY advertises 0x%04x, lpa 0x%04x.\n", 3172 netdev_dbg(dev, "%s: PHY advertises 0x%04x, lpa 0x%04x\n",
3177 dev->name, adv, lpa); 3173 __func__, adv, lpa);
3178 3174
3179 retval = 1; 3175 retval = 1;
3180 if (np->gigabit == PHY_GIGABIT) { 3176 if (np->gigabit == PHY_GIGABIT) {
@@ -3183,8 +3179,8 @@ static int nv_update_linkspeed(struct net_device *dev)
3183 3179
3184 if ((control_1000 & ADVERTISE_1000FULL) && 3180 if ((control_1000 & ADVERTISE_1000FULL) &&
3185 (status_1000 & LPA_1000FULL)) { 3181 (status_1000 & LPA_1000FULL)) {
3186 dprintk(KERN_DEBUG "%s: nv_update_linkspeed: GBit ethernet detected.\n", 3182 netdev_dbg(dev, "%s: GBit ethernet detected\n",
3187 dev->name); 3183 __func__);
3188 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_1000; 3184 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_1000;
3189 newdup = 1; 3185 newdup = 1;
3190 goto set_speed; 3186 goto set_speed;
@@ -3206,7 +3202,8 @@ static int nv_update_linkspeed(struct net_device *dev)
3206 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; 3202 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
3207 newdup = 0; 3203 newdup = 0;
3208 } else { 3204 } else {
3209 dprintk(KERN_DEBUG "%s: bad ability %04x - falling back to 10HD.\n", dev->name, adv_lpa); 3205 netdev_dbg(dev, "bad ability %04x - falling back to 10HD\n",
3206 adv_lpa);
3210 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; 3207 newls = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;
3211 newdup = 0; 3208 newdup = 0;
3212 } 3209 }
@@ -3363,7 +3360,7 @@ static void nv_link_irq(struct net_device *dev)
3363 3360
3364 if (miistat & (NVREG_MIISTAT_LINKCHANGE)) 3361 if (miistat & (NVREG_MIISTAT_LINKCHANGE))
3365 nv_linkchange(dev); 3362 nv_linkchange(dev);
3366 dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name); 3363 netdev_dbg(dev, "link change notification done\n");
3367} 3364}
3368 3365
3369static void nv_msi_workaround(struct fe_priv *np) 3366static void nv_msi_workaround(struct fe_priv *np)
@@ -3414,7 +3411,7 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
3414 struct fe_priv *np = netdev_priv(dev); 3411 struct fe_priv *np = netdev_priv(dev);
3415 u8 __iomem *base = get_hwbase(dev); 3412 u8 __iomem *base = get_hwbase(dev);
3416 3413
3417 dprintk(KERN_DEBUG "%s: nv_nic_irq\n", dev->name); 3414 netdev_dbg(dev, "%s\n", __func__);
3418 3415
3419 if (!(np->msi_flags & NV_MSI_X_ENABLED)) { 3416 if (!(np->msi_flags & NV_MSI_X_ENABLED)) {
3420 np->events = readl(base + NvRegIrqStatus); 3417 np->events = readl(base + NvRegIrqStatus);
@@ -3423,7 +3420,7 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
3423 np->events = readl(base + NvRegMSIXIrqStatus); 3420 np->events = readl(base + NvRegMSIXIrqStatus);
3424 writel(np->events, base + NvRegMSIXIrqStatus); 3421 writel(np->events, base + NvRegMSIXIrqStatus);
3425 } 3422 }
3426 dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, np->events); 3423 netdev_dbg(dev, "irq: %08x\n", np->events);
3427 if (!(np->events & np->irqmask)) 3424 if (!(np->events & np->irqmask))
3428 return IRQ_NONE; 3425 return IRQ_NONE;
3429 3426
@@ -3437,7 +3434,7 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
3437 __napi_schedule(&np->napi); 3434 __napi_schedule(&np->napi);
3438 } 3435 }
3439 3436
3440 dprintk(KERN_DEBUG "%s: nv_nic_irq completed\n", dev->name); 3437 netdev_dbg(dev, "%s: completed\n", __func__);
3441 3438
3442 return IRQ_HANDLED; 3439 return IRQ_HANDLED;
3443} 3440}
@@ -3453,7 +3450,7 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
3453 struct fe_priv *np = netdev_priv(dev); 3450 struct fe_priv *np = netdev_priv(dev);
3454 u8 __iomem *base = get_hwbase(dev); 3451 u8 __iomem *base = get_hwbase(dev);
3455 3452
3456 dprintk(KERN_DEBUG "%s: nv_nic_irq_optimized\n", dev->name); 3453 netdev_dbg(dev, "%s\n", __func__);
3457 3454
3458 if (!(np->msi_flags & NV_MSI_X_ENABLED)) { 3455 if (!(np->msi_flags & NV_MSI_X_ENABLED)) {
3459 np->events = readl(base + NvRegIrqStatus); 3456 np->events = readl(base + NvRegIrqStatus);
@@ -3462,7 +3459,7 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
3462 np->events = readl(base + NvRegMSIXIrqStatus); 3459 np->events = readl(base + NvRegMSIXIrqStatus);
3463 writel(np->events, base + NvRegMSIXIrqStatus); 3460 writel(np->events, base + NvRegMSIXIrqStatus);
3464 } 3461 }
3465 dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, np->events); 3462 netdev_dbg(dev, "irq: %08x\n", np->events);
3466 if (!(np->events & np->irqmask)) 3463 if (!(np->events & np->irqmask))
3467 return IRQ_NONE; 3464 return IRQ_NONE;
3468 3465
@@ -3475,7 +3472,7 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
3475 writel(0, base + NvRegIrqMask); 3472 writel(0, base + NvRegIrqMask);
3476 __napi_schedule(&np->napi); 3473 __napi_schedule(&np->napi);
3477 } 3474 }
3478 dprintk(KERN_DEBUG "%s: nv_nic_irq_optimized completed\n", dev->name); 3475 netdev_dbg(dev, "%s: completed\n", __func__);
3479 3476
3480 return IRQ_HANDLED; 3477 return IRQ_HANDLED;
3481} 3478}
@@ -3489,12 +3486,12 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data)
3489 int i; 3486 int i;
3490 unsigned long flags; 3487 unsigned long flags;
3491 3488
3492 dprintk(KERN_DEBUG "%s: nv_nic_irq_tx\n", dev->name); 3489 netdev_dbg(dev, "%s\n", __func__);
3493 3490
3494 for (i = 0;; i++) { 3491 for (i = 0;; i++) {
3495 events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_TX_ALL; 3492 events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_TX_ALL;
3496 writel(NVREG_IRQ_TX_ALL, base + NvRegMSIXIrqStatus); 3493 writel(NVREG_IRQ_TX_ALL, base + NvRegMSIXIrqStatus);
3497 dprintk(KERN_DEBUG "%s: tx irq: %08x\n", dev->name, events); 3494 netdev_dbg(dev, "tx irq: %08x\n", events);
3498 if (!(events & np->irqmask)) 3495 if (!(events & np->irqmask))
3499 break; 3496 break;
3500 3497
@@ -3518,7 +3515,7 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data)
3518 } 3515 }
3519 3516
3520 } 3517 }
3521 dprintk(KERN_DEBUG "%s: nv_nic_irq_tx completed\n", dev->name); 3518 netdev_dbg(dev, "%s: completed\n", __func__);
3522 3519
3523 return IRQ_RETVAL(i); 3520 return IRQ_RETVAL(i);
3524} 3521}
@@ -3603,12 +3600,12 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data)
3603 int i; 3600 int i;
3604 unsigned long flags; 3601 unsigned long flags;
3605 3602
3606 dprintk(KERN_DEBUG "%s: nv_nic_irq_rx\n", dev->name); 3603 netdev_dbg(dev, "%s\n", __func__);
3607 3604
3608 for (i = 0;; i++) { 3605 for (i = 0;; i++) {
3609 events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_RX_ALL; 3606 events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_RX_ALL;
3610 writel(NVREG_IRQ_RX_ALL, base + NvRegMSIXIrqStatus); 3607 writel(NVREG_IRQ_RX_ALL, base + NvRegMSIXIrqStatus);
3611 dprintk(KERN_DEBUG "%s: rx irq: %08x\n", dev->name, events); 3608 netdev_dbg(dev, "rx irq: %08x\n", events);
3612 if (!(events & np->irqmask)) 3609 if (!(events & np->irqmask))
3613 break; 3610 break;
3614 3611
@@ -3636,7 +3633,7 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data)
3636 break; 3633 break;
3637 } 3634 }
3638 } 3635 }
3639 dprintk(KERN_DEBUG "%s: nv_nic_irq_rx completed\n", dev->name); 3636 netdev_dbg(dev, "%s: completed\n", __func__);
3640 3637
3641 return IRQ_RETVAL(i); 3638 return IRQ_RETVAL(i);
3642} 3639}
@@ -3650,12 +3647,12 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data)
3650 int i; 3647 int i;
3651 unsigned long flags; 3648 unsigned long flags;
3652 3649
3653 dprintk(KERN_DEBUG "%s: nv_nic_irq_other\n", dev->name); 3650 netdev_dbg(dev, "%s\n", __func__);
3654 3651
3655 for (i = 0;; i++) { 3652 for (i = 0;; i++) {
3656 events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_OTHER; 3653 events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_OTHER;
3657 writel(NVREG_IRQ_OTHER, base + NvRegMSIXIrqStatus); 3654 writel(NVREG_IRQ_OTHER, base + NvRegMSIXIrqStatus);
3658 dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, events); 3655 netdev_dbg(dev, "irq: %08x\n", events);
3659 if (!(events & np->irqmask)) 3656 if (!(events & np->irqmask))
3660 break; 3657 break;
3661 3658
@@ -3705,7 +3702,7 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data)
3705 } 3702 }
3706 3703
3707 } 3704 }
3708 dprintk(KERN_DEBUG "%s: nv_nic_irq_other completed\n", dev->name); 3705 netdev_dbg(dev, "%s: completed\n", __func__);
3709 3706
3710 return IRQ_RETVAL(i); 3707 return IRQ_RETVAL(i);
3711} 3708}
@@ -3717,7 +3714,7 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
3717 u8 __iomem *base = get_hwbase(dev); 3714 u8 __iomem *base = get_hwbase(dev);
3718 u32 events; 3715 u32 events;
3719 3716
3720 dprintk(KERN_DEBUG "%s: nv_nic_irq_test\n", dev->name); 3717 netdev_dbg(dev, "%s\n", __func__);
3721 3718
3722 if (!(np->msi_flags & NV_MSI_X_ENABLED)) { 3719 if (!(np->msi_flags & NV_MSI_X_ENABLED)) {
3723 events = readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK; 3720 events = readl(base + NvRegIrqStatus) & NVREG_IRQSTAT_MASK;
@@ -3727,7 +3724,7 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
3727 writel(NVREG_IRQ_TIMER, base + NvRegMSIXIrqStatus); 3724 writel(NVREG_IRQ_TIMER, base + NvRegMSIXIrqStatus);
3728 } 3725 }
3729 pci_push(base); 3726 pci_push(base);
3730 dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, events); 3727 netdev_dbg(dev, "irq: %08x\n", events);
3731 if (!(events & NVREG_IRQ_TIMER)) 3728 if (!(events & NVREG_IRQ_TIMER))
3732 return IRQ_RETVAL(0); 3729 return IRQ_RETVAL(0);
3733 3730
@@ -3737,7 +3734,7 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
3737 np->intr_test = 1; 3734 np->intr_test = 1;
3738 spin_unlock(&np->lock); 3735 spin_unlock(&np->lock);
3739 3736
3740 dprintk(KERN_DEBUG "%s: nv_nic_irq_test completed\n", dev->name); 3737 netdev_dbg(dev, "%s: completed\n", __func__);
3741 3738
3742 return IRQ_RETVAL(1); 3739 return IRQ_RETVAL(1);
3743} 3740}
@@ -4874,21 +4871,21 @@ static int nv_loopback_test(struct net_device *dev)
4874 if (ret) { 4871 if (ret) {
4875 if (len != pkt_len) { 4872 if (len != pkt_len) {
4876 ret = 0; 4873 ret = 0;
4877 dprintk(KERN_DEBUG "%s: loopback len mismatch %d vs %d\n", 4874 netdev_dbg(dev, "loopback len mismatch %d vs %d\n",
4878 dev->name, len, pkt_len); 4875 len, pkt_len);
4879 } else { 4876 } else {
4880 rx_skb = np->rx_skb[0].skb; 4877 rx_skb = np->rx_skb[0].skb;
4881 for (i = 0; i < pkt_len; i++) { 4878 for (i = 0; i < pkt_len; i++) {
4882 if (rx_skb->data[i] != (u8)(i & 0xff)) { 4879 if (rx_skb->data[i] != (u8)(i & 0xff)) {
4883 ret = 0; 4880 ret = 0;
4884 dprintk(KERN_DEBUG "%s: loopback pattern check failed on byte %d\n", 4881 netdev_dbg(dev, "loopback pattern check failed on byte %d\n",
4885 dev->name, i); 4882 i);
4886 break; 4883 break;
4887 } 4884 }
4888 } 4885 }
4889 } 4886 }
4890 } else { 4887 } else {
4891 dprintk(KERN_DEBUG "%s: loopback - did not receive test packet\n", dev->name); 4888 netdev_dbg(dev, "loopback - did not receive test packet\n");
4892 } 4889 }
4893 4890
4894 pci_unmap_single(np->pci_dev, test_dma_addr, 4891 pci_unmap_single(np->pci_dev, test_dma_addr,
@@ -5138,7 +5135,7 @@ static int nv_open(struct net_device *dev)
5138 int oom, i; 5135 int oom, i;
5139 u32 low; 5136 u32 low;
5140 5137
5141 dprintk(KERN_DEBUG "nv_open: begin\n"); 5138 netdev_dbg(dev, "%s\n", __func__);
5142 5139
5143 /* power up phy */ 5140 /* power up phy */
5144 mii_rw(dev, np->phyaddr, MII_BMCR, 5141 mii_rw(dev, np->phyaddr, MII_BMCR,
@@ -5435,10 +5432,11 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5435 err = -EINVAL; 5432 err = -EINVAL;
5436 addr = 0; 5433 addr = 0;
5437 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { 5434 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
5438 dprintk(KERN_DEBUG "%s: resource %d start %p len %ld flags 0x%08lx.\n", 5435 netdev_dbg(dev, "%s: resource %d start %p len %lld flags 0x%08lx\n",
5439 pci_name(pci_dev), i, (void *)pci_resource_start(pci_dev, i), 5436 pci_name(pci_dev), i,
5440 pci_resource_len(pci_dev, i), 5437 (void *)(unsigned long)pci_resource_start(pci_dev, i),
5441 pci_resource_flags(pci_dev, i)); 5438 (long long)pci_resource_len(pci_dev, i),
5439 pci_resource_flags(pci_dev, i));
5442 if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM && 5440 if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM &&
5443 pci_resource_len(pci_dev, i) >= np->register_size) { 5441 pci_resource_len(pci_dev, i) >= np->register_size) {
5444 addr = pci_resource_start(pci_dev, i); 5442 addr = pci_resource_start(pci_dev, i);
@@ -5607,8 +5605,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5607 random_ether_addr(dev->dev_addr); 5605 random_ether_addr(dev->dev_addr);
5608 } 5606 }
5609 5607
5610 dprintk(KERN_DEBUG "%s: MAC Address %pM\n", 5608 netdev_dbg(dev, "%s: MAC Address %pM\n",
5611 pci_name(pci_dev), dev->dev_addr); 5609 pci_name(pci_dev), dev->dev_addr);
5612 5610
5613 /* set mac address */ 5611 /* set mac address */
5614 nv_copy_mac_to_hw(dev); 5612 nv_copy_mac_to_hw(dev);
@@ -5741,8 +5739,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5741 np->phy_model = id2 & PHYID2_MODEL_MASK; 5739 np->phy_model = id2 & PHYID2_MODEL_MASK;
5742 id1 = (id1 & PHYID1_OUI_MASK) << PHYID1_OUI_SHFT; 5740 id1 = (id1 & PHYID1_OUI_MASK) << PHYID1_OUI_SHFT;
5743 id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT; 5741 id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT;
5744 dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n", 5742 netdev_dbg(dev, "%s: %s: Found PHY %04x:%04x at address %d\n",
5745 pci_name(pci_dev), id1, id2, phyaddr); 5743 pci_name(pci_dev), __func__, id1, id2, phyaddr);
5746 np->phyaddr = phyaddr; 5744 np->phyaddr = phyaddr;
5747 np->phy_oui = id1 | id2; 5745 np->phy_oui = id1 | id2;
5748 5746