openSUSE Forums > Programming/Scripting » How to fiind pci-bus of netwrok interface using ioctl

Go Back   openSUSE Forums > Programming/Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-Oct-2009, 09:51
Puzzled Penguin
 
Join Date: Oct 2009
Posts: 1
pradeepkumar hasn't been rated much yet
Default How to fiind pci-bus of netwrok interface using ioctl

Hi,

I want to find which network adpter(pci-bus) is associated with which network interface. I tried using IRQ numaber. I can find IRQ number of netwrok adapter usig lspci command. I found the IRQ number of network interface using ioctl and ifrq struct. Since multiple network adapter can share IRQ, it didn't worked properly.

I found that using pci-bus device id i can find association network adapter and network interface. I want to know which struct will provide this value for the network interface. I am using ioctl.

Regards,
Pradeep
Reply With Quote
  #2 (permalink)  
Old 01-Oct-2009, 23:03
cjcox's Avatar
Parent Penguin
 
Join Date: Jun 2008
Location: Frisco, TX
Posts: 778
cjcox hasn't been rated much yet
Default Re: How to fiind pci-bus of netwrok interface using ioctl

pradeepkumar wrote:
> Hi,
>
> I want to find which network adpter(pci-bus) is associated with which
> network interface. I tried using IRQ numaber. I can find IRQ number of
> netwrok adapter usig lspci command. I found the IRQ number of network
> interface using ioctl and ifrq struct. Since multiple network adapter
> can share IRQ, it didn't worked properly.
>
> I found that using pci-bus device id i can find association network
> adapter and network interface. I want to know which struct will provide
> this value for the network interface. I am using ioctl.



find /sys/devices -name eth0

libsysfs has routines you can use to walk the /sys tree.

Not sure if there is any other good way to get at this...
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2