Lines Matching refs:qc
142 static enum ata_completion_errors pdc_qc_prep(struct ata_queued_cmd *qc);
145 static int pdc_check_atapi_dma(struct ata_queued_cmd *qc);
146 static int pdc_old_sata_check_atapi_dma(struct ata_queued_cmd *qc);
148 static unsigned int pdc_qc_issue(struct ata_queued_cmd *qc);
158 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc);
479 static void pdc_atapi_pkt(struct ata_queued_cmd *qc) in pdc_atapi_pkt() argument
481 struct ata_port *ap = qc->ap; in pdc_atapi_pkt()
483 unsigned int cdb_len = qc->dev->cdb_len; in pdc_atapi_pkt()
484 u8 *cdb = qc->cdb; in pdc_atapi_pkt()
493 switch (qc->tf.protocol) { in pdc_atapi_pkt()
495 if (!(qc->tf.flags & ATA_TFLAG_WRITE)) in pdc_atapi_pkt()
514 dev_sel = qc->tf.device; in pdc_atapi_pkt()
522 buf[17] = qc->tf.nsect; in pdc_atapi_pkt()
524 buf[19] = qc->tf.lbal; in pdc_atapi_pkt()
527 if (qc->tf.protocol != ATAPI_PROT_DMA) in pdc_atapi_pkt()
535 buf[23] = qc->tf.lbam; in pdc_atapi_pkt()
537 buf[25] = qc->tf.lbah; in pdc_atapi_pkt()
541 buf[27] = qc->tf.command; in pdc_atapi_pkt()
567 static void pdc_fill_sg(struct ata_queued_cmd *qc) in pdc_fill_sg() argument
569 struct ata_port *ap = qc->ap; in pdc_fill_sg()
576 if (!(qc->flags & ATA_QCFLAG_DMAMAP)) in pdc_fill_sg()
580 for_each_sg(qc->sg, sg, qc->n_elem, si) { in pdc_fill_sg()
630 static enum ata_completion_errors pdc_qc_prep(struct ata_queued_cmd *qc) in pdc_qc_prep() argument
632 struct pdc_port_priv *pp = qc->ap->private_data; in pdc_qc_prep()
637 switch (qc->tf.protocol) { in pdc_qc_prep()
639 pdc_fill_sg(qc); in pdc_qc_prep()
642 i = pdc_pkt_header(&qc->tf, qc->ap->bmdma_prd_dma, in pdc_qc_prep()
643 qc->dev->devno, pp->pkt); in pdc_qc_prep()
644 if (qc->tf.flags & ATA_TFLAG_LBA48) in pdc_qc_prep()
645 i = pdc_prep_lba48(&qc->tf, pp->pkt, i); in pdc_qc_prep()
647 i = pdc_prep_lba28(&qc->tf, pp->pkt, i); in pdc_qc_prep()
648 pdc_pkt_footer(&qc->tf, pp->pkt, i); in pdc_qc_prep()
651 pdc_fill_sg(qc); in pdc_qc_prep()
654 pdc_fill_sg(qc); in pdc_qc_prep()
657 pdc_atapi_pkt(qc); in pdc_qc_prep()
828 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc) in pdc_post_internal_cmd() argument
830 struct ata_port *ap = qc->ap; in pdc_post_internal_cmd()
833 if (qc->flags & ATA_QCFLAG_FAILED) in pdc_post_internal_cmd()
837 static void pdc_error_intr(struct ata_port *ap, struct ata_queued_cmd *qc, in pdc_error_intr() argument
864 qc->err_mask |= ac_err_mask; in pdc_error_intr()
872 struct ata_queued_cmd *qc) in pdc_host_intr() argument
885 pdc_error_intr(ap, qc, port_status, err_mask); in pdc_host_intr()
889 switch (qc->tf.protocol) { in pdc_host_intr()
894 qc->err_mask |= ac_err_mask(ata_wait_idle(ap)); in pdc_host_intr()
895 ata_qc_complete(qc); in pdc_host_intr()
984 struct ata_queued_cmd *qc; in pdc_interrupt() local
986 qc = ata_qc_from_tag(ap, ap->link.active_tag); in pdc_interrupt()
987 if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING))) in pdc_interrupt()
988 handled += pdc_host_intr(ap, qc); in pdc_interrupt()
999 static void pdc_packet_start(struct ata_queued_cmd *qc) in pdc_packet_start() argument
1001 struct ata_port *ap = qc->ap; in pdc_packet_start()
1019 static unsigned int pdc_qc_issue(struct ata_queued_cmd *qc) in pdc_qc_issue() argument
1021 switch (qc->tf.protocol) { in pdc_qc_issue()
1023 if (qc->dev->flags & ATA_DFLAG_CDB_INTR) in pdc_qc_issue()
1027 if (qc->tf.flags & ATA_TFLAG_POLLING) in pdc_qc_issue()
1032 pdc_packet_start(qc); in pdc_qc_issue()
1037 return ata_sff_qc_issue(qc); in pdc_qc_issue()
1053 static int pdc_check_atapi_dma(struct ata_queued_cmd *qc) in pdc_check_atapi_dma() argument
1055 u8 *scsicmd = qc->scsicmd->cmnd; in pdc_check_atapi_dma()
1083 static int pdc_old_sata_check_atapi_dma(struct ata_queued_cmd *qc) in pdc_old_sata_check_atapi_dma() argument