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

drivers/slipdev: port to netdev_new_api

This commit is contained in:
Benjamin Valentin 2024-11-12 14:56:54 +01:00
parent c636f34eac
commit 82e5b19b86
2 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,6 @@
USEMODULE += chunked_ringbuffer USEMODULE += chunked_ringbuffer
USEMODULE += eui_provider USEMODULE += eui_provider
USEMODULE += netdev_legacy_api USEMODULE += netdev_new_api
USEMODULE += netdev_register USEMODULE += netdev_register
FEATURES_REQUIRED += periph_uart FEATURES_REQUIRED += periph_uart

View File

@ -234,10 +234,6 @@ static int _send(netdev_t *netdev, const iolist_t *iolist)
slipdev_write_byte(dev->config.uart, SLIPDEV_END); slipdev_write_byte(dev->config.uart, SLIPDEV_END);
slipdev_unlock(); slipdev_unlock();
if (netdev->event_callback) {
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
}
return bytes; 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)); assert(max_len == sizeof(uint16_t));
*((uint16_t *)value) = NETDEV_TYPE_SLIP; *((uint16_t *)value) = NETDEV_TYPE_SLIP;
return sizeof(uint16_t); 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) #if IS_USED(MODULE_SLIPDEV_L2ADDR)
case NETOPT_ADDRESS_LONG: case NETOPT_ADDRESS_LONG:
assert(max_len == sizeof(eui64_t)); 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 = { static const netdev_driver_t slip_driver = {
.send = _send, .send = _send,
.recv = _recv, .recv = _recv,
.init = _init, .init = _init,
.isr = _isr, .isr = _isr,
.get = _get, .get = _get,
.confirm_send = _confirm_send,
#if IS_USED(MODULE_SLIPDEV_STDIO) #if IS_USED(MODULE_SLIPDEV_STDIO)
.set = netdev_set_notsup, .set = netdev_set_notsup,
#else #else