blob: 4dbaa7081530ac7f770bbb7ce5f5211372469ae8 [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
Betty Dall9e50a912013-06-06 12:10:49 -060010#define AER_NONFATAL 0
11#define AER_FATAL 1
12#define AER_CORRECTABLE 2
13
Huang Yingc413d762011-02-21 13:54:43 +080014struct aer_header_log_regs {
15 unsigned int dw0;
16 unsigned int dw1;
17 unsigned int dw2;
18 unsigned int dw3;
19};
20
21struct aer_capability_regs {
22 u32 header;
23 u32 uncor_status;
24 u32 uncor_mask;
25 u32 uncor_severity;
26 u32 cor_status;
27 u32 cor_mask;
28 u32 cap_control;
29 struct aer_header_log_regs header_log;
30 u32 root_command;
31 u32 root_status;
32 u16 cor_err_source;
33 u16 uncor_err_source;
34};
35
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080036#if defined(CONFIG_PCIEAER)
37/* pci-e port driver needs this function to enable aer */
Betty Dallfde41b92013-06-06 14:35:35 -060038int pci_enable_pcie_error_reporting(struct pci_dev *dev);
39int pci_disable_pcie_error_reporting(struct pci_dev *dev);
40int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080041#else
Randy Dunlap5547bbe2007-08-23 10:37:53 -070042static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
43{
44 return -EINVAL;
45}
Randy Dunlap5547bbe2007-08-23 10:37:53 -070046static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
47{
48 return -EINVAL;
49}
50static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
51{
52 return -EINVAL;
53}
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080054#endif
55
Linus Torvalds862f0012013-07-03 16:31:35 -070056void cper_print_aer(struct pci_dev *dev, int cper_severity,
Betty Dallfde41b92013-06-06 14:35:35 -060057 struct aer_capability_regs *aer);
58int cper_severity_to_aer(int cper_severity);
59void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
Linus Torvalds862f0012013-07-03 16:31:35 -070060 int severity,
61 struct aer_capability_regs *aer_regs);
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080062#endif //_AER_H_
63