RE: Documentation for Raw USB ConfigFS

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

 



 
> >
> > Would you please let ECM gadget work first at your board, then let
> > f_fs work using test application (you need to compile both host and
> > device application for it). After that, you may have more precise
> > concept for Linux USB gadget framework.
> >
> 
> I don't see anything that harmonizes preexsting function usage with specifying
> custom endpoints.
> 
> I've gotten the ECM gadget, and then the ECM gadget via ffs working. I've read
> through the ffs test but I don't see any way to assign functionality to the endpoints.
> The example seems to transport raw data via a bulk endpoint. I know enough to
> instead assign an isochronous endpoint to the UDC and transfer via that, but I don't
> want it to be the *only* functionality the device offers.
> 
> Are you saying I can assign the ECM gadget via ffs and then add another driver
> after the fact? 

ffs (f_fs.c) is used for customized function, other functions, like ECM (f_ecm.c)
and Mass Storage (f_mass_storage.c) are used for certain function. You could
use configfs (like you have done below) to put customized function and certain functions
into one configuration, and let the host see them at the same time. Do your
real requirement is one customized function and one ECM function in one USB gadget?
If it is, below is the example to combine f_fs, mass_storage, and NCM together.

cd /sys/kernel/config/usb_gadget
cd g1
echo "0x1d6b" > idVendor
echo "0x0105" > idProduct
mkdir /dev/usb-ffs
mkdir functions/ffs.usb
mount -t functionfs usb /dev/usb-ffs
ln -s functions/ffs.usb configs/c.1
/home/root/usb_test/ffs_test/ffs-test & /* your own test application */
while [ ! -e /dev/usb-ffs/ep1 ]
do
        echo "."
        sleep 1;
done
mkdir functions/ncm.0    
ln -s functions/ncm.0 configs/c.1    
mkdir functions/mass_storage.0
ln -s functions/mass_storage.0 configs/c.1
echo $FILE > functions/mass_storage.0/lun.0/file 

Peter 
 




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

  Powered by Linux