Lines Matching defs:aed_sc
70 static struct aed_softc *aed_sc = NULL;
144 aed_sc = sc;
164 if (aed_sc->sc_options & AED_MSEMUL) {
170 event->u.m.buttons |= aed_sc->sc_buttons;
171 new_event.u.m.buttons |= aed_sc->sc_buttons;
201 if (aed_sc->sc_buttons & 0xfe) {
202 aed_sc->sc_buttons &= 1;
204 new_event.u.m.buttons = aed_sc->sc_buttons;
214 aed_sc->sc_buttons |= 1; /* left down */
216 new_event.u.m.buttons = aed_sc->sc_buttons;
223 aed_sc->sc_buttons &= ~1; /* left up */
225 new_event.u.m.buttons = aed_sc->sc_buttons;
236 aed_sc->sc_buttons |= 2; /* middle down */
238 new_event.u.m.buttons = aed_sc->sc_buttons;
248 aed_sc->sc_buttons &= ~2; /* middle up */
250 new_event.u.m.buttons = aed_sc->sc_buttons;
260 aed_sc->sc_buttons |= 4; /* right down */
262 new_event.u.m.buttons = aed_sc->sc_buttons;
272 aed_sc->sc_buttons &= ~4; /* right up */
274 new_event.u.m.buttons = aed_sc->sc_buttons;
366 if (aed_sc->sc_repeating != -1) {
367 callout_stop(&aed_sc->sc_repeat_ch);
369 aed_sc->sc_rptevent = *event;
370 aed_sc->sc_repeating = kbd_key;
371 callout_reset(&aed_sc->sc_repeat_ch, aed_sc->sc_rptdelay,
372 aed_kbdrpt, (void *)aed_sc);
374 if (aed_sc->sc_repeating != -1) {
375 aed_sc->sc_repeating = -1;
376 callout_stop(&aed_sc->sc_repeat_ch);
378 aed_sc->sc_rptevent = *event;
390 if (aed_sc->sc_open && !adb_polling)
405 if (aed_sc->sc_evq_tail < 0 || aed_sc->sc_evq_tail >= AED_MAX_EVENTS)
408 if (aed_sc->sc_evq_len < 0 || aed_sc->sc_evq_len > AED_MAX_EVENTS)
412 if (aed_sc->sc_evq_len == AED_MAX_EVENTS) {
416 aed_sc->sc_evq[(aed_sc->sc_evq_len + aed_sc->sc_evq_tail) %
418 aed_sc->sc_evq_len++;
420 selnotify(&aed_sc->sc_selinfo, 0, 0);
421 if (aed_sc->sc_ioproc)
422 psignal(aed_sc->sc_ioproc, SIGIO);
440 if (aed_sc->sc_open) {
444 aed_sc->sc_evq_tail = 0;
445 aed_sc->sc_evq_len = 0;
446 aed_sc->sc_open = 1;
447 aed_sc->sc_ioproc = l->l_proc;
458 aed_sc->sc_open = 0;
459 aed_sc->sc_ioproc = NULL;
478 if (aed_sc->sc_evq_len == 0) {
483 total = (aed_sc->sc_evq_len < willfit) ? aed_sc->sc_evq_len : willfit;
485 firstmove = (aed_sc->sc_evq_tail + total > AED_MAX_EVENTS)
486 ? (AED_MAX_EVENTS - aed_sc->sc_evq_tail) : total;
488 error = uiomove((void *) & aed_sc->sc_evq[aed_sc->sc_evq_tail],
497 error = uiomove((void *) & aed_sc->sc_evq[0],
504 aed_sc->sc_evq_tail = (aed_sc->sc_evq_tail + total) % AED_MAX_EVENTS;
505 aed_sc->sc_evq_len -= total;
543 ri->delay_ticks = aed_sc->sc_rptdelay;
544 ri->interval_ticks = aed_sc->sc_rptinterval;
552 aed_sc->sc_rptdelay = ri->delay_ticks;
553 aed_sc->sc_rptinterval = ri->interval_ticks;
584 if (aed_sc->sc_evq_len > 0)
587 selrecord(l, &aed_sc->sc_selinfo);
599 selremove_knote(&aed_sc->sc_selinfo, kn);
607 kn->kn_data = aed_sc->sc_evq_len * sizeof(adb_event_t);
627 selrecord_knote(&aed_sc->sc_selinfo, kn);