summaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorStefan Koch <stefan.koch10@gmail.com>2015-08-25 15:10:06 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-22 15:08:40 -0400
commit6b2bd3c8c69c4817a9a2feb4597021d486c105f4 (patch)
tree13f2c1a83691b45149aa52bc5363e789c501c635 /include/linux/usb
parent4ad2ddce1a096dea71d42969515d3a64f0d9246f (diff)
usb: interface authorization: Introduces the default interface authorization
Interfaces are allowed per default. This can disabled or enabled (again) by writing 0 or 1 to /sys/bus/usb/devices/usbX/interface_authorized_default Signed-off-by: Stefan Koch <stefan.koch10@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/hcd.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index d2784c10bfe2..36ce3d215cad 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -120,6 +120,7 @@ struct usb_hcd {
120#define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */ 120#define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */
121#define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */ 121#define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */
122#define HCD_FLAG_DEAD 6 /* controller has died? */ 122#define HCD_FLAG_DEAD 6 /* controller has died? */
123#define HCD_FLAG_INTF_AUTHORIZED 7 /* authorize interfaces? */
123 124
124 /* The flags can be tested using these macros; they are likely to 125 /* The flags can be tested using these macros; they are likely to
125 * be slightly faster than test_bit(). 126 * be slightly faster than test_bit().
@@ -131,6 +132,14 @@ struct usb_hcd {
131#define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING)) 132#define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING))
132#define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD)) 133#define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD))
133 134
135 /*
136 * Specifies if interfaces are authorized by default
137 * or they require explicit user space authorization; this bit is
138 * settable through /sys/class/usb_host/X/interface_authorized_default
139 */
140#define HCD_INTF_AUTHORIZED(hcd) \
141 ((hcd)->flags & (1U << HCD_FLAG_INTF_AUTHORIZED))
142
134 /* Flags that get set only during HCD registration or removal. */ 143 /* Flags that get set only during HCD registration or removal. */
135 unsigned rh_registered:1;/* is root hub registered? */ 144 unsigned rh_registered:1;/* is root hub registered? */
136 unsigned rh_pollable:1; /* may we poll the root hub? */ 145 unsigned rh_pollable:1; /* may we poll the root hub? */