Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpi_support/acpi_fujitsu.c
Show All 12 Lines | |||||
/* Determine what hardware functionality is available */ | /* Determine what hardware functionality is available */ | ||||
acpi_fujitsu_check_hardware(sc); | acpi_fujitsu_check_hardware(sc); | ||||
/* Build the sysctl tree */ | /* Build the sysctl tree */ | ||||
acpi_sc = acpi_device_get_parent_softc(sc->dev); | acpi_sc = acpi_device_get_parent_softc(sc->dev); | ||||
sysctl_ctx_init(&sc->sysctl_ctx); | sysctl_ctx_init(&sc->sysctl_ctx); | ||||
sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, | sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, | ||||
SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), | SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), | ||||
OID_AUTO, "fujitsu", CTLFLAG_RD, 0, ""); | OID_AUTO, "fujitsu", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); | ||||
for (i = 0; sysctl_table[i].name != NULL; i++) { | for (i = 0; sysctl_table[i].name != NULL; i++) { | ||||
switch(sysctl_table[i].method) { | switch(sysctl_table[i].method) { | ||||
case METHOD_GMOU: | case METHOD_GMOU: | ||||
exists = sc->gmou.exists; | exists = sc->gmou.exists; | ||||
break; | break; | ||||
case METHOD_GBLL: | case METHOD_GBLL: | ||||
exists = sc->gbll.exists; | exists = sc->gbll.exists; | ||||
Show All 16 Lines | |||||
exists = 1; | exists = 1; | ||||
break; | break; | ||||
} | } | ||||
if(!exists) | if(!exists) | ||||
continue; | continue; | ||||
SYSCTL_ADD_PROC(&sc->sysctl_ctx, | SYSCTL_ADD_PROC(&sc->sysctl_ctx, | ||||
SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, | SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, | ||||
sysctl_table[i].name, | sysctl_table[i].name, | ||||
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | | ||||
sc, i, acpi_fujitsu_sysctl, "I", | CTLFLAG_NEEDGIANT, sc, i, acpi_fujitsu_sysctl, "I", | ||||
sysctl_table[i].description); | sysctl_table[i].description); | ||||
} | } | ||||
/* Set the hotkeys to their initial states */ | /* Set the hotkeys to their initial states */ | ||||
if (!acpi_fujitsu_update(sc)) { | if (!acpi_fujitsu_update(sc)) { | ||||
device_printf(sc->dev, "Couldn't init hotkey states\n"); | device_printf(sc->dev, "Couldn't init hotkey states\n"); | ||||
return (FALSE); | return (FALSE); | ||||
Show All 12 Lines |