notify a child device of a reconfiguration event

My WDF bus driver gets notified of a reconfiguration event that it needs
to pass to a child (which is in turn a WDF bus driver itself).
Ultimately this interaction will result in the child fdo’s
EvtChildListScanForChildren being called so it can re-enumerate its
child list.

Is there a standard way I can get my child fdo’s
EvtChildListScanForChildren to be called or should I just invent an
internal ioctl and send it down the pdo’s stack?

Thanks

James

if you invalid device relations/bus relations on the child PDO, it will send a new QDR to the child’s stack. but a new QDR does not invoke EvtChildListScanForChildren , only a power up to from Dx->D0 invokes EvtChildListScanForChildren (regardless of the pending QDR state)

d

>

if you invalid device relations/bus relations on the child PDO, it
will send a
new QDR to the child’s stack. but a new QDR does not invoke
EvtChildListScanForChildren , only a power up to from Dx->D0 invokes
EvtChildListScanForChildren (regardless of the pending QDR state)

Thanks Doron. I am now sending an internal device control IRP and that
works fine. The other option would be a callback implemented by a query
interface or something but for what I want the IRP makes more sense.

I can’t seem to see how to send the IRP as a WDFREQUEST though. I have
the WDFDEVICE/DEVICE_OBJECT for the PDO that will ultimately receive the
IRP, but obviously I have to send it to the top of the stack and I can’t
see how to target that. Just sending the IRP using WDM semantics is fine
but it seems like the wrong thing to do - using WDM in a WDF driver when
there should be a WDF way to do it.

Another thing - I would have thought that IoGetAttachedDevice and
WdfDeviceWdmGetAttachedDevice would do similar things, given the
similarity of their names, but IoGetAttachedDevice gets the device at
the top of the stack, and WdfDeviceWdmGetAttachedDevice gets the next
lower device. Confusing.

Thanks

James

Doron has said in the past that if KMDF cannot ‘add value’ to a service
‘WDM’ (I really hate that term since it implies/implied Windows 9x
compatibility), then it does not have a KMDF specific call. I wish more of
the groups with ‘miniports’ such as StorPort, ScsiMiniport, NDIS, etc. were
as open with using Ke/Zw/Io/Ps/?? routines outside their little boxes. Even
when DTM does not check for some routines some customers insist that
‘outside the box’ calls not be used. I do agree when limits are necessary,
then they should be enforced and monitored.

I remember some time ago I developed a simple Python program that would
parse a text file to see if any function listed in it was called in any
source file in a directory. The usage was to detect those functions that
could return an error using SEH so the code could be validated as being in a
__try/__except block of the correct type. Maybe if I was a compiler writer
I could have Python do the parsing for the block too, but I am not and it
was adequate.

“James Harper” wrote in message
news:xxxxx@ntdev…
>
> if you invalid device relations/bus relations on the child PDO, it
will send a
> new QDR to the child’s stack. but a new QDR does not invoke
> EvtChildListScanForChildren , only a power up to from Dx->D0 invokes
> EvtChildListScanForChildren (regardless of the pending QDR state)
>

Thanks Doron. I am now sending an internal device control IRP and that
works fine. The other option would be a callback implemented by a query
interface or something but for what I want the IRP makes more sense.

I can’t seem to see how to send the IRP as a WDFREQUEST though. I have
the WDFDEVICE/DEVICE_OBJECT for the PDO that will ultimately receive the
IRP, but obviously I have to send it to the top of the stack and I can’t
see how to target that. Just sending the IRP using WDM semantics is fine
but it seems like the wrong thing to do - using WDM in a WDF driver when
there should be a WDF way to do it.

Another thing - I would have thought that IoGetAttachedDevice and
WdfDeviceWdmGetAttachedDevice would do similar things, given the
similarity of their names, but IoGetAttachedDevice gets the device at
the top of the stack, and WdfDeviceWdmGetAttachedDevice gets the next
lower device. Confusing.

Thanks

James

>

Doron has said in the past that if KMDF cannot ‘add value’ to a
service
‘WDM’ (I really hate that term since it implies/implied Windows 9x
compatibility), then it does not have a KMDF specific call. I wish
more of
the groups with ‘miniports’ such as StorPort, ScsiMiniport, NDIS, etc.
were
as open with using Ke/Zw/Io/Ps/?? routines outside their little boxes.
Even
when DTM does not check for some routines some customers insist that
‘outside the box’ calls not be used. I do agree when limits are
necessary,
then they should be enforced and monitored.

Agreed. There are good reasons for some of those rules, but only in as
far as when they make the end product better and not worse.

James

> I can’t seem to see how to send the IRP as a WDFREQUEST though.

You can use

WdfRequestCreate, followed by
WdfIoTargetFormatRequestForInternalIoctl[Others]
[Optional] WdfRequestSetCompletionRoutine
WdfRequestSend

In the completion routine you can delete the request you created using (WdfObjectDelete) or just keep the request around in appropriate context and keep reusing it which is preferable if you do need to send request multiple times (you need to call WdfRequestReuse before each reuse).

That would be the WDF way to send requests down.

HTH,
Praveen

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of James Harper
Sent: Saturday, July 25, 2009 6:03 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] notify a child device of a reconfiguration event

if you invalid device relations/bus relations on the child PDO, it
will send a
new QDR to the child’s stack. but a new QDR does not invoke
EvtChildListScanForChildren , only a power up to from Dx->D0 invokes
EvtChildListScanForChildren (regardless of the pending QDR state)

Thanks Doron. I am now sending an internal device control IRP and that
works fine. The other option would be a callback implemented by a query
interface or something but for what I want the IRP makes more sense.

I can’t seem to see how to send the IRP as a WDFREQUEST though. I have
the WDFDEVICE/DEVICE_OBJECT for the PDO that will ultimately receive the
IRP, but obviously I have to send it to the top of the stack and I can’t
see how to target that. Just sending the IRP using WDM semantics is fine
but it seems like the wrong thing to do - using WDM in a WDF driver when
there should be a WDF way to do it.

Another thing - I would have thought that IoGetAttachedDevice and
WdfDeviceWdmGetAttachedDevice would do similar things, given the
similarity of their names, but IoGetAttachedDevice gets the device at
the top of the stack, and WdfDeviceWdmGetAttachedDevice gets the next
lower device. Confusing.

Thanks

James


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer