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