]> bbs.cooldavid.org Git - net-next-2.6.git/commit
netdev: bfin_mac: deduce Ethernet FCS from hardware IP payload checksum
authorSonic Zhang <sonic.zhang@analog.com>
Mon, 10 May 2010 05:39:09 +0000 (05:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 May 2010 00:20:58 +0000 (17:20 -0700)
commitad2864d88718714d8b347b6209b07abb2ecd3a49
treeb6381e4fb49436c3032d7e13f02416db047a67fb
parentf6e1e4f3e511589dd0c47d42b870501659e7195f
netdev: bfin_mac: deduce Ethernet FCS from hardware IP payload checksum

IP checksum is based on 16-bit one's complement algorithm, so to deduce a
value from checksum is equal to add its complement.

Unfortunately, the Blackfin on-chip MAC checksum logic only works when the
IP packet has a header length of 20 bytes.  This is true for most IPv4
packets, but not for IPv6 packets or IPv4 packets which use header options.
So only use the hardware checksum when appropriate.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Jon Kowal <jon.kowal@dspecialists.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/bfin_mac.c