Lines Matching refs:sc_cmd

165 	struct scsi_cmnd *sc_cmd = io_req->sc_cmd;  in bnx2fc_scsi_done()  local
182 io_req->sc_cmd = NULL; in bnx2fc_scsi_done()
185 if (!sc_cmd) { in bnx2fc_scsi_done()
191 if (!sc_cmd->device) { in bnx2fc_scsi_done()
195 if (!sc_cmd->device->host) { in bnx2fc_scsi_done()
201 sc_cmd->result = err_code << 16; in bnx2fc_scsi_done()
204 sc_cmd, host_byte(sc_cmd->result), sc_cmd->retries, in bnx2fc_scsi_done()
205 sc_cmd->allowed); in bnx2fc_scsi_done()
206 scsi_set_resid(sc_cmd, scsi_bufflen(sc_cmd)); in bnx2fc_scsi_done()
207 sc_cmd->SCp.ptr = NULL; in bnx2fc_scsi_done()
208 sc_cmd->scsi_done(sc_cmd); in bnx2fc_scsi_done()
661 static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags) in bnx2fc_initiate_tmf() argument
673 struct Scsi_Host *host = sc_cmd->device->host; in bnx2fc_initiate_tmf()
683 rport = starget_to_rport(scsi_target(sc_cmd->device)); in bnx2fc_initiate_tmf()
694 rc = fc_block_scsi_eh(sc_cmd); in bnx2fc_initiate_tmf()
723 io_req->sc_cmd = sc_cmd; in bnx2fc_initiate_tmf()
745 memset(fcp_cmnd->fc_cdb, 0, sc_cmd->cmd_len); in bnx2fc_initiate_tmf()
768 sc_cmd->SCp.ptr = (char *)io_req; in bnx2fc_initiate_tmf()
872 abts_io_req->sc_cmd = NULL; in bnx2fc_initiate_abts()
967 seq_clnp_req->sc_cmd = NULL; in bnx2fc_initiate_seq_cleanup()
1027 cleanup_io_req->sc_cmd = NULL; in bnx2fc_initiate_cleanup()
1065 int bnx2fc_eh_target_reset(struct scsi_cmnd *sc_cmd) in bnx2fc_eh_target_reset() argument
1067 return bnx2fc_initiate_tmf(sc_cmd, FCP_TMF_TGT_RESET); in bnx2fc_eh_target_reset()
1078 int bnx2fc_eh_device_reset(struct scsi_cmnd *sc_cmd) in bnx2fc_eh_device_reset() argument
1080 return bnx2fc_initiate_tmf(sc_cmd, FCP_TMF_LUN_RESET); in bnx2fc_eh_device_reset()
1124 int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd) in bnx2fc_eh_abort() argument
1126 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); in bnx2fc_eh_abort()
1134 rc = fc_block_scsi_eh(sc_cmd); in bnx2fc_eh_abort()
1138 lport = shost_priv(sc_cmd->device->host); in bnx2fc_eh_abort()
1149 io_req = (struct bnx2fc_cmd *)sc_cmd->SCp.ptr; in bnx2fc_eh_abort()
1421 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_lun_reset_cmpl() local
1424 u64 tm_lun = sc_cmd->device->lun; in bnx2fc_lun_reset_cmpl()
1436 lun = cmd->sc_cmd->device->lun; in bnx2fc_lun_reset_cmpl()
1493 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_process_tm_compl() local
1540 if (!sc_cmd->SCp.ptr) { in bnx2fc_process_tm_compl()
1548 sc_cmd->result = DID_OK << 16; in bnx2fc_process_tm_compl()
1551 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; in bnx2fc_process_tm_compl()
1554 scsi_set_resid(sc_cmd, io_req->fcp_resid); in bnx2fc_process_tm_compl()
1563 sc_cmd = io_req->sc_cmd; in bnx2fc_process_tm_compl()
1564 io_req->sc_cmd = NULL; in bnx2fc_process_tm_compl()
1577 sc_cmd->SCp.ptr = NULL; in bnx2fc_process_tm_compl()
1578 sc_cmd->scsi_done(sc_cmd); in bnx2fc_process_tm_compl()
1616 struct scsi_cmnd *sc = io_req->sc_cmd; in bnx2fc_map_sg()
1659 struct scsi_cmnd *sc = io_req->sc_cmd; in bnx2fc_build_bd_list_from_sg()
1679 struct scsi_cmnd *sc = io_req->sc_cmd; in bnx2fc_unmap_sg_list()
1697 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_build_fcp_cmnd() local
1701 int_to_scsilun(sc_cmd->device->lun, &fcp_cmnd->fc_lun); in bnx2fc_build_fcp_cmnd()
1704 memcpy(fcp_cmnd->fc_cdb, sc_cmd->cmnd, sc_cmd->cmd_len); in bnx2fc_build_fcp_cmnd()
1717 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_parse_fcp_rsp() local
1734 CMD_SCSI_STATUS(sc_cmd) = io_req->cdb_status = in bnx2fc_parse_fcp_rsp()
1793 memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); in bnx2fc_parse_fcp_rsp()
1795 memcpy(sc_cmd->sense_buffer, rq_data, fcp_sns_len); in bnx2fc_parse_fcp_rsp()
1812 struct scsi_cmnd *sc_cmd) in bnx2fc_queuecommand() argument
1815 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); in bnx2fc_queuecommand()
1824 sc_cmd->result = rval; in bnx2fc_queuecommand()
1825 sc_cmd->scsi_done(sc_cmd); in bnx2fc_queuecommand()
1862 io_req->sc_cmd = sc_cmd; in bnx2fc_queuecommand()
1882 struct scsi_cmnd *sc_cmd; in bnx2fc_process_scsi_cmd_compl() local
1900 sc_cmd = io_req->sc_cmd; in bnx2fc_process_scsi_cmd_compl()
1901 if (sc_cmd == NULL) { in bnx2fc_process_scsi_cmd_compl()
1913 host = sc_cmd->device->host; in bnx2fc_process_scsi_cmd_compl()
1914 if (!sc_cmd->SCp.ptr) { in bnx2fc_process_scsi_cmd_compl()
1937 io_req->sc_cmd = NULL; in bnx2fc_process_scsi_cmd_compl()
1943 sc_cmd->result = DID_OK << 16; in bnx2fc_process_scsi_cmd_compl()
1949 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; in bnx2fc_process_scsi_cmd_compl()
1961 scsi_set_resid(sc_cmd, io_req->fcp_resid); in bnx2fc_process_scsi_cmd_compl()
1968 sc_cmd->SCp.ptr = NULL; in bnx2fc_process_scsi_cmd_compl()
1969 sc_cmd->scsi_done(sc_cmd); in bnx2fc_process_scsi_cmd_compl()
1978 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_post_io_req() local
1993 io_req->data_xfer_len = scsi_bufflen(sc_cmd); in bnx2fc_post_io_req()
1994 sc_cmd->SCp.ptr = (char *)io_req; in bnx2fc_post_io_req()
1997 if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { in bnx2fc_post_io_req()
2001 } else if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) { in bnx2fc_post_io_req()