On Mon, 10 Mar 2014 23:18:06 +0100
Alexander Aring <alex.ar...@gmail.com> wrote:

> This patch fix a unexpected state change for the at86rf231 chip.
> We can't change into STATE_FORCE_TX_ON while the chip is in one of
> SLEEP, P_ON, RESET, TRX_OFF, and all *_NOCLK states.
> 
> In this case we are in the TRX_OFF state. See datasheet [1] page 71
> for more information.
> 
> Without this patch you will:
[…]
> diff --git a/drivers/net/ieee802154/at86rf230.c
> b/drivers/net/ieee802154/at86rf230.c index 6ceb170..3ca1c89 100644
> --- a/drivers/net/ieee802154/at86rf230.c
> +++ b/drivers/net/ieee802154/at86rf230.c
> @@ -567,13 +567,22 @@ static int
>  at86rf230_start(struct ieee802154_dev *dev)
>  {
>       struct at86rf230_local *lp = dev->priv;
> +     int state = STATE_TX_ON;
>       u8 rc;
>  
>       rc = at86rf230_write_subreg(lp, SR_RX_SAFE_MODE, 1);
>       if (rc)
>               return rc;
>  
> -     rc = at86rf230_state(dev, STATE_FORCE_TX_ON);
> +     /* For reset sequence the rf212 chip need to change state to
> +      * STATE_FORCE_TX_ON. Change to STATE_FORCE_TX_ON isn't valid
> +      * for state STATE_TRX_OFF for the rf231 chip. On this chip
> we
> +      * turn into the STATE_TX_ON state.
> +      */
> +     if (is_rf212(lp))
> +             state = STATE_FORCE_TX_ON;
> +
> +     rc = at86rf230_state(dev, state);
>       if (rc)
>               return rc;
>  

The is_rf212 doesn't seem to be needed, my transceiver works fine if
it's also put into TX_ON instead of FORCE_TX_ON.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to