1 /* SPDX-License-Identifier: GPL-2.0-or-later * 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* 2 /* 3 * CXL protocol Error INJection support. 3 * CXL protocol Error INJection support. 4 * 4 * 5 * Copyright (c) 2023 Advanced Micro Devices, 5 * Copyright (c) 2023 Advanced Micro Devices, Inc. 6 * All Rights Reserved. 6 * All Rights Reserved. 7 * 7 * 8 * Author: Ben Cheatham <benjamin.cheatham@amd 8 * Author: Ben Cheatham <benjamin.cheatham@amd.com> 9 */ 9 */ 10 #ifndef EINJ_CXL_H 10 #ifndef EINJ_CXL_H 11 #define EINJ_CXL_H 11 #define EINJ_CXL_H 12 12 13 #include <linux/errno.h> 13 #include <linux/errno.h> 14 #include <linux/types.h> 14 #include <linux/types.h> 15 15 16 struct pci_dev; 16 struct pci_dev; 17 struct seq_file; 17 struct seq_file; 18 18 19 #if IS_ENABLED(CONFIG_ACPI_APEI_EINJ_CXL) 19 #if IS_ENABLED(CONFIG_ACPI_APEI_EINJ_CXL) 20 int einj_cxl_available_error_type_show(struct 20 int einj_cxl_available_error_type_show(struct seq_file *m, void *v); 21 int einj_cxl_inject_error(struct pci_dev *dpor 21 int einj_cxl_inject_error(struct pci_dev *dport_dev, u64 type); 22 int einj_cxl_inject_rch_error(u64 rcrb, u64 ty 22 int einj_cxl_inject_rch_error(u64 rcrb, u64 type); 23 bool einj_cxl_is_initialized(void); 23 bool einj_cxl_is_initialized(void); 24 #else /* !IS_ENABLED(CONFIG_ACPI_APEI_EINJ_CXL 24 #else /* !IS_ENABLED(CONFIG_ACPI_APEI_EINJ_CXL) */ 25 static inline int einj_cxl_available_error_typ 25 static inline int einj_cxl_available_error_type_show(struct seq_file *m, 26 26 void *v) 27 { 27 { 28 return -ENXIO; 28 return -ENXIO; 29 } 29 } 30 30 31 static inline int einj_cxl_inject_error(struct 31 static inline int einj_cxl_inject_error(struct pci_dev *dport_dev, u64 type) 32 { 32 { 33 return -ENXIO; 33 return -ENXIO; 34 } 34 } 35 35 36 static inline int einj_cxl_inject_rch_error(u6 36 static inline int einj_cxl_inject_rch_error(u64 rcrb, u64 type) 37 { 37 { 38 return -ENXIO; 38 return -ENXIO; 39 } 39 } 40 40 41 static inline bool einj_cxl_is_initialized(voi 41 static inline bool einj_cxl_is_initialized(void) { return false; } 42 #endif /* CONFIG_ACPI_APEI_EINJ_CXL */ 42 #endif /* CONFIG_ACPI_APEI_EINJ_CXL */ 43 43 44 #endif /* EINJ_CXL_H */ 44 #endif /* EINJ_CXL_H */ 45 45
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.