On 10/20/20 2:38 PM, Oliver Hartkopp wrote: [...] > You can create a DLC of 13 for Classical CAN. And your CAN controller > gets 8 bytes from it and says to the network layer: Here is a CAN frame > with 8 bytes payload. > > Have you ever read out a CAN controller register and found a value > greater than 8 on the register of the DLC value? > > I believe you didn't. The CAN controller sees the DLC but provides 8 > bytes as DLC=8. I just checked on the flexcan (mx6) and the mcp2518fd. I hardcoded a TX-dlc of 12 in both drivers and printed the raw dlc value in the RX-path: > Oct 20 16:46:08 riot kernel: flexcan_mailbox_read: dlc=12 > Oct 20 16:46:10 riot kernel: mcp251xfd_hw_rx_obj_to_skb: dlc=12 The userspace shows a consistent len=8. If we want to support CAN-2.0 with DLC > 8, we have to audit the TX-path every driver and remove the can_dropped_invalid_skb() check. I'm not sure what to do about the RX, with breaking user space ABI. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: OpenPGP digital signature