2008-10-31 05:40:51 +01:00
|
|
|
/** @file
|
2009-02-06 06:07:34 +01:00
|
|
|
Support routines for PxeBc.
|
2009-04-10 22:58:18 +02:00
|
|
|
Copyright (c) 2007 - 2009, Intel Corporation.<BR>
|
2008-10-31 05:40:51 +01:00
|
|
|
All rights reserved. This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
**/
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
#ifndef __EFI_PXEBC_SUPPORT_H__
|
|
|
|
#define __EFI_PXEBC_SUPPORT_H__
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
/**
|
|
|
|
This function gets system guid and serial number from the smbios table.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
@param SystemGuid The pointer of returned system guid.
|
|
|
|
@param SystemSerialNumber The pointer of returned system serial number.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
@retval EFI_SUCCESS Successfully get the system guid and system serial
|
|
|
|
number.
|
|
|
|
@retval EFI_NOT_FOUND Not find the SMBIOS table.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
EFI_STATUS
|
|
|
|
GetSmbiosSystemGuidAndSerialNumber (
|
|
|
|
IN EFI_GUID *SystemGuid,
|
|
|
|
OUT CHAR8 **SystemSerialNumber
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2009-02-06 06:07:34 +01:00
|
|
|
The common notify function associated with various PxeBc events.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
@param Event The event signaled.
|
|
|
|
@param Context The context.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
@return None
|
2008-10-31 05:40:51 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
VOID
|
2009-04-10 22:58:18 +02:00
|
|
|
EFIAPI
|
2008-10-31 05:40:51 +01:00
|
|
|
PxeBcCommonNotify (
|
|
|
|
IN EFI_EVENT Event,
|
|
|
|
IN VOID *Context
|
2009-02-06 06:47:32 +01:00
|
|
|
);
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
This function initialize(or configure) the Udp4Write instance.
|
|
|
|
|
|
|
|
@param Udp4 Pointer to the EFI_UDP4_PROTOCOL instance.
|
|
|
|
@param StationIp Pointer to the station ip address.
|
|
|
|
@param SubnetMask Pointer to the subnetmask of the station ip address.
|
|
|
|
@param Gateway Pointer to the gateway ip address.
|
|
|
|
@param SrcPort Pointer to the srouce port of the station.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The configuration settings were set, changed, or reset successfully.
|
|
|
|
@retval EFI_NO_MAPPING When using a default address, configuration (DHCP, BOOTP,
|
|
|
|
RARP, etc.) is not finished yet.
|
|
|
|
@retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
|
|
|
|
@retval EFI_ALREADY_STARTED The EFI UDPv4 Protocol instance is already started/configured
|
|
|
|
and must be stopped/reset before it can be reconfigured.
|
|
|
|
@retval EFI_ACCESS_DENIED UdpConfigData. AllowDuplicatePort is FALSE
|
|
|
|
and UdpConfigData.StationPort is already used by
|
|
|
|
other instance.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES The EFI UDPv4 Protocol driver cannot allocate memory for this
|
|
|
|
EFI UDPv4 Protocol instance.
|
|
|
|
@retval EFI_DEVICE_ERROR An unexpected network or system error occurred and this instance
|
|
|
|
was not opened.
|
|
|
|
@retval Others Please examine the function Udp4->Routes(Udp4, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, Gateway) returns.
|
|
|
|
|
|
|
|
**/
|
2008-10-31 05:40:51 +01:00
|
|
|
EFI_STATUS
|
|
|
|
PxeBcConfigureUdpWriteInstance (
|
|
|
|
IN EFI_UDP4_PROTOCOL *Udp4,
|
|
|
|
IN EFI_IPv4_ADDRESS *StationIp,
|
|
|
|
IN EFI_IPv4_ADDRESS *SubnetMask,
|
|
|
|
IN EFI_IPv4_ADDRESS *Gateway,
|
|
|
|
IN OUT UINT16 *SrcPort
|
|
|
|
);
|
2009-02-06 06:07:34 +01:00
|
|
|
/**
|
|
|
|
Convert number to ASCII value.
|
|
|
|
|
|
|
|
@param Number Numeric value to convert to decimal ASCII value.
|
2009-02-06 06:11:15 +01:00
|
|
|
@param Buffer Buffer to place ASCII version of the Number.
|
2009-02-06 06:07:34 +01:00
|
|
|
@param Length Length of Buffer.
|
|
|
|
|
|
|
|
**/
|
2008-10-31 05:40:51 +01:00
|
|
|
VOID
|
|
|
|
CvtNum (
|
|
|
|
IN UINTN Number,
|
|
|
|
IN UINT8 *Buffer,
|
2009-02-06 06:07:34 +01:00
|
|
|
IN UINTN Length
|
2008-10-31 05:40:51 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2009-02-06 06:07:34 +01:00
|
|
|
Convert unsigned int number to decimal number.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:47:32 +01:00
|
|
|
@param Number The unsigned int number will be converted.
|
|
|
|
@param Buffer Pointer to the buffer to store the decimal number after transform.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
@return the length of the number after transform.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
UINTN
|
|
|
|
UtoA10 (
|
2009-02-06 06:07:34 +01:00
|
|
|
IN UINTN Number,
|
|
|
|
IN CHAR8 *Buffer
|
2009-02-06 06:47:32 +01:00
|
|
|
);
|
2008-10-31 05:40:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2009-02-06 06:07:34 +01:00
|
|
|
Convert ASCII numeric string to a UINTN value.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
@param Buffer Pointer to the 8-byte unsigned int value.
|
2009-02-06 06:47:32 +01:00
|
|
|
|
2009-02-06 06:07:34 +01:00
|
|
|
@return UINTN value of the ASCII string.
|
2008-10-31 05:40:51 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
UINT64
|
|
|
|
AtoU64 (
|
2009-02-06 06:07:34 +01:00
|
|
|
IN UINT8 *Buffer
|
2009-02-06 06:47:32 +01:00
|
|
|
);
|
2008-10-31 05:40:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|