wilc1000: Add support for enabling CRC
authorDavid Mosberger-Tang <davidm@egauge.net>
Sat, 27 Feb 2021 17:31:38 +0000 (17:31 +0000)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 17 Apr 2021 17:47:40 +0000 (20:47 +0300)
commitc872e7ae056f16e27311fb30d637032cc3b1cb46
tree4e8920a43a45192b35518e83b84d74acb8bb7aaf
parentce3b933832b6286d181c30f646449d6ccc2a2c8c
wilc1000: Add support for enabling CRC

The driver so far has always disabled CRC protection.  This means any
data corruption that occurrs during the SPI transfers could go
undetected.  This patch adds module parameters enable_crc7 and
enable_crc16 to selectively turn on CRC7 (for command transfers) and
CRC16 (for data transfers), respectively.

The default configuration remains unchanged, with both CRC7 and CRC16
off.

The performance impact of CRC was measured by running ttcp -t four
times in a row on a SAMA5 device:

 CRC7 CRC16 Throughput: Standard deviation:
 ---- ----- ----------- -------------------
  off   off 1720  +/- 48 KB/s
   on   off 1658  +/- 58 KB/s
   on    on 1579  +/- 84 KB/s

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210227172818.1711071-4-davidm@egauge.net
drivers/net/wireless/microchip/wilc1000/Kconfig
drivers/net/wireless/microchip/wilc1000/spi.c