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/pci Pull up revision 1.14 (requested by chuck):



details:   https://anonhg.NetBSD.org/src/rev/cf51c19eb6c8
branches:  netbsd-1-5
changeset: 490906:cf51c19eb6c8
user:      he <he%NetBSD.org@localhost>
date:      Tue Mar 20 17:25:33 2001 +0000

description:
Pull up revision 1.14 (requested by chuck):
  Add support for the 3Com 3c555, 3c556 and 3c556B MiniPCI Ethernet
  cards.

diffstat:

 sys/dev/pci/if_ex_pci.c |  49 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 47 insertions(+), 2 deletions(-)

diffs (100 lines):

diff -r 89796be132a7 -r cf51c19eb6c8 sys/dev/pci/if_ex_pci.c
--- a/sys/dev/pci/if_ex_pci.c   Tue Mar 20 17:25:14 2001 +0000
+++ b/sys/dev/pci/if_ex_pci.c   Tue Mar 20 17:25:33 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ex_pci.c,v 1.12.4.1 2000/10/19 13:54:28 he Exp $    */
+/*     $NetBSD: if_ex_pci.c,v 1.12.4.2 2001/03/20 17:25:33 he Exp $    */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -90,6 +90,12 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcidevs.h>
 
+struct ex_pci_softc {
+       struct ex_softc sc_ex;
+       pci_chipset_tag_t sc_chiptag;
+       pcitag_t sc_pcitag;
+};
+
 /*
  * PCI constants.
  * XXX These should be in a common file!
@@ -97,12 +103,16 @@
 #define PCI_CONN               0x48    /* Connector type */
 #define PCI_CBIO               0x10    /* Configuration Base IO Address */
 #define PCI_POWERCTL           0xe0
+#define PCI_FUNCMEM            0x18
+
+#define PCI_INTRACK            0x00008000
 
 int ex_pci_match __P((struct device *, struct cfdata *, void *));
 void ex_pci_attach __P((struct device *, struct device *, void *));
+void ex_pci_intr_ack __P((struct ex_softc *));
 
 struct cfattach ex_pci_ca = {
-       sizeof(struct ex_softc), ex_pci_match, ex_pci_attach
+       sizeof(struct ex_pci_softc), ex_pci_match, ex_pci_attach
 };
 
 const struct ex_pci_product {
@@ -151,6 +161,23 @@
        { PCI_PRODUCT_3COM_3CSOHO100TX, EX_CONF_90XB,
          "3cSOHO100-TX 10/100 Ethernet" },
 
+       { PCI_PRODUCT_3COM_3C555,
+          EX_CONF_90XB | EX_CONF_MII | EX_CONF_EEPROM_OFF |
+          EX_CONF_EEPROM_8BIT,
+         "3c555 MiniPCI 10/100 Ethernet" },
+
+       { PCI_PRODUCT_3COM_3C556,
+          EX_CONF_90XB | EX_CONF_MII | EX_CONF_EEPROM_OFF |
+          EX_CONF_PCI_FUNCREG | EX_CONF_RESETHACK | EX_CONF_INV_LED_POLARITY |
+          EX_CONF_PHY_POWER | EX_CONF_EEPROM_8BIT,
+         "3c556 MiniPCI 10/100 Ethernet" },
+
+       { PCI_PRODUCT_3COM_3C556B,
+          EX_CONF_90XB | EX_CONF_MII | EX_CONF_EEPROM_OFF |
+          EX_CONF_PCI_FUNCREG | EX_CONF_RESETHACK | EX_CONF_INV_LED_POLARITY |
+          EX_CONF_PHY_POWER,
+         "3c556B MiniPCI 10/100 Ethernet" },
+
        { 0,                            0,
          NULL },
 };
@@ -193,6 +220,7 @@
        void *aux;
 {
        struct ex_softc *sc = (void *)self;
+       struct ex_pci_softc *psc = (void *)self;
        struct pci_attach_args *pa = aux;
        pci_chipset_tag_t pc = pa->pa_pc;
        pci_intr_handle_t ih;
@@ -255,6 +283,13 @@
                printf("%s: couldn't map interrupt\n", sc->sc_dev.dv_xname);
                return;
        }
+
+       if (sc->ex_conf & EX_CONF_PCI_FUNCREG) {
+               sc->intr_ack = ex_pci_intr_ack;
+               psc->sc_chiptag = pa->pa_pc;
+               psc->sc_pcitag = pa->pa_tag;
+       }
+
        intrstr = pci_intr_string(pc, ih);
        sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, ex_intr, sc);
        if (sc->sc_ih == NULL) {
@@ -269,3 +304,13 @@
 
        ex_config(sc);
 }
+
+void            
+ex_pci_intr_ack(sc)
+       struct ex_softc *sc;
+{
+       struct ex_pci_softc *psc = (struct ex_pci_softc *)sc;
+        
+       pci_conf_write(psc->sc_chiptag, psc->sc_pcitag, PCI_FUNCMEM + 4,
+           PCI_INTRACK);
+}



Home | Main Index | Thread Index | Old Index