aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2006-12-07 03:22:54 -0500
committerDavid S. Miller <davem@davemloft.net>2006-12-07 03:22:54 -0500
commit9f88f29fc502192824aba092e90af1297a87eb82 (patch)
treea0a718020af8dc02e345c0815c0b9437bc8a878d /drivers/net/tg3.c
parent3600d918d870456ea8e7bb9d47f327de5c20f3d6 (diff)
[TG3]: Use netif_msg_*.
Use netif_msg_* to turn on or off some messages. Based on Stephen Hemminger's initial patch. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 576e9ea0a566..0b50f1fc4e63 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1402,8 +1402,10 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
1402static void tg3_link_report(struct tg3 *tp) 1402static void tg3_link_report(struct tg3 *tp)
1403{ 1403{
1404 if (!netif_carrier_ok(tp->dev)) { 1404 if (!netif_carrier_ok(tp->dev)) {
1405 printk(KERN_INFO PFX "%s: Link is down.\n", tp->dev->name); 1405 if (netif_msg_link(tp))
1406 } else { 1406 printk(KERN_INFO PFX "%s: Link is down.\n",
1407 tp->dev->name);
1408 } else if (netif_msg_link(tp)) {
1407 printk(KERN_INFO PFX "%s: Link is up at %d Mbps, %s duplex.\n", 1409 printk(KERN_INFO PFX "%s: Link is up at %d Mbps, %s duplex.\n",
1408 tp->dev->name, 1410 tp->dev->name,
1409 (tp->link_config.active_speed == SPEED_1000 ? 1411 (tp->link_config.active_speed == SPEED_1000 ?
@@ -3710,8 +3712,9 @@ static void tg3_tx_timeout(struct net_device *dev)
3710{ 3712{
3711 struct tg3 *tp = netdev_priv(dev); 3713 struct tg3 *tp = netdev_priv(dev);
3712 3714
3713 printk(KERN_ERR PFX "%s: transmit timed out, resetting\n", 3715 if (netif_msg_tx_err(tp))
3714 dev->name); 3716 printk(KERN_ERR PFX "%s: transmit timed out, resetting\n",
3717 dev->name);
3715 3718
3716 schedule_work(&tp->reset_task); 3719 schedule_work(&tp->reset_task);
3717} 3720}
@@ -8665,7 +8668,9 @@ static int tg3_test_registers(struct tg3 *tp)
8665 return 0; 8668 return 0;
8666 8669
8667out: 8670out:
8668 printk(KERN_ERR PFX "Register test failed at offset %x\n", offset); 8671 if (netif_msg_hw(tp))
8672 printk(KERN_ERR PFX "Register test failed at offset %x\n",
8673 offset);
8669 tw32(offset, save_val); 8674 tw32(offset, save_val);
8670 return -EIO; 8675 return -EIO;
8671} 8676}