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