blob: ef18907aa655a6f2e2661d3be0d8c970efd3a6d0 [file] [log] [blame]
hhtiana3bcde72010-11-01 06:13:54 +00001/** @file
2 Boot functions declaration for UefiPxeBc Driver.
3
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14**/
15
16#ifndef __EFI_PXEBC_BOOT_H__
17#define __EFI_PXEBC_BOOT_H__
18
19#define PXEBC_DISPLAY_MAX_LINE 70
20#define PXEBC_DEFAULT_UDP_OVERHEAD_SIZE 8
21#define PXEBC_DEFAULT_TFTP_OVERHEAD_SIZE 4
22
23#define PXEBC_IS_SIZE_OVERFLOWED(x) ((sizeof (UINTN) < sizeof (UINT64)) && ((x) > 0xFFFFFFFF))
24
25
26/**
27 Extract the discover information and boot server entry from the
28 cached packets if unspecified.
29
30 @param[in] Private Pointer to PxeBc private data.
31 @param[in] Type The type of bootstrap to perform.
32 @param[in, out] Info Pointer to EFI_PXE_BASE_CODE_DISCOVER_INFO.
33 @param[out] BootEntry Pointer to PXEBC_BOOT_SVR_ENTRY.
34 @param[out] SrvList Pointer to EFI_PXE_BASE_CODE_SRVLIST.
35
36 @retval EFI_SUCCESS Successfully extracted the information.
37 @retval EFI_DEVICE_ERROR Failed to extract the information.
38
39**/
40EFI_STATUS
41PxeBcExtractDiscoverInfo (
42 IN PXEBC_PRIVATE_DATA *Private,
43 IN UINT16 Type,
44 IN OUT EFI_PXE_BASE_CODE_DISCOVER_INFO *Info,
45 OUT PXEBC_BOOT_SVR_ENTRY **BootEntry,
46 OUT EFI_PXE_BASE_CODE_SRVLIST **SrvList
47 );
48
49
50/**
51 Build the discover packet and send out for boot.
52
53 @param[in] Private Pointer to PxeBc private data.
54 @param[in] Type PxeBc option boot item type.
55 @param[in] Layer Pointer to option boot item layer.
56 @param[in] UseBis Use BIS or not.
57 @param[in] DestIp Pointer to the server address.
58 @param[in] IpCount The total count of the server address.
59 @param[in] SrvList Pointer to the server address list.
60
61 @retval EFI_SUCCESS Successfully discovered boot file.
62 @retval EFI_OUT_OF_RESOURCES Failed to allocate resources.
63 @retval EFI_NOT_FOUND Can't get the PXE reply packet.
64 @retval Others Failed to discover boot file.
65
66**/
67EFI_STATUS
68PxeBcDiscoverBootServer (
69 IN PXEBC_PRIVATE_DATA *Private,
70 IN UINT16 Type,
71 IN UINT16 *Layer,
72 IN BOOLEAN UseBis,
73 IN EFI_IP_ADDRESS *DestIp,
74 IN UINT16 IpCount,
75 IN EFI_PXE_BASE_CODE_SRVLIST *SrvList
76 );
77
78
79/**
80 Load boot file into user buffer.
81
82 @param[in] Private Pointer to PxeBc private data.
83 @param[in, out] BufferSize Size of user buffer for input;
84 required buffer size for output.
85 @param[in] Buffer Pointer to user buffer.
86
87 @retval EFI_SUCCESS Successfully obtained all the boot information.
88 @retval EFI_BUFFER_TOO_SMALL The buffer size is not enough for boot file.
89 @retval EFI_ABORTED User cancelled the current operation.
90 @retval Others Failed to parse out the boot information.
91
92**/
93EFI_STATUS
94PxeBcLoadBootFile (
95 IN PXEBC_PRIVATE_DATA *Private,
96 IN OUT UINTN *BufferSize,
97 IN VOID *Buffer OPTIONAL
98 );
99
100#endif