Skip to content

Commit

Permalink
Merge pull request #21037 from benpicco/backport/2024.10/net_fixes-misc
Browse files Browse the repository at this point in the history
drivers/at86rf215: return ENETDOWN when interface is down [backport 2024.10]
  • Loading branch information
maribu authored Nov 25, 2024
2 parents 2699f21 + 969ca83 commit 0e82225
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion drivers/at86rf215/at86rf215.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
9 changes: 3 additions & 6 deletions drivers/at86rf215/at86rf215_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions sys/net/gnrc/netif/gnrc_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1803,7 +1803,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);
Expand Down Expand Up @@ -1876,7 +1876,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 */
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/net/nanocoap_cli/nanocli_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <url>\n", argv[0]);
Expand Down

0 comments on commit 0e82225

Please sign in to comment.