[sane-devel] snooping of USB within linux

Stéphane VOLTZ stefdev at modulonet.fr
Mon Jan 2 07:27:11 UTC 2006

Le Samedi 31 Décembre 2005 13:57, Henning Meier-Geinitz a écrit :
> Hi,
> On 2005-12-29 23:25, Stephen More wrote:
> > I thought I would try and write a backend for SANE. I have used UsbSnoop
> > on windows  to collect some of the URB Data.  What is the equivalent
> > program on linux to snoop USB to see what I am actually sending ? With
> > any luck the output of both should be the same.
> As far as I know, there is no such program. However, I also have never
> seen the need of one until now.
> What you can do to look at what's actually sent to and received from
> the scanner is to enable debugging: export SANE_DEBUG_SANEI_USB=255.
> If your backend uses sanei_usb functions, you'll get all the necessary
> information.
> If I remember correctly, there is a similar feature in the Linux kernel.
> Such low level debugging is usefull if you try to find hardware bugs
> like the toggle issues found in some USB chipsets.
> Bye,
>   Henning


	yes there is such a feature in linux kernel. You'll have to recompile your 
kernel with the following option (from kernel's configuration help):


If you say Y here, a component which captures the USB traffic
between peripheral-specific drivers and HC drivers will be built. 
For more information, see <file:Documentation/usb/usbmon.txt>. 
This is somewhat experimental at this time, but it should be safe.

If unsure, say Y.
Symbol: USB_MON [=y] 
Prompt: USB Monitor
  Defined at drivers/usb/mon/Kconfig:5 
  Depends on: USB  
    -> Device Drivers 
      -> USB support 
        -> Support for Host-side USB (USB [=m]) 


More information about the sane-devel mailing list