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,
56#define NET_REQUEST_ETHERNET_SET_AUTO_NEGOTIATION \
57 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_AUTO_NEGOTIATION)
61#define NET_REQUEST_ETHERNET_SET_LINK \
62 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_LINK)
66#define NET_REQUEST_ETHERNET_SET_DUPLEX \
67 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_DUPLEX)
71#define NET_REQUEST_ETHERNET_SET_MAC_ADDRESS \
72 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_MAC_ADDRESS)
76#define NET_REQUEST_ETHERNET_SET_QAV_PARAM \
77 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_QAV_PARAM)
81#define NET_REQUEST_ETHERNET_GET_PORTS_NUM \
82 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_PORTS_NUM)
86#define NET_REQUEST_ETHERNET_SET_QBV_PARAM \
87 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_QBV_PARAM)
91#define NET_REQUEST_ETHERNET_SET_QBU_PARAM \
92 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_QBU_PARAM)
96#define NET_REQUEST_ETHERNET_SET_TXTIME_PARAM \
97 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_TXTIME_PARAM)
101#define NET_REQUEST_ETHERNET_SET_PROMISC_MODE \
102 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_SET_PROMISC_MODE)
106#define NET_REQUEST_ETHERNET_GET_PRIORITY_QUEUES_NUM \
107 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_PRIORITY_QUEUES_NUM)
111#define NET_REQUEST_ETHERNET_GET_QAV_PARAM \
112 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_QAV_PARAM)
116#define NET_REQUEST_ETHERNET_GET_QBV_PARAM \
117 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_QBV_PARAM)
121#define NET_REQUEST_ETHERNET_GET_QBU_PARAM \
122 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_QBU_PARAM)
126#define NET_REQUEST_ETHERNET_GET_TXTIME_PARAM \
127 (_NET_ETHERNET_BASE | NET_REQUEST_ETHERNET_CMD_GET_TXTIME_PARAM)
137struct ethernet_req_params {
139 bool auto_negotiation;
149 struct net_eth_addr mac_address;
156 int priority_queues_num;
161enum net_event_ethernet_cmd {
162 NET_EVENT_ETHERNET_CMD_CARRIER_ON = 1,
163 NET_EVENT_ETHERNET_CMD_CARRIER_OFF,
164 NET_EVENT_ETHERNET_CMD_VLAN_TAG_ENABLED,
165 NET_EVENT_ETHERNET_CMD_VLAN_TAG_DISABLED,
168#define NET_EVENT_ETHERNET_CARRIER_ON \
169 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_CARRIER_ON)
171#define NET_EVENT_ETHERNET_CARRIER_OFF \
172 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_CARRIER_OFF)
174#define NET_EVENT_ETHERNET_VLAN_TAG_ENABLED \
175 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_VLAN_TAG_ENABLED)
177#define NET_EVENT_ETHERNET_VLAN_TAG_DISABLED \
178 (_NET_ETHERNET_EVENT | NET_EVENT_ETHERNET_CMD_VLAN_TAG_DISABLED)
189#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
203#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
218#if defined(CONFIG_NET_L2_ETHERNET_MGMT)
235#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)
Definition: net_mgmt.h:95
Network Management API public header.
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
Definition: ethernet.h:196
Definition: ethernet.h:301
Definition: ethernet.h:237
Definition: ethernet.h:358
Network Interface structure.
Definition: net_if.h:468
static const char * tag(void)
Definition: main.c:27