From c817b18f6eab6808cfe6e2e94567b36ceeb30987 Mon Sep 17 00:00:00 2001
From: Brendan Jackman <Brendan.Jackman@arm.com>
Date: Mon, 12 May 2014 17:29:18 +0100
Subject: MdeModulePkg/Network/Mtftp4Dxe: Add 'file not found' debug message to MTFTP
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brendan Jackman <Brendan.JackMan@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
---
.../Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
@@ -120,6 +120,7 @@ Mtftp4GetInfoCheckPacket (
MTFTP4_GETINFO_STATE *State;
EFI_STATUS Status;
UINT16 OpCode;
+ EFI_MTFTP4_ERROR_HEADER *ErrorHeader;
State = (MTFTP4_GETINFO_STATE *) Token->Context;
OpCode = NTOHS (Packet->OpCode);
@@ -129,6 +130,12 @@ Mtftp4GetInfoCheckPacket (
//
switch (OpCode) {
case EFI_MTFTP4_OPCODE_ERROR:
+ ErrorHeader = (EFI_MTFTP4_ERROR_HEADER *) Packet;
+ if (ErrorHeader->ErrorCode == EFI_MTFTP4_ERRORCODE_FILE_NOT_FOUND) {
+ DEBUG ((EFI_D_ERROR, "TFTP error code 1 (File Not Found)\n"));
+ } else {
+ DEBUG ((EFI_D_ERROR, "TFTP error code %d\n", ErrorHeader->ErrorCode));
+ }
State->Status = EFI_TFTP_ERROR;
break;
--
1.7.5.4