Skip to content

Commit

Permalink
net/ethernet: Moving ethernet code to dedicated directory
Browse files Browse the repository at this point in the history
There will be additional source files coming in, so let's not clutter l2
root directory.

Reordering a bit l2 Kconfig: offload part come first, then the l2
drivers.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
  • Loading branch information
Tomasz Bursztyka authored and jukkar committed Apr 10, 2018
1 parent 4bf1a9b commit af0c586
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 68 deletions.
12 changes: 6 additions & 6 deletions subsys/net/ip/l2/CMakeLists.txt
@@ -1,23 +1,23 @@
if(CONFIG_NET_ARP OR
CONFIG_NET_L2_BT OR
if(CONFIG_NET_L2_BT OR
CONFIG_NET_L2_BT_SHELL OR
CONFIG_NET_L2_DUMMY OR
CONFIG_NET_L2_ETHERNET)
CONFIG_NET_L2_DUMMY)

zephyr_library()
zephyr_library_include_directories(. ..)
zephyr_library_compile_definitions_ifdef(
CONFIG_NEWLIB_LIBC __LINUX_ERRNO_EXTENSIONS__
)

zephyr_library_sources_ifdef(CONFIG_NET_ARP arp.c)
zephyr_library_sources_ifdef(CONFIG_NET_L2_BT bluetooth.c)
zephyr_library_sources_ifdef(CONFIG_NET_L2_BT_SHELL bluetooth_shell.c)
zephyr_library_sources_ifdef(CONFIG_NET_L2_DUMMY dummy.c)
zephyr_library_sources_ifdef(CONFIG_NET_L2_ETHERNET ethernet.c)

endif()

if(CONFIG_NET_L2_ETHERNET)
add_subdirectory(ethernet)
endif()

if(CONFIG_NET_L2_IEEE802154)
add_subdirectory(ieee802154)
endif()
Expand Down
72 changes: 10 additions & 62 deletions subsys/net/ip/l2/Kconfig
Expand Up @@ -6,45 +6,6 @@

menu "Link layer options"

config NET_L2_DUMMY
bool "Enable dummy l2 layer"
default n
default y if !NET_L2_ETHERNET && NET_TEST
help
Add a dummy L2 layer driver. This is usually only needed when
simulating a network interface when running network stack inside QEMU.

config NET_L2_ETHERNET
bool "Enable Ethernet support"
default n
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.

config NET_VLAN
bool "Enable virtual lan support"
default n
depends on NET_L2_ETHERNET
help
Enables virtual lan (VLAN) support for Ethernet.

config NET_VLAN_COUNT
int "Max VLAN tags supported in the system"
default 1
range 1 255
depends on NET_VLAN
help
How many VLAN tags can be configured.

config NET_DEBUG_L2_ETHERNET
bool "Debug Ethernet L2 layer"
default n
default y if NET_LOG_GLOBAL
depends on NET_LOG
help
Enables Ethernet L2 output debug messages

config NET_OFFLOAD
bool "Offload IP stack [EXPERIMENTAL]"
default n
Expand All @@ -60,6 +21,14 @@ config NET_DEBUG_NET_OFFLOAD
help
Enables offload TCP/IP stack output debug messages.

config NET_L2_DUMMY
bool "Enable dummy l2 layer"
default n
default y if !NET_L2_ETHERNET && NET_TEST
help
Add a dummy L2 layer driver. This is usually only needed when
simulating a network interface when running network stack inside QEMU.

config NET_L2_BT
bool "Enable Bluetooth support"
select BT
Expand Down Expand Up @@ -122,30 +91,9 @@ config NET_L2_BT_SHELL
This can be used for testing Bluetooth management commands through the
console via a shell module named "net_bt".

source "subsys/net/ip/l2/ieee802154/Kconfig"

config NET_ARP
bool "Enable ARP"
default y
depends on NET_IPV4 && NET_L2_ETHERNET
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 22 bytes of memory.
source "subsys/net/ip/l2/ethernet/Kconfig"

config NET_DEBUG_ARP
bool "Debug IPv4 ARP"
depends on NET_ARP && NET_LOG
default n
default y if NET_LOG_GLOBAL
help
Enables core ARP code part to output debug messages
source "subsys/net/ip/l2/ieee802154/Kconfig"

source "subsys/net/ip/l2/openthread/Kconfig"

Expand Down
8 changes: 8 additions & 0 deletions subsys/net/ip/l2/ethernet/CMakeLists.txt
@@ -0,0 +1,8 @@
zephyr_library()
zephyr_library_include_directories(. ../..)
zephyr_library_compile_definitions_ifdef(
CONFIG_NEWLIB_LIBC __LINUX_ERRNO_EXTENSIONS__
)

zephyr_library_sources_ifdef(CONFIG_NET_ARP arp.c)
zephyr_library_sources_ifdef(CONFIG_NET_L2_ETHERNET ethernet.c)
62 changes: 62 additions & 0 deletions subsys/net/ip/l2/ethernet/Kconfig
@@ -0,0 +1,62 @@
#
# Copyright (c) 2018 Intel Corporation.
#
# SPDX-License-Identifier: Apache-2.0
#

menuconfig NET_L2_ETHERNET
bool "Enable Ethernet support"
default n
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

config NET_DEBUG_L2_ETHERNET
bool "Debug Ethernet L2 layer"
default n
default y if NET_LOG_GLOBAL
depends on NET_LOG
help
Enables Ethernet L2 output debug messages

config NET_VLAN
bool "Enable virtual lan support"
default n
help
Enables virtual lan (VLAN) support for Ethernet.

config NET_VLAN_COUNT
int "Max VLAN tags supported in the system"
default 1
range 1 255
depends on NET_VLAN
help
How many VLAN tags can be configured.

config NET_ARP
bool "Enable 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 22 bytes of memory.

config NET_DEBUG_ARP
bool "Debug IPv4 ARP"
depends on NET_ARP && NET_LOG
default n
default y if NET_LOG_GLOBAL
help
Enables core ARP code part to output debug messages

endif # NET_L2_ETHERNET
File renamed without changes.
File renamed without changes.

0 comments on commit af0c586

Please sign in to comment.