code scrub for UefiPxeBcDxe.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7452 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jgong5
2009-02-06 05:07:34 +00:00
parent 4de1f28761
commit f737cfb953
18 changed files with 1709 additions and 1001 deletions

View File

@@ -1,6 +1,7 @@
/** @file
Copyright (c) 2007 - 2008, Intel Corporation
Support routines for PxeBc.
Copyright (c) 2007 - 2008, Intel Corporation.<BR>
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
@@ -9,15 +10,6 @@ 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.
Module Name:
PxeBcSupport.c
Abstract:
Support routines for PxeBc
**/
@@ -25,7 +17,8 @@ Abstract:
/**
This function returns SMBIOS string given the string number.
@param Smbios Pointer to SMBIOS structure
@param StringNumber String number to return. 0 is used to skip all
strings and point to the next SMBIOS structure.
@@ -33,7 +26,6 @@ Abstract:
@return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == 0
**/
// GC_NOTO: function comment is missing 'Routine Description:'
CHAR8 *
GetSmbiosString (
IN SMBIOS_STRUCTURE_POINTER *Smbios,
@@ -78,14 +70,14 @@ GetSmbiosString (
/**
This function gets system guid and serial number from the smbios table
This function gets system guid and serial number from the smbios table.
@param SystemGuid The pointer of returned system guid
@param SystemSerialNumber The pointer of returned system serial number
@param SystemGuid The pointer of returned system guid.
@param SystemSerialNumber The pointer of returned system serial number.
@retval EFI_SUCCESS Successfully get the system guid and system serial
number
@retval EFI_NOT_FOUND Not find the SMBIOS table
number.
@retval EFI_NOT_FOUND Not find the SMBIOS table.
**/
EFI_STATUS
@@ -145,12 +137,12 @@ GetSmbiosSystemGuidAndSerialNumber (
/**
GC_NOTO: Add function description
The common notify function associated with various PxeBc events.
@param Event GC_NOTO: add argument description
@param Context GC_NOTO: add argument description
@param Event The event signaled.
@param Context The context.
@return GC_NOTO: add return values
@return None
**/
VOID
@@ -162,6 +154,32 @@ PxeBcCommonNotify (
*((BOOLEAN *) Context) = TRUE;
}
/**
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.
**/
EFI_STATUS
PxeBcConfigureUdpWriteInstance (
IN EFI_UDP4_PROTOCOL *Udp4,
@@ -214,25 +232,23 @@ PxeBcConfigureUdpWriteInstance (
/**
Convert number to ASCII value
Convert number to ASCII value.
@param Number Numeric value to convert to decimal ASCII value.
@param Buffer Buffer to place ASCII version of the Number
@param Buffer Buffer to place ASCII version of the Number.
@param Length Length of Buffer.
@retval none none
**/
VOID
CvtNum (
IN UINTN Number,
IN UINT8 *Buffer,
IN INTN Length
IN UINTN Length
)
{
UINTN Remainder;
while (Length--) {
while (Length-- > 0) {
Remainder = Number % 10;
Number /= 10;
Buffer[Length] = (UINT8) ('0' + Remainder);
@@ -241,12 +257,12 @@ CvtNum (
/**
GC_NOTO: Add function description
Convert unsigned int number to decimal number.
@param Number GC_NOTO: add argument description
@param Buffer GC_NOTO: add argument description
@param Number The unsigned int number will be converted.
@param Buffer Pointer to the buffer to store the decimal number after transform.
@return GC_NOTO: add return values
@return the length of the number after transform.
**/
UINTN
@@ -274,12 +290,11 @@ UtoA10 (
/**
Convert ASCII numeric string to a UINTN value
Convert ASCII numeric string to a UINTN value.
@param Number Numeric value to convert to decimal ASCII value.
@param Buffer Buffer to place ASCII version of the Number
@param Buffer Pointer to the 8-byte unsigned int value.
@retval Value UINTN value of the ASCII string.
@return UINTN value of the ASCII string.
**/
UINT64