diff options
author | bms <bms@FreeBSD.org> | 2004-11-11 15:31:38 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2004-11-11 15:31:38 +0000 |
commit | f53d94c2fb057ca05bf20d186815b600f0a08a29 (patch) | |
tree | 8538411b2d0be52a0334bea84ab6fe3f38dd8ee4 /sys/dev | |
parent | 7181853f808ec306a8463db30225f5830afb85ed (diff) | |
download | FreeBSD-src-f53d94c2fb057ca05bf20d186815b600f0a08a29.zip FreeBSD-src-f53d94c2fb057ca05bf20d186815b600f0a08a29.tar.gz |
Move per-instance sysctls under the per-device-instance tree.
Reviewed by: mux
Prodded by: rwatson
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/em/if_em.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index fb0c82f..389915b 100644 --- a/sys/dev/em/if_em.c +++ b/sys/dev/em/if_em.c @@ -310,26 +310,14 @@ em_attach(device_t dev) em_adapter_list = adapter; /* SYSCTL stuff */ - sysctl_ctx_init(&adapter->sysctl_ctx); - adapter->sysctl_tree = SYSCTL_ADD_NODE(&adapter->sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_hw), - OID_AUTO, - device_get_nameunit(dev), - CTLFLAG_RD, - 0, ""); - if (adapter->sysctl_tree == NULL) { - error = EIO; - goto err_sysctl; - } - - SYSCTL_ADD_PROC(&adapter->sysctl_ctx, - SYSCTL_CHILDREN(adapter->sysctl_tree), + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "debug_info", CTLTYPE_INT|CTLFLAG_RW, (void *)adapter, 0, em_sysctl_debug_info, "I", "Debug Information"); - SYSCTL_ADD_PROC(&adapter->sysctl_ctx, - SYSCTL_CHILDREN(adapter->sysctl_tree), + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "stats", CTLTYPE_INT|CTLFLAG_RW, (void *)adapter, 0, em_sysctl_stats, "I", "Statistics"); @@ -504,8 +492,6 @@ err_rx_desc: err_tx_desc: err_pci: em_free_pci_resources(adapter); - sysctl_ctx_free(&adapter->sysctl_ctx); -err_sysctl: return(error); } @@ -553,9 +539,6 @@ em_detach(device_t dev) adapter->rx_desc_base = NULL; } - /* Free the sysctl tree */ - sysctl_ctx_free(&adapter->sysctl_ctx); - /* Remove from the adapter list */ if (em_adapter_list == adapter) em_adapter_list = adapter->next; @@ -3391,8 +3374,8 @@ em_add_int_delay_sysctl(struct adapter *adapter, const char *name, info->adapter = adapter; info->offset = offset; info->value = value; - SYSCTL_ADD_PROC(&adapter->sysctl_ctx, - SYSCTL_CHILDREN(adapter->sysctl_tree), + SYSCTL_ADD_PROC(device_get_sysctl_ctx(adapter->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), OID_AUTO, name, CTLTYPE_INT|CTLFLAG_RW, info, 0, em_sysctl_int_delay, "I", description); } |