From e6dfb2de47768efe8cc37c9a1863d2aff81440fb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sat, 25 Apr 2015 03:56:17 -0400 Subject: libnvdimm, nfit: dimm/memory-devices Enable nvdimm devices to be registered on a nvdimm_bus. The kernel assigned device id for nvdimm devicesis dynamic. If userspace needs a more static identifier it should consult a provider-specific attribute. In the case where NFIT is the provider, the 'nmemX/nfit/handle' or 'nmemX/nfit/serial' attributes may be used for this purpose. Cc: Neil Brown Cc: Cc: Greg KH Cc: Robert Moore Cc: Rafael J. Wysocki Acked-by: Christoph Hellwig Acked-by: Rafael J. Wysocki Tested-by: Toshi Kani Signed-off-by: Dan Williams --- drivers/nvdimm/nd-core.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/nvdimm/nd-core.h') diff --git a/drivers/nvdimm/nd-core.h b/drivers/nvdimm/nd-core.h index 0b0ff2423161..9b8303413b60 100644 --- a/drivers/nvdimm/nd-core.h +++ b/drivers/nvdimm/nd-core.h @@ -15,6 +15,10 @@ #include #include +extern struct list_head nvdimm_bus_list; +extern struct mutex nvdimm_bus_list_mutex; +extern struct bus_type nvdimm_bus_type; + struct nvdimm_bus { struct nvdimm_bus_descriptor *nd_desc; struct list_head list; @@ -22,6 +26,14 @@ struct nvdimm_bus { int id; }; +struct nvdimm { + unsigned long flags; + void *provider_data; + struct device dev; + int id; +}; + +struct nvdimm_bus *walk_to_nvdimm_bus(struct device *nd_dev); int __init nvdimm_bus_init(void); void __exit nvdimm_bus_exit(void); int nvdimm_bus_create_ndctl(struct nvdimm_bus *nvdimm_bus); -- cgit v1.2.3