Skip to content

Commit 8fd9d4e

Browse files
committed
cleanup for FreeBSD and Win32 prior to 1.35
git-svn-id: svn://localhost/trunk@476 6180dd3e-e324-4e3e-922d-17de1ae2f315
1 parent 057178c commit 8fd9d4e

13 files changed

+54
-49
lines changed

COVERAGE

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ATA COMMAND PASS-THROUGH(16) sg_sat_identify, sg_sat_set_features,
1212
sg__sat_set_features, sg_sat_smart_rd_data
1313
(previous four in the examples directory)]
1414
ATA COMMAND PASS-THROUGH(12) sg_sat_identify, ++
15+
COMPARE AND WRITE sg_compare_and_write
1516
EXTENDED COPY sg_xcopy, ++
1617
GET CONFIGURATION sg_get_config, ++
1718
GET LBA STATUS sg_get_lba_status, ++
@@ -99,4 +100,4 @@ SMART READ DATA examples/sg_sat_smart_rd_data
99100

100101

101102
Douglas Gilbert
102-
23rd March 2012
103+
14th January 2013

ChangeLog

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
22
some description at the top of its ".c" file. All utilities in the main
33
directory have their own "man" pages. There is also a sg3_utils man page.
44

5-
Changelog for sg3_utils-1.35 [20130110] [svn: r475]
5+
Changelog for sg3_utils-1.35 [20130117] [svn: r476]
66
- sg_compare_and_write: new utility
77
- sg_inq+sg_vpd: block device characteristics VPD page:
88
add product_type, WABEREQ, WACEREQ and VBULS fields

README

+25-24
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The sg driver in Linux can be seen as having 3 distinct versions:
122122
v3 lk >= 2.4 additional sg_io_hdr interface structure [2001/1/4]
123123
v3 lk >= 2.6 same interface as found in lk 2.4 [2.6.0: 2003/12/18]
124124

125-
and the bsg driver supports the sg v4 interface and was added around
125+
and the bsg driver supports the sg v4 interface and was added around
126126
lk 2.6.28 . This package is targeted at "v3" and "v4". Another package called
127127
"sg_utils" is targeted at "v2" and to a lesser extent "v1". The "sg_utils"
128128
package has a subset of the utilities found in this package.
@@ -180,7 +180,8 @@ In Linux there are package build files for "rpm" based and for "deb" based
180180
systems. The 'sg3_utils.spec' file in the main directory can be used like
181181
this: 'rpmbuild -ba sg3_utils.spec' in a rpmbuild tree SPECS directory.
182182
To cross build or make a more widely distributable package then the --target
183-
option may be useful: 'rpmbuild --target=i386 -ba sg3_utils.spec' .
183+
option may be useful: 'rpmbuild --target=i386 -ba sg3_utils.spec' or
184+
'rpmbuild --target=x86_64 -ba sg3_utils.spec' .
184185

185186
The 'build_debian.sh' script should build several "deb" packages and place
186187
them in the parent directory. In debian based systems doing
@@ -220,16 +221,16 @@ Utilities
220221
=========
221222
Here is list in alphabetical order of utilities found in the 'src'
222223
subdirectory of the sg3_utils package:
223-
sginfo, sg_copy_results, sgm_dd, sgp_dd, sg_dd, sg_decode_sense,
224-
sg_emc_trespass, sg_format, sg_get_config, sg_get_lba_status, sg_ident,
225-
sg_inq, sg_logs, sg_luns, sg_map, sg_map26, sg_modes, sg_opcodes,
226-
sg_persist, sg_prevent, sg_raw, sg_rbuf, sg_rdac, sg_read, sg_readcap,
227-
sg_read_block_limits, sg_read_buffer, sg_read_long, sg_reassign,
228-
sg_referrals, sg_request, sg_reset, sg_rmsn, sg_rtpg, sg_safte,
229-
sg_sanitize, sg_sat_identify, sg_sat_phy_event, sg_sat_set_features,
230-
sg_scan, sg_senddiag, sg_ses, sg_start, sg_stpg, sg_sync, sg_test_rwbuff,
231-
sg_turs, sg_unmap, sg_verify, sg_vpd, sg_write_buffer, sg_write_long,
232-
sg_write_same, sg_wr_mode, sg_xcopy
224+
sginfo, sg_compare_and_write, sg_copy_results, sgm_dd, sgp_dd, sg_dd,
225+
sg_decode_sense, sg_emc_trespass, sg_format, sg_get_config,
226+
sg_get_lba_status, sg_ident, sg_inq, sg_logs, sg_luns, sg_map, sg_map26,
227+
sg_modes, sg_opcodes, sg_persist, sg_prevent, sg_raw, sg_rbuf, sg_rdac,
228+
sg_read, sg_readcap, sg_read_block_limits, sg_read_buffer, sg_read_long,
229+
sg_reassign, sg_referrals, sg_request, sg_reset, sg_rmsn, sg_rtpg,
230+
sg_safte, sg_sanitize, sg_sat_identify, sg_sat_phy_event,
231+
sg_sat_set_features, sg_scan, sg_senddiag, sg_ses, sg_start, sg_stpg,
232+
sg_sync, sg_test_rwbuff, sg_turs, sg_unmap, sg_verify, sg_vpd,
233+
sg_write_buffer, sg_write_long, sg_write_same, sg_wr_mode, sg_xcopy
233234

