Lines Matching refs:csio

108 static int	mly_cam_action_io(struct cam_sim *sim, struct ccb_scsiio *csio);
2066 if (!mly_cam_action_io(sim, (struct ccb_scsiio *)&ccb->csio))
2197 mly_cam_action_io(struct cam_sim *sim, struct ccb_scsiio *csio)
2206 target = csio->ccb_h.target_id;
2208 debug(2, "XPT_SCSI_IO %d:%d:%d", bus, target, csio->ccb_h.target_lun);
2213 csio->ccb_h.status = CAM_REQ_CMP_ERR;
2219 csio->ccb_h.status = CAM_REQ_CMP_ERR;
2225 csio->ccb_h.status = CAM_REQ_CMP_ERR;
2229 if (csio->cdb_len > MLY_CMD_SCSI_SMALL_CDB) {
2230 debug(0, " command too large (%d > %d)", csio->cdb_len, MLY_CMD_SCSI_SMALL_CDB);
2231 csio->ccb_h.status = CAM_REQ_CMP_ERR;
2235 if ((csio->ccb_h.flags & CAM_CDB_POINTER) && (csio->ccb_h.flags & CAM_CDB_PHYS)) {
2237 csio->ccb_h.status = CAM_REQ_CMP_ERR;
2241 if ((csio->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_INPROG) {
2251 csio->ccb_h.status |= CAM_REQUEUE_REQ;
2257 mc->mc_data = csio;
2258 mc->mc_length = csio->dxfer_len;
2260 mc->mc_private = csio;
2265 csio->ccb_h.sim_priv.entries[0].field = bus;
2270 if (csio->ccb_h.flags & CAM_DIS_DISCONNECT)
2272 if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT)
2274 ss->data_size = csio->dxfer_len;
2275 ss->addr.phys.lun = csio->ccb_h.target_lun;
2276 ss->addr.phys.target = csio->ccb_h.target_id;
2278 if (csio->ccb_h.timeout < (60 * 1000)) {
2279 ss->timeout.value = csio->ccb_h.timeout / 1000;
2281 } else if (csio->ccb_h.timeout < (60 * 60 * 1000)) {
2282 ss->timeout.value = csio->ccb_h.timeout / (60 * 1000);
2285 ss->timeout.value = csio->ccb_h.timeout / (60 * 60 * 1000); /* overflow? */
2288 ss->maximum_sense_size = csio->sense_len;
2289 ss->cdb_length = csio->cdb_len;
2290 if (csio->ccb_h.flags & CAM_CDB_POINTER) {
2291 bcopy(csio->cdb_io.cdb_ptr, ss->cdb, csio->cdb_len);
2293 bcopy(csio->cdb_io.cdb_bytes, ss->cdb, csio->cdb_len);
2299 csio->ccb_h.status |= CAM_REQUEUE_REQ;
2327 struct ccb_scsiio *csio = (struct ccb_scsiio *)mc->mc_private;
2328 struct scsi_inquiry_data *inq = (struct scsi_inquiry_data *)csio->data_ptr;
2335 csio->scsi_status = mc->mc_status;
2342 bus = csio->ccb_h.sim_priv.entries[0].field;
2343 target = csio->ccb_h.target_id;
2346 if (csio->ccb_h.flags & CAM_CDB_POINTER) {
2347 cmd = *csio->cdb_io.cdb_ptr;
2349 cmd = csio->cdb_io.cdb_bytes[0];
2360 csio->ccb_h.status = CAM_REQ_CMP;
2365 csio->ccb_h.status = CAM_SCSI_STATUS_ERROR;
2366 bzero(&csio->sense_data, SSD_FULL_SIZE);
2367 bcopy(mc->mc_packet, &csio->sense_data, mc->mc_sense);
2368 csio->sense_len = mc->mc_sense;
2369 csio->ccb_h.status |= CAM_AUTOSNS_VALID;
2370 csio->resid = mc->mc_resid; /* XXX this is a signed value... */
2375 csio->ccb_h.status = CAM_SCSI_BUSY;
2379 debug(1, "unknown status 0x%x", csio->scsi_status);
2380 csio->ccb_h.status = CAM_REQ_CMP_ERR;
2385 csio->ccb_h.status |= CAM_RELEASE_SIMQ;
2389 xpt_done((union ccb *)csio);