Re: How to get the network details through programming

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks a lot Rajat. Can we do it programmatically (C program).?

On 3/28/07, Rajat Jain <rajat.noida.india@xxxxxxxxx > wrote:
On 3/28/07, Santosh Pradhan < santosh.pradhan@xxxxxxxxx> wrote:
> Thanks Erik.
> could you please help me to get the description of a PCI card installed in
> the linux system programmatically.
>
> e.g. i have a NIC card which has the description as
> "Ethernet controller: Intel Corporation 82546EB Gigabit Ethernet Controller
> (Copper) (rev 01)" as per the output of the "lspci" command.
>

I assume you already know the PCI address (bus / device / function
number) of your PCI device. Read the Vendor ID / Device ID of the PCI
device from /sys/bus/pci/devices/<device PCI address>/*

Once you have the vendor and device ID. You need to look them up in a
file listing the device descriptions (On my system this is pci.ids
file). You can find out the location of this file by locating a line
like following in "strace lspci" output:

open("/usr/share/pci.ids", O_RDONLY)    = 4


Thanks,

Rajat


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux