Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/sys/dev/pci Pull up revision 1.35 (requested by tron in...



details:   https://anonhg.NetBSD.org/src/rev/bc837c426c91
branches:  netbsd-1-6
changeset: 530290:bc837c426c91
user:      grant <grant%NetBSD.org@localhost>
date:      Mon Jun 16 13:23:30 2003 +0000

description:
Pull up revision 1.35 (requested by tron in ticket #1250):

Commit the FreeBSD alternative of a private patch to check NIC internal
ram for using TBI, versus MII/GMII.

FreeBSD commit log and versions:
   Obtain the media type from the shared memory and only use the eeprom
   as a fallback.

   if_bge.c:    rev 1.30
   if_bgereg.h: rev 1.13

Thanks to Paul Saab @mu.org.

diffstat:

 sys/dev/pci/if_bge.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 62f0c682ca0b -r bc837c426c91 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Mon Jun 16 13:21:44 2003 +0000
+++ b/sys/dev/pci/if_bge.c      Mon Jun 16 13:23:30 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.29.2.4 2003/06/16 13:20:21 grant Exp $    */
+/*     $NetBSD: if_bge.c,v 1.29.2.5 2003/06/16 13:23:30 grant Exp $    */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -2092,14 +2092,20 @@
 
        /*
         * Figure out what sort of media we have by checking the
-        * hardware config word in the EEPROM. Note: on some BCM5700
+        * hardware config word in the first 32k of NIC internal memory,
+        * or fall back to the 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.
         */
-       bge_read_eeprom(sc, (caddr_t)&hwcfg,
+       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));
-       if ((be32toh(hwcfg) & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER)
+               hwcfg = be32toh(hwcfg);
+       }
+       if ((hwcfg & BGE_HWCFG_MEDIA) == BGE_MEDIA_FIBER)
                sc->bge_tbi = 1;
 
        /* The SysKonnect SK-9D41 is a 1000baseSX card. */



Home | Main Index | Thread Index | Old Index