summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-11-09 23:14:20 +0000
committerAngelos D. Keromytis <angelos@cvs.openbsd.org>1999-11-09 23:14:20 +0000
commitb4c68ea0bc52d55fa2e10cc4ada9ad86bb04c988 (patch)
treec6e9eb278d6e4bd7c5baf0d7a5be6e3160dee41a /sys
parent74dc19bb7540973b3ab225b34634bf8ebb6d93c6 (diff)
Fix lengths of scsi cmds
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/cd.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 7683c2e161d..1c606dd73e8 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.48 1999/11/03 21:20:22 angelos Exp $ */
+/* $OpenBSD: cd.c,v 1.49 1999/11/09 23:14:19 angelos Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -1592,7 +1592,7 @@ dvd_auth(cd, a)
cmd.opcode = GPCMD_REPORT_KEY;
cmd.bytes[8] = 8;
cmd.bytes[9] = 0 | (0 << 6);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, 8,
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 8,
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
@@ -1603,7 +1603,7 @@ dvd_auth(cd, a)
cmd.opcode = GPCMD_REPORT_KEY;
cmd.bytes[8] = 16;
cmd.bytes[9] = 1 | (a->lsc.agid << 6);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, 16,
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 16,
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
@@ -1614,7 +1614,7 @@ dvd_auth(cd, a)
cmd.opcode = GPCMD_REPORT_KEY;
cmd.bytes[8] = 12;
cmd.bytes[9] = 2 | (a->lsk.agid << 6);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, 12,
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 12,
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
@@ -1626,7 +1626,7 @@ dvd_auth(cd, a)
_lto4b(a->lstk.lba, &cmd.bytes[1]);
cmd.bytes[8] = 12;
cmd.bytes[9] = 4 | (a->lstk.agid << 6);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, 12,
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 12,
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
@@ -1640,7 +1640,7 @@ dvd_auth(cd, a)
cmd.opcode = GPCMD_REPORT_KEY;
cmd.bytes[8] = 8;
cmd.bytes[9] = 5 | (a->lsasf.agid << 6);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, 8,
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 8,
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
@@ -1653,7 +1653,7 @@ dvd_auth(cd, a)
cmd.bytes[9] = 1 | (a->hsc.agid << 6);
buf[1] = 14;
dvd_copy_challenge(&buf[4], a->hsc.chal);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, 16,
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 16,
CDRETRIES, 30000, NULL,
SCSI_DATA_OUT|SCSI_DATA_IN);
if (error)
@@ -1667,7 +1667,7 @@ dvd_auth(cd, a)
cmd.bytes[9] = 3 | (a->hsk.agid << 6);
buf[1] = 10;
dvd_copy_key(&buf[4], a->hsk.key);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, 12,
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 12,
CDRETRIES, 30000, NULL,
SCSI_DATA_OUT|SCSI_DATA_IN);
if (error) {
@@ -1680,7 +1680,7 @@ dvd_auth(cd, a)
case DVD_INVALIDATE_AGID:
cmd.opcode = GPCMD_REPORT_KEY;
cmd.bytes[9] = 0x3f | (a->lsa.agid << 6);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, 16,
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, 16,
CDRETRIES, 30000, NULL, 0);
if (error)
return (error);
@@ -1709,7 +1709,7 @@ dvd_read_physical(cd, s)
_lto2b(sizeof(buf), &cmd.bytes[7]);
cmd.bytes[5] = s->physical.layer_num;
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, sizeof(buf),
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
@@ -1749,7 +1749,7 @@ dvd_read_copyright(cd, s)
_lto2b(sizeof(buf), &cmd.bytes[7]);
cmd.bytes[5] = s->copyright.layer_num;
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, sizeof(buf),
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
@@ -1774,7 +1774,7 @@ dvd_read_disckey(cd, s)
_lto2b(sizeof(buf), &cmd.bytes[7]);
cmd.bytes[9] = s->disckey.agid << 6;
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, sizeof(buf),
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
@@ -1797,7 +1797,7 @@ dvd_read_bca(cd, s)
cmd.bytes[6] = s->type;
_lto2b(sizeof(buf), &cmd.bytes[7]);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, sizeof(buf),
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);
@@ -1823,7 +1823,7 @@ dvd_read_manufact(cd, s)
cmd.bytes[6] = s->type;
_lto2b(sizeof(buf), &cmd.bytes[7]);
- error = scsi_scsi_cmd(cd->sc_link, &cmd, 16, buf, sizeof(buf),
+ error = scsi_scsi_cmd(cd->sc_link, &cmd, sizeof(cmd), buf, sizeof(buf),
CDRETRIES, 30000, NULL, SCSI_DATA_IN);
if (error)
return (error);