#define HISI_PCIE_LOCAL_VALID_ERR_SEVERITY BIT(8)
#define HISI_PCIE_LOCAL_VALID_ERR_MISC 9
+#define HISI_PCIE_LOCAL_ERR_MISC_MAX 33
+#define HISI_BUF_LEN 1024
+
+#define HISI_ERR_SEVERITY_NFE 0
+#define HISI_ERR_SEVERITY_FE 1
+#define HISI_ERR_SEVERITY_CE 2
+#define HISI_ERR_SEVERITY_NONE 3
+
struct hisi_oem_type1_err_sec {
uint32_t val_bits;
uint8_t version;
uint8_t err_severity;
uint16_t err_type;
uint8_t reserv[2];
- uint32_t err_misc[33];
+ uint32_t err_misc[HISI_PCIE_LOCAL_ERR_MISC_MAX];
};
enum hisi_oem_data_type {
static char *err_severity(uint8_t err_sev)
{
switch (err_sev) {
- case 0: return "recoverable";
- case 1: return "fatal";
- case 2: return "corrected";
- case 3: return "none";
+ case HISI_ERR_SEVERITY_NFE: return "recoverable";
+ case HISI_ERR_SEVERITY_FE: return "fatal";
+ case HISI_ERR_SEVERITY_CE: return "corrected";
+ case HISI_ERR_SEVERITY_NONE: return "none";
}
return "unknown";
}
struct trace_seq *s,
const struct hisi_oem_type1_err_sec *err)
{
- char buf[1024];
+ char buf[HISI_BUF_LEN];
char *p = buf;
p += sprintf(p, "[ ");
struct trace_seq *s,
const struct hisi_oem_type1_err_sec *err)
{
- char buf[1024];
+ char buf[HISI_BUF_LEN];
char *p = buf;
trace_seq_printf(s, "Reg Dump:\n");
struct trace_seq *s,
const struct hisi_oem_type2_err_sec *err)
{
- char buf[1024];
+ char buf[HISI_BUF_LEN];
char *p = buf;
p += sprintf(p, "[ ");
struct trace_seq *s,
const struct hisi_oem_type2_err_sec *err)
{
- char buf[1024];
+ char buf[HISI_BUF_LEN];
char *p = buf;
trace_seq_printf(s, "Reg Dump:\n");
struct trace_seq *s,
const struct hisi_pcie_local_err_sec *err)
{
- char buf[1024];
+ char buf[HISI_BUF_LEN];
char *p = buf;
p += sprintf(p, "[ ");
struct trace_seq *s,
const struct hisi_pcie_local_err_sec *err)
{
- char buf[1024];
+ char buf[HISI_BUF_LEN];
char *p = buf;
uint32_t i;
trace_seq_printf(s, "Reg Dump:\n");
- for (i = 0; i < 33; i++) {
+ for (i = 0; i < HISI_PCIE_LOCAL_ERR_MISC_MAX; i++) {
if (err->val_bits & BIT(HISI_PCIE_LOCAL_VALID_ERR_MISC + i)) {
trace_seq_printf(s, "ERR_MISC_%d=0x%x\n", i,
err->err_misc[i]);