12#ifndef ZEPHYR_INCLUDE_NET_ETHERNET_MGMT_H_
13#define ZEPHYR_INCLUDE_NET_ETHERNET_MGMT_H_
31#define _NET_ETHERNET_LAYER NET_MGMT_LAYER_L2
32#define _NET_ETHERNET_CODE 0x208
33#define _NET_ETHERNET_BASE (NET_MGMT_IFACE_BIT | \
34 NET_MGMT_LAYER(_NET_ETHERNET_LAYER) | \
35 NET_MGMT_LAYER_CODE(_NET_ETHERNET_CODE))
36#define _NET_ETHERNET_EVENT (_NET_ETHERNET_BASE | NET_MGMT_EVENT_BIT)
38enum net_request_ethernet_cmd {
39 NET_REQUEST_ETHERNET_CMD_SET_AUTO_NEGOTIATION = 1,
40 NET_REQUEST_ETHERNET_CMD_SET_LINK,
41 NET_REQUEST_ETHERNET_CMD_SET_DUPLEX,
42 NET_REQUEST_ETHERNET_CMD_SET_MAC_ADDRESS,
43 NET_REQUEST_ETHERNET_CMD_SET_QAV_PARAM,
44 NET_REQUEST_ETHERNET_CMD_SET_QBV_PARAM,
45 NET_REQUEST_ETHERNET_CMD_SET_QBU_PARAM,
46 NET_REQUEST_ETHERNET_CMD_SET_TXTIME_PARAM,
47 NET_REQUEST_ETHERNET_CMD_SET_PROMISC_MODE,
48 NET_REQUEST_ETHERNET_CMD_GET_PRIORITY_QUEUES_NUM,
49 NET_REQUEST_ETHERNET_CMD_GET_QAV_PARAM,
50 NET_REQUEST_ETHERNET_CMD_GET_PORTS_NUM,
51 NET_REQUEST_ETHERNET_CMD_GET_QBV_PARAM,
52 NET_REQUEST_ETHERNET_CMD_GET_QBU_PARAM,
53 NET_REQUEST_ETHERNET_CMD_GET_TXTIME_PARAM,
54 NET_REQUEST_ETHERNET_CMD_SET_T1S_PARAM,
55 NET_REQUEST_ETHERNET_CMD_SET_TXINJECTION_MODE,
56 NET_REQUEST_ETHERNET_CMD_GET_TXINJECTION_MODE,
57 NET_REQUEST_ETHERNET_CMD_SET_MAC_FILTER,
60#define NET_REQUEST_ETHERNET_SET_AUTO_NEGOTIATION \
61 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_AUTO_NEGOTIATION)
65#define NET_REQUEST_ETHERNET_SET_LINK \
66 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_LINK)
70#define NET_REQUEST_ETHERNET_SET_DUPLEX \
71 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_DUPLEX)
75#define NET_REQUEST_ETHERNET_SET_MAC_ADDRESS \
76 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_MAC_ADDRESS)
80#define NET_REQUEST_ETHERNET_SET_QAV_PARAM \
81 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_QAV_PARAM)
85#define NET_REQUEST_ETHERNET_GET_PORTS_NUM \
86 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_PORTS_NUM)
90#define NET_REQUEST_ETHERNET_SET_QBV_PARAM \
91 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_QBV_PARAM)
95#define NET_REQUEST_ETHERNET_SET_QBU_PARAM \
96 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_QBU_PARAM)
100#define NET_REQUEST_ETHERNET_SET_TXTIME_PARAM \
101 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_TXTIME_PARAM)
105#define NET_REQUEST_ETHERNET_SET_PROMISC_MODE \
106 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_PROMISC_MODE)
110#define NET_REQUEST_ETHERNET_GET_PRIORITY_QUEUES_NUM \
111 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_PRIORITY_QUEUES_NUM)
115#define NET_REQUEST_ETHERNET_GET_QAV_PARAM \
116 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_QAV_PARAM)
120#define NET_REQUEST_ETHERNET_GET_QBV_PARAM \
121 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_QBV_PARAM)
125#define NET_REQUEST_ETHERNET_GET_QBU_PARAM \
126 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_QBU_PARAM)
130#define NET_REQUEST_ETHERNET_GET_TXTIME_PARAM \
131 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_TXTIME_PARAM)
135#define NET_REQUEST_ETHERNET_SET_T1S_PARAM \
136 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_T1S_PARAM)
140#define NET_REQUEST_ETHERNET_SET_TXINJECTION_MODE \
141 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_TXINJECTION_MODE)
145#define NET_REQUEST_ETHERNET_GET_TXINJECTION_MODE \
146 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_TXINJECTION_MODE)
150#define NET_REQUEST_ETHERNET_SET_MAC_FILTER \
151 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_MAC_FILTER)
161struct ethernet_req_params {
163 bool auto_negotiation;
166 bool txinjection_mode;
184 int priority_queues_num;
189enum net_event_ethernet_cmd {
190 NET_EVENT_ETHERNET_CMD_CARRIER_ON = 1,
191 NET_EVENT_ETHERNET_CMD_CARRIER_OFF,
192 NET_EVENT_ETHERNET_CMD_VLAN_TAG_ENABLED,
193 NET_EVENT_ETHERNET_CMD_VLAN_TAG_DISABLED,
196#define NET_EVENT_ETHERNET_CARRIER_ON \
197 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_CARRIER_ON)
199#define NET_EVENT_ETHERNET_CARRIER_OFF \
200 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_CARRIER_OFF)
202#define NET_EVENT_ETHERNET_VLAN_TAG_ENABLED \
203 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_VLAN_TAG_ENABLED)
205#define NET_EVENT_ETHERNET_VLAN_TAG_DISABLED \
206 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_VLAN_TAG_DISABLED)
217#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
231#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
246#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
263#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
void ethernet_mgmt_raise_carrier_off_event(struct net_if *iface)
Raise CARRIER_OFF event when Ethernet is disconnected.
void ethernet_mgmt_raise_carrier_on_event(struct net_if *iface)
Raise CARRIER_ON event when Ethernet is connected.
void ethernet_mgmt_raise_vlan_disabled_event(struct net_if *iface, uint16_t tag)
Raise VLAN_DISABLED event when VLAN is disabled.
void ethernet_mgmt_raise_vlan_enabled_event(struct net_if *iface, uint16_t tag)
Raise VLAN_ENABLED event when VLAN is enabled.
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
Declare a request handler function for the given network event.
Definition net_mgmt.h:109
Network Management API public header.
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Ethernet filter description.
Definition ethernet.h:446
Ethernet Qav specific parameters.
Definition ethernet.h:288
Ethernet Qbu specific parameters.
Definition ethernet.h:397
Ethernet Qbv specific parameters.
Definition ethernet.h:330
Ethernet T1S specific parameters.
Definition ethernet.h:243
Ethernet TXTIME specific parameters.
Definition ethernet.h:464
Ethernet address.
Definition ethernet.h:51
Network Interface structure.
Definition net_if.h:678
static const char * tag(void)
Definition main.c:27