summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/hme.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2000-11-28 05:04:33 +0000
committerJason Wright <jason@cvs.openbsd.org>2000-11-28 05:04:33 +0000
commit2ae173bfb95b63e108062026223d4146d4d20d2a (patch)
treee90b5d8c97431ebaf83f53bba71c7ac488304b77 /sys/arch/sparc/dev/hme.c
parent68bde6b767ff5d941db8fbd19f90c029b4ab41e2 (diff)
oops, not yet
Diffstat (limited to 'sys/arch/sparc/dev/hme.c')
-rw-r--r--sys/arch/sparc/dev/hme.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/sys/arch/sparc/dev/hme.c b/sys/arch/sparc/dev/hme.c
index c5ea16bf730..5de558f8648 100644
--- a/sys/arch/sparc/dev/hme.c
+++ b/sys/arch/sparc/dev/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.24 2000/11/28 04:23:16 jason Exp $ */
+/* $OpenBSD: hme.c,v 1.25 2000/11/28 05:04:32 jason Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
@@ -482,6 +482,7 @@ hme_meminit(sc)
sc->sc_bufs_dva = (struct hme_bufs *) dvma_malloc(
sizeof(struct hme_bufs), &sc->sc_bufs, M_NOWAIT);
+
desc = sc->sc_desc;
/*
@@ -507,6 +508,29 @@ hme_meminit(sc)
}
void
+hme_rxd_ref(m)
+ struct mbuf *m;
+{
+ struct hme_softrxd *d = m->m_ext_handle;
+
+ d->rxd_ref++;
+}
+
+void
+hme_rxd_free(m)
+ struct mbuf *m;
+{
+ struct hme_softrxd *d = m->m_ext_handle;
+
+ if (d->rxd_ref <= 0)
+ panic("hme_rxd_free: ref %d", d->rxd_ref);
+ d->rxd_ref--;
+ if (d->rxd_ref == 0) {
+ dvma_free(
+ }
+}
+
+void
hmeinit(sc)
struct hme_softc *sc;
{
@@ -730,7 +754,7 @@ hme_rint(sc)
bix = sc->sc_last_rd;
for (;;) {
- bcopy(&sc->sc_desc->hme_rxd[bix], &rxd, sizeof(rxd));
+ rxd->rx_flags = &sc->sc_desc->hme_rxd[bix];
len = rxd.rx_flags >> 16;
if (rxd.rx_flags & HME_RXD_OWN)
@@ -845,7 +869,7 @@ hme_get(sc, idx, totlen)
len = MCLBYTES;
}
m->m_len = len = min(totlen, len);
- bcopy(&sc->sc_bufs->rx_buf[idx][boff],
+ bcopy(&sc->sc_bufs->rx_buf[idx][boff + HME_RX_OFFSET],
mtod(m, caddr_t), len);
boff += len;
totlen -= len;