Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/nvme/nvme_da.c
Show First 20 Lines • Show All 602 Lines • ▼ Show 20 Lines | ndasysctlinit(void *context, int pending) | ||||
} | } | ||||
softc = (struct nda_softc *)periph->softc; | softc = (struct nda_softc *)periph->softc; | ||||
snprintf(tmpstr, sizeof(tmpstr), "CAM NDA unit %d", periph->unit_number); | snprintf(tmpstr, sizeof(tmpstr), "CAM NDA unit %d", periph->unit_number); | ||||
snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); | snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); | ||||
sysctl_ctx_init(&softc->sysctl_ctx); | sysctl_ctx_init(&softc->sysctl_ctx); | ||||
softc->flags |= NDA_FLAG_SCTX_INIT; | softc->flags |= NDA_FLAG_SCTX_INIT; | ||||
softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, | softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, | ||||
SYSCTL_STATIC_CHILDREN(_kern_cam_nda), OID_AUTO, tmpstr2, | SYSCTL_STATIC_CHILDREN(_kern_cam_nda), OID_AUTO, tmpstr2, | ||||
CTLFLAG_RD, 0, tmpstr); | CTLFLAG_RD, 0, tmpstr, "device_index"); | ||||
if (softc->sysctl_tree == NULL) { | if (softc->sysctl_tree == NULL) { | ||||
printf("ndasysctlinit: unable to allocate sysctl tree\n"); | printf("ndasysctlinit: unable to allocate sysctl tree\n"); | ||||
cam_periph_release(periph); | cam_periph_release(periph); | ||||
return; | return; | ||||
} | } | ||||
SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), | SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), | ||||
OID_AUTO, "unmapped_io", CTLFLAG_RD | CTLFLAG_MPSAFE, | OID_AUTO, "unmapped_io", CTLFLAG_RD | CTLFLAG_MPSAFE, | ||||
▲ Show 20 Lines • Show All 531 Lines • Show Last 20 Lines |