Lines Matching defs:sc_cmd
370 /* Clear any stale sc_cmd back pointer */
371 io_req->sc_cmd = NULL;
444 WARN_ON(io_req->sc_cmd);
473 struct scsi_cmnd *sc = io_req->sc_cmd;
530 struct scsi_cmnd *sc = io_req->sc_cmd;
551 struct scsi_cmnd *sc_cmd = io_req->sc_cmd;
557 int_to_scsilun(sc_cmd->device->lun,
570 if (sc_cmd->sc_data_direction == DMA_TO_DEVICE)
572 else if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE)
580 memcpy(fcp_cmnd->fc_cdb, sc_cmd->cmnd, sc_cmd->cmd_len);
591 struct scsi_cmnd *sc_cmd = io_req->sc_cmd;
613 if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) {
643 scsi_bufflen(io_req->sc_cmd);
805 struct scsi_cmnd *sc_cmd = io_req->sc_cmd;
814 io_log->lun = sc_cmd->device->lun;
815 io_log->op = sc_cmd->cmnd[0];
816 io_log->lba[0] = sc_cmd->cmnd[2];
817 io_log->lba[1] = sc_cmd->cmnd[3];
818 io_log->lba[2] = sc_cmd->cmnd[4];
819 io_log->lba[3] = sc_cmd->cmnd[5];
820 io_log->bufflen = scsi_bufflen(sc_cmd);
821 io_log->sg_count = scsi_sg_count(sc_cmd);
822 io_log->result = sc_cmd->result;
848 struct scsi_cmnd *sc_cmd = io_req->sc_cmd;
849 struct Scsi_Host *host = sc_cmd->device->host;
858 io_req->data_xfer_len = scsi_bufflen(sc_cmd);
859 qedf_priv(sc_cmd)->io_req = io_req;
865 if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) {
868 } else if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) {
881 /* Release cmd will release io_req, but sc_cmd is assigned */
882 io_req->sc_cmd = NULL;
890 /* Release cmd will release io_req, but sc_cmd is assigned */
891 io_req->sc_cmd = NULL;
897 io_req->lun = (int)sc_cmd->device->lun;
909 /* Release cmd will release io_req, but sc_cmd is assigned */
910 io_req->sc_cmd = NULL;
923 if (qedf_io_tracing && io_req->sc_cmd)
930 qedf_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc_cmd)
934 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
943 num_sgs = scsi_sg_count(sc_cmd);
944 if (scsi_sg_count(sc_cmd) > QEDF_MAX_BDS_PER_CMD) {
948 sc_cmd->result = DID_ERROR;
949 scsi_done(sc_cmd);
958 sc_cmd->result = DID_NO_CONNECT << 16;
959 scsi_done(sc_cmd);
965 "Completing sc_cmd=%p DID_NO_CONNECT as MSI-X is not enabled.\n",
966 sc_cmd);
967 sc_cmd->result = DID_NO_CONNECT << 16;
968 scsi_done(sc_cmd);
977 sc_cmd->result = rval;
978 scsi_done(sc_cmd);
1033 io_req->sc_cmd = sc_cmd;
1053 struct scsi_cmnd *sc_cmd = io_req->sc_cmd;
1098 if (sc_cmd->sense_buffer) {
1099 memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
1101 memcpy(sc_cmd->sense_buffer, sense_data,
1108 struct scsi_cmnd *sc = io_req->sc_cmd;
1120 struct scsi_cmnd *sc_cmd;
1143 sc_cmd = io_req->sc_cmd;
1146 if (!sc_cmd) {
1147 QEDF_WARN(&(qedf->dbg_ctx), "sc_cmd is NULL!\n");
1151 if (!qedf_priv(sc_cmd)->io_req) {
1157 if (!sc_cmd->device) {
1159 "Device for sc_cmd %p is NULL.\n", sc_cmd);
1163 if (!scsi_cmd_to_rq(sc_cmd)->q) {
1165 "is not valid, sc_cmd=%p.\n", sc_cmd);
1177 sc_cmd->device->lun == (u64)fcport->lun_reset_lun)) {
1194 sc_cmd->result = DID_BUS_BUSY << 16;
1205 cqe->cqe_info.rsp_info.fw_residual, sc_cmd->cmnd[2],
1206 sc_cmd->cmnd[3], sc_cmd->cmnd[4], sc_cmd->cmnd[5]);
1209 sc_cmd->result = (DID_ERROR << 16) | io_req->cdb_status;
1211 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status;
1217 scsi_set_resid(sc_cmd, scsi_bufflen(sc_cmd));
1225 sc_cmd->result = DID_OK << 16;
1232 qedf->lport->host->host_no, sc_cmd->device->id,
1233 sc_cmd->device->lun, io_req->xid,
1234 sc_cmd->cmnd[0], sc_cmd->cmnd[2], sc_cmd->cmnd[3],
1235 sc_cmd->cmnd[4], sc_cmd->cmnd[5],
1238 sc_cmd->result = (DID_OK << 16) | io_req->cdb_status;
1264 scsi_set_resid(sc_cmd, io_req->fcp_resid);
1312 io_req->sc_cmd = NULL;
1313 qedf_priv(sc_cmd)->io_req = NULL;
1314 scsi_done(sc_cmd);
1322 struct scsi_cmnd *sc_cmd;
1343 sc_cmd = io_req->sc_cmd;
1345 if (!sc_cmd) {
1346 QEDF_WARN(&(qedf->dbg_ctx), "sc_cmd is NULL!\n");
1350 if (!virt_addr_valid(sc_cmd)) {
1351 QEDF_ERR(&qedf->dbg_ctx, "sc_cmd=%p is not valid.", sc_cmd);
1355 if (!qedf_priv(sc_cmd)->io_req) {
1361 if (!sc_cmd->device) {
1362 QEDF_ERR(&qedf->dbg_ctx, "Device for sc_cmd %p is NULL.\n",
1363 sc_cmd);
1367 if (!virt_addr_valid(sc_cmd->device)) {
1369 "Device pointer for sc_cmd %p is bad.\n", sc_cmd);
1373 if (!sc_cmd->sense_buffer) {
1375 "sc_cmd->sense_buffer for sc_cmd %p is NULL.\n",
1376 sc_cmd);
1380 if (!virt_addr_valid(sc_cmd->sense_buffer)) {
1382 "sc_cmd->sense_buffer for sc_cmd %p is bad.\n",
1383 sc_cmd);
1389 sc_cmd->result = result << 16;
1392 "sc_cmd=%p result=0x%08x op=0x%02x lba=0x%02x%02x%02x%02x, "
1394 qedf->lport->host->host_no, sc_cmd->device->id,
1395 sc_cmd->device->lun, sc_cmd, sc_cmd->result, sc_cmd->cmnd[0],
1396 sc_cmd->cmnd[2], sc_cmd->cmnd[3], sc_cmd->cmnd[4],
1397 sc_cmd->cmnd[5], sc_cmd->allowed, sc_cmd->retries,
1404 scsi_set_resid(sc_cmd, scsi_bufflen(sc_cmd));
1409 io_req->sc_cmd = NULL;
1410 qedf_priv(sc_cmd)->io_req = NULL;
1411 scsi_done(sc_cmd);
1417 * Clear the io_req->sc_cmd backpointer so we don't try to process
1420 io_req->sc_cmd = NULL;
1534 io_req->sc_cmd->device->lun == (u64)io_req->fcport->lun_reset_lun)) {
1759 if (!io_req->sc_cmd)
1761 if (!io_req->sc_cmd->device) {
1763 "Device backpointer NULL for sc_cmd=%p.\n",
1764 io_req->sc_cmd);
1766 io_req->sc_cmd = NULL;
1825 "Outstanding io_req =%p xid=0x%x flags=0x%lx, sc_cmd=%p refcount=%d cmd_type=%d.\n",
1828 io_req->sc_cmd,
1912 "io_req xid=0x%x sc_cmd=%p already in cleanup or abort processing or already completed.\n",
1913 io_req->xid, io_req->sc_cmd);
2030 if (io_req->sc_cmd) {
2212 "Entered xid=0x%x sc_cmd=%p cmd_type=%d flags=0x%lx refcount=%d fcport=%p port_id=0x%06x\n",
2213 io_req->xid, io_req->sc_cmd, io_req->cmd_type, io_req->flags,
2256 io_req->sc_cmd = NULL;
2261 if (io_req->sc_cmd) {
2290 static int qedf_execute_tmf(struct qedf_rport *fcport, struct scsi_cmnd *sc_cmd,
2305 if (!sc_cmd) {
2306 QEDF_ERR(&qedf->dbg_ctx, "sc_cmd is NULL\n");
2310 lun = (int)sc_cmd->device->lun;
2330 io_req->sc_cmd = sc_cmd;
2376 io_req->sc_cmd = NULL;
2413 int qedf_initiate_tmf(struct scsi_cmnd *sc_cmd, u8 tm_flags)
2415 struct fc_rport *rport = starget_to_rport(scsi_target(sc_cmd->device));
2419 struct fc_lport *lport = shost_priv(sc_cmd->device->host);
2427 "tm_flags 0x%x sc_cmd %p op = 0x%02x target_id = 0x%x lun=%d\n",
2428 tm_flags, sc_cmd, sc_cmd->cmd_len ? sc_cmd->cmnd[0] : 0xff,
2429 rport->scsi_target_id, (int)sc_cmd->device->lun);
2440 if (qedf_priv(sc_cmd)->io_req) {
2441 io_req = qedf_priv(sc_cmd)->io_req;
2455 rc = fc_block_scsi_eh(sc_cmd);
2503 rc = qedf_execute_tmf(fcport, sc_cmd, tm_flags);
2520 io_req->sc_cmd = NULL;