diff options
author | Dan Williams <dan.j.williams@intel.com> | 2015-04-27 01:26:48 +0200 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2015-06-25 03:24:10 +0200 |
commit | 45def22c1fab85764646746ce38d45b2f3281fa5 (patch) | |
tree | 05a417ff9c0540728bb29be48fe999a3f04ec79d /drivers/acpi/nfit.h | |
parent | libnvdimm, nfit: initial libnvdimm infrastructure and NFIT support (diff) | |
download | linux-45def22c1fab85764646746ce38d45b2f3281fa5.tar.xz linux-45def22c1fab85764646746ce38d45b2f3281fa5.zip |
libnvdimm: control character device and nvdimm_bus sysfs attributes
The control device for a nvdimm_bus is registered as an "nd" class
device. The expectation is that there will usually only be one "nd" bus
registered under /sys/class/nd. However, we allow for the possibility
of multiple buses and they will listed in discovery order as
ndctl0...ndctlN. This character device hosts the ioctl for passing
control messages. The initial command set has a 1:1 correlation with
the commands listed in the by the "NFIT DSM Example" document [1], but
this scheme is extensible to future command sets.
Note, nd_ioctl() and the backing ->ndctl() implementation are defined in
a subsequent patch. This is simply the initial registrations and sysfs
attributes.
[1]: http://pmem.io/documents/NVDIMM_DSM_Interface_Example.pdf
Cc: Neil Brown <neilb@suse.de>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: <linux-acpi@vger.kernel.org>
Cc: Robert Moore <robert.moore@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/acpi/nfit.h')
-rw-r--r-- | drivers/acpi/nfit.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h index c6baba64703f..eda565fa81ef 100644 --- a/drivers/acpi/nfit.h +++ b/drivers/acpi/nfit.h @@ -87,4 +87,10 @@ static inline struct acpi_nfit_memory_map *__to_nfit_memdev( return nfit_mem->memdev_dcr; return nfit_mem->memdev_pmem; } + +static inline struct acpi_nfit_desc *to_acpi_desc( + struct nvdimm_bus_descriptor *nd_desc) +{ + return container_of(nd_desc, struct acpi_nfit_desc, nd_desc); +} #endif /* __NFIT_H__ */ |