summaryrefslogtreecommitdiffstats
path: root/NetworkPkg/TcpDxe/TcpMain.c
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/TcpDxe/TcpMain.c')
-rw-r--r--NetworkPkg/TcpDxe/TcpMain.c67
1 files changed, 50 insertions, 17 deletions
diff --git a/NetworkPkg/TcpDxe/TcpMain.c b/NetworkPkg/TcpDxe/TcpMain.c
index f79db48af3..96a295a7fe 100644
--- a/NetworkPkg/TcpDxe/TcpMain.c
+++ b/NetworkPkg/TcpDxe/TcpMain.c
@@ -2,7 +2,7 @@
Implementation of EFI_TCP4_PROTOCOL and EFI_TCP6_PROTOCOL.
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
- Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -484,14 +484,25 @@ Tcp4Close (
/**
Abort an asynchronous connection, listen, transmission or receive request.
- @param[in] This Pointer to the EFI_TCP4_PROTOCOL instance.
- @param[in] Token Pointer to a token that has been issued by
- Connect(), Accept(), Transmit() or Receive(). If
- NULL, all pending tokens issued by the four
- functions listed above will be aborted.
-
- @retval EFI_UNSUPPORTED The operation is not supported in the current
- implementation.
+ @param This The pointer to the EFI_TCP4_PROTOCOL instance.
+ @param Token The pointer to a token that has been issued by
+ EFI_TCP4_PROTOCOL.Connect(),
+ EFI_TCP4_PROTOCOL.Accept(),
+ EFI_TCP4_PROTOCOL.Transmit() or
+ EFI_TCP4_PROTOCOL.Receive(). If NULL, all pending
+ tokens issued by above four functions will be aborted. Type
+ EFI_TCP4_COMPLETION_TOKEN is defined in
+ EFI_TCP4_PROTOCOL.Connect().
+
+ @retval EFI_SUCCESS The asynchronous I/O request is aborted and Token->Event
+ is signaled.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED This instance hasn't been configured.
+ @retval EFI_NO_MAPPING When using the default address, configuration
+ (DHCP, BOOTP,RARP, etc.) hasn't finished yet.
+ @retval EFI_NOT_FOUND The asynchronous I/O request isn't found in the
+ transmission or receive queue. It has either
+ completed or wasn't issued by Transmit() and Receive().
**/
EFI_STATUS
@@ -501,7 +512,15 @@ Tcp4Cancel (
IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL
)
{
- return EFI_UNSUPPORTED;
+ SOCKET *Sock;
+
+ if (NULL == This) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Sock = SOCK_FROM_THIS (This);
+
+ return SockCancel (Sock, Token);
}
/**
@@ -998,20 +1017,20 @@ Tcp6Close (
}
/**
- Abort an asynchronous connection, listen, transmission, or receive request.
+ Abort an asynchronous connection, listen, transmission or receive request.
- The Cancel() function aborts a pending connection, listen, transmit, or
+ The Cancel() function aborts a pending connection, listen, transmit or
receive request.
- If Token is not NULL and the token is in the connection, listen, transmission,
+ If Token is not NULL and the token is in the connection, listen, transmission
or receive queue when it is being cancelled, its Token->Status will be set
- to EFI_ABORTED, and then Token->Event will be signaled.
+ to EFI_ABORTED and then Token->Event will be signaled.
If the token is not in one of the queues, which usually means that the
asynchronous operation has completed, EFI_NOT_FOUND is returned.
If Token is NULL all asynchronous token issued by Connect(), Accept(),
- Transmit(), and Receive() will be aborted.
+ Transmit() and Receive() will be aborted.
@param[in] This Pointer to the EFI_TCP6_PROTOCOL instance.
@param[in] Token Pointer to a token that has been issued by
@@ -1023,7 +1042,13 @@ Tcp6Close (
EFI_TCP6_COMPLETION_TOKEN is defined in
EFI_TCP_PROTOCOL.Connect().
- @retval EFI_UNSUPPORTED The implementation does not support this function.
+ @retval EFI_SUCCESS The asynchronous I/O request is aborted and Token->Event
+ is signaled.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_NOT_STARTED This instance hasn't been configured.
+ @retval EFI_NOT_FOUND The asynchronous I/O request isn't found in the transmission or
+ receive queue. It has either completed or wasn't issued by
+ Transmit() and Receive().
**/
EFI_STATUS
@@ -1033,7 +1058,15 @@ Tcp6Cancel (
IN EFI_TCP6_COMPLETION_TOKEN *Token OPTIONAL
)
{
- return EFI_UNSUPPORTED;
+ SOCKET *Sock;
+
+ if (NULL == This) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Sock = SOCK_FROM_THIS (This);
+
+ return SockCancel (Sock, Token);
}
/**