summaryrefslogtreecommitdiffstats
path: root/sys/scsi
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-11-06 17:31:14 +0000
committerjoerg <joerg@FreeBSD.org>1996-11-06 17:31:14 +0000
commit69821a67bb18742068616fe185b39a1a3a4fcb19 (patch)
tree456c9e64ab52a23fb499c6bc5bb9f5b8b118c5d3 /sys/scsi
parent1168e2d4ec00da6485782cae4b3022da252fd3b6 (diff)
downloadFreeBSD-src-69821a67bb18742068616fe185b39a1a3a4fcb19.zip
FreeBSD-src-69821a67bb18742068616fe185b39a1a3a4fcb19.tar.gz
Fix the sequence at odopen() time so the driver actually notices if a
medium with another size is being inserted. Right now, this case was broken and led to a situation where a medium could only be replaced with another one of the same size. Closes PR #kern/1830: Can't mount optical disk... Submitted by: akiyama@kme.mei.co.jp (Shunsuke Akiyama)
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/od.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/sys/scsi/od.c b/sys/scsi/od.c
index 5265429..fe8344e 100644
--- a/sys/scsi/od.c
+++ b/sys/scsi/od.c
@@ -28,7 +28,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: od.c,v 1.21 1996/08/17 20:50:26 joerg Exp $
+ * $Id: od.c,v 1.22 1996/09/06 23:09:11 phk Exp $
*/
/*
@@ -309,18 +309,18 @@ od_open(dev, mode, fmt, p, sc_link)
dev, unit, PARTITION(dev)));
/*
- * Try to start the drive (ignore failure).
+ * Try to start the drive, and try to clear "Unit Attention"
+ * condition, when media had been changed before.
+ * This operation also clears the SDEV_MEDIA_LOADED flag in its
+ * error handling routine.
*/
- scsi_start_unit(sc_link, SCSI_ERR_OK | SCSI_SILENT);
+ scsi_start_unit(sc_link, SCSI_SILENT);
scsi_prevent(sc_link, PR_PREVENT, SCSI_ERR_OK | SCSI_SILENT);
/*
- * Try to clear "Unit Attention" condition, when media had
- * been changed before.
- * This operation also clears the SDEV_MEDIA_LOADED flag in its
- * error handling routine.
+ * Make sure the drive is ready.
*/
- scsi_test_unit_ready(sc_link, SCSI_SILENT);
+ scsi_test_unit_ready(sc_link, 0);
SC_DEBUG(sc_link, SDEV_DB3, ("'start' attempted "));
@@ -361,9 +361,7 @@ od_open(dev, mode, fmt, p, sc_link)
switch (od->params.secsiz) {
case SECSIZE :
case 1024 :
-#ifdef notyet
case 2048 :
-#endif
break;
default :
printf("od%ld: Can't deal with %d bytes logical blocks\n",
@@ -962,5 +960,3 @@ static void od_drvinit(void *unused)
}
SYSINIT(oddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,od_drvinit,NULL)
-
-
OpenPOWER on IntegriCloud