Hi there,

I have installed a sniffer in windows to catch the USB packet sent by the USB 
driver on Windows. That is to note what Windows USB driver is doing which my 
Linux driver is not doing.

First observation was, for every one byte command it was sending four bytes of 
information. That is

as shown here below ..........


 

000001: Bulk or Interrupt Transfer (UP), 24.08.2005 12:59:51.9559319 +4.8799725

Pipe Handle: 0x82220f9c (Endpoint Address: 0x2)

Send 0x4 bytes to the device:

 

 02 45 03 40
.E.@

 

000002: Bulk or Interrupt Transfer (UP), 24.08.2005 12:59:52.0159931 +0.0600612

Pipe Handle: 0x82220f9c (Endpoint Address: 0x2)

Send 0x4 bytes to the device:

 

 02 56 03 40
.V.@


That is ........

    0x02, Command, 0x03, 0x40.

On Linux OS, it was not all responding for one byte of command sent on bulk-out 
EP.
When i also sent all four bytes , varying 2nd byte according to command keeping 
other bytes same. Scanner reponded nicely.

I really have no idead what these other bytes are ( not mentioned in Spec) not 
studied in USB spec also.

Thanks alot for all the help,
Savita.



________________________________

From: Alan Stern [mailto:[EMAIL PROTECTED]
Sent: Tue 8/23/2005 8:22 PM
To: Savita H. Neelannava
Cc: linux-usb-devel@lists.sourceforge.net
Subject: RE: [linux-usb-devel] USB Scanner not responding to commands sent on 
bulk-out endpoint



On Tue, 23 Aug 2005, Savita H wrote:

>
> Hi there,
>
> As u suggested, i installed Usb monitor module and captured the USB
> transactions. i refered
> /urs/src/linux/Documentation/usb/usbmon.txt file.
>
> Here is the output ...
>
> dac41b00 3258043428 S Bi:002:04 -115 512 <
> dad20380 3258043448 S Bi:002:06 -115 512 <
> db48be80 3261756782 S Bo:002:02 -115 1 = 56
> db48be80 3261756926 C Bo:002:02 0 1 >
> db48be80 3262534489 S Bo:002:02 -115 1 = 43
> db48be80 3262534547 C Bo:002:02 0 1 >
> db48be80 3263127258 S Bo:002:02 -115 1 = 44
> db48be80 3263127322 C Bo:002:02 0 1 >
> db48be80 3263689162 S Bo:002:02 -115 1 = 51
> db48be80 3263689227 C Bo:002:02 0 1 >
> db48be80 3264296399 S Bo:002:02 -115 1 = 57
> db48be80 3264296503 C Bo:002:02 0 1 >
> dac41b00 3270152777 C Bi:002:04 -108 0
> dad20380 3270159149 C Bi:002:06 -108 0
> dad20380 3270161310 S Co:002:00 -115 0
> dad20380 3270161524 C Co:002:00 0 0

Did you start capturing this output before plugging in the device? 
Obviously not, because it doesn't show the normal device-initialization
sequence.  This means you might have missed seeing some communications
that took place before you began monitoring.

> I am sending diffrent commands on bulk-out EP such as (0x56 - version #,
> 0x43 - Calibrate Scanner ...)
> Its shown here in the captured packets also. But the Scanner is not
> responding on any one of Bulk-in!
> Where as same scanner is working properly on Windows OS.

Maybe the scanner needs some sort of initialization that Windows performs
but your driver does not.

> As shown in the captured packets, bulk-in call functions are called only
> while unloading the driver.
>
> one more observation, i have allocated memory using kmalloc not
> usb_alloc_buffer to get this output.
>
> if i allocate bulk-out buffer using usb_buffer_alloc, output is different ..
>
> d9396e80 1008278891 S Bi:002:04 -115 512 <
> d9fb8f00 1008278911 S Bi:002:06 -115 512 <
> d949f200 1011812007 S Bo:002:02 -115 1 D
> d949f200 1011812104 C Bo:002:02 0 1 D
> d949f200 1012281878 S Bo:002:02 -115 1 D
> d949f200 1012282027 C Bo:002:02 0 1 D
> d949f200 1012937137 S Bo:002:02 -115 1 D
> d949f200 1012937292 C Bo:002:02 0 1 D
> d949f200 1013469124 S Bo:002:02 -115 1 D
> d949f200 1013469204 C Bo:002:02 0 1 D
> d949f200 1014000969 S Bo:002:02 -115 1 D
> d949f200 1014001116 C Bo:002:02 0 1 D
> d9396e80 1018005448 C Bi:002:04 -108 0
> d9fb8f00 1018011699 C Bi:002:06 -108 0
> d9fb8f00 1018013101 S Co:002:00 -115 0
> d9fb8f00 1018013197 C Co:002:00 0 0
>
> Looking at this, allocating buffer by kmalloc is correct i feel.

Both are correct.  The difference is that currently usbmon is unable to
read data buffers that are DMA-mapped.

> but whatever, this first output shows the command has sent by the driver
> properly, but device is not responding!

There are programs you can use to capture the packets sent by Windows,
like the USB Snoopy project on sourceforge.  You might find that Windows
sends the scanner some commands that your driver does not send.

Alan Stern





-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to