norly/elmcan

fail in compiling

Closed this issue · 1 comments

Hi,
I have kernel 4.9.232, I have tried to build elmcan but I have got the error below, is that because my kernet is not 4.11?

khadas@Khadas:~/elmcan/module$ make
make -C /lib/modules/4.9.232/build M=/home/khadas/elmcan/module modules
make[1]: Entering directory '/usr/src/linux-headers-4.9.232'
CC [M] /home/khadas/elmcan/module/elmcan.o
/home/khadas/elmcan/module/elmcan.c: In function ‘elmcan_ldisc_open’:
/home/khadas/elmcan/module/elmcan.c:1118:11: error: ‘struct can_priv’ has no member named ‘bitrate_const’; did you mean ‘bittiming_const’?
elm->can.bitrate_const = elmcan_bitrate_const;
^~~~~~~~~~~~~
bittiming_const
/home/khadas/elmcan/module/elmcan.c:1119:10: error: ‘struct can_priv’ has no member named ‘bitrate_const_cnt’
elm->can.bitrate_const_cnt = ARRAY_SIZE(elmcan_bitrate_const);
^
scripts/Makefile.build:340: recipe for target '/home/khadas/elmcan/module/elmcan.o' failed
make[2]: *** [/home/khadas/elmcan/module/elmcan.o] Error 1
Makefile:1656: recipe for target 'module/home/khadas/elmcan/module' failed
make[1]: *** [module/home/khadas/elmcan/module] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.232'
Makefile:4: recipe for target 'all' failed
make: *** [all] Error 2

norly commented

That is correct. As hinted at in the README (I guess I could expand on that?), the code needs Linux commit 431af779256c to be able to set the bitrate without calculating it from other timing parameters.

You can try reverting the changes I made starting with a44b237 but the code before that was a reeeeally ugly hack ;)
If you get that to work, the rest should be fine IIRC.