aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--doc/sg_logs.810
-rw-r--r--src/sg_ident.c5
-rw-r--r--src/sg_rmsn.c4
-rw-r--r--src/sg_rtpg.c10
-rw-r--r--src/sg_ses.c15
-rw-r--r--src/sg_stpg.c16
-rw-r--r--src/sg_vpd.c9
-rw-r--r--src/sg_vpd_vendor.c4
-rw-r--r--src/sgm_dd.c11
10 files changed, 47 insertions, 39 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ad74b33..46db64f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.33 [20111012] [svn: r418]
+Changelog for sg3_utils-1.33 [20111014] [svn: r419]
- win: change DataBufferOffset type per MSDN; caused
problem with 64 bit machines (buffered interface)
- sg_inq, sg_vpd: sync with spc4r32
diff --git a/doc/sg_logs.8 b/doc/sg_logs.8
index 858f975d..fbcca99e 100644
--- a/doc/sg_logs.8
+++ b/doc/sg_logs.8
@@ -1,4 +1,4 @@
-.TH SG_LOGS "8" "April 2011" "sg3_utils\-1.26" SG3_UTILS
+.TH SG_LOGS "8" "October 2011" "sg3_utils\-1.33" SG3_UTILS
.SH NAME
sg_logs \- access log pages with SCSI LOG SENSE command
.SH SYNOPSIS
@@ -205,7 +205,7 @@ the leading "0x", or as their decimal equivalents.]:
.br
0xb Last n deferred errors or asynchronous events
.br
-0xc Sequential access device (ssc\-2)
+0xc Logical block provisioning (sbc\-3) or Sequential access device (ssc\-2)
.br
0xd Temperature
.br
@@ -213,14 +213,20 @@ the leading "0x", or as their decimal equivalents.]:
.br
0x10 Self\-test results
.br
+0x11 Solid state media
+.br
0x15 Background scan results (sbc\-3)
.br
+0x16 ATA pass\-through results (sat\-3)
+.br
0x17 Non\-volatile cache (sbc\-3)
.br
0x18 Protocol specific port (SAS transport)
.br
0x19 General statistics and performance
.br
+0x1a Power condition transitions
+.br
0x2f Informational exceptions
.br
0x37 Seagate cache (vendor, disk)
diff --git a/src/sg_ident.c b/src/sg_ident.c
index 889c7e58..b39d39fd 100644
--- a/src/sg_ident.c
+++ b/src/sg_ident.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005-2010 Douglas Gilbert.
+ * Copyright (c) 2005-2011 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.
@@ -27,7 +27,7 @@
* DEVICE IDENTIFIER and SET DEVICE IDENTIFIER prior to spc4r07.
*/
-static char * version_str = "1.08 20100312";
+static char * version_str = "1.09 20111014";
#define ME "sg_ident: "
@@ -61,6 +61,7 @@ static void decode_ii(const unsigned char * iip, int ii_len, int itype,
n = write(STDOUT_FILENO, iip, ii_len);
#endif
}
+ n = n; /* suppress warning */
return;
}
if (0x7f == itype) { /* list of available information types */
diff --git a/src/sg_rmsn.c b/src/sg_rmsn.c
index 25ca4800..f107eb69 100644
--- a/src/sg_rmsn.c
+++ b/src/sg_rmsn.c
@@ -163,8 +163,10 @@ int main(int argc, char * argv[])
sn_len = (ucp[0] << 24) + (ucp[1] << 16) + (ucp[2] << 8) +
ucp[3];
if (raw) {
- if (sn_len > 0)
+ if (sn_len > 0) {
n = fwrite(ucp + 4, 1, sn_len, stdout);
+ n = n; /* suppress warning */
+ }
} else {
printf("Serial number:\n");
if (sn_len > 0)
diff --git a/src/sg_rtpg.c b/src/sg_rtpg.c
index 471bc292..d0d14039 100644
--- a/src/sg_rtpg.c
+++ b/src/sg_rtpg.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004-2010 Christophe Varoqui and Douglas Gilbert.
+ * Copyright (c) 2004-2011 Christophe Varoqui and 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.
@@ -26,7 +26,7 @@
* to the given SCSI device.
*/
-static char * version_str = "1.14 20100312";
+static char * version_str = "1.15 20111014";
#define REPORT_TGT_GRP_BUFF_LEN 1024
@@ -151,7 +151,7 @@ static void decode_tpgs_state(const int st)
int main(int argc, char * argv[])
{
- int sg_fd, k, j, off, res, c, report_len, tgt_port_count, trunc;
+ int sg_fd, k, j, off, res, c, report_len, tgt_port_count;
unsigned char reportTgtGrpBuff[REPORT_TGT_GRP_BUFF_LEN];
unsigned char * ucp;
int decode = 0;
@@ -229,7 +229,7 @@ int main(int argc, char * argv[])
}
memset(reportTgtGrpBuff, 0x0, sizeof(reportTgtGrpBuff));
- trunc = 0;
+ /* trunc = 0; */
#ifndef TEST_CODE
res = sg_ll_report_tgt_prt_grp(sg_fd, reportTgtGrpBuff,
@@ -245,7 +245,7 @@ int main(int argc, char * argv[])
(reportTgtGrpBuff[2] << 8) +
reportTgtGrpBuff[3] + 4;
if (report_len > (int)sizeof(reportTgtGrpBuff)) {
- trunc = 1;
+ /* trunc = 1; */
fprintf(stderr, " <<report too long for internal buffer,"
" output truncated\n");
report_len = (int)sizeof(reportTgtGrpBuff);
diff --git a/src/sg_ses.c b/src/sg_ses.c
index 4e85d719..b127ebb9 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -27,7 +27,7 @@
* commands tailored for SES (enclosure) devices.
*/
-static char * version_str = "1.58 20111012"; /* ses3r03 */
+static char * version_str = "1.59 20111014"; /* ses3r03 */
#define MX_ALLOC_LEN 4096
#define MX_ELEM_HDR 1024
@@ -2405,10 +2405,10 @@ process_join(int sg_fd, struct opts_t * op, int display)
unsigned char * ed_ucp;
unsigned char * ae_ucp;
unsigned char * t_ucp;
- const unsigned char * es_last_ucp;
- const unsigned char * ed_last_ucp;
+ /* const unsigned char * es_last_ucp; */
+ /* const unsigned char * ed_last_ucp; */
const unsigned char * ae_last_ucp;
- const unsigned char * t_last_ucp;
+ /* const unsigned char * t_last_ucp; */
const char * cp;
const char * enc_state_changed = " <<state of enclosure changed, "
"please try again>>\n";
@@ -2434,7 +2434,7 @@ process_join(int sg_fd, struct opts_t * op, int display)
return -1;
}
es_ucp = enc_stat_rsp + 8;
- es_last_ucp = enc_stat_rsp + enc_stat_rsp_len - 1;
+ /* es_last_ucp = enc_stat_rsp + enc_stat_rsp_len - 1; */
res = do_rec_diag(sg_fd, DPC_ELEM_DESC, elem_desc_rsp,
sizeof(elem_desc_rsp), op, &elem_desc_rsp_len);
@@ -2450,7 +2450,7 @@ process_join(int sg_fd, struct opts_t * op, int display)
return -1;
}
ed_ucp = elem_desc_rsp + 8;
- ed_last_ucp = elem_desc_rsp + elem_desc_rsp_len - 1;
+ /* ed_last_ucp = elem_desc_rsp + elem_desc_rsp_len - 1; */
} else {
elem_desc_rsp_len = 0;
ed_ucp = NULL;
@@ -2508,7 +2508,7 @@ process_join(int sg_fd, struct opts_t * op, int display)
return -1;
}
t_ucp = threshold_rsp + 8;
- t_last_ucp = threshold_rsp + threshold_rsp_len - 1;
+ /* t_last_ucp = threshold_rsp + threshold_rsp_len - 1; */
} else {
threshold_rsp_len = 0;
t_ucp = NULL;
@@ -2641,6 +2641,7 @@ process_join(int sg_fd, struct opts_t * op, int display)
if (! display) /* probably wanted join_arr[] built only */
return 0;
+ /* Display contents of join_arr */
dn_len = op->desc_name ? (int)strlen(op->desc_name) : 0;
for (k = 0, jrp = join_arr; ((k < MX_JOIN_ROWS) && jrp->enc_statp);
++k, ++jrp) {
diff --git a/src/sg_stpg.c b/src/sg_stpg.c
index 527c91b9..984bb0ea 100644
--- a/src/sg_stpg.c
+++ b/src/sg_stpg.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004-2010 Hannes Reinecke, Christophe Varoqui and Douglas Gilbert.
+ * Copyright (c) 2004-2011 Hannes Reinecke, Christophe Varoqui and 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.
@@ -24,7 +24,7 @@
* to the given SCSI device.
*/
-static char * version_str = "1.2 20100312";
+static char * version_str = "1.3 20111014";
#define TGT_GRP_BUFF_LEN 1024
#define MX_ALLOC_LEN (0xc000 + 0x80)
@@ -113,7 +113,7 @@ dStrRaw(const char* str, int len)
static int
decode_target_port(unsigned char * buff, int len, int *d_id, int *d_tpg)
{
- int c_set, piv, assoc, desig_type, i_len;
+ int c_set, assoc, desig_type, i_len;
int off, u;
const unsigned char * ucp;
const unsigned char * ip;
@@ -131,7 +131,7 @@ decode_target_port(unsigned char * buff, int len, int *d_id, int *d_tpg)
}
ip = ucp + 4;
c_set = (ucp[0] & 0xf);
- piv = ((ucp[1] & 0x80) ? 1 : 0);
+ /* piv = ((ucp[1] & 0x80) ? 1 : 0); */
assoc = ((ucp[1] >> 4) & 0x3);
desig_type = (ucp[1] & 0xf);
switch (desig_type) {
@@ -386,7 +386,7 @@ build_state_arr(const char * inp, int * state_arr, int * state_arr_len,
int
main(int argc, char * argv[])
{
- int sg_fd, k, off, res, c, report_len, tgt_port_count, trunc;
+ int sg_fd, k, off, res, c, report_len, tgt_port_count;
unsigned char reportTgtGrpBuff[TGT_GRP_BUFF_LEN];
unsigned char setTgtGrpBuff[TGT_GRP_BUFF_LEN];
unsigned char rsp_buff[MX_ALLOC_LEN + 2];
@@ -569,7 +569,7 @@ main(int argc, char * argv[])
}
memset(reportTgtGrpBuff, 0x0, sizeof(reportTgtGrpBuff));
- trunc = 0;
+ /* trunc = 0; */
res = sg_ll_report_tgt_prt_grp(sg_fd, reportTgtGrpBuff,
sizeof(reportTgtGrpBuff), 1, verbose);
@@ -580,7 +580,7 @@ main(int argc, char * argv[])
(reportTgtGrpBuff[2] << 8) +
reportTgtGrpBuff[3] + 4;
if (report_len > (int)sizeof(reportTgtGrpBuff)) {
- trunc = 1;
+ /* trunc = 1; */
fprintf(stderr, " <<report too long for internal buffer,"
" output truncated\n");
report_len = (int)sizeof(reportTgtGrpBuff);
@@ -641,7 +641,7 @@ main(int argc, char * argv[])
transition_tpgs_states(tgtGrpState, numgrp, portgroup, state);
memset(setTgtGrpBuff, 0x0, sizeof(setTgtGrpBuff));
- trunc = 0;
+ /* trunc = 0; */
encode_tpgs_states(setTgtGrpBuff, tgtGrpState, numgrp);
report_len = numgrp * 4 + 4;
diff --git a/src/sg_vpd.c b/src/sg_vpd.c
index a0d3db72..3b932979 100644
--- a/src/sg_vpd.c
+++ b/src/sg_vpd.c
@@ -30,7 +30,7 @@
*/
-static char * version_str = "0.54 20111007"; /* spc4r32 + sbc3r29 */
+static char * version_str = "0.55 20111014"; /* spc4r32 + sbc3r29 */
extern void svpd_enumerate_vendor(void);
extern int svpd_decode_vendor(int sg_fd, int num_vpd, int subvalue,
@@ -1605,10 +1605,10 @@ svpd_unable_to_decode(int sg_fd, int num_vpd, int subvalue, int maxlen,
int do_hex, int do_raw, int do_long, int do_quiet,
int verbose)
{
- int len, t, res;
+ int len, res;
int alloc_len = maxlen;
- t = do_quiet; /* suppress warning */
+ do_quiet = do_quiet; /* suppress warning */
if ((! do_hex) && (! do_raw))
printf("Only hex output supported\n");
if (!do_raw) {
@@ -2544,7 +2544,6 @@ main(int argc, char * argv[])
int do_raw = 0;
int do_verbose = 0;
int ret = 0;
- int req_pdt = -1;
int subvalue = 0;
while (1) {
@@ -2635,7 +2634,6 @@ main(int argc, char * argv[])
}
num_vpd = vnp->value;
subvalue = vnp->subvalue;
- req_pdt = vnp->pdt;
} else {
cp = strchr(page_str, ',');
num_vpd = sg_get_num_nomult(page_str);
@@ -2664,7 +2662,6 @@ main(int argc, char * argv[])
}
if (do_ident) {
num_vpd = VPD_DEVICE_ID;
- req_pdt = -1;
if (do_ident > 1) {
if (0 == do_long)
++do_quiet;
diff --git a/src/sg_vpd_vendor.c b/src/sg_vpd_vendor.c
index f2716dba..e33f0745 100644
--- a/src/sg_vpd_vendor.c
+++ b/src/sg_vpd_vendor.c
@@ -629,12 +629,12 @@ svpd_decode_vendor(int sg_fd, int num_vpd, int subvalue, int maxlen,
int do_hex, int do_raw, int do_long, int do_quiet,
int verbose)
{
- int len, t, res;
+ int len, res;
char name[64];
const struct svpd_values_name_t * vnp;
int alloc_len = maxlen;
- t = do_long; /* suppress warning */
+ do_long = do_long; /* suppress warning */
vnp = svpd_get_v_detail(num_vpd, subvalue, -1);
if (vnp && vnp->name)
strcpy(name, vnp->name);
diff --git a/src/sgm_dd.c b/src/sgm_dd.c
index 1e9ad780..5eaa7713 100644
--- a/src/sgm_dd.c
+++ b/src/sgm_dd.c
@@ -33,7 +33,7 @@
/* A utility program for copying files. Specialised for "files" that
* represent devices that understand the SCSI command set.
*
-* Copyright (C) 1999 - 2007 D. Gilbert and P. Allworth
+* Copyright (C) 1999 - 2011 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)
@@ -64,9 +64,9 @@
/* #define SG_WANT_SHARED_MMAP_IO 1 */
#ifdef SG_WANT_SHARED_MMAP_IO
-static char * version_str = "1.35 20080205 shared_mmap";
+static char * version_str = "1.36 20111014 shared_mmap";
#else
-static char * version_str = "1.35 20080205";
+static char * version_str = "1.36 20111014";
#endif
#define DEF_BLOCK_SIZE 512
@@ -843,9 +843,10 @@ main(int argc, char * argv[])
scsi_cdbsz_in = sg_get_num(buf);
scsi_cdbsz_out = scsi_cdbsz_in;
cdbsz_given = 1;
- } else if (0 == strcmp(key,"coe"))
+ } else if (0 == strcmp(key,"coe")) {
do_coe = sg_get_num(buf); /* dummy, just accept + ignore */
- else if (0 == strcmp(key,"count")) {
+ do_coe = do_coe; /* suppress warning */
+ } else if (0 == strcmp(key,"count")) {
if (0 != strcmp("-1", buf)) {
dd_count = sg_get_llnum(buf);
if (-1LL == dd_count) {