Lines Matching defs:sc

69 	struct scsi_cmnd *sc = tl_cmd->sc;
74 scsi_done(sc);
104 struct scsi_cmnd *sc = tl_cmd->sc;
111 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
112 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
115 * Ensure that this tl_tpg reference from the incoming sc->device->id
119 set_host_byte(sc, DID_NO_CONNECT);
123 set_host_byte(sc, DID_TRANSPORT_DISRUPTED);
128 scmd_printk(KERN_ERR, sc,
130 set_host_byte(sc, DID_ERROR);
134 transfer_length = scsi_transfer_length(sc);
135 if (!scsi_prot_sg_count(sc) &&
136 scsi_get_prot_op(sc) != SCSI_PROT_NORMAL) {
143 transfer_length = scsi_bufflen(sc);
148 tl_cmd->sc->device->lun, transfer_length,
149 TCM_SIMPLE_TAG, sc->sc_data_direction, 0);
151 if (target_submit_prep(se_cmd, sc->cmnd, scsi_sglist(sc),
152 scsi_sg_count(sc), sgl_bidi, sgl_bidi_count,
153 scsi_prot_sglist(sc), scsi_prot_sg_count(sc),
161 scsi_done(sc);
168 static int tcm_loop_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)
170 struct tcm_loop_cmd *tl_cmd = scsi_cmd_priv(sc);
173 __func__, sc->device->host->host_no, sc->device->id,
174 sc->device->channel, sc->device->lun, sc->cmnd[0],
175 scsi_bufflen(sc));
178 tl_cmd->sc = sc;
179 tl_cmd->sc_cmd_tag = scsi_cmd_to_rq(sc)->tag;
233 static int tcm_loop_abort_task(struct scsi_cmnd *sc)
242 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
243 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
244 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun,
245 scsi_cmd_to_rq(sc)->tag, TMR_ABORT_TASK);
253 static int tcm_loop_device_reset(struct scsi_cmnd *sc)
262 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
263 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
265 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun,
270 static int tcm_loop_target_reset(struct scsi_cmnd *sc)
278 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
284 * Locate the tl_tpg pointer from TargetID in sc->device->id
286 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
500 * sc->sc_data_direction of DMA_TO_DEVICE with struct scatterlist array
516 struct scsi_cmnd *sc = tl_cmd->sc;
519 func, sc, sc->cmnd[0]);
525 memcpy(sc->sense_buffer, se_cmd->sense_buffer,
527 sc->result = SAM_STAT_CHECK_CONDITION;
529 sc->result = scsi_status;
531 set_host_byte(sc, DID_OK);
534 scsi_set_resid(sc, se_cmd->residual_count);