aer.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (C) 2006 Intel Corp.
  3. * Tom Long Nguyen (tom.l.nguyen@intel.com)
  4. * Zhang Yanmin (yanmin.zhang@intel.com)
  5. */
  6. #ifndef _AER_H_
  7. #define _AER_H_
  8. #define AER_NONFATAL 0
  9. #define AER_FATAL 1
  10. #define AER_CORRECTABLE 2
  11. struct aer_header_log_regs {
  12. unsigned int dw0;
  13. unsigned int dw1;
  14. unsigned int dw2;
  15. unsigned int dw3;
  16. };
  17. struct 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. #if defined(CONFIG_PCIEAER)
  32. /* pci-e port driver needs this function to enable aer */
  33. int pci_enable_pcie_error_reporting(struct pci_dev *dev);
  34. int pci_disable_pcie_error_reporting(struct pci_dev *dev);
  35. int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
  36. #else
  37. static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
  38. {
  39. return -EINVAL;
  40. }
  41. static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
  42. {
  43. return -EINVAL;
  44. }
  45. static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
  46. {
  47. return -EINVAL;
  48. }
  49. #endif
  50. void cper_print_aer(const char *prefix, struct pci_dev *dev, int cper_severity,
  51. struct aer_capability_regs *aer);
  52. int cper_severity_to_aer(int cper_severity);
  53. void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
  54. int severity);
  55. #endif //_AER_H_