aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2019-01-11 06:11:25 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2019-01-11 06:11:25 +0000
commit2433a22138f1b508c2765aa8499456cd6138a200 (patch)
treecf41a311a4230b908c6c14726bcfeae431bfdb48 /include
parent284fbfc7e0eb7b53b3ab7a9872aa1416685de785 (diff)
downloadsg3_utils-2433a22138f1b508c2765aa8499456cd6138a200.tar.gz
spc5r20 updates; fixes for FreeBSD 12.0 release
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@804 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include')
-rw-r--r--include/freebsd_nvme_ioctl.h11
-rw-r--r--include/sg_lib.h14
-rw-r--r--include/sg_linux_inc.h1
3 files changed, 23 insertions, 3 deletions
diff --git a/include/freebsd_nvme_ioctl.h b/include/freebsd_nvme_ioctl.h
index a7c970b9..0b79d851 100644
--- a/include/freebsd_nvme_ioctl.h
+++ b/include/freebsd_nvme_ioctl.h
@@ -39,6 +39,11 @@ extern "C" {
#define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command)
#if __FreeBSD_version < 1100110
+
+#define NVME_STATUS_GET_SC(st) (st.sc)
+#define NVME_STATUS_GET_SCT(st) (st.sct)
+
+
struct nvme_command
{
/* dword 0 */
@@ -151,12 +156,14 @@ struct nvme_pt_command {
*/
struct mtx * driver_lock;
};
-#else
+#else /* not __FreeBSD_version < 1100110 */
#include <dev/nvme/nvme.h>
-#endif
+#endif /* __FreeBSD_version < 1100110 */
+#ifndef nvme_completion_is_error
#define nvme_completion_is_error(cpl) \
((cpl)->status.sc != 0 || (cpl)->status.sct != 0)
+#endif
#define NVME_CTRLR_PREFIX "/dev/nvme"
#define NVME_NS_PREFIX "ns"
diff --git a/include/sg_lib.h b/include/sg_lib.h
index a5f8a3d5..9688991d 100644
--- a/include/sg_lib.h
+++ b/include/sg_lib.h
@@ -2,7 +2,7 @@
#define SG_LIB_H
/*
- * Copyright (c) 2004-2018 Douglas Gilbert.
+ * Copyright (c) 2004-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.
@@ -271,6 +271,18 @@ int sg_get_designation_descriptor_str(const char * leadin,
bool print_assoc, bool do_long,
int blen, char * b);
+/* Expects a T10 UUID designator (as found in the Device Identification VPD
+ * page) pointed to by 'dp'. To not produce an error string in 'b', c_set
+ * should be 1 (binary) and dlen should be 18. Currently T10 only supports
+ * locally assigned UUIDs. Writes output to string 'b' of no more than blen
+ * 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. */
+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);
+
/* Yield string associated with peripheral device type (pdt). Returns
* 'buff'. If 'pdt' out of range yields "bad pdt" string. */
char * sg_get_pdt_str(int pdt, int buff_len, char * buff);
diff --git a/include/sg_linux_inc.h b/include/sg_linux_inc.h
index 1f760185..e6f6b523 100644
--- a/include/sg_linux_inc.h
+++ b/include/sg_linux_inc.h
@@ -12,6 +12,7 @@
#include <linux/../scsi/sg.h>
#include <linux/../scsi/scsi.h>
#else
+ #define __user
#include <scsi/sg.h>
#include <scsi/scsi.h>
#endif