I wrote a NDIS IM driver based on the PASSTHRU sample in the PB5.0. It
works well on my Qtek9000 and QtekS200 except one issue that
NdisAllocatePacket can hang after standby/resume. So I did the AKU2 update
as soon as they are available. However I was surprised by the outcome.
Before the AKU2 update, a standby/resume will cause a complete tear down and
rebind of the NDIS stack and after that things recover nicely. This is true
even I return NDIS_STATUS_SUCCESS in ProtocolPNPHandler with
NetEventSetPower. However after AKU2 update, if I return NDIS_STATUS_SUCCESS
in ProtocolPNPHandler with NetEventSetPower things seems to be simpler.
Standby/resume only cause the lower WLAN miniport to go to D3 and then back
to D0. There is no NDIS stack tear down and rebuild anymore. If I return
NDIS_STATUS_NOT_SUPPORTED in ProtocolPNPHandler on NetEventSetPower then I
get the complete tear down and rebuild behavior back. This is all seems to
be reasonable however in either case the whole network stack hangs up after
resume. There is no NDIS calls into the IM driver anymore and apps which
uses IpHlpAPI will hangup as well. In short the whole NDIS stack is dead and
anything that touches the stack will also die. However one case still do
other things on the device such as open/read a text file. What I do in the
ProtocolPNPHandler are just setting some simple flags and the call is
returned without locks held. There is one more thing, with the complete
stack teardown and rebuild, I also get a D0->D0 notification after the
D3->D0 notification after resume. All the D0->D3, D3->D0 and D0->D0 seems to
happen on device resume. When going to standby everything happens instantly
and I cannot see D0->D3 being logged immediately. I am not sure whether
D0->D3 notification happens on the moment the standby happens but I guess it
happens on resume due to the aggressive power saving stratergy on PPC and on
PPC CPU actually stops on standby. During this standby/resume event all my
fucntions are returned without locks held and this code works before AKU2
update. Now the question is why NDIS hangs up with AKU2? Has anyone
experiencing similar problems or having some insight into the problem?
Thanks in advance!
Jicun