[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211223011358.4031459-51-davidm@egauge.net>
Date: Thu, 23 Dec 2021 01:14:07 +0000 (UTC)
From: David Mosberger-Tang <davidm@...uge.net>
To: Ajay Singh <ajay.kathat@...rochip.com>
Cc: Claudiu Beznea <claudiu.beznea@...rochip.com>,
Kalle Valo <kvalo@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
David Mosberger-Tang <davidm@...uge.net>
Subject: [PATCH v2 50/50] wilc1000: add module parameter
"disable_zero_copy_tx" to SPI driver
Add a module parameter to disable the zero-copy transmit path. This
is useful for testing and performance measurement, for example.
Signed-off-by: David Mosberger-Tang <davidm@...uge.net>
---
drivers/net/wireless/microchip/wilc1000/spi.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/microchip/wilc1000/spi.c b/drivers/net/wireless/microchip/wilc1000/spi.c
index 8d94f111ffc49..588cec326a74b 100644
--- a/drivers/net/wireless/microchip/wilc1000/spi.c
+++ b/drivers/net/wireless/microchip/wilc1000/spi.c
@@ -31,6 +31,11 @@ MODULE_PARM_DESC(enable_crc16,
"\t\t\tData transfers can be large and the CPU-cycle cost\n"
"\t\t\tof enabling this may be substantial.");
+static bool disable_zero_copy_tx;
+module_param(disable_zero_copy_tx, bool, 0644);
+MODULE_PARM_DESC(disable_zero_copy_tx,
+ "Disable zero-copy when sending packets.");
+
/*
* For CMD_SINGLE_READ and CMD_INTERNAL_READ, WILC may insert one or
* more zero bytes between the command response and the DATA Start tag
@@ -41,7 +46,7 @@ MODULE_PARM_DESC(enable_crc16,
*/
#define WILC_SPI_RSP_HDR_EXTRA_DATA 8
-static const struct wilc_hif_func wilc_hif_spi;
+static struct wilc_hif_func wilc_hif_spi;
static int wilc_spi_reset(struct wilc *wilc);
static int wilc_spi_write_sk_buffs(struct wilc *wilc, u32 addr,
@@ -254,6 +259,9 @@ static int wilc_bus_probe(struct spi_device *spi)
if (!spi_priv)
return -ENOMEM;
+ if (!disable_zero_copy_tx)
+ wilc_hif_spi.hif_sk_buffs_tx = wilc_spi_write_sk_buffs;
+
ret = wilc_cfg80211_init(&wilc, &spi->dev, WILC_HIF_SPI, &wilc_hif_spi);
if (ret)
goto free;
@@ -1424,7 +1432,7 @@ static int wilc_spi_sync_ext(struct wilc *wilc, int nint)
}
/* Global spi HIF function table */
-static const struct wilc_hif_func wilc_hif_spi = {
+static struct wilc_hif_func wilc_hif_spi = {
.hif_init = wilc_spi_init,
.hif_deinit = wilc_spi_deinit,
.hif_read_reg = wilc_spi_read_reg,
@@ -1436,7 +1444,6 @@ static const struct wilc_hif_func wilc_hif_spi = {
.hif_read_size = wilc_spi_read_size,
.hif_block_tx_ext = wilc_spi_write,
.hif_block_rx_ext = wilc_spi_read,
- .hif_sk_buffs_tx = wilc_spi_write_sk_buffs,
.hif_sync_ext = wilc_spi_sync_ext,
.hif_reset = wilc_spi_reset,
};
--
2.25.1
Powered by blists - more mailing lists