Lines Matching refs:qc
602 static int mv_qc_defer(struct ata_queued_cmd *qc);
603 static void mv_qc_prep(struct ata_queued_cmd *qc);
604 static void mv_qc_prep_iie(struct ata_queued_cmd *qc);
605 static unsigned int mv_qc_issue(struct ata_queued_cmd *qc);
658 static int mv_check_atapi_dma(struct ata_queued_cmd *qc);
659 static void mv_bmdma_setup(struct ata_queued_cmd *qc);
660 static void mv_bmdma_start(struct ata_queued_cmd *qc);
661 static void mv_bmdma_stop(struct ata_queued_cmd *qc);
1423 static int mv_qc_defer(struct ata_queued_cmd *qc) in mv_qc_defer() argument
1425 struct ata_link *link = qc->dev->link; in mv_qc_defer()
1448 qc->flags |= ATA_QCFLAG_CLEAR_EXCL; in mv_qc_defer()
1468 if (ata_is_ncq(qc->tf.protocol)) in mv_qc_defer()
1788 static void mv_fill_sg(struct ata_queued_cmd *qc) in mv_fill_sg() argument
1790 struct mv_port_priv *pp = qc->ap->private_data; in mv_fill_sg()
1795 mv_sg = pp->sg_tbl[qc->tag]; in mv_fill_sg()
1796 for_each_sg(qc->sg, sg, qc->n_elem, si) { in mv_fill_sg()
1856 static int mv_check_atapi_dma(struct ata_queued_cmd *qc) in mv_check_atapi_dma() argument
1858 struct scsi_cmnd *scmd = qc->scsicmd; in mv_check_atapi_dma()
1884 static void mv_bmdma_setup(struct ata_queued_cmd *qc) in mv_bmdma_setup() argument
1886 struct ata_port *ap = qc->ap; in mv_bmdma_setup()
1890 mv_fill_sg(qc); in mv_bmdma_setup()
1896 writel((pp->sg_tbl_dma[qc->tag] >> 16) >> 16, in mv_bmdma_setup()
1898 writelfl(pp->sg_tbl_dma[qc->tag], in mv_bmdma_setup()
1902 ap->ops->sff_exec_command(ap, &qc->tf); in mv_bmdma_setup()
1912 static void mv_bmdma_start(struct ata_queued_cmd *qc) in mv_bmdma_start() argument
1914 struct ata_port *ap = qc->ap; in mv_bmdma_start()
1916 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); in mv_bmdma_start()
1948 static void mv_bmdma_stop(struct ata_queued_cmd *qc) in mv_bmdma_stop() argument
1950 mv_bmdma_stop_ap(qc->ap); in mv_bmdma_stop()
1992 static void mv_rw_multi_errata_sata24(struct ata_queued_cmd *qc) in mv_rw_multi_errata_sata24() argument
1994 struct ata_taskfile *tf = &qc->tf; in mv_rw_multi_errata_sata24()
2009 if (qc->dev->multi_count > 7) { in mv_rw_multi_errata_sata24()
2037 static void mv_qc_prep(struct ata_queued_cmd *qc) in mv_qc_prep() argument
2039 struct ata_port *ap = qc->ap; in mv_qc_prep()
2042 struct ata_taskfile *tf = &qc->tf; in mv_qc_prep()
2054 mv_rw_multi_errata_sata24(qc); in mv_qc_prep()
2064 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); in mv_qc_prep()
2065 flags |= qc->tag << CRQB_TAG_SHIFT; in mv_qc_prep()
2066 flags |= (qc->dev->link->pmp & 0xf) << CRQB_PMP_SHIFT; in mv_qc_prep()
2072 cpu_to_le32(pp->sg_tbl_dma[qc->tag] & 0xffffffff); in mv_qc_prep()
2074 cpu_to_le32((pp->sg_tbl_dma[qc->tag] >> 16) >> 16); in mv_qc_prep()
2121 if (!(qc->flags & ATA_QCFLAG_DMAMAP)) in mv_qc_prep()
2123 mv_fill_sg(qc); in mv_qc_prep()
2138 static void mv_qc_prep_iie(struct ata_queued_cmd *qc) in mv_qc_prep_iie() argument
2140 struct ata_port *ap = qc->ap; in mv_qc_prep_iie()
2143 struct ata_taskfile *tf = &qc->tf; in mv_qc_prep_iie()
2157 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); in mv_qc_prep_iie()
2158 flags |= qc->tag << CRQB_TAG_SHIFT; in mv_qc_prep_iie()
2159 flags |= qc->tag << CRQB_HOSTQ_SHIFT; in mv_qc_prep_iie()
2160 flags |= (qc->dev->link->pmp & 0xf) << CRQB_PMP_SHIFT; in mv_qc_prep_iie()
2166 crqb->addr = cpu_to_le32(pp->sg_tbl_dma[qc->tag] & 0xffffffff); in mv_qc_prep_iie()
2167 crqb->addr_hi = cpu_to_le32((pp->sg_tbl_dma[qc->tag] >> 16) >> 16); in mv_qc_prep_iie()
2191 if (!(qc->flags & ATA_QCFLAG_DMAMAP)) in mv_qc_prep_iie()
2193 mv_fill_sg(qc); in mv_qc_prep_iie()
2284 static unsigned int mv_qc_issue_fis(struct ata_queued_cmd *qc) in mv_qc_issue_fis() argument
2286 struct ata_port *ap = qc->ap; in mv_qc_issue_fis()
2288 struct ata_link *link = qc->dev->link; in mv_qc_issue_fis()
2292 ata_tf_to_fis(&qc->tf, link->pmp, 1, (void *)fis); in mv_qc_issue_fis()
2297 switch (qc->tf.protocol) { in mv_qc_issue_fis()
2306 if (qc->tf.flags & ATA_TFLAG_WRITE) in mv_qc_issue_fis()
2316 if (qc->tf.flags & ATA_TFLAG_POLLING) in mv_qc_issue_fis()
2333 static unsigned int mv_qc_issue(struct ata_queued_cmd *qc) in mv_qc_issue() argument
2336 struct ata_port *ap = qc->ap; in mv_qc_issue()
2344 switch (qc->tf.protocol) { in mv_qc_issue()
2346 if (qc->tf.command == ATA_CMD_DSM) { in mv_qc_issue()
2353 mv_start_edma(ap, port_mmio, pp, qc->tf.protocol); in mv_qc_issue()
2374 if (limit_warnings > 0 && (qc->nbytes / qc->sect_size) > 1) { in mv_qc_issue()
2376 ata_link_warn(qc->dev->link, DRV_NAME in mv_qc_issue()
2385 qc->tf.flags |= ATA_TFLAG_POLLING; in mv_qc_issue()
2389 if (qc->tf.flags & ATA_TFLAG_POLLING) in mv_qc_issue()
2401 mv_pmp_select(ap, qc->dev->link->pmp); in mv_qc_issue()
2403 if (qc->tf.command == ATA_CMD_READ_LOG_EXT) { in mv_qc_issue()
2417 return mv_qc_issue_fis(qc); in mv_qc_issue()
2419 return ata_bmdma_qc_issue(qc); in mv_qc_issue()
2425 struct ata_queued_cmd *qc; in mv_get_active_qc() local
2429 qc = ata_qc_from_tag(ap, ap->link.active_tag); in mv_get_active_qc()
2430 if (qc && !(qc->tf.flags & ATA_TFLAG_POLLING)) in mv_get_active_qc()
2431 return qc; in mv_get_active_qc()
2618 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag); in mv_unexpected_intr() local
2619 if (qc && (qc->tf.flags & ATA_TFLAG_POLLING)) in mv_unexpected_intr()
2648 struct ata_queued_cmd *qc; in mv_err_intr() local
2675 qc = mv_get_active_qc(ap); in mv_err_intr()
2744 if (qc) in mv_err_intr()
2745 qc->err_mask |= err_mask; in mv_err_intr()
2767 if (qc) in mv_err_intr()
2768 ata_link_abort(qc->dev->link); in mv_err_intr()
2870 struct ata_queued_cmd *qc = mv_get_active_qc(ap); in mv_port_intr() local
2871 if (qc) in mv_port_intr()
2872 ata_bmdma_port_intr(ap, qc); in mv_port_intr()
2955 struct ata_queued_cmd *qc; in mv_pci_error() local
2979 qc = ata_qc_from_tag(ap, ap->link.active_tag); in mv_pci_error()
2980 if (qc) in mv_pci_error()
2981 qc->err_mask |= err_mask; in mv_pci_error()