← Documents Documentation/usb/functionfs-desc.rst GitHub 원문 ↗

Linux 6.18.37 · USB

FunctionFS Descriptor

FunctionFS ep0 descriptor 기록 방식과 interface class/subclass에 따른 class-specific 및 DFU descriptor 승인 규칙입니다.

Source pathDocumentation/usb/functionfs-desc.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

functionfs-desc.rst:1-39

FunctionFS user space는 device/configuration descriptor를 만들지 않고 interface 및 허용된 class-specific descriptor를 header 뒤에 `ep0`로 전달합니다. 후속 descriptor의 유효성은 바로 앞 interface의 class/subclass context로 판정되며 DFU는 `USB_CLASS_APP_SPEC`과 `USB_SUBCLASS_DFU` 조합에서 허용됩니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ======================
2 FunctionFS Descriptors
3 ======================
4
5 Some of the descriptors that can be written to the FFS gadget are
6 described below. Device and configuration descriptors are handled
7 by the composite gadget and are not written by the user to the
8 FFS gadget.
9
10 Descriptors are written to the "ep0" file in the FFS gadget
11 following the descriptor header.
12
13 .. kernel-doc:: include/uapi/linux/usb/functionfs.h
14 :doc: descriptors
15
16 Interface Descriptors
17 ---------------------
18
19 Standard USB interface descriptors may be written. The class/subclass of the
20 most recent interface descriptor determines what type of class-specific
21 descriptors are accepted.
22
23 Class-Specific Descriptors
24 --------------------------
25
26 Class-specific descriptors are accepted only for the class/subclass of the
27 most recent interface descriptor. The following are some of the
28 class-specific descriptors that are supported.
29
30 DFU Functional Descriptor
31 ~~~~~~~~~~~~~~~~~~~~~~~~~
32
33 When the interface class is USB_CLASS_APP_SPEC and the interface subclass
34 is USB_SUBCLASS_DFU, a DFU functional descriptor can be provided.
35 The DFU functional descriptor is a described in the USB specification for
36 Device Firmware Upgrade (DFU), version 1.1 as of this writing.
37
38 .. kernel-doc:: include/uapi/linux/usb/functionfs.h
39 :doc: usb_dfu_functional_descriptor
40

3. 한국어 전문 번역

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

제목

1-4

이 문서는 FunctionFS(FFS) gadget에 전달할 수 있는 descriptor를 설명합니다.

======================
FunctionFS Descriptors
======================

Descriptor 소유권과 ep0 기록

5-11

FFS gadget에 쓸 수 있는 descriptor 가운데 일부를 설명합니다. Device descriptor와 configuration descriptor는 composite gadget이 처리하므로 사용자가 FFS gadget에 직접 쓰지 않습니다.

사용자가 제공하는 descriptor는 descriptor header 뒤에 이어서 FFS gadget의 `ep0` file에 기록합니다.

FunctionFS descriptor 처리 주체
Descriptor처리 주체FFS ep0에 사용자 기록
DeviceComposite gadget아니요
ConfigurationComposite gadget아니요
InterfaceUser space / FunctionFS
Class-specificUser space / FunctionFS조건부

Composite gadget이 만드는 항목과 user space가 ep0에 쓰는 항목을 구분합니다.

Some of the descriptors that can be written to the FFS gadget are
described below. Device and configuration descriptors are handled
by the composite gadget and are not written by the user to the
FFS gadget.

Descriptors are written to the "ep0" file in the FFS gadget
following the descriptor header.

Descriptor UAPI 정의

12-15

일반 descriptor 형식은 `include/uapi/linux/usb/functionfs.h`의 kernel-doc `descriptors` 절에 정의됩니다.


.. kernel-doc:: include/uapi/linux/usb/functionfs.h
   :doc: descriptors

Interface descriptor

16-22

표준 USB interface descriptor를 쓸 수 있습니다.

가장 최근에 기록한 interface descriptor의 class/subclass가 뒤이어 허용되는 class-specific descriptor 유형을 결정합니다.

Interface Descriptors
---------------------

Standard USB interface descriptors may be written. The class/subclass of the
most recent interface descriptor determines what type of class-specific
descriptors are accepted.

Class-specific descriptor

23-29

Class-specific descriptor는 가장 최근 interface descriptor의 class/subclass와 일치하는 경우에만 받아들여집니다. 문서는 지원되는 class-specific descriptor 일부를 이어서 제시합니다.

Class-specific descriptor 승인 흐름
Descriptor header를 ep0에 기록표준 interface descriptor 기록최근 interface의 class/subclass 저장후속 class-specific descriptor의 유형 확인Class/subclass와 일치하면 수락, 아니면 거부

최근 interface descriptor가 후속 descriptor의 해석 context를 제공합니다.

Class-Specific Descriptors
--------------------------

Class-specific descriptors are accepted only for the class/subclass of the
most recent interface descriptor. The following are some of the
class-specific descriptors that are supported.

DFU functional descriptor

30-39

Interface class가 `USB_CLASS_APP_SPEC`이고 interface subclass가 `USB_SUBCLASS_DFU`이면 DFU functional descriptor를 제공할 수 있습니다.

이 descriptor는 Device Firmware Upgrade(DFU) USB specification에 정의되며 문서 작성 당시 기준 version은 1.1입니다.

구조체 세부 정의는 `include/uapi/linux/usb/functionfs.h`의 kernel-doc `usb_dfu_functional_descriptor` 절에서 가져옵니다.

DFU Functional Descriptor
~~~~~~~~~~~~~~~~~~~~~~~~~

When the interface class is USB_CLASS_APP_SPEC and the interface subclass
is USB_SUBCLASS_DFU, a DFU functional descriptor can be provided.
The DFU functional descriptor is a described in the USB specification for
Device Firmware Upgrade (DFU), version 1.1 as of this writing.

.. kernel-doc:: include/uapi/linux/usb/functionfs.h
   :doc: usb_dfu_functional_descriptor