summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-09 22:48:40 +0000
committerlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>2011-09-09 22:48:40 +0000
commit2da30b4b4212c949fedd668f18cb303120db48c8 (patch)
treea86fb56ef29ba5446a28c0df57a4493c7962aba8
parent29f054aac4b7e6f47043c94c5cedf3d74634b0a5 (diff)
downloadedk2-2da30b4b4212c949fedd668f18cb303120db48c8.zip
edk2-2da30b4b4212c949fedd668f18cb303120db48c8.tar.gz
edk2-2da30b4b4212c949fedd668f18cb303120db48c8.tar.bz2
Combine the transmit completion code between IP, TCP and UDP.
Signed-off by: Lee Leahy git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/branches/EADK@12319 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--StdLib/EfiSocketLib/Ip4.c84
-rw-r--r--StdLib/EfiSocketLib/Socket.c92
-rw-r--r--StdLib/EfiSocketLib/Socket.h65
-rw-r--r--StdLib/EfiSocketLib/Tcp4.c161
-rw-r--r--StdLib/EfiSocketLib/Udp4.c119
5 files changed, 180 insertions, 341 deletions
diff --git a/StdLib/EfiSocketLib/Ip4.c b/StdLib/EfiSocketLib/Ip4.c
index d91638c..a72905a 100644
--- a/StdLib/EfiSocketLib/Ip4.c
+++ b/StdLib/EfiSocketLib/Ip4.c
@@ -82,6 +82,7 @@ CONST ESL_PROTOCOL_API cEslIp4Api = {
NULL, // Listen
EslIp4OptionGet,
EslIp4OptionSet,
+ EslIp4PortCloseTxDone,
EslIp4Receive,
EslIp4RxCancel,
EslIp4TxBuffer
@@ -2673,13 +2674,9 @@ EslIp4TxComplete (
)
{
UINT32 LengthInBytes;
- ESL_PACKET * pCurrentPacket;
- ESL_PACKET * pNextPacket;
ESL_PORT * pPort;
ESL_PACKET * pPacket;
ESL_SOCKET * pSocket;
- ESL_IP4_TX_DATA * pTxData;
- ESL_IP4_CONTEXT * pIp4;
EFI_STATUS Status;
DBG_ENTER ( );
@@ -2690,87 +2687,24 @@ EslIp4TxComplete (
pPacket = pIo->pPacket;
pPort = pIo->pPort;
pSocket = pPort->pSocket;
- pIp4 = &pPort->Context.Ip4;
- pTxData = &pPacket->Op.Ip4Tx;
//
- // Mark this packet as complete
+ // Get the transmit length and status
//
LengthInBytes = pPacket->Op.Ip4Tx.TxData.TotalDataLength;
pSocket->TxBytes -= LengthInBytes;
Status = pIo->Token.Ip4Tx.Status;
//
- // Release the IO structure
+ // Complete the transmit operation
//
- EslSocketTxComplete ( pPort,
- pIo,
+ EslSocketTxComplete ( pIo,
+ LengthInBytes,
+ Status,
+ "Raw ",
+ &pSocket->pTxPacketListHead,
+ &pSocket->pTxPacketListTail,
&pPort->pTxActive,
&pPort->pTxFree );
-
- //
- // Save any transmit error
- //
- if ( EFI_ERROR ( Status )) {
- if ( !EFI_ERROR ( pSocket->TxError )) {
- pSocket->TxError = Status;
- }
- DEBUG (( DEBUG_TX | DEBUG_INFO,
- "ERROR - Transmit failure for packet 0x%08x on pPort 0x%08x, Status: %r\r\n",
- pPacket,
- pPort,
- Status ));
-
- //
- // Empty the normal transmit list
- //
- pCurrentPacket = pPacket;
- pNextPacket = pSocket->pTxPacketListHead;
- while ( NULL != pNextPacket ) {
- pPacket = pNextPacket;
- pNextPacket = pPacket->pNext;
- EslSocketPacketFree ( pPacket, DEBUG_TX );
- }
- pSocket->pTxPacketListHead = NULL;
- pSocket->pTxPacketListTail = NULL;
- pPacket = pCurrentPacket;
- }
- else {
- DEBUG (( DEBUG_TX | DEBUG_INFO,
- "0x%08x: Packet transmitted %d bytes successfully\r\n",
- pPacket,
- LengthInBytes ));
-
- //
- // Verify the transmit engine is still running
- //
- if ( !pPort->bCloseNow ) {
- //
- // Start the next packet transmission
- //
- EslSocketTxStart ( pPort,
- &pSocket->pTxPacketListHead,
- &pSocket->pTxPacketListTail,
- &pPort->pTxActive,
- &pPort->pTxFree );
- }
- }
-
- //
- // Release this packet
- //
- EslSocketPacketFree ( pPacket, DEBUG_TX );
-
- //
- // Finish the close operation if necessary
- //
- if (( PORT_STATE_CLOSE_STARTED <= pPort->State )
- && ( NULL == pSocket->pTxPacketListHead )
- && ( NULL == pPort->pTxActive )) {
- //
- // Indicate that the transmit is complete
- //
- EslIp4PortCloseTxDone ( pPort );
- }
DBG_EXIT ( );
}
diff --git a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c
index 9f8d67e..b7d731b 100644
--- a/StdLib/EfiSocketLib/Socket.c
+++ b/StdLib/EfiSocketLib/Socket.c
@@ -2946,22 +2946,44 @@ EslSocketTransmit (
The network specific code calls this routine during its transmit
complete processing. See the \ref TransmitEngine section.
- @param [in] pPort Address of an ::ESL_PORT structure
@param [in] pIo Address of an ::ESL_IO_MGMT structure
+ @param [in] LengthInBytes Length of the data in bytes
+ @param [in] Status Transmit operation status
+ @param [in] pQueueType Zero terminated string describing queue type
+ @param [in] ppQueueHead Transmit queue head address
+ @param [in] ppQueueTail Transmit queue tail address
@param [in] ppActive Active transmit queue address
@param [in] ppFree Free transmit queue address
**/
VOID
EslSocketTxComplete (
- IN ESL_PORT * pPort,
IN ESL_IO_MGMT * pIo,
+ IN UINT32 LengthInBytes,
+ IN EFI_STATUS Status,
+ IN CONST CHAR8 * pQueueType,
+ IN ESL_PACKET ** ppQueueHead,
+ IN ESL_PACKET ** ppQueueTail,
IN ESL_IO_MGMT ** ppActive,
IN ESL_IO_MGMT ** ppFree
)
{
+ ESL_PACKET * pCurrentPacket;
ESL_IO_MGMT * pIoNext;
+ ESL_PACKET * pNextPacket;
+ ESL_PACKET * pPacket;
+ ESL_PORT * pPort;
+ ESL_SOCKET * pSocket;
+ DBG_ENTER ( );
+
+ //
+ // Locate the active transmit packet
+ //
+ pPacket = pIo->pPacket;
+ pPort = pIo->pPort;
+ pSocket = pPort->pSocket;
+
//
// No more packet
//
@@ -2995,6 +3017,72 @@ EslSocketTxComplete (
DEBUG (( DEBUG_TX | DEBUG_INFO,
"0x%08x: pIo Released\r\n",
pIo ));
+
+ //
+ // Save any transmit error
+ //
+ if ( EFI_ERROR ( Status )) {
+ if ( !EFI_ERROR ( pSocket->TxError )) {
+ pSocket->TxError = Status;
+ }
+ DEBUG (( DEBUG_TX | DEBUG_INFO,
+ "ERROR - Transmit failure for %apacket 0x%08x, Status: %r\r\n",
+ pQueueType,
+ pPacket,
+ Status ));
+
+ //
+ // Empty the normal transmit list
+ //
+ pCurrentPacket = pPacket;
+ pNextPacket = *ppQueueHead;
+ while ( NULL != pNextPacket ) {
+ pPacket = pNextPacket;
+ pNextPacket = pPacket->pNext;
+ EslSocketPacketFree ( pPacket, DEBUG_TX );
+ }
+ *ppQueueHead = NULL;
+ *ppQueueTail = NULL;
+ pPacket = pCurrentPacket;
+ }
+ else {
+ DEBUG (( DEBUG_TX | DEBUG_INFO,
+ "0x%08x: %apacket transmitted %d bytes successfully\r\n",
+ pPacket,
+ pQueueType,
+ LengthInBytes ));
+
+ //
+ // Verify the transmit engine is still running
+ //
+ if ( !pPort->bCloseNow ) {
+ //
+ // Start the next packet transmission
+ //
+ EslSocketTxStart ( pPort,
+ ppQueueHead,
+ ppQueueTail,
+ ppActive,
+ ppFree );
+ }
+ }
+
+ //
+ // Release this packet
+ //
+ EslSocketPacketFree ( pPacket, DEBUG_TX );
+
+ //
+ // Finish the close operation if necessary
+ //
+ if ( PORT_STATE_CLOSE_STARTED <= pPort->State ) {
+ //
+ // Indicate that the transmit is complete
+ //
+ pSocket->pApi->pfnPortCloseTxDone ( pPort );
+ }
+
+ DBG_EXIT ( );
}
diff --git a/StdLib/EfiSocketLib/Socket.h b/StdLib/EfiSocketLib/Socket.h
index 120fa17..90e602a 100644
--- a/StdLib/EfiSocketLib/Socket.h
+++ b/StdLib/EfiSocketLib/Socket.h
@@ -584,6 +584,30 @@ EFI_STATUS
);
/**
+ Port close state 2
+
+ This routine determines the state of the transmit engine and
+ continues the close operation after the transmission is complete.
+ The next step is to stop the receive engine.
+
+ This routine is called by ::EslSocketTxCompleteto determine if
+ the transmission is complete.
+
+ @param [in] pPort Address of an ::ESL_PORT structure.
+
+ @retval EFI_SUCCESS The port is closed, not normally returned
+ @retval EFI_NOT_READY The port is still closing
+ @retval EFI_ALREADY_STARTED Error, the port is in the wrong state,
+ most likely the routine was called already.
+
+**/
+typedef
+EFI_STATUS
+(* PFN_API_PORT_CLOSE_TX) (
+ IN ESL_PORT * pPort
+ );
+
+/**
Receive data from a network connection.
@param [in] pSocket Address of a ESL_SOCKET structure
@@ -667,20 +691,21 @@ EFI_STATUS
This driver uses this structure to define the API for the socket type.
**/
typedef struct {
- int DefaultProtocol; ///< Default protocol
- PFN_API_ACCEPT pfnAccept; ///< Accept a network connection
- PFN_API_BIND pfnBind; ///< Bind API for the protocol
- PFN_API_CONNECT_START pfnConnectStart; ///< Start the connection to a remote system
- PFN_API_CONNECT_POLL pfnConnectPoll; ///< Poll for connection complete
- PFN_API_GET_LOCAL_ADDR pfnGetLocalAddr; ///< Get local address
- PFN_API_GET_RMT_ADDR pfnGetRemoteAddr; ///< Get remote address
- PFN_API_IS_CONFIGURED pfnIsConfigured; ///< Determine if the socket is configured
- PFN_API_LISTEN pfnListen; ///< Listen for connections on known server port
- PFN_API_OPTION_GET pfnOptionGet; ///< Get the option value
- PFN_API_OPTION_SET pfnOptionSet; ///< Set the option value
- PFN_API_RECEIVE pfnReceive; ///< Attempt to receive some data
- PFN_API_RX_CANCEL pfnRxCancel; ///< Cancel a receive operation
- PFN_API_TRANSMIT pfnTransmit; ///< Attempt to buffer a packet for transmit
+ int DefaultProtocol; ///< Default protocol
+ PFN_API_ACCEPT pfnAccept; ///< Accept a network connection
+ PFN_API_BIND pfnBind; ///< Bind API for the protocol
+ PFN_API_CONNECT_START pfnConnectStart; ///< Start the connection to a remote system
+ PFN_API_CONNECT_POLL pfnConnectPoll; ///< Poll for connection complete
+ PFN_API_GET_LOCAL_ADDR pfnGetLocalAddr; ///< Get local address
+ PFN_API_GET_RMT_ADDR pfnGetRemoteAddr; ///< Get remote address
+ PFN_API_IS_CONFIGURED pfnIsConfigured; ///< Determine if the socket is configured
+ PFN_API_LISTEN pfnListen; ///< Listen for connections on known server port
+ PFN_API_OPTION_GET pfnOptionGet; ///< Get the option value
+ PFN_API_OPTION_SET pfnOptionSet; ///< Set the option value
+ PFN_API_PORT_CLOSE_TX pfnPortCloseTxDone; ///< Check for port closure
+ PFN_API_RECEIVE pfnReceive; ///< Attempt to receive some data
+ PFN_API_RX_CANCEL pfnRxCancel; ///< Cancel a receive operation
+ PFN_API_TRANSMIT pfnTransmit; ///< Attempt to buffer a packet for transmit
} ESL_PROTOCOL_API;
@@ -988,16 +1013,24 @@ EslSocketPacketFree (
The network specific code calls this routine during its transmit
complete processing. See the \ref TransmitEngine section.
- @param [in] pPort Address of an ::ESL_PORT structure
@param [in] pIo Address of an ::ESL_IO_MGMT structure
+ @param [in] LengthInBytes Length of the data in bytes
+ @param [in] Status Transmit operation status
+ @param [in] pQueueType Zero terminated string describing queue type
+ @param [in] ppQueueHead Transmit queue head address
+ @param [in] ppQueueTail Transmit queue tail address
@param [in] ppActive Active transmit queue address
@param [in] ppFree Free transmit queue address
**/
VOID
EslSocketTxComplete (
- IN ESL_PORT * pPort,
IN ESL_IO_MGMT * pIo,
+ IN UINT32 LengthInBytes,
+ IN EFI_STATUS Status,
+ IN CONST CHAR8 * pQueueType,
+ IN ESL_PACKET ** ppQueueHead,
+ IN ESL_PACKET ** ppQueueTail,
IN ESL_IO_MGMT ** ppActive,
IN ESL_IO_MGMT ** ppFree
);
diff --git a/StdLib/EfiSocketLib/Tcp4.c b/StdLib/EfiSocketLib/Tcp4.c
index f8741ec..bc3f3a0 100644
--- a/StdLib/EfiSocketLib/Tcp4.c
+++ b/StdLib/EfiSocketLib/Tcp4.c
@@ -99,6 +99,7 @@ CONST ESL_PROTOCOL_API cEslTcp4Api = {
EslTcp4Listen,
NULL, // OptionGet
NULL, // OptionSet
+ EslTcp4PortCloseTxDone,
EslTcp4Receive,
EslTcp4RxCancel,
EslTcp4TxBuffer
@@ -3378,12 +3379,9 @@ EslTcp4TxComplete (
)
{
UINT32 LengthInBytes;
- ESL_PACKET * pCurrentPacket;
- ESL_PACKET * pNextPacket;
ESL_PACKET * pPacket;
ESL_PORT * pPort;
ESL_SOCKET * pSocket;
- ESL_TCP4_CONTEXT * pTcp4;
EFI_STATUS Status;
DBG_ENTER ( );
@@ -3394,84 +3392,25 @@ EslTcp4TxComplete (
pPacket = pIo->pPacket;
pPort = pIo->pPort;
pSocket = pPort->pSocket;
- pTcp4 = &pPort->Context.Tcp4;
-
+
//
- // Mark this packet as complete
+ // Get the transmit length and status
//
LengthInBytes = pPacket->Op.Tcp4Tx.TxData.DataLength;
pSocket->TxBytes -= LengthInBytes;
Status = pIo->Token.Tcp4Tx.CompletionToken.Status;
//
- // Release the IO structure
+ // Complete the transmit operation
//
- EslSocketTxComplete ( pPort,
- pIo,
+ EslSocketTxComplete ( pIo,
+ LengthInBytes,
+ Status,
+ "Normal ",
+ &pSocket->pTxPacketListHead,
+ &pSocket->pTxPacketListTail,
&pPort->pTxActive,
&pPort->pTxFree );
-
- //
- // Save any transmit error
- //
- if ( EFI_ERROR ( Status )) {
- if ( !EFI_ERROR ( pSocket->TxError )) {
- pSocket->TxError = Status;
- }
- DEBUG (( DEBUG_TX | DEBUG_INFO,
- "ERROR - Transmit failure for packet 0x%08x, Status: %r\r\n",
- pPacket,
- Status ));
-
- //
- // Empty the normal transmit list
- //
- pCurrentPacket = pPacket;
- pNextPacket = pSocket->pTxPacketListHead;
- while ( NULL != pNextPacket ) {
- pPacket = pNextPacket;
- pNextPacket = pPacket->pNext;
- EslSocketPacketFree ( pPacket, DEBUG_TX );
- }
- pSocket->pTxPacketListHead = NULL;
- pSocket->pTxPacketListTail = NULL;
- pPacket = pCurrentPacket;
- }
- else {
- DEBUG (( DEBUG_TX | DEBUG_INFO,
- "0x%08x: Packet transmitted %d bytes successfully\r\n",
- pPacket,
- LengthInBytes ));
-
- //
- // Verify the transmit engine is still running
- //
- if ( !pPort->bCloseNow ) {
- //
- // Start the next packet transmission
- //
- EslSocketTxStart ( pPort,
- &pSocket->pTxPacketListHead,
- &pSocket->pTxPacketListTail,
- &pPort->pTxActive,
- &pPort->pTxFree );
- }
- }
-
- //
- // Release this packet
- //
- EslSocketPacketFree ( pPacket, DEBUG_TX );
-
- //
- // Finish the close operation if necessary
- //
- if ( PORT_STATE_CLOSE_STARTED <= pPort->State ) {
- //
- // Indicate that the transmit is complete
- //
- EslTcp4PortCloseTxDone ( pPort );
- }
DBG_EXIT ( );
}
@@ -3499,12 +3438,9 @@ EslTcp4TxOobComplete (
)
{
UINT32 LengthInBytes;
- ESL_PACKET * pCurrentPacket;
- ESL_PACKET * pNextPacket;
ESL_PACKET * pPacket;
ESL_PORT * pPort;
ESL_SOCKET * pSocket;
- ESL_TCP4_CONTEXT * pTcp4;
EFI_STATUS Status;
DBG_ENTER ( );
@@ -3515,85 +3451,24 @@ EslTcp4TxOobComplete (
pPacket = pIo->pPacket;
pPort = pIo->pPort;
pSocket = pPort->pSocket;
- pTcp4 = &pPort->Context.Tcp4;
//
- // Mark this packet as complete
+ // Get the transmit length and status
//
- pIo->pPacket = NULL;
LengthInBytes = pPacket->Op.Tcp4Tx.TxData.DataLength;
pSocket->TxOobBytes -= LengthInBytes;
Status = pIo->Token.Tcp4Tx.CompletionToken.Status;
//
- // Release the IO structure
+ // Complete the transmit operation
//
- EslSocketTxComplete ( pPort,
- pIo,
+ EslSocketTxComplete ( pIo,
+ LengthInBytes,
+ Status,
+ "Urgent ",
+ &pSocket->pTxOobPacketListHead,
+ &pSocket->pTxOobPacketListTail,
&pPort->pTxOobActive,
&pPort->pTxOobFree );
-
- //
- // Save any transmit error
- //
- if ( EFI_ERROR ( Status )) {
- if ( !EFI_ERROR ( Status )) {
- pSocket->TxError = Status;
- }
- DEBUG (( DEBUG_TX | DEBUG_INFO,
- "ERROR - Transmit failure for urgent packet 0x%08x, Status: %r\r\n",
- pPacket,
- Status ));
-
-
- //
- // Empty the OOB transmit list
- //
- pCurrentPacket = pPacket;
- pNextPacket = pSocket->pTxOobPacketListHead;
- while ( NULL != pNextPacket ) {
- pPacket = pNextPacket;
- pNextPacket = pPacket->pNext;
- EslSocketPacketFree ( pPacket, DEBUG_TX );
- }
- pSocket->pTxOobPacketListHead = NULL;
- pSocket->pTxOobPacketListTail = NULL;
- pPacket = pCurrentPacket;
- }
- else {
- DEBUG (( DEBUG_TX | DEBUG_INFO,
- "0x%08x: Urgent packet transmitted %d bytes successfully\r\n",
- pPacket,
- LengthInBytes ));
-
- //
- // Verify the transmit engine is still running
- //
- if ( !pPort->bCloseNow ) {
- //
- // Start the next packet transmission
- //
- EslSocketTxStart ( pPort,
- &pSocket->pTxOobPacketListHead,
- &pSocket->pTxOobPacketListTail,
- &pPort->pTxOobActive,
- &pPort->pTxOobFree );
- }
- }
-
- //
- // Release this packet
- //
- EslSocketPacketFree ( pPacket, DEBUG_TX );
-
- //
- // Finish the close operation if necessary
- //
- if ( PORT_STATE_CLOSE_STARTED <= pPort->State ) {
- //
- // Indicate that the transmit is complete
- //
- EslTcp4PortCloseTxDone ( pPort );
- }
DBG_EXIT ( );
}
diff --git a/StdLib/EfiSocketLib/Udp4.c b/StdLib/EfiSocketLib/Udp4.c
index 116355a..7127781 100644
--- a/StdLib/EfiSocketLib/Udp4.c
+++ b/StdLib/EfiSocketLib/Udp4.c
@@ -83,6 +83,7 @@ CONST ESL_PROTOCOL_API cEslUdp4Api = {
NULL, // Listen
NULL, // OptionGet
NULL, // OptionSet
+ EslUdp4PortCloseTxDone,
EslUdp4Receive,
EslUdp4RxCancel,
EslUdp4TxBuffer
@@ -2446,16 +2447,10 @@ EslUdp4TxComplete (
IN ESL_IO_MGMT * pIo
)
{
- BOOLEAN bRetransmit;
UINT32 LengthInBytes;
- ESL_PACKET * pCurrentPacket;
- ESL_PACKET * pNextPacket;
ESL_PORT * pPort;
ESL_PACKET * pPacket;
ESL_SOCKET * pSocket;
- ESL_UDP4_TX_DATA * pTxData;
- ESL_UDP4_CONTEXT * pUdp4;
- EFI_UDP4_PROTOCOL * pUdp4Protocol;
EFI_STATUS Status;
DBG_ENTER ( );
@@ -2466,110 +2461,24 @@ EslUdp4TxComplete (
pPacket = pIo->pPacket;
pPort = pIo->pPort;
pSocket = pPort->pSocket;
- pUdp4 = &pPort->Context.Udp4;
- pTxData = &pPacket->Op.Udp4Tx;
- Status = pIo->Token.Udp4Tx.Status;
//
- // Check for MAC address not available (ARP not complete)
+ // Get the transmit length and status
//
- bRetransmit = FALSE;
- if (( EFI_NO_MAPPING == Status )
- && ( PORT_STATE_CLOSE_STARTED > pPort->State )
- && ( MAX_UDP_RETRANSMIT > pTxData->RetransmitCount++ )) {
- //
- // ARP is still trying to resolve the MAC address
- // Retransmit this packet
- //
- pUdp4Protocol = pUdp4->pProtocol;
- Status = pUdp4Protocol->Transmit ( pUdp4Protocol, &pIo->Token.Udp4Tx );
- if ( !EFI_ERROR ( Status )) {
- bRetransmit = TRUE;
- }
- }
+ LengthInBytes = pPacket->Op.Udp4Tx.TxData.DataLength;
+ pSocket->TxBytes -= LengthInBytes;
+ Status = pIo->Token.Udp4Tx.Status;
//
- // Handle packet completion
+ // Complete the transmit operation
//
- if ( !bRetransmit ) {
- //
- // Mark this packet as complete
- //
- LengthInBytes = pPacket->Op.Udp4Tx.TxData.DataLength;
- pSocket->TxBytes -= LengthInBytes;
-
- //
- // Release the IO structure
- //
- EslSocketTxComplete ( pPort,
- pIo,
- &pPort->pTxActive,
- &pPort->pTxFree );
-
- //
- // Save any transmit error
- //
- if ( EFI_ERROR ( Status )) {
- if ( !EFI_ERROR ( pSocket->TxError )) {
- pSocket->TxError = Status;
- }
- DEBUG (( DEBUG_TX | DEBUG_INFO,
- "ERROR - Transmit failure for packet 0x%08x on pPort 0x%08x, Status: %r\r\n",
- pPacket,
- pPort,
- Status ));
-
- //
- // Empty the normal transmit list
- //
- pCurrentPacket = pPacket;
- pNextPacket = pSocket->pTxPacketListHead;
- while ( NULL != pNextPacket ) {
- pPacket = pNextPacket;
- pNextPacket = pPacket->pNext;
- EslSocketPacketFree ( pPacket, DEBUG_TX );
- }
- pSocket->pTxPacketListHead = NULL;
- pSocket->pTxPacketListTail = NULL;
- pPacket = pCurrentPacket;
- }
- else {
- DEBUG (( DEBUG_TX | DEBUG_INFO,
- "0x%08x: Packet transmitted %d bytes successfully\r\n",
- pPacket,
- LengthInBytes ));
-
- //
- // Verify the transmit engine is still running
- //
- if ( !pPort->bCloseNow ) {
- //
- // Start the next packet transmission
- //
- EslSocketTxStart ( pPort,
- &pSocket->pTxPacketListHead,
- &pSocket->pTxPacketListTail,
- &pPort->pTxActive,
- &pPort->pTxFree );
- }
- }
-
- //
- // Release this packet
- //
- EslSocketPacketFree ( pPacket, DEBUG_TX );
-
- //
- // Finish the close operation if necessary
- //
- if (( PORT_STATE_CLOSE_STARTED <= pPort->State )
- && ( NULL == pSocket->pTxPacketListHead )
- && ( NULL == pPort->pTxActive )) {
- //
- // Indicate that the transmit is complete
- //
- EslUdp4PortCloseTxDone ( pPort );
- }
- }
+ EslSocketTxComplete ( pIo,
+ LengthInBytes,
+ Status,
+ "UDP ",
+ &pSocket->pTxPacketListHead,
+ &pSocket->pTxPacketListTail,
+ &pPort->pTxActive,
+ &pPort->pTxFree );
DBG_EXIT ( );
}