View | Details | Raw Unified | Return to bug 231058 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/dev/atkbdc/psm.c (+33 lines)
Lines 4948-4953 psmsoftintr(void *arg) Link Here
4948
4948
4949
		case MOUSE_MODEL_SYNAPTICS:
4949
		case MOUSE_MODEL_SYNAPTICS:
4950
			if (pb->inputbytes == MOUSE_PS2_PACKETSIZE) {
4950
			if (pb->inputbytes == MOUSE_PS2_PACKETSIZE) {
4951
				static int trbutt;
4952
				int tpbutt;
4953
				static int otpbutt;
4951
				/* Don't rely on bit 3. It is garbled by mux */
4954
				/* Don't rely on bit 3. It is garbled by mux */
4952
				switch (pb->ipacket[0] & 0xc0) {
4955
				switch (pb->ipacket[0] & 0xc0) {
4953
				case 0x80:
4956
				case 0x80:
Lines 4960-4967 psmsoftintr(void *arg) Link Here
4960
					bcopy(pb->ipacket, pb->ipacket + 3, 3);
4963
					bcopy(pb->ipacket, pb->ipacket + 3, 3);
4961
					bcopy(sc->muxsave, pb->ipacket, 3);
4964
					bcopy(sc->muxsave, pb->ipacket, 3);
4962
					sc->muxsave[0] &= 0x03;
4965
					sc->muxsave[0] &= 0x03;
4966
					pb->ipacket[0] &= ~trbutt;
4967
					pb->ipacket[3] &= ~trbutt;
4968
					tpbutt = (pb->ipacket[3] & 0x03) << 2 |
4969
					    (pb->ipacket[0] & 0x03);
4970
					if (tpbutt != otpbutt &&
4971
					    sc->fpcount < 3) {
4972
						pb->ipacket[0] &= 0xfc;
4973
						pb->ipacket[0] |= otpbutt & 0x03;
4974
						pb->ipacket[3] &= 0xfc;
4975
						pb->ipacket[3] |= otpbutt >> 2 & 0x03;
4976
						++sc->fpcount;
4977
					} else {
4978
						sc->fpcount = 0;
4979
						otpbutt = tpbutt;
4980
					}
4981
					if (sc->synhw.capExtended &&
4982
					    !sc->synhw.capPassthrough &&
4983
					    (pb->ipacket[0] & 0x34) == 0x04 &&
4984
					    (pb->ipacket[3] & 0x04) == 0x04) {
4985
						pb->ipacket[0] &= 0xfb;
4986
						pb->ipacket[3] &= 0xfb;
4987
					}
4988
VLOG(3, (LOG_DEBUG, "buttons: [%02x],[%02x]\n", pb->ipacket[0], pb->ipacket[3]));
4963
					break;
4989
					break;
4964
				default:
4990
				default:
4991
					if (trbutt & 0x03 || pb->ipacket[0] & 0x03) {
4992
						trbutt = 0 /* ipacket[0] & 0x04 */;
4993
						pb->ipacket[0] &= 0xfb;
4994
					} else {
4995
						trbutt = 0;
4996
					}
4997
					trbutt |= pb->ipacket[0] & 0x07;
4965
					/* Convert generic -> pass-through */
4998
					/* Convert generic -> pass-through */
4966
					pb->ipacket[5] = pb->ipacket[2];
4999
					pb->ipacket[5] = pb->ipacket[2];
4967
					pb->ipacket[4] = pb->ipacket[1];
5000
					pb->ipacket[4] = pb->ipacket[1];

Return to bug 231058