get mxge to build, stage 8/many
authorAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Sat, 4 Jul 2009 12:51:40 +0000 (15:51 +0300)
committerAggelos Economopoulos <aoiko@cc.ece.ntua.gr>
Wed, 8 Jul 2009 20:27:17 +0000 (23:27 +0300)
- convert sysctls

sys/dev/netif/mxge/if_mxge.c
sys/dev/netif/mxge/if_mxge_var.h

index 9acaa5d..bd32e50 100644 (file)
@@ -1449,8 +1449,18 @@ mxge_add_sysctls(mxge_softc_t *sc)
        int slice;
        char slice_num[8];
 
-       ctx = device_get_sysctl_ctx(sc->dev);
-       children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev));
+       ctx = &sc->sysctl_ctx;
+       sysctl_ctx_init(ctx);
+       sc->sysctl_tree = SYSCTL_ADD_NODE(ctx, SYSCTL_STATIC_CHILDREN(_hw),
+                                         OID_AUTO,
+                                         device_get_nameunit(sc->dev),
+                                         CTLFLAG_RD, 0, "");
+       if (sc->sysctl_tree == NULL) {
+               device_printf(sc->dev, "can't add sysctl node\n");
+               return;
+       }
+
+       children = SYSCTL_CHILDREN(sc->sysctl_tree);
        fw = sc->ss[0].fw_stats;
 
        /* random information */
@@ -1610,7 +1620,7 @@ mxge_add_sysctls(mxge_softc_t *sc)
                sysctl_ctx_init(&ss->sysctl_ctx);
                ctx = &ss->sysctl_ctx;
                children = SYSCTL_CHILDREN(sc->slice_sysctl_tree);
-               sprintf(slice_num, "%d", slice);
+               ksprintf(slice_num, "%d", slice);
                ss->sysctl_tree = 
                        SYSCTL_ADD_NODE(ctx, children, OID_AUTO, slice_num,
                                        CTLFLAG_RD, 0, "");
index a58caff..18ffbe0 100644 (file)
@@ -269,6 +269,8 @@ struct mxge_softc {
        int dying;
        mxge_dma_t dmabench_dma;
        struct callout co_hdl;
+       struct sysctl_ctx_list sysctl_ctx;
+       struct sysctl_oid *sysctl_tree;
        struct sysctl_oid *slice_sysctl_tree;
        struct sysctl_ctx_list slice_sysctl_ctx;
        char *mac_addr_string;