USB wakeup problem with OSR USB-FX2

WAITWAKE_SUPPORTED just tells you if the device can support wake, not if
it is armed for wake

WAITWAKE_ON is what you need to look at. Here is the logic for query Sx

if (powerState.SystemState < PowerSystemHibernate &&
powerState.SystemState > data->MinSystemWakeState &&
WAITWAKE_ON(data)) {
status = STATUS_POWER_STATE_INVALID;
}
else {
status = STATUS_SUCCESS;
}
So if we are going into an Sx state that is lighter then hibernate and
we are going into a state that is deeper then the the mouse can wake the
machine, fail the query.

The part about the minimum Sx state that the machine supports is not
there, I crossed wires with another project which made that comparison.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Friday, January 13, 2006 3:59 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

Sorry Doron, I don’t see it. In the sources from XP SP1 DDK (I have
newer DDK but have BSC database for this one) following macro is used
for decision:

#define WAITWAKE_SUPPORTED(port) ((port)->MinDeviceWakeState >
PowerDeviceD0 && \
(port)->MinSystemWakeState >
PowerSystemWorking)

I haven’t found anything regarding deepest Sx state. Could you tell me
where to look?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Michal Vodicka[SMTP:xxxxx@upek.com]
Reply To: Windows System Software Devs Interest List
Sent: Saturday, January 14, 2006 12:39 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

I’m just trying to find it in mouclass sources :slight_smile: With no success,
yet.

In other words my description was correct but the default state of
remote wakeup setting in DM is disabled when mouse can’t wake system
from deepest Sx state. Right? It makes more sense but still as an user
without knowing internals I’d be confused if notice mouse remote wakeup
setting change system suspend behaviour.

Anyway, it is correct default. In my experience, notebook
manufacturers don’t care about remote wakeup but do care about power
consumption during suspend even if it is matter of uA.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

> ----------
> From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Saturday, January 14, 2006 12:17 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2
>
> See my other reply. Your mouse will only be automatically enabled
for
> wake if it can do so from the deepest Sx state, otherwise it is a
manual
> setting that the user must enable through device manager.
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Michal
Vodicka
> Sent: Friday, January 13, 2006 3:05 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2
>
> > ----------
> > From:
>
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
> ] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
> > Reply To: Windows System Software Devs Interest List
> > Sent: Friday, January 13, 2006 10:32 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2
> >
> > >WDM driver should never deny Sx query IRP.
> >
> > Am I wrong that MOUCLASS does this?
> >
> No, you’re right. I forgot to add IMO to my posting.
>
> What mouclass does is disputatious. If BIOS developers decide USB
device
> including mouse shouldn’t be able to wake system from S3 and should
be
> able to wake system from S1, driver should adhere this configuration
and
> don’t change system suspend behaviour. Take it from user’s point of
> view. Normally, system is suspended to S3. When you attach mouse,
system
> is suspended to S1. If you want S3, you have to disable remote
wakeup
> for mouse driver. Isn’t is crazy?
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
> ‘’
> To unsubscribe send a blank email to
xxxxx@lists.osr.com>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to
xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Saturday, January 14, 2006 12:50 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

Some of this code might be split out of the DDK sample b/c it relies on
internal function calls not documented in the DDK.

Ah, I see. It’d have to find the lowest Sx state some way. Wouldn’t it be better to document these functions, instead, when already documemted in Nebbett’s book? :wink: I was under impression these DDK samples are the same as these installed with OS.

Laptops in the win2k timeframe definitely had this behavior where they
could wake from usb from S1, but not from S3. Modern laptops appear to
have overcome this limitation and can do wakeup from S3.

Some manufacturers intentionally disable it and turn off HCs in S3 to decrease power consuption.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

Yes, I understand query Sx logic. I was trying to find how WMI makes decision about default remote wakeup checkbox state.

BTW, I’m almost sure below code wouldn’t pass HCT if tested on computer where it’d refuse Sx query. IIRC HCT tries S1 and S3 separately and driver isn’t allowed to refuse any. HCT 12.1 also automatically enables remote wakeup via WMI so disabling it wouldn’t help.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Saturday, January 14, 2006 1:13 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

WAITWAKE_SUPPORTED just tells you if the device can support wake, not if
it is armed for wake

WAITWAKE_ON is what you need to look at. Here is the logic for query Sx

