• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/sys/dev/ciss/

Lines Matching refs:csio

184 static int	ciss_cam_action_io(struct cam_sim *sim, struct ccb_scsiio *csio);
185 static int ciss_cam_emulate(struct ciss_softc *sc, struct ccb_scsiio *csio);
188 static void ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio);
2969 struct ccb_scsiio *csio;
2975 csio = (struct ccb_scsiio *)&ccb->csio;
2976 target = csio->ccb_h.target_id;
2982 if (!ciss_cam_action_io(sim, csio))
3103 ciss_cam_action_io(struct cam_sim *sim, struct ccb_scsiio *csio)
3113 target = csio->ccb_h.target_id;
3115 debug(2, "XPT_SCSI_IO %d:%d:%d", bus, target, csio->ccb_h.target_lun);
3118 if ((csio->ccb_h.flags & CAM_CDB_POINTER) && (csio->ccb_h.flags & CAM_CDB_PHYS)) {
3120 csio->ccb_h.status = CAM_REQ_CMP_ERR;
3124 if ((csio->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) {
3130 if (ciss_cam_emulate(sc, csio))
3141 csio->ccb_h.status |= CAM_REQUEUE_REQ;
3149 cr->cr_data = csio;
3150 cr->cr_length = csio->dxfer_len;
3152 cr->cr_private = csio;
3163 cc->cdb.cdb_length = csio->cdb_len;
3166 if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) {
3169 } else if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) {
3177 cc->cdb.timeout = (csio->ccb_h.timeout / 1000) + 1;
3178 if (csio->ccb_h.flags & CAM_CDB_POINTER) {
3179 bcopy(csio->cdb_io.cdb_ptr, &cc->cdb.cdb[0], csio->cdb_len);
3181 bcopy(csio->cdb_io.cdb_bytes, &cc->cdb.cdb[0], csio->cdb_len);
3193 csio->ccb_h.status |= CAM_RELEASE_SIMQ;
3197 csio->ccb_h.status |= CAM_REQUEUE_REQ;
3210 ciss_cam_emulate(struct ciss_softc *sc, struct ccb_scsiio *csio)
3215 target = csio->ccb_h.target_id;
3216 bus = cam_sim_bus(xpt_path_sim(csio->ccb_h.path));
3217 opcode = (csio->ccb_h.flags & CAM_CDB_POINTER) ?
3218 *(u_int8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes[0];
3222 csio->ccb_h.status |= CAM_SEL_TIMEOUT;
3223 xpt_done((union ccb *)csio);
3235 csio->ccb_h.status |= CAM_SEL_TIMEOUT;
3236 xpt_done((union ccb *)csio);
3246 if (((csio->ccb_h.flags & CAM_CDB_POINTER) ?
3247 *(u_int8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes[0]) == SYNCHRONIZE_CACHE) {
3249 csio->ccb_h.status |= CAM_REQ_CMP;
3250 xpt_done((union ccb *)csio);
3261 if (opcode == REPORT_LUNS && csio->dxfer_len > 0) {
3262 csio->data_ptr[3] = 8;
3263 csio->ccb_h.status |= CAM_REQ_CMP;
3264 xpt_done((union ccb *)csio);
3299 struct ccb_scsiio *csio;
3308 csio = (struct ccb_scsiio *)cr->cr_private;
3314 csio->scsi_status = scsi_status;
3323 csio->ccb_h.status |= CAM_REQ_CMP_ERR;
3329 csio->ccb_h.status |= CAM_REQ_CMP;
3336 bzero(&csio->sense_data, SSD_FULL_SIZE);
3337 bcopy(&ce->sense_info[0], &csio->sense_data, ce->sense_length);
3338 if (csio->sense_len > ce->sense_length)
3339 csio->sense_resid = csio->sense_len - ce->sense_length;
3341 csio->sense_resid = 0;
3342 csio->resid = ce->residual_count;
3343 csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID;
3347 debug(0, "sense key %x", scsi_get_sense_key(sns, csio->sense_len -
3348 csio->sense_resid, /*show_errors*/ 1));
3355 csio->ccb_h.status |= CAM_SCSI_BUSY;
3359 debug(0, "unknown status 0x%x", csio->scsi_status);
3360 csio->ccb_h.status |= CAM_REQ_CMP_ERR;
3365 ciss_cam_complete_fixup(sc, csio);
3370 if (csio->ccb_h.status & CAM_RELEASE_SIMQ)
3371 xpt_release_simq(xpt_path_sim(csio->ccb_h.path), 0);
3373 csio->ccb_h.status |= CAM_RELEASE_SIMQ;
3375 xpt_done((union ccb *)csio);
3382 ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio)
3389 cdb = (csio->ccb_h.flags & CAM_CDB_POINTER) ?
3390 (uint8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes;
3393 (csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN &&
3394 csio->dxfer_len >= SHORT_INQUIRY_LENGTH) {
3395 inq = (struct scsi_inquiry_data *)csio->data_ptr;
3396 target = csio->ccb_h.target_id;
3397 bus = cam_sim_bus(xpt_path_sim(csio->ccb_h.path));