Revision ad03502b hw/eepro100.c

b/hw/eepro100.c
129 129
typedef struct {
130 130
    PCIDeviceInfo pci;
131 131
    uint32_t device;
132
    uint16_t device_id;
133
    uint8_t revision;
134 132
    uint8_t stats_size;
135 133
    bool has_extended_tcb_support;
136 134
    bool power_management;
......
526 524

  
527 525
    TRACE(OTHER, logout("%p\n", s));
528 526

  
529
    /* PCI Vendor ID */
530
    pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_INTEL);
531
    /* PCI Device ID */
532
    pci_config_set_device_id(pci_conf, e100_device->device_id);
533 527
    /* PCI Status */
534 528
    pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_DEVSEL_MEDIUM |
535 529
                                        PCI_STATUS_FAST_BACK);
536
    /* PCI Revision ID */
537
    pci_config_set_revision(pci_conf, e100_device->revision);
538
    pci_config_set_class(pci_conf, PCI_CLASS_NETWORK_ETHERNET);
539 530
    /* PCI Latency Timer */
540 531
    pci_set_byte(pci_conf + PCI_LATENCY_TIMER, 0x20);   /* latency timer = 32 clocks */
541 532
    /* Capability Pointer is set by PCI framework. */
......
563 554
    case i82559ER:
564 555
    case i82562:
565 556
    case i82801:
566
        break;
567 557
    case i82559C:
568
#if EEPROM_SIZE > 0
569
        pci_set_word(pci_conf + PCI_SUBSYSTEM_VENDOR_ID, PCI_VENDOR_ID_INTEL);
570
        pci_set_word(pci_conf + PCI_SUBSYSTEM_ID, 0x0040);
571
#endif
572 558
        break;
573 559
    default:
574 560
        logout("Device %X is undefined!\n", device);
......
2040 2026
        .pci.qdev.desc = "Intel i82550 Ethernet",
2041 2027
        .device = i82550,
2042 2028
        /* TODO: check device id. */
2043
        .device_id = PCI_DEVICE_ID_INTEL_82551IT,
2029
        .pci.device_id = PCI_DEVICE_ID_INTEL_82551IT,
2044 2030
        /* Revision ID: 0x0c, 0x0d, 0x0e. */
2045
        .revision = 0x0e,
2031
        .pci.revision = 0x0e,
2046 2032
        /* TODO: check size of statistical counters. */
2047 2033
        .stats_size = 80,
2048 2034
        /* TODO: check extended tcb support. */
......
2052 2038
        .pci.qdev.name = "i82551",
2053 2039
        .pci.qdev.desc = "Intel i82551 Ethernet",
2054 2040
        .device = i82551,
2055
        .device_id = PCI_DEVICE_ID_INTEL_82551IT,
2041
        .pci.device_id = PCI_DEVICE_ID_INTEL_82551IT,
2056 2042
        /* Revision ID: 0x0f, 0x10. */
2057
        .revision = 0x0f,
2043
        .pci.revision = 0x0f,
2058 2044
        /* TODO: check size of statistical counters. */
2059 2045
        .stats_size = 80,
2060 2046
        .has_extended_tcb_support = true,
......
2063 2049
        .pci.qdev.name = "i82557a",
2064 2050
        .pci.qdev.desc = "Intel i82557A Ethernet",
2065 2051
        .device = i82557A,
2066
        .device_id = PCI_DEVICE_ID_INTEL_82557,
2067
        .revision = 0x01,
2052
        .pci.device_id = PCI_DEVICE_ID_INTEL_82557,
2053
        .pci.revision = 0x01,
2068 2054
        .power_management = false,
