Lines 1-5
Link Here
|
1 |
--- os_freebsd.cpp.orig 2017-04-24 09:34:16.000000000 -0700 |
1 |
--- os_freebsd.cpp.orig 2017-04-24 16:34:16 UTC |
2 |
+++ os_freebsd.cpp 2018-02-27 19:15:54.338861000 +0000 |
2 |
+++ os_freebsd.cpp |
3 |
@@ -16,6 +16,8 @@ |
3 |
@@ -16,6 +16,8 @@ |
4 |
*/ |
4 |
*/ |
5 |
|
5 |
|
Lines 9-15
Link Here
|
9 |
#include <sys/types.h> |
9 |
#include <sys/types.h> |
10 |
#include <dirent.h> |
10 |
#include <dirent.h> |
11 |
#include <fcntl.h> |
11 |
#include <fcntl.h> |
12 |
@@ -484,7 +486,7 @@ |
12 |
@@ -484,7 +486,7 @@ bool freebsd_nvme_device::open() |
13 |
} |
13 |
} |
14 |
nsid = 0xFFFFFFFF; // broadcast id |
14 |
nsid = 0xFFFFFFFF; // broadcast id |
15 |
} |
15 |
} |
Lines 18-32
Link Here
|
18 |
&ctrlid, &nsid, &tmp) == 2) |
18 |
&ctrlid, &nsid, &tmp) == 2) |
19 |
{ |
19 |
{ |
20 |
if(ctrlid < 0 || nsid < 0) { |
20 |
if(ctrlid < 0 || nsid < 0) { |
21 |
@@ -521,16 +523,20 @@ |
21 |
@@ -522,15 +524,15 @@ bool freebsd_nvme_device::nvme_pass_thro |
22 |
struct nvme_pt_command pt; |
|
|
23 |
memset(&pt, 0, sizeof(pt)); |
22 |
memset(&pt, 0, sizeof(pt)); |
24 |
|
23 |
|
25 |
+#if __FreeBSD_version >= 1200058 |
|
|
26 |
+ pt.cmd.opc_fuse = NVME_CMD_SET_OPC(in.opcode); |
27 |
+#else |
28 |
pt.cmd.opc = in.opcode; |
24 |
pt.cmd.opc = in.opcode; |
29 |
+#endif |
|
|
30 |
- pt.cmd.nsid = in.nsid; |
25 |
- pt.cmd.nsid = in.nsid; |
31 |
+ pt.cmd.nsid = htole32(in.nsid); |
26 |
+ pt.cmd.nsid = htole32(in.nsid); |
32 |
pt.buf = in.buffer; |
27 |
pt.buf = in.buffer; |
Lines 46-52
Link Here
|
46 |
pt.is_read = 1; // should we use in.direction()? |
41 |
pt.is_read = 1; // should we use in.direction()? |
47 |
|
42 |
|
48 |
int status = ioctl(get_fd(), NVME_PASSTHROUGH_CMD, &pt); |
43 |
int status = ioctl(get_fd(), NVME_PASSTHROUGH_CMD, &pt); |
49 |
@@ -538,6 +544,9 @@ |
44 |
@@ -538,6 +540,9 @@ bool freebsd_nvme_device::nvme_pass_thro |
50 |
if (status < 0) |
45 |
if (status < 0) |
51 |
return set_err(errno, "NVME_PASSTHROUGH_CMD: %s", strerror(errno)); |
46 |
return set_err(errno, "NVME_PASSTHROUGH_CMD: %s", strerror(errno)); |
52 |
|
47 |
|