diff options
author | Markus Klotzbuecher <mk@denx.de> | 2007-04-23 11:17:22 (GMT) |
---|---|---|
committer | Markus Klotzbuecher <mk@pollux.denx.de> | 2007-04-23 11:17:22 (GMT) |
commit | 61ea75aa07838435ec570ac85a2e3fc038844596 (patch) | |
tree | 20135a513c4c9d0bddb2a8ceaf009a8ed5e8bbdf /net | |
parent | e2fb36a57f364016b973b1db255531e07cfefd52 (diff) | |
parent | 14da5f7675bbb427c469e3f45006e027b6e21db9 (diff) | |
download | u-boot-fsl-qoriq-61ea75aa07838435ec570ac85a2e3fc038844596.tar.xz |
Merge with git://www.denx.de/git/u-boot.git
Diffstat (limited to 'net')
-rw-r--r-- | net/eth.c | 12 | ||||
-rw-r--r-- | net/net.c | 20 |
2 files changed, 32 insertions, 0 deletions
@@ -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"); @@ -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; |