Hello community, here is the log from the commit of package sdparm for openSUSE:Factory checked in at Wed May 25 09:44:39 CEST 2011.
-------- --- sdparm/sdparm.changes 2010-08-13 12:12:33.000000000 +0200 +++ /mounts/work_src_done/STABLE/sdparm/sdparm.changes 2011-05-24 17:37:40.000000000 +0200 @@ -1,0 +2,18 @@ +Tue May 24 17:31:45 CEST 2011 - [email protected] + +- Update to version 1.06: + + allow upper and lower case in field, (mode and vpd) page, + vendor, transport or command matching + + control mode page: add ATMPE and RWWP fields (spc4r27) + + extended inquiry vpd page: add extended self test completion + minutes field (spc4r27) + + power control mode page: PM_BG_PRECEDENCE field (spc4r24) + - FIDCPC, FSBCPC, FSTCPC fields (spc4r25) + + sbc3r25 renames 'thin' provisioning' to 'logical block + provisioning'; changes mode+vpd page and field names + - add Application tag mode page + - add SITPUA bit to logical block provisioning mode page + + fix '-eal' problem with vendor pages + + point svn:externals to rev 334 of sg3_utils + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- sdparm-1.05.tar.bz2 New: ---- sdparm-1.06.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sdparm.spec ++++++ --- /var/tmp/diff_new_pack.N6Dore/_old 2011-05-25 09:44:12.000000000 +0200 +++ /var/tmp/diff_new_pack.N6Dore/_new 2011-05-25 09:44:12.000000000 +0200 @@ -1,7 +1,7 @@ # -# spec file for package sdparm (Version 1.05) +# spec file for package sdparm # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ Name: sdparm -Version: 1.05 +Version: 1.06 Release: 1 License: BSD3c Summary: List or change SCSI disk parameters ++++++ sdparm-1.05.tar.bz2 -> sdparm-1.06.tar.bz2 ++++++ ++++ 12153 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/ChangeLog new/sdparm-1.06/ChangeLog --- old/sdparm-1.05/ChangeLog 2010-04-13 15:43:53.000000000 +0200 +++ new/sdparm-1.06/ChangeLog 2010-10-31 20:29:24.000000000 +0100 @@ -2,6 +2,21 @@ the rpm spec file: sdparm.spec ; the debian/changelog file; and the configure.ac file (in the AC_INIT item). +ChangeLog for sdparm-1.06 [20101031] [svn: r166] + - allow upper and lower case in field, (mode and vpd) page, + vendor, transport or command matching + - control mode page: add ATMPE and RWWP fields (spc4r27) + - extended inquiry vpd page: add extended self test + completion minutes field (spc4r27) + - power control mode page: PM_BG_PRECEDENCE field (spc4r24) + - FIDCPC, FSBCPC, FSTCPC fields (spc4r25) + - sbc3r25 renames 'thin' provisioning' to 'logical block + provisioning'; changes mode+vpd page and field names + - add Application tag mode page + - add SITPUA bit to logical block provisioning mode page + - fix '-eal' problem with vendor pages + - point svn:externals to rev 334 of sg3_utils + ChangeLog for sdparm-1.05 [20100413] [svn: r149] - add '--readonly' option especially for '-C start' and '-C stop' on ATA disks. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/README new/sdparm-1.06/README --- old/sdparm-1.05/README 2010-04-13 15:43:53.000000000 +0200 +++ new/sdparm-1.06/README 2010-10-31 20:29:24.000000000 +0100 @@ -230,4 +230,4 @@ Douglas Gilbert -13th April 2010 +31st October 2010 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/config.h.in new/sdparm-1.06/config.h.in --- old/sdparm-1.05/config.h.in 2010-03-29 03:31:06.000000000 +0200 +++ new/sdparm-1.06/config.h.in 2010-09-21 03:20:12.000000000 +0200 @@ -30,6 +30,9 @@ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/configure.ac new/sdparm-1.06/configure.ac --- old/sdparm-1.05/configure.ac 2010-02-11 22:36:08.000000000 +0100 +++ new/sdparm-1.06/configure.ac 2010-09-21 03:13:50.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT(sdparm, 1.05, [email protected]) +AC_INIT(sdparm, 1.06, [email protected]) AM_INIT_AUTOMAKE AM_MAINTAINER_MODE @@ -47,12 +47,12 @@ AC_DEFINE_UNQUOTED(SG_LIB_OSF1, 1, [sdparm on Tru64 UNIX]) AC_SUBST([os_libs], ['']) ;; *-*-cygwin*) - AC_SUBST([os_deps], ['sdparm_wscan.o sg_pt_win32.o']) + AC_SUBST([os_deps], ['sg_pt_win32.o']) AC_DEFINE_UNQUOTED(SG_LIB_WIN32, 1, [sdparm on Win32]) AC_DEFINE_UNQUOTED(WIN32_SPT_DIRECT, 1, [allow large buffers, aligned?]) AC_SUBST([os_libs], ['']) ;; *-*-mingw*) - AC_SUBST([os_deps], ['sdparm_wscan.o sg_pt_win32.o']) + AC_SUBST([os_deps], ['sg_pt_win32.o']) AC_DEFINE_UNQUOTED(SG_LIB_WIN32, 1, [sdparm on Win32]) AC_DEFINE_UNQUOTED(SG_LIB_MINGW, 1, [also MinGW environment]) AC_DEFINE_UNQUOTED(WIN32_SPT_DIRECT, 1, [allow large buffers, aligned?]) @@ -63,6 +63,14 @@ AC_SUBST([os_libs], ['']) ;; esac +# Define platform-specific symbol. +AM_CONDITIONAL(OS_FREEBSD, [echo $host_os | grep 'freebsd' > /dev/null]) +AM_CONDITIONAL(OS_LINUX, [echo $host_os | grep '^linux' > /dev/null]) +AM_CONDITIONAL(OS_OSF, [echo $host_os | grep '^osf' > /dev/null]) +AM_CONDITIONAL(OS_SOLARIS, [echo $host_os | grep '^solaris' > /dev/null]) +AM_CONDITIONAL(OS_WIN32_MINGW, [echo $host_os | grep '^mingw' > /dev/null]) +AM_CONDITIONAL(OS_WIN32_CYGWIN, [echo $host_os | grep '^cygwin' > /dev/null]) + AC_ARG_ENABLE([no-linux-bsg], AC_HELP_STRING([--enable-no-linux-bsg], [ignore linux bsg (sgv4) if present]), AC_DEFINE_UNQUOTED(IGNORE_LINUX_BSG, 1, [ignore linux bsg], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/debian/changelog new/sdparm-1.06/debian/changelog --- old/sdparm-1.05/debian/changelog 2010-04-13 15:43:53.000000000 +0200 +++ new/sdparm-1.06/debian/changelog 2010-10-31 20:29:24.000000000 +0100 @@ -1,3 +1,9 @@ +sdparm (1.06-0.1) unstable; urgency=low + + * see ChangeLog + + -- Douglas Gilbert <[email protected]> Sun, 31 Oct 2010 15:00:00 -0400 + sdparm (1.05-0.1) unstable; urgency=low * see ChangeLog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/doc/sdparm.8 new/sdparm-1.06/doc/sdparm.8 --- old/sdparm-1.05/doc/sdparm.8 2010-02-09 22:19:26.000000000 +0100 +++ new/sdparm-1.06/doc/sdparm.8 2010-08-20 01:35:21.000000000 +0200 @@ -1,4 +1,4 @@ -.TH SDPARM "8" "February 2010" "sdparm\-1.05" SDPARM +.TH SDPARM "8" "July 2010" "sdparm\-1.06" SDPARM .SH NAME sdparm \- access SCSI modes pages; read VPD pages; send simple SCSI commands. .SH SYNOPSIS @@ -301,6 +301,13 @@ there is a SCSI disk at /dev/sda then 'sdparm /dev/sda' will work in both the lk 2.6 and lk 2.4 series. However if there is an ATAPI cd/dvd drive at /dev/hdc then 'sdparm /dev/hdc' will only work in the lk 2.6 series. +.PP +In the Linux 2.6 series, especially with ATA disks, using sdparm to +stop (spin down) a disk may not be sufficient and other mechanisms will +start the disk again some time later. The user might additionally mark +the disk as "offline" with 'echo offline > /sys/block/sda/device/state' +where sda is the block name of the disk. To restart the disk "offline" +can be replaced with "running". .SH PARAMETERS In their simplest form the \fI\-\-clear\fR=, \fI\-\-get\fR= and \fI\-\-set\fR= options (or their short forms) take an acronym_name such @@ -516,7 +523,7 @@ stops the medium (i.e. spins it down). Harmless if medium has already been stopped. See 'eject' command for supported device types. If the \fIDEVICE\fR is an ATA disk in Linux the '\-\-readonly' -option may be required. +option may be required. See the NOTES section above. .TP sync sends a SYNCHRONIZE CACHE command. The device should diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/include/sg_cmds_extra.h new/sdparm-1.06/include/sg_cmds_extra.h --- old/sdparm-1.05/include/sg_cmds_extra.h 2010-04-01 06:17:21.000000000 +0200 +++ new/sdparm-1.06/include/sg_cmds_extra.h 2010-09-07 03:02:11.000000000 +0200 @@ -167,6 +167,14 @@ extern int sg_ll_set_tgt_prt_grp(int sg_fd, void * paramp, int param_len, int noisy, int verbose); +/* Invokes a SCSI REPORT REFERRALS command. Return of 0 -> success, + * SG_LIB_CAT_INVALID_OP -> Report Referrals not supported, + * SG_LIB_CAT_ILLEGAL_REQ -> bad field in cdb, SG_LIB_CAT_ABORTED_COMMAND, + * SG_LIB_CAT_UNIT_ATTENTION, -1 -> other failure */ +extern int sg_ll_report_referrals(int sg_fd, uint64_t start_llba, int one_seg, + void * resp,int mx_resp_len, int noisy, + int verbose); + /* Invokes a SCSI SEND DIAGNOSTIC command. Foreground, extended self tests can * take a long time, if so set long_duration flag. Return of 0 -> success, * SG_LIB_CAT_INVALID_OP -> Send diagnostic not supported, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/lib/sg_cmds_extra.c new/sdparm-1.06/lib/sg_cmds_extra.c --- old/sdparm-1.05/lib/sg_cmds_extra.c 2010-04-01 06:17:21.000000000 +0200 +++ new/sdparm-1.06/lib/sg_cmds_extra.c 2010-09-07 03:02:11.000000000 +0200 @@ -79,6 +79,7 @@ #define SET_IDENTIFYING_INFORMATION_SA 0x6 #define SET_TGT_PRT_GRP_SA 0xa #define WRITE_LONG_16_SA 0x11 +#define REPORT_REFERRALS_SA 0x13 /* Invokes a SCSI GET LBA STATUS command (SBC). Returns 0 -> success, @@ -268,6 +269,80 @@ if (-1 == ret) ; else if (-2 == ret) { + switch (sense_cat) { + case SG_LIB_CAT_INVALID_OP: + case SG_LIB_CAT_ILLEGAL_REQ: + case SG_LIB_CAT_UNIT_ATTENTION: + case SG_LIB_CAT_ABORTED_COMMAND: + ret = sense_cat; + break; + case SG_LIB_CAT_RECOVERED: + case SG_LIB_CAT_NO_SENSE: + ret = 0; + break; + default: + ret = -1; + break; + } + } else + ret = 0; + destruct_scsi_pt_obj(ptvp); + return ret; +} + +/* Invokes a SCSI REPORT REFERRALS command. Return of 0 -> success, + * SG_LIB_CAT_INVALID_OP -> Report Referrals not supported, + * SG_LIB_CAT_ILLEGAL_REQ -> bad field in cdb, SG_LIB_CAT_ABORTED_COMMAND, + * SG_LIB_CAT_UNIT_ATTENTION, -1 -> other failure */ +int +sg_ll_report_referrals(int sg_fd, uint64_t start_llba, int one_seg, void * resp, + int mx_resp_len, int noisy, int verbose) +{ + int k, res, ret, sense_cat; + unsigned char repRefCmdBlk[SERVICE_ACTION_IN_16_CMDLEN] = + {SERVICE_ACTION_IN_16_CMD, REPORT_REFERRALS_SA, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + unsigned char sense_b[SENSE_BUFF_LEN]; + struct sg_pt_base * ptvp; + + repRefCmdBlk[2] = (start_llba >> 56) & 0xff; + repRefCmdBlk[3] = (start_llba >> 48) & 0xff; + repRefCmdBlk[4] = (start_llba >> 40) & 0xff; + repRefCmdBlk[5] = (start_llba >> 32) & 0xff; + repRefCmdBlk[6] = (start_llba >> 24) & 0xff; + repRefCmdBlk[7] = (start_llba >> 16) & 0xff; + repRefCmdBlk[8] = (start_llba >> 8) & 0xff; + repRefCmdBlk[9] = start_llba & 0xff; + repRefCmdBlk[10] = (mx_resp_len >> 24) & 0xff; + repRefCmdBlk[11] = (mx_resp_len >> 16) & 0xff; + repRefCmdBlk[12] = (mx_resp_len >> 8) & 0xff; + repRefCmdBlk[13] = mx_resp_len & 0xff; + repRefCmdBlk[14] = one_seg & 0x1; + if (NULL == sg_warnings_strm) + sg_warnings_strm = stderr; + if (verbose) { + fprintf(sg_warnings_strm, " report referrals cdb: "); + for (k = 0; k < SERVICE_ACTION_IN_16_CMDLEN; ++k) + fprintf(sg_warnings_strm, "%02x ", repRefCmdBlk[k]); + fprintf(sg_warnings_strm, "\n"); + } + + ptvp = construct_scsi_pt_obj(); + if (NULL == ptvp) { + fprintf(sg_warnings_strm, "report target port groups: out of " + "memory\n"); + return -1; + } + set_scsi_pt_cdb(ptvp, repRefCmdBlk, sizeof(repRefCmdBlk)); + set_scsi_pt_sense(ptvp, sense_b, sizeof(sense_b)); + set_scsi_pt_data_in(ptvp, (unsigned char *)resp, mx_resp_len); + res = do_scsi_pt(ptvp, sg_fd, DEF_PT_TIMEOUT, verbose); + ret = sg_cmds_process_resp(ptvp, "report referrals", res, + mx_resp_len, sense_b, noisy, verbose, + &sense_cat); + if (-1 == ret) + ; + else if (-2 == ret) { switch (sense_cat) { case SG_LIB_CAT_INVALID_OP: case SG_LIB_CAT_ILLEGAL_REQ: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/lib/sg_lib.c new/sdparm-1.06/lib/sg_lib.c --- old/sdparm-1.05/lib/sg_lib.c 2010-04-07 00:49:03.000000000 +0200 +++ new/sdparm-1.06/lib/sg_lib.c 2010-05-17 15:08:13.000000000 +0200 @@ -1111,7 +1111,8 @@ void dStrHex(const char* str, int len, int no_ascii) { - const char* p = str; + const char * p = str; + const char * formatstr; unsigned char c; char buff[82]; int a = 0; @@ -1123,6 +1124,7 @@ if (len <= 0) return; + formatstr = (0 == no_ascii) ? "%.76s\n" : "%.56s\n"; memset(buff, ' ', 80); buff[80] = '\0'; if (no_ascii < 0) { @@ -1134,13 +1136,15 @@ sprintf(&buff[bpos], "%.2x", (int)(unsigned char)c); buff[bpos + 2] = ' '; if ((k > 0) && (0 == ((k + 1) % 16))) { - printf("%.60s\n", buff); + printf(formatstr, buff); bpos = bpstart; memset(buff, ' ', 80); } } - if (bpos > bpstart) - printf("%.60s\n", buff); + if (bpos > bpstart) { + buff[bpos + 2] = '\0'; + printf("%s\n", buff); + } return; } /* no_ascii>=0, start each line with address (offset) */ @@ -1162,7 +1166,7 @@ buff[cpos++] = c; } if (cpos > (cpstart + 15)) { - printf("%.76s\n", buff); + printf(formatstr, buff); bpos = bpstart; cpos = cpstart; a += 16; @@ -1171,8 +1175,10 @@ buff[k + 1] = ' '; } } - if (cpos > cpstart) - printf("%.76s\n", buff); + if (cpos > cpstart) { + buff[cpos] = '\0'; + printf("%s\n", buff); + } } /* Output to ASCII-Hex bytes to 'b' not to exceed 'b_len' characters. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/lib/sg_lib_data.c new/sdparm-1.06/lib/sg_lib_data.c --- old/sdparm-1.05/lib/sg_lib_data.c 2010-04-01 06:17:21.000000000 +0200 +++ new/sdparm-1.06/lib/sg_lib_data.c 2010-10-31 20:26:41.000000000 +0100 @@ -15,7 +15,7 @@ #endif -const char * sg_lib_version_str = "1.58 20100329"; /* spc-4 rev 23 */ +const char * sg_lib_version_str = "1.63 20101028"; /* spc-4 rev 27 */ struct sg_lib_value_name_t sg_lib_normal_opcodes[] = { {0, 0, "Test Unit Ready"}, @@ -283,6 +283,7 @@ {0xb, 0, "Write(32)"}, {0xc, 0, "Write an verify(32)"}, {0xd, 0, "Write same(32)"}, + {0xe, 0, "Orwrite(32)"}, /* added sbc3r25 */ {0x1800, 0, "Receive credential"}, {0x8801, 0, "Format OSD (osd)"}, {0x8802, 0, "Create (osd)"}, @@ -379,6 +380,7 @@ {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 +417,7 @@ {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"}, @@ -467,6 +470,7 @@ {0x10,0x01,"Logical block guard check failed"}, {0x10,0x02,"Logical block application tag check failed"}, {0x10,0x03,"Logical block reference tag check failed"}, + {0x10,0x04,"Logical block protection error on recover buffered data"}, {0x11,0x00,"Unrecovered read error"}, {0x11,0x01,"Read retries exhausted"}, {0x11,0x02,"Error too long to correct"}, @@ -637,6 +641,7 @@ {0x2C,0x09,"Previous reservation conflict status"}, {0x2C,0x0A,"Partition or collection contains user objects"}, {0x2C,0x0B,"Not reserved"}, + {0x2C,0x0C,"ORWRITE generation does not match"}, {0x2D,0x00,"Overwrite error on update in place"}, {0x2E,0x00,"Insufficient time for operation"}, {0x2F,0x00,"Commands cleared by another initiator"}, @@ -793,6 +798,10 @@ {0x53,0x02,"Medium removal prevented"}, {0x53,0x03,"Medium removal prevented by data transfer element"}, {0x53,0x04,"Medium thread or unthread failure"}, + {0x53,0x05,"Volume identifier invalid"}, + {0x53,0x06,"Volume identifier missing"}, + {0x53,0x07,"Duplicate volume identifier"}, + {0x53,0x08,"Element status unknown"}, {0x54,0x00,"SCSI to host system interface failure"}, {0x55,0x00,"System resource failure"}, {0x55,0x01,"System buffer full"}, @@ -1053,12 +1062,12 @@ "processor", /* often SAF-TE (seldom scanner) device */ "write once optical disk", /* 5 */ "cd/dvd", - "scanner", + "scanner", /* obsolete */ "optical memory device", "medium changer", - "communications", - /* 0xa */ "graphics [0xa]", - "graphics [0xb]", + "communications", /* obsolete */ + /* 0xa */ "graphics [0xa]", /* obsolete */ + "graphics [0xb]", /* obsolete */ "storage array controller", "enclosure services device", "simplified direct access device", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/lib/sg_pt_common.c new/sdparm-1.06/lib/sg_pt_common.c --- old/sdparm-1.05/lib/sg_pt_common.c 2010-03-21 19:06:58.000000000 +0100 +++ new/sdparm-1.06/lib/sg_pt_common.c 2010-08-20 01:33:02.000000000 +0200 @@ -14,7 +14,7 @@ #endif -static const char * scsi_pt_version_str = "2.05 20100321"; +static const char * scsi_pt_version_str = "2.06 20100812"; const char * scsi_pt_version() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/lib/sg_pt_linux.c new/sdparm-1.06/lib/sg_pt_linux.c --- old/sdparm-1.05/lib/sg_pt_linux.c 2010-03-26 23:49:04.000000000 +0100 +++ new/sdparm-1.06/lib/sg_pt_linux.c 2010-08-26 18:37:13.000000000 +0200 @@ -5,7 +5,7 @@ * license that can be found in the BSD_LICENSE file. */ -/* sg_pt_linux version 1.13 20100321 */ +/* sg_pt_linux version 1.15 20100827 */ #include <stdio.h> #include <stdlib.h> @@ -324,9 +324,9 @@ memset(ptp->io_hdr.sbp, 0, ptp->io_hdr.mx_sb_len); if (ioctl(fd, SG_IO, &ptp->io_hdr) < 0) { ptp->os_err = errno; - if (verbose) - fprintf(sg_warnings_strm, "ioctl(SG_IO) failed with os_err " - "(errno) = %d\n", ptp->os_err); + if (verbose > 1) + fprintf(sg_warnings_strm, "ioctl(SG_IO) failed: %s (errno=%d)\n", + strerror(ptp->os_err), ptp->os_err); return -ptp->os_err; } return 0; @@ -603,8 +603,15 @@ ptp = (struct sg_pt_linux_scsi *) calloc(1, sizeof(struct sg_pt_linux_scsi)); - if (ptp) + if (ptp) { ptp->io_hdr.guard = 'Q'; +#ifdef BSG_PROTOCOL_SCSI + ptp->io_hdr.protocol = BSG_PROTOCOL_SCSI; +#endif +#ifdef BSG_SUB_PROTOCOL_SCSI_CMD + ptp->io_hdr.subprotocol = BSG_SUB_PROTOCOL_SCSI_CMD; +#endif + } return (struct sg_pt_base *)ptp; } @@ -625,6 +632,12 @@ if (ptp) { memset(ptp, 0, sizeof(struct sg_pt_linux_scsi)); ptp->io_hdr.guard = 'Q'; +#ifdef BSG_PROTOCOL_SCSI + ptp->io_hdr.protocol = BSG_PROTOCOL_SCSI; +#endif +#ifdef BSG_SUB_PROTOCOL_SCSI_CMD + ptp->io_hdr.subprotocol = BSG_SUB_PROTOCOL_SCSI_CMD; +#endif } } @@ -908,9 +921,9 @@ /* Finally do the v3 SG_IO ioctl */ if (ioctl(fd, SG_IO, &v3_hdr) < 0) { ptp->os_err = errno; - if (verbose) - fprintf(sg_warnings_strm, "ioctl(SG_IO v3) failed with os_err " - "(errno) = %d\n", ptp->os_err); + if (verbose > 1) + fprintf(sg_warnings_strm, "ioctl(SG_IO v3) failed: %s " + "(errno=%d)\n", strerror(ptp->os_err), ptp->os_err); return -ptp->os_err; } ptp->io_hdr.device_status = (__u32)v3_hdr.status; @@ -952,9 +965,9 @@ if (fstat(fd, &a_stat) < 0) { ptp->os_err = errno; - if (verbose) - fprintf(sg_warnings_strm, "fstat() failed with os_err " - "(errno) = %d\n", ptp->os_err); + if (verbose > 1) + fprintf(sg_warnings_strm, "fstat() failed: %s (errno=%d)\n", + strerror(ptp->os_err), ptp->os_err); return -ptp->os_err; } #ifdef HAVE_LINUX_KDEV_T_H @@ -982,9 +995,9 @@ } if (ioctl(fd, SG_IO, &ptp->io_hdr) < 0) { ptp->os_err = errno; - if (verbose) - fprintf(sg_warnings_strm, "ioctl(SG_IO v4) failed with os_err " - "(errno) = %d\n", ptp->os_err); + if (verbose > 1) + fprintf(sg_warnings_strm, "ioctl(SG_IO v4) failed: %s " + "(errno=%d)\n", strerror(ptp->os_err), ptp->os_err); return -ptp->os_err; } return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/missing new/sdparm-1.06/missing --- old/sdparm-1.05/missing 2010-03-29 03:31:06.000000000 +0200 +++ new/sdparm-1.06/missing 2010-09-21 03:20:12.000000000 +0200 @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2006-05-10.23 +scriptversion=2009-04-28.21; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify @@ -18,9 +18,7 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. +# along with this program. If not, see <http://www.gnu.org/licenses/>. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -89,6 +87,9 @@ tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + Send bug reports to <[email protected]>." exit $? ;; @@ -106,15 +107,22 @@ esac +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect -# the program). +# the program). This is about non-GNU programs, so use $1 not +# $program. case $1 in - lex|yacc) + lex*|yacc*) # Not GNU programs, they don't have --version. ;; - tar) + tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 @@ -138,7 +146,7 @@ # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. -case $1 in +case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if @@ -148,7 +156,7 @@ touch aclocal.m4 ;; - autoconf) + autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the @@ -157,7 +165,7 @@ touch configure ;; - autoheader) + autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want @@ -187,7 +195,7 @@ while read f; do touch "$f"; done ;; - autom4te) + autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the @@ -210,7 +218,7 @@ fi ;; - bison|yacc) + bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package @@ -240,7 +248,7 @@ fi ;; - lex|flex) + lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package @@ -263,7 +271,7 @@ fi ;; - help2man) + help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the @@ -277,11 +285,11 @@ else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" - exit 1 + exit $? fi ;; - makeinfo) + makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file @@ -310,7 +318,7 @@ touch $file ;; - tar) + tar*) shift # We have already tried tar in the generic part. @@ -363,5 +371,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" # End: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/sdparm.spec new/sdparm-1.06/sdparm.spec --- old/sdparm-1.05/sdparm.spec 2010-04-13 15:43:53.000000000 +0200 +++ new/sdparm-1.06/sdparm.spec 2010-10-31 20:29:24.000000000 +0100 @@ -1,5 +1,5 @@ %define name sdparm -%define version 1.05 +%define version 1.06 %define release 1 Summary: List or change SCSI disk parameters @@ -56,6 +56,9 @@ %{_mandir}/man8/* %changelog +* Sun Oct 31 2010 - dgilbert at interlog dot com +- track recent spc4 and sbc3 drafts + * sdparm-1.06 * Tue Apr 13 2010 - dgilbert at interlog dot com - update SAS Enhanced phy control mpage (spl-r04); add '--readonly' * sdparm-1.05 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/src/Makefile.am new/sdparm-1.06/src/Makefile.am --- old/sdparm-1.05/src/Makefile.am 2010-03-29 03:31:06.000000000 +0200 +++ new/sdparm-1.06/src/Makefile.am 2010-09-21 03:13:50.000000000 +0200 @@ -1,9 +1,7 @@ bin_PROGRAMS = sdparm -# INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/include/scsi - -AM_CFLAGS = -Wall -W -# AM_CFLAGS = -Wall -W -pedantic -std=c99 +AM_CFLAGS = -I$(top_srcdir)/include -Wall -W +# AM_CFLAGS = -I$(top_srcdir)/include -Wall -W -pedantic -std=c99 sdparm_SOURCES = sdparm.c \ sdparm.h \ @@ -13,6 +11,15 @@ sdparm_vpd.c \ sdparm_cmd.c +if OS_WIN32_MINGW +sdparm_SOURCES += sdparm_wscan.c +endif + +if OS_WIN32_CYGWIN +sdparm_SOURCES += sdparm_wscan.c +endif + + sglib_SOURCES = ../lib/sg_lib.c \ ../include/sg_lib.h \ ../lib/sg_lib_data.c \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/src/sdparm.c new/sdparm-1.06/src/sdparm.c --- old/sdparm-1.05/src/sdparm.c 2010-04-13 15:43:53.000000000 +0200 +++ new/sdparm-1.06/src/sdparm.c 2010-10-31 20:29:24.000000000 +0100 @@ -77,7 +77,7 @@ #define MAX_DEV_NAMES 256 -static char * version_str = "1.05 20100413 [svn: r149]"; +static char * version_str = "1.06 20101031 [svn: r166]"; static struct option long_options[] = { @@ -265,6 +265,7 @@ } printf("\t%s\n", p); } + /* Enumerate mode page items. Reading from internal dataset. */ static void enumerate_mitems(int pn, int spn, int pdt, @@ -2261,7 +2262,7 @@ printf("\n"); printf("Mode pages for %s vendor:\n", ccp); t_opts.transport = -1; - t_opts.vendor = -k; + t_opts.vendor = k; enumerate_mitems(pn, spn, pdt, &t_opts); } } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/src/sdparm.h new/sdparm-1.06/src/sdparm.h --- old/sdparm-1.05/src/sdparm.h 2010-04-01 06:21:56.000000000 +0200 +++ new/sdparm-1.06/src/sdparm.h 2010-10-31 20:29:24.000000000 +0100 @@ -63,8 +63,9 @@ #define MSP_ADC_DT_DPP 0x2 #define MSP_ADC_LU 0x3 #define MSP_ADC_TD_SN 0x4 -#define MSP_SBC_THIN_PROV 0x2 +#define MSP_SBC_LB_PROV 0x2 #define MSP_SSC_CDP 0xf0 +#define MSP_SBC_APP_TAG 0xf0 #define MODE_DATA_OVERHEAD 128 #define EBUFF_SZ 256 @@ -95,7 +96,7 @@ #define VPD_MAN_ASS_SN 0xb1 /* SSC-3, ADC-2 */ #define VPD_SECURITY_TOKEN 0xb1 /* OSD */ #define VPD_TA_SUPPORTED 0xb2 /* SSC-3 */ -#define VPD_THIN_PROVISIONING 0xb2 /* SBC-3 */ +#define VPD_LB_PROVISIONING 0xb2 /* SBC-3 */ #define VPD_REFERRALS 0xb3 #define VPD_AUTOMATION_DEV_SN 0xb3 /* SSC-3 */ #define VPD_DTDE_ADDRESS 0xb4 /* SSC-4 */ @@ -319,6 +320,7 @@ char * buff); extern char * sdp_get_pdt_doc_str(int version, int buff_len, char * buff); +extern int sdp_strcase_eq(const char * s1p, const char * s2p); /* * Declarations for functions found in sdparm_vpd.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/src/sdparm_access.c new/sdparm-1.06/src/sdparm_access.c --- old/sdparm-1.05/src/sdparm_access.c 2009-08-27 19:28:11.000000000 +0200 +++ new/sdparm-1.06/src/sdparm_access.c 2010-06-02 05:49:00.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2009 Douglas Gilbert. + * Copyright (c) 2005-2010 Douglas Gilbert. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,6 +39,30 @@ * sdparm_data.c */ +/* Returns 1 if strings equal (same length, characters same or only differ + * by case), else returns 0. Assumes 7 bit ASCII (English alphabet). */ +int +sdp_strcase_eq(const char * s1p, const char * s2p) +{ + int c1, c2; + + do { + c1 = *s1p++; + c2 = *s2p++; + if (c1 != c2) { + if (c2 >= 'a') + c2 = toupper(c2); + else if (c1 >= 'a') + c1 = toupper(c1); + else + return 0; + if (c1 != c2) + return 0; + } + } while (c1); + return 1; +} + int sdp_get_mp_len(unsigned char * mp) { @@ -141,7 +165,7 @@ return NULL; for ( ; mpp->acron; ++mpp) { - if (0 == strcmp(mpp->acron, ap)) + if (sdp_strcase_eq(mpp->acron, ap)) return mpp; } return NULL; @@ -174,7 +198,7 @@ const struct sdparm_vpd_page_t * vpp; for (vpp = sdparm_vpd_pg; vpp->acron; ++vpp) { - if (0 == strcmp(vpp->acron, ap)) + if (sdp_strcase_eq(vpp->acron, ap)) return vpp; } return NULL; @@ -198,7 +222,7 @@ const struct sdparm_transport_id_t * tip; for (tip = sdparm_transport_id; tip->acron; ++tip) { - if (0 == strcmp(tip->acron, ap)) + if (sdp_strcase_eq(tip->acron, ap)) return tip; } return NULL; @@ -222,7 +246,7 @@ const struct sdparm_vendor_name_t * vnp; for (vnp = sdparm_vendor_id; vnp->acron; ++vnp) { - if (0 == strcmp(vnp->acron, ap)) + if (sdp_strcase_eq(vnp->acron, ap)) return vnp; } return NULL; @@ -260,7 +284,7 @@ return NULL; for (mpi += k; mpi->acron; ++k, ++mpi) { - if (0 == strcmp(mpi->acron, ap)) + if (sdp_strcase_eq(mpi->acron, ap)) break; } if (NULL == mpi->acron) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/src/sdparm_cmd.c new/sdparm-1.06/src/sdparm_cmd.c --- old/sdparm-1.05/src/sdparm_cmd.c 2009-08-27 19:28:11.000000000 +0200 +++ new/sdparm-1.06/src/sdparm_cmd.c 2010-06-02 05:49:00.000000000 +0200 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2008 Douglas Gilbert. + * Copyright (c) 2005-2010 Douglas Gilbert. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -389,7 +389,7 @@ *argp = arg; for (scmdp = sdparm_command_arr; scmdp->name; ++scmdp) { - if (0 == strcmp(scmdp->name, cp)) + if (sdp_strcase_eq(scmdp->name, cp)) break; } if ((NULL == scmdp->name) && (strlen(cp) >= 2)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/src/sdparm_data.c new/sdparm-1.06/src/sdparm_data.c --- old/sdparm-1.05/src/sdparm_data.c 2010-04-01 06:21:56.000000000 +0200 +++ new/sdparm-1.06/src/sdparm_data.c 2010-10-31 20:29:24.000000000 +0100 @@ -55,11 +55,17 @@ 1, 1, -1, 2, 2, -1, -1, "SMC transport geometry" }; -/* SBC's thin provisioning mode page doesn't give the number +/* SBC's logical block provisioning mode page doesn't give the number of following descriptors but rather parameter length (in bytes). This is flagged by -1 in num_descs_inc (third) field */ -static struct sdparm_mode_descriptor_t sbc_tp_desc = { - 2, 2, -1, 16, 8, -1, -1, "SBC thin provisioning" +static struct sdparm_mode_descriptor_t sbc_lbp_desc = { + 2, 2, -1, 16, 8, -1, -1, "SBC logical block provisioning" +}; +/* SBC's application tag mode page doesn't give the number of + following descriptors but rather parameter length (in bytes). + This is flagged by -1 in num_descs_inc (third) field */ +static struct sdparm_mode_descriptor_t sbc_atag_desc = { + 2, 2, -1, 16, 24, -1, -1, "SBC application tag" }; /* Mode pages that aren't specific to any transport protocol or vendor. @@ -74,6 +80,8 @@ {ADC_MP, MSP_ADC_TD_SN, PDT_ADC, 0, "adts", "Targer device serial number (ADC)", NULL}, {POWER_MP, MSP_SAT_POWER, -1, 0, "apo", "SAT ATA Power condition", NULL}, + {CONTROL_MP, MSP_SBC_APP_TAG, PDT_DISK, 0, "atag", "Application tag " + "(SBC)", &sbc_atag_desc}, {IEC_MP, MSP_BACK_CTL, PDT_DISK, 0, "bc", "Background control (SBC)", NULL}, {CACHING_MP, 0, PDT_DISK, 0, "ca", "Caching (SBC)", NULL}, @@ -99,6 +107,8 @@ NULL}, {FORMAT_MP, 0, PDT_DISK, 0, "fo", "Format (SBC)", NULL}, {IEC_MP, 0, -1, 0, "ie", "Informational exceptions control", NULL}, + {IEC_MP, MSP_SBC_LB_PROV, PDT_DISK, 0, "lbp", "Logical block " + "provisioning (SBC)", &sbc_lbp_desc}, {MED_CONF_MP, 0, PDT_TAPE, 0, "mco", "Medium configuration (SSC)", NULL}, {MED_PART_MP, 0, PDT_TAPE, 0, "mpa", "Medium partition (SSC)", &ssc_mpa_desc}, @@ -116,8 +126,6 @@ /* since in SBC, SSC and MMC treat RW_ERR_RECOVERY_MP as if in SPC */ {TRANS_GEO_PAR_MP, 0, PDT_MCHANGER, 0, "tgp", "Transport geometry " "parameters (SMC)", &smc_tg_desc}, - {IEC_MP, MSP_SBC_THIN_PROV, PDT_DISK, 0, "thp", "Thin provisioning " - "(SBC)", &sbc_tp_desc}, {TIMEOUT_PROT_MP, 0, PDT_MMC, 0, "tp", "Timeout and protect (MMC)", NULL}, {V_ERR_RECOVERY_MP, 0, PDT_DISK, 0, "ve", "Verify error recovery (SBC)", NULL}, @@ -233,6 +241,8 @@ "Data transfer device element address (SSC)"}, {VPD_IMP_OP_DEF, 0, -1, "iod", "Implemented operating definition (obs)"}, + {VPD_LB_PROVISIONING, 0, PDT_DISK, "lbpv", "Logical block provisioning " + "(SBC)"}, {VPD_MAN_ASS_SN, 0, PDT_TAPE, "mas", "Manufacturer assigned serial number (SSC)"}, {VPD_MAN_ASS_SN, 0, PDT_ADC, "masa", @@ -252,7 +262,6 @@ {VPD_SCSI_PORTS, 0, -1, "sp", "SCSI ports"}, {VPD_SUPPORTED_VPDS, 0, -1, "sv", "Supported VPD pages"}, {VPD_TA_SUPPORTED, 0, PDT_TAPE, "tas", "TapeAlert supported flags (SSC)"}, - {VPD_THIN_PROVISIONING, 0, PDT_DISK, "thpv", "Thin provisioning (SBC)"}, {0, 0, 0, NULL, NULL}, }; @@ -290,8 +299,8 @@ "Head offset count (obsolete)", NULL}, {"DSOC", RW_ERR_RECOVERY_MP, 0, -1, 6, 7, 8, 0, "Data strobe offset count (obsolete)", NULL}, - {"TPERE", RW_ERR_RECOVERY_MP, 0, 0, 7, 7, 1, 0, /* SBC */ - "Thin provisioning error reporting enabled", NULL}, + {"LBPERE", RW_ERR_RECOVERY_MP, 0, 0, 7, 7, 1, 0, /* SBC */ + "Logical block provisioning error reporting enabled", NULL}, {"EMCDR", RW_ERR_RECOVERY_MP, 0, 5, 7, 1, 2, 0, /* MMC */ "Enhanced media certification and defect reporting", NULL}, {"WRC", RW_ERR_RECOVERY_MP, 0, -1, 8, 7, 8, 0, @@ -546,6 +555,10 @@ "Task aborted status", "0: tasks aborted without response to app client\t" "1: any other I_T nexuses receive task aborted"}, + {"ATMPE", CONTROL_MP, 0, -1, 5, 5, 1, 0, /* spc4r27 */ + "Application tag mode page enabled", NULL}, + {"RWWP", CONTROL_MP, 0, -1, 5, 4, 1, 0, /* spc4r27 */ + "Reject write without protection", NULL}, {"AUTOLOAD", CONTROL_MP, 0, -1, 5, 2, 3, 0, "Autoload mode", "0: medium loaded for full access\t" @@ -556,7 +569,8 @@ "0: undefined\t" "0ffffh (-1): unlimited"}, {"ESTCT", CONTROL_MP, 0, -1, 10, 7, 16, 0, - "Extended self test completion time (sec)", NULL}, + "Extended self test completion time (sec)", + "0ffffh (-1) takes 65535 seconds or longer"}, /* Control extension mode subpage [0xa,0x1] spc3 */ {"TCMOS", CONTROL_MP, MSP_SPC_CE, -1, 4, 2, 1, 0, @@ -569,6 +583,16 @@ "Initial command priority", "0: none or vendor\t" "1: highest\t15: lowest"}, + /* Application tag mode subpage [0xa,0xf0] sbc3 */ + {"AT_LAST", CONTROL_MP, MSP_SBC_APP_TAG, PDT_DISK, 16, 7, 1, 0, + "Last", NULL}, + {"AT_LBAT", CONTROL_MP, MSP_SBC_APP_TAG, PDT_DISK, 22, 7, 16, 0, + "Logical block application tag", NULL}, + {"AT_LBA", CONTROL_MP, MSP_SBC_APP_TAG, PDT_DISK, 24, 7, 64, MF_HEX, + "Logical block address", NULL}, + {"AT_COUNT", CONTROL_MP, MSP_SBC_APP_TAG, PDT_DISK, 32, 7, 64, MF_HEX, + "Logical block count", NULL}, + /* Control data protection mode subpage [0xa,0xf0] ssc4 */ {"LBPM", CONTROL_MP, MSP_SSC_CDP, PDT_TAPE, 4, 7, 8, 0, "Logical block protection method", "0: none\t" @@ -764,6 +788,10 @@ "[try adding '-t <transport>' to get more fields]"}, /* Power condition mode page [0x1a] spc3 (expanded in spc4r18) */ + {"PM_BG", POWER_MP, 0, -1, 2, 7, 2, 0, /* added spc4r24 */ + "Power management, background functions, precedence", + "0: vendor specific; 1: background function higher\t" + "2: power management higher"}, {"STANDBY_Y", POWER_MP, 0, -1, 2, 0, 1, 0, "Standby_y timer enabled", NULL}, {"IDLE_C", POWER_MP, 0, -1, 3, 3, 1, 0, @@ -788,6 +816,15 @@ "Idle_c condition timer (100 ms)", NULL}, {"SYCT", POWER_MP, 0, -1, 20, 7, 32, 0, "Standby_y condition timer (100 ms)", NULL}, + {"FIDCPC", POWER_MP, 0, -1, 39, 7, 2, 0, /* added spc4r25 */ + "From idle command processing control", + "0: reserved (SAS-2); 1: disabled; 2: enabled\n"}, + {"FSBCPC", POWER_MP, 0, -1, 39, 5, 2, 0, /* added spc4r25 */ + "From standby command processing control", + "0: reserved (SAS-2); 1: disabled; 2: enabled\n"}, + {"FSTCPC", POWER_MP, 0, -1, 39, 3, 2, 0, /* added spc4r25 */ + "From stopped command processing control", + "0: reserved (SAS-2); 1: disabled; 2: enabled\n"}, /* SAT ATA Power condition mode page [0x1a,0xf1] sat2 */ {"APMP", POWER_MP, MSP_SAT_POWER, -1, 5, 0, 1, 0, @@ -813,7 +850,7 @@ "Log informational exception errors", NULL}, {"MRIE", IEC_MP, 0, -1, 3, 3, 4, MF_COMMON, "Method of reporting informational exceptions", - "0: no reporting; 1: async reporting; 2: unit attention\t" + "0: no reporting; 1: async reporting (obs); 2: unit attention\t" "3: conditional recovered error; 4: recovered error\t" "5: check condition with no sense; 6: request sense only"}, {"INTT", IEC_MP, 0, -1, 4, 7, 32, 0, @@ -839,16 +876,18 @@ {"MAX_SUSP", IEC_MP, MSP_BACK_CTL, PDT_DISK, 12, 7, 16, 0, "Maximum time to suspend background scan (ms)", NULL}, - /* Thin provisioning mode subpage [0x1c,0x2] sbc3 */ - {"TH_EN", IEC_MP, MSP_SBC_THIN_PROV, PDT_DISK, 16, 7, 1, 0, + /* Logical block provisioning mode subpage [0x1c,0x2] sbc3 */ + {"SITUA", IEC_MP, MSP_SBC_LB_PROV, PDT_DISK, 4, 0, 1, 0, + "Single initiator threshold unit attention", NULL}, + {"LBP_EN", IEC_MP, MSP_SBC_LB_PROV, PDT_DISK, 16, 7, 1, 0, "Threshold enabled", NULL}, - {"TH_TYPE", IEC_MP, MSP_SBC_THIN_PROV, PDT_DISK, 16, 5, 3, 0, + {"LBP_TYPE", IEC_MP, MSP_SBC_LB_PROV, PDT_DISK, 16, 5, 3, 0, "Threshold type", NULL}, - {"TH_ARM", IEC_MP, MSP_SBC_THIN_PROV, PDT_DISK, 16, 2, 3, 0, + {"LBP_ARM", IEC_MP, MSP_SBC_LB_PROV, PDT_DISK, 16, 2, 3, 0, "Threshold arming", NULL}, - {"TH_RES", IEC_MP, MSP_SBC_THIN_PROV, PDT_DISK, 17, 7, 8, 0, + {"LBP_RES", IEC_MP, MSP_SBC_LB_PROV, PDT_DISK, 17, 7, 8, 0, "Threshold resource", NULL}, - {"TH_COUNT", IEC_MP, MSP_SBC_THIN_PROV, PDT_DISK, 20, 7, 32, 0, + {"LBP_COUNT", IEC_MP, MSP_SBC_LB_PROV, PDT_DISK, 20, 7, 32, 0, "Threshold count", NULL}, /* Medium configuration mode page [0x1d] ssc3 */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/sdparm-1.05/src/sdparm_vpd.c new/sdparm-1.06/src/sdparm_vpd.c --- old/sdparm-1.05/src/sdparm_vpd.c 2010-04-01 06:21:56.000000000 +0200 +++ new/sdparm-1.06/src/sdparm_vpd.c 2010-10-31 20:29:24.000000000 +0100 @@ -502,6 +502,7 @@ return 0; } +/* VPD_MODE_PG_POLICY */ static int decode_mode_policy_vpd(unsigned char * buff, int len) { @@ -533,6 +534,7 @@ return 0; } +/* VPD_MAN_NET_ADDR */ static int decode_man_net_vpd(unsigned char * buff, int len) { @@ -564,6 +566,7 @@ return 0; } +/* VPD_PROTO_LU */ static int decode_proto_lu_vpd(unsigned char * buff, int len) { @@ -605,6 +608,7 @@ return 0; } +/* VPD_PROTO_PORT */ static int decode_proto_port_vpd(unsigned char * buff, int len) { @@ -643,6 +647,7 @@ return 0; } +/* VPD_SCSI_PORTS */ static int decode_scsi_ports_vpd(unsigned char * buff, int len, int long_out, int quiet) { @@ -693,6 +698,7 @@ return 0; } +/* VPD_EXT_INQ */ static int decode_ext_inq_vpd(unsigned char * buff, int len, int quiet) { @@ -722,6 +728,7 @@ printf("r_sup=%d\n", !!(buff[8] & 0x10)); printf("cbcs=%d\n", !!(buff[8] & 0x1)); printf("mitmd=%d\n", (buff[9] & 0xf)); + printf("estcm=%d\n", (buff[10] << 8) + buff[10]); /* spc4r27 */ } else { printf(" ACTIVATE_MICROCODE=%d SPT=%d GRD_CHK=%d APP_CHK=%d " "REF_CHK=%d\n", ((buff[4] >> 6) & 0x3), ((buff[4] >> 3) & 0x7), @@ -737,10 +744,13 @@ !!(buff[7] & 0x10), !!(buff[7] & 0x1), !!(buff[8] & 0x10), !!(buff[8] & 0x1)); printf(" Multi I_T nexus microcode download=%d\n", buff[9] & 0xf); + printf(" Extended self-test completion minutes=%d\n", + (buff[10] << 8) + buff[11]); } return 0; } +/* VPD_ATA_INFO */ static int decode_ata_info_vpd(unsigned char * buff, int len, int long_out, int do_hex) { @@ -800,6 +810,7 @@ return 0; } +/* VPD_POWER_CONDITION */ static int decode_power_condition(unsigned char * buff, int len) { @@ -826,6 +837,7 @@ return 0; } +/* VPD_BLOCK_LIMITS */ static int decode_block_limits_vpd(unsigned char * buff, int len) { @@ -872,6 +884,7 @@ return 0; } +/* VPD_BLOCK_DEV_CHARS */ static int decode_block_dev_chars_vpd(unsigned char * buff, int len) { @@ -919,6 +932,7 @@ return 0; } +/* VPD_SA_DEV_CAP */ static int decode_tape_dev_caps_vpd(unsigned char * buff, int len) { @@ -931,6 +945,7 @@ return 0; } +/* VPD_MAN_ASS_SN */ static int decode_tape_man_ass_sn_vpd(unsigned char * buff, int len) { @@ -944,18 +959,19 @@ return 0; } +/* VPD_LB_PROVISIONING */ static int -decode_block_thin_prov_vpd(unsigned char * b, int len) +decode_block_lb_prov_vpd(unsigned char * b, int len) { int dp, anc_sup; if (len < 4) { - fprintf(stderr, "Thin provisioning page too short=%d\n", + fprintf(stderr, "Logical block provisioning page too short=%d\n", len); return SG_LIB_CAT_MALFORMED; } - printf(" Unmap supported (TPU): %d\n", !!(0x80 & b[5])); - printf(" Write same with unmap supported (TPWS): %d\n", !!(0x40 & b[5])); + printf(" Unmap supported (LBPU): %d\n", !!(0x80 & b[5])); + printf(" Write same with unmap supported (LBPWS): %d\n", !!(0x40 & b[5])); anc_sup = (b[5] >> 1) & 0x7; switch (anc_sup) { case 0: @@ -978,8 +994,8 @@ ucp = b + 8; i_len = ucp[3]; if (0 == i_len) { - fprintf(stderr, "Thin provisioning page provisioning group " - "descriptor too short=%d\n", i_len); + fprintf(stderr, "Logical block provisioning page provisioning " + "group descriptor too short=%d\n", i_len); return 0; } printf(" Provisioning group descriptor\n"); @@ -988,6 +1004,7 @@ return 0; } +/* VPD_TA_SUPPORTED */ static int decode_tapealert_supported_vpd(unsigned char * b, int len) { @@ -1031,6 +1048,7 @@ return 0; } +/* VPD_REFERRALS */ static int decode_referrals_vpd(unsigned char * b, int len) { @@ -1092,7 +1110,7 @@ case VPD_SUPPORTED_VPDS: if (b[1] != pn) goto dumb_inq; - len = b[3]; + len = (b[2] << 8) + b[3]; /* spc4r25 */ printf("Supported VPD pages VPD page:\n"); if (opts->hex) { dStrHex((const char *)b, len + 4, 0); @@ -1178,7 +1196,7 @@ case VPD_EXT_INQ: if (b[1] != pn) goto dumb_inq; - len = (b[2] << 8) + b[3]; + len = (b[2] << 8) + b[3]; /* spc4r25 */ if (len > sz) { fprintf(stderr, "Response to Extended inquiry data VPD page " "truncated\n"); @@ -1327,7 +1345,7 @@ case VPD_SOFTW_INF_ID: if (b[1] != pn) goto dumb_inq; - len = b[3]; + len = (b[2] << 8) + b[3]; /* spc4r25 */ if (len > sz) { fprintf(stderr, "Response to Software interface identification " "VPD page truncated\n"); @@ -1352,7 +1370,7 @@ case VPD_UNIT_SERIAL_NUM: if (b[1] != pn) goto dumb_inq; - len = b[3]; + len = (b[2] << 8) + b[3]; /* spc4r25 */ if (opts->long_out) printf("Unit serial number [0x80] VPD page:\n"); else @@ -1467,7 +1485,7 @@ len = (b[2] << 8) + b[3]; switch (pdt) { case PDT_DISK: case PDT_WO: case PDT_OPTICAL: - vpd_name = "Thin provisioning"; + vpd_name = "Logical block provisioning"; sbc = 1; break; case PDT_TAPE: case PDT_MCHANGER: @@ -1490,7 +1508,7 @@ if (ssc) res = decode_tapealert_supported_vpd(b, len + 4); else if (sbc) /* added in sbc3r20 */ - res = decode_block_thin_prov_vpd(b, len + 4); + res = decode_block_lb_prov_vpd(b, len + 4); else dStrHex((const char *)b, len + 4, 0); if (res) @@ -1523,6 +1541,7 @@ } res = 0; if (ssc) { + /* VPD_AUTOMATION_DEV_SN ssc */ if (len > 0) { if (len + 4 < (int)sizeof(b)) b[len + 4] = '\0'; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
