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