changeset 6948:28788c8a03a8 onnv_93

6640275 ses(7d)'s use of SPC3/4 response data format is incorrect 6640785 sesio.h needs more enclosure types 6692498 ses retry scheduling incorrectly calculated & excessive retries
author jmcp
date Mon, 23 Jun 2008 19:46:32 -0700
parents 5d4910de8618
children f0ec1cfc0500
files usr/src/uts/common/io/scsi/targets/ses.c usr/src/uts/common/sys/scsi/targets/ses.h usr/src/uts/common/sys/scsi/targets/sesio.h
diffstat 3 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/io/scsi/targets/ses.c	Mon Jun 23 19:10:50 2008 -0700
+++ b/usr/src/uts/common/io/scsi/targets/ses.c	Mon Jun 23 19:46:32 2008 -0700
@@ -323,7 +323,12 @@
 		if (strncmp(inqp->inq_vid, SEN_ID, SEN_ID_LEN) == 0) {
 			SES_LOG(ssc, SES_CE_DEBUG3, "SEN device found");
 			*ep = SEN_TYPE;
-		} else if (inqp->inq_rdf > RDF_SCSI2) {
+		} else if (inqp->inq_rdf == RDF_SCSI2) {
+			/*
+			 * Per SPC4 #6.4.2 Standard Inquiry Data, response
+			 * data format (RDF) values of 0 and 1 are Obsolete,
+			 * whereas values greater than 2 are Reserved
+			 */
 			SES_LOG(ssc, SES_CE_DEBUG3, "SES device found");
 			*ep = SES_TYPE;
 		} else {
--- a/usr/src/uts/common/sys/scsi/targets/ses.h	Mon Jun 23 19:10:50 2008 -0700
+++ b/usr/src/uts/common/sys/scsi/targets/ses.h	Mon Jun 23 19:46:32 2008 -0700
@@ -21,7 +21,7 @@
 /*
  * Enclosure Services Device target driver
  *
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -247,11 +247,12 @@
  */
 #define	SES_IO_TIME		  60 /* standard I/O time (sec.) */
 #define	SES_RESTART_TIME	 100 /* I/O restart time (ms.) */
-#define	SES_BUSY_TIME		5000 /* I/O busy restart time (ms.) */
+#define	SES_BUSY_TIME		500 /* I/O busy restart time (ms.) */
 
 #define	SES_ENABLE_RESTART(ms_time, pkt) { \
 	ssc->ses_restart_id = timeout(ses_restart, (void *) pkt, \
-	    (ms_time)? (ms_time * drv_usectohz(1000)): drv_usectohz(1000)); \
+	    (ms_time)? (drv_usectohz(ms_time * 1000)) : \
+	    drv_usectohz(1000)); \
 }
 
 
@@ -272,7 +273,7 @@
 #define	SES_CMD_RETRY		SES_RETRY_MULTIPLIER
 #define	SES_NO_RETRY		0
 #define	SES_SENSE_RETRY		1
-#define	SES_BUSY_RETRY		2
+#define	SES_BUSY_RETRY		4
 
 /* Retry weight is 1 */
 #define	SES_CMD_RETRY1(retry) \
--- a/usr/src/uts/common/sys/scsi/targets/sesio.h	Mon Jun 23 19:10:50 2008 -0700
+++ b/usr/src/uts/common/sys/scsi/targets/sesio.h	Mon Jun 23 19:46:32 2008 -0700
@@ -2,9 +2,8 @@
  * CDDL HEADER START
  *
  * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
  *
  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  * or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -70,6 +69,10 @@
 #define	SESTYP_SCSI_TGT		0x14
 #define	SESTYP_SCSI_INI		0x15
 #define	SESTYP_SUBENC		0x16
+#define	SESTYP_ARRAY		0x17	/* SES2r19 #7.1 */
+#define	SESTYP_SASEXPANDER	0x18	/* SES2r19 #7.1 */
+#define	SESTYP_SASCONNECTOR	0x19	/* SES2r19 #7.1 */
+
 
 /*
  * Overall Enclosure Status