Skip to content

Commit

Permalink
cleanup for FreeBSD and Win32 prior to 1.35
Browse files Browse the repository at this point in the history
git-svn-id: svn://localhost/trunk@476 6180dd3e-e324-4e3e-922d-17de1ae2f315
  • Loading branch information
doug-gilbert committed Jan 18, 2013
1 parent 057178c commit 8fd9d4e
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 49 deletions.
3 changes: 2 additions & 1 deletion COVERAGE
Expand Up @@ -12,6 +12,7 @@ ATA COMMAND PASS-THROUGH(16) sg_sat_identify, sg_sat_set_features,
sg__sat_set_features, sg_sat_smart_rd_data
(previous four in the examples directory)]
ATA COMMAND PASS-THROUGH(12) sg_sat_identify, ++
COMPARE AND WRITE sg_compare_and_write
EXTENDED COPY sg_xcopy, ++
GET CONFIGURATION sg_get_config, ++
GET LBA STATUS sg_get_lba_status, ++
Expand Down Expand Up @@ -99,4 +100,4 @@ SMART READ DATA examples/sg_sat_smart_rd_data


Douglas Gilbert
23rd March 2012
14th January 2013
2 changes: 1 addition & 1 deletion ChangeLog
Expand Up @@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.

Changelog for sg3_utils-1.35 [20130110] [svn: r475]
Changelog for sg3_utils-1.35 [20130117] [svn: r476]
- sg_compare_and_write: new utility
- sg_inq+sg_vpd: block device characteristics VPD page:
add product_type, WABEREQ, WACEREQ and VBULS fields
Expand Down
49 changes: 25 additions & 24 deletions README
Expand Up @@ -122,7 +122,7 @@ The sg driver in Linux can be seen as having 3 distinct versions:
v3 lk >= 2.4 additional sg_io_hdr interface structure [2001/1/4]
v3 lk >= 2.6 same interface as found in lk 2.4 [2.6.0: 2003/12/18]

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

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

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

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


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

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

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

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


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


Douglas Gilbert
9th January 2013
17th January 2013
3 changes: 2 additions & 1 deletion README.freebsd
Expand Up @@ -13,6 +13,7 @@ for FreeBSD.
Supported Utilities
===================
Here is a list of utilities that have been ported:
sg_compare_and_write
sg_decode_sense
sg_format
sg_get_config
Expand Down Expand Up @@ -134,4 +135,4 @@ utilities.


Douglas Gilbert
17th January 2012
14th January 2013
3 changes: 2 additions & 1 deletion README.solaris
Expand Up @@ -30,6 +30,7 @@ for Solaris.
Supported Utilities
===================
Here is a list of utilities that have been ported:
sg_compare_and_write
sg_decode_sense
sg_format
sg_get_config
Expand Down Expand Up @@ -155,4 +156,4 @@ disks to accept SCSI commands including the SCSI ATA PASS THROUGH commands.


Douglas Gilbert
21st June 2011
14th January 2013
3 changes: 2 additions & 1 deletion README.tru64
Expand Up @@ -8,6 +8,7 @@ beyond the SCSI command pass through mechanism.
Supported Utilities
===================
Here is a list of utilities that have been ported:
sg_compare_and_write
sg_decode_sense
sg_format
sg_get_config
Expand Down Expand Up @@ -93,4 +94,4 @@ subdirectory. Currently only the Tru64 port uses it.


Douglas Gilbert
21st June 2011
14th January 2013
3 changes: 2 additions & 1 deletion README.win32
Expand Up @@ -28,6 +28,7 @@ compiled out when sg3_utils is built for MinGW.
Supported Utilities
===================
Here is a list of utilities that have been ported:
sg_compare_and_write
sg_decode_sense
sg_format
sg_get_config
Expand Down Expand Up @@ -215,4 +216,4 @@ mode" with the setmode() Windows command.


Douglas Gilbert
4th February 2012
14th January 2013
2 changes: 1 addition & 1 deletion debian/changelog
Expand Up @@ -2,7 +2,7 @@ sg3-utils (1.35-0.1) unstable; urgency=low

* New upstream version

