]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/dev/ata/ata-pci.c
Change the various AGP drivers that attach to the Host-PCI bridge device to
[FreeBSD/FreeBSD.git] / sys / dev / ata / ata-pci.c
1 /*-
2  * Copyright (c) 1998 - 2005 Søren Schmidt <sos@FreeBSD.org>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer,
10  *    without modification, immediately at the beginning of the file.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. The name of the author may not be used to endorse or promote products
15  *    derived from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
31
32 #include "opt_ata.h"
33 #include <sys/param.h>
34 #include <sys/systm.h>
35 #include <sys/kernel.h>
36 #include <sys/module.h>
37 #include <sys/ata.h>
38 #include <sys/bus.h>
39 #include <sys/malloc.h>
40 #include <sys/sema.h>
41 #include <sys/taskqueue.h>
42 #include <vm/uma.h>
43 #include <machine/stdarg.h>
44 #include <machine/resource.h>
45 #include <machine/bus.h>
46 #ifdef __alpha__
47 #include <machine/md_var.h>
48 #endif
49 #include <sys/rman.h>
50 #include <dev/pci/pcivar.h>
51 #include <dev/pci/pcireg.h>
52 #include <dev/ata/ata-all.h>
53 #include <dev/ata/ata-pci.h>
54 #include <ata_if.h>
55
56 /* local vars */
57 static MALLOC_DEFINE(M_ATAPCI, "ata_pci", "ATA driver PCI");
58
59 /* misc defines */
60 #define IOMASK                  0xfffffffc
61
62 /* prototypes */
63 static void ata_pci_dmainit(device_t);
64
65 int
66 ata_legacy(device_t dev)
67 {
68     return ((pci_read_config(dev, PCIR_PROGIF, 1)&PCIP_STORAGE_IDE_MASTERDEV) &&
69             ((pci_read_config(dev, PCIR_PROGIF, 1) &
70               (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)) !=
71              (PCIP_STORAGE_IDE_MODEPRIM | PCIP_STORAGE_IDE_MODESEC)));
72 }
73
74 int
75 ata_pci_probe(device_t dev)
76 {
77     if (pci_get_class(dev) != PCIC_STORAGE)
78         return ENXIO;
79
80     switch (pci_get_vendor(dev)) {
81     case ATA_ACARD_ID: 
82         if (!ata_acard_ident(dev))
83             return 0;
84         break;
85     case ATA_ACER_LABS_ID:
86         if (!ata_ali_ident(dev))
87             return 0;
88         break;
89     case ATA_AMD_ID:
90         if (!ata_amd_ident(dev))
91             return 0;
92         break;
93     case ATA_ATI_ID:
94         if (!ata_ati_ident(dev))
95             return 0;
96         break;
97     case ATA_CYRIX_ID:
98         if (!ata_cyrix_ident(dev))
99             return 0;
100         break;
101     case ATA_CYPRESS_ID:
102         if (!ata_cypress_ident(dev))
103             return 0;
104         break;
105     case ATA_HIGHPOINT_ID: 
106         if (!ata_highpoint_ident(dev))
107             return 0;
108         break;
109     case ATA_INTEL_ID:
110         if (!ata_intel_ident(dev))
111             return 0;
112         break;
113     case ATA_ITE_ID:
114         if (!ata_ite_ident(dev))
115             return 0;
116         break;
117     case ATA_NATIONAL_ID:
118         if (!ata_national_ident(dev))
119             return 0;
120         break;
121     case ATA_NVIDIA_ID:
122         if (!ata_nvidia_ident(dev))
123             return 0;
124         break;
125     case ATA_PROMISE_ID:
126         if (!ata_promise_ident(dev))
127             return 0;
128         break;
129     case ATA_SERVERWORKS_ID: 
130         if (!ata_serverworks_ident(dev))
131             return 0;
132         break;
133     case ATA_SILICON_IMAGE_ID:
134         if (!ata_sii_ident(dev))
135             return 0;
136         break;
137     case ATA_SIS_ID:
138         if (!ata_sis_ident(dev))
139             return 0;
140         break;
141     case ATA_VIA_ID: 
142         if (!ata_via_ident(dev))
143             return 0;
144         break;
145     case ATA_CENATEK_ID:
146         if (pci_get_devid(dev) == ATA_CENATEK_ROCKET) {
147             ata_generic_ident(dev);
148             device_set_desc(dev, "Cenatek Rocket Drive controller");
149             return 0;
150         }
151         break;
152     case ATA_MICRON_ID:
153         if (pci_get_devid(dev) == ATA_MICRON_RZ1000 ||
154             pci_get_devid(dev) == ATA_MICRON_RZ1001) {
155             ata_generic_ident(dev);
156             device_set_desc(dev, 
157                 "RZ 100? ATA controller !WARNING! data loss/corruption risk");
158             return 0;
159         }
160         break;
161     }
162
163     /* unknown chipset, try generic DMA if it seems possible */
164     if ((pci_get_class(dev) == PCIC_STORAGE) &&
165         (pci_get_subclass(dev) == PCIS_STORAGE_IDE))
166         return ata_generic_ident(dev);
167
168     return ENXIO;
169 }
170
171 int
172 ata_pci_attach(device_t dev)
173 {
174     struct ata_pci_controller *ctlr = device_get_softc(dev);
175     u_int32_t cmd;
176     int unit;
177
178     /* do chipset specific setups only needed once */
179     if (ata_legacy(dev) || pci_read_config(dev, PCIR_BAR(2), 4) & IOMASK)
180         ctlr->channels = 2;
181     else
182         ctlr->channels = 1;
183     ctlr->allocate = ata_pci_allocate;
184     ctlr->dmainit = ata_pci_dmainit;
185     ctlr->dev = dev;
186
187     /* if needed try to enable busmastering */
188     cmd = pci_read_config(dev, PCIR_COMMAND, 2);
189     if (!(cmd & PCIM_CMD_BUSMASTEREN)) {
190         pci_write_config(dev, PCIR_COMMAND, cmd | PCIM_CMD_BUSMASTEREN, 2);
191         cmd = pci_read_config(dev, PCIR_COMMAND, 2);
192     }
193
194     /* if busmastering mode "stuck" use it */
195     if ((cmd & PCIM_CMD_BUSMASTEREN) == PCIM_CMD_BUSMASTEREN) {
196         ctlr->r_type1 = SYS_RES_IOPORT;
197         ctlr->r_rid1 = ATA_BMADDR_RID;
198         ctlr->r_res1 = bus_alloc_resource_any(dev, ctlr->r_type1, &ctlr->r_rid1,
199                                               RF_ACTIVE);
200     }
201
202     ctlr->chipinit(dev);
203
204     /* attach all channels on this controller */
205     for (unit = 0; unit < ctlr->channels; unit++) {
206         if (unit == 0 && (pci_get_progif(dev) & 0x81) == 0x80) {
207             device_add_child(dev, "ata", unit);
208             continue;
209         }
210         if (unit == 1 && (pci_get_progif(dev) & 0x84) == 0x80) {
211             device_add_child(dev, "ata", unit);
212             continue;
213         }
214         device_add_child(dev, "ata", devclass_find_free_unit(ata_devclass, 2));
215     }
216     bus_generic_attach(dev);
217     return 0;
218 }
219
220 int
221 ata_pci_detach(device_t dev)
222 {
223     struct ata_pci_controller *ctlr = device_get_softc(dev);
224     device_t *children;
225     int nchildren, i;
226
227     /* detach & delete all children */
228     if (!device_get_children(dev, &children, &nchildren)) {
229         for (i = 0; i < nchildren; i++)
230             device_delete_child(dev, children[i]);
231         free(children, M_TEMP);
232     }
233
234     if (ctlr->r_irq) {
235         bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle);
236         bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ctlr->r_irq);
237     }
238     if (ctlr->r_res2)
239         bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2);
240     if (ctlr->r_res1)
241         bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1);
242
243     return 0;
244 }
245
246 struct resource *
247 ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
248                        u_long start, u_long end, u_long count, u_int flags)
249 {
250     struct ata_pci_controller *controller = device_get_softc(dev);
251     int unit = ((struct ata_channel *)device_get_softc(child))->unit;
252     struct resource *res = NULL;
253     int myrid;
254
255     if (type == SYS_RES_IOPORT) {
256         switch (*rid) {
257         case ATA_IOADDR_RID:
258             if (ata_legacy(dev)) {
259                 start = (unit ? ATA_SECONDARY : ATA_PRIMARY);
260                 count = ATA_IOSIZE;
261                 end = start + count - 1;
262             }
263             myrid = PCIR_BAR(0) + (unit << 3);
264             res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
265                                      SYS_RES_IOPORT, &myrid,
266                                      start, end, count, flags);
267             break;
268
269         case ATA_CTLADDR_RID:
270             if (ata_legacy(dev)) {
271                 start = (unit ? ATA_SECONDARY : ATA_PRIMARY) + ATA_CTLOFFSET;
272                 count = ATA_CTLIOSIZE;
273                 end = start + count - 1;
274             }
275             myrid = PCIR_BAR(1) + (unit << 3);
276             res = BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
277                                      SYS_RES_IOPORT, &myrid,
278                                      start, end, count, flags);
279             break;
280         }
281     }
282     if (type == SYS_RES_IRQ && *rid == ATA_IRQ_RID) {
283         if (ata_legacy(dev)) {
284 #ifdef __alpha__
285             res = alpha_platform_alloc_ide_intr(unit);
286 #else
287             int irq = (unit == 0 ? 14 : 15);
288             
289             res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
290                                      SYS_RES_IRQ, rid, irq, irq, 1, flags);
291 #endif
292         }
293         else
294             res = controller->r_irq;
295     }
296     return res;
297 }
298
299 int
300 ata_pci_release_resource(device_t dev, device_t child, int type, int rid,
301                          struct resource *r)
302 {
303     int unit = ((struct ata_channel *)device_get_softc(child))->unit;
304
305     if (type == SYS_RES_IOPORT) {
306         switch (rid) {
307         case ATA_IOADDR_RID:
308             return BUS_RELEASE_RESOURCE(device_get_parent(dev), dev,
309                                         SYS_RES_IOPORT,
310                                         PCIR_BAR(0) + (unit << 3), r);
311             break;
312
313         case ATA_CTLADDR_RID:
314             return BUS_RELEASE_RESOURCE(device_get_parent(dev), dev,
315                                         SYS_RES_IOPORT,
316                                         PCIR_BAR(1) + (unit << 3), r);
317             break;
318         default:
319             return ENOENT;
320         }
321     }
322     if (type == SYS_RES_IRQ) {
323         if (rid != ATA_IRQ_RID)
324             return ENOENT;
325
326         if (ata_legacy(dev)) {
327 #ifdef __alpha__
328             return alpha_platform_release_ide_intr(unit, r);
329 #else
330             return BUS_RELEASE_RESOURCE(device_get_parent(dev), child,
331                                         SYS_RES_IRQ, rid, r);
332 #endif
333         }
334         else  
335             return 0;
336     }
337     return EINVAL;
338 }
339
340 int
341 ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, 
342                    int flags, driver_intr_t *function, void *argument,
343                    void **cookiep)
344 {
345     if (ata_legacy(dev)) {
346 #ifdef __alpha__
347         return alpha_platform_setup_ide_intr(child, irq, function, argument,
348                                              cookiep);
349 #else
350         return BUS_SETUP_INTR(device_get_parent(dev), child, irq,
351                               flags, function, argument, cookiep);
352 #endif
353     }
354     else {
355         struct ata_pci_controller *controller = device_get_softc(dev);
356         int unit = ((struct ata_channel *)device_get_softc(child))->unit;
357
358         controller->interrupt[unit].function = function;
359         controller->interrupt[unit].argument = argument;
360         *cookiep = controller;
361         return 0;
362     }
363 }
364
365 int
366 ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq,
367                       void *cookie)
368 {
369     if (ata_legacy(dev)) {
370 #ifdef __alpha__
371         return alpha_platform_teardown_ide_intr(child, irq, cookie);
372 #else
373         return BUS_TEARDOWN_INTR(device_get_parent(dev), child, irq, cookie);
374 #endif
375     }
376     else {
377         struct ata_pci_controller *controller = device_get_softc(dev);
378         int unit = ((struct ata_channel *)device_get_softc(child))->unit;
379
380         controller->interrupt[unit].function = NULL;
381         controller->interrupt[unit].argument = NULL;
382         return 0;
383     }
384 }
385     
386 int
387 ata_pci_allocate(device_t dev)
388 {
389     struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
390     struct ata_channel *ch = device_get_softc(dev);
391     struct resource *io = NULL, *ctlio = NULL;
392     int i, rid;
393
394     rid = ATA_IOADDR_RID;
395     if (!(io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE)))
396         return ENXIO;
397
398     rid = ATA_CTLADDR_RID;
399     if (!(ctlio = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,RF_ACTIVE))){
400         bus_release_resource(dev, SYS_RES_IOPORT, ATA_IOADDR_RID, io);
401         return ENXIO;
402     }
403
404     for (i = ATA_DATA; i <= ATA_COMMAND; i ++) {
405         ch->r_io[i].res = io;
406         ch->r_io[i].offset = i;
407     }
408     ch->r_io[ATA_CONTROL].res = ctlio;
409     ch->r_io[ATA_CONTROL].offset = ata_legacy(device_get_parent(dev)) ? 0 : 2;
410     ch->r_io[ATA_IDX_ADDR].res = io;
411     ata_default_registers(dev);
412     if (ctlr->r_res1) {
413         for (i = ATA_BMCMD_PORT; i <= ATA_BMDTP_PORT; i++) {
414             ch->r_io[i].res = ctlr->r_res1;
415             ch->r_io[i].offset = (i - ATA_BMCMD_PORT) + (ch->unit*ATA_BMIOSIZE);
416         }
417     }
418
419     ata_generic_hw(dev);
420     return 0;
421 }
422
423 static int
424 ata_pci_dmastart(device_t dev)
425 {
426     struct ata_channel *ch = device_get_softc(device_get_parent(dev));
427
428     ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, (ATA_IDX_INB(ch, ATA_BMSTAT_PORT) | 
429                  (ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR)));
430     ATA_IDX_OUTL(ch, ATA_BMDTP_PORT, ch->dma->sg_bus);
431     ch->dma->flags |= ATA_DMA_ACTIVE;
432     ATA_IDX_OUTB(ch, ATA_BMCMD_PORT,
433                  (ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_WRITE_READ) |
434                  ((ch->dma->flags & ATA_DMA_READ) ? ATA_BMCMD_WRITE_READ : 0) |
435                  ATA_BMCMD_START_STOP);
436     return 0;
437 }
438
439 static int
440 ata_pci_dmastop(device_t dev)
441 {
442     struct ata_channel *ch = device_get_softc(device_get_parent(dev));
443     int error;
444
445     ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, 
446                  ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
447     ch->dma->flags &= ~ATA_DMA_ACTIVE;
448     error = ATA_IDX_INB(ch, ATA_BMSTAT_PORT) & ATA_BMSTAT_MASK;
449     ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR);
450     return error;
451 }
452
453 static void
454 ata_pci_dmareset(device_t dev)
455 {
456     struct ata_channel *ch = device_get_softc(dev);
457
458     ATA_IDX_OUTB(ch, ATA_BMCMD_PORT, 
459                  ATA_IDX_INB(ch, ATA_BMCMD_PORT) & ~ATA_BMCMD_START_STOP);
460     ch->dma->flags &= ~ATA_DMA_ACTIVE;
461     ATA_IDX_OUTB(ch, ATA_BMSTAT_PORT, ATA_BMSTAT_INTERRUPT | ATA_BMSTAT_ERROR);
462     ch->dma->unload(dev);
463 }
464
465 static void
466 ata_pci_dmainit(device_t dev)
467 {
468     struct ata_channel *ch = device_get_softc(dev);
469
470     ata_dmainit(dev);
471     if (ch->dma) {
472         ch->dma->start = ata_pci_dmastart;
473         ch->dma->stop = ata_pci_dmastop;
474         ch->dma->reset = ata_pci_dmareset;
475     }
476 }
477
478 static device_method_t ata_pci_methods[] = {
479     /* device interface */
480     DEVMETHOD(device_probe,             ata_pci_probe),
481     DEVMETHOD(device_attach,            ata_pci_attach),
482     DEVMETHOD(device_detach,            ata_pci_detach),
483     DEVMETHOD(device_shutdown,          bus_generic_shutdown),
484     DEVMETHOD(device_suspend,           bus_generic_suspend),
485     DEVMETHOD(device_resume,            bus_generic_resume),
486
487     /* bus methods */
488     DEVMETHOD(bus_alloc_resource,       ata_pci_alloc_resource),
489     DEVMETHOD(bus_release_resource,     ata_pci_release_resource),
490     DEVMETHOD(bus_activate_resource,    bus_generic_activate_resource),
491     DEVMETHOD(bus_deactivate_resource,  bus_generic_deactivate_resource),
492     DEVMETHOD(bus_setup_intr,           ata_pci_setup_intr),
493     DEVMETHOD(bus_teardown_intr,        ata_pci_teardown_intr),
494
495     { 0, 0 }
496 };
497
498 devclass_t atapci_devclass;
499
500 static driver_t ata_pci_driver = {
501     "atapci",
502     ata_pci_methods,
503     sizeof(struct ata_pci_controller),
504 };
505
506 DRIVER_MODULE(atapci, pci, ata_pci_driver, atapci_devclass, 0, 0);
507 MODULE_VERSION(atapci, 1);
508 MODULE_DEPEND(atapci, ata, 1, 1, 1);
509
510 static int
511 ata_pcichannel_probe(device_t dev)
512 {
513     struct ata_channel *ch = device_get_softc(dev);
514     device_t *children;
515     int count, i;
516     char buffer[32];
517
518     /* take care of green memory */
519     bzero(ch, sizeof(struct ata_channel));
520
521     /* find channel number on this controller */
522     device_get_children(device_get_parent(dev), &children, &count);
523     for (i = 0; i < count; i++) {
524         if (children[i] == dev)
525             ch->unit = i;
526     }
527     free(children, M_TEMP);
528
529     sprintf(buffer, "ATA channel %d", ch->unit);
530     device_set_desc_copy(dev, buffer);
531
532     return ata_probe(dev);
533 }
534
535 static int
536 ata_pcichannel_attach(device_t dev)
537 {
538     struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
539     struct ata_channel *ch = device_get_softc(dev);
540     int error;
541
542     if (ctlr->dmainit)
543         ctlr->dmainit(dev);
544     if (ch->dma)
545         ch->dma->alloc(dev);
546
547     if ((error = ctlr->allocate(dev)))
548         return error;
549
550     return ata_attach(dev);
551 }
552
553 static int
554 ata_pcichannel_detach(device_t dev)
555 {
556     struct ata_channel *ch = device_get_softc(dev);
557     int error;
558
559     if ((error = ata_detach(dev)))
560         return error;
561
562     if (ch->dma)
563         ch->dma->free(dev);
564
565     /* XXX SOS free resources for io and ctlio ?? */
566
567     return 0;
568 }
569
570 static int
571 ata_pcichannel_locking(device_t dev, int mode)
572 {
573     struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
574     struct ata_channel *ch = device_get_softc(dev);
575
576     if (ctlr->locking)
577         return ctlr->locking(dev, mode);
578     else
579         return ch->unit;
580 }
581
582 static void
583 ata_pcichannel_reset(device_t dev)
584 {
585     struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
586     struct ata_channel *ch = device_get_softc(dev);
587
588     /* if DMA engine present reset it  */
589     if (ch->dma) {
590         if (ch->dma->reset)
591             ch->dma->reset(dev);
592         ch->dma->unload(dev);
593     }
594
595     /* reset the controller HW */
596     if (ctlr->reset)
597         ctlr->reset(dev);
598     else
599         ata_generic_reset(dev);
600 }
601
602 static void
603 ata_pcichannel_setmode(device_t parent, device_t dev)
604 {
605     struct ata_pci_controller *ctlr = device_get_softc(GRANDPARENT(dev));
606     struct ata_device *atadev = device_get_softc(dev);
607     int mode = atadev->mode;
608
609     ctlr->setmode(dev, ATA_PIO_MAX);
610     if (mode >= ATA_DMA)
611         ctlr->setmode(dev, mode);
612 }
613
614 static device_method_t ata_pcichannel_methods[] = {
615     /* device interface */
616     DEVMETHOD(device_probe,     ata_pcichannel_probe),
617     DEVMETHOD(device_attach,    ata_pcichannel_attach),
618     DEVMETHOD(device_detach,    ata_pcichannel_detach),
619     DEVMETHOD(device_shutdown,  bus_generic_shutdown),
620     DEVMETHOD(device_suspend,   ata_suspend),
621     DEVMETHOD(device_resume,    ata_resume),
622
623     /* ATA methods */
624     DEVMETHOD(ata_setmode,      ata_pcichannel_setmode),
625     DEVMETHOD(ata_locking,      ata_pcichannel_locking),
626     DEVMETHOD(ata_reset,        ata_pcichannel_reset),
627
628     { 0, 0 }
629 };
630
631 driver_t ata_pcichannel_driver = {
632     "ata",
633     ata_pcichannel_methods,
634     sizeof(struct ata_channel),
635 };
636
637 DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0);