Searched refs:scmnd (Results 1 - 6 of 6) sorted by relevance

/linux-4.4.14/drivers/infiniband/ulp/srp/
H A Dib_srp.c1059 static void srp_unmap_data(struct scsi_cmnd *scmnd, srp_unmap_data() argument
1068 if (!scsi_sglist(scmnd) || srp_unmap_data()
1069 (scmnd->sc_data_direction != DMA_TO_DEVICE && srp_unmap_data()
1070 scmnd->sc_data_direction != DMA_FROM_DEVICE)) srp_unmap_data()
1096 ib_dma_unmap_sg(ibdev, scsi_sglist(scmnd), scsi_sg_count(scmnd), srp_unmap_data()
1097 scmnd->sc_data_direction); srp_unmap_data()
1101 * srp_claim_req - Take ownership of the scmnd associated with a request.
1105 * @scmnd: If NULL, take ownership of @req->scmnd. If not NULL, only take
1106 * ownership of @req->scmnd if it equals @scmnd.
1114 struct scsi_cmnd *scmnd) srp_claim_req()
1119 if (req->scmnd && srp_claim_req()
1120 (!sdev || req->scmnd->device == sdev) && srp_claim_req()
1121 (!scmnd || req->scmnd == scmnd)) { srp_claim_req()
1122 scmnd = req->scmnd; srp_claim_req()
1123 req->scmnd = NULL; srp_claim_req()
1125 scmnd = NULL; srp_claim_req()
1129 return scmnd; srp_claim_req()
1136 * @scmnd: SCSI command associated with @req.
1140 struct scsi_cmnd *scmnd, s32 req_lim_delta) srp_free_req()
1144 srp_unmap_data(scmnd, ch, req); srp_free_req()
1154 struct scsi_cmnd *scmnd = srp_claim_req(ch, req, sdev, NULL); srp_finish_req() local
1156 if (scmnd) { srp_finish_req()
1157 srp_free_req(ch, req, scmnd, 0); srp_finish_req()
1158 scmnd->result = result; srp_finish_req()
1159 scmnd->scsi_done(scmnd); srp_finish_req()
1547 static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_rdma_ch *ch, srp_map_data() argument
1562 if (!scsi_sglist(scmnd) || scmnd->sc_data_direction == DMA_NONE) srp_map_data()
1565 if (scmnd->sc_data_direction != DMA_FROM_DEVICE && srp_map_data()
1566 scmnd->sc_data_direction != DMA_TO_DEVICE) { srp_map_data()
1569 scmnd->sc_data_direction); srp_map_data()
1573 nents = scsi_sg_count(scmnd); srp_map_data()
1574 scat = scsi_sglist(scmnd); srp_map_data()
1579 count = ib_dma_map_sg(ibdev, scat, nents, scmnd->sc_data_direction); srp_map_data()
1670 if (scmnd->sc_data_direction == DMA_TO_DEVICE) srp_map_data()
1679 if (scmnd->sc_data_direction == DMA_TO_DEVICE) srp_map_data()
1784 struct scsi_cmnd *scmnd; srp_process_rsp() local
1797 scmnd = scsi_host_find_tag(target->scsi_host, rsp->tag); srp_process_rsp()
1798 if (scmnd) { srp_process_rsp()
1799 req = (void *)scmnd->host_scribble; srp_process_rsp()
1800 scmnd = srp_claim_req(ch, req, NULL, scmnd); srp_process_rsp()
1802 if (!scmnd) { srp_process_rsp()
1804 "Null scmnd for RSP w/tag %#016llx received on ch %td / QP %#x\n", srp_process_rsp()
1813 scmnd->result = rsp->status; srp_process_rsp()
1816 memcpy(scmnd->sense_buffer, rsp->data + srp_process_rsp()
1823 scsi_set_resid(scmnd, be32_to_cpu(rsp->data_in_res_cnt)); srp_process_rsp()
1825 scsi_set_resid(scmnd, -be32_to_cpu(rsp->data_in_res_cnt)); srp_process_rsp()
1827 scsi_set_resid(scmnd, be32_to_cpu(rsp->data_out_res_cnt)); srp_process_rsp()
1829 scsi_set_resid(scmnd, -be32_to_cpu(rsp->data_out_res_cnt)); srp_process_rsp()
1831 srp_free_req(ch, req, scmnd, srp_process_rsp()
1834 scmnd->host_scribble = NULL; srp_process_rsp()
1835 scmnd->scsi_done(scmnd); srp_process_rsp()
2037 static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd) srp_queuecommand() argument
2061 scmnd->result = srp_chkready(target->rport); srp_queuecommand()
2062 if (unlikely(scmnd->result)) srp_queuecommand()
2065 WARN_ON_ONCE(scmnd->request->tag < 0); srp_queuecommand()
2066 tag = blk_mq_unique_tag(scmnd->request); srp_queuecommand()
2085 scmnd->host_scribble = (void *) req; srp_queuecommand()
2091 int_to_scsilun(scmnd->device->lun, &cmd->lun); srp_queuecommand()
2093 memcpy(cmd->cdb, scmnd->cmnd, scmnd->cmd_len); srp_queuecommand()
2095 req->scmnd = scmnd; srp_queuecommand()
2098 len = srp_map_data(scmnd, ch, req); srp_queuecommand()
2108 scmnd->result = len == -ENOMEM ? srp_queuecommand()
2130 srp_unmap_data(scmnd, ch, req); srp_queuecommand()
2139 req->scmnd = NULL; srp_queuecommand()
2142 if (scmnd->result) { srp_queuecommand()
2143 scmnd->scsi_done(scmnd); srp_queuecommand()
2528 static int srp_abort(struct scsi_cmnd *scmnd) srp_abort() argument
2530 struct srp_target_port *target = host_to_target(scmnd->device->host); srp_abort()
2531 struct srp_request *req = (struct srp_request *) scmnd->host_scribble; srp_abort()
2541 tag = blk_mq_unique_tag(scmnd->request); srp_abort()
2546 if (!srp_claim_req(ch, req, NULL, scmnd)) srp_abort()
2550 if (srp_send_tsk_mgmt(ch, tag, scmnd->device->lun, srp_abort()
2557 srp_free_req(ch, req, scmnd, 0); srp_abort()
2558 scmnd->result = DID_ABORT << 16; srp_abort()
2559 scmnd->scsi_done(scmnd); srp_abort()
2564 static int srp_reset_device(struct scsi_cmnd *scmnd) srp_reset_device() argument
2566 struct srp_target_port *target = host_to_target(scmnd->device->host); srp_reset_device()
2573 if (srp_send_tsk_mgmt(ch, SRP_TAG_NO_REQ, scmnd->device->lun, srp_reset_device()
2584 srp_finish_req(ch, req, scmnd->device, DID_RESET << 16); srp_reset_device()
2591 static int srp_reset_host(struct scsi_cmnd *scmnd) srp_reset_host() argument
2593 struct srp_target_port *target = host_to_target(scmnd->device->host); srp_reset_host()
1111 srp_claim_req(struct srp_rdma_ch *ch, struct srp_request *req, struct scsi_device *sdev, struct scsi_cmnd *scmnd) srp_claim_req() argument
1139 srp_free_req(struct srp_rdma_ch *ch, struct srp_request *req, struct scsi_cmnd *scmnd, s32 req_lim_delta) srp_free_req() argument
H A Dib_srp.h121 struct scsi_cmnd *scmnd; member in struct:srp_request
/linux-4.4.14/drivers/scsi/
H A Dstorvsc_drv.c856 struct scsi_cmnd *scmnd, storvsc_handle_error()
872 switch (scmnd->cmnd[0]) { storvsc_handle_error()
875 set_host_byte(scmnd, DID_PASSTHROUGH); storvsc_handle_error()
885 set_host_byte(scmnd, DID_TARGET_FAILURE); storvsc_handle_error()
900 set_host_byte(scmnd, DID_REQUEUE); storvsc_handle_error()
913 set_host_byte(scmnd, DID_TARGET_FAILURE); storvsc_handle_error()
926 struct scsi_cmnd *scmnd = cmd_request->cmd; storvsc_command_completion() local
927 struct hv_host_device *host_dev = shost_priv(scmnd->device->host); storvsc_command_completion()
941 scmnd->result = vm_srb->scsi_status; storvsc_command_completion()
943 if (scmnd->result) { storvsc_command_completion()
944 if (scsi_normalize_sense(scmnd->sense_buffer, storvsc_command_completion()
946 scsi_print_sense_hdr(scmnd->device, "storvsc", storvsc_command_completion()
951 storvsc_handle_error(vm_srb, scmnd, host, sense_hdr.asc, storvsc_command_completion()
954 scsi_set_resid(scmnd, storvsc_command_completion()
958 scmnd->scsi_done(scmnd); storvsc_command_completion()
1290 static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd) storvsc_host_reset_handler() argument
1292 struct hv_host_device *host_dev = shost_priv(scmnd->device->host); storvsc_host_reset_handler()
1346 static enum blk_eh_timer_return storvsc_eh_timed_out(struct scsi_cmnd *scmnd) storvsc_eh_timed_out() argument
1351 static bool storvsc_scsi_cmd_ok(struct scsi_cmnd *scmnd) storvsc_scsi_cmd_ok() argument
1354 u8 scsi_op = scmnd->cmnd[0]; storvsc_scsi_cmd_ok()
1364 scmnd->result = ILLEGAL_REQUEST << 16; storvsc_scsi_cmd_ok()
1373 static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) storvsc_queuecommand() argument
1378 struct storvsc_cmd_request *cmd_request = scsi_cmd_priv(scmnd); storvsc_queuecommand()
1397 if (!storvsc_scsi_cmd_ok(scmnd)) { storvsc_queuecommand()
1398 scmnd->scsi_done(scmnd); storvsc_queuecommand()
1404 cmd_request->cmd = scmnd; storvsc_queuecommand()
1413 switch (scmnd->sc_data_direction) { storvsc_queuecommand()
1432 scmnd->sc_data_direction); storvsc_queuecommand()
1438 vm_srb->path_id = scmnd->device->channel; storvsc_queuecommand()
1439 vm_srb->target_id = scmnd->device->id; storvsc_queuecommand()
1440 vm_srb->lun = scmnd->device->lun; storvsc_queuecommand()
1442 vm_srb->cdb_length = scmnd->cmd_len; storvsc_queuecommand()
1444 memcpy(vm_srb->cdb, scmnd->cmnd, vm_srb->cdb_length); storvsc_queuecommand()
1446 sgl = (struct scatterlist *)scsi_sglist(scmnd); storvsc_queuecommand()
1447 sg_count = scsi_sg_count(scmnd); storvsc_queuecommand()
1449 length = scsi_bufflen(scmnd); storvsc_queuecommand()
1473 } else if (scsi_sglist(scmnd)) { storvsc_queuecommand()
1476 virt_to_phys(scsi_sglist(scmnd)) & (PAGE_SIZE-1); storvsc_queuecommand()
1478 virt_to_phys(scsi_sglist(scmnd)) >> PAGE_SHIFT; storvsc_queuecommand()
855 storvsc_handle_error(struct vmscsi_request *vm_srb, struct scsi_cmnd *scmnd, struct Scsi_Host *host, u8 asc, u8 ascq) storvsc_handle_error() argument
/linux-4.4.14/drivers/scsi/csiostor/
H A Dcsio_scsi.c86 struct scsi_cmnd *scmnd = csio_scsi_cmnd(ioreq); csio_scsi_match_io() local
90 if (scmnd == NULL) csio_scsi_match_io()
95 ((uint64_t)scmnd->device->lun == sld->oslun)); csio_scsi_match_io()
166 struct scsi_cmnd *scmnd = csio_scsi_cmnd(req); csio_scsi_fcp_cmnd() local
169 if (likely(scmnd->SCp.Message == 0)) { csio_scsi_fcp_cmnd()
170 int_to_scsilun(scmnd->device->lun, &fcp_cmnd->fc_lun); csio_scsi_fcp_cmnd()
174 memcpy(fcp_cmnd->fc_cdb, scmnd->cmnd, 16); csio_scsi_fcp_cmnd()
176 fcp_cmnd->fc_dl = cpu_to_be32(scsi_bufflen(scmnd)); csio_scsi_fcp_cmnd()
187 int_to_scsilun(scmnd->device->lun, &fcp_cmnd->fc_lun); csio_scsi_fcp_cmnd()
188 fcp_cmnd->fc_tm_flags = (uint8_t)scmnd->SCp.Message; csio_scsi_fcp_cmnd()
299 struct scsi_cmnd *scmnd = csio_scsi_cmnd(req); csio_scsi_init_ultptx_dsgl() local
305 scsi_for_each_sg(scmnd, sgel, req->nsge, i) { csio_scsi_init_ultptx_dsgl()
327 xfer_len = scsi_bufflen(scmnd); csio_scsi_init_ultptx_dsgl()
368 struct scsi_cmnd *scmnd = csio_scsi_cmnd(req); csio_scsi_init_read_wr() local
378 wr->xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); csio_scsi_init_read_wr()
379 wr->ini_xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); csio_scsi_init_read_wr()
421 struct scsi_cmnd *scmnd = csio_scsi_cmnd(req); csio_scsi_init_write_wr() local
431 wr->xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); csio_scsi_init_write_wr()
432 wr->ini_xfer_cnt = cpu_to_be32(scsi_bufflen(scmnd)); csio_scsi_init_write_wr()
559 struct scsi_cmnd *scmnd = csio_scsi_cmnd(req); csio_setup_ddp() local
569 scsi_for_each_sg(scmnd, sgel, req->nsge, i) { csio_setup_ddp()
608 xfer_len = scsi_bufflen(scmnd); csio_setup_ddp()
1164 struct scsi_cmnd *scmnd; csio_scsi_cleanup_io_q() local
1171 scmnd = csio_scsi_cmnd(ioreq); list_for_each_safe()
1178 if (scmnd != NULL) list_for_each_safe()
1192 csio_abrt_cls(struct csio_ioreq *ioreq, struct scsi_cmnd *scmnd) csio_abrt_cls() argument
1200 if (csio_scsi_cmnd(ioreq) != scmnd) { csio_abrt_cls()
1238 struct scsi_cmnd *scmnd; csio_scsi_abort_io_q() local
1247 scmnd = csio_scsi_cmnd((struct csio_ioreq *)tmp); list_for_each_safe()
1248 csio_abrt_cls((struct csio_ioreq *)tmp, scmnd); list_for_each_safe()
1491 struct scsi_cmnd *scmnd = (struct scsi_cmnd *)csio_scsi_cmnd(req); csio_scsi_copy_to_sgl() local
1502 bytes_left = scsi_bufflen(scmnd); csio_scsi_copy_to_sgl()
1503 sg = scsi_sglist(scmnd); csio_scsi_copy_to_sgl()
/linux-4.4.14/drivers/s390/scsi/
H A Dzfcp_dbf.h366 * @scmnd: SCSI command which caused this error recovery
370 void zfcp_dbf_scsi_devreset(char *tag, struct scsi_cmnd *scmnd, u8 flag) zfcp_dbf_scsi_devreset() argument
380 _zfcp_dbf_scsi(tmp_tag, 1, scmnd, NULL); zfcp_dbf_scsi_devreset()
H A Dzfcp_fsf.c869 * @scmnd: The SCSI command to abort
873 struct zfcp_fsf_req *zfcp_fsf_abort_fcp_cmnd(struct scsi_cmnd *scmnd) zfcp_fsf_abort_fcp_cmnd() argument
876 struct scsi_device *sdev = scmnd->device; zfcp_fsf_abort_fcp_cmnd()
879 unsigned long old_req_id = (unsigned long) scmnd->host_scribble; zfcp_fsf_abort_fcp_cmnd()
2029 struct scsi_cmnd *scmnd = req->data; zfcp_fsf_fcp_handler_common() local
2030 struct scsi_device *sdev = scmnd->device; zfcp_fsf_fcp_handler_common()
2300 * @scmnd: SCSI command to send the task management command for
2304 struct zfcp_fsf_req *zfcp_fsf_fcp_task_mgmt(struct scsi_cmnd *scmnd, zfcp_fsf_fcp_task_mgmt() argument
2309 struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scmnd->device); zfcp_fsf_fcp_task_mgmt()
2329 req->data = scmnd; zfcp_fsf_fcp_task_mgmt()
2340 zfcp_fc_scsi_to_fcp(fcp_cmnd, scmnd, tm_flags); zfcp_fsf_fcp_task_mgmt()

Completed in 268 milliseconds