Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/input/ukbd.c
Show First 20 Lines • Show All 839 Lines • ▼ Show 20 Lines | if (sc->sc_flags & UKBD_FLAG_CAPSLOCK) { | ||||
id = sc->sc_id_capslock; | id = sc->sc_id_capslock; | ||||
any = 1; | any = 1; | ||||
} | } | ||||
/* if no leds, nothing to do */ | /* if no leds, nothing to do */ | ||||
if (!any) | if (!any) | ||||
break; | break; | ||||
#ifdef EVDEV_SUPPORT | |||||
if (sc->sc_evdev != NULL) | |||||
evdev_push_leds(sc->sc_evdev, sc->sc_leds); | |||||
#endif | |||||
/* range check output report length */ | /* range check output report length */ | ||||
len = sc->sc_led_size; | len = sc->sc_led_size; | ||||
if (len > (UKBD_BUFFER_SIZE - 1)) | if (len > (UKBD_BUFFER_SIZE - 1)) | ||||
len = (UKBD_BUFFER_SIZE - 1); | len = (UKBD_BUFFER_SIZE - 1); | ||||
/* check if we need to prefix an ID byte */ | /* check if we need to prefix an ID byte */ | ||||
sc->sc_buffer[0] = id; | sc->sc_buffer[0] = id; | ||||
▲ Show 20 Lines • Show All 1,106 Lines • ▼ Show 20 Lines | |||||
/* local functions */ | /* local functions */ | ||||
static void | static void | ||||
ukbd_set_leds(struct ukbd_softc *sc, uint8_t leds) | ukbd_set_leds(struct ukbd_softc *sc, uint8_t leds) | ||||
{ | { | ||||
UKBD_LOCK_ASSERT(); | UKBD_LOCK_ASSERT(); | ||||
DPRINTF("leds=0x%02x\n", leds); | DPRINTF("leds=0x%02x\n", leds); | ||||
#ifdef EVDEV_SUPPORT | |||||
if (sc->sc_evdev != NULL) | |||||
evdev_push_leds(sc->sc_evdev, leds); | |||||
#endif | |||||
sc->sc_leds = leds; | sc->sc_leds = leds; | ||||
sc->sc_flags |= UKBD_FLAG_SET_LEDS; | sc->sc_flags |= UKBD_FLAG_SET_LEDS; | ||||
/* start transfer, if not already started */ | /* start transfer, if not already started */ | ||||
usbd_transfer_start(sc->sc_xfer[UKBD_CTRL_LED]); | usbd_transfer_start(sc->sc_xfer[UKBD_CTRL_LED]); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |