]>
Commit | Line | Data |
---|---|---|
30368135 | 1 | /** @file\r |
f737cfb9 | 2 | Support routines for PxeBc.\r |
3 | Copyright (c) 2007 - 2008, Intel Corporation.<BR> \r | |
30368135 | 4 | All rights reserved. This program and the accompanying materials\r |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
f737cfb9 | 12 | **/\r |
30368135 | 13 | \r |
f737cfb9 | 14 | #ifndef __EFI_PXEBC_SUPPORT_H__\r |
15 | #define __EFI_PXEBC_SUPPORT_H__\r | |
30368135 | 16 | \r |
f737cfb9 | 17 | /**\r |
18 | This function gets system guid and serial number from the smbios table.\r | |
30368135 | 19 | \r |
f737cfb9 | 20 | @param SystemGuid The pointer of returned system guid.\r |
21 | @param SystemSerialNumber The pointer of returned system serial number.\r | |
30368135 | 22 | \r |
f737cfb9 | 23 | @retval EFI_SUCCESS Successfully get the system guid and system serial\r |
24 | number.\r | |
25 | @retval EFI_NOT_FOUND Not find the SMBIOS table.\r | |
30368135 | 26 | \r |
27 | **/\r | |
30368135 | 28 | EFI_STATUS\r |
29 | GetSmbiosSystemGuidAndSerialNumber (\r | |
30 | IN EFI_GUID *SystemGuid,\r | |
31 | OUT CHAR8 **SystemSerialNumber\r | |
32 | );\r | |
33 | \r | |
34 | \r | |
35 | /**\r | |
f737cfb9 | 36 | The common notify function associated with various PxeBc events. \r |
30368135 | 37 | \r |
f737cfb9 | 38 | @param Event The event signaled.\r |
39 | @param Context The context.\r | |
30368135 | 40 | \r |
f737cfb9 | 41 | @return None\r |
30368135 | 42 | \r |
43 | **/\r | |
44 | VOID\r | |
45 | PxeBcCommonNotify (\r | |
46 | IN EFI_EVENT Event,\r | |
47 | IN VOID *Context\r | |
d59b8b55 | 48 | );\r |
30368135 | 49 | \r |
f737cfb9 | 50 | \r |
51 | /**\r | |
52 | This function initialize(or configure) the Udp4Write instance.\r | |
53 | \r | |
54 | @param Udp4 Pointer to the EFI_UDP4_PROTOCOL instance.\r | |
55 | @param StationIp Pointer to the station ip address.\r | |
56 | @param SubnetMask Pointer to the subnetmask of the station ip address.\r | |
57 | @param Gateway Pointer to the gateway ip address.\r | |
58 | @param SrcPort Pointer to the srouce port of the station.\r | |
59 | \r | |
60 | @retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.\r | |
61 | @retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,\r | |
62 | RARP, etc.) is not finished yet.\r | |
63 | @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:\r | |
64 | @retval EFI_ALREADY_STARTED The EFI UDPv4 Protocol instance is already started/configured\r | |
65 | and must be stopped/reset before it can be reconfigured.\r | |
66 | @retval EFI_ACCESS_DENIED UdpConfigData. AllowDuplicatePort is FALSE\r | |
67 | and UdpConfigData.StationPort is already used by\r | |
68 | other instance.\r | |
69 | @retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this\r | |
70 | EFI UDPv4 Protocol instance.\r | |
71 | @retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance\r | |
72 | was not opened.\r | |
73 | @retval Others Please examine the function Udp4->Routes(Udp4, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, Gateway) returns.\r | |
74 | \r | |
75 | **/\r | |
30368135 | 76 | EFI_STATUS\r |
77 | PxeBcConfigureUdpWriteInstance (\r | |
78 | IN EFI_UDP4_PROTOCOL *Udp4,\r | |
79 | IN EFI_IPv4_ADDRESS *StationIp,\r | |
80 | IN EFI_IPv4_ADDRESS *SubnetMask,\r | |
81 | IN EFI_IPv4_ADDRESS *Gateway,\r | |
82 | IN OUT UINT16 *SrcPort\r | |
83 | );\r | |
f737cfb9 | 84 | /**\r |
85 | Convert number to ASCII value.\r | |
86 | \r | |
87 | @param Number Numeric value to convert to decimal ASCII value.\r | |
81b07614 | 88 | @param Buffer Buffer to place ASCII version of the Number.\r |
f737cfb9 | 89 | @param Length Length of Buffer.\r |
90 | \r | |
f737cfb9 | 91 | **/\r |
30368135 | 92 | VOID\r |
93 | CvtNum (\r | |
94 | IN UINTN Number,\r | |
95 | IN UINT8 *Buffer,\r | |
f737cfb9 | 96 | IN UINTN Length\r |
30368135 | 97 | );\r |
98 | \r | |
99 | \r | |
100 | /**\r | |
f737cfb9 | 101 | Convert unsigned int number to decimal number.\r |
30368135 | 102 | \r |
d59b8b55 | 103 | @param Number The unsigned int number will be converted.\r |
104 | @param Buffer Pointer to the buffer to store the decimal number after transform.\r | |
30368135 | 105 | \r |
f737cfb9 | 106 | @return the length of the number after transform.\r |
30368135 | 107 | \r |
108 | **/\r | |
109 | UINTN\r | |
110 | UtoA10 (\r | |
f737cfb9 | 111 | IN UINTN Number,\r |
112 | IN CHAR8 *Buffer\r | |
d59b8b55 | 113 | );\r |
30368135 | 114 | \r |
115 | \r | |
116 | /**\r | |
f737cfb9 | 117 | Convert ASCII numeric string to a UINTN value.\r |
30368135 | 118 | \r |
f737cfb9 | 119 | @param Buffer Pointer to the 8-byte unsigned int value.\r |
d59b8b55 | 120 | \r |
f737cfb9 | 121 | @return UINTN value of the ASCII string.\r |
30368135 | 122 | \r |
123 | **/\r | |
124 | UINT64\r | |
125 | AtoU64 (\r | |
f737cfb9 | 126 | IN UINT8 *Buffer\r |
d59b8b55 | 127 | );\r |
30368135 | 128 | \r |
129 | \r | |
130 | #endif\r | |
131 | \r |