aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2021-10-31 01:36:51 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2021-10-31 01:36:51 +0000
commit901931cfdad6f06e22c24beba339bb08d2265498 (patch)
tree99378c1ca0db087eb17c3f1aeaadce8c30d3dbeb
parentf0195003bb0c66ba55084b2f7e0fe982f08c5675 (diff)
downloadsg3_utils-901931cfdad6f06e22c24beba339bb08d2265498.tar.gz
sg_logs: additions to Command duration limits statistics log page [spc6r06]; configure.ac: tweak to accepts uclinux as linux
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@917 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r--ChangeLog5
-rwxr-xr-xconfigure2
-rw-r--r--configure.ac2
-rw-r--r--doc/sg_ses.87
-rw-r--r--scripts/40-usb-blacklist.rules2
-rw-r--r--scripts/58-scsi-sg3_symlink.rules2
-rw-r--r--src/sg_logs.c31
-rw-r--r--src/sg_ses.c21
-rw-r--r--testing/Makefile2
9 files changed, 56 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 7714e814..b244653e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,7 @@ 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.47 [20211028] [svn: r916]
+Changelog for pre-release sg3_utils-1.47 [20211030] [svn: r917]
- transport error handling improved. To fix report of a
BAD_TARGET transport error but the utility still continued.
- introduce SG_LIB_TRANSPORT_ERROR [35] exit status
@@ -13,6 +13,8 @@ Changelog for pre-release sg3_utils-1.47 [20211028] [svn: r916]
- fix crash when '-m LEN' < 252
- guard against smaller '--maxlen=' values
- sg_logs: additions to Volume statistics lpage [ssc5r05c]
+ - additions to Command duration limits statistics log
+ page [spc6r06]
- sg_vpd: fix do_hex type on some recent pages
- zoned block dev char vpd: add zone alignment mode and
zone starting LBA granularity [zbc2r11]
@@ -43,6 +45,7 @@ Changelog for pre-release sg3_utils-1.47 [20211028] [svn: r916]
- gcc -fanalyzer fixes: in sg_pt_linux.c + sg_write_x.c
- sg_pt_dummy.c: add list of functions that a new pt
needs to define
+ - configure.ac: tweak to accept uclinux as linux
- move some hex files from examples to inhex directory
- major rework of lib/sg_pt_freebsd.c; make SNTL as similar
as feasible to the Linux implementation
diff --git a/configure b/configure
index fa5bf2ac..c2b13b9b 100755
--- a/configure
+++ b/configure
@@ -13335,7 +13335,7 @@ else
OS_FREEBSD_FALSE=
fi
- if echo $host_os | grep '^linux' > /dev/null; then
+ if echo $host_os | grep -E '^(uc)?linux' > /dev/null; then
OS_LINUX_TRUE=
OS_LINUX_FALSE='#'
else
diff --git a/configure.ac b/configure.ac
index f928f43a..0f83129d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,7 +123,7 @@ esac
# Define platform-specific symbol.
AM_CONDITIONAL(OS_FREEBSD, [echo $host_os | grep 'freebsd' > /dev/null])
-AM_CONDITIONAL(OS_LINUX, [echo $host_os | grep '^linux' > /dev/null])
+AM_CONDITIONAL(OS_LINUX, [echo $host_os | grep -E '^(uc)?linux' > /dev/null])
AM_CONDITIONAL(OS_OSF, [echo $host_os | grep '^osf' > /dev/null])
AM_CONDITIONAL(OS_SOLARIS, [echo $host_os | grep '^solaris' > /dev/null])
AM_CONDITIONAL(OS_WIN32_MINGW, [echo $host_os | grep '^mingw' > /dev/null])
diff --git a/doc/sg_ses.8 b/doc/sg_ses.8
index 4afcb2b4..175e2fca 100644
--- a/doc/sg_ses.8
+++ b/doc/sg_ses.8
@@ -50,6 +50,13 @@ most recent reference for this utility is the draft SCSI Enclosure Services
standards for SES, SES\-2 and SES\-3 are ANSI INCITS 305\-1998 and ANSI
INCITS 448\-2008 and ANSI INCITS 518\-2017 respectively.
.PP
+SAS expanders typically have a SES device attached via a virtual port.
+Some HBAs (SCSI initiators) choose to expose a SES device internally. That
+means the SCSI subsystem on the host machine can see the SES device, but
+devices connected to that HBA (e.g. a SAS expander) cannot see the HBA's
+SES device. That internal SES device might report on the temperature(s)
+of the HBA and whether anything is connected to its SCSI ports.
+.PP
The first form shown in the synopsis is for fetching and decoding dpages or
fields from the SES \fIDEVICE\fR. A SCSI RECEIVE DIAGNOSTIC RESULTS command
is sent to the \fIDEVICE\fR to obtain each dpage response. Rather than
diff --git a/scripts/40-usb-blacklist.rules b/scripts/40-usb-blacklist.rules
index 6cce3e6b..66313880 100644
--- a/scripts/40-usb-blacklist.rules
+++ b/scripts/40-usb-blacklist.rules
@@ -6,7 +6,7 @@
ACTION!="add|change", GOTO="usb_blacklist_end"
KERNEL!="sd*[!0-9]|sr*", GOTO="usb_blacklist_end"
-# unkown device
+# unknown device
ATTRS{idVendor}=="0aec", ATTRS{idProduct}=="3260", ENV{ID_SCSI_INQUIRY}="1"
# Sony/JMicron port replicator
ATTRS{idVendor}=="054c", ATTRS{idProduct}=="06a0", ENV{ID_SCSI_INQUIRY}="1"
diff --git a/scripts/58-scsi-sg3_symlink.rules b/scripts/58-scsi-sg3_symlink.rules
index 2aacfec8..fe6b0000 100644
--- a/scripts/58-scsi-sg3_symlink.rules
+++ b/scripts/58-scsi-sg3_symlink.rules
@@ -25,7 +25,7 @@ ENV{SCSI_IDENT_LUN_EUI64}=="?*", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-id
# 5: SCSI name identifier (prefix 8)
ENV{SCSI_IDENT_LUN_NAME}=="?*", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-id/scsi-8$env{SCSI_IDENT_LUN_NAME}"
ENV{SCSI_IDENT_LUN_NAME}=="?*", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-id/scsi-8$env{SCSI_IDENT_LUN_NAME}-part%n"
-# 6: T10 Vendor identifer (prefix 1)
+# 6: T10 Vendor identifier (prefix 1)
ENV{SCSI_IDENT_LUN_T10}=="?*", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-id/scsi-1$env{SCSI_IDENT_LUN_T10}"
ENV{SCSI_IDENT_LUN_T10}=="?*", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-id/scsi-1$env{SCSI_IDENT_LUN_T10}-part%n"
# 7: IEEE Locally assigned
diff --git a/src/sg_logs.c b/src/sg_logs.c
index ef9c8fbc..99fd44aa 100644
--- a/src/sg_logs.c
+++ b/src/sg_logs.c
@@ -36,7 +36,7 @@
#include "sg_unaligned.h"
#include "sg_pr2serr.h"
-static const char * version_str = "1.86 20210924"; /* spc6r05 + sbc5r01 */
+static const char * version_str = "1.87 20211030"; /* spc6r06 + sbc5r01 */
#define MX_ALLOC_LEN (0xfffc)
#define SHORT_RESP_LEN 128
@@ -2107,7 +2107,7 @@ show_cmd_dur_limits_page(const uint8_t * resp, int len,
bp = &resp[0] + 4;
while (num > 3) {
pc = sg_get_unaligned_be16(bp + 0);
- pl = bp[3] + 4;
+ pl = bp[3] + 4; /* parameter length */
if (op->filter_given) {
if (pc != op->filter)
goto skip;
@@ -2158,6 +2158,33 @@ show_cmd_dur_limits_page(const uint8_t * resp, int len,
printf(" Number of latency misses attributable to background "
"operations = %u\n", sg_get_unaligned_be32(bp + 32));
break;
+ case 0x31:
+ case 0x32:
+ case 0x33:
+ case 0x34:
+ case 0x35:
+ case 0x36:
+ case 0x37:
+ case 0x41:
+ case 0x42:
+ case 0x43:
+ case 0x44:
+ case 0x45:
+ case 0x46:
+ case 0x47:
+ /* This short form introduced in draft spc6r06 */
+ printf(" Command duration limit T2%s %d [Parameter code 0x%x]:\n",
+ ((pc > 0x40) ? "B" : "A"),
+ ((pc > 0x40) ? (pc - 0x40) : (pc - 0x30)), pc);
+ printf(" Number of inactive target miss commands = %u\n",
+ sg_get_unaligned_be32(bp + 4));
+ printf(" Number of active target miss commands = %u\n",
+ sg_get_unaligned_be32(bp + 8));
+ printf(" Number of inactive+active target miss commands = %u\n",
+ sg_get_unaligned_be32(bp + 12));
+ printf(" Number of commands = %u\n",
+ sg_get_unaligned_be32(bp + 16));
+ break;
default:
printf(" <<unexpected parameter code 0x%x\n", pc);
break;
diff --git a/src/sg_ses.c b/src/sg_ses.c
index ecebb9db..9b16134b 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -38,7 +38,7 @@
* commands tailored for SES (enclosure) devices.
*/
-static const char * version_str = "2.53 20211022"; /* ses4r04 */
+static const char * version_str = "2.54 20211028"; /* ses4r04 */
#define MX_ALLOC_LEN ((64 * 1024) - 4) /* max allowable for big enclosures */
#define MX_ELEM_HDR 1024
@@ -827,15 +827,15 @@ usage(int help_num)
{
if (2 != help_num) {
pr2serr(
- "Usage: sg_ses [--all] [--descriptor=DES] [--dev-slot-num=SN] "
- "[--eiioe=A_F]\n"
- " [--filter] [--get=STR] [--hex] "
- "[--index=IIA | =TIA,II]\n"
- " [--inner-hex] [--join] [--maxlen=LEN] "
- "[--page=PG] [--quiet]\n"
- " [--raw] [--readonly] [--sas-addr=SA] [--status] "
- "[--verbose]\n"
- " [--warn] DEVICE\n\n"
+ "Usage: sg_ses [--all] [--ALL] [--descriptor=DES] "
+ "[--dev-slot-num=SN]\n"
+ " [--eiioe=A_F] [--filter] [--get=STR] "
+ "[--hex]\n"
+ " [--index=IIA | =TIA,II] [--inner-hex] [--join] "
+ "[--maxlen=LEN]\n"
+ " [--page=PG] [--quiet] [--raw] [--readonly] "
+ "[--sas-addr=SA]\n"
+ " [--status] [--verbose] [--warn] DEVICE\n\n"
" sg_ses --control [--byte1=B1] [--clear=STR] "
"[--data=H,H...]\n"
" [--descriptor=DES] [--dev-slot-num=SN] "
@@ -927,6 +927,7 @@ usage(int help_num)
} else { /* for '-hh' or '--help --help' */
pr2serr(
" where the remaining sg_ses options are:\n"
+ " --ALL|-z same as --all twice (adds thresholds)\n"
" --byte1=B1|-b B1 byte 1 (2nd byte) of control page set "
"to B1\n"
" --data=H,H...|-d H,H... string of ASCII hex bytes to "
diff --git a/testing/Makefile b/testing/Makefile
index 14ee0d27..ea55cbc6 100644
--- a/testing/Makefile
+++ b/testing/Makefile
@@ -33,7 +33,7 @@ CXXFLAGS = -std=c++11 -pthread -ggdb -O2 -W -Wall -iquote ../include -D_REENTRAN
## CXXFLAGS = -std=c++14 -pthread -ggdb -O2 -W -Wall -iquote ../include -D_REENTRANT $(LARGE_FILE_FLAGS)
## CXXFLAGS = -std=c++17 -pthread -ggdb -O2 -W -Wall -iquote ../include -D_REENTRANT $(LARGE_FILE_FLAGS)
## CXXFLAGS = -std=c++20 -pthread -ggdb -O2 -W -Wall -iquote ../include -D_REENTRANT $(LARGE_FILE_FLAGS)
-# CXXFLAGS = -std=c++2a -pthread -ggdb -O2 -W -Wall -iquote ../include -D_REENTRANT $(LARGE_FILE_FLAGS)
+## CXXFLAGS = -std=c++2a -pthread -ggdb -O2 -W -Wall -iquote ../include -D_REENTRANT $(LARGE_FILE_FLAGS)
# CPPFLAGS = -iquote ../include -iquote .. -D_REENTRANT $(LARGE_FILE_FLAGS) -DHAVE_CONFIG_H -DHAVE_NVME -DDEBUG
CFLAGS = -g -O2 -W -Wall
# CFLAGS = -ggdb -O2 -W -Wall -DDEBUG