Lines Matching defs:aed_sc

79 static struct aed_softc *aed_sc;
154 aed_sc = sc;
180 int rv = aed_sc->sc_open;
184 if (aed_sc->sc_options & AED_MSEMUL) {
190 event->u.m.buttons |= aed_sc->sc_buttons;
191 new_event.u.m.buttons |= aed_sc->sc_buttons;
223 if (aed_sc->sc_buttons & 0xfe) {
224 aed_sc->sc_buttons &= 1;
226 new_event.u.m.buttons = aed_sc->sc_buttons;
236 aed_sc->sc_buttons |= 1; /* left down */
238 new_event.u.m.buttons = aed_sc->sc_buttons;
245 aed_sc->sc_buttons &= ~1; /* left up */
247 new_event.u.m.buttons = aed_sc->sc_buttons;
258 aed_sc->sc_buttons |= 2; /* middle down */
260 new_event.u.m.buttons = aed_sc->sc_buttons;
270 aed_sc->sc_buttons &= ~2; /* middle up */
272 new_event.u.m.buttons = aed_sc->sc_buttons;
282 aed_sc->sc_buttons |= 4; /* right down */
284 new_event.u.m.buttons = aed_sc->sc_buttons;
294 aed_sc->sc_buttons &= ~4; /* right up */
296 new_event.u.m.buttons = aed_sc->sc_buttons;
403 if (aed_sc->sc_repeating != -1) {
404 callout_stop(&aed_sc->sc_repeat_ch);
406 aed_sc->sc_rptevent = *event;
407 aed_sc->sc_repeating = kbd_key;
408 callout_reset(&aed_sc->sc_repeat_ch, aed_sc->sc_rptdelay,
409 aed_kbdrpt, (void *)aed_sc);
411 if (aed_sc->sc_repeating != -1) {
412 aed_sc->sc_repeating = -1;
413 callout_stop(&aed_sc->sc_repeat_ch);
415 aed_sc->sc_rptevent = *event;
427 if (aed_sc->sc_open && !adb_polling)
442 if (aed_sc->sc_evq_tail < 0 || aed_sc->sc_evq_tail >= AED_MAX_EVENTS)
445 if (aed_sc->sc_evq_len < 0 || aed_sc->sc_evq_len > AED_MAX_EVENTS)
449 if (aed_sc->sc_evq_len == AED_MAX_EVENTS) {
453 aed_sc->sc_evq[(aed_sc->sc_evq_len + aed_sc->sc_evq_tail) %
455 aed_sc->sc_evq_len++;
457 selnotify(&aed_sc->sc_selinfo, 0, 0);
458 if (aed_sc->sc_ioproc)
459 psignal(aed_sc->sc_ioproc, SIGIO);
479 aed_sc->sc_evq_tail = 0;
480 aed_sc->sc_evq_len = 0;
481 aed_sc->sc_open = 1;
482 aed_sc->sc_ioproc = l->l_proc;
495 aed_sc->sc_open = 0;
496 aed_sc->sc_ioproc = NULL;
516 if (aed_sc->sc_evq_len == 0) {
521 total = (aed_sc->sc_evq_len < willfit) ? aed_sc->sc_evq_len : willfit;
523 firstmove = (aed_sc->sc_evq_tail + total > AED_MAX_EVENTS)
524 ? (AED_MAX_EVENTS - aed_sc->sc_evq_tail) : total;
526 error = uiomove((void *) & aed_sc->sc_evq[aed_sc->sc_evq_tail],
535 error = uiomove((void *) & aed_sc->sc_evq[0],
542 aed_sc->sc_evq_tail = (aed_sc->sc_evq_tail + total) % AED_MAX_EVENTS;
543 aed_sc->sc_evq_len -= total;
581 ri->delay_ticks = aed_sc->sc_rptdelay;
582 ri->interval_ticks = aed_sc->sc_rptinterval;
590 aed_sc->sc_rptdelay = ri->delay_ticks;
591 aed_sc->sc_rptinterval = ri->interval_ticks;
620 if (aed_sc->sc_evq_len > 0)
623 selrecord(l, &aed_sc->sc_selinfo);
635 selremove_knote(&aed_sc->sc_selinfo, kn);
643 kn->kn_data = aed_sc->sc_evq_len * sizeof(adb_event_t);
663 selrecord_knote(&aed_sc->sc_selinfo, kn);