mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 00:09:46 +01:00
drivers/slipdev: port to netdev_new_api
This commit is contained in:
parent
c636f34eac
commit
82e5b19b86
@ -1,6 +1,6 @@
|
||||
USEMODULE += chunked_ringbuffer
|
||||
USEMODULE += eui_provider
|
||||
USEMODULE += netdev_legacy_api
|
||||
USEMODULE += netdev_new_api
|
||||
USEMODULE += netdev_register
|
||||
FEATURES_REQUIRED += periph_uart
|
||||
|
||||
|
@ -234,10 +234,6 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
|
||||
slipdev_write_byte(dev->config.uart, SLIPDEV_END);
|
||||
slipdev_unlock();
|
||||
|
||||
if (netdev->event_callback) {
|
||||
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
@ -327,9 +323,6 @@ static int _get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
|
||||
assert(max_len == sizeof(uint16_t));
|
||||
*((uint16_t *)value) = NETDEV_TYPE_SLIP;
|
||||
return sizeof(uint16_t);
|
||||
case NETOPT_TX_END_IRQ:
|
||||
*((netopt_enable_t *)value) = NETOPT_ENABLE;
|
||||
return sizeof(netopt_enable_t);
|
||||
#if IS_USED(MODULE_SLIPDEV_L2ADDR)
|
||||
case NETOPT_ADDRESS_LONG:
|
||||
assert(max_len == sizeof(eui64_t));
|
||||
@ -341,12 +334,20 @@ static int _get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
|
||||
}
|
||||
}
|
||||
|
||||
static int _confirm_send(netdev_t *netdev, void *info)
|
||||
{
|
||||
(void)netdev;
|
||||
(void)info;
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static const netdev_driver_t slip_driver = {
|
||||
.send = _send,
|
||||
.recv = _recv,
|
||||
.init = _init,
|
||||
.isr = _isr,
|
||||
.get = _get,
|
||||
.confirm_send = _confirm_send,
|
||||
#if IS_USED(MODULE_SLIPDEV_STDIO)
|
||||
.set = netdev_set_notsup,
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user