Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/evdev/evdev.c
Show All 12 Lines | |||||
EV_REPORT_MT_SLOT, /* Event value and MT slot number changed */ | EV_REPORT_MT_SLOT, /* Event value and MT slot number changed */ | ||||
}; | }; | ||||
MALLOC_DEFINE(M_EVDEV, "evdev", "evdev memory"); | MALLOC_DEFINE(M_EVDEV, "evdev", "evdev memory"); | ||||
int evdev_rcpt_mask = EVDEV_RCPT_SYSMOUSE | EVDEV_RCPT_KBDMUX; | int evdev_rcpt_mask = EVDEV_RCPT_SYSMOUSE | EVDEV_RCPT_KBDMUX; | ||||
int evdev_sysmouse_t_axis = 0; | int evdev_sysmouse_t_axis = 0; | ||||
SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW, 0, "Evdev args"); | SYSCTL_NODE(_kern, OID_AUTO, evdev, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, | ||||
"Evdev args"); | |||||
#ifdef EVDEV_SUPPORT | #ifdef EVDEV_SUPPORT | ||||
SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RW, &evdev_rcpt_mask, 0, | SYSCTL_INT(_kern_evdev, OID_AUTO, rcpt_mask, CTLFLAG_RW, &evdev_rcpt_mask, 0, | ||||
"Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " | "Who is receiving events: bit0 - sysmouse, bit1 - kbdmux, " | ||||
"bit2 - mouse hardware, bit3 - keyboard hardware"); | "bit2 - mouse hardware, bit3 - keyboard hardware"); | ||||
SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, | SYSCTL_INT(_kern_evdev, OID_AUTO, sysmouse_t_axis, CTLFLAG_RW, | ||||
&evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); | &evdev_sysmouse_t_axis, 0, "Extract T-axis from 0-none, 1-ums, 2-psm"); | ||||
#endif | #endif | ||||
SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD, 0, | SYSCTL_NODE(_kern_evdev, OID_AUTO, input, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | ||||
"Evdev input devices"); | "Evdev input devices"); | ||||
static void evdev_start_repeat(struct evdev_dev *, uint16_t); | static void evdev_start_repeat(struct evdev_dev *, uint16_t); | ||||
static void evdev_stop_repeat(struct evdev_dev *); | static void evdev_stop_repeat(struct evdev_dev *); | ||||
static int evdev_check_event(struct evdev_dev *, uint16_t, uint16_t, int32_t); | static int evdev_check_event(struct evdev_dev *, uint16_t, uint16_t, int32_t); | ||||
static inline void | static inline void | ||||
bit_change(bitstr_t *bitstr, int bit, int value) | bit_change(bitstr_t *bitstr, int bit, int value) | ||||
Show All 24 Lines | |||||
struct sysctl_oid *ev_sysctl_tree; | struct sysctl_oid *ev_sysctl_tree; | ||||
char ev_unit_str[8]; | char ev_unit_str[8]; | ||||
snprintf(ev_unit_str, sizeof(ev_unit_str), "%d", evdev->ev_unit); | snprintf(ev_unit_str, sizeof(ev_unit_str), "%d", evdev->ev_unit); | ||||
sysctl_ctx_init(&evdev->ev_sysctl_ctx); | sysctl_ctx_init(&evdev->ev_sysctl_ctx); | ||||
ev_sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&evdev->ev_sysctl_ctx, | ev_sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&evdev->ev_sysctl_ctx, | ||||
SYSCTL_STATIC_CHILDREN(_kern_evdev_input), OID_AUTO, | SYSCTL_STATIC_CHILDREN(_kern_evdev_input), OID_AUTO, | ||||
ev_unit_str, CTLFLAG_RD, NULL, "", "device index"); | ev_unit_str, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "", | ||||
"device index"); | |||||
SYSCTL_ADD_STRING(&evdev->ev_sysctl_ctx, | SYSCTL_ADD_STRING(&evdev->ev_sysctl_ctx, | ||||
SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "name", CTLFLAG_RD, | SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "name", CTLFLAG_RD, | ||||
evdev->ev_name, 0, | evdev->ev_name, 0, | ||||
"Input device name"); | "Input device name"); | ||||
SYSCTL_ADD_STRUCT(&evdev->ev_sysctl_ctx, | SYSCTL_ADD_STRUCT(&evdev->ev_sysctl_ctx, | ||||
SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "id", CTLFLAG_RD, | SYSCTL_CHILDREN(ev_sysctl_tree), OID_AUTO, "id", CTLFLAG_RD, | ||||
Show All 12 Lines |