1# Copyright (c) 2018 Intel Corporation.
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig NET_L2_ETHERNET
5	bool "Ethernet support"
6	help
7	  Add support for Ethernet, enabling selecting relevant hardware drivers.
8	  If NET_SLIP_TAP is selected, NET_L2_ETHERNET will enable to fully
9	  simulate Ethernet through SLIP.
10
11if NET_L2_ETHERNET
12
13module = NET_L2_ETHERNET
14module-dep = NET_LOG
15module-str = Log level for Ethernet L2 layer
16module-help = Enables Ethernet L2 to output debug messages.
17source "subsys/net/Kconfig.template.log_config.net"
18
19config NET_L2_ETHERNET_RESERVE_HEADER
20	bool "Reserve space for Ethernet header in first net_buf in TX"
21	help
22	  If enabled, then reserve space for Ethernet header to the first
23	  net_buf when sending data. The default is still to have layer 2
24	  header in a separate net_buf. In RX side the Ethernet header
25	  is always part of the first net_buf.
26
27config NET_L2_ETHERNET_MGMT
28	bool "Ethernet network management interface"
29	select NET_MGMT
30	select NET_MGMT_EVENT
31	help
32	  Enable support net_mgmt Ethernet interface which can be used to
33	  configure at run-time Ethernet drivers and L2 settings.
34
35
36config NET_L2_ETHERNET_ACCEPT_MISMATCH_L3_L2_ADDR
37	bool "Accept mismatched L3 and L2 addresses"
38	help
39	  If enabled, then accept packets where the L3 and L2 addresses do not
40	  conform to RFC1122 section 3.3.6. This is useful in dealing with
41	  buggy devices that do not follow the RFC.
42
43config NET_VLAN
44	bool "Virtual LAN support"
45	select NET_L2_VIRTUAL
46	help
47	  Enables virtual lan (VLAN) support for Ethernet.
48
49config NET_VLAN_COUNT
50	int "Max VLAN tags supported in the system"
51	default 1
52	range 0 $(UINT8_MAX)
53	depends on NET_VLAN
54	help
55	  How many VLAN tags can be configured. If set to 0, then only
56	  priority tagged VLAN frames with tag value 0 can be handled.
57	  This is useful if you do not want to receive any other VLAN
58	  tagged frames than tag 0. This will save some memory as the
59	  VLAN virtual interface is not created in this case.
60
61config NET_VLAN_TXRX_DEBUG
62	bool "Debug received and sent packets in VLAN"
63	depends on NET_L2_ETHERNET_LOG_LEVEL_DBG && NET_VLAN
64	help
65	  Enables printing of received and sent network packets.
66	  This can produce lot of output so it is disabled by default.
67
68config NET_ARP
69	bool "ARP"
70	default y
71	depends on NET_IPV4
72	help
73	  Enable ARP support. This is necessary on hardware that requires it to
74	  get IPv4 working (like Ethernet devices).
75
76config NET_ARP_TABLE_SIZE
77	int "Number of entries in ARP table."
78	depends on NET_ARP
79	default 2
80	help
81	  Each entry in the ARP table consumes 48 bytes of memory.
82
83config NET_ARP_GRATUITOUS
84	bool "Support gratuitous ARP requests/replies."
85	depends on NET_ARP
86	default y
87	help
88	  Gratuitous in this case means a ARP request or reply that is not
89	  normally needed according to the ARP specification but could be used
90	  in some cases. A gratuitous ARP request is a ARP request packet where
91	  the source and destination IP are both set to the IP of the machine
92	  issuing the packet and the destination MAC is the broadcast address
93	  ff:ff:ff:ff:ff:ff. Ordinarily, no reply packet will occur.
94	  A gratuitous ARP reply is a reply to which no request has been made.
95
96config NET_ARP_GRATUITOUS_TRANSMISSION
97	bool "Transmit gratuitous ARP requests"
98	depends on NET_ARP_GRATUITOUS
99	depends on NET_MGMT_EVENT
100	depends on NET_MGMT_EVENT_INFO
101	help
102	  Transmit gratuitous ARP requests, as defined in RFC 5227.
103
104config NET_ARP_GRATUITOUS_INTERVAL
105	int "Time interval (in seconds) between sending gratuitous ARP requests"
106	depends on NET_ARP_GRATUITOUS_TRANSMISSION
107	default 60
108
109if NET_ARP
110module = NET_ARP
111module-dep = NET_LOG
112module-str = Log level for IPv4 ARP
113module-help = Enables core ARP code to output debug messages.
114source "subsys/net/Kconfig.template.log_config.net"
115endif # NET_ARP
116
117source "subsys/net/l2/ethernet/dsa/Kconfig"
118source "subsys/net/l2/ethernet/gptp/Kconfig"
119source "subsys/net/l2/ethernet/lldp/Kconfig"
120
121config NET_ETHERNET_BRIDGE
122	bool "Ethernet Bridging support"
123	select NET_PROMISCUOUS_MODE
124	select NET_L2_VIRTUAL
125	help
126	  Enables Ethernet bridging where packets can be transparently
127	  forwarded across interfaces registered to a bridge.
128
129config NET_ETHERNET_BRIDGE_COUNT
130	int "Max number of bridge interfaces"
131	default 1
132	range 1 16
133	depends on NET_ETHERNET_BRIDGE
134	help
135	  How many bridge interfaces are created. Each interface can bridge
136	  two or more Ethernet interfaces.
137
138config NET_ETHERNET_BRIDGE_ETH_INTERFACE_COUNT
139	int "Max number of Ethernet interfaces bridged together"
140	default 2
141	range 2 32
142	depends on NET_ETHERNET_BRIDGE
143	help
144	  How many Ethernet interfaces can be bridged together per each
145	  bridge interface.
146
147if NET_ETHERNET_BRIDGE
148module = NET_ETHERNET_BRIDGE
149module-dep = NET_LOG
150module-str = Log level for Ethernet Bridging
151module-help = Enables Ethernet Bridge code to output debug messages.
152source "subsys/net/Kconfig.template.log_config.net"
153endif # NET_ETHERNET_BRIDGE
154
155config NET_ETHERNET_BRIDGE_TXRX_DEBUG
156	bool "Debug received and sent packets in bridge"
157	depends on NET_L2_ETHERNET_LOG_LEVEL_DBG && NET_ETHERNET_BRIDGE
158	help
159	  Enables printing of received and sent network packets.
160	  This can produce lot of output so it is disabled by default.
161
162config NET_ETHERNET_BRIDGE_SHELL
163	bool "Ethernet Bridging management shell"
164	depends on NET_ETHERNET_BRIDGE
165	select NET_SHELL
166	help
167	  Enables shell utility to manage bridge configuration interactively.
168
169config NET_ETHERNET_FORWARD_UNRECOGNISED_ETHERTYPE
170	bool "Forward unrecognized EtherType frames further into net stack"
171	default y if NET_SOCKETS_PACKET
172	help
173	  When enabled, the Ethernet L2 will forward even those frames for which
174	  it does not recognize the EtherType in the header. By default, such
175	  frames are dropped at the L2 processing.
176
177endif # NET_L2_ETHERNET
178