As MichaelPetch correctly states, you should only be reading one (1) byte per interrupt. The controller will trigger an interrupt when it has a single byte ready for reading.
Your code must keep track of which byte within the packet is currently being read and update the packet accordingly.
For example, if you have a three byte packet, you start with a PACKET_INDEX of zero. Also, you should have a local (to your interrupt) buffer holding the data, and only sending a fully updated packet to your mouse driver after the last byte has been received.
1) Interrupt Fired
2) Read Byte
3a) if PACKET_INDEX == 0, update button status in local buffer (see note below)
3b) if PACKET_INDEX == 1, update X coord in local buffer
3c) if PACKET_INDEX == 2, update Y coord in local buffer
4) Increment PACKET_INDEX
5) if PACKET_INDEX == 3, send contents of local packet to mouse driver packet, and set PACKET_INDEX to zero
6) exit interrupt
Note: The first byte of the packet sent from the mouse will have a bit indicating that it is the first byte of the packet. You will need to watch for this bit.
Ben
-
http://www.fysnet.net/input_and_output_devices.htm