xref: /freebsd/share/man/man4/psm.4 (revision 13464e4a44fc58490a03bb8bfc7e3c972e9c30b2)
1.\"
2.\" Copyright (c) 1997
3.\" Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer as
11.\"    the first lines of this file unmodified.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\"
29.Dd September 26, 2016
30.Dt PSM 4
31.Os
32.Sh NAME
33.Nm psm
34.Nd PS/2 mouse style pointing device driver
35.Sh SYNOPSIS
36.Cd "options KBD_RESETDELAY=N"
37.Cd "options KBD_MAXWAIT=N"
38.Cd "options PSM_DEBUG=N"
39.Cd "options KBDIO_DEBUG=N"
40.Cd "device psm"
41.Pp
42In
43.Pa /boot/device.hints :
44.Cd hint.psm.0.at="atkbdc"
45.Cd hint.psm.0.irq="12"
46.Sh DESCRIPTION
47The
48.Nm
49driver provides support for the PS/2 mouse style pointing device.
50Currently there can be only one
51.Nm
52device node in the system.
53As the PS/2 mouse port is located
54at the auxiliary port of the keyboard controller,
55the keyboard controller driver,
56.Nm atkbdc ,
57must also be configured in the kernel.
58Note that there is currently no provision of changing the
59.Em irq
60number.
61.Pp
62Basic PS/2 style pointing device has two or three buttons.
63Some devices may have a roller or a wheel and/or additional buttons.
64.Ss Device Resolution
65The PS/2 style pointing device usually has several grades of resolution,
66that is, sensitivity of movement.
67They are typically 25, 50, 100 and 200
68pulse per inch.
69Some devices may have finer resolution.
70The current resolution can be changed at runtime.
71The
72.Nm
73driver allows the user to initially set the resolution
74via the driver flag
75(see
76.Sx "DRIVER CONFIGURATION" )
77or change it later via the
78.Xr ioctl 2
79command
80.Dv MOUSE_SETMODE
81(see
82.Sx IOCTLS ) .
83.Ss Report Rate
84Frequency, or report rate, at which the device sends movement
85and button state reports to the host system is also configurable.
86The PS/2 style pointing device typically supports 10, 20, 40, 60, 80, 100
87and 200 reports per second.
8860 or 100 appears to be the default value for many devices.
89Note that when there is no movement and no button has changed its state,
90the device will not send anything to the host system.
91The report rate can be changed via an ioctl call.
92.Ss Operation Levels
93The
94.Nm
95driver has three levels of operation.
96The current operation level can be set via an ioctl call.
97.Pp
98At the level zero the basic support is provided; the device driver will report
99horizontal and vertical movement of the attached device
100and state of up to three buttons.
101The movement and status are encoded in a series of fixed-length data packets
102(see
103.Sx "Data Packet Format" ) .
104This is the default level of operation and the driver is initially
105at this level when opened by the user program.
106.Pp
107The operation level one, the `extended' level, supports a roller (or wheel),
108if any, and up to 11 buttons.
109The movement of the roller is reported as movement along the Z axis.
1108 byte data packets are sent to the user program at this level.
111.Pp
112At the operation level two, data from the pointing device is passed to the
113user program as is.
114Conversely, command from the user program is passed
115to the pointing device as is and the user program is responsible for
116status validation and error recovery.
117Modern PS/2 type pointing devices often use proprietary data format.
118Therefore, the user program is expected to have
119intimate knowledge about the format from a particular device when operating
120the driver at this level.
121This level is called `native' level.
122.Ss Data Packet Format
123Data packets read from the
124.Nm
125driver are formatted differently at each operation level.
126.Pp
127A data packet from the PS/2 mouse style pointing device
128is three bytes long at the operation level zero:
129.Pp
130.Bl -tag -width Byte_1 -compact
131.It Byte 1
132.Bl -tag -width bit_7 -compact
133.It bit 7
134One indicates overflow in the vertical movement count.
135.It bit 6
136One indicates overflow in the horizontal movement count.
137.It bit 5
138Set if the vertical movement count is negative.
139.It bit 4
140Set if the horizontal movement count is negative.
141.It bit 3
142Always one.
143.\" The ALPS GlidePoint clears this bit when the user `taps' the surface of
144.\" the pad, otherwise the bit is set.
145.\" Most, if not all, other devices always set this bit.
146.It bit 2
147Middle button status; set if pressed.
148For devices without the middle
149button, this bit is always zero.
150.It bit 1
151Right button status; set if pressed.
152.It bit 0
153Left button status; set if pressed.
154.El
155.It Byte 2
156Horizontal movement count in two's complement;
157-256 through 255.
158Note that the sign bit is in the first byte.
159.It Byte 3
160Vertical movement count in two's complement;
161-256 through 255.
162Note that the sign bit is in the first byte.
163.El
164.Pp
165At the level one, a data packet is encoded
166in the standard format
167.Dv MOUSE_PROTO_SYSMOUSE
168as defined in
169.Xr mouse 4 .
170.Pp
171At the level two, native level, there is no standard on the size and format
172of the data packet.
173.Ss Acceleration
174The
175.Nm
176driver can somewhat `accelerate' the movement of the pointing device.
177The faster you move the device, the further the pointer
178travels on the screen.
179The driver has an internal variable which governs the effect of
180the acceleration.
181Its value can be modified via the driver flag
182or via an ioctl call.
183.Sh DRIVER CONFIGURATION
184.Ss Kernel Configuration Options
185There are following kernel configuration options to control the
186.Nm
187driver.
188They may be set in the kernel configuration file
189(see
190.Xr config 8 ) .
191.Bl -tag -width MOUSE
192.It Em KBD_RESETDELAY=X , KBD_MAXWAIT=Y
193The
194.Nm
195driver will attempt to reset the pointing device during the boot process.
196It sometimes takes a long while before the device will respond after
197reset.
198These options control how long the driver should wait before
199it eventually gives up waiting.
200The driver will wait
201.Fa X
202*
203.Fa Y
204msecs at most.
205If the driver seems unable to detect your pointing
206device, you may want to increase these values.
207The default values are
208200 msec for
209.Fa X
210and 5
211for
212.Fa Y .
213.It Em PSM_DEBUG=N , KBDIO_DEBUG=N
214Sets the debug level to
215.Fa N .
216The default debug level is zero.
217See
218.Sx DIAGNOSTICS
219for debug logging.
220.El
221.Ss Driver Flags
222The
223.Nm
224driver accepts the following driver flags.
225Set them in
226.Pa /boot/device.hints
227(see
228.Sx EXAMPLES
229below).
230.Bl -tag -width MOUSE
231.It bit 0..3 RESOLUTION
232This flag specifies the resolution of the pointing device.
233It must be zero through four.
234The greater the value
235is, the finer resolution the device will select.
236Actual resolution selected by this field varies according to the model
237of the device.
238Typical resolutions are:
239.Pp
240.Bl -tag -width 0_(medium_high)__ -compact
241.It Em 1 (low)
24225 pulse per inch (ppi)
243.It Em 2 (medium low)
24450 ppi
245.It Em 3 (medium high)
246100 ppi
247.It Em 4 (high)
248200 ppi
249.El
250.Pp
251Leaving this flag zero will selects the default resolution for the
252device (whatever it is).
253.It bit 4..7 ACCELERATION
254This flag controls the amount of acceleration effect.
255The smaller the value of this flag is, more sensitive the movement becomes.
256The minimum value allowed, thus the value for the most sensitive setting,
257is one.
258Setting this flag to zero will completely disables the
259acceleration effect.
260.It bit 8 NOCHECKSYNC
261The
262.Nm
263driver tries to detect the first byte of the data packet by checking
264the bit pattern of that byte.
265Although this method should work with most
266PS/2 pointing devices, it may interfere with some devices which are not
267so compatible with known devices.
268If you think your pointing device is not functioning as expected,
269and the kernel frequently prints the following message to the console,
270.Bd -literal -offset indent
271psmintr: out of sync (xxxx != yyyy).
272.Ed
273.Pp
274set this flag to disable synchronization check and see if it helps.
275.It bit 9 NOIDPROBE
276The
277.Nm
278driver will not try to identify the model of the pointing device and
279will not carry out model-specific initialization.
280The device should always act like a standard PS/2 mouse without such
281initialization.
282Extra features, such as wheels and additional buttons, will not be
283recognized by the
284.Nm
285driver.
286.It bit 10 NORESET
287When this flag is set, the
288.Nm
289driver will not reset the pointing device when initializing the device.
290If the
291.Fx
292kernel
293is started after another OS has run, the pointing device will inherit
294settings from the previous OS.
295However, because there is no way for the
296.Nm
297driver to know the settings, the device and the driver may not
298work correctly.
299The flag should never be necessary under normal circumstances.
300.It bit 11 FORCETAP
301Some pad devices report as if the fourth button is pressed
302when the user `taps' the surface of the device (see
303.Sx CAVEATS ) .
304This flag will make the
305.Nm
306driver assume that the device behaves this way.
307Without the flag, the driver will assume this behavior
308for ALPS GlidePoint models only.
309.It bit 12 IGNOREPORTERROR
310This flag makes
311.Nm
312driver ignore certain error conditions when probing the PS/2 mouse port.
313It should never be necessary under normal circumstances.
314.It bit 13 HOOKRESUME
315The built-in PS/2 pointing device of some laptop computers is somehow
316not operable immediately after the system `resumes' from
317the power saving mode,
318though it will eventually become available.
319There are reports that
320stimulating the device by performing I/O will help
321waking up the device quickly.
322This flag will enable a piece of code in the
323.Nm
324driver to hook
325the `resume' event and exercise some harmless I/O operations on the
326device.
327.It bit 14 INITAFTERSUSPEND
328This flag adds more drastic action for the above problem.
329It will cause the
330.Nm
331driver to reset and re-initialize the pointing device
332after the `resume' event.
333.El
334.Sh LOADER TUNABLES
335Extended support for Synaptics touchpads can be enabled by setting
336.Va hw.psm.synaptics_support
337to
338.Em 1
339at boot-time.
340This will enable
341.Nm
342to handle packets from guest devices (sticks) and extra buttons.
343Similarly, extended support for IBM/Lenovo TrackPoint and Elantech touchpads
344can be enabled by setting
345.Va hw.psm.trackpoint_support
346or
347.Va hw.psm.elantech_support,
348respectively, to
349.Em 1
350at boot-time.
351.Pp
352Tap and drag gestures can be disabled by setting
353.Va hw.psm.tap_enabled
354to
355.Em 0
356at boot-time.
357Currently, this is only supported on Synaptics touchpads with Extended
358support disabled.
359The behaviour may be changed after boot by setting
360the sysctl with the same name and by restarting
361.Xr moused 8
362using
363.Pa /etc/rc.d/moused .
364.Sh IOCTLS
365There are a few
366.Xr ioctl 2
367commands for mouse drivers.
368These commands and related structures and constants are defined in
369.In sys/mouse.h .
370General description of the commands is given in
371.Xr mouse 4 .
372This section explains the features specific to the
373.Nm
374driver.
375.Pp
376.Bl -tag -width MOUSE -compact
377.It Dv MOUSE_GETLEVEL Ar int *level
378.It Dv MOUSE_SETLEVEL Ar int *level
379These commands manipulate the operation level of the
380.Nm
381driver.
382.Pp
383.It Dv MOUSE_GETHWINFO Ar mousehw_t *hw
384Returns the hardware information of the attached device in the following
385structure.
386.Bd -literal
387typedef struct mousehw {
388    int buttons;    /* number of buttons */
389    int iftype;     /* I/F type */
390    int type;       /* mouse/track ball/pad... */
391    int model;      /* I/F dependent model ID */
392    int hwid;       /* I/F dependent hardware ID */
393} mousehw_t;
394.Ed
395.Pp
396The
397.Dv buttons
398field holds the number of buttons on the device.
399The
400.Nm
401driver currently can detect the 3 button mouse from Logitech and report
402accordingly.
403The 3 button mouse from the other manufacturer may or may not be
404reported correctly.
405However, it will not affect the operation of
406the driver.
407.Pp
408The
409.Dv iftype
410is always
411.Dv MOUSE_IF_PS2 .
412.Pp
413The
414.Dv type
415tells the device type:
416.Dv MOUSE_MOUSE ,
417.Dv MOUSE_TRACKBALL ,
418.Dv MOUSE_STICK ,
419.Dv MOUSE_PAD ,
420or
421.Dv MOUSE_UNKNOWN .
422The user should not heavily rely on this field, as the
423driver may not always, in fact it is very rarely able to, identify
424the device type.
425.Pp
426The
427.Dv model
428is always
429.Dv MOUSE_MODEL_GENERIC
430at the operation level 0.
431It may be
432.Dv MOUSE_MODEL_GENERIC
433or one of
434.Dv MOUSE_MODEL_XXX
435constants at higher operation levels.
436Again the
437.Nm
438driver may or may not set an appropriate value in this field.
439.Pp
440The
441.Dv hwid
442is the ID value returned by the device.
443Known IDs include:
444.Pp
445.Bl -tag -width 0__ -compact
446.It Em 0
447Mouse (Microsoft, Logitech and many other manufacturers)
448.It Em 2
449Microsoft Ballpoint mouse
450.It Em 3
451Microsoft IntelliMouse
452.El
453.Pp
454.It Dv MOUSE_SYN_GETHWINFO Ar synapticshw_t *synhw
455Retrieves extra information associated with Synaptics Touchpad.
456Only available when a supported device has been detected.
457.Bd -literal
458typedef struct synapticshw {
459    int infoMajor;	/* major hardware revision */
460    int infoMinor;	/* minor hardware revision */
461    int infoRot180;	/* touchpad is rotated */
462    int infoPortrait;	/* touchpad is a portrait */
463    int infoSensor;	/* sensor model */
464    int infoHardware;	/* hardware model */
465    int infoNewAbs;	/* supports the newabs format */
466    int capPen;		/* can detect a pen */
467    int infoSimplC;	/* supports simple commands */
468    int infoGeometry;	/* touchpad dimensions */
469    int capExtended;	/* supports extended packets */
470    int capSleep;	/* can be suspended/resumed */
471    int capFourButtons;	/* has four buttons */
472    int capMultiFinger;	/* can detect multiple fingers */
473    int capPalmDetect;	/* can detect a palm */
474    int capPassthrough;	/* can passthrough guest packets */
475    int capMiddle;	/* has a physical middle button */
476    int nExtendedButtons; /* has N additional buttons */
477    int nExtendedQueries; /* supports N extended queries */
478} synapticshw_t;
479.Ed
480.Pp
481See the
482.Em Synaptics TouchPad Interfacing Guide
483for more information about the fields in this structure.
484.Pp
485.It Dv MOUSE_GETMODE Ar mousemode_t *mode
486The command gets the current operation parameters of the mouse
487driver.
488.Bd -literal
489typedef struct mousemode {
490    int protocol;    /* MOUSE_PROTO_XXX */
491    int rate;        /* report rate (per sec), -1 if unknown */
492    int resolution;  /* MOUSE_RES_XXX, -1 if unknown */
493    int accelfactor; /* acceleration factor */
494    int level;       /* driver operation level */
495    int packetsize;  /* the length of the data packet */
496    unsigned char syncmask[2]; /* sync. bits */
497} mousemode_t;
498.Ed
499.Pp
500The
501.Dv protocol
502is
503.Dv MOUSE_PROTO_PS2
504at the operation level zero and two.
505.Dv MOUSE_PROTO_SYSMOUSE
506at the operation level one.
507.Pp
508The
509.Dv rate
510is the status report rate (reports/sec) at which the device will send
511movement report to the host computer.
512Typical supported values are 10, 20, 40, 60, 80, 100 and 200.
513Some mice may accept other arbitrary values too.
514.Pp
515The
516.Dv resolution
517of the pointing device must be one of
518.Dv MOUSE_RES_XXX
519constants or a positive value.
520The greater the value
521is, the finer resolution the mouse will select.
522Actual resolution selected by the
523.Dv MOUSE_RES_XXX
524constant varies according to the model of mouse.
525Typical resolutions are:
526.Pp
527.Bl -tag -width MOUSE_RES_MEDIUMHIGH__ -compact
528.It Dv MOUSE_RES_LOW
52925 ppi
530.It Dv MOUSE_RES_MEDIUMLOW
53150 ppi
532.It Dv MOUSE_RES_MEDIUMHIGH
533100 ppi
534.It Dv MOUSE_RES_HIGH
535200 ppi
536.El
537.Pp
538The
539.Dv accelfactor
540field holds a value to control acceleration feature
541(see
542.Sx Acceleration ) .
543It must be zero or greater.
544If it is zero, acceleration is disabled.
545.Pp
546The
547.Dv packetsize
548field specifies the length of the data packet.
549It depends on the
550operation level and the model of the pointing device.
551.Pp
552.Bl -tag -width level_0__ -compact
553.It Em level 0
5543 bytes
555.It Em level 1
5568 bytes
557.It Em level 2
558Depends on the model of the device
559.El
560.Pp
561The array
562.Dv syncmask
563holds a bit mask and pattern to detect the first byte of the
564data packet.
565.Dv syncmask[0]
566is the bit mask to be ANDed with a byte.
567If the result is equal to
568.Dv syncmask[1] ,
569the byte is likely to be the first byte of the data packet.
570Note that this detection method is not 100% reliable,
571thus, should be taken only as an advisory measure.
572.Pp
573.It Dv MOUSE_SETMODE Ar mousemode_t *mode
574The command changes the current operation parameters of the mouse driver
575as specified in
576.Ar mode .
577Only
578.Dv rate ,
579.Dv resolution ,
580.Dv level
581and
582.Dv accelfactor
583may be modifiable.
584Setting values in the other field does not generate
585error and has no effect.
586.Pp
587If you do not want to change the current setting of a field, put -1
588there.
589You may also put zero in
590.Dv resolution
591and
592.Dv rate ,
593and the default value for the fields will be selected.
594.\" .Pp
595.\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars
596.\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars
597.\" These commands are not supported by the
598.\" .Nm
599.\" driver.
600.Pp
601.It Dv MOUSE_READDATA Ar mousedata_t *data
602.\" The command reads the raw data from the device.
603.\" .Bd -literal
604.\" typedef struct mousedata {
605.\"     int len;        /* # of data in the buffer */
606.\"     int buf[16];    /* data buffer */
607.\" } mousedata_t;
608.\" .Ed
609.\" .Pp
610.\" Upon returning to the user program, the driver will place the number
611.\" of valid data bytes in the buffer in the
612.\" .Dv len
613.\" field.
614.\" .Pp
615.It Dv MOUSE_READSTATE Ar mousedata_t *state
616.\" The command reads the hardware settings from the device.
617.\" Upon returning to the user program, the driver will place the number
618.\" of valid data bytes in the buffer in the
619.\" .Dv len
620.\" field. It is usually 3 bytes.
621.\" The buffer is formatted as follows:
622.\" .Pp
623.\" .Bl -tag -width Byte_1 -compact
624.\" .It Byte 1
625.\" .Bl -tag -width bit_6 -compact
626.\" .It bit 7
627.\" Reserved.
628.\" .It bit 6
629.\" 0 - stream mode, 1 - remote mode.
630.\" In the stream mode, the pointing device sends the device status
631.\" whenever its state changes. In the remote mode, the host computer
632.\" must request the status to be sent.
633.\" The
634.\" .Nm
635.\" driver puts the device in the stream mode.
636.\" .It bit 5
637.\" Set if the pointing device is currently enabled. Otherwise zero.
638.\" .It bit 4
639.\" 0 - 1:1 scaling, 1 - 2:1 scaling.
640.\" 1:1 scaling is the default.
641.\" .It bit 3
642.\" Reserved.
643.\" .It bit 2
644.\" Left button status; set if pressed.
645.\" .It bit 1
646.\" Middle button status; set if pressed.
647.\" .It bit 0
648.\" Right button status; set if pressed.
649.\" .El
650.\" .It Byte 2
651.\" .Bl -tag -width bit_6_0 -compact
652.\" .It bit 7
653.\" Reserved.
654.\" .It bit 6..0
655.\" Resolution code: zero through three. Actual resolution for
656.\" the resolution code varies from one device to another.
657.\" .El
658.\" .It Byte 3
659.\" The status report rate (reports/sec) at which the device will send
660.\" movement report to the host computer.
661.\" .El
662These commands are not currently supported by the
663.Nm
664driver.
665.Pp
666.It Dv MOUSE_GETSTATUS Ar mousestatus_t *status
667The command returns the current state of buttons and
668movement counts as described in
669.Xr mouse 4 .
670.El
671.Sh FILES
672.Bl -tag -width /dev/npsm0 -compact
673.It Pa /dev/psm0
674`non-blocking' device node
675.It Pa /dev/bpsm0
676`blocking' device node
677.El
678.Sh EXAMPLES
679In order to install the
680.Nm
681driver, you need to add
682.Pp
683.Dl "device atkbdc"
684.Dl "device psm"
685.Pp
686to your kernel configuration file, and put the following lines to
687.Pa /boot/device.hints .
688.Pp
689.Dl hint.atkbdc.0.at="isa"
690.Dl hint.atkbdc.0.port="0x060"
691.Dl hint.psm.0.at="atkbdc"
692.Dl hint.psm.0.irq="12"
693.Pp
694If you add the following statement to
695.Pa /boot/device.hints ,
696.Pp
697.Dl hint.psm.0.flags="0x2000"
698.Pp
699you will add the optional code to stimulate the pointing device
700after the `resume' event.
701.Pp
702.Dl hint.psm.0.flags="0x24"
703.Pp
704The above line will set the device resolution high (4)
705and the acceleration factor to 2.
706.Sh DIAGNOSTICS
707At debug level 0, little information is logged except for the following
708line during boot process:
709.Bd -literal -offset indent
710psm0: device ID X
711.Ed
712.Pp
713where
714.Fa X
715the device ID code returned by the found pointing device.
716See
717.Dv MOUSE_GETINFO
718for known IDs.
719.Pp
720At debug level 1 more information will be logged
721while the driver probes the auxiliary port (mouse port).
722Messages are logged with the LOG_KERN facility at the LOG_DEBUG level
723(see
724.Xr syslogd 8 ) .
725.Bd -literal -offset indent
726psm0: current command byte:xxxx
727kbdio: TEST_AUX_PORT status:0000
728kbdio: RESET_AUX return code:00fa
729kbdio: RESET_AUX status:00aa
730kbdio: RESET_AUX ID:0000
731[...]
732psm: status 00 02 64
733psm0 irq 12 on isa
734psm0: model AAAA, device ID X, N buttons
735psm0: config:00000www, flags:0000uuuu, packet size:M
736psm0: syncmask:xx, syncbits:yy
737.Ed
738.Pp
739The first line shows the command byte value of the keyboard
740controller just before the auxiliary port is probed.
741It usually is 40, 45, 47 or 65, depending on how the motherboard BIOS
742initialized the keyboard controller upon power-up.
743.Pp
744The second line shows the result of the keyboard controller's
745test on the auxiliary port interface, with zero indicating
746no error; note that some controllers report no error even if
747the port does not exist in the system, however.
748.Pp
749The third through fifth lines show the reset status of the pointing device.
750The functioning device should return the sequence of FA AA <ID>.
751The ID code is described above.
752.Pp
753The seventh line shows the current hardware settings.
754.\" See
755.\" .Dv MOUSE_READSTATE
756.\" for definitions.
757These bytes are formatted as follows:
758.Pp
759.Bl -tag -width Byte_1 -compact
760.It Byte 1
761.Bl -tag -width bit_6 -compact
762.It bit 7
763Reserved.
764.It bit 6
7650 - stream mode, 1 - remote mode.
766In the stream mode, the pointing device sends the device status
767whenever its state changes.
768In the remote mode, the host computer
769must request the status to be sent.
770The
771.Nm
772driver puts the device in the stream mode.
773.It bit 5
774Set if the pointing device is currently enabled.
775Otherwise zero.
776.It bit 4
7770 - 1:1 scaling, 1 - 2:1 scaling.
7781:1 scaling is the default.
779.It bit 3
780Reserved.
781.It bit 2
782Left button status; set if pressed.
783.It bit 1
784Middle button status; set if pressed.
785.It bit 0
786Right button status; set if pressed.
787.El
788.It Byte 2
789.Bl -tag -width bit_6_0 -compact
790.It bit 7
791Reserved.
792.It bit 6..0
793Resolution code: zero through three.
794Actual resolution for
795the resolution code varies from one device to another.
796.El
797.It Byte 3
798The status report rate (reports/sec) at which the device will send
799movement report to the host computer.
800.El
801.Pp
802Note that the pointing device will not be enabled until the
803.Nm
804driver is opened by the user program.
805.Pp
806The rest of the lines show the device ID code, the number of detected
807buttons and internal variables.
808.Pp
809At debug level 2, much more detailed information is logged.
810.Sh SEE ALSO
811.Xr ioctl 2 ,
812.Xr syslog 3 ,
813.Xr atkbdc 4 ,
814.Xr mouse 4 ,
815.Xr mse 4 ,
816.Xr sysmouse 4 ,
817.Xr moused 8 ,
818.Xr syslogd 8
819.Rs
820.%T Synaptics TouchPad Interfacing Guide
821.%U http://www.synaptics.com/
822.Re
823.\".Sh HISTORY
824.Sh AUTHORS
825.An -nosplit
826The
827.Nm
828driver is based on the work done by quite a number of people, including
829.An Eric Forsberg ,
830.An Sandi Donno ,
831.An Rick Macklem ,
832.An Andrew Herbert ,
833.An Charles Hannum ,
834.An Shoji Yuen
835and
836.An Kazutaka Yokota
837to name the few.
838.Pp
839This manual page was written by
840.An Kazutaka Yokota Aq Mt yokota@FreeBSD.org .
841.Sh CAVEATS
842Many pad devices behave as if the first (left) button were pressed if
843the user `taps' the surface of the pad.
844In contrast, some pad products, e.g.\& some versions of ALPS GlidePoint
845and Interlink VersaPad, treat the tapping action
846as fourth button events.
847.Pp
848It is reported that ALPS GlidePoint, Synaptics Touchpad, IBM/Lenovo
849TrackPoint, and Interlink VersaPad require
850.Em INITAFTERSUSPEND
851flag in order to recover from suspended state.
852This flag is automatically set when one of these devices is detected by the
853.Nm
854driver.
855.Pp
856Some PS/2 mouse models from MouseSystems require to be put in the
857high resolution mode to work properly.
858Use the driver flag to
859set resolution.
860.Pp
861There is not a guaranteed way to re-synchronize with the first byte
862of the packet once we are out of synchronization with the data
863stream.
864However, if you are using the \fIXFree86\fP server and experiencing
865the problem, you may be able to make the X server synchronize with the mouse
866by switching away to a virtual terminal and getting back to the X server,
867unless the X server is accessing the mouse via
868.Xr moused 8 .
869Clicking any button without moving the mouse may also work.
870.Sh BUGS
871The ioctl command
872.Dv MOUSEIOCREAD
873has been removed.
874It was never functional anyway.
875.Pp
876Enabling the extended support for Synaptics touchpads has been reported to
877cause problems with responsivity on some (newer) models of Synaptics
878hardware, particularly those with guest devices.
879