Merge ~rafaeldtinoco/ubuntu/+source/sg3-utils:lp1879761-focal into ubuntu/+source/sg3-utils:ubuntu/devel

Proposed by Rafael David Tinoco
Status: Superseded
Proposed branch: ~rafaeldtinoco/ubuntu/+source/sg3-utils:lp1879761-focal
Merge into: ubuntu/+source/sg3-utils:ubuntu/devel
Diff against target: 37792 lines (+18706/-5241) (has conflicts)
218 files modified
BSD_LICENSE (+4/-1)
COVERAGE (+3/-1)
CREDITS (+10/-1)
ChangeLog (+102/-0)
Makefile.am (+2/-0)
Makefile.in (+11/-6)
README (+36/-14)
README.freebsd (+2/-1)
README.solaris (+2/-1)
README.win32 (+2/-1)
aclocal.m4 (+97/-113)
ar-lib (+2/-2)
archive/align_b4_memalign.c (+7/-2)
compile (+7/-6)
config.h.in (+6/-0)
configure (+145/-110)
configure.ac (+18/-1)
debian/changelog (+48/-17)
debian/control (+6/-3)
debian/gbp.conf (+4/-0)
debian/libsgutils2-2.symbols (+27/-2)
debian/libsgutils2-2.symbols.kfreebsd (+1/-1)
debian/patches/0001-Fix-path-for-udevadm.patch (+17/-7)
debian/patches/series (+4/-0)
debian/rules (+8/-2)
debian/upstream/metadata (+1/-0)
depcomp (+4/-4)
dev/null (+0/-79)
doc/Makefile.am (+10/-9)
doc/Makefile.in (+19/-16)
doc/rescan-scsi-bus.sh.8 (+2/-2)
doc/scsi_logging_level.8 (+1/-1)
doc/sg3_utils.8 (+58/-12)
doc/sg_dd.8 (+23/-3)
doc/sg_decode_sense.8 (+9/-9)
doc/sg_format.8 (+121/-71)
doc/sg_get_elem_status.8 (+100/-0)
doc/sg_get_lba_status.8 (+28/-13)
doc/sg_logs.8 (+15/-11)
doc/sg_luns.8 (+3/-3)
doc/sg_modes.8 (+6/-3)
doc/sg_raw.8 (+6/-4)
doc/sg_read.8 (+11/-3)
doc/sg_read_buffer.8 (+29/-5)
doc/sg_readcap.8 (+13/-4)
doc/sg_reassign.8 (+2/-2)
doc/sg_rep_zones.8 (+17/-6)
doc/sg_requests.8 (+17/-7)
doc/sg_sat_identify.8 (+3/-3)
doc/sg_scan.8.win32 (+2/-2)
doc/sg_ses.8 (+25/-12)
doc/sg_turs.8 (+11/-9)
doc/sg_verify.8 (+24/-12)
doc/sg_vpd.8 (+25/-8)
doc/sg_write_buffer.8 (+1/-1)
doc/sg_write_same.8 (+17/-11)
doc/sg_write_x.8 (+3/-3)
doc/sg_xcopy.8 (+31/-20)
doc/sgm_dd.8 (+3/-3)
doc/sgp_dd.8 (+11/-4)
examples/scsi_inquiry.c (+21/-19)
examples/sdiag_sas_p0_prbs9.txt (+12/-0)
examples/sdiag_sas_p1_prbs15.txt (+12/-0)
examples/sg_compare_and_write.txt (+1/-1)
examples/sg_excl.c (+26/-21)
examples/sg_sat_chk_power.c (+2/-3)
examples/sg_sat_smart_rd_data.c (+2/-3)
examples/sg_simple1.c (+29/-25)
examples/sgq_dd.c (+33/-30)
examples/transport_ids.txt (+1/-1)
include/Makefile.in (+8/-5)
include/freebsd_nvme_ioctl.h (+9/-2)
include/sg_cmds_basic.h (+5/-3)
include/sg_cmds_extra.h (+2/-0)
include/sg_cmds_mmc.h (+2/-0)
include/sg_io_linux.h (+11/-1)
include/sg_lib.h (+58/-17)
include/sg_lib_data.h (+11/-1)
include/sg_linux_inc.h (+1/-0)
include/sg_pr2serr.h (+2/-0)
include/sg_pt.h (+23/-4)
include/sg_pt_linux.h (+25/-3)
include/sg_pt_nvme.h (+10/-6)
include/sg_unaligned.h (+2/-0)
inhex/README (+50/-0)
inhex/get_elem_status.hex (+35/-0)
inhex/get_lba_status.hex (+14/-0)
inhex/ses_areca_all.hex (+186/-0)
inhex/vpd_consistuents.hex (+38/-0)
inhex/vpd_dev_id.hex (+5/-0)
inhex/vpd_lbpro.hex (+4/-0)
inhex/vpd_sfs.hex (+3/-0)
install-sh (+23/-13)
lib/BSD_LICENSE (+3/-1)
lib/Makefile.am (+2/-2)
lib/Makefile.in (+69/-26)
lib/sg_cmds_basic.c (+127/-71)
lib/sg_cmds_basic2.c (+112/-110)
lib/sg_cmds_extra.c (+524/-524)
lib/sg_cmds_mmc.c (+22/-24)
lib/sg_io_linux.c (+5/-2)
lib/sg_lib.c (+445/-90)
lib/sg_lib_data.c (+30/-5)
lib/sg_pt_common.c (+12/-4)
lib/sg_pt_freebsd.c (+77/-10)
lib/sg_pt_linux.c (+223/-36)
lib/sg_pt_linux_nvme.c (+125/-36)
lib/sg_pt_osf1.c (+63/-2)
lib/sg_pt_solaris.c (+64/-2)
lib/sg_pt_win32.c (+64/-4)
ltmain.sh (+153/-60)
missing (+8/-8)
scripts/40-usb-blacklist.rules (+6/-2)
scripts/54-before-scsi-sg3_id.rules (+55/-0)
scripts/55-scsi-sg3_id.rules (+83/-23)
scripts/58-scsi-sg3_symlink.rules (+2/-4)
scripts/59-fc-wwpn-id.rules (+3/-3)
scripts/Makefile.in (+8/-5)
scripts/rescan-scsi-bus.sh (+323/-287)
scripts/scsi-enable-target-scan.sh (+15/-0)
sg3_utils.spec (+7/-3)
src/BSD_LICENSE (+3/-1)
src/Makefile.am (+14/-12)
src/Makefile.in (+294/-94)
src/sg_bg_ctl.c (+12/-9)
src/sg_compare_and_write.c (+11/-9)
src/sg_copy_results.c (+15/-12)
src/sg_dd.c (+168/-93)
src/sg_decode_sense.c (+13/-159)
src/sg_emc_trespass.c (+2/-0)
src/sg_format.c (+300/-65)
src/sg_get_config.c (+2/-0)
src/sg_get_elem_status.c (+588/-0)
src/sg_get_lba_status.c (+216/-157)
src/sg_ident.c (+2/-0)
src/sg_inq.c (+25/-200)
src/sg_inq_data.c (+18/-13)
src/sg_logs.c (+267/-291)
src/sg_luns.c (+7/-5)
src/sg_map.c (+9/-6)
src/sg_map26.c (+2/-0)
src/sg_modes.c (+23/-5)
src/sg_opcodes.c (+52/-24)
src/sg_persist.c (+5/-3)
src/sg_prevent.c (+2/-0)
src/sg_raw.c (+31/-225)
src/sg_rbuf.c (+17/-15)
src/sg_rdac.c (+2/-0)
src/sg_read.c (+25/-21)
src/sg_read_attr.c (+16/-197)
src/sg_read_block_limits.c (+2/-0)
src/sg_read_buffer.c (+186/-31)
src/sg_read_long.c (+2/-0)
src/sg_readcap.c (+8/-6)
src/sg_reassign.c (+8/-2)
src/sg_referrals.c (+2/-0)
src/sg_rep_zones.c (+61/-20)
src/sg_requests.c (+170/-27)
src/sg_reset.c (+2/-0)
src/sg_reset_wp.c (+12/-10)
src/sg_rmsn.c (+2/-0)
src/sg_rtpg.c (+2/-0)
src/sg_safte.c (+2/-0)
src/sg_sanitize.c (+15/-17)
src/sg_sat_identify.c (+2/-0)
src/sg_sat_phy_event.c (+2/-0)
src/sg_sat_read_gplog.c (+2/-0)
src/sg_sat_set_features.c (+2/-0)
src/sg_scan_linux.c (+2/-0)
src/sg_scan_win32.c (+37/-17)
src/sg_seek.c (+8/-3)
src/sg_senddiag.c (+9/-6)
src/sg_ses.c (+100/-60)
src/sg_ses_microcode.c (+14/-14)
src/sg_start.c (+2/-0)
src/sg_stpg.c (+2/-0)
src/sg_stream_ctl.c (+18/-14)
src/sg_sync.c (+11/-9)
src/sg_test_rwbuf.c (+24/-19)
src/sg_timestamp.c (+19/-15)
src/sg_turs.c (+7/-5)
src/sg_unmap.c (+2/-0)
src/sg_verify.c (+45/-19)
src/sg_vpd.c (+443/-455)
src/sg_vpd_vendor.c (+16/-5)
src/sg_wr_mode.c (+2/-0)
src/sg_write_buffer.c (+53/-10)
src/sg_write_long.c (+2/-0)
src/sg_write_same.c (+29/-19)
src/sg_write_verify.c (+11/-10)
src/sg_write_x.c (+15/-19)
src/sg_xcopy.c (+25/-6)
src/sg_zone.c (+12/-10)
src/sginfo.c (+8/-3)
src/sgm_dd.c (+52/-40)
src/sgp_dd.c (+407/-247)
testing/Makefile (+42/-15)
testing/Makefile.freebsd (+3/-3)
testing/README (+26/-8)
testing/bsg_queue_tst.c (+3/-3)
testing/sg_chk_asc.c (+6/-5)
testing/sg_iovec_tst.c (+19/-15)
testing/sg_queue_tst.c (+100/-31)
testing/sg_sense_test.c (+3/-1)
testing/sg_tst_async.cpp (+1086/-164)
testing/sg_tst_bidi.c (+602/-0)
testing/sg_tst_context.cpp (+7/-9)
testing/sg_tst_excl.cpp (+336/-38)
testing/sg_tst_excl2.cpp (+12/-23)
testing/sg_tst_excl3.cpp (+14/-25)
testing/sg_tst_ioctl.c (+1198/-0)
testing/sg_tst_nvme.c (+6/-5)
testing/sgh_dd.cpp (+4676/-0)
testing/sgs_dd.c (+1343/-0)
testing/tst_sg_lib.c (+5/-3)
testing/uapi_sg.h (+484/-0)
utils/hxascdmp.1 (+9/-4)
utils/hxascdmp.c (+210/-6)
Conflict in debian/changelog
Conflict in debian/control
Conflict in debian/patches/series
Conflict in debian/rules
Reviewer Review Type Date Requested Status
Canonical Server Pending
Review via email: mp+384320@code.launchpad.net
To post a comment you must log in.

Unmerged commits

096e82e... by Rafael David Tinoco

update-maintainer

2e41354... by Rafael David Tinoco

reconstruct-changelog

597f4ae... by Rafael David Tinoco

merge-changelogs

7a3d3c8... by Rafael David Tinoco