234235
Each of the above utilities depends on header files found in the 'include'
235236
subdirectory and library code found in the 'lib' subdirectory. Associated
@@ -260,7 +261,7 @@ Also in that subdirectory is a script to test sg_persist, an example data
260261
file for sg_persist (called "transport_ids.txt") and an example data file for
261262
sg_reassign (called "reassign_addr.txt"). There are several scripts
262263
for 'sg_senddiag -pf -raw=-' that will put some SAS disk phys into
263-
a "compliant jitter tolerance pattern" (CJTPAT).
264+
a "compliant jitter tolerance pattern" (CJTPAT).
264265

265266
The 'utils' subdirectory contains source and a Makefile to build "hxascdmp"
266267
which accepts binary data from stdin (or a file on the command line) and
@@ -276,15 +277,15 @@ The 'scripts' subdirectory contains some Bourne (bash) shell scripts that
276277
rely on utilities in the main directory. One script uses the sdparm utility.
277278
These scripts are described in the scripts/README file and have usage
278279
messages.
279-
280+
280281

281282
Notes for utilities without man pages
282283
=====================================
283284
These utils are found in the 'examples' subdirectory.
284285

285286
The "scsi_inquiry" program shows the use of the SCSI_IOCTL_SEND_COMMAND
286-
ioctl to send a SCSI INQUIRY command. That ioctl() is supported by the
287-
SCSI sub system mid level and so is common to all sd, sr, st and sg devices.
287+
ioctl to send a SCSI INQUIRY command. That ioctl() is supported by the
288+
SCSI sub system mid level and so is common to all sd, sr, st and sg devices.
288289
That ioctl is deprecated in the lk 2.6 series. This program has been placed
289290
in the "examples" subdirectory.
290291

@@ -345,13 +346,13 @@ interface by defining the SG3_UTILS_OLD_OPTS environment variable
345346
or using '-O' as the first command line option.
346347

347348
The more recent utilities that use "getopt_long" only are:
348-
- sg_decode_sense, sg_format sg_get_config sg_get_lba_status sg_ident
349-
sg_luns sg_map26 sg_persist sg_prevent sg_raw sg_read_block_limits
350-
sg_read_buffer sg_read_long sg_reassign sg_referrals sg_requests sg_rmsn
351-
sg_rtpg sg_safte sg_sanitize sg_sat_identify sg_sat_phy_event
352-
sg_sat_set_features sg_scan(w) sg_ses sg_stpg sg_sync sg_test_rwbuf
353-
sg_unmap sg_verify sg_vpd sg_write_buffer sg_write_long sg_write_same
354-
sg_wr_mode
349+
- sg_compare_and_write, sg_decode_sense, sg_format, sg_get_config,
350+
sg_get_lba_status, sg_ident, sg_luns, sg_map26, sg_persist, sg_prevent,
351+
sg_raw, sg_read_block_limits, sg_read_buffer, sg_read_long, sg_reassign,
352+
sg_referrals, sg_requests, sg_rmsn, sg_rtpg, sg_safte, sg_sanitize,
353+
sg_sat_identify, sg_sat_phy_event, sg_sat_set_features, sg_scan(w),
354+
sg_ses, sg_stpg, sg_sync, sg_test_rwbuf, sg_unmap, sg_verify, sg_vpd,
355+
sg_write_buffer, sg_write_long, sg_write_same, sg_wr_mode
355356

