diff options
-rw-r--r-- | sys/compat/ndis/kern_ndis.c | 12 | ||||
-rw-r--r-- | sys/compat/ndis/subr_ndis.c | 8 | ||||
-rw-r--r-- | sys/dev/if_ndis/if_ndis.c | 6 | ||||
-rw-r--r-- | sys/dev/if_ndis/if_ndisvar.h | 2 |
4 files changed, 28 insertions, 0 deletions
diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index 06b5044..e8a89e7 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -611,6 +611,7 @@ 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, @@ -618,6 +619,7 @@ ndis_create_sysctls(arg) device_get_nameunit(sc->ndis_dev), CTLFLAG_RD, 0, device_get_desc(sc->ndis_dev)); +#endif /* Add the driver-specific registry keys. */ vals = sc->ndis_regvals; @@ -628,8 +630,13 @@ ndis_create_sysctls(arg) vals++; continue; } +#if __FreeBSD_version < 502113 SYSCTL_ADD_STRING(&sc->ndis_ctx, SYSCTL_CHILDREN(sc->ndis_tree), +#else + SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), +#endif OID_AUTO, vals->nc_cfgkey, CTLFLAG_RW, vals->nc_val, sizeof(vals->nc_val), @@ -698,7 +705,12 @@ ndis_add_sysctl(arg, key, desc, val, flag) TAILQ_INSERT_TAIL(&sc->ndis_cfglist_head, cfg, link); +#if __FreeBSD_version < 502113 SYSCTL_ADD_STRING(&sc->ndis_ctx, SYSCTL_CHILDREN(sc->ndis_tree), +#else + SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)), +#endif OID_AUTO, cfg->ndis_cfg.nc_cfgkey, flag, cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val), cfg->ndis_cfg.nc_cfgdesc); diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c index 4d96d46..30def31 100644 --- a/sys/compat/ndis/subr_ndis.c +++ b/sys/compat/ndis/subr_ndis.c @@ -613,7 +613,11 @@ ndis_read_cfg(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 (my_strcasecmp(oidp->oid_name, keystr) == 0) { if (strcmp((char *)oidp->oid_arg1, "UNSET") == 0) { @@ -709,7 +713,11 @@ ndis_write_cfg(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 (my_strcasecmp(oidp->oid_name, keystr) == 0) { /* Found it, set the value. */ diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index caf25ef..d68d765 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -43,7 +43,9 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/socket.h> #include <sys/queue.h> +#if __FreeBSD_version < 502113 #include <sys/sysctl.h> +#endif #include <net/if.h> #include <net/if_arp.h> @@ -389,8 +391,10 @@ ndis_attach(dev) sc->ndis_regvals = ndis_regvals; +#if __FreeBSD_version < 502113 sysctl_ctx_init(&sc->ndis_ctx); +#endif /* Create sysctl registry nodes */ ndis_create_sysctls(sc); @@ -741,8 +745,10 @@ ndis_detach(dev) if (sc->ndis_iftype == PCIBus) bus_dma_tag_destroy(sc->ndis_parent_tag); +#if __FreeBSD_version < 502113 sysctl_ctx_free(&sc->ndis_ctx); +#endif mtx_destroy(&sc->ndis_mtx); mtx_destroy(&sc->ndis_intrmtx); diff --git a/sys/dev/if_ndis/if_ndisvar.h b/sys/dev/if_ndis/if_ndisvar.h index 2b2f47f..88a6361 100644 --- a/sys/dev/if_ndis/if_ndisvar.h +++ b/sys/dev/if_ndis/if_ndisvar.h @@ -113,8 +113,10 @@ struct ndis_softc { int ndis_if_flags; int ndis_skip; +#if __FreeBSD_version < 502113 struct sysctl_ctx_list ndis_ctx; struct sysctl_oid *ndis_tree; +#endif int ndis_devidx; interface_type ndis_iftype; |