1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-18 03:46:03 +00:00

Fix build under -CURRENT following Sr329824.

This commit does not address big endian support, which will be addressed
by a separate revision and commit. This commit (and revision) only
addresses build breakage due to Sr329824.

Approved by:	imp, wma, kan, mst_semihalf.com (Michal Stanek)
Differential Revision:	https://reviews.freebsd.org/D14483
This commit is contained in:
Cy Schubert 2018-02-26 20:19:51 +00:00
parent c26e260aa7
commit 2571c076d0
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=463046
2 changed files with 37 additions and 3 deletions

View File

@ -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"

View File

@ -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;