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