[sane-devel] Help with usb scanner module

Henning Meier-Geinitz henning@meier-geinitz.de
Thu, 17 Jan 2002 19:06:48 +0100


Hi,

On Thu, Jan 17, 2002 at 01:09:01AM +0000, David Stevenson wrote:
> I am trying to find my way round to write a Bearpaw 1200TA driver. So here 
> are some queries that I am stuck on.
> 
> I am loading "modprobe scanner"

The normal USB scanner driver now detects the gt-6816 chip? Or does this chip
have more than one endpoint?

> and sane-find-scanner then reports 
> sane-find-scanner: found USB scanner (vendor = 0x055f, product = 0x021e) at 
> device /dev/usb/scanner0
> sane-find-scanner: found USB scanner (vendor = 0x055f, product = 0x021e) at 
> device /dev/usbscanner
> sane-find-scanner: found USB scanner (vendor = 0x055f, product = 0x021e) at 
> device /dev/usbscanner0
> 
> Is it correct to find it 3 times?

Yes. You seem to have all these device files having the same major minor
numbers (or maybe they are symlinks to the same device).

> I have the start of a test program that opens /dev/usb/scanner0 and reads
> the vendor and product numbers.

By your own code or sanei/sanei_usb.c?

> This works but after it has run once "lsmod"
> then
>
> shows
> Module                  Size  Used by
> scanner                 7984   7
> usb-uhci               21488   0  (unused)
> Subsequent runs do not alter the used number, but I now cannot rmmod scanner 
> as it is 'in use'. Is there something obvious I have done wrong?

I'm pretty sure that this is a kernel bug. Which kernel version? There was a
bug in the scanner module that had similar problems if I remember correctly:
http://www.jump.net/~dnelson/linux/usb/ . 0.4.7 fixed it for me.
 
> Where is devrequest defined?  As in
> struct ctrlmsg_ioctl {
> 	devrequest	req;
> 	void		*data;
> 		} cmsg;

For SANE? In sanei_usb.c. You shouldn't need it in your code if I understood
correctly. In the Linux kernel: linux/include/linux/usb.h . Howver, kernel
headers shouldn't be included in user space.

Bye,
  Henning