2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2009, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2009, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #ifndef __DEVICES_PCI_TYPES_H__
21 #define __DEVICES_PCI_TYPES_H__
24 #include <palacios/vmm_types.h>
26 // struct pci_device_config
27 struct pci_config_header {
33 } __attribute__((packed));
34 } __attribute__((packed));
41 } __attribute__((packed));
42 } __attribute__((packed));
51 } __attribute__((packed));
52 } __attribute__((packed));
57 uint8_t cache_line_size;
59 uint8_t header_type; // bits 6-0: 00: other, 01: pci-pci bridge, 02: pci-cardbus; bit 7: 1=multifunction
61 } __attribute__((packed));
62 } __attribute__((packed));
68 } __attribute__((packed));
73 } __attribute__((packed));
78 } __attribute__((packed));
83 } __attribute__((packed));
88 } __attribute__((packed));
93 } __attribute__((packed));
98 uint32_t cardbus_cis_pointer;
99 } __attribute__((packed));
104 uint16_t subsystem_vendor_id;
105 uint16_t subsystem_id;
106 } __attribute__((packed));
107 } __attribute__((packed));
111 uint32_t expansion_rom_address;
112 } __attribute__((packed));;
117 uint8_t cap_ptr; // capabilities list offset in config space
119 } __attribute__((packed));
120 } __attribute__((packed));
125 } __attribute__((packed));
131 uint8_t intr_line; // 00=none, 01=IRQ1, etc.
132 uint8_t intr_pin; // 00=none, otherwise INTA# to INTD#
133 uint8_t min_grant; // min busmaster time - units of 250ns
134 uint8_t max_latency; // units of 250ns - busmasters
135 } __attribute__((packed));
136 } __attribute__((packed));
137 } __attribute__((packed));
141 struct pci_class_desc {
146 static struct pci_class_desc pci_class_descriptions[] = {
147 { 0x0100, "SCSI controller"},
148 { 0x0101, "IDE controller"},
149 { 0x0102, "Floppy controller"},
150 { 0x0103, "IPI controller"},
151 { 0x0104, "RAID controller"},
152 { 0x0106, "SATA controller"},
153 { 0x0107, "SAS controller"},
154 { 0x0180, "Storage controller"},
155 { 0x0200, "Ethernet controller"},
156 { 0x0201, "Token Ring controller"},
157 { 0x0202, "FDDI controller"},
158 { 0x0203, "ATM controller"},
159 { 0x0280, "Network controller"},
160 { 0x0300, "VGA controller"},
161 { 0x0301, "XGA controller"},
162 { 0x0302, "3D controller"},
163 { 0x0380, "Display controller"},
164 { 0x0400, "Video controller"},
165 { 0x0401, "Audio controller"},
167 { 0x0480, "Multimedia controller"},
168 { 0x0500, "RAM controller"},
169 { 0x0501, "Flash controller"},
170 { 0x0580, "Memory controller"},
171 { 0x0600, "Host bridge"},
172 { 0x0601, "ISA bridge"},
173 { 0x0602, "EISA bridge"},
174 { 0x0603, "MC bridge"},
175 { 0x0604, "PCI bridge"},
176 { 0x0605, "PCMCIA bridge"},
177 { 0x0606, "NUBUS bridge"},
178 { 0x0607, "CARDBUS bridge"},
179 { 0x0608, "RACEWAY bridge"},
181 { 0x0c03, "USB controller"},