Lines Matching refs:cmd
211 void ata_scsi_set_sense(struct ata_device *dev, struct scsi_cmnd *cmd, in ata_scsi_set_sense() argument
216 scsi_build_sense(cmd, d_sense, sk, asc, ascq); in ata_scsi_set_sense()
220 struct scsi_cmnd *cmd, in ata_scsi_set_sense_information() argument
229 scsi_set_sense_information(cmd->sense_buffer, in ata_scsi_set_sense_information()
246 struct scsi_cmnd *cmd = qc->scsicmd; in ata_scsi_set_passthru_sense_fields() local
248 unsigned char *sb = cmd->sense_buffer; in ata_scsi_set_passthru_sense_fields()
315 struct scsi_cmnd *cmd, u16 field, u8 bit) in ata_scsi_set_invalid_field() argument
317 ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x24, 0x0); in ata_scsi_set_invalid_field()
319 scsi_set_sense_field_pointer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE, in ata_scsi_set_invalid_field()
324 struct scsi_cmnd *cmd, u16 field) in ata_scsi_set_invalid_parameter() argument
327 ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x26, 0x0); in ata_scsi_set_invalid_parameter()
328 scsi_set_sense_field_pointer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE, in ata_scsi_set_invalid_parameter()
656 unsigned int cmd, void __user *arg) in ata_sas_scsi_ioctl() argument
662 switch (cmd) { in ata_sas_scsi_ioctl()
711 int ata_scsi_ioctl(struct scsi_device *scsidev, unsigned int cmd, in ata_scsi_ioctl() argument
715 scsidev, cmd, arg); in ata_scsi_ioctl()
739 struct scsi_cmnd *cmd) in ata_scsi_qc_new() argument
753 if (WARN_ON_ONCE(cmd->budget_token >= ATA_MAX_QUEUE)) in ata_scsi_qc_new()
755 tag = cmd->budget_token; in ata_scsi_qc_new()
757 tag = scsi_cmd_to_rq(cmd)->tag; in ata_scsi_qc_new()
767 qc->scsicmd = cmd; in ata_scsi_qc_new()
770 qc->sg = scsi_sglist(cmd); in ata_scsi_qc_new()
771 qc->n_elem = scsi_sg_count(cmd); in ata_scsi_qc_new()
773 if (scsi_cmd_to_rq(cmd)->rq_flags & RQF_QUIET) in ata_scsi_qc_new()
779 set_host_byte(cmd, DID_OK); in ata_scsi_qc_new()
780 set_status_byte(cmd, SAM_STAT_TASK_SET_FULL); in ata_scsi_qc_new()
781 scsi_done(cmd); in ata_scsi_qc_new()
935 struct scsi_cmnd *cmd = qc->scsicmd; in ata_gen_passthru_sense() local
953 ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq); in ata_gen_passthru_sense()
967 scsi_build_sense(cmd, 1, RECOVERED_ERROR, 0, 0x1D); in ata_gen_passthru_sense()
984 struct scsi_cmnd *cmd = qc->scsicmd; in ata_gen_ata_sense() local
986 unsigned char *sb = cmd->sense_buffer; in ata_gen_ata_sense()
993 ata_scsi_set_sense(dev, cmd, NOT_READY, 0x04, 0x21); in ata_gen_ata_sense()
1010 ata_scsi_set_sense(dev, cmd, sense_key, asc, ascq); in ata_gen_ata_sense()
1015 ata_scsi_set_sense(dev, cmd, ABORTED_COMMAND, 0, 0); in ata_gen_ata_sense()
1695 struct scsi_cmnd *cmd = qc->scsicmd; in ata_qc_done() local
1699 done(cmd); in ata_qc_done()
1704 struct scsi_cmnd *cmd = qc->scsicmd; in ata_scsi_qc_complete() local
1705 u8 *cdb = cmd->cmnd; in ata_scsi_qc_complete()
1759 static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd, in ata_scsi_translate() argument
1766 qc = ata_scsi_qc_new(dev, cmd); in ata_scsi_translate()
1771 if (cmd->sc_data_direction == DMA_FROM_DEVICE || in ata_scsi_translate()
1772 cmd->sc_data_direction == DMA_TO_DEVICE) { in ata_scsi_translate()
1773 if (unlikely(scsi_bufflen(cmd) < 1)) { in ata_scsi_translate()
1778 ata_sg_init(qc, scsi_sglist(cmd), scsi_sg_count(cmd)); in ata_scsi_translate()
1780 qc->dma_dir = cmd->sc_data_direction; in ata_scsi_translate()
1800 scsi_done(cmd); in ata_scsi_translate()
1805 cmd->result = (DID_ERROR << 16); in ata_scsi_translate()
1806 scsi_done(cmd); in ata_scsi_translate()
1821 struct scsi_cmnd *cmd; member
1843 struct scsi_cmnd *cmd = args->cmd; in ata_scsi_rbuf_fill() local
1851 sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), in ata_scsi_rbuf_fill()
1857 cmd->result = SAM_STAT_GOOD; in ata_scsi_rbuf_fill()
2433 u8 *scsicmd = args->cmd->cmnd, *p = rbuf; in ata_scsiop_mode_sense()
2537 ata_scsi_set_invalid_field(dev, args->cmd, fp, bp); in ata_scsiop_mode_sense()
2541 ata_scsi_set_sense(dev, args->cmd, ILLEGAL_REQUEST, 0x39, 0x0); in ata_scsiop_mode_sense()
2568 if (args->cmd->cmnd[0] == READ_CAPACITY) { in ata_scsiop_read_cap()
2647 static void atapi_fixup_inquiry(struct scsi_cmnd *cmd) in atapi_fixup_inquiry() argument
2651 sg_copy_to_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), buf, 4); in atapi_fixup_inquiry()
2656 sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), buf, 4); in atapi_fixup_inquiry()
2661 struct scsi_cmnd *cmd = qc->scsicmd; in atapi_qc_complete() local
2692 if (cmd->cmnd[0] == INQUIRY && (cmd->cmnd[1] & 0x03) == 0) in atapi_qc_complete()
2693 atapi_fixup_inquiry(cmd); in atapi_qc_complete()
2694 cmd->result = SAM_STAT_GOOD; in atapi_qc_complete()
3196 static size_t ata_format_dsm_trim_descr(struct scsi_cmnd *cmd, u32 trmax, in ata_format_dsm_trim_descr() argument
3199 struct scsi_device *sdp = cmd->device; in ata_format_dsm_trim_descr()
3223 r = sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), buf, len); in ata_format_dsm_trim_descr()
3356 u8 *cdb = args->cmd->cmnd; in ata_scsiop_maint_in()
4127 static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd) in ata_get_xlat_func() argument
4129 switch (cmd) { in ata_get_xlat_func()
4255 int ata_scsi_queuecmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd) in ata_scsi_queuecmd() argument
4259 struct scsi_device *scsidev = cmd->device; in ata_scsi_queuecmd()
4269 rc = __ata_scsi_queuecmd(cmd, dev); in ata_scsi_queuecmd()
4271 cmd->result = (DID_BAD_TARGET << 16); in ata_scsi_queuecmd()
4272 scsi_done(cmd); in ata_scsi_queuecmd()
4293 void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd) in ata_scsi_simulate() argument
4296 const u8 *scsicmd = cmd->cmnd; in ata_scsi_simulate()
4301 args.cmd = cmd; in ata_scsi_simulate()
4306 ata_scsi_set_invalid_field(dev, cmd, 1, 0xff); in ata_scsi_simulate()
4335 ata_scsi_set_invalid_field(dev, cmd, 2, 0xff); in ata_scsi_simulate()
4341 ata_scsi_set_invalid_field(dev, cmd, 2, 0xff); in ata_scsi_simulate()
4344 ata_scsi_set_invalid_field(dev, cmd, 2, 0xff); in ata_scsi_simulate()
4362 ata_scsi_set_invalid_field(dev, cmd, 1, 0xff); in ata_scsi_simulate()
4370 ata_scsi_set_sense(dev, cmd, 0, 0, 0); in ata_scsi_simulate()
4390 ata_scsi_set_invalid_field(dev, cmd, 1, 0xff); in ata_scsi_simulate()
4397 ata_scsi_set_invalid_field(dev, cmd, 1, 0xff); in ata_scsi_simulate()
4402 ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x20, 0x0); in ata_scsi_simulate()
4407 scsi_done(cmd); in ata_scsi_simulate()