Commit | Line | Data |
---|---|---|
977e1244 GH |
1 | /* |
2 | * QEMU IDE Emulation: PCI Bus support. | |
3 | * | |
4 | * Copyright (c) 2003 Fabrice Bellard | |
5 | * Copyright (c) 2006 Openedhand Ltd. | |
6 | * | |
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
8 | * of this software and associated documentation files (the "Software"), to deal | |
9 | * in the Software without restriction, including without limitation the rights | |
10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
11 | * copies of the Software, and to permit persons to whom the Software is | |
12 | * furnished to do so, subject to the following conditions: | |
13 | * | |
14 | * The above copyright notice and this permission notice shall be included in | |
15 | * all copies or substantial portions of the Software. | |
16 | * | |
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
20 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
23 | * THE SOFTWARE. | |
24 | */ | |
53239262 | 25 | #include "qemu/osdep.h" |
a9c94277 | 26 | #include "hw/hw.h" |
a9c94277 MA |
27 | #include "hw/pci/pci.h" |
28 | #include "hw/isa/isa.h" | |
9c17d615 | 29 | #include "sysemu/dma.h" |
3251bdcf | 30 | #include "qemu/error-report.h" |
a9c94277 | 31 | #include "hw/ide/pci.h" |
3eee2611 | 32 | #include "trace.h" |
977e1244 | 33 | |
40a6238a AG |
34 | #define BMDMA_PAGE_SIZE 4096 |
35 | ||
7e2648df | 36 | #define BM_MIGRATION_COMPAT_STATUS_BITS \ |
fd648f10 PB |
37 | (IDE_RETRY_DMA | IDE_RETRY_PIO | \ |
38 | IDE_RETRY_READ | IDE_RETRY_FLUSH) | |
7e2648df | 39 | |
40a6238a | 40 | static void bmdma_start_dma(IDEDMA *dma, IDEState *s, |
097310b5 | 41 | BlockCompletionFunc *dma_cb) |
40a6238a AG |
42 | { |
43 | BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); | |
44 | ||
40a6238a AG |
45 | bm->dma_cb = dma_cb; |
46 | bm->cur_prd_last = 0; | |
47 | bm->cur_prd_addr = 0; | |
48 | bm->cur_prd_len = 0; | |
40a6238a AG |
49 | |
50 | if (bm->status & BM_STATUS_DMAING) { | |
51 | bm->dma_cb(bmdma_active_if(bm), 0); | |
52 | } | |
53 | } | |
54 | ||
3251bdcf | 55 | /** |
a718978e JS |
56 | * Prepare an sglist based on available PRDs. |
57 | * @limit: How many bytes to prepare total. | |
58 | * | |
59 | * Returns the number of bytes prepared, -1 on error. | |
60 | * IDEState.io_buffer_size will contain the number of bytes described | |
61 | * by the PRDs, whether or not we added them to the sglist. | |
3251bdcf | 62 | */ |
a718978e | 63 | static int32_t bmdma_prepare_buf(IDEDMA *dma, int32_t limit) |
40a6238a AG |
64 | { |
65 | BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); | |
66 | IDEState *s = bmdma_active_if(bm); | |
f6c11d56 | 67 | PCIDevice *pci_dev = PCI_DEVICE(bm->pci_dev); |
40a6238a AG |
68 | struct { |
69 | uint32_t addr; | |
70 | uint32_t size; | |
71 | } prd; | |
72 | int l, len; | |
73 | ||
f6c11d56 | 74 | pci_dma_sglist_init(&s->sg, pci_dev, |
552908fe | 75 | s->nsector / (BMDMA_PAGE_SIZE / 512) + 1); |
40a6238a AG |
76 | s->io_buffer_size = 0; |
77 | for(;;) { | |
78 | if (bm->cur_prd_len == 0) { | |
79 | /* end of table (with a fail safe of one page) */ | |
80 | if (bm->cur_prd_last || | |
3251bdcf | 81 | (bm->cur_addr - bm->addr) >= BMDMA_PAGE_SIZE) { |
a718978e | 82 | return s->sg.size; |
3251bdcf | 83 | } |
f6c11d56 | 84 | pci_dma_read(pci_dev, bm->cur_addr, &prd, 8); |
40a6238a AG |
85 | bm->cur_addr += 8; |
86 | prd.addr = le32_to_cpu(prd.addr); | |
87 | prd.size = le32_to_cpu(prd.size); | |
88 | len = prd.size & 0xfffe; | |
89 | if (len == 0) | |
90 | len = 0x10000; | |
91 | bm->cur_prd_len = len; | |
92 | bm->cur_prd_addr = prd.addr; | |
93 | bm->cur_prd_last = (prd.size & 0x80000000); | |
94 | } | |
95 | l = bm->cur_prd_len; | |
96 | if (l > 0) { | |
a718978e JS |
97 | uint64_t sg_len; |
98 | ||
99 | /* Don't add extra bytes to the SGList; consume any remaining | |
100 | * PRDs from the guest, but ignore them. */ | |
101 | sg_len = MIN(limit - s->sg.size, bm->cur_prd_len); | |
102 | if (sg_len) { | |
103 | qemu_sglist_add(&s->sg, bm->cur_prd_addr, sg_len); | |
104 | } | |
3251bdcf | 105 | |
40a6238a AG |
106 | bm->cur_prd_addr += l; |
107 | bm->cur_prd_len -= l; | |
108 | s->io_buffer_size += l; | |
109 | } | |
110 | } | |
3251bdcf JS |
111 | |
112 | qemu_sglist_destroy(&s->sg); | |
113 | s->io_buffer_size = 0; | |
114 | return -1; | |
40a6238a AG |
115 | } |
116 | ||
117 | /* return 0 if buffer completed */ | |
118 | static int bmdma_rw_buf(IDEDMA *dma, int is_write) | |
119 | { | |
120 | BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); | |
121 | IDEState *s = bmdma_active_if(bm); | |
f6c11d56 | 122 | PCIDevice *pci_dev = PCI_DEVICE(bm->pci_dev); |
40a6238a AG |
123 | struct { |
124 | uint32_t addr; | |
125 | uint32_t size; | |
126 | } prd; | |
127 | int l, len; | |
128 | ||
129 | for(;;) { | |
130 | l = s->io_buffer_size - s->io_buffer_index; | |
131 | if (l <= 0) | |
132 | break; | |
133 | if (bm->cur_prd_len == 0) { | |
134 | /* end of table (with a fail safe of one page) */ | |
135 | if (bm->cur_prd_last || | |
136 | (bm->cur_addr - bm->addr) >= BMDMA_PAGE_SIZE) | |
137 | return 0; | |
f6c11d56 | 138 | pci_dma_read(pci_dev, bm->cur_addr, &prd, 8); |
40a6238a AG |
139 | bm->cur_addr += 8; |
140 | prd.addr = le32_to_cpu(prd.addr); | |
141 | prd.size = le32_to_cpu(prd.size); | |
142 | len = prd.size & 0xfffe; | |
143 | if (len == 0) | |
144 | len = 0x10000; | |
145 | bm->cur_prd_len = len; | |
146 | bm->cur_prd_addr = prd.addr; | |
147 | bm->cur_prd_last = (prd.size & 0x80000000); | |
148 | } | |
149 | if (l > bm->cur_prd_len) | |
150 | l = bm->cur_prd_len; | |
151 | if (l > 0) { | |
152 | if (is_write) { | |
f6c11d56 | 153 | pci_dma_write(pci_dev, bm->cur_prd_addr, |
552908fe | 154 | s->io_buffer + s->io_buffer_index, l); |
40a6238a | 155 | } else { |
f6c11d56 | 156 | pci_dma_read(pci_dev, bm->cur_prd_addr, |
552908fe | 157 | s->io_buffer + s->io_buffer_index, l); |
40a6238a AG |
158 | } |
159 | bm->cur_prd_addr += l; | |
160 | bm->cur_prd_len -= l; | |
161 | s->io_buffer_index += l; | |
162 | } | |
163 | } | |
164 | return 1; | |
165 | } | |
166 | ||
0e7ce54c | 167 | static void bmdma_set_inactive(IDEDMA *dma, bool more) |
40a6238a AG |
168 | { |
169 | BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); | |
40a6238a | 170 | |
40a6238a | 171 | bm->dma_cb = NULL; |
0e7ce54c PB |
172 | if (more) { |
173 | bm->status |= BM_STATUS_DMAING; | |
174 | } else { | |
175 | bm->status &= ~BM_STATUS_DMAING; | |
176 | } | |
40a6238a AG |
177 | } |
178 | ||
bd8892c4 | 179 | static void bmdma_restart_dma(IDEDMA *dma) |
40a6238a | 180 | { |
40a6238a AG |
181 | BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); |
182 | ||
06b95b1e | 183 | bm->cur_addr = bm->addr; |
40a6238a AG |
184 | } |
185 | ||
186 | static void bmdma_cancel(BMDMAState *bm) | |
187 | { | |
188 | if (bm->status & BM_STATUS_DMAING) { | |
189 | /* cancel DMA request */ | |
0e7ce54c | 190 | bmdma_set_inactive(&bm->dma, false); |
40a6238a AG |
191 | } |
192 | } | |
193 | ||
1374bec0 | 194 | static void bmdma_reset(IDEDMA *dma) |
40a6238a AG |
195 | { |
196 | BMDMAState *bm = DO_UPCAST(BMDMAState, dma, dma); | |
197 | ||
3eee2611 | 198 | trace_bmdma_reset(); |
40a6238a AG |
199 | bmdma_cancel(bm); |
200 | bm->cmd = 0; | |
201 | bm->status = 0; | |
202 | bm->addr = 0; | |
203 | bm->cur_addr = 0; | |
204 | bm->cur_prd_last = 0; | |
205 | bm->cur_prd_addr = 0; | |
206 | bm->cur_prd_len = 0; | |
40a6238a AG |
207 | } |
208 | ||
40a6238a AG |
209 | static void bmdma_irq(void *opaque, int n, int level) |
210 | { | |
211 | BMDMAState *bm = opaque; | |
212 | ||
213 | if (!level) { | |
214 | /* pass through lower */ | |
215 | qemu_set_irq(bm->irq, level); | |
216 | return; | |
217 | } | |
218 | ||
1635eecc | 219 | bm->status |= BM_STATUS_INT; |
40a6238a AG |
220 | |
221 | /* trigger the real irq */ | |
222 | qemu_set_irq(bm->irq, level); | |
223 | } | |
224 | ||
a9deb8c6 | 225 | void bmdma_cmd_writeb(BMDMAState *bm, uint32_t val) |
977e1244 | 226 | { |
3eee2611 | 227 | trace_bmdma_cmd_writeb(val); |
c29947bb KW |
228 | |
229 | /* Ignore writes to SSBM if it keeps the old value */ | |
230 | if ((val & BM_CMD_START) != (bm->cmd & BM_CMD_START)) { | |
231 | if (!(val & BM_CMD_START)) { | |
86698a12 | 232 | ide_cancel_dma_sync(idebus_active_if(bm->bus)); |
b39f9612 | 233 | bm->status &= ~BM_STATUS_DMAING; |
c29947bb | 234 | } else { |
b76876e6 | 235 | bm->cur_addr = bm->addr; |
c29947bb KW |
236 | if (!(bm->status & BM_STATUS_DMAING)) { |
237 | bm->status |= BM_STATUS_DMAING; | |
238 | /* start dma transfer if possible */ | |
239 | if (bm->dma_cb) | |
40a6238a | 240 | bm->dma_cb(bmdma_active_if(bm), 0); |
c29947bb | 241 | } |
953844d1 | 242 | } |
977e1244 | 243 | } |
c29947bb KW |
244 | |
245 | bm->cmd = val & 0x09; | |
977e1244 GH |
246 | } |
247 | ||
a8170e5e | 248 | static uint64_t bmdma_addr_read(void *opaque, hwaddr addr, |
a9deb8c6 | 249 | unsigned width) |
977e1244 | 250 | { |
a9deb8c6 | 251 | BMDMAState *bm = opaque; |
9fbef1ac | 252 | uint32_t mask = (1ULL << (width * 8)) - 1; |
a9deb8c6 | 253 | uint64_t data; |
977e1244 | 254 | |
a9deb8c6 | 255 | data = (bm->addr >> (addr * 8)) & mask; |
3eee2611 | 256 | trace_bmdma_addr_read(data); |
a9deb8c6 | 257 | return data; |
977e1244 GH |
258 | } |
259 | ||
a8170e5e | 260 | static void bmdma_addr_write(void *opaque, hwaddr addr, |
a9deb8c6 | 261 | uint64_t data, unsigned width) |
977e1244 | 262 | { |
a9deb8c6 | 263 | BMDMAState *bm = opaque; |
9fbef1ac AK |
264 | int shift = addr * 8; |
265 | uint32_t mask = (1ULL << (width * 8)) - 1; | |
977e1244 | 266 | |
3eee2611 | 267 | trace_bmdma_addr_write(data); |
9fbef1ac AK |
268 | bm->addr &= ~(mask << shift); |
269 | bm->addr |= ((data & mask) << shift) & ~3; | |
977e1244 GH |
270 | } |
271 | ||
a9deb8c6 | 272 | MemoryRegionOps bmdma_addr_ioport_ops = { |
9fbef1ac AK |
273 | .read = bmdma_addr_read, |
274 | .write = bmdma_addr_write, | |
a9deb8c6 | 275 | .endianness = DEVICE_LITTLE_ENDIAN, |
9fbef1ac | 276 | }; |
977e1244 | 277 | |
5ee84c33 JQ |
278 | static bool ide_bmdma_current_needed(void *opaque) |
279 | { | |
280 | BMDMAState *bm = opaque; | |
281 | ||
282 | return (bm->cur_prd_len != 0); | |
283 | } | |
284 | ||
def93791 KW |
285 | static bool ide_bmdma_status_needed(void *opaque) |
286 | { | |
287 | BMDMAState *bm = opaque; | |
288 | ||
289 | /* Older versions abused some bits in the status register for internal | |
290 | * error state. If any of these bits are set, we must add a subsection to | |
291 | * transfer the real status register */ | |
292 | uint8_t abused_bits = BM_MIGRATION_COMPAT_STATUS_BITS; | |
293 | ||
294 | return ((bm->status & abused_bits) != 0); | |
295 | } | |
296 | ||
44b1ff31 | 297 | static int ide_bmdma_pre_save(void *opaque) |
def93791 KW |
298 | { |
299 | BMDMAState *bm = opaque; | |
300 | uint8_t abused_bits = BM_MIGRATION_COMPAT_STATUS_BITS; | |
301 | ||
218fd37c PB |
302 | if (!(bm->status & BM_STATUS_DMAING) && bm->dma_cb) { |
303 | bm->bus->error_status = | |
304 | ide_dma_cmd_to_retry(bmdma_active_if(bm)->dma_cmd); | |
305 | } | |
a96cb236 | 306 | bm->migration_retry_unit = bm->bus->retry_unit; |
dc5d0af4 PB |
307 | bm->migration_retry_sector_num = bm->bus->retry_sector_num; |
308 | bm->migration_retry_nsector = bm->bus->retry_nsector; | |
def93791 KW |
309 | bm->migration_compat_status = |
310 | (bm->status & ~abused_bits) | (bm->bus->error_status & abused_bits); | |
44b1ff31 DDAG |
311 | |
312 | return 0; | |
def93791 KW |
313 | } |
314 | ||
315 | /* This function accesses bm->bus->error_status which is loaded only after | |
316 | * BMDMA itself. This is why the function is called from ide_pci_post_load | |
317 | * instead of being registered with VMState where it would run too early. */ | |
318 | static int ide_bmdma_post_load(void *opaque, int version_id) | |
319 | { | |
320 | BMDMAState *bm = opaque; | |
321 | uint8_t abused_bits = BM_MIGRATION_COMPAT_STATUS_BITS; | |
322 | ||
323 | if (bm->status == 0) { | |
324 | bm->status = bm->migration_compat_status & ~abused_bits; | |
325 | bm->bus->error_status |= bm->migration_compat_status & abused_bits; | |
326 | } | |
a96cb236 | 327 | if (bm->bus->error_status) { |
dc5d0af4 PB |
328 | bm->bus->retry_sector_num = bm->migration_retry_sector_num; |
329 | bm->bus->retry_nsector = bm->migration_retry_nsector; | |
a96cb236 PB |
330 | bm->bus->retry_unit = bm->migration_retry_unit; |
331 | } | |
def93791 KW |
332 | |
333 | return 0; | |
334 | } | |
335 | ||
5ee84c33 JQ |
336 | static const VMStateDescription vmstate_bmdma_current = { |
337 | .name = "ide bmdma_current", | |
338 | .version_id = 1, | |
339 | .minimum_version_id = 1, | |
5cd8cada | 340 | .needed = ide_bmdma_current_needed, |
d49805ae | 341 | .fields = (VMStateField[]) { |
5ee84c33 JQ |
342 | VMSTATE_UINT32(cur_addr, BMDMAState), |
343 | VMSTATE_UINT32(cur_prd_last, BMDMAState), | |
344 | VMSTATE_UINT32(cur_prd_addr, BMDMAState), | |
345 | VMSTATE_UINT32(cur_prd_len, BMDMAState), | |
346 | VMSTATE_END_OF_LIST() | |
347 | } | |
348 | }; | |
349 | ||
06ab66cf | 350 | static const VMStateDescription vmstate_bmdma_status = { |
def93791 KW |
351 | .name ="ide bmdma/status", |
352 | .version_id = 1, | |
353 | .minimum_version_id = 1, | |
5cd8cada | 354 | .needed = ide_bmdma_status_needed, |
d49805ae | 355 | .fields = (VMStateField[]) { |
def93791 KW |
356 | VMSTATE_UINT8(status, BMDMAState), |
357 | VMSTATE_END_OF_LIST() | |
358 | } | |
359 | }; | |
5ee84c33 | 360 | |
407a4f30 JQ |
361 | static const VMStateDescription vmstate_bmdma = { |
362 | .name = "ide bmdma", | |
57338424 | 363 | .version_id = 3, |
407a4f30 | 364 | .minimum_version_id = 0, |
def93791 | 365 | .pre_save = ide_bmdma_pre_save, |
d49805ae | 366 | .fields = (VMStateField[]) { |
407a4f30 | 367 | VMSTATE_UINT8(cmd, BMDMAState), |
def93791 | 368 | VMSTATE_UINT8(migration_compat_status, BMDMAState), |
407a4f30 | 369 | VMSTATE_UINT32(addr, BMDMAState), |
dc5d0af4 PB |
370 | VMSTATE_INT64(migration_retry_sector_num, BMDMAState), |
371 | VMSTATE_UINT32(migration_retry_nsector, BMDMAState), | |
a96cb236 | 372 | VMSTATE_UINT8(migration_retry_unit, BMDMAState), |
407a4f30 | 373 | VMSTATE_END_OF_LIST() |
5ee84c33 | 374 | }, |
5cd8cada JQ |
375 | .subsections = (const VMStateDescription*[]) { |
376 | &vmstate_bmdma_current, | |
377 | &vmstate_bmdma_status, | |
378 | NULL | |
977e1244 | 379 | } |
407a4f30 | 380 | }; |
977e1244 | 381 | |
407a4f30 | 382 | static int ide_pci_post_load(void *opaque, int version_id) |
977e1244 GH |
383 | { |
384 | PCIIDEState *d = opaque; | |
407a4f30 | 385 | int i; |
977e1244 | 386 | |
977e1244 | 387 | for(i = 0; i < 2; i++) { |
407a4f30 JQ |
388 | /* current versions always store 0/1, but older version |
389 | stored bigger values. We only need last bit */ | |
a96cb236 | 390 | d->bmdma[i].migration_retry_unit &= 1; |
def93791 | 391 | ide_bmdma_post_load(&d->bmdma[i], -1); |
977e1244 | 392 | } |
def93791 | 393 | |
977e1244 GH |
394 | return 0; |
395 | } | |
396 | ||
407a4f30 JQ |
397 | const VMStateDescription vmstate_ide_pci = { |
398 | .name = "ide", | |
57338424 | 399 | .version_id = 3, |
407a4f30 | 400 | .minimum_version_id = 0, |
407a4f30 | 401 | .post_load = ide_pci_post_load, |
d49805ae | 402 | .fields = (VMStateField[]) { |
f6c11d56 | 403 | VMSTATE_PCI_DEVICE(parent_obj, PCIIDEState), |
407a4f30 JQ |
404 | VMSTATE_STRUCT_ARRAY(bmdma, PCIIDEState, 2, 0, |
405 | vmstate_bmdma, BMDMAState), | |
406 | VMSTATE_IDE_BUS_ARRAY(bus, PCIIDEState, 2), | |
407 | VMSTATE_IDE_DRIVES(bus[0].ifs, PCIIDEState), | |
408 | VMSTATE_IDE_DRIVES(bus[1].ifs, PCIIDEState), | |
409 | VMSTATE_END_OF_LIST() | |
410 | } | |
411 | }; | |
412 | ||
3e7e1558 | 413 | void pci_ide_create_devs(PCIDevice *dev, DriveInfo **hd_table) |
feef3102 | 414 | { |
f6c11d56 | 415 | PCIIDEState *d = PCI_IDE(dev); |
feef3102 GH |
416 | static const int bus[4] = { 0, 0, 1, 1 }; |
417 | static const int unit[4] = { 0, 1, 0, 1 }; | |
418 | int i; | |
419 | ||
420 | for (i = 0; i < 4; i++) { | |
421 | if (hd_table[i] == NULL) | |
422 | continue; | |
1f850f10 | 423 | ide_create_drive(d->bus+bus[i], unit[i], hd_table[i]); |
feef3102 GH |
424 | } |
425 | } | |
40a6238a AG |
426 | |
427 | static const struct IDEDMAOps bmdma_ops = { | |
428 | .start_dma = bmdma_start_dma, | |
40a6238a AG |
429 | .prepare_buf = bmdma_prepare_buf, |
430 | .rw_buf = bmdma_rw_buf, | |
bd8892c4 | 431 | .restart_dma = bmdma_restart_dma, |
40a6238a | 432 | .set_inactive = bmdma_set_inactive, |
40a6238a AG |
433 | .reset = bmdma_reset, |
434 | }; | |
435 | ||
a9deb8c6 | 436 | void bmdma_init(IDEBus *bus, BMDMAState *bm, PCIIDEState *d) |
40a6238a | 437 | { |
40a6238a AG |
438 | if (bus->dma == &bm->dma) { |
439 | return; | |
440 | } | |
441 | ||
442 | bm->dma.ops = &bmdma_ops; | |
443 | bus->dma = &bm->dma; | |
444 | bm->irq = bus->irq; | |
6e38a4ba | 445 | bus->irq = qemu_allocate_irq(bmdma_irq, bm, 0); |
a9deb8c6 | 446 | bm->pci_dev = d; |
40a6238a | 447 | } |
f6c11d56 AF |
448 | |
449 | static const TypeInfo pci_ide_type_info = { | |
450 | .name = TYPE_PCI_IDE, | |
451 | .parent = TYPE_PCI_DEVICE, | |
452 | .instance_size = sizeof(PCIIDEState), | |
453 | .abstract = true, | |
fd3b02c8 EH |
454 | .interfaces = (InterfaceInfo[]) { |
455 | { INTERFACE_CONVENTIONAL_PCI_DEVICE }, | |
456 | { }, | |
457 | }, | |
f6c11d56 AF |
458 | }; |
459 | ||
460 | static void pci_ide_register_types(void) | |
461 | { | |
462 | type_register_static(&pci_ide_type_info); | |
463 | } | |
464 | ||
465 | type_init(pci_ide_register_types) |