All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerry Hoemann <jerry.hoemann@hpe.com>
To: dan.j.williams@intel.com
Cc: linux-nvdimm@lists.01.org
Subject: [PATCH v8 10/10] nvdimm: Add ioctl to return command mask.
Date: Mon, 21 Mar 2016 14:55:35 -0600	[thread overview]
Message-ID: <78a0789b5d390c53e95018f8038b7df00cc326ba.1458583367.git.jerry.hoemann@hpe.com> (raw)
In-Reply-To: <cover.1458583367.git.jerry.hoemann@hpe.com>

The pass thru calls return command mask.  Previously, bit zero
wasn't part of command mask, but as it is now, this left commands_show
displaying "unknown" for function zero.  Add an ioctl interface
to return command mask.

Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
---
 drivers/nvdimm/bus.c       | 10 ++++++++--
 include/uapi/linux/ndctl.h |  9 +++++++++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
index dcfcd8e..a61f069 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -404,7 +404,10 @@ void nvdimm_bus_destroy_ndctl(struct nvdimm_bus *nvdimm_bus)
 }
 
 static const struct nd_cmd_desc __nd_cmd_dimm_descs[] = {
-	[ND_CMD_IMPLEMENTED] = { },
+	[ND_CMD_IMPLEMENTED] = {
+		.out_num = 1,
+		.out_sizes = { 8, },
+	},
 	[ND_CMD_SMART] = {
 		.out_num = 2,
 		.out_sizes = { 4, 8, },
@@ -456,7 +459,10 @@ const struct nd_cmd_desc *nd_cmd_dimm_desc(int cmd)
 EXPORT_SYMBOL_GPL(nd_cmd_dimm_desc);
 
 static const struct nd_cmd_desc __nd_cmd_bus_descs[] = {
-	[ND_CMD_IMPLEMENTED] = { },
+	[ND_CMD_IMPLEMENTED] = {
+		.out_num = 1,
+		.out_sizes = { 1, },
+	},
 	[ND_CMD_ARS_CAP] = {
 		.in_num = 2,
 		.in_sizes = { 8, 8, },
diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h
index c043cd1..cae7c34 100644
--- a/include/uapi/linux/ndctl.h
+++ b/include/uapi/linux/ndctl.h
@@ -20,6 +20,10 @@ struct nd_cmd_smart {
 	__u8 data[128];
 } __packed;
 
+struct nd_cmd_mask {
+	__u8 data[8];
+} __packed;
+
 struct nd_cmd_smart_threshold {
 	__u32 status;
 	__u8 data[8];
@@ -137,6 +141,7 @@ enum {
 static inline const char *nvdimm_bus_cmd_name(unsigned cmd)
 {
 	static const char * const names[] = {
+		[ND_CMD_IMPLEMENTED] = "cmd_mask",
 		[ND_CMD_ARS_CAP] = "ars_cap",
 		[ND_CMD_ARS_START] = "ars_start",
 		[ND_CMD_ARS_STATUS] = "ars_status",
@@ -152,6 +157,7 @@ static inline const char *nvdimm_bus_cmd_name(unsigned cmd)
 static inline const char *nvdimm_cmd_name(unsigned cmd)
 {
 	static const char * const names[] = {
+		[ND_CMD_IMPLEMENTED] = "cmd_mask",
 		[ND_CMD_SMART] = "smart",
 		[ND_CMD_SMART_THRESHOLD] = "smart_thresh",
 		[ND_CMD_DIMM_FLAGS] = "flags",
@@ -171,6 +177,9 @@ static inline const char *nvdimm_cmd_name(unsigned cmd)
 
 #define ND_IOCTL 'N'
 
+#define ND_IOCTL_CMD_MASK		_IOWR(ND_IOCTL, ND_CMD_IMPLEMENTED,\
+					struct nd_cmd_mask)
+
 #define ND_IOCTL_SMART			_IOWR(ND_IOCTL, ND_CMD_SMART,\
 					struct nd_cmd_smart)
 
-- 
1.7.11.3

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  parent reply	other threads:[~2016-03-21 20:56 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 19:37 [PATCH v8 00/10] nvdimm: Add an IOCTL pass thru for DSM calls Jerry Hoemann
2016-03-21 19:37 ` [PATCH v8 01/10] ACPI / util: Fix acpi_evaluate_dsm() argument type Jerry Hoemann
2016-03-21 19:37 ` [PATCH v8 02/10] nvdimm: Add wrapper for IOCTL pass thru Jerry Hoemann
2016-04-11 18:21   ` Dan Williams
2016-04-11 23:16     ` Jerry Hoemann
2016-04-11 23:23       ` Dan Williams
2016-04-12  0:19         ` Jerry Hoemann
2016-04-12  0:27           ` Dan Williams
2016-03-21 19:37 ` [PATCH v8 03/10] nvdimm: Increase max envelope size for IOCTL Jerry Hoemann
2016-03-21 19:37 ` [PATCH v8 04/10] nvdimm: Add UUIDs Jerry Hoemann
2016-04-11 18:25   ` Dan Williams
2016-03-21 19:37 ` [PATCH v8 05/10] nvdimm: Add IOCTL pass thru functions Jerry Hoemann
2016-04-11 19:15   ` Dan Williams
2016-04-11 23:43     ` Jerry Hoemann
2016-04-12  0:18       ` Dan Williams
2016-03-21 19:37 ` [PATCH v8 06/10] libnvdimm: nvdimm_bus_descriptor field name change Jerry Hoemann
2016-03-21 19:37 ` [PATCH v8 07/10] tools/testing/nvdimm: 'call_dsm' support Jerry Hoemann
2016-03-21 19:37 ` [PATCH v8 08/10] nvdimm: command ioctl support Jerry Hoemann
2016-03-21 19:37 ` [PATCH v8 09/10] nvdimm: sysfs shows which dsm support full command ioctl Jerry Hoemann
2016-04-11 21:43   ` Dan Williams
2016-04-11 23:58     ` Jerry Hoemann
2016-04-12  0:30       ` Dan Williams
2016-04-12 21:41         ` Jerry Hoemann
2016-04-12 22:05           ` Dan Williams
2016-04-14 22:58             ` Jerry Hoemann
2016-04-15  2:49               ` Dan Williams
2016-03-21 20:55 ` Jerry Hoemann [this message]
2016-03-29 20:39 ` [PATCH v8 00/10] nvdimm: Add an IOCTL pass thru for DSM calls Jerry Hoemann
2016-04-11 22:19 ` Dan Williams

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=78a0789b5d390c53e95018f8038b7df00cc326ba.1458583367.git.jerry.hoemann@hpe.com \
    --to=jerry.hoemann@hpe.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.