This is an automated email from the ASF dual-hosted git repository.

casaroli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 0147bd8a7522e25308fb7b66884ac4782bd7fa58
Author: wangjinjing1 <[email protected]>
AuthorDate: Thu May 14 22:19:24 2026 +0800

    !net/can: add NET_ prefix to CAN connection alloc options
    
    Rename CAN_PREALLOC_CONNS, CAN_ALLOC_CONNS, and CAN_MAX_CONNS to
    NET_CAN_PREALLOC_CONNS, NET_CAN_ALLOC_CONNS, and NET_CAN_MAX_CONNS
    respectively. This aligns the naming convention with other NET_CAN_*
    options in the SocketCAN Kconfig and avoids potential conflicts with
    the CAN character device driver namespace.
    
    Also rename the option in the nucleo-h753zi socketcan configuration,
    which does not exist in the original change.
    
    BREAKING CHANGE: the CAN socket connection options are renamed, a
    configuration that sets them must use the new names:
    
      CONFIG_CAN_PREALLOC_CONNS -> CONFIG_NET_CAN_PREALLOC_CONNS
      CONFIG_CAN_ALLOC_CONNS    -> CONFIG_NET_CAN_ALLOC_CONNS
      CONFIG_CAN_MAX_CONNS      -> CONFIG_NET_CAN_MAX_CONNS
    
    Quick fix: sed -i 
's/CONFIG_CAN_\(PREALLOC\|ALLOC\|MAX\)_CONNS/CONFIG_NET_CAN_\1_CONNS/'
    on the defconfig or .config, then run "make olddefconfig".
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: wangjinjing1 <[email protected]>
    Signed-off-by: p-szafonimateusz <[email protected]>
---
 .../arm/stm32h7/linum-stm32h753bi/configs/socketcan/defconfig  |  2 +-
 boards/arm/stm32h7/nucleo-h743zi2/configs/socketcan/defconfig  |  2 +-
 boards/arm/stm32h7/nucleo-h753zi/configs/socketcan/defconfig   |  2 +-
 boards/sim/sim/sim/configs/dynconns/defconfig                  |  2 +-
 net/can/Kconfig                                                | 10 +++++-----
 net/can/can_conn.c                                             |  9 +++++----
 6 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/boards/arm/stm32h7/linum-stm32h753bi/configs/socketcan/defconfig 
b/boards/arm/stm32h7/linum-stm32h753bi/configs/socketcan/defconfig
index 0e9a1e41a1a..7f899957950 100644
--- a/boards/arm/stm32h7/linum-stm32h753bi/configs/socketcan/defconfig
+++ b/boards/arm/stm32h7/linum-stm32h753bi/configs/socketcan/defconfig
@@ -27,7 +27,6 @@ CONFIG_BUILTIN=y
 CONFIG_CANUTILS_CANDUMP=y
 CONFIG_CANUTILS_CANSEND=y
 CONFIG_CANUTILS_LIBCANUTILS=y
-CONFIG_CAN_PREALLOC_CONNS=2
 CONFIG_DEBUG_FEATURES=y
 CONFIG_DEBUG_NET=y
 CONFIG_DEBUG_NET_ERROR=y
@@ -48,6 +47,7 @@ CONFIG_NETDEV_CAN_IOCTL=y
 CONFIG_NETDEV_IFINDEX=y
 CONFIG_NETDEV_LATEINIT=y
 CONFIG_NET_CAN=y
+CONFIG_NET_CAN_PREALLOC_CONNS=2
 CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE=500
 CONFIG_NET_CAN_RAW_TX_DEADLINE=y
 CONFIG_NET_CAN_SOCK_OPTS=y
diff --git a/boards/arm/stm32h7/nucleo-h743zi2/configs/socketcan/defconfig 
b/boards/arm/stm32h7/nucleo-h743zi2/configs/socketcan/defconfig
index a2326c1f7d3..e069086b43a 100644
--- a/boards/arm/stm32h7/nucleo-h743zi2/configs/socketcan/defconfig
+++ b/boards/arm/stm32h7/nucleo-h743zi2/configs/socketcan/defconfig
@@ -28,7 +28,6 @@ CONFIG_BUILTIN=y
 CONFIG_CANUTILS_CANDUMP=y
 CONFIG_CANUTILS_CANSEND=y
 CONFIG_CANUTILS_LIBCANUTILS=y
-CONFIG_CAN_PREALLOC_CONNS=2
 CONFIG_DEBUG_FEATURES=y
 CONFIG_DEBUG_NET=y
 CONFIG_DEBUG_NET_ERROR=y
@@ -45,6 +44,7 @@ CONFIG_NETDEV_CAN_IOCTL=y
 CONFIG_NETDEV_IFINDEX=y
 CONFIG_NETDEV_LATEINIT=y
 CONFIG_NET_CAN=y
+CONFIG_NET_CAN_PREALLOC_CONNS=2
 CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE=500
 CONFIG_NET_CAN_RAW_TX_DEADLINE=y
 CONFIG_NET_CAN_SOCK_OPTS=y
