From aa54086dc6fc3cbf8a9f6d5d33798cf415679aad Mon Sep 17 00:00:00 2001 From: Tomasz Bursztyka Date: Tue, 8 Nov 2016 18:18:44 +0100 Subject: [PATCH] drivers: ieee802154: Fix some old left-over before multi-frag support And take the opportunity to reduce the buffer size, as 127 is the 15.4 MTU, it has just engouh space on 128 bytes for the spi cmd plus the frame. Change-Id: Ifdeb83f85ab1adcdebc55bd72c38a98f18a86dbc Signed-off-by: Tomasz Bursztyka --- drivers/ieee802154/ieee802154_cc2520.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ieee802154/ieee802154_cc2520.c b/drivers/ieee802154/ieee802154_cc2520.c index b8fe41c1d2..05ccbd4e95 100644 --- a/drivers/ieee802154/ieee802154_cc2520.c +++ b/drivers/ieee802154/ieee802154_cc2520.c @@ -418,7 +418,7 @@ static inline bool write_txfifo_length(struct cc2520_spi *spi, static inline bool write_txfifo_content(struct cc2520_spi *spi, struct net_buf *buf) { - uint8_t cmd[128 + 1]; + uint8_t cmd[128]; cmd[0] = CC2520_INS_TXBUF; memcpy(&cmd[1], net_nbuf_ll(buf), @@ -427,7 +427,7 @@ static inline bool write_txfifo_content(struct cc2520_spi *spi, spi_slave_select(spi->dev, spi->slave); return (spi_write(spi->dev, cmd, net_nbuf_ll_reserve(buf) + - net_buf_frags_len(buf) + 1) == 0); + buf->frags->len + 1) == 0); } static inline bool verify_txfifo_status(struct cc2520_context *cc2520,