PS/2 mouse state machine

(1) Is there any documentation besides the code in the i8042prt sample DDK driver that describes the mouse state machine?

I’m about to look at the code in detail - my understanding so far is that 3 bytes get received for every interrupt.

(2) One thing I’m not sure of yet (since I haven’t looked at the code in detail) is if the state machine is only maintained in the device driver? Does it rely on any sentinels received in the mouse data to adjust the mouse state, or is the mouse data simply raw data? (For example, does the mouse send a byte indicating that it’s about to send x position data before it sends the x position data? Or does it assume that the driver knows that the following bytes are x position data based on it maintaining an internal state machine.)

thanks