From patchwork Sat Sep 14 15:51:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 274925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 122D52C010C for ; Sun, 15 Sep 2013 01:52:05 +1000 (EST) Received: from localhost ([::1]:53783 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKs8h-0002yk-3M for incoming@patchwork.ozlabs.org; Sat, 14 Sep 2013 11:52:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKs75-0000hC-EJ for qemu-devel@nongnu.org; Sat, 14 Sep 2013 11:50:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKs6z-0004yO-K6 for qemu-devel@nongnu.org; Sat, 14 Sep 2013 11:50:23 -0400 Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]:38250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKs6y-0004x4-Te for qemu-devel@nongnu.org; Sat, 14 Sep 2013 11:50:17 -0400 Received: from localhost.localdomain (unknown [82.227.227.196]) by smtp2-g21.free.fr (Postfix) with ESMTP id 4C5FE4B01D1; Sat, 14 Sep 2013 17:50:10 +0200 (CEST) From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= To: qemu-devel@nongnu.org Date: Sat, 14 Sep 2013 17:51:09 +0200 Message-Id: <1379173870-10974-6-git-send-email-hpoussin@reactos.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1379173870-10974-1-git-send-email-hpoussin@reactos.org> References: <1379173870-10974-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:e0c:1:1599::11 Cc: Paolo Bonzini , =?UTF-8?q?Herv=C3=A9=20Poussineau?= Subject: [Qemu-devel] [PATCH v2 5/5] lsi: add 53C810 variant X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Currently, treat it exactly as a 53C895A. 53C895A is a 53C810 with more capabilities, so this should work. However, this lets us test different code paths on Linux, which don't use lastest features if it detect a 810, or on some OSes which only support 810 and not 895A (like very old Windows NT versions). Signed-off-by: Hervé Poussineau --- hw/scsi/lsi53c895a.c | 21 +++++++++++++++++++++ include/hw/pci/pci_ids.h | 1 + 2 files changed, 22 insertions(+) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 47e4680..1e75e5b 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -7,6 +7,12 @@ * This code is licensed under the LGPL. */ +/* Note: + * LSI53C810 emulation is incorrect, in the sense that it supports + * features added in later evolutions. This should not be a problem, + * as well-behaved operating systems will not try to use them. + */ + #include #include "hw/hw.h" @@ -275,6 +281,7 @@ typedef struct { uint32_t script_ram[2048]; } LSIState; +#define TYPE_LSI53C810 "lsi53c810" #define TYPE_LSI53C895A "lsi53c895a" #define LSI53C895A(obj) \ @@ -2152,9 +2159,23 @@ static const TypeInfo lsi_info = { .class_init = lsi_class_init, }; +static void lsi53c810_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->device_id = PCI_DEVICE_ID_LSI_53C810; +} + +static TypeInfo lsi53c810_info = { + .name = TYPE_LSI53C810, + .parent = TYPE_LSI53C895A, + .class_init = lsi53c810_class_init, +}; + static void lsi53c895a_register_types(void) { type_register_static(&lsi_info); + type_register_static(&lsi53c810_info); } type_init(lsi53c895a_register_types) diff --git a/include/hw/pci/pci_ids.h b/include/hw/pci/pci_ids.h index 3ddaf6a..4c0002b 100644 --- a/include/hw/pci/pci_ids.h +++ b/include/hw/pci/pci_ids.h @@ -53,6 +53,7 @@ /* Vendors and devices. Sort key: vendor first, device next. */ #define PCI_VENDOR_ID_LSI_LOGIC 0x1000 +#define PCI_DEVICE_ID_LSI_53C810 0x0001 #define PCI_DEVICE_ID_LSI_53C895A 0x0012 #define PCI_DEVICE_ID_LSI_SAS1078 0x0060