Lines Matching refs:nfit_test
175 struct nfit_test { struct
196 int (*alloc)(struct nfit_test *t); argument
197 void (*setup)(struct nfit_test *t); argument
216 static struct nfit_test *to_nfit_test(struct device *dev) in to_nfit_test() argument
220 return container_of(pdev, struct nfit_test, pdev); in to_nfit_test()
223 static int nd_intel_test_get_fw_info(struct nfit_test *t, in nd_intel_test_get_fw_info()
249 static int nd_intel_test_start_update(struct nfit_test *t, in nd_intel_test_start_update()
279 static int nd_intel_test_send_data(struct nfit_test *t, in nd_intel_test_send_data()
330 static int nd_intel_test_finish_fw(struct nfit_test *t, in nd_intel_test_finish_fw()
381 static int nd_intel_test_finish_query(struct nfit_test *t, in nd_intel_test_finish_query()
560 static int nfit_test_cmd_ars_start(struct nfit_test *t, in nfit_test_cmd_ars_start()
606 static int nfit_test_cmd_clear_error(struct nfit_test *t, in nfit_test_cmd_clear_error()
810 struct nfit_test *t = container_of(work, typeof(*t), work); in uc_error_notify()
815 static int nfit_test_cmd_ars_error_inject(struct nfit_test *t, in nfit_test_cmd_ars_error_inject()
846 static int nfit_test_cmd_ars_inject_clear(struct nfit_test *t, in nfit_test_cmd_ars_inject_clear()
872 static int nfit_test_cmd_ars_inject_status(struct nfit_test *t, in nfit_test_cmd_ars_inject_status()
895 static int nd_intel_test_cmd_set_lss_status(struct nfit_test *t, in nd_intel_test_cmd_set_lss_status()
952 struct nfit_test *t = container_of(acpi_desc, typeof(*t), acpi_desc); in nfit_test_ctl()
1123 static struct nfit_test *instances[NUM_NFITS];
1137 static void *__test_alloc(struct nfit_test *t, size_t size, dma_addr_t *dma, in __test_alloc()
1171 static void *test_alloc(struct nfit_test *t, size_t size, dma_addr_t *dma) in test_alloc()
1185 struct nfit_test *t = instances[i]; in nfit_test_lookup()
1223 struct nfit_test *t = data; in put_dimms()
1330 static int nfit_test_dimm_init(struct nfit_test *t) in nfit_test_dimm_init()
1347 static void smart_init(struct nfit_test *t) in smart_init()
1365 static int nfit_test0_alloc(struct nfit_test *t) in nfit_test0_alloc()
1428 static int nfit_test1_alloc(struct nfit_test *t) in nfit_test1_alloc()
1471 static void nfit_test0_setup(struct nfit_test *t) in nfit_test0_setup()
2198 static void nfit_test1_setup(struct nfit_test *t) in nfit_test1_setup()
2575 struct nfit_test *nfit_test; in nfit_test_probe() local
2586 nfit_test = to_nfit_test(&pdev->dev); in nfit_test_probe()
2589 if (nfit_test->num_dcr) { in nfit_test_probe()
2590 int num = nfit_test->num_dcr; in nfit_test_probe()
2592 nfit_test->dimm = devm_kcalloc(dev, num, sizeof(void *), in nfit_test_probe()
2594 nfit_test->dimm_dma = devm_kcalloc(dev, num, sizeof(dma_addr_t), in nfit_test_probe()
2596 nfit_test->flush = devm_kcalloc(dev, num, sizeof(void *), in nfit_test_probe()
2598 nfit_test->flush_dma = devm_kcalloc(dev, num, sizeof(dma_addr_t), in nfit_test_probe()
2600 nfit_test->label = devm_kcalloc(dev, num, sizeof(void *), in nfit_test_probe()
2602 nfit_test->label_dma = devm_kcalloc(dev, num, in nfit_test_probe()
2604 nfit_test->dcr = devm_kcalloc(dev, num, in nfit_test_probe()
2606 nfit_test->dcr_dma = devm_kcalloc(dev, num, in nfit_test_probe()
2608 nfit_test->smart = devm_kcalloc(dev, num, in nfit_test_probe()
2610 nfit_test->smart_threshold = devm_kcalloc(dev, num, in nfit_test_probe()
2613 nfit_test->fw = devm_kcalloc(dev, num, in nfit_test_probe()
2615 if (nfit_test->dimm && nfit_test->dimm_dma && nfit_test->label in nfit_test_probe()
2616 && nfit_test->label_dma && nfit_test->dcr in nfit_test_probe()
2617 && nfit_test->dcr_dma && nfit_test->flush in nfit_test_probe()
2618 && nfit_test->flush_dma in nfit_test_probe()
2619 && nfit_test->fw) in nfit_test_probe()
2625 if (nfit_test->num_pm) { in nfit_test_probe()
2626 int num = nfit_test->num_pm; in nfit_test_probe()
2628 nfit_test->spa_set = devm_kcalloc(dev, num, sizeof(void *), in nfit_test_probe()
2630 nfit_test->spa_set_dma = devm_kcalloc(dev, num, in nfit_test_probe()
2632 if (nfit_test->spa_set && nfit_test->spa_set_dma) in nfit_test_probe()
2639 if (nfit_test->alloc(nfit_test)) in nfit_test_probe()
2642 nfit_test->setup(nfit_test); in nfit_test_probe()
2643 acpi_desc = &nfit_test->acpi_desc; in nfit_test_probe()
2651 rc = acpi_nfit_init(acpi_desc, nfit_test->nfit_buf, in nfit_test_probe()
2652 nfit_test->nfit_filled); in nfit_test_probe()
2660 if (nfit_test->setup != nfit_test0_setup) in nfit_test_probe()
2663 nfit_test->setup_hotplug = 1; in nfit_test_probe()
2664 nfit_test->setup(nfit_test); in nfit_test_probe()
2670 obj->buffer.length = nfit_test->nfit_size; in nfit_test_probe()
2671 obj->buffer.pointer = nfit_test->nfit_buf; in nfit_test_probe()
2672 *(nfit_test->_fit) = obj; in nfit_test_probe()
2673 __acpi_nfit_notify(&pdev->dev, nfit_test, 0x80); in nfit_test_probe()
2683 dev_set_drvdata(nfit_test->dimm_dev[i], in nfit_test_probe()
2698 struct nfit_test *nfit_test = to_nfit_test(dev); in nfit_test_release() local
2700 kfree(nfit_test); in nfit_test_release()
2841 struct nfit_test *nfit_test; in nfit_test_init() local
2844 nfit_test = kzalloc(sizeof(*nfit_test), GFP_KERNEL); in nfit_test_init()
2845 if (!nfit_test) { in nfit_test_init()
2849 INIT_LIST_HEAD(&nfit_test->resources); in nfit_test_init()
2850 badrange_init(&nfit_test->badrange); in nfit_test_init()
2853 nfit_test->num_pm = NUM_PM; in nfit_test_init()
2854 nfit_test->dcr_idx = 0; in nfit_test_init()
2855 nfit_test->num_dcr = NUM_DCR; in nfit_test_init()
2856 nfit_test->alloc = nfit_test0_alloc; in nfit_test_init()
2857 nfit_test->setup = nfit_test0_setup; in nfit_test_init()
2860 nfit_test->num_pm = 2; in nfit_test_init()
2861 nfit_test->dcr_idx = NUM_DCR; in nfit_test_init()
2862 nfit_test->num_dcr = 2; in nfit_test_init()
2863 nfit_test->alloc = nfit_test1_alloc; in nfit_test_init()
2864 nfit_test->setup = nfit_test1_setup; in nfit_test_init()
2870 pdev = &nfit_test->pdev; in nfit_test_init()
2885 instances[i] = nfit_test; in nfit_test_init()
2886 INIT_WORK(&nfit_test->work, uc_error_notify); in nfit_test_init()