← Documents Documentation/ABI/testing/configfs-usb-gadget GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

USB gadget configfs testing ABI

USB gadget의 device descriptor와 UDC binding, configuration·language string, function interface descriptor, Microsoft OS descriptor 및 WebUSB extension을 구성하는 configfs hierarchy를 설명합니다.

Source pathDocumentation/ABI/testing/configfs-usb-gadget
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Gadget root와 device attributes

configfs-usb-gadget:1-32

USB gadget group과 개별 gadget의 UDC binding, maximum speed, class/protocol, endpoint 0, USB release 및 vendor/product identity를 구성합니다.

Configuration과 language-specific strings

configfs-usb-gadget:34-66

Configuration의 characteristics와 maximum bus power를 설정하고 language별 configuration description을 제공합니다.

Function interface feature와 extended property descriptors

configfs-usb-gadget:69-112

Gadget function group 아래 interface별 Compatible ID와 property별 type 1-7 및 typed data blob을 구성합니다.

Gadget language strings

configfs-usb-gadget:114-131

Language별 serial number, product description과 manufacturer description을 제공합니다.

Microsoft OS descriptor와 WebUSB extensions

configfs-usb-gadget:133-158

OS String extension의 enable·vendor code·signature와 WebUSB의 enable·version·vendor code·landing page를 구성합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /config/usb-gadget
2 Date: Jun 2013
3 KernelVersion: 3.11
4 Description:
5 This group contains sub-groups corresponding to created
6 USB gadgets.
7
8 What: /config/usb-gadget/gadget
9 Date: Jun 2013
10 KernelVersion: 3.11
11 Description:
12
13 The attributes of a gadget:
14
15 ================ ============================================
16 UDC bind a gadget to UDC/unbind a gadget;
17 write UDC's name found in /sys/class/udc/*
18 to bind a gadget, empty string "" to unbind.
19
20 max_speed maximum speed the driver supports. Valid
21 names are super-speed-plus, super-speed,
22 high-speed, full-speed, and low-speed.
23
24 bDeviceClass USB device class code
25 bDeviceSubClass USB device subclass code
26 bDeviceProtocol USB device protocol code
27 bMaxPacketSize0 maximum endpoint 0 packet size
28 bcdDevice bcd device release number
29 bcdUSB bcd USB specification version number
30 idProduct product ID
31 idVendor vendor ID
32 ================ ============================================
33
34 What: /config/usb-gadget/gadget/configs
35 Date: Jun 2013
36 KernelVersion: 3.11
37 Description:
38 This group contains a USB gadget's configurations
39
40 What: /config/usb-gadget/gadget/configs/config
41 Date: Jun 2013
42 KernelVersion: 3.11
43 Description:
44 The attributes of a configuration:
45
46 ================ ======================================
47 bmAttributes configuration characteristics
48 MaxPower maximum power consumption from the bus
49 ================ ======================================
50
51 What: /config/usb-gadget/gadget/configs/config/strings
52 Date: Jun 2013
53 KernelVersion: 3.11
54 Description:
55 This group contains subdirectories for language-specific
56 strings for this configuration.
57
58 What: /config/usb-gadget/gadget/configs/config/strings/language
59 Date: Jun 2013
60 KernelVersion: 3.11
61 Description:
62 The attributes:
63
64 ================ =========================
65 configuration configuration description
66 ================ =========================
67
68
69 What: /config/usb-gadget/gadget/functions
70 Date: Jun 2013
71 KernelVersion: 3.11
72 Description:
73 This group contains functions available to this USB gadget.
74
75 What: /config/usb-gadget/gadget/functions/<func>.<inst>/interface.<n>
76 Date: May 2014
77 KernelVersion: 3.16
78 Description:
79 This group contains "Feature Descriptors" specific for one
80 gadget's USB interface or one interface group described
81 by an IAD.
82
83 The attributes:
84
85 ================= =====================================
86 compatible_id 8-byte string for "Compatible ID"
87 sub_compatible_id 8-byte string for "Sub Compatible ID"
88 ================= =====================================
89
90 What: /config/usb-gadget/gadget/functions/<func>.<inst>/interface.<n>/<property>
91 Date: May 2014
92 KernelVersion: 3.16
93 Description:
94 This group contains "Extended Property Descriptors" specific for one
95 gadget's USB interface or one interface group described
96 by an IAD.
97
98 The attributes:
99
100 ===== ===============================================
101 type value 1..7 for interpreting the data
102
103 - 1: unicode string
104 - 2: unicode string with environment variable
105 - 3: binary
106 - 4: little-endian 32-bit
107 - 5: big-endian 32-bit
108 - 6: unicode string with a symbolic link
109 - 7: multiple unicode strings
110 data blob of data to be interpreted depending on
111 type
112 ===== ===============================================
113
114 What: /config/usb-gadget/gadget/strings
115 Date: Jun 2013
116 KernelVersion: 3.11
117 Description:
118 This group contains subdirectories for language-specific
119 strings for this gadget.
120
121 What: /config/usb-gadget/gadget/strings/language
122 Date: Jun 2013
123 KernelVersion: 3.11
124 Description:
125 The attributes:
126
127 ============ =================================
128 serialnumber gadget's serial number (string)
129 product gadget's product description
130 manufacturer gadget's manufacturer description
131 ============ =================================
132
133 What: /config/usb-gadget/gadget/os_desc
134 Date: May 2014
135 KernelVersion: 3.16
136 Description:
137 This group contains "OS String" extension handling attributes.
138
139 ============= ===============================================
140 use flag turning "OS Descriptors" support on/off
141 b_vendor_code one-byte value used for custom per-device and
142 per-interface requests
143 qw_sign an identifier to be reported as "OS String"
144 proper
145 ============= ===============================================
146
147 What: /config/usb-gadget/gadget/webusb
148 Date: Dec 2022
149 KernelVersion: 6.3
150 Description:
151 This group contains "WebUSB" extension handling attributes.
152
153 ============= ===============================================
154 use flag turning "WebUSB" support on/off
155 bcdVersion bcd WebUSB specification version number
156 bVendorCode one-byte value used for custom per-device
157 landingPage UTF-8 encoded URL of the device's landing page
158 ============= ===============================================
159

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

