Hi, Stefan

2010/5/4 Stefan Schmidt <ste...@datenfreihafen.org>

> 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.
>

I still don`t know why I must add 2 bytes for the FCS. I read cc2420
datasheet again.
In Page 38, it said:
"In transmit mode the FCS is appended at the correct position defined by the
length
filed. The FCS is not written to the TXFIFO, but stored in a separate
16-bit register."

I think FCS should automatically add to MPDU by cc2420.

Could you help me out? Thx

xue liu



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
>
------------------------------------------------------------------------------
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to