Lines Matching refs:qc
71 static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc);
74 static void ahci_qc_prep(struct ata_queued_cmd *qc);
75 static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc);
90 static void ahci_post_internal_cmd(struct ata_queued_cmd *qc);
1505 static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) in ahci_fill_sg() argument
1516 for_each_sg(qc->sg, sg, qc->n_elem, si) { in ahci_fill_sg()
1528 static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc) in ahci_pmp_qc_defer() argument
1530 struct ata_port *ap = qc->ap; in ahci_pmp_qc_defer()
1534 return ata_std_qc_defer(qc); in ahci_pmp_qc_defer()
1536 return sata_pmp_qc_defer_cmd_switch(qc); in ahci_pmp_qc_defer()
1539 static void ahci_qc_prep(struct ata_queued_cmd *qc) in ahci_qc_prep() argument
1541 struct ata_port *ap = qc->ap; in ahci_qc_prep()
1543 int is_atapi = ata_is_atapi(qc->tf.protocol); in ahci_qc_prep()
1553 cmd_tbl = pp->cmd_tbl + qc->tag * AHCI_CMD_TBL_SZ; in ahci_qc_prep()
1555 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, cmd_tbl); in ahci_qc_prep()
1558 memcpy(cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, qc->dev->cdb_len); in ahci_qc_prep()
1562 if (qc->flags & ATA_QCFLAG_DMAMAP) in ahci_qc_prep()
1563 n_elem = ahci_fill_sg(qc, cmd_tbl); in ahci_qc_prep()
1568 opts = cmd_fis_len | n_elem << 16 | (qc->dev->link->pmp << 12); in ahci_qc_prep()
1569 if (qc->tf.flags & ATA_TFLAG_WRITE) in ahci_qc_prep()
1574 ahci_fill_cmd_slot(pp, qc->tag, opts); in ahci_qc_prep()
1950 unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) in ahci_qc_issue() argument
1952 struct ata_port *ap = qc->ap; in ahci_qc_issue()
1960 pp->active_link = qc->dev->link; in ahci_qc_issue()
1962 if (qc->tf.protocol == ATA_PROT_NCQ) in ahci_qc_issue()
1963 writel(1 << qc->tag, port_mmio + PORT_SCR_ACT); in ahci_qc_issue()
1965 if (pp->fbs_enabled && pp->fbs_last_dev != qc->dev->link->pmp) { in ahci_qc_issue()
1968 fbs |= qc->dev->link->pmp << PORT_FBS_DEV_OFFSET; in ahci_qc_issue()
1970 pp->fbs_last_dev = qc->dev->link->pmp; in ahci_qc_issue()
1973 writel(1 << qc->tag, port_mmio + PORT_CMD_ISSUE); in ahci_qc_issue()
1975 ahci_sw_activity(qc->dev->link); in ahci_qc_issue()
1981 static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) in ahci_qc_fill_rtf() argument
1983 struct ahci_port_priv *pp = qc->ap->private_data; in ahci_qc_fill_rtf()
1987 rx_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ; in ahci_qc_fill_rtf()
1995 if (qc->tf.protocol == ATA_PROT_PIO && qc->dma_dir == DMA_FROM_DEVICE && in ahci_qc_fill_rtf()
1996 !(qc->flags & ATA_QCFLAG_FAILED)) { in ahci_qc_fill_rtf()
1997 ata_tf_from_fis(rx_fis + RX_FIS_PIO_SETUP, &qc->result_tf); in ahci_qc_fill_rtf()
1998 qc->result_tf.command = (rx_fis + RX_FIS_PIO_SETUP)[15]; in ahci_qc_fill_rtf()
2000 ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf); in ahci_qc_fill_rtf()
2047 static void ahci_post_internal_cmd(struct ata_queued_cmd *qc) in ahci_post_internal_cmd() argument
2049 struct ata_port *ap = qc->ap; in ahci_post_internal_cmd()
2052 if (qc->flags & ATA_QCFLAG_FAILED) in ahci_post_internal_cmd()