summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
diff options
context:
space:
mode:
authoryhsu3 <yhsu3@lenovo.com>2024-09-08 17:45:54 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-09-11 16:36:03 +0000
commit589304e67fbfcbb7c250d1a3031ef23c4fb8a41b (patch)
tree797b9ab8058d96db931b3eb900e4ff333f521dc0 /NetworkPkg
parent58b4bf7b7e526cec295bfbc6caa4a5cf223a1c53 (diff)
downloadedk2-589304e67fbfcbb7c250d1a3031ef23c4fb8a41b.tar.gz
edk2-589304e67fbfcbb7c250d1a3031ef23c4fb8a41b.tar.bz2
edk2-589304e67fbfcbb7c250d1a3031ef23c4fb8a41b.zip
Support Report Status Code in the UefiPxe driver.
Report PXE error status via Status Code, with this design, it will be flexible to register a status code handler via gEfiRscHandlerProtocolGuid to output the customized error code to other telemetry service. The subclass code is `EFI_IO_BUS_IP_NETWORK` Signed-off-by: Ethan Hsu <Eathonhsu@gmail.com>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c7
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c7
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h1
-rw-r--r--NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf1
4 files changed, 16 insertions, 0 deletions
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
index f22a151e25..0af791dc5f 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
@@ -1268,5 +1268,12 @@ ON_EXIT:
AsciiPrint ("\n PXE-E99: Unexpected network error.\n");
}
+ REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
+ EFI_ERROR_CODE,
+ (EFI_STATUS_CODE_VALUE)(EFI_IO_BUS_IP_NETWORK | EFI_OEM_SPECIFIC | ((EFI_STATUS_CODE_VALUE)(Status & 0x1F))),
+ (VOID *)&(PxeBcMode->UsingIpv6),
+ sizeof (PxeBcMode->UsingIpv6)
+ );
+
return Status;
}
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
index 0a4baf6f90..e296474471 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
@@ -72,6 +72,13 @@ EfiPxeBcStart (
return EFI_UNSUPPORTED;
}
+ REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
+ EFI_PROGRESS_CODE,
+ EFI_IO_BUS_IP_NETWORK | EFI_IOB_PC_RECONFIG,
+ (VOID *)&(Mode->UsingIpv6),
+ sizeof (Mode->UsingIpv6)
+ );
+
if (Mode->UsingIpv6) {
AsciiPrint ("\n>>Start PXE over IPv6");
//
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h
index 732889f23d..cdb9b34480 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.h
@@ -48,6 +48,7 @@
#include <Library/DpcLib.h>
#include <Library/DevicePathLib.h>
#include <Library/PcdLib.h>
+#include <Library/ReportStatusCodeLib.h>
typedef struct _PXEBC_PRIVATE_DATA PXEBC_PRIVATE_DATA;
typedef struct _PXEBC_PRIVATE_PROTOCOL PXEBC_PRIVATE_PROTOCOL;
diff --git a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
index 3371c150be..d5aba1376a 100644
--- a/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
+++ b/NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf
@@ -62,6 +62,7 @@
DpcLib
DevicePathLib
PcdLib
+ ReportStatusCodeLib
[Protocols]
## TO_START