aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/nvdimm/test/nfit_test.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-12-05 13:43:25 -0800
committerDan Williams <dan.j.williams@intel.com>2016-12-06 17:42:36 -0800
commita7de92dac9f0dbf01deb56fe1d661d7baac097e1 (patch)
treeb1cc2c95f2094ea4ab5b508d49fbbd65fabd5048 /tools/testing/nvdimm/test/nfit_test.h
parentacpi, nfit: fix bus vs dimm confusion in xlat_status (diff)
downloadlinux-dev-a7de92dac9f0dbf01deb56fe1d661d7baac097e1.tar.xz
linux-dev-a7de92dac9f0dbf01deb56fe1d661d7baac097e1.zip
tools/testing/nvdimm: unit test acpi_nfit_ctl()
A recent flurry of bug discoveries in the nfit driver's DSM marshalling routine has highlighted the fact that we do not have unit test coverage for this routine. Add a self-test of acpi_nfit_ctl() routine before probing the "nfit_test.0" device. This mocks stimulus to acpi_nfit_ctl() and if any of the tests fail "nfit_test.0" will be unavailable causing the rest of the tests to not run / fail. This unit test will also be a place to land reproductions of quirky BIOS behavior discovered in the field and ensure the kernel does not regress against implementations it has seen in practice. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to '')
-rw-r--r--tools/testing/nvdimm/test/nfit_test.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/nvdimm/test/nfit_test.h b/tools/testing/nvdimm/test/nfit_test.h
index c281dd2e5e2d..f54c0032c6ff 100644
--- a/tools/testing/nvdimm/test/nfit_test.h
+++ b/tools/testing/nvdimm/test/nfit_test.h
@@ -31,11 +31,17 @@ struct nfit_test_resource {
void *buf;
};
+union acpi_object;
+typedef void *acpi_handle;
+
typedef struct nfit_test_resource *(*nfit_test_lookup_fn)(resource_size_t);
+typedef union acpi_object *(*nfit_test_evaluate_dsm_fn)(acpi_handle handle,
+ const u8 *uuid, u64 rev, u64 func, union acpi_object *argv4);
void __iomem *__wrap_ioremap_nocache(resource_size_t offset,
unsigned long size);
void __wrap_iounmap(volatile void __iomem *addr);
-void nfit_test_setup(nfit_test_lookup_fn lookup);
+void nfit_test_setup(nfit_test_lookup_fn lookup,
+ nfit_test_evaluate_dsm_fn evaluate);
void nfit_test_teardown(void);
struct nfit_test_resource *get_nfit_res(resource_size_t resource);
#endif