summaryrefslogtreecommitdiff
path: root/net/rarp.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2015-04-08 01:41:11 -0500
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:33 -0600
commit698d78e5457bc04f4ee3cd6985429c34615bcb59 (patch)
treeeb9ac468cd99b901bafb1f74ae13274e058b7b48 /net/rarp.c
parent68c76a3a38a008e162581d0785618a898cc7944b (diff)
downloadu-boot-698d78e5457bc04f4ee3cd6985429c34615bcb59.tar.gz
u-boot-698d78e5457bc04f4ee3cd6985429c34615bcb59.tar.bz2
u-boot-698d78e5457bc04f4ee3cd6985429c34615bcb59.zip
net: cosmetic: Clean up RARP variables and functions
Make a thorough pass through all variables and function names contained within rarp.c and remove CamelCase and improve naming. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net/rarp.c')
-rw-r--r--net/rarp.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/net/rarp.c b/net/rarp.c
index f50d2fbd9d..204e03cf28 100644
--- a/net/rarp.c
+++ b/net/rarp.c
@@ -20,7 +20,7 @@
#define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT)
#endif
-int RarpTry;
+int rarp_try;
/*
* Handle a RARP received packet.
@@ -37,10 +37,9 @@ void rarp_receive(struct ip_udp_hdr *ip, unsigned len)
}
if ((ntohs(arp->ar_op) != RARPOP_REPLY) ||
- (ntohs(arp->ar_hrd) != ARP_ETHER) ||
- (ntohs(arp->ar_pro) != PROT_IP) ||
- (arp->ar_hln != 6) || (arp->ar_pln != 4)) {
-
+ (ntohs(arp->ar_hrd) != ARP_ETHER) ||
+ (ntohs(arp->ar_pro) != PROT_IP) ||
+ (arp->ar_hln != 6) || (arp->ar_pln != 4)) {
puts("invalid RARP header\n");
} else {
net_copy_ip(&net_ip, &arp->ar_data[16]);
@@ -56,25 +55,25 @@ void rarp_receive(struct ip_udp_hdr *ip, unsigned len)
/*
* Timeout on BOOTP request.
*/
-static void RarpTimeout(void)
+static void rarp_timeout_handler(void)
{
- if (RarpTry >= TIMEOUT_COUNT) {
+ if (rarp_try >= TIMEOUT_COUNT) {
puts("\nRetry count exceeded; starting again\n");
NetStartAgain();
} else {
- NetSetTimeout(TIMEOUT, RarpTimeout);
- RarpRequest();
+ NetSetTimeout(TIMEOUT, rarp_timeout_handler);
+ rarp_request();
}
}
-void RarpRequest(void)
+void rarp_request(void)
{
uchar *pkt;
struct arp_hdr *rarp;
int eth_hdr_size;
- printf("RARP broadcast %d\n", ++RarpTry);
+ printf("RARP broadcast %d\n", ++rarp_try);
pkt = net_tx_packet;
eth_hdr_size = net_set_ether(pkt, net_bcast_ethaddr, PROT_RARP);
@@ -96,5 +95,5 @@ void RarpRequest(void)
net_send_packet(net_tx_packet, eth_hdr_size + ARP_HDR_SIZE);
- NetSetTimeout(TIMEOUT, RarpTimeout);
+ NetSetTimeout(TIMEOUT, rarp_timeout_handler);
}