Commit ea09dccf authored by robert-hh's avatar robert-hh

mimxrt: Re-Enable eth checksum creation by HW.

The initial problem with a wrong ICMP checksum was caused by
the test code setting a checksum and the HW taking that probably as
the start value and ending up with 0xffff. With a checksum field of 0
set by the test code the HW creates the proper checksum.
parent bbe25f47
......@@ -285,10 +285,7 @@ void eth_init(eth_t *self, int mac_idx, const phy_operations_t *phy_ops, int phy
enet_config.miiDuplex = (enet_mii_duplex_t)duplex;
enet_config.miiMode = kENET_RmiiMode;
// Enable checksum generation by the ENET controller
// Note: Disabled due to problems with the checksum on ICMP requests
// Maybe caused by LWIP inserting 0xffff instead of 0x0000
// Keep the code for now until it may be fixed.
// enet_config.txAccelerConfig = kENET_TxAccelIpCheckEnabled | kENET_TxAccelProtoCheckEnabled;
enet_config.txAccelerConfig = kENET_TxAccelIpCheckEnabled | kENET_TxAccelProtoCheckEnabled;
// Set interrupt
enet_config.interrupt |= ENET_TX_INTERRUPT | ENET_RX_INTERRUPT;
......@@ -351,11 +348,6 @@ STATIC err_t eth_netif_init(struct netif *netif) {
| NETIF_CHECKSUM_CHECK_TCP
| NETIF_CHECKSUM_CHECK_ICMP
| NETIF_CHECKSUM_CHECK_ICMP6
| NETIF_CHECKSUM_GEN_IP
| NETIF_CHECKSUM_GEN_UDP
| NETIF_CHECKSUM_GEN_TCP
| NETIF_CHECKSUM_GEN_ICMP
| NETIF_CHECKSUM_GEN_ICMP6
);
return ERR_OK;
}
......
......@@ -13,11 +13,8 @@
#define MEM_ALIGNMENT 4
#define LWIP_CHKSUM_ALGORITHM 3
// Chksum generaration by HW fails for ICMP
// Maybe caused by LWIP inserting ffff instead of 0000
// The checksum flags are set in eth.c
#define LWIP_CHECKSUM_CTRL_PER_NETIF 0
#define LWIP_CHECKSUM_ON_COPY 0
#define LWIP_CHECKSUM_CTRL_PER_NETIF 1
#define LWIP_ARP 1
#define LWIP_ETHERNET 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment