krumboeck / usb2can

SocketCAN driver for UAB "8 devices" USB2CAN interface
53 stars 24 forks source link

Issue compiling for latest Raspberry PI #13

Open diti24MG opened 2 years ago

diti24MG commented 2 years ago

I tried to compile the driver for Raspberry and I got the following compiling errors. I saw you updated recently from kernel upstream. Is there something I m missing? Thanks for looking at this:

Build output:

pi@raspiUSBCAN01:~/usb2can $ make make -C /lib/modules/5.10.103-v7+/build M=/home/pi/usb2can modules make[1]: Entering directory '/usr/src/linux-headers-5.10.103-v7+' CC [M] /home/pi/usb2can/usb_8dev.o /home/pi/usb2can/usb_8dev.c: In function ‘usb_8dev_rx_err_msg’: /home/pi/usb2can/usb_8dev.c:453:23: error: ‘struct can_frame’ has no member named ‘len’ stats->rx_bytes += cf->len; ^~ /home/pi/usb2can/usb_8dev.c: In function ‘usb_8dev_rx_can_msg’: /home/pi/usb2can/usb_8dev.c:474:3: error: implicit declaration of function ‘can_frame_set_cc_len’; did you mean ‘skb_reset_mac_len’? [-Werror=implicit-function-declaration] can_frame_set_cc_len(cf, msg->dlc & 0xF, priv->can.ctrlmode); ^~~~~~~~ skb_reset_mac_len /home/pi/usb2can/usb_8dev.c:482:34: error: ‘struct can_frame’ has no member named ‘len’ memcpy(cf->data, msg->data, cf->len); ^~ /home/pi/usb2can/usb_8dev.c:485:24: error: ‘struct can_frame’ has no member named ‘len’ stats->rx_bytes += cf->len; ^~ /home/pi/usb2can/usb_8dev.c: In function ‘usb_8dev_write_bulk_callback’: /home/pi/usb2can/usb_8dev.c:589:2: error: too many arguments to function ‘can_get_echo_skb’ can_get_echo_skb(netdev, context->echo_index, NULL); ^~~~ In file included from /home/pi/usb2can/usb_8dev.c:22: ./include/linux/can/dev.h:223:14: note: declared here unsigned int can_get_echo_skb(struct net_device dev, unsigned int idx); ^~~~ /home/pi/usb2can/usb_8dev.c: In function ‘usb_8dev_start_xmit’: /home/pi/usb2can/usb_8dev.c:641:13: error: implicit declaration of function ‘can_get_cc_dlc’; did you mean ‘can_get_echo_skb’? [-Werror=implicit-function-declaration] msg->dlc = can_get_cc_dlc(cf, priv->can.ctrlmode); ^~~~~~ can_get_echo_skb /home/pi/usb2can/usb_8dev.c:642:32: error: ‘struct can_frame’ has no member named ‘len’ memcpy(msg->data, cf->data, cf->len); ^~ /home/pi/usb2can/usb_8dev.c:660:19: error: ‘struct can_frame’ has no member named ‘len’ context->dlc = cf->len; ^~ /home/pi/usb2can/usb_8dev.c:668:2: error: too many arguments to function ‘can_put_echo_skb’ can_put_echo_skb(skb, netdev, context->echo_index, 0); ^~~~ In file included from /home/pi/usb2can/usb_8dev.c:22: ./include/linux/can/dev.h:219:5: note: declared here int can_put_echo_skb(struct sk_buff skb, struct net_device dev, ^~~~ /home/pi/usb2can/usb_8dev.c:674:3: error: too many arguments to function ‘can_free_echo_skb’ can_free_echo_skb(netdev, context->echo_index, NULL); ^~~~~ In file included from /home/pi/usb2can/usb_8dev.c:22: ./include/linux/can/dev.h:224:6: note: declared here void can_free_echo_skb(struct net_device dev, unsigned int idx); ^~~~~ /home/pi/usb2can/usb_8dev.c: In function ‘usb_8dev_probe’: /home/pi/usb2can/usb_8dev.c:941:11: error: ‘CAN_CTRLMODE_CC_LEN8_DLC’ undeclared (first use in this function); did you mean ‘CAN_CTRLMODE_LISTENONLY’? CAN_CTRLMODE_CC_LEN8_DLC; ^~~~~~~~ CAN_CTRLMODE_LISTENONLY /home/pi/usb2can/usb_8dev.c:941:11: note: each undeclared identifier is reported only once for each function it appears in cc1: some warnings being treated as errors make[2]: [scripts/Makefile.build:280: /home/pi/usb2can/usb_8dev.o] Error 1 make[1]: [Makefile:1825: /home/pi/usb2can] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-5.10.103-v7+' make: *** [Makefile:5: all] Error 2