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

Linux 6.18.37 · ABI / testing

USB gadget mass-storage function configfs ABI

USB mass-storage function의 bulk-endpoint stall과 pipeline buffer, LUN backing file·read-only·removable·CD-ROM·FUA 및 forced eject 설정을 설명합니다.

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

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

1. 요약·해설

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

Mass-storage function transport controls

configfs-usb-gadget-mass-storage:1-14

Bulk endpoint halt 허용 여부와 debug configuration에서 사용할 pipeline buffer 수 2-4를 설정합니다.

LUN backing storage와 media semantics

configfs-usb-gadget-mass-storage:16-41

각 LUN의 backing file, read-only·removable·CD-ROM 표시, FUA 관련 flag와 active function의 강제 eject를 구성합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /config/usb-gadget/gadget/functions/mass_storage.name
2 Date: Oct 2013
3 KernelVersion: 3.13
4 Description:
5 The attributes:
6
7 =========== ==============================================
8 stall Set to permit function to halt bulk endpoints.
9 Disabled on some USB devices known not to work
10 correctly. You should set it to true.
11 num_buffers Number of pipeline buffers. Valid numbers
12 are 2..4. Available only if
13 CONFIG_USB_GADGET_DEBUG_FILES is set.
14 =========== ==============================================
15
16 What: /config/usb-gadget/gadget/functions/mass_storage.name/lun.name
17 Date: Oct 2013
18 KernelVersion: 3.13
19 Description:
20 The attributes:
21
22 ============ ==============================================
23 file The path to the backing file for the LUN.
24 Required if LUN is not marked as removable.
25 ro Flag specifying access to the LUN shall be
26 read-only. This is implied if CD-ROM emulation
27 is enabled as well as when it was impossible
28 to open "filename" in R/W mode.
29 removable Flag specifying that LUN shall be indicated as
30 being removable.
31 cdrom Flag specifying that LUN shall be reported as
32 being a CD-ROM.
33 nofua Flag specifying that FUA flag
34 in SCSI WRITE(10,12)
35 forced_eject This write-only file is useful only when
36 the function is active. It causes the backing
37 file to be forcibly detached from the LUN,
38 regardless of whether the host has allowed it.
39 Any non-zero number of bytes written will
40 result in ejection.
41 ============ ==============================================
42

3. 한국어 전문 번역

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

Mass-storage function attributes

1-14
항목내용
What/config/usb-gadget/gadget/functions/mass_storage.name
Date2013년 10월
KernelVersion3.13
Attribute설명
stallFunction이 bulk endpoint를 halt할 수 있도록 허용한다. 올바르게 동작하지 않는 것으로 알려진 일부 USB device에서는 비활성화된다. 이 값은 true로 설정해야 한다.
num_buffersPipeline buffer 수이다. 유효한 값은 2부터 4까지다. `CONFIG_USB_GADGET_DEBUG_FILES`가 설정된 경우에만 사용할 수 있다.

Mass-storage LUN attributes

16-41
항목내용
What/config/usb-gadget/gadget/functions/mass_storage.name/lun.name
Date2013년 10월
KernelVersion3.13
Attribute설명
fileLUN의 backing file 경로이다. LUN이 removable로 표시되지 않았다면 필수이다.
roLUN access를 read-only로 할지 지정하는 flag이다. CD-ROM emulation이 활성화된 경우와 `filename`을 read/write mode로 열 수 없었던 경우에도 read-only가 암시된다.
removableLUN을 removable로 표시할지 지정하는 flag이다.
cdromLUN을 CD-ROM으로 보고할지 지정하는 flag이다.
nofua원문은 이 항목을 `SCSI WRITE(10,12)의 FUA flag를 지정하는 flag`라고 적은 지점에서 문장이 끝나며, 추가 동작은 이 ABI 문서에 기재되어 있지 않다.
forced_ejectFunction이 active일 때만 유용한 write-only file이다. Host가 허용했는지와 관계없이 backing file을 LUN에서 강제로 detach한다. 0이 아닌 byte 수를 쓰면 eject가 일어난다.
USB mass-storage function과 LUN backing file
USB host SCSI commandMass-storage functionstall / pipeline bufferslun.nameBacking file
lun.namero / removable / cdromHost에 보고할 media semantics
Active mass-storage functionforced_eject에 non-zero byte 기록Host 허용 여부와 무관하게 backing file detach

Function transport 설정과 LUN media 설정이 결합되어 host에 보이는 storage device를 구성하며, active 상태에서는 backing file을 강제로 분리할 수 있다.