Re: How to detect of Windows Pc's removal action?

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Wed, 7 Mar 2007, Pandita, Vikram wrote:

> I have a related query on USB suspend: 
> In Host mode, is there a way to force a SUSPEND/RESUME from the class driver or application?

You can force a suspend from within the kernel.  Suppose that udev is a 
struct usb_device you want to suspend.  Then you can call:

	(udev->dev.bus->suspend)(&udev->dev);

You can force a suspend from an application if your kernel has 
CONFIG_PM_SYSFS_DEPRECATED turned on.  From the shell you can do:

	echo -n 2 >/sys/bus/usb/devices/.../power/state

where "..." is the name of the device to suspend.  A similar approach will 
work from within a program.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[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.