From 21def103d55dd7b0fd5562634a21415afbb841e2 Mon Sep 17 00:00:00 2001 From: Brendan Jackman Date: Wed, 21 May 2014 05:59:47 +0000 Subject: Add 'file not found' debug message to MTFTP. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brendan Jackman Reviewed-By: Olivier Martin Reviewed-by: Fu, Siyuan Reviewed-by: Wu, Jiaxin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15543 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c index f3a4952..03b7f28 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c @@ -1,7 +1,7 @@ /** @file Interface routine for Mtftp4. -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -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; -- cgit v1.1