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.
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -15,9 +15,9 @@ · 14 unmodified lines | |||
| 15 | struct can_rx_offload { | 15 | struct can_rx_offload { |
| 16 | struct net_device *dev; | 16 | struct net_device *dev; |
| 17 | 17 | ||
| 18 | unsigned int (*mailbox_read)(struct can_rx_offload *offload, | 18 | struct sk_buff *(*mailbox_read)(struct can_rx_offload *offload, |
| 19 | struct can_frame *cf, | 19 | unsigned int mb, u32 *timestamp, |
| 20 | u32 *timestamp, unsigned int mb); | 20 | bool drop); |
| 21 | 21 | ||
| 22 | struct sk_buff_head skb_queue; | 22 | struct sk_buff_head skb_queue; |
| 23 | u32 skb_queue_len_max; | 23 | u32 skb_queue_len_max; |