Skip to content

Commit

Permalink
driver: wifi: eswifi: Fix spi buffer length
Browse files Browse the repository at this point in the history
The eswifi spi driver sets up spi buffer length as number of frames,
but the length shall be number of bytes. Because eswifi use 16 bit as
frame size, so this turns out reading and writing half of data and
fails to sending any at command request and getting any responds from
eswifi module.

Fix it by setting up length as number of bytes.

Fixes zephyrproject-rtos#62056

Signed-off-by: Chien Hung Lin <chienhung.lin.tw@gmail.com>
  • Loading branch information
chienhung-lin authored and carlescufi committed Sep 5, 2023
1 parent 46cdec8 commit cad51f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/wifi/eswifi/eswifi_bus_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static int eswifi_spi_write(struct eswifi_dev *eswifi, char *data, size_t dlen)
int status;

spi_tx_buf[0].buf = data;
spi_tx_buf[0].len = dlen / 2; /* 16-bit words */
spi_tx_buf[0].len = dlen;
spi_tx.buffers = spi_tx_buf;
spi_tx.count = ARRAY_SIZE(spi_tx_buf);

Expand All @@ -88,7 +88,7 @@ static int eswifi_spi_read(struct eswifi_dev *eswifi, char *data, size_t dlen)
int status;

spi_rx_buf[0].buf = data;
spi_rx_buf[0].len = dlen / 2; /* 16-bit words */
spi_rx_buf[0].len = dlen;
spi_rx.buffers = spi_rx_buf;
spi_rx.count = ARRAY_SIZE(spi_rx_buf);

Expand Down

0 comments on commit cad51f8

Please sign in to comment.