Lines Matching refs:cp

169 void sym_set_cam_result_error(struct sym_hcb *np, struct sym_ccb *cp, int resid)
171 struct scsi_cmnd *cmd = cp->cmd;
175 scsi_status = cp->ssss_status;
177 if (cp->host_flags & HF_SENSE) {
178 scsi_status = cp->sv_scsi_status;
179 resid = cp->sv_resid;
180 if (sym_verbose && cp->sv_xerr_status)
181 sym_print_xerr(cmd, cp->sv_xerr_status);
182 if (cp->host_status == HS_COMPLETE &&
183 cp->ssss_status == S_GOOD &&
184 cp->xerr_status == 0) {
186 cp->sv_xerr_status);
191 memcpy(cmd->sense_buffer, cp->sns_bbuf,
204 cp->target,cp->lun, -1);
217 } else if (cp->host_status == HS_COMPLETE) /* Bad SCSI status */
219 else if (cp->host_status == HS_SEL_TIMEOUT) /* Selection timeout */
221 else if (cp->host_status == HS_UNEXPECTED) /* Unexpected BUS FREE*/
226 cp->host_status, cp->ssss_status,
227 cp->xerr_status);
232 cam_status = sym_xerr_cam_status(DID_ERROR, cp->xerr_status);
238 static int sym_scatter(struct sym_hcb *np, struct sym_ccb *cp, struct scsi_cmnd *cmd)
243 cp->data_len = 0;
248 struct sym_tcb *tp = &np->target[cp->target];
256 data = &cp->phys.data[SYM_CONF_MAX_SG - use_sg];
264 cp->odd_byte_adjustment++;
268 cp->data_len += len;
285 struct sym_ccb *cp;
302 cp = sym_get_ccb(np, cmd, order);
303 if (!cp)
305 sym_queue_scsiio(np, cmd, cp);
312 static inline int sym_setup_cdb(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp)
314 memcpy(cp->cdb_buf, cmd->cmnd, cmd->cmd_len);
316 cp->phys.cmd.addr = CCB_BA(cp, cdb_buf[0]);
317 cp->phys.cmd.size = cpu_to_scr(cmd->cmd_len);
325 int sym_setup_data_and_start(struct sym_hcb *np, struct scsi_cmnd *cmd, struct sym_ccb *cp)
333 if (sym_setup_cdb(np, cmd, cp))
341 cp->segments = sym_scatter(np, cp, cmd);
342 if (cp->segments < 0) {
350 if (!cp->segments)
353 cp->data_len = 0;
354 cp->segments = 0;
367 lastp = goalp - 8 - (cp->segments * (2*4));
370 cp->host_flags |= HF_DATA_IN;
372 lastp = goalp - 8 - (cp->segments * (2*4));
383 cp->phys.head.lastp = cpu_to_scr(lastp);
384 cp->phys.head.savep = cpu_to_scr(lastp);
385 cp->startp = cp->phys.head.savep;
386 cp->goalp = cpu_to_scr(goalp);
395 switch (cp->cdb_buf[0]) {
407 sym_put_start_queue(np, cp);
411 sym_free_ccb(np, cp);
593 struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
594 if (cp->cmd == cmd) {
646 struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb,
648 struct scsi_cmnd *cmd = cp->cmd;