]> git.proxmox.com Git - mirror_edk2.git/blame - NetworkPkg/UefiPxeBcDxe/PxeBcBoot.h
NetworkPkg: Apply uncrustify changes
[mirror_edk2.git] / NetworkPkg / UefiPxeBcDxe / PxeBcBoot.h
CommitLineData
a3bcde70
HT
1/** @file\r
2 Boot functions declaration for UefiPxeBc Driver.\r
3\r
9063c328 4 Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
a3bcde70 5\r
ecf98fbc 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
a3bcde70
HT
7\r
8**/\r
9\r
10#ifndef __EFI_PXEBC_BOOT_H__\r
11#define __EFI_PXEBC_BOOT_H__\r
12\r
d1050b9d
MK
13#define PXEBC_DISPLAY_MAX_LINE 70\r
14#define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE 8\r
15#define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE 4\r
a3bcde70 16\r
d1050b9d 17#define PXEBC_IS_SIZE_OVERFLOWED(x) ((sizeof (UINTN) < sizeof (UINT64)) && ((x) > 0xFFFFFFFF))\r
a3bcde70
HT
18\r
19/**\r
20 Extract the discover information and boot server entry from the\r
21 cached packets if unspecified.\r
22\r
23 @param[in] Private Pointer to PxeBc private data.\r
24 @param[in] Type The type of bootstrap to perform.\r
9063c328 25 @param[in, out] DiscoverInfo Pointer to EFI_PXE_BASE_CODE_DISCOVER_INFO.\r
a3bcde70
HT
26 @param[out] BootEntry Pointer to PXEBC_BOOT_SVR_ENTRY.\r
27 @param[out] SrvList Pointer to EFI_PXE_BASE_CODE_SRVLIST.\r
28\r
29 @retval EFI_SUCCESS Successfully extracted the information.\r
30 @retval EFI_DEVICE_ERROR Failed to extract the information.\r
31\r
32**/\r
33EFI_STATUS\r
34PxeBcExtractDiscoverInfo (\r
35 IN PXEBC_PRIVATE_DATA *Private,\r
36 IN UINT16 Type,\r
9063c328 37 IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO **DiscoverInfo,\r
d1050b9d
MK
38 OUT PXEBC_BOOT_SVR_ENTRY **BootEntry,\r
39 OUT EFI_PXE_BASE_CODE_SRVLIST **SrvList\r
a3bcde70
HT
40 );\r
41\r
a3bcde70
HT
42/**\r
43 Build the discover packet and send out for boot.\r
44\r
45 @param[in] Private Pointer to PxeBc private data.\r
46 @param[in] Type PxeBc option boot item type.\r
47 @param[in] Layer Pointer to option boot item layer.\r
48 @param[in] UseBis Use BIS or not.\r
49 @param[in] DestIp Pointer to the server address.\r
50 @param[in] IpCount The total count of the server address.\r
51 @param[in] SrvList Pointer to the server address list.\r
52\r
53 @retval EFI_SUCCESS Successfully discovered boot file.\r
54 @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.\r
55 @retval EFI_NOT_FOUND Can't get the PXE reply packet.\r
56 @retval Others Failed to discover boot file.\r
57\r
58**/\r
59EFI_STATUS\r
60PxeBcDiscoverBootServer (\r
d1050b9d
MK
61 IN PXEBC_PRIVATE_DATA *Private,\r
62 IN UINT16 Type,\r
63 IN UINT16 *Layer,\r
64 IN BOOLEAN UseBis,\r
65 IN EFI_IP_ADDRESS *DestIp,\r
66 IN UINT16 IpCount,\r
67 IN EFI_PXE_BASE_CODE_SRVLIST *SrvList\r
a3bcde70
HT
68 );\r
69\r
a3bcde70
HT
70/**\r
71 Load boot file into user buffer.\r
72\r
73 @param[in] Private Pointer to PxeBc private data.\r
74 @param[in, out] BufferSize Size of user buffer for input;\r
75 required buffer size for output.\r
76 @param[in] Buffer Pointer to user buffer.\r
77\r
78 @retval EFI_SUCCESS Successfully obtained all the boot information.\r
79 @retval EFI_BUFFER_TOO_SMALL The buffer size is not enough for boot file.\r
80 @retval EFI_ABORTED User cancelled the current operation.\r
81 @retval Others Failed to parse out the boot information.\r
82\r
83**/\r
84EFI_STATUS\r
85PxeBcLoadBootFile (\r
d1050b9d
MK
86 IN PXEBC_PRIVATE_DATA *Private,\r
87 IN OUT UINTN *BufferSize,\r
88 IN VOID *Buffer OPTIONAL\r
a3bcde70
HT
89 );\r
90\r
91#endif\r