From patchwork Mon Dec 14 01:54:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Hoemann X-Patchwork-Id: 7840211 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 879F19F349 for ; Mon, 14 Dec 2015 01:54:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A7CCF204D3 for ; Mon, 14 Dec 2015 01:54:47 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C5BC820439 for ; Mon, 14 Dec 2015 01:54:46 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id BB3611A1FB8; Sun, 13 Dec 2015 17:54:46 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from g1t6213.austin.hp.com (g1t6213.austin.hp.com [15.73.96.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7E2931A1FAC for ; Sun, 13 Dec 2015 17:54:44 -0800 (PST) Received: from g2t4689.austin.hpicorp.net (g2t4689.austin.hpicorp.net [15.94.10.175]) by g1t6213.austin.hp.com (Postfix) with ESMTP id 3EB811D7; Mon, 14 Dec 2015 01:54:43 +0000 (UTC) Received: from lxbuild.ftc.rdlabs.hpecorp.net (lxbuild.ftc.rdlabs.hpecorp.net [16.78.34.175]) by g2t4689.austin.hpicorp.net (Postfix) with ESMTP id 1C1ED36; Mon, 14 Dec 2015 01:54:42 +0000 (UTC) From: Jerry Hoemann To: ross.zwisler@linux.intel.com, rjw@rjwysocki.net, lenb@kernel.org, dan.j.williams@intel.com, elliott@hpe.com, jmoyer@redhat.com, krivenok.dmitry@gmail.com, linda.knippers@hpe.com Subject: [PATCH v3 3/6] nvdimm: Add wrapper for IOCTL pass thru Date: Sun, 13 Dec 2015 18:54:24 -0700 Message-Id: <1f8827ca2e27be08fdb8dad5952e4ce836fadaea.1450036445.git.jerry.hoemann@hpe.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: References: In-Reply-To: References: Cc: linux-nvdimm@lists.01.org, rafael.j.wysocki@intel.com, robert.moore@intel.com, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, lv.zheng@intel.com X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add struct nd_passthru_pkg which serves as a warapper for the data being passed via a pass thru to a NVDIMM DSM. This wrapper specifies the extra information in a uniform manner allowing the kenrel to call a DSM without knowing specifics of the DSM. Add dsm_call command to nvdimm_bus_cmd_name and nvdimm_cmd_name. Signed-off-by: Jerry Hoemann --- include/uapi/linux/ndctl.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h index 5b4a4be..6823af3 100644 --- a/include/uapi/linux/ndctl.h +++ b/include/uapi/linux/ndctl.h @@ -109,6 +109,7 @@ enum { ND_CMD_VENDOR_EFFECT_LOG_SIZE = 7, ND_CMD_VENDOR_EFFECT_LOG = 8, ND_CMD_VENDOR = 9, + ND_CMD_CALL_DSM = 10, }; enum { @@ -122,6 +123,7 @@ static inline const char *nvdimm_bus_cmd_name(unsigned cmd) [ND_CMD_ARS_CAP] = "ars_cap", [ND_CMD_ARS_START] = "ars_start", [ND_CMD_ARS_STATUS] = "ars_status", + [ND_CMD_CALL_DSM] = "dsm_call", }; if (cmd < ARRAY_SIZE(names) && names[cmd]) @@ -141,6 +143,7 @@ static inline const char *nvdimm_cmd_name(unsigned cmd) [ND_CMD_VENDOR_EFFECT_LOG_SIZE] = "effect_size", [ND_CMD_VENDOR_EFFECT_LOG] = "effect_log", [ND_CMD_VENDOR] = "vendor", + [ND_CMD_CALL_DSM] = "dsm_call", }; if (cmd < ARRAY_SIZE(names) && names[cmd]) @@ -204,4 +207,20 @@ enum ars_masks { ARS_STATUS_MASK = 0x0000FFFF, ARS_EXT_STATUS_SHIFT = 16, }; + + +struct nd_cmd_dsmcall_pkg { + struct { + __u8 dsm_uuid[16]; + __u64 reserved1; /* reserved should be zero */ + __u64 dsm_rev; /* revision of dsm call */ + __u64 dsm_fun_idx; /* DSM function id */ + __u32 dsm_in; /* size of _DSM input */ + __u32 dsm_out; /* size of user buffer */ + __u32 reserved2[23]; /* reserved must be zero */ + __u32 dsm_size; /* size _DSM would write */ + } h; + unsigned char dsm_buf[]; /* Contents of DSM call */ +}; + #endif /* __NDCTL_H__ */