Mailing List Archive

Support open source code!


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

Re: association between device and module name



On Sun, 2 Sep 2001, roylo wrote:

> huh?
> well, since all of my cards are pci so it was easy for me.
> basicly I cat /proc/pci
> and grep for "Ethernet controller" and did read line and yada yada yada
> anyway I got the card/driver name with the irq number
> and I go grep /proc/interrupts for the irq number
> which will tell me which one is eth0 and which is eth1 and yada yada yada

all of mine are PCI, too. The problem is, I need to know the specific
association between the interface name and the module name.

With the 3C905-C-TX card, at least, /proc/pci, /proc/interrupts, and
/proc/ioports do NOT give me that information.

On my firewall with the RTL8139 cards, it does, but it appears to be a
non-portable operation depending on your hardware.

> 
> it was pretty strange forward
> 
> 
> ----- Original Message -----
> From: "Scott M. Stone" <sstone@example.com>
> To: <tlug@example.com>
> Sent: Sunday, September 02, 2001 5:26 PM
> Subject: Re: association between device and module name
> 
> 
> > On Sun, 2 Sep 2001, roylo wrote:
> >
> > > I was thinking about the same thing when I answered his question.
> > > so I wrote a shell script for it afterwards. :P
> > >
> > > Anyway, I guess most of the *nix SA will do the same (ie either write a
> perl
> > > or shell script for anything we need)
> > > after all, *nix SA are smarter and can do things like that ourself. So I
> > > guess that is why no one asked for it.
> > >
> > > {I'm not saying M$ windoz SA are dumber; however, I do look down on them
> > > from time to time  :P }
> >
> > shell/perl won't work, due to the way that drivers report themselves into
> > the kernel.. I have a box here that reports eth0 into /proc/ioports, and
> > another box reporting the name of the module into /proc/ioports.. there's
> > no way a shell script will capture all the possible cases, only the kernel
> > interface will, from what I can see.
> >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Scott M. Stone" <sstone@example.com>
> > > To: "Tokyo Linux Users' Group" <tlug@example.com>
> > > Sent: Sunday, September 02, 2001 4:19 PM
> > > Subject: association between device and module name
> > >
> > >
> > > >
> > > > Well in my quest to find an association between "eth0" and "3c59x",
> for
> > > > example, I found that:
> > > >
> > > > struct netdevice {}
> > > >
> > > > contains an "owner" field which contains the name of the module.
> problem
> > > > is, this sturcture and associated functions are local to kernel space.
> > > >
> > > > So i guess I'll have to write a kernel module which goes through each
> > > > netdevice with a get_dev_by_index or what have you, and creates a
> /proc
> > > > file with entries like:
> > > >
> > > > 1:eth0:3c59x
> > > >
> > > > ie, ifIndex:ifDevName:ifModName
> > > >
> > > > looks do-able.  I'm just surprised nobody's ever seen the need for
> this
> > > > before.
> > > >
> > > > --------------------------
> > > > Scott M. Stone <sstone@example.com>
> > > > Director of Information Technology, Director of Research and
> Development
> > > > ITIsOpen, Inc. - http://www.itisopen.com
> > > > Cisco Certified Network Associate, Sun Solaris Certified Systems
> > > Administrator
> > > >
> > >
> > -----------------------------------------------------------------------
> > > > Next Technical Meeting:  Sat, Sep 15 13:30-  Leading Edge Co., Place
> > > Canada
> > > > Next Nomikai Meeting:    Fri, Oct 19 19:30-  Tengu Tokyo Eki-Mae
> > >
> > -----------------------------------------------------------------------
> > > > more info: http://www.tlug.gr.jp           Sponsor: Global Online
> Japan
> > >
> > > -----------------------------------------------------------------------
> > > Next Technical Meeting:  Sat, Sep 15 13:30-  Leading Edge Co., Place
> Canada
> > > Next Nomikai Meeting:    Fri, Oct 19 19:30-  Tengu Tokyo Eki-Mae
> > > -----------------------------------------------------------------------
> > > more info: http://www.tlug.gr.jp           Sponsor: Global Online Japan
> > >
> > >
> >
> > --------------------------
> > Scott M. Stone <sstone@example.com>
> > Director of Information Technology, Director of Research and Development
> > ITIsOpen, Inc. - http://www.itisopen.com
> > Cisco Certified Network Associate, Sun Solaris Certified Systems
> Administrator
> >
> > -----------------------------------------------------------------------
> > Next Technical Meeting:  Sat, Sep 15 13:30-  Leading Edge Co., Place
> Canada
> > Next Nomikai Meeting:    Fri, Oct 19 19:30-  Tengu Tokyo Eki-Mae
> > -----------------------------------------------------------------------
> > more info: http://www.tlug.gr.jp           Sponsor: Global Online Japan
> 
> -----------------------------------------------------------------------
> Next Technical Meeting:  Sat, Sep 15 13:30-  Leading Edge Co., Place Canada
> Next Nomikai Meeting:    Fri, Oct 19 19:30-  Tengu Tokyo Eki-Mae
> -----------------------------------------------------------------------
> more info: http://www.tlug.gr.jp           Sponsor: Global Online Japan
> 
> 

--------------------------
Scott M. Stone <sstone@example.com>
Director of Information Technology, Director of Research and Development
ITIsOpen, Inc. - http://www.itisopen.com
Cisco Certified Network Associate, Sun Solaris Certified Systems Administrator


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links