diff --git a/boards/arm/stm32h7/nucleo-h753zi/configs/socketcan/defconfig 
b/boards/arm/stm32h7/nucleo-h753zi/configs/socketcan/defconfig
index 85a3f02dde4..0214ace4226 100644
--- a/boards/arm/stm32h7/nucleo-h753zi/configs/socketcan/defconfig
+++ b/boards/arm/stm32h7/nucleo-h753zi/configs/socketcan/defconfig
@@ -28,7 +28,6 @@ CONFIG_BUILTIN=y
 CONFIG_CANUTILS_CANDUMP=y
 CONFIG_CANUTILS_CANSEND=y
 CONFIG_CANUTILS_LIBCANUTILS=y
-CONFIG_CAN_PREALLOC_CONNS=2
 CONFIG_DEBUG_FEATURES=y
 CONFIG_DEBUG_NET=y
 CONFIG_DEBUG_NET_ERROR=y
@@ -45,6 +44,7 @@ CONFIG_NETDEV_CAN_IOCTL=y
 CONFIG_NETDEV_IFINDEX=y
 CONFIG_NETDEV_LATEINIT=y
 CONFIG_NET_CAN=y
+CONFIG_NET_CAN_PREALLOC_CONNS=2
 CONFIG_NET_CAN_RAW_DEFAULT_TX_DEADLINE=500
 CONFIG_NET_CAN_RAW_TX_DEADLINE=y
 CONFIG_NET_CAN_SOCK_OPTS=y
diff --git a/boards/sim/sim/sim/configs/dynconns/defconfig 
b/boards/sim/sim/sim/configs/dynconns/defconfig
index 0e75bdcdcd3..d517d6b7571 100644
--- a/boards/sim/sim/sim/configs/dynconns/defconfig
+++ b/boards/sim/sim/sim/configs/dynconns/defconfig
@@ -17,7 +17,6 @@ CONFIG_BOARDCTL_ROMDISK=y
 CONFIG_BOARD_LOOPSPERMSEC=0
 CONFIG_BOOT_RUNFROMEXTSRAM=y
 CONFIG_BUILTIN=y
-CONFIG_CAN_ALLOC_CONNS=1
 CONFIG_CODECS_BASE64=y
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_CRYPTODEV=y
@@ -57,6 +56,7 @@ CONFIG_NET_BLUETOOTH=y
 CONFIG_NET_BLUETOOTH_ALLOC_CONNS=1
 CONFIG_NET_BROADCAST=y
 CONFIG_NET_CAN=y
+CONFIG_NET_CAN_ALLOC_CONNS=1
 CONFIG_NET_CAN_EXTID=y
 CONFIG_NET_CAN_NOTIFIER=y
 CONFIG_NET_CAN_SOCK_OPTS=y
diff --git a/net/can/Kconfig b/net/can/Kconfig
index 0c68f3cf95c..ee629796bc8 100644
--- a/net/can/Kconfig
+++ b/net/can/Kconfig
@@ -41,7 +41,7 @@ config NET_CAN_WRITE_BUFFERS
                You might want to disable CAN write buffering on a highly memory
                memory constrained system where there are no performance issues.
 
-config CAN_PREALLOC_CONNS
+config NET_CAN_PREALLOC_CONNS
        int "Preallocated CAN socket connections"
        default 4
        ---help---
@@ -55,7 +55,7 @@ config CAN_PREALLOC_CONNS
 
                Set to 0 to disable (and rely only on dynamic allocations).
 
-config CAN_ALLOC_CONNS
+config NET_CAN_ALLOC_CONNS
        int "Dynamic CAN connections allocation"
        default 0
        ---help---
@@ -71,12 +71,12 @@ config CAN_ALLOC_CONNS
                connection is no longer needed, it will be returned to the
                free connections pool, and it will never be deallocated!
 
-config CAN_MAX_CONNS
+config NET_CAN_MAX_CONNS
        int "Maximum number of CAN connections"
        default 0
-       depends on CAN_ALLOC_CONNS > 0
+       depends on NET_CAN_ALLOC_CONNS > 0
        ---help---
-               If dynamic connections allocation is selected (CAN_ALLOC_CONNS 
> 0)
+               If dynamic connections allocation is selected 
(NET_CAN_ALLOC_CONNS > 0)
                this will limit the number of connections that can be allocated.
 
                This is useful in case the system is under very heavy load (or
diff --git a/net/can/can_conn.c b/net/can/can_conn.c
index 7547aaf333b..0312770a795 100644
--- a/net/can/can_conn.c
+++ b/net/can/can_conn.c
@@ -49,8 +49,8 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#ifndef CONFIG_CAN_MAX_CONNS
-#  define CONFIG_CAN_MAX_CONNS 0
+#ifndef CONFIG_NET_CAN_MAX_CONNS
+#  define CONFIG_NET_CAN_MAX_CONNS 0
 #endif
 
 /****************************************************************************
@@ -60,8 +60,9 @@
 /* The array containing all NetLink connections. */
 
 NET_BUFPOOL_DECLARE(g_can_connections, sizeof(struct can_conn_s),
-                    CONFIG_CAN_PREALLOC_CONNS, CONFIG_CAN_ALLOC_CONNS,
-                    CONFIG_CAN_MAX_CONNS);
+                    CONFIG_NET_CAN_PREALLOC_CONNS,
+                    CONFIG_NET_CAN_ALLOC_CONNS,
+                    CONFIG_NET_CAN_MAX_CONNS);
 
 /* A list of all allocated NetLink connections */
 

Reply via email to