summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sis.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_sis.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_sis.c')
-rw-r--r--sys/pci/if_sis.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index 858c4c0..2b67f87 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -639,7 +639,7 @@ sis_miibus_readreg(device_t dev, int phy, int reg)
}
if (i == SIS_TIMEOUT) {
- if_printf(sc->sis_ifp, "PHY failed to come ready\n");
+ device_printf(sc->sis_dev, "PHY failed to come ready\n");
return(0);
}
@@ -697,7 +697,7 @@ sis_miibus_writereg(device_t dev, int phy, int reg, int data)
}
if (i == SIS_TIMEOUT)
- if_printf(sc->sis_ifp, "PHY failed to come ready\n");
+ device_printf(sc->sis_dev, "PHY failed to come ready\n");
} else {
bzero((char *)&frame, sizeof(frame));
@@ -863,7 +863,7 @@ sis_reset(struct sis_softc *sc)
}
if (i == SIS_TIMEOUT)
- if_printf(sc->sis_ifp, "reset never completed\n");
+ device_printf(sc->sis_dev, "reset never completed\n");
/* Wait a little while for the chip to get its brains in order. */
DELAY(1000);
@@ -918,7 +918,7 @@ sis_attach(device_t dev)
waittime = 0;
sc = device_get_softc(dev);
- sc->sis_self = dev;
+ sc->sis_dev = dev;
mtx_init(&sc->sis_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
MTX_DEF);
@@ -1889,7 +1889,7 @@ sis_initl(struct sis_softc *sc)
/* Init circular TX/RX lists. */
if (sis_ring_init(sc) != 0) {
- if_printf(ifp,
+ device_printf(sc->sis_dev,
"initialization failed: no memory for rx buffers\n");
sis_stop(sc);
return;
@@ -2013,7 +2013,7 @@ sis_initl(struct sis_softc *sc)
DELAY(100000);
reg = CSR_READ_4(sc, NS_PHY_TDATA) & 0xff;
if ((reg & 0x0080) == 0 || (reg > 0xd8 && reg <= 0xff)) {
- device_printf(sc->sis_self,
+ device_printf(sc->sis_dev,
"Applying short cable fix (reg=%x)\n", reg);
CSR_WRITE_4(sc, NS_PHY_TDATA, 0x00e8);
reg = CSR_READ_4(sc, NS_PHY_DSPCFG);
OpenPOWER on IntegriCloud