find slot number and number of ports for each card

Polytropon freebsd at
Sat Sep 29 18:54:04 UTC 2012

On Sat, 29 Sep 2012 18:07:56 +0330, saeedeh motlagh wrote:
> hello all
> i want to have statistics about my hardware specially the type of card
> that are installed on my system, the number of ports that each card
> has and the slot number which cards are installed.  i can find the
> slot number by tracing the output of dmesg but it's time consuming
> job.

You can use "pciconf -lv" to get a beter output for PCI cards.
Note that this list does also contain "integrated components".
Sadly, there is no direct relation to which "hardware slots"
are occupied, because there is no real standard for communcating
the physical layout of the machine to the OS, either through
the BIOS, ACPI, or "more directly" by the OS itself.

See "man pciconf" for details.

Some non-PC systems (such as EISA-based computers, some Sun
hardware, or the AS/400, or nearly anything from the mainframe
sector) have means to "directly query" hardware resources.
Today's cheap commodity consumer crap (sorry) doesn't have
this feature.

> more over, i don't know how to find the number of ports that each
> card has.

A lot of this data can be obtained by using "pciconf -lv".

Here's an example output for a graphics card:

vgapci0 at pci0:2:0:0:     class=0x030000 card=0x06201462
                        chip=0x039210de rev=0xa1 hdr=0x00
    vendor     = 'NVIDIA Corporation'
    device     = 'NVIDIA GeForce 7600 GS (G73)'
    class      = display
    subclass   = VGA

Of course, _what_ "pci0:2:0:0" is, depends on the mainboard in use.
This particular machine also has a TV tuner card at "pci0:0:9:0"
and "pci0:0:9:1", and a network card at "pci0:0:10:0". _Where_
those are located (which "hardware slots") is not obvious, as
there aren't even _5_ of them on the mainboard!

It cannot easily be concluded, especially considering the common
lack of lower-level documentation.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list