Lines Matching refs:ctlr

88     struct ata_pci_controller *ctlr = device_get_softc(dev);  in ata_via_probe()  local
131 if (!(ctlr->chip = ata_find_chip(dev, ids, -99))) in ata_via_probe()
135 if (!(ctlr->chip = ata_match_chip(dev, new_ids))) in ata_via_probe()
140 ctlr->chipinit = ata_via_chipinit; in ata_via_probe()
147 struct ata_pci_controller *ctlr = device_get_softc(dev); in ata_via_chipinit() local
153 if (ctlr->chip->cfg2 & VIASATA) { in ata_via_chipinit()
154 ctlr->ch_attach = ata_via_sata_ch_attach; in ata_via_chipinit()
155 ctlr->setmode = ata_via_sata_setmode; in ata_via_chipinit()
156 ctlr->getrev = ata_via_sata_getrev; in ata_via_chipinit()
157 ctlr->reset = ata_via_sata_reset; in ata_via_chipinit()
161 if (ctlr->chip->max_dma >= ATA_SA150) { in ata_via_chipinit()
162 ctlr->r_type2 = SYS_RES_IOPORT; in ata_via_chipinit()
163 ctlr->r_rid2 = PCIR_BAR(5); in ata_via_chipinit()
164 if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, in ata_via_chipinit()
165 &ctlr->r_rid2, RF_ACTIVE))) { in ata_via_chipinit()
166 ctlr->ch_attach = ata_via_ch_attach; in ata_via_chipinit()
167 ctlr->ch_detach = ata_via_ch_detach; in ata_via_chipinit()
168 ctlr->reset = ata_via_reset; in ata_via_chipinit()
170 if (ctlr->chip->cfg2 & VIABAR) { in ata_via_chipinit()
171 ctlr->channels = 3; in ata_via_chipinit()
172 ctlr->setmode = ata_via_new_setmode; in ata_via_chipinit()
174 ctlr->setmode = ata_sata_setmode; in ata_via_chipinit()
175 ctlr->getrev = ata_sata_getrev; in ata_via_chipinit()
180 if (ctlr->chip->cfg2 & VIACLK) in ata_via_chipinit()
184 if (ctlr->chip->cfg2 & VIABUG) in ata_via_chipinit()
202 ctlr->setmode = ata_via_old_setmode; in ata_via_chipinit()
209 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); in ata_via_ch_attach() local
213 if (ctlr->chip->cfg2 & VIABAR) { in ata_via_ch_attach()
234 ch->r_io[i].res = ctlr->r_res1; in ata_via_ch_attach()
247 ch->r_io[ATA_SSTATUS].res = ctlr->r_res2; in ata_via_ch_attach()
248 ch->r_io[ATA_SSTATUS].offset = (ch->unit << ctlr->chip->cfg1); in ata_via_ch_attach()
249 ch->r_io[ATA_SERROR].res = ctlr->r_res2; in ata_via_ch_attach()
250 ch->r_io[ATA_SERROR].offset = 0x04 + (ch->unit << ctlr->chip->cfg1); in ata_via_ch_attach()
251 ch->r_io[ATA_SCONTROL].res = ctlr->r_res2; in ata_via_ch_attach()
252 ch->r_io[ATA_SCONTROL].offset = 0x08 + (ch->unit << ctlr->chip->cfg1); in ata_via_ch_attach()
266 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); in ata_via_ch_detach() local
270 if (ctlr->chip->cfg2 & VIABAR) { in ata_via_ch_detach()
291 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); in ata_via_reset() local
294 if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1)) in ata_via_reset()
316 struct ata_pci_controller *ctlr = device_get_softc(parent); in ata_via_new_setmode() local
319 if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1)) { in ata_via_new_setmode()
345 struct ata_pci_controller *ctlr = device_get_softc(parent); in ata_via_old_setmode() local
358 mode = min(mode, ctlr->chip->max_dma); in ata_via_old_setmode()
362 modes[ctlr->chip->cfg1][mode & ATA_MODE_MASK], 1); in ata_via_old_setmode()