[riot-notifications] [RIOT-OS/RIOT] at86rf2xx: Avoid deadlock on manual retransmissions with NETOPT_PRELOADING (#7581)

Joakim NohlgÄrd notifications at github.com
Thu Sep 7 21:17:54 CEST 2017

Manually triggering retransmissions via netdev by setting NETOPT_STATE_TX will put the driver in a deadlock because the transceiver ignores the TX start command when it is not in the TX_ARET_ON mode.

The ISR that runs after the first TX is complete will switch the transceiver back to the mode it was in before the at86rf2xx_tx_prepare was called. This is completely the right thing to do when not using any MAC layer, but when using duty cycling radio protocols, especially for broadcast/multicast, there is a need to be able to manually force a retransmission without having to rebuild the whole frame.

The current use case for this is preloading with manually triggered TX for an implementation of [ContikiMAC](https://github.com/contiki-os/contiki/wiki/Contikimac) (Not yet PRed), to be able to repeat the same frame until it is received by a sleeping node.

This PR also fixes the deadlock that would happen if NETOPT_STATE_TX is set without first calling send(). The node will still send a garbage frame with nonsense, but it won't hang the driver thread on waiting for a mutex.
You can view, comment on, or merge this pull request online at:


-- Commit Summary --

  * at86rf2xx: Avoid deadlock on manual retransmissions with NETOPT_PRELOADING

-- File Changes --

    M drivers/at86rf2xx/at86rf2xx_netdev.c (22)

-- Patch Links --


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20170907/4d61c94c/attachment.html>

More information about the notifications mailing list