slirp/ncsi: add checksum support
commit47335eeea8f1d14b7c6a1dd585a25a9166721168
authorCédric Le Goater <clg@kaod.org>
Wed, 30 May 2018 06:10:35 +0000 (30 08:10 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 31 May 2018 19:19:24 +0000 (31 21:19 +0200)
treea189731f5476000fae263196ca83308e1a076f0b
parentb2d1678fa1733144826f582d28020da39372649f
slirp/ncsi: add checksum support

The checksum field of a NC-SI packet contains a value that may be
included in each command and response. The verification is optional
but the Linux driver does so when a non-zero value is provided. Let's
extend the model to compute the checksum value and exercise a little
more the Linux driver.

See section "8.2.2.3 - 2's Complement Checksum Compensation" in the
Network Controller Sideband Interface (NC-SI) Specification for more
details.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
slirp/ncsi.c