diff mbox

[edk2] MdeModulePkg/Mtftp4Dxe: Add 'file not found' debug message to MTFTP

Message ID 0877601216922E4B83A7129715B5DA2BA7B7583D30@GEORGE.Emea.Arm.com
State New
Headers show

Commit Message

Olivier Martin May 14, 2014, 5:05 p.m. UTC
Dear MdeModulePkg maintainer,
please find the attached patch that clarifies the MTFTP error message. It says if a requested file is not found. It can help user to understand why the file transfer did not work.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brendan Jackman <Brendan.JackMan@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>

Regards,
Olivier

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2548782
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
diff mbox

Patch

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(-)

diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
index f3a4952..10943c7 100644
--- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
+++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.c
@@ -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