]> xenbits.xensource.com Git - xenclient/ioemu-pq.git/commitdiff
[atapi-pt] fixed REPORT_KEY and READ_12 commands
authorAlexandre Bique <alexandre.bique@citrix.com>
Wed, 5 Aug 2009 16:38:05 +0000 (16:38 +0000)
committerAlexandre Bique <alexandre.bique@citrix.com>
Wed, 5 Aug 2009 16:38:05 +0000 (16:38 +0000)
master/atapi-pass-through

index 604e7547b7a608beb4e3bf3275233081a535bc62..03144f6f0fb3040a7edfed7a3941ac2e6b2a2b7f 100644 (file)
@@ -100,7 +100,7 @@ new file mode 100644
 index 0000000..b1c380f
 --- /dev/null
 +++ b/hw/atapi-pt.c
-@@ -0,0 +1,964 @@
+@@ -0,0 +1,970 @@
 +#define DEBUG_IDE_ATAPI_PT
 +
 +#define MSF_TO_FRAMES(M, S, F) (((M) * CD_SECS + (S)) * CD_FRAMES + (F))
@@ -852,6 +852,7 @@ index 0000000..b1c380f
 +        cmd->din_xferp = (__u64)s->io_buffer;
 +        s->atapi_pt.cmd_sent = ide_atapi_pt_standard_reply;
 +        s->atapi_pt.reply_size_len = 2;
++        s->atapi_pt.reply_size_init = 2;
 +        ATAPI_PT_SEND_PACKET;
 +        return;
 +
@@ -877,11 +878,16 @@ index 0000000..b1c380f
 +        int blocksize = 0, nbblocks;
 +
 +        switch (s->io_buffer[0]) {
-+        case GPCMD_READ_10: blocksize = CD_FRAMESIZE; break;
-+        case GPCMD_READ_12: blocksize = CD_FRAMESIZE_RAW0; break;
++        case GPCMD_READ_10:
++            blocksize = CD_FRAMESIZE;
++            nbblocks = ube16_to_cpu(s->io_buffer + 7);
++            break;
++        case GPCMD_READ_12:
++            blocksize = CD_FRAMESIZE_RAW0;
++            nbblocks = ube32_to_cpu(s->io_buffer + 6);
++            break;
 +        default: assert(0);
 +        }
-+        nbblocks = ube16_to_cpu(s->io_buffer + 7);
 +        cmd->din_xfer_len = nbblocks * blocksize;
 +        cmd->din_xferp = (__u64)s->io_buffer;
 +        s->atapi_pt.cmd_sent = ide_atapi_pt_standard_reply;