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 07/10] tools/testing/nvdimm: 'call_dsm' support
Date: Mon, 21 Mar 2016 13:37:07 -0600	[thread overview]
Message-ID: <66ce14146059dd0ee2e0855216916bbb3cd41bbd.1458583367.git.jerry.hoemann@hpe.com> (raw)
In-Reply-To: <cover.1458583367.git.jerry.hoemann@hpe.com>
In-Reply-To: <cover.1458583367.git.jerry.hoemann@hpe.com>

Enable nfit_test to use the generic 'call_dsm' envelope.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 tools/testing/nvdimm/test/nfit.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 1d3b8ce..5afc3d3 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -336,12 +336,21 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc,
 {
 	struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
 	struct nfit_test *t = container_of(acpi_desc, typeof(*t), acpi_desc);
+	unsigned int func = cmd;
 	int i, rc = 0, __cmd_rc;
 
 	if (!cmd_rc)
 		cmd_rc = &__cmd_rc;
 	*cmd_rc = 0;
 
+	if (cmd == ND_CMD_CALL) {
+		struct nd_cmd_pkg *call_dsm = buf;
+
+		buf_len = call_dsm->nd_size_in + call_dsm->nd_size_out;
+		buf = (void *) call_dsm->nd_payload;
+		func = call_dsm->nd_command;
+	}
+
 	if (nvdimm) {
 		struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
 
@@ -356,7 +365,7 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc,
 		if (i >= ARRAY_SIZE(handle))
 			return -ENXIO;
 
-		switch (cmd) {
+		switch (func) {
 		case ND_CMD_GET_CONFIG_SIZE:
 			rc = nfit_test_cmd_get_config_size(buf, buf_len);
 			break;
@@ -377,7 +386,7 @@ static int nfit_test_ctl(struct nvdimm_bus_descriptor *nd_desc,
 		if (!nd_desc || !test_bit(cmd, &nd_desc->cmd_mask))
 			return -ENOTTY;
 
-		switch (cmd) {
+		switch (func) {
 		case ND_CMD_ARS_CAP:
 			rc = nfit_test_cmd_ars_cap(buf, buf_len);
 			break;
-- 
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 19:37 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 ` Jerry Hoemann [this message]
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 ` [PATCH v8 10/10] nvdimm: Add ioctl to return command mask Jerry Hoemann
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=66ce14146059dd0ee2e0855216916bbb3cd41bbd.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.