summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-06-26 04:04:25 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-06-26 04:04:25 +0000
commit7e6dd095a94b39207eff7569000262094cc80685 (patch)
treec08d0bdb42f47175798f177ae6d03146863dd03f /sys/arch
parent6c3864b9cbb19c9e544c04ebc635bd25419e2ee1 (diff)
xs->cmd[n] doesn't mean the n'th byte, because xs->cmd is a struct
*scsi_generic. Change xs->cmd[0] references in sii.c to xs->cmd->opcode and do (caddr_t) arithmetic when copying chunks into the adw adapter struct. Found by Matthew Dempsky, diff tweaked and tested by me.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/vax/dec/sii.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/arch/vax/dec/sii.c b/sys/arch/vax/dec/sii.c
index 64d3ac924b5..25700b49a16 100644
--- a/sys/arch/vax/dec/sii.c
+++ b/sys/arch/vax/dec/sii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sii.c,v 1.9 2010/05/20 00:55:17 krw Exp $ */
+/* $OpenBSD: sii.c,v 1.10 2010/06/26 04:04:24 krw Exp $ */
/* $NetBSD: sii.c,v 1.42 2000/06/02 20:20:29 mhitch Exp $ */
/*
* Copyright (c) 2008 Miodrag Vallat.
@@ -817,7 +817,7 @@ again:
if (state->cmdlen > 0) {
printf("%s: device %d: cmd 0x%x: command data not all sent (%d) 1\n",
sc->sc_dev.dv_xname, sc->sc_target,
- sc->sc_xs[sc->sc_target]->cmd[0],
+ sc->sc_xs[sc->sc_target]->cmd->opcode,
state->cmdlen);
state->cmdlen = 0;
#ifdef DEBUG
@@ -899,7 +899,7 @@ again:
if (state->cmdlen > 0) {
printf("%s: device %d: cmd 0x%x: command data not all sent (%d) 2\n",
sc->sc_dev.dv_xname, sc->sc_target,
- sc->sc_xs[sc->sc_target]->cmd[0],
+ sc->sc_xs[sc->sc_target]->cmd->opcode,
state->cmdlen);
state->cmdlen = 0;
#ifdef DEBUG
@@ -1692,7 +1692,8 @@ sii_CmdDone(sc, target, error)
if (sii_debug > 1) {
printf("sii_CmdDone: %s target %d cmd 0x%x err %d resid %d\n",
sc->sc_dev.dv_xname,
- target, xs->cmd[0], error, sc->sc_st[target].buflen);
+ target, xs->cmd->opcode, error,
+ sc->sc_st[target].buflen);
}
#endif