Lines Matching refs:sc_cmd

164 	struct scsi_cmnd *sc_cmd = io_req->sc_cmd;  in bnx2fc_scsi_done()  local
181 io_req->sc_cmd = NULL; in bnx2fc_scsi_done()
182 if (!sc_cmd) { in bnx2fc_scsi_done()
188 sc_cmd->result = err_code << 16; in bnx2fc_scsi_done()
191 sc_cmd, host_byte(sc_cmd->result), sc_cmd->retries, in bnx2fc_scsi_done()
192 sc_cmd->allowed); in bnx2fc_scsi_done()
193 scsi_set_resid(sc_cmd, scsi_bufflen(sc_cmd)); in bnx2fc_scsi_done()
194 sc_cmd->SCp.ptr = NULL; in bnx2fc_scsi_done()
195 sc_cmd->scsi_done(sc_cmd); in bnx2fc_scsi_done()
648 static int bnx2fc_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags) in bnx2fc_initiate_tmf() argument
660 struct Scsi_Host *host = sc_cmd->device->host; in bnx2fc_initiate_tmf()
670 rport = starget_to_rport(scsi_target(sc_cmd->device)); in bnx2fc_initiate_tmf()
681 rc = fc_block_scsi_eh(sc_cmd); in bnx2fc_initiate_tmf()
710 io_req->sc_cmd = sc_cmd; in bnx2fc_initiate_tmf()
732 memset(fcp_cmnd->fc_cdb, 0, sc_cmd->cmd_len); in bnx2fc_initiate_tmf()
755 sc_cmd->SCp.ptr = (char *)io_req; in bnx2fc_initiate_tmf()
859 abts_io_req->sc_cmd = NULL; in bnx2fc_initiate_abts()
954 seq_clnp_req->sc_cmd = NULL; in bnx2fc_initiate_seq_cleanup()
1014 cleanup_io_req->sc_cmd = NULL; in bnx2fc_initiate_cleanup()
1052 int bnx2fc_eh_target_reset(struct scsi_cmnd *sc_cmd) in bnx2fc_eh_target_reset() argument
1054 return bnx2fc_initiate_tmf(sc_cmd, FCP_TMF_TGT_RESET); in bnx2fc_eh_target_reset()
1065 int bnx2fc_eh_device_reset(struct scsi_cmnd *sc_cmd) in bnx2fc_eh_device_reset() argument
1067 return bnx2fc_initiate_tmf(sc_cmd, FCP_TMF_LUN_RESET); in bnx2fc_eh_device_reset()
1100 int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd) in bnx2fc_eh_abort() argument
1102 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); in bnx2fc_eh_abort()
1110 rc = fc_block_scsi_eh(sc_cmd); in bnx2fc_eh_abort()
1114 lport = shost_priv(sc_cmd->device->host); in bnx2fc_eh_abort()
1125 io_req = (struct bnx2fc_cmd *)sc_cmd->SCp.ptr; in bnx2fc_eh_abort()
1390 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_lun_reset_cmpl() local
1393 u64 tm_lun = sc_cmd->device->lun; in bnx2fc_lun_reset_cmpl()
1405 lun = cmd->sc_cmd->device->lun; in bnx2fc_lun_reset_cmpl()
1462 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_process_tm_compl() local
1509 if (!sc_cmd->SCp.ptr) { in bnx2fc_process_tm_compl()
1517 sc_cmd->result = DID_OK << 16; in bnx2fc_process_tm_compl()
1520 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; in bnx2fc_process_tm_compl()
1523 scsi_set_resid(sc_cmd, io_req->fcp_resid); in bnx2fc_process_tm_compl()
1532 sc_cmd = io_req->sc_cmd; in bnx2fc_process_tm_compl()
1533 io_req->sc_cmd = NULL; in bnx2fc_process_tm_compl()
1546 sc_cmd->SCp.ptr = NULL; in bnx2fc_process_tm_compl()
1547 sc_cmd->scsi_done(sc_cmd); in bnx2fc_process_tm_compl()
1585 struct scsi_cmnd *sc = io_req->sc_cmd; in bnx2fc_map_sg()
1628 struct scsi_cmnd *sc = io_req->sc_cmd; in bnx2fc_build_bd_list_from_sg()
1648 struct scsi_cmnd *sc = io_req->sc_cmd; in bnx2fc_unmap_sg_list()
1666 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_build_fcp_cmnd() local
1670 int_to_scsilun(sc_cmd->device->lun, &fcp_cmnd->fc_lun); in bnx2fc_build_fcp_cmnd()
1673 memcpy(fcp_cmnd->fc_cdb, sc_cmd->cmnd, sc_cmd->cmd_len); in bnx2fc_build_fcp_cmnd()
1686 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_parse_fcp_rsp() local
1703 CMD_SCSI_STATUS(sc_cmd) = io_req->cdb_status = in bnx2fc_parse_fcp_rsp()
1762 memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); in bnx2fc_parse_fcp_rsp()
1764 memcpy(sc_cmd->sense_buffer, rq_data, fcp_sns_len); in bnx2fc_parse_fcp_rsp()
1781 struct scsi_cmnd *sc_cmd) in bnx2fc_queuecommand() argument
1784 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); in bnx2fc_queuecommand()
1793 sc_cmd->result = rval; in bnx2fc_queuecommand()
1794 sc_cmd->scsi_done(sc_cmd); in bnx2fc_queuecommand()
1831 io_req->sc_cmd = sc_cmd; in bnx2fc_queuecommand()
1851 struct scsi_cmnd *sc_cmd; in bnx2fc_process_scsi_cmd_compl() local
1868 sc_cmd = io_req->sc_cmd; in bnx2fc_process_scsi_cmd_compl()
1869 if (sc_cmd == NULL) { in bnx2fc_process_scsi_cmd_compl()
1881 host = sc_cmd->device->host; in bnx2fc_process_scsi_cmd_compl()
1882 if (!sc_cmd->SCp.ptr) { in bnx2fc_process_scsi_cmd_compl()
1905 io_req->sc_cmd = NULL; in bnx2fc_process_scsi_cmd_compl()
1911 sc_cmd->result = DID_OK << 16; in bnx2fc_process_scsi_cmd_compl()
1917 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; in bnx2fc_process_scsi_cmd_compl()
1929 scsi_set_resid(sc_cmd, io_req->fcp_resid); in bnx2fc_process_scsi_cmd_compl()
1936 sc_cmd->SCp.ptr = NULL; in bnx2fc_process_scsi_cmd_compl()
1937 sc_cmd->scsi_done(sc_cmd); in bnx2fc_process_scsi_cmd_compl()
1946 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in bnx2fc_post_io_req() local
1961 io_req->data_xfer_len = scsi_bufflen(sc_cmd); in bnx2fc_post_io_req()
1962 sc_cmd->SCp.ptr = (char *)io_req; in bnx2fc_post_io_req()
1965 if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { in bnx2fc_post_io_req()
1969 } else if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) { in bnx2fc_post_io_req()