Skip to content

Commit

Permalink
Merge pull request #21091 from maribu/pkg/lwip/adapt-to-netdev_new_ne…
Browse files Browse the repository at this point in the history
…w_api

pkg/lwip: fix adaption to API change of netdev_new_api
  • Loading branch information
benpicco authored Dec 16, 2024
2 parents 4044c85 + 424eae0 commit a40852d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/lwip/contrib/netdev/lwip_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,14 +298,16 @@ static err_t _common_link_output(struct netif *netif, netdev_t *netdev, iolist_t
return ERR_IF;
}

/* block until TX completion is signaled from IRQ */
thread_flags_wait_any(THREAD_FLAG_LWIP_TX_DONE);
/* `res > 0` means transmission already completed according to API contract.
* ==> only waiting when res == 0 */
if (res == 0) {
/* block until TX completion is signaled from IRQ */
thread_flags_wait_any(THREAD_FLAG_LWIP_TX_DONE);

irq_state = irq_disable();
compat_netif->thread_doing_tx = NULL;
irq_restore(irq_state);
irq_state = irq_disable();
compat_netif->thread_doing_tx = NULL;
irq_restore(irq_state);

if (res == 0) {
/* async send */
while (-EAGAIN == (res = netdev->driver->confirm_send(netdev, NULL))) {
/* this should not happen, as the driver really only should emit the
Expand Down

0 comments on commit a40852d

Please sign in to comment.