aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--doc/sg3_utils.86
-rw-r--r--include/sg_pt.h2
-rw-r--r--lib/sg_pt_common.c4
-rw-r--r--lib/sg_pt_linux.c25
-rw-r--r--src/sg_vpd.c8
6 files changed, 26 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 2a24020a..12253d6c 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.39 [20140527] [svn: r584]
+Changelog for sg3_utils-1.39 [20140603] [svn: r585]
- sg_rep_zones: new utility for ZBC REPORT ZONES
- sg_reset_wp: new utility, ZBC RESET WRITE POINTER
- sg_ses: add --eiioe=auto|force option
@@ -40,6 +40,7 @@ Changelog for sg3_utils-1.39 [20140527] [svn: r584]
- add sg_get_category_sense_str() to API
- add initial zbc service actions
- dStrHex(Err): fix output truncation error
+ - linux, sg: support SCSI_PT_FLAGS_QUEUE_AT_TAIL
- sg_lib_data: sync asc/ascq codes with T10 20140516
- sync operation code with T10 20140515
- add id string for SPC-5
diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8
index 50e573f8..c5e2c710 100644
--- a/doc/sg3_utils.8
+++ b/doc/sg3_utils.8
@@ -1,4 +1,4 @@
-.TH SG3_UTILS "8" "May 2014" "sg3_utils\-1.39" SG3_UTILS
+.TH SG3_UTILS "8" "June 2014" "sg3_utils\-1.39" SG3_UTILS
.SH NAME
sg3_utils \- a package of utilities for sending SCSI commands
.SH SYNOPSIS
@@ -16,7 +16,9 @@ The names of all utilities start with "sg" and most start with "sg_" often
followed by the name, or a shortening of the name, of the SCSI command that
they send. For example the "sg_verify" utility sends the SCSI VERIFY
command. A mapping between SCSI commands and the sg3_utils utilities that
-issue them is shown in the COVERAGE file.
+issue them is shown in the COVERAGE file. The sg_raw utility can be used to
+send an arbitrary SCSI command (supplied on the command line) to the
+given \fIDEVICE\fR.
.PP
SCSI draft standards can be found at http://www.t10.org . The standards
themselves can be purchased from ANSI and other standards organizations.
diff --git a/include/sg_pt.h b/include/sg_pt.h
index d40cae9d..f0869d52 100644
--- a/include/sg_pt.h
+++ b/include/sg_pt.h
@@ -2,7 +2,7 @@
#define SG_PT_H
/*
- * Copyright (c) 2005-2011 Douglas Gilbert.
+ * Copyright (c) 2005-2014 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.
diff --git a/lib/sg_pt_common.c b/lib/sg_pt_common.c
index 6af93ac6..cc84cc21 100644
--- a/lib/sg_pt_common.c
+++ b/lib/sg_pt_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009-2013 Douglas Gilbert.
+ * Copyright (c) 2009-2014 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.
@@ -14,7 +14,7 @@
#endif
-static const char * scsi_pt_version_str = "2.10 20130827";
+static const char * scsi_pt_version_str = "2.11 20140603";
const char *
scsi_pt_version()
diff --git a/lib/sg_pt_linux.c b/lib/sg_pt_linux.c
index 604c9f27..18c318c4 100644
--- a/lib/sg_pt_linux.c
+++ b/lib/sg_pt_linux.c
@@ -5,7 +5,7 @@
* license that can be found in the BSD_LICENSE file.
*/
-/* sg_pt_linux version 1.20 20131014 */
+/* sg_pt_linux version 1.21 20140603 */
#include <stdio.h>
@@ -278,25 +278,18 @@ set_scsi_pt_task_attr(struct sg_pt_base * vp, int attribute, int priority)
#ifndef SG_FLAG_Q_AT_TAIL
#define SG_FLAG_Q_AT_TAIL 0x10
#endif
-#ifndef SG_FLAG_Q_AT_HEAD
-#define SG_FLAG_Q_AT_HEAD 0x20
-#endif
void
set_scsi_pt_flags(struct sg_pt_base * vp, int flags)
{
struct sg_pt_linux_scsi * ptp = &vp->impl;
- /* default action of SG (v3) is QUEUE_AT_HEAD */
+ /* default action of sg driver [sg v3 interface] is QUEUE_AT_HEAD */
/* default action of block layer SG_IO ioctl is QUEUE_AT_TAIL */
- if (SCSI_PT_FLAGS_QUEUE_AT_TAIL & flags) {
+ if (SCSI_PT_FLAGS_QUEUE_AT_TAIL & flags)
ptp->io_hdr.flags |= SG_FLAG_Q_AT_TAIL;
- ptp->io_hdr.flags &= ~SG_FLAG_Q_AT_HEAD;
- }
- if (SCSI_PT_FLAGS_QUEUE_AT_HEAD & flags) {
- ptp->io_hdr.flags |= SG_FLAG_Q_AT_HEAD;
+ if (SCSI_PT_FLAGS_QUEUE_AT_HEAD & flags)
ptp->io_hdr.flags &= ~SG_FLAG_Q_AT_TAIL;
- }
}
/* Executes SCSI command (or at least forwards it to lower layers).
@@ -755,12 +748,18 @@ set_scsi_pt_task_attr(struct sg_pt_base * vp, int attribute, int priority)
#define BSG_FLAG_Q_AT_TAIL 0x10
#endif
+/* Need this later if translated to v3 interface */
+#ifndef SG_FLAG_Q_AT_TAIL
+#define SG_FLAG_Q_AT_TAIL 0x10
+#endif
+
void
set_scsi_pt_flags(struct sg_pt_base * vp, int flags)
{
struct sg_pt_linux_scsi * ptp = &vp->impl;
- /* default action of bsg (sg v4) is QUEUE_AT_HEAD */
+ /* default action of bsg driver (sg v4) is QUEUE_AT_HEAD */
+ /* default action of block layer SG_IO ioctl is QUEUE_AT_TAIL */
if (SCSI_PT_FLAGS_QUEUE_AT_TAIL & flags)
ptp->io_hdr.flags |= BSG_FLAG_Q_AT_TAIL;
if (SCSI_PT_FLAGS_QUEUE_AT_HEAD & flags)
@@ -931,6 +930,8 @@ do_scsi_pt_v3(struct sg_pt_linux_scsi * ptp, int fd, int time_secs,
v3_hdr.mx_sb_len = (unsigned char)ptp->io_hdr.max_response_len;
}
v3_hdr.pack_id = (int)ptp->io_hdr.spare_in;
+ if (BSG_FLAG_Q_AT_TAIL & ptp->io_hdr.flags)
+ v3_hdr.flags |= SG_FLAG_Q_AT_TAIL;
if (NULL == v3_hdr.cmdp) {
if (verbose)
diff --git a/src/sg_vpd.c b/src/sg_vpd.c
index 84e9c248..c363dc51 100644
--- a/src/sg_vpd.c
+++ b/src/sg_vpd.c
@@ -33,7 +33,7 @@
*/
-static const char * version_str = "0.86 20140527"; /* spc4r37 + sbc4r01 */
+static const char * version_str = "0.87 20140529"; /* spc4r37 + sbc4r01 */
/* And with sbc3r35, vale Mark Evans */
void svpd_enumerate_vendor(int vp_num);
@@ -2095,11 +2095,11 @@ decode_3party_copy_vpd(unsigned char * buff, int len, int do_hex, int verbose)
(ucp[8 + j + 2] << 8) | ucp[8 + j + 3];
printf(" ROD Type %u:\n", u);
printf(" Internal: %s\n",
- ucp[8 + j + 4] & 0x80 ? "yes" : "no");
+ (ucp[8 + j + 4] & 0x80) ? "yes" : "no");
printf(" Token In: %s\n",
- ucp[8 + j + 4] & 0x02 ? "yes" : "no");
+ (ucp[8 + j + 4] & 0x02) ? "yes" : "no");
printf(" Token Out: %s\n",
- ucp[8 + j + 4] & 0x01 ? "yes" : "no");
+ (ucp[8 + j + 4] & 0x01) ? "yes" : "no");
printf(" Preference: %d\n",
(ucp[8 + j + 6] << 8) + ucp[8 + j + 7]);
}