From owner-svn-src-all@freebsd.org  Thu May  4 17:23:40 2017
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75750D5EAEC;
 Thu,  4 May 2017 17:23:40 +0000 (UTC) (envelope-from ken@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 443371AA0;
 Thu,  4 May 2017 17:23:40 +0000 (UTC) (envelope-from ken@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v44HNda7072442;
 Thu, 4 May 2017 17:23:39 GMT (envelope-from ken@FreeBSD.org)
Received: (from ken@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id v44HNdhY072441;
 Thu, 4 May 2017 17:23:39 GMT (envelope-from ken@FreeBSD.org)
Message-Id: <201705041723.v44HNdhY072441@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org
 using -f
From: "Kenneth D. Merry" <ken@FreeBSD.org>
Date: Thu, 4 May 2017 17:23:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r317799 - head/sys/cam/scsi
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 04 May 2017 17:23:40 -0000

Author: ken
Date: Thu May  4 17:23:39 2017
New Revision: 317799
URL: https://svnweb.freebsd.org/changeset/base/317799

Log:
  Add the SCSI Solid State Media Log page (0x11) definition.
  
  sys/cam/scsi/scsi_all.h:
  	Add the SCSI Solid State Media log page (0x11) structure
  	definition.  This gives the percentage used (in terms of
  	lifetime flash wear) of an SSD.
  
  MFC after:	3 days
  Sponsored by:	Spectra Logic

Modified:
  head/sys/cam/scsi/scsi_all.h

Modified: head/sys/cam/scsi/scsi_all.h
==============================================================================
--- head/sys/cam/scsi/scsi_all.h	Thu May  4 15:26:28 2017	(r317798)
+++ head/sys/cam/scsi/scsi_all.h	Thu May  4 17:23:39 2017	(r317799)
@@ -565,6 +565,7 @@ struct scsi_log_sense
 #define	SLS_ERROR_LASTN_PAGE		0x07
 #define	SLS_LOGICAL_BLOCK_PROVISIONING	0x0c
 #define	SLS_SELF_TEST_PAGE		0x10
+#define	SLS_SOLID_STATE_MEDIA		0x11
 #define	SLS_STAT_AND_PERF		0x19
 #define	SLS_IE_PAGE			0x2f
 #define	SLS_PAGE_CTRL_MASK		0xC0
@@ -624,6 +625,13 @@ struct scsi_log_param_header {
 	u_int8_t param_len;
 };
 
+struct scsi_log_media_pct_used {
+	struct scsi_log_param_header hdr;
+#define	SLP_SS_MEDIA_PCT_USED		0x0001
+	uint8_t reserved[3];
+	uint8_t pct_used;
+};
+
 struct scsi_log_stat_and_perf {
 	struct scsi_log_param_header hdr;
 #define	SLP_SAP				0x0001