This is an addition to the last fix for adding the length byte. With hardware
FCS enabled we are obliged to set the length including the 2 bytes for the
FCS. Our skb does only have the len for the data it contains so we need to
adjust it for the length byte.

Signed-off-by: Stefan Schmidt <ste...@datenfreihafen.org>
---
 drivers/ieee802154/cc2420.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/ieee802154/cc2420.c b/drivers/ieee802154/cc2420.c
index fd072ce..3cc2724 100644
--- a/drivers/ieee802154/cc2420.c
+++ b/drivers/ieee802154/cc2420.c
@@ -213,6 +213,8 @@ static int
 cc2420_write_txfifo(struct cc2420_local *lp, u8 *data, u8 len)
 {
        int status;
+       /* Length byte must include FCS even if calculated in hardware */
+       int len_byte = len + 2;
        struct spi_message msg;
        struct spi_transfer xfer_head = {
                .len            = 1,
@@ -221,7 +223,7 @@ cc2420_write_txfifo(struct cc2420_local *lp, u8 *data, u8 
len)
        };
        struct spi_transfer xfer_len = {
                .len            = 1,
-               .tx_buf         = &len,
+               .tx_buf         = &len_byte,
        };
        struct spi_transfer xfer_buf = {
                .len            = len,
-- 
1.7.1


------------------------------------------------------------------------------
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to