NetworkPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the NetworkPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Maciej Rabeda <maciej.rabeda@linux.intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
2f88bd3a12
commit
d1050b9dff
@@ -56,7 +56,6 @@ PxeBcComponentNameGetDriverName (
|
||||
OUT CHAR16 **DriverName
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Retrieves a Unicode string that is the user-readable name of the controller
|
||||
that is being managed by a driver.
|
||||
@@ -135,11 +134,10 @@ PxeBcComponentNameGetControllerName (
|
||||
OUT CHAR16 **ControllerName
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// EFI Component Name Protocol
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName = {
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName = {
|
||||
PxeBcComponentNameGetDriverName,
|
||||
PxeBcComponentNameGetControllerName,
|
||||
"eng"
|
||||
@@ -148,13 +146,13 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName
|
||||
//
|
||||
// EFI Component Name 2 Protocol
|
||||
//
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPxeBcComponentName2 = {
|
||||
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME) PxeBcComponentNameGetDriverName,
|
||||
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) PxeBcComponentNameGetControllerName,
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gPxeBcComponentName2 = {
|
||||
(EFI_COMPONENT_NAME2_GET_DRIVER_NAME)PxeBcComponentNameGetDriverName,
|
||||
(EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME)PxeBcComponentNameGetControllerName,
|
||||
"en"
|
||||
};
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPxeBcDriverNameTable[] = {
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPxeBcDriverNameTable[] = {
|
||||
{
|
||||
"eng;en",
|
||||
L"UEFI PXE Base Code Driver"
|
||||
@@ -165,7 +163,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPxeBcDriverNameTab
|
||||
}
|
||||
};
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPxeBcControllerNameTable[] = {
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mPxeBcControllerNameTable[] = {
|
||||
{
|
||||
"eng;en",
|
||||
L"PXE Controller"
|
||||
@@ -223,7 +221,7 @@ PxeBcComponentNameGetDriverName (
|
||||
OUT CHAR16 **DriverName
|
||||
)
|
||||
{
|
||||
return LookupUnicodeString2(
|
||||
return LookupUnicodeString2 (
|
||||
Language,
|
||||
This->SupportedLanguages,
|
||||
mPxeBcDriverNameTable,
|
||||
@@ -232,7 +230,6 @@ PxeBcComponentNameGetDriverName (
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Retrieves a Unicode string that is the user-readable name of the controller
|
||||
that is being managed by a driver.
|
||||
@@ -311,11 +308,11 @@ PxeBcComponentNameGetControllerName (
|
||||
OUT CHAR16 **ControllerName
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_HANDLE NicHandle;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
EFI_STATUS Status;
|
||||
EFI_HANDLE NicHandle;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
|
||||
if (ControllerHandle == NULL || ChildHandle != NULL) {
|
||||
if ((ControllerHandle == NULL) || (ChildHandle != NULL)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
@@ -333,7 +330,7 @@ PxeBcComponentNameGetControllerName (
|
||||
Status = gBS->OpenProtocol (
|
||||
NicHandle,
|
||||
&gEfiCallerIdGuid,
|
||||
(VOID **) &Id,
|
||||
(VOID **)&Id,
|
||||
NULL,
|
||||
NULL,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
|
@@ -10,7 +10,6 @@
|
||||
|
||||
#include "PxeBcImpl.h"
|
||||
|
||||
|
||||
/**
|
||||
Display the string of the boot item.
|
||||
|
||||
@@ -22,27 +21,26 @@
|
||||
**/
|
||||
VOID
|
||||
PxeBcDisplayBootItem (
|
||||
IN UINT8 *Str,
|
||||
IN UINT8 Len
|
||||
IN UINT8 *Str,
|
||||
IN UINT8 Len
|
||||
)
|
||||
{
|
||||
UINT8 Tmp;
|
||||
UINT8 Tmp;
|
||||
|
||||
//
|
||||
// Cut off the chars behind 70th.
|
||||
//
|
||||
Len = (UINT8) MIN (PXEBC_DISPLAY_MAX_LINE, Len);
|
||||
Tmp = Str[Len];
|
||||
Str[Len] = 0;
|
||||
Len = (UINT8)MIN (PXEBC_DISPLAY_MAX_LINE, Len);
|
||||
Tmp = Str[Len];
|
||||
Str[Len] = 0;
|
||||
AsciiPrint ("%a \n", Str);
|
||||
|
||||
//
|
||||
// Restore the original 70th char.
|
||||
//
|
||||
Str[Len] = Tmp;
|
||||
Str[Len] = Tmp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Select and maintain the boot prompt if needed.
|
||||
|
||||
@@ -57,22 +55,22 @@ PxeBcDisplayBootItem (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcSelectBootPrompt (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
)
|
||||
{
|
||||
PXEBC_DHCP_PACKET_CACHE *Cache;
|
||||
PXEBC_VENDOR_OPTION *VendorOpt;
|
||||
EFI_PXE_BASE_CODE_MODE *Mode;
|
||||
EFI_EVENT TimeoutEvent;
|
||||
EFI_EVENT DescendEvent;
|
||||
EFI_INPUT_KEY InputKey;
|
||||
EFI_STATUS Status;
|
||||
UINT32 OfferType;
|
||||
UINT8 Timeout;
|
||||
UINT8 *Prompt;
|
||||
UINT8 PromptLen;
|
||||
INT32 SecCol;
|
||||
INT32 SecRow;
|
||||
PXEBC_DHCP_PACKET_CACHE *Cache;
|
||||
PXEBC_VENDOR_OPTION *VendorOpt;
|
||||
EFI_PXE_BASE_CODE_MODE *Mode;
|
||||
EFI_EVENT TimeoutEvent;
|
||||
EFI_EVENT DescendEvent;
|
||||
EFI_INPUT_KEY InputKey;
|
||||
EFI_STATUS Status;
|
||||
UINT32 OfferType;
|
||||
UINT8 Timeout;
|
||||
UINT8 *Prompt;
|
||||
UINT8 PromptLen;
|
||||
INT32 SecCol;
|
||||
INT32 SecRow;
|
||||
|
||||
TimeoutEvent = NULL;
|
||||
DescendEvent = NULL;
|
||||
@@ -83,7 +81,7 @@ PxeBcSelectBootPrompt (
|
||||
//
|
||||
// Only DhcpPxe10 and ProxyPxe10 offer needs boot prompt.
|
||||
//
|
||||
if (OfferType != PxeOfferTypeProxyPxe10 && OfferType != PxeOfferTypeDhcpPxe10) {
|
||||
if ((OfferType != PxeOfferTypeProxyPxe10) && (OfferType != PxeOfferTypeDhcpPxe10)) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -100,7 +98,8 @@ PxeBcSelectBootPrompt (
|
||||
// - a boot file name has been presented in the initial DHCP or ProxyDHCP offer packet.
|
||||
//
|
||||
if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) &&
|
||||
Cache->Dhcp4.OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {
|
||||
(Cache->Dhcp4.OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL))
|
||||
{
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
|
||||
@@ -110,7 +109,7 @@ PxeBcSelectBootPrompt (
|
||||
|
||||
Timeout = VendorOpt->MenuPrompt->Timeout;
|
||||
Prompt = VendorOpt->MenuPrompt->Prompt;
|
||||
PromptLen = (UINT8) (VendorOpt->MenuPromptLen - 1);
|
||||
PromptLen = (UINT8)(VendorOpt->MenuPromptLen - 1);
|
||||
|
||||
//
|
||||
// The valid scope of Timeout refers to PXE2.1 spec.
|
||||
@@ -118,6 +117,7 @@ PxeBcSelectBootPrompt (
|
||||
if (Timeout == 0) {
|
||||
return EFI_TIMEOUT;
|
||||
}
|
||||
|
||||
if (Timeout == 255) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@@ -185,46 +185,43 @@ PxeBcSelectBootPrompt (
|
||||
gST->ConOut->SetCursorPosition (gST->ConOut, SecCol + PromptLen, SecRow);
|
||||
AsciiPrint ("(%d) ", Timeout--);
|
||||
}
|
||||
|
||||
if (gST->ConIn->ReadKeyStroke (gST->ConIn, &InputKey) == EFI_NOT_READY) {
|
||||
gBS->Stall (10 * TICKS_PER_MS);
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
// Parse the input key by user.
|
||||
// If <F8> or <Ctrl> + <M> is pressed, return success to display the boot menu.
|
||||
//
|
||||
if (InputKey.ScanCode == 0) {
|
||||
|
||||
switch (InputKey.UnicodeChar) {
|
||||
case CTRL ('c'):
|
||||
Status = EFI_ABORTED;
|
||||
break;
|
||||
|
||||
case CTRL ('c'):
|
||||
Status = EFI_ABORTED;
|
||||
break;
|
||||
case CTRL ('m'):
|
||||
case 'm':
|
||||
case 'M':
|
||||
Status = EFI_SUCCESS;
|
||||
break;
|
||||
|
||||
case CTRL ('m'):
|
||||
case 'm':
|
||||
case 'M':
|
||||
Status = EFI_SUCCESS;
|
||||
break;
|
||||
|
||||
default:
|
||||
continue;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
switch (InputKey.ScanCode) {
|
||||
case SCAN_F8:
|
||||
Status = EFI_SUCCESS;
|
||||
break;
|
||||
|
||||
case SCAN_F8:
|
||||
Status = EFI_SUCCESS;
|
||||
break;
|
||||
case SCAN_ESC:
|
||||
Status = EFI_ABORTED;
|
||||
break;
|
||||
|
||||
case SCAN_ESC:
|
||||
Status = EFI_ABORTED;
|
||||
break;
|
||||
|
||||
default:
|
||||
continue;
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,12 +231,13 @@ PxeBcSelectBootPrompt (
|
||||
//
|
||||
// Reset the cursor on the screen.
|
||||
//
|
||||
gST->ConOut->SetCursorPosition (gST->ConOut, 0 , SecRow + 1);
|
||||
gST->ConOut->SetCursorPosition (gST->ConOut, 0, SecRow + 1);
|
||||
|
||||
ON_EXIT:
|
||||
if (DescendEvent != NULL) {
|
||||
gBS->CloseEvent (DescendEvent);
|
||||
}
|
||||
|
||||
if (TimeoutEvent != NULL) {
|
||||
gBS->CloseEvent (TimeoutEvent);
|
||||
}
|
||||
@@ -247,7 +245,6 @@ ON_EXIT:
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Select the boot menu by user's input.
|
||||
|
||||
@@ -262,26 +259,26 @@ ON_EXIT:
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcSelectBootMenu (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT16 *Type,
|
||||
IN BOOLEAN UseDefaultItem
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT16 *Type,
|
||||
IN BOOLEAN UseDefaultItem
|
||||
)
|
||||
{
|
||||
EFI_PXE_BASE_CODE_MODE *Mode;
|
||||
PXEBC_DHCP_PACKET_CACHE *Cache;
|
||||
PXEBC_VENDOR_OPTION *VendorOpt;
|
||||
EFI_INPUT_KEY InputKey;
|
||||
UINT32 OfferType;
|
||||
UINT8 MenuSize;
|
||||
UINT8 MenuNum;
|
||||
INT32 TopRow;
|
||||
UINT16 Select;
|
||||
UINT16 LastSelect;
|
||||
UINT8 Index;
|
||||
BOOLEAN Finish;
|
||||
CHAR8 Blank[PXEBC_DISPLAY_MAX_LINE];
|
||||
PXEBC_BOOT_MENU_ENTRY *MenuItem;
|
||||
PXEBC_BOOT_MENU_ENTRY *MenuArray[PXEBC_MENU_MAX_NUM];
|
||||
EFI_PXE_BASE_CODE_MODE *Mode;
|
||||
PXEBC_DHCP_PACKET_CACHE *Cache;
|
||||
PXEBC_VENDOR_OPTION *VendorOpt;
|
||||
EFI_INPUT_KEY InputKey;
|
||||
UINT32 OfferType;
|
||||
UINT8 MenuSize;
|
||||
UINT8 MenuNum;
|
||||
INT32 TopRow;
|
||||
UINT16 Select;
|
||||
UINT16 LastSelect;
|
||||
UINT8 Index;
|
||||
BOOLEAN Finish;
|
||||
CHAR8 Blank[PXEBC_DISPLAY_MAX_LINE];
|
||||
PXEBC_BOOT_MENU_ENTRY *MenuItem;
|
||||
PXEBC_BOOT_MENU_ENTRY *MenuArray[PXEBC_MENU_MAX_NUM];
|
||||
|
||||
Finish = FALSE;
|
||||
Select = 0;
|
||||
@@ -305,10 +302,10 @@ PxeBcSelectBootMenu (
|
||||
//
|
||||
// Display the boot menu on the screen.
|
||||
//
|
||||
SetMem (Blank, sizeof(Blank), ' ');
|
||||
SetMem (Blank, sizeof (Blank), ' ');
|
||||
|
||||
MenuSize = VendorOpt->BootMenuLen;
|
||||
MenuItem = VendorOpt->BootMenu;
|
||||
MenuSize = VendorOpt->BootMenuLen;
|
||||
MenuItem = VendorOpt->BootMenu;
|
||||
|
||||
if (MenuSize == 0) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
@@ -316,9 +313,9 @@ PxeBcSelectBootMenu (
|
||||
|
||||
while (MenuSize > 0 && Index < PXEBC_MENU_MAX_NUM) {
|
||||
ASSERT (MenuItem != NULL);
|
||||
MenuArray[Index] = MenuItem;
|
||||
MenuSize = (UINT8) (MenuSize - (MenuItem->DescLen + 3));
|
||||
MenuItem = (PXEBC_BOOT_MENU_ENTRY *) ((UINT8 *) MenuItem + MenuItem->DescLen + 3);
|
||||
MenuArray[Index] = MenuItem;
|
||||
MenuSize = (UINT8)(MenuSize - (MenuItem->DescLen + 3));
|
||||
MenuItem = (PXEBC_BOOT_MENU_ENTRY *)((UINT8 *)MenuItem + MenuItem->DescLen + 3);
|
||||
Index++;
|
||||
}
|
||||
|
||||
@@ -361,60 +358,62 @@ PxeBcSelectBootMenu (
|
||||
|
||||
if (InputKey.ScanCode == 0) {
|
||||
switch (InputKey.UnicodeChar) {
|
||||
case CTRL ('c'):
|
||||
InputKey.ScanCode = SCAN_ESC;
|
||||
break;
|
||||
case CTRL ('c'):
|
||||
InputKey.ScanCode = SCAN_ESC;
|
||||
break;
|
||||
|
||||
case CTRL ('j'): /* linefeed */
|
||||
case CTRL ('m'): /* return */
|
||||
Finish = TRUE;
|
||||
break;
|
||||
case CTRL ('j'): /* linefeed */
|
||||
case CTRL ('m'): /* return */
|
||||
Finish = TRUE;
|
||||
break;
|
||||
|
||||
case CTRL ('i'): /* tab */
|
||||
case ' ':
|
||||
case 'd':
|
||||
case 'D':
|
||||
InputKey.ScanCode = SCAN_DOWN;
|
||||
break;
|
||||
case CTRL ('i'): /* tab */
|
||||
case ' ':
|
||||
case 'd':
|
||||
case 'D':
|
||||
InputKey.ScanCode = SCAN_DOWN;
|
||||
break;
|
||||
|
||||
case CTRL ('h'): /* backspace */
|
||||
case 'u':
|
||||
case 'U':
|
||||
InputKey.ScanCode = SCAN_UP;
|
||||
break;
|
||||
case CTRL ('h'): /* backspace */
|
||||
case 'u':
|
||||
case 'U':
|
||||
InputKey.ScanCode = SCAN_UP;
|
||||
break;
|
||||
|
||||
default:
|
||||
InputKey.ScanCode = 0;
|
||||
default:
|
||||
InputKey.ScanCode = 0;
|
||||
}
|
||||
}
|
||||
|
||||
switch (InputKey.ScanCode) {
|
||||
case SCAN_LEFT:
|
||||
case SCAN_UP:
|
||||
if (Select != 0) {
|
||||
Select--;
|
||||
}
|
||||
break;
|
||||
case SCAN_LEFT:
|
||||
case SCAN_UP:
|
||||
if (Select != 0) {
|
||||
Select--;
|
||||
}
|
||||
|
||||
case SCAN_DOWN:
|
||||
case SCAN_RIGHT:
|
||||
if (++Select == MenuNum) {
|
||||
Select--;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case SCAN_PAGE_UP:
|
||||
case SCAN_HOME:
|
||||
Select = 0;
|
||||
break;
|
||||
case SCAN_DOWN:
|
||||
case SCAN_RIGHT:
|
||||
if (++Select == MenuNum) {
|
||||
Select--;
|
||||
}
|
||||
|
||||
case SCAN_PAGE_DOWN:
|
||||
case SCAN_END:
|
||||
Select = (UINT16) (MenuNum - 1);
|
||||
break;
|
||||
break;
|
||||
|
||||
case SCAN_ESC:
|
||||
return EFI_ABORTED;
|
||||
case SCAN_PAGE_UP:
|
||||
case SCAN_HOME:
|
||||
Select = 0;
|
||||
break;
|
||||
|
||||
case SCAN_PAGE_DOWN:
|
||||
case SCAN_END:
|
||||
Select = (UINT16)(MenuNum - 1);
|
||||
break;
|
||||
|
||||
case SCAN_ESC:
|
||||
return EFI_ABORTED;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -441,7 +440,6 @@ PxeBcSelectBootMenu (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Parse out the boot information from the last Dhcp4 reply packet.
|
||||
|
||||
@@ -454,8 +452,8 @@ PxeBcSelectBootMenu (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDhcp4BootInfo (
|
||||
IN OUT PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT64 *BufferSize
|
||||
IN OUT PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT64 *BufferSize
|
||||
)
|
||||
{
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
@@ -506,7 +504,7 @@ PxeBcDhcp4BootInfo (
|
||||
VendorOpt = &Cache4->VendorOpt;
|
||||
if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) && IS_VALID_BOOT_SERVERS (VendorOpt->BitMap)) {
|
||||
Entry = VendorOpt->BootSvr;
|
||||
if (VendorOpt->BootSvrLen >= sizeof (PXEBC_BOOT_SVR_ENTRY) && Entry->IpCnt > 0) {
|
||||
if ((VendorOpt->BootSvrLen >= sizeof (PXEBC_BOOT_SVR_ENTRY)) && (Entry->IpCnt > 0)) {
|
||||
CopyMem (
|
||||
&Private->ServerIp,
|
||||
&Entry->IpAddr[0],
|
||||
@@ -514,6 +512,7 @@ PxeBcDhcp4BootInfo (
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (Private->ServerIp.Addr[0] == 0) {
|
||||
//
|
||||
// ServerIp.Addr[0] equals zero means we failed to get IP address from boot server list.
|
||||
@@ -525,6 +524,7 @@ PxeBcDhcp4BootInfo (
|
||||
sizeof (EFI_IPv4_ADDRESS)
|
||||
);
|
||||
}
|
||||
|
||||
if (Private->ServerIp.Addr[0] == 0) {
|
||||
//
|
||||
// Still failed , use the IP address from option 54.
|
||||
@@ -546,7 +546,7 @@ PxeBcDhcp4BootInfo (
|
||||
// Parse the boot file size by option.
|
||||
//
|
||||
CopyMem (&Value, Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN]->Data, sizeof (Value));
|
||||
Value = NTOHS (Value);
|
||||
Value = NTOHS (Value);
|
||||
//
|
||||
// The field of boot file size is 512 bytes in unit.
|
||||
//
|
||||
@@ -572,7 +572,7 @@ PxeBcDhcp4BootInfo (
|
||||
//
|
||||
// Save the value of boot file size.
|
||||
//
|
||||
Private->BootFileSize = (UINTN) *BufferSize;
|
||||
Private->BootFileSize = (UINTN)*BufferSize;
|
||||
|
||||
//
|
||||
// Display all the information: boot server address, boot file name and boot file size.
|
||||
@@ -585,7 +585,6 @@ PxeBcDhcp4BootInfo (
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Parse out the boot information from the last Dhcp6 reply packet.
|
||||
|
||||
@@ -599,8 +598,8 @@ PxeBcDhcp4BootInfo (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDhcp6BootInfo (
|
||||
IN OUT PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT64 *BufferSize
|
||||
IN OUT PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT64 *BufferSize
|
||||
)
|
||||
{
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
@@ -648,7 +647,6 @@ PxeBcDhcp6BootInfo (
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Parse (m)tftp server ip address and bootfile name.
|
||||
//
|
||||
@@ -656,7 +654,7 @@ PxeBcDhcp6BootInfo (
|
||||
Private,
|
||||
&Private->BootFileName,
|
||||
&Private->ServerIp.v6,
|
||||
(CHAR8 *) (Cache6->OptList[PXEBC_DHCP6_IDX_BOOT_FILE_URL]->Data),
|
||||
(CHAR8 *)(Cache6->OptList[PXEBC_DHCP6_IDX_BOOT_FILE_URL]->Data),
|
||||
NTOHS (Cache6->OptList[PXEBC_DHCP6_IDX_BOOT_FILE_URL]->OpLen)
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -670,10 +668,11 @@ PxeBcDhcp6BootInfo (
|
||||
//
|
||||
// Parse it out if have the boot file parameter option.
|
||||
//
|
||||
Status = PxeBcExtractBootFileParam ((CHAR8 *) Cache6->OptList[PXEBC_DHCP6_IDX_BOOT_FILE_PARAM]->Data, &Value);
|
||||
Status = PxeBcExtractBootFileParam ((CHAR8 *)Cache6->OptList[PXEBC_DHCP6_IDX_BOOT_FILE_PARAM]->Data, &Value);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
// The field of boot file size is 512 bytes in unit.
|
||||
//
|
||||
@@ -699,7 +698,7 @@ PxeBcDhcp6BootInfo (
|
||||
//
|
||||
// Save the value of boot file size.
|
||||
//
|
||||
Private->BootFileSize = (UINTN) *BufferSize;
|
||||
Private->BootFileSize = (UINTN)*BufferSize;
|
||||
|
||||
//
|
||||
// Display all the information: boot server address, boot file name and boot file size.
|
||||
@@ -712,7 +711,6 @@ PxeBcDhcp6BootInfo (
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Extract the discover information and boot server entry from the
|
||||
cached packets if unspecified.
|
||||
@@ -732,17 +730,17 @@ PxeBcExtractDiscoverInfo (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO **DiscoverInfo,
|
||||
OUT PXEBC_BOOT_SVR_ENTRY **BootEntry,
|
||||
OUT EFI_PXE_BASE_CODE_SRVLIST **SrvList
|
||||
OUT PXEBC_BOOT_SVR_ENTRY **BootEntry,
|
||||
OUT EFI_PXE_BASE_CODE_SRVLIST **SrvList
|
||||
)
|
||||
{
|
||||
EFI_PXE_BASE_CODE_MODE *Mode;
|
||||
PXEBC_DHCP4_PACKET_CACHE *Cache4;
|
||||
PXEBC_VENDOR_OPTION *VendorOpt;
|
||||
PXEBC_BOOT_SVR_ENTRY *Entry;
|
||||
BOOLEAN IsFound;
|
||||
EFI_PXE_BASE_CODE_DISCOVER_INFO *Info;
|
||||
UINT16 Index;
|
||||
EFI_PXE_BASE_CODE_MODE *Mode;
|
||||
PXEBC_DHCP4_PACKET_CACHE *Cache4;
|
||||
PXEBC_VENDOR_OPTION *VendorOpt;
|
||||
PXEBC_BOOT_SVR_ENTRY *Entry;
|
||||
BOOLEAN IsFound;
|
||||
EFI_PXE_BASE_CODE_DISCOVER_INFO *Info;
|
||||
UINT16 Index;
|
||||
|
||||
Mode = Private->PxeBc.Mode;
|
||||
Info = *DiscoverInfo;
|
||||
@@ -759,7 +757,7 @@ PxeBcExtractDiscoverInfo (
|
||||
//
|
||||
CopyMem (&Info->SrvList[0].IpAddr, &Private->ServerIp, sizeof (EFI_IP_ADDRESS));
|
||||
|
||||
*SrvList = Info->SrvList;
|
||||
*SrvList = Info->SrvList;
|
||||
} else {
|
||||
Entry = NULL;
|
||||
IsFound = FALSE;
|
||||
@@ -778,8 +776,8 @@ PxeBcExtractDiscoverInfo (
|
||||
//
|
||||
Info->UseMCast = (BOOLEAN) !IS_DISABLE_MCAST_DISCOVER (VendorOpt->DiscoverCtrl);
|
||||
Info->UseBCast = (BOOLEAN) !IS_DISABLE_BCAST_DISCOVER (VendorOpt->DiscoverCtrl);
|
||||
Info->MustUseList = (BOOLEAN) IS_ENABLE_USE_SERVER_LIST (VendorOpt->DiscoverCtrl);
|
||||
Info->UseUCast = (BOOLEAN) IS_VALID_BOOT_SERVERS (VendorOpt->BitMap);
|
||||
Info->MustUseList = (BOOLEAN)IS_ENABLE_USE_SERVER_LIST (VendorOpt->DiscoverCtrl);
|
||||
Info->UseUCast = (BOOLEAN)IS_VALID_BOOT_SERVERS (VendorOpt->BitMap);
|
||||
|
||||
if (Info->UseMCast) {
|
||||
//
|
||||
@@ -793,11 +791,12 @@ PxeBcExtractDiscoverInfo (
|
||||
if (Info->UseUCast) {
|
||||
Entry = VendorOpt->BootSvr;
|
||||
|
||||
while (((UINT8) (Entry - VendorOpt->BootSvr)) < VendorOpt->BootSvrLen) {
|
||||
while (((UINT8)(Entry - VendorOpt->BootSvr)) < VendorOpt->BootSvrLen) {
|
||||
if (Entry->Type == HTONS (Type)) {
|
||||
IsFound = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
Entry = GET_NEXT_BOOT_SVR_ENTRY (Entry);
|
||||
}
|
||||
|
||||
@@ -811,6 +810,7 @@ PxeBcExtractDiscoverInfo (
|
||||
if (*DiscoverInfo == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
CopyMem (*DiscoverInfo, Info, sizeof (*Info));
|
||||
Info = *DiscoverInfo;
|
||||
}
|
||||
@@ -818,7 +818,7 @@ PxeBcExtractDiscoverInfo (
|
||||
for (Index = 0; Index < Info->IpCnt; Index++) {
|
||||
CopyMem (&Info->SrvList[Index].IpAddr, &Entry->IpAddr[Index], sizeof (EFI_IPv4_ADDRESS));
|
||||
Info->SrvList[Index].AcceptAnyResponse = !Info->MustUseList;
|
||||
Info->SrvList[Index].Type = NTOHS (Entry->Type);
|
||||
Info->SrvList[Index].Type = NTOHS (Entry->Type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -829,7 +829,6 @@ PxeBcExtractDiscoverInfo (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Build the discover packet and send out for boot server.
|
||||
|
||||
@@ -849,13 +848,13 @@ PxeBcExtractDiscoverInfo (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDiscoverBootServer (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN UINT16 *Layer,
|
||||
IN BOOLEAN UseBis,
|
||||
IN EFI_IP_ADDRESS *DestIp,
|
||||
IN UINT16 IpCount,
|
||||
IN EFI_PXE_BASE_CODE_SRVLIST *SrvList
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN UINT16 *Layer,
|
||||
IN BOOLEAN UseBis,
|
||||
IN EFI_IP_ADDRESS *DestIp,
|
||||
IN UINT16 IpCount,
|
||||
IN EFI_PXE_BASE_CODE_SRVLIST *SrvList
|
||||
)
|
||||
{
|
||||
if (Private->PxeBc.Mode->UsingIpv6) {
|
||||
@@ -879,7 +878,6 @@ PxeBcDiscoverBootServer (
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Discover all the boot information for boot file.
|
||||
|
||||
@@ -894,8 +892,8 @@ PxeBcDiscoverBootServer (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDiscoverBootFile (
|
||||
IN OUT PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT64 *BufferSize
|
||||
IN OUT PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT64 *BufferSize
|
||||
)
|
||||
{
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
@@ -937,7 +935,6 @@ PxeBcDiscoverBootFile (
|
||||
}
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
|
||||
if (Type == EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP) {
|
||||
//
|
||||
// Local boot(PXE bootstrap server) need abort
|
||||
@@ -949,7 +946,7 @@ PxeBcDiscoverBootFile (
|
||||
// Start to discover the boot server to get (m)tftp server ip address, bootfile
|
||||
// name and bootfile size.
|
||||
//
|
||||
UseBis = (BOOLEAN) (Mode->BisSupported && Mode->BisDetected);
|
||||
UseBis = (BOOLEAN)(Mode->BisSupported && Mode->BisDetected);
|
||||
Status = PxeBc->Discover (PxeBc, Type, &Layer, UseBis, NULL);
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
@@ -973,6 +970,7 @@ PxeBcDiscoverBootFile (
|
||||
Private->PxeReply.Dhcp4.Packet.Ack.Length
|
||||
);
|
||||
}
|
||||
|
||||
Mode->ProxyOfferReceived = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -989,7 +987,6 @@ PxeBcDiscoverBootFile (
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Install PxeBaseCodeCallbackProtocol if not installed before.
|
||||
|
||||
@@ -1002,8 +999,8 @@ PxeBcDiscoverBootFile (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcInstallCallback (
|
||||
IN OUT PXEBC_PRIVATE_DATA *Private,
|
||||
OUT BOOLEAN *NewMakeCallback
|
||||
IN OUT PXEBC_PRIVATE_DATA *Private,
|
||||
OUT BOOLEAN *NewMakeCallback
|
||||
)
|
||||
{
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
@@ -1016,10 +1013,9 @@ PxeBcInstallCallback (
|
||||
Status = gBS->HandleProtocol (
|
||||
Private->Mode.UsingIpv6 ? Private->Ip6Nic->Controller : Private->Ip4Nic->Controller,
|
||||
&gEfiPxeBaseCodeCallbackProtocolGuid,
|
||||
(VOID **) &Private->PxeBcCallback
|
||||
(VOID **)&Private->PxeBcCallback
|
||||
);
|
||||
if (Status == EFI_UNSUPPORTED) {
|
||||
|
||||
CopyMem (
|
||||
&Private->LoadFileCallback,
|
||||
&gPxeBcCallBackTemplate,
|
||||
@@ -1036,7 +1032,7 @@ PxeBcInstallCallback (
|
||||
&Private->LoadFileCallback
|
||||
);
|
||||
|
||||
(*NewMakeCallback) = (BOOLEAN) (Status == EFI_SUCCESS);
|
||||
(*NewMakeCallback) = (BOOLEAN)(Status == EFI_SUCCESS);
|
||||
|
||||
Status = PxeBc->SetParameters (PxeBc, NULL, NULL, NULL, NULL, NewMakeCallback);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -1048,7 +1044,6 @@ PxeBcInstallCallback (
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Uninstall PxeBaseCodeCallbackProtocol.
|
||||
|
||||
@@ -1059,29 +1054,27 @@ PxeBcInstallCallback (
|
||||
**/
|
||||
VOID
|
||||
PxeBcUninstallCallback (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN BOOLEAN NewMakeCallback
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN BOOLEAN NewMakeCallback
|
||||
)
|
||||
{
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
|
||||
PxeBc = &Private->PxeBc;
|
||||
|
||||
if (NewMakeCallback) {
|
||||
|
||||
NewMakeCallback = FALSE;
|
||||
|
||||
PxeBc->SetParameters (PxeBc, NULL, NULL, NULL, NULL, &NewMakeCallback);
|
||||
|
||||
gBS->UninstallProtocolInterface (
|
||||
Private->Mode.UsingIpv6 ? Private->Ip6Nic->Controller : Private->Ip4Nic->Controller,
|
||||
&gEfiPxeBaseCodeCallbackProtocolGuid,
|
||||
&Private->LoadFileCallback
|
||||
);
|
||||
Private->Mode.UsingIpv6 ? Private->Ip6Nic->Controller : Private->Ip4Nic->Controller,
|
||||
&gEfiPxeBaseCodeCallbackProtocolGuid,
|
||||
&Private->LoadFileCallback
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Download one of boot file in the list, and it's special for IPv6.
|
||||
|
||||
@@ -1098,15 +1091,15 @@ PxeBcUninstallCallback (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcReadBootFileList (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN OUT UINT64 *BufferSize,
|
||||
IN VOID *Buffer OPTIONAL
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN OUT UINT64 *BufferSize,
|
||||
IN VOID *Buffer OPTIONAL
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
EFI_STATUS Status;
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
|
||||
PxeBc = &Private->PxeBc;
|
||||
PxeBc = &Private->PxeBc;
|
||||
|
||||
//
|
||||
// Try to download the boot file if everything is ready.
|
||||
@@ -1124,16 +1117,13 @@ PxeBcReadBootFileList (
|
||||
NULL,
|
||||
FALSE
|
||||
);
|
||||
|
||||
|
||||
} else {
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Load boot file into user buffer.
|
||||
|
||||
@@ -1150,17 +1140,17 @@ PxeBcReadBootFileList (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcLoadBootFile (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN OUT UINTN *BufferSize,
|
||||
IN VOID *Buffer OPTIONAL
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN OUT UINTN *BufferSize,
|
||||
IN VOID *Buffer OPTIONAL
|
||||
)
|
||||
{
|
||||
BOOLEAN NewMakeCallback;
|
||||
UINT64 RequiredSize;
|
||||
UINT64 CurrentSize;
|
||||
EFI_STATUS Status;
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
EFI_PXE_BASE_CODE_MODE *PxeBcMode;
|
||||
BOOLEAN NewMakeCallback;
|
||||
UINT64 RequiredSize;
|
||||
UINT64 CurrentSize;
|
||||
EFI_STATUS Status;
|
||||
EFI_PXE_BASE_CODE_PROTOCOL *PxeBc;
|
||||
EFI_PXE_BASE_CODE_MODE *PxeBcMode;
|
||||
|
||||
NewMakeCallback = FALSE;
|
||||
PxeBc = &Private->PxeBc;
|
||||
@@ -1172,7 +1162,7 @@ PxeBcLoadBootFile (
|
||||
// Install pxebc callback protocol if hasn't been installed yet.
|
||||
//
|
||||
Status = PxeBcInstallCallback (Private, &NewMakeCallback);
|
||||
if (EFI_ERROR(Status)) {
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -1195,7 +1185,7 @@ PxeBcLoadBootFile (
|
||||
//
|
||||
// Get the right buffer size of the bootfile required.
|
||||
//
|
||||
if (CurrentSize < RequiredSize || Buffer == NULL) {
|
||||
if ((CurrentSize < RequiredSize) || (Buffer == NULL)) {
|
||||
//
|
||||
// It's buffer too small if the size of user buffer is smaller than the required.
|
||||
//
|
||||
@@ -1203,8 +1193,9 @@ PxeBcLoadBootFile (
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto ON_EXIT;
|
||||
}
|
||||
|
||||
CurrentSize = RequiredSize;
|
||||
} else if (RequiredSize == 0 && PxeBcMode->UsingIpv6) {
|
||||
} else if ((RequiredSize == 0) && PxeBcMode->UsingIpv6) {
|
||||
//
|
||||
// Try to download another bootfile in list if failed to get the filesize of the last one.
|
||||
// It's special for the case of IPv6.
|
||||
@@ -1212,7 +1203,7 @@ PxeBcLoadBootFile (
|
||||
Status = PxeBcReadBootFileList (Private, &CurrentSize, Buffer);
|
||||
goto ON_EXIT;
|
||||
}
|
||||
} else if (CurrentSize < Private->BootFileSize || Buffer == NULL ) {
|
||||
} else if ((CurrentSize < Private->BootFileSize) || (Buffer == NULL)) {
|
||||
//
|
||||
// It's buffer too small if the size of user buffer is smaller than the required.
|
||||
//
|
||||
@@ -1247,13 +1238,13 @@ PxeBcLoadBootFile (
|
||||
}
|
||||
|
||||
ON_EXIT:
|
||||
*BufferSize = (UINTN) CurrentSize;
|
||||
PxeBcUninstallCallback(Private, NewMakeCallback);
|
||||
*BufferSize = (UINTN)CurrentSize;
|
||||
PxeBcUninstallCallback (Private, NewMakeCallback);
|
||||
|
||||
if (Status == EFI_SUCCESS) {
|
||||
AsciiPrint ("\n NBP file downloaded successfully.\n");
|
||||
return EFI_SUCCESS;
|
||||
} else if (Status == EFI_BUFFER_TOO_SMALL && Buffer != NULL) {
|
||||
} else if ((Status == EFI_BUFFER_TOO_SMALL) && (Buffer != NULL)) {
|
||||
AsciiPrint ("\n PXE-E05: Buffer size is smaller than the requested file.\n");
|
||||
} else if (Status == EFI_DEVICE_ERROR) {
|
||||
AsciiPrint ("\n PXE-E07: Network device error.\n");
|
||||
@@ -1279,4 +1270,3 @@ ON_EXIT:
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@@ -10,12 +10,11 @@
|
||||
#ifndef __EFI_PXEBC_BOOT_H__
|
||||
#define __EFI_PXEBC_BOOT_H__
|
||||
|
||||
#define PXEBC_DISPLAY_MAX_LINE 70
|
||||
#define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE 8
|
||||
#define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE 4
|
||||
|
||||
#define PXEBC_IS_SIZE_OVERFLOWED(x) ((sizeof (UINTN) < sizeof (UINT64)) && ((x) > 0xFFFFFFFF))
|
||||
#define PXEBC_DISPLAY_MAX_LINE 70
|
||||
#define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE 8
|
||||
#define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE 4
|
||||
|
||||
#define PXEBC_IS_SIZE_OVERFLOWED(x) ((sizeof (UINTN) < sizeof (UINT64)) && ((x) > 0xFFFFFFFF))
|
||||
|
||||
/**
|
||||
Extract the discover information and boot server entry from the
|
||||
@@ -36,11 +35,10 @@ PxeBcExtractDiscoverInfo (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO **DiscoverInfo,
|
||||
OUT PXEBC_BOOT_SVR_ENTRY **BootEntry,
|
||||
OUT EFI_PXE_BASE_CODE_SRVLIST **SrvList
|
||||
OUT PXEBC_BOOT_SVR_ENTRY **BootEntry,
|
||||
OUT EFI_PXE_BASE_CODE_SRVLIST **SrvList
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Build the discover packet and send out for boot.
|
||||
|
||||
@@ -60,16 +58,15 @@ PxeBcExtractDiscoverInfo (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDiscoverBootServer (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN UINT16 *Layer,
|
||||
IN BOOLEAN UseBis,
|
||||
IN EFI_IP_ADDRESS *DestIp,
|
||||
IN UINT16 IpCount,
|
||||
IN EFI_PXE_BASE_CODE_SRVLIST *SrvList
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN UINT16 *Layer,
|
||||
IN BOOLEAN UseBis,
|
||||
IN EFI_IP_ADDRESS *DestIp,
|
||||
IN UINT16 IpCount,
|
||||
IN EFI_PXE_BASE_CODE_SRVLIST *SrvList
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Load boot file into user buffer.
|
||||
|
||||
@@ -86,9 +83,9 @@ PxeBcDiscoverBootServer (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcLoadBootFile (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN OUT UINTN *BufferSize,
|
||||
IN VOID *Buffer OPTIONAL
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN OUT UINTN *BufferSize,
|
||||
IN VOID *Buffer OPTIONAL
|
||||
);
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -10,17 +10,17 @@
|
||||
#ifndef __EFI_PXEBC_DHCP4_H__
|
||||
#define __EFI_PXEBC_DHCP4_H__
|
||||
|
||||
#define PXEBC_DHCP4_OPTION_MAX_NUM 16
|
||||
#define PXEBC_DHCP4_OPTION_MAX_SIZE 312
|
||||
#define PXEBC_DHCP4_PACKET_MAX_SIZE (sizeof (EFI_PXE_BASE_CODE_PACKET))
|
||||
#define PXEBC_DHCP4_S_PORT 67
|
||||
#define PXEBC_DHCP4_C_PORT 68
|
||||
#define PXEBC_BS_DOWNLOAD_PORT 69
|
||||
#define PXEBC_BS_DISCOVER_PORT 4011
|
||||
#define PXEBC_DHCP4_OPCODE_REQUEST 1
|
||||
#define PXEBC_DHCP4_OPCODE_REPLY 2
|
||||
#define PXEBC_DHCP4_MSG_TYPE_REQUEST 3
|
||||
#define PXEBC_DHCP4_MAGIC 0x63538263 // network byte order
|
||||
#define PXEBC_DHCP4_OPTION_MAX_NUM 16
|
||||
#define PXEBC_DHCP4_OPTION_MAX_SIZE 312
|
||||
#define PXEBC_DHCP4_PACKET_MAX_SIZE (sizeof (EFI_PXE_BASE_CODE_PACKET))
|
||||
#define PXEBC_DHCP4_S_PORT 67
|
||||
#define PXEBC_DHCP4_C_PORT 68
|
||||
#define PXEBC_BS_DOWNLOAD_PORT 69
|
||||
#define PXEBC_BS_DISCOVER_PORT 4011
|
||||
#define PXEBC_DHCP4_OPCODE_REQUEST 1
|
||||
#define PXEBC_DHCP4_OPCODE_REPLY 2
|
||||
#define PXEBC_DHCP4_MSG_TYPE_REQUEST 3
|
||||
#define PXEBC_DHCP4_MAGIC 0x63538263 // network byte order
|
||||
|
||||
//
|
||||
// Sub-Options in Dhcp Vendor Option
|
||||
@@ -39,24 +39,23 @@
|
||||
#define PXEBC_VENDOR_TAG_CREDENTIAL_TYPES 12
|
||||
#define PXEBC_VENDOR_TAG_BOOT_ITEM 71
|
||||
|
||||
#define PXEBC_BOOT_REQUEST_TIMEOUT 1
|
||||
#define PXEBC_BOOT_REQUEST_RETRIES 4
|
||||
|
||||
#define PXEBC_DHCP4_OVERLOAD_FILE 1
|
||||
#define PXEBC_DHCP4_OVERLOAD_SERVER_NAME 2
|
||||
#define PXEBC_BOOT_REQUEST_TIMEOUT 1
|
||||
#define PXEBC_BOOT_REQUEST_RETRIES 4
|
||||
|
||||
#define PXEBC_DHCP4_OVERLOAD_FILE 1
|
||||
#define PXEBC_DHCP4_OVERLOAD_SERVER_NAME 2
|
||||
|
||||
//
|
||||
// The array index of the DHCP4 option tag interested
|
||||
//
|
||||
#define PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN 0
|
||||
#define PXEBC_DHCP4_TAG_INDEX_VENDOR 1
|
||||
#define PXEBC_DHCP4_TAG_INDEX_OVERLOAD 2
|
||||
#define PXEBC_DHCP4_TAG_INDEX_MSG_TYPE 3
|
||||
#define PXEBC_DHCP4_TAG_INDEX_SERVER_ID 4
|
||||
#define PXEBC_DHCP4_TAG_INDEX_CLASS_ID 5
|
||||
#define PXEBC_DHCP4_TAG_INDEX_BOOTFILE 6
|
||||
#define PXEBC_DHCP4_TAG_INDEX_MAX 7
|
||||
#define PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN 0
|
||||
#define PXEBC_DHCP4_TAG_INDEX_VENDOR 1
|
||||
#define PXEBC_DHCP4_TAG_INDEX_OVERLOAD 2
|
||||
#define PXEBC_DHCP4_TAG_INDEX_MSG_TYPE 3
|
||||
#define PXEBC_DHCP4_TAG_INDEX_SERVER_ID 4
|
||||
#define PXEBC_DHCP4_TAG_INDEX_CLASS_ID 5
|
||||
#define PXEBC_DHCP4_TAG_INDEX_BOOTFILE 6
|
||||
#define PXEBC_DHCP4_TAG_INDEX_MAX 7
|
||||
|
||||
//
|
||||
// Dhcp4 and Dhcp6 share this definition, and corresponding
|
||||
@@ -79,12 +78,12 @@ typedef enum {
|
||||
PxeOfferTypeMax
|
||||
} PXEBC_OFFER_TYPE;
|
||||
|
||||
#define BIT(x) (1 << x)
|
||||
#define CTRL(x) (0x1F & (x))
|
||||
#define DEFAULT_CLASS_ID_DATA "PXEClient:Arch:xxxxx:UNDI:003000"
|
||||
#define DEFAULT_UNDI_TYPE 1
|
||||
#define DEFAULT_UNDI_MAJOR 3
|
||||
#define DEFAULT_UNDI_MINOR 0
|
||||
#define BIT(x) (1 << x)
|
||||
#define CTRL(x) (0x1F & (x))
|
||||
#define DEFAULT_CLASS_ID_DATA "PXEClient:Arch:xxxxx:UNDI:003000"
|
||||
#define DEFAULT_UNDI_TYPE 1
|
||||
#define DEFAULT_UNDI_MAJOR 3
|
||||
#define DEFAULT_UNDI_MINOR 0
|
||||
|
||||
#define MTFTP_VENDOR_OPTION_BIT_MAP \
|
||||
(BIT (PXEBC_VENDOR_TAG_MTFTP_IP) | \
|
||||
@@ -157,122 +156,120 @@ typedef enum {
|
||||
#define IS_DISABLE_PROMPT_MENU(x) \
|
||||
(((x) & BIT (3)) == BIT (3))
|
||||
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
UINT8 ParaList[135];
|
||||
UINT8 ParaList[135];
|
||||
} PXEBC_DHCP4_OPTION_PARA;
|
||||
|
||||
typedef struct {
|
||||
UINT16 Size;
|
||||
UINT16 Size;
|
||||
} PXEBC_DHCP4_OPTION_MAX_MESG_SIZE;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Type;
|
||||
UINT8 MajorVer;
|
||||
UINT8 MinorVer;
|
||||
UINT8 Type;
|
||||
UINT8 MajorVer;
|
||||
UINT8 MinorVer;
|
||||
} PXEBC_DHCP4_OPTION_UNDI;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Type;
|
||||
UINT8 Type;
|
||||
} PXEBC_DHCP4_OPTION_MESG;
|
||||
|
||||
typedef struct {
|
||||
UINT16 Type;
|
||||
UINT16 Type;
|
||||
} PXEBC_DHCP4_OPTION_ARCH;
|
||||
|
||||
typedef struct {
|
||||
UINT8 ClassIdentifier[10];
|
||||
UINT8 ArchitecturePrefix[5];
|
||||
UINT8 ArchitectureType[5];
|
||||
UINT8 Lit3[1];
|
||||
UINT8 InterfaceName[4];
|
||||
UINT8 Lit4[1];
|
||||
UINT8 UndiMajor[3];
|
||||
UINT8 UndiMinor[3];
|
||||
UINT8 ClassIdentifier[10];
|
||||
UINT8 ArchitecturePrefix[5];
|
||||
UINT8 ArchitectureType[5];
|
||||
UINT8 Lit3[1];
|
||||
UINT8 InterfaceName[4];
|
||||
UINT8 Lit4[1];
|
||||
UINT8 UndiMajor[3];
|
||||
UINT8 UndiMinor[3];
|
||||
} PXEBC_DHCP4_OPTION_CLID;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Type;
|
||||
UINT8 Guid[16];
|
||||
UINT8 Type;
|
||||
UINT8 Guid[16];
|
||||
} PXEBC_DHCP4_OPTION_UUID;
|
||||
|
||||
typedef struct {
|
||||
UINT16 Type;
|
||||
UINT16 Layer;
|
||||
UINT16 Type;
|
||||
UINT16 Layer;
|
||||
} PXEBC_OPTION_BOOT_ITEM;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
typedef union {
|
||||
PXEBC_DHCP4_OPTION_PARA *Para;
|
||||
PXEBC_DHCP4_OPTION_UNDI *Undi;
|
||||
PXEBC_DHCP4_OPTION_ARCH *Arch;
|
||||
PXEBC_DHCP4_OPTION_CLID *Clid;
|
||||
PXEBC_DHCP4_OPTION_UUID *Uuid;
|
||||
PXEBC_DHCP4_OPTION_MESG *Mesg;
|
||||
PXEBC_DHCP4_OPTION_MAX_MESG_SIZE *MaxMesgSize;
|
||||
PXEBC_DHCP4_OPTION_PARA *Para;
|
||||
PXEBC_DHCP4_OPTION_UNDI *Undi;
|
||||
PXEBC_DHCP4_OPTION_ARCH *Arch;
|
||||
PXEBC_DHCP4_OPTION_CLID *Clid;
|
||||
PXEBC_DHCP4_OPTION_UUID *Uuid;
|
||||
PXEBC_DHCP4_OPTION_MESG *Mesg;
|
||||
PXEBC_DHCP4_OPTION_MAX_MESG_SIZE *MaxMesgSize;
|
||||
} PXEBC_DHCP4_OPTION_ENTRY;
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
UINT16 Type;
|
||||
UINT8 IpCnt;
|
||||
EFI_IPv4_ADDRESS IpAddr[1];
|
||||
UINT16 Type;
|
||||
UINT8 IpCnt;
|
||||
EFI_IPv4_ADDRESS IpAddr[1];
|
||||
} PXEBC_BOOT_SVR_ENTRY;
|
||||
|
||||
typedef struct {
|
||||
UINT16 Type;
|
||||
UINT8 DescLen;
|
||||
UINT8 DescStr[1];
|
||||
UINT16 Type;
|
||||
UINT8 DescLen;
|
||||
UINT8 DescStr[1];
|
||||
} PXEBC_BOOT_MENU_ENTRY;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Timeout;
|
||||
UINT8 Prompt[1];
|
||||
UINT8 Timeout;
|
||||
UINT8 Prompt[1];
|
||||
} PXEBC_MENU_PROMPT;
|
||||
#pragma pack()
|
||||
|
||||
typedef struct {
|
||||
UINT32 BitMap[8];
|
||||
EFI_IPv4_ADDRESS MtftpIp;
|
||||
UINT16 MtftpCPort;
|
||||
UINT16 MtftpSPort;
|
||||
UINT8 MtftpTimeout;
|
||||
UINT8 MtftpDelay;
|
||||
UINT8 DiscoverCtrl;
|
||||
EFI_IPv4_ADDRESS DiscoverMcastIp;
|
||||
EFI_IPv4_ADDRESS McastIpBase;
|
||||
UINT16 McastIpBlock;
|
||||
UINT16 McastIpRange;
|
||||
UINT16 BootSrvType;
|
||||
UINT16 BootSrvLayer;
|
||||
PXEBC_BOOT_SVR_ENTRY *BootSvr;
|
||||
UINT8 BootSvrLen;
|
||||
PXEBC_BOOT_MENU_ENTRY *BootMenu;
|
||||
UINT8 BootMenuLen;
|
||||
PXEBC_MENU_PROMPT *MenuPrompt;
|
||||
UINT8 MenuPromptLen;
|
||||
UINT32 *CredType;
|
||||
UINT8 CredTypeLen;
|
||||
UINT32 BitMap[8];
|
||||
EFI_IPv4_ADDRESS MtftpIp;
|
||||
UINT16 MtftpCPort;
|
||||
UINT16 MtftpSPort;
|
||||
UINT8 MtftpTimeout;
|
||||
UINT8 MtftpDelay;
|
||||
UINT8 DiscoverCtrl;
|
||||
EFI_IPv4_ADDRESS DiscoverMcastIp;
|
||||
EFI_IPv4_ADDRESS McastIpBase;
|
||||
UINT16 McastIpBlock;
|
||||
UINT16 McastIpRange;
|
||||
UINT16 BootSrvType;
|
||||
UINT16 BootSrvLayer;
|
||||
PXEBC_BOOT_SVR_ENTRY *BootSvr;
|
||||
UINT8 BootSvrLen;
|
||||
PXEBC_BOOT_MENU_ENTRY *BootMenu;
|
||||
UINT8 BootMenuLen;
|
||||
PXEBC_MENU_PROMPT *MenuPrompt;
|
||||
UINT8 MenuPromptLen;
|
||||
UINT32 *CredType;
|
||||
UINT8 CredTypeLen;
|
||||
} PXEBC_VENDOR_OPTION;
|
||||
|
||||
#define PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE (OFFSET_OF (EFI_DHCP4_PACKET, Dhcp4) + PXEBC_DHCP4_PACKET_MAX_SIZE)
|
||||
|
||||
typedef union {
|
||||
EFI_DHCP4_PACKET Offer;
|
||||
EFI_DHCP4_PACKET Ack;
|
||||
UINT8 Buffer[PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE];
|
||||
EFI_DHCP4_PACKET Offer;
|
||||
EFI_DHCP4_PACKET Ack;
|
||||
UINT8 Buffer[PXEBC_CACHED_DHCP4_PACKET_MAX_SIZE];
|
||||
} PXEBC_DHCP4_PACKET;
|
||||
|
||||
typedef struct {
|
||||
PXEBC_DHCP4_PACKET Packet;
|
||||
PXEBC_OFFER_TYPE OfferType;
|
||||
EFI_DHCP4_PACKET_OPTION *OptList[PXEBC_DHCP4_TAG_INDEX_MAX];
|
||||
PXEBC_VENDOR_OPTION VendorOpt;
|
||||
PXEBC_DHCP4_PACKET Packet;
|
||||
PXEBC_OFFER_TYPE OfferType;
|
||||
EFI_DHCP4_PACKET_OPTION *OptList[PXEBC_DHCP4_TAG_INDEX_MAX];
|
||||
PXEBC_VENDOR_OPTION VendorOpt;
|
||||
} PXEBC_DHCP4_PACKET_CACHE;
|
||||
|
||||
|
||||
/**
|
||||
Create a template DHCPv4 packet as a seed.
|
||||
|
||||
@@ -282,11 +279,10 @@ typedef struct {
|
||||
**/
|
||||
VOID
|
||||
PxeBcSeedDhcp4Packet (
|
||||
OUT EFI_DHCP4_PACKET *Seed,
|
||||
IN EFI_UDP4_PROTOCOL *Udp4
|
||||
OUT EFI_DHCP4_PACKET *Seed,
|
||||
IN EFI_UDP4_PROTOCOL *Udp4
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Parse the cached DHCPv4 packet, including all the options.
|
||||
|
||||
@@ -298,10 +294,9 @@ PxeBcSeedDhcp4Packet (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcParseDhcp4Packet (
|
||||
IN PXEBC_DHCP4_PACKET_CACHE *Cache4
|
||||
IN PXEBC_DHCP4_PACKET_CACHE *Cache4
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Build and send out the request packet for the bootfile, and parse the reply.
|
||||
|
||||
@@ -321,13 +316,13 @@ PxeBcParseDhcp4Packet (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDhcp4Discover (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN UINT16 *Layer,
|
||||
IN BOOLEAN UseBis,
|
||||
IN EFI_IP_ADDRESS *DestIp,
|
||||
IN UINT16 IpCount,
|
||||
IN EFI_PXE_BASE_CODE_SRVLIST *SrvList
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN UINT16 *Layer,
|
||||
IN BOOLEAN UseBis,
|
||||
IN EFI_IP_ADDRESS *DestIp,
|
||||
IN UINT16 IpCount,
|
||||
IN EFI_PXE_BASE_CODE_SRVLIST *SrvList
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -341,10 +336,9 @@ PxeBcDhcp4Discover (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcSetIp4Policy (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Start the D.O.R.A DHCPv4 process to acquire the IPv4 address and other PXE boot information.
|
||||
|
||||
@@ -357,9 +351,8 @@ PxeBcSetIp4Policy (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDhcp4Dora (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN EFI_DHCP4_PROTOCOL *Dhcp4
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN EFI_DHCP4_PROTOCOL *Dhcp4
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -10,25 +10,24 @@
|
||||
#ifndef __EFI_PXEBC_DHCP6_H__
|
||||
#define __EFI_PXEBC_DHCP6_H__
|
||||
|
||||
#define PXEBC_DHCP6_OPTION_MAX_NUM 16
|
||||
#define PXEBC_DHCP6_OPTION_MAX_SIZE 312
|
||||
#define PXEBC_DHCP6_PACKET_MAX_SIZE (sizeof (EFI_PXE_BASE_CODE_PACKET))
|
||||
#define PXEBC_IP6_POLICY_MAX 0xff
|
||||
#define PXEBC_IP6_ROUTE_TABLE_TIMEOUT 10
|
||||
#define PXEBC_DHCP6_OPTION_MAX_NUM 16
|
||||
#define PXEBC_DHCP6_OPTION_MAX_SIZE 312
|
||||
#define PXEBC_DHCP6_PACKET_MAX_SIZE (sizeof (EFI_PXE_BASE_CODE_PACKET))
|
||||
#define PXEBC_IP6_POLICY_MAX 0xff
|
||||
#define PXEBC_IP6_ROUTE_TABLE_TIMEOUT 10
|
||||
|
||||
#define PXEBC_DHCP6_S_PORT 547
|
||||
#define PXEBC_DHCP6_C_PORT 546
|
||||
#define PXEBC_DHCP6_S_PORT 547
|
||||
#define PXEBC_DHCP6_C_PORT 546
|
||||
|
||||
#define PXEBC_DHCP6_ENTERPRISE_NUM 343 // TODO: IANA TBD: temporarily using Intel's
|
||||
#define PXEBC_DHCP6_MAX_BOOT_FILE_SIZE 65535 // It's a limitation of bit length, 65535*512 bytes.
|
||||
#define PXEBC_DHCP6_ENTERPRISE_NUM 343 // TODO: IANA TBD: temporarily using Intel's
|
||||
#define PXEBC_DHCP6_MAX_BOOT_FILE_SIZE 65535 // It's a limitation of bit length, 65535*512 bytes.
|
||||
|
||||
|
||||
#define PXEBC_DHCP6_IDX_IA_NA 0
|
||||
#define PXEBC_DHCP6_IDX_BOOT_FILE_URL 1
|
||||
#define PXEBC_DHCP6_IDX_BOOT_FILE_PARAM 2
|
||||
#define PXEBC_DHCP6_IDX_VENDOR_CLASS 3
|
||||
#define PXEBC_DHCP6_IDX_DNS_SERVER 4
|
||||
#define PXEBC_DHCP6_IDX_MAX 5
|
||||
#define PXEBC_DHCP6_IDX_IA_NA 0
|
||||
#define PXEBC_DHCP6_IDX_BOOT_FILE_URL 1
|
||||
#define PXEBC_DHCP6_IDX_BOOT_FILE_PARAM 2
|
||||
#define PXEBC_DHCP6_IDX_VENDOR_CLASS 3
|
||||
#define PXEBC_DHCP6_IDX_DNS_SERVER 4
|
||||
#define PXEBC_DHCP6_IDX_MAX 5
|
||||
|
||||
#define PXEBC_DHCP6_BOOT_FILE_URL_PREFIX "tftp://"
|
||||
#define PXEBC_TFTP_URL_SEPARATOR '/'
|
||||
@@ -47,71 +46,67 @@
|
||||
(Type) == PxeOfferTypeProxyPxe10 || \
|
||||
(Type) == PxeOfferTypeProxyWfm11a)
|
||||
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct {
|
||||
UINT16 OpCode[256];
|
||||
UINT16 OpCode[256];
|
||||
} PXEBC_DHCP6_OPTION_ORO;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Type;
|
||||
UINT8 MajorVer;
|
||||
UINT8 MinorVer;
|
||||
UINT8 Type;
|
||||
UINT8 MajorVer;
|
||||
UINT8 MinorVer;
|
||||
} PXEBC_DHCP6_OPTION_UNDI;
|
||||
|
||||
typedef struct {
|
||||
UINT16 Type;
|
||||
UINT16 Type;
|
||||
} PXEBC_DHCP6_OPTION_ARCH;
|
||||
|
||||
typedef struct {
|
||||
UINT8 ClassIdentifier[10];
|
||||
UINT8 ArchitecturePrefix[5];
|
||||
UINT8 ArchitectureType[5];
|
||||
UINT8 Lit3[1];
|
||||
UINT8 InterfaceName[4];
|
||||
UINT8 Lit4[1];
|
||||
UINT8 UndiMajor[3];
|
||||
UINT8 UndiMinor[3];
|
||||
UINT8 ClassIdentifier[10];
|
||||
UINT8 ArchitecturePrefix[5];
|
||||
UINT8 ArchitectureType[5];
|
||||
UINT8 Lit3[1];
|
||||
UINT8 InterfaceName[4];
|
||||
UINT8 Lit4[1];
|
||||
UINT8 UndiMajor[3];
|
||||
UINT8 UndiMinor[3];
|
||||
} PXEBC_CLASS_ID;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Vendor;
|
||||
UINT16 ClassLen;
|
||||
PXEBC_CLASS_ID ClassId;
|
||||
UINT32 Vendor;
|
||||
UINT16 ClassLen;
|
||||
PXEBC_CLASS_ID ClassId;
|
||||
} PXEBC_DHCP6_OPTION_VENDOR_CLASS;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
typedef union {
|
||||
PXEBC_DHCP6_OPTION_ORO *Oro;
|
||||
PXEBC_DHCP6_OPTION_UNDI *Undi;
|
||||
PXEBC_DHCP6_OPTION_ARCH *Arch;
|
||||
PXEBC_DHCP6_OPTION_VENDOR_CLASS *VendorClass;
|
||||
PXEBC_DHCP6_OPTION_ORO *Oro;
|
||||
PXEBC_DHCP6_OPTION_UNDI *Undi;
|
||||
PXEBC_DHCP6_OPTION_ARCH *Arch;
|
||||
PXEBC_DHCP6_OPTION_VENDOR_CLASS *VendorClass;
|
||||
} PXEBC_DHCP6_OPTION_ENTRY;
|
||||
|
||||
typedef struct {
|
||||
LIST_ENTRY Link;
|
||||
EFI_DHCP6_PACKET_OPTION *Option;
|
||||
UINT8 Precedence;
|
||||
LIST_ENTRY Link;
|
||||
EFI_DHCP6_PACKET_OPTION *Option;
|
||||
UINT8 Precedence;
|
||||
} PXEBC_DHCP6_OPTION_NODE;
|
||||
|
||||
#define PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE (OFFSET_OF (EFI_DHCP6_PACKET, Dhcp6) + PXEBC_DHCP6_PACKET_MAX_SIZE)
|
||||
|
||||
typedef union {
|
||||
EFI_DHCP6_PACKET Offer;
|
||||
EFI_DHCP6_PACKET Ack;
|
||||
UINT8 Buffer[PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE];
|
||||
EFI_DHCP6_PACKET Offer;
|
||||
EFI_DHCP6_PACKET Ack;
|
||||
UINT8 Buffer[PXEBC_CACHED_DHCP6_PACKET_MAX_SIZE];
|
||||
} PXEBC_DHCP6_PACKET;
|
||||
|
||||
typedef struct {
|
||||
PXEBC_DHCP6_PACKET Packet;
|
||||
PXEBC_OFFER_TYPE OfferType;
|
||||
EFI_DHCP6_PACKET_OPTION *OptList[PXEBC_DHCP6_IDX_MAX];
|
||||
PXEBC_DHCP6_PACKET Packet;
|
||||
PXEBC_OFFER_TYPE OfferType;
|
||||
EFI_DHCP6_PACKET_OPTION *OptList[PXEBC_DHCP6_IDX_MAX];
|
||||
} PXEBC_DHCP6_PACKET_CACHE;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
Parse the Boot File URL option.
|
||||
|
||||
@@ -128,14 +123,13 @@ typedef struct {
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcExtractBootFileUrl (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT8 **FileName,
|
||||
IN OUT EFI_IPv6_ADDRESS *SrvAddr,
|
||||
IN CHAR8 *BootFile,
|
||||
IN UINT16 Length
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
OUT UINT8 **FileName,
|
||||
IN OUT EFI_IPv6_ADDRESS *SrvAddr,
|
||||
IN CHAR8 *BootFile,
|
||||
IN UINT16 Length
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Parse the Boot File Parameter option.
|
||||
|
||||
@@ -148,11 +142,10 @@ PxeBcExtractBootFileUrl (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcExtractBootFileParam (
|
||||
IN CHAR8 *BootFilePara,
|
||||
OUT UINT16 *BootFileSize
|
||||
IN CHAR8 *BootFilePara,
|
||||
OUT UINT16 *BootFileSize
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Parse the cached DHCPv6 packet, including all the options.
|
||||
|
||||
@@ -167,7 +160,6 @@ PxeBcParseDhcp6Packet (
|
||||
IN PXEBC_DHCP6_PACKET_CACHE *Cache6
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Register the ready address by Ip6Config protocol.
|
||||
|
||||
@@ -180,11 +172,10 @@ PxeBcParseDhcp6Packet (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcRegisterIp6Address (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN EFI_IPv6_ADDRESS *Address
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN EFI_IPv6_ADDRESS *Address
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Unregister the address by Ip6Config protocol.
|
||||
|
||||
@@ -193,10 +184,9 @@ PxeBcRegisterIp6Address (
|
||||
**/
|
||||
VOID
|
||||
PxeBcUnregisterIp6Address (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Build and send out the request packet for the bootfile, and parse the reply.
|
||||
|
||||
@@ -214,11 +204,11 @@ PxeBcUnregisterIp6Address (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDhcp6Discover (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN UINT16 *Layer,
|
||||
IN BOOLEAN UseBis,
|
||||
IN EFI_IP_ADDRESS *DestIp
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN UINT16 Type,
|
||||
IN UINT16 *Layer,
|
||||
IN BOOLEAN UseBis,
|
||||
IN EFI_IP_ADDRESS *DestIp
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -232,7 +222,7 @@ PxeBcDhcp6Discover (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcSetIp6Policy (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -246,7 +236,7 @@ PxeBcSetIp6Policy (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcSetIp6Address (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -261,9 +251,8 @@ PxeBcSetIp6Address (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcDhcp6Sarr (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN EFI_DHCP6_PROTOCOL *Dhcp6
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN EFI_DHCP6_PROTOCOL *Dhcp6
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -10,8 +10,7 @@
|
||||
|
||||
#include "PxeBcImpl.h"
|
||||
|
||||
|
||||
EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp4DriverBinding = {
|
||||
EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp4DriverBinding = {
|
||||
PxeBcIp4DriverBindingSupported,
|
||||
PxeBcIp4DriverBindingStart,
|
||||
PxeBcIp4DriverBindingStop,
|
||||
@@ -20,7 +19,7 @@ EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp4DriverBinding = {
|
||||
NULL
|
||||
};
|
||||
|
||||
EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp6DriverBinding = {
|
||||
EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp6DriverBinding = {
|
||||
PxeBcIp6DriverBindingSupported,
|
||||
PxeBcIp6DriverBindingStart,
|
||||
PxeBcIp6DriverBindingStop,
|
||||
@@ -39,10 +38,10 @@ EFI_DRIVER_BINDING_PROTOCOL gPxeBcIp6DriverBinding = {
|
||||
**/
|
||||
EFI_HANDLE
|
||||
PxeBcGetNicByIp4Children (
|
||||
IN EFI_HANDLE ControllerHandle
|
||||
IN EFI_HANDLE ControllerHandle
|
||||
)
|
||||
{
|
||||
EFI_HANDLE NicHandle;
|
||||
EFI_HANDLE NicHandle;
|
||||
|
||||
NicHandle = NetLibGetNicHandle (ControllerHandle, &gEfiArpProtocolGuid);
|
||||
if (NicHandle == NULL) {
|
||||
@@ -64,7 +63,6 @@ PxeBcGetNicByIp4Children (
|
||||
return NicHandle;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Get the Nic handle using any child handle in the IPv6 stack.
|
||||
|
||||
@@ -75,10 +73,10 @@ PxeBcGetNicByIp4Children (
|
||||
**/
|
||||
EFI_HANDLE
|
||||
PxeBcGetNicByIp6Children (
|
||||
IN EFI_HANDLE ControllerHandle
|
||||
IN EFI_HANDLE ControllerHandle
|
||||
)
|
||||
{
|
||||
EFI_HANDLE NicHandle;
|
||||
EFI_HANDLE NicHandle;
|
||||
|
||||
NicHandle = NetLibGetNicHandle (ControllerHandle, &gEfiIp6ProtocolGuid);
|
||||
if (NicHandle == NULL) {
|
||||
@@ -97,7 +95,6 @@ PxeBcGetNicByIp6Children (
|
||||
return NicHandle;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Destroy the opened instances based on IPv4.
|
||||
|
||||
@@ -111,7 +108,7 @@ PxeBcDestroyIp4Children (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
)
|
||||
{
|
||||
ASSERT(Private != NULL);
|
||||
ASSERT (Private != NULL);
|
||||
|
||||
if (Private->ArpChild != NULL) {
|
||||
//
|
||||
@@ -175,11 +172,11 @@ PxeBcDestroyIp4Children (
|
||||
// Close Udp4 for PxeBc->UdpRead and destroy the instance.
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Private->Udp4ReadChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
Private->Udp4ReadChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
|
||||
NetLibDestroyServiceChild (
|
||||
Private->Controller,
|
||||
@@ -194,11 +191,11 @@ PxeBcDestroyIp4Children (
|
||||
// Close Mtftp4 for PxeBc->Mtftp4 and destroy the instance.
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Private->Mtftp4Child,
|
||||
&gEfiMtftp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
Private->Mtftp4Child,
|
||||
&gEfiMtftp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
|
||||
NetLibDestroyServiceChild (
|
||||
Private->Controller,
|
||||
@@ -213,11 +210,11 @@ PxeBcDestroyIp4Children (
|
||||
// Close Dhcp4 for PxeBc->Dhcp4 and destroy the instance.
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Private->Dhcp4Child,
|
||||
&gEfiDhcp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
Private->Dhcp4Child,
|
||||
&gEfiDhcp4ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
|
||||
NetLibDestroyServiceChild (
|
||||
Private->Controller,
|
||||
@@ -267,19 +264,19 @@ PxeBcDestroyIp4Children (
|
||||
Private->Snp
|
||||
);
|
||||
}
|
||||
|
||||
FreePool (Private->Ip4Nic);
|
||||
}
|
||||
|
||||
Private->ArpChild = NULL;
|
||||
Private->Ip4Child = NULL;
|
||||
Private->Udp4WriteChild = NULL;
|
||||
Private->Udp4ReadChild = NULL;
|
||||
Private->Mtftp4Child = NULL;
|
||||
Private->Dhcp4Child = NULL;
|
||||
Private->Ip4Nic = NULL;
|
||||
Private->ArpChild = NULL;
|
||||
Private->Ip4Child = NULL;
|
||||
Private->Udp4WriteChild = NULL;
|
||||
Private->Udp4ReadChild = NULL;
|
||||
Private->Mtftp4Child = NULL;
|
||||
Private->Dhcp4Child = NULL;
|
||||
Private->Ip4Nic = NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Destroy the opened instances based on IPv6.
|
||||
|
||||
@@ -293,18 +290,18 @@ PxeBcDestroyIp6Children (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
)
|
||||
{
|
||||
ASSERT(Private != NULL);
|
||||
ASSERT (Private != NULL);
|
||||
|
||||
if (Private->Ip6Child != NULL) {
|
||||
//
|
||||
// Close Ip6 for Ip6->Ip6Config and destroy the instance.
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Private->Ip6Child,
|
||||
&gEfiIp6ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
Private->Ip6Child,
|
||||
&gEfiIp6ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
|
||||
NetLibDestroyServiceChild (
|
||||
Private->Controller,
|
||||
@@ -337,11 +334,11 @@ PxeBcDestroyIp6Children (
|
||||
// Close Udp6 for PxeBc->UdpRead and destroy the instance.
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Private->Udp6ReadChild,
|
||||
&gEfiUdp6ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
Private->Udp6ReadChild,
|
||||
&gEfiUdp6ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
NetLibDestroyServiceChild (
|
||||
Private->Controller,
|
||||
This->DriverBindingHandle,
|
||||
@@ -355,11 +352,11 @@ PxeBcDestroyIp6Children (
|
||||
// Close Mtftp6 for PxeBc->Mtftp and destroy the instance.
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Private->Mtftp6Child,
|
||||
&gEfiMtftp6ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
Private->Mtftp6Child,
|
||||
&gEfiMtftp6ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
|
||||
NetLibDestroyServiceChild (
|
||||
Private->Controller,
|
||||
@@ -374,11 +371,11 @@ PxeBcDestroyIp6Children (
|
||||
// Close Dhcp6 for PxeBc->Dhcp and destroy the instance.
|
||||
//
|
||||
gBS->CloseProtocol (
|
||||
Private->Dhcp6Child,
|
||||
&gEfiDhcp6ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
Private->Dhcp6Child,
|
||||
&gEfiDhcp6ProtocolGuid,
|
||||
This->DriverBindingHandle,
|
||||
Private->Controller
|
||||
);
|
||||
|
||||
NetLibDestroyServiceChild (
|
||||
Private->Controller,
|
||||
@@ -427,6 +424,7 @@ PxeBcDestroyIp6Children (
|
||||
Private->Snp
|
||||
);
|
||||
}
|
||||
|
||||
FreePool (Private->Ip6Nic);
|
||||
}
|
||||
|
||||
@@ -452,20 +450,20 @@ PxeBcDestroyIp6Children (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcCheckIpv6Support (
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
OUT BOOLEAN *Ipv6Support
|
||||
IN EFI_HANDLE ControllerHandle,
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
OUT BOOLEAN *Ipv6Support
|
||||
)
|
||||
{
|
||||
EFI_HANDLE Handle;
|
||||
EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;
|
||||
EFI_STATUS Status;
|
||||
EFI_GUID *InfoTypesBuffer;
|
||||
UINTN InfoTypeBufferCount;
|
||||
UINTN TypeIndex;
|
||||
BOOLEAN Supported;
|
||||
VOID *InfoBlock;
|
||||
UINTN InfoBlockSize;
|
||||
EFI_HANDLE Handle;
|
||||
EFI_ADAPTER_INFORMATION_PROTOCOL *Aip;
|
||||
EFI_STATUS Status;
|
||||
EFI_GUID *InfoTypesBuffer;
|
||||
UINTN InfoTypeBufferCount;
|
||||
UINTN TypeIndex;
|
||||
BOOLEAN Supported;
|
||||
VOID *InfoBlock;
|
||||
UINTN InfoBlockSize;
|
||||
|
||||
ASSERT (Private != NULL && Ipv6Support != NULL);
|
||||
|
||||
@@ -493,16 +491,16 @@ PxeBcCheckIpv6Support (
|
||||
Status = gBS->HandleProtocol (
|
||||
Handle,
|
||||
&gEfiAdapterInformationProtocolGuid,
|
||||
(VOID *) &Aip
|
||||
(VOID *)&Aip
|
||||
);
|
||||
if (EFI_ERROR (Status) || Aip == NULL) {
|
||||
if (EFI_ERROR (Status) || (Aip == NULL)) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
InfoTypesBuffer = NULL;
|
||||
InfoTypeBufferCount = 0;
|
||||
Status = Aip->GetSupportedTypes (Aip, &InfoTypesBuffer, &InfoTypeBufferCount);
|
||||
if (EFI_ERROR (Status) || InfoTypesBuffer == NULL) {
|
||||
Status = Aip->GetSupportedTypes (Aip, &InfoTypesBuffer, &InfoTypeBufferCount);
|
||||
if (EFI_ERROR (Status) || (InfoTypesBuffer == NULL)) {
|
||||
FreePool (InfoTypesBuffer);
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
@@ -525,16 +523,15 @@ PxeBcCheckIpv6Support (
|
||||
//
|
||||
InfoBlock = NULL;
|
||||
InfoBlockSize = 0;
|
||||
Status = Aip->GetInformation (Aip, &gEfiAdapterInfoUndiIpv6SupportGuid, &InfoBlock, &InfoBlockSize);
|
||||
if (EFI_ERROR (Status) || InfoBlock == NULL) {
|
||||
Status = Aip->GetInformation (Aip, &gEfiAdapterInfoUndiIpv6SupportGuid, &InfoBlock, &InfoBlockSize);
|
||||
if (EFI_ERROR (Status) || (InfoBlock == NULL)) {
|
||||
FreePool (InfoBlock);
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
*Ipv6Support = ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT *) InfoBlock)->Ipv6Support;
|
||||
*Ipv6Support = ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT *)InfoBlock)->Ipv6Support;
|
||||
FreePool (InfoBlock);
|
||||
return EFI_SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -555,14 +552,14 @@ PxeBcCreateIp4Children (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
IPv4_DEVICE_PATH Ip4Node;
|
||||
EFI_PXE_BASE_CODE_MODE *Mode;
|
||||
EFI_UDP4_CONFIG_DATA *Udp4CfgData;
|
||||
EFI_IP4_CONFIG_DATA *Ip4CfgData;
|
||||
EFI_IP4_MODE_DATA Ip4ModeData;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
||||
EFI_STATUS Status;
|
||||
IPv4_DEVICE_PATH Ip4Node;
|
||||
EFI_PXE_BASE_CODE_MODE *Mode;
|
||||
EFI_UDP4_CONFIG_DATA *Udp4CfgData;
|
||||
EFI_IP4_CONFIG_DATA *Ip4CfgData;
|
||||
EFI_IP4_MODE_DATA Ip4ModeData;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
||||
|
||||
if (Private->Ip4Nic != NULL) {
|
||||
//
|
||||
@@ -587,7 +584,7 @@ PxeBcCreateIp4Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Dhcp4Child,
|
||||
&gEfiDhcp4ProtocolGuid,
|
||||
(VOID **) &Private->Dhcp4,
|
||||
(VOID **)&Private->Dhcp4,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -612,7 +609,7 @@ PxeBcCreateIp4Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Mtftp4Child,
|
||||
&gEfiMtftp4ProtocolGuid,
|
||||
(VOID **) &Private->Mtftp4,
|
||||
(VOID **)&Private->Mtftp4,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -637,7 +634,7 @@ PxeBcCreateIp4Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Udp4ReadChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
(VOID **) &Private->Udp4Read,
|
||||
(VOID **)&Private->Udp4Read,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -662,7 +659,7 @@ PxeBcCreateIp4Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Udp4WriteChild,
|
||||
&gEfiUdp4ProtocolGuid,
|
||||
(VOID **) &Private->Udp4Write,
|
||||
(VOID **)&Private->Udp4Write,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -687,7 +684,7 @@ PxeBcCreateIp4Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->ArpChild,
|
||||
&gEfiArpProtocolGuid,
|
||||
(VOID **) &Private->Arp,
|
||||
(VOID **)&Private->Arp,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -712,7 +709,7 @@ PxeBcCreateIp4Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Ip4Child,
|
||||
&gEfiIp4ProtocolGuid,
|
||||
(VOID **) &Private->Ip4,
|
||||
(VOID **)&Private->Ip4,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -739,13 +736,13 @@ PxeBcCreateIp4Children (
|
||||
Private->Ip4Nic->Private = Private;
|
||||
Private->Ip4Nic->Signature = PXEBC_VIRTUAL_NIC_SIGNATURE;
|
||||
|
||||
//
|
||||
//
|
||||
// Locate Ip4->Ip4Config2 and store it for set IPv4 Policy.
|
||||
//
|
||||
Status = gBS->HandleProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiIp4Config2ProtocolGuid,
|
||||
(VOID **) &Private->Ip4Config2
|
||||
(VOID **)&Private->Ip4Config2
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
@@ -814,7 +811,7 @@ PxeBcCreateIp4Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Ip4Nic->Controller,
|
||||
&gEfiSimpleNetworkProtocolGuid,
|
||||
(VOID **) &Snp,
|
||||
(VOID **)&Snp,
|
||||
This->DriverBindingHandle,
|
||||
Private->Ip4Nic->Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIVE
|
||||
@@ -831,7 +828,7 @@ PxeBcCreateIp4Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiCallerIdGuid,
|
||||
(VOID **) &Id,
|
||||
(VOID **)&Id,
|
||||
This->DriverBindingHandle,
|
||||
Private->Ip4Nic->Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
|
||||
@@ -843,9 +840,9 @@ PxeBcCreateIp4Children (
|
||||
//
|
||||
// Set default configure data for Udp4Read and Ip4 instance.
|
||||
//
|
||||
Mode = Private->PxeBc.Mode;
|
||||
Udp4CfgData = &Private->Udp4CfgData;
|
||||
Ip4CfgData = &Private->Ip4CfgData;
|
||||
Mode = Private->PxeBc.Mode;
|
||||
Udp4CfgData = &Private->Udp4CfgData;
|
||||
Ip4CfgData = &Private->Ip4CfgData;
|
||||
|
||||
Udp4CfgData->AcceptBroadcast = FALSE;
|
||||
Udp4CfgData->AcceptAnyPort = TRUE;
|
||||
@@ -855,12 +852,12 @@ PxeBcCreateIp4Children (
|
||||
Udp4CfgData->ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
Udp4CfgData->TransmitTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
|
||||
Ip4CfgData->AcceptIcmpErrors = TRUE;
|
||||
Ip4CfgData->DefaultProtocol = EFI_IP_PROTO_ICMP;
|
||||
Ip4CfgData->TypeOfService = Mode->ToS;
|
||||
Ip4CfgData->TimeToLive = Mode->TTL;
|
||||
Ip4CfgData->ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
Ip4CfgData->TransmitTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
Ip4CfgData->AcceptIcmpErrors = TRUE;
|
||||
Ip4CfgData->DefaultProtocol = EFI_IP_PROTO_ICMP;
|
||||
Ip4CfgData->TypeOfService = Mode->ToS;
|
||||
Ip4CfgData->TimeToLive = Mode->TTL;
|
||||
Ip4CfgData->ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
Ip4CfgData->TransmitTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
||||
@@ -869,7 +866,6 @@ ON_ERROR:
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Create the opened instances based on IPv6.
|
||||
|
||||
@@ -888,14 +884,14 @@ PxeBcCreateIp6Children (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
IPv6_DEVICE_PATH Ip6Node;
|
||||
EFI_UDP6_CONFIG_DATA *Udp6CfgData;
|
||||
EFI_IP6_CONFIG_DATA *Ip6CfgData;
|
||||
EFI_IP6_MODE_DATA Ip6ModeData;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
||||
UINTN Index;
|
||||
EFI_STATUS Status;
|
||||
IPv6_DEVICE_PATH Ip6Node;
|
||||
EFI_UDP6_CONFIG_DATA *Udp6CfgData;
|
||||
EFI_IP6_CONFIG_DATA *Ip6CfgData;
|
||||
EFI_IP6_MODE_DATA Ip6ModeData;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
||||
UINTN Index;
|
||||
|
||||
if (Private->Ip6Nic != NULL) {
|
||||
//
|
||||
@@ -929,7 +925,7 @@ PxeBcCreateIp6Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Dhcp6Child,
|
||||
&gEfiDhcp6ProtocolGuid,
|
||||
(VOID **) &Private->Dhcp6,
|
||||
(VOID **)&Private->Dhcp6,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -964,7 +960,7 @@ PxeBcCreateIp6Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Mtftp6Child,
|
||||
&gEfiMtftp6ProtocolGuid,
|
||||
(VOID **) &Private->Mtftp6,
|
||||
(VOID **)&Private->Mtftp6,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -989,7 +985,7 @@ PxeBcCreateIp6Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Udp6ReadChild,
|
||||
&gEfiUdp6ProtocolGuid,
|
||||
(VOID **) &Private->Udp6Read,
|
||||
(VOID **)&Private->Udp6Read,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -1014,7 +1010,7 @@ PxeBcCreateIp6Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Udp6WriteChild,
|
||||
&gEfiUdp6ProtocolGuid,
|
||||
(VOID **) &Private->Udp6Write,
|
||||
(VOID **)&Private->Udp6Write,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -1039,7 +1035,7 @@ PxeBcCreateIp6Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Ip6Child,
|
||||
&gEfiIp6ProtocolGuid,
|
||||
(VOID **) &Private->Ip6,
|
||||
(VOID **)&Private->Ip6,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER
|
||||
@@ -1088,7 +1084,7 @@ PxeBcCreateIp6Children (
|
||||
Status = gBS->HandleProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiIp6ConfigProtocolGuid,
|
||||
(VOID **) &Private->Ip6Cfg
|
||||
(VOID **)&Private->Ip6Cfg
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto ON_ERROR;
|
||||
@@ -1098,9 +1094,9 @@ PxeBcCreateIp6Children (
|
||||
// Create a device path node for Ipv6 virtual nic, and append it.
|
||||
//
|
||||
ZeroMem (&Ip6Node, sizeof (IPv6_DEVICE_PATH));
|
||||
Ip6Node.Header.Type = MESSAGING_DEVICE_PATH;
|
||||
Ip6Node.Header.SubType = MSG_IPv6_DP;
|
||||
Ip6Node.PrefixLength = IP6_PREFIX_LENGTH;
|
||||
Ip6Node.Header.Type = MESSAGING_DEVICE_PATH;
|
||||
Ip6Node.Header.SubType = MSG_IPv6_DP;
|
||||
Ip6Node.PrefixLength = IP6_PREFIX_LENGTH;
|
||||
|
||||
SetDevicePathNodeLength (&Ip6Node.Header, sizeof (Ip6Node));
|
||||
|
||||
@@ -1157,7 +1153,7 @@ PxeBcCreateIp6Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
Private->Ip6Nic->Controller,
|
||||
&gEfiSimpleNetworkProtocolGuid,
|
||||
(VOID **) &Snp,
|
||||
(VOID **)&Snp,
|
||||
This->DriverBindingHandle,
|
||||
Private->Ip6Nic->Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIVE
|
||||
@@ -1174,7 +1170,7 @@ PxeBcCreateIp6Children (
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiCallerIdGuid,
|
||||
(VOID **) &Id,
|
||||
(VOID **)&Id,
|
||||
This->DriverBindingHandle,
|
||||
Private->Ip6Nic->Controller,
|
||||
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
|
||||
@@ -1192,15 +1188,15 @@ PxeBcCreateIp6Children (
|
||||
//
|
||||
// Fail to get the data whether UNDI supports IPv6. Set default value.
|
||||
//
|
||||
Private->Mode.Ipv6Available = TRUE;
|
||||
Private->Mode.Ipv6Available = TRUE;
|
||||
}
|
||||
|
||||
if (!Private->Mode.Ipv6Available) {
|
||||
goto ON_ERROR;
|
||||
}
|
||||
|
||||
Udp6CfgData = &Private->Udp6CfgData;
|
||||
Ip6CfgData = &Private->Ip6CfgData;
|
||||
Udp6CfgData = &Private->Udp6CfgData;
|
||||
Ip6CfgData = &Private->Ip6CfgData;
|
||||
|
||||
Udp6CfgData->AcceptAnyPort = TRUE;
|
||||
Udp6CfgData->AllowDuplicatePort = TRUE;
|
||||
@@ -1208,11 +1204,11 @@ PxeBcCreateIp6Children (
|
||||
Udp6CfgData->ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
Udp6CfgData->TransmitTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
|
||||
Ip6CfgData->AcceptIcmpErrors = TRUE;
|
||||
Ip6CfgData->DefaultProtocol = IP6_ICMP;
|
||||
Ip6CfgData->HopLimit = PXEBC_DEFAULT_HOPLIMIT;
|
||||
Ip6CfgData->ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
Ip6CfgData->TransmitTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
Ip6CfgData->AcceptIcmpErrors = TRUE;
|
||||
Ip6CfgData->DefaultProtocol = IP6_ICMP;
|
||||
Ip6CfgData->HopLimit = PXEBC_DEFAULT_HOPLIMIT;
|
||||
Ip6CfgData->ReceiveTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
Ip6CfgData->TransmitTimeout = PXEBC_DEFAULT_LIFETIME;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
||||
@@ -1221,7 +1217,6 @@ ON_ERROR:
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
The entry point for UefiPxeBc driver that installs the driver
|
||||
binding and component name protocol on its image.
|
||||
@@ -1236,13 +1231,13 @@ ON_ERROR:
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
PxeBcDriverEntryPoint (
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
IN EFI_HANDLE ImageHandle,
|
||||
IN EFI_SYSTEM_TABLE *SystemTable
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
if ((PcdGet8(PcdIPv4PXESupport) == PXE_DISABLED) && (PcdGet8(PcdIPv6PXESupport) == PXE_DISABLED)) {
|
||||
if ((PcdGet8 (PcdIPv4PXESupport) == PXE_DISABLED) && (PcdGet8 (PcdIPv6PXESupport) == PXE_DISABLED)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
@@ -1300,20 +1295,22 @@ PxeBcSupported (
|
||||
IN UINT8 IpVersion
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
EFI_GUID *DhcpServiceBindingGuid;
|
||||
EFI_GUID *MtftpServiceBindingGuid;
|
||||
EFI_STATUS Status;
|
||||
EFI_GUID *DhcpServiceBindingGuid;
|
||||
EFI_GUID *MtftpServiceBindingGuid;
|
||||
|
||||
if (IpVersion == IP_VERSION_4) {
|
||||
if (PcdGet8(PcdIPv4PXESupport) == PXE_DISABLED) {
|
||||
if (PcdGet8 (PcdIPv4PXESupport) == PXE_DISABLED) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
DhcpServiceBindingGuid = &gEfiDhcp4ServiceBindingProtocolGuid;
|
||||
MtftpServiceBindingGuid = &gEfiMtftp4ServiceBindingProtocolGuid;
|
||||
} else {
|
||||
if (PcdGet8(PcdIPv6PXESupport) == PXE_DISABLED) {
|
||||
if (PcdGet8 (PcdIPv6PXESupport) == PXE_DISABLED) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
DhcpServiceBindingGuid = &gEfiDhcp6ServiceBindingProtocolGuid;
|
||||
MtftpServiceBindingGuid = &gEfiMtftp6ServiceBindingProtocolGuid;
|
||||
}
|
||||
@@ -1322,22 +1319,22 @@ PxeBcSupported (
|
||||
// Try to open the Mtftp and Dhcp protocol to test whether IP stack is ready.
|
||||
//
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
DhcpServiceBindingGuid,
|
||||
NULL,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
|
||||
);
|
||||
ControllerHandle,
|
||||
DhcpServiceBindingGuid,
|
||||
NULL,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
MtftpServiceBindingGuid,
|
||||
NULL,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
|
||||
);
|
||||
ControllerHandle,
|
||||
MtftpServiceBindingGuid,
|
||||
NULL,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1375,20 +1372,20 @@ PxeBcStart (
|
||||
IN UINT8 IpVersion
|
||||
)
|
||||
{
|
||||
PXEBC_PRIVATE_DATA *Private;
|
||||
EFI_STATUS Status;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
BOOLEAN FirstStart;
|
||||
PXEBC_PRIVATE_DATA *Private;
|
||||
EFI_STATUS Status;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
BOOLEAN FirstStart;
|
||||
|
||||
FirstStart = FALSE;
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiCallerIdGuid,
|
||||
(VOID **) &Id,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiCallerIdGuid,
|
||||
(VOID **)&Id,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// Skip the initialization if the driver has been started already.
|
||||
@@ -1425,7 +1422,7 @@ PxeBcStart (
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiDevicePathProtocolGuid,
|
||||
(VOID **) &Private->DevicePath,
|
||||
(VOID **)&Private->DevicePath,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
@@ -1441,7 +1438,7 @@ PxeBcStart (
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiNetworkInterfaceIdentifierProtocolGuid_31,
|
||||
(VOID **) &Private->Nii,
|
||||
(VOID **)&Private->Nii,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
@@ -1469,7 +1466,7 @@ PxeBcStart (
|
||||
//
|
||||
// Try to locate SNP protocol.
|
||||
//
|
||||
NetLibGetSnpHandle(ControllerHandle, &Private->Snp);
|
||||
NetLibGetSnpHandle (ControllerHandle, &Private->Snp);
|
||||
}
|
||||
|
||||
if (IpVersion == IP_VERSION_4) {
|
||||
@@ -1483,6 +1480,7 @@ PxeBcStart (
|
||||
//
|
||||
Status = PxeBcCreateIp6Children (This, ControllerHandle, Private);
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// Failed to start PXE driver if IPv4 and IPv6 stack are both not available.
|
||||
@@ -1508,14 +1506,13 @@ ON_ERROR:
|
||||
PxeBcDestroyIp6Children (This, Private);
|
||||
}
|
||||
|
||||
if (FirstStart && Private != NULL) {
|
||||
if (FirstStart && (Private != NULL)) {
|
||||
FreePool (Private);
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Stop this driver on ControllerHandle. This is the worker function for
|
||||
PxeBcIp4(6)DriverBindingStop.
|
||||
@@ -1542,12 +1539,12 @@ PxeBcStop (
|
||||
IN UINT8 IpVersion
|
||||
)
|
||||
{
|
||||
PXEBC_PRIVATE_DATA *Private;
|
||||
PXEBC_VIRTUAL_NIC *VirtualNic;
|
||||
EFI_LOAD_FILE_PROTOCOL *LoadFile;
|
||||
EFI_STATUS Status;
|
||||
EFI_HANDLE NicHandle;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
PXEBC_PRIVATE_DATA *Private;
|
||||
PXEBC_VIRTUAL_NIC *VirtualNic;
|
||||
EFI_LOAD_FILE_PROTOCOL *LoadFile;
|
||||
EFI_STATUS Status;
|
||||
EFI_HANDLE NicHandle;
|
||||
PXEBC_PRIVATE_PROTOCOL *Id;
|
||||
|
||||
Private = NULL;
|
||||
NicHandle = NULL;
|
||||
@@ -1558,7 +1555,7 @@ PxeBcStop (
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiLoadFileProtocolGuid,
|
||||
(VOID **) &LoadFile,
|
||||
(VOID **)&LoadFile,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
@@ -1572,6 +1569,7 @@ PxeBcStop (
|
||||
} else {
|
||||
NicHandle = PxeBcGetNicByIp6Children (ControllerHandle);
|
||||
}
|
||||
|
||||
if (NicHandle == NULL) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
@@ -1582,7 +1580,7 @@ PxeBcStop (
|
||||
Status = gBS->OpenProtocol (
|
||||
NicHandle,
|
||||
&gEfiCallerIdGuid,
|
||||
(VOID **) &Id,
|
||||
(VOID **)&Id,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
@@ -1590,8 +1588,8 @@ PxeBcStop (
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
Private = PXEBC_PRIVATE_DATA_FROM_ID (Id);
|
||||
|
||||
Private = PXEBC_PRIVATE_DATA_FROM_ID (Id);
|
||||
} else {
|
||||
//
|
||||
// It's a virtual handle with LoadFileProtocol.
|
||||
@@ -1599,7 +1597,7 @@ PxeBcStop (
|
||||
Status = gBS->OpenProtocol (
|
||||
ControllerHandle,
|
||||
&gEfiLoadFileProtocolGuid,
|
||||
(VOID **) &LoadFile,
|
||||
(VOID **)&LoadFile,
|
||||
This->DriverBindingHandle,
|
||||
ControllerHandle,
|
||||
EFI_OPEN_PROTOCOL_GET_PROTOCOL
|
||||
@@ -1617,20 +1615,19 @@ PxeBcStop (
|
||||
// Stop functionality of PXE Base Code protocol
|
||||
//
|
||||
Status = Private->PxeBc.Stop (&Private->PxeBc);
|
||||
if (Status != EFI_SUCCESS && Status != EFI_NOT_STARTED) {
|
||||
if ((Status != EFI_SUCCESS) && (Status != EFI_NOT_STARTED)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
||||
if (Private->Ip4Nic != NULL && IpVersion == IP_VERSION_4) {
|
||||
if ((Private->Ip4Nic != NULL) && (IpVersion == IP_VERSION_4)) {
|
||||
PxeBcDestroyIp4Children (This, Private);
|
||||
}
|
||||
|
||||
if (Private->Ip6Nic != NULL && IpVersion == IP_VERSION_6) {
|
||||
if ((Private->Ip6Nic != NULL) && (IpVersion == IP_VERSION_6)) {
|
||||
PxeBcDestroyIp6Children (This, Private);
|
||||
}
|
||||
|
||||
if (Private->Ip4Nic == NULL && Private->Ip6Nic == NULL) {
|
||||
if ((Private->Ip4Nic == NULL) && (Private->Ip6Nic == NULL)) {
|
||||
gBS->UninstallProtocolInterface (
|
||||
NicHandle,
|
||||
&gEfiCallerIdGuid,
|
||||
|
@@ -10,8 +10,8 @@
|
||||
#ifndef __EFI_PXEBC_DRIVER_H__
|
||||
#define __EFI_PXEBC_DRIVER_H__
|
||||
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName;
|
||||
extern EFI_COMPONENT_NAME2_PROTOCOL gPxeBcComponentName2;
|
||||
extern EFI_COMPONENT_NAME_PROTOCOL gPxeBcComponentName;
|
||||
extern EFI_COMPONENT_NAME2_PROTOCOL gPxeBcComponentName2;
|
||||
|
||||
/**
|
||||
Test to see if this driver supports ControllerHandle. This service
|
||||
@@ -64,7 +64,6 @@ PxeBcIp4DriverBindingStart (
|
||||
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Stop this driver on ControllerHandle. This service is called by the
|
||||
EFI boot service DisconnectController(). In order to
|
||||
@@ -171,5 +170,5 @@ PxeBcIp6DriverBindingStop (
|
||||
IN UINTN NumberOfChildren,
|
||||
IN EFI_HANDLE *ChildHandleBuffer
|
||||
);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -49,9 +49,9 @@
|
||||
#include <Library/DevicePathLib.h>
|
||||
#include <Library/PcdLib.h>
|
||||
|
||||
typedef struct _PXEBC_PRIVATE_DATA PXEBC_PRIVATE_DATA;
|
||||
typedef struct _PXEBC_PRIVATE_PROTOCOL PXEBC_PRIVATE_PROTOCOL;
|
||||
typedef struct _PXEBC_VIRTUAL_NIC PXEBC_VIRTUAL_NIC;
|
||||
typedef struct _PXEBC_PRIVATE_DATA PXEBC_PRIVATE_DATA;
|
||||
typedef struct _PXEBC_PRIVATE_PROTOCOL PXEBC_PRIVATE_PROTOCOL;
|
||||
typedef struct _PXEBC_VIRTUAL_NIC PXEBC_VIRTUAL_NIC;
|
||||
|
||||
#include "PxeBcDriver.h"
|
||||
#include "PxeBcDhcp4.h"
|
||||
@@ -60,131 +60,131 @@ typedef struct _PXEBC_VIRTUAL_NIC PXEBC_VIRTUAL_NIC;
|
||||
#include "PxeBcBoot.h"
|
||||
#include "PxeBcSupport.h"
|
||||
|
||||
#define PXEBC_DEFAULT_HOPLIMIT 64
|
||||
#define PXEBC_DEFAULT_LIFETIME 50000 // 50 ms, unit is microsecond
|
||||
#define PXEBC_UDP_TIMEOUT 30000000 // 3 seconds, unit is 100nanosecond
|
||||
#define PXEBC_DAD_ADDITIONAL_DELAY 30000000 // 3 seconds
|
||||
#define PXEBC_MTFTP_TIMEOUT 4
|
||||
#define PXEBC_MTFTP_RETRIES 6
|
||||
#define PXEBC_DHCP_RETRIES 4 // refers to mPxeDhcpTimeout, also by PXE2.1 spec.
|
||||
#define PXEBC_MENU_MAX_NUM 24
|
||||
#define PXEBC_OFFER_MAX_NUM 16
|
||||
#define PXEBC_DEFAULT_HOPLIMIT 64
|
||||
#define PXEBC_DEFAULT_LIFETIME 50000 // 50 ms, unit is microsecond
|
||||
#define PXEBC_UDP_TIMEOUT 30000000 // 3 seconds, unit is 100nanosecond
|
||||
#define PXEBC_DAD_ADDITIONAL_DELAY 30000000 // 3 seconds
|
||||
#define PXEBC_MTFTP_TIMEOUT 4
|
||||
#define PXEBC_MTFTP_RETRIES 6
|
||||
#define PXEBC_DHCP_RETRIES 4 // refers to mPxeDhcpTimeout, also by PXE2.1 spec.
|
||||
#define PXEBC_MENU_MAX_NUM 24
|
||||
#define PXEBC_OFFER_MAX_NUM 16
|
||||
|
||||
#define PXEBC_CHECK_MEDIA_WAITING_TIME EFI_TIMER_PERIOD_SECONDS(20)
|
||||
#define PXEBC_CHECK_MEDIA_WAITING_TIME EFI_TIMER_PERIOD_SECONDS(20)
|
||||
|
||||
#define PXEBC_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'X', 'E', 'P')
|
||||
#define PXEBC_VIRTUAL_NIC_SIGNATURE SIGNATURE_32 ('P', 'X', 'E', 'V')
|
||||
#define PXEBC_PRIVATE_DATA_FROM_PXEBC(a) CR (a, PXEBC_PRIVATE_DATA, PxeBc, PXEBC_PRIVATE_DATA_SIGNATURE)
|
||||
#define PXEBC_PRIVATE_DATA_FROM_ID(a) CR (a, PXEBC_PRIVATE_DATA, Id, PXEBC_PRIVATE_DATA_SIGNATURE)
|
||||
#define PXEBC_VIRTUAL_NIC_FROM_LOADFILE(a) CR (a, PXEBC_VIRTUAL_NIC, LoadFile, PXEBC_VIRTUAL_NIC_SIGNATURE)
|
||||
#define PXEBC_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('P', 'X', 'E', 'P')
|
||||
#define PXEBC_VIRTUAL_NIC_SIGNATURE SIGNATURE_32 ('P', 'X', 'E', 'V')
|
||||
#define PXEBC_PRIVATE_DATA_FROM_PXEBC(a) CR (a, PXEBC_PRIVATE_DATA, PxeBc, PXEBC_PRIVATE_DATA_SIGNATURE)
|
||||
#define PXEBC_PRIVATE_DATA_FROM_ID(a) CR (a, PXEBC_PRIVATE_DATA, Id, PXEBC_PRIVATE_DATA_SIGNATURE)
|
||||
#define PXEBC_VIRTUAL_NIC_FROM_LOADFILE(a) CR (a, PXEBC_VIRTUAL_NIC, LoadFile, PXEBC_VIRTUAL_NIC_SIGNATURE)
|
||||
|
||||
#define PXE_ENABLED 0x01
|
||||
#define PXE_DISABLED 0x00
|
||||
#define PXE_ENABLED 0x01
|
||||
#define PXE_DISABLED 0x00
|
||||
|
||||
typedef union {
|
||||
PXEBC_DHCP4_PACKET_CACHE Dhcp4;
|
||||
PXEBC_DHCP6_PACKET_CACHE Dhcp6;
|
||||
PXEBC_DHCP4_PACKET_CACHE Dhcp4;
|
||||
PXEBC_DHCP6_PACKET_CACHE Dhcp6;
|
||||
} PXEBC_DHCP_PACKET_CACHE;
|
||||
|
||||
struct _PXEBC_PRIVATE_PROTOCOL {
|
||||
UINT64 Reserved;
|
||||
UINT64 Reserved;
|
||||
};
|
||||
|
||||
struct _PXEBC_VIRTUAL_NIC {
|
||||
UINT32 Signature;
|
||||
EFI_HANDLE Controller;
|
||||
EFI_LOAD_FILE_PROTOCOL LoadFile;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
PXEBC_PRIVATE_DATA *Private;
|
||||
UINT32 Signature;
|
||||
EFI_HANDLE Controller;
|
||||
EFI_LOAD_FILE_PROTOCOL LoadFile;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
PXEBC_PRIVATE_DATA *Private;
|
||||
};
|
||||
|
||||
struct _PXEBC_PRIVATE_DATA {
|
||||
UINT32 Signature;
|
||||
EFI_HANDLE Controller;
|
||||
EFI_HANDLE Image;
|
||||
UINT32 Signature;
|
||||
EFI_HANDLE Controller;
|
||||
EFI_HANDLE Image;
|
||||
|
||||
PXEBC_PRIVATE_PROTOCOL Id;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
||||
PXEBC_PRIVATE_PROTOCOL Id;
|
||||
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
|
||||
|
||||
PXEBC_VIRTUAL_NIC *Ip4Nic;
|
||||
PXEBC_VIRTUAL_NIC *Ip6Nic;
|
||||
PXEBC_VIRTUAL_NIC *Ip4Nic;
|
||||
PXEBC_VIRTUAL_NIC *Ip6Nic;
|
||||
|
||||
EFI_HANDLE ArpChild;
|
||||
EFI_HANDLE Ip4Child;
|
||||
EFI_HANDLE Dhcp4Child;
|
||||
EFI_HANDLE Mtftp4Child;
|
||||
EFI_HANDLE Udp4ReadChild;
|
||||
EFI_HANDLE Udp4WriteChild;
|
||||
EFI_HANDLE ArpChild;
|
||||
EFI_HANDLE Ip4Child;
|
||||
EFI_HANDLE Dhcp4Child;
|
||||
EFI_HANDLE Mtftp4Child;
|
||||
EFI_HANDLE Udp4ReadChild;
|
||||
EFI_HANDLE Udp4WriteChild;
|
||||
|
||||
EFI_ARP_PROTOCOL *Arp;
|
||||
EFI_IP4_PROTOCOL *Ip4;
|
||||
EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;
|
||||
EFI_DHCP4_PROTOCOL *Dhcp4;
|
||||
EFI_MTFTP4_PROTOCOL *Mtftp4;
|
||||
EFI_UDP4_PROTOCOL *Udp4Read;
|
||||
EFI_UDP4_PROTOCOL *Udp4Write;
|
||||
EFI_ARP_PROTOCOL *Arp;
|
||||
EFI_IP4_PROTOCOL *Ip4;
|
||||
EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2;
|
||||
EFI_DHCP4_PROTOCOL *Dhcp4;
|
||||
EFI_MTFTP4_PROTOCOL *Mtftp4;
|
||||
EFI_UDP4_PROTOCOL *Udp4Read;
|
||||
EFI_UDP4_PROTOCOL *Udp4Write;
|
||||
|
||||
EFI_HANDLE Ip6Child;
|
||||
EFI_HANDLE Dhcp6Child;
|
||||
EFI_HANDLE Mtftp6Child;
|
||||
EFI_HANDLE Udp6ReadChild;
|
||||
EFI_HANDLE Udp6WriteChild;
|
||||
EFI_HANDLE Ip6Child;
|
||||
EFI_HANDLE Dhcp6Child;
|
||||
EFI_HANDLE Mtftp6Child;
|
||||
EFI_HANDLE Udp6ReadChild;
|
||||
EFI_HANDLE Udp6WriteChild;
|
||||
|
||||
EFI_IP6_PROTOCOL *Ip6;
|
||||
EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg;
|
||||
EFI_DHCP6_PROTOCOL *Dhcp6;
|
||||
EFI_MTFTP6_PROTOCOL *Mtftp6;
|
||||
EFI_UDP6_PROTOCOL *Udp6Read;
|
||||
EFI_UDP6_PROTOCOL *Udp6Write;
|
||||
EFI_DNS6_PROTOCOL *Dns6;
|
||||
EFI_IP6_PROTOCOL *Ip6;
|
||||
EFI_IP6_CONFIG_PROTOCOL *Ip6Cfg;
|
||||
EFI_DHCP6_PROTOCOL *Dhcp6;
|
||||
EFI_MTFTP6_PROTOCOL *Mtftp6;
|
||||
EFI_UDP6_PROTOCOL *Udp6Read;
|
||||
EFI_UDP6_PROTOCOL *Udp6Write;
|
||||
EFI_DNS6_PROTOCOL *Dns6;
|
||||
|
||||
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *Nii;
|
||||
EFI_PXE_BASE_CODE_PROTOCOL PxeBc;
|
||||
EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL LoadFileCallback;
|
||||
EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *PxeBcCallback;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL *Nii;
|
||||
EFI_PXE_BASE_CODE_PROTOCOL PxeBc;
|
||||
EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL LoadFileCallback;
|
||||
EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL *PxeBcCallback;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
|
||||
|
||||
EFI_PXE_BASE_CODE_MODE Mode;
|
||||
EFI_PXE_BASE_CODE_FUNCTION Function;
|
||||
UINT32 Ip6Policy;
|
||||
UINT32 SolicitTimes;
|
||||
UINT64 ElapsedTime;
|
||||
EFI_PXE_BASE_CODE_MODE Mode;
|
||||
EFI_PXE_BASE_CODE_FUNCTION Function;
|
||||
UINT32 Ip6Policy;
|
||||
UINT32 SolicitTimes;
|
||||
UINT64 ElapsedTime;
|
||||
|
||||
EFI_UDP4_CONFIG_DATA Udp4CfgData;
|
||||
EFI_UDP6_CONFIG_DATA Udp6CfgData;
|
||||
EFI_IP4_CONFIG_DATA Ip4CfgData;
|
||||
EFI_IP6_CONFIG_DATA Ip6CfgData;
|
||||
EFI_UDP4_CONFIG_DATA Udp4CfgData;
|
||||
EFI_UDP6_CONFIG_DATA Udp6CfgData;
|
||||
EFI_IP4_CONFIG_DATA Ip4CfgData;
|
||||
EFI_IP6_CONFIG_DATA Ip6CfgData;
|
||||
|
||||
EFI_EVENT UdpTimeOutEvent;
|
||||
EFI_EVENT ArpUpdateEvent;
|
||||
EFI_IP4_COMPLETION_TOKEN IcmpToken;
|
||||
EFI_IP6_COMPLETION_TOKEN Icmp6Token;
|
||||
EFI_EVENT UdpTimeOutEvent;
|
||||
EFI_EVENT ArpUpdateEvent;
|
||||
EFI_IP4_COMPLETION_TOKEN IcmpToken;
|
||||
EFI_IP6_COMPLETION_TOKEN Icmp6Token;
|
||||
|
||||
BOOLEAN IsAddressOk;
|
||||
BOOLEAN IsOfferSorted;
|
||||
BOOLEAN IsProxyRecved;
|
||||
BOOLEAN IsDoDiscover;
|
||||
BOOLEAN IsAddressOk;
|
||||
BOOLEAN IsOfferSorted;
|
||||
BOOLEAN IsProxyRecved;
|
||||
BOOLEAN IsDoDiscover;
|
||||
|
||||
EFI_IP_ADDRESS TmpStationIp;
|
||||
EFI_IP_ADDRESS StationIp;
|
||||
EFI_IP_ADDRESS SubnetMask;
|
||||
EFI_IP_ADDRESS GatewayIp;
|
||||
EFI_IP_ADDRESS ServerIp;
|
||||
EFI_IPv6_ADDRESS *DnsServer;
|
||||
UINT16 CurSrcPort;
|
||||
UINT32 IaId;
|
||||
EFI_IP_ADDRESS TmpStationIp;
|
||||
EFI_IP_ADDRESS StationIp;
|
||||
EFI_IP_ADDRESS SubnetMask;
|
||||
EFI_IP_ADDRESS GatewayIp;
|
||||
EFI_IP_ADDRESS ServerIp;
|
||||
EFI_IPv6_ADDRESS *DnsServer;
|
||||
UINT16 CurSrcPort;
|
||||
UINT32 IaId;
|
||||
|
||||
UINT32 Ip4MaxPacketSize;
|
||||
UINT32 Ip6MaxPacketSize;
|
||||
UINT8 *BootFileName;
|
||||
UINTN BootFileSize;
|
||||
UINTN BlockSize;
|
||||
UINT32 Ip4MaxPacketSize;
|
||||
UINT32 Ip6MaxPacketSize;
|
||||
UINT8 *BootFileName;
|
||||
UINTN BootFileSize;
|
||||
UINTN BlockSize;
|
||||
|
||||
PXEBC_DHCP_PACKET_CACHE ProxyOffer;
|
||||
PXEBC_DHCP_PACKET_CACHE DhcpAck;
|
||||
PXEBC_DHCP_PACKET_CACHE PxeReply;
|
||||
EFI_DHCP6_PACKET *Dhcp6Request;
|
||||
EFI_DHCP4_PACKET SeedPacket;
|
||||
PXEBC_DHCP_PACKET_CACHE ProxyOffer;
|
||||
PXEBC_DHCP_PACKET_CACHE DhcpAck;
|
||||
PXEBC_DHCP_PACKET_CACHE PxeReply;
|
||||
EFI_DHCP6_PACKET *Dhcp6Request;
|
||||
EFI_DHCP4_PACKET SeedPacket;
|
||||
|
||||
//
|
||||
// OfferIndex records the index of DhcpOffer[] buffer, and OfferCount records the num of each type of offer.
|
||||
@@ -213,12 +213,12 @@ struct _PXEBC_PRIVATE_DATA {
|
||||
// (OfferIndex is 0-based.)
|
||||
//
|
||||
//
|
||||
UINT32 SelectIndex;
|
||||
UINT32 SelectProxyType;
|
||||
PXEBC_DHCP_PACKET_CACHE OfferBuffer[PXEBC_OFFER_MAX_NUM];
|
||||
UINT32 OfferNum;
|
||||
UINT32 OfferCount[PxeOfferTypeMax];
|
||||
UINT32 OfferIndex[PxeOfferTypeMax][PXEBC_OFFER_MAX_NUM];
|
||||
UINT32 SelectIndex;
|
||||
UINT32 SelectProxyType;
|
||||
PXEBC_DHCP_PACKET_CACHE OfferBuffer[PXEBC_OFFER_MAX_NUM];
|
||||
UINT32 OfferNum;
|
||||
UINT32 OfferCount[PxeOfferTypeMax];
|
||||
UINT32 OfferIndex[PxeOfferTypeMax][PXEBC_OFFER_MAX_NUM];
|
||||
};
|
||||
|
||||
extern EFI_PXE_BASE_CODE_PROTOCOL gPxeBcProtocolTemplate;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -18,9 +18,8 @@
|
||||
#define PXE_MTFTP_OPTION_MAXIMUM_INDEX 5
|
||||
#define PXE_MTFTP_OPTBUF_MAXNUM_INDEX 128
|
||||
|
||||
#define PXE_MTFTP_ERROR_STRING_LENGTH 127 // refer to definition of struct EFI_PXE_BASE_CODE_TFTP_ERROR.
|
||||
#define PXE_MTFTP_DEFAULT_BLOCK_SIZE 512 // refer to rfc-1350.
|
||||
|
||||
#define PXE_MTFTP_ERROR_STRING_LENGTH 127 // refer to definition of struct EFI_PXE_BASE_CODE_TFTP_ERROR.
|
||||
#define PXE_MTFTP_DEFAULT_BLOCK_SIZE 512 // refer to rfc-1350.
|
||||
|
||||
/**
|
||||
This function is wrapper to get the file size using TFTP.
|
||||
@@ -40,15 +39,14 @@
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcTftpGetFileSize (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN VOID *Config,
|
||||
IN UINT8 *Filename,
|
||||
IN UINTN *BlockSize,
|
||||
IN UINTN *WindowSize,
|
||||
IN OUT UINT64 *BufferSize
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN VOID *Config,
|
||||
IN UINT8 *Filename,
|
||||
IN UINTN *BlockSize,
|
||||
IN UINTN *WindowSize,
|
||||
IN OUT UINT64 *BufferSize
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is a wrapper to get a file using TFTP.
|
||||
|
||||
@@ -68,17 +66,16 @@ PxeBcTftpGetFileSize (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcTftpReadFile (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN VOID *Config,
|
||||
IN UINT8 *Filename,
|
||||
IN UINTN *BlockSize,
|
||||
IN UINTN *WindowSize,
|
||||
IN UINT8 *BufferPtr,
|
||||
IN OUT UINT64 *BufferSize,
|
||||
IN BOOLEAN DontUseBuffer
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN VOID *Config,
|
||||
IN UINT8 *Filename,
|
||||
IN UINTN *BlockSize,
|
||||
IN UINTN *WindowSize,
|
||||
IN UINT8 *BufferPtr,
|
||||
IN OUT UINT64 *BufferSize,
|
||||
IN BOOLEAN DontUseBuffer
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is a wrapper to put file with TFTP.
|
||||
|
||||
@@ -97,16 +94,15 @@ PxeBcTftpReadFile (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcTftpWriteFile (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN VOID *Config,
|
||||
IN UINT8 *Filename,
|
||||
IN BOOLEAN Overwrite,
|
||||
IN UINTN *BlockSize,
|
||||
IN UINT8 *BufferPtr,
|
||||
IN OUT UINT64 *BufferSize
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN VOID *Config,
|
||||
IN UINT8 *Filename,
|
||||
IN BOOLEAN Overwrite,
|
||||
IN UINTN *BlockSize,
|
||||
IN UINT8 *BufferPtr,
|
||||
IN OUT UINT64 *BufferSize
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is a wrapper to get the data (file) from a directory using TFTP.
|
||||
|
||||
@@ -126,13 +122,14 @@ PxeBcTftpWriteFile (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcTftpReadDirectory (
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN VOID *Config,
|
||||
IN UINT8 *Filename,
|
||||
IN UINTN *BlockSize,
|
||||
IN UINTN *WindowSize,
|
||||
IN UINT8 *BufferPtr,
|
||||
IN OUT UINT64 *BufferSize,
|
||||
IN BOOLEAN DontUseBuffer
|
||||
IN PXEBC_PRIVATE_DATA *Private,
|
||||
IN VOID *Config,
|
||||
IN UINT8 *Filename,
|
||||
IN UINTN *BlockSize,
|
||||
IN UINTN *WindowSize,
|
||||
IN UINT8 *BufferPtr,
|
||||
IN OUT UINT64 *BufferSize,
|
||||
IN BOOLEAN DontUseBuffer
|
||||
);
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -10,15 +10,12 @@
|
||||
#ifndef __EFI_PXEBC_SUPPORT_H__
|
||||
#define __EFI_PXEBC_SUPPORT_H__
|
||||
|
||||
|
||||
#define ICMP_DEST_UNREACHABLE 3
|
||||
#define ICMP_SOURCE_QUENCH 4
|
||||
#define ICMP_REDIRECT 5
|
||||
#define ICMP_ECHO_REQUEST 8
|
||||
#define ICMP_TIME_EXCEEDED 11
|
||||
#define ICMP_PARAMETER_PROBLEM 12
|
||||
|
||||
|
||||
#define ICMP_DEST_UNREACHABLE 3
|
||||
#define ICMP_SOURCE_QUENCH 4
|
||||
#define ICMP_REDIRECT 5
|
||||
#define ICMP_ECHO_REQUEST 8
|
||||
#define ICMP_TIME_EXCEEDED 11
|
||||
#define ICMP_PARAMETER_PROBLEM 12
|
||||
|
||||
/**
|
||||
Flush the previous configuration using the new station Ip address.
|
||||
@@ -33,12 +30,11 @@
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcFlushStationIp (
|
||||
PXEBC_PRIVATE_DATA *Private,
|
||||
EFI_IP_ADDRESS *StationIp OPTIONAL,
|
||||
EFI_IP_ADDRESS *SubnetMask OPTIONAL
|
||||
PXEBC_PRIVATE_DATA *Private,
|
||||
EFI_IP_ADDRESS *StationIp OPTIONAL,
|
||||
EFI_IP_ADDRESS *SubnetMask OPTIONAL
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Notify callback function when an event is triggered.
|
||||
|
||||
@@ -49,11 +45,10 @@ PxeBcFlushStationIp (
|
||||
VOID
|
||||
EFIAPI
|
||||
PxeBcCommonNotify (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Perform arp resolution from the arp cache in PxeBcMode.
|
||||
|
||||
@@ -68,12 +63,11 @@ PxeBcCommonNotify (
|
||||
**/
|
||||
BOOLEAN
|
||||
PxeBcCheckArpCache (
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN EFI_IPv4_ADDRESS *Ip4Addr,
|
||||
OUT EFI_MAC_ADDRESS *MacAddress
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN EFI_IPv4_ADDRESS *Ip4Addr,
|
||||
OUT EFI_MAC_ADDRESS *MacAddress
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Update arp cache periodically.
|
||||
|
||||
@@ -84,11 +78,10 @@ PxeBcCheckArpCache (
|
||||
VOID
|
||||
EFIAPI
|
||||
PxeBcArpCacheUpdate (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
xxx
|
||||
|
||||
@@ -99,11 +92,10 @@ PxeBcArpCacheUpdate (
|
||||
VOID
|
||||
EFIAPI
|
||||
PxeBcIcmpErrorUpdate (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
xxx
|
||||
|
||||
@@ -114,11 +106,10 @@ PxeBcIcmpErrorUpdate (
|
||||
VOID
|
||||
EFIAPI
|
||||
PxeBcIcmp6ErrorUpdate (
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
IN EFI_EVENT Event,
|
||||
IN VOID *Context
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is to configure a UDPv4 instance for UdpWrite.
|
||||
|
||||
@@ -148,7 +139,6 @@ PxeBcConfigUdp4Write (
|
||||
IN UINT8 ToS
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is to configure a UDPv6 instance for UdpWrite.
|
||||
|
||||
@@ -187,17 +177,16 @@ PxeBcConfigUdp6Write (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcUdp4Write (
|
||||
IN EFI_UDP4_PROTOCOL *Udp4,
|
||||
IN EFI_UDP4_SESSION_DATA *Session,
|
||||
IN EFI_EVENT TimeoutEvent,
|
||||
IN EFI_IPv4_ADDRESS *Gateway OPTIONAL,
|
||||
IN UINTN *HeaderSize OPTIONAL,
|
||||
IN VOID *HeaderPtr OPTIONAL,
|
||||
IN UINTN *BufferSize,
|
||||
IN VOID *BufferPtr
|
||||
IN EFI_UDP4_PROTOCOL *Udp4,
|
||||
IN EFI_UDP4_SESSION_DATA *Session,
|
||||
IN EFI_EVENT TimeoutEvent,
|
||||
IN EFI_IPv4_ADDRESS *Gateway OPTIONAL,
|
||||
IN UINTN *HeaderSize OPTIONAL,
|
||||
IN VOID *HeaderPtr OPTIONAL,
|
||||
IN UINTN *BufferSize,
|
||||
IN VOID *BufferPtr
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is to configure a UDPv6 instance for UdpWrite.
|
||||
|
||||
@@ -217,16 +206,15 @@ PxeBcUdp4Write (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcUdp6Write (
|
||||
IN EFI_UDP6_PROTOCOL *Udp6,
|
||||
IN EFI_UDP6_SESSION_DATA *Session,
|
||||
IN EFI_EVENT TimeoutEvent,
|
||||
IN UINTN *HeaderSize OPTIONAL,
|
||||
IN VOID *HeaderPtr OPTIONAL,
|
||||
IN UINTN *BufferSize,
|
||||
IN VOID *BufferPtr
|
||||
IN EFI_UDP6_PROTOCOL *Udp6,
|
||||
IN EFI_UDP6_SESSION_DATA *Session,
|
||||
IN EFI_EVENT TimeoutEvent,
|
||||
IN UINTN *HeaderSize OPTIONAL,
|
||||
IN VOID *HeaderPtr OPTIONAL,
|
||||
IN UINTN *BufferSize,
|
||||
IN VOID *BufferPtr
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Check the received packet with the Ip filter.
|
||||
|
||||
@@ -240,12 +228,11 @@ PxeBcUdp6Write (
|
||||
**/
|
||||
BOOLEAN
|
||||
PxeBcCheckByIpFilter (
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN UINT16 OpFlags
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN UINT16 OpFlags
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Filter the received packet with the destination Ip.
|
||||
|
||||
@@ -260,13 +247,12 @@ PxeBcCheckByIpFilter (
|
||||
**/
|
||||
BOOLEAN
|
||||
PxeBcCheckByDestIp (
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN OUT EFI_IP_ADDRESS *DestIp,
|
||||
IN UINT16 OpFlags
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN OUT EFI_IP_ADDRESS *DestIp,
|
||||
IN UINT16 OpFlags
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Check the received packet with the destination port.
|
||||
|
||||
@@ -281,13 +267,12 @@ PxeBcCheckByDestIp (
|
||||
**/
|
||||
BOOLEAN
|
||||
PxeBcCheckByDestPort (
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN OUT UINT16 *DestPort,
|
||||
IN UINT16 OpFlags
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN OUT UINT16 *DestPort,
|
||||
IN UINT16 OpFlags
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Filter the received packet with the source Ip.
|
||||
|
||||
@@ -302,13 +287,12 @@ PxeBcCheckByDestPort (
|
||||
**/
|
||||
BOOLEAN
|
||||
PxeBcFilterBySrcIp (
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN OUT EFI_IP_ADDRESS *SrcIp,
|
||||
IN UINT16 OpFlags
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN OUT EFI_IP_ADDRESS *SrcIp,
|
||||
IN UINT16 OpFlags
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
Filter the received packet with the source port.
|
||||
|
||||
@@ -323,13 +307,12 @@ PxeBcFilterBySrcIp (
|
||||
**/
|
||||
BOOLEAN
|
||||
PxeBcFilterBySrcPort (
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN OUT UINT16 *SrcPort,
|
||||
IN UINT16 OpFlags
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN VOID *Session,
|
||||
IN OUT UINT16 *SrcPort,
|
||||
IN UINT16 OpFlags
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is to receive packet with Udp4Read.
|
||||
|
||||
@@ -351,20 +334,19 @@ PxeBcFilterBySrcPort (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcUdp4Read (
|
||||
IN EFI_UDP4_PROTOCOL *Udp4,
|
||||
IN EFI_UDP4_COMPLETION_TOKEN *Token,
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN EFI_EVENT TimeoutEvent,
|
||||
IN UINT16 OpFlags,
|
||||
IN BOOLEAN *IsDone,
|
||||
OUT BOOLEAN *IsMatched,
|
||||
IN OUT EFI_IP_ADDRESS *DestIp OPTIONAL,
|
||||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL,
|
||||
IN OUT EFI_IP_ADDRESS *SrcIp OPTIONAL,
|
||||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL
|
||||
IN EFI_UDP4_PROTOCOL *Udp4,
|
||||
IN EFI_UDP4_COMPLETION_TOKEN *Token,
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN EFI_EVENT TimeoutEvent,
|
||||
IN UINT16 OpFlags,
|
||||
IN BOOLEAN *IsDone,
|
||||
OUT BOOLEAN *IsMatched,
|
||||
IN OUT EFI_IP_ADDRESS *DestIp OPTIONAL,
|
||||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL,
|
||||
IN OUT EFI_IP_ADDRESS *SrcIp OPTIONAL,
|
||||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is to receive packet with Udp6Read.
|
||||
|
||||
@@ -386,20 +368,19 @@ PxeBcUdp4Read (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcUdp6Read (
|
||||
IN EFI_UDP6_PROTOCOL *Udp6,
|
||||
IN EFI_UDP6_COMPLETION_TOKEN *Token,
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN EFI_EVENT TimeoutEvent,
|
||||
IN UINT16 OpFlags,
|
||||
IN BOOLEAN *IsDone,
|
||||
OUT BOOLEAN *IsMatched,
|
||||
IN OUT EFI_IP_ADDRESS *DestIp OPTIONAL,
|
||||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL,
|
||||
IN OUT EFI_IP_ADDRESS *SrcIp OPTIONAL,
|
||||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL
|
||||
IN EFI_UDP6_PROTOCOL *Udp6,
|
||||
IN EFI_UDP6_COMPLETION_TOKEN *Token,
|
||||
IN EFI_PXE_BASE_CODE_MODE *Mode,
|
||||
IN EFI_EVENT TimeoutEvent,
|
||||
IN UINT16 OpFlags,
|
||||
IN BOOLEAN *IsDone,
|
||||
OUT BOOLEAN *IsMatched,
|
||||
IN OUT EFI_IP_ADDRESS *DestIp OPTIONAL,
|
||||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *DestPort OPTIONAL,
|
||||
IN OUT EFI_IP_ADDRESS *SrcIp OPTIONAL,
|
||||
IN OUT EFI_PXE_BASE_CODE_UDP_PORT *SrcPort OPTIONAL
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is to display the IPv4 address.
|
||||
|
||||
@@ -408,10 +389,9 @@ PxeBcUdp6Read (
|
||||
**/
|
||||
VOID
|
||||
PxeBcShowIp4Addr (
|
||||
IN EFI_IPv4_ADDRESS *Ip
|
||||
IN EFI_IPv4_ADDRESS *Ip
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is to display the IPv6 address.
|
||||
|
||||
@@ -420,10 +400,9 @@ PxeBcShowIp4Addr (
|
||||
**/
|
||||
VOID
|
||||
PxeBcShowIp6Addr (
|
||||
IN EFI_IPv6_ADDRESS *Ip
|
||||
IN EFI_IPv6_ADDRESS *Ip
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is to convert UINTN to ASCII string with required format.
|
||||
|
||||
@@ -434,12 +413,11 @@ PxeBcShowIp6Addr (
|
||||
**/
|
||||
VOID
|
||||
PxeBcUintnToAscDecWithFormat (
|
||||
IN UINTN Number,
|
||||
IN UINT8 *Buffer,
|
||||
IN INTN Length
|
||||
IN UINTN Number,
|
||||
IN UINT8 *Buffer,
|
||||
IN INTN Length
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
This function is to convert a UINTN to a ASCII string, and return the
|
||||
actual length of the buffer.
|
||||
@@ -453,9 +431,9 @@ PxeBcUintnToAscDecWithFormat (
|
||||
**/
|
||||
UINTN
|
||||
PxeBcUintnToAscDec (
|
||||
IN UINTN Number,
|
||||
IN UINT8 *Buffer,
|
||||
IN UINTN BufferSize
|
||||
IN UINTN Number,
|
||||
IN UINT8 *Buffer,
|
||||
IN UINTN BufferSize
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -470,8 +448,8 @@ PxeBcUintnToAscDec (
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeBcUniHexToUint8 (
|
||||
OUT UINT8 *Digit,
|
||||
IN CHAR16 Char
|
||||
OUT UINT8 *Digit,
|
||||
IN CHAR16 Char
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -482,7 +460,7 @@ PxeBcUniHexToUint8 (
|
||||
**/
|
||||
VOID
|
||||
CalcElapsedTime (
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
IN PXEBC_PRIVATE_DATA *Private
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -495,7 +473,7 @@ CalcElapsedTime (
|
||||
**/
|
||||
EFI_HANDLE
|
||||
PxeBcGetNicByIp4Children (
|
||||
IN EFI_HANDLE ControllerHandle
|
||||
IN EFI_HANDLE ControllerHandle
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -508,6 +486,7 @@ PxeBcGetNicByIp4Children (
|
||||
**/
|
||||
EFI_HANDLE
|
||||
PxeBcGetNicByIp6Children (
|
||||
IN EFI_HANDLE ControllerHandle
|
||||
IN EFI_HANDLE ControllerHandle
|
||||
);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user