Hi,
I'm developing a wdm driver under Win2K for a proprietary PCI board.
Unfortunately, the board's PCI interface logic is part of a FPGA that can
only be fully reset by reconfiguring the FPGA. We foresee that we need to
reset our board on certain occasions and we do not want to power-cycle our
system for this.
Therfor, I'm implementing the following reset sequence in my driver:
Because the reconfiguration of the FPGA resets the PCI config space, I start
with saving this data (after having disabled the boards PCI interface). I
then call PoRequestPowerIrp to force the board to go to device state D3. In
the IoCompletion routine, PoRequestPowerIrp is called again to force the
board to go back to device state D0 (this actually resets our FPGA and the
PCI config space). In the IoCompletion routine of the second
PoRequestPowerIrp, I restore the PCI config space data and reenable the PCI
interface.
When, in the above scheme, I use the sequence
IoBuildAsynchronousFsdRequest() - IoSetCompletionRoutine() - IoCallDriver()
to read or write the PCI configuration space, this completion routine is
called with DeviceObject = NULL. I solve this by passing the DeviceObject
via the 'context' of the completion routine. Is this normal or could I be
doing something wrong here?
Apart from the above problem the sequence seems to work, but I am not sure
wether I should also save and restore the power management registers of the
PCI config space. Or should I leave this to the pci.sys bus driver who does
the actual D0/D3/D0 switching ?
Also, I'm not sure that the above will work under all circumstances so I
would appreciate it if anybody knows where to find some more info on stuff
like this.
Thanks in advance,
Koen