linux/drivers/net/can
Oliver Hartkopp 85809a369e can: fix handling of unmodifiable configuration options
[ Upstream commit bb208f144c ]

As described in 'can: m_can: tag current CAN FD controllers as non-ISO'
(6cfda7fbeb) it is possible to define fixed configuration options by
setting the according bit in 'ctrlmode' and clear it in 'ctrlmode_supported'.
This leads to the incovenience that the fixed configuration bits can not be
passed by netlink even when they have the correct values (e.g. non-ISO, FD).

This patch fixes that issue and not only allows fixed set bit values to be set
again but now requires(!) to provide these fixed values at configuration time.
A valid CAN FD configuration consists of a nominal/arbitration bittiming, a
data bittiming and a control mode with CAN_CTRLMODE_FD set - which is now
enforced by a new can_validate() function. This fix additionally removed the
inconsistency that was prohibiting the support of 'CANFD-only' controller
drivers, like the RCar CAN FD.

For this reason a new helper can_set_static_ctrlmode() has been introduced to
provide a proper interface to handle static enabled CAN controller options.

Reported-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Reviewed-by: Ramesh Shanmugasundaram  <ramesh.shanmugasundaram@bp.renesas.com>
Cc: <stable@vger.kernel.org> # >= 3.18
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2016-06-03 11:30:37 -04:00
..
c_can can: c_can: end pending transmission on network stop (ifdown) 2015-02-05 22:36:09 -08:00
cc770 net: can: use kbuild magic to inherit debug settings 2014-08-18 01:03:38 +02:00
m_can can: fix handling of unmodifiable configuration options 2016-06-03 11:30:37 -04:00
mscan net: can: use kbuild magic to inherit debug settings 2014-08-18 01:03:38 +02:00
sja1000 can: remove unused variable 2014-11-18 16:52:18 +01:00
softing net: can: use kbuild magic to inherit debug settings 2014-08-18 01:03:38 +02:00
spi can: mcp251x: Use dmam_alloc_coherent 2014-08-18 01:03:43 +02:00
usb can: gs_usb: fixed disconnect bug by removing erroneous use of kfree() 2016-03-20 22:14:25 -04:00
at91_can.c can: at91_can: add missing prepare and unprepare of the clock 2014-09-18 11:15:37 +02:00
bfin_can.c can: Unify MTU settings for CAN interfaces 2014-03-17 09:20:16 +01:00
dev.c can: fix handling of unmodifiable configuration options 2016-06-03 11:30:37 -04:00
flexcan.c can: flexcan: Deferred on Regulator return EPROBE_DEFER 2015-04-24 17:13:56 -04:00
grcan.c can: Unify MTU settings for CAN interfaces 2014-03-17 09:20:16 +01:00
janz-ican3.c can: Unify MTU settings for CAN interfaces 2014-03-17 09:20:16 +01:00
Kconfig drivers/net/can/Kconfig: Let CAN_AT91 depend on HAS_IOMEM 2014-10-03 15:52:03 -07:00
led.c can: only rename enabled led triggers when changing the netdev name 2014-05-27 15:05:41 +02:00
Makefile can: m_can: add Bosch M_CAN controller support 2014-08-18 01:03:41 +02:00
pch_can.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
rcar_can.c can: rcar_can: add .ndo_change_mtu function 2014-11-18 17:52:08 +01:00
slcan.c Revert "can: fix loss of CAN frames in raw_rcv" 2015-08-04 13:32:39 -04:00
ti_hecc.c can: Unify MTU settings for CAN interfaces 2014-03-17 09:20:16 +01:00
vcan.c Revert "can: fix loss of CAN frames in raw_rcv" 2015-08-04 13:32:39 -04:00
xilinx_can.c can: xilinx_can: add .ndo_change_mtu function 2014-11-18 17:52:08 +01:00