[OpenWrt-Devel] [PATCH] usbgadget: Add new package

Michael Heimpold mhei at heimpold.de
Tue Feb 5 16:59:53 EST 2019


Hi,

Am Dienstag, 5. Februar 2019, 18:39:55 CET schrieb Petr Štetiar:
> Michael Heimpold <mhei at heimpold.de> [2019-02-02 10:09:40]:
> 
> Hi,
> 
> > I would prefer to have "config gadget <a-gadget-name>" to configure one
> > (multi-function) gadget and then have individual "config function <...>"
> > section to configure one function for a referenced gadget.  I think the
> > functions are orthogonal and thus "acm+rndis" looks like wrong approach
> > for
> > me.
> 
> I'm not sure I follow, please can you provide example configs? Thanks.

I hope the following will illustrate my idea (it should just show the idea,
no deeper sense):
I assume a CPU with two USB device ports, e.g. ci_hdrc.0 and ci_hdrc.1.
On ci_hdrc.0 a gadget with serial console and network is configured, on
ci_hdrc.1 a CD-ROM and a camera.

config gadget gadget1
    option manufacturer 'OpenWrt'
    option product 'OpenWrt USB CDC/ACM'
    option serial_number '007'
    option usb_vid '0xbeef'
    option usb_pid '0x1234'
    option udc_dev 'ci_hdrc.0'
    option disabled 0

config configuration config1
    option gadget gadget1
    option maxpower 120

config function console1
    option gadget gadget1
    option type 'acm'
    option disabled 0

config function network1
    option gadget gadget1          
    option type 'rndis'
    option host_addr 00:01:02:04:05:06
    option dev_addr 00:01:02:04:05:07
    option disabled 0

config gadget gadget2
    option manufacturer 'OpenWrt'
    option product 'OpenWrt USB CDC/ACM'
    option serial_number '007'
    option usb_vid '0xbeef'
    option usb_pid '0x1235'
    option udc_dev 'ci_hdrc.1'
    option disabled 0

config function msd
    option gadget gadget2
    option type 'mass_storage'
    option file '/path/to/backing/file'
    option removable 1
    option cdrom 1
    option disabled 0

config function network
    option gadget gadget2
    option type 'uvc'
    option disabled 1

Cheers,
mhei




_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list