Obtain the media type from the shared memory and only use the eeprom
as a fallback.
This commit is contained in:
parent
440baa08c3
commit
41abcc1b62
@ -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. */
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user