From ef639df76fa03518480fdd210a14d8b146092d78 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 22 Nov 2024 19:44:12 +0100 Subject: [PATCH] drivers/at86rf215: return ENETDOWN when interface is down --- drivers/at86rf215/at86rf215.c | 2 +- drivers/at86rf215/at86rf215_netdev.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/at86rf215/at86rf215.c b/drivers/at86rf215/at86rf215.c index 9df5cda50b..c107948fef 100644 --- a/drivers/at86rf215/at86rf215.c +++ b/drivers/at86rf215/at86rf215.c @@ -247,7 +247,7 @@ static bool _tx_ongoing(at86rf215_t *dev) int at86rf215_tx_prepare(at86rf215_t *dev) { if (dev->state == AT86RF215_STATE_SLEEP) { - return -EAGAIN; + return -ENETDOWN; } if (_tx_ongoing(dev)) { diff --git a/drivers/at86rf215/at86rf215_netdev.c b/drivers/at86rf215/at86rf215_netdev.c index 74eb08b65e..99dd571823 100644 --- a/drivers/at86rf215/at86rf215_netdev.c +++ b/drivers/at86rf215/at86rf215_netdev.c @@ -149,10 +149,10 @@ static int _send(netdev_t *netdev, const iolist_t *iolist) { netdev_ieee802154_t *netdev_ieee802154 = container_of(netdev, netdev_ieee802154_t, netdev); at86rf215_t *dev = container_of(netdev_ieee802154, at86rf215_t, netdev); - size_t len = 0; - if (at86rf215_tx_prepare(dev)) { - return -EBUSY; + ssize_t len = at86rf215_tx_prepare(dev); + if (len) { + return len; } /* load packet data into FIFO */