Call CloseDevice() before DeleteIORequest(), and don't call
[AROS.git] / rom / hidds / hidd.pci / pciutil.h
blobc4f2b754c0368f084d30d25eecaf4f992ce763b4
1 #ifndef PCIUTIL_H
2 #define PCIUTIL_H
3 /*
4 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
5 $Id$
7 Desc: PCI stuff for standalone AROS
8 Lang: english
9 */
11 #include <exec/types.h>
12 #include <oop/oop.h>
14 #include "pci.h"
16 typedef struct _PCI_ClassCodes
18 UBYTE Baseclass;
19 UBYTE Subclass;
20 UBYTE Prgif;
21 STRPTR Basedesc;
22 STRPTR Subdesc;
23 STRPTR Prgifdesc;
24 } PCI_ClassCodes;
27 This list contains all classes defined in the
28 PCI 2.2 standard
30 static const PCI_ClassCodes PCI_ClassTable[] =
32 { 0x00, 0x00, 0x00, "Legacy PCI", "Non-VGA", "" },
33 { 0x00, 0x01, 0x00, "Legacy PCI", "VGA Compatible", "" },
35 { 0x01, 0x00, 0x00, "Mass storage", "SCSI", "" },
36 { 0x01, 0x01, 0x00, "Mass storage", "IDE", "" },
37 { 0x01, 0x02, 0x00, "Mass storage", "Floppy", "" },
38 { 0x01, 0x03, 0x00, "Mass storage", "IPI", "" },
39 { 0x01, 0x04, 0x00, "Mass storage", "RAID", "" },
40 { 0x01, 0x05, 0x20, "Mass storage", "ATA", "ADMA (Single)" },
41 { 0x01, 0x05, 0x30, "Mass storage", "ATA", "ADMA (Chained)" },
42 { 0x01, 0x06, 0x00, "Mass storage", "SATA", "Vendor-specific" },
43 { 0x01, 0x06, 0x01, "Mass storage", "SATA", "AHCI" },
44 { 0x01, 0x07, 0x00, "Mass storage", "SAS", "" },
45 { 0x01, 0x80, 0x00, "Mass storage", "Other", "" },
47 { 0x02, 0x00, 0x00, "Network", "Ethernet", "" },
48 { 0x02, 0x01, 0x00, "Network", "Token ring", "" },
49 { 0x02, 0x02, 0x00, "Network", "FDDI", "" },
50 { 0x02, 0x03, 0x00, "Network", "ATM", "" },
51 { 0x02, 0x04, 0x00, "Network", "ISDN", "" },
52 { 0x02, 0x05, 0x00, "Network", "WorldFip", "" },
53 { 0x02, 0x06, 0x00, "Network", "PICMG", "" },
54 { 0x02, 0x80, 0x00, "Network", "Other", "" },
56 { 0x03, 0x00, 0x00, "Video", "PC Compatible", "VGA" },
57 { 0x03, 0x00, 0x01, "Video", "PC Compatible", "IBM8514" },
58 { 0x03, 0x01, 0x00, "Video", "XGA", "" },
59 { 0x03, 0x03, 0x00, "Video", "3D", "" },
60 { 0x03, 0x80, 0x00, "Video", "Other", "" },
62 { 0x04, 0x00, 0x00, "Multimedia", "Video", "" },
63 { 0x04, 0x01, 0x00, "Multimedia", "Audio", "" },
64 { 0x04, 0x02, 0x00, "Multimedia", "Telephony", "" },
65 { 0x04, 0x03, 0x00, "Multimedia", "Audio", "" },
66 { 0x04, 0x80, 0x00, "Multimedia", "Other", "" },
68 { 0x05, 0x00, 0x00, "Memory controller", "RAM", "" },
69 { 0x05, 0x01, 0x00, "Memory controller", "Flash", "" },
70 { 0x05, 0x80, 0x00, "Memory controller", "Other", "" },
72 { 0x06, 0x00, 0x00, "Bridge", "Host-PCI", "" },
73 { 0x06, 0x01, 0x00, "Bridge", "PCI-ISA", "" },
74 { 0x06, 0x02, 0x00, "Bridge", "PCI-EISA", "" },
75 { 0x06, 0x03, 0x00, "Bridge", "PCI-MCA", "" },
76 { 0x06, 0x04, 0x00, "Bridge", "PCI-PCI", "Standard" },
77 { 0x06, 0x04, 0x01, "Bridge", "PCI-PCI", "Subtractive" },
78 { 0x06, 0x05, 0x00, "Bridge", "PCI-PCMCIA", "" },
79 { 0x06, 0x06, 0x00, "Bridge", "PCI-NuBus", "" },
80 { 0x06, 0x07, 0x00, "Bridge", "PCI-CardBus", "" },
81 { 0x06, 0x08, 0x00, "Bridge", "PCI-RACEway", "" },
82 { 0x06, 0x09, 0x40, "Bridge", "Semi-transparent PCI-PCI", "Standard" },
83 { 0x06, 0x09, 0x80, "Bridge", "Semi-transparent PCI-PCI", "Reverse" },
84 { 0x06, 0x0a, 0x00, "Bridge", "PCI-Infiniband", "" },
85 { 0x06, 0x80, 0x00, "Bridge", "Other", "" },
87 { 0x07, 0x00, 0x00, "Communication", "Serial", "XT compatible" },
88 { 0x07, 0x00, 0x01, "Communication", "Serial", "16450 UART" },
89 { 0x07, 0x00, 0x02, "Communication", "Serial", "16550 UART" },
90 { 0x07, 0x00, 0x03, "Communication", "Serial", "16650 UART" },
91 { 0x07, 0x00, 0x04, "Communication", "Serial", "16750 UART" },
92 { 0x07, 0x00, 0x05, "Communication", "Serial", "16850 UART" },
93 { 0x07, 0x00, 0x06, "Communication", "Serial", "16950 UART" },
94 { 0x07, 0x01, 0x00, "Communication", "Parallel", "Standard" },
95 { 0x07, 0x01, 0x01, "Communication", "Parallel", "Bi-directional" },
96 { 0x07, 0x01, 0x02, "Communication", "Parallel", "ECP" },
97 { 0x07, 0x01, 0x03, "Communication", "Parallel", "IEEE1284 host" },
98 { 0x07, 0x01, 0x04, "Communication", "Parallel", "IEEE1284 device" },
99 { 0x07, 0x02, 0x00, "Communication", "Multiport serial", "" },
100 { 0x07, 0x03, 0x00, "Communication", "Modem", "Generic" },
101 { 0x07, 0x03, 0x01, "Communication", "Modem", "Hayes 16450 UART" },
102 { 0x07, 0x03, 0x02, "Communication", "Modem", "Hayes 16550 UART" },
103 { 0x07, 0x03, 0x03, "Communication", "Modem", "Hayes 16650 UART" },
104 { 0x07, 0x03, 0x04, "Communication", "Modem", "Hayes 16750 UART" },
105 { 0x07, 0x04, 0x00, "Communication", "GPIB", "" },
106 { 0x07, 0x05, 0x00, "Communication", "smart Card", "" },
107 { 0x07, 0x80, 0x00, "Communication", "Other", "" },
109 { 0x08, 0x00, 0x00, "System", "PIC", "Generic 8259" },
110 { 0x08, 0x00, 0x01, "System", "PIC", "ISA" },
111 { 0x08, 0x00, 0x02, "System", "PIC", "EISA" },
112 { 0x08, 0x00, 0x10, "System", "PIC", "I/O APIC" },
113 { 0x08, 0x00, 0x20, "System", "PIC", "I/O(x) APIC" },
114 { 0x08, 0x01, 0x00, "System", "DMA", "Generic 8237" },
115 { 0x08, 0x01, 0x01, "System", "DMA", "ISA" },
116 { 0x08, 0x01, 0x02, "System", "DMA", "EISA" },
117 { 0x08, 0x02, 0x00, "System", "Timer", "Generic 8254" },
118 { 0x08, 0x02, 0x01, "System", "Timer", "ISA" },
119 { 0x08, 0x02, 0x02, "System", "Timer", "EISA" },
120 { 0x08, 0x03, 0x00, "System", "RTC", "Generic" },
121 { 0x08, 0x03, 0x01, "System", "RTC", "ISA" },
122 { 0x08, 0x04, 0x00, "System", "PCI Hotplug", "" },
123 { 0x08, 0x05, 0x00, "System", "SD", "" },
124 { 0x08, 0x80, 0x00, "System", "Other", "" },
126 { 0x09, 0x00, 0x00, "Input", "Keyboard", "" },
127 { 0x09, 0x01, 0x00, "Input", "Digitizer", "" },
128 { 0x09, 0x02, 0x00, "Input", "Mouse", "" },
129 { 0x09, 0x03, 0x00, "Input", "Scanner", "" },
130 { 0x09, 0x04, 0x00, "Input", "Gameport", "Generic" },
131 { 0x09, 0x04, 0x10, "Input", "Gameport", "Legacy" },
132 { 0x09, 0x80, 0x00, "Input", "Other", "" },
134 { 0x0a, 0x00, 0x00, "Docking station", "Generic", "" },
135 { 0x0a, 0x80, 0x00, "Docking station", "Other", "" },
137 { 0x0b, 0x00, 0x00, "CPU", "386", "" },
138 { 0x0b, 0x01, 0x00, "CPU", "486", "" },
139 { 0x0b, 0x02, 0x00, "CPU", "Pentium", "" },
140 { 0x0b, 0x10, 0x00, "CPU", "Alpha", "" },
141 { 0x0b, 0x20, 0x00, "CPU", "PowerPC", "" },
142 { 0x0b, 0x30, 0x00, "CPU", "MIPS", "" },
143 { 0x0b, 0x40, 0x00, "CPU", "Co-processor", "" },
145 { 0x0c, 0x00, 0x00, "Serial", "IEEE1394", "FireWire" },
146 { 0x0c, 0x00, 0x10, "Serial", "IEEE1394", "OHCI" },
147 { 0x0c, 0x01, 0x00, "Serial", "ACCESS.bus", "" },
148 { 0x0c, 0x02, 0x00, "Serial", "SSA", "" },
149 { 0x0c, 0x03, 0x00, "Serial", "USB", "UHCI" },
150 { 0x0c, 0x03, 0x10, "Serial", "USB", "OHCI" },
151 { 0x0c, 0x03, 0x20, "Serial", "USB", "EHCI" },
152 { 0x0c, 0x03, 0x30, "Serial", "USB", "XHCI" },
153 { 0x0c, 0x03, 0x80, "Serial", "USB", "Other" },
154 { 0x0c, 0x03, 0xfe, "Serial", "USB", "Device" },
155 { 0x0c, 0x04, 0x00, "Serial", "Fibrechannel", "" },
156 { 0x0c, 0x05, 0x00, "Serial", "SMBus", "" },
157 { 0x0c, 0x06, 0x00, "Serial", "Infiniband", "" },
158 { 0x0c, 0x07, 0x00, "Serial", "IPMI SMIC", "" },
159 { 0x0c, 0x08, 0x00, "Serial", "SERCOS", "" },
160 { 0x0c, 0x09, 0x00, "Serial", "CANBUS", "" },
162 { 0x0d, 0x00, 0x00, "Wireless", "iRDA", "" },
163 { 0x0d, 0x01, 0x00, "Wireless", "Consumer IR", "" },
164 { 0x0d, 0x10, 0x00, "Wireless", "RF", "" },
165 { 0x0d, 0x11, 0x00, "Wireless", "Bluetooth", "" },
166 { 0x0d, 0x12, 0x00, "Wireless", "Broadband", "" },
167 { 0x0d, 0x20, 0x00, "Wireless", "IEEE802.11a", "" },
168 { 0x0d, 0x21, 0x00, "Wireless", "IEEE802.11b", "" },
169 { 0x0d, 0x80, 0x00, "Wireless", "Other", "" },
171 { 0x0e, 0x00, 0x00, "Intelligent I/O", "I2O", "" },
173 { 0x0f, 0x01, 0x00, "Satellite", "TV", "" },
174 { 0x0f, 0x02, 0x00, "Satellite", "Audio", "" },
175 { 0x0f, 0x03, 0x00, "Satellite", "Voice", "" },
176 { 0x0f, 0x04, 0x00, "Satellite", "Data", "" },
178 { 0x10, 0x00, 0x00, "Crypto", "Network", "" },
179 { 0x10, 0x10, 0x00, "Crypto", "Entertainment", "" },
180 { 0x10, 0x80, 0x00, "Crypto", "Other", "" },
182 { 0x11, 0x00, 0x00, "Data acquisition", "DPIO", "" },
183 { 0x11, 0x01, 0x00, "Data acquisition", "Performance Counters", "" },
184 { 0x11, 0x10, 0x00, "Data acquisition", "Communication Synchroniser", "" },
185 { 0x11, 0x20, 0x00, "Data acquisition", "Management", "" },
186 { 0x11, 0x80, 0x00, "Data acquisition", "Other", "" },
189 void getPCIClassDesc( UBYTE class, UBYTE sub, UBYTE prgif, STRPTR *cdesc, STRPTR *sdesc, STRPTR *pdesc );
190 ULONG sizePCIBaseReg( OOP_Object *driver, struct pci_staticdata *psd, UBYTE bus, UBYTE dev, UBYTE func, UBYTE basenum );
192 /* Use this for walking the PCI_ClassTable */
193 #define PCI_CLASSTABLE_LEN (sizeof(PCI_ClassTable)/sizeof(PCI_ClassCodes))
195 #endif