summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-09-04 21:43:01 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-09-04 21:43:01 +0000
commitf7f10e59339db8aa79216f84d17bb6c58bbe9b55 (patch)
treeb0333929eca73848949325221f0bcb19545e8939
parent4d2438b8d96eb3c3c28cfc2232d4305b5b78d369 (diff)
Make sure the MAC address is correct on big-endian platforms if it isn't read
from the EEPROM. ok miod@
-rw-r--r--sys/dev/pci/if_vge.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c
index d47b76431bc..a03fb4e7efd 100644
--- a/sys/dev/pci/if_vge.c
+++ b/sys/dev/pci/if_vge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vge.c,v 1.44 2009/08/13 14:24:47 jasper Exp $ */
+/* $OpenBSD: if_vge.c,v 1.45 2009/09/04 21:43:00 kettenis Exp $ */
/* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */
/*
* Copyright (c) 2004
@@ -701,14 +701,13 @@ void
vge_attach(struct device *parent, struct device *self, void *aux)
{
u_char eaddr[ETHER_ADDR_LEN];
- u_int16_t as[3];
struct vge_softc *sc = (struct vge_softc *)self;
struct pci_attach_args *pa = aux;
pci_chipset_tag_t pc = pa->pa_pc;
pci_intr_handle_t ih;
const char *intrstr = NULL;
struct ifnet *ifp;
- int error = 0, i;
+ int error = 0;
bus_size_t iosize;
/*
@@ -747,11 +746,7 @@ vge_attach(struct device *parent, struct device *self, void *aux)
/*
* Get station address from the EEPROM.
*/
- vge_read_eeprom(sc, (caddr_t)as, VGE_EE_EADDR, 3, 0);
- for (i = 0; i < 3; i++) {
- eaddr[(i * 2) + 0] = as[i] & 0xff;
- eaddr[(i * 2) + 1] = as[i] >> 8;
- }
+ vge_read_eeprom(sc, eaddr, VGE_EE_EADDR, 3, 1);
bcopy(eaddr, (char *)&sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);