Lines Matching refs:STATEP

139 	if (STATEP->init_tid != 0)  in vuid_set_timeout()
140 (void) quntimeout(qp, STATEP->init_tid); in vuid_set_timeout()
141 STATEP->init_tid = qtimeout(qp, VUID_INIT_TIMEOUT, in vuid_set_timeout()
148 (void) quntimeout(qp, STATEP->init_tid); in vuid_cancel_timeout()
149 STATEP->init_tid = 0; in vuid_cancel_timeout()
192 for (b = 0; b < STATEP->nbuttons; b++) { in sendButtonEvent()
195 if ((STATEP->buttons & mask) != (STATEP->oldbuttons & mask)) in sendButtonEvent()
197 (STATEP->buttons & mask ? 1 : 0)); in sendButtonEvent()
227 if (STATEP->inited & PS2_FLAG_NO_EXTN) { in vuidmice_start_wdc_or_setres()
228 STATEP->state = PS2_WAIT_SETRES3_ACK1; in vuidmice_start_wdc_or_setres()
231 STATEP->state = PS2_WAIT_WHEEL_SMPL1_CMD_ACK; in vuidmice_start_wdc_or_setres()
239 STATEP->format = VUID_FIRM_EVENT; in VUID_OPEN()
240 STATEP->vuid_mouse_mode = MOUSE_MODE_PLAIN; in VUID_OPEN()
241 STATEP->inited = 0; in VUID_OPEN()
242 STATEP->nbuttons = 3; in VUID_OPEN()
244 STATEP->state = PS2_WAIT_RESET_COMPLETE; in VUID_OPEN()
248 while ((STATEP->state != PS2_START) && in VUID_OPEN()
249 !(STATEP->inited & PS2_FLAG_INIT_TIMEOUT)) { in VUID_OPEN()
258 STATEP->init_count = 0; in VUID_OPEN()
266 if (STATEP->init_tid != 0) in VUID_CLOSE()
275 STATEP->init_tid = 0; in VUID_INIT_TIMEOUT()
284 if ((STATEP->state == PS2_WAIT_WHEEL_SMPL1_CMD_ACK) || in VUID_INIT_TIMEOUT()
285 (STATEP->state == PS2_WAIT_WHEEL_SMPL1_RATE_ACK) || in VUID_INIT_TIMEOUT()
286 (STATEP->state == PS2_WAIT_WHEEL_SMPL2_RATE_ACK) || in VUID_INIT_TIMEOUT()
287 (STATEP->state == PS2_WAIT_WHEEL_SMPL3_RATE_ACK)) { in VUID_INIT_TIMEOUT()
293 STATEP->inited |= PS2_FLAG_NO_EXTN; in VUID_INIT_TIMEOUT()
303 if (STATEP->state >= PS2_WAIT_STATREQ_ACK && in VUID_INIT_TIMEOUT()
304 STATEP->state <= PS2_WAIT_STATUS_REV) { in VUID_INIT_TIMEOUT()
308 STATEP->nbuttons = 3; in VUID_INIT_TIMEOUT()
310 STATEP->nbuttons = 2; in VUID_INIT_TIMEOUT()
323 if (++STATEP->init_count >= PS2_MAX_INIT_COUNT) { in VUID_INIT_TIMEOUT()
324 STATEP->inited |= PS2_FLAG_INIT_TIMEOUT; in VUID_INIT_TIMEOUT()
325 STATEP->state = PS2_WAIT_FOR_AA; in VUID_INIT_TIMEOUT()
328 STATEP->state = PS2_WAIT_RESET_COMPLETE; in VUID_INIT_TIMEOUT()
345 elapsed = now - STATEP->last_event_lbolt; in VUID_QUEUE()
346 STATEP->last_event_lbolt = now; in VUID_QUEUE()
352 switch (STATEP->state) { in VUID_QUEUE()
391 if (!(STATEP->inited & PS2_FLAG_INIT_DONE)) { in VUID_QUEUE()
392 STATEP->sync_byte = code & 0x8; in VUID_QUEUE()
393 STATEP->inited |= PS2_FLAG_INIT_DONE; in VUID_QUEUE()
404 if ((code ^ STATEP->sync_byte) & 0x08) { in VUID_QUEUE()
406 STATEP->state = PS2_START; in VUID_QUEUE()
411 STATEP->buttons = code & PS2_BUTTONMASK; in VUID_QUEUE()
412 if (STATEP->buttons != STATEP->oldbuttons) { in VUID_QUEUE()
414 STATEP->oldbuttons = STATEP->buttons; in VUID_QUEUE()
419 STATEP->deltay = -1 & ~0xff; in VUID_QUEUE()
421 STATEP->deltay = 0; in VUID_QUEUE()
425 STATEP->deltax = -1 & ~0xff; in VUID_QUEUE()
427 STATEP->deltax = 0; in VUID_QUEUE()
430 STATEP->state = PS2_MAYBE_REATTACH; in VUID_QUEUE()
432 STATEP->state = PS2_BUTTON; in VUID_QUEUE()
443 STATEP->inited &= ~PS2_FLAG_INIT_TIMEOUT; in VUID_QUEUE()
444 STATEP->init_count = 0; in VUID_QUEUE()
445 STATEP->state = PS2_WAIT_RESET_COMPLETE; in VUID_QUEUE()
453 STATEP->state = PS2_WAIT_FOR_00; in VUID_QUEUE()
460 STATEP->inited &= ~PS2_FLAG_INIT_TIMEOUT; in VUID_QUEUE()
461 STATEP->init_count = 0; in VUID_QUEUE()
462 STATEP->state = PS2_WAIT_RESET_COMPLETE; in VUID_QUEUE()
468 STATEP->state = PS2_WAIT_RESET_COMPLETE; in VUID_QUEUE()
485 STATEP->deltax |= code & 0xff; in VUID_QUEUE()
486 STATEP->state = PS2_DELTA_Y; in VUID_QUEUE()
499 STATEP->deltay |= code & 0xff; in VUID_QUEUE()
501 if (STATEP->vuid_mouse_mode == MOUSE_MODE_WHEEL) { in VUID_QUEUE()
502 STATEP->state = PS2_WHEEL_DELTA_Z; in VUID_QUEUE()
504 } else if (STATEP->vuid_mouse_mode == in VUID_QUEUE()
506 STATEP->state = PS2_WHEEL5_DELTA_Z; in VUID_QUEUE()
534 if (STATEP->wheel_state_bf & (1 << in VUID_QUEUE()
563 if (STATEP->wheel_state_bf & in VUID_QUEUE()
582 STATEP->state = PS2_START; in VUID_QUEUE()
589 ((mp->b_rptr[0] ^ STATEP->sync_byte) & 0x08)) { in VUID_QUEUE()
603 if (STATEP->deltax) in VUID_QUEUE()
606 STATEP->deltax); in VUID_QUEUE()
608 if (STATEP->deltay) in VUID_QUEUE()
611 STATEP->deltay); in VUID_QUEUE()
613 STATEP->deltax = STATEP->deltay = 0; in VUID_QUEUE()
637 if (++STATEP->init_count >= in VUID_QUEUE()
639 STATEP->inited |= PS2_FLAG_INIT_TIMEOUT; in VUID_QUEUE()
640 STATEP->state = PS2_WAIT_FOR_AA; in VUID_QUEUE()
663 STATEP->state = PS2_WAIT_SETRES0_ACK1; in VUID_QUEUE()
676 STATEP->state = PS2_WAIT_SETRES0_ACK2; in VUID_QUEUE()
686 STATEP->state++; in VUID_QUEUE()
698 STATEP->state = PS2_WAIT_STATREQ_ACK; in VUID_QUEUE()
711 STATEP->state = PS2_WAIT_STATUS_1; in VUID_QUEUE()
715 STATEP->state = PS2_WAIT_STATUS_BUTTONS; in VUID_QUEUE()
720 STATEP->nbuttons = (uchar_t)code; in VUID_QUEUE()
721 STATEP->state = (uchar_t)PS2_WAIT_STATUS_REV; in VUID_QUEUE()
745 STATEP->nbuttons = 3; in VUID_QUEUE()
747 STATEP->nbuttons = 2; in VUID_QUEUE()
749 STATEP->state = PS2_WAIT_STATUS_3; in VUID_QUEUE()
768 STATEP->state = PS2_WAIT_WHEEL_SMPL1_RATE_ACK; in VUID_QUEUE()
775 STATEP->state = PS2_WAIT_WHEEL_SMPL2_CMD_ACK; in VUID_QUEUE()
783 STATEP->state = PS2_WAIT_WHEEL_SMPL2_RATE_ACK; in VUID_QUEUE()
791 STATEP->state = PS2_WAIT_WHEEL_SMPL3_CMD_ACK; in VUID_QUEUE()
799 STATEP->state = PS2_WAIT_WHEEL_SMPL3_RATE_ACK; in VUID_QUEUE()
811 STATEP->state = PS2_WAIT_WHEEL_DEV_CMD; in VUID_QUEUE()
823 STATEP->state = PS2_WAIT_WHEEL_DEV_ACK; in VUID_QUEUE()
832 STATEP->state = PS2_WAIT_SETRES3_ACK1; in VUID_QUEUE()
842 STATEP->vuid_mouse_mode = MOUSE_MODE_WHEEL; in VUID_QUEUE()
847 STATEP->wheel_state_bf |= VUID_WHEEL_STATE_ENABLED; in VUID_QUEUE()
849 STATEP->state = PS2_WAIT_WHEEL5_SMPL1_CMD_ACK; in VUID_QUEUE()
863 STATEP->state = PS2_WAIT_WHEEL5_SMPL1_RATE_ACK; in VUID_QUEUE()
871 STATEP->state = PS2_WAIT_WHEEL5_SMPL2_CMD_ACK; in VUID_QUEUE()
879 STATEP->state = PS2_WAIT_WHEEL5_SMPL2_RATE_ACK; in VUID_QUEUE()
887 STATEP->state = PS2_WAIT_WHEEL5_SMPL3_CMD_ACK; in VUID_QUEUE()
895 STATEP->state = PS2_WAIT_WHEEL5_SMPL3_RATE_ACK; in VUID_QUEUE()
907 STATEP->state = PS2_WAIT_WHEEL5_DEV_CMD; in VUID_QUEUE()
920 STATEP->state = PS2_WAIT_WHEEL5_DEV_ACK; in VUID_QUEUE()
925 STATEP->vuid_mouse_mode = MOUSE_MODE_WHEEL5; in VUID_QUEUE()
926 STATEP->nbuttons = 5; in VUID_QUEUE()
931 STATEP->wheel_state_bf |= in VUID_QUEUE()
942 STATEP->state = PS2_WAIT_SETRES3_ACK1; in VUID_QUEUE()
955 STATEP->state = PS2_WAIT_SETRES3_ACK2; in VUID_QUEUE()
967 STATEP->state = PS2_WAIT_STREAM_ACK; in VUID_QUEUE()
980 STATEP->state = PS2_WAIT_ON_ACK; in VUID_QUEUE()
996 STATEP->init_count = 0; in VUID_QUEUE()
1000 STATEP->state = PS2_START; in VUID_QUEUE()