diff options
author | phk <phk@FreeBSD.org> | 2003-10-06 10:39:13 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-10-06 10:39:13 +0000 |
commit | 74674b8ed80cc707021fa63e36e7a54c59038e15 (patch) | |
tree | c8fabd93af44a38a843ddeba9b0d074443690014 /sys/cam/scsi | |
parent | 892a2cd2356874ecdc593b708739257c511aeb6b (diff) | |
download | FreeBSD-src-74674b8ed80cc707021fa63e36e7a54c59038e15.zip FreeBSD-src-74674b8ed80cc707021fa63e36e7a54c59038e15.tar.gz |
Add disk_destroy() call to detach processing.
Add short tempered TUR to cdsize() as a workaround.
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r-- | sys/cam/scsi/scsi_cd.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index bd673e0..db382ed 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -496,6 +496,7 @@ cdcleanup(struct cam_periph *periph) free(softc->changer, M_DEVBUF); num_changers--; } + disk_destroy(&softc->disk); free(softc, M_DEVBUF); splx(s); } @@ -2852,6 +2853,20 @@ cdsize(struct cam_periph *periph, u_int32_t *size) ccb = cdgetccb(periph, /* priority */ 1); + scsi_test_unit_ready(&ccb->csio, 0, cddone, + MSG_SIMPLE_Q_TAG, SSD_FULL_SIZE, 1000); + ccb->ccb_h.ccb_bp = NULL; + + error = cam_periph_runccb(ccb, NULL, + /*cam_flags*/0, + /*sense_flags*/SF_RETRY_UA, + softc->disk.d_devstat); + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + xpt_release_ccb(ccb); + return (ENXIO); + } + rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), M_TEMP, M_WAITOK); |