aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--debian/changelog2
-rw-r--r--doc/sg3_utils.82
-rw-r--r--doc/sg_ses.816
-rw-r--r--lib/sg_pt_freebsd.c11
-rw-r--r--sg3_utils.spec2
-rw-r--r--src/sg_ses.c23
-rw-r--r--testing/sg_chk_asc.c8
-rw-r--r--testing/sg_tst_nvme.c6
9 files changed, 48 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index d7aec470..4aeb74f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,8 +2,9 @@ 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.46 [20210222] [svn: r877]
- - sg_rep_pip: report new provisioning initialization pattern cmd
+Changelog for released sg3_utils-1.46 [20210301] [svn: r878]
+ - sg_rep_pip: new utility: report provisioning initialization
+ pattern command
- sg_turs: estimated time-to-ready [20-061r2]
- add --delay=MS option
- sg_requests: substantial cleanup
@@ -20,6 +21,7 @@ Changelog for pre-release sg3_utils-1.46 [20210222] [svn: r877]
- sg_rep_zones: print invalid write pointer LBA as -1 rather
than 16 "f"s
- sg_ses: use fan speed factor field for calculation [ses4r04]
+ - add --all (-a) option, same action as --join
- sg_compare_and_write: add examples section to its manpage
- sg_modes: document '-s' option (same as '-6')
- sg_sanitize + sg_format: when --verbose given once report
@@ -32,7 +34,7 @@ Changelog for pre-release sg3_utils-1.46 [20210222] [svn: r877]
- add --cmdset option to bypass cdb heuristic
- add --scan= first_opcode,last_opcode
- sg_pt_freebsd: allow device names without leading /dev/
- fix for regression introduced in rev 731 (ver: 1.43)
+ thus fix for regression introduced in rev 731 (ver: 1.43)
- sg_pt_solaris+sg_pt_osf1: fix problem with clear_scsi_pt_obj()
which needs to remember is_nvme and dev_fd values
- sg_lib: restore elements and rebuild command added
@@ -55,7 +57,7 @@ Changelog for pre-release sg3_utils-1.46 [20210222] [svn: r877]
- testing: remove master-slave terminology for sgv4
- examples: add nvme_read_ctl.hex and nvme_write_ctl.hex
-Changelog for sg3_utils-1.45 [20200229] [svn: r843]
+Changelog for released sg3_utils-1.45 [20200229] [svn: r843]
- sg_get_elem_status: new utility [sbc4r16]
- sg_ses: bug: --page= being overridden when --control and --data= also
given; fix
diff --git a/debian/changelog b/debian/changelog
index c4e8106d..c2170f40 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@ sg3-utils (1.46-0.1) unstable; urgency=low
* New upstream version
- -- Douglas Gilbert <dgilbert@interlog.com> Mon, 22 Feb 2021 15:00:00 -0500
+ -- Douglas Gilbert <dgilbert@interlog.com> Fri, 26 Feb 2021 12:00:00 -0500
sg3-utils (1.45-0.1) unstable; urgency=low
diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8
index 38a2481e..a510fa09 100644
--- a/doc/sg3_utils.8
+++ b/doc/sg3_utils.8
@@ -1,4 +1,4 @@
-.TH SG3_UTILS "8" "February 2021" "sg3_utils\-1.46" SG3_UTILS
+.TH SG3_UTILS "8" "March 2021" "sg3_utils\-1.46" SG3_UTILS
.SH NAME
sg3_utils \- a package of utilities for sending SCSI commands
.SH SYNOPSIS
diff --git a/doc/sg_ses.8 b/doc/sg_ses.8
index e84e2b05..452c6184 100644
--- a/doc/sg_ses.8
+++ b/doc/sg_ses.8
@@ -1,10 +1,10 @@
-.TH SG_SES "8" "November 2020" "sg3_utils\-1.45" SG3_UTILS
+.TH SG_SES "8" "February 2021" "sg3_utils\-1.46" SG3_UTILS
.SH NAME
sg_ses \- access a SCSI Enclosure Services (SES) device
.SH SYNOPSIS
.B sg_ses
-[\fI\-\-descriptor=DES\fR] [\fI\-\-dev\-slot\-num=SN\fR] [\fI\-\-eiioe=A_F\fR]
-[\fI\-\-filter\fR] [\fI\-\-get=STR\fR] [\fI\-\-hex\fR]
+[\fI\-\-all\fR] [\fI\-\-descriptor=DES\fR] [\fI\-\-dev\-slot\-num=SN\fR]
+[\fI\-\-eiioe=A_F\fR] [\fI\-\-filter\fR] [\fI\-\-get=STR\fR] [\fI\-\-hex\fR]
[\fI\-\-index=IIA\fR | \fI\-\-index=TIA,II\fR] [\fI\-\-inner\-hex\fR]
[\fI\-\-join\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-page=PG\fR] [\fI\-\-quiet\fR]
[\fI\-\-raw\fR] [\fI\-\-readonly\fR] [\fI\-\-sas\-addr=SA\fR]
@@ -45,7 +45,7 @@ If the \fIDEVICE\fR argument is given with no options then the names of all
diagnostic pages (dpages) supported are listed. Most, but not necessarily
all, of the named dpages are defined in the SES standards and drafts. The
most recent reference for this utility is the draft SCSI Enclosure Services
-4 document T10/BSR INCITS 555 Revision 1 at http://www.t10.org . Existing
+4 document T10/BSR INCITS 555 Revision 5 at http://www.t10.org . Existing
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
@@ -87,6 +87,12 @@ Arguments to long options are mandatory for short options as well.
The options are arranged in alphabetical order based on the long
option name.
.TP
+\fB\-a\fR, \fB\-\-all\fR
+shows (almost) all status dpages, following references and presenting
+the information as a long list whose indentation indicates the level
+of nesting. This option is actually the same as \fI\-\-join\fR, see its
+description for more information.
+.TP
\fB\-b\fR, \fB\-\-byte1\fR=\fIB1\fR
some modifiable dpages may need byte 1 (i.e. the second byte) set. In the
Enclosure Control dpage, byte 1 contains the INFO, NON\-CRIT, CRIT and
@@ -761,7 +767,7 @@ Written by Douglas Gilbert.
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
-Copyright \(co 2004\-2020 Douglas Gilbert
+Copyright \(co 2004\-2021 Douglas Gilbert
.br
This software is distributed under a FreeBSD license. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/lib/sg_pt_freebsd.c b/lib/sg_pt_freebsd.c
index 180b582d..4a3845f6 100644
--- a/lib/sg_pt_freebsd.c
+++ b/lib/sg_pt_freebsd.c
@@ -7,7 +7,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-/* sg_pt_freebsd version 1.38 20210221 */
+/* sg_pt_freebsd version 1.39 20210225 */
#include <stdio.h>
#include <stdlib.h>
@@ -166,7 +166,6 @@ scsi_pt_open_flags(const char * device_name, int oflags, int vb)
struct freebsd_dev_channel *fdc_p = NULL;
struct cam_device* cam_dev;
struct stat a_stat;
- char b[PATH_MAX];
char dev_nm[PATH_MAX];
// Search table for a free entry
@@ -184,6 +183,8 @@ scsi_pt_open_flags(const char * device_name, int oflags, int vb)
}
first_ch = device_name[0];
if (('/' != first_ch) && ('.' != first_ch)) {
+ char b[PATH_MAX];
+
/* Step 1: if device_name is symlink, follow it */
s = readlink(device_name, b, sizeof(b));
if (s <= 0) {
@@ -220,11 +221,11 @@ scsi_pt_open_flags(const char * device_name, int oflags, int vb)
nv_ctrlid = broadcast_nsid;
possible_nvme = false;
while (true) { /* dummy loop, so can 'break' out */
- if(sscanf(b, NVME_CTRLR_PREFIX "%u%c", &nv_ctrlid, &tmp) == 1) {
+ if(sscanf(dev_nm, NVME_CTRLR_PREFIX "%u%c", &nv_ctrlid, &tmp) == 1) {
if(nv_ctrlid == broadcast_nsid)
break;
- } else if (sscanf(b, NVME_CTRLR_PREFIX "%d" NVME_NS_PREFIX "%d%c",
- &nv_ctrlid, &nsid, &tmp) == 2) {
+ } else if (sscanf(dev_nm, NVME_CTRLR_PREFIX "%d" NVME_NS_PREFIX
+ "%d%c", &nv_ctrlid, &nsid, &tmp) == 2) {
if((nv_ctrlid == broadcast_nsid) || (nsid == broadcast_nsid))
break;
} else
diff --git a/sg3_utils.spec b/sg3_utils.spec
index 44982897..0e0ad773 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -84,7 +84,7 @@ fi
%{_libdir}/*.la
%changelog
-* Mon Feb 22 2021 - dgilbert at interlog dot com
+* Fri Feb 26 2021 - dgilbert at interlog dot com
- track t10 changes
* sg3_utils-1.46
diff --git a/src/sg_ses.c b/src/sg_ses.c
index 7072c50f..0750aede 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004-2020 Douglas Gilbert.
+ * Copyright (c) 2004-2021 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.
@@ -740,6 +740,7 @@ static bool active_et_aesp_arr[NUM_ACTIVE_ET_AESP_ARR] = {
/* Command line long option names with corresponding short letter. */
static struct option long_options[] = {
+ {"all", no_argument, 0, 'a'},
{"byte1", required_argument, 0, 'b'},
{"clear", required_argument, 0, 'C'},
{"control", no_argument, 0, 'c'},
@@ -824,7 +825,7 @@ usage(int help_num)
{
if (2 != help_num) {
pr2serr(
- "Usage: sg_ses [--descriptor=DES] [--dev-slot-num=SN] "
+ "Usage: sg_ses [--all] [--descriptor=DES] [--dev-slot-num=SN] "
"[--eiioe=A_F]\n"
" [--filter] [--get=STR] [--hex] "
"[--index=IIA | =TIA,II]\n"
@@ -851,10 +852,11 @@ usage(int help_num)
);
if ((help_num < 1) || (help_num > 2)) {
pr2serr("Or the corresponding short option usage: \n"
- " sg_ses [-D DES] [-x SN] [-E A_F] [-f] [-G STR] [-H] "
- "[-I IIA|TIA,II] [-i]\n"
- " [-j] [-m LEN] [-p PG] [-q] [-r] [-R] [-A SA] "
- "[-s] [-v] [-w] DEVICE\n\n"
+ " sg_ses [-a] [-D DES] [-x SN] [-E A_F] [-f] [-G STR] "
+ "[-H] [-I IIA|TIA,II]\n"
+ " [-i] [-j] [-m LEN] [-p PG] [-q] [-r] [-R] "
+ "[-A SA] [-s] [-v] [-w]\n"
+ " DEVICE\n\n"
" sg_ses [-b B1] [-C STR] [-c] [-d H,H...] [-D DES] "
"[-x SN] [-I IIA|TIA,II]\n"
" [-M] [-m LEN] [-N SEID] [-n SEN] [-p PG] "
@@ -866,11 +868,13 @@ usage(int help_num)
"form>]\n\n"
" sg_ses [-e] [-h] [-I IIA] [-l] [-V]\n"
);
- pr2serr("\nFor help use with '-h' one or more times\n");
+ pr2serr("\nFor help use '-h' one or more times.\n");
return;
}
pr2serr(
" where the main options are:\n"
+ " --all|-a show (almost) all status pages (same "
+ "as --join)\n"
" --clear=STR|-C STR clear field by acronym or position\n"
" --control|-c send control information (def: fetch "
"status)\n"
@@ -1142,12 +1146,15 @@ parse_cmd_line(struct opts_t *op, int argc, char *argv[])
while (1) {
int option_index = 0;
- c = getopt_long(argc, argv, "A:b:cC:d:D:eE:fG:hHiI:jln:N:m:Mp:qrRs"
+ c = getopt_long(argc, argv, "aA:b:cC:d:D:eE:fG:hHiI:jln:N:m:Mp:qrRs"
"S:vVwx:", long_options, &option_index);
if (c == -1)
break;
switch (c) {
+ case 'a': /* --all is synonym for --join */
+ ++op->do_join;
+ break;
case 'A': /* SAS address, assumed to be hex */
cp = optarg;
if ((strlen(optarg) > 2) && ('X' == toupper(optarg[1])))
diff --git a/testing/sg_chk_asc.c b/testing/sg_chk_asc.c
index a7844441..8e26e3bc 100644
--- a/testing/sg_chk_asc.c
+++ b/testing/sg_chk_asc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2019 Douglas Gilbert.
+ * Copyright (c) 2006-2021 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.
@@ -27,7 +27,7 @@
* http://www.t10.org/lists/asc-num.txt
*/
-static const char * version_str = "1.08 20191014";
+static const char * version_str = "1.09 20210226";
#define MAX_LINE_LEN 1024
@@ -53,8 +53,8 @@ static void usage()
" --verbose|-v increase verbosity\n"
" --version|-V print version string and exit\n\n"
"Checks asc/ascq codes in <asc_ascq_file> against the sg3_utils "
- "library.\nThe additional sense code (asc_ascq) can be found at\n"
- "www.t10.org/lists/asc-num.txt .\n"
+ "library.\nThe additional sense codes (asc_ascq) can be found "
+ "at\nwww.t10.org/lists/asc-num.txt .\n"
);
}
diff --git a/testing/sg_tst_nvme.c b/testing/sg_tst_nvme.c
index 08bd0314..1adbfdef 100644
--- a/testing/sg_tst_nvme.c
+++ b/testing/sg_tst_nvme.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 Douglas Gilbert
+ * Copyright (c) 2018-2021 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.
@@ -39,7 +39,7 @@
#include "sg_unaligned.h"
#include "sg_pr2serr.h"
-static const char * version_str = "1.06 20190113";
+static const char * version_str = "1.07 20210225";
#define ME "sg_tst_nvme: "
@@ -116,7 +116,7 @@ static int next_dev_name_pos = 0;
static void
usage()
{
- pr2serr("Usage: sg_tst_nvme [--ctl] [dev-id] [--help] [--long] "
+ pr2serr("Usage: sg_tst_nvme [--ctl] [--dev-id] [--help] [--long] "
"[--maxlen=LEN]\n"
" [--nsid=ID] [--self-test=ST] [--to-ms=TO] "
"[--verbose]\n"