RE: [PATCH 2/3] usb: gadget: Add USB functions gadget

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

 



On Tue, 18 Sep 2012, Michal Nazarewicz wrote:

> On Tue, Sep 18 2012, Andrzej Pietrasiewicz wrote:
> > This is how I would like to setup the gadget with mass storage
> > (udc interface unchanged, so no udc choice for user; configfs root
> > for the gadget is named "usb-function-gadget", probably to be changed
> > after the udc-core supports choice of other than first available; some
> > names probably to be changed as well, e.g. iManufacturer->manufacturer
> > or something like that, connect->ready):
> >
> > $ insmod libcomposite.ko
> > $ insmod g_usb_functions.ko
> > $ mount -t configfs none /cfg
> > $ mkdir -p /cfg/usb-function-gadget/ufg/config1/function1
> > $ echo -n <some id> > /cfg/usb-function-gadget/ufg/idVendor
> 
> I assume -n would not really be needed.
> 
> > $ echo -n <some id> > /cfg/usb-function-gadget/ufg/idProduct
> > $ echo -n <something> > /cfg/usb-function-gadget/ufg/bcdDevice
> > $ echo -n <string> > /cfg/usb-function-gadget/ufg/iManufacturer
> > $ echo -n <string> > /cfg/usb-function-gadget/ufg/iSerialNumber
> > $ echo -n <string> > /cfg/usb-function-gadget/ufg/iProduct
> > $ echo -n "f_mass_storage" > /cfg/usb-function-gadget/ufg/\
> > config1/function1/name
> 
> I'd drop “f_” prefix.  After all, everything is a function here, the
> prefix serves no purpose.
> 
> > $ mkdir /cfg/usb-function-gadget/ufg/config1/function1/\
> > f_mass_storage

Speaking of no purpose, what is the reason for
.../function1/f_mass_storage ?  Is there anything besides name and
f_mass_storage under function1?  It seems like an extra directory level
for no reason.

> > $ echo -n 1 > /cfg/usb-function-gadget/ufg/config1/function1/\
> > f_mass_storage/luns
> > $ mkdir /cfg/usb-function-gadget/ufg/config1/function1/\
> > f_mass_storage/lun0
> > $ echo -n "file.img" > /cfg/usb-function-gadget/ufg/config1/\
> > function1/f_mass_storage/lun0/file
> > $ echo -n 1 > /cfg/usb-function-gadget/ufg/connect

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