summaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index c719bc4..44feee2 100644
--- a/net/net.c
+++ b/net/net.c
@@ -137,6 +137,9 @@ uchar NetBcastAddr[6] = /* Ethernet bcast address */
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
uchar NetEtherNullAddr[6] =
{ 0, 0, 0, 0, 0, 0 };
+#ifdef CONFIG_API
+void (*push_packet)(volatile void *, int len) = 0;
+#endif
#if defined(CONFIG_CMD_CDP)
uchar NetCDPAddr[6] = /* Ethernet bcast address */
{ 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
@@ -593,7 +596,9 @@ void NetStartAgain (void)
NetSetHandler (startAgainHandler);
#else /* !CONFIG_NET_MULTI*/
eth_halt ();
+#if !defined(CONFIG_NET_DO_NOT_TRY_ANOTHER)
eth_try_another (!NetRestarted);
+#endif
eth_init (gd->bd);
if (NetRestartWrap) {
NetRestartWrap = 0;
@@ -1161,6 +1166,13 @@ NetReceive(volatile uchar * inpkt, int len)
if (len < ETHER_HDR_SIZE)
return;
+#ifdef CONFIG_API
+ if (push_packet) {
+ (*push_packet)(inpkt, len);
+ return;
+ }
+#endif
+
#if defined(CONFIG_CMD_CDP)
/* keep track if packet is CDP */
iscdp = memcmp(et->et_dest, NetCDPAddr, 6) == 0;