Skip to content

Commit 5f8983f

Browse files
henrikbrixandersencarlescufi
authored andcommitted
drivers: can: npl: ensure CANFD_FDF flag is defined
Linux kernels before v5.14 do not define the CANFD_FDF flag. The flag is disregarded within the Linux kernel. It is just there for being able to reuse the canfd_frame struct for classic CAN frames in Linux user-space applications. Define the CANFD_FDF flag locally if not already defined to allow compiling against older Linux kernel headers. See the following Linux kernel commit for further details: 02546884221279da2725e87e35348290470363d7 Signed-off-by: Henrik Brix Andersen <[email protected]>
1 parent b674ed6 commit 5f8983f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/can/can_native_posix_linux_socketcan.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535

3636
#include "can_native_posix_linux_socketcan.h"
3737

38+
#ifndef CANFD_FDF
39+
/* Linux kernels before v5.14 do not define CANFD_FDF */
40+
#define CANFD_FDF 0x04
41+
#endif /* CANFD_FDF */
42+
3843
int linux_socketcan_iface_open(const char *if_name)
3944
{
4045
struct sockaddr_can addr;

0 commit comments

Comments
 (0)