From 4fa2655157b8ef38e8c3f741c02f15748b0ba6e9 Mon Sep 17 00:00:00 2001 From: Bernhard Schmidt Date: Thu, 4 Nov 2010 18:43:57 +0000 Subject: [PATCH] Remove 4.x, 5.x and 6.x compatibility bits. Submitted by: Paul B Mahol --- sys/compat/ndis/kern_ndis.c | 24 ------------------------ sys/compat/ndis/subr_ndis.c | 20 -------------------- sys/compat/ndis/subr_ntoskrnl.c | 24 ------------------------ 3 files changed, 68 deletions(-) diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index 62bb465899df..459c7868df39 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -287,15 +287,6 @@ ndis_create_sysctls(arg) TAILQ_INIT(&sc->ndis_cfglist_head); -#if __FreeBSD_version < 502113 - /* Create the sysctl tree. */ - - sc->ndis_tree = SYSCTL_ADD_NODE(&sc->ndis_ctx, - SYSCTL_STATIC_CHILDREN(_hw), OID_AUTO, - device_get_nameunit(sc->ndis_dev), CTLFLAG_RD, 0, - device_get_desc(sc->ndis_dev)); - -#endif /* Add the driver-specific registry keys. */ while(1) { @@ -310,11 +301,7 @@ ndis_create_sysctls(arg) /* See if we already have a sysctl with this name */ oidp = NULL; -#if __FreeBSD_version < 502113 - TAILQ_FOREACH(e, &sc->ndis_ctx, link) { -#else TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) { -#endif oidp = e->entry; if (strcasecmp(oidp->oid_name, vals->nc_cfgkey) == 0) break; @@ -395,18 +382,11 @@ ndis_add_sysctl(arg, key, desc, val, flag) TAILQ_INSERT_TAIL(&sc->ndis_cfglist_head, cfg, link); cfg->ndis_oid = -#if __FreeBSD_version < 502113 - SYSCTL_ADD_STRING(&sc->ndis_ctx, SYSCTL_CHILDREN(sc->ndis_tree), - OID_AUTO, cfg->ndis_cfg.nc_cfgkey, flag, - cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), - cfg->ndis_cfg.nc_cfgdesc); -#else SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), OID_AUTO, cfg->ndis_cfg.nc_cfgkey, flag, cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), cfg->ndis_cfg.nc_cfgdesc); -#endif return (0); } @@ -428,11 +408,7 @@ ndis_flush_sysctls(arg) sc = arg; -#if __FreeBSD_version < 502113 - clist = &sc->ndis_ctx; -#else clist = device_get_sysctl_ctx(sc->ndis_dev); -#endif while (!TAILQ_EMPTY(&sc->ndis_cfglist_head)) { cfg = TAILQ_FIRST(&sc->ndis_cfglist_head); diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 558398d71677..a2905c2e34f6 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -639,11 +639,7 @@ NdisReadConfiguration(status, parm, cfg, key, type) * See if registry key is already in a list of known keys * included with the driver. */ -#if __FreeBSD_version < 502113 - TAILQ_FOREACH(e, &sc->ndis_ctx, link) { -#else TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) { -#endif oidp = e->entry; if (strcasecmp(oidp->oid_name, keystr) == 0) { if (strcmp((char *)oidp->oid_arg1, "UNSET") == 0) { @@ -746,11 +742,7 @@ NdisWriteConfiguration(status, cfg, key, parm) /* See if the key already exists. */ -#if __FreeBSD_version < 502113 - TAILQ_FOREACH(e, &sc->ndis_ctx, link) { -#else TAILQ_FOREACH(e, device_get_sysctl_ctx(sc->ndis_dev), link) { -#endif oidp = e->entry; if (strcasecmp(oidp->oid_name, keystr) == 0) { /* Found it, set the value. */ @@ -1318,23 +1310,11 @@ NdisReadNetworkAddress(status, addr, addrlen, adapter) return; } -#ifdef IFP2ENADDR - if (bcmp(IFP2ENADDR(sc->ifp), empty, ETHER_ADDR_LEN) == 0) -#elif __FreeBSD_version >= 700000 if (sc->ifp->if_addr == NULL || bcmp(IF_LLADDR(sc->ifp), empty, ETHER_ADDR_LEN) == 0) -#else - if (bcmp(sc->arpcom.ac_enaddr, empty, ETHER_ADDR_LEN) == 0) -#endif *status = NDIS_STATUS_FAILURE; else { -#ifdef IFP2ENADDR - *addr = IFP2ENADDR(sc->ifp); -#elif __FreeBSD_version >= 700000 *addr = IF_LLADDR(sc->ifp); -#else - *addr = sc->arpcom.ac_enaddr; -#endif *addrlen = ETHER_ADDR_LEN; *status = NDIS_STATUS_SUCCESS; } diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c index 714fcd834117..04184ae5d4ac 100644 --- a/sys/compat/ndis/subr_ntoskrnl.c +++ b/sys/compat/ndis/subr_ntoskrnl.c @@ -44,9 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if __FreeBSD_version > 502113 #include -#endif #include #include #include @@ -2602,11 +2600,7 @@ ntoskrnl_finddev(dev, paddr, res) rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); if (rl != NULL) { -#if __FreeBSD_version < 600022 - SLIST_FOREACH(rle, rl, link) { -#else STAILQ_FOREACH(rle, rl, link) { -#endif r = rle->res; if (r == NULL) @@ -2698,9 +2692,6 @@ ntoskrnl_workitem_thread(arg) KeReleaseSpinLock(&kq->kq_lock, irql); } -#if __FreeBSD_version < 502113 - mtx_lock(&Giant); -#endif kproc_exit(0); return; /* notreached */ } @@ -3429,9 +3420,6 @@ PsTerminateSystemThread(status) ntoskrnl_kth--; -#if __FreeBSD_version < 502113 - mtx_lock(&Giant); -#endif kproc_exit(0); return (0); /* notreached */ } @@ -3453,11 +3441,7 @@ static void DbgBreakPoint(void) { -#if __FreeBSD_version < 502113 - Debugger("DbgBreakPoint(): breakpoint"); -#else kdb_enter(KDB_WHY_NDIS, "DbgBreakPoint(): breakpoint"); -#endif } static void @@ -3697,14 +3681,9 @@ ntoskrnl_dpc_thread(arg) thread_lock(curthread); #ifdef NTOSKRNL_MULTIPLE_DPCS -#if __FreeBSD_version >= 502102 sched_bind(curthread, kq->kq_cpu); -#endif #endif sched_prio(curthread, PRI_MIN_KERN); -#if __FreeBSD_version < 600000 - curthread->td_base_pri = PRI_MIN_KERN; -#endif thread_unlock(curthread); while (1) { @@ -3737,9 +3716,6 @@ ntoskrnl_dpc_thread(arg) KeSetEvent(&kq->kq_done, IO_NO_INCREMENT, FALSE); } -#if __FreeBSD_version < 502113 - mtx_lock(&Giant); -#endif kproc_exit(0); return; /* notreached */ }