/** @file\r
Implementation of the Socket.\r
\r
- Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
\r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php.\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
\r
Parent->ConnCnt--;\r
DEBUG (\r
- (EFI_D_INFO,\r
+ (EFI_D_NET,\r
"SockWakeListenToken: accept a socket, now conncnt is %d",\r
Parent->ConnCnt)\r
);\r
/**\r
Cancel the tokens in the specific token list.\r
\r
- @param[in] Token Pointer to the Token. If NULL, all tokens \r
- in SpecifiedTokenList will be canceled. \r
+ @param[in] Token Pointer to the Token. If NULL, all tokens\r
+ in SpecifiedTokenList will be canceled.\r
@param[in, out] SpecifiedTokenList Pointer to the token list to be checked.\r
- \r
+\r
@retval EFI_SUCCESS Cancel the tokens in the specific token listsuccessfully.\r
@retval EFI_NOT_FOUND The Token is not found in SpecifiedTokenList.\r
- \r
+\r
**/\r
EFI_STATUS\r
SockCancelToken (\r
if (IsListEmpty (SpecifiedTokenList) && Token != NULL) {\r
return EFI_NOT_FOUND;\r
}\r
- \r
+\r
//\r
// Iterate through the SpecifiedTokenList.\r
//\r
Entry = SpecifiedTokenList->ForwardLink;\r
while (Entry != SpecifiedTokenList) {\r
SockToken = NET_LIST_USER_STRUCT (Entry, SOCK_TOKEN, TokenList);\r
- \r
+\r
if (Token == NULL) {\r
SIGNAL_TOKEN (SockToken->Token, EFI_ABORTED);\r
RemoveEntryList (&SockToken->TokenList);\r
FreePool (SockToken);\r
- \r
+\r
Entry = SpecifiedTokenList->ForwardLink;\r
Status = EFI_SUCCESS;\r
} else {\r
SIGNAL_TOKEN (Token, EFI_ABORTED);\r
RemoveEntryList (&(SockToken->TokenList));\r
FreePool (SockToken);\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
Status = EFI_NOT_FOUND;\r
- \r
+\r
Entry = Entry->ForwardLink;\r
- } \r
+ }\r
}\r
\r
ASSERT (IsListEmpty (SpecifiedTokenList) || Token != NULL);\r
- \r
+\r
return Status;\r
}\r
\r
Parent->ConnCnt++;\r
\r
DEBUG (\r
- (EFI_D_INFO,\r
+ (EFI_D_NET,\r
"SockCreate: Create a new socket and add to parent, now conncnt is %d\n",\r
Parent->ConnCnt)\r
);\r
IN OUT SOCKET *Sock\r
)\r
{\r
- VOID *SockProtocol;\r
- EFI_GUID *TcpProtocolGuid;\r
- EFI_STATUS Status;\r
-\r
ASSERT (SockStream == Sock->Type);\r
\r
- if (Sock->DestroyCallback != NULL) {\r
- Sock->DestroyCallback (Sock, Sock->Context);\r
- }\r
-\r
//\r
// Flush the completion token buffered\r
// by sock and rcv, snd buffer\r
Sock->Parent = NULL;\r
}\r
\r
- //\r
- // Set the protocol guid and driver binding handle\r
- // in the light of Sock->SockType\r
- //\r
- if (Sock->IpVersion == IP_VERSION_4) {\r
- TcpProtocolGuid = &gEfiTcp4ProtocolGuid;\r
- } else {\r
- TcpProtocolGuid = &gEfiTcp6ProtocolGuid;\r
- }\r
-\r
- //\r
- // Retrieve the protocol installed on this sock\r
- //\r
- Status = gBS->OpenProtocol (\r
- Sock->SockHandle,\r
- TcpProtocolGuid,\r
- &SockProtocol,\r
- Sock->DriverBinding,\r
- Sock->SockHandle,\r
- EFI_OPEN_PROTOCOL_GET_PROTOCOL\r
- );\r
-\r
- if (EFI_ERROR (Status)) {\r
-\r
- DEBUG (\r
- (EFI_D_ERROR,\r
- "SockDestroy: Open protocol installed on socket failed with %r\n",\r
- Status)\r
- );\r
-\r
- goto FreeSock;\r
- }\r
-\r
- //\r
- // Uninstall the protocol installed on this sock\r
- // in the light of Sock->SockType\r
- //\r
- gBS->UninstallMultipleProtocolInterfaces (\r
- Sock->SockHandle,\r
- TcpProtocolGuid,\r
- SockProtocol,\r
- NULL\r
- );\r
-\r
-FreeSock:\r
-\r
FreePool (Sock);\r
}\r
\r