From fec4efc10bed2f66b962d5c66d08fd20bc745928 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Sat, 12 Jun 2004 05:19:17 +0000 Subject: [PATCH] When autosense is retrieved, tell CAM about it instead of juust pretending that the command succeeded. Sheesh! This makes CDROMs no longer cause an instant panic at boot. Thanks to Jake Burkholder for providing a remote test setup. Also make device resets work, thanks to another typo. --- sys/dev/esp/ncr53c9x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/esp/ncr53c9x.c b/sys/dev/esp/ncr53c9x.c index 01d81a4a5e9..7f42c7cf3c5 100644 --- a/sys/dev/esp/ncr53c9x.c +++ b/sys/dev/esp/ncr53c9x.c @@ -944,7 +944,7 @@ ncr53c9x_action(struct cam_sim *sim, union ccb *ccb) ecb->ccb = ccb; ecb->timeout = ccb->ccb_h.timeout; - if (ccb->ccb_h.func_code == XPT_RESET_BUS) { + if (ccb->ccb_h.func_code == XPT_RESET_DEV) { ecb->flags |= ECB_RESET; ecb->clen = 0; ecb->dleft = 0; @@ -1219,6 +1219,7 @@ ncr53c9x_done(struct ncr53c9x_softc *sc, struct ncr53c9x_ecb *ecb) if ((ecb->flags & ECB_ABORT) != 0) { ccb->ccb_h.status = CAM_CMD_TIMEOUT; } else if ((ecb->flags & ECB_SENSE) != 0) { + ccb->ccb_h.status = CAM_AUTOSNS_VALID; } else if (ecb->stat == SCSI_STATUS_CHECK_COND) { if ((ecb->flags & ECB_SENSE) != 0) ccb->ccb_h.status = CAM_AUTOSENSE_FAIL;