aer.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. #include <linux/types.h>
  9. #define AER_NONFATAL 0
  10. #define AER_FATAL 1
  11. #define AER_CORRECTABLE 2
  12. struct pci_dev;
  13. struct aer_header_log_regs {
  14. unsigned int dw0;
  15. unsigned int dw1;
  16. unsigned int dw2;
  17. unsigned int dw3;
  18. };
  19. struct aer_capability_regs {
  20. u32 header;
  21. u32 uncor_status;
  22. u32 uncor_mask;
  23. u32 uncor_severity;
  24. u32 cor_status;
  25. u32 cor_mask;
  26. u32 cap_control;
  27. struct aer_header_log_regs header_log;
  28. u32 root_command;
  29. u32 root_status;
  30. u16 cor_err_source;
  31. u16 uncor_err_source;
  32. };
  33. #if defined(CONFIG_PCIEAER)
  34. /* pci-e port driver needs this function to enable aer */
  35. int pci_enable_pcie_error_reporting(struct pci_dev *dev);
  36. int pci_disable_pcie_error_reporting(struct pci_dev *dev);
  37. int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
  38. int pci_cleanup_aer_error_status_regs(struct pci_dev *dev);
  39. #else
  40. static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
  41. {
  42. return -EINVAL;
  43. }
  44. static inline int pci_disable_pcie_error_reporting(struct pci_dev *dev)
  45. {
  46. return -EINVAL;
  47. }
  48. static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
  49. {
  50. return -EINVAL;
  51. }
  52. static inline int pci_cleanup_aer_error_status_regs(struct pci_dev *dev)
  53. {
  54. return -EINVAL;
  55. }
  56. #endif
  57. void cper_print_aer(struct pci_dev *dev, int cper_severity,
  58. struct aer_capability_regs *aer);
  59. int cper_severity_to_aer(int cper_severity);
  60. void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
  61. int severity,
  62. struct aer_capability_regs *aer_regs);
  63. #endif //_AER_H_