xref: /openbmc/linux/tools/testing/cxl/test/mock.h (revision dd21bfa4)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #include <linux/list.h>
4 #include <linux/acpi.h>
5 
6 struct cxl_mock_ops {
7 	struct list_head list;
8 	bool (*is_mock_adev)(struct acpi_device *dev);
9 	int (*acpi_table_parse_cedt)(enum acpi_cedt_type id,
10 				     acpi_tbl_entry_handler_arg handler_arg,
11 				     void *arg);
12 	bool (*is_mock_bridge)(struct device *dev);
13 	acpi_status (*acpi_evaluate_integer)(acpi_handle handle,
14 					     acpi_string pathname,
15 					     struct acpi_object_list *arguments,
16 					     unsigned long long *data);
17 	struct acpi_pci_root *(*acpi_pci_find_root)(acpi_handle handle);
18 	struct platform_device *(*mock_port)(struct pci_bus *bus, int index);
19 	bool (*is_mock_bus)(struct pci_bus *bus);
20 	bool (*is_mock_port)(struct platform_device *pdev);
21 	bool (*is_mock_dev)(struct device *dev);
22 };
23 
24 void register_cxl_mock_ops(struct cxl_mock_ops *ops);
25 void unregister_cxl_mock_ops(struct cxl_mock_ops *ops);
26 struct cxl_mock_ops *get_cxl_mock_ops(int *index);
27 void put_cxl_mock_ops(int index);
28