aboutsummaryrefslogtreecommitdiff
path: root/sysutils/smartmontools
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2018-02-26 20:19:51 +0000
committerCy Schubert <cy@FreeBSD.org>2018-02-26 20:19:51 +0000
commit2571c076d0509d4defa18af19ba93bf95cb7d737 (patch)
tree5748274ed9c6d8bb7345a292b348d7692652f332 /sysutils/smartmontools
parentc26e260aa7483f2dbd990dd81050acb8ce979325 (diff)
downloadports-2571c076d0509d4defa18af19ba93bf95cb7d737.tar.gz
ports-2571c076d0509d4defa18af19ba93bf95cb7d737.zip
Notes
Diffstat (limited to 'sysutils/smartmontools')
-rw-r--r--sysutils/smartmontools/files/patch-freebsd__nvme__ioctl.h13
-rw-r--r--sysutils/smartmontools/files/patch-os__freebsd.cpp27
2 files changed, 37 insertions, 3 deletions
diff --git a/sysutils/smartmontools/files/patch-freebsd__nvme__ioctl.h b/sysutils/smartmontools/files/patch-freebsd__nvme__ioctl.h
new file mode 100644
index 000000000000..d66e0193b2d0
--- /dev/null
+++ b/sysutils/smartmontools/files/patch-freebsd__nvme__ioctl.h
@@ -0,0 +1,13 @@
+--- freebsd_nvme_ioctl.h.orig 2017-09-20 10:34:38.000000000 -0700
++++ freebsd_nvme_ioctl.h 2018-02-22 23:04:32.250104000 -0800
+@@ -148,8 +148,10 @@
+ #include <dev/nvme/nvme.h>
+ #endif
+
++#if __FreeBSD_version < 1200058
+ #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/sysutils/smartmontools/files/patch-os__freebsd.cpp b/sysutils/smartmontools/files/patch-os__freebsd.cpp
index 640b0f3ba2b1..0bd021c9502c 100644
--- a/sysutils/smartmontools/files/patch-os__freebsd.cpp
+++ b/sysutils/smartmontools/files/patch-os__freebsd.cpp
@@ -1,6 +1,14 @@
---- os_freebsd.cpp.orig 2017-04-24 16:34:16 UTC
-+++ os_freebsd.cpp
-@@ -484,7 +484,7 @@ bool freebsd_nvme_device::open()
+--- os_freebsd.cpp.orig 2017-04-24 09:34:16.000000000 -0700
++++ os_freebsd.cpp 2018-02-22 23:01:44.118712000 -0800
+@@ -15,6 +15,7 @@
+ *
+ */
+
++#include <sys/param.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <dirent.h>
+@@ -484,7 +485,7 @@
}
nsid = 0xFFFFFFFF; // broadcast id
}
@@ -9,3 +17,16 @@
&ctrlid, &nsid, &tmp) == 2)
{
if(ctrlid < 0 || nsid < 0) {
+@@ -521,7 +522,11 @@
+ struct nvme_pt_command pt;
+ memset(&pt, 0, sizeof(pt));
+
+- pt.cmd.opc = in.opcode;
++#if __FreeBSD_version >= 1200058
++ pt.cmd.opc_fuse = NVME_CMD_SET_OPC(in.opcode);
++#else
++ pt.cmd.opc_fuse = in.opcode;
++#endif
+ pt.cmd.nsid = in.nsid;
+ pt.buf = in.buffer;
+ pt.len = in.size;