생성된 USB gadget group

1-6
항목내용
What/config/usb-gadget
Date2013년 6월
KernelVersion3.11
Description생성된 USB gadget에 대응하는 subgroup을 담는다.

Gadget device descriptor와 UDC binding

8-32
항목내용
What/config/usb-gadget/gadget
Date2013년 6월
KernelVersion3.11
Attribute설명
UDCGadget을 UDC에 bind하거나 unbind한다. Bind하려면 `/sys/class/udc/*`에서 찾은 UDC 이름을 쓰고, unbind하려면 빈 문자열 `""`을 쓴다.
max_speedDriver가 지원하는 최대 속도이다. 유효한 이름은 `super-speed-plus`, `super-speed`, `high-speed`, `full-speed`, `low-speed`이다.
bDeviceClassUSB device class code
bDeviceSubClassUSB device subclass code
bDeviceProtocolUSB device protocol code
bMaxPacketSize0Endpoint 0의 maximum packet size
bcdDeviceBCD device release number
bcdUSBBCD USB specification version number
idProductProduct ID
idVendorVendor ID

USB gadget configuration

34-49
항목내용
What/config/usb-gadget/gadget/configs
Date2013년 6월
KernelVersion3.11
DescriptionUSB gadget의 configuration을 담는 group이다.
Child/config/usb-gadget/gadget/configs/config
Configuration attribute설명
bmAttributesConfiguration characteristics
MaxPowerBus에서 소비하는 maximum power

Configuration의 language-specific string

