From: Clint on
Thanks Vetzak.

I'm trying to use the microchip device driver and was hoping to avoid
writing my own (driver code seems to be pretty involved). There
doesn't appear to be a way to switch off selective suspend in the
microchip driver though so I might, in the end, have no choice but to
write my own.

Thanks for the heads up on the tricky stuff with xp.

Clint

Vetzak wrote:
> Your driver decides when the device goes in and out USB selective
> suspend. To do so, your driver has to send down the wait-wake power IRP
> and then the IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION IRP (see ddk
> docs and USB samples driver sources for details on these mechanisms).
>
> If you don't want USB selective suspend, just don't implement it in
> your driver. Also beware of the state of the "remote wake-up enable"
> bit in the USB configuration descriptor. If set, the USBD will activate
> RWU on te device, else it won't. Your driver doesn't send that
> SetFeature, REMOTE_WAKEUP control request.
>
> One more remark: USB selective suspend in WinXP sucks. Examples:
> * The MS information sources are confusing. First they said selective
> suspend wasn't supported for composite devices, afterwards tey said it
> is. In my experience selective suspend doesn't work properly on all
> systems. That's why we converted our composite devices into
> non-composite devices and wrote bus drivers.
> * The power mappings of root hubs are often wrong leading to strange
> behavior after standby and resume (like the system disconnects USB
> device but the driver isn't surprise-removed). Example wrong mapping:
> S0->D0, S1->D2, S2->D3, S3->D2, S3->D3, S4->D2, S5->D3.
> * If you manage to suspend a USB device, and connect a second device to
> the same (root) hub, the selective suspend is cancelled on the first
> one. So no selective suspend if 2 or more usb device are connected to
> the same (root) hub.
>
> I hope I didn't take the fun away ;-)
>
>
> Clint wrote:
> > Vetzak,
> > I'm using a custom driver.
> >
> > Any ideas how a custom driver indicates it doesn't support selective
> > suspend?
> >
> > Thanks,
> > Clint
> >
> > Vetzak wrote:
> > > Are you using a system driver are a custom driver? A.f.a.i.k. Most
> > > system drivers don't support selective suspend (for example, USB
> > > sticks).