Example #1
0
void
btkbd_set_leds(void *self, int leds)
{
    struct btkbd_softc *sc = (struct btkbd_softc *)self;
    struct hidkbd *kbd = &sc->sc_kbd;
    uint8_t report;

    if (hidkbd_set_leds(kbd, leds, &report) != 0) {
        if (sc->sc_output != NULL)
            (*sc->sc_output)(&sc->sc_hidev, &report,
                             sizeof(report), sc->sc_inintr);
    }
}
Example #2
0
void
ukbd_set_leds(void *v, int leds)
{
	struct ukbd_softc *sc = v;
	struct hidkbd *kbd = &sc->sc_kbd;
	u_int8_t res;

	if (usbd_is_dying(sc->sc_hdev.sc_udev))
		return;

	if (sc->sc_ledsize && hidkbd_set_leds(kbd, leds, &res) != 0)
		uhidev_set_report_async(&sc->sc_hdev, UHID_OUTPUT_REPORT,
		    &res, 1);
}