can: enable CAN FD for virtual CAN devices by default
authorOliver Hartkopp <socketcan@hartkopp.net>
Fri, 2 Jun 2017 17:37:30 +0000 (19:37 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 9 Jun 2017 12:39:02 +0000 (14:39 +0200)
CAN FD capable CAN interfaces can handle (classic) CAN 2.0 frames too.
New users usually fail at their first attempt to explore CAN FD on
virtual CAN interfaces due to the current CAN_MTU default.

Set the MTU to CANFD_MTU by default to reduce this confusion.
If someone *really* needs a 'classic CAN'-only device this can be set
with the 'ip' tool with e.g. 'ip link set vcan0 mtu 16' as before.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/vcan.c
drivers/net/can/vxcan.c

index 0eda1b308583ec474d2b420f746426381b50bc1e..a8cb33264ff1ef32e9f9d44955e07f768f1cc543 100644 (file)
@@ -152,7 +152,7 @@ static const struct net_device_ops vcan_netdev_ops = {
 static void vcan_setup(struct net_device *dev)
 {
        dev->type               = ARPHRD_CAN;
-       dev->mtu                = CAN_MTU;
+       dev->mtu                = CANFD_MTU;
        dev->hard_header_len    = 0;
        dev->addr_len           = 0;
        dev->tx_queue_len       = 0;
index 30cf2368becfb6ea4896a4152ec2fc957c679b75..cfe889e8f1723823d5a3b9db71e9ba438624a9a2 100644 (file)
@@ -150,7 +150,7 @@ static const struct net_device_ops vxcan_netdev_ops = {
 static void vxcan_setup(struct net_device *dev)
 {
        dev->type               = ARPHRD_CAN;
-       dev->mtu                = CAN_MTU;
+       dev->mtu                = CANFD_MTU;
        dev->hard_header_len    = 0;
        dev->addr_len           = 0;
        dev->tx_queue_len       = 0;