From ece223b52ae9ab94f7ae83a9ac49b9f6319a94cb Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 23 May 2012 07:59:15 +0000 Subject: net: Refactor to separate the UDP handler from the ARP handler Call a built-in dummy if none is registered... don't require protocols to register a handler (eliminating dummies) NetConsole now uses the ARP handler when waiting on arp (instead of needing a #define hack in arp.c) Clear handlers at the end of net loop Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- include/net.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/net.h b/include/net.h index 8dd407e..09f040f 100644 --- a/include/net.h +++ b/include/net.h @@ -460,8 +460,10 @@ extern int NetCksumOk(uchar *, int); /* Return true if cksum OK */ extern uint NetCksum(uchar *, int); /* Calculate the checksum */ /* Callbacks */ -extern rxhand_f *NetGetHandler(void); /* Get RX packet handler */ -extern void NetSetHandler(rxhand_f *); /* Set RX packet handler */ +extern rxhand_f *net_get_udp_handler(void); /* Get UDP RX packet handler */ +extern void net_set_udp_handler(rxhand_f *); /* Set UDP RX packet handler */ +extern rxhand_f *net_get_arp_handler(void); /* Get ARP RX packet handler */ +extern void net_set_arp_handler(rxhand_f *); /* Set ARP RX packet handler */ extern void net_set_icmp_handler(rxhand_icmp_f *f); /* Set ICMP RX handler */ extern void NetSetTimeout(ulong, thand_f *);/* Set timeout handler */ @@ -487,6 +489,7 @@ static inline void NetSendPacket(uchar *pkt, int len) /* * Transmit UDP packet, performing ARP request if needed + * (ether will be populated) * * @param ether Raw packet buffer * @param dest IP address to send the datagram to -- cgit v1.1