qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jasper Hartline <jasper.hartline@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] SCSI command 0x51 implementation
Date: Sat, 7 Aug 2010 02:09:57 -0700	[thread overview]
Message-ID: <AANLkTikSW75LS0-_s+MJXY5UNo1qpsVSw35SEPwP4-fV@mail.gmail.com> (raw)

Hi.

I'm trying to implement this properly: GPCMD_READ_DISC_INFO 0x51

What I have done is added this to ide_atapi_cmd() in hw/ide/core.c in
Qemu 0.12.3
however I think with the help of you guys, you might help me implement
it properly.


    case GPCMD_READ_DISC_INFO:
        {
            uint64_t total_sectors;

            bdrv_get_geometry(s->bs, &total_sectors);
            total_sectors >>= 2;
            if (total_sectors == 0) {
                ide_atapi_cmd_error(s, SENSE_NOT_READY,
                                    ASC_MEDIUM_NOT_PRESENT);
            };

            int msf, start_track, len;
            msf = (packet[1] >> 1) & 1;
            start_track = packet[6];

            len = cdrom_read_toc(total_sectors, buf, msf, start_track);
            if (len < 0) {
                ide_atapi_cmd_error(s, SENSE_NOT_READY,
                                    ASC_MEDIUM_NOT_PRESENT);
            };

            cpu_to_ube16(&buf[0], 32);
                    buf[2] = 0x01;
                    buf[3] = 0;
                    buf[4] = 0;
                    buf[5] = 0;
                    buf[6] = len;
                    buf[7] = 0;
                    buf[8] = 0x20;
                    buf[9] = 0x00;
                    buf[10] = 0x01;
                    buf[11] = 0x00;

            ide_atapi_cmd_reply(s, 12, 32);
        }
        break;

                 reply	other threads:[~2010-08-08 17:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=AANLkTikSW75LS0-_s+MJXY5UNo1qpsVSw35SEPwP4-fV@mail.gmail.com \
    --to=jasper.hartline@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).