eepro100: Clean code which sets the PCI device id
* Use function pci_config_set_device_id * Use new macro PCI_DEVICE_ID_INTEL_82557 Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
		
							parent
							
								
									c32d766af1
								
							
						
					
					
						commit
						d6fd1e6603
					
				@ -397,8 +397,7 @@ static void pci_reset(EEPRO100State * s)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    /* PCI Vendor ID */
 | 
					    /* PCI Vendor ID */
 | 
				
			||||||
    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
 | 
					    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
 | 
				
			||||||
    /* PCI Device ID */
 | 
					    /* PCI Device ID depends on device and is set below. */
 | 
				
			||||||
    pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82551IT);
 | 
					 | 
				
			||||||
    /* PCI Command */
 | 
					    /* PCI Command */
 | 
				
			||||||
    PCI_CONFIG_16(PCI_COMMAND, 0x0000);
 | 
					    PCI_CONFIG_16(PCI_COMMAND, 0x0000);
 | 
				
			||||||
    /* PCI Status */
 | 
					    /* PCI Status */
 | 
				
			||||||
@ -446,29 +445,29 @@ static void pci_reset(EEPRO100State * s)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    switch (device) {
 | 
					    switch (device) {
 | 
				
			||||||
    case i82551:
 | 
					    case i82551:
 | 
				
			||||||
        //~ PCI_CONFIG_16(PCI_DEVICE_ID, 0x1209);
 | 
					        pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82551IT);
 | 
				
			||||||
        PCI_CONFIG_8(PCI_REVISION_ID, 0x0f);
 | 
					        PCI_CONFIG_8(PCI_REVISION_ID, 0x0f);
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    case i82557B:
 | 
					    case i82557B:
 | 
				
			||||||
        PCI_CONFIG_16(PCI_DEVICE_ID, 0x1229);
 | 
					        pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82557);
 | 
				
			||||||
        PCI_CONFIG_8(PCI_REVISION_ID, 0x02);
 | 
					        PCI_CONFIG_8(PCI_REVISION_ID, 0x02);
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    case i82557C:
 | 
					    case i82557C:
 | 
				
			||||||
        PCI_CONFIG_16(PCI_DEVICE_ID, 0x1229);
 | 
					        pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82557);
 | 
				
			||||||
        PCI_CONFIG_8(PCI_REVISION_ID, 0x03);
 | 
					        PCI_CONFIG_8(PCI_REVISION_ID, 0x03);
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    case i82558B:
 | 
					    case i82558B:
 | 
				
			||||||
        PCI_CONFIG_16(PCI_DEVICE_ID, 0x1229);
 | 
					        pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82557);
 | 
				
			||||||
        PCI_CONFIG_16(PCI_STATUS, 0x2810);
 | 
					        PCI_CONFIG_16(PCI_STATUS, 0x2810);
 | 
				
			||||||
        PCI_CONFIG_8(PCI_REVISION_ID, 0x05);
 | 
					        PCI_CONFIG_8(PCI_REVISION_ID, 0x05);
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    case i82559C:
 | 
					    case i82559C:
 | 
				
			||||||
        PCI_CONFIG_16(PCI_DEVICE_ID, 0x1229);
 | 
					        pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82557);
 | 
				
			||||||
        PCI_CONFIG_16(PCI_STATUS, 0x2810);
 | 
					        PCI_CONFIG_16(PCI_STATUS, 0x2810);
 | 
				
			||||||
        //~ PCI_CONFIG_8(PCI_REVISION_ID, 0x08);
 | 
					        //~ PCI_CONFIG_8(PCI_REVISION_ID, 0x08);
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
    case i82559ER:
 | 
					    case i82559ER:
 | 
				
			||||||
        //~ PCI_CONFIG_16(PCI_DEVICE_ID, 0x1209);
 | 
					        pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_82551IT);
 | 
				
			||||||
        PCI_CONFIG_16(PCI_STATUS, 0x2810);
 | 
					        PCI_CONFIG_16(PCI_STATUS, 0x2810);
 | 
				
			||||||
        PCI_CONFIG_8(PCI_REVISION_ID, 0x09);
 | 
					        PCI_CONFIG_8(PCI_REVISION_ID, 0x09);
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								hw/pci.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								hw/pci.h
									
									
									
									
									
								
							@ -59,6 +59,7 @@ extern target_phys_addr_t pci_mem_base;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Intel (0x8086) */
 | 
					/* Intel (0x8086) */
 | 
				
			||||||
#define PCI_DEVICE_ID_INTEL_82551IT      0x1209
 | 
					#define PCI_DEVICE_ID_INTEL_82551IT      0x1209
 | 
				
			||||||
 | 
					#define PCI_DEVICE_ID_INTEL_82557        0x1229
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Red Hat / Qumranet (for QEMU) -- see pci-ids.txt */
 | 
					/* Red Hat / Qumranet (for QEMU) -- see pci-ids.txt */
 | 
				
			||||||
#define PCI_VENDOR_ID_REDHAT_QUMRANET    0x1af4
 | 
					#define PCI_VENDOR_ID_REDHAT_QUMRANET    0x1af4
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user