diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/alpha/conf/GENERIC | 4 | ||||
-rw-r--r-- | sys/arch/alpha/conf/RAMDISK | 4 | ||||
-rw-r--r-- | sys/arch/alpha/conf/RAMDISKB | 4 | ||||
-rw-r--r-- | sys/arch/alpha/conf/RAMDISKBIG | 3 | ||||
-rw-r--r-- | sys/arch/amd64/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/arch/amd64/conf/RAMDISK | 4 | ||||
-rw-r--r-- | sys/arch/amd64/conf/RAMDISK_CD | 3 | ||||
-rw-r--r-- | sys/arch/i386/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/arch/i386/conf/RAMDISK | 4 | ||||
-rw-r--r-- | sys/arch/i386/conf/RAMDISKB | 3 | ||||
-rw-r--r-- | sys/arch/i386/conf/RAMDISKC | 4 | ||||
-rw-r--r-- | sys/arch/i386/conf/RAMDISK_CD | 3 | ||||
-rw-r--r-- | sys/dev/pci/files.pci | 8 | ||||
-rw-r--r-- | sys/dev/pci/if_le_pci.c | 256 | ||||
-rw-r--r-- | sys/dev/pci/if_levar.h | 46 | ||||
-rw-r--r-- | sys/dev/pci/if_pcn.c | 5 |
16 files changed, 20 insertions, 337 deletions
diff --git a/sys/arch/alpha/conf/GENERIC b/sys/arch/alpha/conf/GENERIC index e7e983f4db3..dcfada2eea1 100644 --- a/sys/arch/alpha/conf/GENERIC +++ b/sys/arch/alpha/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.166 2006/03/11 01:12:14 brad Exp $ +# $OpenBSD: GENERIC,v 1.167 2006/03/12 17:29:48 martin Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -167,7 +167,6 @@ pceb* at pci? # Intel PCI-EISA bridge cy* at pci? # PCI cyclom card # PCI SCSI devices - ahc* at pci? # Adaptec 2940 SCSI controllers scsibus* at ahc? isp* at pci? # Qlogic ISP [12]0x0 SCSI/FibreChannel @@ -225,7 +224,6 @@ art* at musycc? # Accoom Artery E1/T1 cards #UNTESTED: the following section of drivers is untested on alpha. en* at pci? # ENI PCI ATM (untested) tl* at pci? # Compaq Thunderlan ethernet -le* at pci? # PCI LANCE Ethernet (untested) wb* at pci? # Winbond W89C840F ethernet sf* at pci? # Adaptec AIC-6915 ethernet ste* at pci? # Sundance ST201 ethernet diff --git a/sys/arch/alpha/conf/RAMDISK b/sys/arch/alpha/conf/RAMDISK index 599b2e5437c..cd37050d326 100644 --- a/sys/arch/alpha/conf/RAMDISK +++ b/sys/arch/alpha/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.64 2005/05/01 07:54:41 david Exp $ +# $OpenBSD: RAMDISK,v 1.65 2006/03/12 17:29:48 martin Exp $ # $NetBSD: RAMDISK,v 1.9 1996/12/03 17:25:33 cgd Exp $ machine alpha # architecture, used by config; REQUIRED @@ -75,13 +75,13 @@ fxp* at pci? # EtherExpress 10/100B ethernet cards #ep* at pci? # 3COM 3c59x (untested) #xl* at pci? # 3COM 3c9xx (untested) #fpa* at pci? # DEC DEFPA FDDI cards -#le* at pci? # PCI LANCE Ethernet (untested) siop* at pci? # NCR 53c8xx SCSI pceb* at pci? # Intel PCI-EISA bridge vga* at pci? # PCI VGA graphics ppb* at pci? # PCI-PCI bridges sio* at pci? # Intel PCI-ISA bridge tga* at pci? # DEC ZLXp-E[123] graphics +pcn* at pci? # AMD PCnet-PCI Ethernet isp* at pci? # Qlogic ISP [12]0x0 SCSI/FibreChannel #option ISP_COMPILE_FW=1 diff --git a/sys/arch/alpha/conf/RAMDISKB b/sys/arch/alpha/conf/RAMDISKB index 64fcb5569c3..68fb9c52404 100644 --- a/sys/arch/alpha/conf/RAMDISKB +++ b/sys/arch/alpha/conf/RAMDISKB @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISKB,v 1.29 2006/02/23 23:53:51 miod Exp $ +# $OpenBSD: RAMDISKB,v 1.30 2006/03/12 17:29:48 martin Exp $ # $NetBSD: RAMDISK,v 1.9 1996/12/03 17:25:33 cgd Exp $ machine alpha # architecture, used by config; REQUIRED @@ -75,13 +75,13 @@ fxp* at pci? # EtherExpress 10/100B ethernet cards #ep* at pci? # 3COM 3c59x (untested) #xl* at pci? # 3COM 3c9xx (untested) #fpa* at pci? # DEC DEFPA FDDI cards -#le* at pci? # PCI LANCE Ethernet (untested) siop* at pci? # NCR 53c8xx SCSI pceb* at pci? # Intel PCI-EISA bridge vga* at pci? # PCI VGA graphics ppb* at pci? # PCI-PCI bridges sio* at pci? # Intel PCI-ISA bridge tga* at pci? # DEC ZLXp-E[123] graphics +pcn* at pci? # AMD PCnet-PCI Ethernet isp* at pci? # Qlogic ISP [12]0x0 SCSI/FibreChannel #option ISP_COMPILE_FW=1 #option ISP_COMPILE_1040_FW=1 diff --git a/sys/arch/alpha/conf/RAMDISKBIG b/sys/arch/alpha/conf/RAMDISKBIG index f0e91db9265..f912d36ea53 100644 --- a/sys/arch/alpha/conf/RAMDISKBIG +++ b/sys/arch/alpha/conf/RAMDISKBIG @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISKBIG,v 1.61 2006/02/10 09:40:21 brad Exp $ +# $OpenBSD: RAMDISKBIG,v 1.62 2006/03/12 17:29:48 martin Exp $ # $NetBSD: GENERIC,v 1.31 1996/12/03 17:25:29 cgd Exp $ # # Generic Alpha kernel. Enough to get booted, etc., but not much more. @@ -199,7 +199,6 @@ ral* at pci? # Ralink RT2500/RT2501/RT2600 #UNTESTED: the following section of drivers is untested on alpha. en* at pci? # ENI PCI ATM (untested) tl* at pci? # Compaq Thunderlan ethernet -le* at pci? # PCI LANCE Ethernet (untested) wb* at pci? # Winbond W89C840F ethernet sf* at pci? # Adaptec AIC-6915 ethernet ste* at pci? # Sundance ST201 ethernet diff --git a/sys/arch/amd64/conf/GENERIC b/sys/arch/amd64/conf/GENERIC index c34f4207be3..2e3ee96a249 100644 --- a/sys/arch/amd64/conf/GENERIC +++ b/sys/arch/amd64/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.117 2006/03/11 01:12:14 brad Exp $ +# $OpenBSD: GENERIC,v 1.118 2006/03/12 17:29:48 martin Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -292,7 +292,6 @@ scsibus* at atapiscsi? # Networking devices lmc* at pci? # Lan Media Corp SSI/T3/HSSI san* at pci? # Sangoma PCI AFT card -#le* at pci? # PCnet-PCI based ethernet de* at pci? # DC21X4X-based ethernet fxp* at pci? # EtherExpress 10/100B ethernet fxp* at cardbus? # Intel PRO/100 ethernet diff --git a/sys/arch/amd64/conf/RAMDISK b/sys/arch/amd64/conf/RAMDISK index 72a1e3cce8d..d87d26371e5 100644 --- a/sys/arch/amd64/conf/RAMDISK +++ b/sys/arch/amd64/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.30 2006/02/10 04:10:00 pvalchev Exp $ +# $OpenBSD: RAMDISK,v 1.31 2006/03/12 17:29:48 martin Exp $ machine amd64 # architecture, used by config; REQUIRED @@ -185,7 +185,6 @@ wd* at pciide? flags 0x0000 atapiscsi* at pciide? scsibus* at atapiscsi? -#le* at pci? # PCnet-PCI based ethernet #de* at pci? # DC21X4X-based ethernet fxp* at pci? # EtherExpress 10/100B ethernet #fxp* at cardbus? # Intel PRO/100 ethernet @@ -217,6 +216,7 @@ bge* at pci? # Broadcom BCM570x (aka Tigon3) #mtd* at pci? # Myson MTD803 vge* at pci? # VIA VT612x nfe* at pci? # NVIDIA nForce Ethernet +pcn* at pci? # AMD PCnet-PCI Ethernet # Wireless network cards #wi* at pci? # WaveLAN IEEE 802.11DS diff --git a/sys/arch/amd64/conf/RAMDISK_CD b/sys/arch/amd64/conf/RAMDISK_CD index 5b93643aaab..3ea0c4c995c 100644 --- a/sys/arch/amd64/conf/RAMDISK_CD +++ b/sys/arch/amd64/conf/RAMDISK_CD @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK_CD,v 1.48 2006/02/05 18:16:18 brad Exp $ +# $OpenBSD: RAMDISK_CD,v 1.49 2006/03/12 17:29:48 martin Exp $ machine amd64 # architecture, used by config; REQUIRED @@ -203,7 +203,6 @@ atapiscsi* at wdc? atapiscsi* at pciide? scsibus* at atapiscsi? -#le* at pci? # PCnet-PCI based ethernet de* at pci? # DC21X4X-based ethernet fxp* at pci? # EtherExpress 10/100B ethernet fxp* at cardbus? # Intel PRO/100 ethernet diff --git a/sys/arch/i386/conf/GENERIC b/sys/arch/i386/conf/GENERIC index 492544b7724..a02f1e9e63e 100644 --- a/sys/arch/i386/conf/GENERIC +++ b/sys/arch/i386/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.475 2006/03/06 03:13:42 marco Exp $ +# $OpenBSD: GENERIC,v 1.476 2006/03/12 17:29:48 martin Exp $ # # For further information on compiling OpenBSD kernels, see the config(8) # man page. @@ -429,7 +429,6 @@ ep* at eisa? # 3C579 ethernet fea* at eisa? # DEC DEFEA FDDI lmc* at pci? # Lan Media Corp SSI/T3/HSSI san* at pci? # Sangoma PCI AFT card -le* at pci? # PCnet-PCI based ethernet le* at isapnp? pcn* at pci? # AMD PCnet-PCI Ethernet de* at pci? # DC21X4X-based ethernet diff --git a/sys/arch/i386/conf/RAMDISK b/sys/arch/i386/conf/RAMDISK index 8b275e88d57..0d7041275b7 100644 --- a/sys/arch/i386/conf/RAMDISK +++ b/sys/arch/i386/conf/RAMDISK @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK,v 1.141 2006/02/08 23:56:29 pvalchev Exp $ +# $OpenBSD: RAMDISK,v 1.142 2006/03/12 17:29:49 martin Exp $ machine i386 # architecture, used by config; REQUIRED @@ -207,7 +207,6 @@ le0 at isa? port 0x360 irq 15 drq 6 # IsoLan, NE2100, and DEPCA ep0 at eisa? ep* at eisa? # 3C579 ethernet cards #fea* at eisa? # DEC DEFEA FDDI cards -le* at pci? # PCnet-PCI based ethernet cards ep* at isapnp? # 3C509 PnP ethernet cards le* at isapnp? de* at pci? # DC21X4X-based ethernet cards @@ -243,6 +242,7 @@ em* at pci? # Intel Pro/1000 ethernet re* at pci? # Realtek 8169/8169S/8110S vge* at pci? # VIA VT612x nfe* at pci? # NVIDIA nForce Ethernet +pcn* at pci? # AMD PCnet-PCI Ethernet # Wireless network cards wi* at pci? # WaveLAN IEEE 802.11DS diff --git a/sys/arch/i386/conf/RAMDISKB b/sys/arch/i386/conf/RAMDISKB index 4b162f2f65a..97fd48c2304 100644 --- a/sys/arch/i386/conf/RAMDISKB +++ b/sys/arch/i386/conf/RAMDISKB @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISKB,v 1.85 2006/02/08 23:56:29 pvalchev Exp $ +# $OpenBSD: RAMDISKB,v 1.86 2006/03/12 17:29:49 martin Exp $ machine i386 # architecture, used by config; REQUIRED @@ -232,7 +232,6 @@ scsibus* at atapiscsi? #ep0 at eisa? #ep* at eisa? # 3C579 ethernet cards #fea* at eisa? # DEC DEFEA FDDI cards -#le* at pci? # PCnet-PCI based ethernet cards #ep* at isapnp? # 3C509 PnP ethernet cards #le* at isapnp? de* at pci? # DC21X4X-based ethernet cards diff --git a/sys/arch/i386/conf/RAMDISKC b/sys/arch/i386/conf/RAMDISKC index 2483d8c4a80..fba14e451bf 100644 --- a/sys/arch/i386/conf/RAMDISKC +++ b/sys/arch/i386/conf/RAMDISKC @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISKC,v 1.64 2006/02/08 23:56:29 pvalchev Exp $ +# $OpenBSD: RAMDISKC,v 1.65 2006/03/12 17:29:49 martin Exp $ machine i386 # architecture, used by config; REQUIRED @@ -244,7 +244,6 @@ scsibus* at atapiscsi? #ep0 at eisa? #ep* at eisa? # 3C579 ethernet #fea* at eisa? # DEC DEFEA FDDI -#le* at pci? # PCnet-PCI based ethernet #ep* at isapnp? # 3C509 PnP ethernet #le* at isapnp? #de* at pci? # DC21X4X-based ethernet @@ -283,6 +282,7 @@ re* at cardbus? # Realtek 8169/8169S/8110S #bce* at pci? # Broadcom BCM4401 vge* at pci? # VIA VT612x nfe* at pci? # NVIDIA nForce Ethernet +pcn* at pci? # AMD PCnet-PCI Ethernet # Wireless network cards ath* at pci? # Atheros AR5k (802.11a/b/g) diff --git a/sys/arch/i386/conf/RAMDISK_CD b/sys/arch/i386/conf/RAMDISK_CD index 47b403d6aad..73051e98a9b 100644 --- a/sys/arch/i386/conf/RAMDISK_CD +++ b/sys/arch/i386/conf/RAMDISK_CD @@ -1,4 +1,4 @@ -# $OpenBSD: RAMDISK_CD,v 1.113 2006/02/16 21:11:19 brad Exp $ +# $OpenBSD: RAMDISK_CD,v 1.114 2006/03/12 17:29:49 martin Exp $ machine i386 # architecture, used by config; REQUIRED @@ -293,7 +293,6 @@ ep0 at eisa? ep* at eisa? # 3C579 ethernet ef* at isapnp? # 3C515 ethernet #fea* at eisa? # DEC DEFEA FDDI -le* at pci? # PCnet-PCI based ethernet le* at isapnp? pcn* at pci? # AMD PCnet-PCI Ethernet de* at pci? # DC21X4X-based ethernet diff --git a/sys/dev/pci/files.pci b/sys/dev/pci/files.pci index 6b445fdd7de..85a284aea9d 100644 --- a/sys/dev/pci/files.pci +++ b/sys/dev/pci/files.pci @@ -1,4 +1,4 @@ -# $OpenBSD: files.pci,v 1.199 2006/02/25 23:54:43 reyk Exp $ +# $OpenBSD: files.pci,v 1.200 2006/03/12 17:29:48 martin Exp $ # $NetBSD: files.pci,v 1.20 1996/09/24 17:47:15 christos Exp $ # # Config file and device description for machine-independent PCI code. @@ -202,13 +202,7 @@ device fpa: pdq, fddi, ifnet attach fpa at pci file dev/pci/if_fpa.c fpa -# AMD am7990 (LANCE) -based Ethernet controllers -# device declaration in sys/conf/files -attach le at pci with le_pci -file dev/pci/if_le_pci.c le_pci - # AMD PCnet-PCI Ethernet controller family -# Supersedes if_le_pci.c device pcn: ether, ifnet, ifmedia, mii attach pcn at pci file dev/pci/if_pcn.c pcn diff --git a/sys/dev/pci/if_le_pci.c b/sys/dev/pci/if_le_pci.c deleted file mode 100644 index 98e00e115a7..00000000000 --- a/sys/dev/pci/if_le_pci.c +++ /dev/null @@ -1,256 +0,0 @@ -/* $OpenBSD: if_le_pci.c,v 1.25 2005/12/17 07:31:27 miod Exp $ */ -/* $NetBSD: if_le_pci.c,v 1.13 1996/10/25 21:33:32 cgd Exp $ */ - -/*- - * Copyright (c) 1995 Charles M. Hannum. All rights reserved. - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Ralph Campbell and Rick Macklem. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)if_le.c 8.2 (Berkeley) 11/16/93 - */ - -#include "bpfilter.h" - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/mbuf.h> -#include <sys/syslog.h> -#include <sys/socket.h> -#include <sys/device.h> - -#include <uvm/uvm_extern.h> - -#include <net/if.h> -#include <net/if_media.h> - -#ifdef INET -#include <netinet/in.h> -#include <netinet/if_ether.h> -#endif - -#include <machine/cpu.h> -#include <machine/bus.h> -#include <machine/intr.h> - -#include <dev/pci/pcireg.h> -#include <dev/pci/pcivar.h> -#include <dev/pci/pcidevs.h> - -#include <dev/ic/am7990reg.h> -#include <dev/ic/am7990var.h> - -#include <dev/pci/if_levar.h> - -#ifdef __alpha__ /* XXX */ -/* XXX XXX NEED REAL DMA MAPPING SUPPORT XXX XXX */ -#undef vtophys -#define vtophys(va) alpha_XXX_dmamap((vaddr_t)(va)) -#endif - -int le_pci_match(struct device *, void *, void *); -void le_pci_attach(struct device *, struct device *, void *); - -struct cfattach le_pci_ca = { - sizeof(struct le_softc), le_pci_match, le_pci_attach -}; - -hide void le_pci_wrcsr(struct am7990_softc *, u_int16_t, u_int16_t); -hide u_int16_t le_pci_rdcsr(struct am7990_softc *, u_int16_t); - -/* - * PCI constants. - * XXX These should be in a common file! - */ -#define PCI_CBIO 0x10 /* Configuration Base IO Address */ - -hide void -le_pci_wrcsr(sc, port, val) - struct am7990_softc *sc; - u_int16_t port, val; -{ - struct le_softc *lesc = (struct le_softc *)sc; - bus_space_tag_t iot = lesc->sc_iot; - bus_space_handle_t ioh = lesc->sc_ioh; - - bus_space_write_2(iot, ioh, lesc->sc_rap, port); - bus_space_write_2(iot, ioh, lesc->sc_rdp, val); -} - -hide u_int16_t -le_pci_rdcsr(sc, port) - struct am7990_softc *sc; - u_int16_t port; -{ - struct le_softc *lesc = (struct le_softc *)sc; - bus_space_tag_t iot = lesc->sc_iot; - bus_space_handle_t ioh = lesc->sc_ioh; - u_int16_t val; - - bus_space_write_2(iot, ioh, lesc->sc_rap, port); - val = bus_space_read_2(iot, ioh, lesc->sc_rdp); - return (val); -} - -int -le_pci_match(parent, match, aux) - struct device *parent; - void *match, *aux; -{ - struct pci_attach_args *pa = aux; - - if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_AMD) - return (0); - - switch (PCI_PRODUCT(pa->pa_id)) { - case PCI_PRODUCT_AMD_PCNET_PCI: - case PCI_PRODUCT_AMD_PCHOME_PCI: - return (1); - } - - return (0); -} - -void -le_pci_attach(parent, self, aux) - struct device *parent, *self; - void *aux; -{ - struct le_softc *lesc = (void *)self; - struct am7990_softc *sc = &lesc->sc_am7990; - struct pci_attach_args *pa = aux; - pci_intr_handle_t ih; - bus_size_t iosize; - bus_space_handle_t ioh; - bus_space_tag_t iot; - pci_chipset_tag_t pc = pa->pa_pc; - int i, rseg; - const char *intrstr; - bus_dma_segment_t seg; - bus_dmamap_t dmamap; - caddr_t kva; - - switch (PCI_PRODUCT(pa->pa_id)) { - case PCI_PRODUCT_AMD_PCNET_PCI: - lesc->sc_rap = PCNET_PCI_RAP; - lesc->sc_rdp = PCNET_PCI_RDP; - break; - } - - if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, - &iot, &ioh, NULL, &iosize, 0)) { - printf(": can't map I/O base\n"); - return; - } - - /* - * Extract the physical MAC address from the ROM. - */ - for (i = 0; i < sizeof(sc->sc_arpcom.ac_enaddr); i++) - sc->sc_arpcom.ac_enaddr[i] = bus_space_read_1(iot, ioh, i); - - if (bus_dmamem_alloc(pa->pa_dmat, PCNET_MEMSIZE, PAGE_SIZE, - 0, &seg, 1, &rseg, BUS_DMA_NOWAIT)) { - printf(": couldn't allocate memory for card\n"); - bus_space_unmap(iot, ioh, iosize); - return; - } - if (bus_dmamem_map(pa->pa_dmat, &seg, rseg, PCNET_MEMSIZE, - &kva, BUS_DMA_NOWAIT)) { - printf(": couldn't map memory for card\n"); - bus_dmamem_free(pa->pa_dmat, &seg, rseg); - bus_space_unmap(iot, ioh, iosize); - return; - } - if (bus_dmamap_create(pa->pa_dmat, PCNET_MEMSIZE, 1, PCNET_MEMSIZE, - 0, BUS_DMA_NOWAIT, &dmamap)) { - printf(": couldn't create dma map\n"); - bus_dmamem_unmap(pa->pa_dmat, kva, PCNET_MEMSIZE); - bus_dmamem_free(pa->pa_dmat, &seg, rseg); - bus_space_unmap(iot, ioh, iosize); - return; - } - if (bus_dmamap_load(pa->pa_dmat, dmamap, kva, PCNET_MEMSIZE, - NULL, BUS_DMA_NOWAIT)) { - printf(": couldn't load dma map\n"); - bus_dmamap_destroy(pa->pa_dmat, dmamap); - bus_dmamem_unmap(pa->pa_dmat, kva, PCNET_MEMSIZE); - bus_dmamem_free(pa->pa_dmat, &seg, rseg); - bus_space_unmap(iot, ioh, iosize); - return; - } - sc->sc_mem = kva; - bzero(sc->sc_mem, PCNET_MEMSIZE); - - /* Map and establish the interrupt. */ - if (pci_intr_map(pa, &ih)) { - printf(": couldn't map interrupt\n"); - bus_dmamap_destroy(pa->pa_dmat, dmamap); - bus_dmamem_unmap(pa->pa_dmat, kva, PCNET_MEMSIZE); - bus_dmamem_free(pa->pa_dmat, &seg, rseg); - bus_space_unmap(iot, ioh, iosize); - return; - } - intrstr = pci_intr_string(pc, ih); - lesc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, am7990_intr, sc, - sc->sc_dev.dv_xname); - if (lesc->sc_ih == NULL) { - printf(": couldn't establish interrupt"); - if (intrstr != NULL) - printf(" at %s", intrstr); - printf("\n"); - bus_dmamap_destroy(pa->pa_dmat, dmamap); - bus_dmamem_unmap(pa->pa_dmat, kva, PCNET_MEMSIZE); - bus_dmamem_free(pa->pa_dmat, &seg, rseg); - bus_space_unmap(iot, ioh, iosize); - return; - } - printf(": %s\n", intrstr); - - lesc->sc_iot = iot; - lesc->sc_ioh = ioh; - - sc->sc_conf3 = 0; - sc->sc_addr = vtophys((vaddr_t)sc->sc_mem); /* XXX XXX XXX */ - sc->sc_memsize = PCNET_MEMSIZE; - - sc->sc_copytodesc = am7990_copytobuf_contig; - sc->sc_copyfromdesc = am7990_copyfrombuf_contig; - sc->sc_copytobuf = am7990_copytobuf_contig; - sc->sc_copyfrombuf = am7990_copyfrombuf_contig; - sc->sc_zerobuf = am7990_zerobuf_contig; - - sc->sc_rdcsr = le_pci_rdcsr; - sc->sc_wrcsr = le_pci_wrcsr; - sc->sc_hwreset = NULL; - sc->sc_hwinit = NULL; - - printf("%s", sc->sc_dev.dv_xname); - am7990_config(sc); -} diff --git a/sys/dev/pci/if_levar.h b/sys/dev/pci/if_levar.h deleted file mode 100644 index 01c5e1ad1f8..00000000000 --- a/sys/dev/pci/if_levar.h +++ /dev/null @@ -1,46 +0,0 @@ -/* $OpenBSD: if_levar.h,v 1.5 2001/01/31 23:05:17 tholo Exp $ */ -/* $NetBSD: if_levar.h,v 1.3 1996/10/21 22:56:46 thorpej Exp $ */ - -/* - * LANCE Ethernet driver header file - * - * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. - * - * Copyright (C) 1993, Paul Richards. This software may be used, modified, - * copied, distributed, and sold, in both source and binary form provided - * that the above copyright and these terms are retained. Under no - * circumstances is the author responsible for the proper functioning - * of this software, nor does the author assume any responsibility - * for damages incurred with its use. - */ - -#define PCNET_PCI_RDP 0x10 -#define PCNET_PCI_RAP 0x12 - -/* - * Size of packet buffer - * - * The MI code will split this between initialization block, descriptors, - * transmit and receive buffers. - * - * Must be 8192 <= PCNET_MEMSIZE <= 262144 and a power of 2 - */ - -#define PCNET_MEMSIZE 16384 - - -/* - * Ethernet software status per interface. - * - * Each interface is referenced by a network interface structure, - * arpcom.ac_if, which the routing code uses to locate the interface. - * This structure contains the output queue for the interface, its address, ... - */ -struct le_softc { - struct am7990_softc sc_am7990; /* glue to MI code */ - - void *sc_ih; - bus_space_tag_t sc_iot; /* space cookie */ - bus_space_handle_t sc_ioh; /* bus space handle */ - int sc_rap, sc_rdp; /* offsets to LANCE registers */ -}; diff --git a/sys/dev/pci/if_pcn.c b/sys/dev/pci/if_pcn.c index 54b6b56f0bd..1094047196f 100644 --- a/sys/dev/pci/if_pcn.c +++ b/sys/dev/pci/if_pcn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pcn.c,v 1.6 2006/02/22 18:12:24 brad Exp $ */ +/* $OpenBSD: if_pcn.c,v 1.7 2006/03/12 17:29:48 martin Exp $ */ /* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */ /* @@ -524,8 +524,7 @@ pcn_match(struct device *parent, void *match, void *aux) switch (PCI_PRODUCT(pa->pa_id)) { case PCI_PRODUCT_AMD_PCNET_PCI: - /* Beat if_le_pci.c */ - return (10); + return (1); } return (0); |