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:04:01 +0100
commit7cfd4a5edb73f0cd1bf8476d38e176ec07f4479a (patch)
tree55d4d6f32ea64e9d1724b1a2f778e5c6e40ccd19
parent2bcbcbb18ff6192b69c1efd3459d9fef98f30076 (diff)
downloadrtems-libbsd-7cfd4a5edb73f0cd1bf8476d38e176ec07f4479a.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;