READ_PORT_USHORT / WRITE_PORT_USHORT problem

Hello,
I have a conspicuous problem, for which I seek a solution. Maybe Walter
or Mark can help. My WDM driver handles two PCI cards of same type. The
handler for IRP_MJ_START_DEVICE is called for both the cards, but somehow
the READ_PORT_USHORT and WRITE_PORT_USHORT functions don’t work for one
card and work for the other card.


READ_PORT_USHORT((PUSHORT)((ULONG_PTR)xp_DeviceExtension->mp_ucPortBase+
0x4));

The card for which they work, the PnP Manager assigns the IO range
FF00-FFFF, and the one for which they don’t work, the IO range is
FE00-FEFF.
When I say, the READ_PORT_USHORT doesn’t work, I mean that do what I may,
it always returns 65535. Subsequent writes and reads on the card indicate
that the read/write had failed.

One observation is that, if I insert only one card, the system always
assigns FF00-FFFF, and all reads and writes are successful. I tried out
putting both cards singly in both the slots, and it seems that it is not a
hardware problem.

I hope I’ve described the problem properly. I shall send in more info if
required.

Regards,
Sunil Jigyasu

This sounds like either a platform or device problem, or you have an
egregious software error. Certainly NT supports more than one IO address
decode on the PCI bus. A PCI bus analyzer would help isolate the problem,
but of course such equipment is expensive. I would replicate the problem on
more than one platform. You can also use windbg to directly read/write the
device register and to examine pci config space. If that works I suspect
that you ought to do a complete code review as it suggests a software
problem.

-----Original Message-----
From: Sunil Jigyasu [mailto:xxxxx@vigorsoft.com]
Sent: Tuesday, June 24, 2003 2:16 AM
To: NT Developers Interest List
Subject: [ntdev] READ_PORT_USHORT / WRITE_PORT_USHORT problem

Hello,
I have a conspicuous problem, for which I seek a solution. Maybe Walter or
Mark can help. My WDM driver handles two PCI cards of same type. The
handler for IRP_MJ_START_DEVICE is called for both the cards, but somehow
the READ_PORT_USHORT and WRITE_PORT_USHORT functions don’t work for one card
and work for the other card. … …
READ_PORT_USHORT((PUSHORT)((ULONG_PTR)xp_DeviceExtension->mp_ucPortBase+
0x4));

The card for which they work, the PnP Manager assigns the IO range
FF00-FFFF, and the one for which they don’t work, the IO range is FE00-FEFF.
When I say, the READ_PORT_USHORT doesn’t work, I mean that do what I may, it
always returns 65535. Subsequent writes and reads on the card indicate that
the read/write had failed.

One observation is that, if I insert only one card, the system always
assigns FF00-FFFF, and all reads and writes are successful. I tried out
putting both cards singly in both the slots, and it seems that it is not a
hardware problem.

I hope I’ve described the problem properly. I shall send in more info if
required.

Regards,
Sunil Jigyasu


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

Hello Mark,

Thanks for replying.
I just tried out performing reads and writes on both cards at specific
offsets using a third-party evaluation DriverWizard from Jungo, to check
the IO address ranges. Surprisingly, it shows an IO range of FF00-FFFF for
BOTH the cards, though the Device Manager AND my the enumeration code in
my driver both show FE00-FEFF for one card and FF00-FFFF for the other.

Meanwhile, if I may post this question on this forum, can you tell me how
to write directly to device registers from Windbg ? In particular, how do
I know which register is a device register ?

Regards,
Sunil Jigyasu

Windbg supports IB, ID, IW port input operations. Also see the !pci command
to get read access to pci config space. You should examine pci config space,
as your report regarding the Jungo driver suggests that your two PCI devices
are non-conformant and are attempting to use fixed IO port addresses for
their bars rather than programmable IO port addresses. If this is true then
you have to get the hardware repaired.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Sunil Jigyasu [mailto:xxxxx@vigorsoft.com]
Sent: Wednesday, June 25, 2003 1:54 AM
To: NT Developers Interest List
Subject: [ntdev] RE: READ_PORT_USHORT / WRITE_PORT_USHORT problem

Hello Mark,

Thanks for replying.
I just tried out performing reads and writes on both cards at specific
offsets using a third-party evaluation DriverWizard from Jungo, to check the
IO address ranges. Surprisingly, it shows an IO range of FF00-FFFF for BOTH
the cards, though the Device Manager AND my the enumeration code in my
driver both show FE00-FEFF for one card and FF00-FFFF for the other.

Meanwhile, if I may post this question on this forum, can you tell me how to
write directly to device registers from Windbg ? In particular, how do I
know which register is a device register ?

Regards,
Sunil Jigyasu


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

Hi Mark,

Thank you for your replies.
(I am working along with Sunil Jigyasu under the same project in the same
co.)

The BAR0 shown by !pci in Windbg are the same (FF01) for both the cards.
While the Device Manager still shows FEOO-FEFF and FF00-FFFF IO ranges for
them.

Considering this difference, I tried performing reads and writes on both
cards using FE00 as BAR0 for one card and FF00 for another. The one with
FE00 still does not work.

Now, here my driver is not involved at all. I am reading and writing
directly using Windbg, although I am using a BAR0 indicated by the Device
Manager (FE00).

What do I conclude from this ? Is this a problem with my device or could
this be a W2K issue ? Please do reply.

Regards,
Atur Shah

My conclusion is that your PCI devices do not conform to the PCI standard,
and will not support multiple device instances on a PCI bus hierarchy.

=====================
Mark Roddy
Hollis Technology Solutions
www.hollistech.com
xxxxx@hollistech.com

-----Original Message-----
From: Atur Shah [mailto:xxxxx@vigorsoft.com]
Sent: Thursday, June 26, 2003 8:38 AM
To: NT Developers Interest List
Subject: [ntdev] RE: READ_PORT_USHORT / WRITE_PORT_USHORT problem

Hi Mark,

Thank you for your replies.
(I am working along with Sunil Jigyasu under the same project in the same
co.)

The BAR0 shown by !pci in Windbg are the same (FF01) for both the cards.
While the Device Manager still shows FEOO-FEFF and FF00-FFFF IO ranges for
them.

Considering this difference, I tried performing reads and writes on both
cards using FE00 as BAR0 for one card and FF00 for another. The one with
FE00 still does not work.

Now, here my driver is not involved at all. I am reading and writing
directly using Windbg, although I am using a BAR0 indicated by the Device
Manager (FE00).

What do I conclude from this ? Is this a problem with my device or could
this be a W2K issue ? Please do reply.

Regards,
Atur Shah


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

At 09:05 AM 6/26/2003, Mark Roddy wrote:

My conclusion is that your PCI devices do not conform to the PCI standard,
and will not support multiple device instances on a PCI bus hierarchy.
I think what Mark means by this is that your device is decoding at FF00
independent of the system’s attempt to configure it at FE00. Device Manager
knows it ought to be at FE00 but the card does not respond there. Perhaps
there’s only a single line failure in your test board - there’s only one
bit difference between E and F. If the board designer thinks this should be
working, try putting other addresses, e.g. 200, in the address register and
see if it responds there.