EvtDeviceResourceQuery vs EvtDeviceResourceRequirementsQuery

Help!

No matter how many times I read the documentation, I still can’t
understand WTF I’m supposed to do in each of these callbacks.

My (PCI) bus driver enumerates a number of child devices, each of which
has these 2 callbacks defined in the bus driver.

What I want to do is assign a (subset) block of memory from one of the
PCI device BARs at a (different) fixed offset to each child. IIUC the
FDO for each child PDO can then retrieve these resources from it’s own
PnP callback to access PCI memory space directly.

But I can’t figure out what I’m doing in these callbacks, and when/where
to assign physical/translated IO spaces?

Any hints would be greatly appreciated!

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

You should implement EvtDeviceResourceRequirementsQuery. You will be
passed a WDFIORESREQLIST. You will then be required to add at least one
WDFIORESLIST to the WDFIORESREQLIST. Each WDFIORESLIST is a set of
possible resource requirements for the device. Each WDFIORESLIST is an
alternative set of resource requirements.

Now, this how it works in theory. In practice, you also need to be able
to arbitrate these resources with the owner of them (your FDO). The
arbitration interfaces/implementation are not public, so even once you
get these requirements reported, you may not be able to get your PDO’s
stack started. Instead, expose a custom interface through QI. The
driver that loads on the FDO then queries for the interface. This
private interface can handout whatever resources you want back to the
FDO without involving official PnP resource assignment.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark McDougall
Sent: Tuesday, February 27, 2007 8:28 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] EvtDeviceResourceQuery vs
EvtDeviceResourceRequirementsQuery

Help!

No matter how many times I read the documentation, I still can’t
understand WTF I’m supposed to do in each of these callbacks.

My (PCI) bus driver enumerates a number of child devices, each of which
has these 2 callbacks defined in the bus driver.

What I want to do is assign a (subset) block of memory from one of the
PCI device BARs at a (different) fixed offset to each child. IIUC the
FDO for each child PDO can then retrieve these resources from it’s own
PnP callback to access PCI memory space directly.

But I can’t figure out what I’m doing in these callbacks, and when/where
to assign physical/translated IO spaces?

Any hints would be greatly appreciated!

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266


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

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

Doron Holan wrote:

This
private interface can handout whatever resources you want back to the
FDO without involving official PnP resource assignment.

You mean I should forget about any PnP resources in my upper FDO and
simply pass a pointer via the custom interface to my MmapIoSpace’d PCI
space upwards?

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

Yes, a pointer (and I would guess a length :wink:

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark McDougall
Sent: Tuesday, February 27, 2007 10:25 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] EvtDeviceResourceQuery vs
EvtDeviceResourceRequirementsQuery

Doron Holan wrote:

This
private interface can handout whatever resources you want back to the
FDO without involving official PnP resource assignment.

You mean I should forget about any PnP resources in my upper FDO and
simply pass a pointer via the custom interface to my MmapIoSpace’d PCI
space upwards?

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266


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

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

Doron’s answer was practical and useful. But he didn’t really answer the
question you asked (even if he did steer you toward the question you should
have asked.)

I’ll answer your original question here, even if it probably doesn’t bear on
your situation.

A “Resource List” (aka CmResList) is a set of resources that is assigned to
a device. It’s the answer to either of these two questions: “What
resources is this device decoding right now?” and “What resources should
this device be decoding when it is turned on?”

A “Resource Requirements List” (aka IoResList) is a set of sets of possible
resources for a device. It’s the answer to the question “What are all the
possible ways of legally configuring this device?”

These two callbacks allow you to supply the answers to these questions.
Again, this probably doesn’t bear on your situation. If you’re trying to
subdivide resources assigned to a PCI device, you should either instantiate
an arbiter using MF.sys or you should use a private interface as Doron
described.

  • Jake Oshins
    Windows Kernel Team

“Mark McDougall” wrote in message news:xxxxx@ntdev…
> Help!
>
> No matter how many times I read the documentation, I still can’t
> understand WTF I’m supposed to do in each of these callbacks.
>
> My (PCI) bus driver enumerates a number of child devices, each of which
> has these 2 callbacks defined in the bus driver.
>
> What I want to do is assign a (subset) block of memory from one of the
> PCI device BARs at a (different) fixed offset to each child. IIUC the
> FDO for each child PDO can then retrieve these resources from it’s own
> PnP callback to access PCI memory space directly.
>
> But I can’t figure out what I’m doing in these callbacks, and when/where
> to assign physical/translated IO spaces?
>
> Any hints would be greatly appreciated!
>
> Regards,
>
> –
> Mark McDougall, Engineer
> Virtual Logic Pty Ltd, http:
> 21-25 King St, Rockdale, 2216
> Ph: +612-9599-3255 Fax: +612-9599-3266
></http:>

