Author: yongari
Date: Thu Oct  7 17:14:50 2010
New Revision: 213522
URL: http://svn.freebsd.org/changeset/base/213522

Log:
  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.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c   Thu Oct  7 16:35:50 2010        (r213521)
+++ head/sys/dev/bge/if_bge.c   Thu Oct  7 17:14:50 2010        (r213522)
@@ -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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to