Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / include / linux / aer.h
blob8f87bbeceef41948fd0dc22cf16db22534b04e71
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) 2006 Intel Corp.
4 * Tom Long Nguyen (tom.l.nguyen@intel.com)
5 * Zhang Yanmin (yanmin.zhang@intel.com)
6 */
8 #ifndef _AER_H_
9 #define _AER_H_
11 #include <linux/errno.h>
12 #include <linux/types.h>
14 #define AER_NONFATAL 0
15 #define AER_FATAL 1
16 #define AER_CORRECTABLE 2
18 struct pci_dev;
20 struct aer_header_log_regs {
21 unsigned int dw0;
22 unsigned int dw1;
23 unsigned int dw2;
24 unsigned int dw3;
27 struct aer_capability_regs {
28 u32 header;
29 u32 uncor_status;
30 u32 uncor_mask;
31 u32 uncor_severity;
32 u32 cor_status;
33 u32 cor_mask;
34 u32 cap_control;
35 struct aer_header_log_regs header_log;
36 u32 root_command;
37 u32 root_status;
38 u16 cor_err_source;
39 u16 uncor_err_source;
42 #if defined(CONFIG_PCIEAER)
43 /* PCIe port driver needs this function to enable AER */
44 int pci_enable_pcie_error_reporting(struct pci_dev *dev);
45 int pci_disable_pcie_error_reporting(struct pci_dev *dev);
46 int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
47 int pci_cleanup_aer_error_status_regs(struct pci_dev *dev);
48 #else
49 static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
51 return -EINVAL;
53 static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
55 return -EINVAL;
57 static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
59 return -EINVAL;
61 static inline int pci_cleanup_aer_error_status_regs(struct pci_dev *dev)
63 return -EINVAL;
65 #endif
67 void cper_print_aer(struct pci_dev *dev, int aer_severity,
68 struct aer_capability_regs *aer);
69 int cper_severity_to_aer(int cper_severity);
70 void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
71 int severity, struct aer_capability_regs *aer_regs);
72 #endif //_AER_H_