Commit caf02abf authored by Robin H. Johnson's avatar Robin H. Johnson Committed by Bjorn Helgaas

PCI: Add QEMU top-level IDs for (sub)vendor & device

Introduce PCI_VENDOR/PCI_SUBVENDOR/PCI_SUBDEVICE defines to replace the
constants scattered in the kernel already used to detect QEMU.

They are defined in the QEMU codebase per docs/specs/pci-ids.txt.
Signed-off-by: default avatarRobin H. Johnson <robbat2@gentoo.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 9289b9d3
...@@ -182,8 +182,8 @@ static const struct pci_device_id bochs_pci_tbl[] = { ...@@ -182,8 +182,8 @@ static const struct pci_device_id bochs_pci_tbl[] = {
{ {
.vendor = 0x1234, .vendor = 0x1234,
.device = 0x1111, .device = 0x1111,
.subvendor = 0x1af4, .subvendor = PCI_SUBVENDOR_ID_REDHAT_QUMRANET,
.subdevice = 0x1100, .subdevice = PCI_SUBDEVICE_ID_QEMU,
.driver_data = BOCHS_QEMU_STDVGA, .driver_data = BOCHS_QEMU_STDVGA,
}, },
{ {
......
...@@ -33,8 +33,9 @@ static struct drm_driver driver; ...@@ -33,8 +33,9 @@ static struct drm_driver driver;
/* only bind to the cirrus chip in qemu */ /* only bind to the cirrus chip in qemu */
static const struct pci_device_id pciidlist[] = { static const struct pci_device_id pciidlist[] = {
{ PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, 0x1af4, 0x1100, 0, { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446,
0, 0 }, PCI_SUBVENDOR_ID_REDHAT_QUMRANET, PCI_SUBDEVICE_ID_QEMU,
0, 0, 0 },
{ PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, PCI_VENDOR_ID_XEN, { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, PCI_VENDOR_ID_XEN,
0x0001, 0, 0, 0 }, 0x0001, 0, 0, 0 },
{0,} {0,}
......
...@@ -467,7 +467,7 @@ static const struct dev_pm_ops virtio_pci_pm_ops = { ...@@ -467,7 +467,7 @@ static const struct dev_pm_ops virtio_pci_pm_ops = {
/* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */ /* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */
static const struct pci_device_id virtio_pci_id_table[] = { static const struct pci_device_id virtio_pci_id_table[] = {
{ PCI_DEVICE(0x1af4, PCI_ANY_ID) }, { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) },
{ 0 } { 0 }
}; };
......
...@@ -2506,6 +2506,10 @@ ...@@ -2506,6 +2506,10 @@
#define PCI_VENDOR_ID_AZWAVE 0x1a3b #define PCI_VENDOR_ID_AZWAVE 0x1a3b
#define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4
#define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4
#define PCI_SUBDEVICE_ID_QEMU 0x1100
#define PCI_VENDOR_ID_ASMEDIA 0x1b21 #define PCI_VENDOR_ID_ASMEDIA 0x1b21
#define PCI_VENDOR_ID_CIRCUITCO 0x1cc8 #define PCI_VENDOR_ID_CIRCUITCO 0x1cc8
......
...@@ -2980,8 +2980,8 @@ static int snd_intel8x0_inside_vm(struct pci_dev *pci) ...@@ -2980,8 +2980,8 @@ static int snd_intel8x0_inside_vm(struct pci_dev *pci)
goto fini; goto fini;
/* check for known (emulated) devices */ /* check for known (emulated) devices */
if (pci->subsystem_vendor == 0x1af4 && if (pci->subsystem_vendor == PCI_SUBVENDOR_ID_REDHAT_QUMRANET &&
pci->subsystem_device == 0x1100) { pci->subsystem_device == PCI_SUBDEVICE_ID_QEMU) {
/* KVM emulated sound, PCI SSID: 1af4:1100 */ /* KVM emulated sound, PCI SSID: 1af4:1100 */
msg = "enable KVM"; msg = "enable KVM";
} else if (pci->subsystem_vendor == 0x1ab8) { } else if (pci->subsystem_vendor == 0x1ab8) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment