Lines Matching refs:qc

167 #define HSDEV_FROM_QC(qc)	((struct sata_dwc_device *)(qc)->ap->host->private_data)  argument
184 static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag);
185 static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc,
363 static struct dma_async_tx_descriptor *dma_dwc_xfer_setup(struct ata_queued_cmd *qc) in dma_dwc_xfer_setup() argument
365 struct ata_port *ap = qc->ap; in dma_dwc_xfer_setup()
371 if (qc->dma_dir == DMA_DEV_TO_MEM) { in dma_dwc_xfer_setup()
379 sconf.direction = qc->dma_dir; in dma_dwc_xfer_setup()
388 desc = dmaengine_prep_slave_sg(hsdevp->chan, qc->sg, qc->n_elem, in dma_dwc_xfer_setup()
389 qc->dma_dir, in dma_dwc_xfer_setup()
399 qc->sg, qc->n_elem, &hsdev->dmadr); in dma_dwc_xfer_setup()
458 struct ata_queued_cmd *qc; in sata_dwc_error_intr() local
487 qc = ata_qc_from_tag(ap, tag); in sata_dwc_error_intr()
488 if (qc) in sata_dwc_error_intr()
489 qc->err_mask |= err_mask; in sata_dwc_error_intr()
508 struct ata_queued_cmd *qc; in sata_dwc_isr() local
545 qc = ata_qc_from_tag(ap, tag); in sata_dwc_isr()
546 if (unlikely(!qc)) { in sata_dwc_isr()
556 qc->ap->link.active_tag = tag; in sata_dwc_isr()
557 sata_dwc_bmdma_start_by_tag(qc, tag); in sata_dwc_isr()
571 qc = ata_qc_from_tag(ap, tag); in sata_dwc_isr()
574 if (unlikely(!qc || (qc->tf.flags & ATA_TFLAG_POLLING))) { in sata_dwc_isr()
577 __func__, qc); in sata_dwc_isr()
584 qc->ap->link.active_tag = tag; in sata_dwc_isr()
589 sata_dwc_qc_complete(ap, qc, 1); in sata_dwc_isr()
595 __func__, get_prot_descript(qc->tf.protocol)); in sata_dwc_isr()
597 if (ata_is_dma(qc->tf.protocol)) { in sata_dwc_isr()
615 } else if (ata_is_pio(qc->tf.protocol)) { in sata_dwc_isr()
616 ata_sff_hsm_move(ap, qc, status, 0); in sata_dwc_isr()
620 if (unlikely(sata_dwc_qc_complete(ap, qc, 1))) in sata_dwc_isr()
665 qc = ata_qc_from_tag(ap, tag); in sata_dwc_isr()
666 if (unlikely(!qc)) { in sata_dwc_isr()
673 qc->ap->link.active_tag = tag; in sata_dwc_isr()
680 sata_dwc_qc_complete(ap, qc, 1); in sata_dwc_isr()
687 get_prot_descript(qc->tf.protocol)); in sata_dwc_isr()
688 if (ata_is_dma(qc->tf.protocol)) { in sata_dwc_isr()
697 if (unlikely(sata_dwc_qc_complete(ap, qc, 1))) in sata_dwc_isr()
754 struct ata_queued_cmd *qc; in sata_dwc_dma_xfer_complete() local
760 qc = ata_qc_from_tag(ap, tag); in sata_dwc_dma_xfer_complete()
761 if (!qc) { in sata_dwc_dma_xfer_complete()
770 __func__, qc->hw_tag, qc->tf.command, in sata_dwc_dma_xfer_complete()
771 get_dma_dir_descript(qc->dma_dir), in sata_dwc_dma_xfer_complete()
772 get_prot_descript(qc->tf.protocol), in sata_dwc_dma_xfer_complete()
777 if (ata_is_dma(qc->tf.protocol)) { in sata_dwc_dma_xfer_complete()
786 sata_dwc_qc_complete(ap, qc, check_status); in sata_dwc_dma_xfer_complete()
789 sata_dwc_qc_complete(ap, qc, check_status); in sata_dwc_dma_xfer_complete()
793 static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc, in sata_dwc_qc_complete() argument
798 u8 tag = qc->hw_tag; in sata_dwc_qc_complete()
810 qc->tf.command, status, ap->print_id, qc->tf.protocol); in sata_dwc_qc_complete()
816 ata_qc_complete(qc); in sata_dwc_qc_complete()
998 static void sata_dwc_bmdma_setup_by_tag(struct ata_queued_cmd *qc, u8 tag) in sata_dwc_bmdma_setup_by_tag() argument
1000 sata_dwc_exec_command_by_tag(qc->ap, &qc->tf, tag, in sata_dwc_bmdma_setup_by_tag()
1004 static void sata_dwc_bmdma_setup(struct ata_queued_cmd *qc) in sata_dwc_bmdma_setup() argument
1006 u8 tag = qc->hw_tag; in sata_dwc_bmdma_setup()
1008 if (ata_is_ncq(qc->tf.protocol)) { in sata_dwc_bmdma_setup()
1009 dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n", in sata_dwc_bmdma_setup()
1010 __func__, qc->ap->link.sactive, tag); in sata_dwc_bmdma_setup()
1014 sata_dwc_bmdma_setup_by_tag(qc, tag); in sata_dwc_bmdma_setup()
1017 static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag) in sata_dwc_bmdma_start_by_tag() argument
1021 struct sata_dwc_device *hsdev = HSDEV_FROM_QC(qc); in sata_dwc_bmdma_start_by_tag()
1022 struct ata_port *ap = qc->ap; in sata_dwc_bmdma_start_by_tag()
1025 int dir = qc->dma_dir; in sata_dwc_bmdma_start_by_tag()
1042 __func__, qc, tag, qc->tf.command, in sata_dwc_bmdma_start_by_tag()
1043 get_dma_dir_descript(qc->dma_dir), start_dma); in sata_dwc_bmdma_start_by_tag()
1044 sata_dwc_tf_dump(ap, &qc->tf); in sata_dwc_bmdma_start_by_tag()
1066 static void sata_dwc_bmdma_start(struct ata_queued_cmd *qc) in sata_dwc_bmdma_start() argument
1068 u8 tag = qc->hw_tag; in sata_dwc_bmdma_start()
1070 if (ata_is_ncq(qc->tf.protocol)) { in sata_dwc_bmdma_start()
1071 dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n", in sata_dwc_bmdma_start()
1072 __func__, qc->ap->link.sactive, tag); in sata_dwc_bmdma_start()
1076 dev_dbg(qc->ap->dev, "%s\n", __func__); in sata_dwc_bmdma_start()
1077 sata_dwc_bmdma_start_by_tag(qc, tag); in sata_dwc_bmdma_start()
1080 static unsigned int sata_dwc_qc_issue(struct ata_queued_cmd *qc) in sata_dwc_qc_issue() argument
1083 u8 tag = qc->hw_tag; in sata_dwc_qc_issue()
1084 struct ata_port *ap = qc->ap; in sata_dwc_qc_issue()
1088 if (qc->hw_tag > 0 || ap->link.sactive > 1) in sata_dwc_qc_issue()
1091 __func__, ap->print_id, qc->tf.command, in sata_dwc_qc_issue()
1092 ata_get_cmd_descript(qc->tf.command), in sata_dwc_qc_issue()
1093 qc->hw_tag, get_prot_descript(qc->tf.protocol), in sata_dwc_qc_issue()
1097 if (!ata_is_ncq(qc->tf.protocol)) in sata_dwc_qc_issue()
1100 if (ata_is_dma(qc->tf.protocol)) { in sata_dwc_qc_issue()
1101 hsdevp->desc[tag] = dma_dwc_xfer_setup(qc); in sata_dwc_qc_issue()
1108 if (ata_is_ncq(qc->tf.protocol)) { in sata_dwc_qc_issue()
1113 dev_dbg(qc->ap->dev, in sata_dwc_qc_issue()
1115 __func__, tag, qc->ap->link.sactive, sactive); in sata_dwc_qc_issue()
1117 ap->ops->sff_tf_load(ap, &qc->tf); in sata_dwc_qc_issue()
1118 sata_dwc_exec_command_by_tag(ap, &qc->tf, tag, in sata_dwc_qc_issue()
1121 return ata_bmdma_qc_issue(qc); in sata_dwc_qc_issue()