/linux/drivers/ata/ |
H A D | libata-sff.c | 462 * @qc: queued command 475 unsigned int ata_sff_data_xfer(struct ata_queued_cmd *qc, unsigned char *buf, in ata_sff_data_xfer() argument 478 struct ata_port *ap = qc->dev->link->ap; in ata_sff_data_xfer() 515 * @qc: queued command 530 unsigned int ata_sff_data_xfer32(struct ata_queued_cmd *qc, unsigned char *buf, in ata_sff_data_xfer32() argument 533 struct ata_device *dev = qc->dev; in ata_sff_data_xfer32() 540 return ata_sff_data_xfer(qc, buf, buflen, rw); in ata_sff_data_xfer32() 577 static void ata_pio_xfer(struct ata_queued_cmd *qc, struct page *page, in ata_pio_xfer() argument 580 bool do_write = (qc->tf.flags & ATA_TFLAG_WRITE); in ata_pio_xfer() 584 qc->ap->ops->sff_data_xfer(qc, buf + offset, xfer_size, do_write); in ata_pio_xfer() [all …]
|
H A D | pdc_adma.c | 119 static enum ata_completion_errors adma_qc_prep(struct ata_queued_cmd *qc); 120 static unsigned int adma_qc_issue(struct ata_queued_cmd *qc); 121 static int adma_check_atapi_dma(struct ata_queued_cmd *qc); 172 static int adma_check_atapi_dma(struct ata_queued_cmd *qc) in adma_check_atapi_dma() argument 256 static int adma_fill_sg(struct ata_queued_cmd *qc) in adma_fill_sg() argument 259 struct ata_port *ap = qc->ap; in adma_fill_sg() 263 u8 pFLAGS = pORD | ((qc->tf.flags & ATA_TFLAG_WRITE) ? pDIRO : 0); in adma_fill_sg() 266 for_each_sg(qc->sg, sg, qc->n_elem, si) { in adma_fill_sg() 280 buf[i++] = qc->dev->dma_mode & 0xf; in adma_fill_sg() 295 static enum ata_completion_errors adma_qc_prep(struct ata_queued_cmd *qc) in adma_qc_prep() argument [all …]
|
H A D | sata_dwc_460ex.c | 158 #define HSDEV_FROM_QC(qc) ((struct sata_dwc_device *)(qc)->ap->host->private_data) argument 175 static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag); 176 static int sata_dwc_qc_complete(struct ata_port *ap, struct ata_queued_cmd *qc); 322 static struct dma_async_tx_descriptor *dma_dwc_xfer_setup(struct ata_queued_cmd *qc) in dma_dwc_xfer_setup() argument 324 struct ata_port *ap = qc->ap; in dma_dwc_xfer_setup() 330 if (qc->dma_dir == DMA_DEV_TO_MEM) { in dma_dwc_xfer_setup() 338 sconf.direction = qc->dma_dir; in dma_dwc_xfer_setup() 347 desc = dmaengine_prep_slave_sg(hsdevp->chan, qc->sg, qc->n_elem, in dma_dwc_xfer_setup() 348 qc->dma_dir, in dma_dwc_xfer_setup() 358 qc->sg, qc->n_elem, &hsdev->dmadr); in dma_dwc_xfer_setup() [all …]
|
H A D | sata_qstor.c | 103 static enum ata_completion_errors qs_qc_prep(struct ata_queued_cmd *qc); 104 static unsigned int qs_qc_issue(struct ata_queued_cmd *qc); 105 static int qs_check_atapi_dma(struct ata_queued_cmd *qc); 166 static int qs_check_atapi_dma(struct ata_queued_cmd *qc) in qs_check_atapi_dma() argument 236 static unsigned int qs_fill_sg(struct ata_queued_cmd *qc) in qs_fill_sg() argument 239 struct ata_port *ap = qc->ap; in qs_fill_sg() 244 for_each_sg(qc->sg, sg, qc->n_elem, si) { in qs_fill_sg() 260 static enum ata_completion_errors qs_qc_prep(struct ata_queued_cmd *qc) in qs_qc_prep() argument 262 struct qs_port_priv *pp = qc->ap->private_data; in qs_qc_prep() 268 qs_enter_reg_mode(qc->ap); in qs_qc_prep() [all …]
|
H A D | libata-eh.c | 609 * completion wins, the qc never reaches EH. When error in ata_scsi_cmd_error_handler() 610 * completion wins, the qc has ATA_QCFLAG_EH set. in ata_scsi_cmd_error_handler() 616 * timed out iff its associated qc is active and not failed. in ata_scsi_cmd_error_handler() 634 struct ata_queued_cmd *qc; in ata_scsi_cmd_error_handler() local 644 ata_qc_for_each_raw(ap, qc, i) { in ata_scsi_cmd_error_handler() 645 if (qc->flags & ATA_QCFLAG_ACTIVE && in ata_scsi_cmd_error_handler() 646 qc->scsicmd == scmd) in ata_scsi_cmd_error_handler() 651 /* the scmd has an associated qc */ in ata_scsi_cmd_error_handler() 652 if (!(qc->flags & ATA_QCFLAG_EH)) { in ata_scsi_cmd_error_handler() 655 qc->err_mask |= AC_ERR_TIMEOUT; in ata_scsi_cmd_error_handler() [all …]
|
H A D | acard-ahci.c | 59 static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc); 60 static void acard_ahci_qc_fill_rtf(struct ata_queued_cmd *qc); 182 static unsigned int acard_ahci_fill_sg(struct ata_queued_cmd *qc, void *cmd_tbl) in acard_ahci_fill_sg() argument 191 for_each_sg(qc->sg, sg, qc->n_elem, si) { in acard_ahci_fill_sg() 211 static enum ata_completion_errors acard_ahci_qc_prep(struct ata_queued_cmd *qc) in acard_ahci_qc_prep() argument 213 struct ata_port *ap = qc->ap; in acard_ahci_qc_prep() 215 int is_atapi = ata_is_atapi(qc->tf.protocol); in acard_ahci_qc_prep() 224 cmd_tbl = pp->cmd_tbl + qc->hw_tag * AHCI_CMD_TBL_SZ; in acard_ahci_qc_prep() 226 ata_tf_to_fis(&qc->tf, qc->dev->link->pmp, 1, cmd_tbl); in acard_ahci_qc_prep() 229 memcpy(cmd_tbl + AHCI_CMD_TBL_CDB, qc->cdb, qc->dev->cdb_len); in acard_ahci_qc_prep() [all …]
|
H A D | sata_sx4.c | 196 struct ata_queued_cmd *qc; member 208 static enum ata_completion_errors pdc20621_qc_prep(struct ata_queued_cmd *qc); 222 static unsigned int pdc20621_qc_issue(struct ata_queued_cmd *qc); 225 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc); 226 static int pdc_check_atapi_dma(struct ata_queued_cmd *qc); 414 static void pdc20621_dma_prep(struct ata_queued_cmd *qc) in pdc20621_dma_prep() argument 417 struct ata_port *ap = qc->ap; in pdc20621_dma_prep() 425 WARN_ON(!(qc->flags & ATA_QCFLAG_DMAMAP)); in pdc20621_dma_prep() 434 for_each_sg(qc->sg, sg, qc->n_elem, si) { in pdc20621_dma_prep() 446 pdc20621_host_pkt(&qc->tf, &pp->dimm_buf[0], portno); in pdc20621_dma_prep() [all …]
|
H A D | sata_promise.c | 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() [all …]
|
H A D | libata-scsi.c | 45 typedef unsigned int (*ata_xlat_func_t)(struct ata_queued_cmd *qc); 235 * @qc: ATA PASS-THROUGH command. 243 static void ata_scsi_set_passthru_sense_fields(struct ata_queued_cmd *qc) in ata_scsi_set_passthru_sense_fields() argument 245 struct ata_device *dev = qc->dev; in ata_scsi_set_passthru_sense_fields() 246 struct scsi_cmnd *cmd = qc->scsicmd; in ata_scsi_set_passthru_sense_fields() 247 struct ata_taskfile *tf = &qc->result_tf; in ata_scsi_set_passthru_sense_fields() 250 if (!(qc->flags & ATA_QCFLAG_RTF_FILLED)) { in ata_scsi_set_passthru_sense_fields() 742 struct ata_queued_cmd *qc; in ata_scsi_qc_new() local 760 qc = __ata_qc_from_tag(ap, tag); in ata_scsi_qc_new() 761 qc->tag = qc->hw_tag = tag; in ata_scsi_qc_new() [all …]
|
H A D | pata_octeon_cf.c | 285 * @qc: Queued command 290 static unsigned int octeon_cf_data_xfer8(struct ata_queued_cmd *qc, in octeon_cf_data_xfer8() argument 295 struct ata_port *ap = qc->dev->link->ap; in octeon_cf_data_xfer8() 324 * @qc: Queued command 329 static unsigned int octeon_cf_data_xfer16(struct ata_queued_cmd *qc, in octeon_cf_data_xfer16() argument 334 struct ata_port *ap = qc->dev->link->ap; in octeon_cf_data_xfer16() 517 static void octeon_cf_dma_setup(struct ata_queued_cmd *qc) in octeon_cf_dma_setup() argument 519 struct ata_port *ap = qc->ap; in octeon_cf_dma_setup() 524 qc->cursg = qc->sg; in octeon_cf_dma_setup() 526 ap->ops->sff_exec_command(ap, &qc->tf); in octeon_cf_dma_setup() [all …]
|
H A D | sata_nv.c | 301 static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc); 302 static enum ata_completion_errors nv_adma_qc_prep(struct ata_queued_cmd *qc); 303 static unsigned int nv_adma_qc_issue(struct ata_queued_cmd *qc); 316 static void nv_adma_post_internal_cmd(struct ata_queued_cmd *qc); 325 static enum ata_completion_errors nv_swncq_qc_prep(struct ata_queued_cmd *qc); 326 static void nv_swncq_fill_sg(struct ata_queued_cmd *qc); 327 static unsigned int nv_swncq_qc_issue(struct ata_queued_cmd *qc); 758 static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc) in nv_adma_check_atapi_dma() argument 760 struct nv_adma_port_priv *pp = qc->ap->private_data; in nv_adma_check_atapi_dma() 857 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag); in nv_host_intr() local [all …]
|
H A D | sata_inic162x.c | 385 struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->link.active_tag); in inic_host_intr() local 397 if (unlikely(!qc)) in inic_host_intr() 408 qc->err_mask |= AC_ERR_DEV; in inic_host_intr() 410 ata_qc_complete(qc); in inic_host_intr() 416 qc ? qc->tf.command : 0xff, irq_stat, idma_stat); in inic_host_intr() 445 static int inic_check_atapi_dma(struct ata_queued_cmd *qc) in inic_check_atapi_dma() argument 453 if (atapi_cmd_type(qc->cdb[0]) == READ) in inic_check_atapi_dma() 458 static void inic_fill_sg(struct inic_prd *prd, struct ata_queued_cmd *qc) in inic_fill_sg() argument 464 if (qc->tf.flags & ATA_TFLAG_WRITE) in inic_fill_sg() 467 if (ata_is_dma(qc->tf.protocol)) in inic_fill_sg() [all …]
|
H A D | pata_pxa.c | 47 static enum ata_completion_errors pxa_qc_prep(struct ata_queued_cmd *qc) in pxa_qc_prep() argument 49 struct pata_pxa_data *pd = qc->ap->private_data; in pxa_qc_prep() 53 if (!(qc->flags & ATA_QCFLAG_DMAMAP)) in pxa_qc_prep() 56 dir = (qc->dma_dir == DMA_TO_DEVICE ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM); in pxa_qc_prep() 57 tx = dmaengine_prep_slave_sg(pd->dma_chan, qc->sg, qc->n_elem, dir, in pxa_qc_prep() 60 ata_dev_err(qc->dev, "prep_slave_sg() failed\n"); in pxa_qc_prep() 74 static void pxa_bmdma_setup(struct ata_queued_cmd *qc) in pxa_bmdma_setup() argument 76 qc->ap->ops->sff_exec_command(qc->ap, &qc->tf); in pxa_bmdma_setup() 82 static void pxa_bmdma_start(struct ata_queued_cmd *qc) in pxa_bmdma_start() argument 84 struct pata_pxa_data *pd = qc->ap->private_data; in pxa_bmdma_start() [all …]
|
H A D | pata_triflex.c | 133 * @qc: Command in progress 142 static void triflex_bmdma_start(struct ata_queued_cmd *qc) in triflex_bmdma_start() argument 144 triflex_load_timing(qc->ap, qc->dev, qc->dev->dma_mode); in triflex_bmdma_start() 145 ata_bmdma_start(qc); in triflex_bmdma_start() 150 * @qc: ATA command 157 static void triflex_bmdma_stop(struct ata_queued_cmd *qc) in triflex_bmdma_stop() argument 159 ata_bmdma_stop(qc); in triflex_bmdma_stop() 160 triflex_load_timing(qc->ap, qc->dev, qc->dev->pio_mode); in triflex_bmdma_stop()
|
H A D | pata_arasan_cf.c | 217 /* qc to be transferred using DMA */ 218 struct ata_queued_cmd *qc; member 366 struct ata_queued_cmd *qc = acdev->qc; in dma_complete() local 369 acdev->qc = NULL; in dma_complete() 373 if (unlikely(qc->err_mask) && ata_is_dma(qc->tf.protocol)) in dma_complete() 374 ata_ehi_push_desc(&qc->ap->link.eh_info, "DMA Failed: Timeout"); in dma_complete() 381 u32 rw = acdev->qc->tf.flags & ATA_TFLAG_WRITE; in wait4buf() 435 u32 write = acdev->qc->tf.flags & ATA_TFLAG_WRITE; in sg_xfer() 522 struct ata_queued_cmd *qc = acdev->qc; in data_xfer() local 538 for_each_sg(qc->sg, sg, qc->n_elem, temp) { in data_xfer() [all …]
|
H A D | pata_ns87415.c | 114 * @qc: Command block 120 static void ns87415_bmdma_setup(struct ata_queued_cmd *qc) in ns87415_bmdma_setup() argument 122 struct ata_port *ap = qc->ap; in ns87415_bmdma_setup() 123 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); in ns87415_bmdma_setup() 140 ap->ops->sff_exec_command(ap, &qc->tf); in ns87415_bmdma_setup() 145 * @qc: Command block 154 static void ns87415_bmdma_start(struct ata_queued_cmd *qc) in ns87415_bmdma_start() argument 156 ns87415_set_mode(qc->ap, qc->dev, qc->dev->dma_mode); in ns87415_bmdma_start() 157 ata_bmdma_start(qc); in ns87415_bmdma_start() 162 * @qc: Command block [all …]
|
H A D | sata_sil24.c | 328 static int sil24_qc_defer(struct ata_queued_cmd *qc); 329 static enum ata_completion_errors sil24_qc_prep(struct ata_queued_cmd *qc); 330 static unsigned int sil24_qc_issue(struct ata_queued_cmd *qc); 331 static void sil24_qc_fill_rtf(struct ata_queued_cmd *qc); 343 static void sil24_post_internal_cmd(struct ata_queued_cmd *qc); 769 static inline void sil24_fill_sg(struct ata_queued_cmd *qc, in sil24_fill_sg() argument 776 for_each_sg(qc->sg, sg, qc->n_elem, si) { in sil24_fill_sg() 788 static int sil24_qc_defer(struct ata_queued_cmd *qc) in sil24_qc_defer() argument 790 struct ata_link *link = qc->dev->link; in sil24_qc_defer() 792 u8 prot = qc->tf.protocol; in sil24_qc_defer() [all …]
|
H A D | sata_sil.c | 106 static enum ata_completion_errors sil_qc_prep(struct ata_queued_cmd *qc); 107 static void sil_bmdma_setup(struct ata_queued_cmd *qc); 108 static void sil_bmdma_start(struct ata_queued_cmd *qc); 109 static void sil_bmdma_stop(struct ata_queued_cmd *qc); 251 static void sil_bmdma_stop(struct ata_queued_cmd *qc) in sil_bmdma_stop() argument 253 struct ata_port *ap = qc->ap; in sil_bmdma_stop() 264 static void sil_bmdma_setup(struct ata_queued_cmd *qc) in sil_bmdma_setup() argument 266 struct ata_port *ap = qc->ap; in sil_bmdma_setup() 273 ap->ops->sff_exec_command(ap, &qc->tf); in sil_bmdma_setup() 276 static void sil_bmdma_start(struct ata_queued_cmd *qc) in sil_bmdma_start() argument [all …]
|
H A D | pata_sl82c105.c | 152 * @qc: ATA command 161 static void sl82c105_bmdma_start(struct ata_queued_cmd *qc) in sl82c105_bmdma_start() argument 163 struct ata_port *ap = qc->ap; in sl82c105_bmdma_start() 170 sl82c105_configure_dmamode(ap, qc->dev); in sl82c105_bmdma_start() 172 ata_bmdma_start(qc); in sl82c105_bmdma_start() 177 * @qc: ATA command 189 static void sl82c105_bmdma_stop(struct ata_queued_cmd *qc) in sl82c105_bmdma_stop() argument 191 struct ata_port *ap = qc->ap; in sl82c105_bmdma_stop() 193 ata_bmdma_stop(qc); in sl82c105_bmdma_stop() 199 sl82c105_set_piomode(ap, qc->dev); in sl82c105_bmdma_stop() [all …]
|
H A D | pata_pdc202xx_old.c | 166 * @qc: ATA command 175 static void pdc2026x_bmdma_start(struct ata_queued_cmd *qc) in pdc2026x_bmdma_start() argument 177 struct ata_port *ap = qc->ap; in pdc2026x_bmdma_start() 178 struct ata_device *adev = qc->dev; in pdc2026x_bmdma_start() 179 struct ata_taskfile *tf = &qc->tf; in pdc2026x_bmdma_start() 196 pdc202xx_set_dmamode(ap, qc->dev); in pdc2026x_bmdma_start() 200 len = qc->nbytes / 2; in pdc2026x_bmdma_start() 211 ata_bmdma_start(qc); in pdc2026x_bmdma_start() 216 * @qc: ATA command 225 static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc) in pdc2026x_bmdma_stop() argument [all …]
|
H A D | libata-core.c | 658 static inline void ata_set_tf_cdl(struct ata_queued_cmd *qc, int cdl) in ata_set_tf_cdl() argument 660 struct ata_taskfile *tf = &qc->tf; in ata_set_tf_cdl() 672 qc->flags |= ATA_QCFLAG_HAS_CDL | ATA_QCFLAG_RESULT_TF; in ata_set_tf_cdl() 677 * @qc: Metadata associated with the taskfile to build 687 * Build ATA taskfile for the command @qc for read/write request described 695 int ata_build_rw_tf(struct ata_queued_cmd *qc, u64 block, u32 n_block, in ata_build_rw_tf() argument 698 struct ata_taskfile *tf = &qc->tf; in ata_build_rw_tf() 699 struct ata_device *dev = qc->dev; in ata_build_rw_tf() 717 tf->nsect = qc->hw_tag << 3; in ata_build_rw_tf() 737 ata_set_tf_cdl(qc, cdl); in ata_build_rw_tf() [all …]
|
/linux/include/trace/events/ |
H A D | libata.h | 184 TP_PROTO(struct ata_queued_cmd *qc), 186 TP_ARGS(qc), 210 __entry->ata_port = qc->ap->print_id; 211 __entry->ata_dev = qc->dev->link->pmp + qc->dev->devno; 212 __entry->tag = qc->tag; 213 __entry->proto = qc->tf.protocol; 214 __entry->cmd = qc->tf.command; 215 __entry->dev = qc->tf.device; 216 __entry->lbal = qc->tf.lbal; 217 __entry->lbam = qc->tf.lbam; [all …]
|
/linux/drivers/scsi/libsas/ |
H A D | sas_ata.c | 75 struct ata_queued_cmd *qc = task->uldd_task; in sas_ata_task_done() local 88 else if (qc && qc->scsicmd) in sas_ata_task_done() 89 ASSIGN_SAS_TASK(qc->scsicmd, NULL); in sas_ata_task_done() 96 if (!qc) in sas_ata_task_done() 99 ap = qc->ap; in sas_ata_task_done() 106 if (qc->scsicmd) in sas_ata_task_done() 124 qc->err_mask |= ac_err_mask(dev->sata_dev.fis[2]); in sas_ata_task_done() 128 qc->flags |= ATA_QCFLAG_EH; in sas_ata_task_done() 136 qc->err_mask = ac; in sas_ata_task_done() 139 qc->flags |= ATA_QCFLAG_EH; in sas_ata_task_done() [all …]
|
/linux/arch/loongarch/kernel/ |
H A D | io.c | 70 u64 qc = (u8)c; in __memset_io() local 72 qc |= qc << 8; in __memset_io() 73 qc |= qc << 16; in __memset_io() 74 qc |= qc << 32; in __memset_io() 83 __raw_writeq(qc, dst); in __memset_io()
|
/linux/Documentation/driver-api/ |
H A D | libata.rst | 124 int (*check_atapi_dma) (struct ata_queued_cmd *qc); 202 void (*bmdma_setup) (struct ata_queued_cmd *qc); 203 void (*bmdma_start) (struct ata_queued_cmd *qc); 237 enum ata_completion_errors (*qc_prep) (struct ata_queued_cmd *qc); 238 int (*qc_issue) (struct ata_queued_cmd *qc); 301 void (*post_internal_cmd) (struct ata_queued_cmd *qc); 326 command was active (if any), and calls ata_sff_host_intr(ap,qc). 386 :c:type:`struct ata_queued_cmd <ata_queued_cmd>` or qc. 387 qc's are preallocated during port initialization and repetitively used 388 for command executions. Currently only one qc is allocated per port but [all …]
|