From 28acbab4e01a9abc7eca0ca6229cd84267eedd30 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 9 Aug 1999 13:01:58 +0000 Subject: [PATCH] Unifdef -U__bsdi__ --- sys/dev/de/if_de.c | 259 +----------------------------------------- sys/dev/de/if_devar.h | 50 +------- sys/pci/if_de.c | 259 +----------------------------------------- sys/pci/if_devar.h | 50 +------- 4 files changed, 8 insertions(+), 610 deletions(-) diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index d879f2905057..6dbd4322b164 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -54,7 +54,7 @@ #include #if defined(__FreeBSD__) #include -#elif defined(__bsdi__) || defined(__NetBSD__) +#elif defined(__NetBSD__) #include #endif @@ -79,11 +79,6 @@ #include #endif -#if defined(__bsdi__) && _BSDI_VERSION >= 199701 -#include -#include -#endif - #include "bpf.h" #if NBPF > 0 #include @@ -118,26 +113,6 @@ #endif #endif /* __FreeBSD__ */ -#if defined(__bsdi__) -#include -#include -#include -#include -#include -#include -#include -#if _BSDI_VERSION < 199510 -#include -#else -#define NEISA 0 -#endif -#if NEISA > 0 && _BSDI_VERSION >= 199401 -#include -#define TULIP_EISA -#endif -#define DEVAR_INCLUDE "i386/pci/if_devar.h" -#endif /* __bsdi__ */ - #if defined(__NetBSD__) #include #if defined(INET) @@ -3081,14 +3056,6 @@ tulip_ifmedia_status( { tulip_softc_t *sc = TULIP_IFP_TO_SOFTC(ifp); -#if defined(__bsdi__) - if (sc->tulip_mii.mii_instance != 0) { - mii_pollstat(&sc->tulip_mii); - req->ifm_active = sc->tulip_mii.mii_media_active; - req->ifm_status = sc->tulip_mii.mii_media_status; - return; - } -#endif if (sc->tulip_media == TULIP_MEDIA_UNKNOWN) return; @@ -3725,9 +3692,6 @@ tulip_rx_intr( && m0 != NULL #endif ) { -#if defined(__bsdi__) - eh.ether_type = ntohs(eh.ether_type); -#endif #if !defined(TULIP_COPY_RXDATA) ms->m_pkthdr.len = total_len; ms->m_pkthdr.rcvif = ifp; @@ -5064,7 +5028,7 @@ tulip_ifwatchdog( TULIP_PERFMERGE(sc, perf_rxget); } -#if defined(__bsdi__) || (defined(__FreeBSD__) && BSD < 199506) +#if defined(__FreeBSD__) && BSD < 199506 static ifnet_ret_t tulip_ifwatchdog_wrapper( int unit) @@ -5095,29 +5059,11 @@ tulip_attach( ifp->if_start = tulip_ifstart; ifp->if_watchdog = tulip_ifwatchdog; ifp->if_timer = 1; -#if (!defined(__bsdi__) || _BSDI_VERSION < 199401) && !defined(__NetBSD__) +#if !defined(__NetBSD__) ifp->if_output = ether_output; #endif -#if defined(__bsdi__) && _BSDI_VERSION < 199401 - ifp->if_mtu = ETHERMTU; -#endif -#if defined(__bsdi__) && _BSDI_VERSION >= 199510 - aprint_naive(": DEC Ethernet"); - aprint_normal(": %s%s", sc->tulip_boardid, - tulip_chipdescs[sc->tulip_chipid]); - aprint_verbose(" pass %d.%d", (sc->tulip_revinfo & 0xF0) >> 4, - sc->tulip_revinfo & 0x0F); - printf("\n"); - sc->tulip_pf = aprint_normal; - aprint_normal(TULIP_PRINTF_FMT ": address " TULIP_EADDR_FMT "\n", - TULIP_PRINTF_ARGS, - TULIP_EADDR_ARGS(sc->tulip_enaddr)); -#else printf( -#if defined(__bsdi__) - "\n" -#endif TULIP_PRINTF_FMT ": %s%s pass %d.%d%s\n", TULIP_PRINTF_ARGS, sc->tulip_boardid, @@ -5129,7 +5075,6 @@ tulip_attach( printf(TULIP_PRINTF_FMT ": address " TULIP_EADDR_FMT "\n", TULIP_PRINTF_ARGS, TULIP_EADDR_ARGS(sc->tulip_enaddr)); -#endif #if defined(__alpha__) /* @@ -5171,10 +5116,6 @@ tulip_attach( tulip_reset(sc); -#if defined(__bsdi__) && _BSDI_VERSION >= 199510 - sc->tulip_pf = printf; - TULIP_ETHER_IFATTACH(sc); -#else if_attach(ifp); #if defined(__FreeBSD__) ifp->if_snd.ifq_maxlen = ifqmaxlen; @@ -5182,7 +5123,6 @@ tulip_attach( #if defined(__NetBSD__) || (defined(__FreeBSD__) && BSD >= 199506) TULIP_ETHER_IFATTACH(sc); #endif -#endif /* __bsdi__ */ #if NBPF > 0 TULIP_BPF_ATTACH(sc); @@ -5450,151 +5390,6 @@ static struct pci_device dedevice = { COMPAT_PCI_DRIVER(de, dedevice); #endif /* __FreeBSD__ */ -#if defined(__bsdi__) -#define TULIP_PCI_ATTACH_ARGS struct device * const parent, struct device * const self, void * const aux -#define TULIP_SHUTDOWN_ARGS void *arg - -static int -tulip_pci_match( - pci_devaddr_t *pa) -{ - int irq; - unsigned id; - - id = pci_inl(pa, PCI_VENDOR_ID); - if (PCI_VENDORID(id) != DEC_VENDORID) - return 0; - id = PCI_CHIPID(id); - if (id != CHIPID_21040 && id != CHIPID_21041 - && id != CHIPID_21140 && id != CHIPID_21142) - return 0; - irq = pci_inl(pa, PCI_I_LINE) & 0xFF; - if (irq == 0 || irq >= 16) { - printf("de?: invalid IRQ %d; skipping\n", irq); - return 0; - } - return 1; -} - -static int -tulip_probe( - struct device *parent, - struct cfdata *cf, - void *aux) -{ - struct isa_attach_args * const ia = (struct isa_attach_args *) aux; - unsigned irq, slot; - pci_devaddr_t *pa; - -#if _BSDI_VERSION >= 199401 - switch (ia->ia_bustype) { - case BUS_PCI: -#endif - pa = pci_scan(tulip_pci_match); - if (pa == NULL) - return 0; - - irq = (1 << (pci_inl(pa, PCI_I_LINE) & 0xFF)); - - /* Get the base address; assume the BIOS set it up correctly */ -#if defined(TULIP_IOMAPPED) - ia->ia_maddr = NULL; - ia->ia_msize = 0; - ia->ia_iobase = pci_inl(pa, PCI_CBIO) & ~7; - pci_outl(pa, PCI_CBIO, 0xFFFFFFFF); - ia->ia_iosize = ((~pci_inl(pa, PCI_CBIO)) | 7) + 1; - pci_outl(pa, PCI_CBIO, (int) ia->ia_iobase); - - /* Disable memory space access */ - pci_outl(pa, PCI_COMMAND, pci_inl(pa, PCI_COMMAND) & ~2); -#else - ia->ia_maddr = (caddr_t) (pci_inl(pa, PCI_CBMA) & ~7); - pci_outl(pa, PCI_CBMA, 0xFFFFFFFF); - ia->ia_msize = ((~pci_inl(pa, PCI_CBMA)) | 7) + 1; - pci_outl(pa, PCI_CBMA, (int) ia->ia_maddr); - ia->ia_iobase = 0; - ia->ia_iosize = 0; - - /* Disable I/O space access */ - pci_outl(pa, PCI_COMMAND, pci_inl(pa, PCI_COMMAND) & ~1); -#endif /* TULIP_IOMAPPED */ - - ia->ia_aux = (void *) pa; -#if _BSDI_VERSION >= 199401 - break; - -#if defined(TULIP_EISA) - case BUS_EISA: { - unsigned tmp; - - if ((slot = eisa_match(cf, ia)) == 0) - return 0; - ia->ia_iobase = slot << 12; - ia->ia_iosize = EISA_NPORT; - eisa_slotalloc(slot); - tmp = inb(ia->ia_iobase + DE425_CFG0); - irq = tulip_eisa_irqs[(tmp >> 1) & 0x03]; - /* - * Until BSD/OS likes level interrupts, force - * the DE425 into edge-triggered mode. - */ - if ((tmp & 1) == 0) - outb(ia->ia_iobase + DE425_CFG0, tmp | 1); - /* - * CBIO needs to map to the EISA slot - * enable I/O access and Master - */ - outl(ia->ia_iobase + DE425_CBIO, ia->ia_iobase); - outl(ia->ia_iobase + DE425_CFCS, 5 | inl(ia->ia_iobase + DE425_CFCS)); - ia->ia_aux = NULL; - break; - } -#endif /* TULIP_EISA */ - default: - return 0; - } -#endif - - /* PCI bus masters don't use host DMA channels */ - ia->ia_drq = DRQNONE; - - if (ia->ia_irq != IRQUNK && irq != ia->ia_irq) { - printf("de%d: error: desired IRQ of %d does not match device's " - "actual IRQ of %d,\n", - cf->cf_unit, - ffs(ia->ia_irq) - 1, ffs(irq) - 1); - return 0; - } - if (ia->ia_irq == IRQUNK) - ia->ia_irq = irq; -#ifdef IRQSHARE - ia->ia_irq |= IRQSHARE; -#endif - return 1; -} - -static void tulip_pci_attach(TULIP_PCI_ATTACH_ARGS); - -#if defined(TULIP_EISA) -static char *tulip_eisa_ids[] = { - "DEC4250", - NULL -}; -#endif - -struct cfdriver decd = { - 0, "de", tulip_probe, tulip_pci_attach, -#if _BSDI_VERSION >= 199401 - DV_IFNET, -#endif - sizeof(tulip_softc_t), -#if defined(TULIP_EISA) - tulip_eisa_ids -#endif -}; - -#endif /* __bsdi__ */ - #if defined(__NetBSD__) #define TULIP_PCI_ATTACH_ARGS struct device * const parent, struct device * const self, void * const aux #define TULIP_SHUTDOWN_ARGS void *arg @@ -5647,16 +5442,6 @@ tulip_pci_attach( #define PCI_GETBUSDEVINFO(sc) ((void)((sc)->tulip_pci_busno = (config_id->bus), /* XXX */ \ (sc)->tulip_pci_devno = (config_id->slot))) /* XXX */ #endif -#if defined(__bsdi__) - tulip_softc_t * const sc = (tulip_softc_t *) self; - struct isa_attach_args * const ia = (struct isa_attach_args *) aux; - pci_devaddr_t *pa = (pci_devaddr_t *) ia->ia_aux; - const int unit = sc->tulip_dev.dv_unit; -#define PCI_CONF_WRITE(r, v) pci_outl(pa, (r), (v)) -#define PCI_CONF_READ(r) pci_inl(pa, (r)) -#define PCI_GETBUSDEVINFO(sc) ((void)((sc)->tulip_pci_busno = pa->d_bus, \ - (sc)->tulip_pci_devno = pa->d_agent)) -#endif #if defined(__NetBSD__) tulip_softc_t * const sc = (tulip_softc_t *) self; struct pci_attach_args * const pa = (struct pci_attach_args *) aux; @@ -5690,25 +5475,9 @@ tulip_pci_attach( return; } -#if defined(__bsdi__) - if (pa != NULL) { - revinfo = pci_inl(pa, PCI_CFRV) & 0xFF; - id = pci_inl(pa, PCI_CFID); - cfdainfo = pci_inl(pa, PCI_CFDA); -#if defined(TULIP_EISA) - } else { - revinfo = inl(ia->ia_iobase + DE425_CFRV) & 0xFF; - csroffset = TULIP_EISA_CSROFFSET; - csrsize = TULIP_EISA_CSRSIZE; - chipid = TULIP_DE425; - cfdainfo = 0; -#endif /* TULIP_EISA */ - } -#else /* __bsdi__ */ revinfo = PCI_CONF_READ(PCI_CFRV) & 0xFF; id = PCI_CONF_READ(PCI_CFID); cfdainfo = PCI_CONF_READ(PCI_CFDA); -#endif /* __bsdi__ */ if (PCI_VENDORID(id) == DEC_VENDORID) { if (PCI_CHIPID(id) == CHIPID_21040) @@ -5819,15 +5588,6 @@ tulip_pci_attach( tulips[unit] = sc; #endif /* __FreeBSD__ */ -#if defined(__bsdi__) - sc->tulip_pf = printf; -#if defined(TULIP_IOMAPPED) - csr_base = ia->ia_iobase; -#else - csr_base = (vm_offset_t) mapphys((vm_offset_t) ia->ia_maddr, ia->ia_msize); -#endif -#endif /* __bsdi__ */ - #if defined(__NetBSD__) csr_base = 0; { @@ -5962,19 +5722,6 @@ tulip_pci_attach( at_shutdown(tulip_shutdown, sc, SHUTDOWN_POST_SYNC); #endif #endif -#if defined(__bsdi__) - if ((sc->tulip_features & TULIP_HAVE_SLAVEDINTR) == 0) { - isa_establish(&sc->tulip_id, &sc->tulip_dev); - - sc->tulip_ih.ih_fun = intr_rtn; - sc->tulip_ih.ih_arg = (void *) sc; - intr_establish(ia->ia_irq, &sc->tulip_ih, DV_NET); - } - - sc->tulip_ats.func = tulip_shutdown; - sc->tulip_ats.arg = (void *) sc; - atshutdown(&sc->tulip_ats, ATSH_ADD); -#endif #if defined(TULIP_USE_SOFTINTR) if (sc->tulip_unit > tulip_softintr_max_unit) tulip_softintr_max_unit = sc->tulip_unit; diff --git a/sys/dev/de/if_devar.h b/sys/dev/de/if_devar.h index 2880f6b828cc..85e8ee63dafa 100644 --- a/sys/dev/de/if_devar.h +++ b/sys/dev/de/if_devar.h @@ -406,11 +406,6 @@ typedef struct { void (*bd_media_select)(tulip_softc_t * const sc); void (*bd_media_poll)(tulip_softc_t * const sc, tulip_mediapoll_event_t event); void (*bd_media_preset)(tulip_softc_t * const sc); -#if defined(__bsdi__) && _BSDI_VERSION >= 199701 - struct ifmedia_entry *bd_media_list; - int bd_media_cnt; - int bd_media_options_mask; -#endif } tulip_boardsw_t; /* @@ -494,21 +489,6 @@ typedef struct { * */ struct _tulip_softc_t { -#if defined(__bsdi__) - struct device tulip_dev; /* base device */ - struct isadev tulip_id; /* ISA device */ - struct intrhand tulip_ih; /* intrrupt vectoring */ - struct atshutdown tulip_ats; /* shutdown hook */ -#if _BSDI_VERSION < 199401 - caddr_t tulip_bpf; /* for BPF */ -#else - prf_t tulip_pf; /* printf function */ -#if _BSDI_VERSION >= 199701 - struct mii_data tulip_mii; /* Generic MII and media data */ -#define tulip_ifmedia tulip_mii.mii_media -#endif /* _BSDI_VERSION >= 199701 */ -#endif /* _BSDI_VERSION < 199401 */ -#endif /* __bsdi__ */ #if defined(__NetBSD__) struct device tulip_dev; /* base device */ void *tulip_ih; /* intrrupt vectoring */ @@ -982,34 +962,6 @@ NETISR_SET(NETISR_DE, tulip_softintr); #define loudprintf if (bootverbose) printf #endif -#if defined(__bsdi__) -typedef int ifnet_ret_t; -typedef u_long ioctl_cmd_t; -extern struct cfdriver decd; -#define TULIP_UNIT_TO_SOFTC(unit) ((tulip_softc_t *) decd.cd_devs[unit]) -#define TULIP_IFP_TO_SOFTC(ifp) (TULIP_UNIT_TO_SOFTC((ifp)->if_unit)) -#define TULIP_ETHER_IFATTACH(sc) ether_attach(&(sc)->tulip_if) -#if _BSDI_VERSION >= 199510 -#if 0 -#define TULIP_BURSTSIZE(unit) log2_burst_size -#endif -#define loudprintf aprint_verbose -#define printf (*sc->tulip_pf) -#define MCNT(x) (sizeof(x) / sizeof(struct ifmedia_entry)) -#elif _BSDI_VERSION <= 199401 -#define DRQNONE 0 -#define loudprintf printf -static void -arp_ifinit( - struct arpcom *ac, - struct ifaddr *ifa) -{ - ac->ac_ipaddr = IA_SIN(ifa)->sin_addr; - arpwhohas(ac, &ac->ac_ipaddr); -} -#endif -#endif /* __bsdi__ */ - #if defined(__NetBSD__) typedef void ifnet_ret_t; typedef u_long ioctl_cmd_t; @@ -1076,7 +1028,7 @@ extern struct cfdriver de_cd; #define TULIP_ETHER_IFATTACH(sc) ether_ifattach(&(sc)->tulip_if) #endif -#if !defined(tulip_bpf) && (!defined(__bsdi__) || _BSDI_VERSION >= 199401) +#if !defined(tulip_bpf) #define tulip_bpf tulip_if.if_bpf #endif diff --git a/sys/pci/if_de.c b/sys/pci/if_de.c index d879f2905057..6dbd4322b164 100644 --- a/sys/pci/if_de.c +++ b/sys/pci/if_de.c @@ -54,7 +54,7 @@ #include #if defined(__FreeBSD__) #include -#elif defined(__bsdi__) || defined(__NetBSD__) +#elif defined(__NetBSD__) #include #endif @@ -79,11 +79,6 @@ #include #endif -#if defined(__bsdi__) && _BSDI_VERSION >= 199701 -#include -#include -#endif - #include "bpf.h" #if NBPF > 0 #include @@ -118,26 +113,6 @@ #endif #endif /* __FreeBSD__ */ -#if defined(__bsdi__) -#include -#include -#include -#include -#include -#include -#include -#if _BSDI_VERSION < 199510 -#include -#else -#define NEISA 0 -#endif -#if NEISA > 0 && _BSDI_VERSION >= 199401 -#include -#define TULIP_EISA -#endif -#define DEVAR_INCLUDE "i386/pci/if_devar.h" -#endif /* __bsdi__ */ - #if defined(__NetBSD__) #include #if defined(INET) @@ -3081,14 +3056,6 @@ tulip_ifmedia_status( { tulip_softc_t *sc = TULIP_IFP_TO_SOFTC(ifp); -#if defined(__bsdi__) - if (sc->tulip_mii.mii_instance != 0) { - mii_pollstat(&sc->tulip_mii); - req->ifm_active = sc->tulip_mii.mii_media_active; - req->ifm_status = sc->tulip_mii.mii_media_status; - return; - } -#endif if (sc->tulip_media == TULIP_MEDIA_UNKNOWN) return; @@ -3725,9 +3692,6 @@ tulip_rx_intr( && m0 != NULL #endif ) { -#if defined(__bsdi__) - eh.ether_type = ntohs(eh.ether_type); -#endif #if !defined(TULIP_COPY_RXDATA) ms->m_pkthdr.len = total_len; ms->m_pkthdr.rcvif = ifp; @@ -5064,7 +5028,7 @@ tulip_ifwatchdog( TULIP_PERFMERGE(sc, perf_rxget); } -#if defined(__bsdi__) || (defined(__FreeBSD__) && BSD < 199506) +#if defined(__FreeBSD__) && BSD < 199506 static ifnet_ret_t tulip_ifwatchdog_wrapper( int unit) @@ -5095,29 +5059,11 @@ tulip_attach( ifp->if_start = tulip_ifstart; ifp->if_watchdog = tulip_ifwatchdog; ifp->if_timer = 1; -#if (!defined(__bsdi__) || _BSDI_VERSION < 199401) && !defined(__NetBSD__) +#if !defined(__NetBSD__) ifp->if_output = ether_output; #endif -#if defined(__bsdi__) && _BSDI_VERSION < 199401 - ifp->if_mtu = ETHERMTU; -#endif -#if defined(__bsdi__) && _BSDI_VERSION >= 199510 - aprint_naive(": DEC Ethernet"); - aprint_normal(": %s%s", sc->tulip_boardid, - tulip_chipdescs[sc->tulip_chipid]); - aprint_verbose(" pass %d.%d", (sc->tulip_revinfo & 0xF0) >> 4, - sc->tulip_revinfo & 0x0F); - printf("\n"); - sc->tulip_pf = aprint_normal; - aprint_normal(TULIP_PRINTF_FMT ": address " TULIP_EADDR_FMT "\n", - TULIP_PRINTF_ARGS, - TULIP_EADDR_ARGS(sc->tulip_enaddr)); -#else printf( -#if defined(__bsdi__) - "\n" -#endif TULIP_PRINTF_FMT ": %s%s pass %d.%d%s\n", TULIP_PRINTF_ARGS, sc->tulip_boardid, @@ -5129,7 +5075,6 @@ tulip_attach( printf(TULIP_PRINTF_FMT ": address " TULIP_EADDR_FMT "\n", TULIP_PRINTF_ARGS, TULIP_EADDR_ARGS(sc->tulip_enaddr)); -#endif #if defined(__alpha__) /* @@ -5171,10 +5116,6 @@ tulip_attach( tulip_reset(sc); -#if defined(__bsdi__) && _BSDI_VERSION >= 199510 - sc->tulip_pf = printf; - TULIP_ETHER_IFATTACH(sc); -#else if_attach(ifp); #if defined(__FreeBSD__) ifp->if_snd.ifq_maxlen = ifqmaxlen; @@ -5182,7 +5123,6 @@ tulip_attach( #if defined(__NetBSD__) || (defined(__FreeBSD__) && BSD >= 199506) TULIP_ETHER_IFATTACH(sc); #endif -#endif /* __bsdi__ */ #if NBPF > 0 TULIP_BPF_ATTACH(sc); @@ -5450,151 +5390,6 @@ static struct pci_device dedevice = { COMPAT_PCI_DRIVER(de, dedevice); #endif /* __FreeBSD__ */ -#if defined(__bsdi__) -#define TULIP_PCI_ATTACH_ARGS struct device * const parent, struct device * const self, void * const aux -#define TULIP_SHUTDOWN_ARGS void *arg - -static int -tulip_pci_match( - pci_devaddr_t *pa) -{ - int irq; - unsigned id; - - id = pci_inl(pa, PCI_VENDOR_ID); - if (PCI_VENDORID(id) != DEC_VENDORID) - return 0; - id = PCI_CHIPID(id); - if (id != CHIPID_21040 && id != CHIPID_21041 - && id != CHIPID_21140 && id != CHIPID_21142) - return 0; - irq = pci_inl(pa, PCI_I_LINE) & 0xFF; - if (irq == 0 || irq >= 16) { - printf("de?: invalid IRQ %d; skipping\n", irq); - return 0; - } - return 1; -} - -static int -tulip_probe( - struct device *parent, - struct cfdata *cf, - void *aux) -{ - struct isa_attach_args * const ia = (struct isa_attach_args *) aux; - unsigned irq, slot; - pci_devaddr_t *pa; - -#if _BSDI_VERSION >= 199401 - switch (ia->ia_bustype) { - case BUS_PCI: -#endif - pa = pci_scan(tulip_pci_match); - if (pa == NULL) - return 0; - - irq = (1 << (pci_inl(pa, PCI_I_LINE) & 0xFF)); - - /* Get the base address; assume the BIOS set it up correctly */ -#if defined(TULIP_IOMAPPED) - ia->ia_maddr = NULL; - ia->ia_msize = 0; - ia->ia_iobase = pci_inl(pa, PCI_CBIO) & ~7; - pci_outl(pa, PCI_CBIO, 0xFFFFFFFF); - ia->ia_iosize = ((~pci_inl(pa, PCI_CBIO)) | 7) + 1; - pci_outl(pa, PCI_CBIO, (int) ia->ia_iobase); - - /* Disable memory space access */ - pci_outl(pa, PCI_COMMAND, pci_inl(pa, PCI_COMMAND) & ~2); -#else - ia->ia_maddr = (caddr_t) (pci_inl(pa, PCI_CBMA) & ~7); - pci_outl(pa, PCI_CBMA, 0xFFFFFFFF); - ia->ia_msize = ((~pci_inl(pa, PCI_CBMA)) | 7) + 1; - pci_outl(pa, PCI_CBMA, (int) ia->ia_maddr); - ia->ia_iobase = 0; - ia->ia_iosize = 0; - - /* Disable I/O space access */ - pci_outl(pa, PCI_COMMAND, pci_inl(pa, PCI_COMMAND) & ~1); -#endif /* TULIP_IOMAPPED */ - - ia->ia_aux = (void *) pa; -#if _BSDI_VERSION >= 199401 - break; - -#if defined(TULIP_EISA) - case BUS_EISA: { - unsigned tmp; - - if ((slot = eisa_match(cf, ia)) == 0) - return 0; - ia->ia_iobase = slot << 12; - ia->ia_iosize = EISA_NPORT; - eisa_slotalloc(slot); - tmp = inb(ia->ia_iobase + DE425_CFG0); - irq = tulip_eisa_irqs[(tmp >> 1) & 0x03]; - /* - * Until BSD/OS likes level interrupts, force - * the DE425 into edge-triggered mode. - */ - if ((tmp & 1) == 0) - outb(ia->ia_iobase + DE425_CFG0, tmp | 1); - /* - * CBIO needs to map to the EISA slot - * enable I/O access and Master - */ - outl(ia->ia_iobase + DE425_CBIO, ia->ia_iobase); - outl(ia->ia_iobase + DE425_CFCS, 5 | inl(ia->ia_iobase + DE425_CFCS)); - ia->ia_aux = NULL; - break; - } -#endif /* TULIP_EISA */ - default: - return 0; - } -#endif - - /* PCI bus masters don't use host DMA channels */ - ia->ia_drq = DRQNONE; - - if (ia->ia_irq != IRQUNK && irq != ia->ia_irq) { - printf("de%d: error: desired IRQ of %d does not match device's " - "actual IRQ of %d,\n", - cf->cf_unit, - ffs(ia->ia_irq) - 1, ffs(irq) - 1); - return 0; - } - if (ia->ia_irq == IRQUNK) - ia->ia_irq = irq; -#ifdef IRQSHARE - ia->ia_irq |= IRQSHARE; -#endif - return 1; -} - -static void tulip_pci_attach(TULIP_PCI_ATTACH_ARGS); - -#if defined(TULIP_EISA) -static char *tulip_eisa_ids[] = { - "DEC4250", - NULL -}; -#endif - -struct cfdriver decd = { - 0, "de", tulip_probe, tulip_pci_attach, -#if _BSDI_VERSION >= 199401 - DV_IFNET, -#endif - sizeof(tulip_softc_t), -#if defined(TULIP_EISA) - tulip_eisa_ids -#endif -}; - -#endif /* __bsdi__ */ - #if defined(__NetBSD__) #define TULIP_PCI_ATTACH_ARGS struct device * const parent, struct device * const self, void * const aux #define TULIP_SHUTDOWN_ARGS void *arg @@ -5647,16 +5442,6 @@ tulip_pci_attach( #define PCI_GETBUSDEVINFO(sc) ((void)((sc)->tulip_pci_busno = (config_id->bus), /* XXX */ \ (sc)->tulip_pci_devno = (config_id->slot))) /* XXX */ #endif -#if defined(__bsdi__) - tulip_softc_t * const sc = (tulip_softc_t *) self; - struct isa_attach_args * const ia = (struct isa_attach_args *) aux; - pci_devaddr_t *pa = (pci_devaddr_t *) ia->ia_aux; - const int unit = sc->tulip_dev.dv_unit; -#define PCI_CONF_WRITE(r, v) pci_outl(pa, (r), (v)) -#define PCI_CONF_READ(r) pci_inl(pa, (r)) -#define PCI_GETBUSDEVINFO(sc) ((void)((sc)->tulip_pci_busno = pa->d_bus, \ - (sc)->tulip_pci_devno = pa->d_agent)) -#endif #if defined(__NetBSD__) tulip_softc_t * const sc = (tulip_softc_t *) self; struct pci_attach_args * const pa = (struct pci_attach_args *) aux; @@ -5690,25 +5475,9 @@ tulip_pci_attach( return; } -#if defined(__bsdi__) - if (pa != NULL) { - revinfo = pci_inl(pa, PCI_CFRV) & 0xFF; - id = pci_inl(pa, PCI_CFID); - cfdainfo = pci_inl(pa, PCI_CFDA); -#if defined(TULIP_EISA) - } else { - revinfo = inl(ia->ia_iobase + DE425_CFRV) & 0xFF; - csroffset = TULIP_EISA_CSROFFSET; - csrsize = TULIP_EISA_CSRSIZE; - chipid = TULIP_DE425; - cfdainfo = 0; -#endif /* TULIP_EISA */ - } -#else /* __bsdi__ */ revinfo = PCI_CONF_READ(PCI_CFRV) & 0xFF; id = PCI_CONF_READ(PCI_CFID); cfdainfo = PCI_CONF_READ(PCI_CFDA); -#endif /* __bsdi__ */ if (PCI_VENDORID(id) == DEC_VENDORID) { if (PCI_CHIPID(id) == CHIPID_21040) @@ -5819,15 +5588,6 @@ tulip_pci_attach( tulips[unit] = sc; #endif /* __FreeBSD__ */ -#if defined(__bsdi__) - sc->tulip_pf = printf; -#if defined(TULIP_IOMAPPED) - csr_base = ia->ia_iobase; -#else - csr_base = (vm_offset_t) mapphys((vm_offset_t) ia->ia_maddr, ia->ia_msize); -#endif -#endif /* __bsdi__ */ - #if defined(__NetBSD__) csr_base = 0; { @@ -5962,19 +5722,6 @@ tulip_pci_attach( at_shutdown(tulip_shutdown, sc, SHUTDOWN_POST_SYNC); #endif #endif -#if defined(__bsdi__) - if ((sc->tulip_features & TULIP_HAVE_SLAVEDINTR) == 0) { - isa_establish(&sc->tulip_id, &sc->tulip_dev); - - sc->tulip_ih.ih_fun = intr_rtn; - sc->tulip_ih.ih_arg = (void *) sc; - intr_establish(ia->ia_irq, &sc->tulip_ih, DV_NET); - } - - sc->tulip_ats.func = tulip_shutdown; - sc->tulip_ats.arg = (void *) sc; - atshutdown(&sc->tulip_ats, ATSH_ADD); -#endif #if defined(TULIP_USE_SOFTINTR) if (sc->tulip_unit > tulip_softintr_max_unit) tulip_softintr_max_unit = sc->tulip_unit; diff --git a/sys/pci/if_devar.h b/sys/pci/if_devar.h index 2880f6b828cc..85e8ee63dafa 100644 --- a/sys/pci/if_devar.h +++ b/sys/pci/if_devar.h @@ -406,11 +406,6 @@ typedef struct { void (*bd_media_select)(tulip_softc_t * const sc); void (*bd_media_poll)(tulip_softc_t * const sc, tulip_mediapoll_event_t event); void (*bd_media_preset)(tulip_softc_t * const sc); -#if defined(__bsdi__) && _BSDI_VERSION >= 199701 - struct ifmedia_entry *bd_media_list; - int bd_media_cnt; - int bd_media_options_mask; -#endif } tulip_boardsw_t; /* @@ -494,21 +489,6 @@ typedef struct { * */ struct _tulip_softc_t { -#if defined(__bsdi__) - struct device tulip_dev; /* base device */ - struct isadev tulip_id; /* ISA device */ - struct intrhand tulip_ih; /* intrrupt vectoring */ - struct atshutdown tulip_ats; /* shutdown hook */ -#if _BSDI_VERSION < 199401 - caddr_t tulip_bpf; /* for BPF */ -#else - prf_t tulip_pf; /* printf function */ -#if _BSDI_VERSION >= 199701 - struct mii_data tulip_mii; /* Generic MII and media data */ -#define tulip_ifmedia tulip_mii.mii_media -#endif /* _BSDI_VERSION >= 199701 */ -#endif /* _BSDI_VERSION < 199401 */ -#endif /* __bsdi__ */ #if defined(__NetBSD__) struct device tulip_dev; /* base device */ void *tulip_ih; /* intrrupt vectoring */ @@ -982,34 +962,6 @@ NETISR_SET(NETISR_DE, tulip_softintr); #define loudprintf if (bootverbose) printf #endif -#if defined(__bsdi__) -typedef int ifnet_ret_t; -typedef u_long ioctl_cmd_t; -extern struct cfdriver decd; -#define TULIP_UNIT_TO_SOFTC(unit) ((tulip_softc_t *) decd.cd_devs[unit]) -#define TULIP_IFP_TO_SOFTC(ifp) (TULIP_UNIT_TO_SOFTC((ifp)->if_unit)) -#define TULIP_ETHER_IFATTACH(sc) ether_attach(&(sc)->tulip_if) -#if _BSDI_VERSION >= 199510 -#if 0 -#define TULIP_BURSTSIZE(unit) log2_burst_size -#endif -#define loudprintf aprint_verbose -#define printf (*sc->tulip_pf) -#define MCNT(x) (sizeof(x) / sizeof(struct ifmedia_entry)) -#elif _BSDI_VERSION <= 199401 -#define DRQNONE 0 -#define loudprintf printf -static void -arp_ifinit( - struct arpcom *ac, - struct ifaddr *ifa) -{ - ac->ac_ipaddr = IA_SIN(ifa)->sin_addr; - arpwhohas(ac, &ac->ac_ipaddr); -} -#endif -#endif /* __bsdi__ */ - #if defined(__NetBSD__) typedef void ifnet_ret_t; typedef u_long ioctl_cmd_t; @@ -1076,7 +1028,7 @@ extern struct cfdriver de_cd; #define TULIP_ETHER_IFATTACH(sc) ether_ifattach(&(sc)->tulip_if) #endif -#if !defined(tulip_bpf) && (!defined(__bsdi__) || _BSDI_VERSION >= 199401) +#if !defined(tulip_bpf) #define tulip_bpf tulip_if.if_bpf #endif