From e4b99ad97997066491cbd7c00c2237160016079a Mon Sep 17 00:00:00 2001 From: lgao4 Date: Tue, 24 Feb 2009 08:26:40 +0000 Subject: Change library class PlatDriOverLib to PlatformDriOverrideLib Move Application Platform Override Manager into Application directory. Add comments in Network library class to say they are only intended to be used by UEFI network stack modules. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7641 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Include/Library/IpIoLib.h | 3 +- MdeModulePkg/Include/Library/NetLib.h | 3 +- MdeModulePkg/Include/Library/PlatDriOverLib.h | 188 --------------------- .../Include/Library/PlatformDriverOverrideLib.h | 188 +++++++++++++++++++++ MdeModulePkg/Include/Library/UdpIoLib.h | 24 ++- 5 files changed, 214 insertions(+), 192 deletions(-) delete mode 100644 MdeModulePkg/Include/Library/PlatDriOverLib.h create mode 100644 MdeModulePkg/Include/Library/PlatformDriverOverrideLib.h (limited to 'MdeModulePkg/Include') diff --git a/MdeModulePkg/Include/Library/IpIoLib.h b/MdeModulePkg/Include/Library/IpIoLib.h index 4f40074ae5..a4fbcfd1a3 100644 --- a/MdeModulePkg/Include/Library/IpIoLib.h +++ b/MdeModulePkg/Include/Library/IpIoLib.h @@ -1,5 +1,6 @@ /** @file - This library provides IpIo layer upon EFI IP4 Protocol. + Ihis library is only intended to be used by UEFI network stack modules. + It provides IpIo layer upon EFI IP4 Protocol. Copyright (c) 2005 - 2008, Intel Corporation.
All rights reserved. This program and the accompanying materials diff --git a/MdeModulePkg/Include/Library/NetLib.h b/MdeModulePkg/Include/Library/NetLib.h index 7a33546870..5045e8dcb0 100644 --- a/MdeModulePkg/Include/Library/NetLib.h +++ b/MdeModulePkg/Include/Library/NetLib.h @@ -1,5 +1,6 @@ /** @file - This library provides basic function for UEFI network stack. + Ihis library is only intended to be used by UEFI network stack modules. + It provides basic function for UEFI network stack. Copyright (c) 2005 - 2008, Intel Corporation All rights reserved. This program and the accompanying materials diff --git a/MdeModulePkg/Include/Library/PlatDriOverLib.h b/MdeModulePkg/Include/Library/PlatDriOverLib.h deleted file mode 100644 index ee42f8ba79..0000000000 --- a/MdeModulePkg/Include/Library/PlatDriOverLib.h +++ /dev/null @@ -1,188 +0,0 @@ -/** @file - - This library provides basic platform driver override functions. - -Copyright (c) 2007 - 2008, Intel Corporation -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. - -**/ - -#ifndef _PLAT_DRI_OVER_LIB_H_ -#define _PLAT_DRI_OVER_LIB_H_ - -#include - -/** - Free all the mapping database memory resource and initialize the mapping list entry. - - @param MappingDataBase Mapping database list entry pointer - - @retval EFI_INVALID_PARAMETER mapping database list entry is NULL - @retval EFI_SUCCESS Free success - -**/ -EFI_STATUS -EFIAPI -FreeMappingDatabase ( - IN OUT LIST_ENTRY *MappingDataBase - ) -; - -/** - Read the NV environment variable(s) that contain the override mappings from Controller Device Path to - a set of Driver Device Paths, and create the mapping database in memory to contain these variable info. - - @param MappingDataBase Mapping database list entry pointer - - @retval EFI_INVALID_PARAMETER MappingDataBase pointer is null - @retval EFI_NOT_FOUND Cannot find the 'PlatDriOver' NV variable - @retval EFI_VOLUME_CORRUPTED The found NV variable is corrupted - @retval EFI_SUCCESS Create the mapping database in memory successfully - -**/ -EFI_STATUS -EFIAPI -InitOverridesMapping ( - OUT LIST_ENTRY *MappingDataBase - ) -; - -/** - Save the memory mapping database into NV environment variable(s). - If MappingDataBase list is empty, then delete all platform override NV variables. - - @param MappingDataBase Mapping database list entry pointer - - @retval EFI_INVALID_PARAMETER MappingDataBase pointer is null - @retval EFI_SUCCESS Save memory mapping database successfully - -**/ -EFI_STATUS -EFIAPI -SaveOverridesMapping ( - IN LIST_ENTRY *MappingDataBase - ) -; - -/** - Retrieves the image handle of the platform override driver for a controller in the system from the memory mapping database. - - @param ControllerHandle The device handle of the controller to check if - a driver override exists. - @param DriverImageHandle On output, a pointer to the next driver handle. - Passing in a pointer to NULL, will return the - first driver handle for ControllerHandle. - @param MappingDataBase MappingDataBase - Mapping database list entry - pointer - @param CallerImageHandle The caller driver's image handle, for - UpdateFvFileDevicePath use. - - @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not - a valid handle. Or DriverImagePath is not a - device path that was returned on a previous call - to GetDriverPath(). - @retval EFI_NOT_FOUND A driver override for ControllerHandle was not - found. - @retval EFI_UNSUPPORTED The operation is not supported. - @retval EFI_SUCCESS The driver override for ControllerHandle was - returned in DriverImagePath. - -**/ -EFI_STATUS -EFIAPI -GetDriverFromMapping ( - IN EFI_HANDLE ControllerHandle, - IN OUT EFI_HANDLE *DriverImageHandle, - IN LIST_ENTRY *MappingDataBase, - IN EFI_HANDLE CallerImageHandle - ) -; - -/** - Check mapping database whether already has the mapping info which - records the input Controller to input DriverImage. - - @param ControllerDevicePath The controller device path is to be check. - @param DriverImageDevicePath The driver image device path is to be check. - @param MappingDataBase Mapping database list entry pointer - @param DriverInfoNum the controller's total override driver number - @param DriverImageNO The driver order number for the input DriverImage. - If the DriverImageDevicePath is NULL, DriverImageNO is not set. - - @retval EFI_INVALID_PARAMETER ControllerDevicePath or MappingDataBase is NULL. - @retval EFI_NOT_FOUND ControllerDevicePath is not found in MappingDataBase or - DriverImageDevicePath is not found in the found DriverImage Info list. - @retval EFI_SUCCESS The controller's total override driver number and - input DriverImage's order number is correctly return. -**/ -EFI_STATUS -EFIAPI -CheckMapping ( - IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath, - IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath OPTIONAL, - IN LIST_ENTRY *MappingDataBase, - OUT UINT32 *DriverInfoNum OPTIONAL, - OUT UINT32 *DriverImageNO OPTIONAL - ) -; - -/** - Insert a driver image as a controller's override driver into the mapping database. - The driver image's order number is indicated by DriverImageNO. - - @param ControllerDevicePath The controller device path need to add a - override driver image item - @param DriverImageDevicePath The driver image device path need to be insert - @param MappingDataBase Mapping database list entry pointer - @param DriverImageNO The inserted order number. If this number is taken, - the larger available number will be used. - - @retval EFI_INVALID_PARAMETER ControllerDevicePath is NULL, or DriverImageDevicePath is NULL - or MappingDataBase is NULL - @retval EFI_ALREADY_STARTED The input Controller to input DriverImage has been - recorded into the mapping database. - @retval EFI_SUCCESS The Controller and DriverImage are inserted into - the mapping database successfully. - -**/ -EFI_STATUS -EFIAPI -InsertDriverImage ( - IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath, - IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath, - IN LIST_ENTRY *MappingDataBase, - IN UINT32 DriverImageNO - ) -; - -/** - Delete a controller's override driver from the mapping database. - - @param ControllerDevicePath The controller device path will be deleted - when all drivers images on it are removed. - @param DriverImageDevicePath The driver image device path will be delete. - If NULL, all driver image will be delete. - @param MappingDataBase Mapping database list entry pointer - - @retval EFI_INVALID_PARAMETER ControllerDevicePath is NULL, or MappingDataBase is NULL - @retval EFI_NOT_FOUND ControllerDevicePath is not found in MappingDataBase or - DriverImageDevicePath is not found in the found DriverImage Info list. - @retval EFI_SUCCESS Delete the specified driver successfully. - -**/ -EFI_STATUS -EFIAPI -DeleteDriverImage ( - IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath, - IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath, - IN LIST_ENTRY *MappingDataBase - ) -; - -#endif diff --git a/MdeModulePkg/Include/Library/PlatformDriverOverrideLib.h b/MdeModulePkg/Include/Library/PlatformDriverOverrideLib.h new file mode 100644 index 0000000000..2af25d53d5 --- /dev/null +++ b/MdeModulePkg/Include/Library/PlatformDriverOverrideLib.h @@ -0,0 +1,188 @@ +/** @file + Ihis library is only intended to be used by Platform Driver Override Dxe Driver and Application. + It provides basic platform driver override functions. + +Copyright (c) 2007 - 2009, Intel Corporation +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. + +**/ + +#ifndef _PLATFORM_DRIVER_OVERRIDE_LIB_H_ +#define _PLATFORM_DRIVER_OVERRIDE_LIB_H_ + +#include + +/** + Free all the mapping database memory resource and initialize the mapping list entry. + + @param MappingDataBase Mapping database list entry pointer + + @retval EFI_INVALID_PARAMETER mapping database list entry is NULL + @retval EFI_SUCCESS Free success + +**/ +EFI_STATUS +EFIAPI +FreeMappingDatabase ( + IN OUT LIST_ENTRY *MappingDataBase + ) +; + +/** + Read the NV environment variable(s) that contain the override mappings from Controller Device Path to + a set of Driver Device Paths, and create the mapping database in memory to contain these variable info. + + @param MappingDataBase Mapping database list entry pointer + + @retval EFI_INVALID_PARAMETER MappingDataBase pointer is null + @retval EFI_NOT_FOUND Cannot find the 'PlatDriOver' NV variable + @retval EFI_VOLUME_CORRUPTED The found NV variable is corrupted + @retval EFI_SUCCESS Create the mapping database in memory successfully + +**/ +EFI_STATUS +EFIAPI +InitOverridesMapping ( + OUT LIST_ENTRY *MappingDataBase + ) +; + +/** + Save the memory mapping database into NV environment variable(s). + If MappingDataBase list is empty, then delete all platform override NV variables. + + @param MappingDataBase Mapping database list entry pointer + + @retval EFI_INVALID_PARAMETER MappingDataBase pointer is null + @retval EFI_SUCCESS Save memory mapping database successfully + +**/ +EFI_STATUS +EFIAPI +SaveOverridesMapping ( + IN LIST_ENTRY *MappingDataBase + ) +; + +/** + Retrieves the image handle of the platform override driver for a controller in the system from the memory mapping database. + + @param ControllerHandle The device handle of the controller to check if + a driver override exists. + @param DriverImageHandle On output, a pointer to the next driver handle. + Passing in a pointer to NULL, will return the + first driver handle for ControllerHandle. + @param MappingDataBase MappingDataBase - Mapping database list entry + pointer + @param CallerImageHandle The caller driver's image handle, for + UpdateFvFileDevicePath use. + + @retval EFI_INVALID_PARAMETER The handle specified by ControllerHandle is not + a valid handle. Or DriverImagePath is not a + device path that was returned on a previous call + to GetDriverPath(). + @retval EFI_NOT_FOUND A driver override for ControllerHandle was not + found. + @retval EFI_UNSUPPORTED The operation is not supported. + @retval EFI_SUCCESS The driver override for ControllerHandle was + returned in DriverImagePath. + +**/ +EFI_STATUS +EFIAPI +GetDriverFromMapping ( + IN EFI_HANDLE ControllerHandle, + IN OUT EFI_HANDLE *DriverImageHandle, + IN LIST_ENTRY *MappingDataBase, + IN EFI_HANDLE CallerImageHandle + ) +; + +/** + Check mapping database whether already has the mapping info which + records the input Controller to input DriverImage. + + @param ControllerDevicePath The controller device path is to be check. + @param DriverImageDevicePath The driver image device path is to be check. + @param MappingDataBase Mapping database list entry pointer + @param DriverInfoNum the controller's total override driver number + @param DriverImageNO The driver order number for the input DriverImage. + If the DriverImageDevicePath is NULL, DriverImageNO is not set. + + @retval EFI_INVALID_PARAMETER ControllerDevicePath or MappingDataBase is NULL. + @retval EFI_NOT_FOUND ControllerDevicePath is not found in MappingDataBase or + DriverImageDevicePath is not found in the found DriverImage Info list. + @retval EFI_SUCCESS The controller's total override driver number and + input DriverImage's order number is correctly return. +**/ +EFI_STATUS +EFIAPI +CheckMapping ( + IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath, + IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath OPTIONAL, + IN LIST_ENTRY *MappingDataBase, + OUT UINT32 *DriverInfoNum OPTIONAL, + OUT UINT32 *DriverImageNO OPTIONAL + ) +; + +/** + Insert a driver image as a controller's override driver into the mapping database. + The driver image's order number is indicated by DriverImageNO. + + @param ControllerDevicePath The controller device path need to add a + override driver image item + @param DriverImageDevicePath The driver image device path need to be insert + @param MappingDataBase Mapping database list entry pointer + @param DriverImageNO The inserted order number. If this number is taken, + the larger available number will be used. + + @retval EFI_INVALID_PARAMETER ControllerDevicePath is NULL, or DriverImageDevicePath is NULL + or MappingDataBase is NULL + @retval EFI_ALREADY_STARTED The input Controller to input DriverImage has been + recorded into the mapping database. + @retval EFI_SUCCESS The Controller and DriverImage are inserted into + the mapping database successfully. + +**/ +EFI_STATUS +EFIAPI +InsertDriverImage ( + IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath, + IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath, + IN LIST_ENTRY *MappingDataBase, + IN UINT32 DriverImageNO + ) +; + +/** + Delete a controller's override driver from the mapping database. + + @param ControllerDevicePath The controller device path will be deleted + when all drivers images on it are removed. + @param DriverImageDevicePath The driver image device path will be delete. + If NULL, all driver image will be delete. + @param MappingDataBase Mapping database list entry pointer + + @retval EFI_INVALID_PARAMETER ControllerDevicePath is NULL, or MappingDataBase is NULL + @retval EFI_NOT_FOUND ControllerDevicePath is not found in MappingDataBase or + DriverImageDevicePath is not found in the found DriverImage Info list. + @retval EFI_SUCCESS Delete the specified driver successfully. + +**/ +EFI_STATUS +EFIAPI +DeleteDriverImage ( + IN EFI_DEVICE_PATH_PROTOCOL *ControllerDevicePath, + IN EFI_DEVICE_PATH_PROTOCOL *DriverImageDevicePath, + IN LIST_ENTRY *MappingDataBase + ) +; + +#endif diff --git a/MdeModulePkg/Include/Library/UdpIoLib.h b/MdeModulePkg/Include/Library/UdpIoLib.h index f8ffa444ed..820b8f2b1b 100644 --- a/MdeModulePkg/Include/Library/UdpIoLib.h +++ b/MdeModulePkg/Include/Library/UdpIoLib.h @@ -1,6 +1,6 @@ /** @file - The helper routines to access UDP service. It is used by both - DHCP and MTFTP. + Ihis library is only intended to be used by UEFI network stack modules. + It provides the helper routines to access UDP service. It is used by both DHCP and MTFTP. Copyright (c) 2006 - 2008, Intel Corporation.
All rights reserved. This program and the accompanying materials @@ -169,6 +169,26 @@ BOOLEAN IN VOID *Context ); +/** + Cancel all the sent datagram that pass the selection criteria of ToCancel. + If ToCancel is NULL, all the datagrams are cancelled. + + @param[in] UdpIo The UDP_IO_PORT to cancel packet. + @param[in] IoStatus The IoStatus to return to the packet owners. + @param[in] ToCancel The select funtion to test whether to cancel this + packet or not. + @param[in] Context The opaque parameter to the ToCancel. + +**/ +VOID +EFIAPI +UdpIoCancelDgrams ( + IN UDP_IO_PORT *UdpIo, + IN EFI_STATUS IoStatus, + IN UDP_IO_TO_CANCEL ToCancel, OPTIONAL + IN VOID *Context + ); + /** Create a UDP_IO_PORT to access the UDP service. It will create and configure a UDP child. -- cgit v1.2.3