Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/scsi/scsi_da.c
Show First 20 Lines • Show All 1,918 Lines • ▼ Show 20 Lines | dasysctlinit(void *context, int pending) | ||||
} | } | ||||
softc = (struct da_softc *)periph->softc; | softc = (struct da_softc *)periph->softc; | ||||
snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number); | snprintf(tmpstr, sizeof(tmpstr), "CAM DA 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 |= DA_FLAG_SCTX_INIT; | softc->flags |= DA_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_da), OID_AUTO, tmpstr2, | SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2, | ||||
CTLFLAG_RD, 0, tmpstr); | CTLFLAG_RD, 0, tmpstr, "device_index"); | ||||
if (softc->sysctl_tree == NULL) { | if (softc->sysctl_tree == NULL) { | ||||
printf("dasysctlinit: unable to allocate sysctl tree\n"); | printf("dasysctlinit: unable to allocate sysctl tree\n"); | ||||
cam_periph_release(periph); | cam_periph_release(periph); | ||||
return; | return; | ||||
} | } | ||||
/* | /* | ||||
* Now register the sysctl handler, so the user can change the value on | * Now register the sysctl handler, so the user can change the value on | ||||
▲ Show 20 Lines • Show All 3,987 Lines • Show Last 20 Lines |