summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2007-07-16 19:15:02 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2007-07-16 19:15:02 +0000
commit21dbf0f629d123d16226d8c27451d7a4a7cf9832 (patch)
tree9a1c33bb74eb10c098b9c398c9f954f60cf21776 /sys/dev/ic
parent9af1bfbdc3c2f6b97b150692dd6332f99e28798b (diff)
The logic determining the value of rl_eewidth for the 9346 and 9356
eeproms was backwards. This resulted in a bogus MAC address being read from the eeprom on certain cards. From FreeBSD. OK pvalchev@
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/re.c6
-rw-r--r--sys/dev/ic/rtl81x9reg.h5
2 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index b0076b89f5c..cd59c545fdf 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.73 2007/06/06 22:02:31 pvalchev Exp $ */
+/* $OpenBSD: re.c,v 1.74 2007/07/16 19:15:01 millert Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -826,10 +826,10 @@ re_attach(struct rl_softc *sc, const char *intrstr)
/* Reset the adapter. */
re_reset(sc);
- sc->rl_eewidth = 6;
+ sc->rl_eewidth = RL_9356_ADDR_LEN;
re_read_eeprom(sc, (caddr_t)&re_did, 0, 1);
if (re_did != 0x8129)
- sc->rl_eewidth = 8;
+ sc->rl_eewidth = RL_9346_ADDR_LEN;
/*
* Get station address from the EEPROM.
diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h
index d847b4bf5a5..2720b106ec7 100644
--- a/sys/dev/ic/rtl81x9reg.h
+++ b/sys/dev/ic/rtl81x9reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9reg.h,v 1.39 2007/06/06 22:02:31 pvalchev Exp $ */
+/* $OpenBSD: rtl81x9reg.h,v 1.40 2007/07/16 19:15:01 millert Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -311,6 +311,9 @@
/* 9346/9356 EEPROM commands */
+#define RL_9346_ADDR_LEN 6 /* 93C46 1K: 128x16 */
+#define RL_9356_ADDR_LEN 8 /* 93C56 2K: 256x16 */
+
#define RL_9346_WRITE 0x5
#define RL_9346_READ 0x6
#define RL_9346_ERASE 0x7