Lines Matching defs:aed_sc
79 static struct aed_softc *aed_sc;
154 aed_sc = sc;
184 int rv = aed_sc->sc_open;
188 if (aed_sc->sc_options & AED_MSEMUL) {
194 event->u.m.buttons |= aed_sc->sc_buttons;
195 new_event.u.m.buttons |= aed_sc->sc_buttons;
227 if (aed_sc->sc_buttons & 0xfe) {
228 aed_sc->sc_buttons &= 1;
230 new_event.u.m.buttons = aed_sc->sc_buttons;
240 aed_sc->sc_buttons |= 1; /* left down */
242 new_event.u.m.buttons = aed_sc->sc_buttons;
249 aed_sc->sc_buttons &= ~1; /* left up */
251 new_event.u.m.buttons = aed_sc->sc_buttons;
262 aed_sc->sc_buttons |= 2; /* middle down */
264 new_event.u.m.buttons = aed_sc->sc_buttons;
274 aed_sc->sc_buttons &= ~2; /* middle up */
276 new_event.u.m.buttons = aed_sc->sc_buttons;
286 aed_sc->sc_buttons |= 4; /* right down */
288 new_event.u.m.buttons = aed_sc->sc_buttons;
298 aed_sc->sc_buttons &= ~4; /* right up */
300 new_event.u.m.buttons = aed_sc->sc_buttons;
407 if (aed_sc->sc_repeating != -1) {
408 callout_stop(&aed_sc->sc_repeat_ch);
410 aed_sc->sc_rptevent = *event;
411 aed_sc->sc_repeating = kbd_key;
412 callout_reset(&aed_sc->sc_repeat_ch, aed_sc->sc_rptdelay,
413 aed_kbdrpt, (void *)aed_sc);
415 if (aed_sc->sc_repeating != -1) {
416 aed_sc->sc_repeating = -1;
417 callout_stop(&aed_sc->sc_repeat_ch);
419 aed_sc->sc_rptevent = *event;
431 if (aed_sc->sc_open && !adb_polling)
446 if (aed_sc->sc_evq_tail < 0 || aed_sc->sc_evq_tail >= AED_MAX_EVENTS)
449 if (aed_sc->sc_evq_len < 0 || aed_sc->sc_evq_len > AED_MAX_EVENTS)
453 if (aed_sc->sc_evq_len == AED_MAX_EVENTS) {
457 aed_sc->sc_evq[(aed_sc->sc_evq_len + aed_sc->sc_evq_tail) %
459 aed_sc->sc_evq_len++;
461 selnotify(&aed_sc->sc_selinfo, 0, 0);
462 if (aed_sc->sc_ioproc)
463 psignal(aed_sc->sc_ioproc, SIGIO);
483 aed_sc->sc_evq_tail = 0;
484 aed_sc->sc_evq_len = 0;
485 aed_sc->sc_open = 1;
486 aed_sc->sc_ioproc = l->l_proc;
499 aed_sc->sc_open = 0;
500 aed_sc->sc_ioproc = NULL;
520 if (aed_sc->sc_evq_len == 0) {
525 total = (aed_sc->sc_evq_len < willfit) ? aed_sc->sc_evq_len : willfit;
527 firstmove = (aed_sc->sc_evq_tail + total > AED_MAX_EVENTS)
528 ? (AED_MAX_EVENTS - aed_sc->sc_evq_tail) : total;
530 error = uiomove((void *) & aed_sc->sc_evq[aed_sc->sc_evq_tail],
539 error = uiomove((void *) & aed_sc->sc_evq[0],
546 aed_sc->sc_evq_tail = (aed_sc->sc_evq_tail + total) % AED_MAX_EVENTS;
547 aed_sc->sc_evq_len -= total;
585 ri->delay_ticks = aed_sc->sc_rptdelay;
586 ri->interval_ticks = aed_sc->sc_rptinterval;
594 aed_sc->sc_rptdelay = ri->delay_ticks;
595 aed_sc->sc_rptinterval = ri->interval_ticks;
624 if (aed_sc->sc_evq_len > 0)
627 selrecord(l, &aed_sc->sc_selinfo);
639 selremove_knote(&aed_sc->sc_selinfo, kn);
647 kn->kn_data = aed_sc->sc_evq_len * sizeof(adb_event_t);
667 selrecord_knote(&aed_sc->sc_selinfo, kn);