Tech Support > Microsoft Windows > Drivers > one bug in ndis6 for vista
one bug in ndis6 for vista
Posted by zhangfei on August 17th, 2007


I write a miniport6 driver for my NIC for vista. But I find one bug of
wakeup in ndis6.
Property --> Power Management --> 'Allow this device to wake up the
computer', when
this option is checked , OS will send OID_PNP_ENABLE_WAKE_UP to ask my
miniport driver
enable NIC NDIS_PNP_WAKE_UP_MAGIC_PACKET and NDIS_PNP_WAKE_UP_PATTERN_MATCH
wakeup at
loading time , this is okay. But, when that option is unchecked, the OS will
still send
OID_PNP_ENABLE_WAKE_UP to ask my miniport driver enable NIC
NDIS_PNP_WAKE_UP_PATTERN_MATCH wakeup
at loading time. And OS do nothing before entering S3 sleep state. This is
not according to
WDK specification:

OID_PNP_ENABLE_WAKE_UP
As a set, the OID_PNP_ENABLE_WAKE_UP OID specifies the wake-up capabilities
that a miniport driver should enable in a NIC.

As a query, OID_PNP_ENABLE_WAKE_UP obtains the current wake-up capabilities
that are enabled for a NIC.

This topic documents OID_PNP_ENABLE_WAKE_UP for NDIS 6.0 and later versions.

For NDIS 5.x information, see OID_PNP_ENABLE_WAKE_UP (NDIS 5.x).

The InformationBuffer member of the NDIS_OID_REQUEST structure contains
flags that can be bit-wise ORed together to enable a combination of wake-up
events:

NDIS_PNP_WAKE_UP_MAGIC_PACKET
When set, specifies that the miniport driver should enable a NIC to signal
a wake-up event on receipt of a Magic Packet. (A Magic Packet is a packet
that contains 16 contiguous copies of the receiving NIC's Ethernet address.)
When cleared, specifies that the miniport driver should disable the NIC from
signaling such a wake-up event.
NDIS_PNP_WAKE_UP_PATTERN_MATCH
When set, specifies that the miniport driver should enable a NIC to signal
a wake-up event on receipt of a packet that contains a pattern specified by
the protocol with OID_PNP_ADD_WAKE_UP_PATTERN. When cleared, specifies that
the miniport driver should disable the NIC from signaling such a wake-up
event.
NDIS_PNP_WAKE_UP_LINK_CHANGE
Reserved. NDIS ignores this flag.

A protocol driver uses the miniport adapter's wake-up capabilities in
NDIS_BIND_PARAMETERS to enable the associated NIC's wake-up capabilities. A
protocol driver can also query this OID to determine which wake-up
capabilities are enabled for a NIC.

NDIS does not immediately enable the wake-up capabilities that a protocol
driver specifies. Instead, NDIS keeps tracks of the wake-up capabilities
that the protocol driver enabled and, just before the miniport adapter
transitions to a low-power state, NDIS sends an OID_PNP_ENABLE_WAKE_UP set
request to the miniport driver to enable the appropriate wake-up events.

Before the miniport adapter transitions to a low-power state (that is,
before NDIS sends the miniport driver an OID_PNP_SET_POWER request), NDIS
sends the miniport driver an OID_PNP_ENABLE_WAKE_UP request to enable the
appropriate wake-up capabilities.

The miniport driver must take the appropriate device-dependent steps to
enable or disable wake-up events on the NIC.

The miniport driver should clear the wake-up capabilities that NDIS set with
OID_PNP_ENABLE_WAKE_UP when the system is resumed. The wake-up capabilities
should not be persisted across resumes. If wake-up capabilities are enabled,
NDIS explicitly sets OID_PNP_ENABLE_WAKE_UP before the miniport transitions
to the low-power state.


Any suggestion will be appreciated! Thanks in advance!


Posted by Calvin Guan on August 17th, 2007


Folks at Redmond said it's been fixed in sp1 and lh server.

--
Calvin Guan
Broadcom Corporation
Connecting Everything(r)

"zhangfei" <fzhang@atheros.com> wrote in message
news:eGGfjOK4HHA.4584@TK2MSFTNGP03.phx.gbl...