summaryrefslogtreecommitdiff
path: root/include/net.h
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-05-23 07:58:06 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2012-05-23 17:46:14 -0500
commitcb487f5664b1bf7d907f5d23fe10cc14dc1bd45a (patch)
tree6ccb6584841af8f1974910d5123805e1d74f4d3b /include/net.h
parentc5c59df04d6bb394209936c2a2c2a3054ead9150 (diff)
downloadu-boot-imx-cb487f5664b1bf7d907f5d23fe10cc14dc1bd45a.zip
u-boot-imx-cb487f5664b1bf7d907f5d23fe10cc14dc1bd45a.tar.gz
u-boot-imx-cb487f5664b1bf7d907f5d23fe10cc14dc1bd45a.tar.bz2
net: cosmetic: Un-typedef Ethernet_t
Separate the Ethernet header from the 802 header. Base the size constants on the structs. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'include/net.h')
-rw-r--r--include/net.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/net.h b/include/net.h
index 7692153..2551516 100644
--- a/include/net.h
+++ b/include/net.h
@@ -156,7 +156,17 @@ u32 ether_crc(size_t len, unsigned char const *p);
/*
* Ethernet header
*/
-typedef struct {
+
+struct ethernet_hdr {
+ uchar et_dest[6]; /* Destination node */
+ uchar et_src[6]; /* Source node */
+ ushort et_protlen; /* Protocol or length */
+};
+
+/* Ethernet header size */
+#define ETHER_HDR_SIZE (sizeof(struct ethernet_hdr))
+
+struct e802_hdr {
uchar et_dest[6]; /* Destination node */
uchar et_src[6]; /* Source node */
ushort et_protlen; /* Protocol or length */
@@ -167,10 +177,10 @@ typedef struct {
uchar et_snap2;
uchar et_snap3;
ushort et_prot; /* 802 protocol */
-} Ethernet_t;
+};
-#define ETHER_HDR_SIZE 14 /* Ethernet header size */
-#define E802_HDR_SIZE 22 /* 802 ethernet header size */
+/* 802 ethernet header size */
+#define E802_HDR_SIZE (sizeof(struct e802_hdr))
/*
* Ethernet header