aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sg_lib_data.c9
-rw-r--r--lib/sg_pt_solaris.c25
2 files changed, 21 insertions, 13 deletions
diff --git a/lib/sg_lib_data.c b/lib/sg_lib_data.c
index b7417d03..e64c240d 100644
--- a/lib/sg_lib_data.c
+++ b/lib/sg_lib_data.c
@@ -19,8 +19,8 @@
#include "sg_lib_data.h"
-const char * sg_lib_version_str = "2.75 20200624";
-/* spc6r01, sbc4r20a, zbc2r04 */
+const char * sg_lib_version_str = "2.76 20200708";
+/* spc6r02, sbc4r20a, zbc2r04 */
/* indexed by pdt; those that map to own index do not decay */
@@ -726,6 +726,7 @@ struct sg_lib_asc_ascq_t sg_lib_asc_ascq[] =
{0x04,0x22,"Logical unit not ready, power cycle required"},
{0x04,0x23,"Logical unit not ready, affiliation required"},
{0x04,0x24,"Depopulation in progress"}, /* spc5r15 */
+ {0x04,0x25,"Depopulation restoration in progress"}, /* spc6r02 */
{0x05,0x00,"Logical unit does not respond to selection"},
{0x06,0x00,"No reference position found"},
{0x07,0x00,"Multiple peripheral devices selected"},
@@ -1004,6 +1005,7 @@ struct sg_lib_asc_ascq_t sg_lib_asc_ascq[] =
{0x2C,0x10,"Unwritten data in zone"},
{0x2C,0x11,"Descriptor format sense data required"},
{0x2C,0x12,"Zone is inactive"},
+ {0x2C,0x13,"Well known logical unit access required"}, /* spc6r02 */
{0x2D,0x00,"Overwrite error on update in place"},
{0x2E,0x00,"Insufficient time for operation"},
{0x2E,0x01,"Command timeout before processing"},
@@ -1035,7 +1037,8 @@ struct sg_lib_asc_ascq_t sg_lib_asc_ascq[] =
{0x31,0x01,"Format command failed"},
{0x31,0x02,"Zoned formatting failed due to spare linking"},
{0x31,0x03,"Sanitize command failed"},
- {0x31,0x04,"Depopulation failed"}, /* spc5r15 */
+ {0x31,0x04,"Depopulation failed"}, /* spc5r15 */
+ {0x31,0x05,"Depopulation restoration failed"}, /* spc6r02 */
{0x32,0x00,"No defect spare location available"},
{0x32,0x01,"Defect list update failure"},
{0x33,0x00,"Tape length error"},
diff --git a/lib/sg_pt_solaris.c b/lib/sg_pt_solaris.c
index 3d0cb228..fa68f8ba 100644
--- a/lib/sg_pt_solaris.c
+++ b/lib/sg_pt_solaris.c
@@ -7,7 +7,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-/* sg_pt_solaris version 1.11 20190113 */
+/* sg_pt_solaris version 1.12 20200712 */
#include <stdio.h>
#include <stdlib.h>
@@ -103,8 +103,8 @@ construct_scsi_pt_obj_with_fd(int dev_fd, int verbose)
ptp->dev_fd = (dev_fd < 0) ? -1 : dev_fd;
ptp->is_nvme = false;
ptp->uscsi.uscsi_timeout = DEF_TIMEOUT;
- ptp->uscsi.uscsi_flags = USCSI_READ | USCSI_ISOLATE | USCSI_RQENABLE;
- ptp->uscsi.uscsi_timeout = DEF_TIMEOUT;
+// ptp->uscsi.uscsi_flags = USCSI_READ | USCSI_ISOLATE | USCSI_RQENABLE;
+ ptp->uscsi.uscsi_flags = USCSI_ISOLATE | USCSI_RQENABLE;
} else if (verbose)
fprintf(sg_warnings_strm ? sg_warnings_strm : stderr,
"%s: calloc() out of memory\n", __func__);
@@ -134,8 +134,8 @@ clear_scsi_pt_obj(struct sg_pt_base * vp)
if (ptp) {
memset(ptp, 0, sizeof(struct sg_pt_solaris_scsi));
ptp->uscsi.uscsi_timeout = DEF_TIMEOUT;
- ptp->uscsi.uscsi_flags = USCSI_READ | USCSI_ISOLATE | USCSI_RQENABLE;
- ptp->uscsi.uscsi_timeout = DEF_TIMEOUT;
+// ptp->uscsi.uscsi_flags = USCSI_READ | USCSI_ISOLATE | USCSI_RQENABLE;
+ ptp->uscsi.uscsi_flags = USCSI_ISOLATE | USCSI_RQENABLE;
}
}
@@ -284,6 +284,11 @@ do_scsi_pt(struct sg_pt_base * vp, int fd, int time_secs, int verbose)
if (time_secs > 0)
ptp->uscsi.uscsi_timeout = time_secs;
+// Test code: address rejection of TUR (no data xfer) with EINVAL
+if (NULL == ptp->uscsi.uscsi_bufaddr)
+ ptp->uscsi.uscsi_bufaddr = ptp->uscsi.uscsi_rqbuf; /* give it a buffer address even though not used */
+// End of Test code 20200712 dpg
+
if (ioctl(ptp->dev_fd, USCSICMD, &ptp->uscsi)) {
ptp->os_err = errno;
if ((EIO == ptp->os_err) && ptp->uscsi.uscsi_status) {
@@ -335,8 +340,8 @@ void
get_pt_req_lengths(const struct sg_pt_base * vp, int * req_dinp,
int * req_doutp)
{
- const struct sg_pt_freebsd_scsi * ptp = &vp->impl;
- int dxfer_len = ptp->uscsi.uscsi_buflen
+ const struct sg_pt_solaris_scsi * ptp = &vp->impl;
+ int dxfer_len = ptp->uscsi.uscsi_buflen;
int flags = ptp->uscsi.uscsi_flags;
if (req_dinp) {
@@ -357,8 +362,8 @@ void
get_pt_actual_lengths(const struct sg_pt_base * vp, int * act_dinp,
int * act_doutp)
{
- const struct sg_pt_freebsd_scsi * ptp = &vp->impl;
- int dxfer_len = ptp->uscsi.uscsi_buflen
+ const struct sg_pt_solaris_scsi * ptp = &vp->impl;
+ int dxfer_len = ptp->uscsi.uscsi_buflen;
int flags = ptp->uscsi.uscsi_flags;
if (act_dinp) {
@@ -415,7 +420,7 @@ get_scsi_pt_duration_ms(const struct sg_pt_base * vp)
/* If not available return 0 otherwise return number of nanoseconds that the
* lower layers (and hardware) took to execute the command just completed. */
-uint64_t
+uint64_t
get_pt_duration_ns(const struct sg_pt_base * vp __attribute__ ((unused)))
{
return 0;