From 84ac96f8ab4c6a0308c9b9a3e42cb1b34d8c68af Mon Sep 17 00:00:00 2001 From: Pyun YongHyeon Date: Thu, 7 Oct 2010 17:14:50 +0000 Subject: [PATCH] Fix a long standing bug which regarded some revisions of controller as 5788. This caused BGE_MISC_LOCAL_CTL register is used to generate link state change interrupt for non-5788 controllers. The interrupt handler may or may not detect link state attention as status block wouldn't be updated when an interrupt was generated with BGE_MISC_LOCAL_CTL register. All controllers except 5700 and 5788 should use host coalescing mode register to trigger an interrupt. --- sys/dev/bge/if_bge.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 50f8888e1096..9b2bdac3d4f1 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -2656,14 +2656,12 @@ bge_attach(device_t dev) if (BGE_IS_5755_PLUS(sc) == 0) sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; - /* - * We could possibly check for BCOM_DEVICEID_BCM5788 in bge_probe() - * but I do not know the DEVICEID for the 5788M. - */ - misccfg = CSR_READ_4(sc, BGE_MISC_CFG) & BGE_MISCCFG_BOARD_ID; - if (misccfg == BGE_MISCCFG_BOARD_ID_5788 || - misccfg == BGE_MISCCFG_BOARD_ID_5788M) - sc->bge_flags |= BGE_FLAG_5788; + if (sc->bge_asicrev == BGE_ASICREV_BCM5705) { + misccfg = CSR_READ_4(sc, BGE_MISC_CFG) & BGE_MISCCFG_BOARD_ID; + if (misccfg == BGE_MISCCFG_BOARD_ID_5788 || + misccfg == BGE_MISCCFG_BOARD_ID_5788M) + sc->bge_flags |= BGE_FLAG_5788; + } /* * Some controllers seem to require a special firmware to use