aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2012-09-20 23:07:47 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2012-09-20 23:07:47 +0000
commit8e3cdef4e47582c00a25d535b5db43b86620615e (patch)
tree1dd7fccbf9f49378b9719e023d473f4b26c11bdd /src
parent68167d1b929f09aaa77fb0c8e701eb91f0e87dbd (diff)
downloadsg3_utils-8e3cdef4e47582c00a25d535b5db43b86620615e.tar.gz
sync with spc4r36; new proto_id: protocol specific port identifier
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@457 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src')
-rw-r--r--src/sg_inq.c36
-rw-r--r--src/sg_inq_data.c30
-rw-r--r--src/sg_modes.c4
-rw-r--r--src/sg_vpd.c29
4 files changed, 71 insertions, 28 deletions
diff --git a/src/sg_inq.c b/src/sg_inq.c
index 56a5e543..a3d61a94 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -66,7 +66,7 @@
* information [MAINTENANCE IN, service action = 0xc]; see sg_opcodes.
*/
-static char * version_str = "1.06 20120320"; /* SPC-4 rev 34 */
+static char * version_str = "1.07 20120920"; /* SPC-4 rev 36 */
/* Following VPD pages are in ascending page number order */
@@ -1007,7 +1007,8 @@ static const char * desig_type_arr[] =
"Logical unit group", /* SCSI_IDENT_PORT_LU_GROUP */
"MD5 logical unit identifier", /* SCSI_IDENT_DEVICE_MD5 */
"SCSI name string", /* SCSI_IDENT_DEVICE_SCSINAME */
- "[0x9]", "[0xa]", "[0xb]", "[0xc]", "[0xd]", "[0xe]", "[0xf]",
+ "Protocol specific port identifier", /* spc4r36 */
+ "[0xa]", "[0xb]", "[0xc]", "[0xd]", "[0xe]", "[0xf]",
};
/* These are target port, device server (i.e. target) and LU identifiers */
@@ -1038,6 +1039,7 @@ decode_dev_ids(const char * leadin, unsigned char * buff, int len, int do_hex)
c_set = 1;
assoc = 0;
piv = 0;
+ p_id = 0xf;
desig_type = 3;
j = 1;
off = 16;
@@ -1060,9 +1062,9 @@ decode_dev_ids(const char * leadin, unsigned char * buff, int len, int do_hex)
return;
}
ip = ucp + 4;
- p_id = ((ucp[0] >> 4) & 0xf);
- c_set = (ucp[0] & 0xf);
- piv = ((ucp[1] & 0x80) ? 1 : 0);
+ p_id = ((ucp[0] >> 4) & 0xf); /* protocol identifier */
+ c_set = (ucp[0] & 0xf); /* code set */
+ piv = ((ucp[1] & 0x80) ? 1 : 0); /* protocol identifier valid */
assoc = ((ucp[1] >> 4) & 0x3);
desig_type = (ucp[1] & 0xf);
decode:
@@ -1289,10 +1291,26 @@ decode_dev_ids(const char * leadin, unsigned char * buff, int len, int do_hex)
*/
printf(" %s\n", (const char *)ip);
break;
- case 9: /* PCIe routing ID */
- /* added in sbc4r34, no limits on code_set or association ?? */
- d_id = ((ip[0] << 8) | ip[1]);
- printf(" PCIe routing ID: 0x%x\n", d_id);
+ case 9: /* Protocol specific port identifier */
+ /* added in spc4r36, PIV must be set, proto_id indicates */
+ /* whether UAS (USB) or SOP (PCIe) or ... */
+ if (! piv)
+ printf(" >>>> Protocol specific port identifier "
+ "expects protocol\n"
+ " identifier to be valid and it is not\n");
+ if (TPROTO_UAS == p_id) {
+ printf(" USB device address: 0x%x\n", 0x7f & ip[0]);
+ printf(" USB interface number: 0x%x\n", ip[2]);
+ } else if (TPROTO_SOP == p_id) {
+ printf(" PCIe routing ID, bus number: 0x%x\n", ip[0]);
+ printf(" function number: 0x%x\n", ip[1]);
+ printf(" [or device number: 0x%x, function number: "
+ "0x%x]\n", (0x1f & (ip[1] >> 3)), 0x7 & ip[1]);
+ } else
+ printf(" >>>> unexpected protocol indentifier: %s\n"
+ " with Protocol specific port "
+ "identifier\n",
+ sg_get_trans_proto_str(p_id, sizeof(b), b));
break;
default: /* reserved */
dStrHex((const char *)ip, i_len, -1);
diff --git a/src/sg_inq_data.c b/src/sg_inq_data.c
index aa9e12d2..5e8e9801 100644
--- a/src/sg_inq_data.c
+++ b/src/sg_inq_data.c
@@ -1,13 +1,3 @@
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-
/* A utility program originally written for the Linux OS SCSI subsystem.
* Copyright (C) 2000-2012 D. Gilbert
* This program is free software; you can redistribute it and/or modify
@@ -20,6 +10,16 @@
*/
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
/* Assume index is less than 16 */
const char * sg_ansi_version_arr[] =
{
@@ -186,6 +186,7 @@ struct sg_version_descriptor sg_version_descriptor_arr[] = {
{0x461, "SPC-4 T10/1731-D revision 16"},
{0x462, "SPC-4 T10/1731-D revision 18"},
{0x463, "SPC-4 T10/1731-D revision 23"},
+ {0x466, "SPC-4 T10/1731-D revision 36"},
{0x480, "SMC-3 (no version claimed)"},
{0x482, "SMC-3 T10/1730-D revision 15"},
{0x482, "SMC-3 T10/1730-D revision 16"},
@@ -206,6 +207,9 @@ struct sg_version_descriptor sg_version_descriptor_arr[] = {
{0x523, "SSC-4 T10/2123-D revision 2"},
{0x560, "OSD-3 (no version claimed)"},
{0x580, "SES-3 (no version claimed)"},
+ {0x5a0, "SSC-5 (no version claimed)"},
+ {0x5c0, "SPC-5 (no version claimed)"},
+ {0x5e0, "SFSC (no version claimed)"},
{0x820, "SSA-TL2 (no version claimed)"},
{0x83b, "SSA-TL2 T10/1147-D revision 05b"},
{0x83c, "SSA-TL2 ANSI INCITS 308-1998"},
@@ -266,7 +270,7 @@ struct sg_version_descriptor 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 ANSI INCITS 481-2011"},
+ {0xa46, "FCP-4 ANSI INCITS 481-2012"},
{0xaa0, "SPI (no version claimed)"},
{0xab9, "SPI T10/0855-D revision 15a"},
{0xaba, "SPI ANSI INCITS 253-1995"},
@@ -389,9 +393,11 @@ struct sg_version_descriptor sg_version_descriptor_arr[] = {
{0x12a3, "FC-SCM T11/1824DT revision 1.0"},
{0x12a5, "FC-SCM T11/1824DT revision 1.1"},
{0x12a7, "FC-SCM T11/1824DT revision 1.4"},
+ {0x12aa, "FC-SCM INCITS TR-47 2012"},
{0x12c0, "FC-DA-2 (no version claimed)"},
{0x12c3, "FC-DA-2 T11/1870DT revision 1.04"},
{0x12c5, "FC-DA-2 T11/1870DT revision 1.06"},
+ {0x12c9, "FC-DA-2 INCITS TR-49 2012"},
{0x12e0, "FC-DA (no version claimed)"},
{0x12e2, "FC-DA T11/1513-DT revision 3.1"},
{0x12e8, "FC-DA ANSI INCITS TR-36 2004"},
@@ -452,8 +458,10 @@ struct sg_version_descriptor sg_version_descriptor_arr[] = {
{0x20a3, "SPL T10/2124-D revision 6a"},
{0x20a5, "SPL T10/2124-D revision 7"},
{0x20a7, "SPL SPL ANSI INCITS 476-2011"},
+ {0x20a8, "SPL ANSI INCITS 476-2011 + SPL AM1 INCITS 476/AM1 2012"},
{0x20c0, "SPL-2 (no version claimed)"},
{0x20c2, "SPL-2 T10/2228-D revision 4"},
+ {0x20c4, "SPL-2 T10/2228-D revision 5"},
{0x20e0, "SPL-3 (no version claimed)"},
{0x21e0, "SOP (no version claimed)"},
{0x2200, "PQI (no version claimed)"},
diff --git a/src/sg_modes.c b/src/sg_modes.c
index d7180493..a82a2d1a 100644
--- a/src/sg_modes.c
+++ b/src/sg_modes.c
@@ -25,7 +25,7 @@
#include "sg_lib.h"
#include "sg_cmds_basic.h"
-static char * version_str = "1.38 20120224";
+static char * version_str = "1.39 20120920";
#define DEF_ALLOC_LEN (1024 * 4)
#define DEF_6_ALLOC_LEN 252
@@ -538,7 +538,7 @@ static struct page_code_desc pc_desc_disk[] = {
{0xb, 0x0, "Medium types supported (obsolete)"},
{0xc, 0x0, "Notch and partition (obsolete)"},
{0xd, 0x0, "Power condition (obsolete, moved to 0x1a)"},
- {0x10, 0x0, "XOR control"},
+ {0x10, 0x0, "XOR control"}, /* obsolete in sbc3r32 */
{0x1a, 0xf1, "ATA Power condition"},
{0x1c, 0x1, "Background control"},
{0x1c, 0x2, "Logical block provisioning"},
diff --git a/src/sg_vpd.c b/src/sg_vpd.c
index f5c13bee..9eb1b3a6 100644
--- a/src/sg_vpd.c
+++ b/src/sg_vpd.c
@@ -30,7 +30,7 @@
*/
-static char * version_str = "0.62 20120919"; /* spc4r35 + sbc3r32 */
+static char * version_str = "0.62 20120920"; /* spc4r36 + sbc3r32 */
extern void svpd_enumerate_vendor(void);
extern int svpd_decode_vendor(int sg_fd, int num_vpd, int subvalue,
@@ -579,7 +579,8 @@ static const char * desig_type_arr[] =
"Logical unit group",
"MD5 logical unit identifier",
"SCSI name string",
- "Reserved [0x9]", "Reserved [0xa]", "Reserved [0xb]",
+ "Protocol specific port identifier", /* spc4r36 */
+ "Reserved [0xa]", "Reserved [0xb]",
"Reserved [0xc]", "Reserved [0xd]", "Reserved [0xe]", "Reserved [0xf]",
};
@@ -1006,10 +1007,26 @@ decode_designation_descriptor(const unsigned char * ip, int i_len,
*/
printf(" %s\n", (const char *)ip);
break;
- case 9: /* PCIe routing ID */
- /* added in sbc4r34, no limits on code_set or association ?? */
- d_id = ((ip[0] << 8) | ip[1]);
- printf(" PCIe routing ID: 0x%x\n", d_id);
+ case 9: /* Protocol specific port identifier */
+ /* added in spc4r36, PIV must be set, proto_id indicates */
+ /* whether UAS (USB) or SOP (PCIe) or ... */
+ if (! piv)
+ printf(" >>>> Protocol specific port identifier "
+ "expects protocol\n"
+ " identifier to be valid and it is not\n");
+ if (TPROTO_UAS == p_id) {
+ printf(" USB device address: 0x%x\n", 0x7f & ip[0]);
+ printf(" USB interface number: 0x%x\n", ip[2]);
+ } else if (TPROTO_SOP == p_id) {
+ printf(" PCIe routing ID, bus number: 0x%x\n", ip[0]);
+ printf(" function number: 0x%x\n", ip[1]);
+ printf(" [or device number: 0x%x, function number: "
+ "0x%x]\n", (0x1f & (ip[1] >> 3)), 0x7 & ip[1]);
+ } else
+ printf(" >>>> unexpected protocol indentifier: %s\n"
+ " with Protocol specific port "
+ "identifier\n",
+ sg_get_trans_proto_str(p_id, sizeof(b), b));
break;
default: /* reserved */
dStrHex((const char *)ip, i_len, 0);