13#ifndef ZEPHYR_INCLUDE_NET_ETHERNET_H_
14#define ZEPHYR_INCLUDE_NET_ETHERNET_H_
29#if defined(CONFIG_NET_DSA)
33#if defined(CONFIG_NET_ETHERNET_BRIDGE)
50#define NET_ETH_ADDR_LEN 6U
59#define NET_ETH_HDR(pkt) ((struct net_eth_hdr *)net_pkt_data(pkt))
62#define NET_ETH_PTYPE_ALL 0x0003
63#define NET_ETH_PTYPE_ARP 0x0806
64#define NET_ETH_PTYPE_CAN 0x000C
65#define NET_ETH_PTYPE_CANFD 0x000D
66#define NET_ETH_PTYPE_EAPOL 0x888e
67#define NET_ETH_PTYPE_ECAT 0x88a4
68#define NET_ETH_PTYPE_HDLC 0x0019
69#define NET_ETH_PTYPE_IEEE802154 0x00F6
70#define NET_ETH_PTYPE_IP 0x0800
71#define NET_ETH_PTYPE_IPV6 0x86dd
72#define NET_ETH_PTYPE_LLDP 0x88cc
73#define NET_ETH_PTYPE_PTP 0x88f7
74#define NET_ETH_PTYPE_TSN 0x22f0
75#define NET_ETH_PTYPE_VLAN 0x8100
79#if !defined(ETH_P_8021Q)
80#define ETH_P_8021Q NET_ETH_PTYPE_VLAN
82#if !defined(ETH_P_ALL)
83#define ETH_P_ALL NET_ETH_PTYPE_ALL
85#if !defined(ETH_P_ARP)
86#define ETH_P_ARP NET_ETH_PTYPE_ARP
88#if !defined(ETH_P_CAN)
89#define ETH_P_CAN NET_ETH_PTYPE_CAN
91#if !defined(ETH_P_CANFD)
92#define ETH_P_CANFD NET_ETH_PTYPE_CANFD
94#if !defined(ETH_P_EAPOL)
95#define ETH_P_EAPOL NET_ETH_PTYPE_EAPOL
97#if !defined(ETH_P_ECAT)
98#define ETH_P_ECAT NET_ETH_PTYPE_ECAT
100#if !defined(ETH_P_HDLC)
101#define ETH_P_HDLC NET_ETH_PTYPE_HDLC
103#if !defined(ETH_P_IEEE802154)
104#define ETH_P_IEEE802154 NET_ETH_PTYPE_IEEE802154
106#if !defined(ETH_P_IP)
107#define ETH_P_IP NET_ETH_PTYPE_IP
109#if !defined(ETH_P_IPV6)
110#define ETH_P_IPV6 NET_ETH_PTYPE_IPV6
112#if !defined(ETH_P_TSN)
113#define ETH_P_TSN NET_ETH_PTYPE_TSN
119#define NET_ETH_MINIMAL_FRAME_SIZE 60
120#define NET_ETH_MTU 1500
124#if defined(CONFIG_NET_VLAN)
125#define _NET_ETH_MAX_HDR_SIZE (sizeof(struct net_eth_vlan_hdr))
127#define _NET_ETH_MAX_HDR_SIZE (sizeof(struct net_eth_hdr))
130#define _NET_ETH_MAX_FRAME_SIZE (NET_ETH_MTU + _NET_ETH_MAX_HDR_SIZE)
135#if defined(CONFIG_NET_DSA)
136#define NET_ETH_MAX_FRAME_SIZE (_NET_ETH_MAX_FRAME_SIZE + DSA_TAG_SIZE)
137#define NET_ETH_MAX_HDR_SIZE (_NET_ETH_MAX_HDR_SIZE + DSA_TAG_SIZE)
139#define NET_ETH_MAX_FRAME_SIZE (_NET_ETH_MAX_FRAME_SIZE)
140#define NET_ETH_MAX_HDR_SIZE (_NET_ETH_MAX_HDR_SIZE)
143#define NET_ETH_VLAN_HDR_SIZE 4
221enum ethernet_config_type {
222 ETHERNET_CONFIG_TYPE_AUTO_NEG,
223 ETHERNET_CONFIG_TYPE_LINK,
224 ETHERNET_CONFIG_TYPE_DUPLEX,
225 ETHERNET_CONFIG_TYPE_MAC_ADDRESS,
226 ETHERNET_CONFIG_TYPE_QAV_PARAM,
227 ETHERNET_CONFIG_TYPE_QBV_PARAM,
228 ETHERNET_CONFIG_TYPE_QBU_PARAM,
229 ETHERNET_CONFIG_TYPE_TXTIME_PARAM,
230 ETHERNET_CONFIG_TYPE_PROMISC_MODE,
231 ETHERNET_CONFIG_TYPE_PRIORITY_QUEUES_NUM,
232 ETHERNET_CONFIG_TYPE_FILTER,
233 ETHERNET_CONFIG_TYPE_PORTS_NUM,
234 ETHERNET_CONFIG_TYPE_T1S_PARAM,
235 ETHERNET_CONFIG_TYPE_TXINJECTION_MODE,
236 ETHERNET_CONFIG_TYPE_RX_CHECKSUM_SUPPORT,
237 ETHERNET_CONFIG_TYPE_TX_CHECKSUM_SUPPORT
240enum ethernet_qav_param_type {
241 ETHERNET_QAV_PARAM_TYPE_DELTA_BANDWIDTH,
242 ETHERNET_QAV_PARAM_TYPE_IDLE_SLOPE,
243 ETHERNET_QAV_PARAM_TYPE_OPER_IDLE_SLOPE,
244 ETHERNET_QAV_PARAM_TYPE_TRAFFIC_CLASS,
245 ETHERNET_QAV_PARAM_TYPE_STATUS,
248enum ethernet_t1s_param_type {
249 ETHERNET_T1S_PARAM_TYPE_PLCA_CONFIG,
257 enum ethernet_t1s_param_type
type;
304 enum ethernet_qav_param_type
type;
321enum ethernet_qbv_param_type {
322 ETHERNET_QBV_PARAM_TYPE_STATUS,
323 ETHERNET_QBV_PARAM_TYPE_GATE_CONTROL_LIST,
324 ETHERNET_QBV_PARAM_TYPE_GATE_CONTROL_LIST_LEN,
325 ETHERNET_QBV_PARAM_TYPE_TIME,
328enum ethernet_qbv_state_type {
329 ETHERNET_QBV_STATE_TYPE_ADMIN,
330 ETHERNET_QBV_STATE_TYPE_OPER,
333enum ethernet_gate_state_operation {
334 ETHERNET_SET_GATE_STATE,
335 ETHERNET_SET_AND_HOLD_MAC_STATE,
336 ETHERNET_SET_AND_RELEASE_MAC_STATE,
346 enum ethernet_qbv_param_type
type;
390enum ethernet_qbu_param_type {
391 ETHERNET_QBU_PARAM_TYPE_STATUS,
392 ETHERNET_QBU_PARAM_TYPE_RELEASE_ADVANCE,
393 ETHERNET_QBU_PARAM_TYPE_HOLD_ADVANCE,
394 ETHERNET_QBU_PARAM_TYPE_PREEMPTION_STATUS_TABLE,
397 ETHERNET_QBR_PARAM_TYPE_LINK_PARTNER_STATUS,
398 ETHERNET_QBR_PARAM_TYPE_ADDITIONAL_FRAGMENT_SIZE,
401enum ethernet_qbu_preempt_status {
402 ETHERNET_QBU_STATUS_EXPRESS,
403 ETHERNET_QBU_STATUS_PREEMPTABLE
413 enum ethernet_qbu_param_type
type;
422 enum ethernet_qbu_preempt_status
441enum ethernet_filter_type {
442 ETHERNET_FILTER_TYPE_SRC_MAC_ADDRESS,
443 ETHERNET_FILTER_TYPE_DST_MAC_ADDRESS,
460 enum ethernet_filter_type
type;
469enum ethernet_txtime_param_type {
470 ETHERNET_TXTIME_PARAM_TYPE_ENABLE_QUEUES,
478 enum ethernet_txtime_param_type
type;
505struct ethernet_config {
507 bool auto_negotiation;
510 bool txinjection_mode;
526 int priority_queues_num;
549#if defined(CONFIG_NET_STATISTICS_ETHERNET)
564 enum ethernet_config_type type,
565 const struct ethernet_config *config);
569 enum ethernet_config_type type,
570 struct ethernet_config *config);
577#if defined(CONFIG_NET_VLAN)
578 int (*vlan_setup)(
const struct device *dev,
struct net_if *iface,
583#if defined(CONFIG_PTP_CLOCK)
584 const struct device *(*get_ptp_clock)(
const struct device *dev);
588 const struct device *(*get_phy)(
const struct device *dev);
599BUILD_ASSERT(offsetof(
struct ethernet_api, iface_api) == 0);
607struct ethernet_vlan {
615#if defined(CONFIG_NET_VLAN_COUNT)
616#define NET_VLAN_MAX_COUNT CONFIG_NET_VLAN_COUNT
620#define NET_VLAN_MAX_COUNT 1
659struct ethernet_context {
665#if defined(CONFIG_NET_ETHERNET_BRIDGE)
675 struct k_work carrier_work;
680#if defined(CONFIG_NET_LLDP)
689#if defined(CONFIG_NET_L2_PTP)
697#if defined(CONFIG_NET_DSA)
707 struct dsa_context *dsa_ctx;
714 bool is_net_carrier_up : 1;
728void ethernet_init(
struct net_if *iface);
730#define ETHERNET_L2_CTX_TYPE struct ethernet_context
735struct net_eth_vlan_hdr {
756 if (addr->
addr[0] == 0xff &&
757 addr->
addr[1] == 0xff &&
758 addr->
addr[2] == 0xff &&
759 addr->
addr[3] == 0xff &&
760 addr->
addr[4] == 0xff &&
761 addr->
addr[5] == 0xff) {
777 if (addr->
addr[0] == 0x00 &&
778 addr->
addr[1] == 0x00 &&
779 addr->
addr[2] == 0x00 &&
780 addr->
addr[3] == 0x00 &&
781 addr->
addr[4] == 0x00 &&
782 addr->
addr[5] == 0x00) {
798 if (addr->
addr[0] == 0x00 &&
799 addr->
addr[1] == 0x00 &&
800 addr->
addr[2] == 0x00 &&
801 addr->
addr[3] == 0x00 &&
802 addr->
addr[4] == 0x00 &&
803 addr->
addr[5] == 0x00) {
819#if defined(CONFIG_NET_IPV6)
820 if (addr->
addr[0] == 0x33 &&
821 addr->
addr[1] == 0x33) {
826#if defined(CONFIG_NET_IPV4)
827 if (addr->
addr[0] == 0x01 &&
828 addr->
addr[1] == 0x00 &&
829 addr->
addr[2] == 0x5e) {
846 return addr->
addr[0] & 0x01;
870#if defined(CONFIG_NET_GPTP) || defined(CONFIG_NET_LLDP)
871 if (addr->
addr[0] == 0x01 &&
872 addr->
addr[1] == 0x80 &&
873 addr->
addr[2] == 0xc2 &&
874 addr->
addr[3] == 0x00 &&
875 addr->
addr[4] == 0x00 &&
876 addr->
addr[5] == 0x0e) {
895#if defined(CONFIG_NET_GPTP)
896 if (addr->
addr[0] == 0x01 &&
897 addr->
addr[1] == 0x1b &&
898 addr->
addr[2] == 0x19 &&
899 addr->
addr[3] == 0x00 &&
900 addr->
addr[4] == 0x00 &&
901 addr->
addr[5] == 0x00) {
967 struct ethernet_config *config)
988#if defined(CONFIG_NET_VLAN)
1008#if defined(CONFIG_NET_VLAN)
1031#if defined(CONFIG_NET_VLAN)
1051#if defined(CONFIG_NET_VLAN)
1073#if defined(CONFIG_NET_VLAN)
1098#if defined(CONFIG_NET_VLAN)
1119#if defined(CONFIG_NET_VLAN)
1137#if defined(CONFIG_NET_VLAN)
1150#if !defined(CONFIG_ETH_DRIVER_RAW_MODE)
1152#define Z_ETH_NET_DEVICE_INIT_INSTANCE(node_id, dev_id, name, instance, \
1153 init_fn, pm, data, config, prio, \
1155 Z_NET_DEVICE_INIT_INSTANCE(node_id, dev_id, name, instance, \
1156 init_fn, pm, data, config, prio, \
1158 NET_L2_GET_CTX_TYPE(ETHERNET_L2), mtu)
1162#define Z_ETH_NET_DEVICE_INIT_INSTANCE(node_id, dev_id, name, instance, \
1163 init_fn, pm, data, config, prio, \
1165 Z_DEVICE_STATE_DEFINE(dev_id); \
1166 Z_DEVICE_DEFINE(node_id, dev_id, name, init_fn, pm, data, \
1167 config, POST_KERNEL, prio, api, \
1168 &Z_DEVICE_STATE_NAME(dev_id));
1172#define Z_ETH_NET_DEVICE_INIT(node_id, dev_id, name, init_fn, pm, data, \
1173 config, prio, api, mtu) \
1174 Z_ETH_NET_DEVICE_INIT_INSTANCE(node_id, dev_id, name, 0, \
1175 init_fn, pm, data, config, prio, \
1197#define ETH_NET_DEVICE_INIT(dev_id, name, init_fn, pm, data, config, \
1199 Z_ETH_NET_DEVICE_INIT(DT_INVALID_NODE, dev_id, name, init_fn, \
1200 pm, data, config, prio, api, mtu)
1224#define ETH_NET_DEVICE_INIT_INSTANCE(dev_id, name, instance, init_fn, \
1225 pm, data, config, prio, api, mtu) \
1226 Z_ETH_NET_DEVICE_INIT_INSTANCE(DT_INVALID_NODE, dev_id, name, \
1227 instance, init_fn, pm, data, \
1228 config, prio, api, mtu)
1246#define ETH_NET_DEVICE_DT_DEFINE(node_id, init_fn, pm, data, config, \
1248 Z_ETH_NET_DEVICE_INIT(node_id, Z_DEVICE_DT_DEV_ID(node_id), \
1249 DEVICE_DT_NAME(node_id), init_fn, pm, \
1250 data, config, prio, api, mtu)
1261#define ETH_NET_DEVICE_DT_INST_DEFINE(inst, ...) \
1262 ETH_NET_DEVICE_DT_DEFINE(DT_DRV_INST(inst), __VA_ARGS__)
1313 enum ethernet_filter_type type,
bool enable);
1332#if defined(CONFIG_PTP_CLOCK)
1361#if defined(CONFIG_NET_L2_PTP)
1378#if defined(CONFIG_NET_L2_PTP)
1397 const struct ethernet_context *ctx = (
struct ethernet_context *)
1411#include <zephyr/syscalls/ethernet.h>
long atomic_t
Definition atomic_types.h:15
DSA definitions and handlers.
Ethernet Bridge public header file.
VLAN specific definitions.
enum net_verdict(* dsa_net_recv_cb_t)(struct net_if *iface, struct net_pkt *pkt)
DSA (MGMT) Receive packet callback.
Definition dsa.h:74
int(* dsa_send_t)(const struct device *dev, struct net_pkt *pkt)
Pointer to master interface send function.
Definition dsa.h:100
static struct net_if * net_eth_get_vlan_main(struct net_if *iface)
Return main network interface that is attached to this VLAN tag.
Definition ethernet.h:1077
static int net_eth_get_hw_config(struct net_if *iface, enum ethernet_config_type type, struct ethernet_config *config)
Return ethernet device hardware configuration information.
Definition ethernet.h:966
ethernet_if_types
Types of Ethernet L2.
Definition ethernet.h:449
static void net_eth_set_ptp_port(struct net_if *iface, int port)
Set PTP port number attached to this interface.
Definition ethernet.h:1381
static int net_eth_vlan_enable(struct net_if *iface, uint16_t tag)
Add VLAN tag to the interface.
Definition ethernet.h:991
static bool net_eth_is_addr_all_zeroes(struct net_eth_addr *addr)
Check if the Ethernet MAC address is a all zeroes address.
Definition ethernet.h:775
static bool net_eth_is_addr_multicast(struct net_eth_addr *addr)
Check if the Ethernet MAC address is a multicast address.
Definition ethernet.h:817
static int net_eth_get_ptp_port(struct net_if *iface)
Return PTP port number attached to this interface.
Definition ethernet.h:1364
static const struct device * net_eth_get_ptp_clock(struct net_if *iface)
Return PTP clock that is tied to this ethernet network interface.
Definition ethernet.h:1335
#define NET_ETH_ADDR_LEN
Ethernet MAC address length.
Definition ethernet.h:50
int net_eth_promisc_mode(struct net_if *iface, bool enable)
Set promiscuous mode either ON or OFF.
void net_eth_carrier_off(struct net_if *iface)
Inform ethernet L2 driver that ethernet carrier was lost.
static uint16_t net_eth_get_vlan_tag(struct net_if *iface)
Return VLAN tag specified to network interface.
Definition ethernet.h:1034
static bool net_eth_type_is_wifi(struct net_if *iface)
Check if the Ethernet L2 network interface can perform Wi-Fi.
Definition ethernet.h:1395
const struct device * net_eth_get_phy(struct net_if *iface)
Return the PHY device that is tied to this ethernet network interface.
static bool net_eth_is_addr_broadcast(struct net_eth_addr *addr)
Check if the Ethernet MAC address is a broadcast address.
Definition ethernet.h:754
static bool net_eth_get_vlan_status(struct net_if *iface)
Get VLAN status for a given network interface (enabled or not).
Definition ethernet.h:1122
static bool net_eth_is_addr_group(struct net_eth_addr *addr)
Check if the Ethernet MAC address is a group address.
Definition ethernet.h:844
const struct device * net_eth_get_ptp_clock_by_index(int index)
Return PTP clock that is tied to this ethernet network interface index.
static bool net_eth_is_addr_unspecified(struct net_eth_addr *addr)
Check if the Ethernet MAC address is unspecified.
Definition ethernet.h:796
static bool net_eth_is_vlan_interface(struct net_if *iface)
Check if the given interface is a VLAN interface.
Definition ethernet.h:1140
ethernet_hw_caps
Ethernet hardware capabilities.
Definition ethernet.h:148
int net_eth_mac_filter(struct net_if *iface, struct net_eth_addr *mac, enum ethernet_filter_type type, bool enable)
Set or unset HW filtering for MAC address mac.
void net_eth_ipv6_mcast_to_mac_addr(const struct in6_addr *ipv6_addr, struct net_eth_addr *mac_addr)
Convert IPv6 multicast address to Ethernet address.
static enum ethernet_hw_caps net_eth_get_hw_capabilities(struct net_if *iface)
Return ethernet device hardware capability information.
Definition ethernet.h:944
static int net_eth_vlan_disable(struct net_if *iface, uint16_t tag)
Remove VLAN tag from the interface.
Definition ethernet.h:1011
void net_eth_carrier_on(struct net_if *iface)
Inform ethernet L2 driver that ethernet carrier is detected.
ethernet_checksum_support
Protocols that are supported by checksum offloading.
Definition ethernet.h:486
static bool net_eth_is_vlan_enabled(struct ethernet_context *ctx, struct net_if *iface)
Check if there are any VLAN interfaces enabled to this specific Ethernet network interface.
Definition ethernet.h:1102
static struct net_if * net_eth_get_vlan_iface(struct net_if *iface, uint16_t tag)
Return network interface related to this VLAN tag.
Definition ethernet.h:1055
void net_eth_ipv4_mcast_to_mac_addr(const struct in_addr *ipv4_addr, struct net_eth_addr *mac_addr)
Convert IPv4 multicast address to Ethernet address.
const struct net_eth_addr * net_eth_broadcast_addr(void)
Return Ethernet broadcast address.
static bool net_eth_is_addr_lldp_multicast(struct net_eth_addr *addr)
Check if the Ethernet MAC address is a LLDP multicast address.
Definition ethernet.h:868
static bool net_eth_is_addr_ptp_multicast(struct net_eth_addr *addr)
Check if the Ethernet MAC address is a PTP multicast address.
Definition ethernet.h:893
static bool net_eth_is_addr_valid(struct net_eth_addr *addr)
Check if the Ethernet MAC address is valid.
Definition ethernet.h:856
int net_eth_txinjection_mode(struct net_if *iface, bool enable)
Set TX-Injection mode either ON or OFF.
@ L2_ETH_IF_TYPE_ETHERNET
IEEE 802.3 Ethernet (default)
Definition ethernet.h:451
@ L2_ETH_IF_TYPE_WIFI
IEEE 802.11 Wi-Fi.
Definition ethernet.h:454
@ ETHERNET_HW_VLAN
VLAN supported.
Definition ethernet.h:156
@ ETHERNET_PRIORITY_QUEUES
Priority queues available.
Definition ethernet.h:183
@ ETHERNET_DUPLEX_SET
Changing duplex (half/full) supported.
Definition ethernet.h:171
@ ETHERNET_HW_VLAN_TAG_STRIP
VLAN Tag stripping.
Definition ethernet.h:192
@ ETHERNET_LINK_10BASE_T
10 Mbits link supported
Definition ethernet.h:162
@ ETHERNET_HW_FILTERING
MAC address filtering supported.
Definition ethernet.h:186
@ ETHERNET_PTP
IEEE 802.1AS (gPTP) clock supported.
Definition ethernet.h:174
@ ETHERNET_LINK_2500BASE_T
2.5 Gbits link supported
Definition ethernet.h:213
@ ETHERNET_QBU
IEEE 802.1Qbu (frame preemption) supported.
Definition ethernet.h:204
@ ETHERNET_LINK_100BASE_T
100 Mbits link supported
Definition ethernet.h:165
@ ETHERNET_DSA_MASTER_PORT
DSA switch master port.
Definition ethernet.h:198
@ ETHERNET_DSA_SLAVE_PORT
DSA switch slave port.
Definition ethernet.h:195
@ ETHERNET_TXINJECTION_MODE
TX-Injection supported.
Definition ethernet.h:210
@ ETHERNET_QAV
IEEE 802.1Qav (credit-based shaping) supported.
Definition ethernet.h:177
@ ETHERNET_HW_RX_CHKSUM_OFFLOAD
RX Checksum offloading supported for all of IPv4, UDP, TCP.
Definition ethernet.h:153
@ ETHERNET_LINK_1000BASE_T
1 Gbits link supported
Definition ethernet.h:168
@ ETHERNET_LLDP
Link Layer Discovery Protocol supported.
Definition ethernet.h:189
@ ETHERNET_AUTO_NEGOTIATION_SET
Enabling/disabling auto negotiation supported.
Definition ethernet.h:159
@ ETHERNET_LINK_5000BASE_T
5 Gbits link supported
Definition ethernet.h:216
@ ETHERNET_TXTIME
TXTIME supported.
Definition ethernet.h:207
@ ETHERNET_QBV
IEEE 802.1Qbv (scheduled traffic) supported.
Definition ethernet.h:201
@ ETHERNET_PROMISC_MODE
Promiscuous mode supported.
Definition ethernet.h:180
@ ETHERNET_HW_TX_CHKSUM_OFFLOAD
TX Checksum offloading supported for all of IPv4, UDP, TCP.
Definition ethernet.h:150
@ ETHERNET_CHECKSUM_SUPPORT_UDP
Device supports UDP checksum offloading for all supported IP protocols.
Definition ethernet.h:500
@ ETHERNET_CHECKSUM_SUPPORT_TCP
Device supports TCP checksum offloading for all supported IP protocols.
Definition ethernet.h:498
@ ETHERNET_CHECKSUM_SUPPORT_IPV6_HEADER
Device supports checksum offloading for the IPv6 header.
Definition ethernet.h:494
@ ETHERNET_CHECKSUM_SUPPORT_IPV4_ICMP
Device supports checksum offloading for ICMPv4 payload (implies IPv4 header)
Definition ethernet.h:492
@ ETHERNET_CHECKSUM_SUPPORT_IPV4_HEADER
Device supports checksum offloading for the IPv4 header.
Definition ethernet.h:490
@ ETHERNET_CHECKSUM_SUPPORT_NONE
Device does not support any L3/L4 checksum offloading.
Definition ethernet.h:488
@ ETHERNET_CHECKSUM_SUPPORT_IPV6_ICMP
Device supports checksum offloading for ICMPv6 payload (implies IPv6 header)
Definition ethernet.h:496
enum net_verdict(* net_lldp_recv_cb_t)(struct net_if *iface, struct net_pkt *pkt)
LLDP Receive packet callback.
Definition lldp.h:215
static void * net_if_l2_data(struct net_if *iface)
Get a pointer to the interface L2 private data.
Definition net_if.h:948
static const struct device * net_if_get_device(struct net_if *iface)
Get an network interface's device.
Definition net_if.h:964
net_l2_flags
L2 flags.
Definition net_l2.h:37
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define EINVAL
Invalid argument.
Definition errno.h:60
#define ENOTSUP
Unsupported value.
Definition errno.h:114
#define ENODEV
No such device.
Definition errno.h:57
#define NET_VLAN_TAG_UNSPEC
Unspecified VLAN tag value.
Definition ethernet_vlan.h:32
LLDP definitions and handler.
Public API for network interface.
IPv6 and IPv4 definitions.
Network packet buffer descriptor API.
flags
Definition parser.h:97
Public functions for the Precision Time Protocol time specification.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
__INT64_TYPE__ int64_t
Definition stdint.h:75
Runtime device structure (in ROM) per driver instance.
Definition device.h:411
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:417
Ethernet L2 API operations.
Definition ethernet.h:538
struct net_if_api iface_api
The net_if_api must be placed in first position in this struct so that we are compatible with network...
Definition ethernet.h:543
int(* start)(const struct device *dev)
Collect optional ethernet specific statistics.
Definition ethernet.h:554
int(* get_config)(const struct device *dev, enum ethernet_config_type type, struct ethernet_config *config)
Get hardware specific configuration.
Definition ethernet.h:568
int(* stop)(const struct device *dev)
Stop the device.
Definition ethernet.h:557
enum ethernet_hw_caps(* get_capabilities)(const struct device *dev)
Get the device capabilities.
Definition ethernet.h:560
int(* send)(const struct device *dev, struct net_pkt *pkt)
Send a network packet.
Definition ethernet.h:591
int(* set_config)(const struct device *dev, enum ethernet_config_type type, const struct ethernet_config *config)
Set specific hardware configuration.
Definition ethernet.h:563
Ethernet filter description.
Definition ethernet.h:458
struct net_eth_addr mac_address
MAC address to filter.
Definition ethernet.h:462
bool set
Set (true) or unset (false) the filter.
Definition ethernet.h:464
enum ethernet_filter_type type
Type of filter.
Definition ethernet.h:460
Ethernet LLDP specific parameters.
Definition ethernet.h:626
const uint8_t * optional_du
LLDP Data Unit optional TLVs for the interface.
Definition ethernet.h:634
sys_snode_t node
Used for track timers.
Definition ethernet.h:628
net_lldp_recv_cb_t cb
LLDP RX callback function.
Definition ethernet.h:649
size_t optional_len
Length of the optional Data Unit TLVs.
Definition ethernet.h:637
struct net_if * iface
Network interface that has LLDP supported.
Definition ethernet.h:640
const struct net_lldpdu * lldpdu
LLDP Data Unit mandatory TLVs for the interface.
Definition ethernet.h:631
uint32_t tx_timer_timeout
LLDP TX timeout.
Definition ethernet.h:646
int64_t tx_timer_start
LLDP TX timer start time.
Definition ethernet.h:643
Ethernet Qav specific parameters.
Definition ethernet.h:300
bool enabled
True if Qav is enabled for queue.
Definition ethernet.h:307
unsigned int oper_idle_slope
Oper Idle Slope (bits per second)
Definition ethernet.h:313
enum ethernet_qav_param_type type
Type of Qav parameter.
Definition ethernet.h:304
unsigned int traffic_class
Traffic class the queue is bound to.
Definition ethernet.h:315
int queue_id
ID of the priority queue to use.
Definition ethernet.h:302
unsigned int idle_slope
Idle Slope (bits per second)
Definition ethernet.h:311
unsigned int delta_bandwidth
Delta Bandwidth (percentage of bandwidth)
Definition ethernet.h:309
Ethernet Qbu specific parameters.
Definition ethernet.h:409
enum ethernet_qbu_preempt_status frame_preempt_statuses[NET_TC_TX_COUNT]
sequence of framePreemptionAdminStatus values
Definition ethernet.h:422
uint32_t release_advance
Release advance (nanoseconds)
Definition ethernet.h:419
enum ethernet_qbu_param_type type
Type of Qbu parameter.
Definition ethernet.h:413
uint32_t hold_advance
Hold advance (nanoseconds)
Definition ethernet.h:416
bool enabled
True if Qbu is enabled or not.
Definition ethernet.h:426
bool link_partner_status
Link partner status (from Qbr)
Definition ethernet.h:429
int port_id
Port id.
Definition ethernet.h:411
uint8_t additional_fragment_size
Additional fragment size (from Qbr).
Definition ethernet.h:435
Ethernet Qbv specific parameters.
Definition ethernet.h:342
int port_id
Port id.
Definition ethernet.h:344
bool enabled
True if Qbv is enabled or not.
Definition ethernet.h:351
enum ethernet_qbv_param_type type
Type of Qbv parameter.
Definition ethernet.h:346
uint16_t row
Gate control list row.
Definition ethernet.h:365
enum ethernet_qbv_state_type state
What state (Admin/Oper) parameters are these.
Definition ethernet.h:348
bool gate_status[NET_TC_TX_COUNT]
True = open, False = closed.
Definition ethernet.h:356
struct net_ptp_extended_time base_time
Base time.
Definition ethernet.h:377
uint32_t extension_time
Extension time (nanoseconds)
Definition ethernet.h:383
enum ethernet_gate_state_operation operation
GateState operation.
Definition ethernet.h:359
uint32_t time_interval
Time interval ticks (nanoseconds)
Definition ethernet.h:362
struct net_ptp_time cycle_time
Cycle time.
Definition ethernet.h:380
uint32_t gate_control_list_len
Number of entries in gate control list.
Definition ethernet.h:369
struct ethernet_qbv_param::@352::@354 gate_control
Gate control information.
Ethernet T1S specific parameters.
Definition ethernet.h:255
uint8_t burst_count
T1S PLCA burst count range: 0x0 to 0xFF.
Definition ethernet.h:290
uint8_t node_count
T1S PLCA node count range: 1 to 255.
Definition ethernet.h:288
uint8_t to_timer
T1S PLCA TO value.
Definition ethernet.h:294
uint8_t burst_timer
T1S PLCA burst timer.
Definition ethernet.h:292
uint8_t node_id
T1S PLCA node id range: 0 to 254.
Definition ethernet.h:286
enum ethernet_t1s_param_type type
Type of T1S parameter.
Definition ethernet.h:257
struct ethernet_t1s_param::@347::@349 plca
PLCA is the Physical Layer (PHY) Collision Avoidance technique employed with multidrop 10Base-T1S sta...
bool enable
T1S PLCA enabled.
Definition ethernet.h:284
Ethernet TXTIME specific parameters.
Definition ethernet.h:476
bool enable_txtime
Enable or disable TXTIME per queue.
Definition ethernet.h:482
int queue_id
Queue number for configuring TXTIME.
Definition ethernet.h:480
enum ethernet_txtime_param_type type
Type of TXTIME parameter.
Definition ethernet.h:478
IPv6 address struct.
Definition net_ip.h:143
IPv4 address struct.
Definition net_ip.h:155
A structure used to submit work.
Definition kernel.h:4006
Ethernet address.
Definition ethernet.h:53
uint8_t addr[6U]
Buffer storing the address.
Definition ethernet.h:54
Network Interface structure.
Definition net_if.h:692
LLDP Data Unit (LLDPDU) shall contain the following ordered TLVs as stated in "8.2 LLDPDU format" fro...
Definition lldp.h:169
Network packet.
Definition net_pkt.h:91
Generalized Precision Time Protocol Extended Timestamp format.
Definition ptp_time.h:154
(Generalized) Precision Time Protocol Timestamp format.
Definition ptp_time.h:111
All Ethernet specific statistics.
Definition net_stats.h:589