[tulip] changing ethernet interface names

Donald Becker becker@scyld.com
Thu, 6 Jul 2000 17:54:54 -0400 (EDT)

On Thu, 6 Jul 2000, John D. Scott wrote:

> I work with a company called SecureWorks in Atlanta, GA.  We are
> currently using phobos 4 port ethernet cards in our products.  This card
> is based on the tulip 21142 chipset, and the latest version of the tulip
> driver works like a charm with the phobos cards (picking up all 4
> interfaces); however, I have one question, and I hope it is not a stupid
> one.
> The proprietary drivers provided by phobos insisted upon the naming of

??? I've not heard of this driver.  Is it written from scratch, or based on
the Tulip driver?

> the ethernet devices as pqfe0, pqfe1, pqfe2, and pqfe3.  Of course, the
> tulip drivers name the interfaces as eth0, eth1, eth2, and eth3.  The
> only problem is that we have written software that specifically uses the
> pqfe* device names.  Is there an easy way to alter the tulip driver,
> allowing for a different interface naming scheme?  I have been fooling
> around with the drivers, and having very little experience doing so, I
> am having trouble accomplishing the task of renaming the interfaces.

It's sleazy, but just hack the driver to put its own string in place of
dev->name.  You can add a new array in tulip_private
   char pqfe[16];

and then in tulip_probe1() do
	tp->next_module = root_tulip_dev;
	root_tulip_dev = dev;
+	sprintf(tp->pqfe, "pqfe%s", dev->name + 3);
+	dev->name = tp->pqfe;

This is untested.  We do driver validation if you wanted a tested version.

Donald Becker				becker@scyld.com
Scyld Computing Corporation		http://www.scyld.com
410 Severn Ave. Suite 210		Beowulf Clusters / Linux Installations
Annapolis MD 21403