summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_ste.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-09-15 10:40:54 +0000
committerglebius <glebius@FreeBSD.org>2006-09-15 10:40:54 +0000
commitaeb9aeaa73fe735ddc4a606776072563dd9b6b43 (patch)
treeae382d23f768d8bc206d445054d2cee99c94d544 /sys/pci/if_ste.c
parent6b78b3a81dfd58cd5838b6fae2c4f76e95a5f930 (diff)
downloadFreeBSD-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_ste.c')
-rw-r--r--sys/pci/if_ste.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/pci/if_ste.c b/sys/pci/if_ste.c
index ea2a652..23331d5 100644
--- a/sys/pci/if_ste.c
+++ b/sys/pci/if_ste.c
@@ -504,7 +504,7 @@ ste_wait(sc)
}
if (i == STE_TIMEOUT)
- if_printf(sc->ste_ifp, "command never completed!\n");
+ device_printf(sc->ste_dev, "command never completed!\n");
return;
}
@@ -529,7 +529,7 @@ ste_eeprom_wait(sc)
}
if (i == 100) {
- if_printf(sc->ste_ifp, "eeprom failed to come ready\n");
+ device_printf(sc->ste_dev, "eeprom failed to come ready\n");
return(1);
}
@@ -812,7 +812,7 @@ ste_rxeof(sc)
* If not, something truly strange has happened.
*/
if (!(rxstat & STE_RXSTAT_DMADONE)) {
- if_printf(ifp,
+ device_printf(sc->ste_dev,
"bad receive status -- packet dropped\n");
ifp->if_ierrors++;
cur_rx->ste_ptr->ste_status = 0;
@@ -866,7 +866,8 @@ ste_txeoc(sc)
txstat & STE_TXSTATUS_EXCESSCOLLS ||
txstat & STE_TXSTATUS_RECLAIMERR) {
ifp->if_oerrors++;
- if_printf(ifp, "transmission error: %x\n", txstat);
+ device_printf(sc->ste_dev,
+ "transmission error: %x\n", txstat);
ste_reset(sc);
ste_init_locked(sc);
@@ -874,7 +875,8 @@ ste_txeoc(sc)
if (txstat & STE_TXSTATUS_UNDERRUN &&
sc->ste_tx_thresh < STE_PACKET_SIZE) {
sc->ste_tx_thresh += STE_MIN_FRAMELEN;
- if_printf(ifp, "tx underrun, increasing tx"
+ device_printf(sc->ste_dev,
+ "tx underrun, increasing tx"
" start threshold to %d bytes\n",
sc->ste_tx_thresh);
}
@@ -1309,7 +1311,7 @@ ste_init_locked(sc)
/* Init RX list */
if (ste_init_rx_list(sc) == ENOBUFS) {
- if_printf(ifp,
+ device_printf(sc->ste_dev,
"initialization failed: no memory for RX buffers\n");
ste_stop(sc);
return;
@@ -1469,7 +1471,7 @@ ste_reset(sc)
}
if (i == STE_TIMEOUT)
- if_printf(sc->ste_ifp, "global reset never completed\n");
+ device_printf(sc->ste_dev, "global reset never completed\n");
return;
}
OpenPOWER on IntegriCloud