2069 2055
    },{
2070 2056
        .pci.qdev.name = "i82557b",
2071 2057
        .pci.qdev.desc = "Intel i82557B Ethernet",
2072 2058
        .device = i82557B,
2073
        .device_id = PCI_DEVICE_ID_INTEL_82557,
2074
        .revision = 0x02,
2059
        .pci.device_id = PCI_DEVICE_ID_INTEL_82557,
2060
        .pci.revision = 0x02,
2075 2061
        .power_management = false,
2076 2062
    },{
2077 2063
        .pci.qdev.name = "i82557c",
2078 2064
        .pci.qdev.desc = "Intel i82557C Ethernet",
2079 2065
        .device = i82557C,
2080
        .device_id = PCI_DEVICE_ID_INTEL_82557,
2081
        .revision = 0x03,
2066
        .pci.device_id = PCI_DEVICE_ID_INTEL_82557,
2067
        .pci.revision = 0x03,
2082 2068
        .power_management = false,
2083 2069
    },{
2084 2070
        .pci.qdev.name = "i82558a",
2085 2071
        .pci.qdev.desc = "Intel i82558A Ethernet",
2086 2072
        .device = i82558A,
2087
        .device_id = PCI_DEVICE_ID_INTEL_82557,
2088
        .revision = 0x04,
2073
        .pci.device_id = PCI_DEVICE_ID_INTEL_82557,
2074
        .pci.revision = 0x04,
2089 2075
        .stats_size = 76,
2090 2076
        .has_extended_tcb_support = true,
2091 2077
        .power_management = true,
......
2093 2079
        .pci.qdev.name = "i82558b",
2094 2080
        .pci.qdev.desc = "Intel i82558B Ethernet",
2095 2081
        .device = i82558B,
2096
        .device_id = PCI_DEVICE_ID_INTEL_82557,
2097
        .revision = 0x05,
2082
        .pci.device_id = PCI_DEVICE_ID_INTEL_82557,
2083
        .pci.revision = 0x05,
2098 2084
        .stats_size = 76,
2099 2085
        .has_extended_tcb_support = true,
2100 2086
        .power_management = true,
......
2102 2088
        .pci.qdev.name = "i82559a",
2103 2089
        .pci.qdev.desc = "Intel i82559A Ethernet",
2104 2090
        .device = i82559A,
2105
        .device_id = PCI_DEVICE_ID_INTEL_82557,
2106
        .revision = 0x06,
2091
        .pci.device_id = PCI_DEVICE_ID_INTEL_82557,
2092
        .pci.revision = 0x06,
2107 2093
        .stats_size = 80,
2108 2094
        .has_extended_tcb_support = true,
2109 2095
        .power_management = true,
......
2111 2097
        .pci.qdev.name = "i82559b",
2112 2098
        .pci.qdev.desc = "Intel i82559B Ethernet",
2113 2099
        .device = i82559B,
2114
        .device_id = PCI_DEVICE_ID_INTEL_82557,
2115
        .revision = 0x07,
2100
        .pci.device_id = PCI_DEVICE_ID_INTEL_82557,
2101
        .pci.revision = 0x07,
2116 2102
        .stats_size = 80,
2117 2103
        .has_extended_tcb_support = true,
2118 2104
        .power_management = true,
......
2120 2106
        .pci.qdev.name = "i82559c",
2121 2107
        .pci.qdev.desc = "Intel i82559C Ethernet",
2122 2108
        .device = i82559C,
2123
        .device_id = PCI_DEVICE_ID_INTEL_82557,
2109
        .pci.device_id = PCI_DEVICE_ID_INTEL_82557,
2124 2110
#if 0
2125
        .revision = 0x08,
2111
        .pci.revision = 0x08,
2126 2112
#endif
2127 2113
        /* TODO: Windows wants revision id 0x0c. */
2128
        .revision = 0x0c,
2114
        .pci.revision = 0x0c,
2115
#if EEPROM_SIZE > 0
2116
        .pci.subsystem_vendor_id = PCI_VENDOR_ID_INTEL,
2117
        .pci.subsystem_id = 0x0040,
2118
#endif
2129 2119
        .stats_size = 80,
2130 2120
        .has_extended_tcb_support = true,
2131 2121
        .power_management = true,
......
2133 2123
        .pci.qdev.name = "i82559er",
2134 2124
        .pci.qdev.desc = "Intel i82559ER Ethernet",
2135 2125
        .device = i82559ER,
2136
        .device_id = PCI_DEVICE_ID_INTEL_82551IT,
2137
        .revision = 0x09,
2126
        .pci.device_id = PCI_DEVICE_ID_INTEL_82551IT,
2127
        .pci.revision = 0x09,
2138 2128
        .stats_size = 80,
2139 2129
        .has_extended_tcb_support = true,
2140 2130
        .power_management = true,
......
2143 2133
        .pci.qdev.desc = "Intel i82562 Ethernet",
2144 2134
        .device = i82562,
2145 2135
        /* TODO: check device id. */
2146
        .device_id = PCI_DEVICE_ID_INTEL_82551IT,
2136
        .pci.device_id = PCI_DEVICE_ID_INTEL_82551IT,
2147 2137
        /* TODO: wrong revision id. */
2148
        .revision = 0x0e,
2138
        .pci.revision = 0x0e,
2149 2139
        .stats_size = 80,
2150 2140
        .has_extended_tcb_support = true,
2151 2141
        .power_management = true,
......
2154 2144
        .pci.qdev.name = "i82801",
2155 2145
        .pci.qdev.desc = "Intel i82801 Ethernet",
2156 2146
        .device = i82801,
2157
        .device_id = 0x2449,
2158
        .revision = 0x03,
2147
        .pci.device_id = 0x2449,
2148
        .pci.revision = 0x03,
2159 2149
        .stats_size = 80,
2160 2150
        .has_extended_tcb_support = true,
2161 2151
        .power_management = true,
......
2174 2164
        PCIDeviceInfo *pci_dev = &e100_devices[i].pci;
2175 2165
        /* We use the same rom file for all device ids.
2176 2166
           QEMU fixes the device id during rom load. */
2167
        pci_dev->vendor_id = PCI_VENDOR_ID_INTEL;
2168
        pci_dev->class_id = PCI_CLASS_NETWORK_ETHERNET;
2177 2169
        pci_dev->romfile = "pxe-eepro100.rom";
2178 2170
        pci_dev->init = e100_nic_init;
2179 2171
        pci_dev->exit = pci_nic_uninit;

Also available in: Unified diff