Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 253e0572 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman
Browse files

USB: add a "remove hardware" sysfs attribute



This patch (as1297) adds a "remove" attribute to each USB device's
directory in sysfs.  Writing to this attribute causes the device to be
deconfigured (the same as writing 0 to the "bConfigurationValue"
attribute) and then tells the hub driver to disable the device's
upstream port.  The device remains locked during these activities so
there is no possibility of it getting reconfigured in between.  The
port will remain disabled until after the device is unplugged.

The purpose of this is to provide a means for user programs to imitate
the "Safely remove hardware" applet in Windows.  Some devices do
expect their ports to be disabled before they are unplugged, and they
provide visual feedback to users indicating when they can safely be
unplugged.

The security implications are minimal.  Writing to the "remove"
attribute is no more dangerous than writing to the
"bConfigurationValue" attribute.

Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: David Zeuthen <davidz@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d697cdda
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment