From patchwork Tue May 18 06:57:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 52838 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 02E15B7D94 for ; Tue, 18 May 2010 17:07:26 +1000 (EST) Received: from localhost ([127.0.0.1]:34133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEGte-0007LX-Pc for incoming@patchwork.ozlabs.org; Tue, 18 May 2010 03:07:22 -0400 Received: from [140.186.70.92] (port=44284 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEGnf-0001vn-VQ for qemu-devel@nongnu.org; Tue, 18 May 2010 03:05:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEGjo-0002g8-6y for qemu-devel@nongnu.org; Tue, 18 May 2010 03:01:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59140 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEGjl-0002fg-5p for qemu-devel@nongnu.org; Tue, 18 May 2010 02:57:10 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 537668726A; Tue, 18 May 2010 08:57:08 +0200 (CEST) Date: Tue, 18 May 2010 08:57:08 +0200 To: Nicholas A.Bellinger User-Agent: Heirloom mailx 12.2 01/07/07 MIME-Version: 1.0 Message-Id: <20100518065708.419FE2A371@ochil.suse.de> From: hare@suse.de (Hannes Reinecke) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 3/4] megasas: Add some more functions to keep Windows happy 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 We shouldn't announce we have BIOS disabled, otherwise Windows will barf. And Windows7 insists on sending CLUSTER commands, so we can just implement them, too. Signed-off-by: Hannes Reinecke --- hw/megasas.c | 24 ++++++++++++++++++++++-- hw/mfi.h | 1 + 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/hw/megasas.c b/hw/megasas.c index c3b74ef..e91c96b 100644 --- a/hw/megasas.c +++ b/hw/megasas.c @@ -556,7 +556,6 @@ static int megasas_dcmd_get_bios_info(MPTState *d, struct megasas_cmd_t *cmd) memset(&info, 0x0, sizeof(info)); info.continue_on_error = 1; - info.do_not_int_13 = 1; memcpy(cmd->iov_buf, (uint8_t *)&info, sizeof(info)); return sizeof(info); @@ -572,6 +571,18 @@ static int megasas_dcmd_get_fw_time(MPTState *d, struct megasas_cmd_t *cmd) return sizeof(fw_time); } +static int megasas_dcmd_set_fw_time(MPTState *d, struct megasas_cmd_t *cmd) +{ + uint64_t fw_time; + + memcpy(&fw_time, cmd->frame->dcmd.mbox, sizeof(fw_time)); + DPRINTF("set fw time %lx\n", fw_time); + fw_time = megasas_fw_time(); + memcpy(cmd->iov_buf, (uint8_t *)&fw_time, sizeof(fw_time)); + + return sizeof(fw_time); +} + static int megasas_dcmd_pd_get_list(MPTState *s, struct megasas_cmd_t *cmd) { struct mfi_pd_list info; @@ -865,7 +876,6 @@ static int megasas_handle_dcmd(MPTState *s, struct megasas_cmd_t *cmd) size = megasas_dcmd_set_properties(s, cmd); retval = MFI_STAT_OK; break; - case 0x01080102: case MFI_DCMD_CFG_READ: case MFI_DCMD_CFG_FOREIGN_READ: case MFI_DCMD_CTRL_EVENT_GETINFO: @@ -878,6 +888,12 @@ static int megasas_handle_dcmd(MPTState *s, struct megasas_cmd_t *cmd) #endif retval = MFI_STAT_INVALID_DCMD; break; + case MFI_DCMD_CLUSTER_RESET_ALL: + case MFI_DCMD_CLUSTER_RESET_LD: + /* Cluster reset commands have a size of 0 */ + size = 0; + retval = MFI_STAT_OK; + break; case MFI_DCMD_CTRL_GET_BIOS_INFO: size = megasas_dcmd_get_bios_info(s, cmd); retval = MFI_STAT_OK; @@ -886,6 +902,10 @@ static int megasas_handle_dcmd(MPTState *s, struct megasas_cmd_t *cmd) size = megasas_dcmd_get_fw_time(s, cmd); retval = MFI_STAT_OK; break; + case MFI_DCMD_CTRL_SET_TIME: + size = megasas_dcmd_set_fw_time(s, cmd); + retval = MFI_STAT_OK; + break; case 0x010e0301: case 0x010e0302: case 0x010e8481: diff --git a/hw/mfi.h b/hw/mfi.h index 312563e..0beb1b6 100644 --- a/hw/mfi.h +++ b/hw/mfi.h @@ -167,6 +167,7 @@ typedef enum { MFI_DCMD_CTRL_SHUTDOWN = 0x01050000, MFI_DCMD_HIBERNATE_SHUTDOWN = 0x01060000, MFI_DCMD_CTRL_GET_TIME = 0x01080101, + MFI_DCMD_CTRL_SET_TIME = 0x01080102, MFI_DCMD_CTRL_GET_BIOS_INFO = 0x010c0100, MFI_DCMD_CTRL_FACTORY_DEFAULTS = 0x010d0000, MFI_DCMD_CTRL_MFC_DEFAULTS_GET = 0x010e0201,