diff --git a/sys/dev/pci/if_tlp_pci.c b/sys/dev/pci/if_tlp_pci.c index aef2c3ab8f28..79f5f0807924 100644 --- a/sys/dev/pci/if_tlp_pci.c +++ b/sys/dev/pci/if_tlp_pci.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_tlp_pci.c,v 1.57 2002/01/12 16:17:06 tsutsui Exp $ */ +/* $NetBSD: if_tlp_pci.c,v 1.58 2002/02/14 07:59:55 chs Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.57 2002/01/12 16:17:06 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tlp_pci.c,v 1.58 2002/02/14 07:59:55 chs Exp $"); #include "opt_tlp.h" @@ -206,6 +206,9 @@ void tlp_pci_cobalt_21142_quirks __P((struct tulip_pci_softc *, void tlp_pci_algor_21142_quirks __P((struct tulip_pci_softc *, const u_int8_t *)); +void tlp_pci_adaptec_21143_quirks __P((struct tulip_pci_softc *, + const u_int8_t *)); + const struct tlp_pci_quirks tlp_pci_21040_quirks[] = { { tlp_pci_znyx_21040_quirks, { 0x00, 0xc0, 0x95 } }, { tlp_pci_smc_21040_quirks, { 0x00, 0x00, 0xc0 } }, @@ -235,6 +238,7 @@ const struct tlp_pci_quirks tlp_pci_21142_quirks[] = { { tlp_pci_dec_quirks, { 0x00, 0x00, 0xf8 } }, { tlp_pci_cobalt_21142_quirks, { 0x00, 0x10, 0xe0 } }, { tlp_pci_algor_21142_quirks, { 0x00, 0x40, 0xbc } }, + { tlp_pci_adaptec_21143_quirks, { 0x00, 0x00, 0xd1 } }, { NULL, { 0, 0, 0 } } }; @@ -648,7 +652,18 @@ tlp_pci_attach(parent, self, aux) break; } #endif /* algor */ - if (tlp_read_srom(sc) == 0) + + /* Check for a slaved ROM on a multi-port board. */ + tlp_pci_check_slaved(psc, TULIP_PCI_SHAREDROM, + TULIP_PCI_SLAVEROM); + if (psc->sc_flags & TULIP_PCI_SLAVEROM) { + sc->sc_srom_addrbits = + psc->sc_master->sc_tulip.sc_srom_addrbits; + sc->sc_srom = psc->sc_master->sc_tulip.sc_srom; + enaddr[5] += + sc->sc_devno - psc->sc_master->sc_tulip.sc_devno; + } + else if (tlp_read_srom(sc) == 0) goto cant_cope; break; } @@ -660,25 +675,12 @@ tlp_pci_attach(parent, self, aux) */ switch (sc->sc_chip) { case TULIP_CHIP_21040: - /* Check for a slaved ROM on a multi-port board. */ - tlp_pci_check_slaved(psc, TULIP_PCI_SHAREDROM, - TULIP_PCI_SLAVEROM); - if (psc->sc_flags & TULIP_PCI_SLAVEROM) - memcpy(sc->sc_srom, psc->sc_master->sc_tulip.sc_srom, - sizeof(sc->sc_srom)); - /* * Parse the Ethernet Address ROM. */ if (tlp_parse_old_srom(sc, enaddr) == 0) goto cant_cope; - /* - * If we have a slaved ROM, adjust the Ethernet address. - */ - if (psc->sc_flags & TULIP_PCI_SLAVEROM) - enaddr[5] += - sc->sc_devno - psc->sc_master->sc_tulip.sc_devno; /* * All 21040 boards start out with the same @@ -693,13 +695,6 @@ tlp_pci_attach(parent, self, aux) break; case TULIP_CHIP_21041: - /* Check for a slaved ROM on a multi-port board. */ - tlp_pci_check_slaved(psc, TULIP_PCI_SHAREDROM, - TULIP_PCI_SLAVEROM); - if (psc->sc_flags & TULIP_PCI_SLAVEROM) - memcpy(sc->sc_srom, psc->sc_master->sc_tulip.sc_srom, - sizeof(sc->sc_srom)); - /* Check for new format SROM. */ if (tlp_isv_srom_enaddr(sc, enaddr) == 0) { /* @@ -1247,3 +1242,13 @@ tlp_pci_algor_21142_quirks(psc, enaddr) */ sc->sc_mediasw = &tlp_sio_mii_mediasw; } + +void +tlp_pci_adaptec_21143_quirks(psc, enaddr) + struct tulip_pci_softc *psc; + const u_int8_t *enaddr; +{ + + strcpy(psc->sc_tulip.sc_name, "Adaptec ANA-69xx"); + psc->sc_flags |= TULIP_PCI_SHAREDINTR|TULIP_PCI_SHAREDROM; +}