From: Julian Calaby <julian.calaby@gmail.com>
To: David Mosberger-Tang <davidm@egauge.net>
Cc: linux-wireless@vger.kernel.org,
Ajay Singh <ajay.kathat@microchip.com>,
Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: Re: [PATCH 4/4] wilc1000: Add support for enabling CRC
Date: Thu, 25 Feb 2021 08:19:21 +1100 [thread overview]
Message-ID: <CAGRGNgUR7wHgprWcqz5orJNuhcxeLMSE1C3WCi1_UH_MCwJ6Cg@mail.gmail.com> (raw)
In-Reply-To: <20210224055135.1509200-4-davidm@egauge.net>
Hi David,
On Wed, Feb 24, 2021 at 6:56 PM David Mosberger-Tang <davidm@egauge.net> wrote:
>
> The driver so far has always disabled CRC protection. This means any
> data corruption that occurred during the SPI transfers could
> potentially go unnoticed. This patch adds the macros ENABLE_CRC7 and
> ENABLE_CRC16 to allow compile-time selection of whether or not CRC7
> and CRC16, respectively, should be enabled.
>
> The default configuration remains unchanged, with both CRC7 and CRC16
> off.
>
> Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
> ---
> .../net/wireless/microchip/wilc1000/Kconfig | 1 +
> drivers/net/wireless/microchip/wilc1000/spi.c | 151 +++++++++++++-----
> 2 files changed, 108 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/net/wireless/microchip/wilc1000/Kconfig b/drivers/net/wireless/microchip/wilc1000/Kconfig
> index 7f15e42602dd..62cfcdc9aacc 100644
> --- a/drivers/net/wireless/microchip/wilc1000/Kconfig
> +++ b/drivers/net/wireless/microchip/wilc1000/Kconfig
> @@ -27,6 +27,7 @@ config WILC1000_SPI
> depends on CFG80211 && INET && SPI
> select WILC1000
> select CRC7
> + select CRC_ITU_T
> help
> This module adds support for the SPI interface of adapters using
> WILC1000 chipset. The Atmel WILC1000 has a Serial Peripheral
> diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c
> index b0e096a03a28..c745a440d273 100644
> --- a/drivers/net/wireless/microchip/wilc1000/spi.c
> +++ b/drivers/net/wireless/microchip/wilc1000/spi.c
> @@ -7,10 +7,23 @@
> #include <linux/clk.h>
> #include <linux/spi/spi.h>
> #include <linux/crc7.h>
> +#include <linux/crc-itu-t.h>
>
> #include "netdev.h"
> #include "cfg80211.h"
>
> +/**
> + * Establish the driver's desired CRC configuration. CRC7 is used for
> + * command transfers which have no other protection against corruption
> + * during the SPI transfer. Commands are short so CRC7 is relatively
> + * cheap. CRC16 is used for data transfers, including network packet
> + * transfers. Since those transfers can be large, CRC16 is relatively
> + * expensive. CRC16 is also often redundant as network packets
> + * typically are protected by their own, higher-level checksum.
> + */
> +#define ENABLE_CRC7 0 /* set to 1 to protect SPI commands with CRC7 */
> +#define ENABLE_CRC16 0 /* set to 1 to protect SPI data with CRC16 */
Should these be Kconfig variables instead?
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
next prev parent reply other threads:[~2021-02-24 21:20 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 5:51 [PATCH 1/4] wilc1000: Make SPI transfers work at 48MHz David Mosberger-Tang
2021-02-24 5:51 ` [PATCH 2/4] wilc1000: Introduce symbolic names for SPI protocol register David Mosberger-Tang
2021-02-24 5:51 ` [PATCH 3/4] wilc1000: Check for errors at end of DMA write David Mosberger-Tang
2021-02-25 8:27 ` Kalle Valo
2021-02-25 18:10 ` David Mosberger-Tang
2021-02-24 5:52 ` [PATCH 4/4] wilc1000: Add support for enabling CRC David Mosberger-Tang
2021-02-24 10:01 ` Ajay.Kathat
2021-02-24 16:25 ` David Mosberger-Tang
2021-02-25 4:50 ` Ajay.Kathat
2021-02-24 13:35 ` Ajay.Kathat
2021-02-24 15:47 ` David Mosberger-Tang
2021-02-25 4:58 ` Ajay.Kathat
2021-02-25 8:25 ` Kalle Valo
2021-02-24 21:19 ` Julian Calaby [this message]
2021-02-24 23:36 ` David Mosberger-Tang
2021-02-25 5:56 ` Ajay.Kathat
2021-02-25 8:22 ` Kalle Valo
2021-02-25 11:03 ` Ajay.Kathat
2021-02-26 7:09 ` Kalle Valo
2021-02-27 17:29 ` [PATCH v2 1/4] wilc1000: Make SPI transfers work at 48MHz David Mosberger-Tang
2021-04-17 17:48 ` Kalle Valo
2021-02-27 17:29 ` [PATCH v2 2/4] wilc1000: Introduce symbolic names for SPI protocol register David Mosberger-Tang
2021-02-27 17:29 ` [PATCH v2 3/4] wilc1000: Check for errors at end of DMA write David Mosberger-Tang
2021-02-27 17:31 ` [PATCH v2 4/4] wilc1000: Add support for enabling CRC David Mosberger-Tang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGRGNgUR7wHgprWcqz5orJNuhcxeLMSE1C3WCi1_UH_MCwJ6Cg@mail.gmail.com \
--to=julian.calaby@gmail.com \
--cc=ajay.kathat@microchip.com \
--cc=claudiu.beznea@microchip.com \
--cc=davidm@egauge.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).