Discussion:
gadgetfs: host side enumeration issues
Anshuman Saxena
2008-01-19 09:55:58 UTC
Permalink
Dear All,

We have a at91 board on which we are running a stripped down version of linux 2.6.20. While we have been able to run different kernel space gadget drivers like g_ether and g_zero on the board, we are facing some problem with the test program (usb.c) that comes with the user space driver gadgetfs.

Here are the steps we take (on the board)

[root @ \h]# insmod gadgetfs.ko

gadgetfs: USB Gadget filesystem, version 24 Aug 2004

[root @ \h]# mkdir /dev/gadget

[root @ \h]# mount -t gadgetfs gadgetfs /dev/gadget

[root @ \h]# ls /dev/gadget

at91_udc

[root @ \h]# chmod 744 usb

[root @ \h]# ./usb -r "HDR" -v

gadgetfs: bound to at91_udc driver

/dev/gadget/at91_udc ep0 configured

serial="HDR"

Now we connect the board to a linux host and the above output on the board continues as below

gadgetfs: suspended from state 2

** Thu Jan 1 00:08:12 1998

SUSPEND

gadgetfs: suspenrom state 2

SUSgadgetfs: connected

CONNECT full speed

gadgetfs: disconnected

DISCONNECT

gadgetfs: connected

CONNECT full speed

SETUP 80.06 v0300 i0000 255

SETUP 80.06 v0303 i0gadgetfs: disconnected

409 255

ep0 read after poll: Level 2 halted

done

[root @ \h]#

At the host, dmesg reveals the following

usb 4-2: new full speed USB device using uhci_hcd and address 17

usb 4-2: configuration #3 chosen from 1 choice

usb 4-2: can't set config #3, error -71

usb 4-2: USB disconnect, address 17



As you can see, it does bind to the at91_udc but there seems to be some problem with the user space program usb.c. Wondering if anyone came across this issue?

Regards,

Anshuman





-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
David Brownell
2008-01-30 02:04:09 UTC
Permalink
Post by Anshuman Saxena
As you can see, it does bind to the at91_udc but there seems to be
some problem with the user space program usb.c. Wondering if anyone
came across this issue?
I finally made time to investigate it, and saw this too.

The problem seems to be that userspace didn't understand the
data it was getting. On slightly closer examination, the
cause became apparent: I was using an old binary.

The struct passed into the kernel had two fields swapped in
order to provide the same ABI on 32-bit and 64-bit kernels.
(This is OK for such "EXPERIMENTAL" features, for which a
stable API isn't yet provided.)

The fix was to recompile, using the updated interface to
gadgetfs. Then it worked fine.

- Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
linux-usb-***@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Loading...