Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/cardbus Pull up revisions 1.25-1.27 (requested ...



details:   https://anonhg.NetBSD.org/src/rev/d2fd88c0f5be
branches:  netbsd-1-5
changeset: 492636:d2fd88c0f5be
user:      he <he%NetBSD.org@localhost>
date:      Tue Jan 29 22:52:10 2002 +0000

description:
Pull up revisions 1.25-1.27 (requested by dillo):
  Add support for AN985-based CardBus network interfaces.

diffstat:

 sys/dev/cardbus/if_tlp_cardbus.c |  61 +++++++++++++++++++++++++++++++++++++++-
 1 files changed, 60 insertions(+), 1 deletions(-)

diffs (103 lines):

diff -r b1a6d913e771 -r d2fd88c0f5be sys/dev/cardbus/if_tlp_cardbus.c
--- a/sys/dev/cardbus/if_tlp_cardbus.c  Tue Jan 29 22:50:45 2002 +0000
+++ b/sys/dev/cardbus/if_tlp_cardbus.c  Tue Jan 29 22:52:10 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tlp_cardbus.c,v 1.24 2000/04/04 19:33:21 thorpej Exp $      */
+/*     $NetBSD: if_tlp_cardbus.c,v 1.24.4.1 2002/01/29 22:52:10 he Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -91,6 +91,7 @@
 #include <dev/pci/pcidevs.h>
 
 #include <dev/cardbus/cardbusvar.h>
+#include <dev/cardbus/cardbusdevs.h>
 
 /*
  * PCI configuration space registers used by the Tulip.
@@ -141,6 +142,18 @@
        { PCI_VENDOR_XIRCOM,            PCI_PRODUCT_XIRCOM_X3201_3_21143,
          TULIP_CHIP_X3201_3 },
 
+       { PCI_VENDOR_ADMTEK,            PCI_PRODUCT_ADMTEK_AN985,
+         TULIP_CHIP_AN985 },
+
+       { CARDBUS_VENDOR_ACCTON,        CARDBUS_PRODUCT_ACCTON_EN2242,
+         TULIP_CHIP_AN985 },
+
+       { CARDBUS_VENDOR_ABOCOM,        CARDBUS_PRODUCT_ABOCOM_FE2500,
+         TULIP_CHIP_AN985 },
+
+       { CARDBUS_VENDOR_ABOCOM,        CARDBUS_PRODUCT_ABOCOM_PCM200,
+         TULIP_CHIP_AN985 },
+
        { 0,                            0,
          TULIP_CHIP_INVALID },
 };
@@ -198,6 +211,7 @@
        const struct tulip_cardbus_product *tcp;
        u_int8_t enaddr[ETHER_ADDR_LEN];
        bus_addr_t adr;
+       pcireg_t reg;
 
        sc->sc_devno = ca->ca_device;
        sc->sc_dmat = ca->ca_dmat;
@@ -234,6 +248,28 @@
                        sc->sc_chip = TULIP_CHIP_21143;
                break;
 
+       case TULIP_CHIP_AN985:
+               /*
+                * The AN983 and AN985 are very similar, and are
+                * differentiated by a "signature" register that
+                * is like, but not identical, to a PCI ID register.
+                */
+               reg = cardbus_conf_read(ct->ct_cc, ct->ct_cf, csc->sc_tag,
+                   0x80);
+               switch (reg) {
+               case 0x09811317:
+                       sc->sc_chip = TULIP_CHIP_AN985;
+                       break;
+
+               case 0x09851317:
+                       sc->sc_chip = TULIP_CHIP_AN983;
+                       break;
+
+               default:
+                       /* Unknown -- use default. */
+               }
+               break;
+
        default:
                /* Nothing. */
        }
@@ -338,6 +374,29 @@
                }
                break;
 
+       case TULIP_CHIP_AN983:
+       case TULIP_CHIP_AN985:
+               /*
+                * The ADMtek AN985's Ethernet address is located
+                * at offset 8 of its EEPROM.
+                */
+               memcpy(enaddr, &sc->sc_srom[8], ETHER_ADDR_LEN);
+
+               /*
+                * The ADMtek AN985 can be configured in Single-Chip
+                * mode or MAC-only mode.  Single-Chip uses the built-in
+                * PHY, MAC-only has an external PHY (usually HomePNA).
+                * The selection is based on an EEPROM setting, and both
+                * PHYs are access via MII attached to SIO.
+                *
+                * The AN985 "ghosts" the internal PHY onto all
+                * MII addresses, so we have to use a media init
+                * routine that limits the search.
+                * XXX How does this work with MAC-only mode?
+                */
+               sc->sc_mediasw = &tlp_an985_mediasw;
+               break;
+
        case TULIP_CHIP_X3201_3:
                /*
                 * The X3201 doesn't have an SROM.  Lift the MAC address



Home | Main Index | Thread Index | Old Index