6334882 format -e does not see the USB Iomega Rev Drive
authorphitran
Thu, 27 Oct 2005 09:08:47 -0700
changeset 768 daea417d4c6b
parent 767 0aa24dfb5d87
child 769 9710ecbd3653
6334882 format -e does not see the USB Iomega Rev Drive
usr/src/cmd/format/startup.c
usr/src/uts/common/sys/dkio.h
--- a/usr/src/cmd/format/startup.c	Thu Oct 27 09:01:18 2005 -0700
+++ b/usr/src/cmd/format/startup.c	Thu Oct 27 09:08:47 2005 -0700
@@ -1569,6 +1569,7 @@
 	struct ctlr_type	*ctlr, *tctlr;
 	struct	mctlr_list	*mlp;
 	struct	efi_info	efi_info;
+	struct dk_minfo		mediainfo;
 	int			search_file;
 	int			status;
 	int			i;
@@ -1624,13 +1625,23 @@
 	}
 
 	if (mlp == NULL) {
+		if (dkinfo.dki_ctype == DKC_CDROM) {
+			if (ioctl(search_file, DKIOCGMEDIAINFO,
+			    &mediainfo) < 0) {
+				mediainfo.dki_media_type = DK_UNKNOWN;
+			}
+		}
 		/*
 		 * Skip CDROM devices, they are read only.
-		 *	Also skip PCMCIA memory card device since
-		 *	it is used as a pseudo floppy disk drive
-		 *	at the present time (BugID 1201473)
+		 * But not devices like Iomega Rev Drive which
+		 * identifies itself as a CDROM, but has a removable
+		 * disk.
+		 * Also skip PCMCIA memory card device since
+		 * it is used as a pseudo floppy disk drive
+		 * at the present time (BugID 1201473)
 		 */
-		if ((dkinfo.dki_ctype == DKC_CDROM) ||
+		if (((dkinfo.dki_ctype == DKC_CDROM) &&
+		    (mediainfo.dki_media_type != DK_REMOVABLE_DISK)) ||
 		    (dkinfo.dki_ctype == DKC_PCMCIA_MEM)) {
 			(void) close(search_file);
 			return;
--- a/usr/src/uts/common/sys/dkio.h	Thu Oct 27 09:01:18 2005 -0700
+++ b/usr/src/uts/common/sys/dkio.h	Thu Oct 27 09:08:47 2005 -0700
@@ -281,6 +281,7 @@
  * maintain compatibility with SFF8090.  The following define the
  * optical media type.
  */
+#define	DK_REMOVABLE_DISK	0x02 /* Removable Disk */
 #define	DK_MO_ERASABLE		0x03 /* MO Erasable */
 #define	DK_MO_WRITEONCE		0x04 /* MO Write once */
 #define	DK_AS_MO		0x05 /* AS MO */