summaryrefslogtreecommitdiffstats
path: root/sys/dev/vge
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2005-04-25 18:29:42 +0000
committerwpaul <wpaul@FreeBSD.org>2005-04-25 18:29:42 +0000
commit06ecb5ca5dff42222430d539c78aefd4ba733b2f (patch)
treead726358e20d2430849146600b4cbb51a23ee1a2 /sys/dev/vge
parentd643bc9db0177adb3aff13bcffd595bcd5417bf2 (diff)
downloadFreeBSD-src-06ecb5ca5dff42222430d539c78aefd4ba733b2f.zip
FreeBSD-src-06ecb5ca5dff42222430d539c78aefd4ba733b2f.tar.gz
Reading the EEPROM to learn the station address doesn't seem to work
on boards with VIA gigE controllers that are embedded in VIA chipsets. Presumably, they don't have an external EEPROM and store the MAC address somewhere else. To get around this, force an autoload and read the station address from the RX filter registers instead. This has been tested to work on both embedded and standalone controllers.
Diffstat (limited to 'sys/dev/vge')
-rw-r--r--sys/dev/vge/if_vge.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c
index dbd5e6a..403ef0c 100644
--- a/sys/dev/vge/if_vge.c
+++ b/sys/dev/vge/if_vge.c
@@ -169,7 +169,9 @@ static void vge_shutdown (device_t);
static int vge_ifmedia_upd (struct ifnet *);
static void vge_ifmedia_sts (struct ifnet *, struct ifmediareq *);
+#ifdef VGE_EEPROM
static void vge_eeprom_getword (struct vge_softc *, int, u_int16_t *);
+#endif
static void vge_read_eeprom (struct vge_softc *, caddr_t, int, int, int);
static void vge_miipoll_start (struct vge_softc *);
@@ -222,6 +224,7 @@ DRIVER_MODULE(vge, pci, vge_driver, vge_devclass, 0, 0);
DRIVER_MODULE(vge, cardbus, vge_driver, vge_devclass, 0, 0);
DRIVER_MODULE(miibus, vge, miibus_driver, miibus_devclass, 0, 0);
+#ifdef VGE_EEPROM
/*
* Read a word of data stored in the EEPROM at address 'addr.'
*/
@@ -271,6 +274,7 @@ vge_eeprom_getword(sc, addr, dest)
return;
}
+#endif
/*
* Read a sequence of words from the EEPROM.
@@ -284,6 +288,7 @@ vge_read_eeprom(sc, dest, off, cnt, swap)
int swap;
{
int i;
+#ifdef VGE_EEPROM
u_int16_t word = 0, *ptr;
for (i = 0; i < cnt; i++) {
@@ -294,6 +299,12 @@ vge_read_eeprom(sc, dest, off, cnt, swap)
else
*ptr = word;
}
+#else
+ CSR_SETBIT_1(sc, VGE_EECSR, VGE_EECSR_RELOAD);
+ DELAY(500);
+ for (i = 0; i < ETHER_ADDR_LEN; i++)
+ dest[i] = CSR_READ_1(sc, VGE_PAR0 + i);
+#endif
}
static void
OpenPOWER on IntegriCloud