aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2020-08-03 04:16:31 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2020-08-03 04:16:31 +0000
commit936a3271c9f9d86c9592e1406bdd254341ff2849 (patch)
tree9670d1c5e49bf15e036c7f43830fad570571176f /include
parent33f7b2296c779583acd5475484f57552ba437c41 (diff)
downloadsg3_utils-936a3271c9f9d86c9592e1406bdd254341ff2849.tar.gz
sg_raw: fix --cmdfile= handling; add --nvm option; sg_pt: add do_nvm_pt(); sg_lib: fix crash in sg_f2hex_arr() when fname not found
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@860 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include')
-rw-r--r--include/sg_pt.h14
-rw-r--r--include/sg_pt_linux.h4
2 files changed, 16 insertions, 2 deletions
diff --git a/include/sg_pt.h b/include/sg_pt.h
index 8f55fc11..ab077f31 100644
--- a/include/sg_pt.h
+++ b/include/sg_pt.h
@@ -150,6 +150,7 @@ void set_scsi_pt_flags(struct sg_pt_base * objp, int flags);
#define SCSI_PT_DO_START_OK 0
#define SCSI_PT_DO_BAD_PARAMS 1
#define SCSI_PT_DO_TIMEOUT 2
+#define SCSI_PT_DO_NOT_SUPPORTED 4
#define SCSI_PT_DO_NVME_STATUS 48 /* == SG_LIB_NVME_STATUS */
/* If OS error prior to or during command submission then returns negated
* error value (e.g. Unix '-errno'). This includes interrupted system calls
@@ -162,6 +163,19 @@ void set_scsi_pt_flags(struct sg_pt_base * objp, int flags);
int do_scsi_pt(struct sg_pt_base * objp, int fd, int timeout_secs,
int verbose);
+/* NVMe Admin commands can be sent directly to do_scsi_pt(). Unfortunately
+ * NVMe has at least one other command set: "NVM" to access user data and
+ * the opcodes in the NVM command set overlap with the Admin command set.
+ * So NVMe Admin commands should be sent do_scsi_pt() while NVMe "NVM"
+ * commands should be sent to this function. No SCSI commands should be
+ * sent to this function. Currently submq is not implemented and all
+ * submitted NVM commands are sent on queue 0, the same queue use for
+ * Admin commands. The return values follow the same pattern as do_scsi_pt(),
+ * with 0 returned being good. The NVMe device file descriptor must either
+ * be given to the obj constructor, or a prior set_pt_file_handle() call. */
+int do_nvm_pt(struct sg_pt_base * objp, int submq, int timeout_secs,
+ int verbose);
+
#define SCSI_PT_RESULT_GOOD 0
#define SCSI_PT_RESULT_STATUS 1 /* other than GOOD and CHECK CONDITION */
#define SCSI_PT_RESULT_SENSE 2
diff --git a/include/sg_pt_linux.h b/include/sg_pt_linux.h
index d96e861c..548a7634 100644
--- a/include/sg_pt_linux.h
+++ b/include/sg_pt_linux.h
@@ -117,8 +117,8 @@ struct sg_pt_linux_scsi {
/* Leave io_hdr in first place of this structure */
bool is_sg;
bool is_bsg;
- bool is_nvme; /* OS device type, if false ignore nvme_direct */
- bool nvme_direct; /* false: our SNTL; true: received NVMe command */
+ bool is_nvme; /* OS device type, if false ignore nvme_our_sntl */
+ bool nvme_our_sntl; /* true: our SNTL; false: received NVMe command */
bool nvme_stat_dnr; /* Do No Retry, part of completion status field */
bool nvme_stat_more; /* More, part of completion status field */
bool mdxfer_out; /* direction of metadata xfer, true->data-out */