CAEN V1718 VME-USB2.0 Bridge Linux drivers Fixed

The Linux drivers for CAEN V1718 VME-USB2.0 Bridge contain few bugs that give problem in opening connection to the device.
Here I collect the fixes I developed to make it work properly on my box (Debian Squeeze, kernel "3.0.40+luca-barion-0 #2 SMP Thu Aug 23 17:43:23 CEST 2012 x86_64 GNU/Linux")

Kernel module

Kernel module source has a bug in minor calculation: modify it, according to diff below, recompile and load.
Once loaded you have to add a link to the device (there is a bug also in the binary library shipped by CAEN that points to the wrong device file) and set the permissions on the device:
mkdir /dev/usb
ln -s /dev/v1718_0 /dev/usb/v1718_0
chmod go+rw /dev/v1718_0

diff of v1718.c (kernel module):
187c187,191
<       subminor = MINOR(inode->i_rdev) - V1718_MINOR_BASE;
---
>       // 2012/08/24 Luca Barion
>       // I think V1718_MINOR_BASE constant should not be subtracted
> 
>       //subminor = MINOR(inode->i_rdev) - V1718_MINOR_BASE;
>       subminor = MINOR(inode->i_rdev);


Library manual installation:

I prefer to keep things clean, not mixing system and custom libraries: copy libCAENVME.so.2.30.2 to /usr/local/lib/ and create the proper link
 ln -s libCAENVME.so.2.30.2 libCAENVME.so
If not already set, remember to
 export LD_LIBRARY_PATH=/usr/local/lib/

Enjoy!