From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KYoG9-0005vK-H0 for qemu-devel@nongnu.org; Thu, 28 Aug 2008 16:38:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KYoG8-0005um-4V for qemu-devel@nongnu.org; Thu, 28 Aug 2008 16:38:25 -0400 Received: from [199.232.76.173] (port=44989 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYoG7-0005uj-Sr for qemu-devel@nongnu.org; Thu, 28 Aug 2008 16:38:23 -0400 Received: from an-out-0708.google.com ([209.85.132.246]:21393) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KYoG7-0005b2-F1 for qemu-devel@nongnu.org; Thu, 28 Aug 2008 16:38:23 -0400 Received: by an-out-0708.google.com with SMTP id d18so88888and.130 for ; Thu, 28 Aug 2008 13:38:21 -0700 (PDT) Message-ID: <48B70C8D.2030003@codemonkey.ws> Date: Thu, 28 Aug 2008 15:37:33 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 3/4] pci: add default pci subsystem id for all devices. References: <1219912589-12476-1-git-send-email-kraxel@redhat.com> <1219912589-12476-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1219912589-12476-3-git-send-email-kraxel@redhat.com> 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 Cc: Gerd Hoffmann Gerd Hoffmann wrote: > This sets a default PCI subsystem ID for all emulated PCI devices. PCI > specs require this, so do it. The defaults are global variables so > they can easily be changed (before device creation) as Xen probably > wants to use the XenSource vendor ID instead of the qemu default. > > The defaults are pre-filled by pci_register_device(). Individual > drivers can overwrite it of course when setting up the config space > for the emulated device. > > TODO: get an official vendor ID assigned, or borrow one (maybe > Qumranet which already sponsors the virtio IDs ???). > Does the subvendor ID have to be an official vendor ID? I thought that the subvendor ID could be defined by the vendor as whatever it wants.. > Signed-off-by: Gerd Hoffmann > --- > hw/pci.c | 11 +++++++++++ > hw/pci.h | 2 ++ > 2 files changed, 13 insertions(+), 0 deletions(-) > > diff --git a/hw/pci.c b/hw/pci.c > index bc55989..ffc90d7 100644 > --- a/hw/pci.c > +++ b/hw/pci.c > @@ -50,6 +50,8 @@ static void pci_update_mappings(PCIDevice *d); > static void pci_set_irq(void *opaque, int irq_num, int level); > > target_phys_addr_t pci_mem_base; > +uint16_t pci_default_sub_vendor_id = 0xfffa; /* FIXME: get one assigned */ > +uint16_t pci_default_sub_device_id = 0x0001; > Probably should just be a define. Regards, Anthony Liguori