diff mbox series

acpi: einj: test more error injection actions for einjv2 (mantis 2287)

Message ID 20231229080723.29961-1-ivan.hu@canonical.com
State Accepted
Headers show
Series acpi: einj: test more error injection actions for einjv2 (mantis 2287) | expand

Commit Message

ivanhu Dec. 29, 2023, 8:07 a.m. UTC
BugLink:https://bugs.launchpad.net/fwts/+bug/2047212

Add more error injection actions EINJV2_SET_ERROR_TYPE and
EINJV2_GET_ERROR_TYPE for AVPI6.5

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/acpi/einj/einj.c | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/src/acpi/einj/einj.c b/src/acpi/einj/einj.c
index 7aae08b0..e52bd873 100644
--- a/src/acpi/einj/einj.c
+++ b/src/acpi/einj/einj.c
@@ -81,14 +81,26 @@  static int einj_test1(fwts_framework *fw)
 		fwts_log_info_verbatim(fw, "    Mask                : 0x%16.16"
 				PRIx64, entry->mask);
 
-		if (entry->serialization_action > 0x9 &&
-		    entry->serialization_action != 0xFF) {
-			fwts_failed(fw, LOG_LEVEL_MEDIUM,
-				    "EINJBadInjectionAction",
-				    "EINJ Injection Action must be within 0~9 "
-				    "or 0xFF got 0x%" PRIx8 " instead",
-				    entry->serialization_action);
-			passed = false;
+		if (einj->header.revision >= 2) {
+			if (entry->serialization_action > 0x11 &&
+			    entry->serialization_action != 0xFF) {
+				fwts_failed(fw, LOG_LEVEL_MEDIUM,
+					    "EINJBadInjectionAction",
+					    "EINJ Injection Action must be within 0~9 "
+					    "or 0xFF got 0x%" PRIx8 " instead",
+					    entry->serialization_action);
+				passed = false;
+			}
+		} else {
+			if (entry->serialization_action > 0x9 &&
+			    entry->serialization_action != 0xFF) {
+				fwts_failed(fw, LOG_LEVEL_MEDIUM,
+					    "EINJBadInjectionAction",
+					    "EINJ Injection Action must be within 0~9 "
+					    "or 0xFF got 0x%" PRIx8 " instead",
+					    entry->serialization_action);
+				passed = false;
+			}
 		}
 
 		if (entry->instruction > 0x4) {