Doron Holan wrote:

Yes, a pointer (and I would guess a length :wink:

Thanks again Doran!

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

Jake Oshins wrote:

These two callbacks allow you to supply the answers to these
questions. Again, this probably doesn’t bear on your situation. If
you’re trying to subdivide resources assigned to a PCI device, you
should either instantiate an arbiter using MF.sys or you should use a
private interface as Doron described.

Thanks Jake!

It sure is a challenge coming up to speed on WDM with just the WDK doco
and no book to guide you through the minefield…

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>

There is an excellent book on WDM written by Walter Oney before he returned
to the dark side. Make sure you get the 2nd edition and use his web site to
find updates to the book and samples. There are books coming on KMDF and
OSR has started offering classes if you want to use KMDF.

“Mark McDougall” wrote in message news:xxxxx@ntdev…
> Jake Oshins wrote:
>
>> These two callbacks allow you to supply the answers to these
>> questions. Again, this probably doesn’t bear on your situation. If
>> you’re trying to subdivide resources assigned to a PCI device, you
>> should either instantiate an arbiter using MF.sys or you should use a
>> private interface as Doron described.
>
> Thanks Jake!
>
> It sure is a challenge coming up to speed on WDM with just the WDK doco
> and no book to guide you through the minefield…
>
> Regards,
>
> –
> Mark McDougall, Engineer
> Virtual Logic Pty Ltd, http:
> 21-25 King St, Rockdale, 2216
> Ph: +612-9599-3255 Fax: +612-9599-3266
></http:>

The MSPress KMDF book description can be found here

http://www.microsoft.com/MSPress/books/10512.aspx

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Craig
Sent: Wednesday, February 28, 2007 9:32 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] EvtDeviceResourceQuery vs
EvtDeviceResourceRequirementsQuery

There is an excellent book on WDM written by Walter Oney before he
returned
to the dark side. Make sure you get the 2nd edition and use his web
site to
find updates to the book and samples. There are books coming on KMDF
and
OSR has started offering classes if you want to use KMDF.

“Mark McDougall” wrote in message news:xxxxx@ntdev…
> Jake Oshins wrote:
>
>> These two callbacks allow you to supply the answers to these
>> questions. Again, this probably doesn’t bear on your situation. If
>> you’re trying to subdivide resources assigned to a PCI device, you
>> should either instantiate an arbiter using MF.sys or you should use a
>> private interface as Doron described.
>
> Thanks Jake!
>
> It sure is a challenge coming up to speed on WDM with just the WDK
doco
> and no book to guide you through the minefield…
>
> Regards,
>
> –
> Mark McDougall, Engineer
> Virtual Logic Pty Ltd, http:
> 21-25 King St, Rockdale, 2216
> Ph: +612-9599-3255 Fax: +612-9599-3266
>


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

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

Don’t get put off from the writeup on the link below, the draft I saw of
the book is much better than what the description makes it sound like. Of
course, the best situation is when we have the MSPress book on WDF, the OSR
book on KMDF, and the OSR replacement for Oney’s book!


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

“Doron Holan” wrote in message
news:xxxxx@ntdev…
The MSPress KMDF book description can be found here

http://www.microsoft.com/MSPress/books/10512.aspx

d

Yeah, the description is awful :(.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Don Burn
Sent: Wednesday, February 28, 2007 10:52 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] EvtDeviceResourceQuery vs
EvtDeviceResourceRequirementsQuery

Don’t get put off from the writeup on the link below, the draft I saw of

the book is much better than what the description makes it sound like.
Of
course, the best situation is when we have the MSPress book on WDF, the
OSR
book on KMDF, and the OSR replacement for Oney’s book!


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

“Doron Holan” wrote in message
news:xxxxx@ntdev…
The MSPress KMDF book description can be found here

http://www.microsoft.com/MSPress/books/10512.aspx

d


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

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

David Craig wrote:

There is an excellent book on WDM written by Walter Oney before he
returned to the dark side. Make sure you get the 2nd edition and use
his web site to find updates to the book and samples. There are
books coming on KMDF and OSR has started offering classes if you want
to use KMDF.

Sorry, I meant WDF! I have Walt’s WDM book and it has been invaluable in
the past - which is why I wish that the WDF book was released *now*!

Regards,


Mark McDougall, Engineer
Virtual Logic Pty Ltd, http:
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266</http:>