File-Storage Gadget Eject/"Safely Remove" Detection

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

 



Hello,

I'm looking into having events occur in an embedded device when A) It
connects to a host using the File Storage gadget and B) It is ejected
by that host.  Part A is pretty straightforward, however, I'm having
issues with part B...

The problem is, Windows seems to treat the event differently than
Linux, as Linux sends a SCSI STOP command to the device, whereas
Windows sends a USB Suspend.

>From what I can tell, this USB Suspend isn't passed up to the gadget
layer, making it a pain to see when the device has been 'stopped'.  My
current plan is to have two places where this is monitored, both
exposed as sysfs entries.  One in musb-core.c, and one in
file-storage.c, which will both need to be checked to see if the
device has been ejected.

As you can see, this solution is rather dissatisfying.  My question is
this: does anyone have a better solution?  Is there already some way
that the File-Storage gadget can know it's been suspended?

Thanks,
Patrick Gitchell
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux