6848158 Format to auto-configure EMC array luns to different values
authorAbhinandan Ekande <Abhinandan.Ekande@Sun.COM>
Mon, 18 Jan 2010 09:26:09 +0530
changeset 11533 21be9ad3325a
parent 11532 df2488d7edc4
child 11534 9e690526d933
6848158 Format to auto-configure EMC array luns to different values
usr/src/cmd/format/auto_sense.c
usr/src/cmd/format/ctlr_scsi.c
usr/src/cmd/format/ctlr_scsi.h
--- a/usr/src/cmd/format/auto_sense.c	Mon Jan 18 09:32:20 2010 +0800
+++ b/usr/src/cmd/format/auto_sense.c	Mon Jan 18 09:26:09 2010 +0530
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -895,6 +895,10 @@
 		err_print("disk name:  `%s`\n", disk_name);
 	}
 
+	if (scsi_rdwr(DIR_READ, fd, (diskaddr_t)0, 1, (caddr_t)label,
+	    F_SILENT, NULL))
+		return ((struct disk_type *)NULL);
+
 	/*
 	 * Figure out which method we use for auto sense.
 	 * If a particular method fails, we fall back to
@@ -1096,8 +1100,9 @@
 	 * adjust it to AVG_RPM, 3600.
 	 */
 	if (rpm < MIN_RPM || rpm > MAX_RPM) {
-		err_print("The current rpm value %d is invalid,"
-		    " adjusting it to %d\n", rpm, AVG_RPM);
+		if (option_msg && diag_msg)
+			err_print("The current rpm value %d is invalid,"
+			    " adjusting it to %d\n", rpm, AVG_RPM);
 		rpm = AVG_RPM;
 	}
 
--- a/usr/src/cmd/format/ctlr_scsi.c	Mon Jan 18 09:32:20 2010 +0800
+++ b/usr/src/cmd/format/ctlr_scsi.c	Mon Jan 18 09:26:09 2010 +0530
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -98,10 +98,6 @@
 static int	scsi_read_defect_data(struct defect_list *, int);
 static int	scsi_ck_format(void);
 
-#ifdef i386
-static int	scsi_rdwr(int, int, diskaddr_t, int, caddr_t, int, int *);
-#endif /* i386 */
-
 #else	/* __STDC__ */
 
 static int	scsi_format();
@@ -129,10 +125,6 @@
 static int	scsi_read_defect_data();
 static int	scsi_ck_format();
 
-#ifdef i386
-static int	scsi_rdwr(int, int, diskaddr_t, int, caddr_t, int, int *);
-#endif /* i386 */
-
 #endif	/* __STDC__ */
 
 
--- a/usr/src/cmd/format/ctlr_scsi.h	Mon Jan 18 09:32:20 2010 +0800
+++ b/usr/src/cmd/format/ctlr_scsi.h	Mon Jan 18 09:26:09 2010 +0530
@@ -19,15 +19,13 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
 #ifndef	_CTLR_SCSI_H
 #define	_CTLR_SCSI_H
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -134,10 +132,7 @@
 /*
  *	Local prototypes for ANSI C compilers
  */
-#ifdef sparc
 int	scsi_rdwr(int, int, diskaddr_t, int, caddr_t, int, int *);
-#endif /* sparc */
-
 int	scsi_ex_man(struct defect_list *);
 int	scsi_ex_cur(struct defect_list *);
 int	scsi_ex_grown(struct defect_list *);
@@ -163,9 +158,9 @@
 int	scsi_ms_page4();
 int	scsi_read_defect_data();
 int	scsi_repair();
-int	scsi_rdwr();
 #endif /* sparc */
 
+int	scsi_rdwr();
 int	scsi_ck_format();
 int	scsi_ex_man();
 int	scsi_ex_cur();