diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-23 07:59:13 +0000 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-23 17:46:20 -0500 |
commit | adf5d93e441eb3eacd8c0430d6064b35d47ad2a5 (patch) | |
tree | d8e088ac9d135ab710a276b405c3ed3e5f19b872 /net | |
parent | 61da3c2af8ba7a06cb1f7e9e0db54b9ddea532ce (diff) | |
download | u-boot-adf5d93e441eb3eacd8c0430d6064b35d47ad2a5.tar.gz |
net: Refactor to use NetSendPacket instead of eth_send directly
Use this entry-point consistently across the net/ code
Use a static inline function to preserve code size
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/arp.c | 6 | ||||
-rw-r--r-- | net/cdp.c | 2 | ||||
-rw-r--r-- | net/net.c | 9 | ||||
-rw-r--r-- | net/ping.c | 3 |
4 files changed, 6 insertions, 14 deletions
@@ -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_hdr *et, struct ip_udp_hdr *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_hdr *et, struct ip_udp_hdr *ip, int len) /* modify header, and transmit it */ memcpy(((struct ethernet_hdr *)NetArpWaitTxPacket)-> et_dest, NetArpWaitPacketMAC, ARP_HLEN); - (void) eth_send(NetArpWaitTxPacket, + NetSendPacket(NetArpWaitTxPacket, NetArpWaitTxPacketSize); /* no arp request pending now */ @@ -216,7 +216,7 @@ CDPSendTrigger(void) chksum = 0xFFFF; *cp = htons(chksum); - (void) eth_send(NetTxPacket, (uchar *)s - NetTxPacket); + NetSendPacket(NetTxPacket, (uchar *)s - NetTxPacket); return 0; } @@ -584,13 +584,6 @@ NetSetTimeout(ulong iv, thand_f *f) } } - -void -NetSendPacket(uchar *pkt, int len) -{ - (void) eth_send(pkt, len); -} - int NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int payload_len) { @@ -646,7 +639,7 @@ int NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, return 1; /* waiting */ } else { debug("sending UDP to %pI4/%pM\n", &dest, ether); - eth_send(NetTxPacket, pkt_hdr_size + payload_len); + NetSendPacket(NetTxPacket, pkt_hdr_size + payload_len); return 0; /* transmitted */ } } diff --git a/net/ping.c b/net/ping.c index 0f4d99088e..f0026cc420 100644 --- a/net/ping.c +++ b/net/ping.c @@ -112,8 +112,7 @@ void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *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;*/ |