]> CyberLeo.Net >> Repos - FreeBSD/releng/8.2.git/blob - share/man/man4/psm.4
Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.
[FreeBSD/releng/8.2.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 .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 .Pp
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 It has no effect unless the
334 .Em HOOKRESUME
335 flag is set as well.
336 .El
337 .Sh LOADER TUNABLES
338 Extended support for Synaptics touchpads can be enabled by setting
339 .Va hw.psm.synaptics_support
340 to
341 .Em 1
342 at boot-time.
343 This will enable
344 .Nm
345 to handle packets from guest devices (sticks) and extra buttons.
346 .Sh IOCTLS
347 There are a few
348 .Xr ioctl 2
349 commands for mouse drivers.
350 These commands and related structures and constants are defined in
351 .In sys/mouse.h .
352 General description of the commands is given in
353 .Xr mouse 4 .
354 This section explains the features specific to the
355 .Nm
356 driver.
357 .Pp
358 .Bl -tag -width MOUSE -compact
359 .It Dv MOUSE_GETLEVEL Ar int *level
360 .It Dv MOUSE_SETLEVEL Ar int *level
361 These commands manipulate the operation level of the
362 .Nm
363 driver.
364 .Pp
365 .It Dv MOUSE_GETHWINFO Ar mousehw_t *hw
366 Returns the hardware information of the attached device in the following
367 structure.
368 .Bd -literal
369 typedef struct mousehw {
370     int buttons;    /* number of buttons */
371     int iftype;     /* I/F type */
372     int type;       /* mouse/track ball/pad... */
373     int model;      /* I/F dependent model ID */
374     int hwid;       /* I/F dependent hardware ID */
375 } mousehw_t;
376 .Ed
377 .Pp
378 The
379 .Dv buttons
380 field holds the number of buttons on the device.
381 The
382 .Nm
383 driver currently can detect the 3 button mouse from Logitech and report
384 accordingly.
385 The 3 button mouse from the other manufacturer may or may not be
386 reported correctly.
387 However, it will not affect the operation of
388 the driver.
389 .Pp
390 The
391 .Dv iftype
392 is always
393 .Dv MOUSE_IF_PS2 .
394 .Pp
395 The
396 .Dv type
397 tells the device type:
398 .Dv MOUSE_MOUSE ,
399 .Dv MOUSE_TRACKBALL ,
400 .Dv MOUSE_STICK ,
401 .Dv MOUSE_PAD ,
402 or
403 .Dv MOUSE_UNKNOWN .
404 The user should not heavily rely on this field, as the
405 driver may not always, in fact it is very rarely able to, identify
406 the device type.
407 .Pp
408 The
409 .Dv model
410 is always
411 .Dv MOUSE_MODEL_GENERIC
412 at the operation level 0.
413 It may be
414 .Dv MOUSE_MODEL_GENERIC
415 or one of
416 .Dv MOUSE_MODEL_XXX
417 constants at higher operation levels.
418 Again the
419 .Nm
420 driver may or may not set an appropriate value in this field.
421 .Pp
422 The
423 .Dv hwid
424 is the ID value returned by the device.
425 Known IDs include:
426 .Pp
427 .Bl -tag -width 0__ -compact
428 .It Em 0
429 Mouse (Microsoft, Logitech and many other manufacturers)
430 .It Em 2
431 Microsoft Ballpoint mouse
432 .It Em 3
433 Microsoft IntelliMouse
434 .El
435 .Pp
436 .It Dv MOUSE_SYN_GETHWINFO Ar synapticshw_t *synhw
437 Retrieves extra information associated with Synaptics Touchpads.
438 Only available when
439 .Va hw.psm.synaptics_support
440 has been enabled.
441 .Bd -literal
442 typedef struct synapticshw {
443     int infoMajor;      /* major hardware revision */
444     int infoMinor;      /* minor hardware revision */
445     int infoRot180;     /* touchpad is rotated */
446     int infoPortrait;   /* touchpad is a portrait */
447     int infoSensor;     /* sensor model */
448     int infoHardware;   /* hardware model */
449     int infoNewAbs;     /* supports the newabs format */
450     int capPen;         /* can detect a pen */
451     int infoSimpleC;    /* supports simple commands */
452     int infoGeometry;   /* touchpad dimensions */
453     int capExtended;    /* supports extended packets */
454     int capSleep;       /* can be suspended/resumed */
455     int capFourButtons; /* has four buttons */
456     int capMultiFinger; /* can detect multiple fingers */
457     int capPalmDetect;  /* can detect a palm */
458     int capPassthrough; /* can passthrough guest packets */
459 } synapticshw_t;
460 .Ed
461 .Pp
462 See the
463 .Em Synaptics TouchPad Interfacing Guide
464 for more information about the fields in this structure.
465 .Pp
466 .It Dv MOUSE_GETMODE Ar mousemode_t *mode
467 The command gets the current operation parameters of the mouse
468 driver.
469 .Bd -literal
470 typedef struct mousemode {
471     int protocol;    /* MOUSE_PROTO_XXX */
472     int rate;        /* report rate (per sec), -1 if unknown */
473     int resolution;  /* MOUSE_RES_XXX, -1 if unknown */
474     int accelfactor; /* acceleration factor */
475     int level;       /* driver operation level */
476     int packetsize;  /* the length of the data packet */
477     unsigned char syncmask[2]; /* sync. bits */
478 } mousemode_t;
479 .Ed
480 .Pp
481 The
482 .Dv protocol
483 is
484 .Dv MOUSE_PROTO_PS2
485 at the operation level zero and two.
486 .Dv MOUSE_PROTO_SYSMOUSE
487 at the operation level one.
488 .Pp
489 The
490 .Dv rate
491 is the status report rate (reports/sec) at which the device will send
492 movement report to the host computer.
493 Typical supported values are 10, 20, 40, 60, 80, 100 and 200.
494 Some mice may accept other arbitrary values too.
495 .Pp
496 The
497 .Dv resolution
498 of the pointing device must be one of
499 .Dv MOUSE_RES_XXX
500 constants or a positive value.
501 The greater the value
502 is, the finer resolution the mouse will select.
503 Actual resolution selected by the
504 .Dv MOUSE_RES_XXX
505 constant varies according to the model of mouse.
506 Typical resolutions are:
507 .Pp
508 .Bl -tag -width MOUSE_RES_MEDIUMHIGH__ -compact
509 .It Dv MOUSE_RES_LOW
510 25 ppi
511 .It Dv MOUSE_RES_MEDIUMLOW
512 50 ppi
513 .It Dv MOUSE_RES_MEDIUMHIGH
514 100 ppi
515 .It Dv MOUSE_RES_HIGH
516 200 ppi
517 .El
518 .Pp
519 The
520 .Dv accelfactor
521 field holds a value to control acceleration feature
522 (see
523 .Sx Acceleration ) .
524 It must be zero or greater.
525 If it is zero, acceleration is disabled.
526 .Pp
527 The
528 .Dv packetsize
529 field specifies the length of the data packet.
530 It depends on the
531 operation level and the model of the pointing device.
532 .Pp
533 .Bl -tag -width level_0__ -compact
534 .It Em level 0
535 3 bytes
536 .It Em level 1
537 8 bytes
538 .It Em level 2
539 Depends on the model of the device
540 .El
541 .Pp
542 The array
543 .Dv syncmask
544 holds a bit mask and pattern to detect the first byte of the
545 data packet.
546 .Dv syncmask[0]
547 is the bit mask to be ANDed with a byte.
548 If the result is equal to
549 .Dv syncmask[1] ,
550 the byte is likely to be the first byte of the data packet.
551 Note that this detection method is not 100% reliable,
552 thus, should be taken only as an advisory measure.
553 .Pp
554 .It Dv MOUSE_SETMODE Ar mousemode_t *mode
555 The command changes the current operation parameters of the mouse driver
556 as specified in
557 .Ar mode .
558 Only
559 .Dv rate ,
560 .Dv resolution ,
561 .Dv level
562 and
563 .Dv accelfactor
564 may be modifiable.
565 Setting values in the other field does not generate
566 error and has no effect.
567 .Pp
568 If you do not want to change the current setting of a field, put -1
569 there.
570 You may also put zero in
571 .Dv resolution
572 and
573 .Dv rate ,
574 and the default value for the fields will be selected.
575 .\" .Pp
576 .\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars
577 .\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars
578 .\" These commands are not supported by the
579 .\" .Nm
580 .\" driver.
581 .Pp
582 .It Dv MOUSE_READDATA Ar mousedata_t *data
583 .\" The command reads the raw data from the device.
584 .\" .Bd -literal
585 .\" typedef struct mousedata {
586 .\"     int len;        /* # of data in the buffer */
587 .\"     int buf[16];    /* data buffer */
588 .\" } mousedata_t;
589 .\" .Ed
590 .\" .Pp
591 .\" Upon returning to the user program, the driver will place the number
592 .\" of valid data bytes in the buffer in the
593 .\" .Dv len
594 .\" field.
595 .\" .Pp
596 .It Dv MOUSE_READSTATE Ar mousedata_t *state
597 .\" The command reads the hardware settings from the device.
598 .\" Upon returning to the user program, the driver will place the number
599 .\" of valid data bytes in the buffer in the
600 .\" .Dv len
601 .\" field. It is usually 3 bytes.
602 .\" The buffer is formatted as follows:
603 .\" .Pp
604 .\" .Bl -tag -width Byte_1 -compact
605 .\" .It Byte 1
606 .\" .Bl -tag -width bit_6 -compact
607 .\" .It bit 7
608 .\" Reserved.
609 .\" .It bit 6
610 .\" 0 - stream mode, 1 - remote mode.
611 .\" In the stream mode, the pointing device sends the device status
612 .\" whenever its state changes. In the remote mode, the host computer
613 .\" must request the status to be sent.
614 .\" The
615 .\" .Nm
616 .\" driver puts the device in the stream mode.
617 .\" .It bit 5
618 .\" Set if the pointing device is currently enabled. Otherwise zero.
619 .\" .It bit 4
620 .\" 0 - 1:1 scaling, 1 - 2:1 scaling.
621 .\" 1:1 scaling is the default.
622 .\" .It bit 3
623 .\" Reserved.
624 .\" .It bit 2
625 .\" Left button status; set if pressed.
626 .\" .It bit 1
627 .\" Middle button status; set if pressed.
628 .\" .It bit 0
629 .\" Right button status; set if pressed.
630 .\" .El
631 .\" .It Byte 2
632 .\" .Bl -tag -width bit_6_0 -compact
633 .\" .It bit 7
634 .\" Reserved.
635 .\" .It bit 6..0
636 .\" Resolution code: zero through three. Actual resolution for
637 .\" the resolution code varies from one device to another.
638 .\" .El
639 .\" .It Byte 3
640 .\" The status report rate (reports/sec) at which the device will send
641 .\" movement report to the host computer.
642 .\" .El
643 These commands are not currently supported by the
644 .Nm
645 driver.
646 .Pp
647 .It Dv MOUSE_GETSTATUS Ar mousestatus_t *status
648 The command returns the current state of buttons and
649 movement counts as described in
650 .Xr mouse 4 .
651 .El
652 .Sh FILES
653 .Bl -tag -width /dev/npsm0 -compact
654 .It Pa /dev/psm0
655 `non-blocking' device node
656 .It Pa /dev/bpsm0
657 `blocking' device node
658 .El
659 .Sh EXAMPLES
660 In order to install the
661 .Nm
662 driver, you need to add
663 .Pp
664 .Dl "device atkbdc"
665 .Dl "device psm"
666 .Pp
667 to your kernel configuration file, and put the following lines to
668 .Pa /boot/device.hints .
669 .Pp
670 .Dl hint.atkbdc.0.at="isa"
671 .Dl hint.atkbdc.0.port="0x060"
672 .Dl hint.psm.0.at="atkbdc"
673 .Dl hint.psm.0.irq="12"
674 .Pp
675 If you add the following statement to
676 .Pa /boot/device.hints ,
677 .Pp
678 .Dl hint.psm.0.flags="0x2000"
679 .Pp
680 you will add the optional code to stimulate the pointing device
681 after the `resume' event.
682 .Pp
683 .Dl hint.psm.0.flags="0x24"
684 .Pp
685 The above line will set the device resolution high (4)
686 and the acceleration factor to 2.
687 .Sh DIAGNOSTICS
688 At debug level 0, little information is logged except for the following
689 line during boot process:
690 .Bd -literal -offset indent
691 psm0: device ID X
692 .Ed
693 .Pp
694 where
695 .Fa X
696 the device ID code returned by the found pointing device.
697 See
698 .Dv MOUSE_GETINFO
699 for known IDs.
700 .Pp
701 At debug level 1 more information will be logged
702 while the driver probes the auxiliary port (mouse port).
703 Messages are logged with the LOG_KERN facility at the LOG_DEBUG level
704 (see
705 .Xr syslogd 8 ) .
706 .Bd -literal -offset indent
707 psm0: current command byte:xxxx
708 kbdio: TEST_AUX_PORT status:0000
709 kbdio: RESET_AUX return code:00fa
710 kbdio: RESET_AUX status:00aa
711 kbdio: RESET_AUX ID:0000
712 [...]
713 psm: status 00 02 64
714 psm0 irq 12 on isa
715 psm0: model AAAA, device ID X, N buttons
716 psm0: config:00000www, flags:0000uuuu, packet size:M
717 psm0: syncmask:xx, syncbits:yy
718 .Ed
719 .Pp
720 The first line shows the command byte value of the keyboard
721 controller just before the auxiliary port is probed.
722 It usually is 4D, 45, 47 or 65, depending on how the motherboard BIOS
723 initialized the keyboard controller upon power-up.
724 .Pp
725 The second line shows the result of the keyboard controller's
726 test on the auxiliary port interface, with zero indicating
727 no error; note that some controllers report no error even if
728 the port does not exist in the system, however.
729 .Pp
730 The third through fifth lines show the reset status of the pointing device.
731 The functioning device should return the sequence of FA AA <ID>.
732 The ID code is described above.
733 .Pp
734 The seventh line shows the current hardware settings.
735 .\" See
736 .\" .Dv MOUSE_READSTATE
737 .\" for definitions.
738 These bytes are formatted as follows:
739 .Pp
740 .Bl -tag -width Byte_1 -compact
741 .It Byte 1
742 .Bl -tag -width bit_6 -compact
743 .It bit 7
744 Reserved.
745 .It bit 6
746 0 - stream mode, 1 - remote mode.
747 In the stream mode, the pointing device sends the device status
748 whenever its state changes.
749 In the remote mode, the host computer
750 must request the status to be sent.
751 The
752 .Nm
753 driver puts the device in the stream mode.
754 .It bit 5
755 Set if the pointing device is currently enabled.
756 Otherwise zero.
757 .It bit 4
758 0 - 1:1 scaling, 1 - 2:1 scaling.
759 1:1 scaling is the default.
760 .It bit 3
761 Reserved.
762 .It bit 2
763 Left button status; set if pressed.
764 .It bit 1
765 Middle button status; set if pressed.
766 .It bit 0
767 Right button status; set if pressed.
768 .El
769 .It Byte 2
770 .Bl -tag -width bit_6_0 -compact
771 .It bit 7
772 Reserved.
773 .It bit 6..0
774 Resolution code: zero through three.
775 Actual resolution for
776 the resolution code varies from one device to another.
777 .El
778 .It Byte 3
779 The status report rate (reports/sec) at which the device will send
780 movement report to the host computer.
781 .El
782 .Pp
783 Note that the pointing device will not be enabled until the
784 .Nm
785 driver is opened by the user program.
786 .Pp
787 The rest of the lines show the device ID code, the number of detected
788 buttons and internal variables.
789 .Pp
790 At debug level 2, much more detailed information is logged.
791 .Sh CAVEATS
792 Many pad devices behave as if the first (left) button were pressed if
793 the user `taps' the surface of the pad.
794 In contrast, some pad products, e.g.\& some versions of ALPS GlidePoint
795 and Interlink VersaPad, treat the tapping action
796 as fourth button events.
797 .Pp
798 It is reported that Interlink VersaPad requires both
799 .Em HOOKRESUME
800 and
801 .Em INITAFTERSUSPEND
802 flags in order to recover from suspended state.
803 These flags are automatically set when VersaPad is detected by the
804 .Nm
805 driver.
806 .Pp
807 Some PS/2 mouse models from MouseSystems require to be put in the
808 high resolution mode to work properly.
809 Use the driver flag to
810 set resolution.
811 .Pp
812 There is not a guaranteed way to re-synchronize with the first byte
813 of the packet once we are out of synchronization with the data
814 stream.
815 However, if you are using the \fIXFree86\fP server and experiencing
816 the problem, you may be able to make the X server synchronize with the mouse
817 by switching away to a virtual terminal and getting back to the X server,
818 unless the X server is accessing the mouse via
819 .Xr moused 8 .
820 Clicking any button without moving the mouse may also work.
821 .Sh SEE ALSO
822 .Xr ioctl 2 ,
823 .Xr syslog 3 ,
824 .Xr atkbdc 4 ,
825 .Xr mouse 4 ,
826 .Xr mse 4 ,
827 .Xr sysmouse 4 ,
828 .Xr moused 8 ,
829 .Xr syslogd 8
830 .Rs
831 .%T Synaptics TouchPad Interfacing Guide
832 .%O http://www.synaptics.com/
833 .Re
834 .\".Sh HISTORY
835 .Sh AUTHORS
836 .An -nosplit
837 The
838 .Nm
839 driver is based on the work done by quite a number of people, including
840 .An Eric Forsberg ,
841 .An Sandi Donno ,
842 .An Rick Macklem ,
843 .An Andrew Herbert ,
844 .An Charles Hannum ,
845 .An Shoji Yuen
846 and
847 .An Kazutaka Yokota
848 to name the few.
849 .Pp
850 This manual page was written by
851 .An Kazutaka Yokota Aq yokota@FreeBSD.org .
852 .Sh BUGS
853 The ioctl command
854 .Dv MOUSEIOCREAD
855 has been removed.
856 It was never functional anyway.
857 .Pp
858 Enabling the extended support for Synaptics touchpads has been reported to
859 cause problems with responsivity on some (newer) models of Synaptics
860 hardware, particularly those with guest devices.