From: Johannes Thumshirn <jthumshirn@suse.de>
To: davej@codemonkey.org.uk
Cc: trinity@vger.kernel.org, Johannes Thumshirn <jthumshirn@suse.de>
Subject: [RFC PATCH] nvme ioctl support
Date: Tue, 15 Dec 2015 15:19:04 +0100 [thread overview]
Message-ID: <1450189144-12735-1-git-send-email-jthumshirn@suse.de> (raw)
Add support for NVMe ioctls
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---
ioctls/nvme.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 ioctls/nvme.c
diff --git a/ioctls/nvme.c b/ioctls/nvme.c
new file mode 100644
index 0000000..5588e81
--- /dev/null
+++ b/ioctls/nvme.c
@@ -0,0 +1,39 @@
+#include <linux/ioctl.h>
+#include <linux/nvme.h>
+
+#include "utils.h"
+#include "ioctls.h"
+
+static const struct ioctl nvme_ioctls[] = {
+ IOCTL(NVME_IOCTL_ID),
+ IOCTL(NVME_IOCTL_ADMIN_CMD),
+ IOCTL(NVME_IOCTL_SUBMIT_IO),
+ IOCTL(NVME_IOCTL_IO_CMD),
+ IOCTL(NVME_IOCTL_RESET),
+};
+
+static const char *const nvme_devs[] = {
+ "nvme",
+};
+
+static const struct ioctl_group nvme_grp_misc = {
+ .devtype = DEV_CHAR,
+ .devs = nvme_devs,
+ .devs_cnt = ARRAY_SIZE(nvme_devs),
+ .sanitise = pick_random_ioctl,
+ .ioctls = nvme_ioctls,
+ .ioctls_cnt = ARRAY_SIZE(nvme_ioctls),
+};
+
+REG_IOCTL_GROUP(nvme_grp_misc)
+
+static const struct ioctl_group nvme_grp_block = {
+ .devtype = DEV_BLOCK,
+ .devs = nvme_devs,
+ .devs_cnt = ARRAY_SIZE(nvme_devs),
+ .sanitise = pick_random_ioctl,
+ .ioctls = nvme_ioctls,
+ .ioctls_cnt = ARRAY_SIZE(nvme_ioctls),
+};
+
+REG_IOCTL_GROUP(nvme_grp_block);
--
2.6.3
next reply other threads:[~2015-12-15 14:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-15 14:19 Johannes Thumshirn [this message]
2015-12-15 15:43 ` [RFC PATCH] nvme ioctl support Dave Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450189144-12735-1-git-send-email-jthumshirn@suse.de \
--to=jthumshirn@suse.de \
--cc=davej@codemonkey.org.uk \
--cc=trinity@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).