Can filter driver read PCI configure space?

Hi all,
I have a special purpose to modify the configure space of a pcie switch.
Because this operation must be done when the system is booting, I supposed that a filter driver can achieve my intent: Neither damage the original driver’s function, but also to modify the switch’s configuration space.
I’m I trying to search the relevant documents but no gains, so i’m not sure if my method can be implemented or if there is a better solution.

Thanks

xxxxx@sina.com

On Nov 23, 2017, at 1:16 AM, xxxxx@sina.com wrote:
>
> I have a special purpose to modify the configure space of a pcie switch.
> Because this operation must be done when the system is booting, I supposed that a filter driver can achieve my intent: Neither damage the original driver’s function, but also to modify the switch’s configuration space.
> I’m I trying to search the relevant documents but no gains, so i’m not sure if my method can be implemented or if there is a better solution.

What do you mean by “booting”, exactly? A filter can’t be loaded until the operating system is up and running enough to start the PCI bus driver. Does your tweak have to be run before some other driver loads?

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thank you very much for your reply.
The words I used is not accurate enough, I will describe my scene in detail: My card is declared as Gen3 X4, but there’s a certain chance will be negotiated into Gen1 X4. This should be caused by a hardware problem
that requires further positioning by a hardware engineer. However, I found that the retrain bit of the down stream port of the PCIe switch can be modified to trigger retraining of the link, so that the card can work stably in the Gen3 X4 state.
So I want to use the filter driver automatically trigger retraining to avoid the problem when the system startup, does not affect the follow-up of the card function test.

xxxxx@sina.com

From: xxxxx@probo.com
Date: 2017-11-24 06:44
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Can filter driver read PCI configure space?

On Nov 23, 2017, at 1:16 AM, xxxxx@sina.com wrote:
>
> I have a special purpose to modify the configure space of a pcie switch.
> Because this operation must be done when the system is booting, I supposed that a filter driver can achieve my intent: Neither damage the original driver’s function, but also to modify the switch’s configuration space.
> I’m I trying to search the relevant documents but no gains, so i’m not sure if my method can be implemented or if there is a better solution.

What do you mean by “booting”, exactly? A filter can’t be loaded until the operating system is up and running enough to start the PCI bus driver. Does your tweak have to be run before some other driver loads?

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>

On Nov 23, 2017, at 6:00 PM, xxxxx@sina.com wrote:
>
> Thank you very much for your reply.
> The words I used is not accurate enough, I will describe my scene in detail: My card is declared as Gen3 X4, but there’s a certain chance will be negotiated into Gen1 X4. This should be caused by a hardware problem
> that requires further positioning by a hardware engineer. However, I found that the retrain bit of the down stream port of the PCIe switch can be modified to trigger retraining of the link, so that the card can work stably in the Gen3 X4 state.
> So I want to use the filter driver automatically trigger retraining to avoid the problem when the system startup, does not affect the follow-up of the card function test.

For test and debugging purposes, you might as well make this part of your own driver. You can’t ship boards with a flaw like that, because you don’t know that all the motherboards you’ll be installed in have the same PCIe root complex, or whether they support the same retrain commands.

Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

“Doing it in the driver” might be difficult if “the driver” is “the wrong
sort”. Adding a filter driver that uses either KMDF or WDM to access config
space and participate fully in pnp would seem the right way to go.

Mark Roddy

On Fri, Nov 24, 2017 at 3:22 AM, xxxxx@probo.com wrote:

> On Nov 23, 2017, at 6:00 PM, xxxxx@sina.com wrote:
> >
> > Thank you very much for your reply.
> > The words I used is not accurate enough, I will describe my scene in
> detail: My card is declared as Gen3 X4, but there’s a certain chance will
> be negotiated into Gen1 X4. This should be caused by a hardware problem
> > that requires further positioning by a hardware engineer. However,
> I found that the retrain bit of the down stream port of the PCIe switch can
> be modified to trigger retraining of the link, so that the card can work
> stably in the Gen3 X4 state.
> > So I want to use the filter driver automatically trigger retraining
> to avoid the problem when the system startup, does not affect the follow-up
> of the card function test.
>
> For test and debugging purposes, you might as well make this part of your
> own driver. You can’t ship boards with a flaw like that, because you don’t
> know that all the motherboards you’ll be installed in have the same PCIe
> root complex, or whether they support the same retrain commands.
> —
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:> showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:>