# Copyright (c) 2018 Intel Corporation.
# SPDX-License-Identifier: Apache-2.0

menuconfig NET_L2_ETHERNET
	bool "Ethernet support"
	help
	  Add support for Ethernet, enabling selecting relevant hardware drivers.
	  If NET_SLIP_TAP is selected, NET_L2_ETHERNET will enable to fully
	  simulate Ethernet through SLIP.

if NET_L2_ETHERNET

module = NET_L2_ETHERNET
module-dep = NET_LOG
module-str = Log level for Ethernet L2 layer
module-help = Enables Ethernet L2 to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"

config NET_L2_ETHERNET_RESERVE_HEADER
	bool "Reserve space for Ethernet header in first net_buf in TX"
	help
	  If enabled, then reserve space for Ethernet header to the first
	  net_buf when sending data. The default is still to have layer 2
	  header in a separate net_buf. In RX side the Ethernet header
	  is always part of the first net_buf.

config NET_L2_ETHERNET_MGMT
	bool "Ethernet network management interface"
	select NET_MGMT
	select NET_MGMT_EVENT
	help
	  Enable support net_mgmt Ethernet interface which can be used to
	  configure at run-time Ethernet drivers and L2 settings.


config NET_L2_ETHERNET_ACCEPT_MISMATCH_L3_L2_ADDR
	bool "Accept mismatched L3 and L2 addresses"
	help
	  If enabled, then accept packets where the L3 and L2 addresses do not
	  conform to RFC1122 section 3.3.6. This is useful in dealing with
	  buggy devices that do not follow the RFC.

config NET_VLAN
	bool "Virtual LAN support"
	select NET_L2_VIRTUAL
	help
	  Enables virtual lan (VLAN) support for Ethernet.

config NET_VLAN_COUNT
	int "Max VLAN tags supported in the system"
	default 1
	range 0 $(UINT8_MAX)
	depends on NET_VLAN
	help
	  How many VLAN tags can be configured. If set to 0, then only
	  priority tagged VLAN frames with tag value 0 can be handled.
	  This is useful if you do not want to receive any other VLAN
	  tagged frames than tag 0. This will save some memory as the
	  VLAN virtual interface is not created in this case.

config NET_VLAN_TXRX_DEBUG
	bool "Debug received and sent packets in VLAN"
	depends on NET_L2_ETHERNET_LOG_LEVEL_DBG && NET_VLAN
	help
	  Enables printing of received and sent network packets.
	  This can produce lot of output so it is disabled by default.

config NET_ARP
	bool "ARP"
	default y
	depends on NET_IPV4
	help
	  Enable ARP support. This is necessary on hardware that requires it to
	  get IPv4 working (like Ethernet devices).

config NET_ARP_TABLE_SIZE
	int "Number of entries in ARP table."
	depends on NET_ARP
	default 2
	help
	  Each entry in the ARP table consumes 48 bytes of memory.

config NET_ARP_GRATUITOUS
	bool "Support gratuitous ARP requests/replies."
	depends on NET_ARP
	default y
	help
	  Gratuitous in this case means a ARP request or reply that is not
	  normally needed according to the ARP specification but could be used
	  in some cases. A gratuitous ARP request is a ARP request packet where
	  the source and destination IP are both set to the IP of the machine
	  issuing the packet and the destination MAC is the broadcast address
	  ff:ff:ff:ff:ff:ff. Ordinarily, no reply packet will occur.
	  A gratuitous ARP reply is a reply to which no request has been made.

config NET_ARP_GRATUITOUS_TRANSMISSION
	bool "Transmit gratuitous ARP requests"
	depends on NET_ARP_GRATUITOUS
	depends on NET_MGMT_EVENT
	depends on NET_MGMT_EVENT_INFO
	help
	  Transmit gratuitous ARP requests, as defined in RFC 5227.

config NET_ARP_GRATUITOUS_INTERVAL
	int "Time interval (in seconds) between sending gratuitous ARP requests"
	depends on NET_ARP_GRATUITOUS_TRANSMISSION
	default 60

if NET_ARP
module = NET_ARP
module-dep = NET_LOG
module-str = Log level for IPv4 ARP
module-help = Enables core ARP code to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"
endif # NET_ARP

source "subsys/net/l2/ethernet/dsa/Kconfig"
source "subsys/net/l2/ethernet/gptp/Kconfig"
source "subsys/net/l2/ethernet/lldp/Kconfig"

config NET_ETHERNET_BRIDGE
	bool "Ethernet Bridging support"
	select NET_PROMISCUOUS_MODE
	select NET_L2_VIRTUAL
	help
	  Enables Ethernet bridging where packets can be transparently
	  forwarded across interfaces registered to a bridge.

config NET_ETHERNET_BRIDGE_COUNT
	int "Max number of bridge interfaces"
	default 1
	range 1 16
	depends on NET_ETHERNET_BRIDGE
	help
	  How many bridge interfaces are created. Each interface can bridge
	  two or more Ethernet interfaces.

config NET_ETHERNET_BRIDGE_ETH_INTERFACE_COUNT
	int "Max number of Ethernet interfaces bridged together"
	default 2
	range 2 32
	depends on NET_ETHERNET_BRIDGE
	help
	  How many Ethernet interfaces can be bridged together per each
	  bridge interface.

if NET_ETHERNET_BRIDGE
module = NET_ETHERNET_BRIDGE
module-dep = NET_LOG
module-str = Log level for Ethernet Bridging
module-help = Enables Ethernet Bridge code to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"
endif # NET_ETHERNET_BRIDGE

config NET_ETHERNET_BRIDGE_TXRX_DEBUG
	bool "Debug received and sent packets in bridge"
	depends on NET_L2_ETHERNET_LOG_LEVEL_DBG && NET_ETHERNET_BRIDGE
	help
	  Enables printing of received and sent network packets.
	  This can produce lot of output so it is disabled by default.

config NET_ETHERNET_BRIDGE_SHELL
	bool "Ethernet Bridging management shell"
	depends on NET_ETHERNET_BRIDGE
	select NET_SHELL
	help
	  Enables shell utility to manage bridge configuration interactively.

config NET_ETHERNET_FORWARD_UNRECOGNISED_ETHERTYPE
	bool "Forward unrecognized EtherType frames further into net stack"
	default y if NET_SOCKETS_PACKET
	help
	  When enabled, the Ethernet L2 will forward even those frames for which
	  it does not recognize the EtherType in the header. By default, such
	  frames are dropped at the L2 processing.

config NET_QBV
	bool "Qbv support"
	depends on PTP_CLOCK
	help
	  Enable Qbv support, Qbv is Enhancements for Scheduled Traffic (EST), one
	  feature of TSN. It provides time "slots" for specific classes of traffic
	  in a manner similar to TDM. Host (beyond standard) can select time/time
	  gate during which a packet will be sent, granular control by software of
	  packet transmission.

endif # NET_L2_ETHERNET
