aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2023-08-22 04:14:54 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2023-08-22 04:14:54 +0000
commitee92ca01a9141d314980784b88dde337c0d67710 (patch)
treeaea325529675283f0f4887b116c48f02d2d3e694
parent378ba7e52be935184a5b02aa5221f9793d576a40 (diff)
downloadsg3_utils-ee92ca01a9141d314980784b88dde337c0d67710.tar.gz
sg_inq: update version descriptors to T10 table 20230814
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@1047 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r--ChangeLog5
-rw-r--r--debian/changelog2
-rw-r--r--sg3_utils.spec2
-rw-r--r--src/sg_inq.c2
-rw-r--r--src/sg_inq_data.c199
-rw-r--r--testing/Makefile8
-rw-r--r--testing/sg_chk_asc.c9
-rw-r--r--testing/sg_chk_inq_vd.c250
8 files changed, 403 insertions, 74 deletions
diff --git a/ChangeLog b/ChangeLog
index edcf4759..39af7d50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,9 +2,12 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.
-Changelog for pre-release sg3_utils-1.49 [20230807] [svn: r1046]
+Changelog for pre-release sg3_utils-1.49 [20230821] [svn: r1047]
- apply https://github.com/doug-gilbert/sg3_utils/pull/39
and its revision [20230807] mainly for Android
+ - sg_inq: update version descriptors to T10 table 20230814
+ - testing/sg_chk_inq_vd.c: test internal table against T10
+ version descriptor file
Changelog for released sg3_utils-1.48 [20230801] [svn: r1042]
- decoding utilities: add --json[=JO] and --js-file=JFN
diff --git a/debian/changelog b/debian/changelog
index 6ccbf69a..aaccd136 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@ sg3-utils (1.49-0.1) unstable; urgency=low
* New upstream version
- -- Douglas Gilbert <dgilbert@interlog.com> Wed, 02 Aug 2023 11:00:00 -0400
+ -- Douglas Gilbert <dgilbert@interlog.com> Mon, 21 Aug 2023 18:00:00 -0400
sg3-utils (1.48-0.1) unstable; urgency=low
diff --git a/sg3_utils.spec b/sg3_utils.spec
index b068eb3d..9512e8f1 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -84,7 +84,7 @@ fi
%{_libdir}/*.a
%changelog
-* Wed Aug 02 2023 - dgilbert at interlog dot com
+* Mon Aug 21 2023 - dgilbert at interlog dot com
- track t10 changes
* sg3_utils-1.49
diff --git a/src/sg_inq.c b/src/sg_inq.c
index b3b8127f..5f47949d 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -53,7 +53,7 @@
#include "sg_vpd_common.h" /* for shared VPD page processing with sg_vpd */
-static const char * version_str = "2.48 20230606"; /* spc6r08, sbc5r04 */
+static const char * version_str = "2.49 20230821"; /* spc6r09, sbc5r04 */
#define MY_NAME "sg_inq"
diff --git a/src/sg_inq_data.c b/src/sg_inq_data.c
index 570a86f2..5bb1e5c9 100644
--- a/src/sg_inq_data.c
+++ b/src/sg_inq_data.c
@@ -26,17 +26,21 @@
/* table from SPC-5 revision 16 [sorted numerically (from Annex E.9)] */
-/* Can also be obtained from : https://www.t10.org/lists/stds.txt 20170114 */
-/* Corrected against spc5r21 on 20190312 */
-/* new update for spc6r08.pdf */
+/* Can also be obtained from : https://www.t10.org/lists/stds-num.txt
+ * dated 20230814 . */
#ifdef SG_SCSI_STRINGS
+/* There should be a sg_inq.h file but it would only have one entry in it:
+ * extern struct sg_lib_simple_value_name_t sg_version_descriptor_arr[];
+ * so skip it for the time being. */
+
struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x0, "Version Descriptor not supported or No standard identified"},
{0x20, "SAM (no version claimed)"},
{0x3b, "SAM T10/0994-D revision 18"},
{0x3c, "SAM INCITS 270-1996"},
+ {0x3d, "SAM ISO/IEC 14776-411"},
{0x40, "SAM-2 (no version claimed)"},
{0x54, "SAM-2 T10/1157-D revision 23"},
{0x55, "SAM-2 T10/1157-D revision 24"},
@@ -47,6 +51,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x75, "SAM-3 T10/1561-D revision 13"},
{0x76, "SAM-3 T10/1561-D revision 14"},
{0x77, "SAM-3 INCITS 402-2005"},
+ {0x79, "SAM-3 ISO/IEC 14776-413"},
{0x80, "SAM-4 (no version claimed)"},
{0x87, "SAM-4 T10/1683-D revision 13"},
{0x8b, "SAM-4 T10/1683-D revision 14"},
@@ -57,9 +62,10 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0xa4, "SAM-5 T10/2104-D revision 20"},
{0xa6, "SAM-5 T10/2104-D revision 21"},
{0xa8, "SAM-5 INCITS 515-2016"},
+ {0xaa, "SAM-5 ISO/IEC 14776-415"},
{0xc0, "SAM-6 (no version claimed)"},
- {0xc2, "SAM-6 INCIT 515-2016"},
- {0xd4, "SAM-6 BSR INCIT 515 revision 10)"},
+ {0xc2, "SAM-6 INCITS 546-2021"},
+ {0xd4, "SAM-6 BSR INCITS 546 revision 10"},
{0x120, "SPC (no version claimed)"},
{0x13b, "SPC T10/0995-D revision 11a"},
{0x13c, "SPC INCITS 301-1997"},
@@ -72,6 +78,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x180, "SBC (no version claimed)"},
{0x19b, "SBC T10/0996-D revision 08c"},
{0x19c, "SBC INCITS 306-1998"},
+ {0x19e, "SBC ISO/IEC 14776-321"},
{0x1a0, "SMC (no version claimed)"},
{0x1bb, "SMC T10/0999-D revision 10a"},
{0x1bc, "SMC INCITS 314-1998"},
@@ -79,18 +86,20 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x1c0, "SES (no version claimed)"},
{0x1db, "SES T10/1212-D revision 08b"},
{0x1dc, "SES INCITS 305-1998"},
- {0x1dd, "SES T10/1212-D revision 08b w/ Amendment INCITS.305/AM1:2000"},
- {0x1de, "SES INCITS 305-1998 w/ Amendment INCITS.305/AM1:2000"},
- {0x1e0, "SCC-2 (no version claimed}"},
+ {0x1dd, "SES T10/1212 revision 08b w/ Amendment INCITS 305/AM1-2000"},
+ {0x1de, "SES INCITS 305-1998 w/ Amendment INCITS 305/AM1-2000"},
+ {0x1e0, "SCC-2 (no version claimed)"},
{0x1fb, "SCC-2 T10/1125-D revision 04"},
{0x1fc, "SCC-2 INCITS 318-1998"},
{0x200, "SSC (no version claimed)"},
{0x201, "SSC T10/0997-D revision 17"},
{0x207, "SSC T10/0997-D revision 22"},
{0x21c, "SSC INCITS 335-2000"},
+ {0x21e, "SSC ISO/IEC 14776-331"},
{0x220, "RBC (no version claimed)"},
{0x238, "RBC T10/1240-D revision 10a"},
{0x23c, "RBC INCITS 330-2000"},
+ {0x23e, "RBC ISO/IEC 14776-326"},
{0x240, "MMC-2 (no version claimed)"},
{0x255, "MMC-2 T10/1228-D revision 11"},
{0x25b, "MMC-2 T10/1228-D revision 11a"},
@@ -137,6 +146,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x374, "SSC-2 T10/1434-D revision 7"},
{0x375, "SSC-2 T10/1434-D revision 9"},
{0x37d, "SSC-2 INCITS 380-2003"},
+ {0x37e, "SSC-2 ISO/IEC 14776-342"},
{0x380, "BCC (no version claimed)"},
{0x3a0, "MMC-4 (no version claimed)"},
{0x3b0, "MMC-4 T10/1545-D revision 5"}, /* dropped in spc4r09 */
@@ -158,7 +168,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x403, "SSC-3 T10/1611-D revision 04a"},
{0x407, "SSC-3 T10/1611-D revision 05"},
{0x409, "SSC-3 INCITS 467-2011"},
- {0x40b, "SSC-3 ISO/IEC 14776-333:2013"},
+ {0x40b, "SSC-3 ISO/IEC 14776-333"},
{0x420, "MMC-5 (no version claimed)"},
{0x42f, "MMC-5 T10/1675-D revision 03"},
{0x431, "MMC-5 T10/1675-D revision 03b"},
@@ -176,6 +186,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x468, "SPC-4 T10/BSR INCITS 513 revision 37"},
{0x469, "SPC-4 T10/BSR INCITS 513 revision 37a"},
{0x46c, "SPC-4 INCITS 513-2015"},
+ {0x46e, "SPC-4 ISO/IEC 14776-454"},
{0x480, "SMC-3 (no version claimed)"},
{0x482, "SMC-3 T10/1730-D revision 15"},
{0x484, "SMC-3 T10/1730-D revision 16"},
@@ -188,8 +199,9 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x4c3, "SBC-3 T10/BSR INCITS 514 revision 35"},
{0x4c5, "SBC-3 T10/BSR INCITS 514 revision 36"},
{0x4c8, "SBC-3 INCITS 514-2014"},
+ {0x4ca, "SBC-3 ISO/IEC 14776-323"},
{0x4e0, "MMC-6 (no version claimed)"},
- {0x4e3, "MMC-6 T10/1836-D revision 2b"},
+ {0x4e3, "MMC-6 T10/1836-D revision 02b"},
{0x4e5, "MMC-6 T10/1836-D revision 02g"},
{0x4e6, "MMC-6 INCITS 468-2010"},
{0x4e7, "MMC-6 INCITS 468-2010 + MMC-6/AM1 INCITS 468-2010/AM 1"},
@@ -206,10 +218,10 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x580, "SES-3 (no version claimed)"},
{0x582, "SES-3 T10/BSR INCITS 518 revision 13"},
{0x584, "SES-3 T10/BSR INCITS 518 revision 14"},
- {0x591, "SES-3 INCITS 518-2017"},
+ {0x591, "SES-3 INCITS 518-2017"},
{0x5a0, "SSC-5 (no version claimed)"},
{0x5a2, "SSC-5 BSR INCITS 503-2022"},
- {0x5ab, "SSC-5 BSR INCITS 503 revision 6"},
+ {0x5ab, "SSC-5 BSR INCITS 503 revision 06"},
{0x5af, "SSC-5 AM1 (no version claimed)"},
{0x5c0, "SPC-5 (no version claimed)"},
{0x5c2, "SPC-5 INCITS 502-2019"},
@@ -218,6 +230,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x5e3, "SFSC BSR INCITS 501 revision 01"},
{0x5e5, "SFSC BSR INCITS 501 revision 02"},
{0x5e8, "SFSC INCITS 501-2016"},
+ {0x5ea, "SFSC ISO/IEC 14776-481"},
{0x600, "SBC-4 (no version claimed)"},
{0x602, "SBC-4 INCITS 506-2021"},
{0x60f, "SBC-4 BSR INCITS 506 revision 20a"},
@@ -225,56 +238,90 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x620, "ZBC (no version claimed)"},
{0x622, "ZBC BSR INCITS 536 revision 02"},
{0x624, "ZBC BSR INCITS 536 revision 05"},
+ {0x628, "ZBC INCITS 536-2016"},
+ {0x629, "ZBC AM1 INCITS 536-2016/AM1-2019"},
{0x640, "ADC-4 (no version claimed)"},
- {0x64b, "ADC-4 BSR INCITS 541 revision 4)"},
- {0x64c, "ADC-4 BSR INCITS 541 revision 5)"},
+ {0x64b, "ADC-4 BSR INCITS 541 revision 04"},
+ {0x64c, "ADC-4 BSR INCITS 541 revision 05"},
{0x660, "ZBC-2 (no version claimed)"},
{0x662, "ZBC-2 INCITS 550-2023"},
{0x66b, "ZBC-2 BSR INCITS 550 revision 13"},
{0x680, "SES-4 (no version claimed)"},
{0x682, "SES-4 INCITS 555-2020"},
- {0x68f, "SES-4 BSR INCITS 555 revision 3"},
- {0x690, "SES-4 BSR INCITS 555 revision 5"},
+ {0x68f, "SES-4 BSR INCITS 555 revision 03"},
+ {0x690, "SES-4 BSR INCITS 555 revision 05"},
{0x6a0, "ZBC-3 (no version claimed)"},
{0x6c0, "SBC-5 (no version claimed)"},
{0x6e0, "SPC-6 (no version claimed)"},
{0x820, "SSA-TL2 (no version claimed)"},
- {0x83b, "SSA-TL2 T10/1147-D revision 05b"},
+ {0x83b, "SSA-TL2 T10.1/1147-D revision 05b"},
{0x83c, "SSA-TL2 INCITS 308-1998"},
{0x840, "SSA-TL1 (no version claimed)"},
- {0x85b, "SSA-TL1 T10/0989-D revision 10b"},
+ {0x85b, "SSA-TL1 T10.1/0989-D revision 10b"},
{0x85c, "SSA-TL1 INCITS 295-1996"},
{0x860, "SSA-S3P (no version claimed)"},
- {0x87b, "SSA-S3P T10/1051-D revision 05b"},
+ {0x87b, "SSA-S3P T10.1/1051-D revision 05b"},
{0x87c, "SSA-S3P INCITS 309-1998"},
{0x880, "SSA-S2P (no version claimed)"},
- {0x89b, "SSA-S2P T10/1121-D revision 07b"},
+ {0x89b, "SSA-S2P T10.1/1121-D revision 07b"},
{0x89c, "SSA-S2P INCITS 294-1996"},
{0x8a0, "SIP (no version claimed)"},
{0x8bb, "SIP T10/0856-D revision 10"},
{0x8bc, "SIP INCITS 292-1997"},
{0x8c0, "FCP (no version claimed)"},
- {0x8db, "FCP T10/0856-D revision 12"},
+ {0x8db, "FCP T10/0993-D revision 12"},
{0x8dc, "FCP INCITS 269-1996"},
{0x8e0, "SBP-2 (no version claimed)"},
{0x8fb, "SBP-2 T10/1155-D revision 04"},
- {0x8fc, "SBP-2 INCITS 325-1999"},
+ {0x8fc, "SBP-2 INCITS 325-1998"},
{0x900, "FCP-2 (no version claimed)"},
{0x901, "FCP-2 T10/1144-D revision 4"},
{0x915, "FCP-2 T10/1144-D revision 7"},
{0x916, "FCP-2 T10/1144-D revision 7a"},
{0x917, "FCP-2 INCITS 350-2003"},
{0x918, "FCP-2 T10/1144-D revision 8"},
+ {0x91a, "FCP-2 ISO/IEC 14776-222"},
{0x920, "SST (no version claimed)"},
{0x935, "SST T10/1380-D revision 8b"},
{0x940, "SRP (no version claimed)"},
{0x954, "SRP T10/1415-D revision 10"},
{0x955, "SRP T10/1415-D revision 16a"},
{0x95c, "SRP INCITS 365-2002"},
+ /* 0x961 to 0x97F iSCSI (versions as described via RFC 7144) */
+ /* the following (up to 0x67f) taken from that document */
{0x960, "iSCSI (no version claimed)"},
- {0x961, "iSCSI RFC 7143"},
- {0x962, "iSCSI RFC 7144"},
- /* 0x960 up to 0x97f for iSCSI use */
+ {0x961, "iSCSI RFC 7143 iSCSIProtocolLevel=1"},
+ {0x962, "iSCSI RFC 7144 iSCSIProtocolLevel=2"},
+ {0x963, "iSCSI RFC 7144 iSCSIProtocolLevel=3"},
+ {0x964, "iSCSI RFC 7144 iSCSIProtocolLevel=4"},
+ {0x965, "iSCSI RFC 7144 iSCSIProtocolLevel=5"},
+ {0x966, "iSCSI RFC 7144 iSCSIProtocolLevel=6"},
+ {0x967, "iSCSI RFC 7144 iSCSIProtocolLevel=7"},
+ {0x968, "iSCSI RFC 7144 iSCSIProtocolLevel=8"},
+ {0x969, "iSCSI RFC 7144 iSCSIProtocolLevel=9"},
+ {0x96a, "iSCSI RFC 7144 iSCSIProtocolLevel=10"},
+ {0x96b, "iSCSI RFC 7144 iSCSIProtocolLevel=11"},
+ {0x96c, "iSCSI RFC 7144 iSCSIProtocolLevel=12"},
+ {0x96d, "iSCSI RFC 7144 iSCSIProtocolLevel=13"},
+ {0x96e, "iSCSI RFC 7144 iSCSIProtocolLevel=14"},
+ {0x96f, "iSCSI RFC 7144 iSCSIProtocolLevel=15"},
+ {0x970, "iSCSI RFC 7144 iSCSIProtocolLevel=16"},
+ {0x971, "iSCSI RFC 7144 iSCSIProtocolLevel=17"},
+ {0x972, "iSCSI RFC 7144 iSCSIProtocolLevel=18"},
+ {0x973, "iSCSI RFC 7144 iSCSIProtocolLevel=19"},
+ {0x974, "iSCSI RFC 7144 iSCSIProtocolLevel=20"},
+ {0x975, "iSCSI RFC 7144 iSCSIProtocolLevel=21"},
+ {0x976, "iSCSI RFC 7144 iSCSIProtocolLevel=22"},
+ {0x977, "iSCSI RFC 7144 iSCSIProtocolLevel=23"},
+ {0x978, "iSCSI RFC 7144 iSCSIProtocolLevel=24"},
+ {0x979, "iSCSI RFC 7144 iSCSIProtocolLevel=25"},
+ {0x97a, "iSCSI RFC 7144 iSCSIProtocolLevel=26"},
+ {0x97b, "iSCSI RFC 7144 iSCSIProtocolLevel=27"},
+ {0x97c, "iSCSI RFC 7144 iSCSIProtocolLevel=28"},
+ {0x97d, "iSCSI RFC 7144 iSCSIProtocolLevel=29"},
+ {0x97e, "iSCSI RFC 7144 iSCSIProtocolLevel=30"},
+ {0x97f, "iSCSI RFC 7144 iSCSIProtocolLevel=31"},
+
{0x980, "SBP-3 (no version claimed)"},
{0x982, "SBP-3 T10/1467-D revision 1f"},
{0x994, "SBP-3 T10/1467-D revision 3"},
@@ -282,6 +329,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x99b, "SBP-3 T10/1467-D revision 5"},
{0x99c, "SBP-3 INCITS 375-2004"},
{0x9a0, "SRP-2 (no version claimed)"},
+ {0x9bc, "SRP-2 INCITS 551-2019"},
{0x9c0, "ADP (no version claimed)"},
{0x9e0, "ADT (no version claimed)"},
{0x9f9, "ADT T10/1557-D revision 11"},
@@ -301,20 +349,22 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0xa42, "FCP-4 T10/1828-D revision 01"},
{0xa44, "FCP-4 T10/1828-D revision 02"},
{0xa45, "FCP-4 T10/1828-D revision 02b"},
- {0xa46, "FCP-4 INCITS 481-2012"},
+ {0xa46, "FCP-4 INCITS 481-2011"},
+ {0xa50, "FCP-4 ISO/IEC 14776-224"},
+ {0xa52, "FCP-4 AM1 INCITS 481-2011/AM1-2018"},
{0xa60, "ADT-3 (no version claimed)"},
{0xa62, "ADT-3 INCITS 542-2022"},
- {0xa6b, "ADT-3 BSR INCITS 542 revision 3"},
+ {0xa6b, "ADT-3 BSR INCITS 542 revision 03"},
{0xa80, "FCP-5 (no version claimed)"},
{0xa82, "FCP-5 INCITS 563-2023"},
- {0xa8b, "FCP-5 BSR INCITS 563 revision 4"},
+ {0xa8b, "FCP-5 BSR INCITS 563 revision 04"},
{0xaa0, "SPI (no version claimed)"},
{0xab9, "SPI T10/0855-D revision 15a"},
{0xaba, "SPI INCITS 253-1995"},
{0xabb, "SPI T10/0855-D revision 15a with SPI Amnd revision 3a"},
- {0xabc, "SPI INCITS 253-1995 with SPI Amnd INCITS 253/AM1:1998"},
+ {0xabc, "SPI INCITS 253-1995 with SPI Amnd INCITS 253/AM1-1998"},
{0xac0, "Fast-20 (no version claimed)"},
- {0xadb, "Fast-20 T10/1071-D revision 06"},
+ {0xadb, "Fast-20 T10/1071 revision 06"},
{0xadc, "Fast-20 INCITS 277-1996"},
{0xae0, "SPI-2 (no version claimed)"},
{0xafb, "SPI-2 T10/1142-D revision 20b"},
@@ -325,7 +375,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0xb1a, "SPI-3 T10/1302-D revision 14"},
{0xb1c, "SPI-3 INCITS 336-2000"},
{0xb20, "EPI (no version claimed)"},
- {0xb3b, "EPI T10/1134-D revision 16"},
+ {0xb3b, "EPI T10/1134 revision 16"},
{0xb3c, "EPI INCITS TR-23 1999"},
{0xb40, "SPI-4 (no version claimed)"},
{0xb54, "SPI-4 T10/1365-D revision 7"},
@@ -336,17 +386,18 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0xb79, "SPI-5 T10/1525-D revision 3"},
{0xb7a, "SPI-5 T10/1525-D revision 5"},
{0xb7b, "SPI-5 T10/1525-D revision 6"},
- {0xb7c, "SPI-5 INCITS 367-2004"},
+ {0xb7c, "SPI-5 INCITS 367-2003"},
{0xbe0, "SAS (no version claimed)"},
{0xbe1, "SAS T10/1562-D revision 01"},
{0xbf5, "SAS T10/1562-D revision 03"},
- {0xbfa, "SAS T10/1562-D revision 04"},
+ {0xbfa, "SAS T10/1562-D revision 4"},
{0xbfb, "SAS T10/1562-D revision 04"},
{0xbfc, "SAS T10/1562-D revision 05"},
{0xbfd, "SAS INCITS 376-2003"},
+ {0xbfe, "SAS ISO/IEC 14776-150"},
{0xc00, "SAS-1.1 (no version claimed)"},
- {0xc07, "SAS-1.1 T10/1602-D revision 9"},
- {0xc0f, "SAS-1.1 T10/1602-D revision 10"},
+ {0xc07, "SAS-1.1 T10/1601-D revision 9"},
+ {0xc0f, "SAS-1.1 T10/1601-D revision 10"},
{0xc11, "SAS-1.1 INCITS 417-2006"},
{0xc12, "SAS-1.1 ISO/IEC 14776-151"},
{0xc20, "SAS-2 (no version claimed)"},
@@ -365,16 +416,18 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0xc63, "SAS-3 T10/BSR INCITS 519 revision 05a"},
{0xc65, "SAS-3 T10/BSR INCITS 519 revision 06"},
{0xc68, "SAS-3 INCITS 519-2014"},
+ {0xc6a, "SAS-3 ISO/IEC 14776-154"},
{0xc80, "SAS-4 (no version claimed)"},
{0xc82, "SAS-4 T10/BSR INCITS 534 revision 08a"},
- {0xc84, "SAS-4 INCITS 534 revision 9"},
+ {0xc84, "SAS-4 T10/BSR INCITS 534 revision 09"},
{0xc92, "SAS-4 INCITS 534-2019"},
{0xca0, "SAS-4.1 (no version claimed)"},
- {0xcaf, "SAS-4.1 BSR INCITS 567 revision 3"},
- {0xcb0, "SAS-4.1 BSR INCITS 567 revision 4"},
+ {0xca2, "SAS-4.1 INCITS 567-2023"},
+ {0xcaf, "SAS-4.1 BSR INCITS 567 revision 03"},
+ {0xcb0, "SAS-4.1 BSR INCITS 567 revision 04"},
{0xd20, "FC-PH (no version claimed)"},
{0xd3b, "FC-PH INCITS 230-1994"},
- {0xd3c, "FC-PH INCITS 230-1994 with Amnd 1 INCITS 230/AM1:1996"},
+ {0xd3c, "FC-PH INCITS 230-1994 with Amnd 1 INCITS 230/AM1-1996"},
{0xd40, "FC-AL (no version claimed)"},
{0xd5c, "FC-AL INCITS 272-1996"},
{0xd60, "FC-AL-2 (no version claimed)"},
@@ -383,7 +436,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0xd64, "FC-AL-2 INCITS 332-1999 with Amnd 2 AM2-2006"},
{0xd65, "FC-AL-2 ISO/IEC 14165-122 with AM1 & AM2"},
{0xd7c, "FC-AL-2 INCITS 332-1999"},
- {0xd7d, "FC-AL-2 INCITS 332-1999 with Amnd 1 AM1:2002"},
+ {0xd7d, "FC-AL-2 INCITS 332-1999 with Amnd 1 AM1-2003"},
{0xd80, "FC-PH-3 (no version claimed)"},
{0xd9c, "FC-PH-3 INCITS 303-1998"},
{0xda0, "FC-FS (no version claimed)"},
@@ -412,7 +465,7 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0xe6e, "FC-PI-3 INCITS 460-2011"},
{0xe80, "FC-PI-4 (no version claimed)"},
{0xe82, "FC-PI-4 T11/1647-D revision 8.0"},
- {0xe88, "FC-PI-4 INCITS 450 -2009"},
+ {0xe88, "FC-PI-4 INCITS 450-2009"},
{0xea0, "FC 10GFC (no version claimed)"},
{0xea2, "FC 10GFC INCITS 364-2003"},
{0xea3, "FC 10GFC ISO/IEC 14165-116"},
@@ -422,7 +475,6 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0xee0, "FC-FS-3 (no version claimed)"},
{0xee2, "FC-FS-3 T11/1861-D revision 0.9"},
{0xee7, "FC-FS-3 T11/1861-D revision 1.0"},
- {0xee7, "FC-FS-3 T11/1861-D revision 1.0"},
{0xee9, "FC-FS-3 T11/1861-D revision 1.10"},
{0xeeb, "FC-FS-3 INCITS 470-2011"},
{0xf00, "FC-LS-2 (no version claimed)"},
@@ -452,23 +504,23 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x12e8, "FC-DA INCITS TR-36 2004"},
{0x12e9, "FC-DA ISO/IEC 14165-341"},
{0x1300, "FC-Tape (no version claimed)"},
- {0x1301, "FC-Tape T11/1315-D revision 1.16"},
- {0x131b, "FC-Tape T11/1315-D revision 1.17"},
+ {0x1301, "FC-Tape T11/1315 revision 1.16"},
+ {0x131b, "FC-Tape T11/1315 revision 1.17"},
{0x131c, "FC-Tape INCITS TR-24 1999"},
{0x1320, "FC-FLA (no version claimed)"},
- {0x133b, "FC-FLA T11/1235-D revision 7"},
+ {0x133b, "FC-FLA T11/1235 revision 7"},
{0x133c, "FC-FLA INCITS TR-20 1998"},
{0x1340, "FC-PLDA (no version claimed)"},
- {0x135b, "FC-PLDA T11/1162-D revision 2.1"},
+ {0x135b, "FC-PLDA T11/1162 revision 2.1"},
{0x135c, "FC-PLDA INCITS TR-19 1998"},
{0x1360, "SSA-PH2 (no version claimed)"},
- {0x137b, "SSA-PH2 T10/1145-D revision 09c"},
+ {0x137b, "SSA-PH2 T10.1/1145-D revision 09c"},
{0x137c, "SSA-PH2 INCITS 293-1996"},
{0x1380, "SSA-PH3 (no version claimed)"},
- {0x139b, "SSA-PH3 T10/1146-D revision 05b"},
+ {0x139b, "SSA-PH3 T10.1/1146-D revision 05b"},
{0x139c, "SSA-PH3 INCITS 307-1998"},
{0x14a0, "IEEE 1394 (no version claimed)"},
- {0x14bd, "IEEE 1394:1995"},
+ {0x14bd, "IEEE 1394-1995"},
{0x14c0, "IEEE 1394a (no version claimed)"},
{0x14e0, "IEEE 1394b (no version claimed)"},
{0x15e0, "ATA/ATAPI-6 (no version claimed)"},
@@ -477,37 +529,51 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x1602, "ATA/ATAPI-7 T13/1532-D revision 3"},
{0x161c, "ATA/ATAPI-7 INCITS 397-2005"},
{0x161e, "ATA/ATAPI-7 ISO/IEC 24739"},
- {0x1620, "ATA/ATAPI-8 ATA-AAM Architecture model (no version claimed)"},
- {0x1621, "ATA/ATAPI-8 ATA-PT Parallel transport (no version claimed)"},
- {0x1622, "ATA/ATAPI-8 ATA-AST Serial transport (no version claimed)"},
- {0x1623, "ATA/ATAPI-8 ATA-ACS ATA/ATAPI command set (no version "
+ {0x1620, "ATA/ATAPI-8 ATA8-AAM (no version claimed)"},
+ {0x1621, "ATA/ATAPI-8 ATA8-APT Parallel transport (no version claimed)"},
+ {0x1622, "ATA/ATAPI-8 ATA8-AST Serial transport (no version claimed)"},
+ {0x1623, "ATA/ATAPI-8 ATA8-ACS ATA/ATAPI command set (no version "
"claimed)"},
- {0x1628, "ATA/ATAPI-8 ATA-AAM INCITS 451-2008"},
- {0x162a, "ATA/ATAPI-8 ATA8-ACSINCITS 452-2009 w/ Amendment 1"},
+ {0x1628, "ATA/ATAPI-8 ATA8-AAM INCITS 451-2008"},
+ {0x162a, "ATA/ATAPI-8 ATA8-ACS INCITS 452-2009 w/ Amendment 1"},
+ {0x1630, "ATA/ATAPI-8 ATA8-ACS ATA/ATAPI Command Set ISO/IEC 17760-101"},
{0x1728, "Universal Serial Bus Specification, Revision 1.1"},
{0x1729, "Universal Serial Bus Specification, Revision 2.0"},
- {0x172a, "Universal Serial Bus 3.2 Specification, Revision 1.0"},
- {0x172b, "Universal Serial Bus 4 Specification, Revision 1.0"},
- {0x172c, "Universal Serial Bus 4 Specification, Revision 2.0"},
+ {0x172a, "Universal Serial Bus 3.2 Specification Revision 1.0"},
+ {0x172b, "Universal Serial Bus 4 Specification Version 1.0"},
+ {0x172c, "Universal Serial Bus 4 Specification Version 2.0"},
{0x1730, "USB Mass Storage Class Bulk-Only Transport, Revision 1.0"},
{0x1740, "UAS (no version claimed)"}, /* USB attached SCSI */
{0x1743, "UAS T10/2095-D revision 02"},
{0x1747, "UAS T10/2095-D revision 04"},
{0x1748, "UAS INCITS 471-2010"},
- {0x1749, "UAS ISO/IEC 14776-251:2014"},
+ {0x1749, "UAS ISO/IEC 14776-251"},
{0x1761, "ACS-2 (no version claimed)"},
{0x1762, "ACS-2 INCITS 482-2013"},
- {0x1765, "ACS-3 INCITS 522-2014"},
+ {0x1765, "ACS-3 (no version claimed)"},
+ {0x1766, "ACS-3 INCITS 522-2014"},
{0x1767, "ACS-4 INCITS 529-2018"},
+ {0x1768, "ACS-4 (no version claimed)"},
+ {0x1769, "ACS-5 (no version claimed)"},
+ {0x176a, "ACS-5 INCITS 558-2021"},
+ {0x176e, "ACS-6 (no version claimed)"},
+ {0x1778, "ACS-2 ISO/IEC 17760-102"},
+ {0x1779, "ACS-3 ISO/IEC 17760-103"},
+ {0x177b, "ACS-5 ISO/IEC 17760-105"},
{0x1780, "UAS-2 (no version claimed)"},
+ {0x17a3, "ZAC (no version claimed)"},
{0x17a4, "ZAC INCITS 537-2016"},
{0x17a5, "ZAC-2 INCITS 549-2022"},
+ {0x17a6, "ZAC-2 (no version claimed)"},
+ {0x17a7, "ZAC-3 (no version claimed)"},
+ {0x17bc, "ZAC AM1 INCITS 537-2016/AM1-2019"},
{0x17c0, "UAS-3 (no version claimed)"},
{0x17c2, "UAS-3 INCITS 572-2021"},
- {0x17c5, "UAS-3 BSR INCITS 572 revision 5"},
+ {0x17c5, "UAS-3 BSR INCITS 572 revision 05"},
+ {0x1807, "UAS-3 ISO/IEC 14776-253"},
{0x1ea0, "SAT (no version claimed)"},
- {0x1ea7, "SAT T10/1711-D rev 8"},
- {0x1eab, "SAT T10/1711-D rev 9"},
+ {0x1ea7, "SAT T10/1711-D revision 8"},
+ {0x1eab, "SAT T10/1711-D revision 9"},
{0x1ead, "SAT INCITS 431-2007"},
{0x1ec0, "SAT-2 (no version claimed)"},
{0x1ec4, "SAT-2 T10/1826-D revision 06"},
@@ -529,20 +595,25 @@ struct sg_lib_simple_value_name_t sg_version_descriptor_arr[] = {
{0x20a5, "SPL T10/2124-D revision 7"},
{0x20a7, "SPL INCITS 476-2011"},
{0x20a8, "SPL INCITS 476-2011 + SPL AM1 INCITS 476/AM1 2012"},
- {0x20aa, "SPL ISO/IEC 14776-261:2012"},
+ {0x20aa, "SPL ISO/IEC 14776-261"},
{0x20c0, "SPL-2 (no version claimed)"},
{0x20c2, "SPL-2 T10/BSR INCITS 505 revision 4"},
{0x20c4, "SPL-2 T10/BSR INCITS 505 revision 5"},
{0x20c8, "SPL-2 INCITS 505-2013"},
+ {0x20c9, "SPL-2 ISO/IEC 14776-262"},
{0x20e0, "SPL-3 (no version claimed)"},
{0x20e4, "SPL-3 T10/BSR INCITS 492 revision 6"},
{0x20e6, "SPL-3 T10/BSR INCITS 492 revision 7"},
{0x20e8, "SPL-3 INCITS 492-2015"},
+ {0x20e9, "SPL-3 ISO/IEC 14776-263"},
{0x2100, "SPL-4 (no version claimed)"},
{0x2102, "SPL-4 T10/BSR INCITS 538 revision 08a"},
{0x2104, "SPL-4 T10/BSR INCITS 538 revision 10"},
{0x2105, "SPL-4 T10/BSR INCITS 538 revision 11"},
+ {0x2107, "SPL-4 T10/BSR INCITS 538 revision 13"},
+ {0x2110, "SPL-4 INCITS 538-2018"},
{0x2120, "SPL-5 (no version claimed)"},
+ {0x2122, "SPL-5 INCITS 554-2023"},
{0x212e, "SPL-5 BSR INCITS 554 revision 14"},
{0x212f, "SPL-5 BSR INCITS 554 revision 15"},
{0x21e0, "SOP (no version claimed)"},
diff --git a/testing/Makefile b/testing/Makefile
index d33cdd9d..c911fa30 100644
--- a/testing/Makefile
+++ b/testing/Makefile
@@ -4,8 +4,8 @@ PREFIX=/usr/local
INSTDIR=$(DESTDIR)/$(PREFIX)/bin
MANDIR=$(DESTDIR)/$(PREFIX)/man
-EXECS = sg_sense_test sg_queue_tst bsg_queue_tst sg_chk_asc sg_tst_nvme \
- sg_tst_ioctl sg_tst_bidi tst_sg_lib sgs_dd sg_tst_excl \
+EXECS = sg_sense_test sg_queue_tst bsg_queue_tst sg_chk_asc sg_chk_inq_vd \
+ sg_tst_nvme sg_tst_ioctl sg_tst_bidi tst_sg_lib sgs_dd sg_tst_excl \
sg_tst_excl2 sg_tst_excl3 sg_tst_context sg_tst_async sgh_dd \
sg_mrq_dd sg_iovec_tst sg_take_snap sg_tst_json_builder
@@ -85,6 +85,10 @@ sg_tst_ioctl: sg_tst_ioctl.o $(LIBFILESOLD)
sg_chk_asc: sg_chk_asc.o ../lib/sg_lib.o ../lib/sg_lib_data.o ../lib/sg_pr2serr.o
$(LD) -o $@ $(LDFLAGS) $^
+# building sg_chk_asc depends on a prior successful make in ../lib and ../src/sg_inq_data.o
+sg_chk_inq_vd: sg_chk_inq_vd.o ../lib/sg_lib.o ../lib/sg_lib_data.o ../lib/sg_pr2serr.o ../src/sg_inq_data.o
+ $(LD) -o $@ $(LDFLAGS) $^
+
sg_tst_nvme: sg_tst_nvme.o $(LIBFILESNEW)
$(LD) -o $@ $(LDFLAGS) $^
diff --git a/testing/sg_chk_asc.c b/testing/sg_chk_asc.c
index 2641b964..7a3a1e1f 100644
--- a/testing/sg_chk_asc.c
+++ b/testing/sg_chk_asc.c
@@ -28,10 +28,11 @@
* https://www.t10.org/lists/asc-num.txt
*/
-static const char * version_str = "1.10 20230513";
+static const char * version_str = "1.11 20230821";
#define MAX_LINE_LEN 1024
+#define DEF_OFFSET 24
static struct option long_options[] = {
@@ -65,7 +66,7 @@ int main(int argc, char * argv[])
int k, j, res, c, num, len;
unsigned int asc, ascq;
FILE * fp;
- int offset = 24;
+ int offset = DEF_OFFSET;
int verbose = 0;
char file_name[256];
char line[MAX_LINE_LEN];
@@ -138,7 +139,7 @@ int main(int argc, char * argv[])
len = strlen(line);
if (len < 1)
continue;
- if (! isdigit(line[0]))
+ if (! isxdigit(line[0]))
continue;
num = sscanf(line, "%xh/%xh", &asc, &ascq);
if (1 == num)
@@ -149,7 +150,7 @@ int main(int argc, char * argv[])
k + 1, num);
continue;
}
- if (len < 26)
+ if (len < (DEF_OFFSET + 2))
continue;
#if 0
strncpy(b , line, sizeof(b) - 1);
diff --git a/testing/sg_chk_inq_vd.c b/testing/sg_chk_inq_vd.c
new file mode 100644
index 00000000..3c1347b4
--- /dev/null
+++ b/testing/sg_chk_inq_vd.c
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2023 Douglas Gilbert.
+ * All rights reserved.
+ * Use of this source code is governed by a BSD-style
+ * license that can be found in the BSD_LICENSE file.
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <getopt.h>
+#include <ctype.h>
+#include <errno.h>
+
+#include "sg_lib.h"
+#include "sg_lib_data.h"
+#include "sg_pr2serr.h"
+
+/* A utility program for the Linux OS SCSI subsystem.
+ *
+ * This program takes a stds-num.txt file from www.t10.org and
+ * checks it against the version descriptors held in a table
+ * within the ../src/sg_inq_data.c file
+ * The online version of the version descriptor codes listed in
+ * numerical order and in plain text is at:
+ * https://www.t10.org/lists/stds-num.txt
+ */
+
+static const char * version_str = "1.01 20230821";
+
+
+#define MAX_LINE_LEN 1024
+
+extern struct sg_lib_simple_value_name_t sg_version_descriptor_arr[];
+
+static struct option long_options[] = {
+ {"ascii", 0, 0, 'a'},
+ {"bypass", 0, 0, 'b'},
+ {"help", 0, 0, 'h'},
+ {"verbose", 0, 0, 'v'},
+ {"version", 0, 0, 'V'},
+ {0, 0, 0, 0},
+};
+
+static void usage()
+{
+ fprintf(stderr, "Usage: "
+ "sg_chk_inq_vd [--ascii] [--bypass] [--help] [--verbose] "
+ "[--version]\n"
+ " <version_descriptor_file>\n"
+ " where:\n"
+ " --ascii|-a check ASCII (def: only check number "
+ "equality)\n"
+ " --bypass|-b bypass table entries below file entry\n"
+ " --help|-h print out usage message\n"
+ " --verbose|-v increase verbosity\n"
+ " --version|-V print version string and exit\n\n"
+ "Checks version descriptor codes in <version_descriptor_file> "
+ "against\na table in the sg3_utils src/sg_inq_data.c file. "
+ "Example:\n sg_chk_inq_vd -a -b -v stds-num.txt\n"
+ );
+
+}
+
+int main(int argc, char * argv[])
+{
+ bool do_ascii = false;
+ bool do_bypass = false;
+ int k, j, res, c, num, len;
+ unsigned int vd_num;
+ FILE * fp;
+ int verbose = 0;
+ char file_name[256];
+ char line[MAX_LINE_LEN];
+ char b[MAX_LINE_LEN];
+ char bb[MAX_LINE_LEN];
+ char * cp;
+ const char * ccp;
+ const struct sg_lib_simple_value_name_t * svnp =
+ sg_version_descriptor_arr;
+ int ret = 1;
+
+ memset(file_name, 0, sizeof file_name);
+ memset(line, 0, sizeof file_name);
+ while (1) {
+ int option_index = 0;
+
+ c = getopt_long(argc, argv, "abhvV", long_options,
+ &option_index);
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'a':
+ do_ascii = true;
+ break;
+ case 'b':
+ do_bypass = true;
+ break;
+ case 'h':
+ case '?':
+ usage();
+ return 0;
+ case 'v':
+ ++verbose;
+ break;
+ case 'V':
+ fprintf(stderr, "version: %s\n", version_str);
+ return 0;
+ default:
+ fprintf(stderr, "unrecognised switch code 0x%x ??\n", c);
+ usage();
+ return 1;
+ }
+ }
+ if (optind < argc) {
+ if ('\0' == file_name[0]) {
+ strncpy(file_name, argv[optind], sizeof(file_name) - 1);
+ file_name[sizeof(file_name) - 1] = '\0';
+ ++optind;
+ }
+ if (optind < argc) {
+ for (; optind < argc; ++optind)
+ fprintf(stderr, "Unexpected extra argument: %s\n",
+ argv[optind]);
+ usage();
+ return 1;
+ }
+ }
+
+ if (0 == file_name[0]) {
+ fprintf(stderr, "missing file name!\n");
+ usage();
+ return 1;
+ }
+ fp = fopen(file_name, "r");
+ if (NULL == fp) {
+ fprintf(stderr, "open error: %s: %s\n", file_name,
+ safe_strerror(errno));
+ return 1;
+ }
+ for (k = 0; (cp = fgets(line, sizeof(line) - 1, fp)) &&
+ (svnp->value < 0xffff); ++k) {
+ len = strlen(line);
+ if (len < 1)
+ continue;
+ if (! isxdigit(line[0]))
+ continue;
+ if (verbose > 4)
+ pr2serr("line %d: %s", k + 1, line);
+ num = sscanf(line, "%xh %20s", &vd_num, b);
+ if (num < 1) {
+ if (verbose)
+ fprintf(stderr, "Badly formed line number %d (num=%d)\n",
+ k + 1, num);
+ continue;
+ }
+ if ((num > 1) && (0 == memcmp("to", b, 2))) {
+ continue; // skip lines like: '0961h to 097Fh ....'
+ }
+ if (svnp->value != (int)vd_num) {
+ if (do_bypass && (svnp->value < (int)vd_num)) {
+ if (verbose > 0)
+ pr2serr("bypassing table entry: 0x%x\n", svnp->value);
+ j = 0;
+ do {
+ ++svnp;
+ ++j;
+ } while (svnp->value < (int)vd_num);
+ if ((j > 1) && (verbose > 0))
+ pr2serr(" stepped over %d following table entries\n\n",
+ j);
+ if (svnp->value == (int)vd_num) {
+ ++svnp;
+ continue;
+ }
+ }
+ pr2serr("mismatch at file line %d: 0x%x in file versus 0x%x "
+ "[b: %s]\n", k + 1, vd_num, svnp->value, b);
+ break;
+ }
+ if (NULL == svnp->name)
+ break;
+ if (! do_ascii) {
+ ++svnp;
+ continue;
+ }
+ ccp = strchr(line, '\t');
+ if (NULL == ccp)
+ continue;
+
+ strncpy(b , ccp + 1, sizeof(b) - 1);
+ b[sizeof(b) - 1] = '\0';
+ num = strlen(b);
+ if (0xd == b[num - 2])
+ b[num - 2] = '\0';
+ b[num - 1] = '\0';
+ num = strlen(b);
+ for (j = 0; j < num; ++j)
+ b[j] = toupper(b[j]);
+ if (verbose > 5)
+ pr2serr("%s\n", b);
+
+ strncpy(bb , svnp->name, sizeof(bb) - 1);
+ num = strlen(bb);
+ if (num < (int)sizeof(bb))
+ bb[num] = '\0';
+ for (j = 0; j < num; ++j)
+ bb[j] = toupper(bb[j]);
+ if (verbose > 5)
+ pr2serr(" %s\n", bb);
+
+ if ((0 != memcmp(b, bb, strlen(b))) ||
+ (0 != memcmp(b, bb, strlen(bb)))) {
+ pr2serr("line %d differs: %s", k + 1, line);
+ pr2serr("t>> %s\n\n", svnp->name ? svnp->name : "<null>");
+ }
+
+ ++svnp;
+ }
+ if (NULL == cp) {
+ if (feof(fp)) {
+ if (svnp->value < 0xffff) {
+ for (j = 0; (svnp->value < 0xffff) && (j < 1024);
+ ++j, ++svnp) { }
+ if (j >= 1024)
+ pr2serr("short stds-num.txt file, run-away on internal "
+ "table\n");
+ else
+ pr2serr("%d extra entries on end of internal table\n", j);
+ } else if (verbose > 1)
+ pr2serr("EOF detected on given file\n");
+ } else
+ pr2serr("fgets: %s\n", safe_strerror(errno));
+ } else if (verbose > 5)
+ pr2serr("last line of given line processed: %s\n", line);
+ if (verbose)
+ pr2serr("Finished on line %d of input file\n", k + 1);
+
+ res = fclose(fp);
+ if (EOF == res) {
+ fprintf(stderr, "close error: %s\n", safe_strerror(errno));
+ return 1;
+ }
+ return ret;
+}