-- Douglas Gilbert <dgilbert@interlog.com> Wed, 09 Jan 2013 09:00:00 -0500
-- Douglas Gilbert <dgilbert@interlog.com> Thu, 17 Jan 2013 19:00:00 -0500

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

Expand Down
4 changes: 2 additions & 2 deletions doc/sg_compare_and_write.8
@@ -1,4 +1,4 @@
.TH "COMPARE AND WRITE" "8" "December 2012" "sg3_utils\-1.35" SG3_UTILS
.TH "COMPARE AND WRITE" "8" "January 2013" "sg3_utils\-1.35" SG3_UTILS
.SH NAME
sg_compare_and_write \- send the SCSI COMPARE AND WRITE command
.SH SYNOPSIS
Expand Down Expand Up @@ -87,7 +87,7 @@ Written by Shahar Salzman.
.SH "REPORTING BUGS"
Report bugs to shahar.salzman@kaminario.com
.SH COPYRIGHT
Copyright \(co 2012 Kaminario Technologies LTD
Copyright \(co 2012\-2013 Kaminario Technologies LTD

.br
Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions sg3_utils.spec
Expand Up @@ -79,8 +79,8 @@ fi
%{_libdir}/*.la

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

* Sat Oct 13 2012 - dgilbert at interlog dot com
Expand Down
18 changes: 8 additions & 10 deletions src/sg_compare_and_write.c
Expand Up @@ -9,7 +9,6 @@
#include <string.h>
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
#include <sys/ioctl.h>
#include <getopt.h>

#ifdef HAVE_CONFIG_H
Expand All @@ -21,7 +20,7 @@

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

static const char * version_str = "1.01 20121209";
static const char * version_str = "1.02 20130117";

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

if (opts.verbose)
fprintf(stderr, "Running COMPARE AND WRITE command with the "
"following options:\n in=%s device=%s lba=0x%" PRIx64
" num_blocks=%d xfer_len=%d timeout=%d\n",
opts.ifilename, opts.device_name,
(unsigned long)opts.lba, opts.numblocks,
opts.xfer_len, opts.timeout);
"following options:\n in=%s device=%s lba=0x%"
PRIx64 " num_blocks=%d xfer_len=%d timeout=%d\n",
opts.ifilename, opts.device_name, opts.lba,
opts.numblocks, opts.xfer_len, opts.timeout);

infd = open_if(opts.ifilename);
if (infd <=0) {
Expand Down
4 changes: 2 additions & 2 deletions src/sg_vpd.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2012 Douglas Gilbert.
* Copyright (c) 2006-2013 Douglas Gilbert.
* All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the BSD_LICENSE file.
Expand Down Expand Up @@ -30,7 +30,7 @@
*/

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

extern void svpd_enumerate_vendor(void);
extern int svpd_decode_vendor(int sg_fd, int num_vpd, int subvalue,
Expand Down
5 changes: 3 additions & 2 deletions src/sg_vpd_vendor.c
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2006-2012 Douglas Gilbert.
* Copyright (c) 2006-2013 Douglas Gilbert.
* All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the BSD_LICENSE file.
Expand Down Expand Up @@ -97,7 +97,8 @@ static struct svpd_values_name_t vendor_vpd_pg[] = {
{VPD_V_JUMP_SEA, 0, -1, 1, "jump", "Jump setting (Seagate)"},
{VPD_V_RVSI_RDAC, 0, -1, 1, "rvsi", "Replicated volume source "
"identifier (RDAC)"},
{VPD_V_SAID_RDAC, 0, -1, 1, "said", "Storage array world wide name (RDAC)"},
{VPD_V_SAID_RDAC, 0, -1, 1, "said", "Storage array world wide name "
"(RDAC)"},
{VPD_V_SUBS_RDAC, 0, -1, 1, "sub", "Subsystem identifier (RDAC)"},
{VPD_V_SVER_RDAC, 1, -1, 1, "sver", "Software version (RDAC)"},
{VPD_V_UPR_EMC, 1, -1, 1, "upr", "Unit path report (EMC)"},
Expand Down

0 comments on commit 8fd9d4e

Please sign in to comment.