summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-01-05 10:04:45 +0000
committerphk <phk@FreeBSD.org>2005-01-05 10:04:45 +0000
commit9621af4a8bf6c5d0c7f2356fa3c4c7f2b7427776 (patch)
tree039caa3e833951182c7321d664606376243c5c45 /sys/pci
parenta8c761470712b651fd849bb0b645a0b9af5f9d4c (diff)
downloadFreeBSD-src-9621af4a8bf6c5d0c7f2356fa3c4c7f2b7427776.zip
FreeBSD-src-9621af4a8bf6c5d0c7f2356fa3c4c7f2b7427776.tar.gz
Make a locked and unlocked variant of sis_start()
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_sis.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index 4776559..a681a7d 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -125,6 +125,7 @@ static void sis_txeof (struct sis_softc *);
static void sis_intr (void *);
static void sis_tick (void *);
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_stop (struct sis_softc *);
@@ -1718,7 +1719,7 @@ sis_tick(xsc)
IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
sc->sis_link++;
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
- sis_start(ifp);
+ sis_startl(ifp);
}
callout_reset(&sc->sis_stat_ch, hz, sis_tick, sc);
@@ -1757,7 +1758,7 @@ sis_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
sis_rxeof(sc);
sis_txeof(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
- sis_start(ifp);
+ sis_startl(ifp);
if (sc->rxcycles > 0 || cmd == POLL_AND_CHECK_STATUS) {
u_int32_t status;
@@ -1844,7 +1845,7 @@ sis_intr(arg)
CSR_WRITE_4(sc, SIS_IER, 1);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
- sis_start(ifp);
+ sis_startl(ifp);
done:
SIS_UNLOCK(sc);
@@ -1941,23 +1942,31 @@ sis_start(ifp)
struct ifnet *ifp;
{
struct sis_softc *sc;
+
+ sc = ifp->if_softc;
+ SIS_LOCK(sc);
+ sis_startl(ifp);
+ SIS_UNLOCK(sc);
+}
+
+static void
+sis_startl(struct ifnet *ifp)
+{
+ struct sis_softc *sc;
struct mbuf *m_head = NULL;
u_int32_t idx, queued = 0;
sc = ifp->if_softc;
- SIS_LOCK(sc);
- if (!sc->sis_link) {
- SIS_UNLOCK(sc);
+ SIS_LOCK_ASSERT(sc);
+
+ if (!sc->sis_link)
return;
- }
idx = sc->sis_tx_prod;
- if (ifp->if_flags & IFF_OACTIVE) {
- SIS_UNLOCK(sc);
+ if (ifp->if_flags & IFF_OACTIVE)
return;
- }
while(sc->sis_tx_list[idx].sis_mbuf == NULL) {
IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
@@ -1990,10 +1999,6 @@ sis_start(ifp)
*/
ifp->if_timer = 5;
}
-
- SIS_UNLOCK(sc);
-
- return;
}
static void
@@ -2332,7 +2337,7 @@ sis_watchdog(ifp)
sis_init(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
- sis_start(ifp);
+ sis_startl(ifp);
SIS_UNLOCK(sc);
OpenPOWER on IntegriCloud