Lines Matching refs:qc
193 struct ata_queued_cmd *qc; member
205 static enum ata_completion_errors pdc20621_qc_prep(struct ata_queued_cmd *qc);
221 static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc);
224 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc);
225 static int pdc_check_atapi_dma(struct ata_queued_cmd *qc);
437 static void pdc20621_dma_prep(struct ata_queued_cmd *qc) in pdc20621_dma_prep() argument
440 struct ata_port *ap = qc->ap; in pdc20621_dma_prep()
448 WARN_ON(!(qc->flags & ATA_QCFLAG_DMAMAP)); in pdc20621_dma_prep()
459 for_each_sg(qc->sg, sg, qc->n_elem, si) { in pdc20621_dma_prep()
471 pdc20621_host_pkt(&qc->tf, &pp->dimm_buf[0], portno); in pdc20621_dma_prep()
474 i = pdc20621_ata_pkt(&qc->tf, qc->dev->devno, &pp->dimm_buf[0], portno); in pdc20621_dma_prep()
476 if (qc->tf.flags & ATA_TFLAG_LBA48) in pdc20621_dma_prep()
477 i = pdc_prep_lba48(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_dma_prep()
479 i = pdc_prep_lba28(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_dma_prep()
481 pdc_pkt_footer(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_dma_prep()
498 static void pdc20621_nodata_prep(struct ata_queued_cmd *qc) in pdc20621_nodata_prep() argument
500 struct ata_port *ap = qc->ap; in pdc20621_nodata_prep()
512 i = pdc20621_ata_pkt(&qc->tf, qc->dev->devno, &pp->dimm_buf[0], portno); in pdc20621_nodata_prep()
514 if (qc->tf.flags & ATA_TFLAG_LBA48) in pdc20621_nodata_prep()
515 i = pdc_prep_lba48(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_nodata_prep()
517 i = pdc_prep_lba28(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_nodata_prep()
519 pdc_pkt_footer(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_nodata_prep()
533 static enum ata_completion_errors pdc20621_qc_prep(struct ata_queued_cmd *qc) in pdc20621_qc_prep() argument
535 switch (qc->tf.protocol) { in pdc20621_qc_prep()
537 pdc20621_dma_prep(qc); in pdc20621_qc_prep()
540 pdc20621_nodata_prep(qc); in pdc20621_qc_prep()
549 static void __pdc20621_push_hdma(struct ata_queued_cmd *qc, in __pdc20621_push_hdma() argument
553 struct ata_port *ap = qc->ap; in __pdc20621_push_hdma()
567 static void pdc20621_push_hdma(struct ata_queued_cmd *qc, in pdc20621_push_hdma() argument
571 struct ata_port *ap = qc->ap; in pdc20621_push_hdma()
576 __pdc20621_push_hdma(qc, seq, pkt_ofs); in pdc20621_push_hdma()
581 pp->hdma[idx].qc = qc; in pdc20621_push_hdma()
587 static void pdc20621_pop_hdma(struct ata_queued_cmd *qc) in pdc20621_pop_hdma() argument
589 struct ata_port *ap = qc->ap; in pdc20621_pop_hdma()
599 __pdc20621_push_hdma(pp->hdma[idx].qc, pp->hdma[idx].seq, in pdc20621_pop_hdma()
605 static void pdc20621_dump_hdma(struct ata_queued_cmd *qc) in pdc20621_dump_hdma() argument
607 struct ata_port *ap = qc->ap; in pdc20621_dump_hdma()
620 static inline void pdc20621_dump_hdma(struct ata_queued_cmd *qc) { } in pdc20621_dump_hdma() argument
623 static void pdc20621_packet_start(struct ata_queued_cmd *qc) in pdc20621_packet_start() argument
625 struct ata_port *ap = qc->ap; in pdc20621_packet_start()
629 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); in pdc20621_packet_start()
643 if (rw && qc->tf.protocol == ATA_PROT_DMA) { in pdc20621_packet_start()
646 pdc20621_dump_hdma(qc); in pdc20621_packet_start()
647 pdc20621_push_hdma(qc, seq, port_ofs + PDC_DIMM_HOST_PKT); in pdc20621_packet_start()
666 static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc) in pdc20621_qc_issue() argument
668 switch (qc->tf.protocol) { in pdc20621_qc_issue()
670 if (qc->tf.flags & ATA_TFLAG_POLLING) in pdc20621_qc_issue()
674 pdc20621_packet_start(qc); in pdc20621_qc_issue()
685 return ata_sff_qc_issue(qc); in pdc20621_qc_issue()
689 struct ata_queued_cmd *qc, in pdc20621_host_intr() argument
701 if ((qc->tf.protocol == ATA_PROT_DMA) && /* read */ in pdc20621_host_intr()
702 (!(qc->tf.flags & ATA_TFLAG_WRITE))) { in pdc20621_host_intr()
709 qc->err_mask |= ac_err_mask(ata_wait_idle(ap)); in pdc20621_host_intr()
710 ata_qc_complete(qc); in pdc20621_host_intr()
711 pdc20621_pop_hdma(qc); in pdc20621_host_intr()
721 pdc20621_dump_hdma(qc); in pdc20621_host_intr()
722 pdc20621_push_hdma(qc, seq, in pdc20621_host_intr()
727 } else if (qc->tf.protocol == ATA_PROT_DMA) { /* write */ in pdc20621_host_intr()
748 qc->err_mask |= ac_err_mask(ata_wait_idle(ap)); in pdc20621_host_intr()
749 ata_qc_complete(qc); in pdc20621_host_intr()
750 pdc20621_pop_hdma(qc); in pdc20621_host_intr()
755 } else if (qc->tf.protocol == ATA_PROT_NODATA) { in pdc20621_host_intr()
759 qc->err_mask |= ac_err_mask(status); in pdc20621_host_intr()
760 ata_qc_complete(qc); in pdc20621_host_intr()
821 struct ata_queued_cmd *qc; in pdc20621_interrupt() local
823 qc = ata_qc_from_tag(ap, ap->link.active_tag); in pdc20621_interrupt()
824 if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) in pdc20621_interrupt()
825 handled += pdc20621_host_intr(ap, qc, (i > 4), in pdc20621_interrupt()
909 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc) in pdc_post_internal_cmd() argument
911 struct ata_port *ap = qc->ap; in pdc_post_internal_cmd()
914 if (qc->flags & ATA_QCFLAG_FAILED) in pdc_post_internal_cmd()
918 static int pdc_check_atapi_dma(struct ata_queued_cmd *qc) in pdc_check_atapi_dma() argument
920 u8 *scsicmd = qc->scsicmd->cmnd; in pdc_check_atapi_dma()