Skip to contentSkip to conversation

can: Kconfig: select CAN driver infrastructure by default

can-next Oliver Hartkopp 2 participants 3 messages Nov 28, 2025

Subsystems (4)
lore
Share & tools
lore

Oliver Hartkopp

author maintainer
#0 lore raw

The CAN bus support enabled with CONFIG_CAN provides a socket-based access to CAN interfaces. With the introduction of the latest CAN protocol CAN XL additional configuration status information needs to be exposed to the network layer than formerly provided by standard Linux network drivers.

This requires the CAN driver infrastructure to be selected by default. As the CAN network layer can only operate on CAN interfaces anyway all distributions and common default configs enable at least one CAN driver.

So selecting CONFIG_CAN_DEV when CONFIG_CAN is selected by the user has no effect on established configurations but solves potential build issues when CONFIG_CAN[_XXX]=y is set together with CANFIG_CAN_DEV=m

Fixes 1a620a723853 ("can: raw: instantly reject unsupported CAN frames")
---
 net/can/Kconfig | 1 +
 1 file changed, 1 insertion(+)
net/can/Kconfig +1 -0
index af64a6f76458..e4ccf731a24c 100644
@@ -3,10 +3,11 @@
 # Controller Area Network (CAN) network layer core configuration
 #
 
 menuconfig CAN
 	tristate "CAN bus subsystem support"
+	select CAN_DEV
 	help
 	  Controller Area Network (CAN) is a slow (up to 1Mbit/s) serial
 	  communications protocol. Development of the CAN bus started in
 	  1983 at Robert Bosch GmbH, and the protocol was officially
 	  released in 1986. The CAN bus was originally mainly for automotive,
Signature · 1 line
2.47.3
#1 lore raw
Quoted 9 lines · Oliver Hartkopp

The CAN bus support enabled with CONFIG_CAN provides a socket-based access to CAN interfaces. With the introduction of the latest CAN protocol CAN XL additional configuration status information needs to be exposed to the network layer than formerly provided by standard Linux network drivers.

This requires the CAN driver infrastructure to be selected by default. As the CAN network layer can only operate on CAN interfaces anyway all distributions and common default configs enable at least one CAN driver.

Quoted 8 lines

So selecting CONFIG_CAN_DEV when CONFIG_CAN is selected by the user has no effect on established configurations but solves potential build issues when CONFIG_CAN[_XXX]=y is set together with CANFIG_CAN_DEV=m

Fixes 1a620a723853 ("can: raw: instantly reject unsupported CAN frames")

I think we take this, at least for now. But I'll remove my Suggested-by, which was a leftover from v3.

Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |
author maintainer
#2 lore raw
Quoted 14 lines · Marc Kleine-Budde
Quoted 13 lines · Oliver Hartkopp

The CAN bus support enabled with CONFIG_CAN provides a socket-based access to CAN interfaces. With the introduction of the latest CAN protocol CAN XL additional configuration status information needs to be exposed to the network layer than formerly provided by standard Linux network drivers.

This requires the CAN driver infrastructure to be selected by default. As the CAN network layer can only operate on CAN interfaces anyway all distributions and common default configs enable at least one CAN driver.

So selecting CONFIG_CAN_DEV when CONFIG_CAN is selected by the user has no effect on established configurations but solves potential build issues when CONFIG_CAN[_XXX]=y is set together with CANFIG_CAN_DEV=m

Quoted 7 lines
Quoted 4 lines
Fixes 1a620a723853 ("can: raw: instantly reject unsupported CAN frames")

I think we take this, at least for now. But I'll remove my Suggested-by, which was a leftover from v3.

Sure?

I remember you suggested some Kconfig magic :-D

Ok, this patch has not so much magic inside ... but it is tested!

Best regards,
Oliver