Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi PR/12991: Dave Huang: DVD ioctls don't work b...



details:   https://anonhg.NetBSD.org/src/rev/150f579b2cbd
branches:  trunk
changeset: 510123:150f579b2cbd
user:      christos <christos%NetBSD.org@localhost>
date:      Sun May 20 21:07:58 2001 +0000

description:
PR/12991: Dave Huang: DVD ioctls don't work because we send the wrong size
CDB (16 instead of 12).

diffstat:

 sys/dev/scsipi/cd.c |  28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diffs (126 lines):

diff -r ae53497927ad -r 150f579b2cbd sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c       Sun May 20 21:07:06 2001 +0000
+++ b/sys/dev/scsipi/cd.c       Sun May 20 21:07:58 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd.c,v 1.149 2001/05/17 20:02:56 bouyer Exp $  */
+/*     $NetBSD: cd.c,v 1.150 2001/05/20 21:07:58 christos Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -1611,7 +1611,7 @@
                cmd.opcode = GPCMD_REPORT_KEY;
                cmd.bytes[8] = 8;
                cmd.bytes[9] = 0 | (0 << 6);
-               error = scsipi_command(cd->sc_periph, &cmd, 16, buf, 8,
+               error = scsipi_command(cd->sc_periph, &cmd, 12, buf, 8,
                    CDRETRIES, 30000, NULL,
                    XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
                if (error)
@@ -1623,7 +1623,7 @@
                cmd.opcode = GPCMD_REPORT_KEY;
                cmd.bytes[8] = 16;
                cmd.bytes[9] = 1 | (a->lsc.agid << 6);
-               error = scsipi_command(cd->sc_periph, &cmd, 16, buf, 16,
+               error = scsipi_command(cd->sc_periph, &cmd, 12, buf, 16,
                    CDRETRIES, 30000, NULL,
                    XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
                if (error)
@@ -1635,7 +1635,7 @@
                cmd.opcode = GPCMD_REPORT_KEY;
                cmd.bytes[8] = 12;
                cmd.bytes[9] = 2 | (a->lsk.agid << 6);
-               error = scsipi_command(cd->sc_periph, &cmd, 16, buf, 12,
+               error = scsipi_command(cd->sc_periph, &cmd, 12, buf, 12,
                    CDRETRIES, 30000, NULL,
                    XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
                if (error)
@@ -1648,7 +1648,7 @@
                _lto4b(a->lstk.lba, &cmd.bytes[1]);
                cmd.bytes[8] = 12;
                cmd.bytes[9] = 4 | (a->lstk.agid << 6);
-               error = scsipi_command(cd->sc_periph, &cmd, 16, buf, 12,
+               error = scsipi_command(cd->sc_periph, &cmd, 12, buf, 12,
                    CDRETRIES, 30000, NULL,
                    XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
                if (error)
@@ -1663,7 +1663,7 @@
                cmd.opcode = GPCMD_REPORT_KEY;
                cmd.bytes[8] = 8;
                cmd.bytes[9] = 5 | (a->lsasf.agid << 6);
-               error = scsipi_command(cd->sc_periph, &cmd, 16, buf, 8,
+               error = scsipi_command(cd->sc_periph, &cmd, 12, buf, 8,
                    CDRETRIES, 30000, NULL,
                    XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
                if (error)
@@ -1677,7 +1677,7 @@
                cmd.bytes[9] = 1 | (a->hsc.agid << 6);
                buf[1] = 14;
                dvd_copy_challenge(&buf[4], a->hsc.chal);
-               error = scsipi_command(cd->sc_periph, &cmd, 16, buf, 16,
+               error = scsipi_command(cd->sc_periph, &cmd, 12, buf, 16,
                    CDRETRIES, 30000, NULL,
                    XS_CTL_DATA_OUT|XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
                if (error)
@@ -1691,7 +1691,7 @@
                cmd.bytes[9] = 3 | (a->hsk.agid << 6);
                buf[1] = 10;
                dvd_copy_key(&buf[4], a->hsk.key);
-               error = scsipi_command(cd->sc_periph, &cmd, 16, buf, 12,
+               error = scsipi_command(cd->sc_periph, &cmd, 12, buf, 12,
                    CDRETRIES, 30000, NULL,
                    XS_CTL_DATA_OUT|XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
                if (error) {
@@ -1704,7 +1704,7 @@
        case DVD_INVALIDATE_AGID:
                cmd.opcode = GPCMD_REPORT_KEY;
                cmd.bytes[9] = 0x3f | (a->lsa.agid << 6);
-               error = scsipi_command(cd->sc_periph, &cmd, 16, buf, 16,
+               error = scsipi_command(cd->sc_periph, &cmd, 12, buf, 16,
                    CDRETRIES, 30000, NULL, 0);
                if (error)
                        return (error);
@@ -1733,7 +1733,7 @@
        _lto2b(sizeof(buf), &cmd.bytes[7]);
 
        cmd.bytes[5] = s->physical.layer_num;
-       error = scsipi_command(cd->sc_periph, &cmd, 16, buf, sizeof(buf),
+       error = scsipi_command(cd->sc_periph, &cmd, 12, buf, sizeof(buf),
            CDRETRIES, 30000, NULL, XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
        if (error)
                return (error);
@@ -1773,7 +1773,7 @@
        _lto2b(sizeof(buf), &cmd.bytes[7]);
 
        cmd.bytes[5] = s->copyright.layer_num;
-       error = scsipi_command(cd->sc_periph, &cmd, 16, buf, sizeof(buf),
+       error = scsipi_command(cd->sc_periph, &cmd, 12, buf, sizeof(buf),
            CDRETRIES, 30000, NULL, XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
        if (error)
                return (error);
@@ -1798,7 +1798,7 @@
        _lto2b(sizeof(buf), &cmd.bytes[7]);
 
        cmd.bytes[9] = s->disckey.agid << 6;
-       error = scsipi_command(cd->sc_periph, &cmd, 16, buf, sizeof(buf),
+       error = scsipi_command(cd->sc_periph, &cmd, 12, buf, sizeof(buf),
            CDRETRIES, 30000, NULL, XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
        if (error)
                return (error);
@@ -1821,7 +1821,7 @@
        cmd.bytes[6] = s->type;
        _lto2b(sizeof(buf), &cmd.bytes[7]);
 
-       error = scsipi_command(cd->sc_periph, &cmd, 16, buf, sizeof(buf),
+       error = scsipi_command(cd->sc_periph, &cmd, 12, buf, sizeof(buf),
            CDRETRIES, 30000, NULL, XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
        if (error)
                return (error);
@@ -1847,7 +1847,7 @@
        cmd.bytes[6] = s->type;
        _lto2b(sizeof(buf), &cmd.bytes[7]);
 
-       error = scsipi_command(cd->sc_periph, &cmd, 16, buf, sizeof(buf),
+       error = scsipi_command(cd->sc_periph, &cmd, 12, buf, sizeof(buf),
            CDRETRIES, 30000, NULL, XS_CTL_DATA_IN|XS_CTL_DATA_ONSTACK);
        if (error)
                return (error);



Home | Main Index | Thread Index | Old Index