summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-09-24 06:52:34 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-09-24 06:52:34 +0000
commit0c742c01c5fa0e4114554e9e056ed049768cae81 (patch)
tree5bdd3d32cc98c80388174c62fc344a119dc74da4 /sys/dev
parent3e5466b179481616453d9e78efcd5ab5bf735472 (diff)
get rid of kvtop, not that it matters that much
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/twe.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/ic/twe.c b/sys/dev/ic/twe.c
index ec8e93f43c1..2c6e5800706 100644
--- a/sys/dev/ic/twe.c
+++ b/sys/dev/ic/twe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: twe.c,v 1.12 2001/07/04 22:53:24 espie Exp $ */
+/* $OpenBSD: twe.c,v 1.13 2001/09/24 06:52:33 mickey Exp $ */
/*
* Copyright (c) 2000, 2001 Michael Shalayeff. All rights reserved.
@@ -58,7 +58,7 @@
#define TWE_D_MISC 0x0004
#define TWE_D_DMA 0x0008
#define TWE_D_AEN 0x0010
-int twe_debug = 0xffff;
+int twe_debug = 0;
#else
#define TWE_DPRINTF(m,a) /* m, a */
#endif
@@ -141,6 +141,7 @@ twe_attach(sc)
int error, i, retry, nunits, nseg;
const char *errstr;
twe_lock_t lock;
+ paddr_t pa;
error = bus_dmamem_alloc(sc->dmat, sizeof(struct twe_cmd) * TWE_MAXCMDS,
PAGE_SIZE, 0, sc->sc_cmdseg, 1, &nseg, BUS_DMA_NOWAIT);
@@ -179,8 +180,10 @@ twe_attach(sc)
TAILQ_INIT(&sc->sc_ccbq);
TAILQ_INIT(&sc->sc_free_ccb);
+ pa = sc->sc_cmdmap->dm_segs[0].ds_addr +
+ sizeof(struct twe_cmd) * (TWE_MAXCMDS - 1);;
for (cmd = sc->sc_cmds + sizeof(struct twe_cmd) * (TWE_MAXCMDS - 1);
- cmd >= (struct twe_cmd *)sc->sc_cmds; cmd--) {
+ cmd >= (struct twe_cmd *)sc->sc_cmds; cmd--, pa -= sizeof(*cmd)) {
cmd->cmd_index = cmd - (struct twe_cmd *)sc->sc_cmds;
ccb = &sc->sc_ccbs[cmd->cmd_index];
@@ -194,8 +197,8 @@ twe_attach(sc)
}
ccb->ccb_sc = sc;
ccb->ccb_cmd = cmd;
+ ccb->ccb_cmdpa = pa;
ccb->ccb_state = TWE_CCB_FREE;
- ccb->ccb_cmdpa = kvtop((caddr_t)cmd);
TAILQ_INSERT_TAIL(&sc->sc_free_ccb, ccb, ccb_link);
}