projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: emaclite: Use indirect access in emaclite_recv
[oweals/u-boot.git]
/
net
/
rarp.c
diff --git
a/net/rarp.c
b/net/rarp.c
index f50d2fbd9de7dc5ef261d19ac833a2047def641a..1fa11b690d218fbda9fd80d26d99746acae10bf9 100644
(file)
--- a/
net/rarp.c
+++ b/
net/rarp.c
@@
-8,10
+8,10
@@
#include <common.h>
#include <command.h>
#include <net.h>
#include <common.h>
#include <command.h>
#include <net.h>
+#include <net/tftp.h>
#include "nfs.h"
#include "bootp.h"
#include "rarp.h"
#include "nfs.h"
#include "bootp.h"
#include "rarp.h"
-#include "tftp.h"
#define TIMEOUT 5000UL /* Milliseconds before trying BOOTP again */
#ifndef CONFIG_NET_RETRY_COUNT
#define TIMEOUT 5000UL /* Milliseconds before trying BOOTP again */
#ifndef CONFIG_NET_RETRY_COUNT
@@
-20,7
+20,7
@@
#define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT)
#endif
#define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT)
#endif
-int
RarpT
ry;
+int
rarp_t
ry;
/*
* Handle a RARP received packet.
/*
* 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) ||
}
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]);
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.
*/
/*
* Timeout on BOOTP request.
*/
-static void
RarpTimeout
(void)
+static void
rarp_timeout_handler
(void)
{
{
- if (
RarpT
ry >= TIMEOUT_COUNT) {
+ if (
rarp_t
ry >= TIMEOUT_COUNT) {
puts("\nRetry count exceeded; starting again\n");
puts("\nRetry count exceeded; starting again\n");
-
NetStartA
gain();
+
net_start_a
gain();
} else {
} else {
-
NetSetTimeout(TIMEOUT, RarpTimeout
);
-
RarpR
equest();
+
net_set_timeout_handler(TIMEOUT, rarp_timeout_handler
);
+
rarp_r
equest();
}
}
}
}
-void
RarpR
equest(void)
+void
rarp_r
equest(void)
{
uchar *pkt;
struct arp_hdr *rarp;
int eth_hdr_size;
{
uchar *pkt;
struct arp_hdr *rarp;
int eth_hdr_size;
- printf("RARP broadcast %d\n", ++
RarpT
ry);
+ printf("RARP broadcast %d\n", ++
rarp_t
ry);
pkt = net_tx_packet;
eth_hdr_size = net_set_ether(pkt, net_bcast_ethaddr, PROT_RARP);
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);
net_send_packet(net_tx_packet, eth_hdr_size + ARP_HDR_SIZE);
-
NetSetTimeout(TIMEOUT, RarpTimeout
);
+
net_set_timeout_handler(TIMEOUT, rarp_timeout_handler
);
}
}