A modern PS/2 mouse typically has a default mode ("2 button, no scrollwheel") that uses an older (3 bytes per packet) protocol; then one or more better modes ("5 button, with scrollwheel") that uses a different (4 bytes per packet) protocol. To switch modes there's a sequence of existing commands (and not a simple "change modes" command).
Specifically, to change from the default mode to "Intellimouse Extensions" mode (3 buttons with scrollwheel, 4 byte packet):
- Set sample rate 200
- Set sample rate 100
- Set sample rate 80
And to change to "5 button mode" (up to 5 buttons with scrollwheel, 4 byte packet):
- Set sample rate 200
- Set sample rate 200
- Set sample rate 80
For more (better) information, see: http://www.isdaman.com/alsos/hardware/mouse/ps2interface.htm
Note that you should never poll. Specifically, unless you are using IRQs (e.g. ISA IRQ1 for first PS/2 port, ISA IRQ 12 for 2nd PS/2 port) it's impossible to reliably (without race conditions) determine which PS/2 port a byte came from.
More specifically, the PS/2 controller driver should use IRQs, and should send bytes received on "1st PS/2 port" to whichever driver is being used for whichever device happens to be plugged into the 1st PS/2 port (keyboard, mouse, bar-code scanner, touchpad, ...); and send bytes received on "2st PS/2 port" to whichever driver is being used for whichever device happens to be plugged into the 2st PS/2 port. The mouse driver itself would receive the data (e.g. from a pipe or message or callback or who-knows-what) and add the byte to a (3 or 4 byte) packet buffer (while checking the "always 0" bit to ensure that it remains in sync with the device, and while handling special codes like "ACK" and "RESEND").