Skip to content

Commit 7912646

Browse files
jhirsirlubos
authored andcommitted
[nrf fromtree] net: possibility to set custom link layer address length
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 <[email protected]> (cherry picked from commit 9800ff5)
1 parent 5cc9c4e commit 7912646

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

include/zephyr/net/net_linkaddr.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ extern "C" {
3030
*/
3131

3232
/** Maximum length of the link address */
33-
#if defined(CONFIG_NET_L2_PHY_IEEE802154) || defined(CONFIG_NET_L2_PPP)
33+
#if CONFIG_NET_LINK_ADDR_CUSTOM_LENGTH > 0
34+
#define NET_LINK_ADDR_MAX_LENGTH CONFIG_NET_LINK_ADDR_CUSTOM_LENGTH
35+
#elif defined(CONFIG_NET_L2_PHY_IEEE802154) || defined(CONFIG_NET_L2_PPP)
3436
#define NET_LINK_ADDR_MAX_LENGTH 8
3537
#else
3638
#define NET_LINK_ADDR_MAX_LENGTH 6

subsys/net/ip/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,14 @@ config NET_HEADERS_ALWAYS_CONTIGUOUS
767767
NET_BUF_FIXED_DATA_SIZE enabled and NET_BUF_DATA_SIZE of 128 for
768768
instance.
769769

770+
config NET_LINK_ADDR_CUSTOM_LENGTH
771+
int "Size of custom link layer address length"
772+
default 0
773+
help
774+
This option allows to define custom link layer address length
775+
if your link layer technology is not supported directly.
776+
As a default, custom link layer address length is not used.
777+
770778
# If we are running network tests found in tests/net, then the NET_TEST is
771779
# set and in that case we default to Dummy L2 layer as typically the tests
772780
# use that by default.

0 commit comments

Comments
 (0)