mirror of https://github.com/commaai/panda.git
socketcan: support newer kernels with renamed macro (#765)
This commit is contained in:
parent
e9a4a2b688
commit
bb5e2ccd00
|
@ -15,6 +15,5 @@ jobs:
|
|||
run: |
|
||||
cd drivers/linux
|
||||
make link
|
||||
make all
|
||||
make build
|
||||
make install
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <linux/module.h> // Core header for loading LKMs into the kernel
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/usb.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
/* vendor and product id */
|
||||
#define PANDA_MODULE_NAME "panda"
|
||||
|
@ -283,7 +284,11 @@ static void panda_usb_process_can_rx(struct panda_dev_priv *priv_dev,
|
|||
//if (msg->dlc & MCBA_DLC_RTR_MASK)
|
||||
// cf->can_id |= CAN_RTR_FLAG;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
|
||||
cf->can_dlc = get_can_dlc(msg->bus_dat_len & PANDA_DLC_MASK);
|
||||
#else
|
||||
cf->can_dlc = can_cc_dlc2len(msg->bus_dat_len & PANDA_DLC_MASK);
|
||||
#endif
|
||||
|
||||
memcpy(cf->data, msg->data, cf->can_dlc);
|
||||
|
||||
|
|
Loading…
Reference in New Issue