12#ifndef ZEPHYR_INCLUDE_NET_ETHERNET_MGMT_H_
13#define ZEPHYR_INCLUDE_NET_ETHERNET_MGMT_H_
33#define _NET_ETHERNET_LAYER NET_MGMT_LAYER_L2
34#define _NET_ETHERNET_CODE 0x208
35#define _NET_ETHERNET_BASE (NET_MGMT_IFACE_BIT | \
36 NET_MGMT_LAYER(_NET_ETHERNET_LAYER) | \
37 NET_MGMT_LAYER_CODE(_NET_ETHERNET_CODE))
38#define _NET_ETHERNET_EVENT (_NET_ETHERNET_BASE | NET_MGMT_EVENT_BIT)
40enum net_request_ethernet_cmd {
41 NET_REQUEST_ETHERNET_CMD_SET_AUTO_NEGOTIATION = 1,
42 NET_REQUEST_ETHERNET_CMD_SET_LINK,
43 NET_REQUEST_ETHERNET_CMD_SET_DUPLEX,
44 NET_REQUEST_ETHERNET_CMD_SET_MAC_ADDRESS,
45 NET_REQUEST_ETHERNET_CMD_SET_QAV_PARAM,
46 NET_REQUEST_ETHERNET_CMD_SET_QBV_PARAM,
47 NET_REQUEST_ETHERNET_CMD_SET_QBU_PARAM,
48 NET_REQUEST_ETHERNET_CMD_SET_TXTIME_PARAM,
49 NET_REQUEST_ETHERNET_CMD_SET_PROMISC_MODE,
50 NET_REQUEST_ETHERNET_CMD_GET_PRIORITY_QUEUES_NUM,
51 NET_REQUEST_ETHERNET_CMD_GET_QAV_PARAM,
52 NET_REQUEST_ETHERNET_CMD_GET_PORTS_NUM,
53 NET_REQUEST_ETHERNET_CMD_GET_QBV_PARAM,
54 NET_REQUEST_ETHERNET_CMD_GET_QBU_PARAM,
55 NET_REQUEST_ETHERNET_CMD_GET_TXTIME_PARAM,
56 NET_REQUEST_ETHERNET_CMD_SET_T1S_PARAM,
57 NET_REQUEST_ETHERNET_CMD_SET_TXINJECTION_MODE,
58 NET_REQUEST_ETHERNET_CMD_GET_TXINJECTION_MODE,
59 NET_REQUEST_ETHERNET_CMD_SET_MAC_FILTER,
62#define NET_REQUEST_ETHERNET_SET_AUTO_NEGOTIATION \
63 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_AUTO_NEGOTIATION)
67#define NET_REQUEST_ETHERNET_SET_LINK \
68 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_LINK)
72#define NET_REQUEST_ETHERNET_SET_DUPLEX \
73 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_DUPLEX)
77#define NET_REQUEST_ETHERNET_SET_MAC_ADDRESS \
78 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_MAC_ADDRESS)
82#define NET_REQUEST_ETHERNET_SET_QAV_PARAM \
83 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_QAV_PARAM)
87#define NET_REQUEST_ETHERNET_GET_PORTS_NUM \
88 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_PORTS_NUM)
92#define NET_REQUEST_ETHERNET_SET_QBV_PARAM \
93 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_QBV_PARAM)
97#define NET_REQUEST_ETHERNET_SET_QBU_PARAM \
98 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_QBU_PARAM)
102#define NET_REQUEST_ETHERNET_SET_TXTIME_PARAM \
103 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_TXTIME_PARAM)
107#define NET_REQUEST_ETHERNET_SET_PROMISC_MODE \
108 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_PROMISC_MODE)
112#define NET_REQUEST_ETHERNET_GET_PRIORITY_QUEUES_NUM \
113 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_PRIORITY_QUEUES_NUM)
117#define NET_REQUEST_ETHERNET_GET_QAV_PARAM \
118 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_QAV_PARAM)
122#define NET_REQUEST_ETHERNET_GET_QBV_PARAM \
123 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_QBV_PARAM)
127#define NET_REQUEST_ETHERNET_GET_QBU_PARAM \
128 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_QBU_PARAM)
132#define NET_REQUEST_ETHERNET_GET_TXTIME_PARAM \
133 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_TXTIME_PARAM)
137#define NET_REQUEST_ETHERNET_SET_T1S_PARAM \
138 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_T1S_PARAM)
142#define NET_REQUEST_ETHERNET_SET_TXINJECTION_MODE \
143 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_TXINJECTION_MODE)
147#define NET_REQUEST_ETHERNET_GET_TXINJECTION_MODE \
148 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_TXINJECTION_MODE)
152#define NET_REQUEST_ETHERNET_SET_MAC_FILTER \
153 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_MAC_FILTER)
163struct ethernet_req_params {
165 bool auto_negotiation;
168 bool txinjection_mode;
186 int priority_queues_num;
191enum net_event_ethernet_cmd {
192 NET_EVENT_ETHERNET_CMD_CARRIER_ON = 1,
193 NET_EVENT_ETHERNET_CMD_CARRIER_OFF,
194 NET_EVENT_ETHERNET_CMD_VLAN_TAG_ENABLED,
195 NET_EVENT_ETHERNET_CMD_VLAN_TAG_DISABLED,
198#define NET_EVENT_ETHERNET_CARRIER_ON \
199 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_CARRIER_ON)
201#define NET_EVENT_ETHERNET_CARRIER_OFF \
202 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_CARRIER_OFF)
204#define NET_EVENT_ETHERNET_VLAN_TAG_ENABLED \
205 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_VLAN_TAG_ENABLED)
207#define NET_EVENT_ETHERNET_VLAN_TAG_DISABLED \
208 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_VLAN_TAG_DISABLED)
219#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
233#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
248#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
265#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:111
Network Management API public header.
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Ethernet filter description.
Definition ethernet.h:448
Ethernet Qav specific parameters.
Definition ethernet.h:290
Ethernet Qbu specific parameters.
Definition ethernet.h:399
Ethernet Qbv specific parameters.
Definition ethernet.h:332
Ethernet T1S specific parameters.
Definition ethernet.h:245
Ethernet TXTIME specific parameters.
Definition ethernet.h:466
Ethernet address.
Definition ethernet.h:53
Network Interface structure.
Definition net_if.h:680