Am Mittwoch, 5. Juni 2002 01:46 schrieb David Brownell:
> >   http://marc.theaimsgroup.com/?l=linux-kernel&m=102320879912115&w=2
> >   http://marc.theaimsgroup.com/?l=linux-kernel&m=102320879912113&w=2
> >   http://marc.theaimsgroup.com/?l=linux-kernel&m=102320879912119&w=2
>
> By the way, this suggests that USB devices should have two new
> optional methods in struct usb_driver:
>
>   int         (*suspend) (struct usb_device *dev, u32 state, u32 level);
>   int (*resume) (struct usb_device *dev, u32 level);
>
> Currently calls of those names are there, commented out (no
> infrastructure), and with slightly different syntax (state/level stuff
> unresolved).

That sounds reasonable. If you want them optional, you need
some reasonable defaults.
suspend() should probably return succes if the driver does
not implement its own method and call the drivers disconnect().
resume() should return a failure to resume because the device is gone
and the device should be treated as a new device.
Mice should be happy with this and we have the most common devices
covered thus.

> Seems to me that upcoming USB patches ought to
>
> (a) add those two calls
> (b) add usbcore glue to turn struct device suspend/resume
>      calls into ones made on usb device drivers
> (c) teach at least the "hub" driver what to do there ... like
>      for starters, suspend should disconnect devices when the
>      power rules mean they won't be suspending.

No, no, no. You walk the subtree below the pivotal hub
and tell all devices to suspend into the off state.
The crucial difference is the need to save all state in this case.
Or alternatively you must refuse to go to powersaving at all.
If you only can switch off, why not tell the upper layers ?

        Regards
                Oliver


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to