summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-09-20 14:00:43 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-11-13 13:22:22 +0100
commit6735da1a7029a57262ee0564df632f114b8c9b9b (patch)
treed31237e3f1e3933474598792ee9a48118fc9f684
parenteb4dcdf76de663e0cfa145737f03353568945cbd (diff)
downloadrtems-libbsd-6735da1a7029a57262ee0564df632f114b8c9b9b.tar.bz2
NVME(4): Add NVME_GET_NAMESPACE IO control
Update #3821.
-rw-r--r--freebsd/sys/dev/nvme/nvme.h3
-rw-r--r--freebsd/sys/dev/nvme/nvme_ns.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/freebsd/sys/dev/nvme/nvme.h b/freebsd/sys/dev/nvme/nvme.h
index 0a772fa4..16b9aa5f 100644
--- a/freebsd/sys/dev/nvme/nvme.h
+++ b/freebsd/sys/dev/nvme/nvme.h
@@ -44,6 +44,9 @@
#define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command)
#define NVME_RESET_CONTROLLER _IO('n', 1)
#define NVME_GET_NSID _IOR('n', 2, struct nvme_get_nsid)
+#ifdef __rtems__
+#define NVME_GET_NAMESPACE _IOR('n', 10, struct nvme_namespace *)
+#endif /* __rtems__ */
#define NVME_IO_TEST _IOWR('n', 100, struct nvme_io_test)
#define NVME_BIO_TEST _IOWR('n', 101, struct nvme_io_test)
diff --git a/freebsd/sys/dev/nvme/nvme_ns.c b/freebsd/sys/dev/nvme/nvme_ns.c
index d23061da..01b84ec9 100644
--- a/freebsd/sys/dev/nvme/nvme_ns.c
+++ b/freebsd/sys/dev/nvme/nvme_ns.c
@@ -96,6 +96,11 @@ nvme_ns_ioctl(struct cdev *cdev, u_long cmd, caddr_t arg, int flag,
gnsid->nsid = ns->id;
break;
}
+#ifdef __rtems__
+ case NVME_GET_NAMESPACE:
+ *(struct nvme_namespace **)arg = ns;
+ break;
+#endif /* __rtems__ */
case DIOCGMEDIASIZE:
*(off_t *)arg = (off_t)nvme_ns_get_size(ns);
break;