summaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/nd-core.h
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2018-12-07 18:33:30 +0100
committerDan Williams <dan.j.williams@intel.com>2018-12-21 21:44:41 +0100
commit03b65b22ada8115a7a7bfdf0789f6a94adfd6070 (patch)
treed8ac0a260db2dcac8b52ed36566bd9b89ab2d116 /drivers/nvdimm/nd-core.h
parentacpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs (diff)
downloadlinux-03b65b22ada8115a7a7bfdf0789f6a94adfd6070.tar.xz
linux-03b65b22ada8115a7a7bfdf0789f6a94adfd6070.zip
acpi/nfit, libnvdimm: Add disable passphrase support to Intel nvdimm.
Add support to disable passphrase (security) for the Intel nvdimm. The passphrase used for disabling is pulled from an encrypted-key in the kernel user keyring. The action is triggered by writing "disable <keyid>" to the sysfs attribute "security". Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/nd-core.h')
-rw-r--r--drivers/nvdimm/nd-core.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/nvdimm/nd-core.h b/drivers/nvdimm/nd-core.h
index 15eff40f55f6..d1351c0b1119 100644
--- a/drivers/nvdimm/nd-core.h
+++ b/drivers/nvdimm/nd-core.h
@@ -57,6 +57,15 @@ static inline enum nvdimm_security_state nvdimm_security_state(
return nvdimm->sec.ops->state(nvdimm);
}
int nvdimm_security_freeze(struct nvdimm *nvdimm);
+#if IS_ENABLED(CONFIG_NVDIMM_KEYS)
+int nvdimm_security_disable(struct nvdimm *nvdimm, unsigned int keyid);
+#else
+static inline int nvdimm_security_disable(struct nvdimm *nvdimm,
+ unsigned int keyid)
+{
+ return -EOPNOTSUPP;
+}
+#endif
/**
* struct blk_alloc_info - tracking info for BLK dpa scanning