summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-12-06 06:25:18 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-12-06 06:25:18 +0000
commit79367b55dea5fac78852e96389c532c95e14a873 (patch)
treed556cb58e3d3435e036a44d5696fd4013801c7a7
parentfe3c31ec78e0478bce96526f149c8c18ae9a85ae (diff)
move the setup buffer and pad into a bus_dma alloced area
(current score: 2 vtophys calls to go...)
-rw-r--r--sys/dev/ic/dc.c18
-rw-r--r--sys/dev/ic/dcreg.h6
2 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c
index 2f5b00b28bb..757477e8fce 100644
--- a/sys/dev/ic/dc.c
+++ b/sys/dev/ic/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.35 2001/12/06 05:42:12 jason Exp $ */
+/* $OpenBSD: dc.c,v 1.36 2001/12/06 06:25:17 jason Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -945,14 +945,16 @@ void dc_setfilt_21143(sc)
DC_INC(sc->dc_cdata.dc_tx_prod, DC_TX_LIST_CNT);
sc->dc_cdata.dc_tx_cnt++;
sframe = &sc->dc_ldata->dc_tx_list[i];
- sp = (u_int32_t *)&sc->dc_cdata.dc_sbuf;
+ sp = &sc->dc_ldata->dc_sbuf[0];
bzero((char *)sp, DC_SFRAME_LEN);
- sframe->dc_data = vtophys(&sc->dc_cdata.dc_sbuf);
+ sframe->dc_data = sc->sc_listmap->dm_segs[0].ds_addr +
+ offsetof(struct dc_list_data, dc_sbuf);
sframe->dc_ctl = DC_SFRAME_LEN | DC_TXCTL_SETUP | DC_TXCTL_TLINK |
DC_FILTER_HASHPERF | DC_TXCTL_FINT;
- sc->dc_cdata.dc_tx_chain[i] = (struct mbuf *)&sc->dc_cdata.dc_sbuf;
+ sc->dc_cdata.dc_tx_chain[i] =
+ (struct mbuf *)&sc->dc_ldata->dc_sbuf[0];
/* If we want promiscuous mode, set the allframes bit. */
if (ifp->if_flags & IFF_PROMISC)
@@ -1143,14 +1145,16 @@ void dc_setfilt_xircom(sc)
DC_INC(sc->dc_cdata.dc_tx_prod, DC_TX_LIST_CNT);
sc->dc_cdata.dc_tx_cnt++;
sframe = &sc->dc_ldata->dc_tx_list[i];
- sp = (u_int32_t *)&sc->dc_cdata.dc_sbuf;
+ sp = &sc->dc_ldata->dc_sbuf[0];
bzero((char *)sp, DC_SFRAME_LEN);
- sframe->dc_data = vtophys(&sc->dc_cdata.dc_sbuf);
+ sframe->dc_data = sc->sc_listmap->dm_segs[0].ds_addr +
+ offsetof(struct dc_list_data, dc_sbuf);
sframe->dc_ctl = DC_SFRAME_LEN | DC_TXCTL_SETUP | DC_TXCTL_TLINK |
DC_FILTER_HASHPERF | DC_TXCTL_FINT;
- sc->dc_cdata.dc_tx_chain[i] = (struct mbuf *)&sc->dc_cdata.dc_sbuf;
+ sc->dc_cdata.dc_tx_chain[i] =
+ (struct mbuf *)&sc->dc_ldata->dc_sbuf[0];
/* If we want promiscuous mode, set the allframes bit. */
if (ifp->if_flags & IFF_PROMISC)
diff --git a/sys/dev/ic/dcreg.h b/sys/dev/ic/dcreg.h
index e1e83783b04..4b1fba86a14 100644
--- a/sys/dev/ic/dcreg.h
+++ b/sys/dev/ic/dcreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dcreg.h,v 1.15 2001/12/06 05:42:12 jason Exp $ */
+/* $OpenBSD: dcreg.h,v 1.16 2001/12/06 06:25:17 jason Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -456,13 +456,13 @@ struct dc_desc {
struct dc_list_data {
struct dc_desc dc_rx_list[DC_RX_LIST_CNT];
struct dc_desc dc_tx_list[DC_TX_LIST_CNT];
+ u_int32_t dc_sbuf[DC_SFRAME_LEN/sizeof(u_int32_t)];
+ u_int8_t dc_pad[DC_MIN_FRAMELEN];
};
struct dc_chain_data {
struct mbuf *dc_rx_chain[DC_RX_LIST_CNT];
struct mbuf *dc_tx_chain[DC_TX_LIST_CNT];
- u_int32_t dc_sbuf[DC_SFRAME_LEN/sizeof(u_int32_t)];
- u_int8_t dc_pad[DC_MIN_FRAMELEN];
int dc_tx_prod;
int dc_tx_cons;
int dc_tx_cnt;