[U-Boot] [PATCH v2 11/21] net: cosmetic: Un-typedef VLAN_Ethernet_t

Joe Hershberger joe.hershberger at ni.com
Wed Mar 28 01:42:42 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 |    7 ++++---
 net/net.c     |    6 ++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/include/net.h b/include/net.h
index 328dc2c..0ddb2b4 100644
--- a/include/net.h
+++ b/include/net.h
@@ -184,15 +184,16 @@ struct E802_hdr {
 /*
  *	Ethernet header
  */
-typedef struct {
+struct VLAN_Ethernet_hdr {
 	uchar		vet_dest[6];	/* Destination node		*/
 	uchar		vet_src[6];	/* Source node			*/
 	ushort		vet_vlan_type;	/* PROT_VLAN			*/
 	ushort		vet_tag;	/* TAG of VLAN			*/
 	ushort		vet_type;	/* protocol type		*/
-} VLAN_Ethernet_t;
+};
 
-#define VLAN_ETHER_HDR_SIZE	18	/* VLAN Ethernet header size	*/
+/* VLAN Ethernet header size */
+#define VLAN_ETHER_HDR_SIZE	(sizeof(struct VLAN_Ethernet_hdr))
 
 #define PROT_IP		0x0800		/* IP protocol			*/
 #define PROT_ARP	0x0806		/* IP ARP protocol		*/
diff --git a/net/net.c b/net/net.c
index 9c386ae..76df737 100644
--- a/net/net.c
+++ b/net/net.c
@@ -911,7 +911,8 @@ NetReceive(uchar *inpkt, int len)
 		len -= ETHER_HDR_SIZE;
 
 	} else {			/* VLAN packet */
-		VLAN_Ethernet_t *vet = (VLAN_Ethernet_t *)et;
+		struct VLAN_Ethernet_hdr *vet =
+			(struct VLAN_Ethernet_hdr *)et;
 
 		debug("VLAN packet received\n");
 
@@ -1234,7 +1235,8 @@ NetSetEther(uchar *xet, uchar * addr, uint prot)
 		et->et_protlen = htons(prot);
 		return ETHER_HDR_SIZE;
 	} else {
-		VLAN_Ethernet_t *vet = (VLAN_Ethernet_t *)xet;
+		struct VLAN_Ethernet_hdr *vet =
+			(struct VLAN_Ethernet_hdr *)xet;
 
 		vet->vet_vlan_type = htons(PROT_VLAN);
 		vet->vet_tag = htons((0 << 5) | (myvlanid & VLAN_IDMASK));
-- 
1.6.0.2



More information about the U-Boot mailing list