aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/nvdimm
diff options
context:
space:
mode:
authorD Scott Phillips <scottph@FreeBSD.org>2019-06-06 20:12:04 +0000
committerD Scott Phillips <scottph@FreeBSD.org>2019-06-06 20:12:04 +0000
commit806adc6c0016dd1c13a2d8697d7f95d877e00222 (patch)
tree8c3796fdc565f3af2238047a856e92039e8fc003 /sys/dev/nvdimm
parentce7fb386d8ac7dbd36e9a6e1c6d80080a4162d50 (diff)
nvdimm: Provide nvdimm location information
Provide the acpi handle path as the location string for the nvdimm children of the nvdimm_root device. Reviewed by: kib Approved by: jhb (mentor) MFC after: 1 week Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D20528
Notes
Notes: svn path=/head/; revision=348757
Diffstat (limited to 'sys/dev/nvdimm')
-rw-r--r--sys/dev/nvdimm/nvdimm.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/nvdimm/nvdimm.c b/sys/dev/nvdimm/nvdimm.c
index aed02a2782a5..5c6b6ee6dc72 100644
--- a/sys/dev/nvdimm/nvdimm.c
+++ b/sys/dev/nvdimm/nvdimm.c
@@ -560,6 +560,24 @@ nvdimm_root_write_ivar(device_t dev, device_t child, int index,
return (0);
}
+static int
+nvdimm_root_child_location_str(device_t dev, device_t child, char *buf,
+ size_t buflen)
+{
+ ACPI_HANDLE handle;
+ int res;
+
+ handle = nvdimm_root_get_acpi_handle(child);
+ if (handle != NULL)
+ res = snprintf(buf, buflen, "handle=%s", acpi_name(handle));
+ else
+ res = snprintf(buf, buflen, "unknown");
+
+ if (res >= buflen)
+ return (EOVERFLOW);
+ return (0);
+}
+
static device_method_t nvdimm_methods[] = {
DEVMETHOD(device_probe, nvdimm_probe),
DEVMETHOD(device_attach, nvdimm_attach),
@@ -582,6 +600,7 @@ static device_method_t nvdimm_root_methods[] = {
DEVMETHOD(bus_add_child, bus_generic_add_child),
DEVMETHOD(bus_read_ivar, nvdimm_root_read_ivar),
DEVMETHOD(bus_write_ivar, nvdimm_root_write_ivar),
+ DEVMETHOD(bus_child_location_str, nvdimm_root_child_location_str),
DEVMETHOD_END
};