RFC: Enable CONFIG_USB_GADGET_DUMMY_HCD ?

Tim Gardner tim.gardner at canonical.com
Mon Mar 16 17:26:19 UTC 2009


TJ wrote:
> We currently have the USB Gadget interface enabled with the peripheral
> controller CONFIG_USB_GADGET_NET2280. We also have
> CONFIG_USB_FILE_STORAGE which gives us the g_file_storage module.
> 
> So far I haven't found anything in the changelog or git commits to
> indicate if CONFIG_USB_GADGET_NET2280 is an inherited default or choice
> based on some scenario we need.
> 
> If we were to enable CONFIG_USB_GADGET_DUMMY_HCD instead of
> CONFIG_USB_GADGET_NET2280 to give us the dummy-hcd module, we can
> provide the ability for the user to create virtual USB mass-storage
> devices on the host from a backing file-store.
> 
> This can be very useful especially for VMs such as KVM, VMWARE and so
> forth because it presents a virtual USB mass storage device to the
> guest.
> 
> This is a quite separate facility from using a loop mount for creating
> block devices on a file backing-store.
> 
> For example:
> 
> modprobe dummy-hcd
> modprobe g_file_storage file=/home/all/VirtualMachines/usb-storage.img
> 
> kvm ... -usb -usbdevice host:X.Y
> 
> E.g.
> dd if=/dev/zero of=/home/all/VirtualMachines/usb-storage.img bs=1024
> count=2048
> 
> nc -l -p 9999 >boot.log &
> 
> kvm -name Ubuntu-Jaunty-Desktop -serial tcp:127.0.0.1:9999 -monitor
> stdio -m 512 -hda ubuntu-jaunty-desktop.qcow2 -boot c -k en-gb -net
> nic,model=rtl8139,macaddr=56:44:45:30:31:32,vlan=0 -net
> tap,ifname=tap0,script=no,vlan=0 -soundhw es1370 -usbdevice
> host:0525:a4a5
> 
> [    5.536627] usb 1-2: new full speed USB device using uhci_hcd and address 2
> [    6.181501] usb 1-2: configuration #1 chosen from 1 choice
> [    6.299703] Initializing USB Mass Storage driver...
> [    6.317778] scsi2 : SCSI emulation for USB Mass Storage devices
> [    6.324037] usbcore: registered new interface driver usb-storage
> [    6.339894] USB Mass Storage support registered.
> [   11.356923] scsi 2:0:0:0: Direct-Access     Linux    File-Stor Gadget 0302 PQ: 0 ANSI: 2
> [   11.436330] sd 2:0:0:0: [sdb] 4096 512-byte hardware sectors: (2.09 MB/2.00 MiB)
> 
> 
> 

Frankly, I cannot think of a single reason why CONFIG_USB_GADGET_NET2280
is enabled. PC platforms certainly don't contain the USB slave hardware
that this driver requires.

On the other hand, Ubuntu _does_ profess to be a VM friendly platform,
so CONFIG_USB_GADGET_DUMMY_HCD makes a lot of sense.

http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-jaunty.git;a=commit;h=fc19cf886204da09de45cf2db2275335a5974f93

rtg
-- 
Tim Gardner tim.gardner at canonical.com




More information about the kernel-team mailing list