1993-10-19 20:19:15 +00:00
|
|
|
.\" Copyright 1992 by the University of Guelph
|
|
|
|
.\"
|
|
|
|
.\" Permission to use, copy and modify this
|
|
|
|
.\" software and its documentation for any purpose and without
|
|
|
|
.\" fee is hereby granted, provided that the above copyright
|
|
|
|
.\" notice appear in all copies and that both that copyright
|
|
|
|
.\" notice and this permission notice appear in supporting
|
|
|
|
.\" documentation.
|
|
|
|
.\" University of Guelph makes no representations about the suitability of
|
|
|
|
.\" this software for any purpose. It is provided "as is"
|
|
|
|
.\" without express or implied warranty.
|
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1997-03-07 02:50:01 +00:00
|
|
|
.\"
|
1997-12-07 08:46:56 +00:00
|
|
|
.Dd December 3, 1997
|
1996-12-29 20:36:04 +00:00
|
|
|
.Dt MSE 4 i386
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
1993-10-19 20:19:15 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm mse
|
1997-12-07 08:46:56 +00:00
|
|
|
.Nd bus and InPort mice driver
|
|
|
|
.Sh SYNOPSIS
|
2000-01-17 14:55:02 +00:00
|
|
|
.\" .Cd "options MSE_XXX=N"
|
2001-10-13 09:08:37 +00:00
|
|
|
.Cd "device mse"
|
|
|
|
.Pp
|
|
|
|
In
|
|
|
|
.Pa /boot/device.hints :
|
|
|
|
.Cd hint.mse.0.at="isa"
|
|
|
|
.Cd hint.mse.0.port="0x23c"
|
|
|
|
.Cd hint.mse.0.irq="5"
|
1993-10-19 20:19:15 +00:00
|
|
|
.Sh DESCRIPTION
|
1997-12-07 08:46:56 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver provides support for the bus mouse and the InPort mouse, which
|
|
|
|
are often collectively called ``bus'' mice, as these mice are sold with
|
|
|
|
an interface card which needs to be installed in an expansion bus slot.
|
|
|
|
The interface circuit may come on an integrated I/O card or as an option
|
|
|
|
on video cards.
|
|
|
|
.Pp
|
|
|
|
The bus and InPort mice have two or three buttons,
|
2001-07-14 19:41:16 +00:00
|
|
|
and a D-sub 9-pin male connector or a round DIN 9-pin
|
1997-12-07 08:46:56 +00:00
|
|
|
male connector.
|
|
|
|
.Pp
|
|
|
|
The primary port address of the bus and InPort mouse interface cards
|
2000-03-02 14:54:02 +00:00
|
|
|
is usually 0x23c.
|
|
|
|
Some cards may also be set to use the secondary port
|
|
|
|
address at 0x238.
|
|
|
|
The interface cards require a single IRQ, which may be
|
1997-12-07 08:46:56 +00:00
|
|
|
2, 3, 4 or 5. Some cards may offer additional IRQs.
|
|
|
|
The port number and the IRQ number are configured by jumpers on the cards
|
|
|
|
or by software provided with the card.
|
|
|
|
.Pp
|
|
|
|
Frequency, or report rate, at which the device sends movement
|
|
|
|
and button state reports to the host system, may also be configurable on
|
2000-03-02 14:54:02 +00:00
|
|
|
some interface cards.
|
|
|
|
It may be 15, 30, 60 or 120Hz.
|
1997-12-07 08:46:56 +00:00
|
|
|
.Pp
|
|
|
|
The difference between the two types of the mice is not in mouse devices
|
|
|
|
(in fact they are exactly the same). But in the circuit on the interface
|
2000-03-02 14:54:02 +00:00
|
|
|
cards.
|
2001-07-14 19:41:16 +00:00
|
|
|
This means that the device from a bus mouse package can be
|
1997-12-07 08:46:56 +00:00
|
|
|
connected to the interface card from an InPort mouse package, or vice
|
|
|
|
versa, provided that their connectors match.
|
|
|
|
.Ss Operation Levels
|
|
|
|
The
|
|
|
|
.Nm
|
2001-07-14 19:41:16 +00:00
|
|
|
driver has two levels of operation.
|
1997-12-07 08:46:56 +00:00
|
|
|
The current operation level can be set via an ioctl call.
|
|
|
|
.Pp
|
|
|
|
At the level zero the basic support is provided; the device driver will report
|
2001-07-14 19:41:16 +00:00
|
|
|
horizontal and vertical movement of the attached device
|
1997-12-07 08:46:56 +00:00
|
|
|
and state of up to three buttons in the format described below.
|
|
|
|
It is a subset of the MouseSystems protocol.
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width Byte_1 -compact
|
2001-07-14 19:41:16 +00:00
|
|
|
.It Byte 1
|
1997-12-07 08:46:56 +00:00
|
|
|
.Bl -tag -width bit_7 -compact
|
|
|
|
.It bit 7
|
|
|
|
Always one.
|
|
|
|
.It bit 6..3
|
|
|
|
Always zero.
|
|
|
|
.It bit 2
|
|
|
|
Left button status; cleared if pressed, otherwise set.
|
|
|
|
.It bit 1
|
2000-03-02 14:54:02 +00:00
|
|
|
Middle button status; cleared if pressed, otherwise set.
|
|
|
|
Always one,
|
1997-12-07 08:46:56 +00:00
|
|
|
if the device does not have the middle button.
|
|
|
|
.It bit 0
|
|
|
|
Right button status; cleared if pressed, otherwise set.
|
|
|
|
.El
|
|
|
|
.It Byte 2
|
|
|
|
Horizontal movement count in two's compliment; -128 through 127.
|
|
|
|
.It Byte 3
|
|
|
|
Vertical movement count in two's compliment; -128 through 127.
|
|
|
|
.It Byte 4
|
|
|
|
Always zero.
|
|
|
|
.It Byte 5
|
|
|
|
Always zero.
|
|
|
|
.El
|
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
This is the default level of operation and the driver is initially
|
1997-12-07 08:46:56 +00:00
|
|
|
at this level when opened by the user program.
|
|
|
|
.Pp
|
|
|
|
At the operation level one (extended level), a data packet is encoded
|
|
|
|
in the standard format
|
2001-07-14 19:41:16 +00:00
|
|
|
.Dv MOUSE_PROTO_SYSMOUSE
|
1997-12-07 08:46:56 +00:00
|
|
|
as defined in
|
|
|
|
.Xr mouse 4 .
|
|
|
|
.Ss Acceleration
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
driver can somewhat `accelerate' the movement of the pointing device.
|
2001-07-14 19:41:16 +00:00
|
|
|
The faster you move the device, the further the pointer
|
|
|
|
travels on the screen.
|
|
|
|
The driver has an internal variable which governs the effect of
|
2000-03-02 14:54:02 +00:00
|
|
|
the acceleration.
|
2001-07-14 19:41:16 +00:00
|
|
|
Its value can be modified via the driver flag
|
1997-12-07 08:46:56 +00:00
|
|
|
or via an ioctl call.
|
|
|
|
.Ss Device Number
|
|
|
|
The minor device number of the
|
|
|
|
.Nm
|
|
|
|
is made up of:
|
1993-10-19 20:19:15 +00:00
|
|
|
.Bd -literal -offset indent
|
1997-12-07 08:46:56 +00:00
|
|
|
minor = (`unit' << 1) | `non-blocking'
|
1993-10-19 20:19:15 +00:00
|
|
|
.Ed
|
|
|
|
.Pp
|
1997-12-07 08:46:56 +00:00
|
|
|
where `unit' is the device number (usually 0) and the `non-blocking' bit
|
2001-07-14 19:41:16 +00:00
|
|
|
is set to indicate ``don't block waiting for mouse input,
|
1997-12-07 08:46:56 +00:00
|
|
|
return immediately''.
|
2001-07-14 19:41:16 +00:00
|
|
|
The `non-blocking' bit should be set for \fIXFree86\fP,
|
1997-12-07 08:46:56 +00:00
|
|
|
therefore the minor device number usually used for \fIXFree86\fP is 1.
|
|
|
|
See
|
|
|
|
.Sx FILES
|
|
|
|
for device node names.
|
|
|
|
.Sh DRIVER CONFIGURATION
|
|
|
|
.\" .Ss Kernel Configuration Options
|
|
|
|
.Ss Driver Flags
|
|
|
|
The
|
|
|
|
.Nm
|
2000-03-02 14:54:02 +00:00
|
|
|
driver accepts the following driver flag.
|
2001-07-14 19:41:16 +00:00
|
|
|
Set it in the
|
|
|
|
kernel configuration file
|
2001-08-07 15:48:51 +00:00
|
|
|
(see
|
|
|
|
.Xr config 8 )
|
1997-12-07 08:46:56 +00:00
|
|
|
or in the User Configuration Menu at
|
2001-07-14 19:41:16 +00:00
|
|
|
the boot time
|
2001-08-07 15:48:51 +00:00
|
|
|
(see
|
|
|
|
.Xr boot 8 ) .
|
1997-12-07 08:46:56 +00:00
|
|
|
.Pp
|
|
|
|
.Bl -tag -width MOUSE
|
|
|
|
.It bit 4..7 ACCELERATION
|
|
|
|
This flag controls the amount of acceleration effect.
|
2001-07-14 19:41:16 +00:00
|
|
|
The smaller the value of this flag is, more sensitive the movement becomes.
|
|
|
|
The minimum value allowed, thus the value for the most sensitive setting,
|
2000-03-02 14:54:02 +00:00
|
|
|
is one.
|
|
|
|
Setting this flag to zero will completely disables the
|
2001-07-14 19:41:16 +00:00
|
|
|
acceleration effect.
|
1997-12-07 08:46:56 +00:00
|
|
|
.El
|
|
|
|
.Sh IOCTLS
|
2001-07-14 19:41:16 +00:00
|
|
|
There are a few
|
1997-12-07 08:46:56 +00:00
|
|
|
.Xr ioctl 2
|
2001-07-14 19:41:16 +00:00
|
|
|
commands for mouse drivers.
|
1997-12-07 08:46:56 +00:00
|
|
|
These commands and related structures and constants are defined in
|
2000-10-09 08:08:36 +00:00
|
|
|
.Ao Pa sys/mouse.h Ac .
|
1997-12-07 08:46:56 +00:00
|
|
|
General description of the commands is given in
|
|
|
|
.Xr mouse 4 .
|
|
|
|
This section explains the features specific to the
|
|
|
|
.Nm
|
|
|
|
driver.
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width MOUSE -compact
|
|
|
|
.It Dv MOUSE_GETLEVEL Ar int *level
|
|
|
|
.It Dv MOUSE_SETLEVEL Ar int *level
|
|
|
|
These commands manipulate the operation level of the
|
|
|
|
.Nm
|
|
|
|
driver.
|
|
|
|
.Pp
|
|
|
|
.It Dv MOUSE_GETHWINFO Ar mousehw_t *hw
|
2001-07-14 19:41:16 +00:00
|
|
|
Returns the hardware information of the attached device in the following
|
1997-12-07 08:46:56 +00:00
|
|
|
structure.
|
|
|
|
Only the
|
|
|
|
.Dv iftype
|
|
|
|
field is guaranteed to be filled with the correct value by the current
|
|
|
|
version of the
|
|
|
|
.Nm
|
|
|
|
driver.
|
|
|
|
.Bd -literal
|
|
|
|
typedef struct mousehw {
|
|
|
|
int buttons; /* number of buttons */
|
|
|
|
int iftype; /* I/F type */
|
|
|
|
int type; /* mouse/track ball/pad... */
|
|
|
|
int model; /* I/F dependent model ID */
|
|
|
|
int hwid; /* I/F dependent hardware ID */
|
|
|
|
} mousehw_t;
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv buttons
|
|
|
|
field holds the number of buttons on the device.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv iftype
|
|
|
|
is either
|
2001-07-14 19:41:16 +00:00
|
|
|
.Dv MOUSE_IF_BUS
|
1997-12-07 08:46:56 +00:00
|
|
|
or
|
|
|
|
.Dv MOUSE_IF_INPORT .
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv type
|
|
|
|
may be
|
|
|
|
.Dv MOUSE_MOUSE ,
|
|
|
|
.Dv MOUSE_TRACKBALL ,
|
|
|
|
.Dv MOUSE_STICK ,
|
|
|
|
.Dv MOUSE_PAD ,
|
|
|
|
or
|
|
|
|
.Dv MOUSE_UNKNOWN .
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv model
|
|
|
|
is always
|
|
|
|
.Dv MOUSE_MODEL_GENERIC
|
|
|
|
at the operation level 0.
|
2001-07-14 19:41:16 +00:00
|
|
|
It may be
|
1997-12-07 08:46:56 +00:00
|
|
|
.Dv MOUSE_MODEL_GENERIC
|
2001-07-14 19:41:16 +00:00
|
|
|
or one of
|
1997-12-07 08:46:56 +00:00
|
|
|
.Dv MOUSE_MODEL_XXX
|
|
|
|
constants at higher operation levels.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv hwid
|
|
|
|
is always 0.
|
|
|
|
.Pp
|
|
|
|
.It Dv MOUSE_GETMODE Ar mousemode_t *mode
|
|
|
|
The command gets the current operation parameters of the mouse
|
|
|
|
driver.
|
|
|
|
.Bd -literal
|
|
|
|
typedef struct mousemode {
|
|
|
|
int protocol; /* MOUSE_PROTO_XXX */
|
|
|
|
int rate; /* report rate (per sec), -1 if unknown */
|
|
|
|
int resolution; /* MOUSE_RES_XXX, -1 if unknown */
|
|
|
|
int accelfactor; /* acceleration factor */
|
|
|
|
int level; /* driver operation level */
|
|
|
|
int packetsize; /* the length of the data packet */
|
|
|
|
unsigned char syncmask[2]; /* sync. bits */
|
|
|
|
} mousemode_t;
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv protocol
|
|
|
|
is either
|
|
|
|
.Dv MOUSE_PROTO_BUS
|
|
|
|
or
|
|
|
|
.Dv MOUSE_PROTO_INPORT
|
|
|
|
at the operation level zero.
|
|
|
|
.Dv MOUSE_PROTO_SYSMOUSE
|
|
|
|
at the operation level one.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv rate
|
2001-07-14 19:41:16 +00:00
|
|
|
is the status report rate (reports/sec) at which the device will send
|
1997-12-07 08:46:56 +00:00
|
|
|
movement report to the host computer.
|
2001-07-14 19:41:16 +00:00
|
|
|
As there is no standard to detect the current setting,
|
1997-12-07 08:46:56 +00:00
|
|
|
this field is always set to -1.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv resolution
|
|
|
|
is always set to -1.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv accelfactor
|
2001-07-14 19:41:16 +00:00
|
|
|
field holds a value to control acceleration feature
|
2001-08-07 15:48:51 +00:00
|
|
|
(see
|
|
|
|
.Sx Acceleration ) .
|
1997-12-07 08:46:56 +00:00
|
|
|
It is zero or greater.
|
|
|
|
If it is zero, acceleration is disabled.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Dv packetsize
|
2000-03-02 14:54:02 +00:00
|
|
|
field specifies the length of the data packet.
|
|
|
|
It depends on the
|
1997-12-07 08:46:56 +00:00
|
|
|
operation level.
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width level_0__ -compact
|
|
|
|
.It Em level 0
|
|
|
|
5 bytes
|
|
|
|
.It Em level 1
|
|
|
|
8 bytes
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The array
|
|
|
|
.Dv syncmask
|
|
|
|
holds a bit mask and pattern to detect the first byte of the
|
|
|
|
data packet.
|
|
|
|
.Dv syncmask[0]
|
2000-03-02 14:54:02 +00:00
|
|
|
is the bit mask to be ANDed with a byte.
|
|
|
|
If the result is equal to
|
1997-12-07 08:46:56 +00:00
|
|
|
.Dv syncmask[1] ,
|
|
|
|
the byte is likely to be the first byte of the data packet.
|
|
|
|
Note that this detection method is not 100% reliable,
|
|
|
|
thus, should be taken only as an advisory measure.
|
|
|
|
.Pp
|
|
|
|
Only
|
2001-07-14 19:41:16 +00:00
|
|
|
.Dv level
|
|
|
|
and
|
1997-12-07 08:46:56 +00:00
|
|
|
.Dv accelfactor
|
|
|
|
are modifiable by the
|
|
|
|
.Dv MOUSE_SETMODE
|
|
|
|
command.
|
|
|
|
Changing the other field doesn't cause error, but has no effect.
|
|
|
|
.Pp
|
|
|
|
.It Dv MOUSE_SETMODE Ar mousemode_t *mode
|
|
|
|
The command changes the current operation parameters of the mouse driver
|
|
|
|
as specified in
|
|
|
|
.Ar mode .
|
|
|
|
Only
|
2001-07-14 19:41:16 +00:00
|
|
|
.Dv level
|
|
|
|
and
|
1997-12-07 08:46:56 +00:00
|
|
|
.Dv accelfactor
|
2000-03-02 14:54:02 +00:00
|
|
|
may be modifiable.
|
|
|
|
Setting values in the other field does not generate
|
1997-12-07 08:46:56 +00:00
|
|
|
error and has no effect.
|
|
|
|
.\" .Pp
|
|
|
|
.\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars
|
|
|
|
.\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars
|
|
|
|
.\" These commands are not supported by the
|
|
|
|
.\" .Nm
|
|
|
|
.\" driver.
|
|
|
|
.Pp
|
|
|
|
.It Dv MOUSE_READDATA Ar mousedata_t *data
|
|
|
|
.It Dv MOUSE_READSTATE Ar mousedata_t *state
|
|
|
|
These commands are not supported by the
|
|
|
|
.Nm
|
|
|
|
driver.
|
|
|
|
.Pp
|
1999-11-09 12:18:10 +00:00
|
|
|
.It Dv MOUSE_GETSTATUS Ar mousestatus_t *status
|
2001-07-14 19:41:16 +00:00
|
|
|
The command returns the current state of buttons and
|
1997-12-07 08:46:56 +00:00
|
|
|
movement counts as described in
|
|
|
|
.Xr mouse 4 .
|
|
|
|
.El
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width /dev/nmse0 -compact
|
|
|
|
.It Pa /dev/mse0
|
|
|
|
`non-blocking' device node in the system without
|
|
|
|
.Em devfs ,
|
|
|
|
`blocking' under
|
|
|
|
.Em devfs .
|
|
|
|
.It Pa /dev/nmse0
|
|
|
|
`non-blocking' device node under
|
|
|
|
.Em devfs .
|
|
|
|
.El
|
2000-11-17 11:44:16 +00:00
|
|
|
.Sh EXAMPLES
|
2001-10-13 09:08:37 +00:00
|
|
|
.Dl "device mse"
|
|
|
|
.Pp
|
|
|
|
In
|
|
|
|
.Pa /boot/device.hints :
|
|
|
|
.Dl hint.mse.0.at="isa"
|
|
|
|
.Dl hint.mse.0.port="0x23c"
|
|
|
|
.Dl hint.mse.0.irq="5"
|
1997-12-07 08:46:56 +00:00
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
Add the
|
1997-12-07 08:46:56 +00:00
|
|
|
.Nm
|
|
|
|
driver at the primary port address with the IRQ 5.
|
|
|
|
.Pp
|
2001-10-13 09:08:37 +00:00
|
|
|
.Dl "device mse"
|
|
|
|
.Pp
|
|
|
|
.Dl hint.mse.1.at="isa"
|
|
|
|
.Dl hint.mse.1.port="0x238"
|
|
|
|
.Dl hint.mse.1.irq="4"
|
|
|
|
.Dl hint.mse.1.flags="0x30"
|
1997-12-07 08:46:56 +00:00
|
|
|
.Pp
|
2001-07-14 19:41:16 +00:00
|
|
|
Define the
|
1997-12-07 08:46:56 +00:00
|
|
|
.Nm
|
|
|
|
driver at the secondary port address with the IRQ 4 and the acceleration
|
|
|
|
factor of 3.
|
|
|
|
.Sh CAVEAT
|
2001-07-14 19:41:16 +00:00
|
|
|
Some bus mouse interface cards generate interrupts at the fixed report rate
|
1997-12-07 08:46:56 +00:00
|
|
|
when enabled, whether or not the mouse state is changing.
|
|
|
|
The others generate interrupts only when the state is changing.
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr ioctl 2 ,
|
|
|
|
.Xr mouse 4 ,
|
|
|
|
.Xr psm 4 ,
|
|
|
|
.Xr sysmouse 4 ,
|
|
|
|
.Xr moused 8
|
|
|
|
.\".Sh HISTORY
|