diff options
| author | Stefan Koch <stefan.koch10@gmail.com> | 2015-08-25 15:10:11 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-09-22 15:08:40 -0400 |
| commit | ff8e2c560eca32043ed097099debac488a4bd99f (patch) | |
| tree | 617f7ea228bb0a46e2cc4b59f9f50dd1e2c2c1fe /include/linux/usb | |
| parent | 7f59c150ad9ae017abcff16775ccdd0bdefb963d (diff) | |
usb: interface authorization: Use a flag for the default device authorization
With this patch a flag instead of a variable
is used for the default device authorization.
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.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h index 36ce3d215cad..4d147277b30d 100644 --- a/include/linux/usb/hcd.h +++ b/include/linux/usb/hcd.h | |||
| @@ -58,12 +58,6 @@ | |||
| 58 | * | 58 | * |
| 59 | * Since "struct usb_bus" is so thin, you can't share much code in it. | 59 | * Since "struct usb_bus" is so thin, you can't share much code in it. |
| 60 | * This framework is a layer over that, and should be more sharable. | 60 | * This framework is a layer over that, and should be more sharable. |
| 61 | * | ||
| 62 | * @authorized_default: Specifies if new devices are authorized to | ||
| 63 | * connect by default or they require explicit | ||
| 64 | * user space authorization; this bit is settable | ||
| 65 | * through /sys/class/usb_host/X/authorized_default. | ||
| 66 | * For the rest is RO, so we don't lock to r/w it. | ||
| 67 | */ | 61 | */ |
| 68 | 62 | ||
| 69 | /*-------------------------------------------------------------------------*/ | 63 | /*-------------------------------------------------------------------------*/ |
| @@ -121,6 +115,7 @@ struct usb_hcd { | |||
| 121 | #define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */ | 115 | #define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */ |
| 122 | #define HCD_FLAG_DEAD 6 /* controller has died? */ | 116 | #define HCD_FLAG_DEAD 6 /* controller has died? */ |
| 123 | #define HCD_FLAG_INTF_AUTHORIZED 7 /* authorize interfaces? */ | 117 | #define HCD_FLAG_INTF_AUTHORIZED 7 /* authorize interfaces? */ |
| 118 | #define HCD_FLAG_DEV_AUTHORIZED 8 /* authorize devices? */ | ||
| 124 | 119 | ||
| 125 | /* The flags can be tested using these macros; they are likely to | 120 | /* The flags can be tested using these macros; they are likely to |
| 126 | * be slightly faster than test_bit(). | 121 | * be slightly faster than test_bit(). |
| @@ -140,6 +135,14 @@ struct usb_hcd { | |||
| 140 | #define HCD_INTF_AUTHORIZED(hcd) \ | 135 | #define HCD_INTF_AUTHORIZED(hcd) \ |
| 141 | ((hcd)->flags & (1U << HCD_FLAG_INTF_AUTHORIZED)) | 136 | ((hcd)->flags & (1U << HCD_FLAG_INTF_AUTHORIZED)) |
| 142 | 137 | ||
| 138 | /* | ||
| 139 | * Specifies if devices are authorized by default | ||
| 140 | * or they require explicit user space authorization; this bit is | ||
| 141 | * settable through /sys/class/usb_host/X/authorized_default | ||
| 142 | */ | ||
| 143 | #define HCD_DEV_AUTHORIZED(hcd) \ | ||
| 144 | ((hcd)->flags & (1U << HCD_FLAG_DEV_AUTHORIZED)) | ||
| 145 | |||
| 143 | /* Flags that get set only during HCD registration or removal. */ | 146 | /* Flags that get set only during HCD registration or removal. */ |
| 144 | unsigned rh_registered:1;/* is root hub registered? */ | 147 | unsigned rh_registered:1;/* is root hub registered? */ |
| 145 | unsigned rh_pollable:1; /* may we poll the root hub? */ | 148 | unsigned rh_pollable:1; /* may we poll the root hub? */ |
| @@ -150,7 +153,6 @@ struct usb_hcd { | |||
| 150 | * support the new root-hub polling mechanism. */ | 153 | * support the new root-hub polling mechanism. */ |
| 151 | unsigned uses_new_polling:1; | 154 | unsigned uses_new_polling:1; |
| 152 | unsigned wireless:1; /* Wireless USB HCD */ | 155 | unsigned wireless:1; /* Wireless USB HCD */ |
| 153 | unsigned authorized_default:1; | ||
| 154 | unsigned has_tt:1; /* Integrated TT in root hub */ | 156 | unsigned has_tt:1; /* Integrated TT in root hub */ |
| 155 | unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ | 157 | unsigned amd_resume_bug:1; /* AMD remote wakeup quirk */ |
| 156 | unsigned can_do_streams:1; /* HC supports streams */ | 158 | unsigned can_do_streams:1; /* HC supports streams */ |
