Lines Matching refs:cmnd

27 static int bfad_im_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *cmnd);
37 struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio;
46 scsi_set_resid(cmnd, 0);
52 memcpy(cmnd->sense_buffer, sns_info, sns_len);
57 scsi_set_resid(cmnd, residue);
59 (scsi_bufflen(cmnd) - residue) <
60 cmnd->underflow) {
65 cmnd->result = host_status << 16 | scsi_status;
70 cmnd->result = DID_TIME_OUT << 16;
73 cmnd->result = DID_TRANSPORT_DISRUPTED << 16;
76 cmnd->result = DID_ERROR << 16;
80 if (cmnd->device->host != NULL)
81 scsi_dma_unmap(cmnd);
83 cmnd->host_scribble = NULL;
84 bfa_trc(bfad, cmnd->result);
86 itnim_data = cmnd->device->hostdata;
89 if (!cmnd->result && itnim &&
90 (bfa_lun_queue_depth > cmnd->device->queue_depth)) {
92 bfad_ramp_up_qdepth(itnim, cmnd->device);
93 } else if (cmnd->result == SAM_STAT_TASK_SET_FULL && itnim) {
95 bfad_handle_qfull(itnim, cmnd->device);
99 scsi_done(cmnd);
105 struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio;
109 cmnd->result = DID_OK << 16 | SAM_STAT_GOOD;
112 if (cmnd->device->host != NULL)
113 scsi_dma_unmap(cmnd);
115 cmnd->host_scribble = NULL;
118 if (bfa_lun_queue_depth > cmnd->device->queue_depth) {
119 itnim_data = cmnd->device->hostdata;
123 bfad_ramp_up_qdepth(itnim, cmnd->device);
127 scsi_done(cmnd);
133 struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dio;
136 cmnd->result = DID_ERROR << 16;
139 if (cmnd->device->host != NULL)
140 scsi_dma_unmap(cmnd);
142 bfa_trc(bfad, cmnd->result);
143 cmnd->host_scribble = NULL;
150 struct scsi_cmnd *cmnd = (struct scsi_cmnd *)dtsk;
153 bfad_priv(cmnd)->status |= tsk_status << 1;
154 set_bit(IO_DONE_BIT, &bfad_priv(cmnd)->status);
155 wq = bfad_priv(cmnd)->wq;
156 bfad_priv(cmnd)->wq = NULL;
190 bfad_im_abort_handler(struct scsi_cmnd *cmnd)
192 struct Scsi_Host *shost = cmnd->device->host;
202 hal_io = (struct bfa_ioim_s *) cmnd->host_scribble;
208 if (hal_io->dio != (struct bfad_ioim_s *) cmnd) {
215 "scsi%d: abort cmnd %p iotag %x\n",
216 im_port->shost->host_no, cmnd, hal_io->iotag);
222 while ((struct bfa_ioim_s *) cmnd->host_scribble == hal_io) {
229 scsi_done(cmnd);
233 im_port->shost->host_no, cmnd, hal_io->iotag);
241 bfad_im_target_reset_send(struct bfad_s *bfad, struct scsi_cmnd *cmnd,
249 tskim = bfa_tskim_alloc(&bfad->bfa, (struct bfad_tskim_s *) cmnd);
261 cmnd->host_scribble = NULL;
262 bfad_priv(cmnd)->status = 0;
291 bfad_im_reset_lun_handler(struct scsi_cmnd *cmnd)
293 struct Scsi_Host *shost = cmnd->device->host;
296 struct bfad_itnim_data_s *itnim_data = cmnd->device->hostdata;
315 tskim = bfa_tskim_alloc(&bfad->bfa, (struct bfad_tskim_s *) cmnd);
328 cmnd->host_scribble = NULL;
329 bfad_priv(cmnd)->wq = &wq;
330 bfad_priv(cmnd)->status = 0;
345 int_to_scsilun(cmnd->device->lun, &scsilun);
350 wait_event(wq, test_bit(IO_DONE_BIT, &bfad_priv(cmnd)->status));
352 task_status = bfad_priv(cmnd)->status >> 1;
367 bfad_im_reset_target_handler(struct scsi_cmnd *cmnd)
369 struct Scsi_Host *shost = cmnd->device->host;
370 struct scsi_target *starget = scsi_target(cmnd->device);
383 bfad_priv(cmnd)->wq = &wq;
384 rc = bfad_im_target_reset_send(bfad, cmnd, itnim);
389 &bfad_priv(cmnd)->status));
392 task_status = bfad_priv(cmnd)->status >> 1;
1202 static int bfad_im_queuecommand_lck(struct scsi_cmnd *cmnd)
1206 (struct bfad_im_port_s *) cmnd->device->host->hostdata[0];
1208 struct bfad_itnim_data_s *itnim_data = cmnd->device->hostdata;
1214 struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));
1218 cmnd->result = rc;
1219 done(cmnd);
1225 cmnd->result = DID_NO_CONNECT << 16;
1227 cmnd->result = DID_REQUEUE << 16;
1228 done(cmnd);
1232 sg_cnt = scsi_dma_map(cmnd);
1240 bfad->inst_no, cmnd, cmnd->cmnd[0]);
1241 cmnd->result = DID_NO_CONNECT << 16;
1248 cmnd->result = DID_IMM_RETRY << 16;
1252 hal_io = bfa_ioim_alloc(&bfad->bfa, (struct bfad_ioim_s *) cmnd,
1257 scsi_dma_unmap(cmnd);
1261 cmnd->host_scribble = (char *)hal_io;
1269 scsi_dma_unmap(cmnd);
1271 done(cmnd);