• Home
  • Raw
  • Download

Lines Matching refs:qc

299 static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc);
300 static enum ata_completion_errors nv_adma_qc_prep(struct ata_queued_cmd *qc);
301 static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc);
314 static void nv_adma_post_internal_cmd(struct ata_queued_cmd *qc);
322 static enum ata_completion_errors nv_swncq_qc_prep(struct ata_queued_cmd *qc);
323 static void nv_swncq_fill_sg(struct ata_queued_cmd *qc);
324 static unsigned int nv_swncq_qc_issue(struct ata_queued_cmd *qc);
754 static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc) in nv_adma_check_atapi_dma() argument
756 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_check_atapi_dma()
853 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag); in nv_host_intr() local
866 if (unlikely(!qc || (qc->tf.flags & ATA_TFLAG_POLLING))) { in nv_host_intr()
872 return ata_bmdma_port_intr(ap, qc); in nv_host_intr()
1084 static void nv_adma_post_internal_cmd(struct ata_queued_cmd *qc) in nv_adma_post_internal_cmd() argument
1086 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_post_internal_cmd()
1089 ata_bmdma_post_internal_cmd(qc); in nv_adma_post_internal_cmd()
1297 static void nv_adma_fill_aprd(struct ata_queued_cmd *qc, in nv_adma_fill_aprd() argument
1303 if (qc->tf.flags & ATA_TFLAG_WRITE) in nv_adma_fill_aprd()
1305 if (idx == qc->n_elem - 1) in nv_adma_fill_aprd()
1316 static void nv_adma_fill_sg(struct ata_queued_cmd *qc, struct nv_adma_cpb *cpb) in nv_adma_fill_sg() argument
1318 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_fill_sg()
1325 for_each_sg(qc->sg, sg, qc->n_elem, si) { in nv_adma_fill_sg()
1327 &pp->aprd[NV_ADMA_SGTBL_LEN * qc->hw_tag + (si-5)]; in nv_adma_fill_sg()
1328 nv_adma_fill_aprd(qc, sg, si, aprd); in nv_adma_fill_sg()
1331 cpb->next_aprd = cpu_to_le64(((u64)(pp->aprd_dma + NV_ADMA_SGTBL_SZ * qc->hw_tag))); in nv_adma_fill_sg()
1336 static int nv_adma_use_reg_mode(struct ata_queued_cmd *qc) in nv_adma_use_reg_mode() argument
1338 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_use_reg_mode()
1343 (qc->tf.flags & ATA_TFLAG_POLLING)) in nv_adma_use_reg_mode()
1346 if ((qc->flags & ATA_QCFLAG_DMAMAP) || in nv_adma_use_reg_mode()
1347 (qc->tf.protocol == ATA_PROT_NODATA)) in nv_adma_use_reg_mode()
1353 static enum ata_completion_errors nv_adma_qc_prep(struct ata_queued_cmd *qc) in nv_adma_qc_prep() argument
1355 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_qc_prep()
1356 struct nv_adma_cpb *cpb = &pp->cpb[qc->hw_tag]; in nv_adma_qc_prep()
1360 if (nv_adma_use_reg_mode(qc)) { in nv_adma_qc_prep()
1362 (qc->flags & ATA_QCFLAG_DMAMAP)); in nv_adma_qc_prep()
1363 nv_adma_register_mode(qc->ap); in nv_adma_qc_prep()
1364 ata_bmdma_qc_prep(qc); in nv_adma_qc_prep()
1374 cpb->tag = qc->hw_tag; in nv_adma_qc_prep()
1378 if (qc->tf.protocol == ATA_PROT_NCQ) in nv_adma_qc_prep()
1381 VPRINTK("qc->flags = 0x%lx\n", qc->flags); in nv_adma_qc_prep()
1383 nv_adma_tf_to_cpb(&qc->tf, cpb->tf); in nv_adma_qc_prep()
1385 if (qc->flags & ATA_QCFLAG_DMAMAP) { in nv_adma_qc_prep()
1386 nv_adma_fill_sg(qc, cpb); in nv_adma_qc_prep()
1401 static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc) in nv_adma_qc_issue() argument
1403 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_qc_issue()
1405 int curr_ncq = (qc->tf.protocol == ATA_PROT_NCQ); in nv_adma_qc_issue()
1412 if (unlikely(qc->tf.protocol == ATA_PROT_NCQ && in nv_adma_qc_issue()
1413 (qc->flags & ATA_QCFLAG_RESULT_TF))) { in nv_adma_qc_issue()
1414 ata_dev_err(qc->dev, "NCQ w/ RESULT_TF not allowed\n"); in nv_adma_qc_issue()
1418 if (nv_adma_use_reg_mode(qc)) { in nv_adma_qc_issue()
1420 VPRINTK("using ATA register mode: 0x%lx\n", qc->flags); in nv_adma_qc_issue()
1422 (qc->flags & ATA_QCFLAG_DMAMAP)); in nv_adma_qc_issue()
1423 nv_adma_register_mode(qc->ap); in nv_adma_qc_issue()
1424 return ata_bmdma_qc_issue(qc); in nv_adma_qc_issue()
1426 nv_adma_mode(qc->ap); in nv_adma_qc_issue()
1439 writew(qc->hw_tag, mmio + NV_ADMA_APPEND); in nv_adma_qc_issue()
1441 DPRINTK("Issued tag %u\n", qc->hw_tag); in nv_adma_qc_issue()
1457 struct ata_queued_cmd *qc; in nv_generic_interrupt() local
1459 qc = ata_qc_from_tag(ap, ap->link.active_tag); in nv_generic_interrupt()
1460 if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) { in nv_generic_interrupt()
1461 handled += ata_bmdma_port_intr(ap, qc); in nv_generic_interrupt()
1696 static void nv_swncq_qc_to_dq(struct ata_port *ap, struct ata_queued_cmd *qc) in nv_swncq_qc_to_dq() argument
1703 dq->defer_bits |= (1 << qc->hw_tag); in nv_swncq_qc_to_dq()
1704 dq->tag[dq->tail++ & (ATA_MAX_QUEUE - 1)] = qc->hw_tag; in nv_swncq_qc_to_dq()
1756 struct ata_queued_cmd qc; in __ata_bmdma_stop() local
1758 qc.ap = ap; in __ata_bmdma_stop()
1759 ata_bmdma_stop(&qc); in __ata_bmdma_stop()
1961 static enum ata_completion_errors nv_swncq_qc_prep(struct ata_queued_cmd *qc) in nv_swncq_qc_prep() argument
1963 if (qc->tf.protocol != ATA_PROT_NCQ) { in nv_swncq_qc_prep()
1964 ata_bmdma_qc_prep(qc); in nv_swncq_qc_prep()
1968 if (!(qc->flags & ATA_QCFLAG_DMAMAP)) in nv_swncq_qc_prep()
1971 nv_swncq_fill_sg(qc); in nv_swncq_qc_prep()
1976 static void nv_swncq_fill_sg(struct ata_queued_cmd *qc) in nv_swncq_fill_sg() argument
1978 struct ata_port *ap = qc->ap; in nv_swncq_fill_sg()
1984 prd = pp->prd + ATA_MAX_PRD * qc->hw_tag; in nv_swncq_fill_sg()
1987 for_each_sg(qc->sg, sg, qc->n_elem, si) { in nv_swncq_fill_sg()
2013 struct ata_queued_cmd *qc) in nv_swncq_issue_atacmd() argument
2017 if (qc == NULL) in nv_swncq_issue_atacmd()
2022 writel((1 << qc->hw_tag), pp->sactive_block); in nv_swncq_issue_atacmd()
2023 pp->last_issue_tag = qc->hw_tag; in nv_swncq_issue_atacmd()
2024 pp->dhfis_bits &= ~(1 << qc->hw_tag); in nv_swncq_issue_atacmd()
2025 pp->dmafis_bits &= ~(1 << qc->hw_tag); in nv_swncq_issue_atacmd()
2026 pp->qc_active |= (0x1 << qc->hw_tag); in nv_swncq_issue_atacmd()
2028 ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */ in nv_swncq_issue_atacmd()
2029 ap->ops->sff_exec_command(ap, &qc->tf); in nv_swncq_issue_atacmd()
2031 DPRINTK("Issued tag %u\n", qc->hw_tag); in nv_swncq_issue_atacmd()
2036 static unsigned int nv_swncq_qc_issue(struct ata_queued_cmd *qc) in nv_swncq_qc_issue() argument
2038 struct ata_port *ap = qc->ap; in nv_swncq_qc_issue()
2041 if (qc->tf.protocol != ATA_PROT_NCQ) in nv_swncq_qc_issue()
2042 return ata_bmdma_qc_issue(qc); in nv_swncq_qc_issue()
2047 nv_swncq_issue_atacmd(ap, qc); in nv_swncq_qc_issue()
2049 nv_swncq_qc_to_dq(ap, qc); /* add qc to defer queue */ in nv_swncq_qc_issue()
2081 struct ata_queued_cmd *qc; in nv_swncq_sdbfis() local
2137 qc = ata_qc_from_tag(ap, pp->last_issue_tag); in nv_swncq_sdbfis()
2138 nv_swncq_issue_atacmd(ap, qc); in nv_swncq_sdbfis()
2144 qc = nv_swncq_qc_from_dq(ap); in nv_swncq_sdbfis()
2145 WARN_ON(qc == NULL); in nv_swncq_sdbfis()
2146 nv_swncq_issue_atacmd(ap, qc); in nv_swncq_sdbfis()
2163 struct ata_queued_cmd *qc; in nv_swncq_dmafis() local
2173 qc = ata_qc_from_tag(ap, tag); in nv_swncq_dmafis()
2175 if (unlikely(!qc)) in nv_swncq_dmafis()
2178 rw = qc->tf.flags & ATA_TFLAG_WRITE; in nv_swncq_dmafis()
2181 iowrite32(pp->prd_dma + ATA_PRD_TBL_SZ * qc->hw_tag, in nv_swncq_dmafis()
2196 struct ata_queued_cmd *qc; in nv_swncq_host_interrupt() local
2269 qc = nv_swncq_qc_from_dq(ap); in nv_swncq_host_interrupt()
2270 nv_swncq_issue_atacmd(ap, qc); in nv_swncq_host_interrupt()