From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lfgov-0003aj-Dx for qemu-devel@nongnu.org; Fri, 06 Mar 2009 15:39:01 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lfgot-0003Zz-P2 for qemu-devel@nongnu.org; Fri, 06 Mar 2009 15:39:00 -0500 Received: from [199.232.76.173] (port=49670 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lfgot-0003Zs-7e for qemu-devel@nongnu.org; Fri, 06 Mar 2009 15:38:59 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:59421) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lfgor-00024c-4Q for qemu-devel@nongnu.org; Fri, 06 Mar 2009 15:38:59 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e7.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n26KUBk5021349 for ; Fri, 6 Mar 2009 15:30:11 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n26Kcn9U167024 for ; Fri, 6 Mar 2009 15:38:49 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n26KbU5k018667 for ; Fri, 6 Mar 2009 15:37:30 -0500 Received: from squirrel.codemonkey.ws (sig-9-65-57-49.mts.ibm.com [9.65.57.49]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n26KbTR0018640 for ; Fri, 6 Mar 2009 15:37:30 -0500 Message-ID: <49B189D6.20808@us.ibm.com> Date: Fri, 06 Mar 2009 14:38:46 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Add and use remaining #defines for PCI device IDs References: <20090301170120.GA666@miranda.arrow> In-Reply-To: <20090301170120.GA666@miranda.arrow> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Stuart Brady wrote: > This patch adds and uses #defines for the remaining hardcoded PCI > device IDs. It also marks in hw/pci.h those IDs that have not been > taken from linux/pci_ids.h, and removes the 'RTL' from > PCI_DEVICE_ID_REALTEK_RTL8029. > > Signed-off-by: Stuart Brady > > Index: hw/sh_pci.c > =================================================================== > --- hw/sh_pci.c (revision 6657) > +++ hw/sh_pci.c (working copy) > @@ -189,7 +189,7 @@ > cpu_register_physical_memory(0xfd000000, 0x1000000, mem); > > pci_config_set_vendor_id(p->dev->config, PCI_VENDOR_ID_HITACHI); > - pci_config_set_device_id(p->dev->config, 0x350e); // SH7751R > + pci_config_set_device_id(p->dev->config, PCI_DEVICE_ID_HITACHI_SH7751R); > p->dev->config[0x04] = 0x80; > p->dev->config[0x05] = 0x00; > p->dev->config[0x06] = 0x90; > Index: hw/usb-ohci.c > =================================================================== > --- hw/usb-ohci.c (revision 6657) > +++ hw/usb-ohci.c (working copy) > @@ -1680,7 +1680,8 @@ > } > > pci_config_set_vendor_id(ohci->pci_dev.config, PCI_VENDOR_ID_APPLE); > - pci_config_set_device_id(ohci->pci_dev.config, 0x003f); // device_id > + pci_config_set_device_id(ohci->pci_dev.config, > + PCI_DEVICE_ID_APPLE_IPID_USB); > ohci->pci_dev.config[0x09] = 0x10; /* OHCI */ > pci_config_set_class(ohci->pci_dev.config, PCI_CLASS_SERIAL_USB); > ohci->pci_dev.config[0x3d] = 0x01; /* interrupt pin 1 */ > Index: hw/pci.h > =================================================================== > --- hw/pci.h (revision 6657) > +++ hw/pci.h (working copy) > @@ -54,23 +54,26 @@ > #define PCI_VENDOR_ID_CIRRUS 0x1013 > > #define PCI_VENDOR_ID_IBM 0x1014 > -#define PCI_DEVICE_ID_IBM_OPENPIC2 0xffff > +#define PCI_DEVICE_ID_IBM_440GX 0x027f // * > +#define PCI_DEVICE_ID_IBM_OPENPIC2 0xffff // * > Can you just move the ones that aren't from Linux into a separate header file? The C99 comment makes no sense on it's own. Regards, Anthony Liguori > #define PCI_VENDOR_ID_AMD 0x1022 > #define PCI_DEVICE_ID_AMD_LANCE 0x2000 > > -#define PCI_VENDOR_ID_HITACHI 0x1054 > +#define PCI_VENDOR_ID_HITACHI 0x1054 // * > +#define PCI_DEVICE_ID_HITACHI_SH7751R 0x350e // * > > #define PCI_VENDOR_ID_MOTOROLA 0x1057 > #define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002 > #define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801 > > #define PCI_VENDOR_ID_APPLE 0x106b > -#define PCI_DEVICE_ID_APPLE_343S1201 0x0010 > -#define PCI_DEVICE_ID_APPLE_UNI_N_I_PCI 0x001e > -#define PCI_DEVICE_ID_APPLE_UNI_N_PCI 0x001f > +#define PCI_DEVICE_ID_APPLE_343S1201 0x0010 // * > +#define PCI_DEVICE_ID_APPLE_UNI_N_I_PCI 0x001e // * > +#define PCI_DEVICE_ID_APPLE_UNI_N_PCI 0x001f // * > #define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020 > -#define PCI_DEVICE_ID_APPLE_UNI_N_KEYL 0x0022 > +#define PCI_DEVICE_ID_APPLE_UNI_N_KEYL 0x0022 // * > +#define PCI_DEVICE_ID_APPLE_IPID_USB 0x003f // * > > #define PCI_VENDOR_ID_SUN 0x108e > #define PCI_DEVICE_ID_SUN_EBUS 0x1000 > @@ -81,27 +84,30 @@ > #define PCI_DEVICE_ID_CMD_646 0x0646 > > #define PCI_VENDOR_ID_REALTEK 0x10ec > -#define PCI_DEVICE_ID_REALTEK_RTL8029 0x8029 > +#define PCI_DEVICE_ID_REALTEK_8029 0x8029 // * > #define PCI_DEVICE_ID_REALTEK_8139 0x8139 > > #define PCI_VENDOR_ID_XILINX 0x10ee > +#define PCI_DEVICE_ID_XILINX_XC2VP30 0x0300 // * > > #define PCI_VENDOR_ID_MARVELL 0x11ab > +#define PCI_DEVICE_ID_MARVELL_GT6412X 0x4620 // * > > -#define PCI_VENDOR_ID_QEMU 0x1234 > -#define PCI_DEVICE_ID_QEMU_VGA 0x1111 > +#define PCI_VENDOR_ID_QEMU 0x1234 // * > +#define PCI_DEVICE_ID_QEMU_VGA 0x1111 // * > > #define PCI_VENDOR_ID_ENSONIQ 0x1274 > #define PCI_DEVICE_ID_ENSONIQ_ES1370 0x5000 > > -#define PCI_VENDOR_ID_VMWARE 0x15ad > -#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 > -#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 > -#define PCI_DEVICE_ID_VMWARE_NET 0x0720 > -#define PCI_DEVICE_ID_VMWARE_SCSI 0x0730 > -#define PCI_DEVICE_ID_VMWARE_IDE 0x1729 > +#define PCI_VENDOR_ID_VMWARE 0x15ad // * > +#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 // * > +#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 // * > +#define PCI_DEVICE_ID_VMWARE_NET 0x0720 // * > +#define PCI_DEVICE_ID_VMWARE_SCSI 0x0730 // * > +#define PCI_DEVICE_ID_VMWARE_IDE 0x1729 // * > > #define PCI_VENDOR_ID_INTEL 0x8086 > +#define PCI_DEVICE_ID_INTEL_82551IT 0x1209 // * > #define PCI_DEVICE_ID_INTEL_82441 0x1237 > #define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415 > #define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000 > @@ -112,6 +118,8 @@ > #define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 > #define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 > > +// * = not in linux/pci_ids.h > + > /* Red Hat / Qumranet (for QEMU) -- see pci-ids.txt */ > #define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4 > #define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 > Index: hw/eepro100.c > =================================================================== > --- hw/eepro100.c (revision 6657) > +++ hw/eepro100.c (working copy) > @@ -424,7 +424,7 @@ > /* PCI Vendor ID */ > pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL); > /* PCI Device ID */ > - pci_config_set_device_id(pci_conf, 0x1209); > + pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82551IT); > /* PCI Command */ > PCI_CONFIG_16(PCI_COMMAND, 0x0000); > /* PCI Status */ > Index: hw/ne2000.c > =================================================================== > --- hw/ne2000.c (revision 6657) > +++ hw/ne2000.c (working copy) > @@ -789,7 +789,7 @@ > NULL, NULL); > pci_conf = d->dev.config; > pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_REALTEK); > - pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_REALTEK_RTL8029); > + pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_REALTEK_8029); > pci_config_set_class(pci_conf, PCI_CLASS_NETWORK_ETHERNET); > pci_conf[0x0e] = 0x00; // header_type > pci_conf[0x3d] = 1; // interrupt pin 0 > Index: hw/versatile_pci.c > =================================================================== > --- hw/versatile_pci.c (revision 6657) > +++ hw/versatile_pci.c (working copy) > @@ -126,7 +126,7 @@ > > pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_XILINX); > /* Both boards have the same device ID. Oh well. */ > - pci_config_set_device_id(d->config, 0x0300); // device_id > + pci_config_set_device_id(d->config, PCI_DEVICE_ID_XILINX_XC2VP30); > d->config[0x04] = 0x00; > d->config[0x05] = 0x00; > d->config[0x06] = 0x20; > Index: hw/ppc4xx_pci.c > =================================================================== > --- hw/ppc4xx_pci.c (revision 6657) > +++ hw/ppc4xx_pci.c (working copy) > @@ -379,7 +379,7 @@ > 0, NULL, NULL); > pci_conf = controller->pci_dev->config; > pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_IBM); > - pci_config_set_device_id(pci_conf, 0x027f); // device_id > + pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_IBM_440GX); > pci_config_set_class(pci_conf, PCI_CLASS_BRIDGE_OTHER); > > /* CFGADDR */ > Index: hw/gt64xxx.c > =================================================================== > --- hw/gt64xxx.c (revision 6657) > +++ hw/gt64xxx.c (working copy) > @@ -1137,7 +1137,7 @@ > /* FIXME: Malta specific hw assumptions ahead */ > > pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_MARVELL); > - pci_config_set_device_id(d->config, 0x4620); /* device_id */ > + pci_config_set_device_id(d->config, PCI_DEVICE_ID_MARVELL_GT6412X); > > d->config[0x04] = 0x00; > d->config[0x05] = 0x00; >