network: can: Fix CAN initialization
authorClemens Gruber <clemens.gruber@pqgruber.com>
Fri, 21 Aug 2020 14:03:23 +0000 (16:03 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 24 Aug 2020 07:33:25 +0000 (09:33 +0200)
commitf594b5feabee38dded4b7ae288fba6c3b6c79a45
tree82c639090a0eb5b2c40a5e1eb41e8bd9f8b8e7de
parent69bb9f999c7e470ca4ce3f16aca1bc42aeb87adc
network: can: Fix CAN initialization

When introducing CAN-FD support, the .can_fd_mode was not initalized
with -1 and due to cm.mask containing the CAN_CTRLMODE_FD bit, it was
not ignored when FDMode was not configured but instead disabled.
The same thing happened when listen-only mode support was introduced.

On chips that do not support these features, this lead to an error:
can0: Failed to configure CAN link: Operation not supported

Fix it by intializing all the CAN related tristate variables
(.can_listen_only, .can_fd_mode and .can_non_iso) to -1.
src/network/networkd-network.c