Skip to content

Commit cad51f8

Browse files
chienhung-lincarlescufi
authored andcommitted
driver: wifi: eswifi: Fix spi buffer length
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 #62056 Signed-off-by: Chien Hung Lin <[email protected]>
1 parent 46cdec8 commit cad51f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/wifi/eswifi/eswifi_bus_spi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static int eswifi_spi_write(struct eswifi_dev *eswifi, char *data, size_t dlen)
6666
int status;
6767

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

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

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

0 commit comments

Comments
 (0)