All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, scdbackup@gmx.net, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/5] atapi: kill MODE SENSE(6), fix MODE SENSE(10)
Date: Fri, 11 Nov 2011 14:36:48 +0100	[thread overview]
Message-ID: <4EBD24F0.9090105@redhat.com> (raw)
In-Reply-To: <1320940872-4940-2-git-send-email-pbonzini@redhat.com>

Am 10.11.2011 17:01, schrieb Paolo Bonzini:
> Mode page 2A of emulated ATAPI DVD-ROM should have page length 0x14
> like SCSI CD-ROM, rather than 0x12.
> 
> Mode page length is off by 8, as it should contain the length of the
> payload after the first two bytes.
> 
> MODE SENSE(6) should be thrown out of ATAPI DVD-ROM emulation.  It is
> not specified in the ATAPI list of MMC-2, and MMC-5 prescribes to use
> MODE SENSE(10).  Anyway, its implementation is wrong.
> 
> Reported-by: Thomas Schmitt <scdbackup@gmx.net>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/ide/atapi.c |   21 ++++++++-------------
>  1 files changed, 8 insertions(+), 13 deletions(-)
> 
> diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
> index d4179a0..cf0e66b 100644
> --- a/hw/ide/atapi.c
> +++ b/hw/ide/atapi.c
> @@ -689,12 +689,7 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
>      int action, code;
>      int max_len;
>  
> -    if (buf[0] == GPCMD_MODE_SENSE_10) {
> -        max_len = ube16_to_cpu(buf + 7);
> -    } else {
> -        max_len = buf[4];
> -    }
> -
> +    max_len = ube16_to_cpu(buf + 7);
>      action = buf[2] >> 6;
>      code = buf[2] & 0x3f;
>  
> @@ -702,7 +697,7 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
>      case 0: /* current values */
>          switch(code) {
>          case MODE_PAGE_R_W_ERROR: /* error recovery */
> -            cpu_to_ube16(&buf[0], 16 + 6);
> +            cpu_to_ube16(&buf[0], 16 - 2);
>              buf[2] = 0x70;
>              buf[3] = 0;
>              buf[4] = 0;
> @@ -717,11 +712,10 @@ static void cmd_mode_sense(IDEState *s, uint8_t *buf)
>              buf[12] = 0x00;
>              buf[13] = 0x00;
>              buf[14] = 0x00;
> -            buf[15] = 0x00;

Why did you drop this? It still seems to be part of the buffer.

Kevin

  reply	other threads:[~2011-11-11 13:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-10 16:01 [Qemu-devel] [PATCH 0/5] scsi/atapi: MMC fixes Paolo Bonzini
2011-11-10 16:01 ` [Qemu-devel] [PATCH 1/5] atapi: kill MODE SENSE(6), fix MODE SENSE(10) Paolo Bonzini
2011-11-11 13:36   ` Kevin Wolf [this message]
2011-11-11 13:38     ` Paolo Bonzini
2011-11-11 15:14       ` [Qemu-devel] " Thomas Schmitt
2011-11-10 16:01 ` [Qemu-devel] [PATCH 2/5] scsi: update list of commands Paolo Bonzini
2011-11-11 14:08   ` Kevin Wolf
2011-11-10 16:01 ` [Qemu-devel] [PATCH 3/5] scsi: fix parsing of allocation length field Paolo Bonzini
2011-11-10 16:01 ` [Qemu-devel] [PATCH 4/5] scsi: remove block descriptors from CDs Paolo Bonzini
2011-11-10 16:01 ` [Qemu-devel] [PATCH 5/5] scsi-block: special case CD burning commands Paolo Bonzini
2011-11-10 18:17 ` [Qemu-devel] [PATCH 0/5] scsi/atapi: MMC fixes Thomas Schmitt
2011-11-11 12:08   ` Paolo Bonzini
2011-11-11 14:47     ` Thomas Schmitt
2011-11-11  4:09 ` Zhi Yong Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EBD24F0.9090105@redhat.com \
    --to=kwolf@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=scdbackup@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.