Subject: Re: How to fix NIC name?
To: Water NB <netbsd78@126.com>
From: Daniel Carosone <dan@geek.com.au>
List: tech-net
Date: 11/12/2004 17:39:39
--HnQK338I3UIa/qiP
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, Nov 12, 2004 at 02:28:42PM +0800, Water NB wrote:
> I have a onboard NIC(Network Interface Card) named rtk0 originally.
> After I add a new PCI NIC, the new one become rtk0, and the original
> become rtk1. Why?

They're probed in pci device order.  dmesg(8) should show you
something like:

rtk0 at pci1 dev 8 function 0: D-Link Systems DFE 530TX+

and similar for rtk1.

if you want to wire their configs to particular locators, you need to
build a custom kernel with these locators specified rather than
wildcarded.

So, in your kernel file, where you currently have:

rtk*  at pci? dev ? function ?        # Realtek 8129/8139

you want:

rtk0  at pci? dev 10 function 0        # Realtek 8129/8139
rtk1  at pci? dev 8  function 0        # Realtek 8129/8139
rtk*  at pci? dev ? function ?        # Realtek 8129/8139

where 10 and 8 are numbers that will come from your dmesg.

leave the wildcard rtk* in case you add any more.  in fact, it's
enough for you to wire rtk0 to the onboard dev with the higher number,
and let rtk* match the pci card. This may well be safer, since the
on-board one won't change, but the card might if you move it to
another slot (at which time it would become rtk2 because rtk1 is
reserved).

Or, finally, since rtk cards are notoriously crappy, replace the rtk
pci card with an ex or fxp or something else better, and you'll get
your rtk0 on-board back :)

--
Dan.


--HnQK338I3UIa/qiP
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iD8DBQFBlFqrEAVxvV4N66cRAmZnAKDuFcTHOoG2+37vsoKkil/PfTfmvwCfTRzg
Dv/zfw6QBeBcNoyA90SxPWU=
=n6lN
-----END PGP SIGNATURE-----

--HnQK338I3UIa/qiP--