From d5975b46cf142d2fb3f26d633224fffd63f9e61d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20Hirsim=C3=A4ki?= Date: Fri, 31 Oct 2025 13:38:27 +0200 Subject: [PATCH 1/2] [nrf fromtree] net: ip: new Kconfig NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE is used to set the default size of the data field in the net_mgmt_event_info structure. This change allows the user to configure the size of the data field according to their needs. Signed-off-by: Jani Hirsimäki (cherry picked from commit f55dacf8498fb66895ad21f51eb1cf459bcc85b0) --- subsys/net/ip/Kconfig.mgmt | 10 +++++++++- subsys/net/ip/net_private.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/subsys/net/ip/Kconfig.mgmt b/subsys/net/ip/Kconfig.mgmt index 4ca57e4c8e5e..f5f745390b71 100644 --- a/subsys/net/ip/Kconfig.mgmt +++ b/subsys/net/ip/Kconfig.mgmt @@ -95,15 +95,23 @@ config NET_MGMT_EVENT_INFO and listeners will then be able to get it. Such information depends on the type of event. +if NET_MGMT_EVENT_INFO +config NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE + int "Default size of event information data" + default 32 + help + The default size of the data which can be passed along with an event. + config NET_MGMT_EVENT_MONITOR bool "Monitor network events from net shell" - depends on NET_SHELL && NET_MGMT_EVENT_INFO + depends on NET_SHELL help Allow user to monitor network events from net shell using "net events [on|off]" command. The monitoring is disabled by default. Note that you should probably increase the value of NET_MGMT_EVENT_QUEUE_SIZE from the default in order not to miss any events. +endif # NET_MGMT_EVENT_INFO config NET_MGMT_EVENT_MONITOR_STACK_SIZE int "Size of the stack allocated for the event_mon_stack thread" diff --git a/subsys/net/ip/net_private.h b/subsys/net/ip/net_private.h index 11ae1be6b9fb..a636fcf9b79a 100644 --- a/subsys/net/ip/net_private.h +++ b/subsys/net/ip/net_private.h @@ -25,7 +25,7 @@ #include #endif /* CONFIG_NET_L2_WIFI_MGMT */ -#define DEFAULT_NET_EVENT_INFO_SIZE 32 +#define DEFAULT_NET_EVENT_INFO_SIZE CONFIG_NET_MGMT_EVENT_INFO_DEFAULT_DATA_SIZE /* NOTE: Update this union with all *big* event info structs */ union net_mgmt_events { #if defined(CONFIG_NET_DHCPV4) From 7c4efe2aa7c675319b4027a350c207af265bf1ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jani=20Hirsim=C3=A4ki?= Date: Fri, 31 Oct 2025 10:42:35 +0200 Subject: [PATCH 2/2] [nrf fromtree] net: possibility to set custom link layer address length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds a new Kconfig option NET_LINK_ADDR_CUSTOM_LENGTH that allows to set custom link layer address length if your link layer technology is not supported directly. If this option is set to a value greater than 0, that value is used as link layer address length. Signed-off-by: Jani Hirsimäki (cherry picked from commit 9800ff5c478d99ae7b3f372dc73f35e7217f7d54) --- include/zephyr/net/net_linkaddr.h | 4 +++- subsys/net/ip/Kconfig | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/zephyr/net/net_linkaddr.h b/include/zephyr/net/net_linkaddr.h index 134c20574309..74657c814fc8 100644 --- a/include/zephyr/net/net_linkaddr.h +++ b/include/zephyr/net/net_linkaddr.h @@ -30,7 +30,9 @@ extern "C" { */ /** Maximum length of the link address */ -#if defined(CONFIG_NET_L2_PHY_IEEE802154) || defined(CONFIG_NET_L2_PPP) +#if CONFIG_NET_LINK_ADDR_CUSTOM_LENGTH > 0 +#define NET_LINK_ADDR_MAX_LENGTH CONFIG_NET_LINK_ADDR_CUSTOM_LENGTH +#elif defined(CONFIG_NET_L2_PHY_IEEE802154) || defined(CONFIG_NET_L2_PPP) #define NET_LINK_ADDR_MAX_LENGTH 8 #else #define NET_LINK_ADDR_MAX_LENGTH 6 diff --git a/subsys/net/ip/Kconfig b/subsys/net/ip/Kconfig index b5557c3632e0..673f24d39dda 100644 --- a/subsys/net/ip/Kconfig +++ b/subsys/net/ip/Kconfig @@ -767,6 +767,14 @@ config NET_HEADERS_ALWAYS_CONTIGUOUS NET_BUF_FIXED_DATA_SIZE enabled and NET_BUF_DATA_SIZE of 128 for instance. +config NET_LINK_ADDR_CUSTOM_LENGTH + int "Size of custom link layer address length" + default 0 + help + This option allows to define custom link layer address length + if your link layer technology is not supported directly. + As a default, custom link layer address length is not used. + # If we are running network tests found in tests/net, then the NET_TEST is # set and in that case we default to Dummy L2 layer as typically the tests # use that by default.