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..ea6661877b 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 */ @@ -176,9 +176,6 @@ static int _send(netdev_t *netdev, const iolist_t *iolist) at86rf215_tx_exec(dev); } - /* store successfully sent number of bytes */ - dev->tx_frame_len = len; - /* netdev_new just returns 0 on success */ return 0; } diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index aa6cd4020f..6b6619bfc0 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -1807,7 +1807,7 @@ static void _tx_done(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, return; /* early return to not release */ } else { - LOG_ERROR("gnrc_netif: can't queue packet for sending\n"); + LOG_ERROR("gnrc_netif: can't queue packet for sending, drop it\n"); /* If we got here, it means the device was busy and the pkt queue * was full. The packet should be dropped here anyway */ gnrc_pktbuf_release_error(pkt, ENOMEM); @@ -1880,7 +1880,7 @@ static void _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, bool push_back) return; } else { - LOG_WARNING("gnrc_netif: can't queue packet for sending\n"); + LOG_WARNING("gnrc_netif: can't queue packet for sending, try sending\n"); /* try to send anyway */ } } diff --git a/tests/net/nanocoap_cli/nanocli_client.c b/tests/net/nanocoap_cli/nanocli_client.c index 3266c69055..2f8351a14e 100644 --- a/tests/net/nanocoap_cli/nanocli_client.c +++ b/tests/net/nanocoap_cli/nanocli_client.c @@ -327,7 +327,7 @@ int nanotest_client_get_non_cmd(int argc, char **argv) { int res; - uint8_t response[CONFIG_NANOCOAP_BLOCKSIZE_DEFAULT]; + uint8_t response[coap_szx2size(CONFIG_NANOCOAP_BLOCKSIZE_DEFAULT)]; if (argc < 2) { printf("usage: %s \n", argv[0]);