aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2005-01-05 10:11:37 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2005-01-05 10:11:37 +0000
commita55fd2ad97443cd8959e9d8ea58705e88aadd797 (patch)
treea93a76232c1d7f5260626a2c6a9b1c0ccd2ddd82 /sys
parent93e6be6cd77b8189e936481195addb72b12c2de1 (diff)
downloadsrc-a55fd2ad97443cd8959e9d8ea58705e88aadd797.tar.gz
src-a55fd2ad97443cd8959e9d8ea58705e88aadd797.zip
Add locked/unlocked variants of sis_init()
Notes
Notes: svn path=/head/; revision=139715
Diffstat (limited to 'sys')
-rw-r--r--sys/pci/if_sis.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index a681a7da3959..8fa2e1521fa3 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -128,6 +128,7 @@ static void sis_start (struct ifnet *);
static void sis_startl (struct ifnet *);
static int sis_ioctl (struct ifnet *, u_long, caddr_t);
static void sis_init (void *);
+static void sis_initl (void *);
static void sis_stop (struct sis_softc *);
static void sis_watchdog (struct ifnet *);
static void sis_shutdown (device_t);
@@ -1632,12 +1633,12 @@ sis_rxeof(sc)
}
static void
-sis_rxeoc(sc)
- struct sis_softc *sc;
+sis_rxeoc(struct sis_softc *sc)
{
+
+ SIS_LOCK_ASSERT(sc);
sis_rxeof(sc);
- sis_init(sc);
- return;
+ sis_initl(sc);
}
/*
@@ -1652,6 +1653,7 @@ sis_txeof(sc)
struct ifnet *ifp;
u_int32_t idx;
+ SIS_LOCK_ASSERT(sc);
ifp = &sc->arpcom.ac_if;
/*
@@ -1774,7 +1776,7 @@ sis_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
if (status & SIS_ISR_SYSERR) {
sis_reset(sc);
- sis_init(sc);
+ sis_initl(sc);
}
}
done:
@@ -1837,7 +1839,7 @@ sis_intr(arg)
if (status & SIS_ISR_SYSERR) {
sis_reset(sc);
- sis_init(sc);
+ sis_initl(sc);
}
}
@@ -2002,14 +2004,24 @@ sis_startl(struct ifnet *ifp)
}
static void
-sis_init(xsc)
- void *xsc;
+sis_init(void *xsc)
+{
+ struct sis_softc *sc = xsc;
+
+ SIS_LOCK(sc);
+ sis_initl(xsc);
+ SIS_UNLOCK(sc);
+}
+
+
+static void
+sis_initl(void *xsc)
{
struct sis_softc *sc = xsc;
struct ifnet *ifp = &sc->arpcom.ac_if;
struct mii_data *mii;
- SIS_LOCK(sc);
+ SIS_LOCK_ASSERT(sc);
/*
* Cancel pending I/O and free all RX/TX buffers.
@@ -2057,7 +2069,6 @@ sis_init(xsc)
printf("sis%d: initialization failed: no "
"memory for rx buffers\n", sc->sis_unit);
sis_stop(sc);
- SIS_UNLOCK(sc);
return;
}
@@ -2218,10 +2229,6 @@ sis_init(xsc)
if (!sc->in_tick)
callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc);
-
- SIS_UNLOCK(sc);
-
- return;
}
/*
@@ -2334,7 +2341,7 @@ sis_watchdog(ifp)
sis_stop(sc);
sis_reset(sc);
- sis_init(sc);
+ sis_initl(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
sis_startl(ifp);