Hi all,

Hopefully I'm not being too pushy posting here while not subscribed,
please followup if you do have a clue, I'd appreciate it!  Thanks.

I'm running an Debian 2.6.17 system with usbutils 0.72-4 package
installed, including the lsusb utility.  I'm trying to write a driver
(userspace for now!) for the SanDisk ImageMate 12-in-1 card reader.
It's got a button on the side which when pressed either sends an event
to the host, or I need to poll a USB end-point to see what the status
is.  I think.  I've gotten a trace using the usbsnoop program from an
Windows XP box, but I'm having problems parsing the output.   That's
another step though...

Anyway, I'm using as my skeleton the code that Greg Kroah-Hartman
posted in a Linux Journal article
(http://www.linuxjournal.com/node/7466) on how to use the libusb
library to go through and find all devices on a bus.  But it's not
working as I expected, nor is the lsusb code.  

When I do 'lsusb' I get the followig:

    > lsusb
    Bus 003 Device 001: ID 0000:0000  
    Bus 004 Device 001: ID 0000:0000  
    Bus 002 Device 010: ID 050d:0109 Belkin Components F5U109/F5U409 PDA Adapter
    Bus 002 Device 004: ID 047d:105d Kensington 
    Bus 002 Device 003: ID 0a5c:3535 Broadcom Corp. 
    Bus 002 Device 001: ID 0000:0000  
    Bus 002 Device 002: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
    Bus 001 Device 001: ID 0000:0000  

But when I do 'lsusb -t' I see even more devices!  What's up here?

    > lsusb -t
    Bus#  4
    `-Dev#   1 Vendor 0x0000 Product 0x0000
    Bus#  3
    `-Dev#   1 Vendor 0x0000 Product 0x0000
    Bus#  2
    `-Dev#   1 Vendor 0x0000 Product 0x0000
      |-Dev#   2 Vendor 0x0451 Product 0x2046
      | `-Dev#  10 Vendor 0x050d Product 0x0109
      `-Dev#   3 Vendor 0x0a5c Product 0x3535
        `-Dev#   4 Vendor 0x047d Product 0x105d
    Bus#  1
    `-Dev#   1 Vendor 0x0000 Product 0x0000
      `-Dev#  12 Vendor 0x0781 Product 0x8989


Specifically, my code is looking for the device on Bus 1, Vendor
0x0781, Product 0x8989 and not finding just like a plain 'lsusb' isn't
finding it.  Here's my output:

    B:003  V=0x0000, Id=0x0000, T=0x01 (Device) bDevClass 0x9 (Hub)
    B:004  V=0x0000, Id=0x0000, T=0x01 (Device) bDevClass 0x9 (Hub)
    B:002  V=0x050d, Id=0x0109, T=0x01 (Device) bDevClass 0x0 (Per Interface)
    B:002  V=0x047d, Id=0x105d, T=0x01 (Device) bDevClass 0xe0 (Unknown!)
    B:002  V=0x0a5c, Id=0x3535, T=0x01 (Device) bDevClass 0x9 (Hub)
    B:002  V=0x0000, Id=0x0000, T=0x01 (Device) bDevClass 0x9 (Hub)
    B:002  V=0x0451, Id=0x2046, T=0x01 (Device) bDevClass 0x9 (Hub)
    B:001  V=0x0000, Id=0x0000, T=0x01 (Device) bDevClass 0x9 (Hub)
    Device not found

And of course my code is at the end.  Do I need to check when I find a
bDevClass of type 0x9 and then enumerate the devices (ports?) attached
to a hub to find out if there are other sub-devices on there?  I'll
keep hacking on this, but I find the libusb library not the simplest
thing to find.

Thanks,
John
john'at'stoffel'dot'org

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to