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