diff options
author | mav <mav@FreeBSD.org> | 2017-03-06 06:24:53 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2017-03-06 06:24:53 +0000 |
commit | 2c30894c7590d7f58697ba0492db813d04b38add (patch) | |
tree | 1d0da0b42db17172f823b6c78ea8dbcae465e6bf /sys/cam | |
parent | ea5b912309f9332273ee2f15966cd41e3ad7b292 (diff) | |
download | FreeBSD-src-2c30894c7590d7f58697ba0492db813d04b38add.zip FreeBSD-src-2c30894c7590d7f58697ba0492db813d04b38add.tar.gz |
MFC r314193: Some code cleanup.
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/ctl/scsi_ctl.c | 53 |
1 files changed, 15 insertions, 38 deletions
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c index 65f9b60..4cdae81 100644 --- a/sys/cam/ctl/scsi_ctl.c +++ b/sys/cam/ctl/scsi_ctl.c @@ -842,52 +842,32 @@ ctlfestart(struct cam_periph *periph, union ccb *start_ccb) (io->io_hdr.flags & CTL_FLAG_ABORT_STATUS) == 0) { io->io_hdr.flags &= ~CTL_FLAG_STATUS_QUEUED; - /* - * If this command was aborted, we don't - * need to send status back to the SIM. - * Just free the CTIO and ctl_io, and - * recycle the ATIO back to the SIM. - */ - xpt_print(periph->path, "%s: aborted " - "command 0x%04x discarded\n", - __func__, io->scsiio.tag_num); - /* - * For a wildcard attachment, commands can - * come in with a specific target/lun. Reset - * the target and LUN fields back to the - * wildcard values before we send them back - * down to the SIM. The SIM has a wildcard - * LUN enabled, not whatever target/lun - * these happened to be. - */ - if (softc->flags & CTLFE_LUN_WILDCARD) { - atio->ccb_h.target_id = CAM_TARGET_WILDCARD; - atio->ccb_h.target_lun = CAM_LUN_WILDCARD; - } - - if (atio->ccb_h.func_code != XPT_ACCEPT_TARGET_IO) { - xpt_print(periph->path, "%s: func_code " - "is %#x\n", __func__, - atio->ccb_h.func_code); - } + /* Tell the SIM that we've aborted this ATIO */ +#ifdef CTLFEDEBUG + printf("%s: tag %04x abort\n", __func__, atio->tag_id); +#endif + KASSERT(atio->ccb_h.func_code == XPT_ACCEPT_TARGET_IO, + ("func_code %#x is not ATIO", atio->ccb_h.func_code)); start_ccb->ccb_h.func_code = XPT_ABORT; start_ccb->cab.abort_ccb = (union ccb *)atio; - - /* Tell the SIM that we've aborted this ATIO */ xpt_action(start_ccb); softc->ccbs_freed++; xpt_release_ccb(start_ccb); /* * Send the ATIO back down to the SIM. + * For a wildcard attachment, commands can come in + * with a specific target/lun. Reset the target and + * LUN fields back to the wildcard values before we + * send them back down to the SIM. */ + if (softc->flags & CTLFE_LUN_WILDCARD) { + atio->ccb_h.target_id = CAM_TARGET_WILDCARD; + atio->ccb_h.target_lun = CAM_LUN_WILDCARD; + } xpt_action((union ccb *)atio); - /* - * If we still have work to do, ask for - * another CCB. Otherwise, deactivate our - * callout. - */ + /* If we still have work to do, ask for another CCB. */ if (!TAILQ_EMPTY(&softc->work_queue)) xpt_schedule(periph, /*priority*/ 1); return; @@ -911,9 +891,6 @@ ctlfestart(struct cam_periph *periph, union ccb *start_ccb) if (csio->sense_len != 0) { csio->sense_data = io->scsiio.sense_data; flags |= CAM_SEND_SENSE; - } else if (scsi_status == SCSI_STATUS_CHECK_COND) { - xpt_print(periph->path, "%s: check condition " - "with no sense\n", __func__); } } |