Obtain the media type from the shared memory and only use the eeprom

as a fallback.
This commit is contained in:
Paul Saab 2003-02-05 08:54:36 +00:00
parent 440baa08c3
commit 41abcc1b62
2 changed files with 17 additions and 7 deletions

View File

@ -1613,14 +1613,22 @@ bge_attach(dev)
/*
* Figure out what sort of media we have by checking the
* hardware config word in the EEPROM. Note: on some BCM5700
* cards, this value appears to be unset. If that's the
* case, we have to rely on identifying the NIC by its PCI
* subsystem ID, as we do below for the SysKonnect SK-9D41.
* hardware config word in the first 32k of NIC internal memory,
* or fall back to examining the EEPROM if necessary.
* Note: on some BCM5700 cards, this value appears to be unset.
* If that's the case, we have to rely on identifying the NIC
* by its PCI subsystem ID, as we do below for the SysKonnect
* SK-9D41.
*/
bge_read_eeprom(sc, (caddr_t)&hwcfg,
BGE_EE_HWCFG_OFFSET, sizeof(hwcfg));
if ((ntohl(hwcfg) & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER)
if (bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_SIG) == BGE_MAGIC_NUMBER)
hwcfg = bge_readmem_ind(sc, BGE_SOFTWARE_GENCOMM_NICCFG);
else {
bge_read_eeprom(sc, (caddr_t)&hwcfg,
BGE_EE_HWCFG_OFFSET, sizeof(hwcfg));
hwcfg = ntohl(hwcfg);
}
if ((hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER)
sc->bge_tbi = 1;
/* The SysKonnect SK-9D41 is a 1000baseSX card. */

View File

@ -72,6 +72,8 @@
#define BGE_STATUS_BLOCK 0x00000B00
#define BGE_STATUS_BLOCK_END 0x00000B4F
#define BGE_SOFTWARE_GENCOMM 0x00000B50
#define BGE_SOFTWARE_GENCOMM_SIG 0x00000B54
#define BGE_SOFTWARE_GENCOMM_NICCFG 0x00000B58
#define BGE_SOFTWARE_GENCOMM_END 0x00000FFF
#define BGE_UNMAPPED 0x00001000
#define BGE_UNMAPPED_END 0x00001FFF