Lines Matching refs:scmnd

766 	struct scsi_cmnd *scmnd = cmd_request->cmd;
767 struct hv_host_device *host_dev = shost_priv(scmnd->device->host);
772 struct stor_mem_pools *memp = scmnd->device->hostdata;
777 copy_from_bounce_buffer(scsi_sglist(scmnd),
779 scsi_sg_count(scmnd),
791 scmnd->result = DID_TARGET_FAILURE << 16;
793 scmnd->result = vm_srb->scsi_status;
809 scmnd->result = DID_TARGET_FAILURE << 16;
818 if (scmnd->result) {
819 if (scsi_normalize_sense(scmnd->sense_buffer,
824 scsi_set_resid(scmnd,
828 scsi_done_fn = scmnd->scsi_done;
830 scmnd->host_scribble = NULL;
831 scmnd->scsi_done = NULL;
833 scsi_done_fn(scmnd);
1174 static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
1176 struct hv_host_device *host_dev = shost_priv(scmnd->device->host);
1219 static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd)
1222 u8 scsi_op = scmnd->cmnd[0];
1230 scmnd->result = ILLEGAL_REQUEST << 16;
1239 static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd)
1250 struct stor_mem_pools *memp = scmnd->device->hostdata;
1252 if (!storvsc_scsi_cmd_ok(scmnd)) {
1253 scmnd->scsi_done(scmnd);
1272 cmd_request->cmd = scmnd;
1274 scmnd->host_scribble = (unsigned char *)cmd_request;
1280 switch (scmnd->sc_data_direction) {
1294 vm_srb->path_id = scmnd->device->channel;
1295 vm_srb->target_id = scmnd->device->id;
1296 vm_srb->lun = scmnd->device->lun;
1298 vm_srb->cdb_length = scmnd->cmd_len;
1300 memcpy(vm_srb->cdb, scmnd->cmnd, vm_srb->cdb_length);
1302 cmd_request->sense_buffer = scmnd->sense_buffer;
1305 cmd_request->data_buffer.len = scsi_bufflen(scmnd);
1306 if (scsi_sg_count(scmnd)) {
1307 sgl = (struct scatterlist *)scsi_sglist(scmnd);
1308 sg_count = scsi_sg_count(scmnd);
1311 if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) {
1313 create_bounce_buffer(sgl, scsi_sg_count(scmnd),
1314 scsi_bufflen(scmnd),
1322 ALIGN(scsi_bufflen(scmnd), PAGE_SIZE) >>
1328 scsi_sg_count(scmnd));
1340 } else if (scsi_sglist(scmnd)) {
1342 virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1);
1344 virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT;
1366 scmnd->host_scribble = NULL;