anitazha / rpms / ndctl

Forked from rpms/ndctl a year ago
Clone

Blame SOURCES/0012-Expose-ndctl_bus_nfit_translate_spa-as-a-public-func.patch

e0018b
From c81fa15bafb1295aaa7d7f09500c3fbdd68b0011 Mon Sep 17 00:00:00 2001
e0018b
From: "Tsaur, Erwin" <erwin.tsaur@intel.com>
e0018b
Date: Thu, 4 Mar 2021 17:18:04 -0800
e0018b
Subject: [PATCH 012/217] Expose ndctl_bus_nfit_translate_spa as a public
e0018b
 function.
e0018b
e0018b
The motivation is to allow access to ACPI defined NVDIMM Root Device
e0018b
_DSM Function Index 5(Translate SPA).  The rest of the _DSM functions,
e0018b
which are mostly ARS related, are already public.
e0018b
e0018b
Basically move ndctl_bus_nfit_translate_spa declaration from private.h
e0018b
to libndctl.h.
e0018b
e0018b
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
e0018b
Signed-off-by: "Tsaur, Erwin" <erwin.tsaur@intel.com>
e0018b
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
e0018b
Link: https://lore.kernel.org/r/20210305011804.3573-1-erwin.tsaur@intel.com
e0018b
---
e0018b
 ndctl/lib/libndctl.sym | 4 ++++
e0018b
 ndctl/lib/nfit.c       | 2 +-
e0018b
 ndctl/lib/private.h    | 2 --
e0018b
 ndctl/libndctl.h       | 2 ++
e0018b
 4 files changed, 7 insertions(+), 3 deletions(-)
e0018b
e0018b
diff --git a/ndctl/lib/libndctl.sym b/ndctl/lib/libndctl.sym
e0018b
index 0a82616..58afb74 100644
e0018b
--- a/ndctl/lib/libndctl.sym
e0018b
+++ b/ndctl/lib/libndctl.sym
e0018b
@@ -451,3 +451,7 @@ LIBNDCTL_25 {
e0018b
 	ndctl_bus_clear_fw_activate_nosuspend;
e0018b
 	ndctl_bus_activate_firmware;
e0018b
 } LIBNDCTL_24;
e0018b
+
e0018b
+LIBNDCTL_26 {
e0018b
+	ndctl_bus_nfit_translate_spa;
e0018b
+} LIBNDCTL_25;
e0018b
diff --git a/ndctl/lib/nfit.c b/ndctl/lib/nfit.c
e0018b
index 6f68fcf..d85682f 100644
e0018b
--- a/ndctl/lib/nfit.c
e0018b
+++ b/ndctl/lib/nfit.c
e0018b
@@ -114,7 +114,7 @@ static int is_valid_spa(struct ndctl_bus *bus, unsigned long long spa)
e0018b
  *
e0018b
  * If success, returns zero, store dimm's @handle, and @dpa.
e0018b
  */
e0018b
-int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus,
e0018b
+NDCTL_EXPORT int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus,
e0018b
 	unsigned long long address, unsigned int *handle, unsigned long long *dpa)
e0018b
 {
e0018b
 
e0018b
diff --git a/ndctl/lib/private.h b/ndctl/lib/private.h
e0018b
index ede1300..8f4510e 100644
e0018b
--- a/ndctl/lib/private.h
e0018b
+++ b/ndctl/lib/private.h
e0018b
@@ -370,8 +370,6 @@ static inline int check_kmod(struct kmod_ctx *kmod_ctx)
e0018b
 	return kmod_ctx ? 0 : -ENXIO;
e0018b
 }
e0018b
 
e0018b
-int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus, unsigned long long addr,
e0018b
-		unsigned int *handle, unsigned long long *dpa);
e0018b
 struct ndctl_cmd *ndctl_bus_cmd_new_err_inj(struct ndctl_bus *bus);
e0018b
 struct ndctl_cmd *ndctl_bus_cmd_new_err_inj_clr(struct ndctl_bus *bus);
e0018b
 struct ndctl_cmd *ndctl_bus_cmd_new_err_inj_stat(struct ndctl_bus *bus,
e0018b
diff --git a/ndctl/libndctl.h b/ndctl/libndctl.h
e0018b
index 60e1288..87d07b7 100644
e0018b
--- a/ndctl/libndctl.h
e0018b
+++ b/ndctl/libndctl.h
e0018b
@@ -152,6 +152,8 @@ int ndctl_bus_clear_fw_activate_noidle(struct ndctl_bus *bus);
e0018b
 int ndctl_bus_set_fw_activate_nosuspend(struct ndctl_bus *bus);
e0018b
 int ndctl_bus_clear_fw_activate_nosuspend(struct ndctl_bus *bus);
e0018b
 int ndctl_bus_activate_firmware(struct ndctl_bus *bus, enum ndctl_fwa_method method);
e0018b
+int ndctl_bus_nfit_translate_spa(struct ndctl_bus *bus, unsigned long long addr,
e0018b
+		unsigned int *handle, unsigned long long *dpa);
e0018b
 
e0018b
 struct ndctl_dimm;
e0018b
 struct ndctl_dimm *ndctl_dimm_get_first(struct ndctl_bus *bus);
e0018b
-- 
e0018b
2.27.0
e0018b