qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: anthony@codemonkey.ws
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/7] ide/atapi: add support for GET EVENT STATUS NOTIFICATION
Date: Mon, 26 Jul 2010 16:01:11 +0200	[thread overview]
Message-ID: <1280152877-29037-2-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1280152877-29037-1-git-send-email-kwolf@redhat.com>

From: Aurelien Jarno <aurelien@aurel32.net>

The GET EVENT STATUS NOTIFICATION is a mandatory command according
to MMC-3, even if event status notification is not supported.

This patch adds support for this command. It returns NEA ("No Event
Available") with an empty "Supported Event Classes" to show that it
doesn't event support status notification. If asychronous operation is
requested, which requires NCQ support, it returns an error according
to the specifications.

This fixes HAL support on FreeBSD and derivatives, which fill up the
logs every second with:

  acd0: FAILURE - unknown CMD (0x03) ILLEGAL REQUEST asc=0x20 ascq=0x00

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide/core.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index e20f2e7..9e1bdd5 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1643,6 +1643,21 @@ static void ide_atapi_cmd(IDEState *s)
             ide_atapi_cmd_reply(s, len, max_len);
             break;
         }
+    case GPCMD_GET_EVENT_STATUS_NOTIFICATION:
+        max_len = ube16_to_cpu(packet + 7);
+
+        if (packet[1] & 0x01) { /* polling */
+            /* We don't support any event class (yet). */
+            cpu_to_ube16(buf, 0x00); /* No event descriptor returned */
+            buf[2] = 0x80;           /* No Event Available (NEA) */
+            buf[3] = 0x00;           /* Empty supported event classes */
+            ide_atapi_cmd_reply(s, 4, max_len);
+        } else { /* asynchronous mode */
+            /* Only polling is supported, asynchronous mode is not. */
+            ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
+                                ASC_INV_FIELD_IN_CMD_PACKET);
+        }
+        break;
     default:
         ide_atapi_cmd_error(s, SENSE_ILLEGAL_REQUEST,
                             ASC_ILLEGAL_OPCODE);
-- 
1.7.1.1

  reply	other threads:[~2010-07-26 14:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 14:01 [Qemu-devel] [PULL 0/7] Block patches Kevin Wolf
2010-07-26 14:01 ` Kevin Wolf [this message]
2010-07-26 14:01 ` [Qemu-devel] [PATCH 2/7] block migration: propagate return value when bdrv_write() returns < 0 Kevin Wolf
2010-07-26 14:01 ` [Qemu-devel] [PATCH 3/7] virtio-blk: Create exit function to unregister savevm Kevin Wolf
2010-07-26 14:01 ` [Qemu-devel] [PATCH 4/7] move 'unsafe' to end of caching modes in help Kevin Wolf
2010-07-26 17:28   ` [Qemu-devel] " Anthony Liguori
2010-07-27 16:10     ` Kevin Wolf
2010-07-27 16:17       ` Anthony Liguori
2010-07-26 14:01 ` [Qemu-devel] [PATCH 5/7] block: default to 0 minimal / optiomal I/O size Kevin Wolf
2010-07-26 14:01 ` [Qemu-devel] [PATCH 6/7] block: Use error codes from lower levels for error message Kevin Wolf
2010-07-26 14:01 ` [Qemu-devel] [PATCH 7/7] Fix -snapshot deleting images on disk change Kevin Wolf

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=1280152877-29037-2-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=anthony@codemonkey.ws \
    --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).