blob: 544abdb2238ccdffda329816578b41bb954fc617 [file] [log] [blame]
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +08001/*
2 * Copyright (C) 2006 Intel Corp.
3 * Tom Long Nguyen (tom.l.nguyen@intel.com)
4 * Zhang Yanmin (yanmin.zhang@intel.com)
5 */
6
7#ifndef _AER_H_
8#define _AER_H_
9
Huang Yingc413d762011-02-21 13:54:43 +080010struct aer_header_log_regs {
11 unsigned int dw0;
12 unsigned int dw1;
13 unsigned int dw2;
14 unsigned int dw3;
15};
16
17struct aer_capability_regs {
18 u32 header;
19 u32 uncor_status;
20 u32 uncor_mask;
21 u32 uncor_severity;
22 u32 cor_status;
23 u32 cor_mask;
24 u32 cap_control;
25 struct aer_header_log_regs header_log;
26 u32 root_command;
27 u32 root_status;
28 u16 cor_err_source;
29 u16 uncor_err_source;
30};
31
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080032#if defined(CONFIG_PCIEAER)
33/* pci-e port driver needs this function to enable aer */
34extern int pci_enable_pcie_error_reporting(struct pci_dev *dev);
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080035extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
36extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
37#else
Randy Dunlap5547bbe2007-08-23 10:37:53 -070038static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
39{
40 return -EINVAL;
41}
Randy Dunlap5547bbe2007-08-23 10:37:53 -070042static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
43{
44 return -EINVAL;
45}
46static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
47{
48 return -EINVAL;
49}
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080050#endif
51
Huang Yingc413d762011-02-21 13:54:43 +080052extern void cper_print_aer(const char *prefix, int cper_severity,
53 struct aer_capability_regs *aer);
Huang Ying09184722011-05-17 16:08:37 +080054extern int cper_severity_to_aer(int cper_severity);
55extern void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
56 int severity);
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080057#endif //_AER_H_
58