1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/net/gnrc/netif: adapt to new API

For Ethernet, raw netifs, and IEEE 802.15.4 netifs only release outgoing
frame with legacy drivers, as gnrc_netif does so with new non-blocking
API.
This commit is contained in:
Marian Buschsieweke 2021-01-14 22:16:30 +01:00
parent 1cb6f9e11a
commit 581f35e577
No known key found for this signature in database
GPG Key ID: CB8E3238CE715A94
3 changed files with 12 additions and 5 deletions

View File

@ -162,7 +162,10 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
#endif
res = dev->driver->send(dev, &iolist);
gnrc_pktbuf_release(pkt);
if (gnrc_netif_netdev_legacy_api(netif)) {
/* only for legacy drivers we need to release pkt here */
gnrc_pktbuf_release(pkt);
}
return res;
}

View File

@ -120,8 +120,10 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
#endif
res = dev->driver->send(dev, (iolist_t *)pkt);
/* release old data */
gnrc_pktbuf_release(pkt);
if (gnrc_netif_netdev_legacy_api(netif)) {
/* only for legacy drivers we need to release pkt here */
gnrc_pktbuf_release(pkt);
}
return res;
}

View File

@ -398,8 +398,10 @@ static int _send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
res = dev->driver->send(dev, &iolist_header);
#endif
/* release old data */
gnrc_pktbuf_release(pkt);
if (gnrc_netif_netdev_legacy_api(netif)) {
/* only for legacy drivers we need to release pkt here */
gnrc_pktbuf_release(pkt);
}
return res;
}
/** @} */