356357

357358
Dangerous code
@@ -373,4 +374,4 @@ See http://sg.danny.cz/sg/tools.html
373374

374375

375376
Douglas Gilbert
376-
9th January 2013
377+
17th January 2013

README.freebsd

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ for FreeBSD.
1313
Supported Utilities
1414
===================
1515
Here is a list of utilities that have been ported:
16+
sg_compare_and_write
1617
sg_decode_sense
1718
sg_format
1819
sg_get_config
@@ -134,4 +135,4 @@ utilities.
134135

135136

136137
Douglas Gilbert
137-
17th January 2012
138+
14th January 2013

README.solaris

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ for Solaris.
3030
Supported Utilities
3131
===================
3232
Here is a list of utilities that have been ported:
33+
sg_compare_and_write
3334
sg_decode_sense
3435
sg_format
3536
sg_get_config
@@ -155,4 +156,4 @@ disks to accept SCSI commands including the SCSI ATA PASS THROUGH commands.
155156

156157

157158
Douglas Gilbert
158-
21st June 2011
159+
14th January 2013

README.tru64

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ beyond the SCSI command pass through mechanism.
88
Supported Utilities
99
===================
1010
Here is a list of utilities that have been ported:
11+
sg_compare_and_write
1112
sg_decode_sense
1213
sg_format
1314
sg_get_config
@@ -93,4 +94,4 @@ subdirectory. Currently only the Tru64 port uses it.
9394

9495

9596
Douglas Gilbert
96-
21st June 2011
97+
14th January 2013

README.win32

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ compiled out when sg3_utils is built for MinGW.
2828
Supported Utilities
2929
===================
3030
Here is a list of utilities that have been ported:
31+
sg_compare_and_write
3132
sg_decode_sense
3233
sg_format
3334
sg_get_config
@@ -215,4 +216,4 @@ mode" with the setmode() Windows command.
215216

216217

217218
Douglas Gilbert
218-
4th February 2012
219+
14th January 2013

debian/changelog

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ sg3-utils (1.35-0.1) unstable; urgency=low
22

33
* New upstream version
44

5-
-- Douglas Gilbert <[email protected]> Wed, 09 Jan 2013 09:00:00 -0500
5+
-- Douglas Gilbert <[email protected]> Thu, 17 Jan 2013 19:00:00 -0500
66

77
sg3-utils (1.34-0.1) unstable; urgency=low
88

