blob: c826d1c28f9c866d79fb0460c0b0ce1e87c2b420 [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
Mike Qiu5ccb8222014-07-29 10:49:25 -070014struct pci_dev;
15
Huang Yingc413d762011-02-21 13:54:43 +080016struct aer_header_log_regs {
17 unsigned int dw0;
18 unsigned int dw1;
19 unsigned int dw2;
20 unsigned int dw3;
21};
22
23struct aer_capability_regs {
24 u32 header;
25 u32 uncor_status;
26 u32 uncor_mask;
27 u32 uncor_severity;
28 u32 cor_status;
29 u32 cor_mask;
30 u32 cap_control;
31 struct aer_header_log_regs header_log;
32 u32 root_command;
33 u32 root_status;
34 u16 cor_err_source;
35 u16 uncor_err_source;
36};
37
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080038#if defined(CONFIG_PCIEAER)
39/* pci-e port driver needs this function to enable aer */
Betty Dallfde41b92013-06-06 14:35:35 -060040int pci_enable_pcie_error_reporting(struct pci_dev *dev);
41int pci_disable_pcie_error_reporting(struct pci_dev *dev);
42int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080043#else
Randy Dunlap5547bbe2007-08-23 10:37:53 -070044static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
45{
46 return -EINVAL;
47}
Randy Dunlap5547bbe2007-08-23 10:37:53 -070048static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
49{
50 return -EINVAL;
51}
52static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
53{
54 return -EINVAL;
55}
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080056#endif
57
Linus Torvalds862f0012013-07-03 16:31:35 -070058void cper_print_aer(struct pci_dev *dev, int cper_severity,
Betty Dallfde41b92013-06-06 14:35:35 -060059 struct aer_capability_regs *aer);
60int cper_severity_to_aer(int cper_severity);
61void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
Linus Torvalds862f0012013-07-03 16:31:35 -070062 int severity,
63 struct aer_capability_regs *aer_regs);
Zhang, Yanmin6c2b3742006-07-31 15:21:33 +080064#endif //_AER_H_
65