From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49894 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdOFE-0002Mo-Or for qemu-devel@nongnu.org; Mon, 26 Jul 2010 10:01:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OdOF6-0005P8-Uu for qemu-devel@nongnu.org; Mon, 26 Jul 2010 10:01:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36488) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdOF6-0005Ow-Hv for qemu-devel@nongnu.org; Mon, 26 Jul 2010 10:01:20 -0400 From: Kevin Wolf Date: Mon, 26 Jul 2010 16:01:11 +0200 Message-Id: <1280152877-29037-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1280152877-29037-1-git-send-email-kwolf@redhat.com> References: <1280152877-29037-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 1/7] ide/atapi: add support for GET EVENT STATUS NOTIFICATION List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Aurelien Jarno 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 Signed-off-by: Kevin Wolf --- 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