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

drivers/dose: port to netdev_new_api

This commit is contained in:
Benjamin Valentin 2024-11-14 15:57:21 +01:00
parent 70aa1ec81f
commit 8e4bdca325
2 changed files with 10 additions and 6 deletions

View File

@ -12,6 +12,6 @@ USEMODULE += chunked_ringbuffer
USEMODULE += eui_provider
USEMODULE += iolist
USEMODULE += netdev_eth
USEMODULE += netdev_legacy_api
USEMODULE += netdev_new_api
USEMODULE += random
USEMODULE += ztimer_usec

View File

@ -530,6 +530,13 @@ static inline void _send_done(dose_t *ctx, bool collision)
#endif
}
static int _confirm_send(netdev_t *dev, void *info)
{
(void)dev;
(void)info;
return -EOPNOTSUPP;
}
static int _send(netdev_t *dev, const iolist_t *iolist)
{
dose_t *ctx = container_of(dev, dose_t, netdev);
@ -593,9 +600,6 @@ send:
_send_done(ctx, false);
/* We probably sent the whole packet?! */
dev->event_callback(dev, NETDEV_EVENT_TX_COMPLETE);
/* Get out of the SEND state */
state(ctx, DOSE_SIGNAL_END);
@ -605,7 +609,6 @@ collision:
_send_done(ctx, true);
DEBUG("dose _send(): collision!\n");
if (--retries < 0) {
dev->event_callback(dev, NETDEV_EVENT_TX_MEDIUM_BUSY);
return -EBUSY;
}
@ -765,7 +768,8 @@ static const netdev_driver_t netdev_driver_dose = {
.init = _init,
.isr = _isr,
.get = _get,
.set = _set
.set = _set,
.confirm_send = _confirm_send,
};
void dose_setup(dose_t *ctx, const dose_params_t *params, uint8_t index)