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);
1490 static unsigned int ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) in ahci_fill_sg() argument
1501 for_each_sg(qc->sg, sg, qc->n_elem, si) { in ahci_fill_sg()
1513 static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc) in ahci_pmp_qc_defer() argument
1515 struct ata_port *ap = qc->ap; in ahci_pmp_qc_defer()
1519 return ata_std_qc_defer(qc); in ahci_pmp_qc_defer()
1521 return sata_pmp_qc_defer_cmd_switch(qc); in ahci_pmp_qc_defer()
1524 static void ahci_qc_prep(struct ata_queued_cmd *qc) in ahci_qc_prep() argument
1526 struct ata_port *ap = qc->ap; in ahci_qc_prep()
1528 int is_atapi = ata_is_atapi(qc->tf.protocol); in ahci_qc_prep()
1538 cmd_tbl = pp->cmd_tbl + qc->tag * AHCI_CMD_TBL_SZ; in ahci_qc_prep()
1540 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, cmd_tbl); in ahci_qc_prep()
1543 memcpy(cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, qc->dev->cdb_len); in ahci_qc_prep()
1547 if (qc->flags & ATA_QCFLAG_DMAMAP) in ahci_qc_prep()
1548 n_elem = ahci_fill_sg(qc, cmd_tbl); in ahci_qc_prep()
1553 opts = cmd_fis_len | n_elem << 16 | (qc->dev->link->pmp << 12); in ahci_qc_prep()
1554 if (qc->tf.flags & ATA_TFLAG_WRITE) in ahci_qc_prep()
1559 ahci_fill_cmd_slot(pp, qc->tag, opts); in ahci_qc_prep()
1889 unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) in ahci_qc_issue() argument
1891 struct ata_port *ap = qc->ap; in ahci_qc_issue()
1899 pp->active_link = qc->dev->link; in ahci_qc_issue()
1901 if (qc->tf.protocol == ATA_PROT_NCQ) in ahci_qc_issue()
1902 writel(1 << qc->tag, port_mmio + PORT_SCR_ACT); in ahci_qc_issue()
1904 if (pp->fbs_enabled && pp->fbs_last_dev != qc->dev->link->pmp) { in ahci_qc_issue()
1907 fbs |= qc->dev->link->pmp << PORT_FBS_DEV_OFFSET; in ahci_qc_issue()
1909 pp->fbs_last_dev = qc->dev->link->pmp; in ahci_qc_issue()
1912 writel(1 << qc->tag, port_mmio + PORT_CMD_ISSUE); in ahci_qc_issue()
1914 ahci_sw_activity(qc->dev->link); in ahci_qc_issue()
1920 static bool ahci_qc_fill_rtf(struct ata_queued_cmd *qc) in ahci_qc_fill_rtf() argument
1922 struct ahci_port_priv *pp = qc->ap->private_data; in ahci_qc_fill_rtf()
1926 rx_fis += qc->dev->link->pmp * AHCI_RX_FIS_SZ; in ahci_qc_fill_rtf()
1934 if (qc->tf.protocol == ATA_PROT_PIO && qc->dma_dir == DMA_FROM_DEVICE && in ahci_qc_fill_rtf()
1935 !(qc->flags & ATA_QCFLAG_FAILED)) { in ahci_qc_fill_rtf()
1936 ata_tf_from_fis(rx_fis + RX_FIS_PIO_SETUP, &qc->result_tf); in ahci_qc_fill_rtf()
1937 qc->result_tf.command = (rx_fis + RX_FIS_PIO_SETUP)[15]; in ahci_qc_fill_rtf()
1939 ata_tf_from_fis(rx_fis + RX_FIS_D2H_REG, &qc->result_tf); in ahci_qc_fill_rtf()
1986 static void ahci_post_internal_cmd(struct ata_queued_cmd *qc) in ahci_post_internal_cmd() argument
1988 struct ata_port *ap = qc->ap; in ahci_post_internal_cmd()
1991 if (qc->flags & ATA_QCFLAG_FAILED) in ahci_post_internal_cmd()