Improve the detection code for GlidePoint. This is still a kludge,

but better than before...

PR: kern/13215
This commit is contained in:
Kazutaka YOKOTA 1999-08-22 06:11:52 +00:00
parent e7dcbbe297
commit 7d27f93ac4
2 changed files with 8 additions and 4 deletions

View File

@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: psm.c,v 1.14 1999/07/12 15:16:04 yokota Exp $
* $Id: psm.c,v 1.15 1999/08/17 12:14:13 yokota Exp $
*/
/*
@ -2209,9 +2209,11 @@ enable_aglide(struct psm_softc *sc)
* NOTE: ALPS produces several models of GlidePoint. Some of those
* do not respond to this sequence, thus, cannot be detected this way.
*/
if (set_mouse_sampling_rate(sc->kbdc, 100) != 100)
return FALSE;
if (!mouse_id_proc1(sc->kbdc, PSMD_RES_LOW, 2, status))
return FALSE;
if ((status[0] & 0x10) || (status[1] == PSMD_RES_LOW))
if ((status[1] == PSMD_RES_LOW) || (status[2] == 100))
return FALSE;
return TRUE;
}

View File

@ -20,7 +20,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: psm.c,v 1.14 1999/07/12 15:16:04 yokota Exp $
* $Id: psm.c,v 1.15 1999/08/17 12:14:13 yokota Exp $
*/
/*
@ -2209,9 +2209,11 @@ enable_aglide(struct psm_softc *sc)
* NOTE: ALPS produces several models of GlidePoint. Some of those
* do not respond to this sequence, thus, cannot be detected this way.
*/
if (set_mouse_sampling_rate(sc->kbdc, 100) != 100)
return FALSE;
if (!mouse_id_proc1(sc->kbdc, PSMD_RES_LOW, 2, status))
return FALSE;
if ((status[0] & 0x10) || (status[1] == PSMD_RES_LOW))
if ((status[1] == PSMD_RES_LOW) || (status[2] == 100))
return FALSE;
return TRUE;
}