diff options
author | glebius <glebius@FreeBSD.org> | 2006-09-15 10:40:54 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2006-09-15 10:40:54 +0000 |
commit | aeb9aeaa73fe735ddc4a606776072563dd9b6b43 (patch) | |
tree | ae382d23f768d8bc206d445054d2cee99c94d544 /sys/pci/if_wb.c | |
parent | 6b78b3a81dfd58cd5838b6fae2c4f76e95a5f930 (diff) | |
download | FreeBSD-src-aeb9aeaa73fe735ddc4a606776072563dd9b6b43.zip FreeBSD-src-aeb9aeaa73fe735ddc4a606776072563dd9b6b43.tar.gz |
Consistently use if_printf() only in interface methods: if_start,
if_ioctl, if_watchdog, etc, or in functions that are used by
these methods only. In all other cases use device_printf().
This also fixes several panics, when if_printf() is called before
softc->ifp was initialized.
Submitted by: Alex Lyashkov <umka sevcity.net>
Diffstat (limited to 'sys/pci/if_wb.c')
-rw-r--r-- | sys/pci/if_wb.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c index 486735d..1a59713 100644 --- a/sys/pci/if_wb.c +++ b/sys/pci/if_wb.c @@ -655,7 +655,7 @@ wb_setcfg(sc, media) } if (i == WB_TIMEOUT) - if_printf(sc->wb_ifp, + device_printf(sc->wb_dev, "failed to force tx and rx to idle state\n"); } @@ -696,7 +696,7 @@ wb_reset(sc) break; } if (i == WB_TIMEOUT) - if_printf(sc->wb_ifp, "reset never completed!\n"); + device_printf(sc->wb_dev, "reset never completed!\n"); /* Wait a little while for the chip to get its brains in order. */ DELAY(1000); @@ -784,6 +784,7 @@ wb_attach(dev) int error = 0, rid; sc = device_get_softc(dev); + sc->wb_dev = dev; mtx_init(&sc->wb_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); @@ -1087,8 +1088,9 @@ wb_rxeof(sc) !(rxstat & WB_RXSTAT_RXCMP)) { ifp->if_ierrors++; wb_newbuf(sc, cur_rx, m); - if_printf(ifp, "receiver babbling: possible chip " - "bug, forcing reset\n"); + device_printf(sc->wb_dev, + "receiver babbling: possible chip bug," + " forcing reset\n"); wb_fixmedia(sc); wb_reset(sc); wb_init_locked(sc); @@ -1602,7 +1604,7 @@ wb_init_locked(sc) /* Init circular RX list. */ if (wb_list_rx_init(sc) == ENOBUFS) { - if_printf(ifp, + device_printf(sc->wb_dev, "initialization failed: no memory for rx buffers\n"); wb_stop(sc); return; |