summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2008-10-14 11:41:48 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2008-10-14 11:41:48 +0000
commit352f8ba9fef4f9f68f47fb5db45d38b3ce31e492 (patch)
tree01ed9e8cb392067823982c30d4e85ff1719b7fe4
parent853a0360bbab374e1b362b0a637adf1a006243d8 (diff)
Don't be so pessimistic about the prospects of getting a
valid MAC address. Pyun YongHyeon seems to have taken code for generating an address when something looks invalid from other drivers in FreeBSD, there are no known problems with getting valid addresses for jme, so remove this. Additionally it isn't appropriate to call arc4random() at that point in the boot process so the code needs to go.
-rw-r--r--sys/dev/pci/if_jme.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/sys/dev/pci/if_jme.c b/sys/dev/pci/if_jme.c
index 660db35f37d..96337c3d4d5 100644
--- a/sys/dev/pci/if_jme.c
+++ b/sys/dev/pci/if_jme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_jme.c,v 1.4 2008/10/02 20:21:14 brad Exp $ */
+/* $OpenBSD: if_jme.c,v 1.5 2008/10/14 11:41:47 jsg Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
@@ -65,8 +65,6 @@
#include <net/bpf.h>
#endif
-#include <dev/rndvar.h>
-
#include <dev/mii/mii.h>
#include <dev/mii/miivar.h>
#include <dev/mii/jmphyreg.h>
@@ -474,25 +472,13 @@ jme_reg_macaddr(struct jme_softc *sc, uint8_t eaddr[])
par0 = CSR_READ_4(sc, JME_PAR0);
par1 = CSR_READ_4(sc, JME_PAR1);
par1 &= 0xFFFF;
- if ((par0 == 0 && par1 == 0) || (par0 & 0x1)) {
- printf("%s: generating fake ethernet address.\n",
- sc->sc_dev.dv_xname);
- par0 = arc4random();
- /* Set OUI to JMicron. */
- eaddr[0] = 0x00;
- eaddr[1] = 0x1B;
- eaddr[2] = 0x8C;
- eaddr[3] = (par0 >> 16) & 0xff;
- eaddr[4] = (par0 >> 8) & 0xff;
- eaddr[5] = par0 & 0xff;
- } else {
- eaddr[0] = (par0 >> 0) & 0xFF;
- eaddr[1] = (par0 >> 8) & 0xFF;
- eaddr[2] = (par0 >> 16) & 0xFF;
- eaddr[3] = (par0 >> 24) & 0xFF;
- eaddr[4] = (par1 >> 0) & 0xFF;
- eaddr[5] = (par1 >> 8) & 0xFF;
- }
+
+ eaddr[0] = (par0 >> 0) & 0xFF;
+ eaddr[1] = (par0 >> 8) & 0xFF;
+ eaddr[2] = (par0 >> 16) & 0xFF;
+ eaddr[3] = (par0 >> 24) & 0xFF;
+ eaddr[4] = (par1 >> 0) & 0xFF;
+ eaddr[5] = (par1 >> 8) & 0xFF;
}
void