if (powerState.SystemState < PowerSystemHibernate &&
powerState.SystemState > data->MinSystemWakeState &&
WAITWAKE_ON(data)) {
status = STATUS_POWER_STATE_INVALID;
}
else {
status = STATUS_SUCCESS;
}
So if we are going into an Sx state that is lighter then hibernate and
we are going into a state that is deeper then the the mouse can wake the
machine, fail the query.

The part about the minimum Sx state that the machine supports is not
there, I crossed wires with another project which made that comparison.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Friday, January 13, 2006 3:59 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2

Sorry Doron, I don’t see it. In the sources from XP SP1 DDK (I have
newer DDK but have BSC database for this one) following macro is used
for decision:

#define WAITWAKE_SUPPORTED(port) ((port)->MinDeviceWakeState >
PowerDeviceD0 && \
(port)->MinSystemWakeState >
PowerSystemWorking)

I haven’t found anything regarding deepest Sx state. Could you tell me
where to look?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

> ----------
> From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Michal Vodicka[SMTP:xxxxx@upek.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Saturday, January 14, 2006 12:39 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2
>
> I’m just trying to find it in mouclass sources :slight_smile: With no success,
yet.
>
> In other words my description was correct but the default state of
remote wakeup setting in DM is disabled when mouse can’t wake system
from deepest Sx state. Right? It makes more sense but still as an user
without knowing internals I’d be confused if notice mouse remote wakeup
setting change system suspend behaviour.
>
> Anyway, it is correct default. In my experience, notebook
manufacturers don’t care about remote wakeup but do care about power
consumption during suspend even if it is matter of uA.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
> > ----------
> > From:
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
> > Reply To: Windows System Software Devs Interest List
> > Sent: Saturday, January 14, 2006 12:17 AM
> > To: Windows System Software Devs Interest List>
> > Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2
> >
> > See my other reply. Your mouse will only be automatically enabled
for
> > wake if it can do so from the deepest Sx state, otherwise it is a
manual
> > setting that the user must enable through device manager.
> >
> > d
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On Behalf Of Michal
Vodicka
> > Sent: Friday, January 13, 2006 3:05 PM
> > To: Windows System Software Devs Interest List
> > Subject: RE: [ntdev] USB wakeup problem with OSR USB-FX2
> >
> > > ----------
> > > From:
> >
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com
> > ] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
> > > Reply To: Windows System Software Devs Interest List
> > > Sent: Friday, January 13, 2006 10:32 PM
> > > To: Windows System Software Devs Interest List
> > > Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2
> > >
> > > >WDM driver should never deny Sx query IRP.
> > >
> > > Am I wrong that MOUCLASS does this?
> > >
> > No, you’re right. I forgot to add IMO to my posting.
> >
> > What mouclass does is disputatious. If BIOS developers decide USB
device
> > including mouse shouldn’t be able to wake system from S3 and should
be
> > able to wake system from S1, driver should adhere this configuration
and
> > don’t change system suspend behaviour. Take it from user’s point of
> > view. Normally, system is suspended to S3. When you attach mouse,
system
> > is suspended to S1. If you want S3, you have to disable remote
wakeup
> > for mouse driver. Isn’t is crazy?
> >
> > Best regards,
> >
> > Michal Vodicka
> > UPEK, Inc.
> > [xxxxx@upek.com, http://www.upek.com]
> >
> >
> >
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
argument:
> > ‘’
> > To unsubscribe send a blank email to
xxxxx@lists.osr.com>
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
> >
> > You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> > To unsubscribe send a blank email to
xxxxx@lists.osr.com
> >
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

>Yes, I understand query Sx logic. I was trying to find how WMI makes decision

about default remote wakeup checkbox state.

WMI does not make decisions, it is just the access method to this device flag.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
Reply To: Windows System Software Devs Interest List
Sent: Saturday, January 14, 2006 2:59 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] USB wakeup problem with OSR USB-FX2

>Yes, I understand query Sx logic. I was trying to find how WMI makes decision
>about default remote wakeup checkbox state.

WMI does not make decisions, it is just the access method to this device flag.

Bad wording. I meant how mouclass driver assigns the default value to its flag which reports via WMI and which is in turn displayed in device Power Properties. I hoped it is clear from context :slight_smile:

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]