aer-inject: support multiple PCI domains
Add support for multiple PCI domains (segments). This patch requires
corresponding support in the aer_inject driver (2.6.33 or later).
Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>
diff --git a/aer.h b/aer.h
index 2061a93..00d98cd 100644
--- a/aer.h
+++ b/aer.h
@@ -1,6 +1,8 @@
#ifndef AER_H
#define AER_H
+#include <stdint.h>
+
struct aer_error_inj
{
int8_t bus;
@@ -12,6 +14,7 @@
int32_t header_log1;
int32_t header_log2;
int32_t header_log3;
+ uint16_t domain;
};
#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */
diff --git a/aer.lex b/aer.lex
index b3c6a30..b79733a 100644
--- a/aer.lex
+++ b/aer.lex
@@ -53,6 +53,7 @@
#define KEY(x) { #x, x }
#define KEYVAL(x,v) { #x, x, v }
KEY(AER),
+ KEY(DOMAIN),
KEY(BUS),
KEY(DEV),
KEY(FN),
diff --git a/aer.y b/aer.y
index 80b002e..f30ad8b 100644
--- a/aer.y
+++ b/aer.y
@@ -27,7 +27,7 @@
%}
-%token AER BUS DEV FN UNCOR_STATUS COR_STATUS HEADER_LOG
+%token AER DOMAIN BUS DEV FN UNCOR_STATUS COR_STATUS HEADER_LOG
%token TRAIN DLP POISON_TLP FCP COMP_TIME COMP_ABORT UNX_COMP RX_OVER MALF_TLP
%token ECRC UNSUP
%token RCVR BAD_TLP BAD_DLLP REP_ROLL REP_TIMER
@@ -48,7 +48,12 @@
aer_term: UNCOR_STATUS uncor_status_list { aerr.uncor_status = $2; }
| COR_STATUS cor_status_list { aerr.cor_status = $2; }
- | BUS NUMBER DEV NUMBER FN NUMBER { aerr.bus = $2;
+ | DOMAIN NUMBER BUS NUMBER DEV NUMBER FN NUMBER { aerr.domain = $2;
+ aerr.bus = $4;
+ aerr.dev = $6;
+ aerr.fn = $8; }
+ | BUS NUMBER DEV NUMBER FN NUMBER { aerr.domain = 0;
+ aerr.bus = $2;
aerr.dev = $4;
aerr.fn = $6; }
| HEADER_LOG NUMBER NUMBER NUMBER NUMBER { aerr.header_log0 = $2;