aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--doc/sg_ses.88
-rw-r--r--lib/sg_lib_data.c4
-rw-r--r--src/sg_dd.c18
-rw-r--r--src/sg_inq.c2
-rw-r--r--src/sg_inq_data.c7
-rw-r--r--src/sg_ses.c14
7 files changed, 36 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 583b9541..4679b078 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,13 +2,15 @@ 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.30 [20100601] [svn: r344]
- - sg_inq: update version descriptor list to spc4r24
- - sg_lib: sync asc/ascq list to spc4r24
+Changelog for sg3_utils-1.30 [20100625] [svn: r345]
+ - sg_inq: update version descriptor list to spc4r25
+ - sg_lib: sync asc/ascq list to spc4r25
- dStrHex(): trim excess trailing spaces
- sg_read_long: add --readonly option (open() is rw)
- sg_raw: add --readonly option (open() is rw)
- sg_vpd: rdac vendor page [0xc8] parse corrections
+ - sg_ses: expand --date (in) buffer to 2048 bytes
+ - sg_dd: clean count calculation, document nocache flag
Changelog for sg3_utils-1.29 [20100406] [svn: r334]
- sg_rtpg: new logical block dependent state and bit (spc4r23)
diff --git a/doc/sg_ses.8 b/doc/sg_ses.8
index b3af2531..515101b5 100644
--- a/doc/sg_ses.8
+++ b/doc/sg_ses.8
@@ -1,4 +1,4 @@
-.TH SG_SES "8" "January 2010" "sg3_utils\-1.29" SG3_UTILS
+.TH SG_SES "8" "June 2010" "sg3_utils\-1.30" SG3_UTILS
.SH NAME
sg_ses \- send controls and fetch status from a SCSI Enclosure
Services (SES) device
@@ -45,14 +45,14 @@ in SES\-2) and Subenclosure String Out diagnostic pages can be set currently.
.TP
\fB\-d\fR, \fB\-\-data\fR=\fIH,H...\fR
permits a string of comma separated (ASCII) hex bytes to be specified (limit
-512). A (single) space separated string of hex bytes is also allowed but
+1024). A (single) space separated string of hex bytes is also allowed but
the list needs to be in quotes. This allows the parameters to a control
diagnostic page to be specified. The string given should not include the
first 4 bytes (i.e. page code and length). See next entry for using stdin.
.TP
\fB\-d\fR, \fB\-\-data\fR=\-
-reads a data string from stdin. Spaces, tabs and line feeds additionally
-are permitted as separators.
+reads a data string from stdin, limit 1024 bytes. Spaces, tabs and line feeds
+additionally are permitted as separators.
.TP
\fB\-f\fR, \fB\-\-filter\fR
cuts down on the amount of output from the enclosure status diagnostic
diff --git a/lib/sg_lib_data.c b/lib/sg_lib_data.c
index f2602f85..abbf3555 100644
--- a/lib/sg_lib_data.c
+++ b/lib/sg_lib_data.c
@@ -15,7 +15,7 @@
#endif
-const char * sg_lib_version_str = "1.60 20100511"; /* spc-4 rev 24 */
+const char * sg_lib_version_str = "1.61 20100625"; /* spc-4 rev 25 */
struct sg_lib_value_name_t sg_lib_normal_opcodes[] = {
{0, 0, "Test Unit Ready"},
@@ -379,6 +379,7 @@ struct sg_lib_asc_ascq_t sg_lib_asc_ascq[] =
{0x00,0x1c,"Verify operation in progress"},
{0x00,0x1d,"ATA pass through information available"},
{0x00,0x1e,"Conflicting SA creation request"},
+ {0x00,0x1f,"Logical unit transitioning to another power condition"},
{0x01,0x00,"No index/sector signal"},
{0x02,0x00,"No seek complete"},
{0x03,0x00,"Peripheral device write fault"},
@@ -415,6 +416,7 @@ struct sg_lib_asc_ascq_t sg_lib_asc_ascq[] =
{0x04,0x17,"Logical unit not ready, calibration required"},
{0x04,0x18,"Logical unit not ready, a door is open"},
{0x04,0x19,"Logical unit not ready, operating in sequential mode"},
+ {0x04,0x1a,"Logical unit not ready, start stop unit command in progress"},
{0x05,0x00,"Logical unit does not respond to selection"},
{0x06,0x00,"No reference position found"},
{0x07,0x00,"Multiple peripheral devices selected"},
diff --git a/src/sg_dd.c b/src/sg_dd.c
index e3b20cff..953343e6 100644
--- a/src/sg_dd.c
+++ b/src/sg_dd.c
@@ -34,7 +34,7 @@
/* A utility program for copying files. Specialised for "files" that
* represent devices that understand the SCSI command set.
*
-* Copyright (C) 1999 - 2008 D. Gilbert and P. Allworth
+* Copyright (C) 1999 - 2010 D. Gilbert and P. Allworth
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
@@ -58,7 +58,7 @@
This version is designed for the linux kernel 2.4 and 2.6 series.
*/
-static char * version_str = "5.73 20090205";
+static char * version_str = "5.74 20100613";
#define ME "sg_dd: "
@@ -1650,6 +1650,7 @@ main(int argc, char * argv[])
if ((dd_count < 0) || ((verbose > 0) && (0 == dd_count))) {
in_num_sect = -1;
+ in_sect_sz = -1;
if (FT_SG & in_type) {
res = scsi_read_capacity(infd, &in_num_sect, &in_sect_sz);
if (SG_LIB_CAT_UNIT_ATTENTION == res) {
@@ -1669,8 +1670,7 @@ main(int argc, char * argv[])
else
fprintf(stderr, "Unable to read capacity on %s\n", inf);
in_num_sect = -1;
- }
- if (in_sect_sz != blk_sz)
+ } else if (in_sect_sz != blk_sz)
fprintf(stderr, ">> warning: block size on %s confusion: "
"bs=%d, device claims=%d\n", inf, blk_sz, in_sect_sz);
} else if (FT_BLOCK & in_type) {
@@ -1688,11 +1688,11 @@ main(int argc, char * argv[])
in_num_sect -= skip;
out_num_sect = -1;
+ out_sect_sz = -1;
if (FT_SG & out_type) {
res = scsi_read_capacity(outfd, &out_num_sect, &out_sect_sz);
if (SG_LIB_CAT_UNIT_ATTENTION == res) {
- fprintf(stderr,
- "Unit attention (readcap out), continuing\n");
+ fprintf(stderr, "Unit attention (readcap out), continuing\n");
res = scsi_read_capacity(outfd, &out_num_sect, &out_sect_sz);
} else if (SG_LIB_CAT_ABORTED_COMMAND == res) {
fprintf(stderr,
@@ -1706,8 +1706,7 @@ main(int argc, char * argv[])
else
fprintf(stderr, "Unable to read capacity on %s\n", outf);
out_num_sect = -1;
- }
- if (blk_sz != out_sect_sz)
+ } else if (blk_sz != out_sect_sz)
fprintf(stderr, ">> warning: block size on %s confusion: "
"bs=%d, device claims=%d\n", outf, blk_sz,
out_sect_sz);
@@ -1717,8 +1716,7 @@ main(int argc, char * argv[])
fprintf(stderr, "Unable to read block capacity on %s\n",
outf);
out_num_sect = -1;
- }
- if (blk_sz != out_sect_sz) {
+ } else if (blk_sz != out_sect_sz) {
fprintf(stderr, "block size on %s confusion: bs=%d, "
"device claims=%d\n", outf, blk_sz, out_sect_sz);
out_num_sect = -1;
diff --git a/src/sg_inq.c b/src/sg_inq.c
index 012f2de7..416d0c5d 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -66,7 +66,7 @@
* information [MAINTENANCE IN, service action = 0xc]; see sg_opcodes.
*/
-static char * version_str = "0.89 20100416"; /* SPC-4 rev 24 */
+static char * version_str = "0.90 20100625"; /* SPC-4 rev 25 */
#define VPD_SUPPORTED_VPDS 0x0
diff --git a/src/sg_inq_data.c b/src/sg_inq_data.c
index 1b31fd61..46355b67 100644
--- a/src/sg_inq_data.c
+++ b/src/sg_inq_data.c
@@ -39,7 +39,7 @@ struct sg_version_descriptor {
const char * name;
};
-/* table from SPC-4 revision 24 [sorted numerically (from Annex D.8)] */
+/* table from SPC-4 revision 25 [sorted numerically (from Annex D.8)] */
/* Can also be obtained from : http://www.t10.org/lists/stds.txt */
struct sg_version_descriptor sg_version_descriptor_arr[] = {
{0x0, "Version Descriptor not supported or No standard identified"},
@@ -287,6 +287,7 @@ struct sg_version_descriptor sg_version_descriptor_arr[] = {
{0xc23, "SAS-2 T10/1760-D revision 14"},
{0xc27, "SAS-2 T10/1760-D revision 15"},
{0xc28, "SAS-2 T10/1760-D revision 16"},
+ {0xc2a, "SAS-2 ANSI INCITS 457-2010"},
{0xc40, "SAS-2.1 (no version claimed)"},
{0xc48, "SAS-2.1 T10/2125-D revision 04"},
{0xd20, "FC-PH (no version claimed)"},
@@ -326,6 +327,7 @@ struct sg_version_descriptor sg_version_descriptor_arr[] = {
{0xe60, "FC-PI-3 (no version claimed)"},
{0xe62, "FC-PI-3 T11/1625-D revision 2.0"},
{0xe68, "FC-PI-3 T11/1625-D revision 2.1"},
+ {0xe6a, "FC-PI-3 T11/1625-D revision 4.0"},
{0xe80, "FC-PI-4 (no version claimed)"},
{0xe82, "FC-PI-4 T11/1647-D revision 8.0"},
{0xea0, "FC 10GFC (no version claimed)"},
@@ -341,6 +343,8 @@ struct sg_version_descriptor sg_version_descriptor_arr[] = {
{0xf03, "FC-LS-2 T11/2103-D revision 2.11"},
{0xf20, "FC-PI-5 (no version claimed)"},
{0xf27, "FC-PI-5 T11/2118-D revision 2.00"},
+ {0xf28, "FC-PI-5 T11/2118-D revision 3.00"},
+ {0xf40, "FC-PI-6 (no version claimed)"},
{0x12a0, "FC-SCM (no version claimed)"},
{0x12a3, "FC-SCM T11/1824DT revision 1.0"},
{0x12c0, "FC-DA-2 (no version claimed)"},
@@ -380,6 +384,7 @@ struct sg_version_descriptor sg_version_descriptor_arr[] = {
{0x1623, "ATA/ATAPI-8 ATA-ACS ATA/ATAPI command set (no version "
"claimed)"},
{0x1628, "ATA/ATAPI-8 ATA-AAM ANSI INCITS 451-2008"},
+ {0x162a, "ATA/ATAPI-8 ATA8-ACS ANSI INCITS 452-2009 w/ Amendment 1"},
{0x1728, "Universal Serial Bus Specification, Revision 1.1"},
{0x1729, "Universal Serial Bus Specification, Revision 2.0"},
{0x1730, "USB Mass Storage Class Bulk-Only Transport, Revision 1.0"},
diff --git a/src/sg_ses.c b/src/sg_ses.c
index 9ed1ccf3..96592dee 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -24,10 +24,11 @@
* commands tailored for SES (enclosure) devices.
*/
-static char * version_str = "1.47 20100312"; /* ses3r02 */
+static char * version_str = "1.48 20100610"; /* ses3r02 */
#define MX_ALLOC_LEN 4096
#define MX_ELEM_HDR 1024
+#define MX_DATA_IN 2048
#define TEMPERATURE_OFFSET 20 /* 8 bits represents -19 C to +235 C */
/* value of 0 (would imply -20 C) reserved */
@@ -1524,7 +1525,8 @@ read_hex(const char * inp, unsigned char * arr, int * arr_len)
*arr_len = 0;
}
if ('-' == inp[0]) { /* read from stdin */
- for (j = 0, off = 0; j < 512; ++j) {
+ for (j = 0, off = 0; j < MX_DATA_IN; ++j) {
+ /* limit lines read to MX_DATA_IN */
if (NULL == fgets(line, sizeof(line), stdin))
break;
in_len = strlen(line);
@@ -1550,7 +1552,7 @@ read_hex(const char * inp, unsigned char * arr, int * arr_len)
"line %d, pos %d\n", j + 1, m + k + 1);
return 1;
}
- for (k = 0; k < 1024; ++k) {
+ for (k = 0; k < (MX_DATA_IN - off); ++k) {
if (1 == sscanf(lcp, "%x", &h)) {
if (h > 0xff) {
fprintf(stderr, "read_hex: hex number "
@@ -1573,6 +1575,8 @@ read_hex(const char * inp, unsigned char * arr, int * arr_len)
}
}
off += k + 1;
+ if (off >= MX_DATA_IN)
+ break;
}
*arr_len = off;
} else { /* hex string on command line */
@@ -1582,7 +1586,7 @@ read_hex(const char * inp, unsigned char * arr, int * arr_len)
k + 1);
return 1;
}
- for (k = 0; k < 1024; ++k) {
+ for (k = 0; k < MX_DATA_IN; ++k) {
if (1 == sscanf(lcp, "%x", &h)) {
if (h > 0xff) {
fprintf(stderr, "read_hex: hex number larger "
@@ -1795,7 +1799,7 @@ main(int argc, char * argv[])
int byte1 = 0;
const char * device_name = NULL;
char buff[48];
- unsigned char data_arr[1024];
+ unsigned char data_arr[MX_DATA_IN + 16];
int arr_len = 0;
int pd_type = 0;
int ret = 0;