Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 1999 14:03:25 +0900
From:      Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
To:        Nick Hibma <hibma@skylink.it>
Cc:        FreeBSD current Mailing list <current@FreeBSD.ORG>, USB BSD list <usb-bsd@makelist.com>, yokota@zodiac.mech.utsunomiya-u.ac.jp
Subject:   Re: Hand needed: debugging the USB mouse driver 
Message-ID:  <199901110503.OAA20893@zodiac.mech.utsunomiya-u.ac.jp>
In-Reply-To: Your message of "Mon, 11 Jan 1999 01:06:24 %2B0100." <Pine.BSF.3.96.990111002556.2139B-100000@heidi.plazza.it> 
References:  <Pine.BSF.3.96.990111002556.2139B-100000@heidi.plazza.it> 

next in thread | previous in thread | raw e-mail | index | archive | help

>If there are people that would like to get their hands dirty on some
>programming in FreeBSD, but don't know where to start... 
>
>The ums driver (dev/usb/ums.c) requires some work to get the Z direction
>working. The mouse works in X/Y directions and 3 buttons, but not Z.
>
>Two things could be done:
>1) Debug the IntelliMouse that is currently implemented (and not
>working)
>
>2) Convert the whole protocol used to Sysmouse. This is much better as
>we might end up with USB mice with lots more buttons and directions and
>it would be far easier to accomodate for that in the sysmouse protocol.
>
>The work consists of digging through the mouse protocols (PS/2,
>sysmouse, IntelliMouse, etc.). This protocol information can be fetched
>from psm.c, moused and i386/include/mouse.h, or maybe elsewhere.

Don't forget the man pages for mouse(4), moused(8), mse(4),
sysmouse(4) and psm(4) :-) They contain good amount of description on
the sysmouse protocol and more.

One key feature of FreeBSD mouse drivers is that the driver can switch
protocols according to the setting of "operation level."

The level 0 is "compatibility level."  The drivers stick to the
accepted or De facto standard protocol associated with the device when
reporting data to the userland.  For example, the mse driver uses the
MouseSystems 5 byte protocol at this level, because that has been the
protocol for the driver for years.  The psm driver uses the the
standard PS/2 mouse 3 byte protocol, even if the mouse has a wheel or
additional buttons and the device uses an extended protocol (this
means that the wheel and the extra button information is discarded in
the driver and not available to the userland at this level).

When the drivers are open()ed the initial operation level is always
set to 0.

The level 0 is intended for programs which are aware of only very
basic protocols, such as MS serial mouse protocol, MouseSystems
protocol and PS/2 mouse protocol, and have no ideas about wheels and
extra buttons.  XFree86 servers (ver 3.3.1 or earlier), and many
commercial X servers too, fall in this category.

The level 1 is "sysmouse level".  8 byte sysmouse protocol is used in
all drivers.  The protocol will encode wheel and extra button
information.  This involves data translation in the drivers.  This is
currently the preferred operation level.  moused(8) and XFree86
servers (ver 3.3.2 or later) use this level.

The level 2 is called "native level."  Currently only the psm driver
has the level 2 operation. In this level raw mouse data is passed from
the mouse device to the userland.  Recent exotic mice use various,
often proprietary, protocols.  The userland program must know
different data formats and must be able to decode data according to
the connected mouse model.  At the moment, the level 2 is not very
useful, because there seems to be no programs using this level.
(The mse driver doesn't have the native level operation.)

The FreeBSD USB mouse driver should at least implement the level 0 and
1 operation.  If there already is an sort of accepted data format for
the USB mouse, that should be used for the level 0.  The level 1 must
use the sysmouse protocol.

(The level 0 may use the sysmouse protocol too, if there doesn't seem
to be the De facto standard yet.  The OSes may choose to implement the
sysmouse protocol too, if it suits them.)

Kazu

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901110503.OAA20893>