summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Mosberger-Tang <davidm@egauge.net>2024-02-07 06:07:42 +0100
committerKalle Valo <kvalo@kernel.org>2024-02-12 16:37:40 +0100
commitc08a986344a5eb80ae3651f33d0f386cd9e97252 (patch)
tree696949463df06021eaae4dd37566e9f05bad23fd
parentwifi: rtw89: chan: MCC take reconfig into account (diff)
downloadlinux-c08a986344a5eb80ae3651f33d0f386cd9e97252.tar.xz
linux-c08a986344a5eb80ae3651f33d0f386cd9e97252.zip
wifi: wilc1000: correct CRC7 calculation
Document ATWILC1000/ATWILC3000 Baremetal Wi-Fi/BLE Link Controller Software Design Guide https://tinyurl.com/yer2xhyc says that bit 0 of the CRC7 code must always be a 1. I confirmed that today with a logic analyzer: setting bit 0 causes wilc1000 to accept a command with CRC7 enabled, whereas clearing bit 0 causes wilc1000 to reject the command with a CRC error. Signed-off-by: David Mosberger-Tang <davidm@egauge.net> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://msgid.link/20240207050736.2717641-1-davidm@egauge.net
-rw-r--r--drivers/net/wireless/microchip/wilc1000/spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c
index eaf4dda9c540..c92ee4b73a74 100644
--- a/drivers/net/wireless/microchip/wilc1000/spi.c
+++ b/drivers/net/wireless/microchip/wilc1000/spi.c
@@ -473,7 +473,7 @@ static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz)
********************************************/
static u8 wilc_get_crc7(u8 *buffer, u32 len)
{
- return crc7_be(0xfe, buffer, len);
+ return crc7_be(0xfe, buffer, len) | 0x01;
}
static int wilc_spi_single_read(struct wilc *wilc, u8 cmd, u32 adr, void *b,