Lines Matching refs:scmd
351 struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq);
355 if (copy_from_user(scmd->cmnd, hdr->cmdp, hdr->cmd_len))
357 if (!scsi_cmd_allowed(scmd->cmnd, open_for_write))
359 scmd->cmd_len = hdr->cmd_len;
375 struct scsi_cmnd *scmd = blk_mq_rq_to_pdu(rq);
381 hdr->status = scmd->result & 0xff;
382 hdr->masked_status = sg_status_byte(scmd->result);
384 hdr->host_status = host_byte(scmd->result);
391 hdr->resid = scmd->resid_len;
394 if (scmd->sense_len && hdr->sbp) {
395 int len = min((unsigned int) hdr->mx_sb_len, scmd->sense_len);
397 if (!copy_to_user(hdr->sbp, scmd->sense_buffer, len))
418 struct scsi_cmnd *scmd;
445 scmd = blk_mq_rq_to_pdu(rq);
447 if (hdr->cmd_len > sizeof(scmd->cmnd)) {
463 scmd->allowed = 0;
510 struct scsi_cmnd *scmd;
541 scmd = blk_mq_rq_to_pdu(rq);
549 scmd->cmd_len = cmdlen;
550 if (copy_from_user(scmd->cmnd, sic->data, cmdlen))
557 if (!scsi_cmd_allowed(scmd->cmnd, open_for_write))
561 scmd->allowed = 5;
567 scmd->allowed = 1;
580 scmd->allowed = 1;
595 err = scmd->result & 0xff; /* only 8 bit SCSI status */
597 if (scmd->sense_len && scmd->sense_buffer) {
599 if (copy_to_user(sic->data, scmd->sense_buffer,
600 min(scmd->sense_len, 16U)))