Re: [RFC] Autosuspend update

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
Am Freitag, 9. Februar 2007 23:12 schrieb Alan Stern:

Firstly, cool.
I'll look at it closer again, but just some first comments.

> +static ssize_t
> +set_autosuspend(struct device *dev, struct device_attribute *attr,
> +               const char *buf, size_t count)
> +{
> +       struct usb_device *udev;
> +       unsigned value, old;
> +
> +       if (sscanf(buf, "%u", &value) != 1 || value >= INT_MAX/HZ)
> +               return -EINVAL;
> +       value *= HZ;
> +
> +       if (is_usb_device(dev)) {
> +               udev = to_usb_device(dev);
> +               old = udev->autosuspend_delay;
> +               udev->autosuspend_delay = value;
> +       } else {
> +               struct usb_interface *intf = to_usb_interface(dev);
> +
> +               udev = interface_to_usbdev(intf);
> +               old = intf->autosuspend_delay;
> +               intf->autosuspend_delay = value;
> +       }
> +       if (value > 0 && old == 0)
> +               usb_try_autosuspend_device(udev);

You should retain symmetry. Writing 0 should wake up the device.

Secondly, how about exposing USB_IF_DEVICE_BUSY through sysfs?

	Regards
		Oliver
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.