Files
linux/Documentation/ABI/testing/configfs-usb-gadget-mass-storage
Maxim Devaev 421c8d9a20 usb: gadget: f_mass_storage: forced_eject attribute
It allows to reset prevent_medium_removal flag and "eject" the image.
This can be useful to free the drive from a hunging host or if the host
continues to use the drive even after unmounting (Linux does this).
It's also a bit like using an unfolded paperclip on an optical drive.

Previously, the undocumented method of sending SIGUSR1 to a special
"file-storage" kernel thread could be used for these purposes,
but when using multiple storages there was no way to distinguish
one from the other, so we had to send a signal to everyone.

Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Maxim Devaev <mdevaev@gmail.com>
Link: https://lore.kernel.org/r/20220711102956.19642-1-mdevaev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-14 16:06:42 +02:00

42 lines
1.5 KiB
Plaintext

What: /config/usb-gadget/gadget/functions/mass_storage.name
Date: Oct 2013
KernelVersion: 3.13
Description:
The attributes:
=========== ==============================================
stall Set to permit function to halt bulk endpoints.
Disabled on some USB devices known not to work
correctly. You should set it to true.
num_buffers Number of pipeline buffers. Valid numbers
are 2..4. Available only if
CONFIG_USB_GADGET_DEBUG_FILES is set.
=========== ==============================================
What: /config/usb-gadget/gadget/functions/mass_storage.name/lun.name
Date: Oct 2013
KernelVersion: 3.13
Description:
The attributes:
=========== ==============================================
file The path to the backing file for the LUN.
Required if LUN is not marked as removable.
ro Flag specifying access to the LUN shall be
read-only. This is implied if CD-ROM emulation
is enabled as well as when it was impossible
to open "filename" in R/W mode.
removable Flag specifying that LUN shall be indicated as
being removable.
cdrom Flag specifying that LUN shall be reported as
being a CD-ROM.
nofua Flag specifying that FUA flag
in SCSI WRITE(10,12)
forced_eject This write-only file is useful only when
the function is active. It causes the backing
file to be forcibly detached from the LUN,
regardless of whether the host has allowed it.
Any non-zero number of bytes written will
result in ejection.
=========== ==============================================