[U-Boot] [PATCH 15/28] net: Refactor to call NetSendPacket() instead of calling eth_send()

Joe Hershberger joe.hershberger at ni.com
Fri Jan 20 01:53:18 CET 2012


Use this entry-point consistently across the net/ code

Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
Cc: Joe Hershberger <joe.hershberger at gmail.com>
Cc: Wolfgang Denk <wd at denx.de>
---
 net/arp.c  |    6 +++---
 net/cdp.c  |    2 +-
 net/net.c  |    2 +-
 net/ping.c |    3 +--
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/arp.c b/net/arp.c
index 60a1ded..d9113dc 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -88,7 +88,7 @@ void ArpRequest(void)
 	}
 
 	NetWriteIP(&arp->ar_tpa, NetArpWaitReplyIP);
-	(void) eth_send(NetTxPacket, eth_hdr_size + ARP_HDR_SIZE);
+	NetSendPacket(NetTxPacket, eth_hdr_size + ARP_HDR_SIZE);
 }
 
 void ArpTimeoutCheck(void)
@@ -165,7 +165,7 @@ void ArpReceive(struct Ethernet_t *et, struct IP_UDP_t *ip, int len)
 		NetCopyIP(&arp->ar_tpa, &arp->ar_spa);
 		memcpy(&arp->ar_sha, NetOurEther, ARP_HLEN);
 		NetCopyIP(&arp->ar_spa, &NetOurIP);
-		(void) eth_send((uchar *)et, eth_hdr_size + ARP_HDR_SIZE);
+		NetSendPacket((uchar *)et, eth_hdr_size + ARP_HDR_SIZE);
 		return;
 
 	case ARPOP_REPLY:		/* arp reply */
@@ -198,7 +198,7 @@ void ArpReceive(struct Ethernet_t *et, struct IP_UDP_t *ip, int len)
 			/* modify header, and transmit it */
 			memcpy(((struct Ethernet_t *)NetArpWaitTxPacket)->
 				et_dest, NetArpWaitPacketMAC, ARP_HLEN);
-			(void) eth_send(NetArpWaitTxPacket,
+			NetSendPacket(NetArpWaitTxPacket,
 					NetArpWaitTxPacketSize);
 
 			/* no arp request pending now */
diff --git a/net/cdp.c b/net/cdp.c
index 38b79bd..305ecad 100644
--- a/net/cdp.c
+++ b/net/cdp.c
@@ -215,7 +215,7 @@ CDPSendTrigger(void)
 		chksum = 0xFFFF;
 	*cp = htons(chksum);
 
-	(void) eth_send(NetTxPacket, (uchar *)s - NetTxPacket);
+	NetSendPacket(NetTxPacket, (uchar *)s - NetTxPacket);
 	return 0;
 }
 
diff --git a/net/net.c b/net/net.c
index a47b215..16cbadc 100644
--- a/net/net.c
+++ b/net/net.c
@@ -646,7 +646,7 @@ NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport,
 	pkt = (uchar *)NetTxPacket;
 	pkt += NetSetEther(pkt, ether, PROT_IP);
 	NetSetUDPHeader(pkt, dest, dport, sport, payload_len);
-	eth_send(NetTxPacket, (pkt - NetTxPacket) + IP_UDP_HDR_SIZE +
+	NetSendPacket(NetTxPacket, (pkt - NetTxPacket) + IP_UDP_HDR_SIZE +
 		payload_len);
 
 	return 0;	/* transmitted */
diff --git a/net/ping.c b/net/ping.c
index e4a7a21..7d03072 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -114,8 +114,7 @@ void PingReceive(struct Ethernet_t *et, struct IP_UDP_t *ip, int len)
 		icmph->checksum = 0;
 		icmph->checksum = ~NetCksum((uchar *)icmph,
 			(len - IP_HDR_SIZE) >> 1);
-		(void) eth_send((uchar *)et,
-				ETHER_HDR_SIZE + len);
+		NetSendPacket((uchar *)et, ETHER_HDR_SIZE + len);
 		return;
 /*	default:
 		return;*/
-- 
1.6.0.2



More information about the U-Boot mailing list