Modify UDP and IP to transmit on all network adapters instead of just the first netwo...
authorlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 10 Sep 2012 19:04:41 +0000 (19:04 +0000)
committerlpleahy <lpleahy@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 10 Sep 2012 19:04:41 +0000 (19:04 +0000)
Fix comment in Socket.c.

Signed-off-by: lpleahy
Reviewed and tested by: Sreenivasula Reddy of Dell

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13713 6f19259b-4bc3-4df7-8a09-765794883524

StdLib/EfiSocketLib/Ip4.c
StdLib/EfiSocketLib/Socket.c
StdLib/EfiSocketLib/Udp4.c
StdLib/EfiSocketLib/Udp6.c

index a245e68..2e832c7 100644 (file)
@@ -985,21 +985,21 @@ EslIp4TxBuffer (
   //\r
   if ( SOCKET_STATE_CONNECTED == pSocket->State ) {\r
     //\r
-    //  Locate the port\r
+    //  Verify that there is enough room to buffer another\r
+    //  transmit operation\r
     //\r
-    pPort = pSocket->pPortList;\r
-    if ( NULL != pPort ) {\r
+    pTxBytes = &pSocket->TxBytes;\r
+    if ( pSocket->MaxTxBuf > *pTxBytes ) {\r
       //\r
-      //  Determine the queue head\r
+      //  Locate the port\r
       //\r
-      pIp4 = &pPort->Context.Ip4;\r
-      pTxBytes = &pSocket->TxBytes;\r
+      pPort = pSocket->pPortList;\r
+      while ( NULL != pPort ) {\r
+        //\r
+        //  Determine the queue head\r
+        //\r
+        pIp4 = &pPort->Context.Ip4;\r
 \r
-      //\r
-      //  Verify that there is enough room to buffer another\r
-      //  transmit operation\r
-      //\r
-      if ( pSocket->MaxTxBuf > *pTxBytes ) {\r
         //\r
         //  Attempt to allocate the packet\r
         //\r
@@ -1131,6 +1131,7 @@ EslIp4TxBuffer (
             //  Free the packet\r
             //\r
             EslSocketPacketFree ( pPacket, DEBUG_TX );\r
+            break;\r
           }\r
 \r
           //\r
@@ -1143,16 +1144,22 @@ EslIp4TxBuffer (
           //  Packet allocation failed\r
           //\r
           pSocket->errno = ENOMEM;\r
+          break;\r
         }\r
-      }\r
-      else {\r
+\r
         //\r
-        //  Not enough buffer space available\r
+        //  Set the next port\r
         //\r
-        pSocket->errno = EAGAIN;\r
-        Status = EFI_NOT_READY;\r
+        pPort = pPort->pLinkSocket;\r
       }\r
     }\r
+    else {\r
+      //\r
+      //  Not enough buffer space available\r
+      //\r
+      pSocket->errno = EAGAIN;\r
+      Status = EFI_NOT_READY;\r
+    }\r
   }\r
 \r
   //\r
index acb2367..e718e9b 100644 (file)
@@ -3191,7 +3191,7 @@ EslSocketPacketFree (
   DBG_ENTER ( );\r
 \r
   //\r
-  //  Allocate a packet structure\r
+  //  Free a packet structure\r
   //\r
   LengthInBytes = pPacket->PacketSize;\r
   Status = gBS->FreePool ( pPacket );\r
index 45c0ada..414e3fe 100644 (file)
@@ -794,21 +794,21 @@ EslUdp4TxBuffer (
   //\r
   if ( SOCKET_STATE_CONNECTED == pSocket->State ) {\r
     //\r
-    //  Locate the port\r
+    //  Verify that there is enough room to buffer another\r
+    //  transmit operation\r
     //\r
-    pPort = pSocket->pPortList;\r
-    if ( NULL != pPort ) {\r
+    pTxBytes = &pSocket->TxBytes;\r
+    if ( pSocket->MaxTxBuf > *pTxBytes ) {\r
       //\r
-      //  Determine the queue head\r
+      //  Locate the port\r
       //\r
-      pUdp4 = &pPort->Context.Udp4;\r
-      pTxBytes = &pSocket->TxBytes;\r
+      pPort = pSocket->pPortList;\r
+      while ( NULL != pPort ) {\r
+        //\r
+        //  Determine the queue head\r
+        //\r
+        pUdp4 = &pPort->Context.Udp4;\r
 \r
-      //\r
-      //  Verify that there is enough room to buffer another\r
-      //  transmit operation\r
-      //\r
-      if ( pSocket->MaxTxBuf > *pTxBytes ) {\r
         //\r
         //  Attempt to allocate the packet\r
         //\r
@@ -923,6 +923,7 @@ EslUdp4TxBuffer (
             //  Free the packet\r
             //\r
             EslSocketPacketFree ( pPacket, DEBUG_TX );\r
+            break;\r
           }\r
 \r
           //\r
@@ -935,16 +936,22 @@ EslUdp4TxBuffer (
           //  Packet allocation failed\r
           //\r
           pSocket->errno = ENOMEM;\r
+          break;\r
         }\r
-      }\r
-      else {\r
+\r
         //\r
-        //  Not enough buffer space available\r
+        //  Set the next port\r
         //\r
-        pSocket->errno = EAGAIN;\r
-        Status = EFI_NOT_READY;\r
+        pPort = pPort->pLinkSocket;\r
       }\r
     }\r
+    else {\r
+      //\r
+      //  Not enough buffer space available\r
+      //\r
+      pSocket->errno = EAGAIN;\r
+      Status = EFI_NOT_READY;\r
+    }\r
   }\r
 \r
   //\r
index 899e506..7de5005 100644 (file)
@@ -835,21 +835,21 @@ EslUdp6TxBuffer (
   //\r
   if ( SOCKET_STATE_CONNECTED == pSocket->State ) {\r
     //\r
-    //  Locate the port\r
+    //  Verify that there is enough room to buffer another\r
+    //  transmit operation\r
     //\r
-    pPort = pSocket->pPortList;\r
-    if ( NULL != pPort ) {\r
+    pTxBytes = &pSocket->TxBytes;\r
+    if ( pSocket->MaxTxBuf > *pTxBytes ) {\r
       //\r
-      //  Determine the queue head\r
+      //  Locate the port\r
       //\r
-      pUdp6 = &pPort->Context.Udp6;\r
-      pTxBytes = &pSocket->TxBytes;\r
+      pPort = pSocket->pPortList;\r
+      while ( NULL != pPort ) {\r
+        //\r
+        //  Determine the queue head\r
+        //\r
+        pUdp6 = &pPort->Context.Udp6;\r
 \r
-      //\r
-      //  Verify that there is enough room to buffer another\r
-      //  transmit operation\r
-      //\r
-      if ( pSocket->MaxTxBuf > *pTxBytes ) {\r
         //\r
         //  Attempt to allocate the packet\r
         //\r
@@ -960,6 +960,7 @@ EslUdp6TxBuffer (
             //  Free the packet\r
             //\r
             EslSocketPacketFree ( pPacket, DEBUG_TX );\r
+            break;\r
           }\r
 \r
           //\r
@@ -972,16 +973,22 @@ EslUdp6TxBuffer (
           //  Packet allocation failed\r
           //\r
           pSocket->errno = ENOMEM;\r
+          break;\r
         }\r
-      }\r
-      else {\r
+\r
         //\r
-        //  Not enough buffer space available\r
+        //  Set the next port\r
         //\r
-        pSocket->errno = EAGAIN;\r
-        Status = EFI_NOT_READY;\r
+        pPort = pPort->pLinkSocket;\r
       }\r
     }\r
+    else {\r
+      //\r
+      //  Not enough buffer space available\r
+      //\r
+      pSocket->errno = EAGAIN;\r
+      Status = EFI_NOT_READY;\r
+    }\r
   }\r
 \r
   //\r