doc/sg_compare_and_write.8

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH "COMPARE AND WRITE" "8" "December 2012" "sg3_utils\-1.35" SG3_UTILS
1+
.TH "COMPARE AND WRITE" "8" "January 2013" "sg3_utils\-1.35" SG3_UTILS
22
.SH NAME
33
sg_compare_and_write \- send the SCSI COMPARE AND WRITE command
44
.SH SYNOPSIS
@@ -87,7 +87,7 @@ Written by Shahar Salzman.
8787
.SH "REPORTING BUGS"
8888
Report bugs to [email protected]
8989
.SH COPYRIGHT
90-
Copyright \(co 2012 Kaminario Technologies LTD
90+
Copyright \(co 2012\-2013 Kaminario Technologies LTD
9191

9292
.br
9393
Redistribution and use in source and binary forms, with or without

sg3_utils.spec

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ fi
7979
%{_libdir}/*.la
8080

8181
%changelog
82-
* Wed Jan 09 2012 - dgilbert at interlog dot com
83-
- track t10 changes, fix for cygwin 1.7.17
82+
* Thu Jan 17 2013 - dgilbert at interlog dot com
83+
- add sg_compare_and_write, track t10 changes
8484
* sg3_utils-1.35
8585

8686
* Sat Oct 13 2012 - dgilbert at interlog dot com

src/sg_compare_and_write.c

+8-10
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <string.h>
1010
#define __STDC_FORMAT_MACROS 1
1111
#include <inttypes.h>
12-
#include <sys/ioctl.h>
1312
#include <getopt.h>
1413

1514
#ifdef HAVE_CONFIG_H
@@ -21,7 +20,7 @@
2120

2221
/* A utility program for the Linux OS SCSI generic ("sg") device driver.
2322
*
24-
* Copyright (c) 2012, Kaminario Technologies LTD
23+
* Copyright (c) 2012-2013, Kaminario Technologies LTD
2524
* All rights reserved.
2625
* Redistribution and use in source and binary forms, with or without
2726
* modification, are permitted provided that the following conditions are met:
@@ -42,14 +41,14 @@
4241
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
4342
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
4443
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
46-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
45+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4746
*
4847
* This command performs a SCSI COMPARE AND WRITE on the given lba.
4948
*
5049
*/
5150

52-
static const char * version_str = "1.01 20121209";
51+
static const char * version_str = "1.02 20130117";
5352

5453
#define DEF_BLOCK_SIZE 512
5554
#define DEF_NUM_BLOCKS (1)
@@ -435,11 +434,10 @@ main(int argc, char * argv[])
435434

436435
if (opts.verbose)
437436
fprintf(stderr, "Running COMPARE AND WRITE command with the "
438-
"following options:\n in=%s device=%s lba=0x%" PRIx64
439-
" num_blocks=%d xfer_len=%d timeout=%d\n",
440-
opts.ifilename, opts.device_name,
441-
(unsigned long)opts.lba, opts.numblocks,
442-
opts.xfer_len, opts.timeout);
437+
"following options:\n in=%s device=%s lba=0x%"
438+
PRIx64 " num_blocks=%d xfer_len=%d timeout=%d\n",
439+
opts.ifilename, opts.device_name, opts.lba,
440+
opts.numblocks, opts.xfer_len, opts.timeout);
443441

444442
infd = open_if(opts.ifilename);
445443
if (infd <=0) {

src/sg_vpd.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2012 Douglas Gilbert.
2+
* Copyright (c) 2006-2013 Douglas Gilbert.
33
* All rights reserved.
44
* Use of this source code is governed by a BSD-style
55
* license that can be found in the BSD_LICENSE file.
@@ -30,7 +30,7 @@
3030
3131
*/
3232

33-
static char * version_str = "0.64 20121211"; /* spc4r36 + sbc3r34 */
33+
static char * version_str = "0.65 20130117"; /* spc4r36 + sbc3r34 */
3434

3535
extern void svpd_enumerate_vendor(void);
3636
extern int svpd_decode_vendor(int sg_fd, int num_vpd, int subvalue,

src/sg_vpd_vendor.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2006-2012 Douglas Gilbert.
2+
* Copyright (c) 2006-2013 Douglas Gilbert.
33
* All rights reserved.
44
* Use of this source code is governed by a BSD-style
55
* license that can be found in the BSD_LICENSE file.
@@ -97,7 +97,8 @@ static struct svpd_values_name_t vendor_vpd_pg[] = {
9797
{VPD_V_JUMP_SEA, 0, -1, 1, "jump", "Jump setting (Seagate)"},
9898
{VPD_V_RVSI_RDAC, 0, -1, 1, "rvsi", "Replicated volume source "
9999
"identifier (RDAC)"},
100-
{VPD_V_SAID_RDAC, 0, -1, 1, "said", "Storage array world wide name (RDAC)"},
100+
{VPD_V_SAID_RDAC, 0, -1, 1, "said", "Storage array world wide name "
101+
"(RDAC)"},
101102
{VPD_V_SUBS_RDAC, 0, -1, 1, "sub", "Subsystem identifier (RDAC)"},
102103
{VPD_V_SVER_RDAC, 1, -1, 1, "sver", "Software version (RDAC)"},
103104
{VPD_V_UPR_EMC, 1, -1, 1, "upr", "Unit path report (EMC)"},

0 commit comments

Comments
 (0)