|
@@ -31,26 +31,6 @@
|
|
|
#include "portdrv.h"
|
|
|
|
|
|
#define AER_ERROR_SOURCES_MAX 100
|
|
|
-#define AER_MAX_MULTI_ERR_DEVICES 5 /* Not likely to have more */
|
|
|
-
|
|
|
-struct aer_err_info {
|
|
|
- struct pci_dev *dev[AER_MAX_MULTI_ERR_DEVICES];
|
|
|
- int error_dev_num;
|
|
|
-
|
|
|
- unsigned int id:16;
|
|
|
-
|
|
|
- unsigned int severity:2; /* 0:NONFATAL | 1:FATAL | 2:COR */
|
|
|
- unsigned int __pad1:5;
|
|
|
- unsigned int multi_error_valid:1;
|
|
|
-
|
|
|
- unsigned int first_error:5;
|
|
|
- unsigned int __pad2:2;
|
|
|
- unsigned int tlp_header_valid:1;
|
|
|
-
|
|
|
- unsigned int status; /* COR/UNCOR Error Status */
|
|
|
- unsigned int mask; /* COR/UNCOR Error Mask */
|
|
|
- struct aer_header_log_regs tlp; /* TLP Header */
|
|
|
-};
|
|
|
|
|
|
struct aer_err_source {
|
|
|
unsigned int status;
|
|
@@ -547,7 +527,7 @@ static void __aer_print_error(struct pci_dev *dev,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-static void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
|
|
|
+void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
|
|
|
{
|
|
|
int layer, agent;
|
|
|
int id = ((dev->bus->number << 8) | dev->devfn);
|
|
@@ -876,7 +856,7 @@ EXPORT_SYMBOL_GPL(aer_recover_queue);
|
|
|
#endif
|
|
|
|
|
|
/**
|
|
|
- * get_device_error_info - read error status from dev and store it to info
|
|
|
+ * aer_get_device_error_info - read error status from dev and store it to info
|
|
|
* @dev: pointer to the device expected to have a error record
|
|
|
* @info: pointer to structure to store the error record
|
|
|
*
|
|
@@ -884,7 +864,7 @@ EXPORT_SYMBOL_GPL(aer_recover_queue);
|
|
|
*
|
|
|
* Note that @info is reused among all error devices. Clear fields properly.
|
|
|
*/
|
|
|
-static int get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
|
|
|
+int aer_get_device_error_info(struct pci_dev *dev, struct aer_err_info *info)
|
|
|
{
|
|
|
int pos, temp;
|
|
|
|
|
@@ -942,11 +922,11 @@ static inline void aer_process_err_devices(struct aer_err_info *e_info)
|
|
|
|
|
|
/* Report all before handle them, not to lost records by reset etc. */
|
|
|
for (i = 0; i < e_info->error_dev_num && e_info->dev[i]; i++) {
|
|
|
- if (get_device_error_info(e_info->dev[i], e_info))
|
|
|
+ if (aer_get_device_error_info(e_info->dev[i], e_info))
|
|
|
aer_print_error(e_info->dev[i], e_info);
|
|
|
}
|
|
|
for (i = 0; i < e_info->error_dev_num && e_info->dev[i]; i++) {
|
|
|
- if (get_device_error_info(e_info->dev[i], e_info))
|
|
|
+ if (aer_get_device_error_info(e_info->dev[i], e_info))
|
|
|
handle_error_source(e_info->dev[i], e_info);
|
|
|
}
|
|
|
}
|