-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi!
I want to write a linux driver for my USB scanner which is currently not yet supported by sane. So I wonder where to start; where do I find detailed information about the Windows driver interface, esp. for USB scanners. I want to know which interface a driver has to offer to Windows and which functionality the API has to offer.
Thanks in advance for any help.
- -- Heiko Nardmann
I want to write a linux driver for my USB scanner which is currently not yet supported by sane. So I wonder where to start; where do I find detailed information about the Windows driver interface, esp. for USB scanners. I want to know which interface a driver has to offer to Windows and which functionality the API has to offer.
www.msdn.com might be useful I guess.
On Thu, 13 Jan 2005, Heiko Nardmann wrote: [...]
I want to write a linux driver for my USB scanner which is currently not yet supported by sane. So I wonder where to start; where do I find detailed information about the Windows driver interface, esp. for USB scanners. I want to know which interface a driver has to offer to Windows and which functionality the API has to offer.
Well I think the right solution would be to add support for your scanner to SANE. Then Wine should be able to use it using the twain dll (see dlls/twain) which acts as a bridge to SANE.
Interfacing directly with the scanner might work using Wine's brand new and very incomplete USB interface (I believe part of it is in setupapi) but that would probably be more code and you would still end up writing what is essentially a driver. In other words in either case you will probably need the hardware specifications.
Interfacing directly with the scanner might work using Wine's brand new and very incomplete USB interface (I believe part of it is in setupapi) but that would probably be more code and you would still end up writing what is essentially a driver.
Nope. On "client" side it would be just the regular windows application + its usb driver. On wine side, it would be the WDM hooks to forward usb requests and replies to libusb.
I presume that a good starting point would be to have a look at ndiswrapper.sourceforge.net. They implement USB WDM (amongst others) from scratch, so maybe even the code would be compatible with wine (dunno about licensing, though).
In other words in either case you will probably need the hardware specifications.
Hardware specs are unexistent for most of today's scanner hardware. For reasons known to them, the manufacturers won't ever release them. I.e. good luck if you feel like getting the specs.
I presume that everything that wine needs could be implemented using libusb. Just forward the libusb functionality over via the WDM to clients running in wine. That's the only sensible approach I see.
Kuba
On Thu, Jan 13, 2005 at 11:12:46AM +0100, Heiko Nardmann wrote:
Hi!
I want to write a linux driver for my USB scanner which is currently not yet supported by sane. So I wonder where to start; where do I find detailed information about the Windows driver interface, esp. for USB scanners. I want to know which interface a driver has to offer to Windows and which functionality the API has to offer.
You will probably have to use a USB sniffer application under Windows to deduce the command set first. Many different ones exist, and install as a filter USB driver so they can log the data going to and from the scanner.