Lines Matching refs:qc
209 struct ata_queued_cmd *qc; member
221 static void pdc20621_qc_prep(struct ata_queued_cmd *qc);
237 static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc);
240 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc);
241 static int pdc_check_atapi_dma(struct ata_queued_cmd *qc);
453 static void pdc20621_dma_prep(struct ata_queued_cmd *qc) in pdc20621_dma_prep() argument
456 struct ata_port *ap = qc->ap; in pdc20621_dma_prep()
464 WARN_ON(!(qc->flags & ATA_QCFLAG_DMAMAP)); in pdc20621_dma_prep()
475 for_each_sg(qc->sg, sg, qc->n_elem, si) { in pdc20621_dma_prep()
487 pdc20621_host_pkt(&qc->tf, &pp->dimm_buf[0], portno); in pdc20621_dma_prep()
490 i = pdc20621_ata_pkt(&qc->tf, qc->dev->devno, &pp->dimm_buf[0], portno); in pdc20621_dma_prep()
492 if (qc->tf.flags & ATA_TFLAG_LBA48) in pdc20621_dma_prep()
493 i = pdc_prep_lba48(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_dma_prep()
495 i = pdc_prep_lba28(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_dma_prep()
497 pdc_pkt_footer(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_dma_prep()
514 static void pdc20621_nodata_prep(struct ata_queued_cmd *qc) in pdc20621_nodata_prep() argument
516 struct ata_port *ap = qc->ap; in pdc20621_nodata_prep()
528 i = pdc20621_ata_pkt(&qc->tf, qc->dev->devno, &pp->dimm_buf[0], portno); in pdc20621_nodata_prep()
530 if (qc->tf.flags & ATA_TFLAG_LBA48) in pdc20621_nodata_prep()
531 i = pdc_prep_lba48(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_nodata_prep()
533 i = pdc_prep_lba28(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_nodata_prep()
535 pdc_pkt_footer(&qc->tf, &pp->dimm_buf[0], i); in pdc20621_nodata_prep()
549 static void pdc20621_qc_prep(struct ata_queued_cmd *qc) in pdc20621_qc_prep() argument
551 switch (qc->tf.protocol) { in pdc20621_qc_prep()
553 pdc20621_dma_prep(qc); in pdc20621_qc_prep()
556 pdc20621_nodata_prep(qc); in pdc20621_qc_prep()
563 static void __pdc20621_push_hdma(struct ata_queued_cmd *qc, in __pdc20621_push_hdma() argument
567 struct ata_port *ap = qc->ap; in __pdc20621_push_hdma()
581 static void pdc20621_push_hdma(struct ata_queued_cmd *qc, in pdc20621_push_hdma() argument
585 struct ata_port *ap = qc->ap; in pdc20621_push_hdma()
590 __pdc20621_push_hdma(qc, seq, pkt_ofs); in pdc20621_push_hdma()
595 pp->hdma[idx].qc = qc; in pdc20621_push_hdma()
601 static void pdc20621_pop_hdma(struct ata_queued_cmd *qc) in pdc20621_pop_hdma() argument
603 struct ata_port *ap = qc->ap; in pdc20621_pop_hdma()
613 __pdc20621_push_hdma(pp->hdma[idx].qc, pp->hdma[idx].seq, in pdc20621_pop_hdma()
619 static void pdc20621_dump_hdma(struct ata_queued_cmd *qc) in pdc20621_dump_hdma() argument
621 struct ata_port *ap = qc->ap; in pdc20621_dump_hdma()
634 static inline void pdc20621_dump_hdma(struct ata_queued_cmd *qc) { } in pdc20621_dump_hdma() argument
637 static void pdc20621_packet_start(struct ata_queued_cmd *qc) in pdc20621_packet_start() argument
639 struct ata_port *ap = qc->ap; in pdc20621_packet_start()
643 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); in pdc20621_packet_start()
657 if (rw && qc->tf.protocol == ATA_PROT_DMA) { in pdc20621_packet_start()
660 pdc20621_dump_hdma(qc); in pdc20621_packet_start()
661 pdc20621_push_hdma(qc, seq, port_ofs + PDC_DIMM_HOST_PKT); in pdc20621_packet_start()
680 static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc) in pdc20621_qc_issue() argument
682 switch (qc->tf.protocol) { in pdc20621_qc_issue()
684 if (qc->tf.flags & ATA_TFLAG_POLLING) in pdc20621_qc_issue()
688 pdc20621_packet_start(qc); in pdc20621_qc_issue()
699 return ata_sff_qc_issue(qc); in pdc20621_qc_issue()
703 struct ata_queued_cmd *qc, in pdc20621_host_intr() argument
715 if ((qc->tf.protocol == ATA_PROT_DMA) && /* read */ in pdc20621_host_intr()
716 (!(qc->tf.flags & ATA_TFLAG_WRITE))) { in pdc20621_host_intr()
723 qc->err_mask |= ac_err_mask(ata_wait_idle(ap)); in pdc20621_host_intr()
724 ata_qc_complete(qc); in pdc20621_host_intr()
725 pdc20621_pop_hdma(qc); in pdc20621_host_intr()
735 pdc20621_dump_hdma(qc); in pdc20621_host_intr()
736 pdc20621_push_hdma(qc, seq, in pdc20621_host_intr()
741 } else if (qc->tf.protocol == ATA_PROT_DMA) { /* write */ in pdc20621_host_intr()
762 qc->err_mask |= ac_err_mask(ata_wait_idle(ap)); in pdc20621_host_intr()
763 ata_qc_complete(qc); in pdc20621_host_intr()
764 pdc20621_pop_hdma(qc); in pdc20621_host_intr()
769 } else if (qc->tf.protocol == ATA_PROT_NODATA) { in pdc20621_host_intr()
773 qc->err_mask |= ac_err_mask(status); in pdc20621_host_intr()
774 ata_qc_complete(qc); in pdc20621_host_intr()
835 struct ata_queued_cmd *qc; in pdc20621_interrupt() local
837 qc = ata_qc_from_tag(ap, ap->link.active_tag); in pdc20621_interrupt()
838 if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) in pdc20621_interrupt()
839 handled += pdc20621_host_intr(ap, qc, (i > 4), in pdc20621_interrupt()
923 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc) in pdc_post_internal_cmd() argument
925 struct ata_port *ap = qc->ap; in pdc_post_internal_cmd()
928 if (qc->flags & ATA_QCFLAG_FAILED) in pdc_post_internal_cmd()
932 static int pdc_check_atapi_dma(struct ata_queued_cmd *qc) in pdc_check_atapi_dma() argument
934 u8 *scsicmd = qc->scsicmd->cmnd; in pdc_check_atapi_dma()