• Home
  • Raw
  • Download

Lines Matching refs:sc_cmd

376 	io_req->sc_cmd = NULL;  in qedf_alloc_cmd()
449 WARN_ON(io_req->sc_cmd); in qedf_release_cmd()
478 struct scsi_cmnd *sc = io_req->sc_cmd; in qedf_map_sg()
535 struct scsi_cmnd *sc = io_req->sc_cmd; in qedf_build_bd_list_from_sg()
556 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in qedf_build_fcp_cmnd() local
562 int_to_scsilun(sc_cmd->device->lun, in qedf_build_fcp_cmnd()
575 if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) in qedf_build_fcp_cmnd()
577 else if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) in qedf_build_fcp_cmnd()
585 memcpy(fcp_cmnd->fc_cdb, sc_cmd->cmnd, sc_cmd->cmd_len); in qedf_build_fcp_cmnd()
596 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in qedf_init_task() local
618 if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) { in qedf_init_task()
648 scsi_bufflen(io_req->sc_cmd); in qedf_init_task()
810 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in qedf_trace_io() local
820 io_log->lun = sc_cmd->device->lun; in qedf_trace_io()
821 io_log->op = op = sc_cmd->cmnd[0]; in qedf_trace_io()
822 io_log->lba[0] = sc_cmd->cmnd[2]; in qedf_trace_io()
823 io_log->lba[1] = sc_cmd->cmnd[3]; in qedf_trace_io()
824 io_log->lba[2] = sc_cmd->cmnd[4]; in qedf_trace_io()
825 io_log->lba[3] = sc_cmd->cmnd[5]; in qedf_trace_io()
826 io_log->bufflen = scsi_bufflen(sc_cmd); in qedf_trace_io()
827 io_log->sg_count = scsi_sg_count(sc_cmd); in qedf_trace_io()
828 io_log->result = sc_cmd->result; in qedf_trace_io()
854 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in qedf_post_io_req() local
855 struct Scsi_Host *host = sc_cmd->device->host; in qedf_post_io_req()
864 io_req->data_xfer_len = scsi_bufflen(sc_cmd); in qedf_post_io_req()
865 sc_cmd->SCp.ptr = (char *)io_req; in qedf_post_io_req()
871 if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) { in qedf_post_io_req()
874 } else if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) { in qedf_post_io_req()
888 io_req->sc_cmd = NULL; in qedf_post_io_req()
897 io_req->sc_cmd = NULL; in qedf_post_io_req()
903 io_req->lun = (int)sc_cmd->device->lun; in qedf_post_io_req()
916 io_req->sc_cmd = NULL; in qedf_post_io_req()
929 if (qedf_io_tracing && io_req->sc_cmd) in qedf_post_io_req()
936 qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd) in qedf_queuecommand() argument
940 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); in qedf_queuecommand()
949 num_sgs = scsi_sg_count(sc_cmd); in qedf_queuecommand()
950 if (scsi_sg_count(sc_cmd) > QEDF_MAX_BDS_PER_CMD) { in qedf_queuecommand()
954 sc_cmd->result = DID_ERROR; in qedf_queuecommand()
955 sc_cmd->scsi_done(sc_cmd); in qedf_queuecommand()
964 sc_cmd->result = DID_NO_CONNECT << 16; in qedf_queuecommand()
965 sc_cmd->scsi_done(sc_cmd); in qedf_queuecommand()
972 sc_cmd); in qedf_queuecommand()
973 sc_cmd->result = DID_NO_CONNECT << 16; in qedf_queuecommand()
974 sc_cmd->scsi_done(sc_cmd); in qedf_queuecommand()
983 sc_cmd->result = rval; in qedf_queuecommand()
984 sc_cmd->scsi_done(sc_cmd); in qedf_queuecommand()
1039 io_req->sc_cmd = sc_cmd; in qedf_queuecommand()
1059 struct scsi_cmnd *sc_cmd = io_req->sc_cmd; in qedf_parse_fcp_rsp() local
1073 CMD_SCSI_STATUS(sc_cmd) = io_req->cdb_status = in qedf_parse_fcp_rsp()
1105 if (sc_cmd->sense_buffer) { in qedf_parse_fcp_rsp()
1106 memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); in qedf_parse_fcp_rsp()
1108 memcpy(sc_cmd->sense_buffer, sense_data, in qedf_parse_fcp_rsp()
1115 struct scsi_cmnd *sc = io_req->sc_cmd; in qedf_unmap_sg_list()
1127 struct scsi_cmnd *sc_cmd; in qedf_scsi_completion() local
1150 sc_cmd = io_req->sc_cmd; in qedf_scsi_completion()
1153 if (!sc_cmd) { in qedf_scsi_completion()
1158 if (!sc_cmd->SCp.ptr) { in qedf_scsi_completion()
1164 if (!sc_cmd->device) { in qedf_scsi_completion()
1166 "Device for sc_cmd %p is NULL.\n", sc_cmd); in qedf_scsi_completion()
1170 if (!sc_cmd->request) { in qedf_scsi_completion()
1172 "sc_cmd=%p.\n", sc_cmd); in qedf_scsi_completion()
1176 if (!sc_cmd->request->q) { in qedf_scsi_completion()
1178 "is not valid, sc_cmd=%p.\n", sc_cmd); in qedf_scsi_completion()
1190 sc_cmd->device->lun == (u64)fcport->lun_reset_lun)) { in qedf_scsi_completion()
1207 sc_cmd->result = DID_BUS_BUSY << 16; in qedf_scsi_completion()
1218 cqe->cqe_info.rsp_info.fw_residual, sc_cmd->cmnd[2], in qedf_scsi_completion()
1219 sc_cmd->cmnd[3], sc_cmd->cmnd[4], sc_cmd->cmnd[5]); in qedf_scsi_completion()
1222 sc_cmd->result = (DID_ERROR << 16) | io_req->cdb_status; in qedf_scsi_completion()
1224 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; in qedf_scsi_completion()
1230 scsi_set_resid(sc_cmd, scsi_bufflen(sc_cmd)); in qedf_scsi_completion()
1238 sc_cmd->result = DID_OK << 16; in qedf_scsi_completion()
1245 qedf->lport->host->host_no, sc_cmd->device->id, in qedf_scsi_completion()
1246 sc_cmd->device->lun, io_req->xid, in qedf_scsi_completion()
1247 sc_cmd->cmnd[0], sc_cmd->cmnd[2], sc_cmd->cmnd[3], in qedf_scsi_completion()
1248 sc_cmd->cmnd[4], sc_cmd->cmnd[5], in qedf_scsi_completion()
1251 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status; in qedf_scsi_completion()
1277 scsi_set_resid(sc_cmd, io_req->fcp_resid); in qedf_scsi_completion()
1325 io_req->sc_cmd = NULL; in qedf_scsi_completion()
1326 sc_cmd->SCp.ptr = NULL; in qedf_scsi_completion()
1327 sc_cmd->scsi_done(sc_cmd); in qedf_scsi_completion()
1335 struct scsi_cmnd *sc_cmd; in qedf_scsi_done() local
1356 sc_cmd = io_req->sc_cmd; in qedf_scsi_done()
1358 if (!sc_cmd) { in qedf_scsi_done()
1363 if (!virt_addr_valid(sc_cmd)) { in qedf_scsi_done()
1364 QEDF_ERR(&qedf->dbg_ctx, "sc_cmd=%p is not valid.", sc_cmd); in qedf_scsi_done()
1368 if (!sc_cmd->SCp.ptr) { in qedf_scsi_done()
1374 if (!sc_cmd->device) { in qedf_scsi_done()
1376 sc_cmd); in qedf_scsi_done()
1380 if (!virt_addr_valid(sc_cmd->device)) { in qedf_scsi_done()
1382 "Device pointer for sc_cmd %p is bad.\n", sc_cmd); in qedf_scsi_done()
1386 if (!sc_cmd->sense_buffer) { in qedf_scsi_done()
1389 sc_cmd); in qedf_scsi_done()
1393 if (!virt_addr_valid(sc_cmd->sense_buffer)) { in qedf_scsi_done()
1396 sc_cmd); in qedf_scsi_done()
1400 if (!sc_cmd->scsi_done) { in qedf_scsi_done()
1403 sc_cmd); in qedf_scsi_done()
1409 sc_cmd->result = result << 16; in qedf_scsi_done()
1414 qedf->lport->host->host_no, sc_cmd->device->id, in qedf_scsi_done()
1415 sc_cmd->device->lun, sc_cmd, sc_cmd->result, sc_cmd->cmnd[0], in qedf_scsi_done()
1416 sc_cmd->cmnd[2], sc_cmd->cmnd[3], sc_cmd->cmnd[4], in qedf_scsi_done()
1417 sc_cmd->cmnd[5], sc_cmd->allowed, sc_cmd->retries, in qedf_scsi_done()
1424 scsi_set_resid(sc_cmd, scsi_bufflen(sc_cmd)); in qedf_scsi_done()
1429 io_req->sc_cmd = NULL; in qedf_scsi_done()
1430 sc_cmd->SCp.ptr = NULL; in qedf_scsi_done()
1431 sc_cmd->scsi_done(sc_cmd); in qedf_scsi_done()
1440 io_req->sc_cmd = NULL; in qedf_scsi_done()
1554 io_req->sc_cmd->device->lun == (u64)io_req->fcport->lun_reset_lun)) { in qedf_process_error_detect()
1779 if (!io_req->sc_cmd) in qedf_flush_active_ios()
1781 if (!io_req->sc_cmd->device) { in qedf_flush_active_ios()
1784 io_req->sc_cmd); in qedf_flush_active_ios()
1786 io_req->sc_cmd = NULL; in qedf_flush_active_ios()
1848 io_req->sc_cmd, in qedf_flush_active_ios()
1932 io_req->xid, io_req->sc_cmd); in qedf_initiate_abts()
2046 if (io_req->sc_cmd) { in qedf_process_abts_compl()
2229 io_req->xid, io_req->sc_cmd, io_req->cmd_type, io_req->flags, in qedf_initiate_cleanup()
2270 io_req->sc_cmd = NULL; in qedf_initiate_cleanup()
2275 if (io_req->sc_cmd) { in qedf_initiate_cleanup()
2304 static int qedf_execute_tmf(struct qedf_rport *fcport, struct scsi_cmnd *sc_cmd, in qedf_execute_tmf() argument
2319 if (!sc_cmd) { in qedf_execute_tmf()
2324 lun = (int)sc_cmd->device->lun; in qedf_execute_tmf()
2344 io_req->sc_cmd = sc_cmd; in qedf_execute_tmf()
2390 io_req->sc_cmd = NULL; in qedf_execute_tmf()
2427 int qedf_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags) in qedf_initiate_tmf() argument
2429 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device)); in qedf_initiate_tmf()
2433 struct fc_lport *lport = shost_priv(sc_cmd->device->host); in qedf_initiate_tmf()
2442 tm_flags, sc_cmd, sc_cmd->cmd_len ? sc_cmd->cmnd[0] : 0xff, in qedf_initiate_tmf()
2443 rport->scsi_target_id, (int)sc_cmd->device->lun); in qedf_initiate_tmf()
2454 if (sc_cmd->SCp.ptr) { in qedf_initiate_tmf()
2455 io_req = (struct qedf_ioreq *)sc_cmd->SCp.ptr; in qedf_initiate_tmf()
2469 rc = fc_block_scsi_eh(sc_cmd); in qedf_initiate_tmf()
2517 rc = qedf_execute_tmf(fcport, sc_cmd, tm_flags); in qedf_initiate_tmf()
2534 io_req->sc_cmd = NULL; in qedf_process_tmf_compl()