diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2021-06-07 15:21:01 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2021-06-07 15:21:01 +0000 |
commit | 30363466e3580cae5f428c9bf35caa934cef469b (patch) | |
tree | 265f9bd6b4a8ebcf7102908ca0596dc1f42ce28a /lib | |
parent | d65eadbdaa302c7b83c059569a28efd3304947e4 (diff) | |
download | sg3_utils-30363466e3580cae5f428c9bf35caa934cef469b.tar.gz |
sg_vpd: fix do_hex type on some recent pages; sg_dd: don't close negative file descriptors; pt_linux_nvme: fix fua setting
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@903 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sg_cmds_basic.c | 8 | ||||
-rw-r--r-- | lib/sg_pt_freebsd.c | 4 | ||||
-rw-r--r-- | lib/sg_pt_linux_nvme.c | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/sg_cmds_basic.c b/lib/sg_cmds_basic.c index 0b862821..d1a61168 100644 --- a/lib/sg_cmds_basic.c +++ b/lib/sg_cmds_basic.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2020 Douglas Gilbert. + * Copyright (c) 1999-2021 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. @@ -42,7 +42,7 @@ #endif -static const char * const version_str = "1.97 20200722"; +static const char * const version_str = "1.98 20210601"; #define SENSE_BUFF_LEN 64 /* Arbitrary, could be larger */ @@ -622,7 +622,7 @@ sg_ll_test_unit_ready_com(struct sg_pt_base * ptvp, int sg_fd, int pack_id, bool local_cdb = true; int res, ret, sense_cat; uint8_t tur_cdb[TUR_CMDLEN] = {TUR_CMD, 0, 0, 0, 0, 0}; - uint8_t sense_b[SENSE_BUFF_LEN]; + uint8_t sense_b[SENSE_BUFF_LEN] = {0}; if (verbose) { char b[128]; @@ -748,7 +748,7 @@ sg_ll_request_sense_com(struct sg_pt_base * ptvp, int sg_fd, bool desc, } if (ptvp) { ptvp_given = true; - if (get_scsi_pt_sense_buf(ptvp)) + if (get_scsi_pt_cdb_buf(ptvp)) local_cdb = false; else set_scsi_pt_cdb(ptvp, rs_cdb, sizeof(rs_cdb)); diff --git a/lib/sg_pt_freebsd.c b/lib/sg_pt_freebsd.c index 918197c6..b6af6704 100644 --- a/lib/sg_pt_freebsd.c +++ b/lib/sg_pt_freebsd.c @@ -7,7 +7,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -/* sg_pt_freebsd version 1.43 20210503 */ +/* sg_pt_freebsd version 1.44 20210601 */ #include <stdio.h> #include <stdlib.h> @@ -2514,7 +2514,7 @@ sntl_rread(struct sg_pt_freebsd_scsi * ptp, const uint8_t * cdbp, bool is_read10 = (SCSI_READ10_OPC == cdbp[0]); bool have_fua = !!(cdbp[1] & 0x8); int err; - uint32_t nblks_t10 = 0; + uint32_t nblks_t10 = 0; /* 'control' in upper 16 bits */ uint64_t lba; struct nvme_pt_command npc; uint8_t * npc_up = (uint8_t *)&npc; diff --git a/lib/sg_pt_linux_nvme.c b/lib/sg_pt_linux_nvme.c index 094dc49c..3dbd182e 100644 --- a/lib/sg_pt_linux_nvme.c +++ b/lib/sg_pt_linux_nvme.c @@ -41,7 +41,7 @@ * MA 02110-1301, USA. */ -/* sg_pt_linux_nvme version 1.17 20210501 */ +/* sg_pt_linux_nvme version 1.18 20210601 */ /* This file contains a small "SPC-only" SNTL to support the SES pass-through * of SEND DIAGNOSTIC and RECEIVE DIAGNOSTIC RESULTS through NVME-MI @@ -154,7 +154,7 @@ #define SG_NVME_NVM_WRITE 0x1 #define SG_NVME_NVM_WRITE_ZEROES 0x8 /* SCSI WRITE SAME */ -#define SG_NVME_RW_CDW12_FUA (1 << 30) /* Force Unit Access bit */ +#define SG_NVME_RW_CONTROL_FUA (1 << 14) /* Force Unit Access bit */ #if (HAVE_NVME && (! IGNORE_NVME)) @@ -1480,7 +1480,7 @@ sntl_rread(struct sg_pt_linux_scsi * ptp, const uint8_t * cdbp, } iop->nblocks = nblks_t10 - 1; /* crazy "0's based" */ if (have_fua) - iop->nblocks |= SG_NVME_RW_CDW12_FUA; + iop->control |= SG_NVME_RW_CONTROL_FUA; iop->addr = (uint64_t)ptp->io_hdr.din_xferp; res = sntl_do_nvm_cmd(ptp, iop, ptp->io_hdr.din_xfer_len, true /* is_read */, time_secs, vb); @@ -1526,7 +1526,7 @@ sntl_write(struct sg_pt_linux_scsi * ptp, const uint8_t * cdbp, } iop->nblocks = nblks_t10 - 1; if (have_fua) - iop->nblocks |= SG_NVME_RW_CDW12_FUA; + iop->control |= SG_NVME_RW_CONTROL_FUA; iop->addr = (uint64_t)ptp->io_hdr.dout_xferp; res = sntl_do_nvm_cmd(ptp, iop, ptp->io_hdr.dout_xfer_len, false, time_secs, vb); |