From owner-freebsd-current Sun Jan 10 21:01:49 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA03239 for freebsd-current-outgoing; Sun, 10 Jan 1999 21:01:49 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from outmail.utsunomiya-u.ac.jp (outmail.utsunomiya-u.ac.jp [160.12.196.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA03233 for ; Sun, 10 Jan 1999 21:01:44 -0800 (PST) (envelope-from yokota@zodiac.mech.utsunomiya-u.ac.jp) Received: from zodiac.mech.utsunomiya-u.ac.jp (IDENT:3WT0ikh+OZL3ZSoN+mEs6jkWTm05gqQB@zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by outmail.utsunomiya-u.ac.jp (8.9.1/8.9.1) with ESMTP id OAA01299; Mon, 11 Jan 1999 14:01:00 +0900 (JST) Received: from zodiac.mech.utsunomiya-u.ac.jp (zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by zodiac.mech.utsunomiya-u.ac.jp (8.7.6+2.6Wbeta7/3.4W/zodiac-May96) with ESMTP id OAA20893; Mon, 11 Jan 1999 14:03:26 +0900 (JST) Message-Id: <199901110503.OAA20893@zodiac.mech.utsunomiya-u.ac.jp> To: Nick Hibma cc: FreeBSD current Mailing list , USB BSD list , yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Re: Hand needed: debugging the USB mouse driver In-reply-to: Your message of "Mon, 11 Jan 1999 01:06:24 +0100." References: Date: Mon, 11 Jan 1999 14:03:25 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >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