aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--README2
-rw-r--r--debian/changelog2
-rw-r--r--doc/sg_write_same.820
-rw-r--r--sg3_utils.spec2
-rw-r--r--src/sg_inq.c12
-rw-r--r--src/sg_logs.c11
-rw-r--r--src/sg_modes.c16
-rw-r--r--src/sg_vpd.c14
9 files changed, 54 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index ff66b524..1310c833 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,12 +2,12 @@ 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.28 [20090522] [svn: r265]
+Changelog for sg3_utils-1.28 [20090530] [svn: r266]
- sg_logs: add cache memory statistics log (sub)page
- - sg_lib: sg_set_binary_mode() inactive because config.h not
- included
+ - sg_vpd, sg_inq: extend Block limits VPD page (sbc3r19)
+ - sg_lib: sg_set_binary_mode() needs config.h included
- change SG3_UTILS_* constants to SG_LIB_*
- - sync with spc4r19
+ - sync with spc4r20
- sg_pt_linux: fix check condition but empty sense buffer; occurred
when sg v3 node used and /usr/include/linux/bsg.h visible
- utils/hxascdmp: in Windows set binary mode on read files
diff --git a/README b/README
index 278247a8..e754cf2f 100644
--- a/README
+++ b/README
@@ -335,4 +335,4 @@ See http://sg.danny.cz/sg/tools.html
Doug Gilbert
-22nd May 2009
+30th May 2009
diff --git a/debian/changelog b/debian/changelog
index 422c0544..c56a8d4b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@ sg3-utils (1.28-0.1) unstable; urgency=low
* New upstream version
- -- Doug Gilbert <dgilbert@interlog.com> Fri, 22 May 2009 16:00:00 -0400
+ -- Doug Gilbert <dgilbert@interlog.com> Sat, 30 May 2009 19:00:00 -0400
sg3-utils (1.27-0.1) unstable; urgency=low
diff --git a/doc/sg_write_same.8 b/doc/sg_write_same.8
index 5c6005bb..8894c8f7 100644
--- a/doc/sg_write_same.8
+++ b/doc/sg_write_same.8
@@ -1,4 +1,4 @@
-.TH SG_WRITE_SAME "8" "April 2007" "sg3_utils\-1.27" SG3_UTILS
+.TH SG_WRITE_SAME "8" "May 2009" "sg3_utils\-1.28" SG3_UTILS
.SH NAME
sg_write_same \- send the SCSI WRITE SAME command
.SH SYNOPSIS
@@ -23,8 +23,8 @@ was not given) and the PROT_EN bit is set then the last 8 bytes are
set to 0xff.
.PP
By default WRITE SAME(10) is sent unless \fILBA\fR (plus \fINUM\fR)
-exceeds 32 bits, \fINUM\fR exceeds 65535 or \fI\-\-unmap\fR is given.
-In these cases WRITE SAME(16) is sent.
+exceeds 32 bits, \fINUM\fR exceeds 65535 or the \fI\-\-unmap\fR option is
+given. In these cases WRITE SAME(16) is sent.
.PP
.B Take care:
The WRITE SAME(10, 16 and 32) commands interpret a \fINUM\fR of zero
@@ -32,8 +32,8 @@ as write to the end of \fIDEVICE\fR. This utility defaults \fINUM\fR to
1 . The WRITE SAME commands have no IMMED bit so if \fINUM\fR is
large (or zero) then an invocation of this utility could take a long
time, potentially as long as a FORMAT UNIT command. In such situations
-the command timeout value \fITO\fR will most likely need to be increased
-from its default value of 60 seconds.
+the command timeout value \fITO\fR may need to be increased from its
+default value of 60 seconds.
.PP
As a precaution against an accidental 'sg_write_same /dev/sda' (for example)
overwriting LBA 0 on /dev/sda with zeroes, at least one of the
@@ -41,7 +41,7 @@ overwriting LBA 0 on /dev/sda with zeroes, at least one of the
given. Obviously this utility can destroy a lot of user data so check the
options carefully.
.PP
-This utility is based SBC\-3 draft revision 18 found at http://www.t10.org .
+This utility is based SBC\-3 draft revision 19 found at http://www.t10.org .
.SH OPTIONS
Arguments to long options are mandatory for short options as well.
.TP
@@ -99,7 +99,7 @@ considerably more time than 60 seconds to complete.
\fB\-U\fR, \fB\-\-unmap\fR
sets the UNMAP bit in the WRITE SAME(16 and 32) cdb. When this option is
given the default command becomes WRITE SAME(16) since the WRITE SAME(10)
-command does not offer this bit (in SBC\-3 draft revision 18). See UNMAP
+command does not offer this bit (in SBC\-3 draft revision 19). See UNMAP
section below.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
@@ -121,7 +121,7 @@ data out buffer length. If both this option and the \fIIF\fR option are
given and \fILEN\fR exceeds the length of the \fIIF\fR file then \fILEN\fR
is the data out buffer length with zeroes used as pad bytes.
.SH UNMAP
-Thin provisioning is the sophisticated term used in SBC\-3 revision 18
+Thin provisioning is the sophisticated term used in SBC\-3 revision 19
for the ability to mark blocks as unused. It is closely related to the
ATA DATA SET MANAGEMENT command with the "Trim" bit set. For large
storage arrays, it is a way to provision less physical storage than the
@@ -132,8 +132,8 @@ known large sections (or almost all) of the flash memory is not in use.
.PP
Support for thin provisioning is indicated by the TPE bit being set in
the READ CAPACITY(16) command response. That implies at least one of
-the UNMAP, WRITE SAME(16) or WRITE SAME(32) commands is implemented. If
-the UNMAP command is implemented then the "Maximum unmap LBA count"
+the UNMAP or WRITE SAME(16) commands is implemented. If the UNMAP command
+is implemented then the "Maximum unmap LBA count"
and "Maximum unmap block descriptor count" fields in the Block Limits
VPD page should both be greater than zero. The READ CAPACITY(16) command
response also contains a TPRZ bit which if set means that if unmapped
diff --git a/sg3_utils.spec b/sg3_utils.spec
index 388fba2e..57996000 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -79,7 +79,7 @@ fi
%{_libdir}/*.la
%changelog
-* Fri May 22 2009 - dgilbert at interlog dot com
+* Sat May 30 2009 - dgilbert at interlog dot com
- sg_logs: cache memory statistics log page
* sg3_utils-1.28
diff --git a/src/sg_inq.c b/src/sg_inq.c
index ba9915a9..bfaf17ec 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.82 20090422"; /* SPC-4 rev 18 */
+static char * version_str = "0.83 20090530"; /* SPC-4 rev 20 */
#define VPD_SUPPORTED_VPDS 0x0
@@ -1426,6 +1426,16 @@ decode_b0_vpd(unsigned char * buff, int len, int do_hex, int pdt)
(buff[26] << 8) | buff[27];
printf(" Maximum unmap block descriptor count: %u\n", u);
}
+ if (len > 35) { /* added in sbc3r19 */
+ u = ((unsigned int)buff[28] << 24) | (buff[29] << 16) |
+ (buff[30] << 8) | buff[31];
+ printf(" Optimal unmap granularity: %u\n", u);
+ printf(" Unmap granularity alignment valid: %u\n",
+ !!(buff[32] & 0x80));
+ u = ((unsigned int)(buff[32] & 0x7f) << 24) |
+ (buff[33] << 16) | (buff[34] << 8) | buff[35];
+ printf(" Unmap granularity alignment: %u\n", u);
+ }
break;
case PDT_TAPE: case PDT_MCHANGER:
printf(" WORM=%d\n", !!(buff[4] & 0x1));
diff --git a/src/sg_logs.c b/src/sg_logs.c
index 245e47f0..eb3fb691 100644
--- a/src/sg_logs.c
+++ b/src/sg_logs.c
@@ -25,7 +25,7 @@
*/
-static char * version_str = "0.85 20090507"; /* SPC-4 revision 19 */
+static char * version_str = "0.86 20090602"; /* SPC-4 revision 20 */
#define MX_ALLOC_LEN (0xfffc)
#define SHORT_RESP_LEN 128
@@ -2245,8 +2245,8 @@ show_format_status_page(unsigned char * resp, int len, int show_pcb)
dStrHex((const char *)ucp, pl, 0);
break;
case 1: printf(" Grown defects during certification"); break;
- case 2: printf(" Total blocks relocated during format"); break;
- case 3: printf(" Total new blocks relocated"); break;
+ case 2: printf(" Total blocks reassigned during format"); break;
+ case 3: printf(" Total new blocks reassigned"); break;
case 4: printf(" Power on minutes since format"); break;
default:
printf(" Unknown Format status code = 0x%x\n", pc);
@@ -2364,14 +2364,15 @@ show_non_volatile_cache_page(unsigned char * resp, int len, int show_pcb)
static const char * bms_status[] = {
"no background scans active",
- "background scan is active",
+ "background medium scan is active",
"background pre-scan is active",
"background scan halted due to fatal error",
"background scan halted due to a vendor specific pattern of error",
"background scan halted due to medium formatted without P-List",
"background scan halted - vendor specific cause",
"background scan halted due to temperature out of range",
- "background scan halted until BM interval timer expires", /* 8 */
+ "background scan enabled, none active (waiting for BMS interval timer "
+ "to expire)", /* 8 */
};
static const char * reassign_status[] = {
diff --git a/src/sg_modes.c b/src/sg_modes.c
index 9343586a..432f5769 100644
--- a/src/sg_modes.c
+++ b/src/sg_modes.c
@@ -13,7 +13,7 @@
#include "sg_cmds_basic.h"
/*
-* Copyright (C) 2000-2008 D. Gilbert
+* Copyright (C) 2000-2009 D. Gilbert
* 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)
@@ -26,7 +26,7 @@
*/
-static char * version_str = "1.30 20080805";
+static char * version_str = "1.31 20090530";
#define DEF_ALLOC_LEN (1024 * 4)
#define DEF_6_ALLOC_LEN 252
@@ -577,7 +577,7 @@ static struct page_code_desc pc_desc_rbc[] = {
{0x6, 0x0, "RBC device parameters"},
};
-static struct page_code_desc pc_desc_adt[] = {
+static struct page_code_desc pc_desc_adc[] = {
/* {0xe, 0x0, "ADC device configuration"}, */
{0xe, 0x1, "Target device"},
{0xe, 0x2, "DT device primary port"},
@@ -618,8 +618,8 @@ mode_page_cs_table(int scsi_ptype, int * size)
*size = sizeof(pc_desc_rbc) / sizeof(pc_desc_rbc[0]);
return &pc_desc_rbc[0];
case PDT_ADC: /* automation device/interface */
- *size = sizeof(pc_desc_adt) / sizeof(pc_desc_adt[0]);
- return &pc_desc_adt[0];
+ *size = sizeof(pc_desc_adc) / sizeof(pc_desc_adc[0]);
+ return &pc_desc_adc[0];
}
*size = 0;
return NULL;
@@ -647,7 +647,7 @@ static struct page_code_desc pc_desc_t_sas[] = {
{0x19, 0x3, "SAS-2 phy"},
};
-static struct page_code_desc pc_desc_t_adt[] = {
+static struct page_code_desc pc_desc_t_adc[] = {
{0xe, 0x1, "Target device"},
{0xe, 0x2, "DT device primary port"},
{0xe, 0x3, "Logical unit"},
@@ -670,8 +670,8 @@ mode_page_transp_table(int t_proto, int * size)
*size = sizeof(pc_desc_t_sas) / sizeof(pc_desc_t_sas[0]);
return &pc_desc_t_sas[0];
case TPROTO_ADT:
- *size = sizeof(pc_desc_t_adt) / sizeof(pc_desc_t_adt[0]);
- return &pc_desc_t_adt[0];
+ *size = sizeof(pc_desc_t_adc) / sizeof(pc_desc_t_adc[0]);
+ return &pc_desc_t_adc[0];
}
*size = 0;
return NULL;
diff --git a/src/sg_vpd.c b/src/sg_vpd.c
index 949b3b77..c707de2d 100644
--- a/src/sg_vpd.c
+++ b/src/sg_vpd.c
@@ -52,7 +52,7 @@
*/
-static char * version_str = "0.32 20090228"; /* spc4r18 + sbc3r18 */
+static char * version_str = "0.33 20090530"; /* spc4r20 + sbc3r19 */
extern void svpd_enumerate_vendor(void);
extern int svpd_decode_vendor(int sg_fd, int num_vpd, int subvalue,
@@ -1299,7 +1299,7 @@ decode_b0_vpd(unsigned char * buff, int len, int do_hex, int pdt)
return;
}
switch (pdt) {
- case 0: case 4: case 7:
+ case 0: case 4: case 7: /* Block limits */
if (len < 16) {
fprintf(stderr, "Block limits VPD page length too "
"short=%d\n", len);
@@ -1327,6 +1327,16 @@ decode_b0_vpd(unsigned char * buff, int len, int do_hex, int pdt)
(buff[26] << 8) | buff[27];
printf(" Maximum unmap block descriptor count: %u\n", u);
}
+ if (len > 35) { /* added in sbc3r19 */
+ u = ((unsigned int)buff[28] << 24) | (buff[29] << 16) |
+ (buff[30] << 8) | buff[31];
+ printf(" Optimal unmap granularity: %u\n", u);
+ printf(" Unmap granularity alignment valid: %u\n",
+ !!(buff[32] & 0x80));
+ u = ((unsigned int)(buff[32] & 0x7f) << 24) | (buff[33] << 16) |
+ (buff[34] << 8) | buff[35];
+ printf(" Unmap granularity alignment: %u\n", u);
+ }
break;
case 1: case 8:
printf(" WORM=%d\n", !!(buff[4] & 0x1));