Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfit: add sysfs dimm 'family' and 'dsm_mask' attributes

Communicate the command format and supported functions to userspace
tooling.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>

+26
+26
drivers/acpi/nfit.c
··· 897 897 } 898 898 static DEVICE_ATTR_RO(serial); 899 899 900 + static ssize_t family_show(struct device *dev, 901 + struct device_attribute *attr, char *buf) 902 + { 903 + struct nvdimm *nvdimm = to_nvdimm(dev); 904 + struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); 905 + 906 + if (nfit_mem->family < 0) 907 + return -ENXIO; 908 + return sprintf(buf, "%d\n", nfit_mem->family); 909 + } 910 + static DEVICE_ATTR_RO(family); 911 + 912 + static ssize_t dsm_mask_show(struct device *dev, 913 + struct device_attribute *attr, char *buf) 914 + { 915 + struct nvdimm *nvdimm = to_nvdimm(dev); 916 + struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm); 917 + 918 + if (nfit_mem->family < 0) 919 + return -ENXIO; 920 + return sprintf(buf, "%#lx\n", nfit_mem->dsm_mask); 921 + } 922 + static DEVICE_ATTR_RO(dsm_mask); 923 + 900 924 static ssize_t flags_show(struct device *dev, 901 925 struct device_attribute *attr, char *buf) 902 926 { ··· 944 920 &dev_attr_serial.attr, 945 921 &dev_attr_rev_id.attr, 946 922 &dev_attr_flags.attr, 923 + &dev_attr_family.attr, 924 + &dev_attr_dsm_mask.attr, 947 925 NULL, 948 926 }; 949 927