[U-Boot] [PATCH v2 12/21] net: cosmetic: Un-typedef ARP_t
Joe Hershberger
joe.hershberger at ni.com
Wed Mar 28 01:42:43 CEST 2012
Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
Cc: Joe Hershberger <joe.hershberger at gmail.com>
Cc: Simon Glass <sjg at chromium.org>
Cc: Mike Frysinger <vapier at gentoo.org>
---
Changes for v2:
- Split apart from "Un-typedef variables in net"
- Renamed structs from *_t to *_hdr since they are nolonger types
include/net.h | 5 ++---
net/arp.c | 8 ++++----
net/rarp.c | 8 ++++----
3 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/include/net.h b/include/net.h
index 0ddb2b4..937a99e 100644
--- a/include/net.h
+++ b/include/net.h
@@ -253,8 +253,7 @@ struct IP_UDP_hdr {
/*
* Address Resolution Protocol (ARP) header.
*/
-typedef struct
-{
+struct ARP_hdr {
ushort ar_hrd; /* Format of hardware address */
# define ARP_ETHER 1 /* Ethernet hardware address */
ushort ar_pro; /* Format of protocol address */
@@ -279,7 +278,7 @@ typedef struct
uchar ar_tha[]; /* Target hardware address */
uchar ar_tpa[]; /* Target protocol address */
#endif /* 0 */
-} ARP_t;
+};
#define ARP_HDR_SIZE (8+20) /* Size assuming ethernet */
diff --git a/net/arp.c b/net/arp.c
index 8b30a73..3d5dc83 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -51,7 +51,7 @@ void ArpInit(void)
void ArpRequest(void)
{
uchar *pkt;
- ARP_t *arp;
+ struct ARP_hdr *arp;
debug("ARP broadcast %d\n", NetArpWaitTry);
@@ -59,7 +59,7 @@ void ArpRequest(void)
pkt += NetSetEther(pkt, NetBcastAddr, PROT_ARP);
- arp = (ARP_t *) pkt;
+ arp = (struct ARP_hdr *) pkt;
arp->ar_hrd = htons(ARP_ETHER);
arp->ar_pro = htons(PROT_IP);
@@ -115,7 +115,7 @@ void ArpTimeoutCheck(void)
void ArpReceive(struct Ethernet_hdr *et, struct IP_UDP_hdr *ip, int len)
{
- ARP_t *arp;
+ struct ARP_hdr *arp;
IPaddr_t tmp;
uchar *pkt;
@@ -130,7 +130,7 @@ void ArpReceive(struct Ethernet_hdr *et, struct IP_UDP_hdr *ip, int len)
*/
debug("Got ARP\n");
- arp = (ARP_t *)ip;
+ arp = (struct ARP_hdr *)ip;
if (len < ARP_HDR_SIZE) {
printf("bad length %d < %d\n", len, ARP_HDR_SIZE);
return;
diff --git a/net/rarp.c b/net/rarp.c
index b30c812..a77f077 100644
--- a/net/rarp.c
+++ b/net/rarp.c
@@ -43,10 +43,10 @@ int RarpTry;
*/
void rarp_receive(struct IP_UDP_hdr *ip, unsigned len)
{
- ARP_t *arp;
+ struct ARP_hdr *arp;
debug("Got RARP\n");
- arp = (ARP_t *)ip;
+ arp = (struct ARP_hdr *)ip;
if (len < ARP_HDR_SIZE) {
printf("bad length %d < %d\n", len, ARP_HDR_SIZE);
return;
@@ -87,14 +87,14 @@ static void RarpTimeout(void)
void RarpRequest(void)
{
uchar *pkt;
- ARP_t *rarp;
+ struct ARP_hdr *rarp;
printf("RARP broadcast %d\n", ++RarpTry);
pkt = NetTxPacket;
pkt += NetSetEther(pkt, NetBcastAddr, PROT_RARP);
- rarp = (ARP_t *)pkt;
+ rarp = (struct ARP_hdr *)pkt;
rarp->ar_hrd = htons(ARP_ETHER);
rarp->ar_pro = htons(PROT_IP);
--
1.6.0.2
More information about the U-Boot
mailing list