最終更新:2022-08-24 (水) 12:31:50 (608d)
GadgetFS
Top / GadgetFS
Gadget Filesystem
.config
概要
- This driver provides a filesystem based API that lets user mode programs implement a single-configuration USB device, including endpoint I/O and control requests that don't relate to enumeration.
- All endpoints, transfer speeds, and transfer types supported by the hardware are available, through read() and write() calls.
モジュール
デバイスファイル
- Linux/dev/gadget/<USBホストコントローラ名>
$CHIP
- allows you to open Endpoint Zero and write descriptors to the gadget framework.
fd = open ("/dev/gadget/$CHIP", O_RDWR) status = write (fd, descriptors, sizeof descriptors)
サンプル
- http://www.linux-usb.org/gadget/usb.c
- ベンダー固有のデバイスの例
メモ
- Provides User-Mode API
- Each endpoint presented as single I/O file descriptor
- Normal read() and write() calls
- Async I/O supported
- Configuration and descriptors written into files
メモ
- Linux 3.17でディレクトリが整理された
コード
- linux/usb/gadget.h
- uapi/linux/usb/gadgetfs.h?
- drivers/usb/gadget/inode.c