One card initialization failure

I apologize if this has been covered before, but I can’t find material on
the same.

My driver is written for 2 PCI cards. At boottime, the PnP Manager
detects the cards, sends PnP requests – including the IRP_MN_START_DEVICE
for BOTH the cards. In StartDevice, I have extracted the BARs and
performed a series of reads and writes for initializing using the
READ_PORT_XXX functions. The problem is that, only one card gets
initialized, and the other does not. No read or write has any effect on
the other card.

Both cards initialize well in both the PCI hardware slots individually,
but only one does when both are put together. (The BAR0s are assigned as
FF00 and FE00 for the cards, and the initialization occurs for the card
with BAR0 as FF00 – if this information might matter.)

Can anybody throw some light on this ?

Regards,
Sunil Jigyasu.

Sunil Jigyasu wrote:

My driver is written for 2 PCI cards. At boottime, the PnP Manager
detects the cards, sends PnP requests – including the IRP_MN_START_DEVICE
for BOTH the cards. In StartDevice, I have extracted the BARs and
performed a series of reads and writes for initializing using the
READ_PORT_XXX functions. The problem is that, only one card gets
initialized, and the other does not. No read or write has any effect on
the other card.

Both cards initialize well in both the PCI hardware slots individually,
but only one does when both are put together. (The BAR0s are assigned as
FF00 and FE00 for the cards, and the initialization occurs for the card
with BAR0 as FF00 – if this information might matter.)

First of all, are you trying to directly read the BARs somehow, and (if
so) why? Generally speaking, the I/O resource parameter structures that
accompany START_DEVICE have all the information you need to map ports &
registers, connect your interrupt, etc.

I would also be concerned by your statement that your “driver is written
for 2 PCI cards”. Do you mean that you have a restriction built into the
driver? If so, why?

I can see you having a problem if you were using global variables to
keep track of things like register addresses. Are you possibly doing
that instead of using members of your device extension structure for
that purpose?


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com

Thank you for reply, Mr.Oney.

First of all, are you trying to directly read the BARs somehow, and (if
so) why? Generally speaking, the I/O resource parameter structures that
accompany START_DEVICE have all the information you need to map ports &
registers, connect your interrupt, etc.

About reading the BARs, I am getting the BAR from the u.Port.Start.LowPart
of the partial descriptor list. I use this address – adding offsets to
it – as parameter to READ_PORT_XXX.

I would also be concerned by your statement that your “driver is written
for 2 PCI cards”. Do you mean that you have a restriction built into the
driver? If so, why?

No, there is no restriction built into the driver. I just happened to
mince words while describing the problem. I am handling more than one PCI
cards of same type with same PCI DeviceIds.

I can see you having a problem if you were using global variables to
keep track of things like register addresses. Are you possibly doing
that instead of using members of your device extension structure for
that purpose?

Actually, I am indeed using device extension structure for storing the
BARs. Both devices have their own device extension structures with their
respective information. I was warned of possible issues with use of
globals by a previous post by Mark Roddy.

What could possible be the problem ?

Regards,
Sunil Jigyasu.

Sunil Jigyasu wrote:

Actually, I am indeed using device extension structure for storing the
BARs. Both devices have their own device extension structures with their
respective information. I was warned of possible issues with use of
globals by a previous post by Mark Roddy.

What could possible be the problem ?

Darned if I know. Is your card possibly not responding correctly?


Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Now teaming with John Hyde for USB Device Engineering Seminars
Check out our schedule at http://www.oneysoft.com