mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
usb: Add support for indicating whether a port is removable
Userspace may want to make policy decisions based on whether or not a given USB device is removable. Add a per-device member and support for exposing it in sysfs. Information sources to populate it will be added later. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
af74d2dae8
commit
0846e7e985
3 changed files with 42 additions and 0 deletions
|
@ -376,6 +376,12 @@ struct usb_bus {
|
|||
|
||||
struct usb_tt;
|
||||
|
||||
enum usb_device_removable {
|
||||
USB_DEVICE_REMOVABLE_UNKNOWN = 0,
|
||||
USB_DEVICE_REMOVABLE,
|
||||
USB_DEVICE_FIXED,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct usb_device - kernel's representation of a USB device
|
||||
* @devnum: device number; address on a USB bus
|
||||
|
@ -432,6 +438,7 @@ struct usb_tt;
|
|||
* @wusb_dev: if this is a Wireless USB device, link to the WUSB
|
||||
* specific data for the device.
|
||||
* @slot_id: Slot ID assigned by xHCI
|
||||
* @removable: Device can be physically removed from this port
|
||||
*
|
||||
* Notes:
|
||||
* Usbcore drivers should not set usbdev->state directly. Instead use
|
||||
|
@ -509,6 +516,7 @@ struct usb_device {
|
|||
#endif
|
||||
struct wusb_dev *wusb_dev;
|
||||
int slot_id;
|
||||
enum usb_device_removable removable;
|
||||
};
|
||||
#define to_usb_device(d) container_of(d, struct usb_device, dev)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue