diff options
author | Michael Chan <mchan@broadcom.com> | 2006-12-07 00:22:54 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-12-07 00:22:54 -0800 |
commit | 9f88f29fc502192824aba092e90af1297a87eb82 (patch) | |
tree | a0a718020af8dc02e345c0815c0b9437bc8a878d /drivers/net/tg3.c | |
parent | 3600d918d870456ea8e7bb9d47f327de5c20f3d6 (diff) | |
download | kernel_samsung_tuna-9f88f29fc502192824aba092e90af1297a87eb82.zip kernel_samsung_tuna-9f88f29fc502192824aba092e90af1297a87eb82.tar.gz kernel_samsung_tuna-9f88f29fc502192824aba092e90af1297a87eb82.tar.bz2 |
[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.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 576e9ea..0b50f1f 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) static void tg3_link_report(struct tg3 *tp) { if (!netif_carrier_ok(tp->dev)) { - printk(KERN_INFO PFX "%s: Link is down.\n", tp->dev->name); - } else { + if (netif_msg_link(tp)) + printk(KERN_INFO PFX "%s: Link is down.\n", + tp->dev->name); + } else if (netif_msg_link(tp)) { printk(KERN_INFO PFX "%s: Link is up at %d Mbps, %s duplex.\n", tp->dev->name, (tp->link_config.active_speed == SPEED_1000 ? @@ -3710,8 +3712,9 @@ static void tg3_tx_timeout(struct net_device *dev) { struct tg3 *tp = netdev_priv(dev); - printk(KERN_ERR PFX "%s: transmit timed out, resetting\n", - dev->name); + if (netif_msg_tx_err(tp)) + printk(KERN_ERR PFX "%s: transmit timed out, resetting\n", + dev->name); schedule_work(&tp->reset_task); } @@ -8665,7 +8668,9 @@ static int tg3_test_registers(struct tg3 *tp) return 0; out: - printk(KERN_ERR PFX "Register test failed at offset %x\n", offset); + if (netif_msg_hw(tp)) + printk(KERN_ERR PFX "Register test failed at offset %x\n", + offset); tw32(offset, save_val); return -EIO; } |