From 726b00dc9fa45f32a3885670a30093345ce93f79 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sun, 14 Oct 2018 16:01:46 +0200 Subject: [PATCH 1/6] batman-adv: Add DEBUG_LOG -> DEBUGFS dependency The debug log is only available when the debugfs is also enabled. This must be reflected in Kconfig to avoid incompatible selection of batman-adv options. Signed-off-by: Sven Eckelmann --- batman-adv/Config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/batman-adv/Config.in b/batman-adv/Config.in index c56a4b3..85c18df 100644 --- a/batman-adv/Config.in +++ b/batman-adv/Config.in @@ -2,6 +2,7 @@ config KMOD_BATMAN_ADV_DEBUG_LOG bool "enable verbose debug logging" depends on PACKAGE_kmod-batman-adv + depends on KMOD_BATMAN_ADV_DEBUGFS default n config KMOD_BATMAN_ADV_BLA From c5092c6e786ef34dd2ea754aa09f3341fbc9bc40 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sun, 14 Oct 2018 16:50:23 +0200 Subject: [PATCH 2/6] batman-adv: Order Kconfig config symbols like kernel The options in the kernel Kconfig have a different order than the one in the OptionWrt Config.in. This makes it unnecessary hard to compare these two files. Signed-off-by: Sven Eckelmann --- batman-adv/Config.in | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/batman-adv/Config.in b/batman-adv/Config.in index 85c18df..997bf9a 100644 --- a/batman-adv/Config.in +++ b/batman-adv/Config.in @@ -1,9 +1,8 @@ -config KMOD_BATMAN_ADV_DEBUG_LOG - bool "enable verbose debug logging" +config KMOD_BATMAN_ADV_BATMAN_V + bool "enable batman v routing algorithm" depends on PACKAGE_kmod-batman-adv - depends on KMOD_BATMAN_ADV_DEBUGFS - default n + default y config KMOD_BATMAN_ADV_BLA bool "enable bridge loop avoidance" @@ -15,8 +14,8 @@ config KMOD_BATMAN_ADV_DAT depends on PACKAGE_kmod-batman-adv default y -config KMOD_BATMAN_ADV_DEBUGFS - bool "enable debugfs support" +config KMOD_BATMAN_ADV_NC + bool "enable network coding [requires promisc mode support]" depends on PACKAGE_kmod-batman-adv default n @@ -25,12 +24,13 @@ config KMOD_BATMAN_ADV_MCAST depends on PACKAGE_kmod-batman-adv default y -config KMOD_BATMAN_ADV_NC - bool "enable network coding [requires promisc mode support]" +config KMOD_BATMAN_ADV_DEBUGFS + bool "enable debugfs support" depends on PACKAGE_kmod-batman-adv default n -config KMOD_BATMAN_ADV_BATMAN_V - bool "enable batman v routing algorithm" +config KMOD_BATMAN_ADV_DEBUG_LOG + bool "enable verbose debug logging" depends on PACKAGE_kmod-batman-adv - default y + depends on KMOD_BATMAN_ADV_DEBUGFS + default n From 45c12f406f61500822229af2b53754b69a2c8b25 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sun, 14 Oct 2018 16:58:01 +0200 Subject: [PATCH 3/6] batman-adv: Disable MCAST during compilation The multicast optimization compile option is disabled by default in the Kconfig of batman-adv. The out-of-tree module should keep this setting in sync and thus has to also disable the build of multicast optimization by default. Signed-off-by: Sven Eckelmann --- batman-adv/Config.in | 1 - 1 file changed, 1 deletion(-) diff --git a/batman-adv/Config.in b/batman-adv/Config.in index 997bf9a..18b3807 100644 --- a/batman-adv/Config.in +++ b/batman-adv/Config.in @@ -22,7 +22,6 @@ config KMOD_BATMAN_ADV_NC config KMOD_BATMAN_ADV_MCAST bool "enable multicast transmission optimization" depends on PACKAGE_kmod-batman-adv - default y config KMOD_BATMAN_ADV_DEBUGFS bool "enable debugfs support" From 0db66160aaabcd48ebc57c2b8f0ea9157123196d Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sun, 14 Oct 2018 16:24:20 +0200 Subject: [PATCH 4/6] batman-adv: Sync config options with kernel Kconfig The kernel already provides all available kernel options for batman-adv and even includes more verbose descriptions of each option. Importing this Kconfig (with minor adjustments) file as Config.in allows to share most information between kernel and OpenWrt. Signed-off-by: Sven Eckelmann --- batman-adv/Config.in | 84 ++++++++++++++++++++++++++++++++++++++------ batman-adv/Makefile | 11 +++--- 2 files changed, 80 insertions(+), 15 deletions(-) diff --git a/batman-adv/Config.in b/batman-adv/Config.in index 18b3807..687acf0 100644 --- a/batman-adv/Config.in +++ b/batman-adv/Config.in @@ -1,35 +1,97 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (C) 2007-2018 B.A.T.M.A.N. contributors: +# +# Marek Lindner, Simon Wunderlich +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of version 2 of the GNU General Public +# License as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . + +# +# B.A.T.M.A.N meshing protocol +# config KMOD_BATMAN_ADV_BATMAN_V - bool "enable batman v routing algorithm" + bool "B.A.T.M.A.N. V protocol" depends on PACKAGE_kmod-batman-adv default y + help + This option enables the B.A.T.M.A.N. V protocol, the successor + of the currently used B.A.T.M.A.N. IV protocol. The main + changes include splitting of the OGM protocol into a neighbor + discovery protocol (Echo Location Protocol, ELP) and a new OGM + Protocol OGMv2 for flooding protocol information through the + network, as well as a throughput based metric. + B.A.T.M.A.N. V is currently considered experimental and not + compatible to B.A.T.M.A.N. IV networks. config KMOD_BATMAN_ADV_BLA - bool "enable bridge loop avoidance" + bool "Bridge Loop Avoidance" depends on PACKAGE_kmod-batman-adv + select PACKAGE_kmod-lib-crc16 default y + help + This option enables BLA (Bridge Loop Avoidance), a mechanism + to avoid Ethernet frames looping when mesh nodes are connected + to both the same LAN and the same mesh. If you will never use + more than one mesh node in the same LAN, you can safely remove + this feature and save some space. config KMOD_BATMAN_ADV_DAT - bool "enable distributed arp table" + bool "Distributed ARP Table" depends on PACKAGE_kmod-batman-adv default y + help + This option enables DAT (Distributed ARP Table), a DHT based + mechanism that increases ARP reliability on sparse wireless + mesh networks. If you think that your network does not need + this option you can safely remove it and save some space. config KMOD_BATMAN_ADV_NC - bool "enable network coding [requires promisc mode support]" + bool "Network Coding" depends on PACKAGE_kmod-batman-adv - default n + help + This option enables network coding, a mechanism that aims to + increase the overall network throughput by fusing multiple + packets in one transmission. + Note that interfaces controlled by batman-adv must be manually + configured to have promiscuous mode enabled in order to make + network coding work. + If you think that your network does not need this feature you + can safely disable it and save some space. config KMOD_BATMAN_ADV_MCAST - bool "enable multicast transmission optimization" + bool "Multicast optimisation" depends on PACKAGE_kmod-batman-adv + help + This option enables the multicast optimisation which aims to + reduce the air overhead while improving the reliability of + multicast messages. config KMOD_BATMAN_ADV_DEBUGFS - bool "enable debugfs support" + bool "batman-adv debugfs entries" depends on PACKAGE_kmod-batman-adv - default n + select KERNEL_DEBUG_FS + help + Enable this to export routing related debug tables via debugfs. + The information for each soft-interface and used hard-interface can be + found under batman_adv/ + + If unsure, say N. config KMOD_BATMAN_ADV_DEBUG_LOG - bool "enable verbose debug logging" - depends on PACKAGE_kmod-batman-adv + bool "B.A.T.M.A.N. debugging" depends on KMOD_BATMAN_ADV_DEBUGFS - default n + help + This is an option for use by developers; most people should + say N here. This enables compilation of support for + outputting debugging information to the kernel log. The + output is controlled via the module parameter debug. diff --git a/batman-adv/Makefile b/batman-adv/Makefile index 0d9aa77..047b2d7 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -27,16 +27,19 @@ define KernelPackage/batman-adv URL:=https://www.open-mesh.org/ MAINTAINER:=Simon Wunderlich SUBMENU:=Network Support - DEPENDS:=+KMOD_BATMAN_ADV_BLA:kmod-lib-crc16 +kmod-crypto-crc32c +kmod-lib-crc32c +kmod-cfg80211 + DEPENDS:=+kmod-crypto-crc32c +kmod-lib-crc32c +kmod-cfg80211 TITLE:=B.A.T.M.A.N. Adv FILES:=$(PKG_BUILD_DIR)/net/batman-adv/batman-adv.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoProbe,batman-adv) endef define KernelPackage/batman-adv/description -B.A.T.M.A.N. advanced is a kernel module which allows to -build layer 2 mesh networks. This package builds -version $(PKG_VERSION) of the kernel module. +B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is +a routing protocol for multi-hop ad-hoc mesh networks. The +networks may be wired or wireless. See +https://www.open-mesh.org/ for more information and user space +tools. This package builds version $(PKG_VERSION) of the kernel +module. endef define KernelPackage/batman-adv/config From 6a25fd5ce5244f411ab5771652e8a9e93d5bd1c1 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sun, 14 Oct 2018 16:40:43 +0200 Subject: [PATCH 5/6] batman-adv: Use the kernel style Kconfig symbols Kernel modules like ath9k and ath10k are using the same Kconfig option symbols as used in the kernel. This makes it easier to share them between these two projects. A similar approach should be used for the batman-adv module. Signed-off-by: Sven Eckelmann --- batman-adv/Config.in | 16 ++++++++-------- batman-adv/Makefile | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/batman-adv/Config.in b/batman-adv/Config.in index 687acf0..52a688b 100644 --- a/batman-adv/Config.in +++ b/batman-adv/Config.in @@ -19,7 +19,7 @@ # B.A.T.M.A.N meshing protocol # -config KMOD_BATMAN_ADV_BATMAN_V +config BATMAN_ADV_BATMAN_V bool "B.A.T.M.A.N. V protocol" depends on PACKAGE_kmod-batman-adv default y @@ -33,7 +33,7 @@ config KMOD_BATMAN_ADV_BATMAN_V B.A.T.M.A.N. V is currently considered experimental and not compatible to B.A.T.M.A.N. IV networks. -config KMOD_BATMAN_ADV_BLA +config BATMAN_ADV_BLA bool "Bridge Loop Avoidance" depends on PACKAGE_kmod-batman-adv select PACKAGE_kmod-lib-crc16 @@ -45,7 +45,7 @@ config KMOD_BATMAN_ADV_BLA more than one mesh node in the same LAN, you can safely remove this feature and save some space. -config KMOD_BATMAN_ADV_DAT +config BATMAN_ADV_DAT bool "Distributed ARP Table" depends on PACKAGE_kmod-batman-adv default y @@ -55,7 +55,7 @@ config KMOD_BATMAN_ADV_DAT mesh networks. If you think that your network does not need this option you can safely remove it and save some space. -config KMOD_BATMAN_ADV_NC +config BATMAN_ADV_NC bool "Network Coding" depends on PACKAGE_kmod-batman-adv help @@ -68,7 +68,7 @@ config KMOD_BATMAN_ADV_NC If you think that your network does not need this feature you can safely disable it and save some space. -config KMOD_BATMAN_ADV_MCAST +config BATMAN_ADV_MCAST bool "Multicast optimisation" depends on PACKAGE_kmod-batman-adv help @@ -76,7 +76,7 @@ config KMOD_BATMAN_ADV_MCAST reduce the air overhead while improving the reliability of multicast messages. -config KMOD_BATMAN_ADV_DEBUGFS +config BATMAN_ADV_DEBUGFS bool "batman-adv debugfs entries" depends on PACKAGE_kmod-batman-adv select KERNEL_DEBUG_FS @@ -87,9 +87,9 @@ config KMOD_BATMAN_ADV_DEBUGFS If unsure, say N. -config KMOD_BATMAN_ADV_DEBUG_LOG +config BATMAN_ADV_DEBUG bool "B.A.T.M.A.N. debugging" - depends on KMOD_BATMAN_ADV_DEBUGFS + depends on BATMAN_ADV_DEBUGFS help This is an option for use by developers; most people should say N here. This enables compilation of support for diff --git a/batman-adv/Makefile b/batman-adv/Makefile index 047b2d7..3075b52 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -52,13 +52,13 @@ endef PKG_EXTRA_KCONFIG:= \ CONFIG_BATMAN_ADV=m \ - CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUG_LOG),y,n) \ - CONFIG_BATMAN_ADV_DEBUGFS=$(if $(CONFIG_KMOD_BATMAN_ADV_DEBUGFS),y,n) \ - CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_KMOD_BATMAN_ADV_BLA),y,n) \ - CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_KMOD_BATMAN_ADV_DAT),y,n) \ - CONFIG_BATMAN_ADV_MCAST=$(if $(CONFIG_KMOD_BATMAN_ADV_MCAST),y,n) \ - CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_KMOD_BATMAN_ADV_NC),y,n) \ - CONFIG_BATMAN_ADV_BATMAN_V=$(if $(CONFIG_KMOD_BATMAN_ADV_BATMAN_V),y,n) \ + CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_BATMAN_ADV_DEBUG),y,n) \ + CONFIG_BATMAN_ADV_DEBUGFS=$(if $(CONFIG_BATMAN_ADV_DEBUGFS),y,n) \ + CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_BATMAN_ADV_BLA),y,n) \ + CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_BATMAN_ADV_DAT),y,n) \ + CONFIG_BATMAN_ADV_MCAST=$(if $(CONFIG_BATMAN_ADV_MCAST),y,n) \ + CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_BATMAN_ADV_NC),y,n) \ + CONFIG_BATMAN_ADV_BATMAN_V=$(if $(CONFIG_BATMAN_ADV_BATMAN_V),y,n) \ PKG_EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \ @@ -76,9 +76,9 @@ NOSTDINC_FLAGS = \ -DBATADV_SOURCE_VERSION=\\\"openwrt-$(PKG_VERSION)-$(PKG_RELEASE)\\\" COMPAT_SOURCES = \ - $(if $(CONFIG_KMOD_BATMAN_ADV_MCAST),../../compat-sources/net/core/skbuff.o,) \ - $(if $(CONFIG_KMOD_BATMAN_ADV_MCAST),../../compat-sources/net/ipv4/igmp.o,) \ - $(if $(CONFIG_KMOD_BATMAN_ADV_MCAST),../../compat-sources/net/ipv6/mcast_snoop.o,) \ + $(if $(CONFIG_BATMAN_ADV_MCAST),../../compat-sources/net/core/skbuff.o,) \ + $(if $(CONFIG_BATMAN_ADV_MCAST),../../compat-sources/net/ipv4/igmp.o,) \ + $(if $(CONFIG_BATMAN_ADV_MCAST),../../compat-sources/net/ipv6/mcast_snoop.o,) \ define Build/Compile +env "batman-adv-y=$(COMPAT_SOURCES)" \ From c3b60d4c84a45218384aace9ac95d1d8ad299163 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sun, 14 Oct 2018 17:37:29 +0200 Subject: [PATCH 6/6] batman-adv: Remove unused dependency kmod-crypto-crc32c The translation table code from batman-adv is only using the function crc32c which is part of kmod-lib-crc32c. The kmod-crypto-crc32c is then only used by kmod-lib-crc32c but not batman-adv. Signed-off-by: Sven Eckelmann --- batman-adv/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/batman-adv/Makefile b/batman-adv/Makefile index 3075b52..36c764e 100644 --- a/batman-adv/Makefile +++ b/batman-adv/Makefile @@ -27,7 +27,7 @@ define KernelPackage/batman-adv URL:=https://www.open-mesh.org/ MAINTAINER:=Simon Wunderlich SUBMENU:=Network Support - DEPENDS:=+kmod-crypto-crc32c +kmod-lib-crc32c +kmod-cfg80211 + DEPENDS:=+kmod-lib-crc32c +kmod-cfg80211 TITLE:=B.A.T.M.A.N. Adv FILES:=$(PKG_BUILD_DIR)/net/batman-adv/batman-adv.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoProbe,batman-adv)