Lines Matching refs:ctlr

93 #define ATA_INTEL_SMAP(ctlr, ch) \
94 &((struct ata_intel_data *)((ctlr)->chipset_data))->smap[(ch)->unit * 2]
95 #define ATA_INTEL_LOCK(ctlr) \
96 mtx_lock(&((struct ata_intel_data *)((ctlr)->chipset_data))->lock)
97 #define ATA_INTEL_UNLOCK(ctlr) \
98 mtx_unlock(&((struct ata_intel_data *)((ctlr)->chipset_data))->lock)
106 struct ata_pci_controller *ctlr = device_get_softc(dev);
197 if (!(ctlr->chip = ata_match_chip(dev, ids)))
201 ctlr->chipinit = ata_intel_chipinit;
202 ctlr->chipdeinit = ata_intel_chipdeinit;
209 struct ata_pci_controller *ctlr = device_get_softc(dev);
217 ctlr->chipset_data = (void *)data;
220 if (ctlr->chip->chipid == ATA_I82371FB) {
221 ctlr->setmode = ata_intel_old_setmode;
225 else if (ctlr->chip->chipid == ATA_I31244) {
227 ctlr->r_type2 = SYS_RES_MEMORY;
228 ctlr->r_rid2 = PCIR_BAR(0);
229 if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
230 &ctlr->r_rid2,
233 ctlr->channels = 4;
234 ctlr->ch_attach = ata_intel_31244_ch_attach;
235 ctlr->ch_detach = ata_intel_31244_ch_detach;
236 ctlr->reset = ata_intel_31244_reset;
238 ctlr->setmode = ata_sata_setmode;
239 ctlr->getrev = ata_sata_getrev;
242 else if (ctlr->chip->chipid == ATA_ISCH) {
243 ctlr->channels = 1;
244 ctlr->ch_attach = ata_intel_ch_attach;
245 ctlr->ch_detach = ata_pci_ch_detach;
246 ctlr->setmode = ata_intel_sch_setmode;
249 else if (ctlr->chip->max_dma < ATA_SA150) {
250 ctlr->channels = ctlr->chip->cfg2;
251 ctlr->ch_attach = ata_intel_ch_attach;
252 ctlr->ch_detach = ata_pci_ch_detach;
253 ctlr->setmode = ata_intel_new_setmode;
261 ctlr->ch_attach = ata_intel_ch_attach;
262 ctlr->ch_detach = ata_pci_ch_detach;
263 ctlr->reset = ata_intel_reset;
266 if ((ctlr->chip->cfg1 & INTEL_ICH7)) {
267 ctlr->r_type2 = SYS_RES_MEMORY;
268 ctlr->r_rid2 = PCIR_BAR(5);
269 ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
270 &ctlr->r_rid2, RF_ACTIVE);
271 if (ctlr->r_res2 != NULL) {
276 ATA_OUTL(ctlr->r_res2, 0x0C,
277 ATA_INL(ctlr->r_res2, 0x0C) | 0xf);
280 } else if (ctlr->chip->chipid != ATA_I82801HBM_S1 ||
282 ctlr->r_type2 = SYS_RES_IOPORT;
283 ctlr->r_rid2 = PCIR_BAR(5);
284 ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2,
285 &ctlr->r_rid2, RF_ACTIVE);
287 if (ctlr->r_res2 != NULL ||
288 (ctlr->chip->cfg1 & INTEL_ICH5))
289 ctlr->getrev = ata_intel_sata_getrev;
290 ctlr->setmode = ata_sata_setmode;
298 struct ata_pci_controller *ctlr = device_get_softc(dev);
301 data = ctlr->chipset_data;
304 ctlr->chipset_data = NULL;
311 struct ata_pci_controller *ctlr;
320 ctlr = device_get_softc(device_get_parent(dev));
324 if (ctlr->r_res2) {
325 ch->r_io[ATA_IDX_ADDR].res = ctlr->r_res2;
327 ch->r_io[ATA_IDX_DATA].res = ctlr->r_res2;
332 if (ctlr->chip->max_dma >= ATA_SA150) {
333 smap = ATA_INTEL_SMAP(ctlr, ch);
335 if (ctlr->chip->cfg1 & INTEL_ICH5) {
351 } else if (ctlr->chip->cfg1 & INTEL_6CH2) {
373 if ((ctlr->chip->cfg1 & INTEL_ICH5)) {
376 } else if (ctlr->r_res2) {
377 if ((ctlr->chip->cfg1 & INTEL_ICH7)) {
396 ctlr->setmode = ata_intel_new_setmode;
397 if (ctlr->chip->max_dma >= ATA_SA600)
399 } else if (ctlr->chip->chipid != ATA_ISCH)
408 struct ata_pci_controller *ctlr = device_get_softc(parent);
419 smap = ATA_INTEL_SMAP(ctlr, ch);
430 if (ctlr->chip->cfg1 & (INTEL_6CH | INTEL_6CH2))
467 struct ata_pci_controller *ctlr = device_get_softc(parent);
469 mode = min(mode, ctlr->chip->max_dma);
477 struct ata_pci_controller *ctlr = device_get_softc(parent);
497 mode = min(mode, ctlr->chip->max_dma);
550 struct ata_pci_controller *ctlr = device_get_softc(parent);
555 mode = min(mode, ctlr->chip->max_dma);
601 struct ata_pci_controller *ctlr;
608 ctlr = device_get_softc(parent);
611 smap = ATA_INTEL_SMAP(ctlr, ch);
626 *result = ATA_INL(ctlr->r_res2, offset + reg);
633 struct ata_pci_controller *ctlr;
639 ctlr = device_get_softc(parent);
641 smap = ATA_INTEL_SMAP(ctlr, ch);
656 ATA_INTEL_LOCK(ctlr);
660 ATA_INTEL_UNLOCK(ctlr);
667 struct ata_pci_controller *ctlr;
672 ctlr = device_get_softc(parent);
688 ATA_INTEL_LOCK(ctlr);
691 ATA_INTEL_UNLOCK(ctlr);
698 struct ata_pci_controller *ctlr;
705 ctlr = device_get_softc(parent);
708 smap = ATA_INTEL_SMAP(ctlr, ch);
723 ATA_OUTL(ctlr->r_res2, offset + reg, value);
730 struct ata_pci_controller *ctlr;
736 ctlr = device_get_softc(parent);
738 smap = ATA_INTEL_SMAP(ctlr, ch);
753 ATA_INTEL_LOCK(ctlr);
757 ATA_INTEL_UNLOCK(ctlr);
764 struct ata_pci_controller *ctlr;
769 ctlr = device_get_softc(parent);
785 ATA_INTEL_LOCK(ctlr);
788 ATA_INTEL_UNLOCK(ctlr);
821 struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
831 ch->r_io[i].res = ctlr->r_res2;
864 ATA_OUTL(ctlr->r_res2, 0x4,
865 ATA_INL(ctlr->r_res2, 0x04) | (0x01 << (ch->unit << 3)));