hw/unin_pci.c: convert to PCIDeviceInfo to initialize ids
use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
		
							parent
							
								
									e8b36ba92e
								
							
						
					
					
						commit
						d7b61ecc61
					
				| @ -279,10 +279,6 @@ PCIBus *pci_pmac_u3_init(qemu_irq *pic) | ||||
| 
 | ||||
| static int unin_main_pci_host_init(PCIDevice *d) | ||||
| { | ||||
|     pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_APPLE); | ||||
|     pci_config_set_device_id(d->config, PCI_DEVICE_ID_APPLE_UNI_N_PCI); | ||||
|     d->config[0x08] = 0x00; // revision
 | ||||
|     pci_config_set_class(d->config, PCI_CLASS_BRIDGE_HOST); | ||||
|     d->config[0x0C] = 0x08; // cache_line_size
 | ||||
|     d->config[0x0D] = 0x10; // latency_timer
 | ||||
|     d->config[0x34] = 0x00; // capabilities_pointer
 | ||||
| @ -291,10 +287,6 @@ static int unin_main_pci_host_init(PCIDevice *d) | ||||
| 
 | ||||
| static int unin_agp_pci_host_init(PCIDevice *d) | ||||
| { | ||||
|     pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_APPLE); | ||||
|     pci_config_set_device_id(d->config, PCI_DEVICE_ID_APPLE_UNI_N_AGP); | ||||
|     d->config[0x08] = 0x00; // revision
 | ||||
|     pci_config_set_class(d->config, PCI_CLASS_BRIDGE_HOST); | ||||
|     d->config[0x0C] = 0x08; // cache_line_size
 | ||||
|     d->config[0x0D] = 0x10; // latency_timer
 | ||||
|     //    d->config[0x34] = 0x80; // capabilities_pointer
 | ||||
| @ -303,11 +295,6 @@ static int unin_agp_pci_host_init(PCIDevice *d) | ||||
| 
 | ||||
| static int u3_agp_pci_host_init(PCIDevice *d) | ||||
| { | ||||
|     pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_APPLE); | ||||
|     pci_config_set_device_id(d->config, PCI_DEVICE_ID_APPLE_U3_AGP); | ||||
|     /* revision */ | ||||
|     d->config[0x08] = 0x00; | ||||
|     pci_config_set_class(d->config, PCI_CLASS_BRIDGE_HOST); | ||||
|     /* cache line size */ | ||||
|     d->config[0x0C] = 0x08; | ||||
|     /* latency timer */ | ||||
| @ -317,10 +304,6 @@ static int u3_agp_pci_host_init(PCIDevice *d) | ||||
| 
 | ||||
| static int unin_internal_pci_host_init(PCIDevice *d) | ||||
| { | ||||
|     pci_config_set_vendor_id(d->config, PCI_VENDOR_ID_APPLE); | ||||
|     pci_config_set_device_id(d->config, PCI_DEVICE_ID_APPLE_UNI_N_I_PCI); | ||||
|     d->config[0x08] = 0x00; // revision
 | ||||
|     pci_config_set_class(d->config, PCI_CLASS_BRIDGE_HOST); | ||||
|     d->config[0x0C] = 0x08; // cache_line_size
 | ||||
|     d->config[0x0D] = 0x10; // latency_timer
 | ||||
|     d->config[0x34] = 0x00; // capabilities_pointer
 | ||||
| @ -331,24 +314,40 @@ static PCIDeviceInfo unin_main_pci_host_info = { | ||||
|     .qdev.name = "uni-north", | ||||
|     .qdev.size = sizeof(PCIDevice), | ||||
|     .init      = unin_main_pci_host_init, | ||||
|     .vendor_id = PCI_VENDOR_ID_APPLE, | ||||
|     .device_id = PCI_DEVICE_ID_APPLE_UNI_N_PCI, | ||||
|     .revision  = 0x00, | ||||
|     .class_id  = PCI_CLASS_BRIDGE_HOST, | ||||
| }; | ||||
| 
 | ||||
| static PCIDeviceInfo u3_agp_pci_host_info = { | ||||
|     .qdev.name = "u3-agp", | ||||
|     .qdev.size = sizeof(PCIDevice), | ||||
|     .init      = u3_agp_pci_host_init, | ||||
|     .vendor_id = PCI_VENDOR_ID_APPLE, | ||||
|     .device_id = PCI_DEVICE_ID_APPLE_U3_AGP, | ||||
|     .revision  = 0x00, | ||||
|     .class_id  = PCI_CLASS_BRIDGE_HOST, | ||||
| }; | ||||
| 
 | ||||
| static PCIDeviceInfo unin_agp_pci_host_info = { | ||||
|     .qdev.name = "uni-north-agp", | ||||
|     .qdev.size = sizeof(PCIDevice), | ||||
|     .init      = unin_agp_pci_host_init, | ||||
|     .vendor_id = PCI_VENDOR_ID_APPLE, | ||||
|     .device_id = PCI_DEVICE_ID_APPLE_UNI_N_AGP, | ||||
|     .revision  = 0x00, | ||||
|     .class_id  = PCI_CLASS_BRIDGE_HOST, | ||||
| }; | ||||
| 
 | ||||
| static PCIDeviceInfo unin_internal_pci_host_info = { | ||||
|     .qdev.name = "uni-north-pci", | ||||
|     .qdev.size = sizeof(PCIDevice), | ||||
|     .init      = unin_internal_pci_host_init, | ||||
|     .vendor_id = PCI_VENDOR_ID_APPLE, | ||||
|     .device_id = PCI_DEVICE_ID_APPLE_UNI_N_I_PCI, | ||||
|     .revision  = 0x00, | ||||
|     .class_id  = PCI_CLASS_BRIDGE_HOST, | ||||
| }; | ||||
| 
 | ||||
| static void unin_register_devices(void) | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Isaku Yamahata
						Isaku Yamahata