aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorChuanhong Guo <gch981213@gmail.com>2023-11-19 20:56:52 +0800
committerChuanhong Guo <gch981213@gmail.com>2023-12-28 13:10:32 +0800
commitb196a9f6ce8ef7d6b09d20ef79ffcf464d1a15ab (patch)
tree5a45cc2697c475192821324fbfcad1e44b0706ac /target/linux
parentb799dd3c705dfd95745cdd94b13d1cd2ad2367a6 (diff)
downloadupstream-b196a9f6ce8ef7d6b09d20ef79ffcf464d1a15ab.tar.gz
upstream-b196a9f6ce8ef7d6b09d20ef79ffcf464d1a15ab.tar.bz2
upstream-b196a9f6ce8ef7d6b09d20ef79ffcf464d1a15ab.zip
package: new package for usb gadget setup
Setting up usb gadgets using g_* kernel modules are considered a legacy approach, but the usb_gadget configfs is a bit annoying to use directly. The usb_gadget configfs works by creating magic directories and writing to magic files under /sys/kernel/config/usbgadget. This new package is an init script to setup usb_gadget configfs using uci. In the config file, gadget/configuration/function sections create corresponding directories. UCI options are magic files available in the configfs and strings/0x409 directories, grabbed with a 'find' command. UDC option in gadget writes the UDC file under the 'gadget' directory to attach the generated gadget config. It's also possible to apply pre-made config templates under /usr/share/usbgadget. The templates use the same UCI config format, with the 'gadget' entry named 'g1'. Currently, there are templates for CDC-ACM and CDC-NCM gadgets written based on existing g_*.ko module code. Certain SBCs come with only a USB device port (e.g. Raspberry Pi Zero). With this script, it's now possible to perform initial setup on them by adding a default NCM gadget. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Diffstat (limited to 'target/linux')
0 files changed, 0 insertions, 0 deletions