summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2010-07-22 04:54:25 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2010-07-22 04:54:25 +0000
commit64f848bfbc8f66d670df0076bf52532eaf21dda9 (patch)
tree4117061536399fa906b7c29ad21d9af7fa490c5f /sys
parent92827df6873506fcd62b3d409c92b958bc136eff (diff)
Appropriately set SCSI_DATA_IN or SCSI_DATA_OUT depending on type of
dvd_auth command. Fixes regression from scsi_scsi_cmd() removal. ok dlg@
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/cd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index e283ebd4adf..a6423ad9f5d 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.176 2010/07/22 00:31:06 krw Exp $ */
+/* $OpenBSD: cd.c,v 1.177 2010/07/22 04:54:24 matthew Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -1713,7 +1713,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
u_int8_t buf[20];
int error;
- xs = scsi_xs_get(sc->sc_link, SCSI_DATA_IN);
+ xs = scsi_xs_get(sc->sc_link, 0);
if (xs == NULL)
return (ENOMEM);
xs->cmdlen = sizeof(*cmd);
@@ -1728,6 +1728,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
xs->cmd->bytes[8] = 8;
xs->cmd->bytes[9] = 0 | (0 << 6);
xs->datalen = 8;
+ xs->flags |= SCSI_DATA_IN;
error = scsi_xs_sync(xs);
scsi_xs_put(xs);
@@ -1741,6 +1742,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
xs->cmd->bytes[8] = 16;
xs->cmd->bytes[9] = 1 | (a->lsc.agid << 6);
xs->datalen = 16;
+ xs->flags |= SCSI_DATA_IN;
error = scsi_xs_sync(xs);
scsi_xs_put(xs);
@@ -1753,6 +1755,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
xs->cmd->bytes[8] = 12;
xs->cmd->bytes[9] = 2 | (a->lsk.agid << 6);
xs->datalen = 12;
+ xs->flags |= SCSI_DATA_IN;
error = scsi_xs_sync(xs);
scsi_xs_put(xs);
@@ -1767,6 +1770,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
xs->cmd->bytes[8] = 12;
xs->cmd->bytes[9] = 4 | (a->lstk.agid << 6);
xs->datalen = 12;
+ xs->flags |= SCSI_DATA_IN;
error = scsi_xs_sync(xs);
scsi_xs_put(xs);
@@ -1784,6 +1788,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
xs->cmd->bytes[8] = 8;
xs->cmd->bytes[9] = 5 | (a->lsasf.agid << 6);
xs->datalen = 8;
+ xs->flags |= SCSI_DATA_IN;
error = scsi_xs_sync(xs);
scsi_xs_put(xs);
@@ -1799,6 +1804,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
buf[1] = 14;
dvd_copy_challenge(&buf[4], a->hsc.chal);
xs->datalen = 16;
+ xs->flags |= SCSI_DATA_OUT;
error = scsi_xs_sync(xs);
scsi_xs_put(xs);
@@ -1814,6 +1820,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
buf[1] = 10;
dvd_copy_key(&buf[4], a->hsk.key);
xs->datalen = 12;
+ xs->flags |= SCSI_DATA_OUT;
error = scsi_xs_sync(xs);
scsi_xs_put(xs);
@@ -1839,6 +1846,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
xs->cmd->bytes[8] = 8;
xs->cmd->bytes[9] = 8 | (0 << 6);
xs->datalen = 8;
+ xs->flags |= SCSI_DATA_IN;
error = scsi_xs_sync(xs);
scsi_xs_put(xs);
@@ -1859,6 +1867,7 @@ dvd_auth(struct cd_softc *sc, union dvd_authinfo *a)
buf[1] = 6;
buf[4] = a->hrpcs.pdrc;
xs->datalen = 8;
+ xs->flags |= SCSI_DATA_OUT;
error = scsi_xs_sync(xs);
scsi_xs_put(xs);