Add comments for functions.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7039 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
niry
2008-12-16 02:57:53 +00:00
parent 74935bd732
commit dfc1f033ea
19 changed files with 2004 additions and 767 deletions

View File

@@ -1,21 +1,14 @@
/** @file
Copyright (c) 2005 - 2007, Intel Corporation
Copyright (c) 2005 - 2007, 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
http://opensource.org/licenses/bsd-license.php
http://opensource.org/licenses/bsd-license.php<BR>
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:
Tcp4Driver.c
Abstract:
**/
#include "Tcp4Main.h"
@@ -187,17 +180,33 @@ Tcp4DriverEntryPoint (
/**
Test to see if this driver supports ControllerHandle.
Tests to see if this driver supports a given controller.
If a child device is provided, it further tests to see if this driver supports
creating a handle for the specified child device.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to test.
@param RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param RemainingDevicePath A pointer to the remaining portion of a device path.
This parameter is ignored by device drivers, and is optional for bus drivers.
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_ALREADY_STARTED This driver is already running on this device.
@retval other This driver does not support this device.
@retval EFI_SUCCESS The device specified by ControllerHandle and
RemainingDevicePath is supported by the driver
specified by This.
@retval EFI_ALREADY_STARTED The device specified by ControllerHandle and
RemainingDevicePath is already being managed by
the driver specified by This.
@retval EFI_ACCESS_DENIED The device specified by ControllerHandle and
RemainingDevicePath is already being managed by a
different driver or an application that requires
exclusive access.
@retval EFI_UNSUPPORTED The device specified by ControllerHandle and
RemainingDevicePath is not supported by the driver
specified by This.
**/
EFI_STATUS
EFIAPI
@@ -241,17 +250,32 @@ Tcp4DriverBindingSupported (
/**
Start this driver on ControllerHandle.
Start this driver on ControllerHandle.
The Start() function is designed to be invoked from the EFI boot service
ConnectController(). As a result, much of the error checking on the parameters
to Start() has been moved into this common boot service. It is legal to call
Start() from other locations, but the following calling restrictions must be
followed or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally
aligned EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified
by This must have been called with the same calling parameters, and Supported()
must have returned EFI_SUCCESS.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to bind driver to.
@param RemainingDevicePath Optional parameter use to pick a specific child
device to start.
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param RemainingDevicePath A pointer to the remaining portion of a device path.
This parameter is ignored by device drivers, and is
optional for bus drivers.
@retval EFI_SUCCESS The driver is added to ControllerHandle.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to start the
driver.
@retval other The driver cannot be added to ControllerHandle.
@retval EFI_SUCCESS The device was started.
@retval EFI_ALREADY_STARTED The device could not be started due to a device error.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack
of resources.
**/
EFI_STATUS
@@ -270,7 +294,7 @@ Tcp4DriverBindingStart (
if (NULL == TcpServiceData) {
DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingStart: Have no enough"
" resource to create a Tcp Servcie Data!\n"));
" resource to create a Tcp Servcie Data\n"));
return EFI_OUT_OF_RESOURCES;
}
@@ -282,7 +306,7 @@ Tcp4DriverBindingStart (
if (NULL == TcpServiceData->IpIo) {
DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingStart: Have no enough"
" resource to create an Ip Io!\n"));
" resource to create an Ip Io\n"));
Status = EFI_OUT_OF_RESOURCES;
goto ON_ERROR;
@@ -363,15 +387,29 @@ ON_ERROR:
/**
Stop this driver on ControllerHandle.
The Stop() function is designed to be invoked from the EFI boot service
DisconnectController(). As a result, much of the error checking on the parameters
to Stop() has been moved into this common boot service. It is legal to call Stop()
from other locations, but the following calling restrictions must be followed
or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call
to this same driver's Start() function.
2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid
EFI_HANDLE. In addition, all of these handles must have been created in this
driver's Start() function, and the Start() function must have called OpenProtocol()
on ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param ChildHandleBuffer An array of child handles to be freed. May be NULL if
NumberOfChildren is 0.
@param This Protocol instance pointer.
@param ControllerHandle Handle of device to stop driver on.
@param NumberOfChildren Number of Handles in ChildHandleBuffer. If number
of children is zero stop the entire bus driver.
@param ChildHandleBuffer List of Child Handles to Stop.
@retval EFI_SUCCESS This driver is removed from ControllerHandle.
@retval other This driver is not removed from ControllerHandle.
@retval EFI_SUCCESS The device was stopped.
@retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
**/
EFI_STATUS
@@ -569,18 +607,23 @@ Tcp4DestroySocketCallback (
}
/**
Creates a child handle with a set of TCP4 services.
Creates a child handle and installs a protocol.
The CreateChild() function installs a protocol on ChildHandle. If ChildHandle
is a pointer to NULL, then a new handle is created and returned in ChildHandle.
If ChildHandle is not a pointer to NULL, then the protocol installs on the existing
ChildHandle.
@param This Protocol instance pointer.
@param ChildHandle Pointer to the handle of the child to create. If
it is NULL, then a new handle is created. If it is
not NULL, then the I/O services are added to the
existing child handle.
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param ChildHandle Pointer to the handle of the child to create. If it is NULL, then
a new handle is created. If it is a pointer to an existing UEFI
handle, then the protocol is added to the existing UEFI handle.
@retval EFI_SUCCESS The child handle is created.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval EFI_OUT_OF_RESOURCES There are not enough resources to create the
child.
@retval EFI_SUCCES The protocol was added to ChildHandle.
@retval EFI_INVALID_PARAMETER ChildHandle is NULL.
@retval EFI_OUT_OF_RESOURCES There are not enough resources availabe to create
the child.
@retval other The child handle was not created.
**/
EFI_STATUS
@@ -630,16 +673,23 @@ Tcp4ServiceBindingCreateChild (
/**
Destroys a child handle with a set of UDP4 services.
Destroys a child handle with a protocol installed on it.
The DestroyChild() function does the opposite of CreateChild(). It removes a protocol
that was installed by CreateChild() from ChildHandle. If the removed protocol is the
last protocol on ChildHandle, then ChildHandle is destroyed.
@param This Protocol instance pointer.
@param ChildHandle Handle of the child to be destroyed.
@retval EFI_SUCCESS The TCP4 services are removed from the child
handle.
@retval EFI_INVALID_PARAMETER One or more parameters are invalid.
@retval other The child handle is not destroyed.
@param This Pointer to the EFI_SERVICE_BINDING_PROTOCOL instance.
@param ChildHandle Handle of the child to destroy
@retval EFI_SUCCES The protocol was removed from ChildHandle.
@retval EFI_UNSUPPORTED ChildHandle does not support the protocol that is
being removed.
@retval EFI_INVALID_PARAMETER Child handle is not a valid UEFI Handle.
@retval EFI_ACCESS_DENIED The protocol could not be removed from the ChildHandle
because its services are being used.
@retval other The child handle was not destroyed.
**/
EFI_STATUS
EFIAPI