acpi/nfit, libnvdimm: Introduce nvdimm_security_ops
Some NVDIMMs, like the ones defined by the NVDIMM_FAMILY_INTEL command set, expose a security capability to lock the DIMMs at poweroff and require a passphrase to unlock them. The security model is derived from ATA security. In anticipation of other DIMMs implementing a similar scheme, and to abstract the core security implementation away from the device-specific details, introduce nvdimm_security_ops. Initially only a status retrieval operation, ->state(), is defined, along with the base infrastructure and definitions for future operations. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Co-developed-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
This commit is contained in:
@@ -42,8 +42,21 @@ struct nvdimm {
|
||||
int id, num_flush;
|
||||
struct resource *flush_wpq;
|
||||
const char *dimm_id;
|
||||
struct {
|
||||
const struct nvdimm_security_ops *ops;
|
||||
enum nvdimm_security_state state;
|
||||
} sec;
|
||||
};
|
||||
|
||||
static inline enum nvdimm_security_state nvdimm_security_state(
|
||||
struct nvdimm *nvdimm)
|
||||
{
|
||||
if (!nvdimm->sec.ops)
|
||||
return -ENXIO;
|
||||
|
||||
return nvdimm->sec.ops->state(nvdimm);
|
||||
}
|
||||
|
||||
/**
|
||||
* struct blk_alloc_info - tracking info for BLK dpa scanning
|
||||
* @nd_mapping: blk region mapping boundaries
|
||||
|
Reference in New Issue
Block a user