Lines Matching defs:achp
211 struct ahci_channel *achp;
222 achp = &sc->sc_channels[i];
223 chp = &achp->ata_channel;
233 struct ahci_channel *achp;
235 achp = &sc->sc_channels[i];
237 AHCI_WRITE(sc, AHCI_P_CLB(i), BUS_ADDR_LO32(achp->ahcic_bus_cmdh));
238 AHCI_WRITE(sc, AHCI_P_CLBU(i), BUS_ADDR_HI32(achp->ahcic_bus_cmdh));
239 AHCI_WRITE(sc, AHCI_P_FB(i), BUS_ADDR_LO32(achp->ahcic_bus_rfis));
240 AHCI_WRITE(sc, AHCI_P_FBU(i), BUS_ADDR_HI32(achp->ahcic_bus_rfis));
258 struct ahci_channel *achp;
407 achp = &sc->sc_channels[i];
408 chp = &achp->ata_channel;
420 &achp->ahcic_cmd_tbl_seg, 1, &achp->ahcic_cmd_tbl_nseg,
427 error = bus_dmamem_map(sc->sc_dmat, &achp->ahcic_cmd_tbl_seg,
428 achp->ahcic_cmd_tbl_nseg, dmasize,
436 BUS_DMA_NOWAIT, &achp->ahcic_cmd_tbld);
442 error = bus_dmamap_load(sc->sc_dmat, achp->ahcic_cmd_tbld,
450 bus_dmamap_sync(sc->sc_dmat, achp->ahcic_cmd_tbld, 0,
452 achp->ahcic_cmdh = (struct ahci_cmd_header *)
454 achp->ahcic_bus_cmdh = sc->sc_cmd_hdrd->dm_segs[0].ds_addr +
456 achp->ahcic_rfis = (struct ahci_r_fis *)
460 achp->ahcic_bus_rfis = sc->sc_cmd_hdrd->dm_segs[0].ds_addr +
465 achp->ahcic_cmdh, (uint64_t)achp->ahcic_bus_cmdh,
466 achp->ahcic_rfis, (uint64_t)achp->ahcic_bus_rfis),
470 achp->ahcic_cmd_tbl[j] = (struct ahci_cmd_tbl *)
472 achp->ahcic_bus_cmd_tbl[j] =
473 achp->ahcic_cmd_tbld->dm_segs[0].ds_addr +
475 achp->ahcic_cmdh[j].cmdh_cmdtba =
476 htole64(achp->ahcic_bus_cmd_tbl[j]);
478 achp->ahcic_cmd_tbl[j],
479 (uint64_t)achp->ahcic_bus_cmd_tbl[j]), DEBUG_PROBE);
484 &achp->ahcic_datad[j]);
493 AHCI_P_SSTS(i), 4, &achp->ahcic_sstatus) != 0) {
499 AHCI_P_SCTL(i), 4, &achp->ahcic_scontrol) != 0) {
505 AHCI_P_SERR(i), 4, &achp->ahcic_serror) != 0) {
520 struct ahci_channel *achp;
524 achp = &sc->sc_channels[i];
525 chp = &achp->ata_channel;
539 struct ahci_channel *achp;
549 achp = &sc->sc_channels[i];
550 chp = &achp->ata_channel;
571 bus_dmamap_destroy(sc->sc_dmat, achp->ahcic_datad[j]);
573 bus_dmamap_unload(sc->sc_dmat, achp->ahcic_cmd_tbld);
574 bus_dmamap_destroy(sc->sc_dmat, achp->ahcic_cmd_tbld);
575 bus_dmamem_unmap(sc->sc_dmat, achp->ahcic_cmd_tbl[0],
577 bus_dmamem_free(sc->sc_dmat, &achp->ahcic_cmd_tbl_seg,
578 achp->ahcic_cmd_tbl_nseg);
631 struct ahci_channel *achp = v;
632 struct ata_channel *chp = &achp->ata_channel;
794 struct ahci_channel *achp = (struct ahci_channel *)chp;
805 AHCI_CMDTBL_SYNC(sc, achp, slot, BUS_DMASYNC_PREWRITE);
806 AHCI_CMDH_SYNC(sc, achp, slot,
843 struct ahci_channel *achp = (struct ahci_channel *)chp;
889 cmd_h = &achp->ahcic_cmdh[c_slot];
890 cmd_tbl = achp->ahcic_cmd_tbl[c_slot];
996 struct ahci_channel *achp = (struct ahci_channel *)chp;
1002 if (sata_reset_interface(chp, sc->sc_ahcit, achp->ahcic_scontrol,
1003 achp->ahcic_sstatus, flags) != SStatus_DET_DEV) {
1054 struct ahci_channel *achp = (struct ahci_channel *)chp;
1075 switch (sata_reset_interface(chp, sc->sc_ahcit, achp->ahcic_scontrol,
1076 achp->ahcic_sstatus, AT_WAIT)) {
1173 struct ahci_channel *achp = (struct ahci_channel *)chp;
1186 cmd_tbl = achp->ahcic_cmd_tbl[slot];
1193 cmd_h = &achp->ahcic_cmdh[slot];
1208 AHCI_CMDH_SYNC(sc, achp, slot,
1231 struct ahci_channel *achp = (struct ahci_channel *)chp;
1242 ahci_intr_port(achp);
1311 struct ahci_channel *achp = (struct ahci_channel *)chp;
1335 AHCI_RFIS_SYNC(sc, achp, BUS_DMASYNC_POSTREAD);
1336 satafis_rdh_cmd_readreg(ata_c, achp->ahcic_rfis->rfis_rfis);
1353 struct ahci_channel *achp = (struct ahci_channel *)chp;
1362 bus_dmamap_t map = achp->ahcic_datad[xfer->c_slot];
1369 AHCI_CMDH_SYNC(sc, achp, xfer->c_slot,
1381 if (achp->ahcic_cmdh[xfer->c_slot].cmdh_prdbc)
1426 struct ahci_channel *achp = (struct ahci_channel *)chp;
1436 cmd_tbl = achp->ahcic_cmd_tbl[xfer->c_slot];
1443 cmd_h = &achp->ahcic_cmdh[xfer->c_slot];
1456 AHCI_CMDH_SYNC(sc, achp, xfer->c_slot,
1481 struct ahci_channel *achp = (struct ahci_channel *)chp;
1489 ahci_intr_port(achp);
1557 struct ahci_channel *achp = (struct ahci_channel *)chp;
1570 bus_dmamap_sync(sc->sc_dmat, achp->ahcic_datad[xfer->c_slot], 0,
1571 achp->ahcic_datad[xfer->c_slot]->dm_mapsize,
1574 bus_dmamap_unload(sc->sc_dmat, achp->ahcic_datad[xfer->c_slot]);
1585 AHCI_CMDH_SYNC(sc, achp, xfer->c_slot,
1603 le32toh(achp->ahcic_cmdh[xfer->c_slot].cmdh_prdbc);
1761 struct ahci_channel *achp = (struct ahci_channel *)chp;
1765 cmd_h = &achp->ahcic_cmdh[slot];
1766 cmd_tbl = achp->ahcic_cmd_tbl[slot];
1773 error = bus_dmamap_load(sc->sc_dmat, achp->ahcic_datad[slot],
1781 bus_dmamap_sync(sc->sc_dmat, achp->ahcic_datad[slot], 0,
1782 achp->ahcic_datad[slot]->dm_mapsize,
1784 for (seg = 0; seg < achp->ahcic_datad[slot]->dm_nsegs; seg++) {
1786 achp->ahcic_datad[slot]->dm_segs[seg].ds_addr);
1788 achp->ahcic_datad[slot]->dm_segs[seg].ds_len - 1);
1791 cmd_h->cmdh_prdtl = htole16(achp->ahcic_datad[slot]->dm_nsegs);
1793 AHCI_CMDTBL_SYNC(sc, achp, slot, BUS_DMASYNC_PREWRITE);
1921 struct ahci_channel *achp = (struct ahci_channel *)chp;
1931 cmd_tbl = achp->ahcic_cmd_tbl[xfer->c_slot];
1940 cmd_h = &achp->ahcic_cmdh[xfer->c_slot];
1956 AHCI_CMDH_SYNC(sc, achp, xfer->c_slot,
1979 struct ahci_channel *achp = (struct ahci_channel *)chp;
1987 ahci_intr_port(achp);
2018 struct ahci_channel *achp = (struct ahci_channel *)chp;
2032 bus_dmamap_sync(sc->sc_dmat, achp->ahcic_datad[xfer->c_slot], 0,
2033 achp->ahcic_datad[xfer->c_slot]->dm_mapsize,
2036 bus_dmamap_unload(sc->sc_dmat, achp->ahcic_datad[xfer->c_slot]);
2039 AHCI_CMDH_SYNC(sc, achp, xfer->c_slot,
2042 sc_xfer->resid -= le32toh(achp->ahcic_cmdh[xfer->c_slot].cmdh_prdbc);