summaryrefslogtreecommitdiffstats
path: root/net
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 /net
parentc5c59df04d6bb394209936c2a2c2a3054ead9150 (diff)
downloadtalos-obmc-uboot-cb487f5664b1bf7d907f5d23fe10cc14dc1bd45a.tar.gz
talos-obmc-uboot-cb487f5664b1bf7d907f5d23fe10cc14dc1bd45a.zip
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 'net')
-rw-r--r--net/arp.c4
-rw-r--r--net/arp.h2
-rw-r--r--net/bootp.c2
-rw-r--r--net/cdp.c4
-rw-r--r--net/net.c11
-rw-r--r--net/ping.c2
-rw-r--r--net/ping.h2
7 files changed, 14 insertions, 13 deletions
diff --git a/net/arp.c b/net/arp.c
index 03272adf57..c3def633b6 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -113,7 +113,7 @@ void ArpTimeoutCheck(void)
}
}
-void ArpReceive(Ethernet_t *et, struct ip_udp_hdr *ip, int len)
+void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
{
ARP_t *arp;
IPaddr_t tmp;
@@ -193,7 +193,7 @@ void ArpReceive(Ethernet_t *et, struct ip_udp_hdr *ip, int len)
NetGetHandler()(0, 0, 0, 0, 0);
#endif
/* modify header, and transmit it */
- memcpy(((Ethernet_t *)NetArpWaitTxPacket)->
+ memcpy(((struct ethernet_hdr *)NetArpWaitTxPacket)->
et_dest, NetArpWaitPacketMAC, 6);
(void) eth_send(NetArpWaitTxPacket,
NetArpWaitTxPacketSize);
diff --git a/net/arp.h b/net/arp.h
index b59fbdd2ed..b7a1ac97d4 100644
--- a/net/arp.h
+++ b/net/arp.h
@@ -25,6 +25,6 @@ extern int NetArpWaitTry;
void ArpInit(void);
void ArpRequest(void);
void ArpTimeoutCheck(void);
-void ArpReceive(Ethernet_t *et, struct ip_udp_hdr *ip, int len);
+void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len);
#endif /* __ARP_H__ */
diff --git a/net/bootp.c b/net/bootp.c
index b8d2760676..32852500d9 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -103,7 +103,7 @@ static void BootpCopyNetParams(struct Bootp_t *bp)
NetCopyIP(&tmp_ip, &bp->bp_siaddr);
if (tmp_ip != 0)
NetCopyIP(&NetServerIP, &bp->bp_siaddr);
- memcpy(NetServerEther, ((Ethernet_t *)NetRxPacket)->et_src, 6);
+ memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6);
#endif
if (strlen(bp->bp_file) > 0)
copy_filename(BootFile, bp->bp_file, sizeof(BootFile));
diff --git a/net/cdp.c b/net/cdp.c
index 004aae2ff2..63be570584 100644
--- a/net/cdp.c
+++ b/net/cdp.c
@@ -109,7 +109,7 @@ CDPSendTrigger(void)
uchar *pkt;
ushort *s;
ushort *cp;
- Ethernet_t *et;
+ struct ethernet_hdr *et;
int len;
ushort chksum;
#if defined(CONFIG_CDP_DEVICE_ID) || defined(CONFIG_CDP_PORT_ID) || \
@@ -118,7 +118,7 @@ CDPSendTrigger(void)
#endif
pkt = NetTxPacket;
- et = (Ethernet_t *)pkt;
+ et = (struct ethernet_hdr *)pkt;
/* NOTE: trigger sent not on any VLAN */
diff --git a/net/net.c b/net/net.c
index 2bf5631f0d..33de399683 100644
--- a/net/net.c
+++ b/net/net.c
@@ -823,7 +823,7 @@ static inline struct ip_udp_hdr *NetDefragment(struct ip_udp_hdr *ip, int *lenp)
* @parma ip IP packet containing the ICMP
*/
static void receive_icmp(struct ip_udp_hdr *ip, int len,
- IPaddr_t src_ip, Ethernet_t *et)
+ IPaddr_t src_ip, struct ethernet_hdr *et)
{
ICMP_t *icmph = (ICMP_t *)&ip->udp_src;
@@ -851,7 +851,7 @@ static void receive_icmp(struct ip_udp_hdr *ip, int len,
void
NetReceive(uchar *inpkt, int len)
{
- Ethernet_t *et;
+ struct ethernet_hdr *et;
struct ip_udp_hdr *ip;
IPaddr_t tmp;
IPaddr_t src_ip;
@@ -865,7 +865,7 @@ NetReceive(uchar *inpkt, int len)
NetRxPacket = inpkt;
NetRxPacketLen = len;
- et = (Ethernet_t *)inpkt;
+ et = (struct ethernet_hdr *)inpkt;
/* too small packet? */
if (len < ETHER_HDR_SIZE)
@@ -895,10 +895,11 @@ NetReceive(uchar *inpkt, int len)
debug("packet received\n");
if (x < 1514) {
+ struct e802_hdr *et802 = (struct e802_hdr *)et;
/*
* Got a 802 packet. Check the other protocol field.
*/
- x = ntohs(et->et_prot);
+ x = ntohs(et802->et_prot);
ip = (struct ip_udp_hdr *)(inpkt + E802_HDR_SIZE);
len -= E802_HDR_SIZE;
@@ -1218,7 +1219,7 @@ NetEthHdrSize(void)
int
NetSetEther(uchar *xet, uchar * addr, uint prot)
{
- Ethernet_t *et = (Ethernet_t *)xet;
+ struct ethernet_hdr *et = (struct ethernet_hdr *)xet;
ushort myvlanid;
myvlanid = ntohs(NetOurVLAN);
diff --git a/net/ping.c b/net/ping.c
index 8542e2299b..04a594cf53 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -98,7 +98,7 @@ void ping_start(void)
ping_send();
}
-void ping_receive(Ethernet_t *et, struct ip_udp_hdr *ip, int len)
+void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
{
ICMP_t *icmph = (ICMP_t *)&(ip->udp_src);
IPaddr_t src_ip;
diff --git a/net/ping.h b/net/ping.h
index 0a2d7d1797..fd8d8d9778 100644
--- a/net/ping.h
+++ b/net/ping.h
@@ -28,7 +28,7 @@ void ping_start(void);
* @param ip IP header in the same packet
* @param len Packet length
*/
-void ping_receive(Ethernet_t *et, struct ip_udp_hdr *ip, int len);
+void ping_receive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len);
#endif /* __PING_H__ */
#endif
OpenPOWER on IntegriCloud