summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/eth.c12
-rw-r--r--net/net.c20
2 files changed, 32 insertions, 0 deletions
diff --git a/net/eth.c b/net/eth.c
index cca93920594..0fc22115dc2 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -52,9 +52,12 @@ extern int rtl8139_initialize(bd_t*);
extern int rtl8169_initialize(bd_t*);
extern int scc_initialize(bd_t*);
extern int skge_initialize(bd_t*);
+extern int tsi108_eth_initialize(bd_t*);
extern int tsec_initialize(bd_t*, int, char *);
extern int npe_initialize(bd_t *);
extern int uec_initialize(int);
+extern int bfin_EMAC_initialize(bd_t *);
+extern int atstk1000_eth_initialize(bd_t *);
static struct eth_device *eth_devices, *eth_current;
@@ -249,12 +252,21 @@ int eth_initialize(bd_t *bis)
#ifdef CONFIG_NS8382X
ns8382x_initialize(bis);
#endif
+#if defined(CONFIG_TSI108_ETH)
+ tsi108_eth_initialize(bis);
+#endif
#if defined(CONFIG_RTL8139)
rtl8139_initialize(bis);
#endif
#if defined(CONFIG_RTL8169)
rtl8169_initialize(bis);
#endif
+#if defined(CONFIG_BF537)
+ bfin_EMAC_initialize(bis);
+#endif
+#if defined(CONFIG_ATSTK1000)
+ atstk1000_eth_initialize(bis);
+#endif
if (!eth_devices) {
puts ("No ethernet found.\n");
diff --git a/net/net.c b/net/net.c
index 1d1c98f3c20..2ff7bfc09f0 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1424,6 +1424,26 @@ NetReceive(volatile uchar * inpkt, int len)
/* XXX point to ip packet */
(*packetHandler)((uchar *)ip, 0, 0, 0);
return;
+ case ICMP_ECHO_REQUEST:
+#ifdef ET_DEBUG
+ printf ("Got ICMP ECHO REQUEST, return %d bytes \n",
+ ETHER_HDR_SIZE + len);
+#endif
+ memcpy (&et->et_dest[0], &et->et_src[0], 6);
+ memcpy (&et->et_src[ 0], NetOurEther, 6);
+
+ ip->ip_sum = 0;
+ ip->ip_off = 0;
+ NetCopyIP((void*)&ip->ip_dst, &ip->ip_src);
+ NetCopyIP((void*)&ip->ip_src, &NetOurIP);
+ ip->ip_sum = ~NetCksum((uchar *)ip, IP_HDR_SIZE_NO_UDP >> 1);
+
+ icmph->type = ICMP_ECHO_REPLY;
+ icmph->checksum = 0;
+ icmph->checksum = ~NetCksum((uchar *)icmph,
+ (len - IP_HDR_SIZE_NO_UDP) >> 1);
+ (void) eth_send((uchar *)et, ETHER_HDR_SIZE + len);
+ return;
#endif
default:
return;