summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/dc.c19
-rw-r--r--sys/dev/ic/dcreg.h9
2 files changed, 23 insertions, 5 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c
index bd631f9e2bb..6286063b764 100644
--- a/sys/dev/ic/dc.c
+++ b/sys/dev/ic/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.39 2001/12/06 20:12:00 jason Exp $ */
+/* $OpenBSD: dc.c,v 1.40 2001/12/06 21:22:07 jason Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -978,11 +978,22 @@ void dc_setfilt_21143(sc)
}
/* Set our MAC address */
- sp[39] = ((u_int16_t *)sc->arpcom.ac_enaddr)[0];
- sp[40] = ((u_int16_t *)sc->arpcom.ac_enaddr)[1];
- sp[41] = ((u_int16_t *)sc->arpcom.ac_enaddr)[2];
+ sp[39] = DC_SP_FIELD(sc->arpcom.ac_enaddr, 0);
+ sp[40] = DC_SP_FIELD(sc->arpcom.ac_enaddr, 1);
+ sp[41] = DC_SP_FIELD(sc->arpcom.ac_enaddr, 2);
+
+ bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap,
+ offsetof(struct dc_list_data, dc_sbuf[0]),
+ sizeof(struct dc_list_data) -
+ offsetof(struct dc_list_data, dc_sbuf[0]),
+ BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
sframe->dc_status = htole32(DC_TXSTAT_OWN);
+
+ bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap,
+ offsetof(struct dc_list_data, dc_tx_list[i]),
+ sizeof(struct dc_desc), BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+
CSR_WRITE_4(sc, DC_TXSTART, 0xFFFFFFFF);
/*
diff --git a/sys/dev/ic/dcreg.h b/sys/dev/ic/dcreg.h
index a360ce05fdc..ccd852e5ee7 100644
--- a/sys/dev/ic/dcreg.h
+++ b/sys/dev/ic/dcreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcreg.h,v 1.19 2001/12/06 20:12:00 jason Exp $ */
+/* $OpenBSD: dcreg.h,v 1.20 2001/12/06 21:22:07 jason Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1004,3 +1004,10 @@ extern void dc_attach __P((struct dc_softc *));
extern int dc_detach __P((struct dc_softc *));
extern int dc_intr __P((void *));
extern void dc_reset __P((struct dc_softc *));
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define DC_SP_FIELD_C(x) ((x) << 16)
+#else
+#define DC_SP_FIELD_C(x) (x)
+#endif
+#define DC_SP_FIELD(x,f) DC_SP_FIELD_C(((u_int16_t *)(x))[(f)])