1 /*
2  * Copyright (c) 2016 Intel Corporation
3  * Copyright (c) 2023 Nordic Semiconductor ASA
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #define LOG_MODULE_NAME eth_slip_tap
9 #define LOG_LEVEL CONFIG_ETHERNET_LOG_LEVEL
10 
11 #include <zephyr/logging/log.h>
12 LOG_MODULE_REGISTER(LOG_MODULE_NAME);
13 
14 #include <zephyr/net/ethernet.h>
15 #include "../net/slip.h"
16 
17 static struct slip_context slip_context_data;
18 
eth_capabilities(const struct device * dev)19 static enum ethernet_hw_caps eth_capabilities(const struct device *dev)
20 {
21 	ARG_UNUSED(dev);
22 
23 	return ETHERNET_HW_VLAN
24 #if defined(CONFIG_NET_LLDP)
25 		| ETHERNET_LLDP
26 #endif
27 		;
28 }
29 
30 static const struct ethernet_api slip_if_api = {
31 	.iface_api.init = slip_iface_init,
32 
33 	.get_capabilities = eth_capabilities,
34 	.send = slip_send,
35 };
36 
37 #define _SLIP_L2_LAYER ETHERNET_L2
38 #define _SLIP_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(ETHERNET_L2)
39 
40 ETH_NET_DEVICE_INIT(slip, CONFIG_SLIP_DRV_NAME,
41 		    slip_init, NULL,
42 		    &slip_context_data, NULL,
43 		    CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
44 		    &slip_if_api, _SLIP_MTU);
45