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