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
diff --git a/BSD_LICENSE b/BSD_LICENSE
index 7f1906b..eef2b04 100644
--- a/BSD_LICENSE
+++ b/BSD_LICENSE
@@ -1,5 +1,5 @@
11
2Copyright (c) 1999-2018, Douglas Gilbert2Copyright (c) 1999-2019, Douglas Gilbert
3All rights reserved.3All rights reserved.
44
5Redistribution and use in source and binary forms, with or without5Redistribution and use in source and binary forms, with or without
@@ -22,3 +22,6 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS22(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.23SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2424
25
26Above is the:
27SPDX-License-Identifier: BSD-2-Clause
diff --git a/COVERAGE b/COVERAGE
index 84bd4d4..2d5a7e3 100644
--- a/COVERAGE
+++ b/COVERAGE
@@ -21,6 +21,7 @@ COPY OPERATION ABORT ddptctl, ++
21EXTENDED COPY(LID1) sg_xcopy, ddpt, ++21EXTENDED COPY(LID1) sg_xcopy, ddpt, ++
22GET CONFIGURATION sg_get_config, ++22GET CONFIGURATION sg_get_config, ++
23GET LBA STATUS sg_get_lba_status, ++23GET LBA STATUS sg_get_lba_status, ++
24GET PHYSICAL ELEMENT STATUS sg_get_elem_status, ++
24GET STREAM STATUS sg_stream_ctl25GET STREAM STATUS sg_stream_ctl
25INQUIRY sg_dd, sg_format, sg_inq, sginfo,26INQUIRY sg_dd, sg_format, sg_inq, sginfo,
26 sg_logs, sg_map('-i'), sg_modes, sg_opcodes,27 sg_logs, sg_map('-i'), sg_modes, sg_opcodes,
@@ -28,6 +29,7 @@ INQUIRY sg_dd, sg_format, sg_inq, sginfo,
28FINISH ZONE sg_zone29FINISH ZONE sg_zone
29FORMAT MEDIUM sg_format, ++ [SSC]30FORMAT MEDIUM sg_format, ++ [SSC]
30FORMAT UNIT sg_format, ++ [SBC]31FORMAT UNIT sg_format, ++ [SBC]
32FORMAT WITH PRESET sg_format, ++ [SBC]
31LOG SELECT sg_logs('-r' or '-select'), ++33LOG SELECT sg_logs('-r' or '-select'), ++
32LOG SENSE sg_logs, ++34LOG SENSE sg_logs, ++
33MODE SELECT(6) sdparm, sg_wr_mode, sginfo, sg_format,35MODE SELECT(6) sdparm, sg_wr_mode, sginfo, sg_format,
@@ -158,4 +160,4 @@ THIRD PARTY COPY IN (0x83).
158160
159161
160Douglas Gilbert162Douglas Gilbert
1616th May 201816324th January 2020
diff --git a/CREDITS b/CREDITS
index beefb4c..e48eb44 100644
--- a/CREDITS
+++ b/CREDITS
@@ -11,6 +11,10 @@ Bart Van Assche <bart dot vanassche at sandisk dot com>
11 configure.ac and Makefile.am cleanup plus sgp_dd code11 configure.ac and Makefile.am cleanup plus sgp_dd code
12 to replace pthread_cancel with pthread_kill [20180102]12 to replace pthread_cancel with pthread_kill [20180102]
1313
14Bean Huo <beanhuo dot micron dot com>
15 sg_write_buffer: patch to allow comma or period separated bytes
16 (in decimal or hex) to be decoded when given as standard input.
17
14Brian Bunker <Brian dot Bunker at netapp dot com> contributed18Brian Bunker <Brian dot Bunker at netapp dot com> contributed
15 sg_read_block_limits and the target reset addition to sg_reset19 sg_read_block_limits and the target reset addition to sg_reset
16 [20090615]20 [20090615]
@@ -103,6 +107,8 @@ Mark Knibbs <markk at clara dot co dot uk>
103107
104Martin Schwenke <martin at meltin dot net> added the raw switch "-r" to sg_inq108Martin Schwenke <martin at meltin dot net> added the raw switch "-r" to sg_inq
105109
110Martin Wilck <mwilck at suse dot com> contributed script files [20190425]
111
106Nate Dailey < Nate dot Dailey at stratus dot com > extended sg_map for sparse112Nate Dailey < Nate dot Dailey at stratus dot com > extended sg_map for sparse
107 disk node names (e.g. /dev/sdaaa) [20050511]113 disk node names (e.g. /dev/sdaaa) [20050511]
108114
@@ -139,6 +145,9 @@ Tom Steudten <steudten at gmx dot ch> sginfo addition: add '-Fhead' option
139Trent Piepho <xyzzy at speakeasy dot org> print out some "sense key specific"145Trent Piepho <xyzzy at speakeasy dot org> print out some "sense key specific"
140 data and "-6" switch for sg_modes146 data and "-6" switch for sg_modes
141147
148Xose Vazquez Perez <xose dot vazquez at gmail dot com>
149 documentation corrections [20200117]
150
142151
143Douglas Gilbert152Douglas Gilbert
1442nd January 201815317th January 2020
diff --git a/ChangeLog b/ChangeLog
index 08f598c..3dbfda2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,108 @@ Each utility has its own version number, date of last change and
2some description at the top of its ".c" file. All utilities in the main2some description at the top of its ".c" file. All utilities in the main
3directory have their own "man" pages. There is also a sg3_utils man page.3directory have their own "man" pages. There is also a sg3_utils man page.
44
5Changelog for sg3_utils-1.45 [20200229] [svn: r843]
6 - sg_get_elem_status: new utility [sbc4r16]
7 - sg_ses: bug: --page= being overridden when --control
8 and --data= also given; fix
9 - document explicit Element type codes and example
10 - rename 'SAS SlimLine' to SlimSAS [ses4r02]
11 - add --inhex=FN, equivalent to --data=@FN, for
12 compatibility with other utilities
13 - 'fan speed factor' field added in 20-013r1
14 - sg_opcodes: expand MLU (now 2 bits, spc5r20)
15 - include RWCDLP field as extension of CDLP
16 field (spc5r01)
17 - sg_write_buffer: allow comma and period separated
18 lists when input from stdin
19 - sg_inq: update version descriptors to spc5r21
20 - add some NVMe 1.4 snippets to ctl identify
21 - sg_format: add --dcrt used twice (FOV=1 DCRT=0)
22 - add support for FORMAT WITH PRESET (sbc4r18)
23 - sg_raw: fix --send bug when using stdin
24 - sg_vpd: 3pc VPD page add copy group descriptor
25 - add --examine option
26 - new zoned block device char. field (zbc2r04)
27 - sg_read_buffer: decode read microcode status page
28 - add --inhex=FN option
29 - sg_request: add --error option, replaces opcode
30 with 0xff (or skips call to pass-through)
31 - sg_get_lba_status: add --inhex=FN option
32 - sg_xcopy: add --fco (fast copy only) (spc5r20)
33 - implement --app=1 (append) on regular OFILE type
34 - sg_scan (win32): expand limits for big arrays
35 - sg_modes: placeholders for Command duration limit
36 T2A and T2B mpages (sbc4r17)
37 - improve zbc support (e.g. caching mpage)
38 - sg_logs: add Command duration limits statistics
39 lpage (spc6r01)
40 - zoned block device statistics log page: shorten
41 counter fields from 8 to 4 bytes (zbc2r02)
42 - new field in this log page (zbc2r04)
43 - change '-ll' option to suppress subpages=0xff
44 apart from page 0x0,0xff. Used three times:
45 list all pages and subpages names reported
46 - sg_reassign: for defect list format 6 (vendor
47 specific) don't try to decode
48 - sg_rep_zones: expand some fields per zbc2r04
49 - add --num= and --wp options
50 - sg_verify: correct so issues VERIFY(16)
51 - add --0 and --ff options and implement
52 bytchk=3 properly
53 - sg_write_same: add --ff for 0xff fill
54 - sg_luns: report new "target commands" w-lun (19-117)
55 - sg_dd: add --verify support
56 - sgp_dd: support memory-mapped IO via mmap flag
57 - inhex directory: new, contains ASCII hex files
58 that can be used with the '--inhex=' option
59 - sg_lib: add sg_t10_uuid_desig2str()
60 - add sg_get_command_str and sg_print_command_len()
61 - speed up sg_print_command()
62 - sg_scsi_normalize_sense(): populate byte4,5,6
63 - tweak sg_pt interface to better handle bidi
64 - sg_cmds_process_resp(): two arguments removed
65 - add ${PACKAGE_VERSION} to '.so' name
66 - add sg_f2hex_arr()
67 - update some tables for NVMe 1.4
68 - sg_get_num()+sg_get_llnum(): add 'e' decoding,
69 - asc/ascq match asc-num.txt @t10 20191014
70 exabytes; allow addition (e.g. --count=3+1k)
71 - new zbc2r04 service actions
72 - sg_pt_freebsd: fixes for FreeBSD 12.0 release
73 - scripts: update 54-before-scsi-sg3_id.rules,
74 scsi-enable-target-scan.sh and
75 59-fc-wwpn-id.rules
76 - linux: add nanosecond durations when
77 SG3_UTILS_LINUX_NANO environment variable given
78 and Linux sg driver >= 4.0.30
79 - rescan-scsi-bus: widen LUN 0 only scanning
80 - multiple patches to sync with Suse
81 - testing/sg_tst_async: fix free_list issue
82 - testing/sg_tst_ioctl: for sg 4.0 driver
83 - testing/sg_tst_bidi: for sg 4.0 driver
84 - testing/sgh_dd: test request sharing, mreqs...
85 - add --verify support
86 - testing/sgs_dd: back from archive, for testing
87 - testing/sg_chk_asc: allow LF and CR/LF in asc-num.txt
88 - testing: 'make' now builds both C and C++ programs
89 SIGPOLL (SIGIO) and realtime (RT) signals
90 - sg_pt: add sg_get_opcode_translation() to replace
91 global pointer to array: sg_opcode_info_arr[]
92 - extend small SNTL to support read capacity
93 - utils/hxascdmp: add -o=<offset> option
94 - add -1, -2 and -q options
95 - sg_io_linux (sg_lib): add sg_linux_sense_print()
96 - sg_pt_linux: uses sg v4 interface if sg driver
97 >= 4.0.0 . Force sg v3 always by building with
98 './configure --disable-linux-sgv4'
99 - add sg_linux_get_sg_version() function
100 - add: 'SPDX-License-Identifier: BSD-2-Clause'
101 or a small number of 'GPL-2.0-or-later'
102 - gcc-9: suppress (pointless) warnings
103 - automake: upgrade to version 1.16.1
104 - autoconf: upgrade to version 2.69
105 - sync with fixes from Redhat, via github
106
5Changelog for sg3_utils-1.44 [20180912] [svn: r791]107Changelog for sg3_utils-1.44 [20180912] [svn: r791]
6 - same code as release 1.43 20180911 svn rev 789;108 - same code as release 1.43 20180911 svn rev 789;
7 new release due to sync problem with git mirror at:109 new release due to sync problem with git mirror at:
diff --git a/Makefile.am b/Makefile.am
index 0417ee9..77b0716 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,4 +10,6 @@ EXTRA_DIST=autogen.sh COVERAGE CREDITS
10distclean-local:10distclean-local:
11 rm -rf autom4te.cache11 rm -rf autom4te.cache
12 rm -f build-stamp configure-stamp12 rm -f build-stamp configure-stamp
13 rm -rf lib/.deps
14 rm -rf src/.deps
1315
diff --git a/Makefile.in b/Makefile.in
index fb215b2..ddb8090 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
1# Makefile.in generated by automake 1.15.1 from Makefile.am.1# Makefile.in generated by automake 1.16.1 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994-2017 Free Software Foundation, Inc.4# Copyright (C) 1994-2018 Free Software Foundation, Inc.
55
6# This Makefile.in is free software; the Free Software Foundation6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,7# gives unlimited permission to copy and/or distribute it,
@@ -134,7 +134,7 @@ am__recursive_targets = \
134 $(RECURSIVE_CLEAN_TARGETS) \134 $(RECURSIVE_CLEAN_TARGETS) \
135 $(am__extra_recursive_targets)135 $(am__extra_recursive_targets)
136AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \136AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
137 cscope distdir dist dist-all distcheck137 cscope distdir distdir-am dist dist-all distcheck
138am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \138am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
139 $(LISP)config.h.in139 $(LISP)config.h.in
140# Read a list of newline-separated strings from the standard input,140# Read a list of newline-separated strings from the standard input,
@@ -354,8 +354,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
354 echo ' $(SHELL) ./config.status'; \354 echo ' $(SHELL) ./config.status'; \
355 $(SHELL) ./config.status;; \355 $(SHELL) ./config.status;; \
356 *) \356 *) \
357 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \357 echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
358 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \358 cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
359 esac;359 esac;
360360
361$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)361$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -497,7 +497,10 @@ distclean-tags:
497 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags497 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
498 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files498 -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
499499
500distdir: $(DISTFILES)500distdir: $(BUILT_SOURCES)
501 $(MAKE) $(AM_MAKEFLAGS) distdir-am
502
503distdir-am: $(DISTFILES)
501 $(am__remove_distdir)504 $(am__remove_distdir)
502 test -d "$(distdir)" || mkdir "$(distdir)"505 test -d "$(distdir)" || mkdir "$(distdir)"
503 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \506 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -815,6 +818,8 @@ uninstall-am:
815distclean-local:818distclean-local:
816 rm -rf autom4te.cache819 rm -rf autom4te.cache
817 rm -f build-stamp configure-stamp820 rm -f build-stamp configure-stamp
821 rm -rf lib/.deps
822 rm -rf src/.deps
818823
819# Tell versions [3.59,3.63) of GNU make to not export all variables.824# Tell versions [3.59,3.63) of GNU make to not export all variables.
820# Otherwise a system limit (for SysV at least) may be exceeded.825# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/README b/README
index 8a741e3..b88dd44 100644
--- a/README
+++ b/README
@@ -203,7 +203,7 @@ and disable the creation of the shared library (libsgutils<num>.so) this
203invocation could be used: "./configure --prefix=/usr --disable-shared".203invocation could be used: "./configure --prefix=/usr --disable-shared".
204To reduce the size of an executable as well try this:204To reduce the size of an executable as well try this:
205"./configure --prefix=/usr --disable-shared --disable-scsistrings".205"./configure --prefix=/usr --disable-shared --disable-scsistrings".
206Also --disable-shared will produce (realtively) "static" executables in206Also --disable-shared will produce (relatively) "static" executables in
207the src directory that are easier to debug. And207the src directory that are easier to debug. And
208"./configure --enable-debug" will compile with more debug type options,208"./configure --enable-debug" will compile with more debug type options,
209including more compiler checks and defining "DEBUG" within the src and209including more compiler checks and defining "DEBUG" within the src and
@@ -259,13 +259,14 @@ Here is list in alphabetical order of utilities found in the 'src'
259subdirectory of the sg3_utils package:259subdirectory of the sg3_utils package:
260 sginfo, sg_bt_ctl, sg_compare_and_write, sg_copy_results, sgm_dd, sgp_dd,260 sginfo, sg_bt_ctl, sg_compare_and_write, sg_copy_results, sgm_dd, sgp_dd,
261 sg_dd, sg_decode_sense, sg_emc_trespass, sg_format, sg_get_config,261 sg_dd, sg_decode_sense, sg_emc_trespass, sg_format, sg_get_config,
262 sg_get_lba_status, sg_ident, sg_inq, sg_logs, sg_luns, sg_map, sg_map26,262 sg_get_elem_status, sg_get_lba_status, sg_ident, sg_inq, sg_logs,
263 sg_modes, sg_opcodes, sg_persist, sg_prevent, sg_raw, sg_rbuf, sg_rdac,263 sg_luns, sg_map, sg_map26, sg_modes, sg_opcodes, sg_persist, sg_prevent,
264 sg_read, sg_read_attr, sg_readcap, sg_read_block_limits, sg_read_buffer,264 sg_raw, sg_rbuf, sg_rdac, sg_read, sg_read_attr, sg_readcap,
265 sg_read_long, sg_reassign, sg_referrals, sg_request, sg_reset, sg_rmsn,265 sg_read_block_limits, sg_read_buffer, sg_read_long, sg_reassign,
266 sg_rtpg, sg_safte, sg_sanitize, sg_sat_identify, sg_sat_phy_event,266 sg_referrals, sg_request, sg_reset, sg_rmsn, sg_rtpg, sg_safte,
267 sg_sat_read_gplog, sg_sat_set_features, sg_scan, sg_seek, sg_senddiag,267 sg_sanitize, sg_sat_identify, sg_sat_phy_event, sg_sat_read_gplog,
268 sg_ses, sg_ses_microcode, sg_start, sg_stpg, sg_stream_ctl, sg_sync,268 sg_sat_set_features, sg_scan, sg_seek, sg_senddiag, sg_ses,
269 sg_ses_microcode, sg_start, sg_stpg, sg_stream_ctl, sg_sync,
269 sg_test_rwbuff, sg_timestamp, sg_turs, sg_unmap, sg_verify, sg_vpd,270 sg_test_rwbuff, sg_timestamp, sg_turs, sg_unmap, sg_verify, sg_vpd,
270 sg_write_buffer, sg_write_long, sg_write_same, sg_write_verify,271 sg_write_buffer, sg_write_long, sg_write_same, sg_write_verify,
271 sg_write_x, sg_wr_mode, sg_xcopy, sg_zone272 sg_write_x, sg_wr_mode, sg_xcopy, sg_zone
@@ -304,15 +305,14 @@ a "compliant jitter tolerance pattern" (CJTPAT).
304The 'testing' subdirectory contains source and a Makefiles to test305The 'testing' subdirectory contains source and a Makefiles to test
305kernel pass-through and associated drivers, mainly for Linux. There is306kernel pass-through and associated drivers, mainly for Linux. There is
306both C code (with the extension ".c") and C++ code (with the extension307both C code (with the extension ".c") and C++ code (with the extension
307".cpp"). There is a "Makefile" to build the C code and a "Makefile.cplus"308".cpp"). There is a "Makefile" to build the C + C++ code. The Makefile
308to build the C++ code. Both depend on some object files from the "lib"309depends on some object files from the "lib" subdirectory. So a sequence
309subdirectory. So a sequence like this may be required prior to invoking310like this may be required prior to invoking make: "cd <top_of_package> ;
310one of the Makefiles in the directory: "cd <top_of_package> ;
311./configure ; cd lib ; make ; cd ../testing".311./configure ; cd lib ; make ; cd ../testing".
312312
313Here is a list in alphabetical order of utilities found in the 'testing'313Here is a list in alphabetical order of utilities found in the 'testing'
314subdirectory:314subdirectory:
315 - bsg_queue_tst, sg_iovec_tst, sg_queue_tst, sg_sense_tst,315 - bsg_queue_tst, sgh_dd (C++), sg_iovec_tst, sg_queue_tst, sg_sense_tst,
316 sg_tst_async (C++), sg_tst_context (C++), sg_tst_excl (C++),316 sg_tst_async (C++), sg_tst_context (C++), sg_tst_excl (C++),
317 sg_tst_excl2 (C++), sg_tst_excl3 (C++)317 sg_tst_excl2 (C++), sg_tst_excl3 (C++)
318318
@@ -399,6 +399,28 @@ queue limit of 16). Multiple threads doing the same thing act as a
399multiplier to that queue limit.399multiplier to that queue limit.
400400
401401
402NVME Support
403============
404Firstly the author has no intention of extending this package to contain
405general purpose NVMe utilities. That leaves the areas where SCSI overlaps
406with NVMe. There was a SCSI to NVMe Translation Layer (SNTL) driver in the
407Linux kernel based on a white paper from NVM Express. Intel has withdrawn
408that driver and T10 (SCSI) and NVM Express have made no further attempts
409to standardize a SNTL. Given the SCSI to ATA Translation Layer (SATL) which
410is standardized by T10, it is pretty clear what a SNTL should do.
411
412The NVMe Management Interface (NVME-MI) committee have decided to use SES-3
413standard from T10 via the newly added SES Send and SES Receive MI commands.
414So the sg_ses utility and this package's library have been extended to use
415these commands when a NVMe device (typically a disk enclosure) is detected.
416This has been tested by a disk vendor who is happy with the results. Other
417user reports are welcome as the author does not have equipment to test
418this.
419
420Other utilities in this package that use the SES Send and Receive commands,
421or the SNTL in the library are sg_senddiag, sg_inq and sg_readcap.
422
423
402Command line processing424Command line processing
403=======================425=======================
404These utilities can be divided into 3 groups when their handling of command426These utilities can be divided into 3 groups when their handling of command
@@ -519,4 +541,4 @@ See http://sg.danny.cz/sg/tools.html
519541
520542
521Douglas Gilbert543Douglas Gilbert
52228th June 201854417 September 2019
diff --git a/README.freebsd b/README.freebsd
index 7ca25e9..4a720a7 100644
--- a/README.freebsd
+++ b/README.freebsd
@@ -18,6 +18,7 @@ Here is a list of utilities that have been ported:
18 sg_decode_sense18 sg_decode_sense
19 sg_format19 sg_format
20 sg_get_config20 sg_get_config
21 sg_get_elem_status
21 sg_get_lba_status22 sg_get_lba_status
22 sg_ident23 sg_ident
23 sg_inq [dropped ATA IDENTIFY DEVICE capability]24 sg_inq [dropped ATA IDENTIFY DEVICE capability]
@@ -142,4 +143,4 @@ utilities.
142143
143144
144Douglas Gilbert145Douglas Gilbert
14527th January 20181469th September 2019
diff --git a/README.solaris b/README.solaris
index 15e6fec..dac22dc 100644
--- a/README.solaris
+++ b/README.solaris
@@ -35,6 +35,7 @@ Here is a list of utilities that have been ported:
35 sg_decode_sense35 sg_decode_sense
36 sg_format36 sg_format
37 sg_get_config37 sg_get_config
38 sg_get_elem_status
38 sg_get_lba_status39 sg_get_lba_status
39 sg_ident40 sg_ident
40 sg_inq [dropped ATA IDENTIFY DEVICE capability]41 sg_inq [dropped ATA IDENTIFY DEVICE capability]
@@ -163,4 +164,4 @@ disks to accept SCSI commands including the SCSI ATA PASS THROUGH commands.
163164
164165
165Douglas Gilbert166Douglas Gilbert
16627th January 20181679th September 2019
diff --git a/README.win32 b/README.win32
index 41173b6..4711525 100644
--- a/README.win32
+++ b/README.win32
@@ -38,6 +38,7 @@ Here is a list of utilities that have been ported:
38 sg_decode_sense38 sg_decode_sense
39 sg_format39 sg_format
40 sg_get_config40 sg_get_config
41 sg_get_elem_status
41 sg_get_lba_status42 sg_get_lba_status
42 sg_ident43 sg_ident
43 sg_inq [dropped ATA IDENTIFY DEVICE capability]44 sg_inq [dropped ATA IDENTIFY DEVICE capability]
@@ -242,4 +243,4 @@ mode" with the setmode() Windows command.
242243
243244
244Douglas Gilbert245Douglas Gilbert
24527th January 20182469th September 2019
diff --git a/aclocal.m4 b/aclocal.m4
index 087efba..a0e5eda 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
1# generated automatically by aclocal 1.15.1 -*- Autoconf -*-1# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
22
3# Copyright (C) 1996-2017 Free Software Foundation, Inc.3# Copyright (C) 1996-2018 Free Software Foundation, Inc.
44
5# This file is free software; the Free Software Foundation5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,6# gives unlimited permission to copy and/or distribute it,
@@ -4077,7 +4077,8 @@ _LT_EOF
4077 if AC_TRY_EVAL(ac_compile); then4077 if AC_TRY_EVAL(ac_compile); then
4078 # Now try to grab the symbols.4078 # Now try to grab the symbols.
4079 nlist=conftest.nm4079 nlist=conftest.nm
4080 if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then4080 $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
4081 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
4081 # Try sorting and uniquifying the output.4082 # Try sorting and uniquifying the output.
4082 if sort "$nlist" | uniq > "$nlist"T; then4083 if sort "$nlist" | uniq > "$nlist"T; then
4083 mv -f "$nlist"T "$nlist"4084 mv -f "$nlist"T "$nlist"
@@ -6448,7 +6449,7 @@ if test yes != "$_lt_caught_CXX_error"; then
6448 # Commands to make compiler produce verbose output that lists6449 # Commands to make compiler produce verbose output that lists
6449 # what "hidden" libraries, object files and flags are used when6450 # what "hidden" libraries, object files and flags are used when
6450 # linking a shared library.6451 # linking a shared library.
6451 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'6452 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
64526453
6453 else6454 else
6454 GXX=no6455 GXX=no
@@ -6823,7 +6824,7 @@ if test yes != "$_lt_caught_CXX_error"; then
6823 # explicitly linking system object files so we need to strip them6824 # explicitly linking system object files so we need to strip them
6824 # from the output so that they don't get included in the library6825 # from the output so that they don't get included in the library
6825 # dependencies.6826 # dependencies.
6826 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"'6827 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"'
6827 ;;6828 ;;
6828 *)6829 *)
6829 if test yes = "$GXX"; then6830 if test yes = "$GXX"; then
@@ -6888,7 +6889,7 @@ if test yes != "$_lt_caught_CXX_error"; then
6888 # explicitly linking system object files so we need to strip them6889 # explicitly linking system object files so we need to strip them
6889 # from the output so that they don't get included in the library6890 # from the output so that they don't get included in the library
6890 # dependencies.6891 # dependencies.
6891 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"'6892 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"'
6892 ;;6893 ;;
6893 *)6894 *)
6894 if test yes = "$GXX"; then6895 if test yes = "$GXX"; then
@@ -7227,7 +7228,7 @@ if test yes != "$_lt_caught_CXX_error"; then
7227 # Commands to make compiler produce verbose output that lists7228 # Commands to make compiler produce verbose output that lists
7228 # what "hidden" libraries, object files and flags are used when7229 # what "hidden" libraries, object files and flags are used when
7229 # linking a shared library.7230 # linking a shared library.
7230 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'7231 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
72317232
7232 else7233 else
7233 # FIXME: insert proper C++ library support7234 # FIXME: insert proper C++ library support
@@ -7311,7 +7312,7 @@ if test yes != "$_lt_caught_CXX_error"; then
7311 # Commands to make compiler produce verbose output that lists7312 # Commands to make compiler produce verbose output that lists
7312 # what "hidden" libraries, object files and flags are used when7313 # what "hidden" libraries, object files and flags are used when
7313 # linking a shared library.7314 # linking a shared library.
7314 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'7315 output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
7315 else7316 else
7316 # g++ 2.7 appears to require '-G' NOT '-shared' on this7317 # g++ 2.7 appears to require '-G' NOT '-shared' on this
7317 # platform.7318 # platform.
@@ -7322,7 +7323,7 @@ if test yes != "$_lt_caught_CXX_error"; then
7322 # Commands to make compiler produce verbose output that lists7323 # Commands to make compiler produce verbose output that lists
7323 # what "hidden" libraries, object files and flags are used when7324 # what "hidden" libraries, object files and flags are used when
7324 # linking a shared library.7325 # linking a shared library.
7325 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'7326 output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
7326 fi7327 fi
73277328
7328 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'7329 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
@@ -9067,7 +9068,7 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
9067m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])9068m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
9068m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])9069m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
90699070
9070# Copyright (C) 2002-2017 Free Software Foundation, Inc.9071# Copyright (C) 2002-2018 Free Software Foundation, Inc.
9071#9072#
9072# This file is free software; the Free Software Foundation9073# This file is free software; the Free Software Foundation
9073# gives unlimited permission to copy and/or distribute it,9074# gives unlimited permission to copy and/or distribute it,
@@ -9079,10 +9080,10 @@ m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
9079# generated from the m4 files accompanying Automake X.Y.9080# generated from the m4 files accompanying Automake X.Y.
9080# (This private macro should not be called outside this file.)9081# (This private macro should not be called outside this file.)
9081AC_DEFUN([AM_AUTOMAKE_VERSION],9082AC_DEFUN([AM_AUTOMAKE_VERSION],
9082[am__api_version='1.15'9083[am__api_version='1.16'
9083dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to9084dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
9084dnl require some minimum version. Point them to the right macro.9085dnl require some minimum version. Point them to the right macro.
9085m4_if([$1], [1.15.1], [],9086m4_if([$1], [1.16.1], [],
9086 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl9087 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
9087])9088])
90889089
@@ -9098,12 +9099,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
9098# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.9099# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
9099# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.9100# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
9100AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],9101AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
9101[AM_AUTOMAKE_VERSION([1.15.1])dnl9102[AM_AUTOMAKE_VERSION([1.16.1])dnl
9102m4_ifndef([AC_AUTOCONF_VERSION],9103m4_ifndef([AC_AUTOCONF_VERSION],
9103 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl9104 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
9104_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])9105_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
91059106
9106# Copyright (C) 2011-2017 Free Software Foundation, Inc.9107# Copyright (C) 2011-2018 Free Software Foundation, Inc.
9107#9108#
9108# This file is free software; the Free Software Foundation9109# This file is free software; the Free Software Foundation
9109# gives unlimited permission to copy and/or distribute it,9110# gives unlimited permission to copy and/or distribute it,
@@ -9165,7 +9166,7 @@ AC_SUBST([AR])dnl
91659166
9166# AM_AUX_DIR_EXPAND -*- Autoconf -*-9167# AM_AUX_DIR_EXPAND -*- Autoconf -*-
91679168
9168# Copyright (C) 2001-2017 Free Software Foundation, Inc.9169# Copyright (C) 2001-2018 Free Software Foundation, Inc.
9169#9170#
9170# This file is free software; the Free Software Foundation9171# This file is free software; the Free Software Foundation
9171# gives unlimited permission to copy and/or distribute it,9172# gives unlimited permission to copy and/or distribute it,
@@ -9217,7 +9218,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
92179218
9218# AM_CONDITIONAL -*- Autoconf -*-9219# AM_CONDITIONAL -*- Autoconf -*-
92199220
9220# Copyright (C) 1997-2017 Free Software Foundation, Inc.9221# Copyright (C) 1997-2018 Free Software Foundation, Inc.
9221#9222#
9222# This file is free software; the Free Software Foundation9223# This file is free software; the Free Software Foundation
9223# gives unlimited permission to copy and/or distribute it,9224# gives unlimited permission to copy and/or distribute it,
@@ -9248,7 +9249,7 @@ AC_CONFIG_COMMANDS_PRE(
9248Usually this means the macro was only invoked conditionally.]])9249Usually this means the macro was only invoked conditionally.]])
9249fi])])9250fi])])
92509251
9251# Copyright (C) 1999-2017 Free Software Foundation, Inc.9252# Copyright (C) 1999-2018 Free Software Foundation, Inc.
9252#9253#
9253# This file is free software; the Free Software Foundation9254# This file is free software; the Free Software Foundation
9254# gives unlimited permission to copy and/or distribute it,9255# gives unlimited permission to copy and/or distribute it,
@@ -9439,13 +9440,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
94399440
9440# Generate code to set up dependency tracking. -*- Autoconf -*-9441# Generate code to set up dependency tracking. -*- Autoconf -*-
94419442
9442# Copyright (C) 1999-2017 Free Software Foundation, Inc.9443# Copyright (C) 1999-2018 Free Software Foundation, Inc.
9443#9444#
9444# This file is free software; the Free Software Foundation9445# This file is free software; the Free Software Foundation
9445# gives unlimited permission to copy and/or distribute it,9446# gives unlimited permission to copy and/or distribute it,
9446# with or without modifications, as long as this notice is preserved.9447# with or without modifications, as long as this notice is preserved.
94479448
9448
9449# _AM_OUTPUT_DEPENDENCY_COMMANDS9449# _AM_OUTPUT_DEPENDENCY_COMMANDS
9450# ------------------------------9450# ------------------------------
9451AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],9451AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -9453,49 +9453,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
9453 # Older Autoconf quotes --file arguments for eval, but not when files9453 # Older Autoconf quotes --file arguments for eval, but not when files
9454 # are listed without --file. Let's play safe and only enable the eval9454 # are listed without --file. Let's play safe and only enable the eval
9455 # if we detect the quoting.9455 # if we detect the quoting.
9456 case $CONFIG_FILES in9456 # TODO: see whether this extra hack can be removed once we start
9457 *\'*) eval set x "$CONFIG_FILES" ;;9457 # requiring Autoconf 2.70 or later.
9458 *) set x $CONFIG_FILES ;;9458 AS_CASE([$CONFIG_FILES],
9459 esac9459 [*\'*], [eval set x "$CONFIG_FILES"],
9460 [*], [set x $CONFIG_FILES])
9460 shift9461 shift
9461 for mf9462 # Used to flag and report bootstrapping failures.
9463 am_rc=0
9464 for am_mf
9462 do9465 do
9463 # Strip MF so we end up with the name of the file.9466 # Strip MF so we end up with the name of the file.
9464 mf=`echo "$mf" | sed -e 's/:.*$//'`9467 am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
9465 # Check whether this is an Automake generated Makefile or not.9468 # Check whether this is an Automake generated Makefile which includes
9466 # We used to match only the files named 'Makefile.in', but9469 # dependency-tracking related rules and includes.
9467 # some people rename them; so instead we look at the file content.9470 # Grep'ing the whole file directly is not great: AIX grep has a line
9468 # Grep'ing the first line is not enough: some people post-process
9469 # each Makefile.in and add a new line on top of each file to say so.
9470 # Grep'ing the whole file is not good either: AIX grep has a line
9471 # limit of 2048, but all sed's we know have understand at least 4000.9471 # limit of 2048, but all sed's we know have understand at least 4000.
9472 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then9472 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
9473 dirpart=`AS_DIRNAME("$mf")`9473 || continue
9474 else9474 am_dirpart=`AS_DIRNAME(["$am_mf"])`
9475 continue9475 am_filepart=`AS_BASENAME(["$am_mf"])`
9476 fi9476 AM_RUN_LOG([cd "$am_dirpart" \
9477 # Extract the definition of DEPDIR, am__include, and am__quote9477 && sed -e '/# am--include-marker/d' "$am_filepart" \
9478 # from the Makefile without running 'make'.9478 | $MAKE -f - am--depfiles]) || am_rc=$?
9479 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
9480 test -z "$DEPDIR" && continue
9481 am__include=`sed -n 's/^am__include = //p' < "$mf"`
9482 test -z "$am__include" && continue
9483 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
9484 # Find all dependency output files, they are included files with
9485 # $(DEPDIR) in their names. We invoke sed twice because it is the
9486 # simplest approach to changing $(DEPDIR) to its actual value in the
9487 # expansion.
9488 for file in `sed -n "
9489 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
9490 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
9491 # Make sure the directory exists.
9492 test -f "$dirpart/$file" && continue
9493 fdir=`AS_DIRNAME(["$file"])`
9494 AS_MKDIR_P([$dirpart/$fdir])
9495 # echo "creating $dirpart/$file"
9496 echo '# dummy' > "$dirpart/$file"
9497 done
9498 done9479 done
9480 if test $am_rc -ne 0; then
9481 AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
9482 for automatic dependency tracking. Try re-running configure with the
9483 '--disable-dependency-tracking' option to at least be able to build
9484 the package (albeit without support for automatic dependency tracking).])
9485 fi
9486 AS_UNSET([am_dirpart])
9487 AS_UNSET([am_filepart])
9488 AS_UNSET([am_mf])
9489 AS_UNSET([am_rc])
9490 rm -f conftest-deps.mk
9499}9491}
9500])# _AM_OUTPUT_DEPENDENCY_COMMANDS9492])# _AM_OUTPUT_DEPENDENCY_COMMANDS
95019493
@@ -9504,18 +9496,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
9504# -----------------------------9496# -----------------------------
9505# This macro should only be invoked once -- use via AC_REQUIRE.9497# This macro should only be invoked once -- use via AC_REQUIRE.
9506#9498#
9507# This code is only required when automatic dependency tracking9499# This code is only required when automatic dependency tracking is enabled.
9508# is enabled. FIXME. This creates each '.P' file that we will9500# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
9509# need in order to bootstrap the dependency handling code.9501# order to bootstrap the dependency handling code.
9510AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],9502AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
9511[AC_CONFIG_COMMANDS([depfiles],9503[AC_CONFIG_COMMANDS([depfiles],
9512 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],9504 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
9513 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])9505 [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
9514])
95159506
9516# Do all the work for Automake. -*- Autoconf -*-9507# Do all the work for Automake. -*- Autoconf -*-
95179508
9518# Copyright (C) 1996-2017 Free Software Foundation, Inc.9509# Copyright (C) 1996-2018 Free Software Foundation, Inc.
9519#9510#
9520# This file is free software; the Free Software Foundation9511# This file is free software; the Free Software Foundation
9521# gives unlimited permission to copy and/or distribute it,9512# gives unlimited permission to copy and/or distribute it,
@@ -9602,8 +9593,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
9602AC_REQUIRE([AC_PROG_MKDIR_P])dnl9593AC_REQUIRE([AC_PROG_MKDIR_P])dnl
9603# For better backward compatibility. To be removed once Automake 1.9.x9594# For better backward compatibility. To be removed once Automake 1.9.x
9604# dies out for good. For more background, see:9595# dies out for good. For more background, see:
9605# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>9596# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
9606# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>9597# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
9607AC_SUBST([mkdir_p], ['$(MKDIR_P)'])9598AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
9608# We need awk for the "check" target (and possibly the TAP driver). The9599# We need awk for the "check" target (and possibly the TAP driver). The
9609# system "awk" is bad on some platforms.9600# system "awk" is bad on some platforms.
@@ -9670,7 +9661,7 @@ END
9670Aborting the configuration process, to ensure you take notice of the issue.9661Aborting the configuration process, to ensure you take notice of the issue.
96719662
9672You can download and install GNU coreutils to get an 'rm' implementation9663You can download and install GNU coreutils to get an 'rm' implementation
9673that behaves properly: <http://www.gnu.org/software/coreutils/>.9664that behaves properly: <https://www.gnu.org/software/coreutils/>.
96749665
9675If you want to complete the configuration process using your problematic9666If you want to complete the configuration process using your problematic
9676'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM9667'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -9712,7 +9703,7 @@ for _am_header in $config_headers :; do
9712done9703done
9713echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])9704echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
97149705
9715# Copyright (C) 2001-2017 Free Software Foundation, Inc.9706# Copyright (C) 2001-2018 Free Software Foundation, Inc.
9716#9707#
9717# This file is free software; the Free Software Foundation9708# This file is free software; the Free Software Foundation
9718# gives unlimited permission to copy and/or distribute it,9709# gives unlimited permission to copy and/or distribute it,
@@ -9733,7 +9724,7 @@ if test x"${install_sh+set}" != xset; then
9733fi9724fi
9734AC_SUBST([install_sh])])9725AC_SUBST([install_sh])])
97359726
9736# Copyright (C) 2003-2017 Free Software Foundation, Inc.9727# Copyright (C) 2003-2018 Free Software Foundation, Inc.
9737#9728#
9738# This file is free software; the Free Software Foundation9729# This file is free software; the Free Software Foundation
9739# gives unlimited permission to copy and/or distribute it,9730# gives unlimited permission to copy and/or distribute it,
@@ -9755,7 +9746,7 @@ AC_SUBST([am__leading_dot])])
9755# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-9746# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
9756# From Jim Meyering9747# From Jim Meyering
97579748
9758# Copyright (C) 1996-2017 Free Software Foundation, Inc.9749# Copyright (C) 1996-2018 Free Software Foundation, Inc.
9759#9750#
9760# This file is free software; the Free Software Foundation9751# This file is free software; the Free Software Foundation
9761# gives unlimited permission to copy and/or distribute it,9752# gives unlimited permission to copy and/or distribute it,
@@ -9790,7 +9781,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
97909781
9791# Check to see how 'make' treats includes. -*- Autoconf -*-9782# Check to see how 'make' treats includes. -*- Autoconf -*-
97929783
9793# Copyright (C) 2001-2017 Free Software Foundation, Inc.9784# Copyright (C) 2001-2018 Free Software Foundation, Inc.
9794#9785#
9795# This file is free software; the Free Software Foundation9786# This file is free software; the Free Software Foundation
9796# gives unlimited permission to copy and/or distribute it,9787# gives unlimited permission to copy and/or distribute it,
@@ -9798,49 +9789,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
97989789
9799# AM_MAKE_INCLUDE()9790# AM_MAKE_INCLUDE()
9800# -----------------9791# -----------------
9801# Check to see how make treats includes.9792# Check whether make has an 'include' directive that can support all
9793# the idioms we need for our automatic dependency tracking code.
9802AC_DEFUN([AM_MAKE_INCLUDE],9794AC_DEFUN([AM_MAKE_INCLUDE],
9803[am_make=${MAKE-make}9795[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
9804cat > confinc << 'END'9796cat > confinc.mk << 'END'
9805am__doit:9797am__doit:
9806 @echo this is the am__doit target9798 @echo this is the am__doit target >confinc.out
9807.PHONY: am__doit9799.PHONY: am__doit
9808END9800END
9809# If we don't find an include directive, just comment out the code.
9810AC_MSG_CHECKING([for style of include used by $am_make])
9811am__include="#"9801am__include="#"
9812am__quote=9802am__quote=
9813_am_result=none9803# BSD make does it like this.
9814# First try GNU make style include.9804echo '.include "confinc.mk" # ignored' > confmf.BSD
9815echo "include confinc" > confmf9805# Other make implementations (GNU, Solaris 10, AIX) do it like this.
9816# Ignore all kinds of additional output from 'make'.9806echo 'include confinc.mk # ignored' > confmf.GNU
9817case `$am_make -s -f confmf 2> /dev/null` in #(9807_am_result=no
9818*the\ am__doit\ target*)9808for s in GNU BSD; do
9819 am__include=include9809 AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
9820 am__quote=9810 AS_CASE([$?:`cat confinc.out 2>/dev/null`],
9821 _am_result=GNU9811 ['0:this is the am__doit target'],
9822 ;;9812 [AS_CASE([$s],
9823esac9813 [BSD], [am__include='.include' am__quote='"'],
9824# Now try BSD make style include.9814 [am__include='include' am__quote=''])])
9825if test "$am__include" = "#"; then9815 if test "$am__include" != "#"; then
9826 echo '.include "confinc"' > confmf9816 _am_result="yes ($s style)"
9827 case `$am_make -s -f confmf 2> /dev/null` in #(9817 break
9828 *the\ am__doit\ target*)9818 fi
9829 am__include=.include9819done
9830 am__quote="\""9820rm -f confinc.* confmf.*
9831 _am_result=BSD9821AC_MSG_RESULT([${_am_result}])
9832 ;;9822AC_SUBST([am__include])])
9833 esac9823AC_SUBST([am__quote])])
9834fi
9835AC_SUBST([am__include])
9836AC_SUBST([am__quote])
9837AC_MSG_RESULT([$_am_result])
9838rm -f confinc confmf
9839])
98409824
9841# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-9825# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
98429826
9843# Copyright (C) 1997-2017 Free Software Foundation, Inc.9827# Copyright (C) 1997-2018 Free Software Foundation, Inc.
9844#9828#
9845# This file is free software; the Free Software Foundation9829# This file is free software; the Free Software Foundation
9846# gives unlimited permission to copy and/or distribute it,9830# gives unlimited permission to copy and/or distribute it,
@@ -9881,7 +9865,7 @@ fi
9881# Obsolete and "removed" macros, that must however still report explicit9865# Obsolete and "removed" macros, that must however still report explicit
9882# error messages when used, to smooth transition.9866# error messages when used, to smooth transition.
9883#9867#
9884# Copyright (C) 1996-2017 Free Software Foundation, Inc.9868# Copyright (C) 1996-2018 Free Software Foundation, Inc.
9885#9869#
9886# This file is free software; the Free Software Foundation9870# This file is free software; the Free Software Foundation
9887# gives unlimited permission to copy and/or distribute it,9871# gives unlimited permission to copy and/or distribute it,
@@ -9908,7 +9892,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
99089892
9909# Helper functions for option handling. -*- Autoconf -*-9893# Helper functions for option handling. -*- Autoconf -*-
99109894
9911# Copyright (C) 2001-2017 Free Software Foundation, Inc.9895# Copyright (C) 2001-2018 Free Software Foundation, Inc.
9912#9896#
9913# This file is free software; the Free Software Foundation9897# This file is free software; the Free Software Foundation
9914# gives unlimited permission to copy and/or distribute it,9898# gives unlimited permission to copy and/or distribute it,
@@ -9937,7 +9921,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
9937AC_DEFUN([_AM_IF_OPTION],9921AC_DEFUN([_AM_IF_OPTION],
9938[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])9922[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
99399923
9940# Copyright (C) 1999-2017 Free Software Foundation, Inc.9924# Copyright (C) 1999-2018 Free Software Foundation, Inc.
9941#9925#
9942# This file is free software; the Free Software Foundation9926# This file is free software; the Free Software Foundation
9943# gives unlimited permission to copy and/or distribute it,9927# gives unlimited permission to copy and/or distribute it,
@@ -9984,7 +9968,7 @@ AC_LANG_POP([C])])
9984# For backward compatibility.9968# For backward compatibility.
9985AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])9969AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
99869970
9987# Copyright (C) 2001-2017 Free Software Foundation, Inc.9971# Copyright (C) 2001-2018 Free Software Foundation, Inc.
9988#9972#
9989# This file is free software; the Free Software Foundation9973# This file is free software; the Free Software Foundation
9990# gives unlimited permission to copy and/or distribute it,9974# gives unlimited permission to copy and/or distribute it,
@@ -10003,7 +9987,7 @@ AC_DEFUN([AM_RUN_LOG],
100039987
10004# Check to make sure that the build environment is sane. -*- Autoconf -*-9988# Check to make sure that the build environment is sane. -*- Autoconf -*-
100059989
10006# Copyright (C) 1996-2017 Free Software Foundation, Inc.9990# Copyright (C) 1996-2018 Free Software Foundation, Inc.
10007#9991#
10008# This file is free software; the Free Software Foundation9992# This file is free software; the Free Software Foundation
10009# gives unlimited permission to copy and/or distribute it,9993# gives unlimited permission to copy and/or distribute it,
@@ -10084,7 +10068,7 @@ AC_CONFIG_COMMANDS_PRE(
10084rm -f conftest.file10068rm -f conftest.file
10085])10069])
1008610070
10087# Copyright (C) 2009-2017 Free Software Foundation, Inc.10071# Copyright (C) 2009-2018 Free Software Foundation, Inc.
10088#10072#
10089# This file is free software; the Free Software Foundation10073# This file is free software; the Free Software Foundation
10090# gives unlimited permission to copy and/or distribute it,10074# gives unlimited permission to copy and/or distribute it,
@@ -10144,7 +10128,7 @@ AC_SUBST([AM_BACKSLASH])dnl
10144_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl10128_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
10145])10129])
1014610130
10147# Copyright (C) 2001-2017 Free Software Foundation, Inc.10131# Copyright (C) 2001-2018 Free Software Foundation, Inc.
10148#10132#
10149# This file is free software; the Free Software Foundation10133# This file is free software; the Free Software Foundation
10150# gives unlimited permission to copy and/or distribute it,10134# gives unlimited permission to copy and/or distribute it,
@@ -10172,7 +10156,7 @@ fi
10172INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"10156INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10173AC_SUBST([INSTALL_STRIP_PROGRAM])])10157AC_SUBST([INSTALL_STRIP_PROGRAM])])
1017410158
10175# Copyright (C) 2006-2017 Free Software Foundation, Inc.10159# Copyright (C) 2006-2018 Free Software Foundation, Inc.
10176#10160#
10177# This file is free software; the Free Software Foundation10161# This file is free software; the Free Software Foundation
10178# gives unlimited permission to copy and/or distribute it,10162# gives unlimited permission to copy and/or distribute it,
@@ -10191,7 +10175,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1019110175
10192# Check how to create a tarball. -*- Autoconf -*-10176# Check how to create a tarball. -*- Autoconf -*-
1019310177
10194# Copyright (C) 2004-2017 Free Software Foundation, Inc.10178# Copyright (C) 2004-2018 Free Software Foundation, Inc.
10195#10179#
10196# This file is free software; the Free Software Foundation10180# This file is free software; the Free Software Foundation
10197# gives unlimited permission to copy and/or distribute it,10181# gives unlimited permission to copy and/or distribute it,
diff --git a/ar-lib b/ar-lib
index 05094d3..0baa4f6 100755
--- a/ar-lib
+++ b/ar-lib
@@ -4,7 +4,7 @@
4me=ar-lib4me=ar-lib
5scriptversion=2012-03-01.08; # UTC5scriptversion=2012-03-01.08; # UTC
66
7# Copyright (C) 2010-2017 Free Software Foundation, Inc.7# Copyright (C) 2010-2018 Free Software Foundation, Inc.
8# Written by Peter Rosin <peda@lysator.liu.se>.8# Written by Peter Rosin <peda@lysator.liu.se>.
9#9#
10# This program is free software; you can redistribute it and/or modify10# This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@ scriptversion=2012-03-01.08; # UTC
18# GNU General Public License for more details.18# GNU General Public License for more details.
19#19#
20# You should have received a copy of the GNU General Public License20# You should have received a copy of the GNU General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.21# along with this program. If not, see <https://www.gnu.org/licenses/>.
2222
23# As a special exception to the GNU General Public License, if you23# As a special exception to the GNU General Public License, if you
24# distribute this file as part of a program that contains a24# distribute this file as part of a program that contains a
diff --git a/archive/align_b4_memalign.c b/archive/align_b4_memalign.c
index 8760202..1cd4032 100644
--- a/archive/align_b4_memalign.c
+++ b/archive/align_b4_memalign.c
@@ -1,5 +1,6 @@
1/* Code fragment of how to get a buffer of heap that has a specific1/* Code fragment of how to get a buffer from the heap that has a specific
2 * alignment, typically 'page' size which is 4096 bytes. */2 * alignment. The typical alignment is to a "page" whose size is often
3 * 4096 bytes. */
34
4 uint8_t * wrkBuff; /* will get pointer to heap allocation */5 uint8_t * wrkBuff; /* will get pointer to heap allocation */
5 uint8_t * wrkPos; /* will get aligned pointer within wrkBuff */6 uint8_t * wrkPos; /* will get aligned pointer within wrkBuff */
@@ -17,3 +18,7 @@
17 /* perhaps use posix_memalign() instead. Yes but not always available */18 /* perhaps use posix_memalign() instead. Yes but not always available */
18 wrkBuff = (uint8_t *)malloc(sz_of_aligned + psz);19 wrkBuff = (uint8_t *)malloc(sz_of_aligned + psz);
19 wrkPos = (uint8_t *)(((sg_uintptr_t)wrkBuff + psz - 1) & (~(psz - 1)));20 wrkPos = (uint8_t *)(((sg_uintptr_t)wrkBuff + psz - 1) & (~(psz - 1)));
21
22/* The disadvantage of this approach is that it needs both wrkBuff and wrkPos
23 * to be held by the application. The wrkBuff is only needed for the
24 * corresponding free(), all other uses should be via wrkPos. */
diff --git a/compile b/compile
index a85b723..99e5052 100755
--- a/compile
+++ b/compile
@@ -1,9 +1,9 @@
1#! /bin/sh1#! /bin/sh
2# Wrapper for compilers which do not understand '-c -o'.2# Wrapper for compilers which do not understand '-c -o'.
33
4scriptversion=2012-10-14.11; # UTC4scriptversion=2018-03-07.03; # UTC
55
6# Copyright (C) 1999-2014 Free Software Foundation, Inc.6# Copyright (C) 1999-2018 Free Software Foundation, Inc.
7# Written by Tom Tromey <tromey@cygnus.com>.7# Written by Tom Tromey <tromey@cygnus.com>.
8#8#
9# This program is free software; you can redistribute it and/or modify9# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
17# GNU General Public License for more details.17# GNU General Public License for more details.
18#18#
19# You should have received a copy of the GNU General Public License19# You should have received a copy of the GNU General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.20# along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
22# As a special exception to the GNU General Public License, if you22# As a special exception to the GNU General Public License, if you
23# distribute this file as part of a program that contains a23# distribute this file as part of a program that contains a
@@ -255,7 +255,8 @@ EOF
255 echo "compile $scriptversion"255 echo "compile $scriptversion"
256 exit $?256 exit $?
257 ;;257 ;;
258 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )258 cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
259 icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
259 func_cl_wrapper "$@" # Doesn't return...260 func_cl_wrapper "$@" # Doesn't return...
260 ;;261 ;;
261esac262esac
@@ -339,9 +340,9 @@ exit $ret
339# Local Variables:340# Local Variables:
340# mode: shell-script341# mode: shell-script
341# sh-indentation: 2342# sh-indentation: 2
342# eval: (add-hook 'write-file-hooks 'time-stamp)343# eval: (add-hook 'before-save-hook 'time-stamp)
343# time-stamp-start: "scriptversion="344# time-stamp-start: "scriptversion="
344# time-stamp-format: "%:y-%02m-%02d.%02H"345# time-stamp-format: "%:y-%02m-%02d.%02H"
345# time-stamp-time-zone: "UTC"346# time-stamp-time-zone: "UTC0"
346# time-stamp-end: "; # UTC"347# time-stamp-end: "; # UTC"
347# End:348# End:
diff --git a/config.h.in b/config.h.in
index ab0eb00..4173c07 100644
--- a/config.h.in
+++ b/config.h.in
@@ -27,6 +27,9 @@
27/* Define to 1 if you have the <linux/nvme_ioctl.h> header file. */27/* Define to 1 if you have the <linux/nvme_ioctl.h> header file. */
28#undef HAVE_LINUX_NVME_IOCTL_H28#undef HAVE_LINUX_NVME_IOCTL_H
2929
30/* Have Linux sg v4 header */
31#undef HAVE_LINUX_SG_V4_HDR
32
30/* Define to 1 if you have the <linux/types.h> header file. */33/* Define to 1 if you have the <linux/types.h> header file. */
31#undef HAVE_LINUX_TYPES_H34#undef HAVE_LINUX_TYPES_H
3235
@@ -81,6 +84,9 @@
81/* option ignored */84/* option ignored */
82#undef IGNORE_LINUX_BSG85#undef IGNORE_LINUX_BSG
8386
87/* even if Linux sg v4 available, use v3 instead */
88#undef IGNORE_LINUX_SGV4
89
84/* compile out NVMe support */90/* compile out NVMe support */
85#undef IGNORE_NVME91#undef IGNORE_NVME
8692
diff --git a/configure b/configure
index 97207eb..45ee88a 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
1#! /bin/sh1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.69 for sg3_utils 1.44.3# Generated by GNU Autoconf 2.69 for sg3_utils 1.45.
4#4#
5# Report bugs to <dgilbert@interlog.com>.5# Report bugs to <dgilbert@interlog.com>.
6#6#
@@ -590,8 +590,8 @@ MAKEFLAGS=
590# Identity of this package.590# Identity of this package.
591PACKAGE_NAME='sg3_utils'591PACKAGE_NAME='sg3_utils'
592PACKAGE_TARNAME='sg3_utils'592PACKAGE_TARNAME='sg3_utils'
593PACKAGE_VERSION='1.44'593PACKAGE_VERSION='1.45'
594PACKAGE_STRING='sg3_utils 1.44'594PACKAGE_STRING='sg3_utils 1.45'
595PACKAGE_BUGREPORT='dgilbert@interlog.com'595PACKAGE_BUGREPORT='dgilbert@interlog.com'
596PACKAGE_URL=''596PACKAGE_URL=''
597597
@@ -692,7 +692,6 @@ am__nodep
692AMDEPBACKSLASH692AMDEPBACKSLASH
693AMDEP_FALSE693AMDEP_FALSE
694AMDEP_TRUE694AMDEP_TRUE
695am__quote
696am__include695am__include
697DEPDIR696DEPDIR
698OBJEXT697OBJEXT
@@ -770,7 +769,8 @@ PACKAGE_VERSION
770PACKAGE_TARNAME769PACKAGE_TARNAME
771PACKAGE_NAME770PACKAGE_NAME
772PATH_SEPARATOR771PATH_SEPARATOR
773SHELL'772SHELL
773am__quote'
774ac_subst_files=''774ac_subst_files=''
775ac_user_opts='775ac_user_opts='
776enable_option_checking776enable_option_checking
@@ -791,6 +791,7 @@ enable_win32_spt_direct
791enable_scsistrings791enable_scsistrings
792enable_nvme_supp792enable_nvme_supp
793enable_fast_lebe793enable_fast_lebe
794enable_linux_sgv4
794'795'
795 ac_precious_vars='build_alias796 ac_precious_vars='build_alias
796host_alias797host_alias
@@ -1352,7 +1353,7 @@ if test "$ac_init_help" = "long"; then
1352 # Omit some internal or obsolete options to make the list less imposing.1353 # Omit some internal or obsolete options to make the list less imposing.
1353 # This message is too long to be a string in the A/UX 3.1 sh.1354 # This message is too long to be a string in the A/UX 3.1 sh.
1354 cat <<_ACEOF1355 cat <<_ACEOF
1355\`configure' configures sg3_utils 1.44 to adapt to many kinds of systems.1356\`configure' configures sg3_utils 1.45 to adapt to many kinds of systems.
13561357
1357Usage: $0 [OPTION]... [VAR=VALUE]...1358Usage: $0 [OPTION]... [VAR=VALUE]...
13581359
@@ -1423,7 +1424,7 @@ fi
14231424
1424if test -n "$ac_init_help"; then1425if test -n "$ac_init_help"; then
1425 case $ac_init_help in1426 case $ac_init_help in
1426 short | recursive ) echo "Configuration of sg3_utils 1.44:";;1427 short | recursive ) echo "Configuration of sg3_utils 1.45:";;
1427 esac1428 esac
1428 cat <<\_ACEOF1429 cat <<\_ACEOF
14291430
@@ -1453,6 +1454,8 @@ Optional Features:
1453 strings1454 strings
1454 --disable-nvme-supp remove all or most NVMe code1455 --disable-nvme-supp remove all or most NVMe code
1455 --disable-fast-lebe use generic little-endian/big-endian code instead1456 --disable-fast-lebe use generic little-endian/big-endian code instead
1457 --disable-linux-sgv4 for Linux sg driver avoid v4 interface even if
1458 available
14561459
1457Optional Packages:1460Optional Packages:
1458 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]1461 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1544,7 +1547,7 @@ fi
1544test -n "$ac_init_help" && exit $ac_status1547test -n "$ac_init_help" && exit $ac_status
1545if $ac_init_version; then1548if $ac_init_version; then
1546 cat <<\_ACEOF1549 cat <<\_ACEOF
1547sg3_utils configure 1.441550sg3_utils configure 1.45
1548generated by GNU Autoconf 2.691551generated by GNU Autoconf 2.69
15491552
1550Copyright (C) 2012 Free Software Foundation, Inc.1553Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1913,7 +1916,7 @@ cat >config.log <<_ACEOF
1913This file contains any messages produced by compilers while1916This file contains any messages produced by compilers while
1914running configure, to aid debugging if configure makes a mistake.1917running configure, to aid debugging if configure makes a mistake.
19151918
1916It was created by sg3_utils $as_me 1.44, which was1919It was created by sg3_utils $as_me 1.45, which was
1917generated by GNU Autoconf 2.69. Invocation command line was1920generated by GNU Autoconf 2.69. Invocation command line was
19181921
1919 $ $0 $@1922 $ $0 $@
@@ -2262,7 +2265,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
22622265
22632266
22642267
2265am__api_version='1.15'2268am__api_version='1.16'
22662269
2267ac_aux_dir=2270ac_aux_dir=
2268for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do2271for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2777,7 +2780,7 @@ fi
27772780
2778# Define the identity of the package.2781# Define the identity of the package.
2779 PACKAGE='sg3_utils'2782 PACKAGE='sg3_utils'
2780 VERSION='1.44'2783 VERSION='1.45'
27812784
27822785
2783cat >>confdefs.h <<_ACEOF2786cat >>confdefs.h <<_ACEOF
@@ -2807,8 +2810,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
28072810
2808# For better backward compatibility. To be removed once Automake 1.9.x2811# For better backward compatibility. To be removed once Automake 1.9.x
2809# dies out for good. For more background, see:2812# dies out for good. For more background, see:
2810# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>2813# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
2811# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>2814# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
2812mkdir_p='$(MKDIR_P)'2815mkdir_p='$(MKDIR_P)'
28132816
2814# We need awk for the "check" target (and possibly the TAP driver). The2817# We need awk for the "check" target (and possibly the TAP driver). The
@@ -2859,7 +2862,7 @@ END
2859Aborting the configuration process, to ensure you take notice of the issue.2862Aborting the configuration process, to ensure you take notice of the issue.
28602863
2861You can download and install GNU coreutils to get an 'rm' implementation2864You can download and install GNU coreutils to get an 'rm' implementation
2862that behaves properly: <http://www.gnu.org/software/coreutils/>.2865that behaves properly: <https://www.gnu.org/software/coreutils/>.
28632866
2864If you want to complete the configuration process using your problematic2867If you want to complete the configuration process using your problematic
2865'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM2868'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -3747,45 +3750,45 @@ DEPDIR="${am__leading_dot}deps"
37473750
3748ac_config_commands="$ac_config_commands depfiles"3751ac_config_commands="$ac_config_commands depfiles"
37493752
37503753{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
3751am_make=${MAKE-make}3754$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
3752cat > confinc << 'END'3755cat > confinc.mk << 'END'
3753am__doit:3756am__doit:
3754 @echo this is the am__doit target3757 @echo this is the am__doit target >confinc.out
3755.PHONY: am__doit3758.PHONY: am__doit
3756END3759END
3757# If we don't find an include directive, just comment out the code.
3758{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3759$as_echo_n "checking for style of include used by $am_make... " >&6; }
3760am__include="#"3760am__include="#"
3761am__quote=3761am__quote=
3762_am_result=none3762# BSD make does it like this.
3763# First try GNU make style include.3763echo '.include "confinc.mk" # ignored' > confmf.BSD
3764echo "include confinc" > confmf3764# Other make implementations (GNU, Solaris 10, AIX) do it like this.
3765# Ignore all kinds of additional output from 'make'.3765echo 'include confinc.mk # ignored' > confmf.GNU
3766case `$am_make -s -f confmf 2> /dev/null` in #(3766_am_result=no
3767*the\ am__doit\ target*)3767for s in GNU BSD; do
3768 am__include=include3768 { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
3769 am__quote=3769 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
3770 _am_result=GNU3770 ac_status=$?
3771 ;;3771 echo "$as_me:$LINENO: \$? = $ac_status" >&5
3772esac3772 (exit $ac_status); }
3773# Now try BSD make style include.3773 case $?:`cat confinc.out 2>/dev/null` in #(
3774if test "$am__include" = "#"; then3774 '0:this is the am__doit target') :
3775 echo '.include "confinc"' > confmf3775 case $s in #(
3776 case `$am_make -s -f confmf 2> /dev/null` in #(3776 BSD) :
3777 *the\ am__doit\ target*)3777 am__include='.include' am__quote='"' ;; #(
3778 am__include=.include3778 *) :
3779 am__quote="\""3779 am__include='include' am__quote='' ;;
3780 _am_result=BSD3780esac ;; #(
3781 *) :
3781 ;;3782 ;;
3782 esac3783esac
3783fi3784 if test "$am__include" != "#"; then
37843785 _am_result="yes ($s style)"
37853786 break
3786{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&53787 fi
3787$as_echo "$_am_result" >&6; }3788done
3788rm -f confinc confmf3789rm -f confinc.* confmf.*
3790{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
3791$as_echo "${_am_result}" >&6; }
37893792
3790# Check whether --enable-dependency-tracking was given.3793# Check whether --enable-dependency-tracking was given.
3791if test "${enable_dependency_tracking+set}" = set; then :3794if test "${enable_dependency_tracking+set}" = set; then :
@@ -6285,11 +6288,8 @@ _LT_EOF
6285 test $ac_status = 0; }; then6288 test $ac_status = 0; }; then
6286 # Now try to grab the symbols.6289 # Now try to grab the symbols.
6287 nlist=conftest.nm6290 nlist=conftest.nm
6288 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&56291 $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
6289 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&56292 if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
6290 ac_status=$?
6291 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6292 test $ac_status = 0; } && test -s "$nlist"; then
6293 # Try sorting and uniquifying the output.6293 # Try sorting and uniquifying the output.
6294 if sort "$nlist" | uniq > "$nlist"T; then6294 if sort "$nlist" | uniq > "$nlist"T; then
6295 mv -f "$nlist"T "$nlist"6295 mv -f "$nlist"T "$nlist"
@@ -12585,6 +12585,28 @@ done
1258512585
12586}12586}
1258712587
12588check_for_linux_sg_v4_hdr() {
12589 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12590/* end confdefs.h. */
12591 # include <scsi/sg.h>
12592 #ifdef SG_IOSUBMIT
12593 found
12594 #endif
12595
12596_ACEOF
12597if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12598 $EGREP "found" >/dev/null 2>&1; then :
12599
12600cat >>confdefs.h <<_ACEOF
12601#define HAVE_LINUX_SG_V4_HDR 1
12602_ACEOF
12603
12604fi
12605rm -f conftest*
12606
12607
12608}
12609
12588case "${host}" in12610case "${host}" in
12589 *-*-android*)12611 *-*-android*)
1259012612
@@ -12597,6 +12619,7 @@ cat >>confdefs.h <<_ACEOF
12597#define SG_LIB_LINUX 112619#define SG_LIB_LINUX 1
12598_ACEOF12620_ACEOF
1259912621
12622 check_for_linux_sg_v4_hdr
12600 check_for_linux_nvme_headers;;12623 check_for_linux_nvme_headers;;
12601 *-*-freebsd*|*-*-kfreebsd*-gnu*)12624 *-*-freebsd*|*-*-kfreebsd*-gnu*)
1260212625
@@ -12659,6 +12682,7 @@ cat >>confdefs.h <<_ACEOF
12659#define SG_LIB_LINUX 112682#define SG_LIB_LINUX 1
12660_ACEOF12683_ACEOF
1266112684
12685 check_for_linux_sg_v4_hdr
12662 check_for_linux_nvme_headers;;12686 check_for_linux_nvme_headers;;
12663esac12687esac
1266412688
@@ -12793,6 +12817,16 @@ _ACEOF
12793fi12817fi
1279412818
1279512819
12820# Check whether --enable-linux-sgv4 was given.
12821if test "${enable_linux_sgv4+set}" = set; then :
12822 enableval=$enable_linux_sgv4;
12823cat >>confdefs.h <<_ACEOF
12824#define IGNORE_LINUX_SGV4 1
12825_ACEOF
12826
12827fi
12828
12829
1279612830
12797ac_config_files="$ac_config_files Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile scripts/Makefile"12831ac_config_files="$ac_config_files Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile scripts/Makefile"
1279812832
@@ -13361,7 +13395,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
13361# report actual input values of CONFIG_FILES etc. instead of their13395# report actual input values of CONFIG_FILES etc. instead of their
13362# values after options handling.13396# values after options handling.
13363ac_log="13397ac_log="
13364This file was extended by sg3_utils $as_me 1.44, which was13398This file was extended by sg3_utils $as_me 1.45, which was
13365generated by GNU Autoconf 2.69. Invocation command line was13399generated by GNU Autoconf 2.69. Invocation command line was
1336613400
13367 CONFIG_FILES = $CONFIG_FILES13401 CONFIG_FILES = $CONFIG_FILES
@@ -13427,7 +13461,7 @@ _ACEOF
13427cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=113461cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13428ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"13462ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
13429ac_cs_version="\\13463ac_cs_version="\\
13430sg3_utils config.status 1.4413464sg3_utils config.status 1.45
13431configured by $0, generated by GNU Autoconf 2.69,13465configured by $0, generated by GNU Autoconf 2.69,
13432 with options \\"\$ac_cs_config\\"13466 with options \\"\$ac_cs_config\\"
1343313467
@@ -13546,7 +13580,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
13546#13580#
13547# INIT-COMMANDS13581# INIT-COMMANDS
13548#13582#
13549AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"13583AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
1355013584
1355113585
13552# The HP-UX ksh and POSIX shell print the target directory to stdout13586# The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -14447,29 +14481,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
14447 # Older Autoconf quotes --file arguments for eval, but not when files14481 # Older Autoconf quotes --file arguments for eval, but not when files
14448 # are listed without --file. Let's play safe and only enable the eval14482 # are listed without --file. Let's play safe and only enable the eval
14449 # if we detect the quoting.14483 # if we detect the quoting.
14450 case $CONFIG_FILES in14484 # TODO: see whether this extra hack can be removed once we start
14451 *\'*) eval set x "$CONFIG_FILES" ;;14485 # requiring Autoconf 2.70 or later.
14452 *) set x $CONFIG_FILES ;;14486 case $CONFIG_FILES in #(
14453 esac14487 *\'*) :
14488 eval set x "$CONFIG_FILES" ;; #(
14489 *) :
14490 set x $CONFIG_FILES ;; #(
14491 *) :
14492 ;;
14493esac
14454 shift14494 shift
14455 for mf14495 # Used to flag and report bootstrapping failures.
14496 am_rc=0
14497 for am_mf
14456 do14498 do
14457 # Strip MF so we end up with the name of the file.14499 # Strip MF so we end up with the name of the file.
14458 mf=`echo "$mf" | sed -e 's/:.*$//'`14500 am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
14459 # Check whether this is an Automake generated Makefile or not.14501 # Check whether this is an Automake generated Makefile which includes
14460 # We used to match only the files named 'Makefile.in', but14502 # dependency-tracking related rules and includes.
14461 # some people rename them; so instead we look at the file content.14503 # Grep'ing the whole file directly is not great: AIX grep has a line
14462 # Grep'ing the first line is not enough: some people post-process
14463 # each Makefile.in and add a new line on top of each file to say so.
14464 # Grep'ing the whole file is not good either: AIX grep has a line
14465 # limit of 2048, but all sed's we know have understand at least 4000.14504 # limit of 2048, but all sed's we know have understand at least 4000.
14466 if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then14505 sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
14467 dirpart=`$as_dirname -- "$mf" ||14506 || continue
14468$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \14507 am_dirpart=`$as_dirname -- "$am_mf" ||
14469 X"$mf" : 'X\(//\)[^/]' \| \14508$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14470 X"$mf" : 'X\(//\)$' \| \14509 X"$am_mf" : 'X\(//\)[^/]' \| \
14471 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||14510 X"$am_mf" : 'X\(//\)$' \| \
14472$as_echo X"$mf" |14511 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
14512$as_echo X"$am_mf" |
14473 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{14513 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
14474 s//\1/14514 s//\1/
14475 q14515 q
@@ -14487,53 +14527,48 @@ $as_echo X"$mf" |
14487 q14527 q
14488 }14528 }
14489 s/.*/./; q'`14529 s/.*/./; q'`
14490 else14530 am_filepart=`$as_basename -- "$am_mf" ||
14491 continue14531$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
14492 fi14532 X"$am_mf" : 'X\(//\)$' \| \
14493 # Extract the definition of DEPDIR, am__include, and am__quote14533 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
14494 # from the Makefile without running 'make'.14534$as_echo X/"$am_mf" |
14495 DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`14535 sed '/^.*\/\([^/][^/]*\)\/*$/{
14496 test -z "$DEPDIR" && continue
14497 am__include=`sed -n 's/^am__include = //p' < "$mf"`
14498 test -z "$am__include" && continue
14499 am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
14500 # Find all dependency output files, they are included files with
14501 # $(DEPDIR) in their names. We invoke sed twice because it is the
14502 # simplest approach to changing $(DEPDIR) to its actual value in the
14503 # expansion.
14504 for file in `sed -n "
14505 s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
14506 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
14507 # Make sure the directory exists.
14508 test -f "$dirpart/$file" && continue
14509 fdir=`$as_dirname -- "$file" ||
14510$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14511 X"$file" : 'X\(//\)[^/]' \| \
14512 X"$file" : 'X\(//\)$' \| \
14513 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
14514$as_echo X"$file" |
14515 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
14516 s//\1/
14517 q
14518 }
14519 /^X\(\/\/\)[^/].*/{
14520 s//\1/14536 s//\1/
14521 q14537 q
14522 }14538 }
14523 /^X\(\/\/\)$/{14539 /^X\/\(\/\/\)$/{
14524 s//\1/14540 s//\1/
14525 q14541 q
14526 }14542 }
14527 /^X\(\/\).*/{14543 /^X\/\(\/\).*/{
14528 s//\1/14544 s//\1/
14529 q14545 q
14530 }14546 }
14531 s/.*/./; q'`14547 s/.*/./; q'`
14532 as_dir=$dirpart/$fdir; as_fn_mkdir_p14548 { echo "$as_me:$LINENO: cd "$am_dirpart" \
14533 # echo "creating $dirpart/$file"14549 && sed -e '/# am--include-marker/d' "$am_filepart" \
14534 echo '# dummy' > "$dirpart/$file"14550 | $MAKE -f - am--depfiles" >&5
14535 done14551 (cd "$am_dirpart" \
14552 && sed -e '/# am--include-marker/d' "$am_filepart" \
14553 | $MAKE -f - am--depfiles) >&5 2>&5
14554 ac_status=$?
14555 echo "$as_me:$LINENO: \$? = $ac_status" >&5
14556 (exit $ac_status); } || am_rc=$?
14536 done14557 done
14558 if test $am_rc -ne 0; then
14559 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
14560$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
14561as_fn_error $? "Something went wrong bootstrapping makefile fragments
14562 for automatic dependency tracking. Try re-running configure with the
14563 '--disable-dependency-tracking' option to at least be able to build
14564 the package (albeit without support for automatic dependency tracking).
14565See \`config.log' for more details" "$LINENO" 5; }
14566 fi
14567 { am_dirpart=; unset am_dirpart;}
14568 { am_filepart=; unset am_filepart;}
14569 { am_mf=; unset am_mf;}
14570 { am_rc=; unset am_rc;}
14571 rm -f conftest-deps.mk
14537}14572}
14538 ;;14573 ;;
14539 "libtool":C)14574 "libtool":C)
diff --git a/configure.ac b/configure.ac
index 1b4df71..8d641eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1AC_INIT(sg3_utils, 1.44, dgilbert@interlog.com)1AC_INIT(sg3_utils, 1.45, dgilbert@interlog.com)
22
3AM_INIT_AUTOMAKE([-Wall -Werror foreign])3AM_INIT_AUTOMAKE([-Wall -Werror foreign])
4AM_MAINTAINER_MODE4AM_MAINTAINER_MODE
@@ -59,10 +59,22 @@ check_for_linux_nvme_headers() {
59 ]])59 ]])
60}60}
6161
62check_for_linux_sg_v4_hdr() {
63 AC_EGREP_CPP(found,
64 [ # include <scsi/sg.h>
65 #ifdef SG_IOSUBMIT
66 found
67 #endif
68 ],
69 [AC_DEFINE_UNQUOTED(HAVE_LINUX_SG_V4_HDR, 1, [Have Linux sg v4 header]) ])
70
71}
72
62case "${host}" in73case "${host}" in
63 *-*-android*)74 *-*-android*)
64 AC_DEFINE_UNQUOTED(SG_LIB_ANDROID, 1, [sg3_utils on android])75 AC_DEFINE_UNQUOTED(SG_LIB_ANDROID, 1, [sg3_utils on android])
65 AC_DEFINE_UNQUOTED(SG_LIB_LINUX, 1, [sg3_utils on linux])76 AC_DEFINE_UNQUOTED(SG_LIB_LINUX, 1, [sg3_utils on linux])
77 check_for_linux_sg_v4_hdr
66 check_for_linux_nvme_headers;;78 check_for_linux_nvme_headers;;
67 *-*-freebsd*|*-*-kfreebsd*-gnu*)79 *-*-freebsd*|*-*-kfreebsd*-gnu*)
68 AC_DEFINE_UNQUOTED(SG_LIB_FREEBSD, 1, [sg3_utils on FreeBSD])80 AC_DEFINE_UNQUOTED(SG_LIB_FREEBSD, 1, [sg3_utils on FreeBSD])
@@ -85,6 +97,7 @@ case "${host}" in
85 CFLAGS="$CFLAGS -D__USE_MINGW_ANSI_STDIO";;97 CFLAGS="$CFLAGS -D__USE_MINGW_ANSI_STDIO";;
86 *-*-linux-gnu* | *-*-linux* | *)98 *-*-linux-gnu* | *-*-linux* | *)
87 AC_DEFINE_UNQUOTED(SG_LIB_LINUX, 1, [sg3_utils on linux])99 AC_DEFINE_UNQUOTED(SG_LIB_LINUX, 1, [sg3_utils on linux])
100 check_for_linux_sg_v4_hdr
88 check_for_linux_nvme_headers;;101 check_for_linux_nvme_headers;;
89esac102esac
90103
@@ -128,6 +141,10 @@ AC_ARG_ENABLE([fast-lebe],
128 AC_HELP_STRING([--disable-fast-lebe], [use generic little-endian/big-endian code instead]),141 AC_HELP_STRING([--disable-fast-lebe], [use generic little-endian/big-endian code instead]),
129 [AC_DEFINE_UNQUOTED(IGNORE_FAST_LEBE, 1, [use generic little-endian/big-endian instead], )], [])142 [AC_DEFINE_UNQUOTED(IGNORE_FAST_LEBE, 1, [use generic little-endian/big-endian instead], )], [])
130143
144AC_ARG_ENABLE([linux-sgv4],
145 AC_HELP_STRING([--disable-linux-sgv4], [for Linux sg driver avoid v4 interface even if available]),
146 [AC_DEFINE_UNQUOTED(IGNORE_LINUX_SGV4, 1, [even if Linux sg v4 available, use v3 instead], )], [])
147
131148
132AC_OUTPUT(Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile scripts/Makefile)149AC_OUTPUT(Makefile include/Makefile lib/Makefile src/Makefile doc/Makefile scripts/Makefile)
133150
diff --git a/debian/changelog b/debian/changelog
index 0a711ed..6127ad3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,36 @@
1<<<<<<< debian/changelog
2=======
3sg3-utils (1.45-1ubuntu1) groovy; urgency=medium
4
5 * Merge with Debian unstable (LP: #1879761). Remaining changes:
6 - debian/control, debian/rules: build a sg3-udeb installer package again.
7 - debian/sg3-udeb.install: install the right binaries for sg3-udeb.
8 * Dropped:
9 - Fix a typo in a udev rule that leads to truncated ID_SERIAL values in
10 udev. (LP: #1859858)
11 [merged in Debian 1.45-1]
12
13 -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Thu, 21 May 2020 03:34:16 +0000
14
15sg3-utils (1.45-1) unstable; urgency=medium
16
17 [ Debian Janitor ]
18 * Trim trailing whitespace.
19 * Bump debhelper from old 9 to 12.
20 * Set upstream metadata fields: Bug-Submit.
21 * Drop unnecessary dependency on dh-autoconf.
22 * Use canonical URL in Vcs-Browser.
23
24 [ Ritesh Raj Sarraf ]
25 * Add filter for the debian folder
26 * New upstream version 1.45
27 * Drop quilt based patch fix-udevadm-path.patch
28 * Add patch to fix path for udevadm
29 * Update symbol list for 1.45
30
31 -- Ritesh Raj Sarraf <rrs@debian.org> Fri, 10 Apr 2020 20:52:49 +0530
32
33>>>>>>> debian/changelog
1sg3-utils (1.44-1ubuntu2) focal; urgency=medium34sg3-utils (1.44-1ubuntu2) focal; urgency=medium
235
3 * Fix a typo in a udev rule that leads to truncated ID_SERIAL values in36 * Fix a typo in a udev rule that leads to truncated ID_SERIAL values in
@@ -148,7 +181,7 @@ sg3-utils (1.32-1) unstable; urgency=low
148181
149sg3-utils (1.31-1) unstable; urgency=low182sg3-utils (1.31-1) unstable; urgency=low
150183
151 * New Upstream Release 184 * New Upstream Release
152 * [0d9bfc1] update symbols file185 * [0d9bfc1] update symbols file
153186
154 -- Ritesh Raj Sarraf <rrs@debian.org> Thu, 17 Mar 2011 19:46:32 +0530187 -- Ritesh Raj Sarraf <rrs@debian.org> Thu, 17 Mar 2011 19:46:32 +0530
@@ -156,20 +189,20 @@ sg3-utils (1.31-1) unstable; urgency=low
156sg3-utils (1.30-1) unstable; urgency=low189sg3-utils (1.30-1) unstable; urgency=low
157190
158 * New Upstream Release191 * New Upstream Release
159 * Change address to my official Debian address and remove the DMUA flag 192 * Change address to my official Debian address and remove the DMUA flag
160 * Add a get-orig-source target 193 * Add a get-orig-source target
161 * Dropping patches that have merged upstream194 * Dropping patches that have merged upstream
162 - 001_man_page_fixes.patch195 - 001_man_page_fixes.patch
163 - 002_spelling_error_fixes.patch 196 - 002_spelling_error_fixes.patch
164 * Update Standards Version to 3.9.1197 * Update Standards Version to 3.9.1
165 - Add BSD license to the copyright section 198 - Add BSD license to the copyright section
166199
167 -- Ritesh Raj Sarraf <rrs@debian.org> Fri, 11 Feb 2011 01:22:58 +0530200 -- Ritesh Raj Sarraf <rrs@debian.org> Fri, 11 Feb 2011 01:22:58 +0530
168201
169sg3-utils (1.29-1) unstable; urgency=low202sg3-utils (1.29-1) unstable; urgency=low
170203
171 [Ritesh Raj Sarraf]204 [Ritesh Raj Sarraf]
172 * Adopt package as the new maintainer (Closes: #540828) 205 * Adopt package as the new maintainer (Closes: #540828)
173 * New upstream release206 * New upstream release
174 + Drop patches, merged upstream207 + Drop patches, merged upstream
175 - 01_am_maintainer_mode.patch208 - 01_am_maintainer_mode.patch
@@ -178,12 +211,12 @@ sg3-utils (1.29-1) unstable; urgency=low
178 + Add new patches211 + Add new patches
179 - 001_man_page_fixes.patch212 - 001_man_page_fixes.patch
180 - 002_spelling_error_fixes.patch213 - 002_spelling_error_fixes.patch
181 * Update symbol list for new symbols introduced in this release 214 * Update symbol list for new symbols introduced in this release
182 * Add ${misc:Depends} to make in lintian clean 215 * Add ${misc:Depends} to make in lintian clean
183 * Add "source/format" and specify the current source format 216 * Add "source/format" and specify the current source format
184 * Update Standards Version to 3.8.4 (No changes required) 217 * Update Standards Version to 3.8.4 (No changes required)
185 * Add Vcs headers 218 * Add Vcs headers
186 * Add DMUA Flag 219 * Add DMUA Flag
187 * Explain about tarball re-packing in README.source220 * Explain about tarball re-packing in README.source
188221
189 [Jonathan McDowell]222 [Jonathan McDowell]
@@ -228,10 +261,10 @@ sg3-utils (1.27-1) unstable; urgency=low
228261
229 * QA upload.262 * QA upload.
230 + Set maintainer to Debian QA Group <packages@qa.debian.org>263 + Set maintainer to Debian QA Group <packages@qa.debian.org>
231 * Don't ignore errors on make clean. 264 * Don't ignore errors on make clean.
232 * Use quilt as a patch system.265 * Use quilt as a patch system.
233 * Enable AM_MAINTAINER_MODE.266 * Enable AM_MAINTAINER_MODE.
234 * Add patch by Petr Salinger to fix FTBFS on GNU/kFreeBSD (closes: 267 * Add patch by Petr Salinger to fix FTBFS on GNU/kFreeBSD (closes:
235 #542748).268 #542748).
236269
237 -- Aurelien Jarno <aurel32@debian.org> Sun, 30 Aug 2009 17:35:35 +0200270 -- Aurelien Jarno <aurel32@debian.org> Sun, 30 Aug 2009 17:35:35 +0200
@@ -364,7 +397,7 @@ sg3-utils (1.03-1) unstable; urgency=low
364sg3-utils (0.95-4) unstable; urgency=low397sg3-utils (0.95-4) unstable; urgency=low
365398
366 * Only warns if installed on a kernel version < 2.4 (closes: #136434)399 * Only warns if installed on a kernel version < 2.4 (closes: #136434)
367 400
368 -- Eric Schwartz <emschwar@debian.org> Tue, 28 May 2002 22:55:29 -0600401 -- Eric Schwartz <emschwar@debian.org> Tue, 28 May 2002 22:55:29 -0600
369402
370sg3-utils (0.95-3) unstable; urgency=low403sg3-utils (0.95-3) unstable; urgency=low
@@ -387,5 +420,3 @@ sg3-utils (0.95-1) unstable; urgency=low
387 * Adjusted Makefile to include $DESTDIR420 * Adjusted Makefile to include $DESTDIR
388421
389 -- Eric Schwartz <emschwar@debian.org> Wed, 14 Nov 2001 17:05:56 -0700422 -- Eric Schwartz <emschwar@debian.org> Wed, 14 Nov 2001 17:05:56 -0700
390
391
diff --git a/debian/compat b/debian/compat
392deleted file mode 100644423deleted file mode 100644
index ec63514..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
19
diff --git a/debian/control b/debian/control
index f0066c9..2a108f1 100644
--- a/debian/control
+++ b/debian/control
@@ -4,11 +4,11 @@ Priority: optional
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: Ritesh Raj Sarraf <rrs@debian.org>5XSBC-Original-Maintainer: Ritesh Raj Sarraf <rrs@debian.org>
6Uploaders: Jonathan McDowell <noodles@earth.li>6Uploaders: Jonathan McDowell <noodles@earth.li>
7Build-Depends: debhelper (>= 9), libtool, libcam-dev [kfreebsd-any], dh-autoreconf, dpkg-dev (>= 1.16.1~)7Build-Depends: debhelper-compat (= 12), libtool, libcam-dev [kfreebsd-any], dpkg-dev (>= 1.16.1~)
8Standards-Version: 3.9.28Standards-Version: 3.9.2
9Homepage: http://sg.danny.cz/sg/9Homepage: http://sg.danny.cz/sg/
10Vcs-Git: https://salsa.debian.org/linux-blocks-team/sg3-utils.git10Vcs-Git: https://salsa.debian.org/linux-blocks-team/sg3-utils.git
11Vcs-Browser: https://salsa.debian.org/linux-blocks-team/sg3-utils.git11Vcs-Browser: https://salsa.debian.org/linux-blocks-team/sg3-utils
1212
13Package: sg3-utils13Package: sg3-utils
14Architecture: any14Architecture: any
@@ -65,7 +65,7 @@ Description: utilities for devices using the SCSI command set (developer files)
6565
66Package: sg3-utils-udev66Package: sg3-utils-udev
67Architecture: all67Architecture: all
68Depends: sg3-utils, initramfs-tools, ${misc:Depends}68Depends: sg3-utils, initramfs-tools-core, initramfs-tools | linux-initramfs-tool, ${misc:Depends}
69Description: utilities for devices using the SCSI command set (udev rules)69Description: utilities for devices using the SCSI command set (udev rules)
70 Most OSes have SCSI pass-through interfaces that enable user space programs70 Most OSes have SCSI pass-through interfaces that enable user space programs
71 to send SCSI commands to a device and fetch the response. With SCSI to ATA71 to send SCSI commands to a device and fetch the response. With SCSI to ATA
@@ -84,4 +84,7 @@ Package-Type: udeb
84Section: debian-installer84Section: debian-installer
85Depends: ${misc:Depends}85Depends: ${misc:Depends}
86Description: utilities for devices using the SCSI command set86Description: utilities for devices using the SCSI command set
87<<<<<<< debian/control
8788
89=======
90>>>>>>> debian/control
diff --git a/debian/gbp.conf b/debian/gbp.conf
index cec628c..992b1d8 100644
--- a/debian/gbp.conf
+++ b/debian/gbp.conf
@@ -1,2 +1,6 @@
1[DEFAULT]1[DEFAULT]
2pristine-tar = True2pristine-tar = True
3
4
5[import-orig]
6filter = [ 'debian' ]
diff --git a/debian/libsgutils2-2.symbols b/debian/libsgutils2-2.symbols
index 4665a75..23a3afe 100644
--- a/debian/libsgutils2-2.symbols
+++ b/debian/libsgutils2-2.symbols
@@ -1,4 +1,4 @@
1libsgutils2.so.2 libsgutils2-2 #MINVER#1libsgutils2-1.45.so.2 libsgutils2-2 #MINVER#
2 check_pt_file_handle@Base 1.432 check_pt_file_handle@Base 1.43
3 clear_scsi_pt_obj@Base 1.273 clear_scsi_pt_obj@Base 1.27
4 construct_scsi_pt_obj@Base 1.274 construct_scsi_pt_obj@Base 1.27
@@ -9,8 +9,11 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
9 dWordHex@Base 1.279 dWordHex@Base 1.27
10 destruct_scsi_pt_obj@Base 1.2710 destruct_scsi_pt_obj@Base 1.27
11 do_scsi_pt@Base 1.2711 do_scsi_pt@Base 1.27
12 get_pt_actual_lengths@Base 1.45
13 get_pt_duration_ns@Base 1.45
12 get_pt_file_handle@Base 1.4314 get_pt_file_handle@Base 1.43
13 get_pt_nvme_nsid@Base 1.4315 get_pt_nvme_nsid@Base 1.43
16 get_pt_req_lengths@Base 1.45
14 get_pt_result@Base 1.4317 get_pt_result@Base 1.43
15 get_scsi_pt_duration_ms@Base 1.2718 get_scsi_pt_duration_ms@Base 1.27
16 set_scsi_pt_flags@Base 1.2919 set_scsi_pt_flags@Base 1.29
@@ -18,6 +21,7 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
18 get_scsi_pt_os_err_str@Base 1.2721 get_scsi_pt_os_err_str@Base 1.27
19 get_scsi_pt_resid@Base 1.2722 get_scsi_pt_resid@Base 1.27
20 get_scsi_pt_result_category@Base 1.2723 get_scsi_pt_result_category@Base 1.27
24 get_scsi_pt_sense_buf@Base 1.45
21 get_scsi_pt_sense_len@Base 1.2725 get_scsi_pt_sense_len@Base 1.27
22 get_scsi_pt_status_response@Base 1.2726 get_scsi_pt_status_response@Base 1.27
23 get_scsi_pt_transport_err@Base 1.2727 get_scsi_pt_transport_err@Base 1.27
@@ -50,6 +54,7 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
50 sg_bsg_major@Base 1.4354 sg_bsg_major@Base 1.43
51 sg_bsg_nvme_char_major_checked@Base 1.4355 sg_bsg_nvme_char_major_checked@Base 1.43
52 sg_build_sense_buffer@Base 1.4356 sg_build_sense_buffer@Base 1.43
57 sg_checked_version_num@Base 1.45
53 sg_chk_n_print3@Base 1.2758 sg_chk_n_print3@Base 1.27
54 sg_chk_n_print@Base 1.2759 sg_chk_n_print@Base 1.27
55 sg_cmds_close_device@Base 1.2760 sg_cmds_close_device@Base 1.27
@@ -61,18 +66,22 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
61 sg_convert_errno@Base 1.4366 sg_convert_errno@Base 1.43
62 sg_decode_transportid_str@Base 1.4367 sg_decode_transportid_str@Base 1.43
63 sg_do_nvme_pt@Base 1.4368 sg_do_nvme_pt@Base 1.43
69 sg_driver_version_num@Base 1.45
70 sg_duration_set_nano@Base 1.45
64 sg_err_category3@Base 1.2771 sg_err_category3@Base 1.27
65 sg_err_category@Base 1.2772 sg_err_category@Base 1.27
66 sg_err_category_new@Base 1.2773 sg_err_category_new@Base 1.27
67 sg_err_category_sense@Base 1.2774 sg_err_category_sense@Base 1.27
68 sg_exit2str@Base 1.4375 sg_exit2str@Base 1.43
69 sg_exit_str_arr@Base 1.4376 sg_exit_str_arr@Base 1.43
77 sg_f2hex_arr@Base 1.45
70 sg_find_bsg_nvme_char_major@Base 1.4378 sg_find_bsg_nvme_char_major@Base 1.43
71 sg_get_asc_ascq_str@Base 1.2779 sg_get_asc_ascq_str@Base 1.27
72 sg_get_big_endian@Base 1.4380 sg_get_big_endian@Base 1.43
73 sg_get_category_sense_str@Base 1.3981 sg_get_category_sense_str@Base 1.39
74 sg_get_command_name@Base 1.2782 sg_get_command_name@Base 1.27
75 sg_get_command_size@Base 1.2783 sg_get_command_size@Base 1.27
84 sg_get_command_str@Base 1.45
76 sg_get_desig_assoc_str@Base 1.4285 sg_get_desig_assoc_str@Base 1.42
77 sg_get_desig_code_set_str@Base 1.4286 sg_get_desig_code_set_str@Base 1.42
78 sg_get_desig_type_str@Base 1.4287 sg_get_desig_type_str@Base 1.42
@@ -88,6 +97,7 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
88 sg_get_nvme_opcode_name@Base 1.4397 sg_get_nvme_opcode_name@Base 1.43
89 sg_get_opcode_name@Base 1.2798 sg_get_opcode_name@Base 1.27
90 sg_get_opcode_sa_name@Base 1.2799 sg_get_opcode_sa_name@Base 1.27
100 sg_get_opcode_translation@Base 1.45
91 sg_get_page_size@Base 1.43101 sg_get_page_size@Base 1.43
92 sg_get_pdt_str@Base 1.27102 sg_get_pdt_str@Base 1.27
93 sg_get_scsi_status_str@Base 1.27103 sg_get_scsi_status_str@Base 1.27
@@ -141,6 +151,8 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
141 sg_lib_zoning_in_arr@Base 1.41151 sg_lib_zoning_in_arr@Base 1.41
142 sg_lib_zoning_out_arr@Base 1.41152 sg_lib_zoning_out_arr@Base 1.41
143 sg_lin_page_size@Base 1.43153 sg_lin_page_size@Base 1.43
154 sg_linux_get_sg_version@Base 1.45
155 sg_linux_sense_print@Base 1.45
144 sg_ll_3party_copy_out@Base 1.38156 sg_ll_3party_copy_out@Base 1.38
145 sg_ll_ata_pt@Base 1.27157 sg_ll_ata_pt@Base 1.27
146 sg_ll_extended_copy@Base 1.36158 sg_ll_extended_copy@Base 1.36
@@ -219,8 +231,8 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
219 sg_nvme_char_major@Base 1.43231 sg_nvme_char_major@Base 1.43
220 sg_nvme_desc2sense@Base 1.43232 sg_nvme_desc2sense@Base 1.43
221 sg_nvme_status2scsi@Base 1.43233 sg_nvme_status2scsi@Base 1.43
222 sg_opcode_info_arr@Base 1.43
223 sg_print_command@Base 1.27234 sg_print_command@Base 1.27
235 sg_print_command_len@Base 1.45
224 sg_print_driver_status@Base 1.27236 sg_print_driver_status@Base 1.27
225 sg_print_host_status@Base 1.27237 sg_print_host_status@Base 1.27
226 sg_print_masked_status@Base 1.27238 sg_print_masked_status@Base 1.27
@@ -241,3 +253,16 @@ libsgutils2.so.2 libsgutils2-2 #MINVER#
241 sntl_init_dev_stat@Base 1.43253 sntl_init_dev_stat@Base 1.43
242 sntl_resp_mode_select10@Base 1.43254 sntl_resp_mode_select10@Base 1.43
243 sntl_resp_mode_sense10@Base 1.43255 sntl_resp_mode_sense10@Base 1.43
256 sg_scsi_sense_desc_find@Base 1.45
257 sg_set_big_endian@Base 1.45
258 sg_set_binary_mode@Base 1.45
259 sg_set_text_mode@Base 1.45
260 sg_set_warnings_strm@Base 1.45
261 sg_simple_inquiry@Base 1.45
262 sg_simple_inquiry_pt@Base 1.45
263 sg_t10_uuid_desig2str@Base 1.45
264 sg_vpd_dev_id_iter@Base 1.45
265 sg_warnings_strm@Base 1.45
266 sntl_init_dev_stat@Base 1.45
267 sntl_resp_mode_select10@Base 1.45
268 sntl_resp_mode_sense10@Base 1.45
diff --git a/debian/libsgutils2-2.symbols.kfreebsd b/debian/libsgutils2-2.symbols.kfreebsd
index bb98206..009f28a 100644
--- a/debian/libsgutils2-2.symbols.kfreebsd
+++ b/debian/libsgutils2-2.symbols.kfreebsd
@@ -1,4 +1,4 @@
1libsgutils2.so.2 libsgutils2-2 #MINVER#1libsgutils2-1.45.so.2 libsgutils2-2 #MINVER#
2 clear_scsi_pt_obj@Base 1.272 clear_scsi_pt_obj@Base 1.27
3 construct_scsi_pt_obj@Base 1.273 construct_scsi_pt_obj@Base 1.27
4 dStrHex@Base 1.274 dStrHex@Base 1.27
diff --git a/debian/patches/fix-udevadm-path.patch b/debian/patches/0001-Fix-path-for-udevadm.patch
5similarity index 72%5similarity index 72%
6rename from debian/patches/fix-udevadm-path.patch6rename from debian/patches/fix-udevadm-path.patch
7rename to debian/patches/0001-Fix-path-for-udevadm.patch7rename to debian/patches/0001-Fix-path-for-udevadm.patch
index a6bd025..0f7cce2 100644
--- a/debian/patches/fix-udevadm-path.patch
+++ b/debian/patches/0001-Fix-path-for-udevadm.patch
@@ -1,12 +1,22 @@
1Add new path for udevadm. See DBug #8525851From: Ritesh Raj Sarraf <rrs@debian.org>
2Date: Fri, 10 Apr 2020 18:13:13 +0530
3Subject: Fix path for udevadm
4
5See DBug #852585, for details
6---
7 scripts/rescan-scsi-bus.sh | 8 ++++----
8 1 file changed, 4 insertions(+), 4 deletions(-)
9
10diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
11index 46fe6c0..7d0bbf7 100755
2--- a/scripts/rescan-scsi-bus.sh12--- a/scripts/rescan-scsi-bus.sh
3+++ b/scripts/rescan-scsi-bus.sh13+++ b/scripts/rescan-scsi-bus.sh
4@@ -430,12 +430,12 @@14@@ -452,12 +452,12 @@ getluns()
5 udevadm_settle()15 udevadm_settle()
6 {16 {
7 local tmo=6017 local tmo=60
8- if test -x /sbin/udevadm; then 18- if [ -x /sbin/udevadm ] ; then
9+ if test -x /bin/udevadm; then 19+ if [ -x /bin/udevadm ] ; then
10 print_and_scroll_back " Calling udevadm settle (can take a while) "20 print_and_scroll_back " Calling udevadm settle (can take a while) "
11 # Loop for up to 60 seconds if sd devices still are settling..21 # Loop for up to 60 seconds if sd devices still are settling..
12 # This allows us to continue if udev events are stuck on multipaths in recovery mode22 # This allows us to continue if udev events are stuck on multipaths in recovery mode
@@ -16,7 +26,7 @@ Add new path for udevadm. See DBug #852585
16 break;26 break;
17 fi27 fi
18 let tmo=$tmo-128 let tmo=$tmo-1
19@@ -767,7 +767,7 @@29@@ -799,7 +799,7 @@ findremapped()
20 30
21 # Trigger udev to update the info31 # Trigger udev to update the info
22 echo -n "Triggering udev to update device information... "32 echo -n "Triggering udev to update device information... "
@@ -25,10 +35,10 @@ Add new path for udevadm. See DBug #852585
25 udevadm_settle 2>&1 /dev/null35 udevadm_settle 2>&1 /dev/null
26 echo "Done"36 echo "Done"
27 37
28@@ -1331,7 +1331,7 @@38@@ -1367,7 +1367,7 @@ if [ -n "$mp_enable" ] && [ $rmvd_found -gt 0 ] ; then
29 flushmpaths 139 flushmpaths 1
30 fi40 fi
31 if test $found -gt 0 ; then41 if [ $found -gt 0 ] ; then
32- /sbin/udevadm trigger --sysname-match=sd*42- /sbin/udevadm trigger --sysname-match=sd*
33+ /bin/udevadm trigger --sysname-match=sd*43+ /bin/udevadm trigger --sysname-match=sd*
34 udevadm_settle44 udevadm_settle
diff --git a/debian/patches/series b/debian/patches/series
index 0f8e6b5..d8206e3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,6 @@
1<<<<<<< debian/patches/series
1fix-udevadm-path.patch2fix-udevadm-path.patch
2fix-SCSI_IDENT_LUN_NAA_EXT-udev-rule.patch3fix-SCSI_IDENT_LUN_NAA_EXT-udev-rule.patch
4=======
50001-Fix-path-for-udevadm.patch
6>>>>>>> debian/patches/series
diff --git a/debian/rules b/debian/rules
index d1c1231..f65efe3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,7 +10,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
10DPKG_EXPORT_BUILDFLAGS = 110DPKG_EXPORT_BUILDFLAGS = 1
11include /usr/share/dpkg/buildflags.mk11include /usr/share/dpkg/buildflags.mk
1212
13# Uncomment this to turn on verbose mode. 13# Uncomment this to turn on verbose mode.
14# export DH_VERBOSE=114# export DH_VERBOSE=1
1515
16DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)16DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
@@ -18,7 +18,7 @@ DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
18INITRAMFS=$(CURDIR)/debian/sg3-utils-udev/usr/share/initramfs-tools/18INITRAMFS=$(CURDIR)/debian/sg3-utils-udev/usr/share/initramfs-tools/
1919
20%:20%:
21 dh "$@" --with autoreconf21 dh "$@"
2222
23override_dh_install:23override_dh_install:
24 dh_testdir24 dh_testdir
@@ -28,9 +28,15 @@ override_dh_install:
28 [ ! -f scripts/55-scsi-sg3_id.rules ] || cp scripts/55-scsi-sg3_id.rules debian/sg3-udeb.scsi-sg3_id.udev28 [ ! -f scripts/55-scsi-sg3_id.rules ] || cp scripts/55-scsi-sg3_id.rules debian/sg3-udeb.scsi-sg3_id.udev
29 [ ! -f scripts/58-scsi-sg3_symlink.rules ] || cp scripts/58-scsi-sg3_symlink.rules debian/sg3-utils-udev.scsi-sg3_symlink.udev29 [ ! -f scripts/58-scsi-sg3_symlink.rules ] || cp scripts/58-scsi-sg3_symlink.rules debian/sg3-utils-udev.scsi-sg3_symlink.udev
3030
31<<<<<<< debian/rules
31 dh_installudev -psg3-utils-udev --priority=55 --name=scsi-sg3_id 32 dh_installudev -psg3-utils-udev --priority=55 --name=scsi-sg3_id
32 dh_installudev -psg3-utils-udev --priority=58 --name=scsi-sg3_symlink 33 dh_installudev -psg3-utils-udev --priority=58 --name=scsi-sg3_symlink
33 dh_installudev -psg3-udeb --priority=55 --name=scsi-sg3_id 34 dh_installudev -psg3-udeb --priority=55 --name=scsi-sg3_id
35=======
36 dh_installudev -psg3-utils-udev --priority=55 --name=scsi-sg3_id
37 dh_installudev -psg3-utils-udev --priority=58 --name=scsi-sg3_symlink
38 dh_installudev -psg3-udeb --priority=55 --name=scsi-sg3_id
39>>>>>>> debian/rules
3440
35 install -D -m 755 debian/initramfs/hooks $(INITRAMFS)/hooks/sg3-utils41 install -D -m 755 debian/initramfs/hooks $(INITRAMFS)/hooks/sg3-utils
3642
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
37new file mode 10064443new file mode 100644
index 0000000..97eac72
--- /dev/null
+++ b/debian/upstream/metadata
@@ -0,0 +1 @@
1Bug-Submit: dgilbert@interlog.com
diff --git a/depcomp b/depcomp
index b39f98f..65cbf70 100755
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,9 @@
1#! /bin/sh1#! /bin/sh
2# depcomp - compile a program generating dependencies as side-effects2# depcomp - compile a program generating dependencies as side-effects
33
4scriptversion=2016-01-11.22; # UTC4scriptversion=2018-03-07.03; # UTC
55
6# Copyright (C) 1999-2017 Free Software Foundation, Inc.6# Copyright (C) 1999-2018 Free Software Foundation, Inc.
77
8# This program is free software; you can redistribute it and/or modify8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by9# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
16# GNU General Public License for more details.16# GNU General Public License for more details.
1717
18# You should have received a copy of the GNU General Public License18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.19# along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
21# As a special exception to the GNU General Public License, if you21# As a special exception to the GNU General Public License, if you
22# distribute this file as part of a program that contains a22# distribute this file as part of a program that contains a
@@ -783,7 +783,7 @@ exit 0
783# Local Variables:783# Local Variables:
784# mode: shell-script784# mode: shell-script
785# sh-indentation: 2785# sh-indentation: 2
786# eval: (add-hook 'write-file-hooks 'time-stamp)786# eval: (add-hook 'before-save-hook 'time-stamp)
787# time-stamp-start: "scriptversion="787# time-stamp-start: "scriptversion="
788# time-stamp-format: "%:y-%02m-%02d.%02H"788# time-stamp-format: "%:y-%02m-%02d.%02H"
789# time-stamp-time-zone: "UTC0"789# time-stamp-time-zone: "UTC0"
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 9a1816e..fc8e85d 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -3,15 +3,16 @@ man_MANS = \
3 scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 scsi_start.8 \3 scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 scsi_start.8 \
4 scsi_stop.8 scsi_temperature.8 sg3_utils.8 sg_bg_ctl.8 \4 scsi_stop.8 scsi_temperature.8 sg3_utils.8 sg_bg_ctl.8 \
5 sg_compare_and_write.8 sg_decode_sense.8 sg_format.8 sg_get_config.8 \5 sg_compare_and_write.8 sg_decode_sense.8 sg_format.8 sg_get_config.8 \
6 sg_get_lba_status.8 sg_ident.8 sg_inq.8 sg_logs.8 sg_luns.8 \6 sg_get_elem_status.8 sg_get_lba_status.8 sg_ident.8 sg_inq.8 \
7 sg_modes.8 sg_opcodes.8 sg_persist.8 sg_prevent.8 sg_raw.8 sg_rdac.8 \7 sg_logs.8 sg_luns.8 sg_modes.8 sg_opcodes.8 sg_persist.8 \
8 sg_read_attr.8 sg_read_block_limits.8 sg_read_buffer.8 \8 sg_prevent.8 sg_raw.8 sg_rdac.8 sg_read_attr.8 \
9 sg_read_long.8 sg_readcap.8 sg_reassign.8 sg_referrals.8 \9 sg_read_block_limits.8 sg_read_buffer.8 sg_read_long.8 sg_readcap.8 \
10 sg_rep_zones.8 sg_requests.8 sg_reset_wp.8 sg_rmsn.8 sg_rtpg.8 \10 sg_reassign.8 sg_referrals.8 sg_rep_zones.8 sg_requests.8 \
11 sg_safte.8 sg_sanitize.8 sg_sat_identify.8 sg_sat_phy_event.8 \11 sg_reset_wp.8 sg_rmsn.8 sg_rtpg.8 sg_safte.8 sg_sanitize.8 \
12 sg_sat_read_gplog.8 sg_sat_set_features.8 sg_seek.8 sg_senddiag.8 \12 sg_sat_identify.8 sg_sat_phy_event.8 sg_sat_read_gplog.8 \
13 sg_ses.8 sg_ses_microcode.8 sg_start.8 sg_stpg.8 sg_stream_ctl.8 \13 sg_sat_set_features.8 sg_seek.8 sg_senddiag.8 sg_ses.8 \
14 sg_sync.8 sg_timestamp.8 sg_turs.8 sg_unmap.8 sg_verify.8 sg_vpd.8 \14 sg_ses_microcode.8 sg_start.8 sg_stpg.8 sg_stream_ctl.8 sg_sync.8 \
15 sg_timestamp.8 sg_turs.8 sg_unmap.8 sg_verify.8 sg_vpd.8 \
15 sg_wr_mode.8 sg_write_buffer.8 sg_write_long.8 sg_write_same.8 \16 sg_wr_mode.8 sg_write_buffer.8 sg_write_long.8 sg_write_same.8 \
16 sg_write_verify.8 sg_write_x.8 sg_zone.817 sg_write_verify.8 sg_write_x.8 sg_zone.8
17CLEANFILES =18CLEANFILES =
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 3097608..6a37b4f 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,7 +1,7 @@
1# Makefile.in generated by automake 1.15.1 from Makefile.am.1# Makefile.in generated by automake 1.16.1 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994-2017 Free Software Foundation, Inc.4# Copyright (C) 1994-2018 Free Software Foundation, Inc.
55
6# This Makefile.in is free software; the Free Software Foundation6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,7# gives unlimited permission to copy and/or distribute it,
@@ -283,17 +283,17 @@ top_srcdir = @top_srcdir@
283man_MANS = scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 \283man_MANS = scsi_mandat.8 scsi_readcap.8 scsi_ready.8 scsi_satl.8 \
284 scsi_start.8 scsi_stop.8 scsi_temperature.8 sg3_utils.8 \284 scsi_start.8 scsi_stop.8 scsi_temperature.8 sg3_utils.8 \
285 sg_bg_ctl.8 sg_compare_and_write.8 sg_decode_sense.8 \285 sg_bg_ctl.8 sg_compare_and_write.8 sg_decode_sense.8 \
286 sg_format.8 sg_get_config.8 sg_get_lba_status.8 sg_ident.8 \286 sg_format.8 sg_get_config.8 sg_get_elem_status.8 \
287 sg_inq.8 sg_logs.8 sg_luns.8 sg_modes.8 sg_opcodes.8 \287 sg_get_lba_status.8 sg_ident.8 sg_inq.8 sg_logs.8 sg_luns.8 \
288 sg_persist.8 sg_prevent.8 sg_raw.8 sg_rdac.8 sg_read_attr.8 \288 sg_modes.8 sg_opcodes.8 sg_persist.8 sg_prevent.8 sg_raw.8 \
289 sg_read_block_limits.8 sg_read_buffer.8 sg_read_long.8 \289 sg_rdac.8 sg_read_attr.8 sg_read_block_limits.8 \
290 sg_readcap.8 sg_reassign.8 sg_referrals.8 sg_rep_zones.8 \290 sg_read_buffer.8 sg_read_long.8 sg_readcap.8 sg_reassign.8 \
291 sg_requests.8 sg_reset_wp.8 sg_rmsn.8 sg_rtpg.8 sg_safte.8 \291 sg_referrals.8 sg_rep_zones.8 sg_requests.8 sg_reset_wp.8 \
292 sg_sanitize.8 sg_sat_identify.8 sg_sat_phy_event.8 \292 sg_rmsn.8 sg_rtpg.8 sg_safte.8 sg_sanitize.8 sg_sat_identify.8 \
293 sg_sat_read_gplog.8 sg_sat_set_features.8 sg_seek.8 \293 sg_sat_phy_event.8 sg_sat_read_gplog.8 sg_sat_set_features.8 \
294 sg_senddiag.8 sg_ses.8 sg_ses_microcode.8 sg_start.8 sg_stpg.8 \294 sg_seek.8 sg_senddiag.8 sg_ses.8 sg_ses_microcode.8 sg_start.8 \
295 sg_stream_ctl.8 sg_sync.8 sg_timestamp.8 sg_turs.8 sg_unmap.8 \295 sg_stpg.8 sg_stream_ctl.8 sg_sync.8 sg_timestamp.8 sg_turs.8 \
296 sg_verify.8 sg_vpd.8 sg_wr_mode.8 sg_write_buffer.8 \296 sg_unmap.8 sg_verify.8 sg_vpd.8 sg_wr_mode.8 sg_write_buffer.8 \
297 sg_write_long.8 sg_write_same.8 sg_write_verify.8 sg_write_x.8 \297 sg_write_long.8 sg_write_same.8 sg_write_verify.8 sg_write_x.8 \
298 sg_zone.8 $(am__append_1) $(am__append_3) $(am__append_5)298 sg_zone.8 $(am__append_1) $(am__append_3) $(am__append_5)
299CLEANFILES = $(am__append_2) $(am__append_4) $(am__append_6)299CLEANFILES = $(am__append_2) $(am__append_4) $(am__append_6)
@@ -317,8 +317,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
317 *config.status*) \317 *config.status*) \
318 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \318 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
319 *) \319 *) \
320 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \320 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
321 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \321 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
322 esac;322 esac;
323323
324$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)324$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -385,7 +385,10 @@ ctags CTAGS:
385cscope cscopelist:385cscope cscopelist:
386386
387387
388distdir: $(DISTFILES)388distdir: $(BUILT_SOURCES)
389 $(MAKE) $(AM_MAKEFLAGS) distdir-am
390
391distdir-am: $(DISTFILES)
389 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \392 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
390 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \393 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
391 list='$(DISTFILES)'; \394 list='$(DISTFILES)'; \
diff --git a/doc/rescan-scsi-bus.sh.8 b/doc/rescan-scsi-bus.sh.8
index 4435c7d..fa93fcf 100644
--- a/doc/rescan-scsi-bus.sh.8
+++ b/doc/rescan-scsi-bus.sh.8
@@ -40,10 +40,10 @@ enable debug [default: 0]
40flush failed multipath devices [default: disabled]40flush failed multipath devices [default: disabled]
41.TP41.TP
42\fB\-\-forceremove\fR42\fB\-\-forceremove\fR
43remove and readd every device (DANGEROUS)43remove stale devices (DANGEROUS)
44.TP44.TP
45\fB\-\-forcerescan\fR45\fB\-\-forcerescan\fR
46rescan existing devices46remove and readd existing devices (DANGEROUS)
47.TP47.TP
48\fB\-h\fR, \fB\-\-help\fR48\fB\-h\fR, \fB\-\-help\fR
49print usage message then exit49print usage message then exit
diff --git a/doc/scsi_logging_level.8 b/doc/scsi_logging_level.8
index 10e946b..062d3f4 100644
--- a/doc/scsi_logging_level.8
+++ b/doc/scsi_logging_level.8
@@ -1,4 +1,4 @@
1.TH SCSI_LOGGING_LEVEL "8" "January 2014" "sg3_utils\-1.41" SG3_UTILS1.TH SCSI_LOGGING_LEVEL "8" "September 2018" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3scsi_logging_level \- access Linux SCSI logging level information3scsi_logging_level \- access Linux SCSI logging level information
4.SH SYNOPSIS4.SH SYNOPSIS
diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8
index eaf6489..b336707 100644
--- a/doc/sg3_utils.8
+++ b/doc/sg3_utils.8
@@ -1,10 +1,10 @@
1.TH SG3_UTILS "8" "September 2018" "sg3_utils\-1.44" SG3_UTILS1.TH SG3_UTILS "8" "February 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg3_utils \- a package of utilities for sending SCSI commands3sg3_utils \- a package of utilities for sending SCSI commands
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_*5.B sg_*
6[\fI\-\-dry\-run\fR] [\fI\-\-enumerate\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]6[\fI\-\-dry\-run\fR] [\fI\-\-enumerate\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]
7[\fI\-\-in=FN\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR]7[\fI\-\-in=FN\fR] [\fI\-\-inhex=FN\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR]
8[\fI\-\-timeout=SECS\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]8[\fI\-\-timeout=SECS\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
9[\fIOTHER_OPTIONS\fR] \fIDEVICE\fR9[\fIOTHER_OPTIONS\fR] \fIDEVICE\fR
10.SH DESCRIPTION10.SH DESCRIPTION
@@ -35,7 +35,7 @@ Architecture Model (SAM) with SAM\-5 being the most recent standard (ANSI
35INCITS 515\-2016) with the most recent draft being SAM\-6 revision 4 . SCSI35INCITS 515\-2016) with the most recent draft being SAM\-6 revision 4 . SCSI
36commands in common with all device types can be found in SCSI Primary36commands in common with all device types can be found in SCSI Primary
37Commands (SPC) of which SPC\-4 is the most recent standard (ANSI INCITS37Commands (SPC) of which SPC\-4 is the most recent standard (ANSI INCITS
38513-2015). The most recent SPC draft is SPC\-5 revision 19. Block device38513-2015). The most recent SPC draft is SPC\-5 revision 21. Block device
39specific commands (e.g. as used by disks) are in SBC, those for tape drives39specific commands (e.g. as used by disks) are in SBC, those for tape drives
40in SSC, those for SCSI enclosures in SES and those for CD/DVD/BD drives in40in SSC, those for SCSI enclosures in SES and those for CD/DVD/BD drives in
41MMC.41MMC.
@@ -98,6 +98,15 @@ SCSI to NVMe Translation Layer within the underlying library).
98Several utilities have their own environment variable setting (e.g.98Several utilities have their own environment variable setting (e.g.
99sg_persist has SG_PERSIST_IN_RDONLY). See individual utility man pages99sg_persist has SG_PERSIST_IN_RDONLY). See individual utility man pages
100for more information.100for more information.
101.PP
102There is a Linux specific environment variable called SG3_UTILS_LINUX_NANO
103that if defined and the sg driver in the system is 4.0.30 or later, will
104show command durations in nanoseconds rather than the default milliseconds.
105Command durations are typically only shown if \-\-verbose is used 3 or more
106times. Due to an interface problem (a 32 bit integer that should be 64 bits
107with the benefit of hindsight) the maximum duration that can be represented
108in nanoseconds is about 4.2 seconds. If longer durations may occur then
109don't define this environment variable (or undefine it).
101.SH LINUX DEVICE NAMING110.SH LINUX DEVICE NAMING
102Most disk block devices have names like /dev/sda, /dev/sdb, /dev/sdc, etc.111Most disk block devices have names like /dev/sda, /dev/sdb, /dev/sdc, etc.
103SCSI disks in Linux have always had names like that but in recent Linux112SCSI disks in Linux have always had names like that but in recent Linux
@@ -235,8 +244,8 @@ The NVME\-MI SES Send and SES Receive commands correspond to the SCSI
235SEND DIAGNOSTIC and RECEIVE DIAGNOSTIC RESULTS commands respectively.244SEND DIAGNOSTIC and RECEIVE DIAGNOSTIC RESULTS commands respectively.
236There are however a few other commands that need to be translated, the245There are however a few other commands that need to be translated, the
237most important of which is the SCSI INQUIRY command to the NVMe Identify246most important of which is the SCSI INQUIRY command to the NVMe Identify
238controller/namespace. Version 1.43 of these utilities contain a small247controller/namespace. Starting in version 1.43 these utilities contain a
239SNTL (SCSI to NVMe Translation Layer) to take care of these details.248small SNTL (SCSI to NVMe Translation Layer) to take care of these details.
240.PP249.PP
241As a side effect of this "juggling" if the sg_inq utility is used (without250As a side effect of this "juggling" if the sg_inq utility is used (without
242the \-\-page= option) on a NVMe \fIDEVICE\fR then the actual NVMe251the \-\-page= option) on a NVMe \fIDEVICE\fR then the actual NVMe
@@ -251,6 +260,12 @@ package assume they are talking to a SCSI device and decode any response
251accordingly. One easy way for users to see the underlying device is a260accordingly. One easy way for users to see the underlying device is a
252NVMe device is the standard INQUIRY response Vendor Identification field261NVMe device is the standard INQUIRY response Vendor Identification field
253of "NVMe " (an 8 character long string with 4 spaces to the right).262of "NVMe " (an 8 character long string with 4 spaces to the right).
263.PP
264The following SCSI commands are currently supported by the SNTL library:
265INQUIRY, MODE SELECT(10), MODE SENSE(10), READ CAPACITY(10 and 16),
266RECEIVE DIAGNOSTIC RESULTS, REQUEST SENSE, REPORT LUNS, REPORT SUPPORTED
267OPERATION CODES, REPORT SUPPORTED TASK MANAGEMENT FUNCTIONS, SEND
268DIAGNOSTICS, and TEST UNIT READY.
254.SH EXIT STATUS269.SH EXIT STATUS
255To aid scripts that call these utilities, the exit status is set to indicate270To aid scripts that call these utilities, the exit status is set to indicate
256success (0) or failure (1 or more). Note that some of the lower values271success (0) or failure (1 or more). Note that some of the lower values
@@ -398,6 +413,11 @@ like "shouldn't/can't get here". Perhaps the author should be informed.
398.B 33413.B 33
399the command sent to \fIDEVICE\fR has timed out.414the command sent to \fIDEVICE\fR has timed out.
400.TP415.TP
416.B 34
417this is a Windows only exit status and indicates that the Windows error
418number (32 bits) cannot meaningfully be mapped to an equivalent Unix error
419number returned as the exit status (7 bits).
420.TP
401.B 36421.B 36
402no error has occurred plus the utility wants to convey a boolean value422no error has occurred plus the utility wants to convey a boolean value
403of false. The corresponding true value is conveyed by a 0 exit status.423of false. The corresponding true value is conveyed by a 0 exit status.
@@ -553,8 +573,14 @@ act on the input, typically it acts on the output data.
553Since the structure of the data returned by SCSI commands varies573Since the structure of the data returned by SCSI commands varies
554considerably then the usage information or the manpage of the utility being574considerably then the usage information or the manpage of the utility being
555used should be checked. In some cases \fI\-\-hex\fR may need to be used575used should be checked. In some cases \fI\-\-hex\fR may need to be used
556multiple times (and is more conveniently given as '\-HH' or '\-HHH). In576multiple times (and is more conveniently given as '\-HH' or '\-HHH).
557other cases the name of this option is \fI\-\-inhex=FN\fR.577.TP
578\fB\-i\fR, \fB\-\-inhex\fR=\fIFN\fR
579This option has the same or similar functionality as \fI\-\-in=FN\fR. And
580perhaps 'inhex' is more descriptive since by default, ASCII hexadecimal is
581expected in the contents of file: \fIFN\fR. Alternatively the short form
582option may be \fI\-I\fR or \fI\-X\fR. See the "FORMAT OF FILES CONTAINING
583ASCII HEX" section below for more information.
558.TP584.TP
559\fB\-m\fR, \fB\-\-maxlen\fR=\fILEN\fR585\fB\-m\fR, \fB\-\-maxlen\fR=\fILEN\fR
560several important SCSI commands (e.g. INQUIRY and MODE SENSE) have response586several important SCSI commands (e.g. INQUIRY and MODE SENSE) have response
@@ -650,19 +676,39 @@ An example is "2k" for 2048. The large tera and peta suffixes are only
650available for numeric arguments that might require 64 bits to represent676available for numeric arguments that might require 64 bits to represent
651internally.677internally.
652.PP678.PP
653A suffix of the form "x<n>" multiplies the leading number by <n>. An
654example is "2x33" for "66". The leading number cannot be "0" (zero) as
655that would be interpreted as a hexadecimal number (see below).
656.PP
657These multiplicative suffixes are compatible with GNU's dd command (since679These multiplicative suffixes are compatible with GNU's dd command (since
6582002) which claims compliance with SI and with IEC 60027\-2.6802002) which claims compliance with SI and with IEC 60027\-2.
659.PP681.PP
682A suffix of the form "x<n>" multiplies the preceding number by <n>. An
683example is "2x33" for "66". The left argument cannot be '0' as '0x' will
684be interpreted as hexadecimal number prefix (see below). The left
685argument to the multiplication must end in a hexadecimal digit (i.e.
6860 to f) and the whole expression cannot have any embedded whitespace (e.g.
687spaces). An ugly example: "0xfx0x2" for 30.
688.PP
689A suffix of the form "+<n>" adds the preceding number to <n>. An example
690is "3+1k" for "1027". The left argument to the addition must end in a
691hexadecimal digit (i.e. 0 to f) and the whole expression cannot have any
692embedded whitespace (e.g. spaces). Another example: "0xf+0x2" for 17.
693.PP
660Alternatively numerical arguments can be given in hexadecimal. There are694Alternatively numerical arguments can be given in hexadecimal. There are
661two syntaxes. The number can be preceded by either "0x" or "0X" as found695two syntaxes. The number can be preceded by either "0x" or "0X" as found
662in the C programming language. The second hexadecimal representation is a696in the C programming language. The second hexadecimal representation is a
663trailing "h" or "H" as found in (storage) standards. When hex numbers are697trailing "h" or "H" as found in (storage) standards. When hex numbers are
664given, multipliers cannot be used. For example the decimal value "256" can698given, multipliers cannot be used. For example the decimal value "256" can
665be given as "0x100" or "100h".699be given as "0x100" or "100h".
700.SH FORMAT OF FILES CONTAINING ASCII HEX
701Such a file is assumed to contain a sequence of one or two digit ASCII
702hexadecimal values separated by whitespace. "Whitespace consists of either
703spaces, tabs, blank lines, or any combination thereof". Each one or two digit
704ASCII hex pair is decoded into a byte (i.e. 8 bits). The following will be
705decoded to valid (ascending valued)
706bytes: '0', '01', '3', 'c', 'F', '4a', 'cC', 'ff'.
707Lines containing only whitespace are ignored. The contents of any line
708containing a hash mark ('#') is ignored from that point until the end of that
709line. Users are encouraged to use hash marks to introduce comments in hex
710files. The author uses the extension'.hex' on such files. Examples can be
711found in the 'inhex' directory.
666.SH MICROCODE AND FIRMWARE712.SH MICROCODE AND FIRMWARE
667There are two standardized methods for downloading microcode (i.e. device713There are two standardized methods for downloading microcode (i.e. device
668firmware) to a SCSI device. The more general way is with the SCSI WRITE714firmware) to a SCSI device. The more general way is with the SCSI WRITE
@@ -706,7 +752,7 @@ CREDITS file and individual source files (in the 'src' directory).
706.SH "REPORTING BUGS"752.SH "REPORTING BUGS"
707Report bugs to <dgilbert at interlog dot com>.753Report bugs to <dgilbert at interlog dot com>.
708.SH COPYRIGHT754.SH COPYRIGHT
709Copyright \(co 1999\-2018 Douglas Gilbert755Copyright \(co 1999\-2020 Douglas Gilbert
710.br756.br
711Some utilities are distributed under a GPL version 2 license while757Some utilities are distributed under a GPL version 2 license while
712others, usually more recent ones, are under a FreeBSD license. The files758others, usually more recent ones, are under a FreeBSD license. The files
diff --git a/doc/sg_dd.8 b/doc/sg_dd.8
index 881d11e..2c6caed 100644
--- a/doc/sg_dd.8
+++ b/doc/sg_dd.8
@@ -1,4 +1,4 @@
1.TH SG_DD "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_DD "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_dd \- copy data to and from files and devices, especially SCSI3sg_dd \- copy data to and from files and devices, especially SCSI
4devices4devices
@@ -13,6 +13,7 @@ devices
13[\fIcoe=\fR{0|1|2|3}] [\fIcoe_limit=CL\fR] [\fIdio=\fR{0|1}]13[\fIcoe=\fR{0|1|2|3}] [\fIcoe_limit=CL\fR] [\fIdio=\fR{0|1}]
14[\fIodir=\fR{0|1}] [\fIof2=OFILE2\fR] [\fIretries=RETR\fR] [\fIsync=\fR{0|1}]14[\fIodir=\fR{0|1}] [\fIof2=OFILE2\fR] [\fIretries=RETR\fR] [\fIsync=\fR{0|1}]
15[\fItime=\fR{0|1}] [\fIverbose=VERB\fR] [\fI\-\-dry\-run\fR] [\fI\-V\fR]15[\fItime=\fR{0|1}] [\fIverbose=VERB\fR] [\fI\-\-dry\-run\fR] [\fI\-V\fR]
16[\fI\-\-verify\fR]
16.SH DESCRIPTION17.SH DESCRIPTION
17.\" Add any additional description here18.\" Add any additional description here
18.PP19.PP
@@ -28,6 +29,15 @@ The first group in the synopsis above are "standard" Unix
28operands. The second group are extra options added by this utility.29operands. The second group are extra options added by this utility.
29Both groups are defined below.30Both groups are defined below.
30.PP31.PP
32When the \fI\-\-verify\fR option is given, then the read side is the
33same but the on the write side, the WRITE SCSI command is replaced by
34the VERIFY SCSI command. If any VERIFY commands yields a sense key of
35MISCOMPARE then the verify operation will stop. The \fI\-\-verify\fR
36option can only be used when \fIOFILE\fR is either a sg device or
37a block device with oflag=sgio also given. When the \fI\-\-verify\fR
38option is used, this utility works in a similar fashion to the Unix
39cmp(1) command.
40.PP
31This utility is only supported on Linux whereas most other utilities in the41This utility is only supported on Linux whereas most other utilities in the
32sg3_utils package have been ported to other operating systems. A utility42sg3_utils package have been ported to other operating systems. A utility
33called "ddpt" has similar syntax and functionality to sg_dd. ddpt drops some43called "ddpt" has similar syntax and functionality to sg_dd. ddpt drops some
@@ -101,7 +111,7 @@ copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
101minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices111minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices
102report from SCSI READ CAPACITY commands or that block devices (or their112report from SCSI READ CAPACITY commands or that block devices (or their
103partitions) report. Normal files are not probed for their size. If113partitions) report. Normal files are not probed for their size. If
104\fIskip=SKIP\fR or \fIskip=SEEK\fR are given and the count is derived (i.e.114\fIskip=SKIP\fR or \fIseek=SEEK\fR are given and the count is derived (i.e.
105not explicitly given) then the derived count is scaled back so that the115not explicitly given) then the derived count is scaled back so that the
106copy will not overrun the device. If the file name is a block device116copy will not overrun the device. If the file name is a block device
107partition and \fICOUNT\fR is not given then the size of the partition117partition and \fICOUNT\fR is not given then the size of the partition
@@ -208,6 +218,14 @@ outputs usage message and exits.
208when used once, this is equivalent to \fIverbose=1\fR. When used218when used once, this is equivalent to \fIverbose=1\fR. When used
209twice (e.g. "\-vv") this is equivalent to \fIverbose=2\fR, etc.219twice (e.g. "\-vv") this is equivalent to \fIverbose=2\fR, etc.
210.TP220.TP
221\fB\-x\fR, \fB\-\-verify\fR
222do a verify operation (like Unix command cmp(1)) rather than a copy. Cannot
223be used with "oflag=sparse". \fIof=OFILE\fR must be given and \fIOFILE\fR
224must be an sg device or a block device with "oflag=sgio" also given. Uses the
225SCSI VERIFY command with the BYTCHK field set to 1. The VERIFY command is
226used instead of WRITE when this option is given. There is no VERIFY(6)
227command.
228.TP
211\fB\-V\fR, \fB\-\-version\fR229\fB\-V\fR, \fB\-\-version\fR
212outputs version number information and exits.230outputs version number information and exits.
213.SH CONVERSIONS231.SH CONVERSIONS
@@ -491,11 +509,13 @@ Written by Douglas Gilbert and Peter Allworth.
491.SH "REPORTING BUGS"509.SH "REPORTING BUGS"
492Report bugs to <dgilbert at interlog dot com>.510Report bugs to <dgilbert at interlog dot com>.
493.SH COPYRIGHT511.SH COPYRIGHT
494Copyright \(co 2000\-2018 Douglas Gilbert512Copyright \(co 2000\-2020 Douglas Gilbert
495.br513.br
496This software is distributed under the GPL version 2. There is NO514This software is distributed under the GPL version 2. There is NO
497warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.515warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
498.SH "SEE ALSO"516.SH "SEE ALSO"
517cmp(1)
518.PP
499There is a web page discussing sg_dd at http://sg.danny.cz/sg/sg_dd.html519There is a web page discussing sg_dd at http://sg.danny.cz/sg/sg_dd.html
500.PP520.PP
501A POSIX threads version of this utility called521A POSIX threads version of this utility called
diff --git a/doc/sg_decode_sense.8 b/doc/sg_decode_sense.8
index 2396ae3..5a141bf 100644
--- a/doc/sg_decode_sense.8
+++ b/doc/sg_decode_sense.8
@@ -1,9 +1,9 @@
1.TH SG_DECODE_SENSE "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_DECODE_SENSE "8" "June 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_decode_sense \- decode SCSI sense and related data3sg_decode_sense \- decode SCSI sense and related data
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_decode_sense5.B sg_decode_sense
6[\fI\-\-binary=FN\fR] [\fI\-\-cdb\fR] [\fI\-\-err=ES\fR] [\fI\-\-file=FN\fR]6[\fI\-\-binary=BFN\fR] [\fI\-\-cdb\fR] [\fI\-\-err=ES\fR] [\fI\-\-file=HFN\fR]
7[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-nospace\fR] [\fI\-\-status=SS\fR]7[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-nospace\fR] [\fI\-\-status=SS\fR]
8[\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-write=WFN\fR]8[\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-write=WFN\fR]
9[H1 H2 H3 ...]9[H1 H2 H3 ...]
@@ -43,8 +43,8 @@ are ignored apart from \fI\-\-verbose\fR.
43.SH OPTIONS43.SH OPTIONS
44Arguments to long options are mandatory for short options as well.44Arguments to long options are mandatory for short options as well.
45.TP45.TP
46\fB\-b\fR, \fB\-\-binary\fR=\fIFN\fR46\fB\-b\fR, \fB\-\-binary\fR=\fIBFN\fR
47the sense data is read in binary from a file called \fIFN\fR.47the sense data is read in binary from a file called \fIBFN\fR.
48.TP48.TP
49\fB\-c\fR, \fB\-\-cdb\fR49\fB\-c\fR, \fB\-\-cdb\fR
50treat the given string of hex arguments as bytes in a SCSI CDB and50treat the given string of hex arguments as bytes in a SCSI CDB and
@@ -60,12 +60,12 @@ is given two or more times a longer form of the message is output. In all
60cases the message is less than 128 characters long with one trailing line60cases the message is less than 128 characters long with one trailing line
61feed. All other command line options and arguments are ignored.61feed. All other command line options and arguments are ignored.
62.TP62.TP
63\fB\-f\fR, \fB\-\-file\fR=\fIFN\fR63\fB\-f\fR, \fB\-\-file\fR=\fIHFN\fR
64the sense data is read in ASCII hexadecimal from a file called \fIFN\fR.64the sense data is read in ASCII hexadecimal from a file called \fIHFN\fR.
65The sense data should appear as a sequence of bytes separated by space,65The sense data should appear as a sequence of bytes separated by space,
66comma, tab or newline. Everything from and including a hash symbol to the66comma, tab or newline. Everything from and including a hash symbol to the
67end of that line is ignored. If \fI\-\-nospace\fR is set then no separator67end of that line is ignored. If \fI\-\-nospace\fR is set then no separator
68is required between the ASCII hexadecimal digits in \fIFN\fR with bytes68is required between the ASCII hexadecimal digits in \fIHFN\fR with bytes
69decoded from pairs of ASCII hexadecimal digits.69decoded from pairs of ASCII hexadecimal digits.
70.TP70.TP
71\fB\-h\fR, \fB\-\-help\fR71\fB\-h\fR, \fB\-\-help\fR
@@ -82,7 +82,7 @@ expect ASCII hexadecimal to be a string of hexadecimal digits with no
82spaces between them. Bytes are decoded by taking two hexadecimal digits82spaces between them. Bytes are decoded by taking two hexadecimal digits
83at a time, so an even number of digits is expected. The string of83at a time, so an even number of digits is expected. The string of
84hexadecimal digits may be on the command line (replacing "H1 H2 H3")84hexadecimal digits may be on the command line (replacing "H1 H2 H3")
85or spread across multiple lines the \fIFN\fR given to \fI\-\-file=\fR.85or spread across multiple lines the \fIHFN\fR given to \fI\-\-file=\fR.
86On the command line, spaces (or other whitespace characters) between86On the command line, spaces (or other whitespace characters) between
87sequences of hexadecimal digits are ignored; the maximum command line87sequences of hexadecimal digits are ignored; the maximum command line
88hex string is 1023 characters long.88hex string is 1023 characters long.
@@ -148,7 +148,7 @@ Written by Douglas Gilbert.
148.SH "REPORTING BUGS"148.SH "REPORTING BUGS"
149Report bugs to <dgilbert at interlog dot com>.149Report bugs to <dgilbert at interlog dot com>.
150.SH COPYRIGHT150.SH COPYRIGHT
151Copyright \(co 2010\-2018 Douglas Gilbert151Copyright \(co 2010\-2019 Douglas Gilbert
152.br152.br
153This software is distributed under a FreeBSD license. There is NO153This software is distributed under a FreeBSD license. There is NO
154warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.154warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_format.8 b/doc/sg_format.8
index d1d3fde..84ae8f5 100644
--- a/doc/sg_format.8
+++ b/doc/sg_format.8
@@ -1,17 +1,17 @@
1.TH SG_FORMAT "8" "September 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_FORMAT "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_format \- format, resize a SCSI disk or format a tape3sg_format \- format, format with preset, resize SCSI disk; format tape
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_format5.B sg_format
6[\fI\-\-cmplst=\fR{0|1}] [\fI\-\-count=COUNT\fR] [\fI\-\-dcrt\fR]6[\fI\-\-cmplst=\fR{0|1}] [\fI\-\-count=COUNT\fR] [\fI\-\-dcrt\fR]
7[\fI\-\-dry\-run\fR] [\fI\-\-early\fR] [\fI\-\-ffmt=FFMT\fR]7[\fI\-\-dry\-run\fR] [\fI\-\-early\fR] [\fI\-\-ffmt=FFMT\fR]
8[\fI\-\-fmtpinfo=FPI\fR] [\fI\-\-format\fR] [\fI\-\-help\fR]8[\fI\-\-fmtmaxlba\R] [\fI\-\-fmtpinfo=FPI\fR] [\fI\-\-format\fR]
9[\fI\-\-ip\-def\fR] [\fI\-\-long\fR] [\fI\-\-mode=MP\fR] [\fI\-\-pfu=PFU\fR]9[\fI\-\-help\fR] [\fI\-\-ip\-def\fR] [\fI\-\-long\fR] [\fI\-\-mode=MP\fR]
10[\fI\-\-pie=PIE\fR] [\fI\-\-pinfo\fR] [\fI\-\-poll=PT\fR] [\fI\-\-quick\fR]10[\fI\-\-pfu=PFU\fR] [\fI\-\-pie=PIE\fR] [\fI\-\-pinfo\fR] [\fI\-\-poll=PT\fR]
11[\fI\-\-resize\fR] [\fI\-\-rto_req\fR] [\fI\-\-security\fR] [\fI\-\-six\fR]11[\fI\-\-preset=ID\fR] [\fI\-\-quick\fR] [\fI\-\-resize\fR] [\fI\-\-rto_req\fR]
12[\fI\-\-size=LB_SZ\fR] [\fI\-\-tape=FM\fR] [\fI\-\-timeout=SECS\fR]12[\fI\-\-security\fR] [\fI\-\-six\fR] [\fI\-\-size=LB_SZ\fR]
13[\fI\-\-verbose\fR] [\fI\-\-verify\fR] [\fI\-\-version\fR] [\fI\-\-wait\fR]13[\fI\-\-tape=FM\fR] [\fI\-\-timeout=SECS\fR] [\fI\-\-verbose\fR]
14\fIDEVICE\fR14[\fI\-\-verify\fR] [\fI\-\-version\fR] [\fI\-\-wait\fR] \fIDEVICE\fR
15.SH DESCRIPTION15.SH DESCRIPTION
16.\" Add any additional description here16.\" Add any additional description here
17.PP17.PP
@@ -24,6 +24,12 @@ recommendation typically leaves aside a certain number of tracks, spread
24across the media, for reassignment of blocks to logical block addresses24across the media, for reassignment of blocks to logical block addresses
25during the life of the disk.25during the life of the disk.
26.PP26.PP
27This utility issues one of three SCSI format commands: FORMAT UNIT, FORMAT
28MEDIUM or FORMAT WITH PRESET. In the following description, unqualified
29sections will usually be referring to the SCSI FORMAT UNIT command. Both
30FORMAT UNIT and FORMAT WITH PRESET apply to disks (or disk\-like devices).
31The FORMAT MEDIUM command is for tapes.
32.PP
27This utility can format modern SCSI disks and potentially change their block33This utility can format modern SCSI disks and potentially change their block
28size (if permitted) and the block count (i.e. number of accessible blocks on34size (if permitted) and the block count (i.e. number of accessible blocks on
29the media also known as "resizing"). Resizing a disk to less than the35the media also known as "resizing"). Resizing a disk to less than the
@@ -42,11 +48,12 @@ response to a MODE SENSE command and the response to a READ CAPACITY command.
42The reason for this double check is to detect a "format corrupt" state (see48The reason for this double check is to detect a "format corrupt" state (see
43the NOTES section). This usage will not modify the disk.49the NOTES section). This usage will not modify the disk.
44.PP50.PP
45When this utility is used with the "\-\-format" (or "\-F") option it will51When this utility is used with either \fI\-\-format\fR, \fI\-\-preset=ID\fR
46attempt to format the given DEVICE. In the absence of the \fI\-\-quick\fR52or \fI\-\-tape=FM\fR, it will attempt to format the given DEVICE. In the
47option there is a 15 second pause during which time the user is invited53absence of the \fI\-\-quick\fR option there is a 15 second pause during which
48thrice (5 seconds apart) to abort sg_format. This occurs just prior the SCSI54time the user is invited thrice (5 seconds apart) to abort sg_format. This
49FORMAT UNIT command being issued. See the NOTES section for more information.55occurs just prior the SCSI FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM
56command being issued. See the NOTES section for more information.
50.PP57.PP
51Protection information (PI) is optional and is made up of one or more58Protection information (PI) is optional and is made up of one or more
52protection intervals, each made up of 8 bytes associated with a logical59protection intervals, each made up of 8 bytes associated with a logical
@@ -58,8 +65,13 @@ INFORMATION section below for more information.
58.PP65.PP
59When the \fI\-\-tape=FM\fR option is given then the SCSI FORMAT MEDIUM66When the \fI\-\-tape=FM\fR option is given then the SCSI FORMAT MEDIUM
60command is sent to the \fIDEVICE\fR. FORMAT MEDIUM is defined in the SSC67command is sent to the \fIDEVICE\fR. FORMAT MEDIUM is defined in the SSC
61documents at T10 and prepares a volume for use. That may include68documents at T10 and prepares a volume for use. That may include partitioning
62partitioning the medium. See the section below on TAPE for more information.69the medium. See the section below on TAPE for more information.
70.PP
71The FORMAT WITH PRESET was added in draft SBC\-4 revision 18. A preset
72pattern, selected by the PRESET IDENTIFIER field (\fI\-\-id=FWPID\fR),
73is written to the disk. See the FORMAT PRESETS VPD page (0xb8) for a list
74of available Format preset identifiers and their associated data.
63.SH OPTIONS75.SH OPTIONS
64Arguments to long options are mandatory for short options as well.76Arguments to long options are mandatory for short options as well.
65The options are arranged in alphabetical order based on the long77The options are arranged in alphabetical order based on the long
@@ -113,16 +125,23 @@ See NOTES section below.
113\fB\-D\fR, \fB\-\-dcrt\fR125\fB\-D\fR, \fB\-\-dcrt\fR
114this option sets the DCRT bit in the FORMAT UNIT command's parameter list126this option sets the DCRT bit in the FORMAT UNIT command's parameter list
115header. It will "disable certification". Certification verifies that blocks127header. It will "disable certification". Certification verifies that blocks
116are usable during the format process. Using this option may speed the format.128are usable during the format process. Using this option may speed the format
117The default action of this utility (i.e. when this option is not given) is129but \fI\-\-ffmt=FFMT\fR, if available, would probably be better. The default
118to clear the DCRT bit thereby requesting "media certification". When the DCRT130action of this utility (i.e. when this option is not given) is to clear the
119bit is set, the FOV bit must also be set hence sg_format does that.131DCRT bit thereby requesting "media certification" (also unless another
132option needs it, the FOV bit will be cleared). When the DCRT bit is set, the
133FOV bit must also be set hence sg_format does that.
134.br
135If this option is given twice then certification is enabled by clearing the
136DCRT bit and setting the FOV bit. Both these bits are found in the parameter
137list associated with the FORMAT UNIT cdb.
120.TP138.TP
121\fB\-d\fR, \fB\-\-dry\-run\fR139\fB\-d\fR, \fB\-\-dry\-run\fR
122this option will parse the command line, do all the preparation but bypass140this option will parse the command line, do all the preparation but bypass
123the actual FORMAT UNIT or FORMAT MEDIUM commands. Also if the options would141the actual FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM command. Also if
124cause the logical block size to change, then the MODE SELECT command that142the options would otherwise cause the logical block size to change, then the
125would do that is also bypassed when the dry run option is given.143MODE SELECT command that would do that is also bypassed when the dry
144run option is given.
126.TP145.TP
127\fB\-e\fR, \fB\-\-early\fR146\fB\-e\fR, \fB\-\-early\fR
128during a format operation, The default action of this utility is to poll the147during a format operation, The default action of this utility is to poll the
@@ -139,7 +158,7 @@ UNIT cdb. The field was introduced in SBC\-4 revision 10. The default value
139is 0 which implies the former action which is typically to overwrite all158is 0 which implies the former action which is typically to overwrite all
140blocks on the \fIDEVICE\fR. That can take a long time (e.g. with hard disks159blocks on the \fIDEVICE\fR. That can take a long time (e.g. with hard disks
141over 10 TB in size that can be days). With \fIFFMT\fR set that time may be160over 10 TB in size that can be days). With \fIFFMT\fR set that time may be
142reduced to minutes. So it is worth trying if it is available.161reduced to minutes or less. So it is worth trying if it is available.
143.br162.br
144\fIFFMT\fR has values 1 and 2 for fast format with 3 being reserved163\fIFFMT\fR has values 1 and 2 for fast format with 3 being reserved
145currently. These two values include this description: "The device server164currently. These two values include this description: "The device server
@@ -150,7 +169,12 @@ data has been written to, after the fast format. When \fIFFMT\fR is 1 the
150read operation should return "unspecified logical block data" and complete169read operation should return "unspecified logical block data" and complete
151without error. When \fIFFMT\fR is 2 the read operation may yield check170without error. When \fIFFMT\fR is 2 the read operation may yield check
152condition status with a sense key set to hardware error, medium error or171condition status with a sense key set to hardware error, medium error or
153command aborted. See SBC\-4 revision 15 section 4.35 for more details.172command aborted. See draft SBC\-4 revision 16 section 4.34 for more details.
173.TP
174\fB\-b\fR, \fB\-\-fmtmaxlba\fR
175This option is only active if it is given together with the
176\fI\-\-preset=ID\fR option. If so it sets the FMTMAXLBA field in the FORMAT
177WITH PRESET command.
154.TP178.TP
155\fB\-f\fR, \fB\-\-fmtpinfo\fR=\fIFPI\fR179\fB\-f\fR, \fB\-\-fmtpinfo\fR=\fIFPI\fR
156sets the FMTPINFO field in the FORMAT UNIT cdb to a value between 0 and 3.180sets the FMTPINFO field in the FORMAT UNIT cdb to a value between 0 and 3.
@@ -163,8 +187,10 @@ option should be used in their place. See the PROTECTION INFORMATION section
163below for more information.187below for more information.
164.TP188.TP
165\fB\-F\fR, \fB\-\-format\fR189\fB\-F\fR, \fB\-\-format\fR
166issue a SCSI FORMAT UNIT command.190issue one of the three SCSI "format" commands. In the absence of the
167.B This will destroy all the data held on the media.191\fI\-\-preset=ID\fR and \fI\-\-tape=FM\fR options, the SCSI FORMAT UNIT
192command is issued.
193.B These commands will destroy all the data held on the media.
168This option is required to change the block size of a disk. In the absence194This option is required to change the block size of a disk. In the absence
169of the \fI\-\-quick\fR option, the user is given a 15 second count down to195of the \fI\-\-quick\fR option, the user is given a 15 second count down to
170ponder the wisdom of doing this, during which time control\-C (amongst other196ponder the wisdom of doing this, during which time control\-C (amongst other
@@ -240,6 +266,12 @@ READY command is used, otherwise a REQUEST SENSE command is used. The
240default is currently 0 but this will change to 1 in the near future. See266default is currently 0 but this will change to 1 in the near future. See
241the NOTES sections below.267the NOTES sections below.
242.TP268.TP
269\fB\-E\fR, \fB\-\-preset\fR=\fIID\fR
270this option instructs this utility to issue a SCSI FORMAT WITH PRESET
271command. The PRESET IDENTIFIER field in that cdb is set to \fIID\fR. The
272IMMED field in that cdb is also set unless the \fI\-\-wait\fR option is
273also given, in which case it is cleared.
274.TP
243\fB\-Q\fR, \fB\-\-quick\fR275\fB\-Q\fR, \fB\-\-quick\fR
244the default action (i.e. when the option is not given) is to give the user276the default action (i.e. when the option is not given) is to give the user
24515 seconds to reconsider doing a format operation on the \fIDEVICE\fR.27715 seconds to reconsider doing a format operation on the \fIDEVICE\fR.
@@ -296,18 +328,18 @@ in a tape drive for use. Values for \fIFM\fR include 0 to do the "default"
296format; 1 to partition a volume and 2 to do a default format then partition.328format; 1 to partition a volume and 2 to do a default format then partition.
297.TP329.TP
298\fB\-m\fR, \fB\-\-timeout\fR=\fISECS\fR330\fB\-m\fR, \fB\-\-timeout\fR=\fISECS\fR
299where \fISECS\fR is the FORMAT UNIT or FORMAT MEDIUM command timeout in331where \fISECS\fR is the FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM
300seconds. \fISECS\fR will only be used if it exceeds the internal timeout332command timeout in seconds. \fISECS\fR will only be used if it exceeds the
301which is 20 seconds if the IMMED bit is set and 72000 seconds (20 hours)333internal timeout which is 20 seconds if the IMMED bit is set and 72000
302or higher if the IMMED bit is not set. If the disk size exceeds 4 TB then334seconds (20 hours) or higher if the IMMED bit is not set. If the disk size
303the timeout value is increased to 144000 seconds (40 hours). And if it is335exceeds 4 TB then the timeout value is increased to 144000 seconds (40 hours).
304greater than 8 TB then the timeout value is increased to 288000 seconds (80336And if it is greater than 8 TB then the timeout value is increased to
305hours). If the timeout is exceeded then the operating system will typically337288000 seconds (80 hours). If the timeout is exceeded then the operating
306abort the command. Aborting a command may escalate to a LUN reset (or338system will typically abort the command. Aborting a command may escalate to
307worse). A timeout may also leave the disk or tape format operation339a LUN reset (or worse). A timeout may also leave the disk or tape format
308incomplete. And that may result in the disk or tape being in a "format340operation incomplete. And that may result in the disk or tape being in
309corrupt" state requiring another format to remedy the situation. So for341a "format corrupt" state requiring another format to remedy the situation.
310various reasons timeouts are best avoided.342So for various reasons command timeouts are best avoided.
311.TP343.TP
312\fB\-v\fR, \fB\-\-verbose\fR344\fB\-v\fR, \fB\-\-verbose\fR
313increase the level of verbosity, (i.e. debug output). "\-vvv" gives345increase the level of verbosity, (i.e. debug output). "\-vvv" gives
@@ -324,9 +356,13 @@ print the version string and then exit.
324the default format action is to set the "IMMED" bit in the FORMAT UNIT356the default format action is to set the "IMMED" bit in the FORMAT UNIT
325command's (short) parameter header. If this option (i.e. \fI\-\-wait\fR) is357command's (short) parameter header. If this option (i.e. \fI\-\-wait\fR) is
326given then the "IMMED" bit is not set. If \fI\-\-wait\fR is given then the358given then the "IMMED" bit is not set. If \fI\-\-wait\fR is given then the
327FORMAT UNIT or FORMAT MEDIUM command waits until the format operation359FORMAT UNIT, FORMAT WITH PRESET or FORMAT MEDIUM command waits until the
328completes before returning its response. This can be many hours on large360format operation completes before returning its response. This can be many
329disks. See the \fI\-\-timeout=SECS\fR option.361hours on large disks. See the \fI\-\-timeout=SECS\fR option.
362.br
363Alternatively this option may be useful when used together with
364\fI\-\-ffmt=FFMT\fR (and \fIFFMT\fR greater than 0) since the fast format
365may only be a matter of seconds.
330.SH LISTS366.SH LISTS
331The SBC\-3 draft (revision 20) defines PLIST, CLIST, DLIST and GLIST in367The SBC\-3 draft (revision 20) defines PLIST, CLIST, DLIST and GLIST in
332section 4.10 on "Medium defects". Briefly, the PLIST is the "primary"368section 4.10 on "Medium defects". Briefly, the PLIST is the "primary"
@@ -370,8 +406,8 @@ introduced in the SBC\-2 standard. SBC\-3 defines 4 protection types (types
3700 to 3) with protection type 0 meaning no PI is maintained. While a device4060 to 3) with protection type 0 meaning no PI is maintained. While a device
371may support one or more protection types, it can only be formatted with 1407may support one or more protection types, it can only be formatted with 1
372of the 4. To change a device's protection type, it must be re\-formatted.408of the 4. To change a device's protection type, it must be re\-formatted.
373For more information see the Protection Information in section 4.22 of409For more information see the Protection Information in section 4.21 of
374draft SBC\-4 revision 15.410draft SBC\-4 revision 16.
375.PP411.PP
376A device that supports PI information (i.e. supports one or more protection412A device that supports PI information (i.e. supports one or more protection
377types 1, 2 and 3) sets the "PROTECT" bit in its standard INQUIRY response. It413types 1, 2 and 3) sets the "PROTECT" bit in its standard INQUIRY response. It
@@ -423,32 +459,35 @@ the current version of this utility defaults to using TEST UNIT READY
423commands to poll the disk to find out the progress of the format. The459commands to poll the disk to find out the progress of the format. The
424\fI\-\-poll=PT\fR option has been added to control this.460\fI\-\-poll=PT\fR option has been added to control this.
425.PP461.PP
426When the \fI\-\-format\fR option is given without the \fI\-\-wait\fR option462When the \fI\-\-format\fR, \fI\-\-preset=ID\fR or \fI\-\-tape=FM\fR option
427then the SCSI FORMAT UNIT command is issued with the IMMED bit set which463is given without the \fI\-\-wait\fR option then the corresponding SCSI
428causes the SCSI command to return after it has started the format operation.464command is issued with the IMMED bit set which causes the SCSI command to
429The \fI\-\-early\fR option will cause sg_format to exit at that point.465return after it has started the format operation. The \fI\-\-early\fR option
430Otherwise the \fIDEVICE\fR is polled every 60 seconds or every 10 seconds466will cause sg_format to exit at that point. Otherwise the \fIDEVICE\fR is
431if \fIFFMT\fR is non\-zero. The poll is with TEST UNIT READY or REQUEST SENSE467polled every 60 seconds or every 10 seconds if \fIFFMT\fR is non\-zero. The
432commands until one reports an "all clear" (i.e. the format operation has468poll is with TEST UNIT READY or REQUEST SENSE commands until one reports
433completed). Normally these polling commands will result in a progress469an "all clear" (i.e. the format operation has completed). Normally these
434indicator (expressed as a percentage) being output to the screen. If the user470polling commands will result in a progress indicator (expressed as a
435gets bored watching the progress report then sg_format process can be471percentage) being output to the screen. If the user gets bored watching the
436terminated (e.g. with control\-C) without affecting the format operation472progress report then sg_format process can be terminated (e.g. with
437which continues. However a target or device reset (or a power cycle) will473control\-C) without affecting the format operation which continues. However
438probably cause the device to become "format corrupt".474a target or device reset (or a power cycle) will probably cause the format
439.PP475to cease and the \fIDEVICE\fR to become "format corrupt".
440When the \fI\-\-format\fR (or \fI\-\-tape\fR) and \fI\-\-wait\fR options are476.PP
441both given then this utility may take a long time to return. In this case477When the \fI\-\-format\fR (\fI\-\-preset=ID\fR or \fI\-\-tape\fR) and
442care should be taken not to send any other SCSI commands to the disk as it478\fI\-\-wait\fR options are both given then this utility may take a long time
443may not respond leaving those commands queued behind the active format479to return. In this case care should be taken not to send any other SCSI
444command. This may cause a timeout in the OS driver (in a lot shorter period480commands to the disk as it may not respond leaving those commands queued
445than 20 hours applicable to some format operations). This may result in the481behind the active format command. This may cause a timeout in the OS
446OS resetting the disk leaving the format operation incomplete. This may leave482driver (in a lot shorter period than 20 hours applicable to some format
447the disk in a "format corrupt" state requiring another format to remedy483operations). This may result in the OS resetting the disk leaving the format
448the situation. Modern SCSI devices should yield a "not ready" sense key484operation incomplete. This may leave the disk in a "format corrupt" state
449with an additional sense indicating a format is in progress. With older485requiring another format to remedy the situation. Modern SCSI devices should
450devices the user should take precautions that nothing attempts to access486yield a "not ready" sense key with an additional sense indicating a format
451a device while it is being formatted.487is in progress. With older devices the user should take precautions that
488nothing attempts to access a device while it is being formatted. Unmounting
489in mounted file systems on a \fIDEVICE\fR prior to calling this utility
490is strongly advised.
452.PP491.PP
453When the block size (i.e. the number of bytes in each block) is changed492When the block size (i.e. the number of bytes in each block) is changed
454on a disk two SCSI commands must be sent: a MODE SELECT to change the block493on a disk two SCSI commands must be sent: a MODE SELECT to change the block
@@ -628,6 +667,17 @@ backed up.
628Now /dev/sdd should have 512 byte logical block size. And to switch it back:667Now /dev/sdd should have 512 byte logical block size. And to switch it back:
629.PP668.PP
630 # sg_format \-\-format \-\-ffmt=1 \-\-size=4096 /dev/sdd669 # sg_format \-\-format \-\-ffmt=1 \-\-size=4096 /dev/sdd
670.PP
671Since fast formats can be very quick (a matter of seconds) using the
672\-\-wait option may be appropriate.
673.PP
674And tu use Format with preset this invocation might be used:
675.PP
676 # sg_format \-\-preset=1 \-\-fmtmaxlba /dev/sdd
677.PP
678The FORMAT PRESETS VPD page (0xb8) should be consulted to check that Preset
679identifier 0x1 is there and has the expected format (i.e. "default host aware
680zoned block device model with 512 bytes of user data in each logical block").
631.SH EXIT STATUS681.SH EXIT STATUS
632The exit status of sg_format is 0 when it is successful. Otherwise see682The exit status of sg_format is 0 when it is successful. Otherwise see
633the sg3_utils(8) man page. Unless the \fI\-\-wait\fR option is given, the683the sg3_utils(8) man page. Unless the \fI\-\-wait\fR option is given, the
@@ -638,7 +688,7 @@ Written by Grant Grundler, James Bottomley and Douglas Gilbert.
638.SH "REPORTING BUGS"688.SH "REPORTING BUGS"
639Report bugs to <dgilbert at interlog dot com>.689Report bugs to <dgilbert at interlog dot com>.
640.SH COPYRIGHT690.SH COPYRIGHT
641Copyright \(co 2005\-2018 Grant Grundler, James Bottomley and Douglas Gilbert691Copyright \(co 2005\-2020 Grant Grundler, James Bottomley and Douglas Gilbert
642.br692.br
643This software is distributed under the GPL version 2. There is NO693This software is distributed under the GPL version 2. There is NO
644warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.694warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_get_elem_status.8 b/doc/sg_get_elem_status.8
645new file mode 100644695new file mode 100644
index 0000000..a4d533f
--- /dev/null
+++ b/doc/sg_get_elem_status.8
@@ -0,0 +1,100 @@
1.TH SG_GET_ELEM_STATUS "8" "August 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME
3sg_get_elem_status \- send SCSI GET PHYSICAL ELEMENT STATUS command
4.SH SYNOPSIS
5.B sg_get_elem_status
6[\fI\-\-brief\fR] [\fI\-\-filter=FLT\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]
7[\fI\-\-inhex=FN\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR]
8[\fI\-\-readonly\fR] [\fI\-\-report\-type=RT\fR] [\fI\-\-starting=ELEM\fR]
9[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
10.SH DESCRIPTION
11.\" Add any additional description here
12.PP
13Send the SCSI GET PHYSICAL ELEMENT STATUS command to the \fIDEVICE\fR and
14output the response. The command was introduced in (draft) SBC\-4 revision
1516.
16.PP
17The default action is to decode the response into one physical element
18status descriptor per line then output a header and the status descriptors
19to stdout. The amount of output can be reduced by the \fI\-\-brief\fR option.
20.PP
21Rather than send this SCSI command to \fIDEVICE\fR, if the \fI\-\-inhex=FN\fR
22option is given, then the contents of the file named \fIFN\fR are decoded
23as ASCII hex and then processed if it was the response of this command.
24.SH OPTIONS
25Arguments to long options are mandatory for short options as well.
26.TP
27\fB\-b\fR, \fB\-\-brief\fR
28tbd
29.TP
30\fB\-f\fR, \fB\-\-filter\fR=\fIFLT\fR
31where \fIFLT\fR is placed in a two bit field called FILTER in the GET
32PHYSICAL ELEMENT STATUS command. Only two values are defined for that
33field: 0 for all element descriptors; 1 for those element descriptors that
34are outside 'spec' or have depopulation information to report. In both cases
35the REPORT TYPE and STARTING ELEMENT fields may further restrict (reduce)
36the number of element descriptors returned. The default value is zero.
37.TP
38\fB\-h\fR, \fB\-\-help\fR
39output the usage message then exit.
40.TP
41\fB\-H\fR, \fB\-\-hex\fR
42output response to this command in ASCII hex.
43.TP
44\fB\-i\fR, \fB\-\-inhex\fR=\fIFN\fR
45where \fIFN\fR is a function name whose contents are assumed to be ASCII
46hexadecimal. If \fIDEVICE\fR is also given then \fIDEVICE\fR is ignored,
47a warning is issued and the utility continues, decoding the file named
48\fIFN\fR. See the "FORMAT OF FILES CONTAINING ASCII HEX" section in the
49sg3_utils manpage for more information. If the \fI\-\-raw\fR option is
50also given then the contents of \fIFN\fR are treated as binary.
51.TP
52\fB\-m\fR, \fB\-\-maxlen\fR=\fILEN\fR
53where \fILEN\fR is the (maximum) response length in bytes. It is placed in
54the cdb's "allocation length" field. If not given then 32 is used. 32 is
55enough space for the response header only.
56\fILEN\fR should be a multiple of 32 (e.g. 32, 64, and 96 are suitable).
57.TP
58\fB\-r\fR, \fB\-\-raw\fR
59output response in binary (to stdout) unless the \fI\-\-inhex=FN\fR option
60is also given. In that case the input file name (\fIFN\fR) is decoded as
61binary (and the output is _not_ in binary).
62.TP
63\fB\-R\fR, \fB\-\-readonly\fR
64open the \fIDEVICE\fR read\-only (e.g. in Unix with the O_RDONLY flag).
65The default is to open it read\-write.
66.TP
67\fB\-t\fR, \fB\-\-report\-type\fR=\fIRT\fR
68where \fIRT\fR will be placed in the REPORT TYPE field of the GET PHYSICAL
69ELEMENT STATUS command. Currently only two values are defined: 0
70for 'physical element' and 1: for 'storage element'. The default value
71is 1 .
72.TP
73\fB\-s\fR, \fB\-\-starting\fR=\fIELEM\fR
74where \fIELEM\fR is the placed in the STARTING ELEMENT field of the GET
75PHYSICAL ELEMENT STATUS command. Only physical elements with identifiers
76equal to or greater than \fIELEM\fR are returned. The default value is zero
77which while it isn't a valid element identifier (since they must be
78non\-zero) is given in an example in Annex L of SBC\-4 revision 17. So
79an \fIELEM\fR of zero is assumed to be valid in this context.
80.TP
81\fB\-v\fR, \fB\-\-verbose\fR
82increase the level of verbosity, (i.e. debug output). Additional output
83caused by this option is sent to stderr.
84.TP
85\fB\-V\fR, \fB\-\-version\fR
86print the version string and then exit.
87.SH EXIT STATUS
88The exit status of sg_get_elem_status is 0 when it is successful. Otherwise
89see the sg3_utils(8) man page.
90.SH AUTHORS
91Written by Douglas Gilbert.
92.SH "REPORTING BUGS"
93Report bugs to <dgilbert at interlog dot com>.
94.SH COPYRIGHT
95Copyright \(co 2019 Douglas Gilbert
96.br
97This software is distributed under a FreeBSD license. There is NO
98warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
99.SH "SEE ALSO"
100.B sg_get_lba_status(8), sg3_utils(8)
diff --git a/doc/sg_get_lba_status.8 b/doc/sg_get_lba_status.8
index bc35208..347a958 100644
--- a/doc/sg_get_lba_status.8
+++ b/doc/sg_get_lba_status.8
@@ -1,12 +1,13 @@
1.TH SG_GET_LBA_STATUS "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_GET_LBA_STATUS "8" "August 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_get_lba_status \- send SCSI GET LBA STATUS(16 or 32) command3sg_get_lba_status \- send SCSI GET LBA STATUS(16 or 32) command
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_get_lba_status5.B sg_get_lba_status
6[\fI\-\-16\fR] [\fI\-\-32\fR] [\fI\-\-brief\fR] [\fI\-\-element-id=EI\fR]6[\fI\-\-16\fR] [\fI\-\-32\fR] [\fI\-\-brief\fR] [\fI\-\-element-id=EI\fR]
7[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-maxlen=LEN\fR]7[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-inhex=FN\fR] [\fI\-\-lba=LBA\fR]
8[\fI\-\-raw\fR] [\fI\-\-readonly\fR] [\fI\-\-report\-type=RT\fR]8[\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR] [\fI\-\-readonly\fR]
9[\fI\-\-scan-len=SL\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR9[\fI\-\-report\-type=RT\fR] [\fI\-\-scan-len=SL\fR] [\fI\-\-verbose\fR]
10[\fI\-\-version\fR] \fIDEVICE\fR
10.SH DESCRIPTION11.SH DESCRIPTION
11.\" Add any additional description here12.\" Add any additional description here
12.PP13.PP
@@ -17,12 +18,17 @@ block provisioning should support this command. The GET LBA STATUS(32)
17command was added in (draft) SBC\-4 revision 14.18command was added in (draft) SBC\-4 revision 14.
18.PP19.PP
19The default action is to decode the response into one LBA status descriptor20The default action is to decode the response into one LBA status descriptor
20per line output to stdout. The descriptor LBA is output in hex (prefixed21per line then output a header and the status descriptors to stdout. The
21by '0x') and the number of blocks is output in decimal followed by the22descriptor LBA is output in hex (prefixed by '0x') and the number of blocks
22provisioning status and additional status in decimal. The provisioning status23is output in decimal followed by the provisioning status and additional status
23can be in the range 0 to 15 of which only 0 (mapped or unknown), 1 (unmapped),24in decimal. The provisioning status can be in the range 0 to 15 of which only
242 (anchored), 3 (mapped) and 4 (unknown) are used currently. The amount of250 (mapped or unknown), 1 (unmapped), 2 (anchored), 3 (mapped) and 4 (unknown)
25output can be reduced by the \fI\-\-brief\fR option.26are used currently. The amount of output can be reduced by the
27\fI\-\-brief\fR option.
28.PP
29Rather than send this SCSI command to \fIDEVICE\fR, if the \fI\-\-inhex=FN\fR
30option is given, then the contents of the file named \fIFN\fR are decoded
31as ASCII hex and then processed if it was the response of this command.
26.SH OPTIONS32.SH OPTIONS
27Arguments to long options are mandatory for short options as well.33Arguments to long options are mandatory for short options as well.
28.TP34.TP
@@ -65,6 +71,13 @@ output the usage message then exit.
65\fB\-H\fR, \fB\-\-hex\fR71\fB\-H\fR, \fB\-\-hex\fR
66output response to this command in ASCII hex.72output response to this command in ASCII hex.
67.TP73.TP
74\fB\-i\fR, \fB\-\-inhex\fR=\fIFN\fR
75where \fIFN\fR is a filename whose contents are assumed to be ASCII
76hexadecimal bytes. See the "FORMAT OF FILES CONTAINING ASCII HEX" section
77in the sg3_utils manpage for more information. If \fIDEVICE\fR is also
78given then it is ignored. If the \fI\-\-raw\fR option is also given then
79the contents of \fIFN\fR are treated as binary.
80.TP
68\fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR81\fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR
69where \fILBA\fR is the starting Logical Block Address (LBA) to check the82where \fILBA\fR is the starting Logical Block Address (LBA) to check the
70provisioning status for. Note that the \fIDEVICE\fR chooses how many83provisioning status for. Note that the \fIDEVICE\fR chooses how many
@@ -77,7 +90,9 @@ enough space for the response header and one LBA status descriptor.
77\fILEN\fR should be 8 plus a multiple of 16 (e.g. 24, 40, and 56 are suitable).90\fILEN\fR should be 8 plus a multiple of 16 (e.g. 24, 40, and 56 are suitable).
78.TP91.TP
79\fB\-r\fR, \fB\-\-raw\fR92\fB\-r\fR, \fB\-\-raw\fR
80output response in binary (to stdout).93output response in binary (to stdout) unless the \fI\-\-inhex=FN\fR option
94is also given. In that case the input file name (\fIFN\fR) is decoded as
95binary (and the output is _not_ in binary).
81.TP96.TP
82\fB\-R\fR, \fB\-\-readonly\fR97\fB\-R\fR, \fB\-\-readonly\fR
83open the \fIDEVICE\fR read\-only (e.g. in Unix with the O_RDONLY flag).98open the \fIDEVICE\fR read\-only (e.g. in Unix with the O_RDONLY flag).
@@ -126,9 +141,9 @@ Written by Douglas Gilbert.
126.SH "REPORTING BUGS"141.SH "REPORTING BUGS"
127Report bugs to <dgilbert at interlog dot com>.142Report bugs to <dgilbert at interlog dot com>.
128.SH COPYRIGHT143.SH COPYRIGHT
129Copyright \(co 2009\-2018 Douglas Gilbert144Copyright \(co 2009\-2019 Douglas Gilbert
130.br145.br
131This software is distributed under a FreeBSD license. There is NO146This software is distributed under a FreeBSD license. There is NO
132warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.147warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
133.SH "SEE ALSO"148.SH "SEE ALSO"
134.B sg_write_same(8), sg_unmap(8)149.B sg_write_same(8), sg_unmap(8), sg3_utils(8)
diff --git a/doc/sg_logs.8 b/doc/sg_logs.8
index af07a2a..216f8d7 100644
--- a/doc/sg_logs.8
+++ b/doc/sg_logs.8
@@ -1,4 +1,4 @@
1.TH SG_LOGS "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_LOGS "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_logs \- access log pages with SCSI LOG SENSE command3sg_logs \- access log pages with SCSI LOG SENSE command
4.SH SYNOPSIS4.SH SYNOPSIS
@@ -161,7 +161,11 @@ treated as binary.
161lists the names of all logs sense pages supported by this device. This is161lists the names of all logs sense pages supported by this device. This is
162done by reading the "supported log pages" log page. When used162done by reading the "supported log pages" log page. When used
163twice (e.g. '\-ll') lists the names of all logs sense pages and subpages163twice (e.g. '\-ll') lists the names of all logs sense pages and subpages
164supported by this device. There is a list of common log page codes below.164supported by this device, excluding pages whose subpage number is
1650xff (apart from page 0x0,0xff). When used three times then all supported
166pages and subpages reported by the device are list. So the page/subpage
167names and not thrie content is shown with this option. There is a list of
168common log page codes below.
165.TP169.TP
166\fB\-m\fR, \fB\-\-maxlen\fR=\fILEN\fR170\fB\-m\fR, \fB\-\-maxlen\fR=\fILEN\fR
167sets the "allocation length" field in the LOG SENSE cdb. The is the maximum171sets the "allocation length" field in the LOG SENSE cdb. The is the maximum
@@ -279,14 +283,14 @@ outputs the transport ('Protocol specific port') log page. Equivalent to
279setting '\-\-page=18h'.283setting '\-\-page=18h'.
280.TP284.TP
281\fB\-M\fR, \fB\-\-vendor\fR=\fIVP\fR285\fB\-M\fR, \fB\-\-vendor\fR=\fIVP\fR
282where \fIVP\fR is a vendor (e.g. "sea" for Seagate) or product (group)286where \fIVP\fR is a vendor/manufacturer (e.g. "sea" for Seagate) or
283acronym (e.g. "lto5" for the 5th generation LTO (tape) consortium). Either287product (group) acronym (e.g. "lto5" for the 5th generation LTO (tape)
284the whole log page is vendor specific (e.g. page numbers 0x30 to 0x3f) or288consortium). Either the whole log page is vendor specific (e.g. page
285part of a T10 defined log page is vendor specific. For example SPC\-5289numbers 0x30 to 0x3f) or part of a T10 defined log page is vendor specific.
286defines parameter code 0x0 of page 0x2f (the Informational Exceptions log290For example SPC\-5 defines parameter code 0x0 of page 0x2f (the Informational
287page) and states that the remaining parameter codes (i.e. 0x1 to 0xffff)291Exceptions log page) and states that the remaining parameter codes (i.e. 0x1
288are vendor specific. Using a \fIVP\fR of "xxx" will list the available292to 0xffff) are vendor specific. Using a \fIVP\fR of "xxx" will list the
289acronyms.293available acronyms.
290.br294.br
291If this option is used with \fI\-\-page=PG\fR and \fIPG\fR is an acronym295If this option is used with \fI\-\-page=PG\fR and \fIPG\fR is an acronym
292then this option is ignored. If \fIPG\fR is a number (e.g. 0xc0) then296then this option is ignored. If \fIPG\fR is a number (e.g. 0xc0) then
@@ -478,7 +482,7 @@ Written by Douglas Gilbert
478.SH "REPORTING BUGS"482.SH "REPORTING BUGS"
479Report bugs to <dgilbert at interlog dot com>.483Report bugs to <dgilbert at interlog dot com>.
480.SH COPYRIGHT484.SH COPYRIGHT
481Copyright \(co 2002\-2018 Douglas Gilbert485Copyright \(co 2002\-2020 Douglas Gilbert
482.br486.br
483This software is distributed under the GPL version 2. There is NO487This software is distributed under the GPL version 2. There is NO
484warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.488warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_luns.8 b/doc/sg_luns.8
index f27ed6f..8292772 100644
--- a/doc/sg_luns.8
+++ b/doc/sg_luns.8
@@ -1,4 +1,4 @@
1.TH SG_LUNS "8" "June 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_LUNS "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_luns \- send SCSI REPORT LUNS command or decode given LUN3sg_luns \- send SCSI REPORT LUNS command or decode given LUN
4.SH SYNOPSIS4.SH SYNOPSIS
@@ -20,7 +20,7 @@ should be a list of LUNs ("a LUN inventory") for the I_T nexus associated
20with the \fIDEVICE\fR. Roughly speaking that is all LUNs that share the20with the \fIDEVICE\fR. Roughly speaking that is all LUNs that share the
21target device that the REPORT LUNS command is sent through. This command21target device that the REPORT LUNS command is sent through. This command
22is defined in the SPC\-3 and SPC\-4 SCSI standards and its support is22is defined in the SPC\-3 and SPC\-4 SCSI standards and its support is
23mandatory. The most recent draft if SPC\5 revision 9.23mandatory. The most recent draft if SPC\-6 revision 1.
24.PP24.PP
25When the \fI\-\-test=ALUN\fR option is given (the second form in the25When the \fI\-\-test=ALUN\fR option is given (the second form in the
26SYNOPSIS), then the \fIALUN\fR value is decoded as outlined in various26SYNOPSIS), then the \fIALUN\fR value is decoded as outlined in various
@@ -311,7 +311,7 @@ Written by Douglas Gilbert.
311.SH "REPORTING BUGS"311.SH "REPORTING BUGS"
312Report bugs to <dgilbert at interlog dot com>.312Report bugs to <dgilbert at interlog dot com>.
313.SH COPYRIGHT313.SH COPYRIGHT
314Copyright \(co 2004\-2018 Douglas Gilbert314Copyright \(co 2004\-2020 Douglas Gilbert
315.br315.br
316This software is distributed under a FreeBSD license. There is NO316This software is distributed under a FreeBSD license. There is NO
317warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.317warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_modes.8 b/doc/sg_modes.8
index ed2d2e3..d68bc40 100644
--- a/doc/sg_modes.8
+++ b/doc/sg_modes.8
@@ -1,4 +1,4 @@
1.TH SG_MODES "8" "September 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_MODES "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_modes \- reads mode pages with SCSI MODE SENSE command3sg_modes \- reads mode pages with SCSI MODE SENSE command
4.SH SYNOPSIS4.SH SYNOPSIS
@@ -22,7 +22,7 @@ outputs the response. There is a 6 byte and 10 byte (cdb) variant of the
22MODE SENSE command, this utility defaults to the 10 byte variant. The SPC\-422MODE SENSE command, this utility defaults to the 10 byte variant. The SPC\-4
23standard (and SPC\-5 drafts) include a note stating that implementers should23standard (and SPC\-5 drafts) include a note stating that implementers should
24migrate away from the SCSI MODE SELECT(6) and MODE SENSE(6) commands in24migrate away from the SCSI MODE SELECT(6) and MODE SENSE(6) commands in
25favour of the 10 byte variants (e.g. MODE SENSE(10)).25favour of the 10 byte variants (e.g. MODE SENSE(10)).
26.PP26.PP
27This utility decodes mode page headers and block descriptors but outputs27This utility decodes mode page headers and block descriptors but outputs
28the contents of each mode page in hex. It also has no facility to change28the contents of each mode page in hex. It also has no facility to change
@@ -82,6 +82,9 @@ descriptors are present in the response or not, they are not output.
82examine each mode page in the range 0 through to 62 (inclusive).82examine each mode page in the range 0 through to 62 (inclusive).
83If some response is given then print out the mode page name or83If some response is given then print out the mode page name or
84number (in hex) if the name is not known.84number (in hex) if the name is not known.
85.br
86The sdparm utility which lists mode and VPD pages also has a \fB\-\-examine\fR
87option will similar functionility.
85.TP88.TP
86\fB\-f\fR, \fB\-\-flexible\fR89\fB\-f\fR, \fB\-\-flexible\fR
87Some devices, bridges and/or drivers attempt crude translations between90Some devices, bridges and/or drivers attempt crude translations between
@@ -298,7 +301,7 @@ Written by Douglas Gilbert
298.SH "REPORTING BUGS"301.SH "REPORTING BUGS"
299Report bugs to <dgilbert at interlog dot com>.302Report bugs to <dgilbert at interlog dot com>.
300.SH COPYRIGHT303.SH COPYRIGHT
301Copyright \(co 2000\-2018 Douglas Gilbert304Copyright \(co 2000\-2020 Douglas Gilbert
302.br305.br
303This software is distributed under the GPL version 2. There is NO306This software is distributed under the GPL version 2. There is NO
304warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.307warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_raw.8 b/doc/sg_raw.8
index b6bdbcc..3e01bd0 100644
--- a/doc/sg_raw.8
+++ b/doc/sg_raw.8
@@ -1,4 +1,4 @@
1.TH SG_RAW "8" "May 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_RAW "8" "January 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_raw \- send arbitrary SCSI command to a device3sg_raw \- send arbitrary SCSI command to a device
4.SH SYNOPSIS4.SH SYNOPSIS
@@ -193,7 +193,9 @@ bsg device. Note that data is being read from "urandom.bin" and sent
193to the device (data\-out) while resulting data (data\-in) is placed193to the device (data\-out) while resulting data (data\-in) is placed
194in the "out.bin" file. Also note the length of both is 512 bytes194in the "out.bin" file. Also note the length of both is 512 bytes
195which corresponds to the transfer length of 1 (block) in the cdb (i.e.195which corresponds to the transfer length of 1 (block) in the cdb (i.e.
196the second last byte).196the second last byte). urandom.bin can be produced like this:
197.br
198dd if=/dev/urandom bs=512 count=1 of=urandom.bin
197.TP199.TP
198sg_raw.exe PhysicalDrive1 a1 0c 0e 00 00 00 00 00 00 e0 00 00200sg_raw.exe PhysicalDrive1 a1 0c 0e 00 00 00 00 00 00 e0 00 00
199This example is from Windows and shows a ATA STANDBY IMMEDIATE command201This example is from Windows and shows a ATA STANDBY IMMEDIATE command
@@ -208,9 +210,9 @@ the sg3_utils(8) man page.
208.SH AUTHOR210.SH AUTHOR
209Written by Ingo van Lil211Written by Ingo van Lil
210.SH "REPORTING BUGS"212.SH "REPORTING BUGS"
211Report bugs to <inguin at gmx dot de>.213Report bugs to <inguin at gmx dot de> or to <dgilbert at interlog dot com>.
212.SH COPYRIGHT214.SH COPYRIGHT
213Copyright \(co 2001\-2018 Ingo van Lil215Copyright \(co 2001\-2019 Ingo van Lil
214.br216.br
215This software is distributed under the GPL version 2. There is NO217This software is distributed under the GPL version 2. There is NO
216warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.218warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_read.8 b/doc/sg_read.8
index 3f01134..c12dd57 100644
--- a/doc/sg_read.8
+++ b/doc/sg_read.8
@@ -1,4 +1,4 @@
1.TH SG_READ "8" "November 2012" "sg3_utils\-1.35" SG3_UTILS1.TH SG_READ "8" "September 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_read \- read multiple blocks of data, optionally with SCSI READ commands3sg_read \- read multiple blocks of data, optionally with SCSI READ commands
4.SH SYNOPSIS4.SH SYNOPSIS
@@ -29,6 +29,11 @@ are issued. "Zero block" means "do nothing" for SCSI READ 10, 12 and
2916 byte commands (but not for the 6 byte variant). In practice "zero2916 byte commands (but not for the 6 byte variant). In practice "zero
30block" SCSI READ commands have low latency and so are one way to measure30block" SCSI READ commands have low latency and so are one way to measure
31SCSI command overhead.31SCSI command overhead.
32.PP
33Please note: this is a very old utility that uses 32 bit integers for
34disk LBAs and the count. Hence it will not be able to address beyond
352 Terabytes on a disk with logical blocks that are 512 bytes long.
36Alternatives are the sg_dd and ddpt utilities.
32.SH OPTIONS37.SH OPTIONS
33.TP38.TP
34\fBblk_sgio\fR=0 | 139\fBblk_sgio\fR=0 | 1
@@ -171,14 +176,17 @@ Written by Douglas Gilbert.
171.SH "REPORTING BUGS"176.SH "REPORTING BUGS"
172Report bugs to <dgilbert at interlog dot com>.177Report bugs to <dgilbert at interlog dot com>.
173.SH COPYRIGHT178.SH COPYRIGHT
174Copyright \(co 2000\-2012 Douglas Gilbert179Copyright \(co 2000\-2019 Douglas Gilbert
175.br180.br
176This software is distributed under the GPL version 2. There is NO181This software is distributed under the GPL version 2. There is NO
177warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.182warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
178.SH "SEE ALSO"183.SH "SEE ALSO"
179To time streaming media read or write time see184To time streaming media read or write time see
180.B sg_dd185.B sg_dd
181is in the sg3_utils package. The lmbench package contains186is in the sg3_utils package and
187.B ddpt
188in a package of the same name.
189The lmbench package contains
182.B lmdd190.B lmdd
183which is also interesting.191which is also interesting.
184.B raw(8), dd(1)192.B raw(8), dd(1)
diff --git a/doc/sg_read_buffer.8 b/doc/sg_read_buffer.8
index fd9296c..d1aed04 100644
--- a/doc/sg_read_buffer.8
+++ b/doc/sg_read_buffer.8
@@ -1,11 +1,12 @@
1.TH SG_READ_BUFFER "8" "May 2014" "sg3_utils\-1.39" SG3_UTILS1.TH SG_READ_BUFFER "8" "May 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_read_buffer \- send SCSI READ BUFFER command3sg_read_buffer \- send SCSI READ BUFFER command
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_read_buffer5.B sg_read_buffer
6[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-id=ID\fR] [\fI\-\-length=LEN\fR]6[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-id=ID\fR] [\fI\-\-inhex=FN\fR]
7[\fI\-\-mode=MO\fR] [\fI\-\-offset=OFF\fR] [\fI\-\-raw\fR]7[\fI\-\-length=LEN\fR] [\fI\-\-mode=MO\fR] [\fI\-\-offset=OFF\fR]
8[\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR8[\fI\-\-raw\fR] [\fI\-\-readonly\fR] [\fI\-\-specific=MS\fR]
9[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
9.SH DESCRIPTION10.SH DESCRIPTION
10.\" Add any additional description here11.\" Add any additional description here
11.PP12.PP
@@ -15,6 +16,12 @@ it in binary to stdout. If a response is received for a "descriptor"
15mode then, in the absence of \fI\-\-hex\fR and \fI\-\-raw\fR, it is16mode then, in the absence of \fI\-\-hex\fR and \fI\-\-raw\fR, it is
16decoded. Response for non\-descriptor modes are output in hexadecimal17decoded. Response for non\-descriptor modes are output in hexadecimal
17unless the \fI\-\-raw\fR option is given.18unless the \fI\-\-raw\fR option is given.
19.PP
20This utility may be called without a \fIDEVICE\fR but with a
21\fI\-\-inhex=FN\fR option instead. \fIFN\fR is expected to be a file
22name (or '\-' for stdin). The contents of the file (or stdin stream)
23is assumed to be hexadecimal (or binary) data that represents a SCSI
24READ BUFFER command response and is decoded as such.
18.SH OPTIONS25.SH OPTIONS
19Arguments to long options are mandatory for short options as well.26Arguments to long options are mandatory for short options as well.
20.TP27.TP
@@ -31,6 +38,16 @@ right of each line.
31this option sets the buffer id field in the cdb. \fIID\fR is a value between38this option sets the buffer id field in the cdb. \fIID\fR is a value between
320 (default) and 255 inclusive.390 (default) and 255 inclusive.
33.TP40.TP
41\fB\-I\fR, \fB\-\-inhex\fR=\fIFN\fR
42\fIFN\fR is expected to be a file name (or '\-' for stdin) which contains
43ASCII hexadecimal or binary representing a READ BUFFER response. If known
44this utility will then decode that response. It is preferable to also
45supply the \fI\-\-mode=MO\fR and \fI\-\-specific=MS\fR options, since these
46are not present in the response. The hexadecimal should be arranged as 1 or
472 digits representing a byte each of which is whitespace or comma separated.
48Anything from and including a hash mark to the end of line is ignored. If the
49\fI\-\-raw\fR option is also given then \fIFN\fR is treated as binary.
50.TP
34\fB\-l\fR, \fB\-\-length\fR=\fILEN\fR51\fB\-l\fR, \fB\-\-length\fR=\fILEN\fR
35where \fILEN\fR is the length, in bytes, that is placed in the "allocation52where \fILEN\fR is the length, in bytes, that is placed in the "allocation
36length" field in the cdb. The default value is 4 (bytes). The device may53length" field in the cdb. The default value is 4 (bytes). The device may
@@ -54,6 +71,10 @@ if a response is received then it is sent in binary to stdout.
54open the \fIDEVICE\fR read\-only (e.g. in Unix with the O_RDONLY flag).71open the \fIDEVICE\fR read\-only (e.g. in Unix with the O_RDONLY flag).
55The default is to open it read\-write.72The default is to open it read\-write.
56.TP73.TP
74\fB\-S\fR, \fB\-\-specific\fR=\fIMS\fR
75this option sets the mode specific field in the cdb. \fIMS\fR is a value
76between 0 and 7 as this is a 3 bit field.
77.TP
57\fB\-v\fR, \fB\-\-verbose\fR78\fB\-v\fR, \fB\-\-verbose\fR
58increase the level of verbosity, (i.e. debug output).79increase the level of verbosity, (i.e. debug output).
59.TP80.TP
@@ -87,6 +108,9 @@ Echo buffer descriptor: yields 4 bytes of which the last (lowest) 13 bits
87represent the echo buffer capacity. The maximum echo buffer size is 4096108represent the echo buffer capacity. The maximum echo buffer size is 4096
88bytes.109bytes.
89.TP110.TP
111rd_microc_st [15, 0xf]
112Read microcode status. Added in spc5r20 .
113.TP
90en_ex [26, 0x1a]114en_ex [26, 0x1a]
91Enable expander communications protocol and Echo buffer. Made obsolete in115Enable expander communications protocol and Echo buffer. Made obsolete in
92SPC\-4.116SPC\-4.
@@ -105,7 +129,7 @@ Written by Luben Tuikov and Douglas Gilbert.
105.SH "REPORTING BUGS"129.SH "REPORTING BUGS"
106Report bugs to <dgilbert at interlog dot com>.130Report bugs to <dgilbert at interlog dot com>.
107.SH COPYRIGHT131.SH COPYRIGHT
108Copyright \(co 2006\-2014 Luben Tuikov and Douglas Gilbert132Copyright \(co 2006\-2019 Luben Tuikov and Douglas Gilbert
109.br133.br
110This software is distributed under a FreeBSD license. There is NO134This software is distributed under a FreeBSD license. There is NO
111warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.135warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_readcap.8 b/doc/sg_readcap.8
index ffc8724..fa2afd3 100644
--- a/doc/sg_readcap.8
+++ b/doc/sg_readcap.8
@@ -1,15 +1,17 @@
1.TH SG_READCAP "8" "May 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_READCAP "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_readcap \- send SCSI READ CAPACITY command3sg_readcap \- send SCSI READ CAPACITY command
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_readcap5.B sg_readcap
6[\fI\-\-16\fR] [\fI\-\-brief\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]6[\fI\-\-16\fR] [\fI\-\-brief\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]
7[\fI\-\-lba=LBA\fR] [\fI\-\-long\fR] [\fI\-\-pmi\fR] [\fI\-\-raw\fR]7[\fI\-\-lba=LBA\fR] [\fI\-\-long\fR] [\fI\-\-pmi\fR] [\fI\-\-raw\fR]
8[\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR8[\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-zbc\fR]
9\fIDEVICE\fR
9.PP10.PP
10.B sg_readcap11.B sg_readcap
11[\fI\-16\fR] [\fI\-b\fR] [\fI\-h\fR] [\fI\-H\fR] [\fI\-lba=LBA\fR]12[\fI\-16\fR] [\fI\-b\fR] [\fI\-h\fR] [\fI\-H\fR] [\fI\-lba=LBA\fR]
12[\fI\-pmi\fR] [\fI\-r\fR] [\fI\-R\fR] [\fI\-v\fR] [\fI\-V\fR] \fIDEVICE\fR13[\fI\-pmi\fR] [\fI\-r\fR] [\fI\-R\fR] [\fI\-v\fR] [\fI\-V\fR] [\fI\-z\fR]
14\fIDEVICE\fR
13.SH DESCRIPTION15.SH DESCRIPTION
14.\" Add any additional description here16.\" Add any additional description here
15.PP17.PP
@@ -104,6 +106,10 @@ increase level of verbosity. Can be used multiple times.
104.TP106.TP
105\fB\-V\fR, \fB\-\-version\fR107\fB\-V\fR, \fB\-\-version\fR
106outputs version string then exits.108outputs version string then exits.
109.TP
110\fB\-z\fR, \fB\-\-zbc\fR
111additionally prints out the extra ZBC field (RC_BASIS) in the READ CAPACITY
112response. Using the option implicitly sets the \fI\-\-16\fR option.
107.SH NOTES113.SH NOTES
108The response to READ CAPACITY(16) contains a LBPRZ bit in the SBC\-3114The response to READ CAPACITY(16) contains a LBPRZ bit in the SBC\-3
109standard (ANSI INCITS 514\-2014). There was also a LBPRZ bit with the same115standard (ANSI INCITS 514\-2014). There was also a LBPRZ bit with the same
@@ -171,6 +177,9 @@ and '\-vvv' are also accepted yielding greater verbosity.
171.TP177.TP
172\fB\-V\fR178\fB\-V\fR
173outputs version string then exits.179outputs version string then exits.
180.TP
181\fB\-R\fR
182Equivalent to \fI\-\-zbc\fR in the main description.
174.SH ENVIRONMENT VARIABLES183.SH ENVIRONMENT VARIABLES
175Since sg3_utils version 1.23 the environment variable SG3_UTILS_OLD_OPTS184Since sg3_utils version 1.23 the environment variable SG3_UTILS_OLD_OPTS
176can be given. When it is present this utility will expect the older command185can be given. When it is present this utility will expect the older command
@@ -179,7 +188,7 @@ using \fI\-\-old\fR (or \fI\-O\fR) as the first command line option.
179.SH AUTHORS188.SH AUTHORS
180Written by Douglas Gilbert189Written by Douglas Gilbert
181.SH COPYRIGHT190.SH COPYRIGHT
182Copyright \(co 1999\-2018 Douglas Gilbert191Copyright \(co 1999\-2020 Douglas Gilbert
183.br192.br
184This software is distributed under the GPL version 2. There is NO193This software is distributed under the GPL version 2. There is NO
185warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.194warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_reassign.8 b/doc/sg_reassign.8
index ecacc7f..3ad0f8a 100644
--- a/doc/sg_reassign.8
+++ b/doc/sg_reassign.8
@@ -1,4 +1,4 @@
1.TH SG_REASSIGN "8" "October 2017" "sg3_utils\-1.43" SG3_UTILS1.TH SG_REASSIGN "8" "October 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_reassign \- send SCSI REASSIGN BLOCKS command3sg_reassign \- send SCSI REASSIGN BLOCKS command
4.SH SYNOPSIS4.SH SYNOPSIS
@@ -142,7 +142,7 @@ Written by Douglas Gilbert.
142.SH "REPORTING BUGS"142.SH "REPORTING BUGS"
143Report bugs to <dgilbert at interlog dot com>.143Report bugs to <dgilbert at interlog dot com>.
144.SH COPYRIGHT144.SH COPYRIGHT
145Copyright \(co 2005\-2017 Douglas Gilbert145Copyright \(co 2005\-2019 Douglas Gilbert
146.br146.br
147This software is distributed under a FreeBSD license. There is NO147This software is distributed under a FreeBSD license. There is NO
148warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.148warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_rep_zones.8 b/doc/sg_rep_zones.8
index df734d0..29fecd1 100644
--- a/doc/sg_rep_zones.8
+++ b/doc/sg_rep_zones.8
@@ -1,17 +1,18 @@
1.TH SG_REP_ZONES "8" "February 2016" "sg3_utils\-1.42" SG3_UTILS1.TH SG_REP_ZONES "8" "February 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_rep_zones \- send SCSI REPORT ZONES command3sg_rep_zones \- send SCSI REPORT ZONES command
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_rep_zones5.B sg_rep_zones
6[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-raw\fR]6[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-num=NUM\fR]
7[\fI\-\-readonly\fR] [\fI\-\-report=OPT\fR] [\fI\-\-start=LBA\fR]7[\fI\-\-raw\fR] [\fI\-\-readonly\fR] [\fI\-\-report=OPT\fR]
8[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR8[\fI\-\-start=LBA\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-wp\fR]
9\fIDEVICE\fR
9.SH DESCRIPTION10.SH DESCRIPTION
10.\" Add any additional description here11.\" Add any additional description here
11.PP12.PP
12Sends a SCSI REPORT ZONES command to \fIDEVICE\fR and outputs the data13Sends a SCSI REPORT ZONES command to \fIDEVICE\fR and outputs the data
13returned. This command is found in the ZBC draft standard, revision14returned. This command is found in the ZBC draft standard, revision
144c (zbc\-r04c.pdf).155 (zbc\-r05.pdf).
15.SH OPTIONS16.SH OPTIONS
16Arguments to long options are mandatory for short options as well.17Arguments to long options are mandatory for short options as well.
17.TP18.TP
@@ -30,6 +31,11 @@ where \fILEN\fR is the (maximum) response length in bytes. It is placed in
30the cdb's "allocation length" field. If not given (or \fILEN\fR is zero)31the cdb's "allocation length" field. If not given (or \fILEN\fR is zero)
31then 8192 is used. The maximum allowed value of \fILEN\fR is 1048576.32then 8192 is used. The maximum allowed value of \fILEN\fR is 1048576.
32.TP33.TP
34\fB\-n\fR, \fB\-\-num\fR=\fINUM\fR
35where \fINUM\fR is the (maximum) number of zone descriptors to print out.
36The default value is zero which is taken to mean print out all zone
37descriptors returned by the REPORT ZONES command.
38.TP
33\fB\-p\fR, \fB\-\-partial\fR39\fB\-p\fR, \fB\-\-partial\fR
34set the PARTIAL bit in the cdb.40set the PARTIAL bit in the cdb.
35.TP41.TP
@@ -62,6 +68,11 @@ prefixed with '0x' or has a trailing 'h' which indicate hexadecimal.
62increase the level of verbosity, (i.e. debug output).68increase the level of verbosity, (i.e. debug output).
63.TP69.TP
64\fB\-V\fR, \fB\-\-version\fR70\fB\-V\fR, \fB\-\-version\fR
71print the write pointer (in hex) only. In the absence of errors, then a hex
72LBA will be printed on each line, one line for each zone. Can be usefully
73combined with the \fI\-\-num=NUM\fR and \fI\-\-start=LBA\fR options.
74.TP
75\fB\-w\fR, \fB\-\-wp\fR
65print the version string and then exit.76print the version string and then exit.
66.SH EXIT STATUS77.SH EXIT STATUS
67The exit status of sg_rep_zones is 0 when it is successful. Otherwise see78The exit status of sg_rep_zones is 0 when it is successful. Otherwise see
@@ -71,7 +82,7 @@ Written by Douglas Gilbert.
71.SH "REPORTING BUGS"82.SH "REPORTING BUGS"
72Report bugs to <dgilbert at interlog dot com>.83Report bugs to <dgilbert at interlog dot com>.
73.SH COPYRIGHT84.SH COPYRIGHT
74Copyright \(co 2014\-2016 Douglas Gilbert85Copyright \(co 2014\-2020 Douglas Gilbert
75.br86.br
76This software is distributed under a FreeBSD license. There is NO87This software is distributed under a FreeBSD license. There is NO
77warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.88warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_requests.8 b/doc/sg_requests.8
index 5372deb..81db55f 100644
--- a/doc/sg_requests.8
+++ b/doc/sg_requests.8
@@ -1,12 +1,12 @@
1.TH SG_REQUESTS "8" "February 2016" "sg3_utils\-1.43" SG3_UTILS1.TH SG_REQUESTS "8" "July 2018" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_requests \- send one or more SCSI REQUEST SENSE commands3sg_requests \- send one or more SCSI REQUEST SENSE commands
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_requests5.B sg_requests
6[\fI\-\-desc\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-maxlen=LEN\fR]6[\fI\-\-desc\fR] [\fI\-\-error\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR]
7[\fI\-\-num=NUM\fR] [\fI\-\-number=NUM\fR] [\fI\-\-progress\fR]7[\fI\-\-maxlen=LEN\fR] [\fI\-\-num=NUM\fR] [\fI\-\-number=NUM\fR]
8[\fI\-\-raw\fR] [\fI\-\-status\fR] [\fI\-\-time\fR] [\fI\-\-verbose\fR]8[\fI\-\-progress\fR] [\fI\-\-raw\fR] [\fI\-\-status\fR] [\fI\-\-time\fR]
9[\fI\-\-version\fR] \fIDEVICE\fR9[\fI\-\-verbose\fR] [\fI\-\-version\fR] \fIDEVICE\fR
10.SH DESCRIPTION10.SH DESCRIPTION
11.\" Add any additional description here11.\" Add any additional description here
12.PP12.PP
@@ -28,6 +28,16 @@ and later). If the device is pre SPC\-3 then setting a bit in a reserved
28field may cause a check condition status with an illegal request sense key,28field may cause a check condition status with an illegal request sense key,
29but will most likely be ignored.29but will most likely be ignored.
30.TP30.TP
31\fB\-e\fR, \fB\-\-error\fR
32when used once it changes the REQUEST SENSE opcode from 0x3 to 0xff which
33should be rejected by the \fIDEVICE\fR. There is a small chance that the
34device vendor has implemented a vendor specific command at that opcode (0xff).
35When used twice the pass-through call to send the SCSI command is bypassed.
36The idea here is to measure the user space overhead of this package's
37library to set up and process the response of a SCSI command. This option
38will be typically used with the \fI\-\-num=NUM\fR and \fI\-\-time\fR
39options where \fINUM\fR is a large number (e.g. 1000000).
40.TP
31\fB\-h\fR, \fB\-\-help\fR41\fB\-h\fR, \fB\-\-help\fR
32output the usage message then exit.42output the usage message then exit.
33.TP43.TP
@@ -47,7 +57,7 @@ is reached or an error occurs. The default value for \fINUM\fR is 1 .
47same action as \fI\-\-num=NUM\fR. Added for compatibility with sg_turs.57same action as \fI\-\-num=NUM\fR. Added for compatibility with sg_turs.
48.TP58.TP
49\fB\-p\fR, \fB\-\-progress\fR59\fB\-p\fR, \fB\-\-progress\fR
50show progress indication (a percentage) if available. If \fI\-\-number=NUM\fR60show progress indication (a percentage) if available. If \fI\-\-num=NUM\fR
51is given, \fINUM\fR is greater than 1 and an initial progress indication61is given, \fINUM\fR is greater than 1 and an initial progress indication
52was detected then this utility waits 30 seconds before subsequent checks.62was detected then this utility waits 30 seconds before subsequent checks.
53Exits when \fINUM\fR is reached or there are no more progress indications.63Exits when \fINUM\fR is reached or there are no more progress indications.
@@ -120,7 +130,7 @@ Written by Douglas Gilbert.
120.SH "REPORTING BUGS"130.SH "REPORTING BUGS"
121Report bugs to <dgilbert at interlog dot com>.131Report bugs to <dgilbert at interlog dot com>.
122.SH COPYRIGHT132.SH COPYRIGHT
123Copyright \(co 2004\-2016 Douglas Gilbert133Copyright \(co 2004\-2017 Douglas Gilbert
124.br134.br
125This software is distributed under a FreeBSD license. There is NO135This software is distributed under a FreeBSD license. There is NO
126warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.136warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_sat_identify.8 b/doc/sg_sat_identify.8
index aee3467..e811614 100644
--- a/doc/sg_sat_identify.8
+++ b/doc/sg_sat_identify.8
@@ -1,4 +1,4 @@
1.TH SG_SAT_IDENTIFY "8" "January 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_SAT_IDENTIFY "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_sat_identify \- send ATA IDENTIFY DEVICE command via SCSI to ATA3sg_sat_identify \- send ATA IDENTIFY DEVICE command via SCSI to ATA
4Translation (SAT) layer4Translation (SAT) layer
@@ -23,7 +23,7 @@ www.t10.org) defines two SCSI "ATA PASS\-THROUGH" commands: one using a 16
23byte "cdb" and the other with a 12 byte cdb. This utility defaults to using23byte "cdb" and the other with a 12 byte cdb. This utility defaults to using
24the 16 byte cdb variant. SAT\-4 revision 5 added a SCSI "ATA24the 16 byte cdb variant. SAT\-4 revision 5 added a SCSI "ATA
25PASS\-THROUGH(32)" command. SAT\-2 and SAT\-3 are now also standards: SAT\-225PASS\-THROUGH(32)" command. SAT\-2 and SAT\-3 are now also standards: SAT\-2
26ANSI INCITS 465\-2010 and SAT\3 ANSI INCITS 517-2015 . The SAT\-4 project26ANSI INCITS 465\-2010 and SAT\-3 ANSI INCITS 517-2015 . The SAT\-4 project
27is near standardization and the most recent draft is sat4r06.pdf .27is near standardization and the most recent draft is sat4r06.pdf .
28.SH OPTIONS28.SH OPTIONS
29Arguments to long options are mandatory for short options as well.29Arguments to long options are mandatory for short options as well.
@@ -159,7 +159,7 @@ Written by Douglas Gilbert
159.SH "REPORTING BUGS"159.SH "REPORTING BUGS"
160Report bugs to <dgilbert at interlog dot com>.160Report bugs to <dgilbert at interlog dot com>.
161.SH COPYRIGHT161.SH COPYRIGHT
162Copyright \(co 2006\-2018 Douglas Gilbert162Copyright \(co 2006\-2020 Douglas Gilbert
163.br163.br
164This software is distributed under a FreeBSD license. There is NO164This software is distributed under a FreeBSD license. There is NO
165warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.165warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_scan.8.win32 b/doc/sg_scan.8.win32
index b87888a..84cc38b 100644
--- a/doc/sg_scan.8.win32
+++ b/doc/sg_scan.8.win32
@@ -1,4 +1,4 @@
1.TH SG_SCAN "8" "August 2014" "sg3_utils\-1.40" SG3_UTILS1.TH SG_SCAN "8" "November 2018" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_scan \- scan storage devices and map to volume names3sg_scan \- scan storage devices and map to volume names
4.SH SYNOPSIS4.SH SYNOPSIS
@@ -164,7 +164,7 @@ the sg3_utils(8) man page.
164.SH AUTHORS164.SH AUTHORS
165Written by D. Gilbert165Written by D. Gilbert
166.SH COPYRIGHT166.SH COPYRIGHT
167Copyright \(co 2006\-2012 Douglas Gilbert167Copyright \(co 2006\-2018 Douglas Gilbert
168.br168.br
169This software is distributed under a FreeBSD license. There is NO169This software is distributed under a FreeBSD license. There is NO
170warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.170warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_ses.8 b/doc/sg_ses.8
index 573c92b..d953e55 100644
--- a/doc/sg_ses.8
+++ b/doc/sg_ses.8
@@ -1,4 +1,4 @@
1.TH SG_SES "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_SES "8" "February 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_ses \- access a SCSI Enclosure Services (SES) device3sg_ses \- access a SCSI Enclosure Services (SES) device
4.SH SYNOPSIS4.SH SYNOPSIS
@@ -11,7 +11,7 @@ sg_ses \- access a SCSI Enclosure Services (SES) device
11[\fI\-\-status\fR] [\fI\-\-verbose\fR] [\fI\-\-warn\fR] \fIDEVICE\fR11[\fI\-\-status\fR] [\fI\-\-verbose\fR] [\fI\-\-warn\fR] \fIDEVICE\fR
12.PP12.PP
13.B sg_ses13.B sg_ses
14[\fI\-\-byte1=B1\fR] [\fI\-\-clear=STR\fR] [\fI\-\-control\fR]14\fI\-\-control\fR [\fI\-\-byte1=B1\fR] [\fI\-\-clear=STR\fR]
15[\fI\-\-data=H,H...\fR] [\fI\-\-data=@FN\fR] [\fI\-\-descriptor=DES\fR]15[\fI\-\-data=H,H...\fR] [\fI\-\-data=@FN\fR] [\fI\-\-descriptor=DES\fR]
16[\fI\-\-dev\-slot\-num=SN\fR] [\fI\-\-index=IIA\fR | \fI\-\-index=TIA,II\fR]16[\fI\-\-dev\-slot\-num=SN\fR] [\fI\-\-index=IIA\fR | \fI\-\-index=TIA,II\fR]
17[\fI\-\-mask\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-nickname=SEN\fR]17[\fI\-\-mask\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-nickname=SEN\fR]
@@ -22,6 +22,10 @@ sg_ses \- access a SCSI Enclosure Services (SES) device
22.B sg_ses22.B sg_ses
23\fI\-\-data=@FN\fR \fI\-\-status\fR [\fI\-\-raw\fR \fI\-\-raw\fR]23\fI\-\-data=@FN\fR \fI\-\-status\fR [\fI\-\-raw\fR \fI\-\-raw\fR]
24[<all options from first form>]24[<all options from first form>]
25.br
26.B sg_ses
27\fI\-\-inhex=FN\fR \fI\-\-status\fR [\fI\-\-raw\fR \fI\-\-raw\fR]
28[<all options from first form>]
25.PP29.PP
26.B sg_ses30.B sg_ses
27[\fI\-\-enumerate\fR] [\fI\-\-index=IIA\fR] [\fI\-\-list\fR] [\fI\-\-help\fR]31[\fI\-\-enumerate\fR] [\fI\-\-index=IIA\fR] [\fI\-\-list\fR] [\fI\-\-help\fR]
@@ -58,11 +62,12 @@ enclosure (e.g. requesting the "ident" (locate) LED to flash on a disk
58carrier in an array) is typically done using a read\-modify\-write cycle.62carrier in an array) is typically done using a read\-modify\-write cycle.
59See the section on CHANGING STATE below.63See the section on CHANGING STATE below.
60.PP64.PP
61The third form in the synopsis shows the options for decoding the contents65The third form in the synopsis has two equivalent invocations shown. They
62of a file that holds a hexadecimal or binary representation of a SES66decode the contents of a file (named \fIFN\fR) that holds a hexadecimal or
63dpage response. Typically an earlier invocation of the first form of this67binary representation of one, or many, SES dpage responses. Typically an
64utility with the '\-HHHH' option would have generated that file. Since no68earlier invocation of the first form of this utility with the '\-HHHH'
65SCSI commands are sent, the \fIDEVICE\fR argument if given will be ignored.69option would have generated that file. Since no SCSI commands are sent, the
70\fIDEVICE\fR argument if given will be ignored.
66.PP71.PP
67The last form in the synopsis shows the options for providing command line72The last form in the synopsis shows the options for providing command line
68help (i.e. usage information), listing out dpage and field information tables73help (i.e. usage information), listing out dpage and field information tables
@@ -233,6 +238,14 @@ option or one of the \fI\-\-clear=STR\fR, \fI\-\-get=STR\fR or
233\fI\-\-set=STR\fR options. To enumerate the available Element type238\fI\-\-set=STR\fR options. To enumerate the available Element type
234abbreviations use the \fI\-\-enumerate\fR option.239abbreviations use the \fI\-\-enumerate\fR option.
235.TP240.TP
241\fB\-X\fR, \fB\-\-inhex\fR=\fIFN\fR
242where \fIFN\fR is a filename. It has the equivalent action of the
243\fI\-\-data=@FN\fR option. If \fIFN\fR is '\-' then stdin is read. This
244option has been given for compatibility with other utilities in this
245package that use \fI\-\-inhex=FN\fR (or \fI\-\-in=FN\fR) is a similar
246way. See the "FORMAT OF FILES CONTAINING ASCII HEX" section in the
247sg3_utils manpage for more information.
248.TP
236\fB\-i\fR, \fB\-\-inner\-hex\fR249\fB\-i\fR, \fB\-\-inner\-hex\fR
237the outer levels of a status dpage are decoded and printed out but the250the outer levels of a status dpage are decoded and printed out but the
238innermost level (e.g. the Element Status Descriptor) is output in hex. Also251innermost level (e.g. the Element Status Descriptor) is output in hex. Also
@@ -430,10 +443,10 @@ Wherever an individual index is applicable, it can be replaced by an
430individual index range. It has the form: <first_ii>\-<last_ii>. For443individual index range. It has the form: <first_ii>\-<last_ii>. For
431example: '3\-5' will select individual indexes 3, 4 and 5 .444example: '3\-5' will select individual indexes 3, 4 and 5 .
432.PP445.PP
433To cope with vendor specific Element types (which should be in the range 128446To cope with vendor specific Element types (whose type codes should be in
434to 255) the Element type can be given as a number with a leading underscore.447the range 128 to 255) the Element type code can be given as a number with
435For example these are equivalent: \fI\-\-index=arr\fR and448a leading underscore. For example these are equivalent: \fI\-\-index=arr\fR
436\fI\-\-index=_23\fR since the Array Device Slot Element type value is 23.449and \fI\-\-index=_23\fR since the Array Device Slot Element type code is 23.
437Also \fI\-\-index=ps1\fR and \fI\-\-index=_2_1\fR are equivalent.450Also \fI\-\-index=ps1\fR and \fI\-\-index=_2_1\fR are equivalent.
438.PP451.PP
439Another example: if the first type header in the Configuration dpage has452Another example: if the first type header in the Configuration dpage has
@@ -746,7 +759,7 @@ Written by Douglas Gilbert.
746.SH "REPORTING BUGS"759.SH "REPORTING BUGS"
747Report bugs to <dgilbert at interlog dot com>.760Report bugs to <dgilbert at interlog dot com>.
748.SH COPYRIGHT761.SH COPYRIGHT
749Copyright \(co 2004\-2018 Douglas Gilbert762Copyright \(co 2004\-2020 Douglas Gilbert
750.br763.br
751This software is distributed under a FreeBSD license. There is NO764This software is distributed under a FreeBSD license. There is NO
752warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.765warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_turs.8 b/doc/sg_turs.8
index 66e6ad3..8cf909c 100644
--- a/doc/sg_turs.8
+++ b/doc/sg_turs.8
@@ -1,9 +1,9 @@
1.TH SG_TURS "8" "March 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_TURS "8" "September 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_turs \- send one or more SCSI TEST UNIT READY commands3sg_turs \- send one or more SCSI TEST UNIT READY commands
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_turs5.B sg_turs
6[\fI\-\-help\fR] [\fI\-\-low\fR] [\fI\-\-number=NUM\fR] [\fI\-\-num=NUM\fR]6[\fI\-\-help\fR] [\fI\-\-low\fR] [\fI\-\-num=NUM\fR] [\fI\-\-number=NUM\fR]
7[\fI\-\-progress\fR] [\fI\-\-time\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]7[\fI\-\-progress\fR] [\fI\-\-time\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
8\fIDEVICE\fR8\fIDEVICE\fR
9.PP9.PP
@@ -34,7 +34,7 @@ calls a library function to do each TUR (sg_ll_test_unit_ready). With this
34option it uses the lower level sg_pt interface (see sg_pt.h) to save a34option it uses the lower level sg_pt interface (see sg_pt.h) to save a
35little time on each TUR.35little time on each TUR.
36.TP36.TP
37\fB\-n\fR, \fB\-\-number\fR=\fINUM\fR37\fB\-n\fR, \fB\-\-num\fR=\fINUM\fR
38performs TEST UNIT READY \fINUM\fR times. If not given defaults to 1.38performs TEST UNIT READY \fINUM\fR times. If not given defaults to 1.
39These suffix multipliers are permitted: c C *1; w W *2; b B *512;39These suffix multipliers are permitted: c C *1; w W *2; b B *512;
40k K KiB *1,024; KB *1,000; m M MiB *1,048,576; MB *1,000,000;40k K KiB *1,024; KB *1,000; m M MiB *1,048,576; MB *1,000,000;
@@ -42,15 +42,17 @@ g G GiB *1,073,741,824; and GB *1,000,000,000 . Also a suffix of the
42form "x<n>" multiplies the leading number by <n>. Alternatively a hex42form "x<n>" multiplies the leading number by <n>. Alternatively a hex
43number may be given, prefixed by either '0x' or has a trailing 'h'.43number may be given, prefixed by either '0x' or has a trailing 'h'.
44.TP44.TP
45\fB\-\-num\fR=\fINUM\fR45\fB\-\-number\fR=\fINUM\fR
46same as \fI\-\-number=NUM\fR. Added for compatibility with sg_requests46same as \fI\-\-num=NUM\fR. Added for compatibility with sg_requests and
47which has taken over the role of polling the progress indication.47other utilities in this package. The sg_request utility has taken over the
48role of polling the progress indication which was originally assigned to
49the TEST UNIT READY command. This is a change by T10.
48.TP50.TP
49\fB\-O\fR, \fB\-\-old\fR51\fB\-O\fR, \fB\-\-old\fR
50Switch to older style options. Please use as first option.52Switch to older style options. Please use as first option.
51.TP53.TP
52\fB\-p\fR, \fB\-\-progress\fR54\fB\-p\fR, \fB\-\-progress\fR
53show progress indication (a percentage) if available. If \fI\-\-number=NUM\fR55show progress indication (a percentage) if available. If \fI\-\-num=NUM\fR
54is given, \fINUM\fR is greater than 1 and an initial progress indication56is given, \fINUM\fR is greater than 1 and an initial progress indication
55was detected then this utility waits 30 seconds before subsequent checks.57was detected then this utility waits 30 seconds before subsequent checks.
56Exits when \fINUM\fR is reached or there are no more progress indications.58Exits when \fINUM\fR is reached or there are no more progress indications.
@@ -101,7 +103,7 @@ force the use of these older command line options.
101.TP103.TP
102\fB\-n\fR=\fINUM\fR104\fB\-n\fR=\fINUM\fR
103performs TEST UNIT READY \fINUM\fR times. If not given defaults to 1.105performs TEST UNIT READY \fINUM\fR times. If not given defaults to 1.
104Equivalent to \fI\-\-number=NUM\fR in the main description.106Equivalent to \fI\-\-num=NUM\fR in the main description.
105.TP107.TP
106\fB-N\fR, \fB\-\-new\fR108\fB-N\fR, \fB\-\-new\fR
107Switch to the newer style options.109Switch to the newer style options.
@@ -128,7 +130,7 @@ using \fI\-\-old\fR (or \fI\-O\fR) as the first command line option.
128.SH AUTHORS130.SH AUTHORS
129Written by D. Gilbert131Written by D. Gilbert
130.SH COPYRIGHT132.SH COPYRIGHT
131Copyright \(co 2000\-2018 Douglas Gilbert133Copyright \(co 2000\-2019 Douglas Gilbert
132.br134.br
133This software is distributed under the GPL version 2. There is NO135This software is distributed under the GPL version 2. There is NO
134warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.136warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_verify.8 b/doc/sg_verify.8
index 51c8f88..425af3b 100644
--- a/doc/sg_verify.8
+++ b/doc/sg_verify.8
@@ -1,19 +1,19 @@
1.TH SG_VERIFY "8" "January 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_VERIFY "8" "December 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_verify \- invoke SCSI VERIFY command(s) on a block device3sg_verify \- invoke SCSI VERIFY command(s) on a block device
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_verify5.B sg_verify
6[\fI\-\-16\fR] [\fI\-\-bpc=BPC\fR] [\fI\-\-count=COUNT\fR] [\fI\-\-dpo\fR]6[\fI\-\-0\fR] [\fI\-\-16\fR] [\fI\-\-bpc=BPC\fR] [\fI\-\-count=COUNT\fR]
7[\fI\-\-ebytchk=BCH\fR] [\fI\-\-group=GN\fR] [\fI\-\-help\fR]7[\fI\-\-dpo\fR] [\fI\-\-ff\fR] [\fI\-\-ebytchk=BCH\fR] [\fI\-\-group=GN\fR]
8[\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-ndo=NDO\fR] [\fI\-\-quiet\fR]8[\fI\-\-help\fR] [\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR] [\fI\-\-ndo=NDO\fR]
9[\fI\-\-readonly\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]9[\fI\-\-quiet\fR] [\fI\-\-readonly\fR] [\fI\-\-verbose\fR]
10[\fI\-\-vrprotect=VRP\fR] \fIDEVICE\fR10[\fI\-\-version\fR] [\fI\-\-vrprotect=VRP\fR] \fIDEVICE\fR
11.SH DESCRIPTION11.SH DESCRIPTION
12.\" Add any additional description here12.\" Add any additional description here
13.PP13.PP
14Sends one or more SCSI VERIFY (10 or 16) commands to \fIDEVICE\fR. These SCSI14Sends one or more SCSI VERIFY (10 or 16) commands to \fIDEVICE\fR. These SCSI
15commands are defined in the SBC\-2 (draft) standard at http://www.t10.org and15commands are defined in the SBC\-2 and SBC\-3 standards at http://www.t10.org
16SBC\-3 drafts.16and SBC\-4 drafts.
17.PP17.PP
18When \fI\-\-ndo=NDO\fR is not given then the verify starts at the logical18When \fI\-\-ndo=NDO\fR is not given then the verify starts at the logical
19block address given by the \fI\-\-lba=LBA\fR option and continues for19block address given by the \fI\-\-lba=LBA\fR option and continues for
@@ -45,6 +45,12 @@ Arguments to long options are mandatory for short options as well.
45The options are arranged in alphabetical order based on the long45The options are arranged in alphabetical order based on the long
46option name.46option name.
47.TP47.TP
48\fB\-0\fR, \fB\-\-0\fR
49a buffer \fINDO\fR bytes long full of zeros is sent as the data\-out
50part of a VERIFY command. So stdin is not read and if \fI\-\-in=IF\fR
51is given, an error is generated. Useful when \fIBCH\fR is 3 to check
52if some or all of \fIDEVICE\fR (e.g. a disk) is zero filled blocks.
53.TP
48\fB\-S\fR, \fB\-\-16\fR54\fB\-S\fR, \fB\-\-16\fR
49uses a VERIFY(16) command (default VERIFY(10)). Even without this option,55uses a VERIFY(16) command (default VERIFY(10)). Even without this option,
50using an \fI\-\-lba=LBA\fR which is too large, will cause the utility56using an \fI\-\-lba=LBA\fR which is too large, will cause the utility
@@ -80,11 +86,17 @@ other commands are more likely to remain in the device's cache.
80sets the BYTCHK field to \fIBCH\fR overriding the value (1) set by the86sets the BYTCHK field to \fIBCH\fR overriding the value (1) set by the
81\fI\-\-ndo=NDO\fR option. Values of 1, 2 or 3 are accepted for \fIBCH\fR87\fI\-\-ndo=NDO\fR option. Values of 1, 2 or 3 are accepted for \fIBCH\fR
82however sbc3r34 reserves the value 2. If this option is given then88however sbc3r34 reserves the value 2. If this option is given then
83\fI\-\-ndo=NDO\fR must also be given. If \fIBCH\fR is 3 then \fICOUNT\fR89\fI\-\-ndo=NDO\fR must also be given. If \fIBCH\fR is 3 then \fINDO\fR
84must be 1 and \fINDO\fR should be the size of one logical block (plus the90should be the size of one logical block (plus the size of some or all
85size of some or all of the protection information if \fIVRP\fR is greater91of the protection information if \fIVRP\fR is greater
86than 0).92than 0).
87.TP93.TP
94\fB\-f\fR, \fB\-\-ff\fR
95a buffer \fINDO\fR bytes long full of 0xff bytes is sent as the data\-out
96part of a VERIFY command. So stdin is not read and if \fI\-\-in=IF\fR
97is given, an error is generated. Useful when \fIBCH\fR is 3 to check
98if some or all of \fIDEVICE\fR (e.g. a disk) is 0xff byte filled blocks.
99.TP
88\fB\-g\fR, \fB\-\-group\fR=\fIGN\fR100\fB\-g\fR, \fB\-\-group\fR=\fIGN\fR
89where \fIGN\fR becomes the contents of the group number field in the SCSI101where \fIGN\fR becomes the contents of the group number field in the SCSI
90VERIFY(16) command. It can be from 0 to 63 inclusive. The default value for102VERIFY(16) command. It can be from 0 to 63 inclusive. The default value for
@@ -198,7 +210,7 @@ Written by Douglas Gilbert.
198.SH "REPORTING BUGS"210.SH "REPORTING BUGS"
199Report bugs to <dgilbert at interlog dot com>.211Report bugs to <dgilbert at interlog dot com>.
200.SH COPYRIGHT212.SH COPYRIGHT
201Copyright \(co 2004\-2018 Douglas Gilbert213Copyright \(co 2004\-2019 Douglas Gilbert
202.br214.br
203This software is distributed under a FreeBSD license. There is NO215This software is distributed under a FreeBSD license. There is NO
204warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.216warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_vpd.8 b/doc/sg_vpd.8
index 1bbdc7c..08c371d 100644
--- a/doc/sg_vpd.8
+++ b/doc/sg_vpd.8
@@ -1,12 +1,13 @@
1.TH SG_VPD "8" "March 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_VPD "8" "April 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_vpd \- fetch SCSI VPD page and/or decode its response3sg_vpd \- fetch SCSI VPD page and/or decode its response
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_vpd5.B sg_vpd
6[\fI\-\-all\fR] [\fI\-\-enumerate\fR] [\fI\-\-force\fR] [\fI\-\-help\fR]6[\fI\-\-all\fR] [\fI\-\-enumerate\fR] [\fI\-\-examine\fR] [\fI\-\-force\fR]
7[\fI\-\-hex\fR] [\fI\-\-ident\fR] [\fI\-\-inhex=FN\fR] [\fI\-\-long\fR]7[\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-ident\fR] [\fI\-\-inhex=FN\fR]
8[\fI\-\-maxlen=LEN\fR] [\fI\-\-page=PG\fR] [\fI\-\-quiet\fR] [\fI\-\-raw\fR]8[\fI\-\-long\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-page=PG\fR] [\fI\-\-quiet\fR]
9[\fI\-\-vendor=VP\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fIDEVICE\fR]9[\fI\-\-raw\fR] [\fI\-\-vendor=VP\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
10[\fIDEVICE\fR]
10.SH DESCRIPTION11.SH DESCRIPTION
11.\" Add any additional description here12.\" Add any additional description here
12.PP13.PP
@@ -25,8 +26,8 @@ has been flagged as mandatory. This page can be fetched by
25using the \fI\-\-ident\fR option.26using the \fI\-\-ident\fR option.
26.PP27.PP
27The reference document used for interpreting VPD pages (and the INQUIRY28The reference document used for interpreting VPD pages (and the INQUIRY
28standard response) is T10/BSR INCITS 502 Revision 19 which is draft SPC\-529standard response) is T10/BSR INCITS 502 Revision 22 which is draft SPC\-5
29revision 19, 14 February 2018). It can be found at http://www.t10.org .30revision 19, 22 April 2019. It can be found at http://www.t10.org .
30.PP31.PP
31When no options are given, other than a \fIDEVICE\fR, then the "Supported32When no options are given, other than a \fIDEVICE\fR, then the "Supported
32VPD pages" (0x0) VPD page is fetched and decoded.33VPD pages" (0x0) VPD page is fetched and decoded.
@@ -60,6 +61,22 @@ summary lines of all VPD pages whose number matches \fIPG\fR. May be used
60with \fI\-\-vendor=VP\fR to restrict output to known vendor specific pages61with \fI\-\-vendor=VP\fR to restrict output to known vendor specific pages
61for vendor/product \fIVP\fR.62for vendor/product \fIVP\fR.
62.TP63.TP
64\fB\-E\fR, \fB\-\-examine\fR
65scan part of all of the VPD space (from 0x0 to 0xff) and output any pages
66found. This option ignores the contents of VPD page 0x0 which should contain
67a list of all supported VPD pages. However some vendors either forget to
68list some standard pages or perhaps purposely don't list vendor specific
69pages which are in the range 0xc0 to 0xff.
70.br
71If the \fI\-\-page=PG\fR option is not given and this option is given once
72then the scan is from VPD page number 0x80 to 0xff inclusive. If the
73\fI\-\-page=PG\fR option is given then the scan is from 0x80 to
74\fIPG\fR inclusive. If this option is given twice then the scan starts at
75VPD page 0x0.
76.br
77The sdparm utility which lists mode and VPD pages also has a \fB\-\-examine\fR
78option will similar functionility.
79.TP
63\fB\-f\fR, \fB\-\-force\fR80\fB\-f\fR, \fB\-\-force\fR
64As a sanity check, the normal action when fetching VPD pages other than81As a sanity check, the normal action when fetching VPD pages other than
65page 0x0 (the "Supported VPD pages" VPD page), is to first fetch page 0x082page 0x0 (the "Supported VPD pages" VPD page), is to first fetch page 0x0
@@ -304,7 +321,7 @@ Written by Douglas Gilbert
304.SH "REPORTING BUGS"321.SH "REPORTING BUGS"
305Report bugs to <dgilbert at interlog dot com>.322Report bugs to <dgilbert at interlog dot com>.
306.SH COPYRIGHT323.SH COPYRIGHT
307Copyright \(co 2006\-2018 Douglas Gilbert324Copyright \(co 2006\-2019 Douglas Gilbert
308.br325.br
309This software is distributed under a FreeBSD license. There is NO326This software is distributed under a FreeBSD license. There is NO
310warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.327warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_write_buffer.8 b/doc/sg_write_buffer.8
index d2aab53..09332e1 100644
--- a/doc/sg_write_buffer.8
+++ b/doc/sg_write_buffer.8
@@ -1,4 +1,4 @@
1.TH SG_WRITE_BUFFER "8" "January 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_WRITE_BUFFER "8" "November 2018" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_write_buffer \- send SCSI WRITE BUFFER commands3sg_write_buffer \- send SCSI WRITE BUFFER commands
4.SH SYNOPSIS4.SH SYNOPSIS
diff --git a/doc/sg_write_same.8 b/doc/sg_write_same.8
index 55e739d..55dcfec 100644
--- a/doc/sg_write_same.8
+++ b/doc/sg_write_same.8
@@ -1,13 +1,14 @@
1.TH SG_WRITE_SAME "8" "November 2017" "sg3_utils\-1.43" SG3_UTILS1.TH SG_WRITE_SAME "8" "December 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_write_same \- send SCSI WRITE SAME command3sg_write_same \- send SCSI WRITE SAME command
4.SH SYNOPSIS4.SH SYNOPSIS
5.B sg_write_same5.B sg_write_same
6[\fI\-\-10\fR] [\fI\-\-16\fR] [\fI\-\-32\fR] [\fI\-\-anchor\fR]6[\fI\-\-10\fR] [\fI\-\-16\fR] [\fI\-\-32\fR] [\fI\-\-anchor\fR]
7[\fI\-\-grpnum=GN\fR] [\fI\-\-help\fR] [\fI\-\-in=IF\fR] [\fI\-\-lba=LBA\fR]7[\fI\-\-ff\fR] [\fI\-\-grpnum=GN\fR] [\fI\-\-help\fR] [\fI\-\-in=IF\fR]
8[\fI\-\-lbdata\fR] [\fI\-\-num=NUM\fR] [\fI\-\-ndob\fR] [\fI\-\-pbdata\fR]8[\fI\-\-lba=LBA\fR] [\fI\-\-lbdata\fR] [\fI\-\-num=NUM\fR]
9[\fI\-\-timeout=TO\fR] [\fI\-\-unmap\fR] [\fI\-\-verbose\fR]9[\fI\-\-ndob\fR] [\fI\-\-pbdata\fR] [\fI\-\-timeout=TO\fR]
10[\fI\-\-version\fR] [\fI\-\-wrprotect=WPR\fR] [\fI\-\-xferlen=LEN\fR]10[\fI\-\-unmap\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR]
11[\fI\-\-wrprotect=WPR\fR] [\fI\-\-xferlen=LEN\fR]
11\fIDEVICE\fR12\fIDEVICE\fR
12.SH DESCRIPTION13.SH DESCRIPTION
13.\" Add any additional description here14.\" Add any additional description here
@@ -86,6 +87,10 @@ send a SCSI WRITE SAME (32) command to \fIDEVICE\fR.
86sets the ANCHOR bit in the cdb. Introduced in SBC\-3 revision 22.87sets the ANCHOR bit in the cdb. Introduced in SBC\-3 revision 22.
87That draft requires the \fI\-\-unmap\fR option to also be specified.88That draft requires the \fI\-\-unmap\fR option to also be specified.
88.TP89.TP
90\fB\-f\fR, \fB\-\-ff\fR
91the data\-out buffer sent with this command is initialized with 0xff bytes
92when this option is given.
93.TP
89\fB\-g\fR, \fB\-\-grpnum\fR=\fIGN\fR94\fB\-g\fR, \fB\-\-grpnum\fR=\fIGN\fR
90sets the 'Group number' field to \fIGN\fR. Defaults to a value of zero.95sets the 'Group number' field to \fIGN\fR. Defaults to a value of zero.
91\fIGN\fR should be a value between 0 and 63.96\fIGN\fR should be a value between 0 and 63.
@@ -97,11 +102,12 @@ output the usage message then exit.
97read data (binary) from file named \fIIF\fR and use it as the data\-out102read data (binary) from file named \fIIF\fR and use it as the data\-out
98buffer for the SCSI WRITE SAME command. The length of the data\-out buffer103buffer for the SCSI WRITE SAME command. The length of the data\-out buffer
99is \fI\-\-xferlen=LEN\fR or, if that is not given, the length of the \fIIF\fR104is \fI\-\-xferlen=LEN\fR or, if that is not given, the length of the \fIIF\fR
100file. If \fIIF\fR is "\-" then stdin is read. If this option is not given105file. If \fIIF\fR is "\-" then stdin is read. If this option and the
101then 0x00 bytes are used as fill with the length of the data\-out buffer106\fI\-\-ff\fR are not given then 0x00 bytes are used as fill with the length
102obtained from \fI\-\-xferlen=LEN\fR or by calling READ CAPACITY(16 or 10).107of the data\-out buffer obtained from \fI\-\-xferlen=LEN\fR or by calling
103If the response to READ CAPACITY(16) has the PROT_EN bit set then data\-108READ CAPACITY(16 or 10). If the response to READ CAPACITY(16) has the
104out buffer size is modified accordingly with the last 8 bytes set to 0xff.109PROT_EN bit set then data\- out buffer size is modified accordingly with
110the last 8 bytes set to 0xff.
105.TP111.TP
106\fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR112\fB\-l\fR, \fB\-\-lba\fR=\fILBA\fR
107where \fILBA\fR is the logical block address to start the WRITE SAME command.113where \fILBA\fR is the logical block address to start the WRITE SAME command.
@@ -316,7 +322,7 @@ Written by Douglas Gilbert.
316.SH "REPORTING BUGS"322.SH "REPORTING BUGS"
317Report bugs to <dgilbert at interlog dot com>.323Report bugs to <dgilbert at interlog dot com>.
318.SH COPYRIGHT324.SH COPYRIGHT
319Copyright \(co 2009\-2017 Douglas Gilbert325Copyright \(co 2009\-2019 Douglas Gilbert
320.br326.br
321This software is distributed under a FreeBSD license. There is NO327This software is distributed under a FreeBSD license. There is NO
322warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.328warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_write_x.8 b/doc/sg_write_x.8
index 122d950..de9f10d 100644
--- a/doc/sg_write_x.8
+++ b/doc/sg_write_x.8
@@ -1,4 +1,4 @@
1.TH SG_WRITE_X "8" "May 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_WRITE_X "8" "January 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_write_x \- SCSI WRITE normal/ATOMIC/SAME/SCATTERED/STREAM, ORWRITE commands3sg_write_x \- SCSI WRITE normal/ATOMIC/SAME/SCATTERED/STREAM, ORWRITE commands
4.SH SYNOPSIS4.SH SYNOPSIS
@@ -451,7 +451,7 @@ output version string then exit.
451.TP451.TP
452\fB\-w\fR, \fB\-\-wrprotect\fR=\fIWPR\fR452\fB\-w\fR, \fB\-\-wrprotect\fR=\fIWPR\fR
453sets the WRPROTECT field (3 bits) in all sg_write_x commands apart from453sets the WRPROTECT field (3 bits) in all sg_write_x commands apart from
454ORWRITE which has a 3 bit ORPROTECT field (and the synopsis shows \fiOPR\fR454ORWRITE which has a 3 bit ORPROTECT field (and the synopsis shows \fIOPR\fR
455to highlight the difference). In all cases \fIWPR\fR is placed455to highlight the difference). In all cases \fIWPR\fR is placed
456in that 3 bit field. The default value is zero which does not send any PI456in that 3 bit field. The default value is zero which does not send any PI
457in the data\-out buffer. \fIWPR\fR should be a value between 0 and 7.457in the data\-out buffer. \fIWPR\fR should be a value between 0 and 7.
@@ -587,7 +587,7 @@ Written by Douglas Gilbert.
587.SH "REPORTING BUGS"587.SH "REPORTING BUGS"
588Report bugs to <dgilbert at interlog dot com>.588Report bugs to <dgilbert at interlog dot com>.
589.SH COPYRIGHT589.SH COPYRIGHT
590Copyright \(co 2017 Douglas Gilbert590Copyright \(co 2017\-2020 Douglas Gilbert
591.br591.br
592This software is distributed under a FreeBSD license. There is NO592This software is distributed under a FreeBSD license. There is NO
593warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.593warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sg_xcopy.8 b/doc/sg_xcopy.8
index 437bad0..197fc37 100644
--- a/doc/sg_xcopy.8
+++ b/doc/sg_xcopy.8
@@ -1,4 +1,4 @@
1.TH SG_XCOPY "8" "August 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SG_XCOPY "8" "February 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sg_xcopy \- copy data to and from files and devices using SCSI EXTENDED3sg_xcopy \- copy data to and from files and devices using SCSI EXTENDED
4COPY (XCOPY)4COPY (XCOPY)
@@ -9,7 +9,7 @@ COPY (XCOPY)
9[\fIoflag=FLAGS\fR] [\fIseek=SEEK\fR] [\fIskip=SKIP\fR] [\fI\-\-help\fR]9[\fIoflag=FLAGS\fR] [\fIseek=SEEK\fR] [\fIskip=SKIP\fR] [\fI\-\-help\fR]
10[\fI\-\-version\fR]10[\fI\-\-version\fR]
11.PP11.PP
12[\fIbpt=BPT\fR] [\fIcat=\fR0|1] [\fIdc=\fR0|1]12[\fIapp=\fR0|1] [\fIbpt=BPT\fR] [\fIcat=\fR0|1] [\fIdc=\fR0|1] [\fIfco=\fR0|1]
13[\fIid_usage=\fR{hold|discard|disable}] [\fIlist_id=ID\fR] [\fIprio=PRIO\fR]13[\fIid_usage=\fR{hold|discard|disable}] [\fIlist_id=ID\fR] [\fIprio=PRIO\fR]
14[\fItime=\fR0|1] [\fIverbose=VERB\fR] [\fI\-\-on_dst|\-\-on_src\fR]14[\fItime=\fR0|1] [\fIverbose=VERB\fR] [\fI\-\-on_dst|\-\-on_src\fR]
15[\fI\-\-verbose\fR]15[\fI\-\-verbose\fR]
@@ -19,14 +19,6 @@ COPY (XCOPY)
19Copy data to and from any files. Specialized for "files" that are Linux SCSI19Copy data to and from any files. Specialized for "files" that are Linux SCSI
20devices that support the SCSI EXTENDED COPY (XCOPY) command.20devices that support the SCSI EXTENDED COPY (XCOPY) command.
21.PP21.PP
22During the draft stages of SPC\-4 the T10 committee has expanded the XCOPY
23command so that it now has two variants: "LID1" (for a List Identifier
24length of 1 byte) and "LID4" (for a List Identifier length of 4 bytes).
25This utility supports the older, LID1 variant which is also found in SPC\-3
26and earlier. While the LID1 variant in SPC\-4 is command level (binary)
27compatible with XCOPY as defined in SPC\-3, some of the command naming has
28changed. This utility uses the older, SPC\-3 XCOPY names.
29.PP
30This utility22This utility
31has similar syntax and semantics to23has similar syntax and semantics to
32.B dd(1)24.B dd(1)
@@ -42,12 +34,26 @@ with the \fI\-\-on_src\fR or \fIiflag=xflag\fR options which cause the XCOPY
42command to be sent to \fIIFILE\fR instead. Also see the section on34command to be sent to \fIIFILE\fR instead. Also see the section on
43ENVIRONMENT VARIABLES.35ENVIRONMENT VARIABLES.
44.PP36.PP
37In the SPC\-4 standard the T10 committee has expanded the XCOPY command so
38that it now has two variants: "LID1" (for a List Identifier length of 1 byte)
39and "LID4" (for a List Identifier length of 4 bytes). This utility supports
40the older, LID1 variant which is also found in SPC\-3 and earlier. While the
41LID1 variant in SPC\-4 is command level (binary) compatible with XCOPY as
42defined in SPC\-3, some of the command naming has changed. This utility uses
43the older, SPC\-3 XCOPY names.
44.PP
45The ddpt utility supports the same xcopy(LID1) functionality as this utility45The ddpt utility supports the same xcopy(LID1) functionality as this utility
46with the same options and flags. Additionally ddpt supports a subset of46with the same options and flags. Additionally ddpt supports a subset of
47xcopy(LID4) functionality variously called "xcopy version 2, lite" or ODX.47xcopy(LID4) functionality variously called "xcopy version 2, lite" or ODX.
48ODX is a market name and stands for Offloaded Data Xfer (i.e. transfer).48ODX is a market name and stands for Offloaded Data Xfer (i.e. transfer).
49.SH OPTIONS49.SH OPTIONS
50.TP50.TP
51\fBapp\fR={0|1}
52if 1 start the destination of the copy at the end of OFILE. This assumes
53that OFILE is a regular file. The default is 0 in which case the destination
54of the copy starts at the beginning of OFILE (possibly offset be SEEK). This
55option cannot be used with the \fIseek=SEEK\fR option.
56.TP
51\fBbpt\fR=\fIBPT\fR57\fBbpt\fR=\fIBPT\fR
52each IO transaction will be made using \fIBPT\fR blocks (or less if near58each IO transaction will be made using \fIBPT\fR blocks (or less if near
53the end of the copy). Default is 128 for logical block sizes less that 204859the end of the copy). Default is 128 for logical block sizes less that 2048
@@ -73,24 +79,16 @@ the handling of residual data. See section
73.B HANDLING OF RESIDUAL DATA79.B HANDLING OF RESIDUAL DATA
74for details.80for details.
75.TP81.TP
76\fBdc\fR={0|1}
77sets the SCSI EXTENDED COPY command segment descriptor DC bit to 0 or
781 (default: 0). The DC bit controls whether \fICOUNT\fR
79refers to the source (\fIdc=0\fR) or the target (\fIdc=1\fR) descriptor.
80.TP
81\fBconv\fR=\fBCONV\fR82\fBconv\fR=\fBCONV\fR
82all \fBCONV\fR arguments are ignored.83all \fBCONV\fR arguments are ignored.
83.TP84.TP
84\fBapp\fR=\fBAPPEND\fR
85all \fBAPPEND\fR arguments are ignored.
86.TP
87\fBcount\fR=\fICOUNT\fR85\fBcount\fR=\fICOUNT\fR
88copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the86copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
89minimum (\fIIFILE\fR if \fIdc=0\fR or \fIOFILE\fR if \fIdc=1\fR)87minimum (\fIIFILE\fR if \fIdc=0\fR or \fIOFILE\fR if \fIdc=1\fR)
90number of blocks that SCSI devices report from SCSI READ CAPACITY88number of blocks that SCSI devices report from SCSI READ CAPACITY
91commands or that block devices (or their partitions) report. Normal89commands or that block devices (or their partitions) report. Normal
92files are not probed for their size. If \fIskip=SKIP\fR or90files are not probed for their size. If \fIskip=SKIP\fR or
93\fIskip=SEEK\fR are given and the count is derived (i.e. not91\fIseek=SEEK\fR are given and the count is derived (i.e. not
94explicitly given) then the derived count is scaled back so that the92explicitly given) then the derived count is scaled back so that the
95copy will not overrun the device. If the file name is a block device93copy will not overrun the device. If the file name is a block device
96partition and \fICOUNT\fR is not given then the size of the partition94partition and \fICOUNT\fR is not given then the size of the partition
@@ -98,6 +96,19 @@ rather than the size of the whole device is used. If \fICOUNT\fR is
98not given (or \fIcount=\-1\fR) and cannot be derived then an error96not given (or \fIcount=\-1\fR) and cannot be derived then an error
99message is issued and no copy takes place.97message is issued and no copy takes place.
100.TP98.TP
99\fBdc\fR={0|1}
100sets the SCSI EXTENDED COPY command segment descriptor DC bit to 0 or
1011 (default: 0). The DC bit controls whether \fICOUNT\fR
102refers to the source (\fIdc=0\fR) or the target (\fIdc=1\fR) descriptor.
103.TP
104\fBfco\fR={0|1}
105sets the SCSI EXTENDED COPY command segment descriptor FCO bit to 0 or
1061 (default: 0). The Fast Copy Only (FCO) bit set will result in the
107copy being done but a technique faster than SCSI READ and WRITE commands.
108If the copy cannot but done in a faster manner then a sense key of "Copy
109aborted" with and additional sense of "Fast copy not possible" is
110returned.
111.TP
101\fBibs\fR=\fIBS\fR112\fBibs\fR=\fIBS\fR
102if given must be the same as \fIBS\fR given to 'bs=' option.113if given must be the same as \fIBS\fR given to 'bs=' option.
103.TP114.TP
@@ -343,7 +354,7 @@ Written by Hannes Reinecke and Douglas Gilbert.
343.SH "REPORTING BUGS"354.SH "REPORTING BUGS"
344Report bugs to <dgilbert at interlog dot com>.355Report bugs to <dgilbert at interlog dot com>.
345.SH COPYRIGHT356.SH COPYRIGHT
346Copyright \(co 2000\-2018 Hannes Reinecke and Douglas Gilbert357Copyright \(co 2000\-2019 Hannes Reinecke and Douglas Gilbert
347.br358.br
348This software is distributed under the GPL version 2. There is NO359This software is distributed under the GPL version 2. There is NO
349warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.360warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sgm_dd.8 b/doc/sgm_dd.8
index 346bedb..58782d7 100644
--- a/doc/sgm_dd.8
+++ b/doc/sgm_dd.8
@@ -1,4 +1,4 @@
1.TH SGM_DD "8" "June 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SGM_DD "8" "February 2019" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sgm_dd \- copy data to and from files and devices, especially SCSI3sgm_dd \- copy data to and from files and devices, especially SCSI
4devices4devices
@@ -66,7 +66,7 @@ copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
66minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices66minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices
67report from SCSI READ CAPACITY commands or that block devices (or their67report from SCSI READ CAPACITY commands or that block devices (or their
68partitions) report. Normal files are not probed for their size. If68partitions) report. Normal files are not probed for their size. If
69\fIskip=SKIP\fR or \fIskip=SEEK\fR are given and the count is derived (i.e.69\fIskip=SKIP\fR or \fIseek=SEEK\fR are given and the count is derived (i.e.
70not explicitly given) then the derived count is scaled back so that the70not explicitly given) then the derived count is scaled back so that the
71copy will not overrun the device. If the file name is a block device71copy will not overrun the device. If the file name is a block device
72partition and \fICOUNT\fR is not given then the size of the partition rather72partition and \fICOUNT\fR is not given then the size of the partition rather
@@ -269,7 +269,7 @@ Written by Douglas Gilbert and Peter Allworth.
269.SH "REPORTING BUGS"269.SH "REPORTING BUGS"
270Report bugs to <dgilbert at interlog dot com>.270Report bugs to <dgilbert at interlog dot com>.
271.SH COPYRIGHT271.SH COPYRIGHT
272Copyright \(co 2000\-2018 Douglas Gilbert272Copyright \(co 2000\-2019 Douglas Gilbert
273.br273.br
274This software is distributed under the GPL version 2. There is NO274This software is distributed under the GPL version 2. There is NO
275warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.275warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/doc/sgp_dd.8 b/doc/sgp_dd.8
index 0c99712..62a065b 100644
--- a/doc/sgp_dd.8
+++ b/doc/sgp_dd.8
@@ -1,4 +1,4 @@
1.TH SGP_DD "8" "June 2018" "sg3_utils\-1.43" SG3_UTILS1.TH SGP_DD "8" "February 2020" "sg3_utils\-1.45" SG3_UTILS
2.SH NAME2.SH NAME
3sgp_dd \- copy data to and from files and devices, especially SCSI3sgp_dd \- copy data to and from files and devices, especially SCSI
4devices4devices
@@ -61,7 +61,7 @@ copy \fICOUNT\fR blocks from \fIIFILE\fR to \fIOFILE\fR. Default is the
61minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices61minimum (of \fIIFILE\fR and \fIOFILE\fR) number of blocks that sg devices
62report from SCSI READ CAPACITY commands or that block devices (or their62report from SCSI READ CAPACITY commands or that block devices (or their
63partitions) report. Normal files are not probed for their size. If63partitions) report. Normal files are not probed for their size. If
64\fIskip=SKIP\fR or \fIskip=SEEK\fR are given and the count is deduced (i.e.64\fIskip=SKIP\fR or \fIseek=SEEK\fR are given and the count is deduced (i.e.
65not explicitly given) then that count is scaled back so that the copy will65not explicitly given) then that count is scaled back so that the copy will
66not overrun the device. If the file name is a block device partition and66not overrun the device. If the file name is a block device partition and
67\fICOUNT\fR is not given then the size of the partition rather than the67\fICOUNT\fR is not given then the size of the partition rather than the
@@ -123,7 +123,7 @@ transfer. Only active when \fIOFILE\fR is a sg device file name.
123.TP123.TP
124\fBthr\fR=\fITHR\fR124\fBthr\fR=\fITHR\fR
125where \fITHR\fR is the number or worker threads (default 4) that attempt to125where \fITHR\fR is the number or worker threads (default 4) that attempt to
126copy in parallel. Minimum is 1 and maximum is 16.126copy in parallel. Minimum is 1 and maximum is 1024.
127.TP127.TP
128\fBtime\fR=0 | 1128\fBtime\fR=0 | 1
129when 1, the transfer is timed and throughput calculation is129when 1, the transfer is timed and throughput calculation is
@@ -201,6 +201,13 @@ excl
201causes the O_EXCL flag to be added to the open of \fIIFILE\fR and/or201causes the O_EXCL flag to be added to the open of \fIIFILE\fR and/or
202\fIOFILE\fR.202\fIOFILE\fR.
203.TP203.TP
204mmap
205can only be used in the \fIiflag=FLAGS\fR or the \fIoflag=FLAGS\fR argument
206list but not both. The nominated side of the copy will use memory mapped IO
207based on the mmap(2) system call. The sg driver will remap its DMA
208destination or source buffer into the user space when the mmap(2) system call
209is used on a sg device.
210.TP
204fua211fua
205causes the FUA (force unit access) bit to be set in SCSI READ and/or WRITE212causes the FUA (force unit access) bit to be set in SCSI READ and/or WRITE
206commands. This only has effect with sg devices. The 6 byte variants213commands. This only has effect with sg devices. The 6 byte variants
@@ -314,7 +321,7 @@ Written by Douglas Gilbert and Peter Allworth.
314.SH "REPORTING BUGS"321.SH "REPORTING BUGS"
315Report bugs to <dgilbert at interlog dot com>.322Report bugs to <dgilbert at interlog dot com>.
316.SH COPYRIGHT323.SH COPYRIGHT
317Copyright \(co 2000\-2017 Douglas Gilbert324Copyright \(co 2000\-2020 Douglas Gilbert
318.br325.br
319This software is distributed under the GPL version 2. There is NO326This software is distributed under the GPL version 2. There is NO
320warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.327warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/examples/scsi_inquiry.c b/examples/scsi_inquiry.c
index 32fe74d..9949749 100644
--- a/examples/scsi_inquiry.c
+++ b/examples/scsi_inquiry.c
@@ -1,3 +1,24 @@
1/*
2 * Copyright (C) 1999-2018 D. Gilbert
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2, or (at your option)
6 * any later version.
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 *
10 * Test code for D. Gilbert's extensions to the Linux OS SCSI generic ("sg")
11 * device driver.
12 * This program does a SCSI inquiry command on the given device and
13 * outputs some of the result. This program highlights the use of the
14 * SCSI_IOCTL_SEND_COMMAND ioctl. This should be able to be applied to
15 * any SCSI device file descriptor (not just one related to sg). [Whether
16 * this is a good idea on a disk while it is mounted is debatable.
17 * No detrimental effects when this was tested ...]
18 *
19 * Version 0.16 20181207
20 */
21
1#include <unistd.h>22#include <unistd.h>
2#include <signal.h>23#include <signal.h>
3#include <fcntl.h>24#include <fcntl.h>
@@ -11,25 +32,6 @@
11#include <scsi/scsi.h>32#include <scsi/scsi.h>
12/* #include <scsi/scsi_ioctl.h> */ /* glibc hides this file sometimes */33/* #include <scsi/scsi_ioctl.h> */ /* glibc hides this file sometimes */
1334
14/* Test code for D. Gilbert's extensions to the Linux OS SCSI generic ("sg")
15 device driver.
16* Copyright (C) 1999 D. Gilbert
17* This program is free software; you can redistribute it and/or modify
18* it under the terms of the GNU General Public License as published by
19* the Free Software Foundation; either version 2, or (at your option)
20* any later version.
21
22 This program does a SCSI inquiry command on the given device and
23 outputs some of the result. This program highlights the use of the
24 SCSI_IOCTL_SEND_COMMAND ioctl. This should be able to be applied to
25 any SCSI device file descriptor (not just one related to sg). [Whether
26 this is a good idea on a disk while it is mounted is debatable.
27 No detrimental effects when this was tested ...]
28
29Version 0.15 20160528
30*/
31
32
33typedef struct my_scsi_ioctl_command {35typedef struct my_scsi_ioctl_command {
34 unsigned int inlen; /* _excluding_ scsi command length */36 unsigned int inlen; /* _excluding_ scsi command length */
35 unsigned int outlen;37 unsigned int outlen;
diff --git a/examples/sdiag_sas_p0_prbs9.txt b/examples/sdiag_sas_p0_prbs9.txt
36new file mode 10064438new file mode 100644
index 0000000..1b96f99
--- /dev/null
+++ b/examples/sdiag_sas_p0_prbs9.txt
@@ -0,0 +1,12 @@
1# This is the hex for a SAS protocol specific diagnostic
2# page. It will attempt to put phy identifier 0 of the
3# given device into PRBS9 (jitter pattern) generation mode.
4# Physical transmission speed is 22.5 Gbps
5# N.B. This will turn the receiver off on phy id 0.
6#
7# Usage example: 'sg_senddiag --pf --raw=- /dev/sg2 < {this_file}'
8#
93f,6,0,1c,0,1,3,c,
100,0,0,0,0,0,0,0,
110,0,0,0,0,0,0,0,
120,0,0,0,0,0,0,0
diff --git a/examples/sdiag_sas_p1_prbs15.txt b/examples/sdiag_sas_p1_prbs15.txt
0new file mode 10064413new file mode 100644
index 0000000..1248ab3
--- /dev/null
+++ b/examples/sdiag_sas_p1_prbs15.txt
@@ -0,0 +1,12 @@
1# This is the hex for a SAS protocol specific diagnostic
2# page. It will attempt to put phy identifier 1 of the
3# given device into PRBS15 (jitter pattern) generation mode.
4# Physical transmission speed is 22.5 Gbps
5# N.B. This will turn the receiver off on phy id 1.
6#
7# Usage example: 'sg_senddiag --pf --raw=- /dev/sg2 < {this_file}'
8#
93f,6,0,1c,1,1,4,c,
100,0,0,0,0,0,0,0,
110,0,0,0,0,0,0,0,
120,0,0,0,0,0,0,0
diff --git a/examples/sg_compare_and_write.txt b/examples/sg_compare_and_write.txt
index 05d72b9..86b166b 100644
--- a/examples/sg_compare_and_write.txt
+++ b/examples/sg_compare_and_write.txt
@@ -9,7 +9,7 @@
9#9#
10# The following example shows initialization, successful and unsuccessful10# The following example shows initialization, successful and unsuccessful
11# compare and write using sg3_utils. I am using caw_buf_zero2one and11# compare and write using sg3_utils. I am using caw_buf_zero2one and
12# caw_buf_one2zero as shown bellow.12# caw_buf_one2zero as shown below.
1313
14$ hexdump /tmp/caw_buf_zero2one14$ hexdump /tmp/caw_buf_zero2one
150000000 0000 0000 0000 0000 0000 0000 0000 0000150000000 0000 0000 0000 0000 0000 0000 0000 0000
diff --git a/examples/sg_excl.c b/examples/sg_excl.c
index 8cbab75..7e589b2 100644
--- a/examples/sg_excl.c
+++ b/examples/sg_excl.c
@@ -1,3 +1,28 @@
1/*
2 * Copyright (C) 2003-2018 D. Gilbert
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2, or (at your option)
6 * any later version.
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 *
10 * This is a simple program that tests the O_EXCL flag in sg while
11 * executing a SCSI INQUIRY command and a
12 * TEST UNIT READY command using the SCSI generic (sg) driver
13 *
14 * Invocation: sg_excl [-x] <sg_device>
15 *
16 * Version 3.62 (20181227)
17 *
18 * 6 byte INQUIRY command:
19 * [0x12][ |lu][pg cde][res ][al len][cntrl ]
20 *
21 * 6 byte TEST UNIT READY command:
22 * [0x00][ |lu][res ][res ][res ][res ]
23 *
24 */
25
1#include <unistd.h>26#include <unistd.h>
2#include <fcntl.h>27#include <fcntl.h>
3#include <stdio.h>28#include <stdio.h>
@@ -11,27 +36,6 @@
11#include "sg_lib.h"36#include "sg_lib.h"
12#include "sg_io_linux.h"37#include "sg_io_linux.h"
1338
14/* This is a simple program that tests the O_EXCL flag in sg while
15 executing a SCSI INQUIRY command and a
16 TEST UNIT READY command using the SCSI generic (sg) driver
17
18* Copyright (C) 2003-2018 D. Gilbert
19* This program is free software; you can redistribute it and/or modify
20* it under the terms of the GNU General Public License as published by
21* the Free Software Foundation; either version 2, or (at your option)
22* any later version.
23
24 Invocation: sg_excl [-x] <sg_device>
25
26 Version 3.60 (20180220)
27
286 byte INQUIRY command:
29[0x12][ |lu][pg cde][res ][al len][cntrl ]
30
316 byte TEST UNIT READY command:
32[0x00][ |lu][res ][res ][res ][res ]
33
34*/
3539
36#define INQ_REPLY_LEN 9640#define INQ_REPLY_LEN 96
37#define INQ_CMD_LEN 641#define INQ_CMD_LEN 6
@@ -191,6 +195,7 @@ int main(int argc, char * argv[])
191 "msg_status=%d\n", io_hdr.duration, io_hdr.resid,195 "msg_status=%d\n", io_hdr.duration, io_hdr.resid,
192 (int)io_hdr.msg_status);196 (int)io_hdr.msg_status);
193197
198 printf("Wait for 60 seconds with O_EXCL help on %s\n", file_name);
194 sleep(60);199 sleep(60);
195 close(sg_fd);200 close(sg_fd);
196 return 0;201 return 0;
diff --git a/examples/sg_sat_chk_power.c b/examples/sg_sat_chk_power.c
index b5ea18a..ca24f66 100644
--- a/examples/sg_sat_chk_power.c
+++ b/examples/sg_sat_chk_power.c
@@ -10,8 +10,6 @@
10 * 2. Redistributions in binary form must reproduce the above copyright10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.12 * documentation and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *13 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -25,6 +23,7 @@
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.24 * SUCH DAMAGE.
27 *25 *
26 * SPDX-License-Identifier: BSD-2-Clause
28 */27 */
2928
30#include <unistd.h>29#include <unistd.h>
@@ -59,7 +58,7 @@
5958
60#define EBUFF_SZ 25659#define EBUFF_SZ 256
6160
62static const char * version_str = "1.07 20180706";61static const char * version_str = "1.08 20181207";
6362
6463
65#if 064#if 0
diff --git a/examples/sg_sat_smart_rd_data.c b/examples/sg_sat_smart_rd_data.c
index 1e7295d..223da2a 100644
--- a/examples/sg_sat_smart_rd_data.c
+++ b/examples/sg_sat_smart_rd_data.c
@@ -10,8 +10,6 @@
10 * 2. Redistributions in binary form must reproduce the above copyright10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.12 * documentation and/or other materials provided with the distribution.
13 * 3. The name of the author may not be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *13 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -25,6 +23,7 @@
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.24 * SUCH DAMAGE.
27 *25 *
26 * SPDX-License-Identifier: BSD-2-Clause
28 */27 */
2928
30#include <unistd.h>29#include <unistd.h>
@@ -58,7 +57,7 @@
5857
59#define EBUFF_SZ 25658#define EBUFF_SZ 256
6059
61static char * version_str = "1.04 20180220";60static char * version_str = "1.05 20181207";
6261
63int main(int argc, char * argv[])62int main(int argc, char * argv[])
64{63{
diff --git a/examples/sg_simple1.c b/examples/sg_simple1.c
index d835267..b8ef349 100644
--- a/examples/sg_simple1.c
+++ b/examples/sg_simple1.c
@@ -1,3 +1,32 @@
1/*
2 * Copyright (C) 1999-2018 D. Gilbert
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2, or (at your option)
6 * any later version.
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 *
10 * This is a simple program executing a SCSI INQUIRY command and a
11 * TEST UNIT READY command using the SCSI generic (sg) driver
12 * There is another variant of this program called "sg_simple2"
13 * which does not include the sg_lib.h header and logic and so has
14 * simpler but more primitive error processing.
15 * In the lk 2.6 series devices nodes such as /dev/sda also support
16 * the SG_IO ioctl.
17 *
18 * Invocation: sg_simple1 [-x] <scsi_device>
19 *
20 * Version 3.60 (20181207)
21 *
22 * 6 byte INQUIRY command:
23 * [0x12][ |lu][pg cde][res ][al len][cntrl ]
24 *
25 * 6 byte TEST UNIT READY command:
26 * [0x00][ |lu][res ][res ][res ][res ]
27 *
28 */
29
1#include <unistd.h>30#include <unistd.h>
2#include <fcntl.h>31#include <fcntl.h>
3#include <stdio.h>32#include <stdio.h>
@@ -10,31 +39,6 @@
10#include "sg_lib.h"39#include "sg_lib.h"
11#include "sg_io_linux.h"40#include "sg_io_linux.h"
1241
13/* This is a simple program executing a SCSI INQUIRY command and a
14 TEST UNIT READY command using the SCSI generic (sg) driver
15 There is another variant of this program called "sg_simple2"
16 which does not include the sg_lib.h header and logic and so has
17 simpler but more primitive error processing.
18 In the lk 2.6 series devices nodes such as /dev/sda also support
19 the SG_IO ioctl.
20
21* Copyright (C) 1999-2007 D. Gilbert
22* This program is free software; you can redistribute it and/or modify
23* it under the terms of the GNU General Public License as published by
24* the Free Software Foundation; either version 2, or (at your option)
25* any later version.
26
27 Invocation: sg_simple1 [-x] <scsi_device>
28
29 Version 03.59 (20160528)
30
316 byte INQUIRY command:
32[0x12][ |lu][pg cde][res ][al len][cntrl ]
33
346 byte TEST UNIT READY command:
35[0x00][ |lu][res ][res ][res ][res ]
36
37*/
3842
39#define INQ_REPLY_LEN 9643#define INQ_REPLY_LEN 96
40#define INQ_CMD_LEN 644#define INQ_CMD_LEN 6
diff --git a/examples/sgq_dd.c b/examples/sgq_dd.c
index debbe37..2f163ef 100644
--- a/examples/sgq_dd.c
+++ b/examples/sgq_dd.c
@@ -1,3 +1,32 @@
1/*
2 * A utility program for the Linux OS SCSI generic ("sg") device driver.
3 * Copyright (C) 1999-2010 D. Gilbert and P. Allworth
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
7 * any later version.
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 *
11 * This program is a specialization of the Unix "dd" command in which
12 * one or both of the given files is a scsi generic device or a raw
13 * device. A block size ('bs') is assumed to be 512 if not given. This
14 * program complains if 'ibs' or 'obs' are given with some other value
15 * than 'bs'. If 'if' is not given or 'if=-' then stdin is assumed. If
16 * 'of' is not given or 'of=-' then stdout assumed. Multipliers:
17 * 'c','C' *1 'b','B' *512 'k' *1024 'K' *1000
18 * 'm' *(1024^2) 'M' *(1000^2) 'g' *(1024^3) 'G' *(1000^3)
19 *
20 * A non-standard argument "bpt" (blocks per transfer) is added to control
21 * the maximum number of blocks in each transfer. The default value is 128.
22 * For example if "bs=512" and "bpt=32" then a maximum of 32 blocks (16KB
23 * in this case) are transferred to or from the sg device in a single SCSI
24 * command.
25 *
26 * This version should compile with Linux sg drivers with version numbers
27 * >= 30000 . This version uses queuing within the Linux sg driver.
28 */
29
1#define _XOPEN_SOURCE 50030#define _XOPEN_SOURCE 500
231
3#include <unistd.h>32#include <unistd.h>
@@ -23,34 +52,8 @@ typedef uint8_t u_char; /* horrible, for scsi.h */
23#include "sg_io_linux.h"52#include "sg_io_linux.h"
24#include "sg_unaligned.h"53#include "sg_unaligned.h"
2554
26/* A utility program for the Linux OS SCSI generic ("sg") device driver.55
27* Copyright (C) 1999-2018 D. Gilbert and P. Allworth56static char * version_str = "0.63 20190324";
28* This program is free software; you can redistribute it and/or modify
29* it under the terms of the GNU General Public License as published by
30* the Free Software Foundation; either version 2, or (at your option)
31* any later version.
32
33 This program is a specialization of the Unix "dd" command in which
34 one or both of the given files is a scsi generic device or a raw
35 device. A block size ('bs') is assumed to be 512 if not given. This
36 program complains if 'ibs' or 'obs' are given with some other value
37 than 'bs'. If 'if' is not given or 'if=-' then stdin is assumed. If
38 'of' is not given or 'of=-' then stdout assumed. Multipliers:
39 'c','C' *1 'b','B' *512 'k' *1024 'K' *1000
40 'm' *(1024^2) 'M' *(1000^2) 'g' *(1024^3) 'G' *(1000^3)
41
42 A non-standard argument "bpt" (blocks per transfer) is added to control
43 the maximum number of blocks in each transfer. The default value is 128.
44 For example if "bs=512" and "bpt=32" then a maximum of 32 blocks (16KB
45 in this case) are transferred to or from the sg device in a single SCSI
46 command.
47
48 This version should compile with Linux sg drivers with version numbers
49 >= 30000 . This version uses queuing within the Linux sg driver.
50
51*/
52
53static char * version_str = "0.61 20180627";
54/* resurrected from "0.55 20020509" */57/* resurrected from "0.55 20020509" */
5558
56#define DEF_BLOCK_SIZE 51259#define DEF_BLOCK_SIZE 512
@@ -64,7 +67,7 @@ static char * version_str = "0.61 20180627";
64#define SGP_READ10 0x2867#define SGP_READ10 0x28
65#define SGP_WRITE10 0x2a68#define SGP_WRITE10 0x2a
66#define DEF_NUM_THREADS 4 /* actually degree of concurrency */69#define DEF_NUM_THREADS 4 /* actually degree of concurrency */
67#define MAX_NUM_THREADS 3270#define MAX_NUM_THREADS 1024
6871
69#ifndef RAW_MAJOR72#ifndef RAW_MAJOR
70#define RAW_MAJOR 255 /*unlikey value */73#define RAW_MAJOR 255 /*unlikey value */
@@ -241,7 +244,7 @@ usage()
241 " usually either 'if' or 'of' is a sg or raw device\n"244 " usually either 'if' or 'of' is a sg or raw device\n"
242 " 'bpt' is blocks_per_transfer (default is 128)\n"245 " 'bpt' is blocks_per_transfer (default is 128)\n"
243 " 'dio' is direct IO, 1->attempt, 0->indirect IO (def)\n"246 " 'dio' is direct IO, 1->attempt, 0->indirect IO (def)\n"
244 " 'thr' is number of queues, must be > 0, default 4, max 32\n");247 " 'thr' is number of queues, must be > 0, default 4, max 1024\n");
245 fprintf(stderr, " 'coe' continue on sg error, 0->exit (def), "248 fprintf(stderr, " 'coe' continue on sg error, 0->exit (def), "
246 "1->zero + continue\n"249 "1->zero + continue\n"
247 " 'time' 0->no timing(def), 1->time plus calculate throughput\n"250 " 'time' 0->no timing(def), 1->time plus calculate throughput\n"
diff --git a/examples/transport_ids.txt b/examples/transport_ids.txt
index 0c60456..a63374d 100644
--- a/examples/transport_ids.txt
+++ b/examples/transport_ids.txt
@@ -9,7 +9,7 @@
9# To see transport IDs decoded after they have been read in (e.g. to check9# To see transport IDs decoded after they have been read in (e.g. to check
10# they are well formed) use the verbose flag 3 times (i.e. "... -vvv ...").10# they are well formed) use the verbose flag 3 times (i.e. "... -vvv ...").
1111
12# Here is a simple example (for SPI) of a comma separted hex list:12# Here is a simple example (for SPI) of a comma separated hex list:
131,0,0,7,0,0,0,1 # SPI, initiator address=7, relative_port_num=1131,0,0,7,0,0,0,1 # SPI, initiator address=7, relative_port_num=1
1414
15# and here is the transport specific format for the same thing:15# and here is the transport specific format for the same thing:
diff --git a/include/Makefile.in b/include/Makefile.in
index d6029bf..6ee60f6 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,7 +1,7 @@
1# Makefile.in generated by automake 1.15.1 from Makefile.am.1# Makefile.in generated by automake 1.16.1 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994-2017 Free Software Foundation, Inc.4# Copyright (C) 1994-2018 Free Software Foundation, Inc.
55
6# This Makefile.in is free software; the Free Software Foundation6# This Makefile.in is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,7# gives unlimited permission to copy and/or distribute it,
@@ -351,8 +351,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
351 *config.status*) \351 *config.status*) \
352 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \352 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
353 *) \353 *) \
354 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \354 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
355 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \355 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
356 esac;356 esac;
357357
358$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)358$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -443,7 +443,10 @@ cscopelist-am: $(am__tagged_files)
443distclean-tags:443distclean-tags:
444 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags444 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
445445
446distdir: $(DISTFILES)446distdir: $(BUILT_SOURCES)
447 $(MAKE) $(AM_MAKEFLAGS) distdir-am
448
449distdir-am: $(DISTFILES)
447 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \450 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
448 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \451 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
449 list='$(DISTFILES)'; \452 list='$(DISTFILES)'; \
diff --git a/include/freebsd_nvme_ioctl.h b/include/freebsd_nvme_ioctl.h
index a7c970b..0b79d85 100644
--- a/include/freebsd_nvme_ioctl.h
+++ b/include/freebsd_nvme_ioctl.h
@@ -39,6 +39,11 @@ extern "C" {
39#define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command)39#define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command)
4040
41#if __FreeBSD_version < 110011041#if __FreeBSD_version < 1100110
42
43#define NVME_STATUS_GET_SC(st) (st.sc)
44#define NVME_STATUS_GET_SCT(st) (st.sct)
45
46
42struct nvme_command47struct nvme_command
43{48{
44 /* dword 0 */49 /* dword 0 */
@@ -151,12 +156,14 @@ struct nvme_pt_command {
151 */156 */
152 struct mtx * driver_lock;157 struct mtx * driver_lock;
153};158};
154#else159#else /* not __FreeBSD_version < 1100110 */
155#include <dev/nvme/nvme.h>160#include <dev/nvme/nvme.h>
156#endif161#endif /* __FreeBSD_version < 1100110 */
157162
163#ifndef nvme_completion_is_error
158#define nvme_completion_is_error(cpl) \164#define nvme_completion_is_error(cpl) \
159 ((cpl)->status.sc != 0 || (cpl)->status.sct != 0)165 ((cpl)->status.sc != 0 || (cpl)->status.sct != 0)
166#endif
160167
161#define NVME_CTRLR_PREFIX "/dev/nvme"168#define NVME_CTRLR_PREFIX "/dev/nvme"
162#define NVME_NS_PREFIX "ns"169#define NVME_NS_PREFIX "ns"
diff --git a/include/sg_cmds_basic.h b/include/sg_cmds_basic.h
index 4fb0ddf..e40d101 100644
--- a/include/sg_cmds_basic.h
+++ b/include/sg_cmds_basic.h
@@ -2,10 +2,12 @@
2#define SG_CMDS_BASIC_H2#define SG_CMDS_BASIC_H
33
4/*4/*
5 * Copyright (c) 2004-2018 Douglas Gilbert.5 * Copyright (c) 2004-2019 Douglas Gilbert.
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11/*13/*
@@ -341,8 +343,8 @@ const char * sg_cmds_version();
341 * output via 'o_sense_cat' pointer (if not NULL). Note that several sense343 * output via 'o_sense_cat' pointer (if not NULL). Note that several sense
342 * categories also have data in bytes received; -2 is still returned. */344 * categories also have data in bytes received; -2 is still returned. */
343int sg_cmds_process_resp(struct sg_pt_base * ptvp, const char * leadin,345int sg_cmds_process_resp(struct sg_pt_base * ptvp, const char * leadin,
344 int pt_res, int mx_di_len, const uint8_t * sense_b,346 int pt_res, bool noisy, int verbose,
345 bool noisy, int verbose, int * o_sense_cat);347 int * o_sense_cat);
346348
347/* NVMe devices use a different command set. This function will return true349/* NVMe devices use a different command set. This function will return true
348 * if the device associated with 'pvtp' is a NVME device, else it will350 * if the device associated with 'pvtp' is a NVME device, else it will
diff --git a/include/sg_cmds_extra.h b/include/sg_cmds_extra.h
index 974d17c..dde2298 100644
--- a/include/sg_cmds_extra.h
+++ b/include/sg_cmds_extra.h
@@ -6,6 +6,8 @@
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11#include <stdint.h>13#include <stdint.h>
diff --git a/include/sg_cmds_mmc.h b/include/sg_cmds_mmc.h
index 3988b1d..c9b7d73 100644
--- a/include/sg_cmds_mmc.h
+++ b/include/sg_cmds_mmc.h
@@ -6,6 +6,8 @@
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11#ifdef __cplusplus13#ifdef __cplusplus
diff --git a/include/sg_io_linux.h b/include/sg_io_linux.h
index b57aa63..4766e2a 100644
--- a/include/sg_io_linux.h
+++ b/include/sg_io_linux.h
@@ -6,10 +6,12 @@
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11/*13/*
12 * Version 1.06 [20180119]14 * Version 1.07 [20181211]
13 */15 */
1416
15/*17/*
@@ -158,6 +160,14 @@ struct sg_io_hdr;
158int sg_chk_n_print3(const char * leadin, struct sg_io_hdr * hp,160int sg_chk_n_print3(const char * leadin, struct sg_io_hdr * hp,
159 bool raw_sinfo);161 bool raw_sinfo);
160162
163/* Returns 1 if no errors found and thus nothing printed; otherwise
164 * prints error/warning (prefix by 'leadin') to stderr (pr2ws) and
165 * returns 0. */
166int sg_linux_sense_print(const char * leadin, int scsi_status,
167 int host_status, int driver_status,
168 const uint8_t * sense_buffer, int sb_len,
169 bool raw_sinfo);
170
161/* Calls sg_scsi_normalize_sense() after obtaining the sense buffer and171/* Calls sg_scsi_normalize_sense() after obtaining the sense buffer and
162 its length from the struct sg_io_hdr pointer. If these cannot be172 its length from the struct sg_io_hdr pointer. If these cannot be
163 obtained, false is returned. */173 obtained, false is returned. */
diff --git a/include/sg_lib.h b/include/sg_lib.h
index e860b92..1ece717 100644
--- a/include/sg_lib.h
+++ b/include/sg_lib.h
@@ -2,10 +2,12 @@
2#define SG_LIB_H2#define SG_LIB_H
33
4/*4/*
5 * Copyright (c) 2004-2018 Douglas Gilbert.5 * Copyright (c) 2004-2019 Douglas Gilbert.
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11/*13/*
@@ -178,10 +180,10 @@ struct sg_scsi_sense_hdr {
178 uint8_t sense_key;180 uint8_t sense_key;
179 uint8_t asc;181 uint8_t asc;
180 uint8_t ascq;182 uint8_t ascq;
181 uint8_t byte4;183 uint8_t byte4; /* descriptor: SDAT_OVFL; fixed: lower three ... */
182 uint8_t byte5;184 uint8_t byte5; /* ... bytes of INFO field */
183 uint8_t byte6;185 uint8_t byte6;
184 uint8_t additional_length;186 uint8_t additional_length; /* zero for fixed format sense data */
185};187};
186188
187/* Maps the salient data from a sense buffer which is in either fixed or189/* Maps the salient data from a sense buffer which is in either fixed or
@@ -269,6 +271,18 @@ int sg_get_designation_descriptor_str(const char * leadin,
269 bool print_assoc, bool do_long,271 bool print_assoc, bool do_long,
270 int blen, char * b);272 int blen, char * b);
271273
274/* Expects a T10 UUID designator (as found in the Device Identification VPD
275 * page) pointed to by 'dp'. To not produce an error string in 'b', c_set
276 * should be 1 (binary) and dlen should be 18. Currently T10 only supports
277 * locally assigned UUIDs. Writes output to string 'b' of no more than blen
278 * bytes and returns the number of bytes actually written to 'b' but doesn't
279 * count the trailing null character it always appends (if blen > 0). 'lip'
280 * is lead-in string (on each line) than may be NULL. skip_prefix avoids
281 * outputting: ' Locally assigned UUID: ' before the UUID. */
282int sg_t10_uuid_desig2str(const uint8_t * dp, int dlen, int c_set,
283 bool do_long, bool skip_prefix,
284 const char * lip, int blen, char * b);
285
272/* Yield string associated with peripheral device type (pdt). Returns286/* Yield string associated with peripheral device type (pdt). Returns
273 * 'buff'. If 'pdt' out of range yields "bad pdt" string. */287 * 'buff'. If 'pdt' out of range yields "bad pdt" string. */
274char * sg_get_pdt_str(int pdt, int buff_len, char * buff);288char * sg_get_pdt_str(int pdt, int buff_len, char * buff);
@@ -364,9 +378,21 @@ extern FILE * sg_warnings_strm;
364378
365void sg_set_warnings_strm(FILE * warnings_strm);379void sg_set_warnings_strm(FILE * warnings_strm);
366380
381/* Given a SCSI command pointed to by cdbp of sz bytes this function forms a
382 * SCSI command in ASCII hex surrounded by square brackets in 'b'. 'b' is at
383 * least blen bytes long. If cmd_name is true then the command is prefixed
384 * by its SCSI command name (e.g. "VERIFY(10) [2f ...]". The command is
385 * shown as spaced separated pairs of hexadecimal digits (i.e. 0-9, a-f).
386 * Each pair represents byte. The leftmost pair of digits is cdbp[0] . If
387 * sz <= 0 then this function tries to guess the length of the command. */
388char *
389sg_get_command_str(const uint8_t * cdbp, int sz, bool cmd_name, int blen,
390 char * b);
391
367/* The following "print" functions send ASCII to 'sg_warnings_strm' file392/* The following "print" functions send ASCII to 'sg_warnings_strm' file
368 * descriptor (default value is stderr). 'leadin' is string prepended to393 * descriptor (default value is stderr). 'leadin' is string prepended to
369 * each line printed out, NULL treated as "". */394 * each line printed out, NULL treated as "". */
395void sg_print_command_len(const uint8_t * command, int len);
370void sg_print_command(const uint8_t * command);396void sg_print_command(const uint8_t * command);
371void sg_print_scsi_status(int scsi_status);397void sg_print_scsi_status(int scsi_status);
372398
@@ -450,6 +476,8 @@ bool sg_exit2str(int exit_status, bool longer, int b_len, char * b);
450#define SG_LIB_CAT_TASK_ABORTED 29 /* SCSI status, this command aborted by? */476#define SG_LIB_CAT_TASK_ABORTED 29 /* SCSI status, this command aborted by? */
451#define SG_LIB_CONTRADICT 31 /* error involving two or more cl options */477#define SG_LIB_CONTRADICT 31 /* error involving two or more cl options */
452#define SG_LIB_LOGIC_ERROR 32 /* unexpected situation in code */478#define SG_LIB_LOGIC_ERROR 32 /* unexpected situation in code */
479#define SG_LIB_WINDOWS_ERR 34 /* Windows error number don't fit in 7 bits so
480 * map to a single value for exit statuses */
453#define SG_LIB_OK_FALSE 36 /* no error, reporting false (cf. no error,481#define SG_LIB_OK_FALSE 36 /* no error, reporting false (cf. no error,
454 * reporting true is SG_LIB_OK_TRUE(0) ) */482 * reporting true is SG_LIB_OK_TRUE(0) ) */
455#define SG_LIB_CAT_PROTECTION 40 /* subset of aborted command (for PI, DIF)483#define SG_LIB_CAT_PROTECTION 40 /* subset of aborted command (for PI, DIF)
@@ -553,6 +581,16 @@ void hex2stderr(const uint8_t * b_str, int len, int no_ascii);
553int hex2str(const uint8_t * b_str, int len, const char * leadin, int format,581int hex2str(const uint8_t * b_str, int len, const char * leadin, int format,
554 int cb_len, char * cbp);582 int cb_len, char * cbp);
555583
584/* Read ASCII hex bytes or binary from fname (a file named '-' taken as
585 * stdin). If reading ASCII hex then there should be either one entry per
586 * line or a comma, space or tab separated list of bytes. If no_space is
587 * set then a string of ACSII hex digits is expected, 2 per byte. Everything
588 * from and including a '#' on a line is ignored. Returns 0 if ok, or an
589 * error code. If the error code is SG_LIB_LBA_OUT_OF_RANGE then mp_arr
590 * would be exceeded and both mp_arr and mp_arr_len are written to. */
591int sg_f2hex_arr(const char * fname, bool as_binary, bool no_space,
592 uint8_t * mp_arr, int * mp_arr_len, int max_arr_len);
593
556/* Returns true when executed on big endian machine; else returns false.594/* Returns true when executed on big endian machine; else returns false.
557 * Useful for displaying ATA identify words (which need swapping on a595 * Useful for displaying ATA identify words (which need swapping on a
558 * big endian machine). */596 * big endian machine). */
@@ -587,13 +625,14 @@ int sg_ata_get_chars(const uint16_t * word_arr, int start_word,
587void dWordHex(const uint16_t * words, int num, int no_ascii, bool swapb);625void dWordHex(const uint16_t * words, int num, int no_ascii, bool swapb);
588626
589/* If the number in 'buf' can not be decoded or the multiplier is unknown627/* If the number in 'buf' can not be decoded or the multiplier is unknown
590 * then -1 is returned. Accepts a hex prefix (0x or 0X) or a 'h' (or 'H')628 * then -1 is returned. Accepts a hex prefix (0x or 0X) or a decimal
591 * suffix. Otherwise a decimal multiplier suffix may be given. Recognised629 * multiplier suffix (as per GNU's dd (since 2002: SI and IEC 60027-2)).
592 * multipliers: c C *1; w W *2; b B *512; k K KiB *1,024;630 * Main (SI) multipliers supported: K, M, G. Ignore leading spaces and
593 * KB *1,000; m M MiB *1,048,576; MB *1,000,000; g G GiB *1,073,741,824;631 * tabs; accept comma, hyphen, space, tab and hash as terminator.
594 * GB *1,000,000,000 and <n>x<m> which multiplies <n> by <m> . Ignore leading632 * Handles zero and positive values up to 2**31-1 .
595 * spaces and tabs; accept comma, hyphen, space, tab and hash as terminator.633 * Experimental: left argument (must in with hexadecimal digit) added
596 */634 * to, or multiplied, by right argument. No embedded spaces.
635 * Examples: '3+1k' (evaluates to 1027) and '0xf+0x3'. */
597int sg_get_num(const char * buf);636int sg_get_num(const char * buf);
598637
599/* If the number in 'buf' can not be decoded then -1 is returned. Accepts a638/* If the number in 'buf' can not be decoded then -1 is returned. Accepts a
@@ -604,12 +643,14 @@ int sg_get_num(const char * buf);
604int sg_get_num_nomult(const char * buf);643int sg_get_num_nomult(const char * buf);
605644
606/* If the number in 'buf' can not be decoded or the multiplier is unknown645/* If the number in 'buf' can not be decoded or the multiplier is unknown
607 * then -1LL is returned. Accepts a hex prefix (0x or 0X) or a 'h' (or 'H')646 * then -1LL is returned. Accepts a hex prefix (0x or 0X), hex suffix
608 * suffix. Otherwise a decimal multiplier suffix may be given. In addition647 * (h or H), or a decimal multiplier suffix (as per GNU's dd (since 2002:
609 * to supporting the multipliers of sg_get_num(), this function supports:648 * SI and IEC 60027-2)). Main (SI) multipliers supported: K, M, G, T, P
610 * t T TiB *(2**40); TB *(10**12); p P PiB *(2**50); PB *(10**15) .649 * and E. Ignore leading spaces and tabs; accept comma, hyphen, space, tab
611 * Ignore leading spaces and tabs; accept comma, hyphen, space, tab and hash650 * and hash as terminator. Handles zero and positive values up to 2**63-1 .
612 * as terminator. */651 * Experimental: the left argument (must end in with hexadecimal digit)
652 * added to, or multiplied by, the right argument. No embedded spaces.
653 * Examples: '3+1k' (evaluates to 1027) and '0xf+0x3'. */
613int64_t sg_get_llnum(const char * buf);654int64_t sg_get_llnum(const char * buf);
614655
615/* If the number in 'buf' can not be decoded then -1 is returned. Accepts a656/* If the number in 'buf' can not be decoded then -1 is returned. Accepts a
diff --git a/include/sg_lib_data.h b/include/sg_lib_data.h
index a870043..2f142a2 100644
--- a/include/sg_lib_data.h
+++ b/include/sg_lib_data.h
@@ -2,10 +2,12 @@
2#define SG_LIB_DATA_H2#define SG_LIB_DATA_H
33
4/*4/*
5 * Copyright (c) 2007-2018 Douglas Gilbert.5 * Copyright (c) 2007-2019 Douglas Gilbert.
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11/*13/*
@@ -86,6 +88,14 @@ struct sg_lib_4tuple_u8 {
86 uint8_t t4;88 uint8_t t4;
87};89};
8890
91struct sg_cmd_response_t {
92 int din_len;
93 int dout_len;
94 int resid;
95 int resid2;
96 const uint8_t * sbp;
97};
98
8999
90extern const char * sg_lib_version_str;100extern const char * sg_lib_version_str;
91101
diff --git a/include/sg_linux_inc.h b/include/sg_linux_inc.h
index 1f76018..e6f6b52 100644
--- a/include/sg_linux_inc.h
+++ b/include/sg_linux_inc.h
@@ -12,6 +12,7 @@
12 #include <linux/../scsi/sg.h>12 #include <linux/../scsi/sg.h>
13 #include <linux/../scsi/scsi.h>13 #include <linux/../scsi/scsi.h>
14 #else14 #else
15 #define __user
15 #include <scsi/sg.h>16 #include <scsi/sg.h>
16 #include <scsi/scsi.h>17 #include <scsi/scsi.h>
17 #endif18 #endif
diff --git a/include/sg_pr2serr.h b/include/sg_pr2serr.h
index c317f5b..351b3e3 100644
--- a/include/sg_pr2serr.h
+++ b/include/sg_pr2serr.h
@@ -6,6 +6,8 @@
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11/* These are convenience functions that replace the somewhat long-winded13/* These are convenience functions that replace the somewhat long-winded
diff --git a/include/sg_pt.h b/include/sg_pt.h
index c882893..2be9cbf 100644
--- a/include/sg_pt.h
+++ b/include/sg_pt.h
@@ -2,10 +2,12 @@
2#define SG_PT_H2#define SG_PT_H
33
4/*4/*
5 * Copyright (c) 2005-2018 Douglas Gilbert.5 * Copyright (c) 2005-2019 Douglas Gilbert.
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11#include <stdint.h>13#include <stdint.h>
@@ -170,9 +172,12 @@ int do_scsi_pt(struct sg_pt_base * objp, int fd, int timeout_secs,
170 * belongs to. */172 * belongs to. */
171int get_scsi_pt_result_category(const struct sg_pt_base * objp);173int get_scsi_pt_result_category(const struct sg_pt_base * objp);
172174
173/* If not available return 0 which implies there is no residual175/* If not available return 0 which implies there is no residual value. If
174 * value. If supported the number of bytes actually sent back by176 * supported it is the number of bytes requested to transfer less the
175 * the device is 'dxfer_ilen - get_scsi_pt_len()' bytes. */177 * number actually transferred. This it typically important for data-in
178 * transfers. For data-out (only) transfers, the 'dout_req_len -
179 * dout_act_len' is returned. For bidi transfer the data-in residual is
180 * returned. */
176int get_scsi_pt_resid(const struct sg_pt_base * objp);181int get_scsi_pt_resid(const struct sg_pt_base * objp);
177182
178/* Returns SCSI status value (from device that received the command). If an183/* Returns SCSI status value (from device that received the command). If an
@@ -188,6 +193,7 @@ uint32_t get_pt_result(const struct sg_pt_base * objp);
188/* Actual sense length returned. If sense data is present but193/* Actual sense length returned. If sense data is present but
189 actual sense length is not known, return 'max_sense_len' */194 actual sense length is not known, return 'max_sense_len' */
190int get_scsi_pt_sense_len(const struct sg_pt_base * objp);195int get_scsi_pt_sense_len(const struct sg_pt_base * objp);
196uint8_t * get_scsi_pt_sense_buf(const struct sg_pt_base * objp);
191197
192/* If not available return 0 (for success). */198/* If not available return 0 (for success). */
193int get_scsi_pt_os_err(const struct sg_pt_base * objp);199int get_scsi_pt_os_err(const struct sg_pt_base * objp);
@@ -205,6 +211,19 @@ char * get_scsi_pt_transport_err_str(const struct sg_pt_base * objp,
205 * command. */211 * command. */
206int get_scsi_pt_duration_ms(const struct sg_pt_base * objp);212int get_scsi_pt_duration_ms(const struct sg_pt_base * objp);
207213
214/* If not available return 0 otherwise return number of nanoseconds that the
215 * lower layers (and hardware) took to execute the command just completed. */
216uint64_t get_pt_duration_ns(const struct sg_pt_base * objp);
217
218/* The two functions yield requested and actual data transfer lengths in
219 * bytes. The second argument is a pointer to the data-in length; the third
220 * argument is a pointer to the data-out length. The pointers may be NULL.
221 * The _actual_ values are related to resid (residual count from DMA) */
222void get_pt_req_lengths(const struct sg_pt_base * objp, int * req_dinp,
223 int * req_doutp);
224void get_pt_actual_lengths(const struct sg_pt_base * objp, int * act_dinp,
225 int * act_doutp);
226
208/* Return true if device associated with 'objp' uses NVMe command set. To227/* Return true if device associated with 'objp' uses NVMe command set. To
209 * be useful (in modifying the type of command sent (SCSI or NVMe) then228 * be useful (in modifying the type of command sent (SCSI or NVMe) then
210 * construct_scsi_pt_obj_with_fd() should be used followed by an invocation229 * construct_scsi_pt_obj_with_fd() should be used followed by an invocation
diff --git a/include/sg_pt_linux.h b/include/sg_pt_linux.h
index 00010ba..eb451e8 100644
--- a/include/sg_pt_linux.h
+++ b/include/sg_pt_linux.h
@@ -6,6 +6,8 @@
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11#include <stdint.h>13#include <stdint.h>
@@ -40,6 +42,25 @@ extern "C" {
40#define BSG_FLAG_Q_AT_TAIL 0x10 /* default is Q_AT_HEAD */42#define BSG_FLAG_Q_AT_TAIL 0x10 /* default is Q_AT_HEAD */
41#define BSG_FLAG_Q_AT_HEAD 0x2043#define BSG_FLAG_Q_AT_HEAD 0x20
4244
45#ifndef SGV4_FLAG_YIELD_TAG
46#define SGV4_FLAG_YIELD_TAG 0x8
47#endif
48#ifndef SGV4_FLAG_FIND_BY_TAG
49#define SGV4_FLAG_FIND_BY_TAG 0x100
50#endif
51#ifndef SGV4_FLAG_IMMED
52#define SGV4_FLAG_IMMED 0x400
53#endif
54#ifndef SGV4_FLAG_IMMED
55#define SGV4_FLAG_IMMED 0x400
56#endif
57#ifndef SGV4_FLAG_DEV_SCOPE
58#define SGV4_FLAG_DEV_SCOPE 0x1000
59#endif
60#ifndef SGV4_FLAG_SHARE
61#define SGV4_FLAG_SHARE 0x2000
62#endif
63
43struct sg_io_v4 {64struct sg_io_v4 {
44 __s32 guard; /* [i] 'Q' to differentiate from v3 */65 __s32 guard; /* [i] 'Q' to differentiate from v3 */
45 __u32 protocol; /* [i] 0 -> SCSI , .... */66 __u32 protocol; /* [i] 0 -> SCSI , .... */
@@ -48,10 +69,10 @@ struct sg_io_v4 {
4869
49 __u32 request_len; /* [i] in bytes */70 __u32 request_len; /* [i] in bytes */
50 __u64 request; /* [i], [*i] {SCSI: cdb} */71 __u64 request; /* [i], [*i] {SCSI: cdb} */
51 __u64 request_tag; /* [i] {SCSI: task tag (only if flagged)} */72 __u64 request_tag; /* [i] {in sg 4.0+ this is out parameter} */
52 __u32 request_attr; /* [i] {SCSI: task attribute} */73 __u32 request_attr; /* [i] {SCSI: task attribute} */
53 __u32 request_priority; /* [i] {SCSI: task priority} */74 __u32 request_priority; /* [i] {SCSI: task priority} */
54 __u32 request_extra; /* [i] {spare, for padding} */75 __u32 request_extra; /* [i] {used for pack_id} */
55 __u32 max_response_len; /* [i] in bytes */76 __u32 max_response_len; /* [i] in bytes */
56 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */77 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
5778
@@ -104,6 +125,7 @@ struct sg_pt_linux_scsi {
104 int dev_fd; /* -1 if not given (yet) */125 int dev_fd; /* -1 if not given (yet) */
105 int in_err;126 int in_err;
106 int os_err;127 int os_err;
128 int sg_version; /* for deciding whether to use v3 or v4 interface */
107 uint32_t nvme_nsid; /* 1 to 0xfffffffe are possibly valid, 0129 uint32_t nvme_nsid; /* 1 to 0xfffffffe are possibly valid, 0
108 * implies dev_fd is not a NVMe device130 * implies dev_fd is not a NVMe device
109 * (is_nvme=false) or it is a NVMe char131 * (is_nvme=false) or it is a NVMe char
@@ -157,6 +179,7 @@ extern long sg_lin_page_size;
157179
158void sg_find_bsg_nvme_char_major(int verbose);180void sg_find_bsg_nvme_char_major(int verbose);
159int sg_do_nvme_pt(struct sg_pt_base * vp, int fd, int time_secs, int vb);181int sg_do_nvme_pt(struct sg_pt_base * vp, int fd, int time_secs, int vb);
182int sg_linux_get_sg_version(const struct sg_pt_base * vp);
160183
161/* This trims given NVMe block device name in Linux (e.g. /dev/nvme0n1p5)184/* This trims given NVMe block device name in Linux (e.g. /dev/nvme0n1p5)
162 * to the name of its associated char device (e.g. /dev/nvme0). If this185 * to the name of its associated char device (e.g. /dev/nvme0). If this
@@ -165,7 +188,6 @@ int sg_do_nvme_pt(struct sg_pt_base * vp, int fd, int time_secs, int vb);
165bool sg_get_nvme_char_devname(const char * nvme_block_devname, uint32_t b_len,188bool sg_get_nvme_char_devname(const char * nvme_block_devname, uint32_t b_len,
166 char * b);189 char * b);
167190
168
169#ifdef __cplusplus191#ifdef __cplusplus
170}192}
171#endif193#endif
diff --git a/include/sg_pt_nvme.h b/include/sg_pt_nvme.h
index a910b05..590b4de 100644
--- a/include/sg_pt_nvme.h
+++ b/include/sg_pt_nvme.h
@@ -2,10 +2,12 @@
2#define SG_PT_NVME_H2#define SG_PT_NVME_H
33
4/*4/*
5 * Copyright (c) 2017-2018 Douglas Gilbert.5 * Copyright (c) 2017-2019 Douglas Gilbert.
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11#include <stdint.h>13#include <stdint.h>
@@ -27,9 +29,9 @@ extern "C" {
27 * are exceptions, for example the EUI-64 identifiers in the Admin Identify29 * are exceptions, for example the EUI-64 identifiers in the Admin Identify
28 * response are big endian.30 * response are big endian.
29 *31 *
30 * Code online (e.g. nvme-cli at github.com) seems to like packed strcutures,32 * Code online (e.g. nvme-cli at github.com) seems to favour packed
31 * the author prefers byte offset plus a range of unaligned integer builders33 * structures, while the author prefers byte offset plus a range of unaligned
32 * such as those in sg_unaligned.h .34 * integer builders such as those in sg_unaligned.h .
33 */35 */
3436
35#ifdef __GNUC__37#ifdef __GNUC__
@@ -181,8 +183,6 @@ struct sg_opcode_info_t {
181/* Vendor specific (sg3_utils) VPD pages */183/* Vendor specific (sg3_utils) VPD pages */
182#define SG_NVME_VPD_NICR 0xde /* NVME Identify controller response */184#define SG_NVME_VPD_NICR 0xde /* NVME Identify controller response */
183185
184extern struct sg_opcode_info_t sg_opcode_info_arr[];
185
186186
187/* Given the NVMe Identify Controller response and optionally the NVMe187/* Given the NVMe Identify Controller response and optionally the NVMe
188 * Identify Namespace response (NULL otherwise), generate the SCSI VPD188 * Identify Namespace response (NULL otherwise), generate the SCSI VPD
@@ -211,6 +211,10 @@ int sntl_resp_mode_select10(struct sg_sntl_dev_state_t * dsp,
211 const uint8_t * cdbp, const uint8_t * dop,211 const uint8_t * cdbp, const uint8_t * dop,
212 int do_len, struct sg_sntl_result_t * resp);212 int do_len, struct sg_sntl_result_t * resp);
213213
214/* Returns pointer to array of struct sg_opcode_info_t of SCSI commands
215 * translated to NVMe. */
216const struct sg_opcode_info_t * sg_get_opcode_translation(void);
217
214#ifdef __cplusplus218#ifdef __cplusplus
215}219}
216#endif220#endif
diff --git a/include/sg_unaligned.h b/include/sg_unaligned.h
index ca702e8..0a65b39 100644
--- a/include/sg_unaligned.h
+++ b/include/sg_unaligned.h
@@ -6,6 +6,8 @@
6 * All rights reserved.6 * All rights reserved.
7 * Use of this source code is governed by a BSD-style7 * Use of this source code is governed by a BSD-style
8 * license that can be found in the BSD_LICENSE file.8 * license that can be found in the BSD_LICENSE file.
9 *
10 * SPDX-License-Identifier: BSD-2-Clause
9 */11 */
1012
11#include <stdbool.h>13#include <stdbool.h>
diff --git a/inhex/README b/inhex/README
12new file mode 10064414new file mode 100644
index 0000000..d765466
--- /dev/null
+++ b/inhex/README
@@ -0,0 +1,50 @@
1 Hex data for various sg3_utils utilities
2 ========================================
3
4The files in this folder contain hexadecimal data (in ASCII) and associated
5comments (prefixed with the hash mark symbol ('#')).
6
7The utility that each hex file is associated with can be determined by
8prepending "sg_" to these filenames then going to the 'src' folder (a
9sibling folder to this one) and look for a match or partial match on
10the name.
11
12For example:
13 vpd_dev_id.hex
14after prepending 'sg_' becomes:
15 sg_vpd_dev_id.hex
16which is a partial match on the sg_vpd utility.
17The remaining 'dev_id.hex' is meant to suggest the 'device identifier'
18VPD page which is a mandatory VPD page.
19
20Assuming sg3_utils is installed, it can be tested like this:
21 sg_vpd --inhex=<folder_holding_sg3_utils>/inhex/vpd_dev_id.hex
22
23And should output this:
24
25Device Identification VPD page:
26 Addressed logical unit:
27 designator type: NAA, code set: Binary
28 0x5000c5003011cb2b
29 Target port:
30 designator type: NAA, code set: Binary
31 transport: Serial Attached SCSI Protocol (SPL-4)
32 0x5000c5003011cb29
33 designator type: Relative target port, code set: Binary
34 transport: Serial Attached SCSI Protocol (SPL-4)
35 Relative target port: 0x1
36 Target device that contains addressed lu:
37 designator type: NAA, code set: Binary
38 transport: Serial Attached SCSI Protocol (SPL-4)
39 0x5000c5003011cb28
40 designator type: SCSI name string, code set: UTF-8
41 SCSI name string:
42 naa.5000C5003011CB28
43
44
45Users are encouraged to send the author any ASCII hex files for utilities
46that support --inhex and don't have hex data already. Special cases are
47also welcome. They help the author test this code.
48
49Douglas Gilbert
5028th August 2019
diff --git a/inhex/get_elem_status.hex b/inhex/get_elem_status.hex
0new file mode 10064451new file mode 100644
index 0000000..7db83c8
--- /dev/null
+++ b/inhex/get_elem_status.hex
@@ -0,0 +1,35 @@
1# To test sg_get_elem_status with dummy response to the SCSI
2# GET PHYSICAL ELEMENT SATUS command
3
40 0 0 4
50 0 0 2
60 0 0 2
7
80 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9
10# first descriptor
110 0 0 0
120 0 0 1
13
140 0 0 0 0
150
161
172c
180 0 0 0 11 22 33 0
19
200 0 0 0 0 0 0 0
21
22# second descriptor
230 0 0 0
240 0 0 2
25
260 0 0 0 0
271
281
29fe
30ff ff ff ff ff ff ff ff
31
320 0 0 0 0 0 0 0
33
34
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches