From patchwork Mon Jul 19 13:53:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 59198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3CC961007D1 for ; Mon, 19 Jul 2010 23:59:31 +1000 (EST) Received: from localhost ([127.0.0.1]:59605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OaqoY-0002ee-31 for incoming@patchwork.ozlabs.org; Mon, 19 Jul 2010 09:55:26 -0400 Received: from [140.186.70.92] (port=41556 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oaqo5-0002ce-3M for qemu-devel@nongnu.org; Mon, 19 Jul 2010 09:54:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oaqnv-00006n-Ha for qemu-devel@nongnu.org; Mon, 19 Jul 2010 09:54:49 -0400 Received: from hall.aurel32.net ([88.191.82.174]:54416) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oaqnv-00006S-BZ for qemu-devel@nongnu.org; Mon, 19 Jul 2010 09:54:47 -0400 Received: from [2a01:e35:2e80:2fb0:21e:8cff:feb0:693b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Oaqns-000326-QA; Mon, 19 Jul 2010 15:54:44 +0200 Received: from aurel32 by volta.aurel32.net with local (Exim 4.72) (envelope-from ) id 1OaqnD-0006fP-Q2; Mon, 19 Jul 2010 15:54:03 +0200 From: Aurelien Jarno To: Kevin Wolf Date: Mon, 19 Jul 2010 15:53:35 +0200 Message-Id: <1279547615-25599-1-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: QEMU Developers , Aurelien Jarno Subject: [Qemu-devel] [PATCH] ide/atapi: add support for GET EVENT STATUS NOTIFICATION X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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);