OSDN Git Service

can: rx-offload: Prepare for CAN FD support
authorJoakim Zhang <qiangqing.zhang@nxp.com>
Fri, 12 Jul 2019 08:02:38 +0000 (08:02 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 11 Nov 2019 20:58:10 +0000 (21:58 +0100)
commit4e9c9484b085dbba60b299182dd490eaeb84d18a
tree2132ffbed1a86dc3085c9a2c0cad7fd2d1f9c2f8
parent61d2350615c2c42f7af65d9a575f5dbf9738a10e
can: rx-offload: Prepare for CAN FD support

The skbs for classic CAN and CAN FD frames are allocated with seperate
functions: alloc_can_skb() and alloc_canfd_skb().

In order to support CAN FD frames via the rx-offload helper, the driver
itself has to allocate the skb (depending whether it received a classic
CAN or CAN FD frame), as the rx-offload helper cannot know which kind of
CAN frame the driver has received.

This patch moves the allocation of the skb into the struct
can_rx_offload::mailbox_read callbacks of the the flexcan and ti_hecc
driver and adjusts the rx-offload helper accordingly.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c
drivers/net/can/rx-offload.c
drivers/net/can/ti_hecc.c
include/linux/can/rx-offload.h