Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Aug 2012 17:01:07 +0000 (UTC)
From:      Matt Jacob <mjacob@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239213 - head/sys/cam/scsi
Message-ID:  <201208121701.q7CH17ub011685@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjacob
Date: Sun Aug 12 17:01:07 2012
New Revision: 239213
URL: http://svn.freebsd.org/changeset/base/239213

Log:
  1. Remove SEN support. I doubt there are any working examples
  of this hardware still running (close to twenty years now).
  
  2. Quiesece and use ENC_VLOG instead of ENC_LOG for most
  complaints. That is, they're visible with bootverbose, but
  otherwise quiesced and not repeatedly spamming messages
  with constant reminders that hardware in this space is
  rarely fully compliant.
  
  MFC after:	1 month

Modified:
  head/sys/cam/scsi/scsi_enc.c
  head/sys/cam/scsi/scsi_enc_safte.c
  head/sys/cam/scsi/scsi_enc_ses.c

Modified: head/sys/cam/scsi/scsi_enc.c
==============================================================================
--- head/sys/cam/scsi/scsi_enc.c	Sun Aug 12 16:58:38 2012	(r239212)
+++ head/sys/cam/scsi/scsi_enc.c	Sun Aug 12 17:01:07 2012	(r239213)
@@ -60,9 +60,6 @@ MALLOC_DEFINE(M_SCSIENC, "SCSI ENC", "SC
 
 /* Enclosure type independent driver */
 
-#define	SEN_ID		"UNISYS           SUN_SEN"
-#define	SEN_ID_LEN	24
-
 static	d_open_t	enc_open;
 static	d_close_t	enc_close;
 static	d_ioctl_t	enc_ioctl;
@@ -630,9 +627,8 @@ enc_log(struct enc_softc *enc, const cha
 /*
  * Is this a device that supports enclosure services?
  *
- * It's a a pretty simple ruleset- if it is device type 0x0D (13), it's
- * an ENC device. If it happens to be an old UNISYS SEN device, we can
- * handle that too.
+ * It's a a pretty simple ruleset- if it is device type
+ * 0x0D (13), it's an ENCLOSURE device.
  */
 
 #define	SAFTE_START	44
@@ -659,13 +655,9 @@ enc_type(struct ccb_getdev *cgd)
 	iqd = (unsigned char *)&cgd->inq_data;
 	buflen = min(sizeof(cgd->inq_data),
 	    SID_ADDITIONAL_LENGTH(&cgd->inq_data));
-	if (buflen < 8+SEN_ID_LEN)
-		return (ENC_NONE);
 
 	if ((iqd[0] & 0x1f) == T_ENCLOSURE) {
-		if (STRNCMP(&iqd[8], SEN_ID, SEN_ID_LEN) == 0) {
-			return (ENC_SEN);
-		} else if ((iqd[2] & 0x7) > 2) {
+		if ((iqd[2] & 0x7) > 2) {
 			return (ENC_SES);
 		} else {
 			return (ENC_SES_SCSI2);
@@ -920,7 +912,6 @@ enc_ctor(struct cam_periph *periph, void
 	case ENC_SEMB_SAFT:
 		err = safte_softc_init(enc);
 		break;
-	case ENC_SEN:
 	case ENC_NONE:
 	default:
 		ENC_FREE(enc);
@@ -997,9 +988,6 @@ enc_ctor(struct cam_periph *periph, void
         case ENC_SES_PASSTHROUGH:
 		tname = "ENC Passthrough Device";
 		break;
-        case ENC_SEN:
-		tname = "UNISYS SEN Device (NOT HANDLED YET)";
-		break;
         case ENC_SAFT:
 		tname = "SAF-TE Compliant Device";
 		break;

Modified: head/sys/cam/scsi/scsi_enc_safte.c
==============================================================================
--- head/sys/cam/scsi/scsi_enc_safte.c	Sun Aug 12 16:58:38 2012	(r239212)
+++ head/sys/cam/scsi/scsi_enc_safte.c	Sun Aug 12 17:01:07 2012	(r239213)
@@ -220,7 +220,7 @@ struct scfg {
 static char *safte_2little = "Too Little Data Returned (%d) at line %d\n";
 #define	SAFT_BAIL(r, x)	\
 	if ((r) >= (x)) { \
-		ENC_LOG(enc, safte_2little, x, __LINE__);\
+		ENC_VLOG(enc, safte_2little, x, __LINE__);\
 		return (EIO); \
 	}
 
@@ -269,7 +269,7 @@ safte_process_config(enc_softc_t *enc, s
 	if (error != 0)
 		return (error);
 	if (xfer_len < 6) {
-		ENC_LOG(enc, "too little data (%d) for configuration\n",
+		ENC_VLOG(enc, "too little data (%d) for configuration\n",
 		    xfer_len);
 		return (EIO);
 	}
@@ -435,7 +435,7 @@ safte_process_status(enc_softc_t *enc, s
 			break;
 		default:
 			cache->elm_map[oid].encstat[0] = SES_OBJSTAT_UNSUPPORTED;
-			ENC_LOG(enc, "Unknown fan%d status 0x%x\n", i,
+			ENC_VLOG(enc, "Unknown fan%d status 0x%x\n", i,
 			    buf[r] & 0xff);
 			break;
 		}
@@ -495,7 +495,7 @@ safte_process_status(enc_softc_t *enc, s
 			cfg->enc_status |= SES_ENCSTAT_INFO;
 			break;
 		default:
-			ENC_LOG(enc, "unknown power supply %d status (0x%x)\n",
+			ENC_VLOG(enc, "unknown power supply %d status (0x%x)\n",
 			    i, buf[r] & 0xff);
 			break;
 		}
@@ -543,7 +543,7 @@ safte_process_status(enc_softc_t *enc, s
 		default:
 			cache->elm_map[oid].encstat[0] =
 			    SES_OBJSTAT_UNSUPPORTED;
-			ENC_LOG(enc, "unknown lock status 0x%x\n",
+			ENC_VLOG(enc, "unknown lock status 0x%x\n",
 			    buf[r] & 0xff);
 			break;
 		}

Modified: head/sys/cam/scsi/scsi_enc_ses.c
==============================================================================
--- head/sys/cam/scsi/scsi_enc_ses.c	Sun Aug 12 16:58:38 2012	(r239212)
+++ head/sys/cam/scsi/scsi_enc_ses.c	Sun Aug 12 17:01:07 2012	(r239213)
@@ -1175,7 +1175,7 @@ ses_set_timed_completion(enc_softc_t *en
 	err = cam_periph_runccb(ccb, enc_error, ENC_CFLAGS,
 	    ENC_FLAGS|SF_QUIET_IR, NULL);
 	if (ccb->ccb_h.status != CAM_REQ_CMP) {
-		ENC_LOG(enc, "Timed Completion Unsupported\n");
+		ENC_VLOG(enc, "Timed Completion Unsupported\n");
 		goto release;
 	}
 
@@ -1198,7 +1198,7 @@ ses_set_timed_completion(enc_softc_t *en
 
 	err = cam_periph_runccb(ccb, enc_error, ENC_CFLAGS, ENC_FLAGS, NULL);
 	if (ccb->ccb_h.status != CAM_REQ_CMP) {
-		ENC_LOG(enc, "Timed Completion Set Failed\n");
+		ENC_VLOG(enc, "Timed Completion Set Failed\n");
 		goto release;
 	}
 
@@ -1244,14 +1244,14 @@ ses_process_pages(enc_softc_t *enc, stru
 		goto out;
 	}
 	if (xfer_len < sizeof(*page)) {
-		ENC_LOG(enc, "Unable to parse Diag Pages List Header\n");
+		ENC_VLOG(enc, "Unable to parse Diag Pages List Header\n");
 		err = EIO;
 		goto out;
 	}
 	page = (struct scsi_diag_page *)*bufp;
 	length = scsi_2btoul(page->length);
 	if (length + offsetof(struct scsi_diag_page, params) > xfer_len) {
-		ENC_LOG(enc, "Diag Pages List Too Long\n");
+		ENC_VLOG(enc, "Diag Pages List Too Long\n");
 		goto out;
 	}
 	ENC_DLOG(enc, "%s: page length %d, xfer_len %d\n",
@@ -1318,7 +1318,7 @@ ses_process_config(enc_softc_t *enc, str
 		goto out;
 	}
 	if (xfer_len < sizeof(cfg_page->hdr)) {
-		ENC_LOG(enc, "Unable to parse SES Config Header\n");
+		ENC_VLOG(enc, "Unable to parse SES Config Header\n");
 		err = EIO;
 		goto out;
 	}
@@ -1326,7 +1326,7 @@ ses_process_config(enc_softc_t *enc, str
 	cfg_page = (struct ses_cfg_page *)buf;
 	length = ses_page_length(&cfg_page->hdr);
 	if (length > xfer_len) {
-		ENC_LOG(enc, "Enclosure Config Page Too Long\n");
+		ENC_VLOG(enc, "Enclosure Config Page Too Long\n");
 		goto out;
 	}
 	last_valid_byte = &buf[length - 1];
@@ -1377,7 +1377,7 @@ ses_process_config(enc_softc_t *enc, str
 	while (cur_subenc <= last_subenc) {
 
 		if (!ses_enc_desc_is_complete(buf_subenc, last_valid_byte)) {
-			ENC_LOG(enc, "Enclosure %d Beyond End of "
+			ENC_VLOG(enc, "Enclosure %d Beyond End of "
 			    "Descriptors\n", cur_subenc - subencs);
 			err = EIO;
 			goto out;
@@ -1416,7 +1416,7 @@ ses_process_config(enc_softc_t *enc, str
 	sestype = ses_types;
 	while (cur_buf_type <= last_buf_type) {
 		if (&cur_buf_type->etype_txt_len > last_valid_byte) {
-			ENC_LOG(enc, "Runt Enclosure Type Header %d\n",
+			ENC_VLOG(enc, "Runt Enclosure Type Header %d\n",
 			    sestype - ses_types);
 			err = EIO;
 			goto out;
@@ -1424,7 +1424,7 @@ ses_process_config(enc_softc_t *enc, str
 		sestype->hdr  = cur_buf_type;
 		sestype->text = type_text;
 		type_text += cur_buf_type->etype_txt_len;
-		ENC_LOG(enc, " Type Desc[%d]: Type 0x%x, MaxElt %d, In Subenc "
+		ENC_VLOG(enc, " Type Desc[%d]: Type 0x%x, MaxElt %d, In Subenc "
 		    "%d, Text Length %d: %.*s\n", sestype - ses_types,
 		    sestype->hdr->etype_elm_type, sestype->hdr->etype_maxelt,
 		    sestype->hdr->etype_subenc, sestype->hdr->etype_txt_len,
@@ -1529,12 +1529,12 @@ ses_process_status(enc_softc_t *enc, str
 	 * could happen... Need to use dynamic discovery of the size.
 	 */
 	if (length > xfer_len) {
-		ENC_LOG(enc, "Enclosure Status Page Too Long\n");
+		ENC_VLOG(enc, "Enclosure Status Page Too Long\n");
 		goto out;
 	}
 	/* Make sure the length contains at least one header and status */
 	if (length < (sizeof(*page) + sizeof(*page->elements))) {
-		ENC_LOG(enc, "Enclosure Status Page Too Short\n");
+		ENC_VLOG(enc, "Enclosure Status Page Too Short\n");
 		goto out;
 	}
 
@@ -1576,11 +1576,11 @@ ses_process_status(enc_softc_t *enc, str
 	}
 
 	if (ses_iter_next(&iter) != NULL) {
-		ENC_LOG(enc, "Status page, length insufficient for "
+		ENC_VLOG(enc, "Status page, length insufficient for "
 			"expected number of objects\n");
 	} else {
 		if (cur_stat <= last_stat)
-			ENC_LOG(enc, "Status page, exhausted objects before "
+			ENC_VLOG(enc, "Status page, exhausted objects before "
 				"exhausing page\n");
 		enc_update_request(enc, SES_PUBLISH_CACHE);
 		err = 0;
@@ -1706,11 +1706,11 @@ ses_process_elm_addlstatus(enc_softc_t *
 	ENC_DLOG(enc, "Additional Element Status Page Length 0x%x\n", length);
 	/* Make sure the length includes at least one header. */
 	if (length < sizeof(*hdr)+sizeof(struct ses_elm_addlstatus_base_hdr)) {
-		ENC_LOG(enc, "Runt Additional Element Status Page\n");
+		ENC_VLOG(enc, "Runt Additional Element Status Page\n");
 		goto out;
 	}
 	if (length > xfer_len) {
-		ENC_LOG(enc, "Additional Element Status Page Too Long\n");
+		ENC_VLOG(enc, "Additional Element Status Page Too Long\n");
 		goto out;
 	}
 
@@ -1763,7 +1763,7 @@ ses_process_elm_addlstatus(enc_softc_t *
 
 			if (iter.individual_element_index > expected_index
 			 && status_type == TYPE_ADDLSTATUS_MANDATORY) {
-				ENC_LOG(enc, "%s: provided element "
+				ENC_VLOG(enc, "%s: provided element "
 					"index %d skips mandatory status "
 					" element at index %d\n",
 					__func__, eip_hdr->element_index,
@@ -1784,7 +1784,7 @@ ses_process_elm_addlstatus(enc_softc_t *
 
 		/* Make sure the descriptor is within bounds */
 		if ((offset + elmpriv->addl.hdr->length) > length) {
-			ENC_LOG(enc, "Element %d Beyond End "
+			ENC_VLOG(enc, "Element %d Beyond End "
 			    "of Additional Element Status Descriptors\n",
 			    iter.global_element_index);
 			err = EIO;
@@ -1814,7 +1814,7 @@ ses_process_elm_addlstatus(enc_softc_t *
 						   iter.global_element_index);
 			break;
 		default:
-			ENC_LOG(enc, "Element %d: Unknown Additional Element "
+			ENC_VLOG(enc, "Element %d: Unknown Additional Element "
 			    "Protocol 0x%x\n", iter.global_element_index,
 			    ses_elm_addlstatus_proto(elmpriv->addl.hdr));
 			goto out;
@@ -1931,11 +1931,11 @@ ses_process_elm_descs(enc_softc_t *enc, 
 	phdr = &ses_cache->elm_descs_page->hdr;
 	plength = ses_page_length(phdr);
 	if (xfer_len < sizeof(struct ses_page_hdr)) {
-		ENC_LOG(enc, "Runt Element Descriptor Page\n");
+		ENC_VLOG(enc, "Runt Element Descriptor Page\n");
 		goto out;
 	}
 	if (plength > xfer_len) {
-		ENC_LOG(enc, "Element Descriptor Page Too Long\n");
+		ENC_VLOG(enc, "Element Descriptor Page Too Long\n");
 		goto out;
 	}
 
@@ -1953,7 +1953,7 @@ ses_process_elm_descs(enc_softc_t *enc, 
 	    && (element = ses_iter_next(&iter)) != NULL) {
 
 		if ((offset + sizeof(struct ses_elm_desc_hdr)) > plength) {
-			ENC_LOG(enc, "Element %d Descriptor Header Past "
+			ENC_VLOG(enc, "Element %d Descriptor Header Past "
 			    "End of Buffer\n", iter.global_element_index);
 			goto out;
 		}
@@ -1963,7 +1963,7 @@ ses_process_elm_descs(enc_softc_t *enc, 
 		    iter.global_element_index, iter.type_index,
 		    iter.type_element_index, length, offset);
 		if ((offset + sizeof(*hdr) + length) > plength) {
-			ENC_LOG(enc, "Element%d Descriptor Past "
+			ENC_VLOG(enc, "Element%d Descriptor Past "
 			    "End of Buffer\n", iter.global_element_index);
 			goto out;
 		}
@@ -2138,7 +2138,7 @@ static int
 ses_get_elm_addlstatus_fc(enc_softc_t *enc, enc_cache_t *enc_cache,
 			  uint8_t *buf, int bufsiz)
 {
-	ENC_LOG(enc, "FC Device Support Stubbed in Additional Status Page\n");
+	ENC_VLOG(enc, "FC Device Support Stubbed in Additional Status Page\n");
 	return (ENODEV);
 }
 
@@ -2385,7 +2385,7 @@ ses_get_elm_addlstatus_sas_type0(enc_sof
 	physz = addl->proto_hdr.sas->base_hdr.num_phys;
 	physz *= sizeof(struct ses_elm_sas_device_phy);
 	if (physz > (bufsiz - offset + 4)) {
-		ENC_LOG(enc, "Element %d Device Phy List Beyond End Of Buffer\n",
+		ENC_VLOG(enc, "Element %d Device Phy List Beyond End Of Buffer\n",
 		    nobj);
 		err = EIO;
 		goto out;
@@ -2440,7 +2440,7 @@ ses_get_elm_addlstatus_sas_type1(enc_sof
 		physz = addl->proto_hdr.sas->base_hdr.num_phys *
 		    sizeof(struct ses_elm_sas_expander_phy);
 		if (physz > (bufsiz - offset)) {
-			ENC_LOG(enc, "Element %d: Expander Phy List Beyond "
+			ENC_VLOG(enc, "Element %d: Expander Phy List Beyond "
 			    "End Of Buffer\n", nobj);
 			err = EIO;
 			goto out;
@@ -2452,7 +2452,7 @@ ses_get_elm_addlstatus_sas_type1(enc_sof
 		physz = addl->proto_hdr.sas->base_hdr.num_phys *
 		    sizeof(struct ses_elm_sas_port_phy);
 		if (physz > (bufsiz - offset + 4)) {
-			ENC_LOG(enc, "Element %d: Port Phy List Beyond End "
+			ENC_VLOG(enc, "Element %d: Port Phy List Beyond End "
 			    "Of Buffer\n", nobj);
 			err = EIO;
 			goto out;
@@ -2504,7 +2504,7 @@ ses_get_elm_addlstatus_sas(enc_softc_t *
 		case ELMTYP_ARRAY_DEV:
 			break;
 		default:
-			ENC_LOG(enc, "Element %d has Additional Status type 0, "
+			ENC_VLOG(enc, "Element %d has Additional Status type 0, "
 			    "invalid for SES element type 0x%x\n", nobj,
 			    ses_cache->ses_types[tidx].hdr->etype_elm_type);
 			err = ENODEV;
@@ -2522,7 +2522,7 @@ ses_get_elm_addlstatus_sas(enc_softc_t *
 		case ELMTYP_ESCC:
 			break;
 		default:
-			ENC_LOG(enc, "Element %d has Additional Status type 1, "
+			ENC_VLOG(enc, "Element %d has Additional Status type 1, "
 			    "invalid for SES element type 0x%x\n", nobj,
 			    ses_cache->ses_types[tidx].hdr->etype_elm_type);
 			err = ENODEV;
@@ -2532,7 +2532,7 @@ ses_get_elm_addlstatus_sas(enc_softc_t *
 						       bufsiz, eip, nobj);
 		break;
 	default:
-		ENC_LOG(enc, "Element %d of type 0x%x has Additional Status "
+		ENC_VLOG(enc, "Element %d of type 0x%x has Additional Status "
 		    "of unknown type 0x%x\n", nobj,
 		    ses_cache->ses_types[tidx].hdr->etype_elm_type, dtype);
 		err = ENODEV;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208121701.q7CH17ub011685>