From 9ddcd0ac08f1c6a46d681bc349f3f523e8da4fcf Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Mon, 11 Feb 2019 01:43:25 +0000 Subject: sg_pt: add sg_get_opcode_translation() to replace global pointer to array; utils/hxascdmp: add -o= option; testing/sgh_dd fixes git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@811 6180dd3e-e324-4e3e-922d-17de1ae2f315 --- include/sg_lib.h | 2 +- include/sg_pt_nvme.h | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/sg_lib.h b/include/sg_lib.h index 9688991d..80c536c1 100644 --- a/include/sg_lib.h +++ b/include/sg_lib.h @@ -278,7 +278,7 @@ int sg_get_designation_descriptor_str(const char * leadin, * bytes and returns the number of bytes actually written to 'b' but doesn't * count the trailing null character it always appends (if blen > 0). 'lip' * is lead-in string (on each line) than may be NULL. skip_prefix avoids - * outputing ' Locally assigned UUID: ' before the UUID. */ + * outputting: ' Locally assigned UUID: ' before the UUID. */ int sg_t10_uuid_desig2str(const uint8_t * dp, int dlen, int c_set, bool do_long, bool skip_prefix, const char * lip, int blen, char * b); diff --git a/include/sg_pt_nvme.h b/include/sg_pt_nvme.h index daca8fce..590b4de9 100644 --- a/include/sg_pt_nvme.h +++ b/include/sg_pt_nvme.h @@ -2,7 +2,7 @@ #define SG_PT_NVME_H /* - * Copyright (c) 2017-2018 Douglas Gilbert. + * Copyright (c) 2017-2019 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. @@ -29,9 +29,9 @@ extern "C" { * are exceptions, for example the EUI-64 identifiers in the Admin Identify * response are big endian. * - * Code online (e.g. nvme-cli at github.com) seems to like packed strcutures, - * the author prefers byte offset plus a range of unaligned integer builders - * such as those in sg_unaligned.h . + * Code online (e.g. nvme-cli at github.com) seems to favour packed + * structures, while the author prefers byte offset plus a range of unaligned + * integer builders such as those in sg_unaligned.h . */ #ifdef __GNUC__ @@ -183,8 +183,6 @@ struct sg_opcode_info_t { /* Vendor specific (sg3_utils) VPD pages */ #define SG_NVME_VPD_NICR 0xde /* NVME Identify controller response */ -extern struct sg_opcode_info_t sg_opcode_info_arr[]; - /* Given the NVMe Identify Controller response and optionally the NVMe * Identify Namespace response (NULL otherwise), generate the SCSI VPD @@ -213,6 +211,10 @@ int sntl_resp_mode_select10(struct sg_sntl_dev_state_t * dsp, const uint8_t * cdbp, const uint8_t * dop, int do_len, struct sg_sntl_result_t * resp); +/* Returns pointer to array of struct sg_opcode_info_t of SCSI commands + * translated to NVMe. */ +const struct sg_opcode_info_t * sg_get_opcode_translation(void); + #ifdef __cplusplus } #endif -- cgit v1.2.3