How to hack a network driver to use a specific ethX (was Re: How does "alias ethX drivername" in modules.conf work?)

From: Mark Atwood (mra@pobox.com)
Date: Mon Aug 06 2001 - 14:46:00 EST


Tim Jansen <tim@tjansen.de> writes:
> On Friday 03 August 2001 23:29, Mark Atwood wrote:
> > I'm trying to figure out how "alias ethX" works in /etc/modules.conf
> > Is it some "magic" in depmod / modprobe? And how is the network
> > interface identifier then passed into the module when it loads?
>
> If some user-space app accesses ethX the kernel calls "/sbin/modprobe ethX".
> The alias in /etc/modules.conf just gives ethX the name of the real module.
> The interface identifier isn't passed to the module, you have to initialize
> your interfaces in the right order (or set it using an option for modprobe,
> but I don't whether any drivers support setting the interface identifier).

Are their any examples of drivers that can set the interface identifier?

If it possible that a driver may do so, does that mean that the kernel
can handle interface identifiers being set "out of order"?

My problem stems the following situation:

  eth0 is an "ordinary" PCI hme ethernet device. That works just fine.

  eth1 is a weird device that is still under hardware development,
   and, depending on the phase of the moon and the favor of the Gods,
   sometimes comes up and sometimes doesnt

   there is a line in /etc/modules that looks like

    alias eth1 weirddevice

  eth2 is to be a hot plugged PCMCIA ethernet device

In the cases when "weirddevice" properly comes up, I can
 see it's driver in lsmod,
 see it's interface in ifconfig as eth1,
 and then when I plug in the PCMCIA card
  it gets eth2, and works fine

In the cases when "weirddevice" doesnt come up, I can
  still see it's driver in lsmod
   but it's marked "(unused)"
  dont see it in ifconfig
  and then when I plug in the PCMCIA card
   it gets eth1,
    i can see the module driver in lsmod
    i can see the interface in eth1
   BUT
    it doesnt work, and the cardmgr error log says that cardmgr keeps trying to reset the card to make it work

I suspect that the cardmgr is loading the correct card driver module,
but then some sort of argument is happening under the hood, as the
card driver knows that it registered eth1, but the modules.conf has
the "alias eth1 weirddevice" line.

I'm feeling that the easiest way to make my headache go away is be
able to somehow insist to each network driver "YOU go in eth1, no
matter what, and YOU go in eth2, no matter if their is a eth1 or not".

I cannot do this by MAC address, because I have a small herd of these
boxes, with different MACs for each interface in each box, and, if my
employers dreams come true, there will soon enough be hundreds and
then thousands of these boxes.

If it's not too terribly hard to modify a network driver to go to an
interface specified as a module option, I can probably hack that into
the module drivers (I do have the source to them, thank gods.)

-- 
Mark Atwood   | I'm wearing black only until I find something darker.
mra@pobox.com | http://www.pobox.com/~mra
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 07 2001 - 21:00:40 EST