Rev 1628 | Rev 1633 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1408 | serge | 1 | |
1631 | serge | 2 | #define __PCI_H__ |
3 | |||
4 | |||
1408 | serge | 5 | #include |
6 | #include |
||
1631 | serge | 7 | #include |
1628 | serge | 8 | #include |
1631 | serge | 9 | |
1408 | serge | 10 | |
1628 | serge | 11 | struct pci_slot { |
12 | struct pci_bus *bus; /* The bus this slot is on */ |
||
13 | struct list_head list; /* node in list of slots on this bus */ |
||
14 | // struct hotplug_slot *hotplug; /* Hotplug info (migrate over time) */ |
||
15 | unsigned char number; /* PCI_SLOT(pci_dev->devfn) */ |
||
16 | // struct kobject kobj; |
||
17 | }; |
||
18 | |||
19 | |||
20 | |||
1408 | serge | 21 | |
22 | |||
23 | |||
24 | #define PCI_CLASS_NOT_DEFINED_VGA 0x0001 |
||
25 | |||
26 | |||
27 | #define PCI_CLASS_STORAGE_SCSI 0x0100 |
||
28 | #define PCI_CLASS_STORAGE_IDE 0x0101 |
||
29 | #define PCI_CLASS_STORAGE_FLOPPY 0x0102 |
||
30 | #define PCI_CLASS_STORAGE_IPI 0x0103 |
||
31 | #define PCI_CLASS_STORAGE_RAID 0x0104 |
||
32 | #define PCI_CLASS_STORAGE_SATA 0x0106 |
||
33 | #define PCI_CLASS_STORAGE_SATA_AHCI 0x010601 |
||
34 | #define PCI_CLASS_STORAGE_SAS 0x0107 |
||
35 | #define PCI_CLASS_STORAGE_OTHER 0x0180 |
||
36 | |||
37 | |||
38 | #define PCI_CLASS_NETWORK_ETHERNET 0x0200 |
||
39 | #define PCI_CLASS_NETWORK_TOKEN_RING 0x0201 |
||
40 | #define PCI_CLASS_NETWORK_FDDI 0x0202 |
||
41 | #define PCI_CLASS_NETWORK_ATM 0x0203 |
||
42 | #define PCI_CLASS_NETWORK_OTHER 0x0280 |
||
43 | |||
44 | |||
45 | #define PCI_CLASS_DISPLAY_VGA 0x0300 |
||
46 | #define PCI_CLASS_DISPLAY_XGA 0x0301 |
||
47 | #define PCI_CLASS_DISPLAY_3D 0x0302 |
||
48 | #define PCI_CLASS_DISPLAY_OTHER 0x0380 |
||
49 | |||
50 | |||
51 | #define PCI_CLASS_MULTIMEDIA_VIDEO 0x0400 |
||
52 | #define PCI_CLASS_MULTIMEDIA_AUDIO 0x0401 |
||
53 | #define PCI_CLASS_MULTIMEDIA_PHONE 0x0402 |
||
54 | #define PCI_CLASS_MULTIMEDIA_OTHER 0x0480 |
||
55 | |||
56 | |||
57 | #define PCI_CLASS_MEMORY_RAM 0x0500 |
||
58 | #define PCI_CLASS_MEMORY_FLASH 0x0501 |
||
59 | #define PCI_CLASS_MEMORY_OTHER 0x0580 |
||
60 | |||
61 | |||
62 | #define PCI_CLASS_BRIDGE_HOST 0x0600 |
||
63 | #define PCI_CLASS_BRIDGE_ISA 0x0601 |
||
64 | #define PCI_CLASS_BRIDGE_EISA 0x0602 |
||
65 | #define PCI_CLASS_BRIDGE_MC 0x0603 |
||
66 | #define PCI_CLASS_BRIDGE_PCI 0x0604 |
||
67 | #define PCI_CLASS_BRIDGE_PCMCIA 0x0605 |
||
68 | #define PCI_CLASS_BRIDGE_NUBUS 0x0606 |
||
69 | #define PCI_CLASS_BRIDGE_CARDBUS 0x0607 |
||
70 | #define PCI_CLASS_BRIDGE_RACEWAY 0x0608 |
||
71 | #define PCI_CLASS_BRIDGE_OTHER 0x0680 |
||
72 | |||
73 | |||
74 | #define PCI_CLASS_COMMUNICATION_SERIAL 0x0700 |
||
75 | #define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701 |
||
76 | #define PCI_CLASS_COMMUNICATION_MULTISERIAL 0x0702 |
||
77 | #define PCI_CLASS_COMMUNICATION_MODEM 0x0703 |
||
78 | #define PCI_CLASS_COMMUNICATION_OTHER 0x0780 |
||
79 | |||
80 | |||
81 | #define PCI_CLASS_SYSTEM_PIC 0x0800 |
||
82 | #define PCI_CLASS_SYSTEM_PIC_IOAPIC 0x080010 |
||
83 | #define PCI_CLASS_SYSTEM_PIC_IOXAPIC 0x080020 |
||
84 | #define PCI_CLASS_SYSTEM_DMA 0x0801 |
||
85 | #define PCI_CLASS_SYSTEM_TIMER 0x0802 |
||
86 | #define PCI_CLASS_SYSTEM_RTC 0x0803 |
||
87 | #define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804 |
||
88 | #define PCI_CLASS_SYSTEM_SDHCI 0x0805 |
||
89 | #define PCI_CLASS_SYSTEM_OTHER 0x0880 |
||
90 | |||
91 | |||
92 | #define PCI_CLASS_INPUT_KEYBOARD 0x0900 |
||
93 | #define PCI_CLASS_INPUT_PEN 0x0901 |
||
94 | #define PCI_CLASS_INPUT_MOUSE 0x0902 |
||
95 | #define PCI_CLASS_INPUT_SCANNER 0x0903 |
||
96 | #define PCI_CLASS_INPUT_GAMEPORT 0x0904 |
||
97 | #define PCI_CLASS_INPUT_OTHER 0x0980 |
||
98 | |||
99 | |||
100 | #define PCI_CLASS_DOCKING_GENERIC 0x0a00 |
||
101 | #define PCI_CLASS_DOCKING_OTHER 0x0a80 |
||
102 | |||
103 | |||
104 | #define PCI_CLASS_PROCESSOR_386 0x0b00 |
||
105 | #define PCI_CLASS_PROCESSOR_486 0x0b01 |
||
106 | #define PCI_CLASS_PROCESSOR_PENTIUM 0x0b02 |
||
107 | #define PCI_CLASS_PROCESSOR_ALPHA 0x0b10 |
||
108 | #define PCI_CLASS_PROCESSOR_POWERPC 0x0b20 |
||
109 | #define PCI_CLASS_PROCESSOR_MIPS 0x0b30 |
||
110 | #define PCI_CLASS_PROCESSOR_CO 0x0b40 |
||
111 | |||
112 | |||
113 | #define PCI_CLASS_SERIAL_FIREWIRE 0x0c00 |
||
114 | #define PCI_CLASS_SERIAL_FIREWIRE_OHCI 0x0c0010 |
||
115 | #define PCI_CLASS_SERIAL_ACCESS 0x0c01 |
||
116 | #define PCI_CLASS_SERIAL_SSA 0x0c02 |
||
117 | #define PCI_CLASS_SERIAL_USB 0x0c03 |
||
118 | #define PCI_CLASS_SERIAL_USB_UHCI 0x0c0300 |
||
119 | #define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310 |
||
120 | #define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320 |
||
121 | #define PCI_CLASS_SERIAL_FIBER 0x0c04 |
||
122 | #define PCI_CLASS_SERIAL_SMBUS 0x0c05 |
||
123 | |||
124 | |||
125 | #define PCI_CLASS_WIRELESS_RF_CONTROLLER 0x0d10 |
||
126 | #define PCI_CLASS_WIRELESS_WHCI 0x0d1010 |
||
127 | |||
128 | |||
129 | #define PCI_CLASS_INTELLIGENT_I2O 0x0e00 |
||
130 | |||
131 | |||
132 | #define PCI_CLASS_SATELLITE_TV 0x0f00 |
||
133 | #define PCI_CLASS_SATELLITE_AUDIO 0x0f01 |
||
134 | #define PCI_CLASS_SATELLITE_VOICE 0x0f03 |
||
135 | #define PCI_CLASS_SATELLITE_DATA 0x0f04 |
||
136 | |||
137 | |||
138 | #define PCI_CLASS_CRYPT_NETWORK 0x1000 |
||
139 | #define PCI_CLASS_CRYPT_ENTERTAINMENT 0x1001 |
||
140 | #define PCI_CLASS_CRYPT_OTHER 0x1080 |
||
141 | |||
142 | |||
143 | #define PCI_CLASS_SP_DPIO 0x1100 |
||
144 | #define PCI_CLASS_SP_OTHER 0x1180 |
||
145 | |||
146 | |||
147 | |||
148 | |||
149 | |||
150 | |||
151 | #define PCI_MAP_REG_END 0x28 |
||
152 | #define PCI_MAP_ROM_REG 0x30 |
||
153 | |||
154 | |||
155 | #define PCI_MAP_IO 0x00000001 |
||
156 | |||
157 | |||
158 | #define PCI_MAP_IO_TYPE 0x00000003 |
||
159 | |||
160 | |||
161 | #define PCI_MAP_MEMORY_TYPE_32BIT_1M 0x00000002 |
||
162 | #define PCI_MAP_MEMORY_TYPE_64BIT 0x00000004 |
||
163 | #define PCI_MAP_MEMORY_TYPE_MASK 0x00000006 |
||
164 | #define PCI_MAP_MEMORY_CACHABLE 0x00000008 |
||
165 | #define PCI_MAP_MEMORY_ATTR_MASK 0x0000000e |
||
166 | #define PCI_MAP_MEMORY_ADDRESS_MASK 0xfffffff0 |
||
167 | |||
168 | |||
169 | |||
170 | |||
171 | |||
172 | |||
173 | #define PCI_MAP_IS_MEM(b) (!PCI_MAP_IS_IO(b)) |
||
174 | |||
175 | |||
176 | (((b) & PCI_MAP_MEMORY_TYPE_MASK) == PCI_MAP_MEMORY_TYPE_64BIT) |
||
177 | |||
178 | |||
179 | #define PCIGETMEMORY64HIGH(b) (*((CARD32*)&b + 1)) |
||
180 | #define PCIGETMEMORY64(b) \ |
||
181 | (PCIGETMEMORY(b) | ((CARD64)PCIGETMEMORY64HIGH(b) << 32)) |
||
182 | |||
183 | |||
184 | |||
185 | |||
186 | |||
187 | |||
188 | #define PCI_MAP_ROM_ADDRESS_MASK 0xfffff800 |
||
189 | |||
190 | |||
191 | |||
192 | |||
193 | |||
194 | # define PCI_DOM_MASK 0x0ffu |
||
195 | #endif |
||
196 | #define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu) |
||
197 | |||
198 | |||
199 | (((d) & 0x00001fu) << 11) | \ |
||
200 | (((f) & 0x000007u) << 8)) |
||
201 | |||
202 | |||
203 | #define PCI_DEV_FROM_TAG(tag) (((tag) & 0x0000f800u) >> 11) |
||
204 | #define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700u) >> 8) |
||
205 | #define PCI_DFN_FROM_TAG(tag) (((tag) & 0x0000ff00u) >> 8) |
||
206 | |||
207 | |||
208 | #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) |
||
209 | #define PCI_FUNC(devfn) ((devfn) & 0x07) |
||
210 | |||
211 | |||
1628 | serge | 212 | #define PCIIOC_BASE ('P' << 24 | 'C' << 16 | 'I' << 8) |
213 | #define PCIIOC_CONTROLLER (PCIIOC_BASE | 0x00) /* Get controller for PCI device. */ |
||
214 | #define PCIIOC_MMAP_IS_IO (PCIIOC_BASE | 0x01) /* Set mmap state to I/O space. */ |
||
215 | #define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02) /* Set mmap state to MEM space. */ |
||
216 | #define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03) /* Enable/disable write-combining. */ |
||
217 | |||
1408 | serge | 218 | |
219 | |||
1628 | serge | 220 | |
221 | |||
222 | /* I/O channel is in normal state */ |
||
223 | pci_channel_io_normal = (__force pci_channel_state_t) 1, |
||
224 | |||
225 | |||
226 | pci_channel_io_frozen = (__force pci_channel_state_t) 2, |
||
227 | |||
228 | |||
229 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, |
||
230 | }; |
||
231 | |||
232 | |||
233 | |||
1408 | serge | 234 | |
235 | |||
236 | pciTag(int busnum, int devnum, int funcnum) |
||
237 | { |
||
238 | return(PCI_MAKE_TAG(busnum,devnum,funcnum)); |
||
239 | } |
||
240 | |||
241 | |||
1628 | serge | 242 | #define PCI_DMA_BIDIRECTIONAL 0 |
243 | #define PCI_DMA_TODEVICE 1 |
||
244 | #define PCI_DMA_FROMDEVICE 2 |
||
245 | #define PCI_DMA_NONE 3 |
||
246 | |||
1627 | serge | 247 | |
1408 | serge | 248 | * For PCI devices, the region numbers are assigned this way: |
1627 | serge | 249 | */ |
250 | enum { |
||
251 | /* #0-5: standard PCI resources */ |
||
252 | PCI_STD_RESOURCES, |
||
253 | PCI_STD_RESOURCE_END = 5, |
||
254 | |||
255 | |||
256 | PCI_ROM_RESOURCE, |
||
257 | |||
258 | |||
259 | #ifdef CONFIG_PCI_IOV |
||