aer.h 1.7 KB

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