Skip to contentSkip to conversation

xen: move to new pci initializers

PATCH In review Michael S. Tsirkin 3 participants 4 messages Jun 26, 2011 – Jun 29, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: move to new pci initializers

move ids to pci info structure

Untested.

---
 hw/xen_platform.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
hw/xen_platform.c +7 -8
index 9a01735..f43e175 100644
@@ -290,18 +290,10 @@ static int xen_platform_initfn(PCIDevice *dev)
 
     pci_conf = d->pci_dev.config;
 
-    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_XEN);
-    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_XEN_PLATFORM);
-    pci_set_word(pci_conf + PCI_SUBSYSTEM_VENDOR_ID, PCI_VENDOR_ID_XEN);
-    pci_set_word(pci_conf + PCI_SUBSYSTEM_ID, PCI_DEVICE_ID_XEN_PLATFORM);
-
     pci_set_word(pci_conf + PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
 
-    pci_config_set_revision(pci_conf, 1);
     pci_config_set_prog_interface(pci_conf, 0);
 
-    pci_config_set_class(pci_conf, PCI_CLASS_OTHERS << 8 | 0x80);
-
     pci_conf[PCI_INTERRUPT_PIN] = 1;
 
     pci_register_bar(&d->pci_dev, 0, 0x100,
@@ -330,6 +322,13 @@ static PCIDeviceInfo xen_platform_info = {
     .qdev.size = sizeof(PCIXenPlatformState),
     .qdev.vmsd = &vmstate_xen_platform,
     .qdev.reset = platform_reset,
+
+    .vendor_id    =  PCI_VENDOR_ID_XEN,
+    .device_id    = PCI_DEVICE_ID_XEN_PLATFORM,
+    .class_id     = PCI_CLASS_OTHERS << 8 | 0x80,
+    .subsystem_vendor_id = PCI_VENDOR_ID_XEN,
+    .subsystem_id = PCI_DEVICE_ID_XEN_PLATFORM,
+    .revision = 1,
 };
 
 static void xen_platform_register(void)
Signature · 1 line
1.7.5.53.gc233e
#1 lore raw
Quoted 6 lines · Michael S. Tsirkin

move ids to pci info structure

Untested.

tested and working correctly, it is fine by me.

Quoted 44 lines
---
 hw/xen_platform.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)
hw/xen_platform.c +7 -8
index 9a01735..f43e175 100644
@@ -290,18 +290,10 @@ static int xen_platform_initfn(PCIDevice *dev)
 
     pci_conf = d->pci_dev.config;
 
-    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_XEN);
-    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_XEN_PLATFORM);
-    pci_set_word(pci_conf + PCI_SUBSYSTEM_VENDOR_ID, PCI_VENDOR_ID_XEN);
-    pci_set_word(pci_conf + PCI_SUBSYSTEM_ID, PCI_DEVICE_ID_XEN_PLATFORM);
-
     pci_set_word(pci_conf + PCI_COMMAND, PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
 
-    pci_config_set_revision(pci_conf, 1);
     pci_config_set_prog_interface(pci_conf, 0);
 
-    pci_config_set_class(pci_conf, PCI_CLASS_OTHERS << 8 | 0x80);
-
     pci_conf[PCI_INTERRUPT_PIN] = 1;
 
     pci_register_bar(&d->pci_dev, 0, 0x100,
@@ -330,6 +322,13 @@ static PCIDeviceInfo xen_platform_info = {
     .qdev.size = sizeof(PCIXenPlatformState),
     .qdev.vmsd = &vmstate_xen_platform,
     .qdev.reset = platform_reset,
+
+    .vendor_id    =  PCI_VENDOR_ID_XEN,
+    .device_id    = PCI_DEVICE_ID_XEN_PLATFORM,
+    .class_id     = PCI_CLASS_OTHERS << 8 | 0x80,
+    .subsystem_vendor_id = PCI_VENDOR_ID_XEN,
+    .subsystem_id = PCI_DEVICE_ID_XEN_PLATFORM,
+    .revision = 1,
 };
 
 static void xen_platform_register(void)
Signature · 1 line
1.7.5.53.gc233e
#2 lore raw
Quoted 9 lines · Stefano Stabellini
Quoted 6 lines · Michael S. Tsirkin

move ids to pci info structure

Untested.

tested and working correctly, it is fine by me.

Michael, which tree do you want this to go through?

Alex

#3 lore raw
Quoted 11 lines · Alexander Graf
Quoted 8 lines · Stefano Stabellini
Quoted 6 lines · Michael S. Tsirkin

move ids to pci info structure

Untested.

Quoted 6 lines
Quoted 1 line

tested and working correctly, it is fine by me.

Michael, which tree do you want this to go through?

Alex

I put this on my tree.