Re: usb: gadget: f_mass_storage: detect eject

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 28 Aug 2018, Nuno Gonçalves wrote:

> On Mon, Aug 20, 2018 at 4:23 PM Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> > It is expected.  No notifications for host-initiated ejects were ever
> > put into the f_mass_storage driver.
> >
> > I have never tried to use f_mass_storage under configfs.  When you do,
> > does the driver create its normal sysfs files?
> 
> Is there any other way to use it? Isn't config fs the way to
> instantiate GadgetFS/FunctionFS modules (f_mass_storage)?

There is another way: modprobe g_file_storage with appropriate 
parameters.

> The only other files I find in sysfs are the ones referring to the
> module being loaded, but those do not change with eject.
> 
> What should I look for?

Somewhere under /sys/devices will be a directory for the system's USB
device controller.  Beneath that will be the gadget directory for 
f_mass_storage, and below that will be directories for the individual 
Logical Units.  Each LUN will have a sysfs entry named "file", which 
contains the name of the file or device being used as the backing 
store.

Alan Stern




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux