detect slot number on which my pci card is plug in ?

Could anyone tell how to use CA_PCI_… functions detect which pci slot My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

Haomin Lin <linhm@uwyo.edu> wrote:

Could anyone tell how to use CA_PCI_… functions detect which pci slot My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

The way I’ve done this in the past is to steal the source for “show_pci”
(it’s in the /usr/free section on quics.qnx.com), and see how they do
the display. What you’re looking for is a match between your vendor ID
and device ID and whatever is in a given slot… For laughs, try running
“show_pci -vvv” at your prompt – you’ll see what kind of info you can get.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at www.parse.com

Thanks. I know using vendor ID and devive ID and we can get many information
with CA_PCI_… function calls.
My application is that I have two identical cards pluged in, they have the
same vendor ID and device ID. I want to differentiate them in my program,
since they are pluged in different slots, i want to get the slots number
corresponding to each card. However i do not know which parameter from
CA_PCI_… function call or show_pci command is the slot number ???
<nospam94@parse.com> wrote in message news:9rbqb4$ffd$1@inn.qnx.com

Haomin Lin <> linhm@uwyo.edu> > wrote:
Could anyone tell how to use CA_PCI_… functions detect which pci slot
My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

The way I’ve done this in the past is to steal the source for “show_pci”
(it’s in the /usr/free section on quics.qnx.com), and see how they do
the display. What you’re looking for is a match between your vendor ID
and device ID and whatever is in a given slot… For laughs, try running
“show_pci -vvv” at your prompt – you’ll see what kind of info you can
get.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at > www.parse.com

In CA_PCI_Find_Device function to find a vendor/device combination, there is a
parameter, index. Setting this to 0 will find the “first” card with the given
combination. Setting it to 1 will find the “second”, etc. I believe that this
index is not necessarily related in a simple, fixed way to slot position. It
depends on the hardware BIOS. You will need to resolve which card is which by
trying some command and see which one reacts.

Haomin Lin wrote:

Thanks. I know using vendor ID and devive ID and we can get many information
with CA_PCI_… function calls.
My application is that I have two identical cards pluged in, they have the
same vendor ID and device ID. I want to differentiate them in my program,
since they are pluged in different slots, i want to get the slots number
corresponding to each card. However i do not know which parameter from
CA_PCI_… function call or show_pci command is the slot number ???
nospam94@parse.com> > wrote in message news:9rbqb4$ffd$> 1@inn.qnx.com> …
Haomin Lin <> linhm@uwyo.edu> > wrote:
Could anyone tell how to use CA_PCI_… functions detect which pci slot
My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

The way I’ve done this in the past is to steal the source for “show_pci”
(it’s in the /usr/free section on quics.qnx.com), and see how they do
the display. What you’re looking for is a match between your vendor ID
and device ID and whatever is in a given slot… For laughs, try running
“show_pci -vvv” at your prompt – you’ll see what kind of info you can
get.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at > www.parse.com

Yes, I think you are right.
I tried, but i still have no idea about resolving which card is which ?
Anyone did this before ?

“Dean Douthat” <ddouthat@faac.com> wrote in message
news:3BD981FC.31E43773@faac.com

In CA_PCI_Find_Device function to find a vendor/device combination, there
is a
parameter, index. Setting this to 0 will find the “first” card with the
given
combination. Setting it to 1 will find the “second”, etc. I believe that
this
index is not necessarily related in a simple, fixed way to slot position.
It
depends on the hardware BIOS. You will need to resolve which card is
which by
trying some command and see which one reacts.

Haomin Lin wrote:

Thanks. I know using vendor ID and devive ID and we can get many
information
with CA_PCI_… function calls.
My application is that I have two identical cards pluged in, they have
the
same vendor ID and device ID. I want to differentiate them in my
program,
since they are pluged in different slots, i want to get the slots number
corresponding to each card. However i do not know which parameter from
CA_PCI_… function call or show_pci command is the slot number ???
nospam94@parse.com> > wrote in message news:9rbqb4$ffd$> 1@inn.qnx.com> …
Haomin Lin <> linhm@uwyo.edu> > wrote:
Could anyone tell how to use CA_PCI_… functions detect which pci
slot
My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

The way I’ve done this in the past is to steal the source for
“show_pci”
(it’s in the /usr/free section on quics.qnx.com), and see how they do
the display. What you’re looking for is a match between your vendor
ID
and device ID and whatever is in a given slot… For laughs, try
running
“show_pci -vvv” at your prompt – you’ll see what kind of info you can
get.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at
www.parse.com

Haomin Lin <linhm@uwyo.edu> wrote:

Thanks. I know using vendor ID and devive ID and we can get many information
with CA_PCI_… function calls.
My application is that I have two identical cards pluged in, they have the
same vendor ID and device ID. I want to differentiate them in my program,
since they are pluged in different slots, i want to get the slots number
corresponding to each card. However i do not know which parameter from
CA_PCI_… function call or show_pci command is the slot number ???

Oh. :frowning:

I think that the actual number (index) varies anyway depending on the
motherboard… It’s been a while since I had “two” of something plugged
into a QNX 4 box…

Sorry!
-RK

nospam94@parse.com> > wrote in message news:9rbqb4$ffd$> 1@inn.qnx.com> …
Haomin Lin <> linhm@uwyo.edu> > wrote:
Could anyone tell how to use CA_PCI_… functions detect which pci slot
My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

The way I’ve done this in the past is to steal the source for “show_pci”
(it’s in the /usr/free section on quics.qnx.com), and see how they do
the display. What you’re looking for is a match between your vendor ID
and device ID and whatever is in a given slot… For laughs, try running
“show_pci -vvv” at your prompt – you’ll see what kind of info you can
get.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at > www.parse.com


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at www.parse.com

I haven’t looked at the QNX PCI functions. But, in the early days of PCI I
wrote my own PCI access functions for a PCI device. There were written from
the PCI specs. I don’t remember exactly how to do it but there is a way to
query:

  1. number of PCI buses
  2. number of slots in a bus
  3. device, if any, plugged into a slot


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


<nospam94@parse.com> wrote in message news:9rbvo6$j2c$2@inn.qnx.com

Haomin Lin <> linhm@uwyo.edu> > wrote:
Thanks. I know using vendor ID and devive ID and we can get many
information
with CA_PCI_… function calls.
My application is that I have two identical cards pluged in, they have
the
same vendor ID and device ID. I want to differentiate them in my
program,
since they are pluged in different slots, i want to get the slots number
corresponding to each card. However i do not know which parameter from
CA_PCI_… function call or show_pci command is the slot number ???

Oh. > :frowning:

I think that the actual number (index) varies anyway depending on the
motherboard… It’s been a while since I had “two” of something plugged
into a QNX 4 box…

Sorry!
-RK

nospam94@parse.com> > wrote in message news:9rbqb4$ffd$> 1@inn.qnx.com> …
Haomin Lin <> linhm@uwyo.edu> > wrote:
Could anyone tell how to use CA_PCI_… functions detect which pci
slot
My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

The way I’ve done this in the past is to steal the source for
“show_pci”
(it’s in the /usr/free section on quics.qnx.com), and see how they do
the display. What you’re looking for is a match between your vendor ID
and device ID and whatever is in a given slot… For laughs, try
running
“show_pci -vvv” at your prompt – you’ll see what kind of info you can
get.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at > www.parse.com


\

Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at > www.parse.com

In article <9rbvrl$jcj$1@inn.qnx.com>, linhm@uwyo.edu says…

Yes, I think you are right.
I tried, but i still have no idea about resolving which card is which ?
Anyone did this before ?

Yes. Usually the indexes are either from right to left, or left to

right. However it does vary by the motherboard/BIOS manufacturer.
There is no other known way of distinguishing which slot a board is in.
(AFAIK, and I have looked high and low…)
I have written software to support multiple cards of the same type, and
the only way I have found is to do it by index number, and determine
which card is which by only activating one, and then see which is active.
Almost always, once you have determined the “order” for a
particular motherboard/BIOS combination, that order is followed in all
cases in that board. In other words, if 2 boards are in slot 3 and 4,
and the slot 3 is index 0, and slot 4 is index 1, it is almost always
safe to guess that the lower numbered slot will have the lower numbered
index. (And vice versa)

“Dean Douthat” <> ddouthat@faac.com> > wrote in message
news:> 3BD981FC.31E43773@faac.com> …
In CA_PCI_Find_Device function to find a vendor/device combination, there
is a
parameter, index. Setting this to 0 will find the “first” card with the
given
combination. Setting it to 1 will find the “second”, etc. I believe that
this
index is not necessarily related in a simple, fixed way to slot position.
It
depends on the hardware BIOS. You will need to resolve which card is
which by
trying some command and see which one reacts.

Haomin Lin wrote:

Thanks. I know using vendor ID and devive ID and we can get many
information
with CA_PCI_… function calls.
My application is that I have two identical cards pluged in, they have
the
same vendor ID and device ID. I want to differentiate them in my
program,
since they are pluged in different slots, i want to get the slots number
corresponding to each card. However i do not know which parameter from
CA_PCI_… function call or show_pci command is the slot number ???
nospam94@parse.com> > wrote in message news:9rbqb4$ffd$> 1@inn.qnx.com> …
Haomin Lin <> linhm@uwyo.edu> > wrote:
Could anyone tell how to use CA_PCI_… functions detect which pci
slot
My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

The way I’ve done this in the past is to steal the source for
“show_pci”
(it’s in the /usr/free section on quics.qnx.com), and see how they do
the display. What you’re looking for is a match between your vendor
ID
and device ID and whatever is in a given slot… For laughs, try
running
“show_pci -vvv” at your prompt – you’ll see what kind of info you can
get.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at
www.parse.com

\


Stephen Munnings
Software Developer
Corman Technologies Inc.

Note: I have seen motherboards where the slot index numbers were numbered 1,
2, 3, 0. Don’t ask me why, I couldn’t begin to guess. Also, I don’t
remember the motherboard. I do remember that we didn’t use it very long,
for other reasons as well as this. We discovered this problem because we
tried to put two of the exact same PCI ethernet cards into the same
motherboard. We wanted to know for sure which card was Lan 1 and which was
Lan 2 so we indicated the slot number on the Net.* command line. It was a
real PITA until we figured it out.


Bill Caroselli – 1(530) 510-7292
Q-TPS Consulting
QTPS@EarthLink.net


“Stephen Munnings” <steve@cormantech.com> wrote in message
news:MPG.16436785786e91c69896dd@inn.qnx.com

In article <9rbvrl$jcj$> 1@inn.qnx.com> >, > linhm@uwyo.edu > says…
Yes, I think you are right.
I tried, but i still have no idea about resolving which card is which ?
Anyone did this before ?

Yes. Usually the indexes are either from right to left, or left to
right. However it does vary by the motherboard/BIOS manufacturer.
There is no other known way of distinguishing which slot a board is in.
(AFAIK, and I have looked high and low…)
I have written software to support multiple cards of the same type, and
the only way I have found is to do it by index number, and determine
which card is which by only activating one, and then see which is active.
Almost always, once you have determined the “order” for a
particular motherboard/BIOS combination, that order is followed in all
cases in that board. In other words, if 2 boards are in slot 3 and 4,
and the slot 3 is index 0, and slot 4 is index 1, it is almost always
safe to guess that the lower numbered slot will have the lower numbered
index. (And vice versa)

“Dean Douthat” <> ddouthat@faac.com> > wrote in message
news:> 3BD981FC.31E43773@faac.com> …
In CA_PCI_Find_Device function to find a vendor/device combination,
there
is a
parameter, index. Setting this to 0 will find the “first” card with
the
given
combination. Setting it to 1 will find the “second”, etc. I believe
that
this
index is not necessarily related in a simple, fixed way to slot
position.
It
depends on the hardware BIOS. You will need to resolve which card is
which by
trying some command and see which one reacts.

Haomin Lin wrote:

Thanks. I know using vendor ID and devive ID and we can get many
information
with CA_PCI_… function calls.
My application is that I have two identical cards pluged in, they
have
the
same vendor ID and device ID. I want to differentiate them in my
program,
since they are pluged in different slots, i want to get the slots
number
corresponding to each card. However i do not know which parameter
from
CA_PCI_… function call or show_pci command is the slot number ???
nospam94@parse.com> > wrote in message
news:9rbqb4$ffd$> 1@inn.qnx.com> …
Haomin Lin <> linhm@uwyo.edu> > wrote:
Could anyone tell how to use CA_PCI_… functions detect which
pci
slot
My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

The way I’ve done this in the past is to steal the source for
“show_pci”
(it’s in the /usr/free section on quics.qnx.com), and see how they
do
the display. What you’re looking for is a match between your
vendor
ID
and device ID and whatever is in a given slot… For laughs, try
running
“show_pci -vvv” at your prompt – you’ll see what kind of info you
can
get.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at
www.parse.com




\

Stephen Munnings
Software Developer
Corman Technologies Inc.

Continuing what Stephen said…

You also need to be aware of backplanes that have 8-10-12 PCI slots because
they have multiple bridge chips.

The PCI slots are numbered within a bus - so slot 1 occurs multiple times
but
in different busses.

I have never played with on of these boards at this level but there is also
the
issue bus numbering off of the primary bridge and left->right or right->left
or arbitrary…

Jay

“Stephen Munnings” <steve@cormantech.com> wrote in message
news:MPG.16436785786e91c69896dd@inn.qnx.com

In article <9rbvrl$jcj$> 1@inn.qnx.com> >, > linhm@uwyo.edu > says…
Yes, I think you are right.
I tried, but i still have no idea about resolving which card is which ?
Anyone did this before ?

Yes. Usually the indexes are either from right to left, or left to
right. However it does vary by the motherboard/BIOS manufacturer.
There is no other known way of distinguishing which slot a board is in.
(AFAIK, and I have looked high and low…)
I have written software to support multiple cards of the same type, and
the only way I have found is to do it by index number, and determine
which card is which by only activating one, and then see which is active.
Almost always, once you have determined the “order” for a
particular motherboard/BIOS combination, that order is followed in all
cases in that board. In other words, if 2 boards are in slot 3 and 4,
and the slot 3 is index 0, and slot 4 is index 1, it is almost always
safe to guess that the lower numbered slot will have the lower numbered
index. (And vice versa)

“Dean Douthat” <> ddouthat@faac.com> > wrote in message
news:> 3BD981FC.31E43773@faac.com> …
In CA_PCI_Find_Device function to find a vendor/device combination,
there
is a
parameter, index. Setting this to 0 will find the “first” card with
the
given
combination. Setting it to 1 will find the “second”, etc. I believe
that
this
index is not necessarily related in a simple, fixed way to slot
position.
It
depends on the hardware BIOS. You will need to resolve which card is
which by
trying some command and see which one reacts.

Haomin Lin wrote:

Thanks. I know using vendor ID and devive ID and we can get many
information
with CA_PCI_… function calls.
My application is that I have two identical cards pluged in, they
have
the
same vendor ID and device ID. I want to differentiate them in my
program,
since they are pluged in different slots, i want to get the slots
number
corresponding to each card. However i do not know which parameter
from
CA_PCI_… function call or show_pci command is the slot number ???
nospam94@parse.com> > wrote in message
news:9rbqb4$ffd$> 1@inn.qnx.com> …
Haomin Lin <> linhm@uwyo.edu> > wrote:
Could anyone tell how to use CA_PCI_… functions detect which
pci
slot
My
cards (e.g. A/D board or NIC card) are pluged in ?? Thanks

The way I’ve done this in the past is to steal the source for
“show_pci”
(it’s in the /usr/free section on quics.qnx.com), and see how they
do
the display. What you’re looking for is a match between your
vendor
ID
and device ID and whatever is in a given slot… For laughs, try
running
“show_pci -vvv” at your prompt – you’ll see what kind of info you
can
get.

Cheers,
-RK


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at
www.parse.com




\

Stephen Munnings
Software Developer
Corman Technologies Inc.