Lines Matching refs:sc_cmd

209 	struct scsi_cmnd *sc_cmd = io_req->sc_cmd;  in bnx2fc_scsi_done()  local
226 io_req->sc_cmd = NULL; in bnx2fc_scsi_done()
227 if (!sc_cmd) { in bnx2fc_scsi_done()
233 sc_cmd->result = err_code << 16; in bnx2fc_scsi_done()
236 sc_cmd, host_byte(sc_cmd->result), sc_cmd->retries, in bnx2fc_scsi_done()
237 sc_cmd->allowed); in bnx2fc_scsi_done()
238 scsi_set_resid(sc_cmd, scsi_bufflen(sc_cmd)); in bnx2fc_scsi_done()
239 sc_cmd->SCp.ptr = NULL; in bnx2fc_scsi_done()
240 sc_cmd->scsi_done(sc_cmd); in bnx2fc_scsi_done()
689 static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags) in bnx2fc_initiate_tmf() argument
701 struct Scsi_Host *host = sc_cmd->device->host; in bnx2fc_initiate_tmf()
711 rport = starget_to_rport(scsi_target(sc_cmd->device)); in bnx2fc_initiate_tmf()
722 rc = fc_block_scsi_eh(sc_cmd); in bnx2fc_initiate_tmf()
751 io_req->sc_cmd = sc_cmd; in bnx2fc_initiate_tmf()
773 memset(fcp_cmnd->fc_cdb, 0, sc_cmd->cmd_len); in bnx2fc_initiate_tmf()
796 sc_cmd->SCp.ptr = (char *)io_req; in bnx2fc_initiate_tmf()
900 abts_io_req->sc_cmd = NULL; in bnx2fc_initiate_abts()
995 seq_clnp_req->sc_cmd = NULL; in bnx2fc_initiate_seq_cleanup()
1055 cleanup_io_req->sc_cmd = NULL; in bnx2fc_initiate_cleanup()
1093 int bnx2fc_eh_target_reset(struct scsi_cmnd *sc_cmd) in bnx2fc_eh_target_reset() argument
1095 return bnx2fc_initiate_tmf(sc_cmd, FCP_TMF_TGT_RESET); in bnx2fc_eh_target_reset()
1106 int bnx2fc_eh_device_reset(struct scsi_cmnd *sc_cmd) in bnx2fc_eh_device_reset() argument
1108 return bnx2fc_initiate_tmf(sc_cmd, FCP_TMF_LUN_RESET); in bnx2fc_eh_device_reset()
1161 int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd) in bnx2fc_eh_abort() argument
1163 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); in bnx2fc_eh_abort()
1171 rc = fc_block_scsi_eh(sc_cmd); in bnx2fc_eh_abort()
1175 lport = shost_priv(sc_cmd->device->host); in bnx2fc_eh_abort()
1186 io_req = (struct bnx2fc_cmd *)sc_cmd->SCp.ptr; in bnx2fc_eh_abort()
1451 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_lun_reset_cmpl() local
1454 u64 tm_lun = sc_cmd->device->lun; in bnx2fc_lun_reset_cmpl()
1466 lun = cmd->sc_cmd->device->lun; in bnx2fc_lun_reset_cmpl()
1523 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_process_tm_compl() local
1570 if (!sc_cmd->SCp.ptr) { in bnx2fc_process_tm_compl()
1578 sc_cmd->result = DID_OK << 16; in bnx2fc_process_tm_compl()
1581 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; in bnx2fc_process_tm_compl()
1584 scsi_set_resid(sc_cmd, io_req->fcp_resid); in bnx2fc_process_tm_compl()
1593 sc_cmd = io_req->sc_cmd; in bnx2fc_process_tm_compl()
1594 io_req->sc_cmd = NULL; in bnx2fc_process_tm_compl()
1607 sc_cmd->SCp.ptr = NULL; in bnx2fc_process_tm_compl()
1608 sc_cmd->scsi_done(sc_cmd); in bnx2fc_process_tm_compl()
1646 struct scsi_cmnd *sc = io_req->sc_cmd; in bnx2fc_map_sg()
1689 struct scsi_cmnd *sc = io_req->sc_cmd; in bnx2fc_build_bd_list_from_sg()
1709 struct scsi_cmnd *sc = io_req->sc_cmd; in bnx2fc_unmap_sg_list()
1727 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_build_fcp_cmnd() local
1731 int_to_scsilun(sc_cmd->device->lun, &fcp_cmnd->fc_lun); in bnx2fc_build_fcp_cmnd()
1734 memcpy(fcp_cmnd->fc_cdb, sc_cmd->cmnd, sc_cmd->cmd_len); in bnx2fc_build_fcp_cmnd()
1747 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_parse_fcp_rsp() local
1761 CMD_SCSI_STATUS(sc_cmd) = io_req->cdb_status = in bnx2fc_parse_fcp_rsp()
1820 memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); in bnx2fc_parse_fcp_rsp()
1822 memcpy(sc_cmd->sense_buffer, rq_data, fcp_sns_len); in bnx2fc_parse_fcp_rsp()
1839 struct scsi_cmnd *sc_cmd) in bnx2fc_queuecommand() argument
1842 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); in bnx2fc_queuecommand()
1851 sc_cmd->result = rval; in bnx2fc_queuecommand()
1852 sc_cmd->scsi_done(sc_cmd); in bnx2fc_queuecommand()
1889 io_req->sc_cmd = sc_cmd; in bnx2fc_queuecommand()
1909 struct scsi_cmnd *sc_cmd; in bnx2fc_process_scsi_cmd_compl() local
1926 sc_cmd = io_req->sc_cmd; in bnx2fc_process_scsi_cmd_compl()
1927 if (sc_cmd == NULL) { in bnx2fc_process_scsi_cmd_compl()
1939 host = sc_cmd->device->host; in bnx2fc_process_scsi_cmd_compl()
1940 if (!sc_cmd->SCp.ptr) { in bnx2fc_process_scsi_cmd_compl()
1963 io_req->sc_cmd = NULL; in bnx2fc_process_scsi_cmd_compl()
1969 sc_cmd->result = DID_OK << 16; in bnx2fc_process_scsi_cmd_compl()
1975 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; in bnx2fc_process_scsi_cmd_compl()
1987 scsi_set_resid(sc_cmd, io_req->fcp_resid); in bnx2fc_process_scsi_cmd_compl()
1994 sc_cmd->SCp.ptr = NULL; in bnx2fc_process_scsi_cmd_compl()
1995 sc_cmd->scsi_done(sc_cmd); in bnx2fc_process_scsi_cmd_compl()
2004 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_post_io_req() local
2019 io_req->data_xfer_len = scsi_bufflen(sc_cmd); in bnx2fc_post_io_req()
2020 sc_cmd->SCp.ptr = (char *)io_req; in bnx2fc_post_io_req()
2023 if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { in bnx2fc_post_io_req()
2027 } else if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) { in bnx2fc_post_io_req()