From a5cd246f513b5d7e9b6f8f2fde75f379e7eba2c3 Mon Sep 17 00:00:00 2001 From: Guo Mang Date: Thu, 27 Apr 2017 11:38:57 +0800 Subject: StdLib: Remove unused Package Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang --- StdLib/UseSocketDxe/UseSocketDxe.c | 227 ----------------------------------- StdLib/UseSocketDxe/UseSocketDxe.inf | 45 ------- 2 files changed, 272 deletions(-) delete mode 100644 StdLib/UseSocketDxe/UseSocketDxe.c delete mode 100644 StdLib/UseSocketDxe/UseSocketDxe.inf (limited to 'StdLib/UseSocketDxe') diff --git a/StdLib/UseSocketDxe/UseSocketDxe.c b/StdLib/UseSocketDxe/UseSocketDxe.c deleted file mode 100644 index 423419c23e..0000000000 --- a/StdLib/UseSocketDxe/UseSocketDxe.c +++ /dev/null @@ -1,227 +0,0 @@ -/** @file - Implement the connection to the socket driver - - Copyright (c) 2011, 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. - -**/ - -#include - -#include -#include -#include - -#include -#include - - -/** - Free the socket resources - - This releases the socket resources allocated by calling - EslServiceGetProtocol. - - This routine is called from the ::close routine in BsdSocketLib - to release the socket resources. - - @param [in] pSocketProtocol Address of an ::EFI_SOCKET_PROTOCOL - structure - - @return Value for ::errno, zero (0) indicates success. - - **/ -int -EslServiceFreeProtocol ( - IN EFI_SOCKET_PROTOCOL * pSocketProtocol - ) -{ - EFI_SERVICE_BINDING_PROTOCOL * pServiceBinding; - int RetVal; - EFI_STATUS Status; - - // - // Assume success - // - RetVal = 0; - - // - // Locate the socket protocol - // - Status = gBS->LocateProtocol ( &gEfiSocketServiceBindingProtocolGuid, - NULL, - (VOID **) &pServiceBinding ); - if ( !EFI_ERROR ( Status )) { - // - // Release the handle - // - Status = pServiceBinding->DestroyChild ( pServiceBinding, - pSocketProtocol->SocketHandle ); - } - if ( EFI_ERROR ( Status )) { - RetVal = EIO; - } - - // - // Return the operation status - // - return RetVal; -} - - -/** - Connect to the EFI socket library - - This routine establishes a connection to the socket driver - and returns the API (::EFI_SOCKET_PROTOCOL address) to the - socket file system layer in BsdSocketLib. This routine looks for - the gEfiSocketServiceBindingProtocolGuid to locate the socket - driver. This routine then creates a child handle and locates - the gEfiSocketProtocolGuid protocol on that handle to get the - ::EFI_SOCKET_PROTOCOL structure address. - - This routine is called from the ::socket routine in BsdSocketLib - to create the data structure and initialize the API for a socket. - Note that this implementation is only used by socket applications - that link directly to UseSocketDxe. - - @param [in] ppSocketProtocol Address to receive the ::EFI_SOCKET_PROTOCOL - structure address - - @return Value for ::errno, zero (0) indicates success. - - **/ -int -EslServiceGetProtocol ( - IN EFI_SOCKET_PROTOCOL ** ppSocketProtocol - ) -{ - EFI_SERVICE_BINDING_PROTOCOL * pServiceBinding; - int RetVal; - EFI_HANDLE SocketHandle; - EFI_STATUS Status; - - // - // Locate the socket protocol - // - Status = gBS->LocateProtocol ( &gEfiSocketServiceBindingProtocolGuid, - NULL, - (VOID **)&pServiceBinding ); - if ( !EFI_ERROR ( Status )) { - // - // Create a new socket - // - SocketHandle = NULL; - Status = pServiceBinding->CreateChild ( pServiceBinding, - &SocketHandle ); - if ( !EFI_ERROR ( Status )) { - // - // Get the socket protocol - // - Status = gBS->OpenProtocol ( SocketHandle, - &gEfiSocketProtocolGuid, - (VOID **)ppSocketProtocol, - NULL, - NULL, - EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL ); - if ( !EFI_ERROR ( Status )) { - // - // Success! - // - RetVal = 0; - } - else { - DEBUG (( DEBUG_ERROR, - "ERROR - No socket protocol on 0x%08x, Status: %r\r\n", - SocketHandle, - Status )); - RetVal = ENODEV; - } - } - else { - // - // Translate the error - // - DEBUG (( DEBUG_ERROR, - "ERROR - CreateChild failed, Status: %r\r\n", - Status )); - switch ( Status ) { - case EFI_SUCCESS: - RetVal = 0; - break; - - case EFI_ACCESS_DENIED: - case EFI_WRITE_PROTECTED: - RetVal = EACCES; - break; - - case EFI_NO_RESPONSE: - RetVal = EHOSTUNREACH; - break; - - case EFI_BAD_BUFFER_SIZE: - case EFI_BUFFER_TOO_SMALL: - case EFI_INVALID_PARAMETER: - RetVal = EINVAL; - break; - - case EFI_DEVICE_ERROR: - case EFI_MEDIA_CHANGED: - case EFI_NO_MEDIA: - case EFI_VOLUME_CORRUPTED: - RetVal = EIO; - break; - - case EFI_NOT_FOUND: - RetVal = ENOENT; - break; - - default: - case EFI_OUT_OF_RESOURCES: - RetVal = ENOMEM; - break; - - case EFI_VOLUME_FULL: - RetVal = ENOSPC; - break; - - case EFI_UNSUPPORTED: - RetVal = ENOSYS; - break; - - case EFI_NO_MAPPING: - RetVal = ENXIO; - break; - - case EFI_LOAD_ERROR: - RetVal = ESRCH; - break; - - case EFI_TIMEOUT: - RetVal = ETIMEDOUT; - break; - - case EFI_NOT_READY: - RetVal = EWOULDBLOCK; - break; - } - } - } - else { - DEBUG (( DEBUG_ERROR, - "ERROR - Socket driver not loaded, Status: %r\r\n", - Status )); - RetVal = ENODEV; - } - - // - // Return the operation status - // - return RetVal; -} diff --git a/StdLib/UseSocketDxe/UseSocketDxe.inf b/StdLib/UseSocketDxe/UseSocketDxe.inf deleted file mode 100644 index 45fb70f292..0000000000 --- a/StdLib/UseSocketDxe/UseSocketDxe.inf +++ /dev/null @@ -1,45 +0,0 @@ -#/** @file -# Component description file for the EFI socket library. -# -# This module implements the socket layer. -# Copyright (c) 2011, 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. -# -#**/ - -[Defines] - INF_VERSION = 0x00010005 - BASE_NAME = UseSocketDxe - FILE_GUID = 1A6853C8-F362-4f68-A77E-0B304A194C05 - MODULE_TYPE = BASE - VERSION_STRING = 1.0 - LIBRARY_CLASS = UseSocketDxe - -# -# VALID_ARCHITECTURES = IA32 X64 IPF EBC -# - -[Sources.common] - UseSocketDxe.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - StdLib/StdLib.dec -# SocketPkg/SocketPkg.dec - -[LibraryClasses] - UefiLib - UefiBootServicesTableLib - BaseMemoryLib - DebugLib - -[Protocols] - gEfiSocketProtocolGuid - gEfiSocketServiceBindingProtocolGuid -- cgit v1.2.3