linux-sg2042/drivers/net/can/sja1000
Oliver Hartkopp c7cd606f60 can: Fix data length code handling in rx path
A valid CAN dataframe can have a data length code (DLC) of 0 .. 8 data bytes.

When reading the CAN controllers register the 4-bit value may contain values
from 0 .. 15 which may exceed the reserved space in the socket buffer!

The ISO 11898-1 Chapter 8.4.2.3 (DLC field) says that register values > 8
should be reduced to 8 without any error reporting or frame drop.

This patch introduces a new helper macro to cast a given 4-bit data length
code (dlc) to __u8 and ensure the DLC value to be max. 8 bytes.

The different handlings in the rx path of the CAN netdevice drivers are fixed.

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-13 19:47:42 -08:00
..
Kconfig can: Fix driver Kconfig structure 2009-11-13 19:56:55 -08:00
Makefile can: sja1000: legacy SJA1000 ISA bus driver 2009-09-04 02:16:16 -07:00
ems_pci.c ems_pci: fix size of CAN controllers BAR mapping for CPC-PCI v2 2009-09-24 15:39:18 -07:00
kvaser_pci.c can: sja1000: stop misusing member base_addr of struct net_device 2009-06-01 02:53:34 -07:00
sja1000.c can: Fix data length code handling in rx path 2009-12-13 19:47:42 -08:00
sja1000.h can: make the number of echo skb's configurable 2009-10-13 03:44:04 -07:00
sja1000_isa.c can: sja1000: legacy SJA1000 ISA bus driver 2009-09-04 02:16:16 -07:00
sja1000_of_platform.c net: Fix OF platform drivers coldplug/hotplug when compiled as modules 2009-10-14 14:54:52 -07:00
sja1000_platform.c can: sja1000: stop misusing member base_addr of struct net_device 2009-06-01 02:53:34 -07:00