[sane-devel] Hai, about probe_scanner can't be probed

Henning Meier-Geinitz henning at meier-geinitz.de
Thu Apr 10 10:28:27 BST 2003


Hi,

On Tue, Apr 08, 2003 at 10:41:33PM +0800, Fan Dan wrote:
> Hai, Henning

Have you read my response to your other posting? Could you please
answer my questions? If something is unclear, please ask. I'm not a
native English speaker so sometimes I'm writing crap :-)

Ok, I understand the problem now. The scanner has two endpoints with
the same number but different "directions":
     bEndpointAddress    =   81 (in)
     bEndpointAddress    =   01 (out)

I have never seens this. In fact I just have checked all the outputs
of scanners I have and none uses the same number for two different
endpoints.

Does anyone know if that's complient to the USB spec at all?

>    Today, I modified scanner.c for Mustek A3Pro usb scanner (0x055f 
> 0x0401)
> In probe_scanner.
> modified
> have_bulk_in = 1
> have_bulk_out =2
> have_intr = 3
> to 
> have_bulk_in = 0
> have_bulk_out = 1
> have_bulk_intr = 2


> /////////////////////////////////////////
> + have_bulk_in--
> + have_bulk_out--
> + have_intr--

> then scanner that has three endpoints can be probed successly, because 
> maxpacketout[3] = 0, but maxpacketout[2] = 1 in USB module; 

I see. But wouldn't be the right approach:

have_bulk_in = 1
have_bulk_out = 1
have_bulk_intr = 2

At least according to your log in your previous message?

> And scanner can be writed, but we can't read  from that. so I midified some 
> code int read_scanner function.
> //////////////////////////////////////////////////////
> - result = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, scn->bulk_in_ep), ibuf, 
> this_read, &partial, scn->rd_nak_timeout);
> + result = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, scn->bulk_out_ep), ibuf, 
> this_read, &partial, scn->rd_nak_timeout);
> /////////////////////////////////////////////////////
> Then scanner can be write and read.

Ok, but I'll never accept code like this in the kernel :-)

> I want to know that there are three endpoint in scanner, but why both in 
> bulk and out bulk are in same ep? Whether is that OK??

I don't think so, but I'll have to check the USB spec. It's extremely
unusual at least.

I'll ask on linux-usb-devel for some details.

Bye,
  Henning



More information about the sane-devel mailing list