Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

authored by

Robin H. Johnson and committed by
Bjorn Helgaas
caf02abf 9289b9d3

+12 -7
+2 -2
drivers/gpu/drm/bochs/bochs_drv.c
··· 182 182 { 183 183 .vendor = 0x1234, 184 184 .device = 0x1111, 185 - .subvendor = 0x1af4, 186 - .subdevice = 0x1100, 185 + .subvendor = PCI_SUBVENDOR_ID_REDHAT_QUMRANET, 186 + .subdevice = PCI_SUBDEVICE_ID_QEMU, 187 187 .driver_data = BOCHS_QEMU_STDVGA, 188 188 }, 189 189 {
+3 -2
drivers/gpu/drm/cirrus/cirrus_drv.c
··· 33 33 34 34 /* only bind to the cirrus chip in qemu */ 35 35 static const struct pci_device_id pciidlist[] = { 36 - { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, 0x1af4, 0x1100, 0, 37 - 0, 0 }, 36 + { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, 37 + PCI_SUBVENDOR_ID_REDHAT_QUMRANET, PCI_SUBDEVICE_ID_QEMU, 38 + 0, 0, 0 }, 38 39 { PCI_VENDOR_ID_CIRRUS, PCI_DEVICE_ID_CIRRUS_5446, PCI_VENDOR_ID_XEN, 39 40 0x0001, 0, 0, 0 }, 40 41 {0,}
+1 -1
drivers/virtio/virtio_pci_common.c
··· 467 467 468 468 /* Qumranet donated their vendor ID for devices 0x1000 thru 0x10FF. */ 469 469 static const struct pci_device_id virtio_pci_id_table[] = { 470 - { PCI_DEVICE(0x1af4, PCI_ANY_ID) }, 470 + { PCI_DEVICE(PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_ANY_ID) }, 471 471 { 0 } 472 472 }; 473 473
+4
include/linux/pci_ids.h
··· 2506 2506 2507 2507 #define PCI_VENDOR_ID_AZWAVE 0x1a3b 2508 2508 2509 + #define PCI_VENDOR_ID_REDHAT_QUMRANET 0x1af4 2510 + #define PCI_SUBVENDOR_ID_REDHAT_QUMRANET 0x1af4 2511 + #define PCI_SUBDEVICE_ID_QEMU 0x1100 2512 + 2509 2513 #define PCI_VENDOR_ID_ASMEDIA 0x1b21 2510 2514 2511 2515 #define PCI_VENDOR_ID_CIRCUITCO 0x1cc8
+2 -2
sound/pci/intel8x0.c
··· 2980 2980 goto fini; 2981 2981 2982 2982 /* check for known (emulated) devices */ 2983 - if (pci->subsystem_vendor == 0x1af4 && 2984 - pci->subsystem_device == 0x1100) { 2983 + if (pci->subsystem_vendor == PCI_SUBVENDOR_ID_REDHAT_QUMRANET && 2984 + pci->subsystem_device == PCI_SUBDEVICE_ID_QEMU) { 2985 2985 /* KVM emulated sound, PCI SSID: 1af4:1100 */ 2986 2986 msg = "enable KVM"; 2987 2987 } else if (pci->subsystem_vendor == 0x1ab8) {