51-66
경로내용
/config/usb-gadget/gadget/configs/config/strings이 configuration의 language-specific string을 위한 subdirectory를 담는다.
/config/usb-gadget/gadget/configs/config/strings/language`configuration` attribute에 configuration description을 담는다.

두 ABI 모두 2013년 6월, Linux 3.11에 도입되었다.

Gadget에서 사용할 수 있는 function group

69-73
항목내용
What/config/usb-gadget/gadget/functions
Date2013년 6월
KernelVersion3.11
Description이 USB gadget에서 사용할 수 있는 function을 담는다.

USB interface Feature Descriptor

75-88
항목내용
What/config/usb-gadget/gadget/functions/<func>.<inst>/interface.<n>
Date2014년 5월
KernelVersion3.16
DescriptionGadget의 한 USB interface 또는 IAD가 설명하는 한 interface group에 특화된 Feature Descriptor를 담는다.
Attribute설명
compatible_idCompatible ID를 위한 8-byte 문자열
sub_compatible_idSub Compatible ID를 위한 8-byte 문자열

USB interface Extended Property Descriptor

90-112
항목내용
What/config/usb-gadget/gadget/functions/<func>.<inst>/interface.<n>/<property>
Date2014년 5월
KernelVersion3.16
DescriptionGadget의 한 USB interface 또는 IAD가 설명하는 한 interface group에 특화된 Extended Property Descriptor를 담는다.
type 값data 해석
1Unicode string
2Environment variable을 포함한 Unicode string
3Binary
4Little-endian 32-bit
5Big-endian 32-bit
6Symbolic link를 포함한 Unicode string
7여러 Unicode string

`type`은 data 해석 방식을 정하는 1부터 7까지의 값이고, `data`는 type에 따라 해석할 data blob이다.

Gadget의 language-specific string descriptor

114-131
경로내용
/config/usb-gadget/gadget/strings이 gadget의 language-specific string을 위한 subdirectory를 담는다.
/config/usb-gadget/gadget/strings/languageLanguage별 string attribute를 담는다.
Attribute설명
serialnumberGadget serial number 문자열
productGadget product description
manufacturerGadget manufacturer description

두 ABI 모두 2013년 6월, Linux 3.11에 도입되었다.

Microsoft OS String extension

133-145
항목내용
What/config/usb-gadget/gadget/os_desc
Date2014년 5월
KernelVersion3.16
DescriptionOS String extension 처리 attribute를 담는다.
Attribute설명
useOS Descriptor 지원을 켜거나 끄는 flag
b_vendor_codeDevice별 및 interface별 custom request에 사용하는 1-byte 값
qw_signOS String 자체로 보고할 identifier

WebUSB extension

147-158
항목내용
What/config/usb-gadget/gadget/webusb
Date2022년 12월
KernelVersion6.3
DescriptionWebUSB extension 처리 attribute를 담는다.
Attribute설명
useWebUSB 지원을 켜거나 끄는 flag
bcdVersionBCD WebUSB specification version number
bVendorCodeCustom per-device request에 사용하는 1-byte 값
landingPageDevice landing page의 UTF-8 encoded URL
USB gadget configfs hierarchy와 UDC bind
/config/usb-gadgetgadgetDevice descriptor와 max_speed 설정UDC에 /sys/class/udc/* 이름 기록Gadget bind
gadgetconfigs/configbmAttributes / MaxPowerstrings/languageConfiguration description
gadgetfunctions/<func>.<inst>interface.<n>Compatible IDExtended Property Descriptor
gadgetstrings/languageserialnumber / product / manufacturer
gadgetos_desc 또는 webusbExtension enable과 protocol-specific attribute
Bound gadgetUDC에 빈 문자열 기록Gadget unbind

Gadget root 아래 descriptor, configuration, function, string 및 extension을 구성한 뒤 UDC 이름을 기록해 controller에 bind한다.