* Dropped:
  - Fix a typo in a udev rule that leads to truncated ID_SERIAL values
    in udev. (LP: #1859858)
    [merged in Debian 1.45-1]

b6e9b3a... by Andreas Hasenack

    - debian/sg3-udeb.install: install the right binaries for sg3-udeb.

279b6f3... by Andreas Hasenack

    - debian/control, debian/rules: build a sg3-udeb installer package again.

6336879... by Ritesh Raj Sarraf

Import patches-unapplied version 1.45-1 to debian/sid

Imported using git-ubuntu import.

Changelog parent: 8b01a5a7611173cd1c0acbb8373ec721965230bf

New changelog entries:
  [ Debian Janitor ]
  * Trim trailing whitespace.
  * Bump debhelper from old 9 to 12.
  * Set upstream metadata fields: Bug-Submit.
  * Drop unnecessary dependency on dh-autoconf.
  * Use canonical URL in Vcs-Browser.
  [ Ritesh Raj Sarraf ]
  * Add filter for the debian folder
  * New upstream version 1.45
  * Drop quilt based patch fix-udevadm-path.patch
  * Add patch to fix path for udevadm
  * Update symbol list for 1.45

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/BSD_LICENSE b/BSD_LICENSE
2index 7f1906b..eef2b04 100644
3--- a/BSD_LICENSE
4+++ b/BSD_LICENSE
5@@ -1,5 +1,5 @@
6
7-Copyright (c) 1999-2018, Douglas Gilbert
8+Copyright (c) 1999-2019, Douglas Gilbert
9 All rights reserved.
10
11 Redistribution and use in source and binary forms, with or without
12@@ -22,3 +22,6 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
14 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
16+
17+Above is the:
18+SPDX-License-Identifier: BSD-2-Clause
19diff --git a/COVERAGE b/COVERAGE
20index 84bd4d4..2d5a7e3 100644
21--- a/COVERAGE
22+++ b/COVERAGE
23@@ -21,6 +21,7 @@ COPY OPERATION ABORT ddptctl, ++
24 EXTENDED COPY(LID1) sg_xcopy, ddpt, ++
25 GET CONFIGURATION sg_get_config, ++
26 GET LBA STATUS sg_get_lba_status, ++
27+GET PHYSICAL ELEMENT STATUS sg_get_elem_status, ++
28 GET STREAM STATUS sg_stream_ctl
29 INQUIRY sg_dd, sg_format, sg_inq, sginfo,
30 sg_logs, sg_map('-i'), sg_modes, sg_opcodes,
31@@ -28,6 +29,7 @@ INQUIRY sg_dd, sg_format, sg_inq, sginfo,
32 FINISH ZONE sg_zone
33 FORMAT MEDIUM sg_format, ++ [SSC]
34 FORMAT UNIT sg_format, ++ [SBC]
35+FORMAT WITH PRESET sg_format, ++ [SBC]
36 LOG SELECT sg_logs('-r' or '-select'), ++
37 LOG SENSE sg_logs, ++
38 MODE SELECT(6) sdparm, sg_wr_mode, sginfo, sg_format,
39@@ -158,4 +160,4 @@ THIRD PARTY COPY IN (0x83).
40
41
42 Douglas Gilbert
43-6th May 2018
44+24th January 2020
45diff --git a/CREDITS b/CREDITS
46index beefb4c..e48eb44 100644
47--- a/CREDITS
48+++ b/CREDITS
49@@ -11,6 +11,10 @@ Bart Van Assche <bart dot vanassche at sandisk dot com>
50 configure.ac and Makefile.am cleanup plus sgp_dd code
51 to replace pthread_cancel with pthread_kill [20180102]
52
53+Bean Huo <beanhuo dot micron dot com>
54+ sg_write_buffer: patch to allow comma or period separated bytes
55+ (in decimal or hex) to be decoded when given as standard input.
56+
57 Brian Bunker <Brian dot Bunker at netapp dot com> contributed
58 sg_read_block_limits and the target reset addition to sg_reset
59 [20090615]
60@@ -103,6 +107,8 @@ Mark Knibbs <markk at clara dot co dot uk>
61
62 Martin Schwenke <martin at meltin dot net> added the raw switch "-r" to sg_inq
63
64+Martin Wilck <mwilck at suse dot com> contributed script files [20190425]
65+
66 Nate Dailey < Nate dot Dailey at stratus dot com > extended sg_map for sparse
67 disk node names (e.g. /dev/sdaaa) [20050511]
68
69@@ -139,6 +145,9 @@ Tom Steudten <steudten at gmx dot ch> sginfo addition: add '-Fhead' option
70 Trent Piepho <xyzzy at speakeasy dot org> print out some "sense key specific"
71 data and "-6" switch for sg_modes
72
73+Xose Vazquez Perez <xose dot vazquez at gmail dot com>
74+ documentation corrections [20200117]
75+
76
77 Douglas Gilbert
78-2nd January 2018
79+17th January 2020
80diff --git a/ChangeLog b/ChangeLog
81index 08f598c..3dbfda2 100644
82--- a/ChangeLog
83+++ b/ChangeLog
84@@ -2,6 +2,108 @@ Each utility has its own version number, date of last change and
85 some description at the top of its ".c" file. All utilities in the main
86 directory have their own "man" pages. There is also a sg3_utils man page.
87
88+Changelog for sg3_utils-1.45 [20200229] [svn: r843]
89+ - sg_get_elem_status: new utility [sbc4r16]
90+ - sg_ses: bug: --page= being overridden when --control
91+ and --data= also given; fix
92+ - document explicit Element type codes and example
93+ - rename 'SAS SlimLine' to SlimSAS [ses4r02]
94+ - add --inhex=FN, equivalent to --data=@FN, for
95+ compatibility with other utilities
96+ - 'fan speed factor' field added in 20-013r1
97+ - sg_opcodes: expand MLU (now 2 bits, spc5r20)
98+ - include RWCDLP field as extension of CDLP
99+ field (spc5r01)
100+ - sg_write_buffer: allow comma and period separated
101+ lists when input from stdin
102+ - sg_inq: update version descriptors to spc5r21
103+ - add some NVMe 1.4 snippets to ctl identify
104+ - sg_format: add --dcrt used twice (FOV=1 DCRT=0)
105+ - add support for FORMAT WITH PRESET (sbc4r18)
106+ - sg_raw: fix --send bug when using stdin
107+ - sg_vpd: 3pc VPD page add copy group descriptor
108+ - add --examine option
109+ - new zoned block device char. field (zbc2r04)
110+ - sg_read_buffer: decode read microcode status page
111+ - add --inhex=FN option
112+ - sg_request: add --error option, replaces opcode
113+ with 0xff (or skips call to pass-through)
114+ - sg_get_lba_status: add --inhex=FN option
115+ - sg_xcopy: add --fco (fast copy only) (spc5r20)
116+ - implement --app=1 (append) on regular OFILE type
117+ - sg_scan (win32): expand limits for big arrays
118+ - sg_modes: placeholders for Command duration limit
119+ T2A and T2B mpages (sbc4r17)
120+ - improve zbc support (e.g. caching mpage)
121+ - sg_logs: add Command duration limits statistics
122+ lpage (spc6r01)
123+ - zoned block device statistics log page: shorten
124+ counter fields from 8 to 4 bytes (zbc2r02)
125+ - new field in this log page (zbc2r04)
126+ - change '-ll' option to suppress subpages=0xff
127+ apart from page 0x0,0xff. Used three times:
128+ list all pages and subpages names reported
129+ - sg_reassign: for defect list format 6 (vendor
130+ specific) don't try to decode
131+ - sg_rep_zones: expand some fields per zbc2r04
132+ - add --num= and --wp options
133+ - sg_verify: correct so issues VERIFY(16)
134+ - add --0 and --ff options and implement
135+ bytchk=3 properly
136+ - sg_write_same: add --ff for 0xff fill
137+ - sg_luns: report new "target commands" w-lun (19-117)
138+ - sg_dd: add --verify support
139+ - sgp_dd: support memory-mapped IO via mmap flag
140+ - inhex directory: new, contains ASCII hex files
141+ that can be used with the '--inhex=' option
142+ - sg_lib: add sg_t10_uuid_desig2str()
143+ - add sg_get_command_str and sg_print_command_len()
144+ - speed up sg_print_command()
145+ - sg_scsi_normalize_sense(): populate byte4,5,6
146+ - tweak sg_pt interface to better handle bidi
147+ - sg_cmds_process_resp(): two arguments removed
148+ - add ${PACKAGE_VERSION} to '.so' name
149+ - add sg_f2hex_arr()
150+ - update some tables for NVMe 1.4
151+ - sg_get_num()+sg_get_llnum(): add 'e' decoding,
152+ - asc/ascq match asc-num.txt @t10 20191014
153+ exabytes; allow addition (e.g. --count=3+1k)
154+ - new zbc2r04 service actions
155+ - sg_pt_freebsd: fixes for FreeBSD 12.0 release
156+ - scripts: update 54-before-scsi-sg3_id.rules,
157+ scsi-enable-target-scan.sh and
158+ 59-fc-wwpn-id.rules
159+ - linux: add nanosecond durations when
160+ SG3_UTILS_LINUX_NANO environment variable given
161+ and Linux sg driver >= 4.0.30
162+ - rescan-scsi-bus: widen LUN 0 only scanning
163+ - multiple patches to sync with Suse
164+ - testing/sg_tst_async: fix free_list issue
165+ - testing/sg_tst_ioctl: for sg 4.0 driver
166+ - testing/sg_tst_bidi: for sg 4.0 driver
167+ - testing/sgh_dd: test request sharing, mreqs...
168+ - add --verify support
169+ - testing/sgs_dd: back from archive, for testing
170+ - testing/sg_chk_asc: allow LF and CR/LF in asc-num.txt
171+ - testing: 'make' now builds both C and C++ programs
172+ SIGPOLL (SIGIO) and realtime (RT) signals
173+ - sg_pt: add sg_get_opcode_translation() to replace
174+ global pointer to array: sg_opcode_info_arr[]
175+ - extend small SNTL to support read capacity
176+ - utils/hxascdmp: add -o=<offset> option
177+ - add -1, -2 and -q options
178+ - sg_io_linux (sg_lib): add sg_linux_sense_print()
179+ - sg_pt_linux: uses sg v4 interface if sg driver
180+ >= 4.0.0 . Force sg v3 always by building with
181+ './configure --disable-linux-sgv4'
182+ - add sg_linux_get_sg_version() function
183+ - add: 'SPDX-License-Identifier: BSD-2-Clause'
184+ or a small number of 'GPL-2.0-or-later'
185+ - gcc-9: suppress (pointless) warnings
186+ - automake: upgrade to version 1.16.1
187+ - autoconf: upgrade to version 2.69
188+ - sync with fixes from Redhat, via github
189+
190 Changelog for sg3_utils-1.44 [20180912] [svn: r791]
191 - same code as release 1.43 20180911 svn rev 789;
192 new release due to sync problem with git mirror at:
193diff --git a/Makefile.am b/Makefile.am
194index 0417ee9..77b0716 100644
195--- a/Makefile.am
196+++ b/Makefile.am
197@@ -10,4 +10,6 @@ EXTRA_DIST=autogen.sh COVERAGE CREDITS
198 distclean-local:
199 rm -rf autom4te.cache
200 rm -f build-stamp configure-stamp
201+ rm -rf lib/.deps
202+ rm -rf src/.deps
203
204diff --git a/Makefile.in b/Makefile.in
205index fb215b2..ddb8090 100644
206--- a/Makefile.in
207+++ b/Makefile.in
208@@ -1,7 +1,7 @@
209-# Makefile.in generated by automake 1.15.1 from Makefile.am.
210+# Makefile.in generated by automake 1.16.1 from Makefile.am.
211 # @configure_input@
212
213-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
214+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
215
216 # This Makefile.in is free software; the Free Software Foundation
217 # gives unlimited permission to copy and/or distribute it,
218@@ -134,7 +134,7 @@ am__recursive_targets = \
219 $(RECURSIVE_CLEAN_TARGETS) \
220 $(am__extra_recursive_targets)
221 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
222- cscope distdir dist dist-all distcheck
223+ cscope distdir distdir-am dist dist-all distcheck
224 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
225 $(LISP)config.h.in
226 # Read a list of newline-separated strings from the standard input,
227@@ -354,8 +354,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
228 echo ' $(SHELL) ./config.status'; \
229 $(SHELL) ./config.status;; \
230 *) \
231- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
232- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
233+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
234+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
235 esac;
236
237 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
238@@ -497,7 +497,10 @@ distclean-tags:
239 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
240 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
241
242-distdir: $(DISTFILES)
243+distdir: $(BUILT_SOURCES)
244+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
245+
246+distdir-am: $(DISTFILES)
247 $(am__remove_distdir)
248 test -d "$(distdir)" || mkdir "$(distdir)"
249 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
250@@ -815,6 +818,8 @@ uninstall-am:
251 distclean-local:
252 rm -rf autom4te.cache
253 rm -f build-stamp configure-stamp
254+ rm -rf lib/.deps
255+ rm -rf src/.deps
256
257 # Tell versions [3.59,3.63) of GNU make to not export all variables.
258 # Otherwise a system limit (for SysV at least) may be exceeded.
259diff --git a/README b/README
260index 8a741e3..b88dd44 100644
261--- a/README
262+++ b/README
263@@ -203,7 +203,7 @@ and disable the creation of the shared library (libsgutils<num>.so) this
264 invocation could be used: "./configure --prefix=/usr --disable-shared".
265 To reduce the size of an executable as well try this:
266 "./configure --prefix=/usr --disable-shared --disable-scsistrings".
267-Also --disable-shared will produce (realtively) "static" executables in
268+Also --disable-shared will produce (relatively) "static" executables in
269 the src directory that are easier to debug. And
270 "./configure --enable-debug" will compile with more debug type options,
271 including more compiler checks and defining "DEBUG" within the src and
272@@ -259,13 +259,14 @@ Here is list in alphabetical order of utilities found in the 'src'
273 subdirectory of the sg3_utils package:
274 sginfo, sg_bt_ctl, sg_compare_and_write, sg_copy_results, sgm_dd, sgp_dd,
275 sg_dd, sg_decode_sense, sg_emc_trespass, sg_format, sg_get_config,
276- sg_get_lba_status, sg_ident, sg_inq, sg_logs, sg_luns, sg_map, sg_map26,
277- sg_modes, sg_opcodes, sg_persist, sg_prevent, sg_raw, sg_rbuf, sg_rdac,
278- sg_read, sg_read_attr, sg_readcap, sg_read_block_limits, sg_read_buffer,
279- sg_read_long, sg_reassign, sg_referrals, sg_request, sg_reset, sg_rmsn,
280- sg_rtpg, sg_safte, sg_sanitize, sg_sat_identify, sg_sat_phy_event,
281- sg_sat_read_gplog, sg_sat_set_features, sg_scan, sg_seek, sg_senddiag,
282- sg_ses, sg_ses_microcode, sg_start, sg_stpg, sg_stream_ctl, sg_sync,
283+ sg_get_elem_status, sg_get_lba_status, sg_ident, sg_inq, sg_logs,
284+ sg_luns, sg_map, sg_map26, sg_modes, sg_opcodes, sg_persist, sg_prevent,
285+ sg_raw, sg_rbuf, sg_rdac, sg_read, sg_read_attr, sg_readcap,
286+ sg_read_block_limits, sg_read_buffer, sg_read_long, sg_reassign,
287+ sg_referrals, sg_request, sg_reset, sg_rmsn, sg_rtpg, sg_safte,
288+ sg_sanitize, sg_sat_identify, sg_sat_phy_event, sg_sat_read_gplog,
289+ sg_sat_set_features, sg_scan, sg_seek, sg_senddiag, sg_ses,
290+ sg_ses_microcode, sg_start, sg_stpg, sg_stream_ctl, sg_sync,
291 sg_test_rwbuff, sg_timestamp, sg_turs, sg_unmap, sg_verify, sg_vpd,
292 sg_write_buffer, sg_write_long, sg_write_same, sg_write_verify,
293 sg_write_x, sg_wr_mode, sg_xcopy, sg_zone
294@@ -304,15 +305,14 @@ a "compliant jitter tolerance pattern" (CJTPAT).
295 The 'testing' subdirectory contains source and a Makefiles to test
296 kernel pass-through and associated drivers, mainly for Linux. There is
297 both C code (with the extension ".c") and C++ code (with the extension
298-".cpp"). There is a "Makefile" to build the C code and a "Makefile.cplus"
299-to build the C++ code. Both depend on some object files from the "lib"
300-subdirectory. So a sequence like this may be required prior to invoking
301-one of the Makefiles in the directory: "cd <top_of_package> ;
302+".cpp"). There is a "Makefile" to build the C + C++ code. The Makefile
303+depends on some object files from the "lib" subdirectory. So a sequence
304+like this may be required prior to invoking make: "cd <top_of_package> ;
305 ./configure ; cd lib ; make ; cd ../testing".
306
307 Here is a list in alphabetical order of utilities found in the 'testing'
308 subdirectory:
309- - bsg_queue_tst, sg_iovec_tst, sg_queue_tst, sg_sense_tst,
310+ - bsg_queue_tst, sgh_dd (C++), sg_iovec_tst, sg_queue_tst, sg_sense_tst,
311 sg_tst_async (C++), sg_tst_context (C++), sg_tst_excl (C++),
312 sg_tst_excl2 (C++), sg_tst_excl3 (C++)
313
314@@ -399,6 +399,28 @@ queue limit of 16). Multiple threads doing the same thing act as a
315 multiplier to that queue limit.
316
317
318+NVME Support
319+============
320+Firstly the author has no intention of extending this package to contain
321+general purpose NVMe utilities. That leaves the areas where SCSI overlaps
322+with NVMe. There was a SCSI to NVMe Translation Layer (SNTL) driver in the
323+Linux kernel based on a white paper from NVM Express. Intel has withdrawn
324+that driver and T10 (SCSI) and NVM Express have made no further attempts
325+to standardize a SNTL. Given the SCSI to ATA Translation Layer (SATL) which
326+is standardized by T10, it is pretty clear what a SNTL should do.
327+
328+The NVMe Management Interface (NVME-MI) committee have decided to use SES-3
329+standard from T10 via the newly added SES Send and SES Receive MI commands.
330+So the sg_ses utility and this package's library have been extended to use
331+these commands when a NVMe device (typically a disk enclosure) is detected.
332+This has been tested by a disk vendor who is happy with the results. Other
333+user reports are welcome as the author does not have equipment to test
334+this.
335+
336+Other utilities in this package that use the SES Send and Receive commands,
337+or the SNTL in the library are sg_senddiag, sg_inq and sg_readcap.
338+
339+
340 Command line processing
341 =======================
342 These utilities can be divided into 3 groups when their handling of command
343@@ -519,4 +541,4 @@ See http://sg.danny.cz/sg/tools.html
344
345
346 Douglas Gilbert
347-28th June 2018
348+17 September 2019
349diff --git a/README.freebsd b/README.freebsd
350index 7ca25e9..4a720a7 100644
351--- a/README.freebsd
352+++ b/README.freebsd
353@@ -18,6 +18,7 @@ Here is a list of utilities that have been ported:
354 sg_decode_sense
355 sg_format
356 sg_get_config
357+ sg_get_elem_status
358 sg_get_lba_status
359 sg_ident
360 sg_inq [dropped ATA IDENTIFY DEVICE capability]
361@@ -142,4 +143,4 @@ utilities.
362
363
364 Douglas Gilbert
365-27th January 2018
366+9th September 2019
367diff --git a/README.solaris b/README.solaris
368index 15e6fec..dac22dc 100644
369--- a/README.solaris
370+++ b/README.solaris
371@@ -35,6 +35,7 @@ Here is a list of utilities that have been ported:
372 sg_decode_sense
373 sg_format
374 sg_get_config
375+ sg_get_elem_status
376 sg_get_lba_status
377 sg_ident
378 sg_inq [dropped ATA IDENTIFY DEVICE capability]
379@@ -163,4 +164,4 @@ disks to accept SCSI commands including the SCSI ATA PASS THROUGH commands.
380
381
382 Douglas Gilbert
383-27th January 2018
384+9th September 2019
385diff --git a/README.win32 b/README.win32
386index 41173b6..4711525 100644
387--- a/README.win32
388+++ b/README.win32
389@@ -38,6 +38,7 @@ Here is a list of utilities that have been ported:
390 sg_decode_sense
391 sg_format
392 sg_get_config
393+ sg_get_elem_status
394 sg_get_lba_status
395 sg_ident
396 sg_inq [dropped ATA IDENTIFY DEVICE capability]
397@@ -242,4 +243,4 @@ mode" with the setmode() Windows command.
398
399
400 Douglas Gilbert
401-27th January 2018
402+9th September 2019
403diff --git a/aclocal.m4 b/aclocal.m4
404index 087efba..a0e5eda 100644
405--- a/aclocal.m4
406+++ b/aclocal.m4
407@@ -1,6 +1,6 @@
408-# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
409+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
410
411-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
412+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
413
414 # This file is free software; the Free Software Foundation
415 # gives unlimited permission to copy and/or distribute it,
416@@ -4077,7 +4077,8 @@ _LT_EOF
417 if AC_TRY_EVAL(ac_compile); then
418 # Now try to grab the symbols.
419 nlist=conftest.nm
420- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
421+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
422+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
423 # Try sorting and uniquifying the output.
424 if sort "$nlist" | uniq > "$nlist"T; then
425 mv -f "$nlist"T "$nlist"
426@@ -6448,7 +6449,7 @@ if test yes != "$_lt_caught_CXX_error"; then
427 # Commands to make compiler produce verbose output that lists
428 # what "hidden" libraries, object files and flags are used when
429 # linking a shared library.
430- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
431+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
432
433 else
434 GXX=no
435@@ -6823,7 +6824,7 @@ if test yes != "$_lt_caught_CXX_error"; then
436 # explicitly linking system object files so we need to strip them
437 # from the output so that they don't get included in the library
438 # dependencies.
439- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
440+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
441 ;;
442 *)
443 if test yes = "$GXX"; then
444@@ -6888,7 +6889,7 @@ if test yes != "$_lt_caught_CXX_error"; then
445 # explicitly linking system object files so we need to strip them
446 # from the output so that they don't get included in the library
447 # dependencies.
448- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
449+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
450 ;;
451 *)
452 if test yes = "$GXX"; then
453@@ -7227,7 +7228,7 @@ if test yes != "$_lt_caught_CXX_error"; then
454 # Commands to make compiler produce verbose output that lists
455 # what "hidden" libraries, object files and flags are used when
456 # linking a shared library.
457- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
458+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
459
460 else
461 # FIXME: insert proper C++ library support
462@@ -7311,7 +7312,7 @@ if test yes != "$_lt_caught_CXX_error"; then
463 # Commands to make compiler produce verbose output that lists
464 # what "hidden" libraries, object files and flags are used when
465 # linking a shared library.
466- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
467+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
468 else
469 # g++ 2.7 appears to require '-G' NOT '-shared' on this
470 # platform.
471@@ -7322,7 +7323,7 @@ if test yes != "$_lt_caught_CXX_error"; then
472 # Commands to make compiler produce verbose output that lists
473 # what "hidden" libraries, object files and flags are used when
474 # linking a shared library.
475- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
476+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
477 fi
478
479 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
480@@ -9067,7 +9068,7 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
481 m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
482 m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
483
484-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
485+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
486 #
487 # This file is free software; the Free Software Foundation
488 # gives unlimited permission to copy and/or distribute it,
489@@ -9079,10 +9080,10 @@ m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
490 # generated from the m4 files accompanying Automake X.Y.
491 # (This private macro should not be called outside this file.)
492 AC_DEFUN([AM_AUTOMAKE_VERSION],
493-[am__api_version='1.15'
494+[am__api_version='1.16'
495 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
496 dnl require some minimum version. Point them to the right macro.
497-m4_if([$1], [1.15.1], [],
498+m4_if([$1], [1.16.1], [],
499 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
500 ])
501
502@@ -9098,12 +9099,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
503 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
504 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
505 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
506-[AM_AUTOMAKE_VERSION([1.15.1])dnl
507+[AM_AUTOMAKE_VERSION([1.16.1])dnl
508 m4_ifndef([AC_AUTOCONF_VERSION],
509 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
510 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
511
512-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
513+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
514 #
515 # This file is free software; the Free Software Foundation
516 # gives unlimited permission to copy and/or distribute it,
517@@ -9165,7 +9166,7 @@ AC_SUBST([AR])dnl
518
519 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
520
521-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
522+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
523 #
524 # This file is free software; the Free Software Foundation
525 # gives unlimited permission to copy and/or distribute it,
526@@ -9217,7 +9218,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
527
528 # AM_CONDITIONAL -*- Autoconf -*-
529
530-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
531+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
532 #
533 # This file is free software; the Free Software Foundation
534 # gives unlimited permission to copy and/or distribute it,
535@@ -9248,7 +9249,7 @@ AC_CONFIG_COMMANDS_PRE(
536 Usually this means the macro was only invoked conditionally.]])
537 fi])])
538
539-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
540+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
541 #
542 # This file is free software; the Free Software Foundation
543 # gives unlimited permission to copy and/or distribute it,
544@@ -9439,13 +9440,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
545
546 # Generate code to set up dependency tracking. -*- Autoconf -*-
547
548-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
549+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
550 #
551 # This file is free software; the Free Software Foundation
552 # gives unlimited permission to copy and/or distribute it,
553 # with or without modifications, as long as this notice is preserved.
554
555-
556 # _AM_OUTPUT_DEPENDENCY_COMMANDS
557 # ------------------------------
558 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
559@@ -9453,49 +9453,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
560 # Older Autoconf quotes --file arguments for eval, but not when files
561 # are listed without --file. Let's play safe and only enable the eval
562 # if we detect the quoting.
563- case $CONFIG_FILES in
564- *\'*) eval set x "$CONFIG_FILES" ;;
565- *) set x $CONFIG_FILES ;;
566- esac
567+ # TODO: see whether this extra hack can be removed once we start
568+ # requiring Autoconf 2.70 or later.
569+ AS_CASE([$CONFIG_FILES],
570+ [*\'*], [eval set x "$CONFIG_FILES"],
571+ [*], [set x $CONFIG_FILES])
572 shift
573- for mf
574+ # Used to flag and report bootstrapping failures.
575+ am_rc=0
576+ for am_mf
577 do
578 # Strip MF so we end up with the name of the file.
579- mf=`echo "$mf" | sed -e 's/:.*$//'`
580- # Check whether this is an Automake generated Makefile or not.
581- # We used to match only the files named 'Makefile.in', but
582- # some people rename them; so instead we look at the file content.
583- # Grep'ing the first line is not enough: some people post-process
584- # each Makefile.in and add a new line on top of each file to say so.
585- # Grep'ing the whole file is not good either: AIX grep has a line
586+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
587+ # Check whether this is an Automake generated Makefile which includes
588+ # dependency-tracking related rules and includes.
589+ # Grep'ing the whole file directly is not great: AIX grep has a line
590 # limit of 2048, but all sed's we know have understand at least 4000.
591- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
592- dirpart=`AS_DIRNAME("$mf")`
593- else
594- continue
595- fi
596- # Extract the definition of DEPDIR, am__include, and am__quote
597- # from the Makefile without running 'make'.
598- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
599- test -z "$DEPDIR" && continue
600- am__include=`sed -n 's/^am__include = //p' < "$mf"`
601- test -z "$am__include" && continue
602- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
603- # Find all dependency output files, they are included files with
604- # $(DEPDIR) in their names. We invoke sed twice because it is the
605- # simplest approach to changing $(DEPDIR) to its actual value in the
606- # expansion.
607- for file in `sed -n "
608- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
609- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
610- # Make sure the directory exists.
611- test -f "$dirpart/$file" && continue
612- fdir=`AS_DIRNAME(["$file"])`
613- AS_MKDIR_P([$dirpart/$fdir])
614- # echo "creating $dirpart/$file"
615- echo '# dummy' > "$dirpart/$file"
616- done
617+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
618+ || continue
619+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
620+ am_filepart=`AS_BASENAME(["$am_mf"])`
621+ AM_RUN_LOG([cd "$am_dirpart" \
622+ && sed -e '/# am--include-marker/d' "$am_filepart" \
623+ | $MAKE -f - am--depfiles]) || am_rc=$?
624 done
625+ if test $am_rc -ne 0; then
626+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
627+ for automatic dependency tracking. Try re-running configure with the
628+ '--disable-dependency-tracking' option to at least be able to build
629+ the package (albeit without support for automatic dependency tracking).])
630+ fi
631+ AS_UNSET([am_dirpart])
632+ AS_UNSET([am_filepart])
633+ AS_UNSET([am_mf])
634+ AS_UNSET([am_rc])
635+ rm -f conftest-deps.mk
636 }
637 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
638
639@@ -9504,18 +9496,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
640 # -----------------------------
641 # This macro should only be invoked once -- use via AC_REQUIRE.
642 #
643-# This code is only required when automatic dependency tracking
644-# is enabled. FIXME. This creates each '.P' file that we will
645-# need in order to bootstrap the dependency handling code.
646+# This code is only required when automatic dependency tracking is enabled.
647+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
648+# order to bootstrap the dependency handling code.
649 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
650 [AC_CONFIG_COMMANDS([depfiles],
651 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
652- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
653-])
654+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
655
656 # Do all the work for Automake. -*- Autoconf -*-
657
658-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
659+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
660 #
661 # This file is free software; the Free Software Foundation
662 # gives unlimited permission to copy and/or distribute it,
663@@ -9602,8 +9593,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
664 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
665 # For better backward compatibility. To be removed once Automake 1.9.x
666 # dies out for good. For more background, see:
667-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
668-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
669+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
670+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
671 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
672 # We need awk for the "check" target (and possibly the TAP driver). The
673 # system "awk" is bad on some platforms.
674@@ -9670,7 +9661,7 @@ END
675 Aborting the configuration process, to ensure you take notice of the issue.
676
677 You can download and install GNU coreutils to get an 'rm' implementation
678-that behaves properly: <http://www.gnu.org/software/coreutils/>.
679+that behaves properly: <https://www.gnu.org/software/coreutils/>.
680
681 If you want to complete the configuration process using your problematic
682 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
683@@ -9712,7 +9703,7 @@ for _am_header in $config_headers :; do
684 done
685 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
686
687-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
688+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
689 #
690 # This file is free software; the Free Software Foundation
691 # gives unlimited permission to copy and/or distribute it,
692@@ -9733,7 +9724,7 @@ if test x"${install_sh+set}" != xset; then
693 fi
694 AC_SUBST([install_sh])])
695
696-# Copyright (C) 2003-2017 Free Software Foundation, Inc.
697+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
698 #
699 # This file is free software; the Free Software Foundation
700 # gives unlimited permission to copy and/or distribute it,
701@@ -9755,7 +9746,7 @@ AC_SUBST([am__leading_dot])])
702 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
703 # From Jim Meyering
704
705-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
706+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
707 #
708 # This file is free software; the Free Software Foundation
709 # gives unlimited permission to copy and/or distribute it,
710@@ -9790,7 +9781,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
711
712 # Check to see how 'make' treats includes. -*- Autoconf -*-
713
714-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
715+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
716 #
717 # This file is free software; the Free Software Foundation
718 # gives unlimited permission to copy and/or distribute it,
719@@ -9798,49 +9789,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
720
721 # AM_MAKE_INCLUDE()
722 # -----------------
723-# Check to see how make treats includes.
724+# Check whether make has an 'include' directive that can support all
725+# the idioms we need for our automatic dependency tracking code.
726 AC_DEFUN([AM_MAKE_INCLUDE],
727-[am_make=${MAKE-make}
728-cat > confinc << 'END'
729+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
730+cat > confinc.mk << 'END'
731 am__doit:
732- @echo this is the am__doit target
733+ @echo this is the am__doit target >confinc.out
734 .PHONY: am__doit
735 END
736-# If we don't find an include directive, just comment out the code.
737-AC_MSG_CHECKING([for style of include used by $am_make])
738 am__include="#"
739 am__quote=
740-_am_result=none
741-# First try GNU make style include.
742-echo "include confinc" > confmf
743-# Ignore all kinds of additional output from 'make'.
744-case `$am_make -s -f confmf 2> /dev/null` in #(
745-*the\ am__doit\ target*)
746- am__include=include
747- am__quote=
748- _am_result=GNU
749- ;;
750-esac
751-# Now try BSD make style include.
752-if test "$am__include" = "#"; then
753- echo '.include "confinc"' > confmf
754- case `$am_make -s -f confmf 2> /dev/null` in #(
755- *the\ am__doit\ target*)
756- am__include=.include
757- am__quote="\""
758- _am_result=BSD
759- ;;
760- esac
761-fi
762-AC_SUBST([am__include])
763-AC_SUBST([am__quote])
764-AC_MSG_RESULT([$_am_result])
765-rm -f confinc confmf
766-])
767+# BSD make does it like this.
768+echo '.include "confinc.mk" # ignored' > confmf.BSD
769+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
770+echo 'include confinc.mk # ignored' > confmf.GNU
771+_am_result=no
772+for s in GNU BSD; do
773+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
774+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
775+ ['0:this is the am__doit target'],
776+ [AS_CASE([$s],
777+ [BSD], [am__include='.include' am__quote='"'],
778+ [am__include='include' am__quote=''])])
779+ if test "$am__include" != "#"; then
780+ _am_result="yes ($s style)"
781+ break
782+ fi
783+done
784+rm -f confinc.* confmf.*
785+AC_MSG_RESULT([${_am_result}])
786+AC_SUBST([am__include])])
787+AC_SUBST([am__quote])])
788
789 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
790
791-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
792+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
793 #
794 # This file is free software; the Free Software Foundation
795 # gives unlimited permission to copy and/or distribute it,
796@@ -9881,7 +9865,7 @@ fi
797 # Obsolete and "removed" macros, that must however still report explicit
798 # error messages when used, to smooth transition.
799 #
800-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
801+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
802 #
803 # This file is free software; the Free Software Foundation
804 # gives unlimited permission to copy and/or distribute it,
805@@ -9908,7 +9892,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
806
807 # Helper functions for option handling. -*- Autoconf -*-
808
809-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
810+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
811 #
812 # This file is free software; the Free Software Foundation
813 # gives unlimited permission to copy and/or distribute it,
814@@ -9937,7 +9921,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
815 AC_DEFUN([_AM_IF_OPTION],
816 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
817
818-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
819+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
820 #
821 # This file is free software; the Free Software Foundation
822 # gives unlimited permission to copy and/or distribute it,
823@@ -9984,7 +9968,7 @@ AC_LANG_POP([C])])
824 # For backward compatibility.
825 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
826
827-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
828+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
829 #
830 # This file is free software; the Free Software Foundation
831 # gives unlimited permission to copy and/or distribute it,
832@@ -10003,7 +9987,7 @@ AC_DEFUN([AM_RUN_LOG],
833
834 # Check to make sure that the build environment is sane. -*- Autoconf -*-
835
836-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
837+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
838 #
839 # This file is free software; the Free Software Foundation
840 # gives unlimited permission to copy and/or distribute it,
841@@ -10084,7 +10068,7 @@ AC_CONFIG_COMMANDS_PRE(
842 rm -f conftest.file
843 ])
844
845-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
846+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
847 #
848 # This file is free software; the Free Software Foundation
849 # gives unlimited permission to copy and/or distribute it,
850@@ -10144,7 +10128,7 @@ AC_SUBST([AM_BACKSLASH])dnl
851 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
852 ])
853
854-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
855+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
856 #
857 # This file is free software; the Free Software Foundation
858 # gives unlimited permission to copy and/or distribute it,
859@@ -10172,7 +10156,7 @@ fi
860 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
861 AC_SUBST([INSTALL_STRIP_PROGRAM])])
862
863-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
864+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
865 #
866 # This file is free software; the Free Software Foundation
867 # gives unlimited permission to copy and/or distribute it,
868@@ -10191,7 +10175,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
869
870 # Check how to create a tarball. -*- Autoconf -*-
871
872-# Copyright (C) 2004-2017 Free Software Foundation, Inc.
873+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
874 #
875 # This file is free software; the Free Software Foundation
876 # gives unlimited permission to copy and/or distribute it,
877diff --git a/ar-lib b/ar-lib
878index 05094d3..0baa4f6 100755
879--- a/ar-lib
880+++ b/ar-lib
881@@ -4,7 +4,7 @@
882 me=ar-lib
883 scriptversion=2012-03-01.08; # UTC
884
885-# Copyright (C) 2010-2017 Free Software Foundation, Inc.
886+# Copyright (C) 2010-2018 Free Software Foundation, Inc.
887 # Written by Peter Rosin <peda@lysator.liu.se>.
888 #
889 # This program is free software; you can redistribute it and/or modify
890@@ -18,7 +18,7 @@ scriptversion=2012-03-01.08; # UTC
891 # GNU General Public License for more details.
892 #
893 # You should have received a copy of the GNU General Public License
894-# along with this program. If not, see <http://www.gnu.org/licenses/>.
895+# along with this program. If not, see <https://www.gnu.org/licenses/>.
896
897 # As a special exception to the GNU General Public License, if you
898 # distribute this file as part of a program that contains a
899diff --git a/archive/align_b4_memalign.c b/archive/align_b4_memalign.c
900index 8760202..1cd4032 100644
901--- a/archive/align_b4_memalign.c
902+++ b/archive/align_b4_memalign.c
903@@ -1,5 +1,6 @@
904-/* Code fragment of how to get a buffer of heap that has a specific
905- * alignment, typically 'page' size which is 4096 bytes. */
906+/* Code fragment of how to get a buffer from the heap that has a specific
907+ * alignment. The typical alignment is to a "page" whose size is often
908+ * 4096 bytes. */
909
910 uint8_t * wrkBuff; /* will get pointer to heap allocation */
911 uint8_t * wrkPos; /* will get aligned pointer within wrkBuff */
912@@ -17,3 +18,7 @@
913 /* perhaps use posix_memalign() instead. Yes but not always available */
914 wrkBuff = (uint8_t *)malloc(sz_of_aligned + psz);
915 wrkPos = (uint8_t *)(((sg_uintptr_t)wrkBuff + psz - 1) & (~(psz - 1)));
916+
917+/* The disadvantage of this approach is that it needs both wrkBuff and wrkPos
918+ * to be held by the application. The wrkBuff is only needed for the
919+ * corresponding free(), all other uses should be via wrkPos. */
920diff --git a/compile b/compile
921index a85b723..99e5052 100755
922--- a/compile
923+++ b/compile
924@@ -1,9 +1,9 @@
925 #! /bin/sh
926 # Wrapper for compilers which do not understand '-c -o'.
927
928-scriptversion=2012-10-14.11; # UTC
929+scriptversion=2018-03-07.03; # UTC
930
931-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
932+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
933 # Written by Tom Tromey <tromey@cygnus.com>.
934 #
935 # This program is free software; you can redistribute it and/or modify
936@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
937 # GNU General Public License for more details.
938 #
939 # You should have received a copy of the GNU General Public License
940-# along with this program. If not, see <http://www.gnu.org/licenses/>.
941+# along with this program. If not, see <https://www.gnu.org/licenses/>.
942
943 # As a special exception to the GNU General Public License, if you
944 # distribute this file as part of a program that contains a
945@@ -255,7 +255,8 @@ EOF
946 echo "compile $scriptversion"
947 exit $?
948 ;;
949- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
950+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
951+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
952 func_cl_wrapper "$@" # Doesn't return...
953 ;;
954 esac
955@@ -339,9 +340,9 @@ exit $ret
956 # Local Variables:
957 # mode: shell-script
958 # sh-indentation: 2
959-# eval: (add-hook 'write-file-hooks 'time-stamp)
960+# eval: (add-hook 'before-save-hook 'time-stamp)
961 # time-stamp-start: "scriptversion="
962 # time-stamp-format: "%:y-%02m-%02d.%02H"
963-# time-stamp-time-zone: "UTC"
964+# time-stamp-time-zone: "UTC0"
965 # time-stamp-end: "; # UTC"
966 # End:
967diff --git a/config.h.in b/config.h.in
968index ab0eb00..4173c07 100644
969--- a/config.h.in
970+++ b/config.h.in
971@@ -27,6 +27,9 @@
972 /* Define to 1 if you have the <linux/nvme_ioctl.h> header file. */
973 #undef HAVE_LINUX_NVME_IOCTL_H
974
975+/* Have Linux sg v4 header */
976+#undef HAVE_LINUX_SG_V4_HDR
977+
978 /* Define to 1 if you have the <linux/types.h> header file. */
979 #undef HAVE_LINUX_TYPES_H
980
981@@ -81,6 +84,9 @@
982 /* option ignored */
983 #undef IGNORE_LINUX_BSG
984
985+/* even if Linux sg v4 available, use v3 instead */
986+#undef IGNORE_LINUX_SGV4
987+
988 /* compile out NVMe support */
989 #undef IGNORE_NVME
990
991diff --git a/configure b/configure
992index 97207eb..45ee88a 100755
993--- a/configure
994+++ b/configure
995@@ -1,6 +1,6 @@
996 #! /bin/sh
997 # Guess values for system-dependent variables and create Makefiles.
998-# Generated by GNU Autoconf 2.69 for sg3_utils 1.44.
999+# Generated by GNU Autoconf 2.69 for sg3_utils 1.45.
1000 #
1001 # Report bugs to <dgilbert@interlog.com>.
1002 #
1003@@ -590,8 +590,8 @@ MAKEFLAGS=
1004 # Identity of this package.
1005 PACKAGE_NAME='sg3_utils'
1006 PACKAGE_TARNAME='sg3_utils'
1007-PACKAGE_VERSION='1.44'
1008-PACKAGE_STRING='sg3_utils 1.44'
1009+PACKAGE_VERSION='1.45'
1010+PACKAGE_STRING='sg3_utils 1.45'
1011 PACKAGE_BUGREPORT='dgilbert@interlog.com'
1012 PACKAGE_URL=''
1013
1014@@ -692,7 +692,6 @@ am__nodep
1015 AMDEPBACKSLASH
1016 AMDEP_FALSE
1017 AMDEP_TRUE
1018-am__quote
1019 am__include
1020 DEPDIR
1021 OBJEXT
1022@@ -770,7 +769,8 @@ PACKAGE_VERSION
1023 PACKAGE_TARNAME
1024 PACKAGE_NAME
1025 PATH_SEPARATOR
1026-SHELL'
1027+SHELL
1028+am__quote'
1029 ac_subst_files=''
1030 ac_user_opts='
1031 enable_option_checking
1032@@ -791,6 +791,7 @@ enable_win32_spt_direct
1033 enable_scsistrings
1034 enable_nvme_supp
1035 enable_fast_lebe
1036+enable_linux_sgv4
1037 '
1038 ac_precious_vars='build_alias
1039 host_alias
1040@@ -1352,7 +1353,7 @@ if test "$ac_init_help" = "long"; then
1041 # Omit some internal or obsolete options to make the list less imposing.
1042 # This message is too long to be a string in the A/UX 3.1 sh.
1043 cat <<_ACEOF
1044-\`configure' configures sg3_utils 1.44 to adapt to many kinds of systems.
1045+\`configure' configures sg3_utils 1.45 to adapt to many kinds of systems.
1046
1047 Usage: $0 [OPTION]... [VAR=VALUE]...
1048
1049@@ -1423,7 +1424,7 @@ fi
1050
1051 if test -n "$ac_init_help"; then
1052 case $ac_init_help in
1053- short | recursive ) echo "Configuration of sg3_utils 1.44:";;
1054+ short | recursive ) echo "Configuration of sg3_utils 1.45:";;
1055 esac
1056 cat <<\_ACEOF
1057
1058@@ -1453,6 +1454,8 @@ Optional Features:
1059 strings
1060 --disable-nvme-supp remove all or most NVMe code
1061 --disable-fast-lebe use generic little-endian/big-endian code instead
1062+ --disable-linux-sgv4 for Linux sg driver avoid v4 interface even if
1063+ available
1064
1065 Optional Packages:
1066 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
1067@@ -1544,7 +1547,7 @@ fi
1068 test -n "$ac_init_help" && exit $ac_status
1069 if $ac_init_version; then
1070 cat <<\_ACEOF
1071-sg3_utils configure 1.44
1072+sg3_utils configure 1.45
1073 generated by GNU Autoconf 2.69
1074
1075 Copyright (C) 2012 Free Software Foundation, Inc.
1076@@ -1913,7 +1916,7 @@ cat >config.log <<_ACEOF
1077 This file contains any messages produced by compilers while
1078 running configure, to aid debugging if configure makes a mistake.
1079
1080-It was created by sg3_utils $as_me 1.44, which was
1081+It was created by sg3_utils $as_me 1.45, which was
1082 generated by GNU Autoconf 2.69. Invocation command line was
1083
1084 $ $0 $@
1085@@ -2262,7 +2265,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
1086
1087
1088
1089-am__api_version='1.15'
1090+am__api_version='1.16'
1091
1092 ac_aux_dir=
1093 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
1094@@ -2777,7 +2780,7 @@ fi
1095
1096 # Define the identity of the package.
1097 PACKAGE='sg3_utils'
1098- VERSION='1.44'
1099+ VERSION='1.45'
1100
1101
1102 cat >>confdefs.h <<_ACEOF
1103@@ -2807,8 +2810,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
1104
1105 # For better backward compatibility. To be removed once Automake 1.9.x
1106 # dies out for good. For more background, see:
1107-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1108-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1109+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
1110+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
1111 mkdir_p='$(MKDIR_P)'
1112
1113 # We need awk for the "check" target (and possibly the TAP driver). The
1114@@ -2859,7 +2862,7 @@ END
1115 Aborting the configuration process, to ensure you take notice of the issue.
1116
1117 You can download and install GNU coreutils to get an 'rm' implementation
1118-that behaves properly: <http://www.gnu.org/software/coreutils/>.
1119+that behaves properly: <https://www.gnu.org/software/coreutils/>.
1120
1121 If you want to complete the configuration process using your problematic
1122 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
1123@@ -3747,45 +3750,45 @@ DEPDIR="${am__leading_dot}deps"
1124
1125 ac_config_commands="$ac_config_commands depfiles"
1126
1127-
1128-am_make=${MAKE-make}
1129-cat > confinc << 'END'
1130+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
1131+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
1132+cat > confinc.mk << 'END'
1133 am__doit:
1134- @echo this is the am__doit target
1135+ @echo this is the am__doit target >confinc.out
1136 .PHONY: am__doit
1137 END
1138-# If we don't find an include directive, just comment out the code.
1139-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
1140-$as_echo_n "checking for style of include used by $am_make... " >&6; }
1141 am__include="#"
1142 am__quote=
1143-_am_result=none
1144-# First try GNU make style include.
1145-echo "include confinc" > confmf
1146-# Ignore all kinds of additional output from 'make'.
1147-case `$am_make -s -f confmf 2> /dev/null` in #(
1148-*the\ am__doit\ target*)
1149- am__include=include
1150- am__quote=
1151- _am_result=GNU
1152- ;;
1153-esac
1154-# Now try BSD make style include.
1155-if test "$am__include" = "#"; then
1156- echo '.include "confinc"' > confmf
1157- case `$am_make -s -f confmf 2> /dev/null` in #(
1158- *the\ am__doit\ target*)
1159- am__include=.include
1160- am__quote="\""
1161- _am_result=BSD
1162+# BSD make does it like this.
1163+echo '.include "confinc.mk" # ignored' > confmf.BSD
1164+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
1165+echo 'include confinc.mk # ignored' > confmf.GNU
1166+_am_result=no
1167+for s in GNU BSD; do
1168+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
1169+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
1170+ ac_status=$?
1171+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
1172+ (exit $ac_status); }
1173+ case $?:`cat confinc.out 2>/dev/null` in #(
1174+ '0:this is the am__doit target') :
1175+ case $s in #(
1176+ BSD) :
1177+ am__include='.include' am__quote='"' ;; #(
1178+ *) :
1179+ am__include='include' am__quote='' ;;
1180+esac ;; #(
1181+ *) :
1182 ;;
1183- esac
1184-fi
1185-
1186-
1187-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
1188-$as_echo "$_am_result" >&6; }
1189-rm -f confinc confmf
1190+esac
1191+ if test "$am__include" != "#"; then
1192+ _am_result="yes ($s style)"
1193+ break
1194+ fi
1195+done
1196+rm -f confinc.* confmf.*
1197+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
1198+$as_echo "${_am_result}" >&6; }
1199
1200 # Check whether --enable-dependency-tracking was given.
1201 if test "${enable_dependency_tracking+set}" = set; then :
1202@@ -6285,11 +6288,8 @@ _LT_EOF
1203 test $ac_status = 0; }; then
1204 # Now try to grab the symbols.
1205 nlist=conftest.nm
1206- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
1207- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
1208- ac_status=$?
1209- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1210- test $ac_status = 0; } && test -s "$nlist"; then
1211+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
1212+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
1213 # Try sorting and uniquifying the output.
1214 if sort "$nlist" | uniq > "$nlist"T; then
1215 mv -f "$nlist"T "$nlist"
1216@@ -12585,6 +12585,28 @@ done
1217
1218 }
1219
1220+check_for_linux_sg_v4_hdr() {
1221+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1222+/* end confdefs.h. */
1223+ # include <scsi/sg.h>
1224+ #ifdef SG_IOSUBMIT
1225+ found
1226+ #endif
1227+
1228+_ACEOF
1229+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1230+ $EGREP "found" >/dev/null 2>&1; then :
1231+
1232+cat >>confdefs.h <<_ACEOF
1233+#define HAVE_LINUX_SG_V4_HDR 1
1234+_ACEOF
1235+
1236+fi
1237+rm -f conftest*
1238+
1239+
1240+}
1241+
1242 case "${host}" in
1243 *-*-android*)
1244
1245@@ -12597,6 +12619,7 @@ cat >>confdefs.h <<_ACEOF
1246 #define SG_LIB_LINUX 1
1247 _ACEOF
1248
1249+ check_for_linux_sg_v4_hdr
1250 check_for_linux_nvme_headers;;
1251 *-*-freebsd*|*-*-kfreebsd*-gnu*)
1252
1253@@ -12659,6 +12682,7 @@ cat >>confdefs.h <<_ACEOF
1254 #define SG_LIB_LINUX 1
1255 _ACEOF
1256
1257+ check_for_linux_sg_v4_hdr
1258 check_for_linux_nvme_headers;;
1259 esac
1260
1261@@ -12793,6 +12817,16 @@ _ACEOF
1262 fi
1263
1264
1265+# Check whether --enable-linux-sgv4 was given.
1266+if test "${enable_linux_sgv4+set}" = set; then :
1267+ enableval=$enable_linux_sgv4;
1268+cat >>confdefs.h <<_ACEOF
1269+#define IGNORE_LINUX_SGV4 1
1270+_ACEOF
1271+
1272+fi
1273+
1274+
1275
1276 ac_config_files="$ac_config_files Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile scripts/Makefile"
1277
1278@@ -13361,7 +13395,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1279 # report actual input values of CONFIG_FILES etc. instead of their
1280 # values after options handling.
1281 ac_log="
1282-This file was extended by sg3_utils $as_me 1.44, which was
1283+This file was extended by sg3_utils $as_me 1.45, which was
1284 generated by GNU Autoconf 2.69. Invocation command line was
1285
1286 CONFIG_FILES = $CONFIG_FILES
1287@@ -13427,7 +13461,7 @@ _ACEOF
1288 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1289 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1290 ac_cs_version="\\
1291-sg3_utils config.status 1.44
1292+sg3_utils config.status 1.45
1293 configured by $0, generated by GNU Autoconf 2.69,
1294 with options \\"\$ac_cs_config\\"
1295
1296@@ -13546,7 +13580,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1297 #
1298 # INIT-COMMANDS
1299 #
1300-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
1301+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
1302
1303
1304 # The HP-UX ksh and POSIX shell print the target directory to stdout
1305@@ -14447,29 +14481,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
1306 # Older Autoconf quotes --file arguments for eval, but not when files
1307 # are listed without --file. Let's play safe and only enable the eval
1308 # if we detect the quoting.
1309- case $CONFIG_FILES in
1310- *\'*) eval set x "$CONFIG_FILES" ;;
1311- *) set x $CONFIG_FILES ;;
1312- esac
1313+ # TODO: see whether this extra hack can be removed once we start
1314+ # requiring Autoconf 2.70 or later.
1315+ case $CONFIG_FILES in #(
1316+ *\'*) :
1317+ eval set x "$CONFIG_FILES" ;; #(
1318+ *) :
1319+ set x $CONFIG_FILES ;; #(
1320+ *) :
1321+ ;;
1322+esac
1323 shift
1324- for mf
1325+ # Used to flag and report bootstrapping failures.
1326+ am_rc=0
1327+ for am_mf
1328 do
1329 # Strip MF so we end up with the name of the file.
1330- mf=`echo "$mf" | sed -e 's/:.*$//'`
1331- # Check whether this is an Automake generated Makefile or not.
1332- # We used to match only the files named 'Makefile.in', but
1333- # some people rename them; so instead we look at the file content.
1334- # Grep'ing the first line is not enough: some people post-process
1335- # each Makefile.in and add a new line on top of each file to say so.
1336- # Grep'ing the whole file is not good either: AIX grep has a line
1337+ am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
1338+ # Check whether this is an Automake generated Makefile which includes
1339+ # dependency-tracking related rules and includes.
1340+ # Grep'ing the whole file directly is not great: AIX grep has a line
1341 # limit of 2048, but all sed's we know have understand at least 4000.
1342- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
1343- dirpart=`$as_dirname -- "$mf" ||
1344-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1345- X"$mf" : 'X\(//\)[^/]' \| \
1346- X"$mf" : 'X\(//\)$' \| \
1347- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
1348-$as_echo X"$mf" |
1349+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
1350+ || continue
1351+ am_dirpart=`$as_dirname -- "$am_mf" ||
1352+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1353+ X"$am_mf" : 'X\(//\)[^/]' \| \
1354+ X"$am_mf" : 'X\(//\)$' \| \
1355+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
1356+$as_echo X"$am_mf" |
1357 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1358 s//\1/
1359 q
1360@@ -14487,53 +14527,48 @@ $as_echo X"$mf" |
1361 q
1362 }
1363 s/.*/./; q'`
1364- else
1365- continue
1366- fi
1367- # Extract the definition of DEPDIR, am__include, and am__quote
1368- # from the Makefile without running 'make'.
1369- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
1370- test -z "$DEPDIR" && continue
1371- am__include=`sed -n 's/^am__include = //p' < "$mf"`
1372- test -z "$am__include" && continue
1373- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
1374- # Find all dependency output files, they are included files with
1375- # $(DEPDIR) in their names. We invoke sed twice because it is the
1376- # simplest approach to changing $(DEPDIR) to its actual value in the
1377- # expansion.
1378- for file in `sed -n "
1379- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
1380- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
1381- # Make sure the directory exists.
1382- test -f "$dirpart/$file" && continue
1383- fdir=`$as_dirname -- "$file" ||
1384-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1385- X"$file" : 'X\(//\)[^/]' \| \
1386- X"$file" : 'X\(//\)$' \| \
1387- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
1388-$as_echo X"$file" |
1389- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1390- s//\1/
1391- q
1392- }
1393- /^X\(\/\/\)[^/].*/{
1394+ am_filepart=`$as_basename -- "$am_mf" ||
1395+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
1396+ X"$am_mf" : 'X\(//\)$' \| \
1397+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
1398+$as_echo X/"$am_mf" |
1399+ sed '/^.*\/\([^/][^/]*\)\/*$/{
1400 s//\1/
1401 q
1402 }
1403- /^X\(\/\/\)$/{
1404+ /^X\/\(\/\/\)$/{
1405 s//\1/
1406 q
1407 }
1408- /^X\(\/\).*/{
1409+ /^X\/\(\/\).*/{
1410 s//\1/
1411 q
1412 }
1413 s/.*/./; q'`
1414- as_dir=$dirpart/$fdir; as_fn_mkdir_p
1415- # echo "creating $dirpart/$file"
1416- echo '# dummy' > "$dirpart/$file"
1417- done
1418+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
1419+ && sed -e '/# am--include-marker/d' "$am_filepart" \
1420+ | $MAKE -f - am--depfiles" >&5
1421+ (cd "$am_dirpart" \
1422+ && sed -e '/# am--include-marker/d' "$am_filepart" \
1423+ | $MAKE -f - am--depfiles) >&5 2>&5
1424+ ac_status=$?
1425+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
1426+ (exit $ac_status); } || am_rc=$?
1427 done
1428+ if test $am_rc -ne 0; then
1429+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
1430+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
1431+as_fn_error $? "Something went wrong bootstrapping makefile fragments
1432+ for automatic dependency tracking. Try re-running configure with the
1433+ '--disable-dependency-tracking' option to at least be able to build
1434+ the package (albeit without support for automatic dependency tracking).
1435+See \`config.log' for more details" "$LINENO" 5; }
1436+ fi
1437+ { am_dirpart=; unset am_dirpart;}
1438+ { am_filepart=; unset am_filepart;}
1439+ { am_mf=; unset am_mf;}
1440+ { am_rc=; unset am_rc;}
1441+ rm -f conftest-deps.mk
1442 }
1443 ;;
1444 "libtool":C)
1445diff --git a/configure.ac b/configure.ac
1446index 1b4df71..8d641eb 100644
1447--- a/configure.ac
1448+++ b/configure.ac
1449@@ -1,4 +1,4 @@
1450-AC_INIT(sg3_utils, 1.44, dgilbert@interlog.com)
1451+AC_INIT(sg3_utils, 1.45, dgilbert@interlog.com)
1452
1453 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
1454 AM_MAINTAINER_MODE
1455@@ -59,10 +59,22 @@ check_for_linux_nvme_headers() {
1456 ]])
1457 }
1458
1459+check_for_linux_sg_v4_hdr() {
1460+ AC_EGREP_CPP(found,
1461+ [ # include <scsi/sg.h>
1462+ #ifdef SG_IOSUBMIT
1463+ found
1464+ #endif
1465+ ],
1466+ [AC_DEFINE_UNQUOTED(HAVE_LINUX_SG_V4_HDR, 1, [Have Linux sg v4 header]) ])
1467+
1468+}
1469+
1470 case "${host}" in
1471 *-*-android*)
1472 AC_DEFINE_UNQUOTED(SG_LIB_ANDROID, 1, [sg3_utils on android])
1473 AC_DEFINE_UNQUOTED(SG_LIB_LINUX, 1, [sg3_utils on linux])
1474+ check_for_linux_sg_v4_hdr
1475 check_for_linux_nvme_headers;;
1476 *-*-freebsd*|*-*-kfreebsd*-gnu*)
1477 AC_DEFINE_UNQUOTED(SG_LIB_FREEBSD, 1, [sg3_utils on FreeBSD])
1478@@ -85,6 +97,7 @@ case "${host}" in
1479 CFLAGS="$CFLAGS -D__USE_MINGW_ANSI_STDIO";;
1480 *-*-linux-gnu* | *-*-linux* | *)
1481 AC_DEFINE_UNQUOTED(SG_LIB_LINUX, 1, [sg3_utils on linux])
1482+ check_for_linux_sg_v4_hdr
1483 check_for_linux_nvme_headers;;
1484 esac
1485
1486@@ -128,6 +141,10 @@ AC_ARG_ENABLE([fast-lebe],
1487 AC_HELP_STRING([--disable-fast-lebe], [use generic little-endian/big-endian code instead]),
1488 [AC_DEFINE_UNQUOTED(IGNORE_FAST_LEBE, 1, [use generic little-endian/big-endian instead], )], [])
1489
1490+AC_ARG_ENABLE([linux-sgv4],
1491+ AC_HELP_STRING([--disable-linux-sgv4], [for Linux sg driver avoid v4 interface even if available]),
1492+ [AC_DEFINE_UNQUOTED(IGNORE_LINUX_SGV4, 1, [even if Linux sg v4 available, use v3 instead], )], [])
1493+
1494
1495 AC_OUTPUT(Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile scripts/Makefile)
1496
1497diff --git a/debian/changelog b/debian/changelog
1498index 0a711ed..6127ad3 100644
1499--- a/debian/changelog
1500+++ b/debian/changelog
1501@@ -1,3 +1,36 @@
1502+<<<<<<< debian/changelog
1503+=======
1504+sg3-utils (1.45-1ubuntu1) groovy; urgency=medium
1505+
1506+ * Merge with Debian unstable (LP: #1879761). Remaining changes:
1507+ - debian/control, debian/rules: build a sg3-udeb installer package again.
1508+ - debian/sg3-udeb.install: install the right binaries for sg3-udeb.
1509+ * Dropped:
1510+ - Fix a typo in a udev rule that leads to truncated ID_SERIAL values in
1511+ udev. (LP: #1859858)
1512+ [merged in Debian 1.45-1]
1513+
1514+ -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Thu, 21 May 2020 03:34:16 +0000
1515+
1516+sg3-utils (1.45-1) unstable; urgency=medium
1517+
1518+ [ Debian Janitor ]
1519+ * Trim trailing whitespace.
1520+ * Bump debhelper from old 9 to 12.
1521+ * Set upstream metadata fields: Bug-Submit.
1522+ * Drop unnecessary dependency on dh-autoconf.
1523+ * Use canonical URL in Vcs-Browser.
1524+
1525+ [ Ritesh Raj Sarraf ]
1526+ * Add filter for the debian folder
1527+ * New upstream version 1.45
1528+ * Drop quilt based patch fix-udevadm-path.patch
1529+ * Add patch to fix path for udevadm
1530+ * Update symbol list for 1.45
1531+
1532+ -- Ritesh Raj Sarraf <rrs@debian.org> Fri, 10 Apr 2020 20:52:49 +0530
1533+
1534+>>>>>>> debian/changelog
1535 sg3-utils (1.44-1ubuntu2) focal; urgency=medium
1536
1537 * Fix a typo in a udev rule that leads to truncated ID_SERIAL values in
1538@@ -148,7 +181,7 @@ sg3-utils (1.32-1) unstable; urgency=low
1539
1540 sg3-utils (1.31-1) unstable; urgency=low
1541
1542- * New Upstream Release
1543+ * New Upstream Release
1544 * [0d9bfc1] update symbols file
1545
1546 -- Ritesh Raj Sarraf <rrs@debian.org> Thu, 17 Mar 2011 19:46:32 +0530
1547@@ -156,20 +189,20 @@ sg3-utils (1.31-1) unstable; urgency=low
1548 sg3-utils (1.30-1) unstable; urgency=low
1549
1550 * New Upstream Release
1551- * Change address to my official Debian address and remove the DMUA flag
1552- * Add a get-orig-source target
1553+ * Change address to my official Debian address and remove the DMUA flag
1554+ * Add a get-orig-source target
1555 * Dropping patches that have merged upstream
1556 - 001_man_page_fixes.patch
1557- - 002_spelling_error_fixes.patch
1558+ - 002_spelling_error_fixes.patch
1559 * Update Standards Version to 3.9.1
1560- - Add BSD license to the copyright section
1561+ - Add BSD license to the copyright section
1562
1563 -- Ritesh Raj Sarraf <rrs@debian.org> Fri, 11 Feb 2011 01:22:58 +0530
1564
1565 sg3-utils (1.29-1) unstable; urgency=low
1566
1567 [Ritesh Raj Sarraf]
1568- * Adopt package as the new maintainer (Closes: #540828)
1569+ * Adopt package as the new maintainer (Closes: #540828)
1570 * New upstream release
1571 + Drop patches, merged upstream
1572 - 01_am_maintainer_mode.patch
1573@@ -178,12 +211,12 @@ sg3-utils (1.29-1) unstable; urgency=low
1574 + Add new patches
1575 - 001_man_page_fixes.patch
1576 - 002_spelling_error_fixes.patch
1577- * Update symbol list for new symbols introduced in this release
1578- * Add ${misc:Depends} to make in lintian clean
1579- * Add "source/format" and specify the current source format
1580- * Update Standards Version to 3.8.4 (No changes required)
1581- * Add Vcs headers
1582- * Add DMUA Flag
1583+ * Update symbol list for new symbols introduced in this release
1584+ * Add ${misc:Depends} to make in lintian clean
1585+ * Add "source/format" and specify the current source format
1586+ * Update Standards Version to 3.8.4 (No changes required)
1587+ * Add Vcs headers
1588+ * Add DMUA Flag
1589 * Explain about tarball re-packing in README.source
1590
1591 [Jonathan McDowell]
1592@@ -228,10 +261,10 @@ sg3-utils (1.27-1) unstable; urgency=low
1593
1594 * QA upload.
1595 + Set maintainer to Debian QA Group <packages@qa.debian.org>
1596- * Don't ignore errors on make clean.
1597+ * Don't ignore errors on make clean.
1598 * Use quilt as a patch system.
1599 * Enable AM_MAINTAINER_MODE.
1600- * Add patch by Petr Salinger to fix FTBFS on GNU/kFreeBSD (closes:
1601+ * Add patch by Petr Salinger to fix FTBFS on GNU/kFreeBSD (closes:
1602 #542748).
1603
1604 -- Aurelien Jarno <aurel32@debian.org> Sun, 30 Aug 2009 17:35:35 +0200
1605@@ -364,7 +397,7 @@ sg3-utils (1.03-1) unstable; urgency=low
1606 sg3-utils (0.95-4) unstable; urgency=low
1607
1608 * Only warns if installed on a kernel version < 2.4 (closes: #136434)
1609-
1610+
1611 -- Eric Schwartz <emschwar@debian.org> Tue, 28 May 2002 22:55:29 -0600
1612
1613 sg3-utils (0.95-3) unstable; urgency=low
1614@@ -387,5 +420,3 @@ sg3-utils (0.95-1) unstable; urgency=low
1615 * Adjusted Makefile to include $DESTDIR
1616
1617 -- Eric Schwartz <emschwar@debian.org> Wed, 14 Nov 2001 17:05:56 -0700
1618-
1619-
1620diff --git a/debian/compat b/debian/compat
1621deleted file mode 100644
1622index ec63514..0000000
1623--- a/debian/compat
1624+++ /dev/null
1625@@ -1 +0,0 @@
1626-9
1627diff --git a/debian/control b/debian/control
1628index f0066c9..2a108f1 100644
1629--- a/debian/control
1630+++ b/debian/control
1631@@ -4,11 +4,11 @@ Priority: optional
1632 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
1633 XSBC-Original-Maintainer: Ritesh Raj Sarraf <rrs@debian.org>
1634 Uploaders: Jonathan McDowell <noodles@earth.li>
1635-Build-Depends: debhelper (>= 9), libtool, libcam-dev [kfreebsd-any], dh-autoreconf, dpkg-dev (>= 1.16.1~)
1636+Build-Depends: debhelper-compat (= 12), libtool, libcam-dev [kfreebsd-any], dpkg-dev (>= 1.16.1~)
1637 Standards-Version: 3.9.2
1638 Homepage: http://sg.danny.cz/sg/
1639 Vcs-Git: https://salsa.debian.org/linux-blocks-team/sg3-utils.git
1640-Vcs-Browser: https://salsa.debian.org/linux-blocks-team/sg3-utils.git
1641+Vcs-Browser: https://salsa.debian.org/linux-blocks-team/sg3-utils
1642
1643 Package: sg3-utils
1644 Architecture: any
1645@@ -65,7 +65,7 @@ Description: utilities for devices using the SCSI command set (developer files)
1646
1647 Package: sg3-utils-udev
1648 Architecture: all
1649-Depends: sg3-utils, initramfs-tools, ${misc:Depends}
1650+Depends: sg3-utils, initramfs-tools-core, initramfs-tools | linux-initramfs-tool, ${misc:Depends}
1651 Description: utilities for devices using the SCSI command set (udev rules)
1652 Most OSes have SCSI pass-through interfaces that enable user space programs
1653 to send SCSI commands to a device and fetch the response. With SCSI to ATA
1654@@ -84,4 +84,7 @@ Package-Type: udeb
1655 Section: debian-installer
1656 Depends: ${misc:Depends}
1657 Description: utilities for devices using the SCSI command set
1658+<<<<<<< debian/control
1659
1660+=======
1661+>>>>>>> debian/control
1662diff --git a/debian/gbp.conf b/debian/gbp.conf
1663index cec628c..992b1d8 100644
1664--- a/debian/gbp.conf
1665+++ b/debian/gbp.conf
1666@@ -1,2 +1,6 @@
1667 [DEFAULT]
1668 pristine-tar = True
1669+
1670+
1671+[import-orig]
1672+filter = [ 'debian' ]
1673diff --git a/debian/libsgutils2-2.symbols b/debian/libsgutils2-2.symbols
1674index 4665a75..23a3afe 100644
1675--- a/debian/libsgutils2-2.symbols
1676+++ b/debian/libsgutils2-2.symbols
1677@@ -1,4 +1,4 @@
1678-libsgutils2.so.2 libsgutils2-2 #MINVER#
1679+libsgutils2-1.45.so.2 libsgutils2-2 #MINVER#
1680 check_pt_file_handle@Base 1.43
1681 clear_scsi_pt_obj@Base 1.27
1682 construct_scsi_pt_obj@Base 1.27
1683@@ -9,8 +9,11 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
1684 dWordHex@Base 1.27
1685 destruct_scsi_pt_obj@Base 1.27
1686 do_scsi_pt@Base 1.27
1687+ get_pt_actual_lengths@Base 1.45
1688+ get_pt_duration_ns@Base 1.45
1689 get_pt_file_handle@Base 1.43
1690 get_pt_nvme_nsid@Base 1.43
1691+ get_pt_req_lengths@Base 1.45
1692 get_pt_result@Base 1.43
1693 get_scsi_pt_duration_ms@Base 1.27
1694 set_scsi_pt_flags@Base 1.29
1695@@ -18,6 +21,7 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
1696 get_scsi_pt_os_err_str@Base 1.27
1697 get_scsi_pt_resid@Base 1.27
1698 get_scsi_pt_result_category@Base 1.27
1699+ get_scsi_pt_sense_buf@Base 1.45
1700 get_scsi_pt_sense_len@Base 1.27
1701 get_scsi_pt_status_response@Base 1.27
1702 get_scsi_pt_transport_err@Base 1.27
1703@@ -50,6 +54,7 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
1704 sg_bsg_major@Base 1.43
1705 sg_bsg_nvme_char_major_checked@Base 1.43
1706 sg_build_sense_buffer@Base 1.43
1707+ sg_checked_version_num@Base 1.45
1708 sg_chk_n_print3@Base 1.27
1709 sg_chk_n_print@Base 1.27
1710 sg_cmds_close_device@Base 1.27
1711@@ -61,18 +66,22 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
1712 sg_convert_errno@Base 1.43
1713 sg_decode_transportid_str@Base 1.43
1714 sg_do_nvme_pt@Base 1.43
1715+ sg_driver_version_num@Base 1.45
1716+ sg_duration_set_nano@Base 1.45
1717 sg_err_category3@Base 1.27
1718 sg_err_category@Base 1.27
1719 sg_err_category_new@Base 1.27
1720 sg_err_category_sense@Base 1.27
1721 sg_exit2str@Base 1.43
1722 sg_exit_str_arr@Base 1.43
1723+ sg_f2hex_arr@Base 1.45
1724 sg_find_bsg_nvme_char_major@Base 1.43
1725 sg_get_asc_ascq_str@Base 1.27
1726 sg_get_big_endian@Base 1.43
1727 sg_get_category_sense_str@Base 1.39
1728 sg_get_command_name@Base 1.27
1729 sg_get_command_size@Base 1.27
1730+ sg_get_command_str@Base 1.45
1731 sg_get_desig_assoc_str@Base 1.42
1732 sg_get_desig_code_set_str@Base 1.42
1733 sg_get_desig_type_str@Base 1.42
1734@@ -88,6 +97,7 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
1735 sg_get_nvme_opcode_name@Base 1.43
1736 sg_get_opcode_name@Base 1.27
1737 sg_get_opcode_sa_name@Base 1.27
1738+ sg_get_opcode_translation@Base 1.45
1739 sg_get_page_size@Base 1.43
1740 sg_get_pdt_str@Base 1.27
1741 sg_get_scsi_status_str@Base 1.27
1742@@ -141,6 +151,8 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
1743 sg_lib_zoning_in_arr@Base 1.41
1744 sg_lib_zoning_out_arr@Base 1.41
1745 sg_lin_page_size@Base 1.43
1746+ sg_linux_get_sg_version@Base 1.45
1747+ sg_linux_sense_print@Base 1.45
1748 sg_ll_3party_copy_out@Base 1.38
1749 sg_ll_ata_pt@Base 1.27
1750 sg_ll_extended_copy@Base 1.36
1751@@ -219,8 +231,8 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
1752 sg_nvme_char_major@Base 1.43
1753 sg_nvme_desc2sense@Base 1.43
1754 sg_nvme_status2scsi@Base 1.43
1755- sg_opcode_info_arr@Base 1.43
1756 sg_print_command@Base 1.27
1757+ sg_print_command_len@Base 1.45
1758 sg_print_driver_status@Base 1.27
1759 sg_print_host_status@Base 1.27
1760 sg_print_masked_status@Base 1.27
1761@@ -241,3 +253,16 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
1762 sntl_init_dev_stat@Base 1.43
1763 sntl_resp_mode_select10@Base 1.43
1764 sntl_resp_mode_sense10@Base 1.43
1765+ sg_scsi_sense_desc_find@Base 1.45
1766+ sg_set_big_endian@Base 1.45
1767+ sg_set_binary_mode@Base 1.45
1768+ sg_set_text_mode@Base 1.45
1769+ sg_set_warnings_strm@Base 1.45
1770+ sg_simple_inquiry@Base 1.45
1771+ sg_simple_inquiry_pt@Base 1.45
1772+ sg_t10_uuid_desig2str@Base 1.45
1773+ sg_vpd_dev_id_iter@Base 1.45
1774+ sg_warnings_strm@Base 1.45
1775+ sntl_init_dev_stat@Base 1.45
1776+ sntl_resp_mode_select10@Base 1.45
1777+ sntl_resp_mode_sense10@Base 1.45
1778diff --git a/debian/libsgutils2-2.symbols.kfreebsd b/debian/libsgutils2-2.symbols.kfreebsd
1779index bb98206..009f28a 100644
1780--- a/debian/libsgutils2-2.symbols.kfreebsd
1781+++ b/debian/libsgutils2-2.symbols.kfreebsd
1782@@ -1,4 +1,4 @@
1783-libsgutils2.so.2 libsgutils2-2 #MINVER#
1784+libsgutils2-1.45.so.2 libsgutils2-2 #MINVER#
1785 clear_scsi_pt_obj@Base 1.27
1786 construct_scsi_pt_obj@Base 1.27
1787 dStrHex@Base 1.27
1788diff --git a/debian/patches/fix-udevadm-path.patch b/debian/patches/0001-Fix-path-for-udevadm.patch
1789similarity index 72%
1790rename from debian/patches/fix-udevadm-path.patch
1791rename to debian/patches/0001-Fix-path-for-udevadm.patch
1792index a6bd025..0f7cce2 100644
1793--- a/debian/patches/fix-udevadm-path.patch
1794+++ b/debian/patches/0001-Fix-path-for-udevadm.patch
1795@@ -1,12 +1,22 @@
1796-Add new path for udevadm. See DBug #852585
1797+From: Ritesh Raj Sarraf <rrs@debian.org>
1798+Date: Fri, 10 Apr 2020 18:13:13 +0530
1799+Subject: Fix path for udevadm
1800+
1801+See DBug #852585, for details
1802+---
1803+ scripts/rescan-scsi-bus.sh | 8 ++++----
1804+ 1 file changed, 4 insertions(+), 4 deletions(-)
1805+
1806+diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
1807+index 46fe6c0..7d0bbf7 100755
1808 --- a/scripts/rescan-scsi-bus.sh
1809 +++ b/scripts/rescan-scsi-bus.sh
1810-@@ -430,12 +430,12 @@
1811+@@ -452,12 +452,12 @@ getluns()
1812 udevadm_settle()
1813 {
1814 local tmo=60
1815-- if test -x /sbin/udevadm; then
1816-+ if test -x /bin/udevadm; then
1817+- if [ -x /sbin/udevadm ] ; then
1818++ if [ -x /bin/udevadm ] ; then
1819 print_and_scroll_back " Calling udevadm settle (can take a while) "
1820 # Loop for up to 60 seconds if sd devices still are settling..
1821 # This allows us to continue if udev events are stuck on multipaths in recovery mode
1822@@ -16,7 +26,7 @@ Add new path for udevadm. See DBug #852585
1823 break;
1824 fi
1825 let tmo=$tmo-1
1826-@@ -767,7 +767,7 @@
1827+@@ -799,7 +799,7 @@ findremapped()
1828
1829 # Trigger udev to update the info
1830 echo -n "Triggering udev to update device information... "
1831@@ -25,10 +35,10 @@ Add new path for udevadm. See DBug #852585
1832 udevadm_settle 2>&1 /dev/null
1833 echo "Done"
1834
1835-@@ -1331,7 +1331,7 @@
1836+@@ -1367,7 +1367,7 @@ if [ -n "$mp_enable" ] && [ $rmvd_found -gt 0 ] ; then
1837 flushmpaths 1
1838 fi
1839- if test $found -gt 0 ; then
1840+ if [ $found -gt 0 ] ; then
1841 - /sbin/udevadm trigger --sysname-match=sd*
1842 + /bin/udevadm trigger --sysname-match=sd*
1843 udevadm_settle
1844diff --git a/debian/patches/series b/debian/patches/series
1845index 0f8e6b5..d8206e3 100644
1846--- a/debian/patches/series
1847+++ b/debian/patches/series
1848@@ -1,2 +1,6 @@
1849+<<<<<<< debian/patches/series
1850 fix-udevadm-path.patch
1851 fix-SCSI_IDENT_LUN_NAA_EXT-udev-rule.patch
1852+=======
1853+0001-Fix-path-for-udevadm.patch
1854+>>>>>>> debian/patches/series
1855diff --git a/debian/rules b/debian/rules
1856index d1c1231..f65efe3 100755
1857--- a/debian/rules
1858+++ b/debian/rules
1859@@ -10,7 +10,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
1860 DPKG_EXPORT_BUILDFLAGS = 1
1861 include /usr/share/dpkg/buildflags.mk
1862
1863-# Uncomment this to turn on verbose mode.
1864+# Uncomment this to turn on verbose mode.
1865 # export DH_VERBOSE=1
1866
1867 DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
1868@@ -18,7 +18,7 @@ DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
1869 INITRAMFS=$(CURDIR)/debian/sg3-utils-udev/usr/share/initramfs-tools/
1870
1871 %:
1872- dh "$@" --with autoreconf
1873+ dh "$@"
1874
1875 override_dh_install:
1876 dh_testdir
1877@@ -28,9 +28,15 @@ override_dh_install:
1878 [ ! -f scripts/55-scsi-sg3_id.rules ] || cp scripts/55-scsi-sg3_id.rules debian/sg3-udeb.scsi-sg3_id.udev
1879 [ ! -f scripts/58-scsi-sg3_symlink.rules ] || cp scripts/58-scsi-sg3_symlink.rules debian/sg3-utils-udev.scsi-sg3_symlink.udev
1880
1881+<<<<<<< debian/rules
1882 dh_installudev -psg3-utils-udev --priority=55 --name=scsi-sg3_id
1883 dh_installudev -psg3-utils-udev --priority=58 --name=scsi-sg3_symlink
1884 dh_installudev -psg3-udeb --priority=55 --name=scsi-sg3_id
1885+=======
1886+ dh_installudev -psg3-utils-udev --priority=55 --name=scsi-sg3_id
1887+ dh_installudev -psg3-utils-udev --priority=58 --name=scsi-sg3_symlink
1888+ dh_installudev -psg3-udeb --priority=55 --name=scsi-sg3_id
1889+>>>>>>> debian/rules
1890
1891 install -D -m 755 debian/initramfs/hooks $(INITRAMFS)/hooks/sg3-utils
1892
1893diff --git a/debian/upstream/metadata b/debian/upstream/metadata
1894new file mode 100644
1895index 0000000..97eac72
1896--- /dev/null
1897+++ b/debian/upstream/metadata
1898@@ -0,0 +1 @@
1899+Bug-Submit: dgilbert@interlog.com
1900diff --git a/depcomp b/depcomp
1901index b39f98f..65cbf70 100755
1902--- a/depcomp
1903+++ b/depcomp
1904@@ -1,9 +1,9 @@
1905 #! /bin/sh
1906 # depcomp - compile a program generating dependencies as side-effects
1907
1908-scriptversion=2016-01-11.22; # UTC
1909+scriptversion=2018-03-07.03; # UTC
1910
1911-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
1912+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
1913
1914 # This program is free software; you can redistribute it and/or modify
1915 # it under the terms of the GNU General Public License as published by
1916@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
1917 # GNU General Public License for more details.
1918
1919 # You should have received a copy of the GNU General Public License
1920-# along with this program. If not, see <http://www.gnu.org/licenses/>.
1921+# along with this program. If not, see <https://www.gnu.org/licenses/>.
1922
1923 # As a special exception to the GNU General Public License, if you
1924 # distribute this file as part of a program that contains a
1925@@ -783,7 +783,7 @@ exit 0
1926 # Local Variables:
1927 # mode: shell-script
1928 # sh-indentation: 2
1929-# eval: (add-hook 'write-file-hooks 'time-stamp)
1930+# eval: (add-hook 'before-save-hook 'time-stamp)
1931 # time-stamp-start: "scriptversion="
1932 # time-stamp-format: "%:y-%02m-%02d.%02H"
1933 # time-stamp-time-zone: "UTC0"
1934diff --git a/doc/Makefile.am b/doc/Makefile.am
1935index 9a1816e..fc8e85d 100644
1936--- a/doc/Makefile.am
1937+++ b/doc/Makefile.am
1938@@ -3,15 +3,16 @@ man_MANS = \
1939 scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 scsi_start.8 \
1940 scsi_stop.8 scsi_temperature.8 sg3_utils.8 sg_bg_ctl.8 \
1941 sg_compare_and_write.8 sg_decode_sense.8 sg_format.8 sg_get_config.8 \
1942- sg_get_lba_status.8 sg_ident.8 sg_inq.8 sg_logs.8 sg_luns.8 \
1943- sg_modes.8 sg_opcodes.8 sg_persist.8 sg_prevent.8 sg_raw.8 sg_rdac.8 \
1944- sg_read_attr.8 sg_read_block_limits.8 sg_read_buffer.8 \
1945- sg_read_long.8 sg_readcap.8 sg_reassign.8 sg_referrals.8 \
1946- sg_rep_zones.8 sg_requests.8 sg_reset_wp.8 sg_rmsn.8 sg_rtpg.8 \
1947- sg_safte.8 sg_sanitize.8 sg_sat_identify.8 sg_sat_phy_event.8 \
1948- sg_sat_read_gplog.8 sg_sat_set_features.8 sg_seek.8 sg_senddiag.8 \
1949- sg_ses.8 sg_ses_microcode.8 sg_start.8 sg_stpg.8 sg_stream_ctl.8 \
1950- sg_sync.8 sg_timestamp.8 sg_turs.8 sg_unmap.8 sg_verify.8 sg_vpd.8 \
1951+ sg_get_elem_status.8 sg_get_lba_status.8 sg_ident.8 sg_inq.8 \
1952+ sg_logs.8 sg_luns.8 sg_modes.8 sg_opcodes.8 sg_persist.8 \
1953+ sg_prevent.8 sg_raw.8 sg_rdac.8 sg_read_attr.8 \
1954+ sg_read_block_limits.8 sg_read_buffer.8 sg_read_long.8 sg_readcap.8 \
1955+ sg_reassign.8 sg_referrals.8 sg_rep_zones.8 sg_requests.8 \
1956+ sg_reset_wp.8 sg_rmsn.8 sg_rtpg.8 sg_safte.8 sg_sanitize.8 \
1957+ sg_sat_identify.8 sg_sat_phy_event.8 sg_sat_read_gplog.8 \
1958+ sg_sat_set_features.8 sg_seek.8 sg_senddiag.8 sg_ses.8 \
1959+ sg_ses_microcode.8 sg_start.8 sg_stpg.8 sg_stream_ctl.8 sg_sync.8 \
1960+ sg_timestamp.8 sg_turs.8 sg_unmap.8 sg_verify.8 sg_vpd.8 \
1961 sg_wr_mode.8 sg_write_buffer.8 sg_write_long.8 sg_write_same.8 \
1962 sg_write_verify.8 sg_write_x.8 sg_zone.8
1963 CLEANFILES =
1964diff --git a/doc/Makefile.in b/doc/Makefile.in
1965index 3097608..6a37b4f 100644
1966--- a/doc/Makefile.in
1967+++ b/doc/Makefile.in
1968@@ -1,7 +1,7 @@
1969-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1970+# Makefile.in generated by automake 1.16.1 from Makefile.am.
1971 # @configure_input@
1972
1973-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
1974+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
1975
1976 # This Makefile.in is free software; the Free Software Foundation
1977 # gives unlimited permission to copy and/or distribute it,
1978@@ -283,17 +283,17 @@ top_srcdir = @top_srcdir@
1979 man_MANS = scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 \
1980 scsi_start.8 scsi_stop.8 scsi_temperature.8 sg3_utils.8 \
1981 sg_bg_ctl.8 sg_compare_and_write.8 sg_decode_sense.8 \
1982- sg_format.8 sg_get_config.8 sg_get_lba_status.8 sg_ident.8 \
1983- sg_inq.8 sg_logs.8 sg_luns.8 sg_modes.8 sg_opcodes.8 \
1984- sg_persist.8 sg_prevent.8 sg_raw.8 sg_rdac.8 sg_read_attr.8 \
1985- sg_read_block_limits.8 sg_read_buffer.8 sg_read_long.8 \
1986- sg_readcap.8 sg_reassign.8 sg_referrals.8 sg_rep_zones.8 \
1987- sg_requests.8 sg_reset_wp.8 sg_rmsn.8 sg_rtpg.8 sg_safte.8 \
1988- sg_sanitize.8 sg_sat_identify.8 sg_sat_phy_event.8 \
1989- sg_sat_read_gplog.8 sg_sat_set_features.8 sg_seek.8 \
1990- sg_senddiag.8 sg_ses.8 sg_ses_microcode.8 sg_start.8 sg_stpg.8 \
1991- sg_stream_ctl.8 sg_sync.8 sg_timestamp.8 sg_turs.8 sg_unmap.8 \
1992- sg_verify.8 sg_vpd.8 sg_wr_mode.8 sg_write_buffer.8 \
1993+ sg_format.8 sg_get_config.8 sg_get_elem_status.8 \
1994+ sg_get_lba_status.8 sg_ident.8 sg_inq.8 sg_logs.8 sg_luns.8 \
1995+ sg_modes.8 sg_opcodes.8 sg_persist.8 sg_prevent.8 sg_raw.8 \
1996+ sg_rdac.8 sg_read_attr.8 sg_read_block_limits.8 \
1997+ sg_read_buffer.8 sg_read_long.8 sg_readcap.8 sg_reassign.8 \
1998+ sg_referrals.8 sg_rep_zones.8 sg_requests.8 sg_reset_wp.8 \
1999+ sg_rmsn.8 sg_rtpg.8 sg_safte.8 sg_sanitize.8 sg_sat_identify.8 \
2000+ sg_sat_phy_event.8 sg_sat_read_gplog.8 sg_sat_set_features.8 \
2001+ sg_seek.8 sg_senddiag.8 sg_ses.8 sg_ses_microcode.8 sg_start.8 \
2002+ sg_stpg.8 sg_stream_ctl.8 sg_sync.8 sg_timestamp.8 sg_turs.8 \
2003+ sg_unmap.8 sg_verify.8 sg_vpd.8 sg_wr_mode.8 sg_write_buffer.8 \
2004 sg_write_long.8 sg_write_same.8 sg_write_verify.8 sg_write_x.8 \
2005 sg_zone.8 $(am__append_1) $(am__append_3) $(am__append_5)
2006 CLEANFILES = $(am__append_2) $(am__append_4) $(am__append_6)
2007@@ -317,8 +317,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
2008 *config.status*) \
2009 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
2010 *) \
2011- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
2012- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
2013+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
2014+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
2015 esac;
2016
2017 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
2018@@ -385,7 +385,10 @@ ctags CTAGS:
2019 cscope cscopelist:
2020
2021
2022-distdir: $(DISTFILES)
2023+distdir: $(BUILT_SOURCES)
2024+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
2025+
2026+distdir-am: $(DISTFILES)
2027 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
2028 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
2029 list='$(DISTFILES)'; \
2030diff --git a/doc/rescan-scsi-bus.sh.8 b/doc/rescan-scsi-bus.sh.8
2031index 4435c7d..fa93fcf 100644
2032--- a/doc/rescan-scsi-bus.sh.8
2033+++ b/doc/rescan-scsi-bus.sh.8
2034@@ -40,10 +40,10 @@ enable debug [default: 0]
2035 flush failed multipath devices [default: disabled]
2036 .TP
2037 \fB\-\-forceremove\fR
2038-remove and readd every device (DANGEROUS)
2039+remove stale devices (DANGEROUS)
2040 .TP
2041 \fB\-\-forcerescan\fR
2042-rescan existing devices
2043+remove and readd existing devices (DANGEROUS)
2044 .TP
2045 \fB\-h\fR, \fB\-\-help\fR
2046 print usage message then exit
2047diff --git a/doc/scsi_logging_level.8 b/doc/scsi_logging_level.8
2048index 10e946b..062d3f4 100644
2049--- a/doc/scsi_logging_level.8
2050+++ b/doc/scsi_logging_level.8
2051@@ -1,4 +1,4 @@
2052-.TH SCSI_LOGGING_LEVEL "8" "January 2014" "sg3_utils\-1.41" SG3_UTILS
2053+.TH SCSI_LOGGING_LEVEL "8" "September 2018" "sg3_utils\-1.45" SG3_UTILS
2054 .SH NAME
2055 scsi_logging_level \- access Linux SCSI logging level information
2056 .SH SYNOPSIS
2057diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8
2058index eaf6489..b336707 100644
2059--- a/doc/sg3_utils.8
2060+++ b/doc/sg3_utils.8
2061@@ -1,10 +1,10 @@
2062-.TH SG3_UTILS "8" "September 2018" "sg3_utils\-1.44" SG3_UTILS
2063+.TH SG3_UTILS "8" "February 2020" "sg3_utils\-1.45" SG3_UTILS
2064 .SH NAME
2065 sg3_utils \- a package of utilities for sending SCSI commands
2066 .SH SYNOPSIS
2067 .B sg_*
2068 [\fI\-\-dry\-run\fR] [\fI\-\-enumerate\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]
2069-[\fI\-\-in=FN\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR]
2070+[\fI\-\-in=FN\fR] [\fI\-\-inhex=FN\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR]
2071 [\fI\-\-timeout=SECS\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
2072 [\fIOTHER_OPTIONS\fR] \fIDEVICE\fR
2073 .SH DESCRIPTION
2074@@ -35,7 +35,7 @@ Architecture Model (SAM) with SAM\-5 being the most recent standard (ANSI
2075 INCITS 515\-2016) with the most recent draft being SAM\-6 revision 4 . SCSI
2076 commands in common with all device types can be found in SCSI Primary
2077 Commands (SPC) of which SPC\-4 is the most recent standard (ANSI INCITS
2078-513-2015). The most recent SPC draft is SPC\-5 revision 19. Block device
2079+513-2015). The most recent SPC draft is SPC\-5 revision 21. Block device
2080 specific commands (e.g. as used by disks) are in SBC, those for tape drives
2081 in SSC, those for SCSI enclosures in SES and those for CD/DVD/BD drives in
2082 MMC.
2083@@ -98,6 +98,15 @@ SCSI to NVMe Translation Layer within the underlying library).
2084 Several utilities have their own environment variable setting (e.g.
2085 sg_persist has SG_PERSIST_IN_RDONLY). See individual utility man pages
2086 for more information.
2087+.PP
2088+There is a Linux specific environment variable called SG3_UTILS_LINUX_NANO
2089+that if defined and the sg driver in the system is 4.0.30 or later, will
2090+show command durations in nanoseconds rather than the default milliseconds.
2091+Command durations are typically only shown if \-\-verbose is used 3 or more
2092+times. Due to an interface problem (a 32 bit integer that should be 64 bits
2093+with the benefit of hindsight) the maximum duration that can be represented
2094+in nanoseconds is about 4.2 seconds. If longer durations may occur then
2095+don't define this environment variable (or undefine it).
2096 .SH LINUX DEVICE NAMING
2097 Most disk block devices have names like /dev/sda, /dev/sdb, /dev/sdc, etc.
2098 SCSI disks in Linux have always had names like that but in recent Linux
2099@@ -235,8 +244,8 @@ The NVME\-MI SES Send and SES Receive commands correspond to the SCSI
2100 SEND DIAGNOSTIC and RECEIVE DIAGNOSTIC RESULTS commands respectively.
2101 There are however a few other commands that need to be translated, the
2102 most important of which is the SCSI INQUIRY command to the NVMe Identify
2103-controller/namespace. Version 1.43 of these utilities contain a small
2104-SNTL (SCSI to NVMe Translation Layer) to take care of these details.
2105+controller/namespace. Starting in version 1.43 these utilities contain a
2106+small SNTL (SCSI to NVMe Translation Layer) to take care of these details.
2107 .PP
2108 As a side effect of this "juggling" if the sg_inq utility is used (without
2109 the \-\-page= option) on a NVMe \fIDEVICE\fR then the actual NVMe
2110@@ -251,6 +260,12 @@ package assume they are talking to a SCSI device and decode any response
2111 accordingly. One easy way for users to see the underlying device is a
2112 NVMe device is the standard INQUIRY response Vendor Identification field
2113 of "NVMe " (an 8 character long string with 4 spaces to the right).
2114+.PP
2115+The following SCSI commands are currently supported by the SNTL library:
2116+INQUIRY, MODE SELECT(10), MODE SENSE(10), READ CAPACITY(10 and 16),
2117+RECEIVE DIAGNOSTIC RESULTS, REQUEST SENSE, REPORT LUNS, REPORT SUPPORTED
2118+OPERATION CODES, REPORT SUPPORTED TASK MANAGEMENT FUNCTIONS, SEND
2119+DIAGNOSTICS, and TEST UNIT READY.
2120 .SH EXIT STATUS
2121 To aid scripts that call these utilities, the exit status is set to indicate
2122 success (0) or failure (1 or more). Note that some of the lower values
2123@@ -398,6 +413,11 @@ like "shouldn't/can't get here". Perhaps the author should be informed.
2124 .B 33
2125 the command sent to \fIDEVICE\fR has timed out.
2126 .TP
2127+.B 34
2128+this is a Windows only exit status and indicates that the Windows error
2129+number (32 bits) cannot meaningfully be mapped to an equivalent Unix error
2130+number returned as the exit status (7 bits).
2131+.TP
2132 .B 36
2133 no error has occurred plus the utility wants to convey a boolean value
2134 of false. The corresponding true value is conveyed by a 0 exit status.
2135@@ -553,8 +573,14 @@ act on the input, typically it acts on the output data.
2136 Since the structure of the data returned by SCSI commands varies
2137 considerably then the usage information or the manpage of the utility being
2138 used should be checked. In some cases \fI\-\-hex\fR may need to be used
2139-multiple times (and is more conveniently given as '\-HH' or '\-HHH). In
2140-other cases the name of this option is \fI\-\-inhex=FN\fR.
2141+multiple times (and is more conveniently given as '\-HH' or '\-HHH).
2142+.TP
2143+\fB\-i\fR, \fB\-\-inhex\fR=\fIFN\fR
2144+This option has the same or similar functionality as \fI\-\-in=FN\fR. And
2145+perhaps 'inhex' is more descriptive since by default, ASCII hexadecimal is
2146+expected in the contents of file: \fIFN\fR. Alternatively the short form
2147+option may be \fI\-I\fR or \fI\-X\fR. See the "FORMAT OF FILES CONTAINING
2148+ASCII HEX" section below for more information.
2149 .TP
2150 \fB\-m\fR, \fB\-\-maxlen\fR=\fILEN\fR
2151 several important SCSI commands (e.g. INQUIRY and MODE SENSE) have response
2152@@ -650,19 +676,39 @@ An example is "2k" for 2048. The large tera and peta suffixes are only
2153 available for numeric arguments that might require 64 bits to represent
2154 internally.
2155 .PP
2156-A suffix of the form "x<n>" multiplies the leading number by <n>. An
2157-example is "2x33" for "66". The leading number cannot be "0" (zero) as
2158-that would be interpreted as a hexadecimal number (see below).
2159-.PP
2160 These multiplicative suffixes are compatible with GNU's dd command (since
2161 2002) which claims compliance with SI and with IEC 60027\-2.
2162 .PP
2163+A suffix of the form "x<n>" multiplies the preceding number by <n>. An
2164+example is "2x33" for "66". The left argument cannot be '0' as '0x' will
2165+be interpreted as hexadecimal number prefix (see below). The left
2166+argument to the multiplication must end in a hexadecimal digit (i.e.
2167+0 to f) and the whole expression cannot have any embedded whitespace (e.g.
2168+spaces). An ugly example: "0xfx0x2" for 30.
2169+.PP
2170+A suffix of the form "+<n>" adds the preceding number to <n>. An example
2171+is "3+1k" for "1027". The left argument to the addition must end in a
2172+hexadecimal digit (i.e. 0 to f) and the whole expression cannot have any
2173+embedded whitespace (e.g. spaces). Another example: "0xf+0x2" for 17.
2174+.PP
2175 Alternatively numerical arguments can be given in hexadecimal. There are
2176 two syntaxes. The number can be preceded by either "0x" or "0X" as found
2177 in the C programming language. The second hexadecimal representation is a
2178 trailing "h" or "H" as found in (storage) standards. When hex numbers are
2179 given, multipliers cannot be used. For example the decimal value "256" can
2180 be given as "0x100" or "100h".
2181+.SH FORMAT OF FILES CONTAINING ASCII HEX
2182+Such a file is assumed to contain a sequence of one or two digit ASCII
2183+hexadecimal values separated by whitespace. "Whitespace consists of either
2184+spaces, tabs, blank lines, or any combination thereof". Each one or two digit
2185+ASCII hex pair is decoded into a byte (i.e. 8 bits). The following will be
2186+decoded to valid (ascending valued)
2187+bytes: '0', '01', '3', 'c', 'F', '4a', 'cC', 'ff'.
2188+Lines containing only whitespace are ignored. The contents of any line
2189+containing a hash mark ('#') is ignored from that point until the end of that
2190+line. Users are encouraged to use hash marks to introduce comments in hex
2191+files. The author uses the extension'.hex' on such files. Examples can be
2192+found in the 'inhex' directory.
2193 .SH MICROCODE AND FIRMWARE
2194 There are two standardized methods for downloading microcode (i.e. device
2195 firmware) to a SCSI device. The more general way is with the SCSI WRITE
2196@@ -706,7 +752,7 @@ CREDITS file and individual source files (in the 'src' directory).
2197 .SH "REPORTING BUGS"
2198 Report bugs to <dgilbert at interlog dot com>.
2199 .SH COPYRIGHT
2200-Copyright \(co 1999\-2018 Douglas Gilbert
2201+Copyright \(co 1999\-2020 Douglas Gilbert
2202 .br
2203 Some utilities are distributed under a GPL version 2 license while
2204 others, usually more recent ones, are under a FreeBSD license. The files
2205diff --git a/doc/sg_dd.8 b/doc/sg_dd.8
2206index 881d11e..2c6caed 100644
2207--- a/doc/sg_dd.8
2208+++ b/doc/sg_dd.8
2209@@ -1,4 +1,4 @@
2210-.TH SG_DD "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS
2211+.TH SG_DD "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2212 .SH NAME
2213 sg_dd \- copy data to and from files and devices, especially SCSI
2214 devices
2215@@ -13,6 +13,7 @@ devices
2216 [\fIcoe=\fR{0|1|2|3}] [\fIcoe_limit=CL\fR] [\fIdio=\fR{0|1}]
2217 [\fIodir=\fR{0|1}] [\fIof2=OFILE2\fR] [\fIretries=RETR\fR] [\fIsync=\fR{0|1}]
2218 [\fItime=\fR{0|1}] [\fIverbose=VERB\fR] [\fI\-\-dry\-run\fR] [\fI\-V\fR]
2219+[\fI\-\-verify\fR]
2220 .SH DESCRIPTION
2221 .\" Add any additional description here
2222 .PP
2223@@ -28,6 +29,15 @@ The first group in the synopsis above are "standard" Unix
2224 operands. The second group are extra options added by this utility.
2225 Both groups are defined below.
2226 .PP
2227+When the \fI\-\-verify\fR option is given, then the read side is the
2228+same but the on the write side, the WRITE SCSI command is replaced by
2229+the VERIFY SCSI command. If any VERIFY commands yields a sense key of
2230+MISCOMPARE then the verify operation will stop. The \fI\-\-verify\fR
2231+option can only be used when \fIOFILE\fR is either a sg device or
2232+a block device with oflag=sgio also given. When the \fI\-\-verify\fR
2233+option is used, this utility works in a similar fashion to the Unix
2234+cmp(1) command.
2235+.PP
2236 This utility is only supported on Linux whereas most other utilities in the
2237 sg3_utils package have been ported to other operating systems. A utility
2238 called "ddpt" has similar syntax and functionality to sg_dd. ddpt drops some
2239@@ -101,7 +111,7 @@ copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
2240 minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices
2241 report from SCSI READ CAPACITY commands or that block devices (or their
2242 partitions) report. Normal files are not probed for their size. If
2243-\fIskip=SKIP\fR or \fIskip=SEEK\fR are given and the count is derived (i.e.
2244+\fIskip=SKIP\fR or \fIseek=SEEK\fR are given and the count is derived (i.e.
2245 not explicitly given) then the derived count is scaled back so that the
2246 copy will not overrun the device. If the file name is a block device
2247 partition and \fICOUNT\fR is not given then the size of the partition
2248@@ -208,6 +218,14 @@ outputs usage message and exits.
2249 when used once, this is equivalent to \fIverbose=1\fR. When used
2250 twice (e.g. "\-vv") this is equivalent to \fIverbose=2\fR, etc.
2251 .TP
2252+\fB\-x\fR, \fB\-\-verify\fR
2253+do a verify operation (like Unix command cmp(1)) rather than a copy. Cannot
2254+be used with "oflag=sparse". \fIof=OFILE\fR must be given and \fIOFILE\fR
2255+must be an sg device or a block device with "oflag=sgio" also given. Uses the
2256+SCSI VERIFY command with the BYTCHK field set to 1. The VERIFY command is
2257+used instead of WRITE when this option is given. There is no VERIFY(6)
2258+command.
2259+.TP
2260 \fB\-V\fR, \fB\-\-version\fR
2261 outputs version number information and exits.
2262 .SH CONVERSIONS
2263@@ -491,11 +509,13 @@ Written by Douglas Gilbert and Peter Allworth.
2264 .SH "REPORTING BUGS"
2265 Report bugs to <dgilbert at interlog dot com>.
2266 .SH COPYRIGHT
2267-Copyright \(co 2000\-2018 Douglas Gilbert
2268+Copyright \(co 2000\-2020 Douglas Gilbert
2269 .br
2270 This software is distributed under the GPL version 2. There is NO
2271 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2272 .SH "SEE ALSO"
2273+cmp(1)
2274+.PP
2275 There is a web page discussing sg_dd at http://sg.danny.cz/sg/sg_dd.html
2276 .PP
2277 A POSIX threads version of this utility called
2278diff --git a/doc/sg_decode_sense.8 b/doc/sg_decode_sense.8
2279index 2396ae3..5a141bf 100644
2280--- a/doc/sg_decode_sense.8
2281+++ b/doc/sg_decode_sense.8
2282@@ -1,9 +1,9 @@
2283-.TH SG_DECODE_SENSE "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS
2284+.TH SG_DECODE_SENSE "8" "June 2019" "sg3_utils\-1.45" SG3_UTILS
2285 .SH NAME
2286 sg_decode_sense \- decode SCSI sense and related data
2287 .SH SYNOPSIS
2288 .B sg_decode_sense
2289-[\fI\-\-binary=FN\fR] [\fI\-\-cdb\fR] [\fI\-\-err=ES\fR] [\fI\-\-file=FN\fR]
2290+[\fI\-\-binary=BFN\fR] [\fI\-\-cdb\fR] [\fI\-\-err=ES\fR] [\fI\-\-file=HFN\fR]
2291 [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-nospace\fR] [\fI\-\-status=SS\fR]
2292 [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-write=WFN\fR]
2293 [H1 H2 H3 ...]
2294@@ -43,8 +43,8 @@ are ignored apart from \fI\-\-verbose\fR.
2295 .SH OPTIONS
2296 Arguments to long options are mandatory for short options as well.
2297 .TP
2298-\fB\-b\fR, \fB\-\-binary\fR=\fIFN\fR
2299-the sense data is read in binary from a file called \fIFN\fR.
2300+\fB\-b\fR, \fB\-\-binary\fR=\fIBFN\fR
2301+the sense data is read in binary from a file called \fIBFN\fR.
2302 .TP
2303 \fB\-c\fR, \fB\-\-cdb\fR
2304 treat the given string of hex arguments as bytes in a SCSI CDB and
2305@@ -60,12 +60,12 @@ is given two or more times a longer form of the message is output. In all
2306 cases the message is less than 128 characters long with one trailing line
2307 feed. All other command line options and arguments are ignored.
2308 .TP
2309-\fB\-f\fR, \fB\-\-file\fR=\fIFN\fR
2310-the sense data is read in ASCII hexadecimal from a file called \fIFN\fR.
2311+\fB\-f\fR, \fB\-\-file\fR=\fIHFN\fR
2312+the sense data is read in ASCII hexadecimal from a file called \fIHFN\fR.
2313 The sense data should appear as a sequence of bytes separated by space,
2314 comma, tab or newline. Everything from and including a hash symbol to the
2315 end of that line is ignored. If \fI\-\-nospace\fR is set then no separator
2316-is required between the ASCII hexadecimal digits in \fIFN\fR with bytes
2317+is required between the ASCII hexadecimal digits in \fIHFN\fR with bytes
2318 decoded from pairs of ASCII hexadecimal digits.
2319 .TP
2320 \fB\-h\fR, \fB\-\-help\fR
2321@@ -82,7 +82,7 @@ expect ASCII hexadecimal to be a string of hexadecimal digits with no
2322 spaces between them. Bytes are decoded by taking two hexadecimal digits
2323 at a time, so an even number of digits is expected. The string of
2324 hexadecimal digits may be on the command line (replacing "H1 H2 H3")
2325-or spread across multiple lines the \fIFN\fR given to \fI\-\-file=\fR.
2326+or spread across multiple lines the \fIHFN\fR given to \fI\-\-file=\fR.
2327 On the command line, spaces (or other whitespace characters) between
2328 sequences of hexadecimal digits are ignored; the maximum command line
2329 hex string is 1023 characters long.
2330@@ -148,7 +148,7 @@ Written by Douglas Gilbert.
2331 .SH "REPORTING BUGS"
2332 Report bugs to <dgilbert at interlog dot com>.
2333 .SH COPYRIGHT
2334-Copyright \(co 2010\-2018 Douglas Gilbert
2335+Copyright \(co 2010\-2019 Douglas Gilbert
2336 .br
2337 This software is distributed under a FreeBSD license. There is NO
2338 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2339diff --git a/doc/sg_format.8 b/doc/sg_format.8
2340index d1d3fde..84ae8f5 100644
2341--- a/doc/sg_format.8
2342+++ b/doc/sg_format.8
2343@@ -1,17 +1,17 @@
2344-.TH SG_FORMAT "8" "September 2018" "sg3_utils\-1.43" SG3_UTILS
2345+.TH SG_FORMAT "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2346 .SH NAME
2347-sg_format \- format, resize a SCSI disk or format a tape
2348+sg_format \- format, format with preset, resize SCSI disk; format tape
2349 .SH SYNOPSIS
2350 .B sg_format
2351 [\fI\-\-cmplst=\fR{0|1}] [\fI\-\-count=COUNT\fR] [\fI\-\-dcrt\fR]
2352 [\fI\-\-dry\-run\fR] [\fI\-\-early\fR] [\fI\-\-ffmt=FFMT\fR]
2353-[\fI\-\-fmtpinfo=FPI\fR] [\fI\-\-format\fR] [\fI\-\-help\fR]
2354-[\fI\-\-ip\-def\fR] [\fI\-\-long\fR] [\fI\-\-mode=MP\fR] [\fI\-\-pfu=PFU\fR]
2355-[\fI\-\-pie=PIE\fR] [\fI\-\-pinfo\fR] [\fI\-\-poll=PT\fR] [\fI\-\-quick\fR]
2356-[\fI\-\-resize\fR] [\fI\-\-rto_req\fR] [\fI\-\-security\fR] [\fI\-\-six\fR]
2357-[\fI\-\-size=LB_SZ\fR] [\fI\-\-tape=FM\fR] [\fI\-\-timeout=SECS\fR]
2358-[\fI\-\-verbose\fR] [\fI\-\-verify\fR] [\fI\-\-version\fR] [\fI\-\-wait\fR]
2359-\fIDEVICE\fR
2360+[\fI\-\-fmtmaxlba\R] [\fI\-\-fmtpinfo=FPI\fR] [\fI\-\-format\fR]
2361+[\fI\-\-help\fR] [\fI\-\-ip\-def\fR] [\fI\-\-long\fR] [\fI\-\-mode=MP\fR]
2362+[\fI\-\-pfu=PFU\fR] [\fI\-\-pie=PIE\fR] [\fI\-\-pinfo\fR] [\fI\-\-poll=PT\fR]
2363+[\fI\-\-preset=ID\fR] [\fI\-\-quick\fR] [\fI\-\-resize\fR] [\fI\-\-rto_req\fR]
2364+[\fI\-\-security\fR] [\fI\-\-six\fR] [\fI\-\-size=LB_SZ\fR]
2365+[\fI\-\-tape=FM\fR] [\fI\-\-timeout=SECS\fR] [\fI\-\-verbose\fR]
2366+[\fI\-\-verify\fR] [\fI\-\-version\fR] [\fI\-\-wait\fR] \fIDEVICE\fR
2367 .SH DESCRIPTION
2368 .\" Add any additional description here
2369 .PP
2370@@ -24,6 +24,12 @@ recommendation typically leaves aside a certain number of tracks, spread
2371 across the media, for reassignment of blocks to logical block addresses
2372 during the life of the disk.
2373 .PP
2374+This utility issues one of three SCSI format commands: FORMAT UNIT, FORMAT
2375+MEDIUM or FORMAT WITH PRESET. In the following description, unqualified
2376+sections will usually be referring to the SCSI FORMAT UNIT command. Both
2377+FORMAT UNIT and FORMAT WITH PRESET apply to disks (or disk\-like devices).
2378+The FORMAT MEDIUM command is for tapes.
2379+.PP
2380 This utility can format modern SCSI disks and potentially change their block
2381 size (if permitted) and the block count (i.e. number of accessible blocks on
2382 the media also known as "resizing"). Resizing a disk to less than the
2383@@ -42,11 +48,12 @@ response to a MODE SENSE command and the response to a READ CAPACITY command.
2384 The reason for this double check is to detect a "format corrupt" state (see
2385 the NOTES section). This usage will not modify the disk.
2386 .PP
2387-When this utility is used with the "\-\-format" (or "\-F") option it will
2388-attempt to format the given DEVICE. In the absence of the \fI\-\-quick\fR
2389-option there is a 15 second pause during which time the user is invited
2390-thrice (5 seconds apart) to abort sg_format. This occurs just prior the SCSI
2391-FORMAT UNIT command being issued. See the NOTES section for more information.
2392+When this utility is used with either \fI\-\-format\fR, \fI\-\-preset=ID\fR
2393+or \fI\-\-tape=FM\fR, it will attempt to format the given DEVICE. In the
2394+absence of the \fI\-\-quick\fR option there is a 15 second pause during which
2395+time the user is invited thrice (5 seconds apart) to abort sg_format. This
2396+occurs just prior the SCSI FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM
2397+command being issued. See the NOTES section for more information.
2398 .PP
2399 Protection information (PI) is optional and is made up of one or more
2400 protection intervals, each made up of 8 bytes associated with a logical
2401@@ -58,8 +65,13 @@ INFORMATION section below for more information.
2402 .PP
2403 When the \fI\-\-tape=FM\fR option is given then the SCSI FORMAT MEDIUM
2404 command is sent to the \fIDEVICE\fR. FORMAT MEDIUM is defined in the SSC
2405-documents at T10 and prepares a volume for use. That may include
2406-partitioning the medium. See the section below on TAPE for more information.
2407+documents at T10 and prepares a volume for use. That may include partitioning
2408+the medium. See the section below on TAPE for more information.
2409+.PP
2410+The FORMAT WITH PRESET was added in draft SBC\-4 revision 18. A preset
2411+pattern, selected by the PRESET IDENTIFIER field (\fI\-\-id=FWPID\fR),
2412+is written to the disk. See the FORMAT PRESETS VPD page (0xb8) for a list
2413+of available Format preset identifiers and their associated data.
2414 .SH OPTIONS
2415 Arguments to long options are mandatory for short options as well.
2416 The options are arranged in alphabetical order based on the long
2417@@ -113,16 +125,23 @@ See NOTES section below.
2418 \fB\-D\fR, \fB\-\-dcrt\fR
2419 this option sets the DCRT bit in the FORMAT UNIT command's parameter list
2420 header. It will "disable certification". Certification verifies that blocks
2421-are usable during the format process. Using this option may speed the format.
2422-The default action of this utility (i.e. when this option is not given) is
2423-to clear the DCRT bit thereby requesting "media certification". When the DCRT
2424-bit is set, the FOV bit must also be set hence sg_format does that.
2425+are usable during the format process. Using this option may speed the format
2426+but \fI\-\-ffmt=FFMT\fR, if available, would probably be better. The default
2427+action of this utility (i.e. when this option is not given) is to clear the
2428+DCRT bit thereby requesting "media certification" (also unless another
2429+option needs it, the FOV bit will be cleared). When the DCRT bit is set, the
2430+FOV bit must also be set hence sg_format does that.
2431+.br
2432+If this option is given twice then certification is enabled by clearing the
2433+DCRT bit and setting the FOV bit. Both these bits are found in the parameter
2434+list associated with the FORMAT UNIT cdb.
2435 .TP
2436 \fB\-d\fR, \fB\-\-dry\-run\fR
2437 this option will parse the command line, do all the preparation but bypass
2438-the actual FORMAT UNIT or FORMAT MEDIUM commands. Also if the options would
2439-cause the logical block size to change, then the MODE SELECT command that
2440-would do that is also bypassed when the dry run option is given.
2441+the actual FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM command. Also if
2442+the options would otherwise cause the logical block size to change, then the
2443+MODE SELECT command that would do that is also bypassed when the dry
2444+run option is given.
2445 .TP
2446 \fB\-e\fR, \fB\-\-early\fR
2447 during a format operation, The default action of this utility is to poll the
2448@@ -139,7 +158,7 @@ UNIT cdb. The field was introduced in SBC\-4 revision 10. The default value
2449 is 0 which implies the former action which is typically to overwrite all
2450 blocks on the \fIDEVICE\fR. That can take a long time (e.g. with hard disks
2451 over 10 TB in size that can be days). With \fIFFMT\fR set that time may be
2452-reduced to minutes. So it is worth trying if it is available.
2453+reduced to minutes or less. So it is worth trying if it is available.
2454 .br
2455 \fIFFMT\fR has values 1 and 2 for fast format with 3 being reserved
2456 currently. These two values include this description: "The device server
2457@@ -150,7 +169,12 @@ data has been written to, after the fast format. When \fIFFMT\fR is 1 the
2458 read operation should return "unspecified logical block data" and complete
2459 without error. When \fIFFMT\fR is 2 the read operation may yield check
2460 condition status with a sense key set to hardware error, medium error or
2461-command aborted. See SBC\-4 revision 15 section 4.35 for more details.
2462+command aborted. See draft SBC\-4 revision 16 section 4.34 for more details.
2463+.TP
2464+\fB\-b\fR, \fB\-\-fmtmaxlba\fR
2465+This option is only active if it is given together with the
2466+\fI\-\-preset=ID\fR option. If so it sets the FMTMAXLBA field in the FORMAT
2467+WITH PRESET command.
2468 .TP
2469 \fB\-f\fR, \fB\-\-fmtpinfo\fR=\fIFPI\fR
2470 sets the FMTPINFO field in the FORMAT UNIT cdb to a value between 0 and 3.
2471@@ -163,8 +187,10 @@ option should be used in their place. See the PROTECTION INFORMATION section
2472 below for more information.
2473 .TP
2474 \fB\-F\fR, \fB\-\-format\fR
2475-issue a SCSI FORMAT UNIT command.
2476-.B This will destroy all the data held on the media.
2477+issue one of the three SCSI "format" commands. In the absence of the
2478+\fI\-\-preset=ID\fR and \fI\-\-tape=FM\fR options, the SCSI FORMAT UNIT
2479+command is issued.
2480+.B These commands will destroy all the data held on the media.
2481 This option is required to change the block size of a disk. In the absence
2482 of the \fI\-\-quick\fR option, the user is given a 15 second count down to
2483 ponder the wisdom of doing this, during which time control\-C (amongst other
2484@@ -240,6 +266,12 @@ READY command is used, otherwise a REQUEST SENSE command is used. The
2485 default is currently 0 but this will change to 1 in the near future. See
2486 the NOTES sections below.
2487 .TP
2488+\fB\-E\fR, \fB\-\-preset\fR=\fIID\fR
2489+this option instructs this utility to issue a SCSI FORMAT WITH PRESET
2490+command. The PRESET IDENTIFIER field in that cdb is set to \fIID\fR. The
2491+IMMED field in that cdb is also set unless the \fI\-\-wait\fR option is
2492+also given, in which case it is cleared.
2493+.TP
2494 \fB\-Q\fR, \fB\-\-quick\fR
2495 the default action (i.e. when the option is not given) is to give the user
2496 15 seconds to reconsider doing a format operation on the \fIDEVICE\fR.
2497@@ -296,18 +328,18 @@ in a tape drive for use. Values for \fIFM\fR include 0 to do the "default"
2498 format; 1 to partition a volume and 2 to do a default format then partition.
2499 .TP
2500 \fB\-m\fR, \fB\-\-timeout\fR=\fISECS\fR
2501-where \fISECS\fR is the FORMAT UNIT or FORMAT MEDIUM command timeout in
2502-seconds. \fISECS\fR will only be used if it exceeds the internal timeout
2503-which is 20 seconds if the IMMED bit is set and 72000 seconds (20 hours)
2504-or higher if the IMMED bit is not set. If the disk size exceeds 4 TB then
2505-the timeout value is increased to 144000 seconds (40 hours). And if it is
2506-greater than 8 TB then the timeout value is increased to 288000 seconds (80
2507-hours). If the timeout is exceeded then the operating system will typically
2508-abort the command. Aborting a command may escalate to a LUN reset (or
2509-worse). A timeout may also leave the disk or tape format operation
2510-incomplete. And that may result in the disk or tape being in a "format
2511-corrupt" state requiring another format to remedy the situation. So for
2512-various reasons timeouts are best avoided.
2513+where \fISECS\fR is the FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM
2514+command timeout in seconds. \fISECS\fR will only be used if it exceeds the
2515+internal timeout which is 20 seconds if the IMMED bit is set and 72000
2516+seconds (20 hours) or higher if the IMMED bit is not set. If the disk size
2517+exceeds 4 TB then the timeout value is increased to 144000 seconds (40 hours).
2518+And if it is greater than 8 TB then the timeout value is increased to
2519+288000 seconds (80 hours). If the timeout is exceeded then the operating
2520+system will typically abort the command. Aborting a command may escalate to
2521+a LUN reset (or worse). A timeout may also leave the disk or tape format
2522+operation incomplete. And that may result in the disk or tape being in
2523+a "format corrupt" state requiring another format to remedy the situation.
2524+So for various reasons command timeouts are best avoided.
2525 .TP
2526 \fB\-v\fR, \fB\-\-verbose\fR
2527 increase the level of verbosity, (i.e. debug output). "\-vvv" gives
2528@@ -324,9 +356,13 @@ print the version string and then exit.
2529 the default format action is to set the "IMMED" bit in the FORMAT UNIT
2530 command's (short) parameter header. If this option (i.e. \fI\-\-wait\fR) is
2531 given then the "IMMED" bit is not set. If \fI\-\-wait\fR is given then the
2532-FORMAT UNIT or FORMAT MEDIUM command waits until the format operation
2533-completes before returning its response. This can be many hours on large
2534-disks. See the \fI\-\-timeout=SECS\fR option.
2535+FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM command waits until the
2536+format operation completes before returning its response. This can be many
2537+hours on large disks. See the \fI\-\-timeout=SECS\fR option.
2538+.br
2539+Alternatively this option may be useful when used together with
2540+\fI\-\-ffmt=FFMT\fR (and \fIFFMT\fR greater than 0) since the fast format
2541+may only be a matter of seconds.
2542 .SH LISTS
2543 The SBC\-3 draft (revision 20) defines PLIST, CLIST, DLIST and GLIST in
2544 section 4.10 on "Medium defects". Briefly, the PLIST is the "primary"
2545@@ -370,8 +406,8 @@ introduced in the SBC\-2 standard. SBC\-3 defines 4 protection types (types
2546 0 to 3) with protection type 0 meaning no PI is maintained. While a device
2547 may support one or more protection types, it can only be formatted with 1
2548 of the 4. To change a device's protection type, it must be re\-formatted.
2549-For more information see the Protection Information in section 4.22 of
2550-draft SBC\-4 revision 15.
2551+For more information see the Protection Information in section 4.21 of
2552+draft SBC\-4 revision 16.
2553 .PP
2554 A device that supports PI information (i.e. supports one or more protection
2555 types 1, 2 and 3) sets the "PROTECT" bit in its standard INQUIRY response. It
2556@@ -423,32 +459,35 @@ the current version of this utility defaults to using TEST UNIT READY
2557 commands to poll the disk to find out the progress of the format. The
2558 \fI\-\-poll=PT\fR option has been added to control this.
2559 .PP
2560-When the \fI\-\-format\fR option is given without the \fI\-\-wait\fR option
2561-then the SCSI FORMAT UNIT command is issued with the IMMED bit set which
2562-causes the SCSI command to return after it has started the format operation.
2563-The \fI\-\-early\fR option will cause sg_format to exit at that point.
2564-Otherwise the \fIDEVICE\fR is polled every 60 seconds or every 10 seconds
2565-if \fIFFMT\fR is non\-zero. The poll is with TEST UNIT READY or REQUEST SENSE
2566-commands until one reports an "all clear" (i.e. the format operation has
2567-completed). Normally these polling commands will result in a progress
2568-indicator (expressed as a percentage) being output to the screen. If the user
2569-gets bored watching the progress report then sg_format process can be
2570-terminated (e.g. with control\-C) without affecting the format operation
2571-which continues. However a target or device reset (or a power cycle) will
2572-probably cause the device to become "format corrupt".
2573-.PP
2574-When the \fI\-\-format\fR (or \fI\-\-tape\fR) and \fI\-\-wait\fR options are
2575-both given then this utility may take a long time to return. In this case
2576-care should be taken not to send any other SCSI commands to the disk as it
2577-may not respond leaving those commands queued behind the active format
2578-command. This may cause a timeout in the OS driver (in a lot shorter period
2579-than 20 hours applicable to some format operations). This may result in the
2580-OS resetting the disk leaving the format operation incomplete. This may leave
2581-the disk in a "format corrupt" state requiring another format to remedy
2582-the situation. Modern SCSI devices should yield a "not ready" sense key
2583-with an additional sense indicating a format is in progress. With older
2584-devices the user should take precautions that nothing attempts to access
2585-a device while it is being formatted.
2586+When the \fI\-\-format\fR, \fI\-\-preset=ID\fR or \fI\-\-tape=FM\fR option
2587+is given without the \fI\-\-wait\fR option then the corresponding SCSI
2588+command is issued with the IMMED bit set which causes the SCSI command to
2589+return after it has started the format operation. The \fI\-\-early\fR option
2590+will cause sg_format to exit at that point. Otherwise the \fIDEVICE\fR is
2591+polled every 60 seconds or every 10 seconds if \fIFFMT\fR is non\-zero. The
2592+poll is with TEST UNIT READY or REQUEST SENSE commands until one reports
2593+an "all clear" (i.e. the format operation has completed). Normally these
2594+polling commands will result in a progress indicator (expressed as a
2595+percentage) being output to the screen. If the user gets bored watching the
2596+progress report then sg_format process can be terminated (e.g. with
2597+control\-C) without affecting the format operation which continues. However
2598+a target or device reset (or a power cycle) will probably cause the format
2599+to cease and the \fIDEVICE\fR to become "format corrupt".
2600+.PP
2601+When the \fI\-\-format\fR (\fI\-\-preset=ID\fR or \fI\-\-tape\fR) and
2602+\fI\-\-wait\fR options are both given then this utility may take a long time
2603+to return. In this case care should be taken not to send any other SCSI
2604+commands to the disk as it may not respond leaving those commands queued
2605+behind the active format command. This may cause a timeout in the OS
2606+driver (in a lot shorter period than 20 hours applicable to some format
2607+operations). This may result in the OS resetting the disk leaving the format
2608+operation incomplete. This may leave the disk in a "format corrupt" state
2609+requiring another format to remedy the situation. Modern SCSI devices should
2610+yield a "not ready" sense key with an additional sense indicating a format
2611+is in progress. With older devices the user should take precautions that
2612+nothing attempts to access a device while it is being formatted. Unmounting
2613+in mounted file systems on a \fIDEVICE\fR prior to calling this utility
2614+is strongly advised.
2615 .PP
2616 When the block size (i.e. the number of bytes in each block) is changed
2617 on a disk two SCSI commands must be sent: a MODE SELECT to change the block
2618@@ -628,6 +667,17 @@ backed up.
2619 Now /dev/sdd should have 512 byte logical block size. And to switch it back:
2620 .PP
2621 # sg_format \-\-format \-\-ffmt=1 \-\-size=4096 /dev/sdd
2622+.PP
2623+Since fast formats can be very quick (a matter of seconds) using the
2624+\-\-wait option may be appropriate.
2625+.PP
2626+And tu use Format with preset this invocation might be used:
2627+.PP
2628+ # sg_format \-\-preset=1 \-\-fmtmaxlba /dev/sdd
2629+.PP
2630+The FORMAT PRESETS VPD page (0xb8) should be consulted to check that Preset
2631+identifier 0x1 is there and has the expected format (i.e. "default host aware
2632+zoned block device model with 512 bytes of user data in each logical block").
2633 .SH EXIT STATUS
2634 The exit status of sg_format is 0 when it is successful. Otherwise see
2635 the sg3_utils(8) man page. Unless the \fI\-\-wait\fR option is given, the
2636@@ -638,7 +688,7 @@ Written by Grant Grundler, James Bottomley and Douglas Gilbert.
2637 .SH "REPORTING BUGS"
2638 Report bugs to <dgilbert at interlog dot com>.
2639 .SH COPYRIGHT
2640-Copyright \(co 2005\-2018 Grant Grundler, James Bottomley and Douglas Gilbert
2641+Copyright \(co 2005\-2020 Grant Grundler, James Bottomley and Douglas Gilbert
2642 .br
2643 This software is distributed under the GPL version 2. There is NO
2644 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2645diff --git a/doc/sg_get_elem_status.8 b/doc/sg_get_elem_status.8
2646new file mode 100644
2647index 0000000..a4d533f
2648--- /dev/null
2649+++ b/doc/sg_get_elem_status.8
2650@@ -0,0 +1,100 @@
2651+.TH SG_GET_ELEM_STATUS "8" "August 2019" "sg3_utils\-1.45" SG3_UTILS
2652+.SH NAME
2653+sg_get_elem_status \- send SCSI GET PHYSICAL ELEMENT STATUS command
2654+.SH SYNOPSIS
2655+.B sg_get_elem_status
2656+[\fI\-\-brief\fR] [\fI\-\-filter=FLT\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]
2657+[\fI\-\-inhex=FN\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR]
2658+[\fI\-\-readonly\fR] [\fI\-\-report\-type=RT\fR] [\fI\-\-starting=ELEM\fR]
2659+[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
2660+.SH DESCRIPTION
2661+.\" Add any additional description here
2662+.PP
2663+Send the SCSI GET PHYSICAL ELEMENT STATUS command to the \fIDEVICE\fR and
2664+output the response. The command was introduced in (draft) SBC\-4 revision
2665+16.
2666+.PP
2667+The default action is to decode the response into one physical element
2668+status descriptor per line then output a header and the status descriptors
2669+to stdout. The amount of output can be reduced by the \fI\-\-brief\fR option.
2670+.PP
2671+Rather than send this SCSI command to \fIDEVICE\fR, if the \fI\-\-inhex=FN\fR
2672+option is given, then the contents of the file named \fIFN\fR are decoded
2673+as ASCII hex and then processed if it was the response of this command.
2674+.SH OPTIONS
2675+Arguments to long options are mandatory for short options as well.
2676+.TP
2677+\fB\-b\fR, \fB\-\-brief\fR
2678+tbd
2679+.TP
2680+\fB\-f\fR, \fB\-\-filter\fR=\fIFLT\fR
2681+where \fIFLT\fR is placed in a two bit field called FILTER in the GET
2682+PHYSICAL ELEMENT STATUS command. Only two values are defined for that
2683+field: 0 for all element descriptors; 1 for those element descriptors that
2684+are outside 'spec' or have depopulation information to report. In both cases
2685+the REPORT TYPE and STARTING ELEMENT fields may further restrict (reduce)
2686+the number of element descriptors returned. The default value is zero.
2687+.TP
2688+\fB\-h\fR, \fB\-\-help\fR
2689+output the usage message then exit.
2690+.TP
2691+\fB\-H\fR, \fB\-\-hex\fR
2692+output response to this command in ASCII hex.
2693+.TP
2694+\fB\-i\fR, \fB\-\-inhex\fR=\fIFN\fR
2695+where \fIFN\fR is a function name whose contents are assumed to be ASCII
2696+hexadecimal. If \fIDEVICE\fR is also given then \fIDEVICE\fR is ignored,
2697+a warning is issued and the utility continues, decoding the file named
2698+\fIFN\fR. See the "FORMAT OF FILES CONTAINING ASCII HEX" section in the
2699+sg3_utils manpage for more information. If the \fI\-\-raw\fR option is
2700+also given then the contents of \fIFN\fR are treated as binary.
2701+.TP
2702+\fB\-m\fR, \fB\-\-maxlen\fR=\fILEN\fR
2703+where \fILEN\fR is the (maximum) response length in bytes. It is placed in
2704+the cdb's "allocation length" field. If not given then 32 is used. 32 is
2705+enough space for the response header only.
2706+\fILEN\fR should be a multiple of 32 (e.g. 32, 64, and 96 are suitable).
2707+.TP
2708+\fB\-r\fR, \fB\-\-raw\fR
2709+output response in binary (to stdout) unless the \fI\-\-inhex=FN\fR option
2710+is also given. In that case the input file name (\fIFN\fR) is decoded as
2711+binary (and the output is _not_ in binary).
2712+.TP
2713+\fB\-R\fR, \fB\-\-readonly\fR
2714+open the \fIDEVICE\fR read\-only (e.g. in Unix with the O_RDONLY flag).
2715+The default is to open it read\-write.
2716+.TP
2717+\fB\-t\fR, \fB\-\-report\-type\fR=\fIRT\fR
2718+where \fIRT\fR will be placed in the REPORT TYPE field of the GET PHYSICAL
2719+ELEMENT STATUS command. Currently only two values are defined: 0
2720+for 'physical element' and 1: for 'storage element'. The default value
2721+is 1 .
2722+.TP
2723+\fB\-s\fR, \fB\-\-starting\fR=\fIELEM\fR
2724+where \fIELEM\fR is the placed in the STARTING ELEMENT field of the GET
2725+PHYSICAL ELEMENT STATUS command. Only physical elements with identifiers
2726+equal to or greater than \fIELEM\fR are returned. The default value is zero
2727+which while it isn't a valid element identifier (since they must be
2728+non\-zero) is given in an example in Annex L of SBC\-4 revision 17. So
2729+an \fIELEM\fR of zero is assumed to be valid in this context.
2730+.TP
2731+\fB\-v\fR, \fB\-\-verbose\fR
2732+increase the level of verbosity, (i.e. debug output). Additional output
2733+caused by this option is sent to stderr.
2734+.TP
2735+\fB\-V\fR, \fB\-\-version\fR
2736+print the version string and then exit.
2737+.SH EXIT STATUS
2738+The exit status of sg_get_elem_status is 0 when it is successful. Otherwise
2739+see the sg3_utils(8) man page.
2740+.SH AUTHORS
2741+Written by Douglas Gilbert.
2742+.SH "REPORTING BUGS"
2743+Report bugs to <dgilbert at interlog dot com>.
2744+.SH COPYRIGHT
2745+Copyright \(co 2019 Douglas Gilbert
2746+.br
2747+This software is distributed under a FreeBSD license. There is NO
2748+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2749+.SH "SEE ALSO"
2750+.B sg_get_lba_status(8), sg3_utils(8)
2751diff --git a/doc/sg_get_lba_status.8 b/doc/sg_get_lba_status.8
2752index bc35208..347a958 100644
2753--- a/doc/sg_get_lba_status.8
2754+++ b/doc/sg_get_lba_status.8
2755@@ -1,12 +1,13 @@
2756-.TH SG_GET_LBA_STATUS "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS
2757+.TH SG_GET_LBA_STATUS "8" "August 2019" "sg3_utils\-1.45" SG3_UTILS
2758 .SH NAME
2759 sg_get_lba_status \- send SCSI GET LBA STATUS(16 or 32) command
2760 .SH SYNOPSIS
2761 .B sg_get_lba_status
2762 [\fI\-\-16\fR] [\fI\-\-32\fR] [\fI\-\-brief\fR] [\fI\-\-element-id=EI\fR]
2763-[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-maxlen=LEN\fR]
2764-[\fI\-\-raw\fR] [\fI\-\-readonly\fR] [\fI\-\-report\-type=RT\fR]
2765-[\fI\-\-scan-len=SL\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
2766+[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-inhex=FN\fR] [\fI\-\-lba=LBA\fR]
2767+[\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR] [\fI\-\-readonly\fR]
2768+[\fI\-\-report\-type=RT\fR] [\fI\-\-scan-len=SL\fR] [\fI\-\-verbose\fR]
2769+[\fI\-\-version\fR] \fIDEVICE\fR
2770 .SH DESCRIPTION
2771 .\" Add any additional description here
2772 .PP
2773@@ -17,12 +18,17 @@ block provisioning should support this command. The GET LBA STATUS(32)
2774 command was added in (draft) SBC\-4 revision 14.
2775 .PP
2776 The default action is to decode the response into one LBA status descriptor
2777-per line output to stdout. The descriptor LBA is output in hex (prefixed
2778-by '0x') and the number of blocks is output in decimal followed by the
2779-provisioning status and additional status in decimal. The provisioning status
2780-can be in the range 0 to 15 of which only 0 (mapped or unknown), 1 (unmapped),
2781-2 (anchored), 3 (mapped) and 4 (unknown) are used currently. The amount of
2782-output can be reduced by the \fI\-\-brief\fR option.
2783+per line then output a header and the status descriptors to stdout. The
2784+descriptor LBA is output in hex (prefixed by '0x') and the number of blocks
2785+is output in decimal followed by the provisioning status and additional status
2786+in decimal. The provisioning status can be in the range 0 to 15 of which only
2787+0 (mapped or unknown), 1 (unmapped), 2 (anchored), 3 (mapped) and 4 (unknown)
2788+are used currently. The amount of output can be reduced by the
2789+\fI\-\-brief\fR option.
2790+.PP
2791+Rather than send this SCSI command to \fIDEVICE\fR, if the \fI\-\-inhex=FN\fR
2792+option is given, then the contents of the file named \fIFN\fR are decoded
2793+as ASCII hex and then processed if it was the response of this command.
2794 .SH OPTIONS
2795 Arguments to long options are mandatory for short options as well.
2796 .TP
2797@@ -65,6 +71,13 @@ output the usage message then exit.
2798 \fB\-H\fR, \fB\-\-hex\fR
2799 output response to this command in ASCII hex.
2800 .TP
2801+\fB\-i\fR, \fB\-\-inhex\fR=\fIFN\fR
2802+where \fIFN\fR is a filename whose contents are assumed to be ASCII
2803+hexadecimal bytes. See the "FORMAT OF FILES CONTAINING ASCII HEX" section
2804+in the sg3_utils manpage for more information. If \fIDEVICE\fR is also
2805+given then it is ignored. If the \fI\-\-raw\fR option is also given then
2806+the contents of \fIFN\fR are treated as binary.
2807+.TP
2808 \fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR
2809 where \fILBA\fR is the starting Logical Block Address (LBA) to check the
2810 provisioning status for. Note that the \fIDEVICE\fR chooses how many
2811@@ -77,7 +90,9 @@ enough space for the response header and one LBA status descriptor.
2812 \fILEN\fR should be 8 plus a multiple of 16 (e.g. 24, 40, and 56 are suitable).
2813 .TP
2814 \fB\-r\fR, \fB\-\-raw\fR
2815-output response in binary (to stdout).
2816+output response in binary (to stdout) unless the \fI\-\-inhex=FN\fR option
2817+is also given. In that case the input file name (\fIFN\fR) is decoded as
2818+binary (and the output is _not_ in binary).
2819 .TP
2820 \fB\-R\fR, \fB\-\-readonly\fR
2821 open the \fIDEVICE\fR read\-only (e.g. in Unix with the O_RDONLY flag).
2822@@ -126,9 +141,9 @@ Written by Douglas Gilbert.
2823 .SH "REPORTING BUGS"
2824 Report bugs to <dgilbert at interlog dot com>.
2825 .SH COPYRIGHT
2826-Copyright \(co 2009\-2018 Douglas Gilbert
2827+Copyright \(co 2009\-2019 Douglas Gilbert
2828 .br
2829 This software is distributed under a FreeBSD license. There is NO
2830 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2831 .SH "SEE ALSO"
2832-.B sg_write_same(8), sg_unmap(8)
2833+.B sg_write_same(8), sg_unmap(8), sg3_utils(8)
2834diff --git a/doc/sg_logs.8 b/doc/sg_logs.8
2835index af07a2a..216f8d7 100644
2836--- a/doc/sg_logs.8
2837+++ b/doc/sg_logs.8
2838@@ -1,4 +1,4 @@
2839-.TH SG_LOGS "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS
2840+.TH SG_LOGS "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2841 .SH NAME
2842 sg_logs \- access log pages with SCSI LOG SENSE command
2843 .SH SYNOPSIS
2844@@ -161,7 +161,11 @@ treated as binary.
2845 lists the names of all logs sense pages supported by this device. This is
2846 done by reading the "supported log pages" log page. When used
2847 twice (e.g. '\-ll') lists the names of all logs sense pages and subpages
2848-supported by this device. There is a list of common log page codes below.
2849+supported by this device, excluding pages whose subpage number is
2850+0xff (apart from page 0x0,0xff). When used three times then all supported
2851+pages and subpages reported by the device are list. So the page/subpage
2852+names and not thrie content is shown with this option. There is a list of
2853+common log page codes below.
2854 .TP
2855 \fB\-m\fR, \fB\-\-maxlen\fR=\fILEN\fR
2856 sets the "allocation length" field in the LOG SENSE cdb. The is the maximum
2857@@ -279,14 +283,14 @@ outputs the transport ('Protocol specific port') log page. Equivalent to
2858 setting '\-\-page=18h'.
2859 .TP
2860 \fB\-M\fR, \fB\-\-vendor\fR=\fIVP\fR
2861-where \fIVP\fR is a vendor (e.g. "sea" for Seagate) or product (group)
2862-acronym (e.g. "lto5" for the 5th generation LTO (tape) consortium). Either
2863-the whole log page is vendor specific (e.g. page numbers 0x30 to 0x3f) or
2864-part of a T10 defined log page is vendor specific. For example SPC\-5
2865-defines parameter code 0x0 of page 0x2f (the Informational Exceptions log
2866-page) and states that the remaining parameter codes (i.e. 0x1 to 0xffff)
2867-are vendor specific. Using a \fIVP\fR of "xxx" will list the available
2868-acronyms.
2869+where \fIVP\fR is a vendor/manufacturer (e.g. "sea" for Seagate) or
2870+product (group) acronym (e.g. "lto5" for the 5th generation LTO (tape)
2871+consortium). Either the whole log page is vendor specific (e.g. page
2872+numbers 0x30 to 0x3f) or part of a T10 defined log page is vendor specific.
2873+For example SPC\-5 defines parameter code 0x0 of page 0x2f (the Informational
2874+Exceptions log page) and states that the remaining parameter codes (i.e. 0x1
2875+to 0xffff) are vendor specific. Using a \fIVP\fR of "xxx" will list the
2876+available acronyms.
2877 .br
2878 If this option is used with \fI\-\-page=PG\fR and \fIPG\fR is an acronym
2879 then this option is ignored. If \fIPG\fR is a number (e.g. 0xc0) then
2880@@ -478,7 +482,7 @@ Written by Douglas Gilbert
2881 .SH "REPORTING BUGS"
2882 Report bugs to <dgilbert at interlog dot com>.
2883 .SH COPYRIGHT
2884-Copyright \(co 2002\-2018 Douglas Gilbert
2885+Copyright \(co 2002\-2020 Douglas Gilbert
2886 .br
2887 This software is distributed under the GPL version 2. There is NO
2888 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2889diff --git a/doc/sg_luns.8 b/doc/sg_luns.8
2890index f27ed6f..8292772 100644
2891--- a/doc/sg_luns.8
2892+++ b/doc/sg_luns.8
2893@@ -1,4 +1,4 @@
2894-.TH SG_LUNS "8" "June 2018" "sg3_utils\-1.43" SG3_UTILS
2895+.TH SG_LUNS "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2896 .SH NAME
2897 sg_luns \- send SCSI REPORT LUNS command or decode given LUN
2898 .SH SYNOPSIS
2899@@ -20,7 +20,7 @@ should be a list of LUNs ("a LUN inventory") for the I_T nexus associated
2900 with the \fIDEVICE\fR. Roughly speaking that is all LUNs that share the
2901 target device that the REPORT LUNS command is sent through. This command
2902 is defined in the SPC\-3 and SPC\-4 SCSI standards and its support is
2903-mandatory. The most recent draft if SPC\5 revision 9.
2904+mandatory. The most recent draft if SPC\-6 revision 1.
2905 .PP
2906 When the \fI\-\-test=ALUN\fR option is given (the second form in the
2907 SYNOPSIS), then the \fIALUN\fR value is decoded as outlined in various
2908@@ -311,7 +311,7 @@ Written by Douglas Gilbert.
2909 .SH "REPORTING BUGS"
2910 Report bugs to <dgilbert at interlog dot com>.
2911 .SH COPYRIGHT
2912-Copyright \(co 2004\-2018 Douglas Gilbert
2913+Copyright \(co 2004\-2020 Douglas Gilbert
2914 .br
2915 This software is distributed under a FreeBSD license. There is NO
2916 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2917diff --git a/doc/sg_modes.8 b/doc/sg_modes.8
2918index ed2d2e3..d68bc40 100644
2919--- a/doc/sg_modes.8
2920+++ b/doc/sg_modes.8
2921@@ -1,4 +1,4 @@
2922-.TH SG_MODES "8" "September 2018" "sg3_utils\-1.43" SG3_UTILS
2923+.TH SG_MODES "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2924 .SH NAME
2925 sg_modes \- reads mode pages with SCSI MODE SENSE command
2926 .SH SYNOPSIS
2927@@ -22,7 +22,7 @@ outputs the response. There is a 6 byte and 10 byte (cdb) variant of the
2928 MODE SENSE command, this utility defaults to the 10 byte variant. The SPC\-4
2929 standard (and SPC\-5 drafts) include a note stating that implementers should
2930 migrate away from the SCSI MODE SELECT(6) and MODE SENSE(6) commands in
2931-favour of the 10 byte variants (e.g. MODE SENSE(10)).
2932+favour of the 10 byte variants (e.g. MODE SENSE(10)).
2933 .PP
2934 This utility decodes mode page headers and block descriptors but outputs
2935 the contents of each mode page in hex. It also has no facility to change
2936@@ -82,6 +82,9 @@ descriptors are present in the response or not, they are not output.
2937 examine each mode page in the range 0 through to 62 (inclusive).
2938 If some response is given then print out the mode page name or
2939 number (in hex) if the name is not known.
2940+.br
2941+The sdparm utility which lists mode and VPD pages also has a \fB\-\-examine\fR
2942+option will similar functionility.
2943 .TP
2944 \fB\-f\fR, \fB\-\-flexible\fR
2945 Some devices, bridges and/or drivers attempt crude translations between
2946@@ -298,7 +301,7 @@ Written by Douglas Gilbert
2947 .SH "REPORTING BUGS"
2948 Report bugs to <dgilbert at interlog dot com>.
2949 .SH COPYRIGHT
2950-Copyright \(co 2000\-2018 Douglas Gilbert
2951+Copyright \(co 2000\-2020 Douglas Gilbert
2952 .br
2953 This software is distributed under the GPL version 2. There is NO
2954 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2955diff --git a/doc/sg_raw.8 b/doc/sg_raw.8
2956index b6bdbcc..3e01bd0 100644
2957--- a/doc/sg_raw.8
2958+++ b/doc/sg_raw.8
2959@@ -1,4 +1,4 @@
2960-.TH SG_RAW "8" "May 2018" "sg3_utils\-1.43" SG3_UTILS
2961+.TH SG_RAW "8" "January 2019" "sg3_utils\-1.45" SG3_UTILS
2962 .SH NAME
2963 sg_raw \- send arbitrary SCSI command to a device
2964 .SH SYNOPSIS
2965@@ -193,7 +193,9 @@ bsg device. Note that data is being read from "urandom.bin" and sent
2966 to the device (data\-out) while resulting data (data\-in) is placed
2967 in the "out.bin" file. Also note the length of both is 512 bytes
2968 which corresponds to the transfer length of 1 (block) in the cdb (i.e.
2969-the second last byte).
2970+the second last byte). urandom.bin can be produced like this:
2971+.br
2972+dd if=/dev/urandom bs=512 count=1 of=urandom.bin
2973 .TP
2974 sg_raw.exe PhysicalDrive1 a1 0c 0e 00 00 00 00 00 00 e0 00 00
2975 This example is from Windows and shows a ATA STANDBY IMMEDIATE command
2976@@ -208,9 +210,9 @@ the sg3_utils(8) man page.
2977 .SH AUTHOR
2978 Written by Ingo van Lil
2979 .SH "REPORTING BUGS"
2980-Report bugs to <inguin at gmx dot de>.
2981+Report bugs to <inguin at gmx dot de> or to <dgilbert at interlog dot com>.
2982 .SH COPYRIGHT
2983-Copyright \(co 2001\-2018 Ingo van Lil
2984+Copyright \(co 2001\-2019 Ingo van Lil
2985 .br
2986 This software is distributed under the GPL version 2. There is NO
2987 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
2988diff --git a/doc/sg_read.8 b/doc/sg_read.8
2989index 3f01134..c12dd57 100644
2990--- a/doc/sg_read.8
2991+++ b/doc/sg_read.8
2992@@ -1,4 +1,4 @@
2993-.TH SG_READ "8" "November 2012" "sg3_utils\-1.35" SG3_UTILS
2994+.TH SG_READ "8" "September 2019" "sg3_utils\-1.45" SG3_UTILS
2995 .SH NAME
2996 sg_read \- read multiple blocks of data, optionally with SCSI READ commands
2997 .SH SYNOPSIS
2998@@ -29,6 +29,11 @@ are issued. "Zero block" means "do nothing" for SCSI READ 10, 12 and
2999 16 byte commands (but not for the 6 byte variant). In practice "zero
3000 block" SCSI READ commands have low latency and so are one way to measure
3001 SCSI command overhead.
3002+.PP
3003+Please note: this is a very old utility that uses 32 bit integers for
3004+disk LBAs and the count. Hence it will not be able to address beyond
3005+2 Terabytes on a disk with logical blocks that are 512 bytes long.
3006+Alternatives are the sg_dd and ddpt utilities.
3007 .SH OPTIONS
3008 .TP
3009 \fBblk_sgio\fR=0 | 1
3010@@ -171,14 +176,17 @@ Written by Douglas Gilbert.
3011 .SH "REPORTING BUGS"
3012 Report bugs to <dgilbert at interlog dot com>.
3013 .SH COPYRIGHT
3014-Copyright \(co 2000\-2012 Douglas Gilbert
3015+Copyright \(co 2000\-2019 Douglas Gilbert
3016 .br
3017 This software is distributed under the GPL version 2. There is NO
3018 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3019 .SH "SEE ALSO"
3020 To time streaming media read or write time see
3021 .B sg_dd
3022-is in the sg3_utils package. The lmbench package contains
3023+is in the sg3_utils package and
3024+.B ddpt
3025+in a package of the same name.
3026+The lmbench package contains
3027 .B lmdd
3028 which is also interesting.
3029 .B raw(8), dd(1)
3030diff --git a/doc/sg_read_buffer.8 b/doc/sg_read_buffer.8
3031index fd9296c..d1aed04 100644
3032--- a/doc/sg_read_buffer.8
3033+++ b/doc/sg_read_buffer.8
3034@@ -1,11 +1,12 @@
3035-.TH SG_READ_BUFFER "8" "May 2014" "sg3_utils\-1.39" SG3_UTILS
3036+.TH SG_READ_BUFFER "8" "May 2019" "sg3_utils\-1.45" SG3_UTILS
3037 .SH NAME
3038 sg_read_buffer \- send SCSI READ BUFFER command
3039 .SH SYNOPSIS
3040 .B sg_read_buffer
3041-[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-id=ID\fR] [\fI\-\-length=LEN\fR]
3042-[\fI\-\-mode=MO\fR] [\fI\-\-offset=OFF\fR] [\fI\-\-raw\fR]
3043-[\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
3044+[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-id=ID\fR] [\fI\-\-inhex=FN\fR]
3045+[\fI\-\-length=LEN\fR] [\fI\-\-mode=MO\fR] [\fI\-\-offset=OFF\fR]
3046+[\fI\-\-raw\fR] [\fI\-\-readonly\fR] [\fI\-\-specific=MS\fR]
3047+[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
3048 .SH DESCRIPTION
3049 .\" Add any additional description here
3050 .PP
3051@@ -15,6 +16,12 @@ it in binary to stdout. If a response is received for a "descriptor"
3052 mode then, in the absence of \fI\-\-hex\fR and \fI\-\-raw\fR, it is
3053 decoded. Response for non\-descriptor modes are output in hexadecimal
3054 unless the \fI\-\-raw\fR option is given.
3055+.PP
3056+This utility may be called without a \fIDEVICE\fR but with a
3057+\fI\-\-inhex=FN\fR option instead. \fIFN\fR is expected to be a file
3058+name (or '\-' for stdin). The contents of the file (or stdin stream)
3059+is assumed to be hexadecimal (or binary) data that represents a SCSI
3060+READ BUFFER command response and is decoded as such.
3061 .SH OPTIONS
3062 Arguments to long options are mandatory for short options as well.
3063 .TP
3064@@ -31,6 +38,16 @@ right of each line.
3065 this option sets the buffer id field in the cdb. \fIID\fR is a value between
3066 0 (default) and 255 inclusive.
3067 .TP
3068+\fB\-I\fR, \fB\-\-inhex\fR=\fIFN\fR
3069+\fIFN\fR is expected to be a file name (or '\-' for stdin) which contains
3070+ASCII hexadecimal or binary representing a READ BUFFER response. If known
3071+this utility will then decode that response. It is preferable to also
3072+supply the \fI\-\-mode=MO\fR and \fI\-\-specific=MS\fR options, since these
3073+are not present in the response. The hexadecimal should be arranged as 1 or
3074+2 digits representing a byte each of which is whitespace or comma separated.
3075+Anything from and including a hash mark to the end of line is ignored. If the
3076+\fI\-\-raw\fR option is also given then \fIFN\fR is treated as binary.
3077+.TP
3078 \fB\-l\fR, \fB\-\-length\fR=\fILEN\fR
3079 where \fILEN\fR is the length, in bytes, that is placed in the "allocation
3080 length" field in the cdb. The default value is 4 (bytes). The device may
3081@@ -54,6 +71,10 @@ if a response is received then it is sent in binary to stdout.
3082 open the \fIDEVICE\fR read\-only (e.g. in Unix with the O_RDONLY flag).
3083 The default is to open it read\-write.
3084 .TP
3085+\fB\-S\fR, \fB\-\-specific\fR=\fIMS\fR
3086+this option sets the mode specific field in the cdb. \fIMS\fR is a value
3087+between 0 and 7 as this is a 3 bit field.
3088+.TP
3089 \fB\-v\fR, \fB\-\-verbose\fR
3090 increase the level of verbosity, (i.e. debug output).
3091 .TP
3092@@ -87,6 +108,9 @@ Echo buffer descriptor: yields 4 bytes of which the last (lowest) 13 bits
3093 represent the echo buffer capacity. The maximum echo buffer size is 4096
3094 bytes.
3095 .TP
3096+rd_microc_st [15, 0xf]
3097+Read microcode status. Added in spc5r20 .
3098+.TP
3099 en_ex [26, 0x1a]
3100 Enable expander communications protocol and Echo buffer. Made obsolete in
3101 SPC\-4.
3102@@ -105,7 +129,7 @@ Written by Luben Tuikov and Douglas Gilbert.
3103 .SH "REPORTING BUGS"
3104 Report bugs to <dgilbert at interlog dot com>.
3105 .SH COPYRIGHT
3106-Copyright \(co 2006\-2014 Luben Tuikov and Douglas Gilbert
3107+Copyright \(co 2006\-2019 Luben Tuikov and Douglas Gilbert
3108 .br
3109 This software is distributed under a FreeBSD license. There is NO
3110 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3111diff --git a/doc/sg_readcap.8 b/doc/sg_readcap.8
3112index ffc8724..fa2afd3 100644
3113--- a/doc/sg_readcap.8
3114+++ b/doc/sg_readcap.8
3115@@ -1,15 +1,17 @@
3116-.TH SG_READCAP "8" "May 2018" "sg3_utils\-1.43" SG3_UTILS
3117+.TH SG_READCAP "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
3118 .SH NAME
3119 sg_readcap \- send SCSI READ CAPACITY command
3120 .SH SYNOPSIS
3121 .B sg_readcap
3122 [\fI\-\-16\fR] [\fI\-\-brief\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]
3123 [\fI\-\-lba=LBA\fR] [\fI\-\-long\fR] [\fI\-\-pmi\fR] [\fI\-\-raw\fR]
3124-[\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
3125+[\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-zbc\fR]
3126+\fIDEVICE\fR
3127 .PP
3128 .B sg_readcap
3129 [\fI\-16\fR] [\fI\-b\fR] [\fI\-h\fR] [\fI\-H\fR] [\fI\-lba=LBA\fR]
3130-[\fI\-pmi\fR] [\fI\-r\fR] [\fI\-R\fR] [\fI\-v\fR] [\fI\-V\fR] \fIDEVICE\fR
3131+[\fI\-pmi\fR] [\fI\-r\fR] [\fI\-R\fR] [\fI\-v\fR] [\fI\-V\fR] [\fI\-z\fR]
3132+\fIDEVICE\fR
3133 .SH DESCRIPTION
3134 .\" Add any additional description here
3135 .PP
3136@@ -104,6 +106,10 @@ increase level of verbosity. Can be used multiple times.
3137 .TP
3138 \fB\-V\fR, \fB\-\-version\fR
3139 outputs version string then exits.
3140+.TP
3141+\fB\-z\fR, \fB\-\-zbc\fR
3142+additionally prints out the extra ZBC field (RC_BASIS) in the READ CAPACITY
3143+response. Using the option implicitly sets the \fI\-\-16\fR option.
3144 .SH NOTES
3145 The response to READ CAPACITY(16) contains a LBPRZ bit in the SBC\-3
3146 standard (ANSI INCITS 514\-2014). There was also a LBPRZ bit with the same
3147@@ -171,6 +177,9 @@ and '\-vvv' are also accepted yielding greater verbosity.
3148 .TP
3149 \fB\-V\fR
3150 outputs version string then exits.
3151+.TP
3152+\fB\-R\fR
3153+Equivalent to \fI\-\-zbc\fR in the main description.
3154 .SH ENVIRONMENT VARIABLES
3155 Since sg3_utils version 1.23 the environment variable SG3_UTILS_OLD_OPTS
3156 can be given. When it is present this utility will expect the older command
3157@@ -179,7 +188,7 @@ using \fI\-\-old\fR (or \fI\-O\fR) as the first command line option.
3158 .SH AUTHORS
3159 Written by Douglas Gilbert
3160 .SH COPYRIGHT
3161-Copyright \(co 1999\-2018 Douglas Gilbert
3162+Copyright \(co 1999\-2020 Douglas Gilbert
3163 .br
3164 This software is distributed under the GPL version 2. There is NO
3165 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3166diff --git a/doc/sg_reassign.8 b/doc/sg_reassign.8
3167index ecacc7f..3ad0f8a 100644
3168--- a/doc/sg_reassign.8
3169+++ b/doc/sg_reassign.8
3170@@ -1,4 +1,4 @@
3171-.TH SG_REASSIGN "8" "October 2017" "sg3_utils\-1.43" SG3_UTILS
3172+.TH SG_REASSIGN "8" "October 2019" "sg3_utils\-1.45" SG3_UTILS
3173 .SH NAME
3174 sg_reassign \- send SCSI REASSIGN BLOCKS command
3175 .SH SYNOPSIS
3176@@ -142,7 +142,7 @@ Written by Douglas Gilbert.
3177 .SH "REPORTING BUGS"
3178 Report bugs to <dgilbert at interlog dot com>.
3179 .SH COPYRIGHT
3180-Copyright \(co 2005\-2017 Douglas Gilbert
3181+Copyright \(co 2005\-2019 Douglas Gilbert
3182 .br
3183 This software is distributed under a FreeBSD license. There is NO
3184 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3185diff --git a/doc/sg_rep_zones.8 b/doc/sg_rep_zones.8
3186index df734d0..29fecd1 100644
3187--- a/doc/sg_rep_zones.8
3188+++ b/doc/sg_rep_zones.8
3189@@ -1,17 +1,18 @@
3190-.TH SG_REP_ZONES "8" "February 2016" "sg3_utils\-1.42" SG3_UTILS
3191+.TH SG_REP_ZONES "8" "February 2020" "sg3_utils\-1.45" SG3_UTILS
3192 .SH NAME
3193 sg_rep_zones \- send SCSI REPORT ZONES command
3194 .SH SYNOPSIS
3195 .B sg_rep_zones
3196-[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR]
3197-[\fI\-\-readonly\fR] [\fI\-\-report=OPT\fR] [\fI\-\-start=LBA\fR]
3198-[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
3199+[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-num=NUM\fR]
3200+[\fI\-\-raw\fR] [\fI\-\-readonly\fR] [\fI\-\-report=OPT\fR]
3201+[\fI\-\-start=LBA\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-wp\fR]
3202+\fIDEVICE\fR
3203 .SH DESCRIPTION
3204 .\" Add any additional description here
3205 .PP
3206 Sends a SCSI REPORT ZONES command to \fIDEVICE\fR and outputs the data
3207 returned. This command is found in the ZBC draft standard, revision
3208-4c (zbc\-r04c.pdf).
3209+5 (zbc\-r05.pdf).
3210 .SH OPTIONS
3211 Arguments to long options are mandatory for short options as well.
3212 .TP
3213@@ -30,6 +31,11 @@ where \fILEN\fR is the (maximum) response length in bytes. It is placed in
3214 the cdb's "allocation length" field. If not given (or \fILEN\fR is zero)
3215 then 8192 is used. The maximum allowed value of \fILEN\fR is 1048576.
3216 .TP
3217+\fB\-n\fR, \fB\-\-num\fR=\fINUM\fR
3218+where \fINUM\fR is the (maximum) number of zone descriptors to print out.
3219+The default value is zero which is taken to mean print out all zone
3220+descriptors returned by the REPORT ZONES command.
3221+.TP
3222 \fB\-p\fR, \fB\-\-partial\fR
3223 set the PARTIAL bit in the cdb.
3224 .TP
3225@@ -62,6 +68,11 @@ prefixed with '0x' or has a trailing 'h' which indicate hexadecimal.
3226 increase the level of verbosity, (i.e. debug output).
3227 .TP
3228 \fB\-V\fR, \fB\-\-version\fR
3229+print the write pointer (in hex) only. In the absence of errors, then a hex
3230+LBA will be printed on each line, one line for each zone. Can be usefully
3231+combined with the \fI\-\-num=NUM\fR and \fI\-\-start=LBA\fR options.
3232+.TP
3233+\fB\-w\fR, \fB\-\-wp\fR
3234 print the version string and then exit.
3235 .SH EXIT STATUS
3236 The exit status of sg_rep_zones is 0 when it is successful. Otherwise see
3237@@ -71,7 +82,7 @@ Written by Douglas Gilbert.
3238 .SH "REPORTING BUGS"
3239 Report bugs to <dgilbert at interlog dot com>.
3240 .SH COPYRIGHT
3241-Copyright \(co 2014\-2016 Douglas Gilbert
3242+Copyright \(co 2014\-2020 Douglas Gilbert
3243 .br
3244 This software is distributed under a FreeBSD license. There is NO
3245 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3246diff --git a/doc/sg_requests.8 b/doc/sg_requests.8
3247index 5372deb..81db55f 100644
3248--- a/doc/sg_requests.8
3249+++ b/doc/sg_requests.8
3250@@ -1,12 +1,12 @@
3251-.TH SG_REQUESTS "8" "February 2016" "sg3_utils\-1.43" SG3_UTILS
3252+.TH SG_REQUESTS "8" "July 2018" "sg3_utils\-1.45" SG3_UTILS
3253 .SH NAME
3254 sg_requests \- send one or more SCSI REQUEST SENSE commands
3255 .SH SYNOPSIS
3256 .B sg_requests
3257-[\fI\-\-desc\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-maxlen=LEN\fR]
3258-[\fI\-\-num=NUM\fR] [\fI\-\-number=NUM\fR] [\fI\-\-progress\fR]
3259-[\fI\-\-raw\fR] [\fI\-\-status\fR] [\fI\-\-time\fR] [\fI\-\-verbose\fR]
3260-[\fI\-\-version\fR] \fIDEVICE\fR
3261+[\fI\-\-desc\fR] [\fI\-\-error\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]
3262+[\fI\-\-maxlen=LEN\fR] [\fI\-\-num=NUM\fR] [\fI\-\-number=NUM\fR]
3263+[\fI\-\-progress\fR] [\fI\-\-raw\fR] [\fI\-\-status\fR] [\fI\-\-time\fR]
3264+[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
3265 .SH DESCRIPTION
3266 .\" Add any additional description here
3267 .PP
3268@@ -28,6 +28,16 @@ and later). If the device is pre SPC\-3 then setting a bit in a reserved
3269 field may cause a check condition status with an illegal request sense key,
3270 but will most likely be ignored.
3271 .TP
3272+\fB\-e\fR, \fB\-\-error\fR
3273+when used once it changes the REQUEST SENSE opcode from 0x3 to 0xff which
3274+should be rejected by the \fIDEVICE\fR. There is a small chance that the
3275+device vendor has implemented a vendor specific command at that opcode (0xff).
3276+When used twice the pass-through call to send the SCSI command is bypassed.
3277+The idea here is to measure the user space overhead of this package's
3278+library to set up and process the response of a SCSI command. This option
3279+will be typically used with the \fI\-\-num=NUM\fR and \fI\-\-time\fR
3280+options where \fINUM\fR is a large number (e.g. 1000000).
3281+.TP
3282 \fB\-h\fR, \fB\-\-help\fR
3283 output the usage message then exit.
3284 .TP
3285@@ -47,7 +57,7 @@ is reached or an error occurs. The default value for \fINUM\fR is 1 .
3286 same action as \fI\-\-num=NUM\fR. Added for compatibility with sg_turs.
3287 .TP
3288 \fB\-p\fR, \fB\-\-progress\fR
3289-show progress indication (a percentage) if available. If \fI\-\-number=NUM\fR
3290+show progress indication (a percentage) if available. If \fI\-\-num=NUM\fR
3291 is given, \fINUM\fR is greater than 1 and an initial progress indication
3292 was detected then this utility waits 30 seconds before subsequent checks.
3293 Exits when \fINUM\fR is reached or there are no more progress indications.
3294@@ -120,7 +130,7 @@ Written by Douglas Gilbert.
3295 .SH "REPORTING BUGS"
3296 Report bugs to <dgilbert at interlog dot com>.
3297 .SH COPYRIGHT
3298-Copyright \(co 2004\-2016 Douglas Gilbert
3299+Copyright \(co 2004\-2017 Douglas Gilbert
3300 .br
3301 This software is distributed under a FreeBSD license. There is NO
3302 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3303diff --git a/doc/sg_sat_identify.8 b/doc/sg_sat_identify.8
3304index aee3467..e811614 100644
3305--- a/doc/sg_sat_identify.8
3306+++ b/doc/sg_sat_identify.8
3307@@ -1,4 +1,4 @@
3308-.TH SG_SAT_IDENTIFY "8" "January 2018" "sg3_utils\-1.43" SG3_UTILS
3309+.TH SG_SAT_IDENTIFY "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
3310 .SH NAME
3311 sg_sat_identify \- send ATA IDENTIFY DEVICE command via SCSI to ATA
3312 Translation (SAT) layer
3313@@ -23,7 +23,7 @@ www.t10.org) defines two SCSI "ATA PASS\-THROUGH" commands: one using a 16
3314 byte "cdb" and the other with a 12 byte cdb. This utility defaults to using
3315 the 16 byte cdb variant. SAT\-4 revision 5 added a SCSI "ATA
3316 PASS\-THROUGH(32)" command. SAT\-2 and SAT\-3 are now also standards: SAT\-2
3317-ANSI INCITS 465\-2010 and SAT\3 ANSI INCITS 517-2015 . The SAT\-4 project
3318+ANSI INCITS 465\-2010 and SAT\-3 ANSI INCITS 517-2015 . The SAT\-4 project
3319 is near standardization and the most recent draft is sat4r06.pdf .
3320 .SH OPTIONS
3321 Arguments to long options are mandatory for short options as well.
3322@@ -159,7 +159,7 @@ Written by Douglas Gilbert
3323 .SH "REPORTING BUGS"
3324 Report bugs to <dgilbert at interlog dot com>.
3325 .SH COPYRIGHT
3326-Copyright \(co 2006\-2018 Douglas Gilbert
3327+Copyright \(co 2006\-2020 Douglas Gilbert
3328 .br
3329 This software is distributed under a FreeBSD license. There is NO
3330 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3331diff --git a/doc/sg_scan.8.win32 b/doc/sg_scan.8.win32
3332index b87888a..84cc38b 100644
3333--- a/doc/sg_scan.8.win32
3334+++ b/doc/sg_scan.8.win32
3335@@ -1,4 +1,4 @@
3336-.TH SG_SCAN "8" "August 2014" "sg3_utils\-1.40" SG3_UTILS
3337+.TH SG_SCAN "8" "November 2018" "sg3_utils\-1.45" SG3_UTILS
3338 .SH NAME
3339 sg_scan \- scan storage devices and map to volume names
3340 .SH SYNOPSIS
3341@@ -164,7 +164,7 @@ the sg3_utils(8) man page.
3342 .SH AUTHORS
3343 Written by D. Gilbert
3344 .SH COPYRIGHT
3345-Copyright \(co 2006\-2012 Douglas Gilbert
3346+Copyright \(co 2006\-2018 Douglas Gilbert
3347 .br
3348 This software is distributed under a FreeBSD license. There is NO
3349 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3350diff --git a/doc/sg_ses.8 b/doc/sg_ses.8
3351index 573c92b..d953e55 100644
3352--- a/doc/sg_ses.8
3353+++ b/doc/sg_ses.8
3354@@ -1,4 +1,4 @@
3355-.TH SG_SES "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS
3356+.TH SG_SES "8" "February 2020" "sg3_utils\-1.45" SG3_UTILS
3357 .SH NAME
3358 sg_ses \- access a SCSI Enclosure Services (SES) device
3359 .SH SYNOPSIS
3360@@ -11,7 +11,7 @@ sg_ses \- access a SCSI Enclosure Services (SES) device
3361 [\fI\-\-status\fR] [\fI\-\-verbose\fR] [\fI\-\-warn\fR] \fIDEVICE\fR
3362 .PP
3363 .B sg_ses
3364-[\fI\-\-byte1=B1\fR] [\fI\-\-clear=STR\fR] [\fI\-\-control\fR]
3365+\fI\-\-control\fR [\fI\-\-byte1=B1\fR] [\fI\-\-clear=STR\fR]
3366 [\fI\-\-data=H,H...\fR] [\fI\-\-data=@FN\fR] [\fI\-\-descriptor=DES\fR]
3367 [\fI\-\-dev\-slot\-num=SN\fR] [\fI\-\-index=IIA\fR | \fI\-\-index=TIA,II\fR]
3368 [\fI\-\-mask\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-nickname=SEN\fR]
3369@@ -22,6 +22,10 @@ sg_ses \- access a SCSI Enclosure Services (SES) device
3370 .B sg_ses
3371 \fI\-\-data=@FN\fR \fI\-\-status\fR [\fI\-\-raw\fR \fI\-\-raw\fR]
3372 [<all options from first form>]
3373+.br
3374+.B sg_ses
3375+\fI\-\-inhex=FN\fR \fI\-\-status\fR [\fI\-\-raw\fR \fI\-\-raw\fR]
3376+[<all options from first form>]
3377 .PP
3378 .B sg_ses
3379 [\fI\-\-enumerate\fR] [\fI\-\-index=IIA\fR] [\fI\-\-list\fR] [\fI\-\-help\fR]
3380@@ -58,11 +62,12 @@ enclosure (e.g. requesting the "ident" (locate) LED to flash on a disk
3381 carrier in an array) is typically done using a read\-modify\-write cycle.
3382 See the section on CHANGING STATE below.
3383 .PP
3384-The third form in the synopsis shows the options for decoding the contents
3385-of a file that holds a hexadecimal or binary representation of a SES
3386-dpage response. Typically an earlier invocation of the first form of this
3387-utility with the '\-HHHH' option would have generated that file. Since no
3388-SCSI commands are sent, the \fIDEVICE\fR argument if given will be ignored.
3389+The third form in the synopsis has two equivalent invocations shown. They
3390+decode the contents of a file (named \fIFN\fR) that holds a hexadecimal or
3391+binary representation of one, or many, SES dpage responses. Typically an
3392+earlier invocation of the first form of this utility with the '\-HHHH'
3393+option would have generated that file. Since no SCSI commands are sent, the
3394+\fIDEVICE\fR argument if given will be ignored.
3395 .PP
3396 The last form in the synopsis shows the options for providing command line
3397 help (i.e. usage information), listing out dpage and field information tables
3398@@ -233,6 +238,14 @@ option or one of the \fI\-\-clear=STR\fR, \fI\-\-get=STR\fR or
3399 \fI\-\-set=STR\fR options. To enumerate the available Element type
3400 abbreviations use the \fI\-\-enumerate\fR option.
3401 .TP
3402+\fB\-X\fR, \fB\-\-inhex\fR=\fIFN\fR
3403+where \fIFN\fR is a filename. It has the equivalent action of the
3404+\fI\-\-data=@FN\fR option. If \fIFN\fR is '\-' then stdin is read. This
3405+option has been given for compatibility with other utilities in this
3406+package that use \fI\-\-inhex=FN\fR (or \fI\-\-in=FN\fR) is a similar
3407+way. See the "FORMAT OF FILES CONTAINING ASCII HEX" section in the
3408+sg3_utils manpage for more information.
3409+.TP
3410 \fB\-i\fR, \fB\-\-inner\-hex\fR
3411 the outer levels of a status dpage are decoded and printed out but the
3412 innermost level (e.g. the Element Status Descriptor) is output in hex. Also
3413@@ -430,10 +443,10 @@ Wherever an individual index is applicable, it can be replaced by an
3414 individual index range. It has the form: <first_ii>\-<last_ii>. For
3415 example: '3\-5' will select individual indexes 3, 4 and 5 .
3416 .PP
3417-To cope with vendor specific Element types (which should be in the range 128
3418-to 255) the Element type can be given as a number with a leading underscore.
3419-For example these are equivalent: \fI\-\-index=arr\fR and
3420-\fI\-\-index=_23\fR since the Array Device Slot Element type value is 23.
3421+To cope with vendor specific Element types (whose type codes should be in
3422+the range 128 to 255) the Element type code can be given as a number with
3423+a leading underscore. For example these are equivalent: \fI\-\-index=arr\fR
3424+and \fI\-\-index=_23\fR since the Array Device Slot Element type code is 23.
3425 Also \fI\-\-index=ps1\fR and \fI\-\-index=_2_1\fR are equivalent.
3426 .PP
3427 Another example: if the first type header in the Configuration dpage has
3428@@ -746,7 +759,7 @@ Written by Douglas Gilbert.
3429 .SH "REPORTING BUGS"
3430 Report bugs to <dgilbert at interlog dot com>.
3431 .SH COPYRIGHT
3432-Copyright \(co 2004\-2018 Douglas Gilbert
3433+Copyright \(co 2004\-2020 Douglas Gilbert
3434 .br
3435 This software is distributed under a FreeBSD license. There is NO
3436 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3437diff --git a/doc/sg_turs.8 b/doc/sg_turs.8
3438index 66e6ad3..8cf909c 100644
3439--- a/doc/sg_turs.8
3440+++ b/doc/sg_turs.8
3441@@ -1,9 +1,9 @@
3442-.TH SG_TURS "8" "March 2018" "sg3_utils\-1.43" SG3_UTILS
3443+.TH SG_TURS "8" "September 2019" "sg3_utils\-1.45" SG3_UTILS
3444 .SH NAME
3445 sg_turs \- send one or more SCSI TEST UNIT READY commands
3446 .SH SYNOPSIS
3447 .B sg_turs
3448-[\fI\-\-help\fR] [\fI\-\-low\fR] [\fI\-\-number=NUM\fR] [\fI\-\-num=NUM\fR]
3449+[\fI\-\-help\fR] [\fI\-\-low\fR] [\fI\-\-num=NUM\fR] [\fI\-\-number=NUM\fR]
3450 [\fI\-\-progress\fR] [\fI\-\-time\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
3451 \fIDEVICE\fR
3452 .PP
3453@@ -34,7 +34,7 @@ calls a library function to do each TUR (sg_ll_test_unit_ready). With this
3454 option it uses the lower level sg_pt interface (see sg_pt.h) to save a
3455 little time on each TUR.
3456 .TP
3457-\fB\-n\fR, \fB\-\-number\fR=\fINUM\fR
3458+\fB\-n\fR, \fB\-\-num\fR=\fINUM\fR
3459 performs TEST UNIT READY \fINUM\fR times. If not given defaults to 1.
3460 These suffix multipliers are permitted: c C *1; w W *2; b B *512;
3461 k K KiB *1,024; KB *1,000; m M MiB *1,048,576; MB *1,000,000;
3462@@ -42,15 +42,17 @@ g G GiB *1,073,741,824; and GB *1,000,000,000 . Also a suffix of the
3463 form "x<n>" multiplies the leading number by <n>. Alternatively a hex
3464 number may be given, prefixed by either '0x' or has a trailing 'h'.
3465 .TP
3466-\fB\-\-num\fR=\fINUM\fR
3467-same as \fI\-\-number=NUM\fR. Added for compatibility with sg_requests
3468-which has taken over the role of polling the progress indication.
3469+\fB\-\-number\fR=\fINUM\fR
3470+same as \fI\-\-num=NUM\fR. Added for compatibility with sg_requests and
3471+other utilities in this package. The sg_request utility has taken over the
3472+role of polling the progress indication which was originally assigned to
3473+the TEST UNIT READY command. This is a change by T10.
3474 .TP
3475 \fB\-O\fR, \fB\-\-old\fR
3476 Switch to older style options. Please use as first option.
3477 .TP
3478 \fB\-p\fR, \fB\-\-progress\fR
3479-show progress indication (a percentage) if available. If \fI\-\-number=NUM\fR
3480+show progress indication (a percentage) if available. If \fI\-\-num=NUM\fR
3481 is given, \fINUM\fR is greater than 1 and an initial progress indication
3482 was detected then this utility waits 30 seconds before subsequent checks.
3483 Exits when \fINUM\fR is reached or there are no more progress indications.
3484@@ -101,7 +103,7 @@ force the use of these older command line options.
3485 .TP
3486 \fB\-n\fR=\fINUM\fR
3487 performs TEST UNIT READY \fINUM\fR times. If not given defaults to 1.
3488-Equivalent to \fI\-\-number=NUM\fR in the main description.
3489+Equivalent to \fI\-\-num=NUM\fR in the main description.
3490 .TP
3491 \fB-N\fR, \fB\-\-new\fR
3492 Switch to the newer style options.
3493@@ -128,7 +130,7 @@ using \fI\-\-old\fR (or \fI\-O\fR) as the first command line option.
3494 .SH AUTHORS
3495 Written by D. Gilbert
3496 .SH COPYRIGHT
3497-Copyright \(co 2000\-2018 Douglas Gilbert
3498+Copyright \(co 2000\-2019 Douglas Gilbert
3499 .br
3500 This software is distributed under the GPL version 2. There is NO
3501 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3502diff --git a/doc/sg_verify.8 b/doc/sg_verify.8
3503index 51c8f88..425af3b 100644
3504--- a/doc/sg_verify.8
3505+++ b/doc/sg_verify.8
3506@@ -1,19 +1,19 @@
3507-.TH SG_VERIFY "8" "January 2018" "sg3_utils\-1.43" SG3_UTILS
3508+.TH SG_VERIFY "8" "December 2019" "sg3_utils\-1.45" SG3_UTILS
3509 .SH NAME
3510 sg_verify \- invoke SCSI VERIFY command(s) on a block device
3511 .SH SYNOPSIS
3512 .B sg_verify
3513-[\fI\-\-16\fR] [\fI\-\-bpc=BPC\fR] [\fI\-\-count=COUNT\fR] [\fI\-\-dpo\fR]
3514-[\fI\-\-ebytchk=BCH\fR] [\fI\-\-group=GN\fR] [\fI\-\-help\fR]
3515-[\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-ndo=NDO\fR] [\fI\-\-quiet\fR]
3516-[\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
3517-[\fI\-\-vrprotect=VRP\fR] \fIDEVICE\fR
3518+[\fI\-\-0\fR] [\fI\-\-16\fR] [\fI\-\-bpc=BPC\fR] [\fI\-\-count=COUNT\fR]
3519+[\fI\-\-dpo\fR] [\fI\-\-ff\fR] [\fI\-\-ebytchk=BCH\fR] [\fI\-\-group=GN\fR]
3520+[\fI\-\-help\fR] [\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-ndo=NDO\fR]
3521+[\fI\-\-quiet\fR] [\fI\-\-readonly\fR] [\fI\-\-verbose\fR]
3522+[\fI\-\-version\fR] [\fI\-\-vrprotect=VRP\fR] \fIDEVICE\fR
3523 .SH DESCRIPTION
3524 .\" Add any additional description here
3525 .PP
3526 Sends one or more SCSI VERIFY (10 or 16) commands to \fIDEVICE\fR. These SCSI
3527-commands are defined in the SBC\-2 (draft) standard at http://www.t10.org and
3528-SBC\-3 drafts.
3529+commands are defined in the SBC\-2 and SBC\-3 standards at http://www.t10.org
3530+and SBC\-4 drafts.
3531 .PP
3532 When \fI\-\-ndo=NDO\fR is not given then the verify starts at the logical
3533 block address given by the \fI\-\-lba=LBA\fR option and continues for
3534@@ -45,6 +45,12 @@ Arguments to long options are mandatory for short options as well.
3535 The options are arranged in alphabetical order based on the long
3536 option name.
3537 .TP
3538+\fB\-0\fR, \fB\-\-0\fR
3539+a buffer \fINDO\fR bytes long full of zeros is sent as the data\-out
3540+part of a VERIFY command. So stdin is not read and if \fI\-\-in=IF\fR
3541+is given, an error is generated. Useful when \fIBCH\fR is 3 to check
3542+if some or all of \fIDEVICE\fR (e.g. a disk) is zero filled blocks.
3543+.TP
3544 \fB\-S\fR, \fB\-\-16\fR
3545 uses a VERIFY(16) command (default VERIFY(10)). Even without this option,
3546 using an \fI\-\-lba=LBA\fR which is too large, will cause the utility
3547@@ -80,11 +86,17 @@ other commands are more likely to remain in the device's cache.
3548 sets the BYTCHK field to \fIBCH\fR overriding the value (1) set by the
3549 \fI\-\-ndo=NDO\fR option. Values of 1, 2 or 3 are accepted for \fIBCH\fR
3550 however sbc3r34 reserves the value 2. If this option is given then
3551-\fI\-\-ndo=NDO\fR must also be given. If \fIBCH\fR is 3 then \fICOUNT\fR
3552-must be 1 and \fINDO\fR should be the size of one logical block (plus the
3553-size of some or all of the protection information if \fIVRP\fR is greater
3554+\fI\-\-ndo=NDO\fR must also be given. If \fIBCH\fR is 3 then \fINDO\fR
3555+should be the size of one logical block (plus the size of some or all
3556+of the protection information if \fIVRP\fR is greater
3557 than 0).
3558 .TP
3559+\fB\-f\fR, \fB\-\-ff\fR
3560+a buffer \fINDO\fR bytes long full of 0xff bytes is sent as the data\-out
3561+part of a VERIFY command. So stdin is not read and if \fI\-\-in=IF\fR
3562+is given, an error is generated. Useful when \fIBCH\fR is 3 to check
3563+if some or all of \fIDEVICE\fR (e.g. a disk) is 0xff byte filled blocks.
3564+.TP
3565 \fB\-g\fR, \fB\-\-group\fR=\fIGN\fR
3566 where \fIGN\fR becomes the contents of the group number field in the SCSI
3567 VERIFY(16) command. It can be from 0 to 63 inclusive. The default value for
3568@@ -198,7 +210,7 @@ Written by Douglas Gilbert.
3569 .SH "REPORTING BUGS"
3570 Report bugs to <dgilbert at interlog dot com>.
3571 .SH COPYRIGHT
3572-Copyright \(co 2004\-2018 Douglas Gilbert
3573+Copyright \(co 2004\-2019 Douglas Gilbert
3574 .br
3575 This software is distributed under a FreeBSD license. There is NO
3576 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3577diff --git a/doc/sg_vpd.8 b/doc/sg_vpd.8
3578index 1bbdc7c..08c371d 100644
3579--- a/doc/sg_vpd.8
3580+++ b/doc/sg_vpd.8
3581@@ -1,12 +1,13 @@
3582-.TH SG_VPD "8" "March 2018" "sg3_utils\-1.43" SG3_UTILS
3583+.TH SG_VPD "8" "April 2019" "sg3_utils\-1.45" SG3_UTILS
3584 .SH NAME
3585 sg_vpd \- fetch SCSI VPD page and/or decode its response
3586 .SH SYNOPSIS
3587 .B sg_vpd
3588-[\fI\-\-all\fR] [\fI\-\-enumerate\fR] [\fI\-\-force\fR] [\fI\-\-help\fR]
3589-[\fI\-\-hex\fR] [\fI\-\-ident\fR] [\fI\-\-inhex=FN\fR] [\fI\-\-long\fR]
3590-[\fI\-\-maxlen=LEN\fR] [\fI\-\-page=PG\fR] [\fI\-\-quiet\fR] [\fI\-\-raw\fR]
3591-[\fI\-\-vendor=VP\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fIDEVICE\fR]
3592+[\fI\-\-all\fR] [\fI\-\-enumerate\fR] [\fI\-\-examine\fR] [\fI\-\-force\fR]
3593+[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-ident\fR] [\fI\-\-inhex=FN\fR]
3594+[\fI\-\-long\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-page=PG\fR] [\fI\-\-quiet\fR]
3595+[\fI\-\-raw\fR] [\fI\-\-vendor=VP\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
3596+[\fIDEVICE\fR]
3597 .SH DESCRIPTION
3598 .\" Add any additional description here
3599 .PP
3600@@ -25,8 +26,8 @@ has been flagged as mandatory. This page can be fetched by
3601 using the \fI\-\-ident\fR option.
3602 .PP
3603 The reference document used for interpreting VPD pages (and the INQUIRY
3604-standard response) is T10/BSR INCITS 502 Revision 19 which is draft SPC\-5
3605-revision 19, 14 February 2018). It can be found at http://www.t10.org .
3606+standard response) is T10/BSR INCITS 502 Revision 22 which is draft SPC\-5
3607+revision 19, 22 April 2019. It can be found at http://www.t10.org .
3608 .PP
3609 When no options are given, other than a \fIDEVICE\fR, then the "Supported
3610 VPD pages" (0x0) VPD page is fetched and decoded.
3611@@ -60,6 +61,22 @@ summary lines of all VPD pages whose number matches \fIPG\fR. May be used
3612 with \fI\-\-vendor=VP\fR to restrict output to known vendor specific pages
3613 for vendor/product \fIVP\fR.
3614 .TP
3615+\fB\-E\fR, \fB\-\-examine\fR
3616+scan part of all of the VPD space (from 0x0 to 0xff) and output any pages
3617+found. This option ignores the contents of VPD page 0x0 which should contain
3618+a list of all supported VPD pages. However some vendors either forget to
3619+list some standard pages or perhaps purposely don't list vendor specific
3620+pages which are in the range 0xc0 to 0xff.
3621+.br
3622+If the \fI\-\-page=PG\fR option is not given and this option is given once
3623+then the scan is from VPD page number 0x80 to 0xff inclusive. If the
3624+\fI\-\-page=PG\fR option is given then the scan is from 0x80 to
3625+\fIPG\fR inclusive. If this option is given twice then the scan starts at
3626+VPD page 0x0.
3627+.br
3628+The sdparm utility which lists mode and VPD pages also has a \fB\-\-examine\fR
3629+option will similar functionility.
3630+.TP
3631 \fB\-f\fR, \fB\-\-force\fR
3632 As a sanity check, the normal action when fetching VPD pages other than
3633 page 0x0 (the "Supported VPD pages" VPD page), is to first fetch page 0x0
3634@@ -304,7 +321,7 @@ Written by Douglas Gilbert
3635 .SH "REPORTING BUGS"
3636 Report bugs to <dgilbert at interlog dot com>.
3637 .SH COPYRIGHT
3638-Copyright \(co 2006\-2018 Douglas Gilbert
3639+Copyright \(co 2006\-2019 Douglas Gilbert
3640 .br
3641 This software is distributed under a FreeBSD license. There is NO
3642 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3643diff --git a/doc/sg_write_buffer.8 b/doc/sg_write_buffer.8
3644index d2aab53..09332e1 100644
3645--- a/doc/sg_write_buffer.8
3646+++ b/doc/sg_write_buffer.8
3647@@ -1,4 +1,4 @@
3648-.TH SG_WRITE_BUFFER "8" "January 2018" "sg3_utils\-1.43" SG3_UTILS
3649+.TH SG_WRITE_BUFFER "8" "November 2018" "sg3_utils\-1.45" SG3_UTILS
3650 .SH NAME
3651 sg_write_buffer \- send SCSI WRITE BUFFER commands
3652 .SH SYNOPSIS
3653diff --git a/doc/sg_write_same.8 b/doc/sg_write_same.8
3654index 55e739d..55dcfec 100644
3655--- a/doc/sg_write_same.8
3656+++ b/doc/sg_write_same.8
3657@@ -1,13 +1,14 @@
3658-.TH SG_WRITE_SAME "8" "November 2017" "sg3_utils\-1.43" SG3_UTILS
3659+.TH SG_WRITE_SAME "8" "December 2019" "sg3_utils\-1.45" SG3_UTILS
3660 .SH NAME
3661 sg_write_same \- send SCSI WRITE SAME command
3662 .SH SYNOPSIS
3663 .B sg_write_same
3664 [\fI\-\-10\fR] [\fI\-\-16\fR] [\fI\-\-32\fR] [\fI\-\-anchor\fR]
3665-[\fI\-\-grpnum=GN\fR] [\fI\-\-help\fR] [\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR]
3666-[\fI\-\-lbdata\fR] [\fI\-\-num=NUM\fR] [\fI\-\-ndob\fR] [\fI\-\-pbdata\fR]
3667-[\fI\-\-timeout=TO\fR] [\fI\-\-unmap\fR] [\fI\-\-verbose\fR]
3668-[\fI\-\-version\fR] [\fI\-\-wrprotect=WPR\fR] [\fI\-\-xferlen=LEN\fR]
3669+[\fI\-\-ff\fR] [\fI\-\-grpnum=GN\fR] [\fI\-\-help\fR] [\fI\-\-in=IF\fR]
3670+[\fI\-\-lba=LBA\fR] [\fI\-\-lbdata\fR] [\fI\-\-num=NUM\fR]
3671+[\fI\-\-ndob\fR] [\fI\-\-pbdata\fR] [\fI\-\-timeout=TO\fR]
3672+[\fI\-\-unmap\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
3673+[\fI\-\-wrprotect=WPR\fR] [\fI\-\-xferlen=LEN\fR]
3674 \fIDEVICE\fR
3675 .SH DESCRIPTION
3676 .\" Add any additional description here
3677@@ -86,6 +87,10 @@ send a SCSI WRITE SAME (32) command to \fIDEVICE\fR.
3678 sets the ANCHOR bit in the cdb. Introduced in SBC\-3 revision 22.
3679 That draft requires the \fI\-\-unmap\fR option to also be specified.
3680 .TP
3681+\fB\-f\fR, \fB\-\-ff\fR
3682+the data\-out buffer sent with this command is initialized with 0xff bytes
3683+when this option is given.
3684+.TP
3685 \fB\-g\fR, \fB\-\-grpnum\fR=\fIGN\fR
3686 sets the 'Group number' field to \fIGN\fR. Defaults to a value of zero.
3687 \fIGN\fR should be a value between 0 and 63.
3688@@ -97,11 +102,12 @@ output the usage message then exit.
3689 read data (binary) from file named \fIIF\fR and use it as the data\-out
3690 buffer for the SCSI WRITE SAME command. The length of the data\-out buffer
3691 is \fI\-\-xferlen=LEN\fR or, if that is not given, the length of the \fIIF\fR
3692-file. If \fIIF\fR is "\-" then stdin is read. If this option is not given
3693-then 0x00 bytes are used as fill with the length of the data\-out buffer
3694-obtained from \fI\-\-xferlen=LEN\fR or by calling READ CAPACITY(16 or 10).
3695-If the response to READ CAPACITY(16) has the PROT_EN bit set then data\-
3696-out buffer size is modified accordingly with the last 8 bytes set to 0xff.
3697+file. If \fIIF\fR is "\-" then stdin is read. If this option and the
3698+\fI\-\-ff\fR are not given then 0x00 bytes are used as fill with the length
3699+of the data\-out buffer obtained from \fI\-\-xferlen=LEN\fR or by calling
3700+READ CAPACITY(16 or 10). If the response to READ CAPACITY(16) has the
3701+PROT_EN bit set then data\- out buffer size is modified accordingly with
3702+the last 8 bytes set to 0xff.
3703 .TP
3704 \fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR
3705 where \fILBA\fR is the logical block address to start the WRITE SAME command.
3706@@ -316,7 +322,7 @@ Written by Douglas Gilbert.
3707 .SH "REPORTING BUGS"
3708 Report bugs to <dgilbert at interlog dot com>.
3709 .SH COPYRIGHT
3710-Copyright \(co 2009\-2017 Douglas Gilbert
3711+Copyright \(co 2009\-2019 Douglas Gilbert
3712 .br
3713 This software is distributed under a FreeBSD license. There is NO
3714 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3715diff --git a/doc/sg_write_x.8 b/doc/sg_write_x.8
3716index 122d950..de9f10d 100644
3717--- a/doc/sg_write_x.8
3718+++ b/doc/sg_write_x.8
3719@@ -1,4 +1,4 @@
3720-.TH SG_WRITE_X "8" "May 2018" "sg3_utils\-1.43" SG3_UTILS
3721+.TH SG_WRITE_X "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
3722 .SH NAME
3723 sg_write_x \- SCSI WRITE normal/ATOMIC/SAME/SCATTERED/STREAM, ORWRITE commands
3724 .SH SYNOPSIS
3725@@ -451,7 +451,7 @@ output version string then exit.
3726 .TP
3727 \fB\-w\fR, \fB\-\-wrprotect\fR=\fIWPR\fR
3728 sets the WRPROTECT field (3 bits) in all sg_write_x commands apart from
3729-ORWRITE which has a 3 bit ORPROTECT field (and the synopsis shows \fiOPR\fR
3730+ORWRITE which has a 3 bit ORPROTECT field (and the synopsis shows \fIOPR\fR
3731 to highlight the difference). In all cases \fIWPR\fR is placed
3732 in that 3 bit field. The default value is zero which does not send any PI
3733 in the data\-out buffer. \fIWPR\fR should be a value between 0 and 7.
3734@@ -587,7 +587,7 @@ Written by Douglas Gilbert.
3735 .SH "REPORTING BUGS"
3736 Report bugs to <dgilbert at interlog dot com>.
3737 .SH COPYRIGHT
3738-Copyright \(co 2017 Douglas Gilbert
3739+Copyright \(co 2017\-2020 Douglas Gilbert
3740 .br
3741 This software is distributed under a FreeBSD license. There is NO
3742 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3743diff --git a/doc/sg_xcopy.8 b/doc/sg_xcopy.8
3744index 437bad0..197fc37 100644
3745--- a/doc/sg_xcopy.8
3746+++ b/doc/sg_xcopy.8
3747@@ -1,4 +1,4 @@
3748-.TH SG_XCOPY "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS
3749+.TH SG_XCOPY "8" "February 2019" "sg3_utils\-1.45" SG3_UTILS
3750 .SH NAME
3751 sg_xcopy \- copy data to and from files and devices using SCSI EXTENDED
3752 COPY (XCOPY)
3753@@ -9,7 +9,7 @@ COPY (XCOPY)
3754 [\fIoflag=FLAGS\fR] [\fIseek=SEEK\fR] [\fIskip=SKIP\fR] [\fI\-\-help\fR]
3755 [\fI\-\-version\fR]
3756 .PP
3757-[\fIbpt=BPT\fR] [\fIcat=\fR0|1] [\fIdc=\fR0|1]
3758+[\fIapp=\fR0|1] [\fIbpt=BPT\fR] [\fIcat=\fR0|1] [\fIdc=\fR0|1] [\fIfco=\fR0|1]
3759 [\fIid_usage=\fR{hold|discard|disable}] [\fIlist_id=ID\fR] [\fIprio=PRIO\fR]
3760 [\fItime=\fR0|1] [\fIverbose=VERB\fR] [\fI\-\-on_dst|\-\-on_src\fR]
3761 [\fI\-\-verbose\fR]
3762@@ -19,14 +19,6 @@ COPY (XCOPY)
3763 Copy data to and from any files. Specialized for "files" that are Linux SCSI
3764 devices that support the SCSI EXTENDED COPY (XCOPY) command.
3765 .PP
3766-During the draft stages of SPC\-4 the T10 committee has expanded the XCOPY
3767-command so that it now has two variants: "LID1" (for a List Identifier
3768-length of 1 byte) and "LID4" (for a List Identifier length of 4 bytes).
3769-This utility supports the older, LID1 variant which is also found in SPC\-3
3770-and earlier. While the LID1 variant in SPC\-4 is command level (binary)
3771-compatible with XCOPY as defined in SPC\-3, some of the command naming has
3772-changed. This utility uses the older, SPC\-3 XCOPY names.
3773-.PP
3774 This utility
3775 has similar syntax and semantics to
3776 .B dd(1)
3777@@ -42,12 +34,26 @@ with the \fI\-\-on_src\fR or \fIiflag=xflag\fR options which cause the XCOPY
3778 command to be sent to \fIIFILE\fR instead. Also see the section on
3779 ENVIRONMENT VARIABLES.
3780 .PP
3781+In the SPC\-4 standard the T10 committee has expanded the XCOPY command so
3782+that it now has two variants: "LID1" (for a List Identifier length of 1 byte)
3783+and "LID4" (for a List Identifier length of 4 bytes). This utility supports
3784+the older, LID1 variant which is also found in SPC\-3 and earlier. While the
3785+LID1 variant in SPC\-4 is command level (binary) compatible with XCOPY as
3786+defined in SPC\-3, some of the command naming has changed. This utility uses
3787+the older, SPC\-3 XCOPY names.
3788+.PP
3789 The ddpt utility supports the same xcopy(LID1) functionality as this utility
3790 with the same options and flags. Additionally ddpt supports a subset of
3791 xcopy(LID4) functionality variously called "xcopy version 2, lite" or ODX.
3792 ODX is a market name and stands for Offloaded Data Xfer (i.e. transfer).
3793 .SH OPTIONS
3794 .TP
3795+\fBapp\fR={0|1}
3796+if 1 start the destination of the copy at the end of OFILE. This assumes
3797+that OFILE is a regular file. The default is 0 in which case the destination
3798+of the copy starts at the beginning of OFILE (possibly offset be SEEK). This
3799+option cannot be used with the \fIseek=SEEK\fR option.
3800+.TP
3801 \fBbpt\fR=\fIBPT\fR
3802 each IO transaction will be made using \fIBPT\fR blocks (or less if near
3803 the end of the copy). Default is 128 for logical block sizes less that 2048
3804@@ -73,24 +79,16 @@ the handling of residual data. See section
3805 .B HANDLING OF RESIDUAL DATA
3806 for details.
3807 .TP
3808-\fBdc\fR={0|1}
3809-sets the SCSI EXTENDED COPY command segment descriptor DC bit to 0 or
3810-1 (default: 0). The DC bit controls whether \fICOUNT\fR
3811-refers to the source (\fIdc=0\fR) or the target (\fIdc=1\fR) descriptor.
3812-.TP
3813 \fBconv\fR=\fBCONV\fR
3814 all \fBCONV\fR arguments are ignored.
3815 .TP
3816-\fBapp\fR=\fBAPPEND\fR
3817-all \fBAPPEND\fR arguments are ignored.
3818-.TP
3819 \fBcount\fR=\fICOUNT\fR
3820 copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
3821 minimum (\fIIFILE\fR if \fIdc=0\fR or \fIOFILE\fR if \fIdc=1\fR)
3822 number of blocks that SCSI devices report from SCSI READ CAPACITY
3823 commands or that block devices (or their partitions) report. Normal
3824 files are not probed for their size. If \fIskip=SKIP\fR or
3825-\fIskip=SEEK\fR are given and the count is derived (i.e. not
3826+\fIseek=SEEK\fR are given and the count is derived (i.e. not
3827 explicitly given) then the derived count is scaled back so that the
3828 copy will not overrun the device. If the file name is a block device
3829 partition and \fICOUNT\fR is not given then the size of the partition
3830@@ -98,6 +96,19 @@ rather than the size of the whole device is used. If \fICOUNT\fR is
3831 not given (or \fIcount=\-1\fR) and cannot be derived then an error
3832 message is issued and no copy takes place.
3833 .TP
3834+\fBdc\fR={0|1}
3835+sets the SCSI EXTENDED COPY command segment descriptor DC bit to 0 or
3836+1 (default: 0). The DC bit controls whether \fICOUNT\fR
3837+refers to the source (\fIdc=0\fR) or the target (\fIdc=1\fR) descriptor.
3838+.TP
3839+\fBfco\fR={0|1}
3840+sets the SCSI EXTENDED COPY command segment descriptor FCO bit to 0 or
3841+1 (default: 0). The Fast Copy Only (FCO) bit set will result in the
3842+copy being done but a technique faster than SCSI READ and WRITE commands.
3843+If the copy cannot but done in a faster manner then a sense key of "Copy
3844+aborted" with and additional sense of "Fast copy not possible" is
3845+returned.
3846+.TP
3847 \fBibs\fR=\fIBS\fR
3848 if given must be the same as \fIBS\fR given to 'bs=' option.
3849 .TP
3850@@ -343,7 +354,7 @@ Written by Hannes Reinecke and Douglas Gilbert.
3851 .SH "REPORTING BUGS"
3852 Report bugs to <dgilbert at interlog dot com>.
3853 .SH COPYRIGHT
3854-Copyright \(co 2000\-2018 Hannes Reinecke and Douglas Gilbert
3855+Copyright \(co 2000\-2019 Hannes Reinecke and Douglas Gilbert
3856 .br
3857 This software is distributed under the GPL version 2. There is NO
3858 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3859diff --git a/doc/sgm_dd.8 b/doc/sgm_dd.8
3860index 346bedb..58782d7 100644
3861--- a/doc/sgm_dd.8
3862+++ b/doc/sgm_dd.8
3863@@ -1,4 +1,4 @@
3864-.TH SGM_DD "8" "June 2018" "sg3_utils\-1.43" SG3_UTILS
3865+.TH SGM_DD "8" "February 2019" "sg3_utils\-1.45" SG3_UTILS
3866 .SH NAME
3867 sgm_dd \- copy data to and from files and devices, especially SCSI
3868 devices
3869@@ -66,7 +66,7 @@ copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
3870 minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices
3871 report from SCSI READ CAPACITY commands or that block devices (or their
3872 partitions) report. Normal files are not probed for their size. If
3873-\fIskip=SKIP\fR or \fIskip=SEEK\fR are given and the count is derived (i.e.
3874+\fIskip=SKIP\fR or \fIseek=SEEK\fR are given and the count is derived (i.e.
3875 not explicitly given) then the derived count is scaled back so that the
3876 copy will not overrun the device. If the file name is a block device
3877 partition and \fICOUNT\fR is not given then the size of the partition rather
3878@@ -269,7 +269,7 @@ Written by Douglas Gilbert and Peter Allworth.
3879 .SH "REPORTING BUGS"
3880 Report bugs to <dgilbert at interlog dot com>.
3881 .SH COPYRIGHT
3882-Copyright \(co 2000\-2018 Douglas Gilbert
3883+Copyright \(co 2000\-2019 Douglas Gilbert
3884 .br
3885 This software is distributed under the GPL version 2. There is NO
3886 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3887diff --git a/doc/sgp_dd.8 b/doc/sgp_dd.8
3888index 0c99712..62a065b 100644
3889--- a/doc/sgp_dd.8
3890+++ b/doc/sgp_dd.8
3891@@ -1,4 +1,4 @@
3892-.TH SGP_DD "8" "June 2018" "sg3_utils\-1.43" SG3_UTILS
3893+.TH SGP_DD "8" "February 2020" "sg3_utils\-1.45" SG3_UTILS
3894 .SH NAME
3895 sgp_dd \- copy data to and from files and devices, especially SCSI
3896 devices
3897@@ -61,7 +61,7 @@ copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
3898 minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices
3899 report from SCSI READ CAPACITY commands or that block devices (or their
3900 partitions) report. Normal files are not probed for their size. If
3901-\fIskip=SKIP\fR or \fIskip=SEEK\fR are given and the count is deduced (i.e.
3902+\fIskip=SKIP\fR or \fIseek=SEEK\fR are given and the count is deduced (i.e.
3903 not explicitly given) then that count is scaled back so that the copy will
3904 not overrun the device. If the file name is a block device partition and
3905 \fICOUNT\fR is not given then the size of the partition rather than the
3906@@ -123,7 +123,7 @@ transfer. Only active when \fIOFILE\fR is a sg device file name.
3907 .TP
3908 \fBthr\fR=\fITHR\fR
3909 where \fITHR\fR is the number or worker threads (default 4) that attempt to
3910-copy in parallel. Minimum is 1 and maximum is 16.
3911+copy in parallel. Minimum is 1 and maximum is 1024.
3912 .TP
3913 \fBtime\fR=0 | 1
3914 when 1, the transfer is timed and throughput calculation is
3915@@ -201,6 +201,13 @@ excl
3916 causes the O_EXCL flag to be added to the open of \fIIFILE\fR and/or
3917 \fIOFILE\fR.
3918 .TP
3919+mmap
3920+can only be used in the \fIiflag=FLAGS\fR or the \fIoflag=FLAGS\fR argument
3921+list but not both. The nominated side of the copy will use memory mapped IO
3922+based on the mmap(2) system call. The sg driver will remap its DMA
3923+destination or source buffer into the user space when the mmap(2) system call
3924+is used on a sg device.
3925+.TP
3926 fua
3927 causes the FUA (force unit access) bit to be set in SCSI READ and/or WRITE
3928 commands. This only has effect with sg devices. The 6 byte variants
3929@@ -314,7 +321,7 @@ Written by Douglas Gilbert and Peter Allworth.
3930 .SH "REPORTING BUGS"
3931 Report bugs to <dgilbert at interlog dot com>.
3932 .SH COPYRIGHT
3933-Copyright \(co 2000\-2017 Douglas Gilbert
3934+Copyright \(co 2000\-2020 Douglas Gilbert
3935 .br
3936 This software is distributed under the GPL version 2. There is NO
3937 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3938diff --git a/examples/scsi_inquiry.c b/examples/scsi_inquiry.c
3939index 32fe74d..9949749 100644
3940--- a/examples/scsi_inquiry.c
3941+++ b/examples/scsi_inquiry.c
3942@@ -1,3 +1,24 @@
3943+/*
3944+ * Copyright (C) 1999-2018 D. Gilbert
3945+ * This program is free software; you can redistribute it and/or modify
3946+ * it under the terms of the GNU General Public License as published by
3947+ * the Free Software Foundation; either version 2, or (at your option)
3948+ * any later version.
3949+ *
3950+ * SPDX-License-Identifier: GPL-2.0-or-later
3951+ *
3952+ * Test code for D. Gilbert's extensions to the Linux OS SCSI generic ("sg")
3953+ * device driver.
3954+ * This program does a SCSI inquiry command on the given device and
3955+ * outputs some of the result. This program highlights the use of the
3956+ * SCSI_IOCTL_SEND_COMMAND ioctl. This should be able to be applied to
3957+ * any SCSI device file descriptor (not just one related to sg). [Whether
3958+ * this is a good idea on a disk while it is mounted is debatable.
3959+ * No detrimental effects when this was tested ...]
3960+ *
3961+ * Version 0.16 20181207
3962+ */
3963+
3964 #include <unistd.h>
3965 #include <signal.h>
3966 #include <fcntl.h>
3967@@ -11,25 +32,6 @@
3968 #include <scsi/scsi.h>
3969 /* #include <scsi/scsi_ioctl.h> */ /* glibc hides this file sometimes */
3970
3971-/* Test code for D. Gilbert's extensions to the Linux OS SCSI generic ("sg")
3972- device driver.
3973-* Copyright (C) 1999 D. Gilbert
3974-* This program is free software; you can redistribute it and/or modify
3975-* it under the terms of the GNU General Public License as published by
3976-* the Free Software Foundation; either version 2, or (at your option)
3977-* any later version.
3978-
3979- This program does a SCSI inquiry command on the given device and
3980- outputs some of the result. This program highlights the use of the
3981- SCSI_IOCTL_SEND_COMMAND ioctl. This should be able to be applied to
3982- any SCSI device file descriptor (not just one related to sg). [Whether
3983- this is a good idea on a disk while it is mounted is debatable.
3984- No detrimental effects when this was tested ...]
3985-
3986-Version 0.15 20160528
3987-*/
3988-
3989-
3990 typedef struct my_scsi_ioctl_command {
3991 unsigned int inlen; /* _excluding_ scsi command length */
3992 unsigned int outlen;
3993diff --git a/examples/sdiag_sas_p0_prbs9.txt b/examples/sdiag_sas_p0_prbs9.txt
3994new file mode 100644
3995index 0000000..1b96f99
3996--- /dev/null
3997+++ b/examples/sdiag_sas_p0_prbs9.txt
3998@@ -0,0 +1,12 @@
3999+# This is the hex for a SAS protocol specific diagnostic
4000+# page. It will attempt to put phy identifier 0 of the
4001+# given device into PRBS9 (jitter pattern) generation mode.
4002+# Physical transmission speed is 22.5 Gbps
4003+# N.B. This will turn the receiver off on phy id 0.
4004+#
4005+# Usage example: 'sg_senddiag --pf --raw=- /dev/sg2 < {this_file}'
4006+#
4007+3f,6,0,1c,0,1,3,c,
4008+0,0,0,0,0,0,0,0,
4009+0,0,0,0,0,0,0,0,
4010+0,0,0,0,0,0,0,0
4011diff --git a/examples/sdiag_sas_p1_prbs15.txt b/examples/sdiag_sas_p1_prbs15.txt
4012new file mode 100644
4013index 0000000..1248ab3
4014--- /dev/null
4015+++ b/examples/sdiag_sas_p1_prbs15.txt
4016@@ -0,0 +1,12 @@
4017+# This is the hex for a SAS protocol specific diagnostic
4018+# page. It will attempt to put phy identifier 1 of the
4019+# given device into PRBS15 (jitter pattern) generation mode.
4020+# Physical transmission speed is 22.5 Gbps
4021+# N.B. This will turn the receiver off on phy id 1.
4022+#
4023+# Usage example: 'sg_senddiag --pf --raw=- /dev/sg2 < {this_file}'
4024+#
4025+3f,6,0,1c,1,1,4,c,
4026+0,0,0,0,0,0,0,0,
4027+0,0,0,0,0,0,0,0,
4028+0,0,0,0,0,0,0,0
4029diff --git a/examples/sg_compare_and_write.txt b/examples/sg_compare_and_write.txt
4030index 05d72b9..86b166b 100644
4031--- a/examples/sg_compare_and_write.txt
4032+++ b/examples/sg_compare_and_write.txt
4033@@ -9,7 +9,7 @@
4034 #
4035 # The following example shows initialization, successful and unsuccessful
4036 # compare and write using sg3_utils. I am using caw_buf_zero2one and
4037-# caw_buf_one2zero as shown bellow.
4038+# caw_buf_one2zero as shown below.
4039
4040 $ hexdump /tmp/caw_buf_zero2one
4041 0000000 0000 0000 0000 0000 0000 0000 0000 0000
4042diff --git a/examples/sg_excl.c b/examples/sg_excl.c
4043index 8cbab75..7e589b2 100644
4044--- a/examples/sg_excl.c
4045+++ b/examples/sg_excl.c
4046@@ -1,3 +1,28 @@
4047+/*
4048+ * Copyright (C) 2003-2018 D. Gilbert
4049+ * This program is free software; you can redistribute it and/or modify
4050+ * it under the terms of the GNU General Public License as published by
4051+ * the Free Software Foundation; either version 2, or (at your option)
4052+ * any later version.
4053+ *
4054+ * SPDX-License-Identifier: GPL-2.0-or-later
4055+ *
4056+ * This is a simple program that tests the O_EXCL flag in sg while
4057+ * executing a SCSI INQUIRY command and a
4058+ * TEST UNIT READY command using the SCSI generic (sg) driver
4059+ *
4060+ * Invocation: sg_excl [-x] <sg_device>
4061+ *
4062+ * Version 3.62 (20181227)
4063+ *
4064+ * 6 byte INQUIRY command:
4065+ * [0x12][ |lu][pg cde][res ][al len][cntrl ]
4066+ *
4067+ * 6 byte TEST UNIT READY command:
4068+ * [0x00][ |lu][res ][res ][res ][res ]
4069+ *
4070+ */
4071+
4072 #include <unistd.h>
4073 #include <fcntl.h>
4074 #include <stdio.h>
4075@@ -11,27 +36,6 @@
4076 #include "sg_lib.h"
4077 #include "sg_io_linux.h"
4078
4079-/* This is a simple program that tests the O_EXCL flag in sg while
4080- executing a SCSI INQUIRY command and a
4081- TEST UNIT READY command using the SCSI generic (sg) driver
4082-
4083-* Copyright (C) 2003-2018 D. Gilbert
4084-* This program is free software; you can redistribute it and/or modify
4085-* it under the terms of the GNU General Public License as published by
4086-* the Free Software Foundation; either version 2, or (at your option)
4087-* any later version.
4088-
4089- Invocation: sg_excl [-x] <sg_device>
4090-
4091- Version 3.60 (20180220)
4092-
4093-6 byte INQUIRY command:
4094-[0x12][ |lu][pg cde][res ][al len][cntrl ]
4095-
4096-6 byte TEST UNIT READY command:
4097-[0x00][ |lu][res ][res ][res ][res ]
4098-
4099-*/
4100
4101 #define INQ_REPLY_LEN 96
4102 #define INQ_CMD_LEN 6
4103@@ -191,6 +195,7 @@ int main(int argc, char * argv[])
4104 "msg_status=%d\n", io_hdr.duration, io_hdr.resid,
4105 (int)io_hdr.msg_status);
4106
4107+ printf("Wait for 60 seconds with O_EXCL help on %s\n", file_name);
4108 sleep(60);
4109 close(sg_fd);
4110 return 0;
4111diff --git a/examples/sg_sat_chk_power.c b/examples/sg_sat_chk_power.c
4112index b5ea18a..ca24f66 100644
4113--- a/examples/sg_sat_chk_power.c
4114+++ b/examples/sg_sat_chk_power.c
4115@@ -10,8 +10,6 @@
4116 * 2. Redistributions in binary form must reproduce the above copyright
4117 * notice, this list of conditions and the following disclaimer in the
4118 * documentation and/or other materials provided with the distribution.
4119- * 3. The name of the author may not be used to endorse or promote products
4120- * derived from this software without specific prior written permission.
4121 *
4122 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
4123 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4124@@ -25,6 +23,7 @@
4125 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4126 * SUCH DAMAGE.
4127 *
4128+ * SPDX-License-Identifier: BSD-2-Clause
4129 */
4130
4131 #include <unistd.h>
4132@@ -59,7 +58,7 @@
4133
4134 #define EBUFF_SZ 256
4135
4136-static const char * version_str = "1.07 20180706";
4137+static const char * version_str = "1.08 20181207";
4138
4139
4140 #if 0
4141diff --git a/examples/sg_sat_smart_rd_data.c b/examples/sg_sat_smart_rd_data.c
4142index 1e7295d..223da2a 100644
4143--- a/examples/sg_sat_smart_rd_data.c
4144+++ b/examples/sg_sat_smart_rd_data.c
4145@@ -10,8 +10,6 @@
4146 * 2. Redistributions in binary form must reproduce the above copyright
4147 * notice, this list of conditions and the following disclaimer in the
4148 * documentation and/or other materials provided with the distribution.
4149- * 3. The name of the author may not be used to endorse or promote products
4150- * derived from this software without specific prior written permission.
4151 *
4152 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
4153 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4154@@ -25,6 +23,7 @@
4155 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4156 * SUCH DAMAGE.
4157 *
4158+ * SPDX-License-Identifier: BSD-2-Clause
4159 */
4160
4161 #include <unistd.h>
4162@@ -58,7 +57,7 @@
4163
4164 #define EBUFF_SZ 256
4165
4166-static char * version_str = "1.04 20180220";
4167+static char * version_str = "1.05 20181207";
4168
4169 int main(int argc, char * argv[])
4170 {
4171diff --git a/examples/sg_simple1.c b/examples/sg_simple1.c
4172index d835267..b8ef349 100644
4173--- a/examples/sg_simple1.c
4174+++ b/examples/sg_simple1.c
4175@@ -1,3 +1,32 @@
4176+/*
4177+ * Copyright (C) 1999-2018 D. Gilbert
4178+ * This program is free software; you can redistribute it and/or modify
4179+ * it under the terms of the GNU General Public License as published by
4180+ * the Free Software Foundation; either version 2, or (at your option)
4181+ * any later version.
4182+ *
4183+ * SPDX-License-Identifier: GPL-2.0-or-later
4184+ *
4185+ * This is a simple program executing a SCSI INQUIRY command and a
4186+ * TEST UNIT READY command using the SCSI generic (sg) driver
4187+ * There is another variant of this program called "sg_simple2"
4188+ * which does not include the sg_lib.h header and logic and so has
4189+ * simpler but more primitive error processing.
4190+ * In the lk 2.6 series devices nodes such as /dev/sda also support
4191+ * the SG_IO ioctl.
4192+ *
4193+ * Invocation: sg_simple1 [-x] <scsi_device>
4194+ *
4195+ * Version 3.60 (20181207)
4196+ *
4197+ * 6 byte INQUIRY command:
4198+ * [0x12][ |lu][pg cde][res ][al len][cntrl ]
4199+ *
4200+ * 6 byte TEST UNIT READY command:
4201+ * [0x00][ |lu][res ][res ][res ][res ]
4202+ *
4203+ */
4204+
4205 #include <unistd.h>
4206 #include <fcntl.h>
4207 #include <stdio.h>
4208@@ -10,31 +39,6 @@
4209 #include "sg_lib.h"
4210 #include "sg_io_linux.h"
4211
4212-/* This is a simple program executing a SCSI INQUIRY command and a
4213- TEST UNIT READY command using the SCSI generic (sg) driver
4214- There is another variant of this program called "sg_simple2"
4215- which does not include the sg_lib.h header and logic and so has
4216- simpler but more primitive error processing.
4217- In the lk 2.6 series devices nodes such as /dev/sda also support
4218- the SG_IO ioctl.
4219-
4220-* Copyright (C) 1999-2007 D. Gilbert
4221-* This program is free software; you can redistribute it and/or modify
4222-* it under the terms of the GNU General Public License as published by
4223-* the Free Software Foundation; either version 2, or (at your option)
4224-* any later version.
4225-
4226- Invocation: sg_simple1 [-x] <scsi_device>
4227-
4228- Version 03.59 (20160528)
4229-
4230-6 byte INQUIRY command:
4231-[0x12][ |lu][pg cde][res ][al len][cntrl ]
4232-
4233-6 byte TEST UNIT READY command:
4234-[0x00][ |lu][res ][res ][res ][res ]
4235-
4236-*/
4237
4238 #define INQ_REPLY_LEN 96
4239 #define INQ_CMD_LEN 6
4240diff --git a/examples/sgq_dd.c b/examples/sgq_dd.c
4241index debbe37..2f163ef 100644
4242--- a/examples/sgq_dd.c
4243+++ b/examples/sgq_dd.c
4244@@ -1,3 +1,32 @@
4245+/*
4246+ * A utility program for the Linux OS SCSI generic ("sg") device driver.
4247+ * Copyright (C) 1999-2010 D. Gilbert and P. Allworth
4248+ * This program is free software; you can redistribute it and/or modify
4249+ * it under the terms of the GNU General Public License as published by
4250+ * the Free Software Foundation; either version 2, or (at your option)
4251+ * any later version.
4252+ *
4253+ * SPDX-License-Identifier: GPL-2.0-or-later
4254+ *
4255+ * This program is a specialization of the Unix "dd" command in which
4256+ * one or both of the given files is a scsi generic device or a raw
4257+ * device. A block size ('bs') is assumed to be 512 if not given. This
4258+ * program complains if 'ibs' or 'obs' are given with some other value
4259+ * than 'bs'. If 'if' is not given or 'if=-' then stdin is assumed. If
4260+ * 'of' is not given or 'of=-' then stdout assumed. Multipliers:
4261+ * 'c','C' *1 'b','B' *512 'k' *1024 'K' *1000
4262+ * 'm' *(1024^2) 'M' *(1000^2) 'g' *(1024^3) 'G' *(1000^3)
4263+ *
4264+ * A non-standard argument "bpt" (blocks per transfer) is added to control
4265+ * the maximum number of blocks in each transfer. The default value is 128.
4266+ * For example if "bs=512" and "bpt=32" then a maximum of 32 blocks (16KB
4267+ * in this case) are transferred to or from the sg device in a single SCSI
4268+ * command.
4269+ *
4270+ * This version should compile with Linux sg drivers with version numbers
4271+ * >= 30000 . This version uses queuing within the Linux sg driver.
4272+ */
4273+
4274 #define _XOPEN_SOURCE 500
4275
4276 #include <unistd.h>
4277@@ -23,34 +52,8 @@ typedef uint8_t u_char; /* horrible, for scsi.h */
4278 #include "sg_io_linux.h"
4279 #include "sg_unaligned.h"
4280
4281-/* A utility program for the Linux OS SCSI generic ("sg") device driver.
4282-* Copyright (C) 1999-2018 D. Gilbert and P. Allworth
4283-* This program is free software; you can redistribute it and/or modify
4284-* it under the terms of the GNU General Public License as published by
4285-* the Free Software Foundation; either version 2, or (at your option)
4286-* any later version.
4287-
4288- This program is a specialization of the Unix "dd" command in which
4289- one or both of the given files is a scsi generic device or a raw
4290- device. A block size ('bs') is assumed to be 512 if not given. This
4291- program complains if 'ibs' or 'obs' are given with some other value
4292- than 'bs'. If 'if' is not given or 'if=-' then stdin is assumed. If
4293- 'of' is not given or 'of=-' then stdout assumed. Multipliers:
4294- 'c','C' *1 'b','B' *512 'k' *1024 'K' *1000
4295- 'm' *(1024^2) 'M' *(1000^2) 'g' *(1024^3) 'G' *(1000^3)
4296-
4297- A non-standard argument "bpt" (blocks per transfer) is added to control
4298- the maximum number of blocks in each transfer. The default value is 128.
4299- For example if "bs=512" and "bpt=32" then a maximum of 32 blocks (16KB
4300- in this case) are transferred to or from the sg device in a single SCSI
4301- command.
4302-
4303- This version should compile with Linux sg drivers with version numbers
4304- >= 30000 . This version uses queuing within the Linux sg driver.
4305-
4306-*/
4307-
4308-static char * version_str = "0.61 20180627";
4309+
4310+static char * version_str = "0.63 20190324";
4311 /* resurrected from "0.55 20020509" */
4312
4313 #define DEF_BLOCK_SIZE 512
4314@@ -64,7 +67,7 @@ static char * version_str = "0.61 20180627";
4315 #define SGP_READ10 0x28
4316 #define SGP_WRITE10 0x2a
4317 #define DEF_NUM_THREADS 4 /* actually degree of concurrency */
4318-#define MAX_NUM_THREADS 32
4319+#define MAX_NUM_THREADS 1024
4320
4321 #ifndef RAW_MAJOR
4322 #define RAW_MAJOR 255 /*unlikey value */
4323@@ -241,7 +244,7 @@ usage()
4324 " usually either 'if' or 'of' is a sg or raw device\n"
4325 " 'bpt' is blocks_per_transfer (default is 128)\n"
4326 " 'dio' is direct IO, 1->attempt, 0->indirect IO (def)\n"
4327- " 'thr' is number of queues, must be > 0, default 4, max 32\n");
4328+ " 'thr' is number of queues, must be > 0, default 4, max 1024\n");
4329 fprintf(stderr, " 'coe' continue on sg error, 0->exit (def), "
4330 "1->zero + continue\n"
4331 " 'time' 0->no timing(def), 1->time plus calculate throughput\n"
4332diff --git a/examples/transport_ids.txt b/examples/transport_ids.txt
4333index 0c60456..a63374d 100644
4334--- a/examples/transport_ids.txt
4335+++ b/examples/transport_ids.txt
4336@@ -9,7 +9,7 @@
4337 # To see transport IDs decoded after they have been read in (e.g. to check
4338 # they are well formed) use the verbose flag 3 times (i.e. "... -vvv ...").
4339
4340-# Here is a simple example (for SPI) of a comma separted hex list:
4341+# Here is a simple example (for SPI) of a comma separated hex list:
4342 1,0,0,7,0,0,0,1 # SPI, initiator address=7, relative_port_num=1
4343
4344 # and here is the transport specific format for the same thing:
4345diff --git a/include/Makefile.in b/include/Makefile.in
4346index d6029bf..6ee60f6 100644
4347--- a/include/Makefile.in
4348+++ b/include/Makefile.in
4349@@ -1,7 +1,7 @@
4350-# Makefile.in generated by automake 1.15.1 from Makefile.am.
4351+# Makefile.in generated by automake 1.16.1 from Makefile.am.
4352 # @configure_input@
4353
4354-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4355+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
4356
4357 # This Makefile.in is free software; the Free Software Foundation
4358 # gives unlimited permission to copy and/or distribute it,
4359@@ -351,8 +351,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
4360 *config.status*) \
4361 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
4362 *) \
4363- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
4364- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
4365+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
4366+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
4367 esac;
4368
4369 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
4370@@ -443,7 +443,10 @@ cscopelist-am: $(am__tagged_files)
4371 distclean-tags:
4372 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
4373
4374-distdir: $(DISTFILES)
4375+distdir: $(BUILT_SOURCES)
4376+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
4377+
4378+distdir-am: $(DISTFILES)
4379 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
4380 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
4381 list='$(DISTFILES)'; \
4382diff --git a/include/freebsd_nvme_ioctl.h b/include/freebsd_nvme_ioctl.h
4383index a7c970b..0b79d85 100644
4384--- a/include/freebsd_nvme_ioctl.h
4385+++ b/include/freebsd_nvme_ioctl.h
4386@@ -39,6 +39,11 @@ extern "C" {
4387 #define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command)
4388
4389 #if __FreeBSD_version < 1100110
4390+
4391+#define NVME_STATUS_GET_SC(st) (st.sc)
4392+#define NVME_STATUS_GET_SCT(st) (st.sct)
4393+
4394+
4395 struct nvme_command
4396 {
4397 /* dword 0 */
4398@@ -151,12 +156,14 @@ struct nvme_pt_command {
4399 */
4400 struct mtx * driver_lock;
4401 };
4402-#else
4403+#else /* not __FreeBSD_version < 1100110 */
4404 #include <dev/nvme/nvme.h>
4405-#endif
4406+#endif /* __FreeBSD_version < 1100110 */
4407
4408+#ifndef nvme_completion_is_error
4409 #define nvme_completion_is_error(cpl) \
4410 ((cpl)->status.sc != 0 || (cpl)->status.sct != 0)
4411+#endif
4412
4413 #define NVME_CTRLR_PREFIX "/dev/nvme"
4414 #define NVME_NS_PREFIX "ns"
4415diff --git a/include/sg_cmds_basic.h b/include/sg_cmds_basic.h
4416index 4fb0ddf..e40d101 100644
4417--- a/include/sg_cmds_basic.h
4418+++ b/include/sg_cmds_basic.h
4419@@ -2,10 +2,12 @@
4420 #define SG_CMDS_BASIC_H
4421
4422 /*
4423- * Copyright (c) 2004-2018 Douglas Gilbert.
4424+ * Copyright (c) 2004-2019 Douglas Gilbert.
4425 * All rights reserved.
4426 * Use of this source code is governed by a BSD-style
4427 * license that can be found in the BSD_LICENSE file.
4428+ *
4429+ * SPDX-License-Identifier: BSD-2-Clause
4430 */
4431
4432 /*
4433@@ -341,8 +343,8 @@ const char * sg_cmds_version();
4434 * output via 'o_sense_cat' pointer (if not NULL). Note that several sense
4435 * categories also have data in bytes received; -2 is still returned. */
4436 int sg_cmds_process_resp(struct sg_pt_base * ptvp, const char * leadin,
4437- int pt_res, int mx_di_len, const uint8_t * sense_b,
4438- bool noisy, int verbose, int * o_sense_cat);
4439+ int pt_res, bool noisy, int verbose,
4440+ int * o_sense_cat);
4441
4442 /* NVMe devices use a different command set. This function will return true
4443 * if the device associated with 'pvtp' is a NVME device, else it will
4444diff --git a/include/sg_cmds_extra.h b/include/sg_cmds_extra.h
4445index 974d17c..dde2298 100644
4446--- a/include/sg_cmds_extra.h
4447+++ b/include/sg_cmds_extra.h
4448@@ -6,6 +6,8 @@
4449 * All rights reserved.
4450 * Use of this source code is governed by a BSD-style
4451 * license that can be found in the BSD_LICENSE file.
4452+ *
4453+ * SPDX-License-Identifier: BSD-2-Clause
4454 */
4455
4456 #include <stdint.h>
4457diff --git a/include/sg_cmds_mmc.h b/include/sg_cmds_mmc.h
4458index 3988b1d..c9b7d73 100644
4459--- a/include/sg_cmds_mmc.h
4460+++ b/include/sg_cmds_mmc.h
4461@@ -6,6 +6,8 @@
4462 * All rights reserved.
4463 * Use of this source code is governed by a BSD-style
4464 * license that can be found in the BSD_LICENSE file.
4465+ *
4466+ * SPDX-License-Identifier: BSD-2-Clause
4467 */
4468
4469 #ifdef __cplusplus
4470diff --git a/include/sg_io_linux.h b/include/sg_io_linux.h
4471index b57aa63..4766e2a 100644
4472--- a/include/sg_io_linux.h
4473+++ b/include/sg_io_linux.h
4474@@ -6,10 +6,12 @@
4475 * All rights reserved.
4476 * Use of this source code is governed by a BSD-style
4477 * license that can be found in the BSD_LICENSE file.
4478+ *
4479+ * SPDX-License-Identifier: BSD-2-Clause
4480 */
4481
4482 /*
4483- * Version 1.06 [20180119]
4484+ * Version 1.07 [20181211]
4485 */
4486
4487 /*
4488@@ -158,6 +160,14 @@ struct sg_io_hdr;
4489 int sg_chk_n_print3(const char * leadin, struct sg_io_hdr * hp,
4490 bool raw_sinfo);
4491
4492+/* Returns 1 if no errors found and thus nothing printed; otherwise
4493+ * prints error/warning (prefix by 'leadin') to stderr (pr2ws) and
4494+ * returns 0. */
4495+int sg_linux_sense_print(const char * leadin, int scsi_status,
4496+ int host_status, int driver_status,
4497+ const uint8_t * sense_buffer, int sb_len,
4498+ bool raw_sinfo);
4499+
4500 /* Calls sg_scsi_normalize_sense() after obtaining the sense buffer and
4501 its length from the struct sg_io_hdr pointer. If these cannot be
4502 obtained, false is returned. */
4503diff --git a/include/sg_lib.h b/include/sg_lib.h
4504index e860b92..1ece717 100644
4505--- a/include/sg_lib.h
4506+++ b/include/sg_lib.h
4507@@ -2,10 +2,12 @@
4508 #define SG_LIB_H
4509
4510 /*
4511- * Copyright (c) 2004-2018 Douglas Gilbert.
4512+ * Copyright (c) 2004-2019 Douglas Gilbert.
4513 * All rights reserved.
4514 * Use of this source code is governed by a BSD-style
4515 * license that can be found in the BSD_LICENSE file.
4516+ *
4517+ * SPDX-License-Identifier: BSD-2-Clause
4518 */
4519
4520 /*
4521@@ -178,10 +180,10 @@ struct sg_scsi_sense_hdr {
4522 uint8_t sense_key;
4523 uint8_t asc;
4524 uint8_t ascq;
4525- uint8_t byte4;
4526- uint8_t byte5;
4527+ uint8_t byte4; /* descriptor: SDAT_OVFL; fixed: lower three ... */
4528+ uint8_t byte5; /* ... bytes of INFO field */
4529 uint8_t byte6;
4530- uint8_t additional_length;
4531+ uint8_t additional_length; /* zero for fixed format sense data */
4532 };
4533
4534 /* Maps the salient data from a sense buffer which is in either fixed or
4535@@ -269,6 +271,18 @@ int sg_get_designation_descriptor_str(const char * leadin,
4536 bool print_assoc, bool do_long,
4537 int blen, char * b);
4538
4539+/* Expects a T10 UUID designator (as found in the Device Identification VPD
4540+ * page) pointed to by 'dp'. To not produce an error string in 'b', c_set
4541+ * should be 1 (binary) and dlen should be 18. Currently T10 only supports
4542+ * locally assigned UUIDs. Writes output to string 'b' of no more than blen
4543+ * bytes and returns the number of bytes actually written to 'b' but doesn't
4544+ * count the trailing null character it always appends (if blen > 0). 'lip'
4545+ * is lead-in string (on each line) than may be NULL. skip_prefix avoids
4546+ * outputting: ' Locally assigned UUID: ' before the UUID. */
4547+int sg_t10_uuid_desig2str(const uint8_t * dp, int dlen, int c_set,
4548+ bool do_long, bool skip_prefix,
4549+ const char * lip, int blen, char * b);
4550+
4551 /* Yield string associated with peripheral device type (pdt). Returns
4552 * 'buff'. If 'pdt' out of range yields "bad pdt" string. */
4553 char * sg_get_pdt_str(int pdt, int buff_len, char * buff);
4554@@ -364,9 +378,21 @@ extern FILE * sg_warnings_strm;
4555
4556 void sg_set_warnings_strm(FILE * warnings_strm);
4557
4558+/* Given a SCSI command pointed to by cdbp of sz bytes this function forms a
4559+ * SCSI command in ASCII hex surrounded by square brackets in 'b'. 'b' is at
4560+ * least blen bytes long. If cmd_name is true then the command is prefixed
4561+ * by its SCSI command name (e.g. "VERIFY(10) [2f ...]". The command is
4562+ * shown as spaced separated pairs of hexadecimal digits (i.e. 0-9, a-f).
4563+ * Each pair represents byte. The leftmost pair of digits is cdbp[0] . If
4564+ * sz <= 0 then this function tries to guess the length of the command. */
4565+char *
4566+sg_get_command_str(const uint8_t * cdbp, int sz, bool cmd_name, int blen,
4567+ char * b);
4568+
4569 /* The following "print" functions send ASCII to 'sg_warnings_strm' file
4570 * descriptor (default value is stderr). 'leadin' is string prepended to
4571 * each line printed out, NULL treated as "". */
4572+void sg_print_command_len(const uint8_t * command, int len);
4573 void sg_print_command(const uint8_t * command);
4574 void sg_print_scsi_status(int scsi_status);
4575
4576@@ -450,6 +476,8 @@ bool sg_exit2str(int exit_status, bool longer, int b_len, char * b);
4577 #define SG_LIB_CAT_TASK_ABORTED 29 /* SCSI status, this command aborted by? */
4578 #define SG_LIB_CONTRADICT 31 /* error involving two or more cl options */
4579 #define SG_LIB_LOGIC_ERROR 32 /* unexpected situation in code */
4580+#define SG_LIB_WINDOWS_ERR 34 /* Windows error number don't fit in 7 bits so
4581+ * map to a single value for exit statuses */
4582 #define SG_LIB_OK_FALSE 36 /* no error, reporting false (cf. no error,
4583 * reporting true is SG_LIB_OK_TRUE(0) ) */
4584 #define SG_LIB_CAT_PROTECTION 40 /* subset of aborted command (for PI, DIF)
4585@@ -553,6 +581,16 @@ void hex2stderr(const uint8_t * b_str, int len, int no_ascii);
4586 int hex2str(const uint8_t * b_str, int len, const char * leadin, int format,
4587 int cb_len, char * cbp);
4588
4589+/* Read ASCII hex bytes or binary from fname (a file named '-' taken as
4590+ * stdin). If reading ASCII hex then there should be either one entry per
4591+ * line or a comma, space or tab separated list of bytes. If no_space is
4592+ * set then a string of ACSII hex digits is expected, 2 per byte. Everything
4593+ * from and including a '#' on a line is ignored. Returns 0 if ok, or an
4594+ * error code. If the error code is SG_LIB_LBA_OUT_OF_RANGE then mp_arr
4595+ * would be exceeded and both mp_arr and mp_arr_len are written to. */
4596+int sg_f2hex_arr(const char * fname, bool as_binary, bool no_space,
4597+ uint8_t * mp_arr, int * mp_arr_len, int max_arr_len);
4598+
4599 /* Returns true when executed on big endian machine; else returns false.
4600 * Useful for displaying ATA identify words (which need swapping on a
4601 * big endian machine). */
4602@@ -587,13 +625,14 @@ int sg_ata_get_chars(const uint16_t * word_arr, int start_word,
4603 void dWordHex(const uint16_t * words, int num, int no_ascii, bool swapb);
4604
4605 /* If the number in 'buf' can not be decoded or the multiplier is unknown
4606- * then -1 is returned. Accepts a hex prefix (0x or 0X) or a 'h' (or 'H')
4607- * suffix. Otherwise a decimal multiplier suffix may be given. Recognised
4608- * multipliers: c C *1; w W *2; b B *512; k K KiB *1,024;
4609- * KB *1,000; m M MiB *1,048,576; MB *1,000,000; g G GiB *1,073,741,824;
4610- * GB *1,000,000,000 and <n>x<m> which multiplies <n> by <m> . Ignore leading
4611- * spaces and tabs; accept comma, hyphen, space, tab and hash as terminator.
4612- */
4613+ * then -1 is returned. Accepts a hex prefix (0x or 0X) or a decimal
4614+ * multiplier suffix (as per GNU's dd (since 2002: SI and IEC 60027-2)).
4615+ * Main (SI) multipliers supported: K, M, G. Ignore leading spaces and
4616+ * tabs; accept comma, hyphen, space, tab and hash as terminator.
4617+ * Handles zero and positive values up to 2**31-1 .
4618+ * Experimental: left argument (must in with hexadecimal digit) added
4619+ * to, or multiplied, by right argument. No embedded spaces.
4620+ * Examples: '3+1k' (evaluates to 1027) and '0xf+0x3'. */
4621 int sg_get_num(const char * buf);
4622
4623 /* If the number in 'buf' can not be decoded then -1 is returned. Accepts a
4624@@ -604,12 +643,14 @@ int sg_get_num(const char * buf);
4625 int sg_get_num_nomult(const char * buf);
4626
4627 /* If the number in 'buf' can not be decoded or the multiplier is unknown
4628- * then -1LL is returned. Accepts a hex prefix (0x or 0X) or a 'h' (or 'H')
4629- * suffix. Otherwise a decimal multiplier suffix may be given. In addition
4630- * to supporting the multipliers of sg_get_num(), this function supports:
4631- * t T TiB *(2**40); TB *(10**12); p P PiB *(2**50); PB *(10**15) .
4632- * Ignore leading spaces and tabs; accept comma, hyphen, space, tab and hash
4633- * as terminator. */
4634+ * then -1LL is returned. Accepts a hex prefix (0x or 0X), hex suffix
4635+ * (h or H), or a decimal multiplier suffix (as per GNU's dd (since 2002:
4636+ * SI and IEC 60027-2)). Main (SI) multipliers supported: K, M, G, T, P
4637+ * and E. Ignore leading spaces and tabs; accept comma, hyphen, space, tab
4638+ * and hash as terminator. Handles zero and positive values up to 2**63-1 .
4639+ * Experimental: the left argument (must end in with hexadecimal digit)
4640+ * added to, or multiplied by, the right argument. No embedded spaces.
4641+ * Examples: '3+1k' (evaluates to 1027) and '0xf+0x3'. */
4642 int64_t sg_get_llnum(const char * buf);
4643
4644 /* If the number in 'buf' can not be decoded then -1 is returned. Accepts a
4645diff --git a/include/sg_lib_data.h b/include/sg_lib_data.h
4646index a870043..2f142a2 100644
4647--- a/include/sg_lib_data.h
4648+++ b/include/sg_lib_data.h
4649@@ -2,10 +2,12 @@
4650 #define SG_LIB_DATA_H
4651
4652 /*
4653- * Copyright (c) 2007-2018 Douglas Gilbert.
4654+ * Copyright (c) 2007-2019 Douglas Gilbert.
4655 * All rights reserved.
4656 * Use of this source code is governed by a BSD-style
4657 * license that can be found in the BSD_LICENSE file.
4658+ *
4659+ * SPDX-License-Identifier: BSD-2-Clause
4660 */
4661
4662 /*
4663@@ -86,6 +88,14 @@ struct sg_lib_4tuple_u8 {
4664 uint8_t t4;
4665 };
4666
4667+struct sg_cmd_response_t {
4668+ int din_len;
4669+ int dout_len;
4670+ int resid;
4671+ int resid2;
4672+ const uint8_t * sbp;
4673+};
4674+
4675
4676 extern const char * sg_lib_version_str;
4677
4678diff --git a/include/sg_linux_inc.h b/include/sg_linux_inc.h
4679index 1f76018..e6f6b52 100644
4680--- a/include/sg_linux_inc.h
4681+++ b/include/sg_linux_inc.h
4682@@ -12,6 +12,7 @@
4683 #include <linux/../scsi/sg.h>
4684 #include <linux/../scsi/scsi.h>
4685 #else
4686+ #define __user
4687 #include <scsi/sg.h>
4688 #include <scsi/scsi.h>
4689 #endif
4690diff --git a/include/sg_pr2serr.h b/include/sg_pr2serr.h
4691index c317f5b..351b3e3 100644
4692--- a/include/sg_pr2serr.h
4693+++ b/include/sg_pr2serr.h
4694@@ -6,6 +6,8 @@
4695 * All rights reserved.
4696 * Use of this source code is governed by a BSD-style
4697 * license that can be found in the BSD_LICENSE file.
4698+ *
4699+ * SPDX-License-Identifier: BSD-2-Clause
4700 */
4701
4702 /* These are convenience functions that replace the somewhat long-winded
4703diff --git a/include/sg_pt.h b/include/sg_pt.h
4704index c882893..2be9cbf 100644
4705--- a/include/sg_pt.h
4706+++ b/include/sg_pt.h
4707@@ -2,10 +2,12 @@
4708 #define SG_PT_H
4709
4710 /*
4711- * Copyright (c) 2005-2018 Douglas Gilbert.
4712+ * Copyright (c) 2005-2019 Douglas Gilbert.
4713 * All rights reserved.
4714 * Use of this source code is governed by a BSD-style
4715 * license that can be found in the BSD_LICENSE file.
4716+ *
4717+ * SPDX-License-Identifier: BSD-2-Clause
4718 */
4719
4720 #include <stdint.h>
4721@@ -170,9 +172,12 @@ int do_scsi_pt(struct sg_pt_base * objp, int fd, int timeout_secs,
4722 * belongs to. */
4723 int get_scsi_pt_result_category(const struct sg_pt_base * objp);
4724
4725-/* If not available return 0 which implies there is no residual
4726- * value. If supported the number of bytes actually sent back by
4727- * the device is 'dxfer_ilen - get_scsi_pt_len()' bytes. */
4728+/* If not available return 0 which implies there is no residual value. If
4729+ * supported it is the number of bytes requested to transfer less the
4730+ * number actually transferred. This it typically important for data-in
4731+ * transfers. For data-out (only) transfers, the 'dout_req_len -
4732+ * dout_act_len' is returned. For bidi transfer the data-in residual is
4733+ * returned. */
4734 int get_scsi_pt_resid(const struct sg_pt_base * objp);
4735
4736 /* Returns SCSI status value (from device that received the command). If an
4737@@ -188,6 +193,7 @@ uint32_t get_pt_result(const struct sg_pt_base * objp);
4738 /* Actual sense length returned. If sense data is present but
4739 actual sense length is not known, return 'max_sense_len' */
4740 int get_scsi_pt_sense_len(const struct sg_pt_base * objp);
4741+uint8_t * get_scsi_pt_sense_buf(const struct sg_pt_base * objp);
4742
4743 /* If not available return 0 (for success). */
4744 int get_scsi_pt_os_err(const struct sg_pt_base * objp);
4745@@ -205,6 +211,19 @@ char * get_scsi_pt_transport_err_str(const struct sg_pt_base * objp,
4746 * command. */
4747 int get_scsi_pt_duration_ms(const struct sg_pt_base * objp);
4748
4749+/* If not available return 0 otherwise return number of nanoseconds that the
4750+ * lower layers (and hardware) took to execute the command just completed. */
4751+uint64_t get_pt_duration_ns(const struct sg_pt_base * objp);
4752+
4753+/* The two functions yield requested and actual data transfer lengths in
4754+ * bytes. The second argument is a pointer to the data-in length; the third
4755+ * argument is a pointer to the data-out length. The pointers may be NULL.
4756+ * The _actual_ values are related to resid (residual count from DMA) */
4757+void get_pt_req_lengths(const struct sg_pt_base * objp, int * req_dinp,
4758+ int * req_doutp);
4759+void get_pt_actual_lengths(const struct sg_pt_base * objp, int * act_dinp,
4760+ int * act_doutp);
4761+
4762 /* Return true if device associated with 'objp' uses NVMe command set. To
4763 * be useful (in modifying the type of command sent (SCSI or NVMe) then
4764 * construct_scsi_pt_obj_with_fd() should be used followed by an invocation
4765diff --git a/include/sg_pt_linux.h b/include/sg_pt_linux.h
4766index 00010ba..eb451e8 100644
4767--- a/include/sg_pt_linux.h
4768+++ b/include/sg_pt_linux.h
4769@@ -6,6 +6,8 @@
4770 * All rights reserved.
4771 * Use of this source code is governed by a BSD-style
4772 * license that can be found in the BSD_LICENSE file.
4773+ *
4774+ * SPDX-License-Identifier: BSD-2-Clause
4775 */
4776
4777 #include <stdint.h>
4778@@ -40,6 +42,25 @@ extern "C" {
4779 #define BSG_FLAG_Q_AT_TAIL 0x10 /* default is Q_AT_HEAD */
4780 #define BSG_FLAG_Q_AT_HEAD 0x20
4781
4782+#ifndef SGV4_FLAG_YIELD_TAG
4783+#define SGV4_FLAG_YIELD_TAG 0x8
4784+#endif
4785+#ifndef SGV4_FLAG_FIND_BY_TAG
4786+#define SGV4_FLAG_FIND_BY_TAG 0x100
4787+#endif
4788+#ifndef SGV4_FLAG_IMMED
4789+#define SGV4_FLAG_IMMED 0x400
4790+#endif
4791+#ifndef SGV4_FLAG_IMMED
4792+#define SGV4_FLAG_IMMED 0x400
4793+#endif
4794+#ifndef SGV4_FLAG_DEV_SCOPE
4795+#define SGV4_FLAG_DEV_SCOPE 0x1000
4796+#endif
4797+#ifndef SGV4_FLAG_SHARE
4798+#define SGV4_FLAG_SHARE 0x2000
4799+#endif
4800+
4801 struct sg_io_v4 {
4802 __s32 guard; /* [i] 'Q' to differentiate from v3 */
4803 __u32 protocol; /* [i] 0 -> SCSI , .... */
4804@@ -48,10 +69,10 @@ struct sg_io_v4 {
4805
4806 __u32 request_len; /* [i] in bytes */
4807 __u64 request; /* [i], [*i] {SCSI: cdb} */
4808- __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
4809+ __u64 request_tag; /* [i] {in sg 4.0+ this is out parameter} */
4810 __u32 request_attr; /* [i] {SCSI: task attribute} */
4811 __u32 request_priority; /* [i] {SCSI: task priority} */
4812- __u32 request_extra; /* [i] {spare, for padding} */
4813+ __u32 request_extra; /* [i] {used for pack_id} */
4814 __u32 max_response_len; /* [i] in bytes */
4815 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
4816
4817@@ -104,6 +125,7 @@ struct sg_pt_linux_scsi {
4818 int dev_fd; /* -1 if not given (yet) */
4819 int in_err;
4820 int os_err;
4821+ int sg_version; /* for deciding whether to use v3 or v4 interface */
4822 uint32_t nvme_nsid; /* 1 to 0xfffffffe are possibly valid, 0
4823 * implies dev_fd is not a NVMe device
4824 * (is_nvme=false) or it is a NVMe char
4825@@ -157,6 +179,7 @@ extern long sg_lin_page_size;
4826
4827 void sg_find_bsg_nvme_char_major(int verbose);
4828 int sg_do_nvme_pt(struct sg_pt_base * vp, int fd, int time_secs, int vb);
4829+int sg_linux_get_sg_version(const struct sg_pt_base * vp);
4830
4831 /* This trims given NVMe block device name in Linux (e.g. /dev/nvme0n1p5)
4832 * to the name of its associated char device (e.g. /dev/nvme0). If this
4833@@ -165,7 +188,6 @@ int sg_do_nvme_pt(struct sg_pt_base * vp, int fd, int time_secs, int vb);
4834 bool sg_get_nvme_char_devname(const char * nvme_block_devname, uint32_t b_len,
4835 char * b);
4836
4837-
4838 #ifdef __cplusplus
4839 }
4840 #endif
4841diff --git a/include/sg_pt_nvme.h b/include/sg_pt_nvme.h
4842index a910b05..590b4de 100644
4843--- a/include/sg_pt_nvme.h
4844+++ b/include/sg_pt_nvme.h
4845@@ -2,10 +2,12 @@
4846 #define SG_PT_NVME_H
4847
4848 /*
4849- * Copyright (c) 2017-2018 Douglas Gilbert.
4850+ * Copyright (c) 2017-2019 Douglas Gilbert.
4851 * All rights reserved.
4852 * Use of this source code is governed by a BSD-style
4853 * license that can be found in the BSD_LICENSE file.
4854+ *
4855+ * SPDX-License-Identifier: BSD-2-Clause
4856 */
4857
4858 #include <stdint.h>
4859@@ -27,9 +29,9 @@ extern "C" {
4860 * are exceptions, for example the EUI-64 identifiers in the Admin Identify
4861 * response are big endian.
4862 *
4863- * Code online (e.g. nvme-cli at github.com) seems to like packed strcutures,
4864- * the author prefers byte offset plus a range of unaligned integer builders
4865- * such as those in sg_unaligned.h .
4866+ * Code online (e.g. nvme-cli at github.com) seems to favour packed
4867+ * structures, while the author prefers byte offset plus a range of unaligned
4868+ * integer builders such as those in sg_unaligned.h .
4869 */
4870
4871 #ifdef __GNUC__
4872@@ -181,8 +183,6 @@ struct sg_opcode_info_t {
4873 /* Vendor specific (sg3_utils) VPD pages */
4874 #define SG_NVME_VPD_NICR 0xde /* NVME Identify controller response */
4875
4876-extern struct sg_opcode_info_t sg_opcode_info_arr[];
4877-
4878
4879 /* Given the NVMe Identify Controller response and optionally the NVMe
4880 * Identify Namespace response (NULL otherwise), generate the SCSI VPD
4881@@ -211,6 +211,10 @@ int sntl_resp_mode_select10(struct sg_sntl_dev_state_t * dsp,
4882 const uint8_t * cdbp, const uint8_t * dop,
4883 int do_len, struct sg_sntl_result_t * resp);
4884
4885+/* Returns pointer to array of struct sg_opcode_info_t of SCSI commands
4886+ * translated to NVMe. */
4887+const struct sg_opcode_info_t * sg_get_opcode_translation(void);
4888+
4889 #ifdef __cplusplus
4890 }
4891 #endif
4892diff --git a/include/sg_unaligned.h b/include/sg_unaligned.h
4893index ca702e8..0a65b39 100644
4894--- a/include/sg_unaligned.h
4895+++ b/include/sg_unaligned.h
4896@@ -6,6 +6,8 @@
4897 * All rights reserved.
4898 * Use of this source code is governed by a BSD-style
4899 * license that can be found in the BSD_LICENSE file.
4900+ *
4901+ * SPDX-License-Identifier: BSD-2-Clause
4902 */
4903
4904 #include <stdbool.h>
4905diff --git a/inhex/README b/inhex/README
4906new file mode 100644
4907index 0000000..d765466
4908--- /dev/null
4909+++ b/inhex/README
4910@@ -0,0 +1,50 @@
4911+ Hex data for various sg3_utils utilities
4912+ ========================================
4913+
4914+The files in this folder contain hexadecimal data (in ASCII) and associated
4915+comments (prefixed with the hash mark symbol ('#')).
4916+
4917+The utility that each hex file is associated with can be determined by
4918+prepending "sg_" to these filenames then going to the 'src' folder (a
4919+sibling folder to this one) and look for a match or partial match on
4920+the name.
4921+
4922+For example:
4923+ vpd_dev_id.hex
4924+after prepending 'sg_' becomes:
4925+ sg_vpd_dev_id.hex
4926+which is a partial match on the sg_vpd utility.
4927+The remaining 'dev_id.hex' is meant to suggest the 'device identifier'
4928+VPD page which is a mandatory VPD page.
4929+
4930+Assuming sg3_utils is installed, it can be tested like this:
4931+ sg_vpd --inhex=<folder_holding_sg3_utils>/inhex/vpd_dev_id.hex
4932+
4933+And should output this:
4934+
4935+Device Identification VPD page:
4936+ Addressed logical unit:
4937+ designator type: NAA, code set: Binary
4938+ 0x5000c5003011cb2b
4939+ Target port:
4940+ designator type: NAA, code set: Binary
4941+ transport: Serial Attached SCSI Protocol (SPL-4)
4942+ 0x5000c5003011cb29
4943+ designator type: Relative target port, code set: Binary
4944+ transport: Serial Attached SCSI Protocol (SPL-4)
4945+ Relative target port: 0x1
4946+ Target device that contains addressed lu:
4947+ designator type: NAA, code set: Binary
4948+ transport: Serial Attached SCSI Protocol (SPL-4)
4949+ 0x5000c5003011cb28
4950+ designator type: SCSI name string, code set: UTF-8
4951+ SCSI name string:
4952+ naa.5000C5003011CB28
4953+
4954+
4955+Users are encouraged to send the author any ASCII hex files for utilities
4956+that support --inhex and don't have hex data already. Special cases are
4957+also welcome. They help the author test this code.
4958+
4959+Douglas Gilbert
4960+28th August 2019
4961diff --git a/inhex/get_elem_status.hex b/inhex/get_elem_status.hex
4962new file mode 100644
4963index 0000000..7db83c8
4964--- /dev/null
4965+++ b/inhex/get_elem_status.hex
4966@@ -0,0 +1,35 @@
4967+# To test sg_get_elem_status with dummy response to the SCSI
4968+# GET PHYSICAL ELEMENT SATUS command
4969+
4970+0 0 0 4
4971+0 0 0 2
4972+0 0 0 2
4973+
4974+0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4975+
4976+# first descriptor
4977+0 0 0 0
4978+0 0 0 1
4979+
4980+0 0 0 0 0
4981+0
4982+1
4983+2c
4984+0 0 0 0 11 22 33 0
4985+
4986+0 0 0 0 0 0 0 0
4987+
4988+# second descriptor
4989+0 0 0 0
4990+0 0 0 2
4991+
4992+0 0 0 0 0
4993+1
4994+1
4995+fe
4996+ff ff ff ff ff ff ff ff
4997+
4998+0 0 0 0 0 0 0 0
4999+
5000+
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches