summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-07-19 20:31:52 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-07-19 20:31:52 +0000
commitbe7d3576f00707f6a47121ca72ef7b225bbd7b37 (patch)
treeabd6894e841a233e6f60bd9956beee21548f8f83 /sys/arch/mvme88k/dev
parent26f2beb93cf6043490aa26d7600102fe17e9cabf (diff)
Direct REQUEST_SENSE commands to the correct target, instead of always
target zero. This makes targets other than zero working now... Spotted by nick@
Diffstat (limited to 'sys/arch/mvme88k/dev')
-rw-r--r--sys/arch/mvme88k/dev/vs.c7
-rw-r--r--sys/arch/mvme88k/dev/vsreg.h4
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c
index 4e398d2069b..58ba39632e3 100644
--- a/sys/arch/mvme88k/dev/vs.c
+++ b/sys/arch/mvme88k/dev/vs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs.c,v 1.43 2004/07/18 19:45:51 miod Exp $ */
+/* $OpenBSD: vs.c,v 1.44 2004/07/19 20:31:51 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
@@ -324,7 +324,7 @@ vs_scsicmd(struct scsi_xfer *xs)
(u_int8_t *)xs->cmd, xs->cmdlen);
vs_write(2, iopb + IOPB_CMD, IOPB_PASSTHROUGH);
- vs_write(2, iopb + IOPB_UNIT, (slp->lun << 3) | slp->target);
+ vs_write(2, iopb + IOPB_UNIT, IOPB_UNIT_VALUE(slp->target, slp->lun));
vs_write(1, iopb + IOPB_NVCT, sc->sc_nvec);
vs_write(1, iopb + IOPB_EVCT, sc->sc_evec);
@@ -415,6 +415,7 @@ vs_chksense(struct scsi_xfer *xs)
mce_iopb_write(2, IOPB_ADDR, ADDR_MOD);
mce_iopb_write(4, IOPB_BUFF, kvtop((vaddr_t)&xs->sense));
mce_iopb_write(4, IOPB_LENGTH, sizeof(struct scsi_sense_data));
+ mce_iopb_write(2, IOPB_UNIT, IOPB_UNIT_VALUE(slp->target, slp->lun));
vs_bzero(sh_MCE, CQE_SIZE);
mce_write(2, CQE_IOPB_ADDR, sh_MCE_IOPB);
@@ -607,7 +608,7 @@ vs_resync(struct vs_softc *sc)
mce_iopb_write(1, DRCF_NVCT, sc->sc_nvec);
mce_iopb_write(1, DRCF_EVCT, sc->sc_evec);
mce_iopb_write(2, DRCF_ILVL, 0);
- mce_iopb_write(2, DRCF_UNIT, i);
+ mce_iopb_write(2, DRCF_UNIT, IOPB_UNIT_VALUE(i, 0));
vs_bzero(sh_MCE, CQE_SIZE);
mce_write(2, CQE_IOPB_ADDR, sh_MCE_IOPB);
diff --git a/sys/arch/mvme88k/dev/vsreg.h b/sys/arch/mvme88k/dev/vsreg.h
index 4880ea68fdb..81a7758a641 100644
--- a/sys/arch/mvme88k/dev/vsreg.h
+++ b/sys/arch/mvme88k/dev/vsreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vsreg.h,v 1.9 2004/07/18 19:45:51 miod Exp $ */
+/* $OpenBSD: vsreg.h,v 1.10 2004/07/19 20:31:51 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1999 Steve Murphree, Jr.
@@ -337,6 +337,8 @@
#define CNTR_ISSUE_ABORT 0x4e /* abort has been issued */
#define CNTR_DOWNLOAD_FIRMWARE 0x4f /* download firmware (COUGAR) */
+#define IOPB_UNIT_VALUE(target, lun) ((lun) << 3 | (target & 7))
+
/*
* Memory types
*/