Avoiding PCI Resource allocation and PCI Bus filter driver

Discussion in 'Windows Vista Drivers' started by Vasudevan Srinivasan, Jun 22, 2008.

  1. I'm trying to avoid the pnp manager from allocating an MMIO resource for a
    pci device even though the device has that resource available (There is no
    IOBAR equivalent to this MMIO bar, but, I do not want this MMIO bar for the
    device to be functional and this MMIO is not functioning as expected and
    hence this requirement).

    I tried handling the EvtDeviceFilterRemoveResourceRequirements in the
    function driver and tried to remove the memory resource, but, the device
    yellow banged in device manager.

    I also read from the forums and WDK documentation that a bus filter driver
    could handle the IRP_MN_QUERY_RESOURCE_REQUIREMENTS (
    EvtDeviceResourceRequirementsQuery in WDF?) and alter the resource
    requirements.

    Question 1: Since my device is a PCI device (Bus X, Dev Y, Fn Z) that has
    pci.sys as the bus driver, how do I install a bus filter driver for this
    device? I need my function driver to install as well so would greatly
    appreciate any pointers on how to setup the inf file for this filter driver
    (I would prefer a separate inf file for this filter driver if possible, so I
    can choose to install this filter or not). I'm assuming writing this filter
    driver itself shouldn't be a big deal as it could be a regular WDF driver
    that adds the specific PNP event handler that I need.

    Question 2: Can I add this PDO event handler in my function driver itself?
    If so, will it automatically get tied to the PDO that my function driver is
    connecting to?

    Appreciate any help/pointers that would allow me to remove the Memory BAR
    allocation by the PNP Manager and still allow my function driver to load
    fine.

    Thanks,
    Vasu.
     
    Vasudevan Srinivasan, Jun 22, 2008
    #1
    1. Advertisements

  2. Vasudevan Srinivasan

    Pavel A. Guest

    Have you tried to specify a resources override in your INF?

    --PA
     
    Pavel A., Jun 22, 2008
    #2
    1. Advertisements

  3. Then PCI.SYS seems to check that it's getting correct number of BARs in
    START_DEVICE.
     
    Alexander Grigoriev, Jun 22, 2008
    #3
  4. How can I specify a resource override to avoid allocating a resource? I
    thought you can specify a resource override to shrink or specify legacy
    addresses and such only...

    Thanks,
    Vasu.
     
    Vasudevan Srinivasan, Jun 22, 2008
    #4
  5. if you want to modify the resource list back to its original form, you can
    do so in EvtDeviceFilterAddResourceRequirements

    d
     
    Doron Holan [MSFT], Jun 23, 2008
    #5
  6. Vasudevan Srinivasan

    Tim Roberts Guest

    If you own the function driver, as the last sentence implies, then why
    can't you just modify the driver to ignore the resource? No one else is
    going to try to access your memory space.
     
    Tim Roberts, Jun 24, 2008
    #6
  7. Well, I'm trying to workaround a hardware issue and I cannot ignore the
    resource per se.. I'll have to prevent the OS from allocating it.

    Thanks,
    Vasu.
     
    Vasudevan Srinivasan, Jun 24, 2008
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.