lkml.org 
[lkml]   [1999]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How do you determine the network interface name associated with a PCI devfn?
On Fri, 14 May 1999, Ajit Prem wrote:

Ajit_Prem> Given just the PCI devfn, can I
Ajit_Prem> determine the interface name (like eth5)

Yes.

use /proc/pci or /proc/bus/pci/devices

Eg. I have the devices:

Bus 0, device 10, function 0:
Medium devsel. IRQ 9.
I/O at 0x6400 [0x6401].
Bus 0, device 11, function 0:
Medium devsel. IRQ 12.
I/O at 0x6500 [0x6501].

ifconfig tells me:
eth0 Link encap:Ethernet HWaddr 00:00:C0:FF:EE:00
Interrupt:9 Base address:0x6400

eth1 Link encap:Ethernet HWaddr 00:C1:49:00:DE:AD
Interrupt:12 Base address:0x6500

which tells me device 10 is eth0 and device 11 is eth1 (compare I/O
addresses and IRQs)

Simple enough to write a small perl (or bash) script that does the
comparison.

- Matt


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.039 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site