Lines Matching defs:cmd
211 void ata_scsi_set_sense(struct ata_device *dev, struct scsi_cmnd *cmd,
216 scsi_build_sense(cmd, d_sense, sk, asc, ascq);
220 struct scsi_cmnd *cmd,
229 scsi_set_sense_information(cmd->sense_buffer,
234 struct scsi_cmnd *cmd, u16 field, u8 bit)
236 ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x24, 0x0);
238 scsi_set_sense_field_pointer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE,
243 struct scsi_cmnd *cmd, u16 field)
246 ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x26, 0x0);
247 scsi_set_sense_field_pointer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE,
575 unsigned int cmd, void __user *arg)
581 switch (cmd) {
630 int ata_scsi_ioctl(struct scsi_device *scsidev, unsigned int cmd,
634 scsidev, cmd, arg);
641 * @cmd: SCSI command that originated this ATA command
658 struct scsi_cmnd *cmd)
672 if (WARN_ON_ONCE(cmd->budget_token >= ATA_MAX_QUEUE))
674 tag = cmd->budget_token;
676 tag = scsi_cmd_to_rq(cmd)->tag;
686 qc->scsicmd = cmd;
689 qc->sg = scsi_sglist(cmd);
690 qc->n_elem = scsi_sg_count(cmd);
692 if (scsi_cmd_to_rq(cmd)->rq_flags & RQF_QUIET)
698 set_host_byte(cmd, DID_OK);
699 set_status_byte(cmd, SAM_STAT_TASK_SET_FULL);
700 scsi_done(cmd);
855 struct scsi_cmnd *cmd = qc->scsicmd;
857 unsigned char *sb = cmd->sense_buffer;
871 ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq);
877 scsi_build_sense(cmd, 1, RECOVERED_ERROR, 0, 0x1D);
880 if ((cmd->sense_buffer[0] & 0x7f) >= 0x72) {
950 struct scsi_cmnd *cmd = qc->scsicmd;
952 unsigned char *sb = cmd->sense_buffer;
961 ata_scsi_set_sense(dev, cmd, NOT_READY, 0x04, 0x21);
971 ata_scsi_set_sense(dev, cmd, sense_key, asc, ascq);
976 ata_scsi_set_sense(dev, cmd, ABORTED_COMMAND, 0, 0);
1656 struct scsi_cmnd *cmd = qc->scsicmd;
1660 done(cmd);
1665 struct scsi_cmnd *cmd = qc->scsicmd;
1666 u8 *cdb = cmd->cmnd;
1686 cmd->result &= 0x0000ffff;
1694 * @cmd: SCSI command to execute
1695 * @xlat_func: Actor which translates @cmd to an ATA taskfile
1706 * then cmd->result (and possibly cmd->sense_buffer) are assumed
1717 static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,
1724 qc = ata_scsi_qc_new(dev, cmd);
1729 if (cmd->sc_data_direction == DMA_FROM_DEVICE ||
1730 cmd->sc_data_direction == DMA_TO_DEVICE) {
1731 if (unlikely(scsi_bufflen(cmd) < 1)) {
1736 ata_sg_init(qc, scsi_sglist(cmd), scsi_sg_count(cmd));
1738 qc->dma_dir = cmd->sc_data_direction;
1758 scsi_done(cmd);
1763 cmd->result = (DID_ERROR << 16);
1764 scsi_done(cmd);
1779 struct scsi_cmnd *cmd;
1791 * completed successfully (0), or not (in which case cmd->result
1801 struct scsi_cmnd *cmd = args->cmd;
1809 sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd),
1815 cmd->result = SAM_STAT_GOOD;
1821 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1904 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1940 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
1965 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2024 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2379 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2391 u8 *scsicmd = args->cmd->cmnd, *p = rbuf;
2495 ata_scsi_set_invalid_field(dev, args->cmd, fp, bp);
2499 ata_scsi_set_sense(dev, args->cmd, ILLEGAL_REQUEST, 0x39, 0x0);
2507 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2526 if (args->cmd->cmnd[0] == READ_CAPACITY) {
2583 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
2605 static void atapi_fixup_inquiry(struct scsi_cmnd *cmd)
2609 sg_copy_to_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), buf, 4);
2614 sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), buf, 4);
2619 struct scsi_cmnd *cmd = qc->scsicmd;
2656 if (cmd->cmnd[0] == INQUIRY && (cmd->cmnd[1] & 0x03) == 0)
2657 atapi_fixup_inquiry(cmd);
2658 cmd->result = SAM_STAT_GOOD;
2891 /* 7Fh variable length cmd means a ata pass-thru(32) */
3141 * @cmd: SCSI command being translated
3160 static size_t ata_format_dsm_trim_descr(struct scsi_cmnd *cmd, u32 trmax,
3163 struct scsi_device *sdp = cmd->device;
3187 r = sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), buf, len);
3245 /* If the request is too large the cmd is invalid */
3310 * @rbuf: Response buffer, to which simulated SCSI cmd output is sent.
3320 u8 *cdb = args->cmd->cmnd;
4082 * @cmd: SCSI command opcode to consider
4091 static inline ata_xlat_func_t ata_get_xlat_func(struct ata_device *dev, u8 cmd)
4093 switch (cmd) {
4203 * @cmd: SCSI command to be sent
4216 * Return value from __ata_scsi_queuecmd() if @cmd can be queued,
4219 int ata_scsi_queuecmd(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
4223 struct scsi_device *scsidev = cmd->device;
4233 rc = __ata_scsi_queuecmd(cmd, dev);
4235 cmd->result = (DID_BAD_TARGET << 16);
4236 scsi_done(cmd);
4248 * @cmd: SCSI command being sent to device.
4257 void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd)
4260 const u8 *scsicmd = cmd->cmnd;
4265 args.cmd = cmd;
4270 ata_scsi_set_invalid_field(dev, cmd, 1, 0xff);
4299 ata_scsi_set_invalid_field(dev, cmd, 2, 0xff);
4305 ata_scsi_set_invalid_field(dev, cmd, 2, 0xff);
4308 ata_scsi_set_invalid_field(dev, cmd, 2, 0xff);
4326 ata_scsi_set_invalid_field(dev, cmd, 1, 0xff);
4334 ata_scsi_set_sense(dev, cmd, 0, 0, 0);
4354 ata_scsi_set_invalid_field(dev, cmd, 1, 0xff);
4361 ata_scsi_set_invalid_field(dev, cmd, 1, 0xff);
4366 ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x20, 0x0);
4371 scsi_done(cmd);