Re: help with dummy_hcd and g_zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Questions like this should always be posted to the linux-usb mailing 
list.

On Thu, 27 Dec 2012, Dan Clapp wrote:

> Hello Alan,
> 
> First, let me start by thanking you for supplying you code.  I 
> appreciate it.  I think this is the way we would like to go to test our 
> system before we actually get hardware made.
> 
> I am getting desperate!  I have been trying to use your "dummy_hcd.ko" 
> and g_zero.ko module to try and run usb test and eventually get to write 
> my own usb device driver.
> 
> However, I keep freezing up my system when I install the g_zero device 
> driver.
> 
> I was wondering if can either point me in the correct direction, and or 
> give me a couple of hints as to what i am doing wrong:
> 
> Here is what I am doing:
> 
> Running on Fedora 14 virtual machine.

Fedora 14 is about two years old now, and it isn't supported any more
(no more software updates, bug fixes, or security fixes).  Shouldn't
you use something more up-to-date?

> I compiled and was successfully generated dummy_hcd, gadgetfs and g_zero.
> 
> First I load in the dummy_hcd stuff:
> 
> #insmod dummy_hcd.ko
> #mkdir /dev/gadget
> #insmod gadgetfs.ko

This is your mistake.  You should not load gadgetfs.ko.

> #mount -t gadgetfs none /dev/gadget
> 
> At this point I can see both a dummy_hcd and dummy_ucd (at /proc/bus/usb 
> and /dev/gadget respectively).
> 
> # ls /dev/gadget
> dummy_udc
> # ls /proc/bus/usb
> 001  002  003  devices
> 
> where in devices we have:
> 
> [root@localhost gadget]# cat /proc/bus/usb/devices
> 
> T:  Bus=03 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
> B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
> D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=1d6b ProdID=0002 Rev= 2.06
> S:  Manufacturer=Linux 2.6.35.14-106.fc14.i686 dummy_hcd
> S:  Product=Dummy host controller
> S:  SerialNumber=dummy_hcd
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
> I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
> E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms
> 
> T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12   MxCh= 2
> B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
> D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=1d6b ProdID=0001 Rev= 2.06
> S:  Manufacturer=Linux 2.6.35.14-106.fc14.i686 uhci_hcd
> S:  Product=UHCI Host Controller
> S:  SerialNumber=0000:02:00.0
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
> I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
> E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms
> 
> T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12   MxCh= 7
> D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
> P:  Vendor=0e0f ProdID=0002 Rev= 1.00
> S:  Product=VMware Virtual USB Hub
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
> I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
> E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=255ms
> 
> T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 6
> B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
> D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=1d6b ProdID=0002 Rev= 2.06
> S:  Manufacturer=Linux 2.6.35.14-106.fc14.i686 ehci_hcd
> S:  Product=EHCI Host Controller
> S:  SerialNumber=0000:02:03.0
> C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
> I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
> E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms
> [root@localhost gadget]#
> 
> 
> Now I want to put a "device" on the dummy_ucd bus 3.
> 
> I try and insert g_zero.ko
> 
> #insmod g_zero.ko
> 
> This is where things go bad - my system hangs and I need to reboot. 
> Nothing is in dmesg output with regards to this command.

The system should not hang.  Instead, the insmod command should simply 
fail.  Does the same thing happen if you use a 3.8-rc1 kernel?

> Do you have any examples, or help you can give me?
> 
> How do I specify that g_zero should be attached to the dummy_hcd bus?

It will attach there automatically if gadgetfs isn't already attached 
there first.

> Any help or guidance is greatly appreciated!
> 
> Thanks,

You're welcome.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux