Ulrich Van Den Hekke wrote:
> I have a Colorado USB 19200 scanner.
> I find a driver but for an old kernel in page : http://viceo.orcon.net.nz/ >
> I would like to update him to work with kernel 2.6 and libusb.
> But i don't know how begin.
> Where can i find documentation to write driver for my scanner ?
I think the first thing to do is to contact the maintainer of the
viceo backend and ask him if he can update the backend.
In order to convert the backend from using a kernel interface into
using libusb, you need to look at the functions provided by
include/sane/sanei_usb.h. You should be able to replace all
open/read/write/ioctl/close references by a suitable function
Typical conversions are:
open -> sanei_usb_open
ioctl -> sanei_usb_control_msg (for IOCTL_READ_REGISTERS and
IOCTL_WRITE_REGISTERS ioctls anyway)
read -> sanei_usb_read_bulk
write -> sanei_usb_write_bulk
close -> sanei_usb_close
You can probably get the arguments for the sanei_usb_control_msg
function from the old kernel patch.
Also you may need to update the mechanism for detection of a
scanner. For example, you can use function sanei_usb_find_devices
to receive call-backs for every device supported by your backend.