Hello. On 7/29/2015 11:16 AM, Stefan Koch wrote:
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 <skoch@xxxxxxx> --- drivers/usb/core/hcd.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++ drivers/usb/core/message.c | 1 + include/linux/usb/hcd.h | 3 +++ 3 files changed, 51 insertions(+)
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index cbcd092..4f5ba47 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -882,9 +882,53 @@ static ssize_t authorized_default_store(struct device *dev,
[...]
+/* + * interface_authorized_default_store - store default authorization status + * for USB interfaces + * + * note: interface_auhorized_default is the default value
Authorized.
+ * for initializing the authorized attribute of interfaces + */ +static ssize_t interface_authorized_default_store(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) +{ + struct usb_device *usb_dev = to_usb_device(dev); + struct usb_hcd *hcd = bus_to_hcd(usb_dev->bus); + int rc = count; + bool val; + + if (strtobool(buf, &val) != 0) + return -EINVAL; + + if(val)
Space is needed between *if* and paren. Please run your patches thru scripts/checkpatch.pl before submitting.
[...] MBR, Sergei -- 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