/** @file\r
+ Interface function of the Socket.\r
\r
-Copyright (c) 2005 - 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2009, Intel Corporation. All rights reserved.<BR>\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
+http://opensource.org/licenses/bsd-license.php<BR>\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
\r
-Module Name:\r
-\r
- SockInterface.c\r
-\r
-Abstract:\r
-\r
-\r
**/\r
\r
\r
@param List Pointer to the token list to be searched.\r
@param Event The event to be checked.\r
\r
- @retval BOOLEAN If TRUE, the specific Event exists in the List. If\r
- FALSE, the specific Event is not in the List.\r
+ @retval TRUE The specific Event exists in the List. \r
+ @retval FALSE The specific Event is not in the List.\r
\r
**/\r
BOOLEAN\r
@param Sock Pointer to the instance's socket.\r
@param Event The event to be checked.\r
\r
- @return The specific Event exists in one of socket's lists or not.\r
+ @retval TRUE The Event exists in related socket's lists. \r
+ @retval FALSE The Event is not in related socket's lists.\r
\r
**/\r
BOOLEAN\r
if (SockTokenExistedInList (&Sock->SndTokenList, Event) ||\r
SockTokenExistedInList (&Sock->ProcessingSndTokenList, Event) ||\r
SockTokenExistedInList (&Sock->RcvTokenList, Event) ||\r
- SockTokenExistedInList (&Sock->ListenTokenList, Event)\r
- ) {\r
+ SockTokenExistedInList (&Sock->ListenTokenList, Event)) {\r
\r
return TRUE;\r
}\r
**/\r
EFI_STATUS\r
SockDestroyChild (\r
- IN SOCKET *Sock\r
+ IN SOCKET *Sock\r
)\r
{\r
EFI_STATUS Status;\r
\r
- ASSERT (Sock && Sock->ProtoHandler);\r
+ ASSERT ((Sock != NULL) && (Sock->ProtoHandler != NULL));\r
\r
if (Sock->IsDestroyed) {\r
return EFI_SUCCESS;\r
data ProtoData.\r
\r
@param SockInitData Inital data to setting the socket.\r
- @param ProtoData Pointer to the protocol specific data.\r
- @param Len Length of the protocol specific data.\r
-\r
+ \r
@return Pointer to the newly created socket. If NULL, error condition occured.\r
\r
**/\r
\r
\r
/**\r
- Configure the specific socket Sock using configuration data\r
- ConfigData.\r
+ Configure the specific socket Sock using configuration data ConfigData.\r
\r
@param Sock Pointer to the socket to be configured.\r
@param ConfigData Pointer to the configuration data.\r
SOCKET *Socket;\r
EFI_EVENT Event;\r
\r
- ASSERT (SOCK_STREAM == Sock->Type);\r
+ ASSERT (SockStream == Sock->Type);\r
\r
Status = EfiAcquireLockOrFail (&(Sock->Lock));\r
if (EFI_ERROR (Status)) {\r
\r
RemoveEntryList (ListEntry);\r
\r
- ASSERT (Socket->Parent);\r
+ ASSERT (Socket->Parent != NULL);\r
\r
Socket->Parent->ConnCnt--;\r
\r
DEBUG (\r
- (EFI_D_WARN,\r
+ (EFI_D_INFO,\r
"SockAccept: Accept a socket, now conncount is %d",\r
Socket->Parent->ConnCnt)\r
);\r
SOCK_TOKEN *SockToken;\r
UINT32 DataLen;\r
\r
- ASSERT (SOCK_STREAM == Sock->Type);\r
+ ASSERT (SockStream == Sock->Type);\r
\r
Status = EfiAcquireLockOrFail (&(Sock->Lock));\r
if (EFI_ERROR (Status)) {\r
"Snd Data\n", Status));\r
\r
RemoveEntryList (&(SockToken->TokenList));\r
- gBS->FreePool (SockToken);\r
+ FreePool (SockToken);\r
}\r
}\r
\r
EFI_STATUS Status;\r
EFI_EVENT Event;\r
\r
- ASSERT (SOCK_STREAM == Sock->Type);\r
+ ASSERT (SockStream == Sock->Type);\r
\r
Status = EfiAcquireLockOrFail (&(Sock->Lock));\r
if (EFI_ERROR (Status)) {\r
{\r
EFI_STATUS Status;\r
\r
- ASSERT (SOCK_STREAM == Sock->Type);\r
+ ASSERT (SockStream == Sock->Type);\r
\r
Status = EfiAcquireLockOrFail (&(Sock->Lock));\r
if (EFI_ERROR (Status)) {\r
EFI_STATUS Status;\r
EFI_EVENT Event;\r
\r
- ASSERT (SOCK_STREAM == Sock->Type);\r
+ ASSERT (SockStream == Sock->Type);\r
\r
Status = EfiAcquireLockOrFail (&(Sock->Lock));\r
if (EFI_ERROR (Status)) {\r
**/\r
EFI_STATUS\r
SockGetMode (\r
- IN SOCKET *Sock,\r
- IN VOID *Mode\r
+ IN SOCKET *Sock,\r
+ IN OUT VOID *Mode\r
)\r
{\r
return Sock->ProtoHandler (Sock, SOCK_MODE, Mode);\r