From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKZOm-0002tF-M1 for qemu-devel@nongnu.org; Fri, 13 Sep 2013 15:51:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKZOh-0006U3-3V for qemu-devel@nongnu.org; Fri, 13 Sep 2013 15:51:24 -0400 Received: from smtp3-g21.free.fr ([2a01:e0c:1:1599::12]:51270) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKZOg-0006Tk-Ga for qemu-devel@nongnu.org; Fri, 13 Sep 2013 15:51:19 -0400 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Fri, 13 Sep 2013 21:50:57 +0200 Message-Id: <1379101857-27500-5-git-send-email-hpoussin@reactos.org> In-Reply-To: <1379101857-27500-1-git-send-email-hpoussin@reactos.org> References: <1379101857-27500-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 4/4] lsi: add 53C810 variant List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paul Brook 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=C3=A9 Poussineau --- hw/scsi/lsi53c895a.c | 15 +++++++++++++++ include/hw/pci/pci_ids.h | 1 + 2 files changed, 16 insertions(+) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index a9a9eca..f048780 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -278,6 +278,7 @@ typedef struct { uint32_t script_ram[2048]; } LSIState; =20 +#define TYPE_LSI53C810 "lsi53c810" #define TYPE_LSI53C895A "lsi53c895a" =20 #define LSI53C895A(obj) \ @@ -2155,9 +2156,23 @@ static const TypeInfo lsi_info =3D { .class_init =3D lsi_class_init, }; =20 +static void lsi53c810_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k =3D PCI_DEVICE_CLASS(klass); + + k->device_id =3D PCI_DEVICE_ID_LSI_53C810; +} + +static TypeInfo lsi53c810_info =3D { + .name =3D TYPE_LSI53C810, + .parent =3D TYPE_LSI53C895A, + .class_init =3D lsi53c810_class_init, +}; + static void lsi53c895a_register_types(void) { type_register_static(&lsi_info); + type_register_static(&lsi53c810_info); } =20 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. */ =20 #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 =20 --=20 1.7.10.4