mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/dose: port to netdev_new_api
This commit is contained in:
parent
70aa1ec81f
commit
8e4bdca325
@ -12,6 +12,6 @@ USEMODULE += chunked_ringbuffer
|
|||||||
USEMODULE += eui_provider
|
USEMODULE += eui_provider
|
||||||
USEMODULE += iolist
|
USEMODULE += iolist
|
||||||
USEMODULE += netdev_eth
|
USEMODULE += netdev_eth
|
||||||
USEMODULE += netdev_legacy_api
|
USEMODULE += netdev_new_api
|
||||||
USEMODULE += random
|
USEMODULE += random
|
||||||
USEMODULE += ztimer_usec
|
USEMODULE += ztimer_usec
|
||||||
|
@ -530,6 +530,13 @@ static inline void _send_done(dose_t *ctx, bool collision)
|
|||||||
#endif
|
#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)
|
static int _send(netdev_t *dev, const iolist_t *iolist)
|
||||||
{
|
{
|
||||||
dose_t *ctx = container_of(dev, dose_t, netdev);
|
dose_t *ctx = container_of(dev, dose_t, netdev);
|
||||||
@ -593,9 +600,6 @@ send:
|
|||||||
|
|
||||||
_send_done(ctx, false);
|
_send_done(ctx, false);
|
||||||
|
|
||||||
/* We probably sent the whole packet?! */
|
|
||||||
dev->event_callback(dev, NETDEV_EVENT_TX_COMPLETE);
|
|
||||||
|
|
||||||
/* Get out of the SEND state */
|
/* Get out of the SEND state */
|
||||||
state(ctx, DOSE_SIGNAL_END);
|
state(ctx, DOSE_SIGNAL_END);
|
||||||
|
|
||||||
@ -605,7 +609,6 @@ collision:
|
|||||||
_send_done(ctx, true);
|
_send_done(ctx, true);
|
||||||
DEBUG("dose _send(): collision!\n");
|
DEBUG("dose _send(): collision!\n");
|
||||||
if (--retries < 0) {
|
if (--retries < 0) {
|
||||||
dev->event_callback(dev, NETDEV_EVENT_TX_MEDIUM_BUSY);
|
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,7 +768,8 @@ static const netdev_driver_t netdev_driver_dose = {
|
|||||||
.init = _init,
|
.init = _init,
|
||||||
.isr = _isr,
|
.isr = _isr,
|
||||||
.get = _get,
|
.get = _get,
|
||||||
.set = _set
|
.set = _set,
|
||||||
|
.confirm_send = _confirm_send,
|
||||||
};
|
};
|
||||||
|
|
||||||
void dose_setup(dose_t *ctx, const dose_params_t *params, uint8_t index)
|
void dose_setup(dose_t *ctx, const dose_params_t *params, uint8_t index)
|
||||||
|
Loading…
Reference in New Issue
Block a user