Lines Matching refs:ctlr

62     struct ata_pci_controller *ctlr = device_get_softc(dev);
75 ctlr->chipinit = ata_generic_chipinit;
84 struct ata_pci_controller *ctlr = device_get_softc(dev);
90 ctlr->legacy = ata_legacy(dev);
91 if (ctlr->legacy || pci_read_config(dev, PCIR_BAR(2), 4) & IOMASK)
92 ctlr->channels = 2;
94 ctlr->channels = 1;
95 ctlr->ichannels = -1;
96 ctlr->ch_attach = ata_pci_ch_attach;
97 ctlr->ch_detach = ata_pci_ch_detach;
98 ctlr->dev = dev;
106 ctlr->r_type1 = SYS_RES_IOPORT;
107 ctlr->r_rid1 = ATA_BMADDR_RID;
108 ctlr->r_res1 = bus_alloc_resource_any(dev, ctlr->r_type1, &ctlr->r_rid1,
112 if (ctlr->chipinit(dev))
116 for (unit = 0; unit < ctlr->channels; unit++) {
117 if ((ctlr->ichannels & (1 << unit)) == 0)
120 ((unit == 0 || unit == 1) && ctlr->legacy) ?
134 struct ata_pci_controller *ctlr = device_get_softc(dev);
139 if (ctlr->r_irq) {
140 bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle);
141 bus_release_resource(dev, SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq);
142 if (ctlr->r_irq_rid != ATA_IRQ_RID)
145 if (ctlr->chipdeinit != NULL)
146 ctlr->chipdeinit(dev);
147 if (ctlr->r_res2) {
149 bus_space_unmap(rman_get_bustag(ctlr->r_res2),
150 rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2));
152 bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2);
154 if (ctlr->r_res1) {
156 bus_space_unmap(rman_get_bustag(ctlr->r_res1),
157 rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1));
159 bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1);
168 struct ata_pci_controller *ctlr = device_get_softc(dev);
172 if (ctlr->suspend)
173 error = ctlr->suspend(dev);
180 struct ata_pci_controller *ctlr = device_get_softc(dev);
183 if (ctlr->resume)
184 error = ctlr->resume(dev);
385 struct ata_pci_controller *ctlr = device_get_softc(dev);
389 ctlr->setmode = ata_generic_setmode;
396 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
418 ch->r_io[ATA_CONTROL].offset = ctlr->legacy ? 0 : 2;
421 if (ctlr->r_res1) {
423 ch->r_io[i].res = ctlr->r_res1;
632 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
646 if ((error = ctlr->ch_attach(dev)))
655 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
666 if (ctlr->ch_detach)
667 return (ctlr->ch_detach(dev));
674 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
684 if (ctlr->ch_suspend != NULL && (error = ctlr->ch_suspend(dev)))
693 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
700 if (ctlr->ch_resume != NULL && (error = ctlr->ch_resume(dev)))
709 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
717 if (ctlr->reset)
718 ctlr->reset(dev);
726 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
728 if (ctlr->setmode)
729 return (ctlr->setmode(dev, target, mode));
737 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
741 if (ctlr->getrev)
742 return (ctlr->getrev(dev, target));
795 struct ata_pci_controller *ctlr = data;
800 if ((ch = ctlr->interrupt[unit].argument))
801 ctlr->interrupt[unit].function(ch);
808 struct ata_pci_controller *ctlr = device_get_softc(dev);
811 if (!ctlr->legacy) {
816 ctlr->r_irq_rid = 0x1;
819 ctlr->r_irq_rid = ATA_IRQ_RID;
821 if (!(ctlr->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
822 &ctlr->r_irq_rid, RF_SHAREABLE | RF_ACTIVE))) {
828 if ((bus_setup_intr(dev, ctlr->r_irq, ATA_INTR_FLAGS, NULL,
829 intr_func, ctlr, &ctlr->handle))) {
832 SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq);
844 struct ata_pci_controller *ctlr = device_get_softc(dev);
848 ata_pcivendor2str(dev), ctlr->chip->text,
849 ata_mode2str(ctlr->chip->max_dma));