Skip to content

Commit

Permalink
drivers/at86rf215: make use of packet queue if available
Browse files Browse the repository at this point in the history
Don't block on TX is a packet queue is available.
This improves the performance with fragmented packets.
  • Loading branch information
benpicco committed Sep 4, 2020
1 parent 50663d9 commit 30a423b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/at86rf215/at86rf215.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ static void _block_while_busy(at86rf215_t *dev)

static void at86rf215_block_while_busy(at86rf215_t *dev)
{
if (IS_ACTIVE(NETIF_PKTQ)) {
return;
}

if (_tx_ongoing(dev)) {
DEBUG("[at86rf215] Block while TXing\n");
_block_while_busy(dev);
Expand All @@ -262,7 +266,12 @@ int at86rf215_tx_prepare(at86rf215_t *dev)
return -EAGAIN;
}

at86rf215_block_while_busy(dev);
if (IS_ACTIVE(NETIF_PKTQ) && _tx_ongoing(dev)) {
return -EBUSY;
} else {
at86rf215_block_while_busy(dev);
}

dev->tx_frame_len = IEEE802154_FCS_LEN;

return 0;
Expand Down

0 comments on commit 30a423b

Please sign in to comment.