net: Support network packet checksum calc offloading

Create infrastructure that allows ethernet device driver to tell
if it supports network packet checksum offloading. This applies only
to IPv4, UDP or TCP checksums. The driver can enable/disable checksum
offloading separately for Tx and Rx network packets.

If the device (ethernet in this case) can calculate the network
packet checksum for IPv4, UDP or TCP, then do not calculate the
corresponding checksum by the stack itself.

Fixes #2987

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2018-03-14 10:55:19 +02:00
commit 85a2459edb
14 changed files with 143 additions and 35 deletions

View file

@ -705,9 +705,9 @@ static void eth_enc28j60_iface_init_0(struct net_if *iface)
context->iface = iface;
}
static struct net_if_api api_funcs_0 = {
.init = eth_enc28j60_iface_init_0,
.send = eth_net_tx,
static const struct ethernet_api api_funcs_0 = {
.iface_api.init = eth_enc28j60_iface_init_0,
.iface_api.send = eth_net_tx,
};
static struct eth_enc28j60_runtime eth_enc28j60_0_runtime;