Lines Matching refs:scmnd

551 static void srp_unmap_data(struct scsi_cmnd *scmnd,  in srp_unmap_data()  argument
558 if (!scsi_sglist(scmnd) || in srp_unmap_data()
559 (scmnd->sc_data_direction != DMA_TO_DEVICE && in srp_unmap_data()
560 scmnd->sc_data_direction != DMA_FROM_DEVICE)) in srp_unmap_data()
567 ib_dma_unmap_sg(ibdev, scsi_sglist(scmnd), scsi_sg_count(scmnd), in srp_unmap_data()
568 scmnd->sc_data_direction); in srp_unmap_data()
576 srp_unmap_data(req->scmnd, target, req); in srp_remove_req()
579 req->scmnd = NULL; in srp_remove_req()
586 req->scmnd->result = DID_RESET << 16; in srp_reset_req()
587 req->scmnd->scsi_done(req->scmnd); in srp_reset_req()
625 if (req->scmnd) in srp_reconnect_target()
800 static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target, in srp_map_data() argument
813 if (!scsi_sglist(scmnd) || scmnd->sc_data_direction == DMA_NONE) in srp_map_data()
816 if (scmnd->sc_data_direction != DMA_FROM_DEVICE && in srp_map_data()
817 scmnd->sc_data_direction != DMA_TO_DEVICE) { in srp_map_data()
820 scmnd->sc_data_direction); in srp_map_data()
824 nents = scsi_sg_count(scmnd); in srp_map_data()
825 scat = scsi_sglist(scmnd); in srp_map_data()
830 count = ib_dma_map_sg(ibdev, scat, nents, scmnd->sc_data_direction); in srp_map_data()
933 if (scmnd->sc_data_direction == DMA_TO_DEVICE) in srp_map_data()
942 if (scmnd->sc_data_direction == DMA_TO_DEVICE) in srp_map_data()
1044 struct scsi_cmnd *scmnd; in srp_process_rsp() local
1058 scmnd = req->scmnd; in srp_process_rsp()
1059 if (!scmnd) in srp_process_rsp()
1063 scmnd->result = rsp->status; in srp_process_rsp()
1066 memcpy(scmnd->sense_buffer, rsp->data + in srp_process_rsp()
1073 scsi_set_resid(scmnd, be32_to_cpu(rsp->data_out_res_cnt)); in srp_process_rsp()
1075 scsi_set_resid(scmnd, be32_to_cpu(rsp->data_in_res_cnt)); in srp_process_rsp()
1078 scmnd->host_scribble = NULL; in srp_process_rsp()
1079 scmnd->scsi_done(scmnd); in srp_process_rsp()
1239 static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd) in srp_queuecommand() argument
1254 scmnd->result = DID_BAD_TARGET << 16; in srp_queuecommand()
1255 scmnd->scsi_done(scmnd); in srp_queuecommand()
1272 scmnd->result = 0; in srp_queuecommand()
1273 scmnd->host_scribble = (void *) req; in srp_queuecommand()
1279 cmd->lun = cpu_to_be64((u64) scmnd->device->lun << 48); in srp_queuecommand()
1281 memcpy(cmd->cdb, scmnd->cmnd, scmnd->cmd_len); in srp_queuecommand()
1283 req->scmnd = scmnd; in srp_queuecommand()
1286 len = srp_map_data(scmnd, target, req); in srp_queuecommand()
1304 srp_unmap_data(scmnd, target, req); in srp_queuecommand()
1612 static int srp_abort(struct scsi_cmnd *scmnd) in srp_abort() argument
1614 struct srp_target_port *target = host_to_target(scmnd->device->host); in srp_abort()
1615 struct srp_request *req = (struct srp_request *) scmnd->host_scribble; in srp_abort()
1622 if (srp_send_tsk_mgmt(target, req->index, scmnd->device->lun, in srp_abort()
1626 if (req->scmnd) { in srp_abort()
1629 scmnd->result = DID_ABORT << 16; in srp_abort()
1637 static int srp_reset_device(struct scsi_cmnd *scmnd) in srp_reset_device() argument
1639 struct srp_target_port *target = host_to_target(scmnd->device->host); in srp_reset_device()
1646 if (srp_send_tsk_mgmt(target, SRP_TAG_NO_REQ, scmnd->device->lun, in srp_reset_device()
1654 if (req->scmnd && req->scmnd->device == scmnd->device) in srp_reset_device()
1661 static int srp_reset_host(struct scsi_cmnd *scmnd) in srp_reset_host() argument
1663 struct srp_target_port *target = host_to_target(scmnd->device->host); in srp_reset_host()