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