All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC/RFT] PS/2 mouse resync for KVM users
Date: Wed, 23 Jun 2004 09:39:30 +0200	[thread overview]
Message-ID: <20040623073930.GB1101@ucw.cz> (raw)
In-Reply-To: <200406230140.45383.dtor_core@ameritech.net>

Hi!

I really like this approach, and it's something I wanted to implement,
but never found the time to do it.

Another heuristic I planned to implement would be interbyte timing - not
just timeouts, but qualify the validity of a packet both on how close
its bytes arrived together and whether it's separated from other
packets by some time. We could even keep an estimate on both the
interbyte and interpacket timing and classify each byte as based on the
probability of a packet boundary. It might be a little overkill, though. 




> +	if (psmouse->pktcnt == 1) {
> +/*
> + * If go by the letter of PS/2 protcol 4th bit in 1st byte should always be set.
> + */
> +		if (psmouse_strict && !(packet[0] & 0x08))
> +			return PSMOUSE_BAD_DATA;

This bit actually says 'internal/external', and can be used to
differentiate between data from an internal trackpoint and an external
mouse on older notebooks.

All newer devices have it at '1'.

> +/*
> + * Overflows should happen rarely.
> + */
> +		if (packet[0] & 0xc0)
> +			return PSMOUSE_SUSPECT_DATA;

Very rarely indeed. It should be next to impossible to generate an
overflow at a reasonable report rate (> 80 reports/sec). For higher
resolutions (> 400 dpi) it might be reasonable to up the report rate
accordingly.

> +/*
> + * Having left or right button together with middle is somewhat unusual.
> + */
> +		if ((packet[0] & 0x07) > 4)
> +			return PSMOUSE_SUSPECT_DATA;
> +	}
> +
>  	if (psmouse->pktcnt < 3 + (psmouse->type >= PSMOUSE_GENPS))
>  		return PSMOUSE_GOOD_DATA;

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

  reply	other threads:[~2004-06-23  7:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-23  6:40 [RFC/RFT] PS/2 mouse resync for KVM users Dmitry Torokhov
2004-06-23  7:39 ` Vojtech Pavlik [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-06-23  9:36 linux
2004-06-23 16:07 Dmitry Torokhov
2004-06-28 18:58 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040623073930.GB1101@ucw.cz \
    --to=vojtech@suse.cz \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.