Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Dec 2002 11:29:30 -0500
From:      Jake Burkholder <jake@locore.ca>
To:        Andrzej Kwiatkowski <kwiatek@tpi.pl>
Cc:        freebsd-sparc@FreeBSD.ORG
Subject:   Re: Multiple interfaces -> one MAC
Message-ID:  <20021204112929.P35729@locore.ca>
In-Reply-To: <20021204160900.F5536-100000@kwiatek.eu.org>; from kwiatek@tpi.pl on Wed, Dec 04, 2002 at 04:13:33PM %2B0100
References:  <20021204160900.F5536-100000@kwiatek.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Apparently, On Wed, Dec 04, 2002 at 04:13:33PM +0100,
	Andrzej Kwiatkowski said words to the effect of;

> 
> I have got U10 with one internal ethernet Card,
> one quad and one Pci network card.
> 
> My banner command in OBP shows:
> Ethernet address 8:0:20:a1:fd:47,
> 
> i've set
> ok setenv local-mac-address? true
> local-mac-address? =  true
> ok reset
> 
> When my FreeBSD boot-s, i've got
> 
> platinum# ifconfig -a
> hme0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
>         ether 08:00:20:a1:fd:47
>         media: Ethernet autoselect
> hme1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
>         ether 08:00:20:a1:fd:47
>         media: Ethernet autoselect
> hme2: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
>         ether 08:00:20:a1:fd:47
>         media: Ethernet autoselect
> hme3: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
>         ether 08:00:20:a1:fd:47
>         media: Ethernet autoselect
> hme4: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
>         ether 08:00:20:a1:fd:47
>         media: Ethernet autoselect
> hme5: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet 10.23.12.50 netmask 0xffff0000 broadcast 10.23.255.255
>         inet6 fe80::a00:20ff:fea1:fd47%hme5 prefixlen 64 scopeid 0x6
>         ether 08:00:20:a1:fd:47
>         media: Ethernet autoselect (100baseTX)
>         status: active
> lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
>         inet6 ::1 prefixlen 128
>         inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
>         inet 127.0.0.1 netmask 0xff000000
> platinum#
> 
> Every Card have got one Mac address.
> How can i change to every card was showing its own MAC ???

You can use the attached patch, it will make them use their local mac address
unconditionally.  Given that we're in code freeze I'm not sure when/if this
support will be committed.

I'm curious why you want them to have different MAC addresses?  If they're
on separate networks it shouldn't matter right?

Also, out of interest, could you post the dmesg lines where hme1 through 4
are probed?

Jake

Index: if_hme_pci.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/hme/if_hme_pci.c,v
retrieving revision 1.3
diff -u -r1.3 if_hme_pci.c
--- if_hme_pci.c	23 Mar 2002 19:37:11 -0000	1.3
+++ if_hme_pci.c	19 Nov 2002 17:29:13 -0000
@@ -62,6 +62,9 @@
 #include <hme/if_hmereg.h>
 #include <hme/if_hmevar.h>
 
+#include <dev/ofw/openfirm.h>
+#include <sparc64/pci/ofw_pci.h>
+
 #include "miibus_if.h"
 
 struct hme_pci_softc {
@@ -120,6 +123,7 @@
 {
 	struct hme_pci_softc *hsc = device_get_softc(dev);
 	struct hme_softc *sc = &hsc->hsc_hme;
+	phandle_t node;
 	int error;
 
 	/*
@@ -167,7 +171,10 @@
 	sc->sc_maco = 0x6000;
 	sc->sc_mifo = 0x7000;
 
-	OF_getetheraddr(dev, sc->sc_arpcom.ac_enaddr);
+	node = ofw_pci_node(dev);
+	if (OF_getprop(node, "local-mac-address", sc->sc_arpcom.ac_enaddr,
+	    sizeof(sc->sc_arpcom.ac_enaddr)) == -1)
+		OF_getetheraddr(dev, sc->sc_arpcom.ac_enaddr);
 
 	sc->sc_burst = 64;	/* XXX */
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-sparc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021204112929.P35729>