(VOID *) &LoadfilePtr->Private->CallbackProtocolPtr\r
);\r
\r
- switch (Status) {\r
- case EFI_SUCCESS:\r
+ if (Status == EFI_SUCCESS) {\r
//\r
// There is already a callback routine. Do nothing.\r
//\r
DEBUG ((EFI_D_WARN, "\nLoadFile() BC callback exists."));\r
- break;\r
-\r
- case EFI_UNSUPPORTED:\r
+ } else if (Status == EFI_UNSUPPORTED) {\r
//\r
// No BaseCode Callback protocol found. Add our own.\r
//\r
&NewMakeCallback\r
);\r
}\r
-\r
- break;\r
-\r
- default:\r
+ } else {\r
DEBUG ((EFI_D_WARN, "\nLoadFile() Callback check status == %xh", Status));\r
}\r
//\r
\r
DEBUG ((EFI_D_WARN, "\nBC.Loadfile() Status == %xh\n", Status));\r
\r
- switch (Status) {\r
- case EFI_SUCCESS: /* 0 */\r
+ if (Status == EFI_SUCCESS) {\r
+ /* 0 */\r
return EFI_SUCCESS;\r
-\r
- case EFI_BUFFER_TOO_SMALL: /* 5 */\r
+ } else if (Status == EFI_BUFFER_TOO_SMALL) {\r
+ /* 5 */\r
//\r
// Error is only displayed when we are actually trying to\r
// download the boot image.\r
if (Buffer == NULL) {\r
return EFI_BUFFER_TOO_SMALL;\r
}\r
-\r
AsciiPrint ("\nPXE-E05: Download buffer is smaller than requested file.\n");\r
- break;\r
-\r
- case EFI_DEVICE_ERROR: /* 7 */\r
+ } else if (Status == EFI_DEVICE_ERROR) {\r
+ /* 7 */\r
AsciiPrint ("\nPXE-E07: Network device error. Check network connection.\n");\r
- break;\r
-\r
- case EFI_OUT_OF_RESOURCES: /* 9 */\r
+ } else if (Status == EFI_OUT_OF_RESOURCES) {\r
+ /* 9 */\r
AsciiPrint ("\nPXE-E09: Could not allocate I/O buffers.\n");\r
- break;\r
-\r
- case EFI_NO_MEDIA: /* 12 */\r
+ } else if (Status == EFI_NO_MEDIA) {\r
+ /* 12 */\r
AsciiPrint ("\nPXE-E12: Could not detect network connection. Check cable.\n");\r
- break;\r
-\r
- case EFI_NO_RESPONSE: /* 16 */\r
+ } else if (Status == EFI_NO_RESPONSE) {\r
+ /* 16 */\r
AsciiPrint ("\nPXE-E16: Valid PXE offer not received.\n");\r
- break;\r
-\r
- case EFI_TIMEOUT: /* 18 */\r
+ } else if (Status == EFI_TIMEOUT) {\r
+ /* 18 */\r
AsciiPrint ("\nPXE-E18: Timeout. Server did not respond.\n");\r
- break;\r
-\r
- case EFI_ABORTED: /* 21 */\r
+ } else if (Status == EFI_ABORTED) {\r
+ /* 21 */\r
AsciiPrint ("\nPXE-E21: Remote boot cancelled.\n");\r
- break;\r
-\r
- case EFI_ICMP_ERROR: /* 22 */\r
+ } else if (Status == EFI_ICMP_ERROR) {\r
+ /* 22 */\r
AsciiPrint ("\nPXE-E22: Client received ICMP error from server.\n");\r
\r
- if (LoadfilePtr->Private->EfiBc.Mode == NULL) {\r
- break;\r
- }\r
-\r
- if (!LoadfilePtr->Private->EfiBc.Mode->IcmpErrorReceived) {\r
- break;\r
- }\r
+ if ((LoadfilePtr->Private->EfiBc.Mode != NULL) && LoadfilePtr->Private->EfiBc.Mode->IcmpErrorReceived) {\r
+ AsciiPrint (\r
+ "PXE-E98: Type: %xh Code: %xh ",\r
+ LoadfilePtr->Private->EfiBc.Mode->IcmpError.Type,\r
+ LoadfilePtr->Private->EfiBc.Mode->IcmpError.Code\r
+ );\r
\r
- AsciiPrint (\r
- "PXE-E98: Type: %xh Code: %xh ",\r
- LoadfilePtr->Private->EfiBc.Mode->IcmpError.Type,\r
- LoadfilePtr->Private->EfiBc.Mode->IcmpError.Code\r
- );\r
+ switch (LoadfilePtr->Private->EfiBc.Mode->IcmpError.Type) {\r
+ case 0x03:\r
+ switch (LoadfilePtr->Private->EfiBc.Mode->IcmpError.Code) {\r
+ case 0x00: /* net unreachable */\r
+ AsciiPrint ("Net unreachable");\r
+ break;\r
\r
- switch (LoadfilePtr->Private->EfiBc.Mode->IcmpError.Type) {\r
- case 0x03:\r
- switch (LoadfilePtr->Private->EfiBc.Mode->IcmpError.Code) {\r
- case 0x00: /* net unreachable */\r
- AsciiPrint ("Net unreachable");\r
- break;\r
+ case 0x01: /* host unreachable */\r
+ AsciiPrint ("Host unreachable");\r
+ break;\r
\r
- case 0x01: /* host unreachable */\r
- AsciiPrint ("Host unreachable");\r
- break;\r
+ case 0x02: /* protocol unreachable */\r
+ AsciiPrint ("Protocol unreachable");\r
+ break;\r
\r
- case 0x02: /* protocol unreachable */\r
- AsciiPrint ("Protocol unreachable");\r
- break;\r
+ case 0x03: /* port unreachable */\r
+ AsciiPrint ("Port unreachable");\r
+ break;\r
\r
- case 0x03: /* port unreachable */\r
- AsciiPrint ("Port unreachable");\r
- break;\r
+ case 0x04: /* Fragmentation needed */\r
+ AsciiPrint ("Fragmentation needed");\r
+ break;\r
\r
- case 0x04: /* Fragmentation needed */\r
- AsciiPrint ("Fragmentation needed");\r
- break;\r
+ case 0x05: /* Source route failed */\r
+ AsciiPrint ("Source route failed");\r
+ break;\r
+ }\r
\r
- case 0x05: /* Source route failed */\r
- AsciiPrint ("Source route failed");\r
break;\r
}\r
\r
- break;\r
+ AsciiPrint ("\n");\r
}\r
-\r
- AsciiPrint ("\n");\r
-\r
- break;\r
-\r
- case EFI_TFTP_ERROR: /* 23 */\r
+ } else if (Status == EFI_TFTP_ERROR) {\r
+ /* 23 */\r
AsciiPrint ("\nPXE-E23: Client received TFTP error from server.\n");\r
\r
- if (LoadfilePtr->Private->EfiBc.Mode == NULL) {\r
- break;\r
- }\r
-\r
- if (LoadfilePtr->Private->EfiBc.Mode->TftpErrorReceived) {\r
+ if ((LoadfilePtr->Private->EfiBc.Mode != NULL) && (LoadfilePtr->Private->EfiBc.Mode->TftpErrorReceived)) {\r
AsciiPrint (\r
"PXE-E98: Code: %xh %a\n",\r
LoadfilePtr->Private->EfiBc.Mode->TftpError.ErrorCode,\r
LoadfilePtr->Private->EfiBc.Mode->TftpError.ErrorString\r
);\r
}\r
-\r
- break;\r
-\r
- default:\r
+ } else {\r
AsciiPrint ("\nPXE-E99: Unexpected network error: %xh\n", Status);\r
}\r
\r