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