Deleted Added
full compact
psm.4 (56330) psm.4 (57676)
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:

--- 10 unchanged lines hidden (view full) ---

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.\"
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:

--- 10 unchanged lines hidden (view full) ---

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: head/share/man/man4/psm.4 56330 2000-01-20 13:23:42Z yokota $
27.\" $FreeBSD: head/share/man/man4/psm.4 57676 2000-03-01 14:50:24Z sheldonh $
28.\"
29.Dd January 30, 1999
30.Dt PSM 4
31.Os FreeBSD
32.Sh NAME
33.Nm psm
34.Nd
35PS/2 mouse style pointing device driver

--- 20 unchanged lines hidden (view full) ---

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,
28.\"
29.Dd January 30, 1999
30.Dt PSM 4
31.Os FreeBSD
32.Sh NAME
33.Nm psm
34.Nd
35PS/2 mouse style pointing device driver

--- 20 unchanged lines hidden (view full) ---

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. They are typically 25, 50, 100 and 200
65pulse per inch. Some devices may have finer resolution.
66The current resolution can be changed at runtime. The
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
67.Nm
68driver allows the user to initially set the resolution
69via the driver flag
70.Pq see Sx DRIVER CONFIGURATION
71or change it later via the
72.Xr ioctl 2
73command
74.Dv MOUSE_SETMODE

--- 53 unchanged lines hidden (view full) ---

128.It bit 4
129Set if the horizontal movement count is negative.
130.It bit 3
131Always one.
132.\" The ALPS GlidePoint clears this bit when the user `taps' the surface of
133.\" the pad, otherwise the bit is set.
134.\" Most, if not all, other devices always set this bit.
135.It bit 2
70.Nm
71driver allows the user to initially set the resolution
72via the driver flag
73.Pq see Sx DRIVER CONFIGURATION
74or change it later via the
75.Xr ioctl 2
76command
77.Dv MOUSE_SETMODE

--- 53 unchanged lines hidden (view full) ---

131.It bit 4
132Set if the horizontal movement count is negative.
133.It bit 3
134Always one.
135.\" The ALPS GlidePoint clears this bit when the user `taps' the surface of
136.\" the pad, otherwise the bit is set.
137.\" Most, if not all, other devices always set this bit.
138.It bit 2
136Middle button status; set if pressed. For devices without the middle
139Middle button status; set if pressed.
140For devices without the middle
137button, this bit is always zero.
138.It bit 1
139Right button status; set if pressed.
140.It bit 0
141Left button status; set if pressed.
142.El
143.It Byte 2
144Horizontal movement count in two's compliment;

--- 15 unchanged lines hidden (view full) ---

160of the data packet.
161.Ss Acceleration
162The
163.Nm
164driver can somewhat `accelerate' the movement of the pointing device.
165The faster you move the device, the further the pointer
166travels on the screen.
167The driver has an internal variable which governs the effect of
141button, this bit is always zero.
142.It bit 1
143Right button status; set if pressed.
144.It bit 0
145Left button status; set if pressed.
146.El
147.It Byte 2
148Horizontal movement count in two's compliment;

--- 15 unchanged lines hidden (view full) ---

164of the data packet.
165.Ss Acceleration
166The
167.Nm
168driver can somewhat `accelerate' the movement of the pointing device.
169The faster you move the device, the further the pointer
170travels on the screen.
171The driver has an internal variable which governs the effect of
168the acceleration. Its value can be modified via the driver flag
172the acceleration.
173Its value can be modified via the driver flag
169or via an ioctl call.
170.Ss Device Number
171The minor device number of the
172.Nm
173is made up of:
174.Bd -literal -offset indent
175minor = (`unit' << 1) | `non-blocking'
176.Ed

--- 16 unchanged lines hidden (view full) ---

193.Bl -tag -width MOUSE
194.It Em PSM_HOOKRESUME
195The built-in PS/2 pointing device of some laptop computers is somehow
196not operable immediately after the system `resumes' from
197the power saving mode,
198though it will eventually become available.
199There are reports that
200stimulating the device by performing I/O will help
174or via an ioctl call.
175.Ss Device Number
176The minor device number of the
177.Nm
178is made up of:
179.Bd -literal -offset indent
180minor = (`unit' << 1) | `non-blocking'
181.Ed

--- 16 unchanged lines hidden (view full) ---

198.Bl -tag -width MOUSE
199.It Em PSM_HOOKRESUME
200The built-in PS/2 pointing device of some laptop computers is somehow
201not operable immediately after the system `resumes' from
202the power saving mode,
203though it will eventually become available.
204There are reports that
205stimulating the device by performing I/O will help
201waking up the device quickly. This option will add a piece of code
206waking up the device quickly.
207This option will add a piece of code
202to the
203.Nm
204driver to hook
205the `resume' event and exercise some harmless I/O operations to the
206device.
207.It Em PSM_RESETAFTERSUSPEND
208This option adds more drastic action for the above problem.
209It will make the
210.Nm
211driver to reset the pointing device after the resume event.
212It has no effect unless the
213.Em PSM_HOOKRESUME
214option is enabled as well.
215.It Em KBD_RESETDELAY=X, KBD_MAXWAIT=Y
216The
217.Nm
218driver will attempt to reset the pointing device during the boot process.
219It sometimes takes a long while before the device will respond after
208to the
209.Nm
210driver to hook
211the `resume' event and exercise some harmless I/O operations to the
212device.
213.It Em PSM_RESETAFTERSUSPEND
214This option adds more drastic action for the above problem.
215It will make the
216.Nm
217driver to reset the pointing device after the resume event.
218It has no effect unless the
219.Em PSM_HOOKRESUME
220option is enabled as well.
221.It Em KBD_RESETDELAY=X, KBD_MAXWAIT=Y
222The
223.Nm
224driver will attempt to reset the pointing device during the boot process.
225It sometimes takes a long while before the device will respond after
220reset. These options control how long the driver should wait before
221it eventually gives up waiting. The driver will wait
226reset.
227These options control how long the driver should wait before
228it eventually gives up waiting.
229The driver will wait
222.Fa X
223*
224.Fa Y
230.Fa X
231*
232.Fa Y
225msecs at most. If the driver seems unable to detect your pointing
226device, you may want to increase these values. The default values are
233msecs at most.
234If the driver seems unable to detect your pointing
235device, you may want to increase these values.
236The default values are
227200 msec for
228.Fa X
229and 5
230for
231.Fa Y .
232.It Em PSM_DEBUG=N, KBDIO_DEBUG=N
233Sets the debug level to
234.Fa N .
237200 msec for
238.Fa X
239and 5
240for
241.Fa Y .
242.It Em PSM_DEBUG=N, KBDIO_DEBUG=N
243Sets the debug level to
244.Fa N .
235The default debug level is zero. See
245The default debug level is zero.
246See
236.Sx DIAGNOSTICS
237for debug logging.
238.El
239.Ss Driver Flags
240The
241.Nm
247.Sx DIAGNOSTICS
248for debug logging.
249.El
250.Ss Driver Flags
251The
252.Nm
242driver accepts the following driver flags. Set them in the
253driver accepts the following driver flags.
254Set them in the
243kernel configuration file or in the User Configuration Menu at
244the boot time
245.Pq see Xr boot 8 .
246.Pp
247.Bl -tag -width MOUSE
248.It bit 0..3 RESOLUTION
249This flag specifies the resolution of the pointing device.
255kernel configuration file or in the User Configuration Menu at
256the boot time
257.Pq see Xr boot 8 .
258.Pp
259.Bl -tag -width MOUSE
260.It bit 0..3 RESOLUTION
261This flag specifies the resolution of the pointing device.
250It must be zero through four. The greater the value
262It must be zero through four.
263The greater the value
251is, the finer resolution the device will select.
252Actual resolution selected by this field varies according to the model
264is, the finer resolution the device will select.
265Actual resolution selected by this field varies according to the model
253of the device. Typical resolutions are:
266of the device.
267Typical resolutions are:
254.Pp
255.Bl -tag -width 0_(medium_high)__ -compact
256.It Em 1 (low)
25725 pulse per inch (ppi)
258.It Em 2 (medium low)
25950 ppi
260.It Em 3 (medium high)
261100 ppi
262.It Em 4 (high)
263200 ppi
264.El
265.Pp
266Leaving this flag zero will selects the default resolution for the
267device (whatever it is).
268.It bit 4..7 ACCELERATION
269This flag controls the amount of acceleration effect.
270The smaller the value of this flag is, more sensitive the movement becomes.
271The minimum value allowed, thus the value for the most sensitive setting,
268.Pp
269.Bl -tag -width 0_(medium_high)__ -compact
270.It Em 1 (low)
27125 pulse per inch (ppi)
272.It Em 2 (medium low)
27350 ppi
274.It Em 3 (medium high)
275100 ppi
276.It Em 4 (high)
277200 ppi
278.El
279.Pp
280Leaving this flag zero will selects the default resolution for the
281device (whatever it is).
282.It bit 4..7 ACCELERATION
283This flag controls the amount of acceleration effect.
284The smaller the value of this flag is, more sensitive the movement becomes.
285The minimum value allowed, thus the value for the most sensitive setting,
272is one. Setting this flag to zero will completely disables the
286is one.
287Setting this flag to zero will completely disables the
273acceleration effect.
274.It bit 8 NOCHECKSYNC
275The
276.Nm
277driver tries to detect the first byte of the data packet by checking
288acceleration effect.
289.It bit 8 NOCHECKSYNC
290The
291.Nm
292driver tries to detect the first byte of the data packet by checking
278the bit pattern of that byte. Although this method should work with most
293the bit pattern of that byte.
294Although this method should work with most
279PS/2 pointing devices, it may interfere with some devices which are not
280so compatible with known devices.
281If you think your pointing device is not functioning as expected,
282and the kernel frequently prints the following message to the console,
283.Bd -literal -offset indent
284psmintr: out of sync (xxxx != yyyy).
285.Ed
286.Pp

--- 71 unchanged lines hidden (view full) ---

358The
359.Dv buttons
360field holds the number of buttons on the device.
361The
362.Nm
363driver currently can detect the 3 button mouse from Logitech and report
364accordingly.
365The 3 button mouse from the other manufacturer may or may not be
295PS/2 pointing devices, it may interfere with some devices which are not
296so compatible with known devices.
297If you think your pointing device is not functioning as expected,
298and the kernel frequently prints the following message to the console,
299.Bd -literal -offset indent
300psmintr: out of sync (xxxx != yyyy).
301.Ed
302.Pp

--- 71 unchanged lines hidden (view full) ---

374The
375.Dv buttons
376field holds the number of buttons on the device.
377The
378.Nm
379driver currently can detect the 3 button mouse from Logitech and report
380accordingly.
381The 3 button mouse from the other manufacturer may or may not be
366reported correctly. However, it will not affect the operation of
382reported correctly.
383However, it will not affect the operation of
367the driver.
368.Pp
369The
370.Dv iftype
371is always
372.Dv MOUSE_IF_PS2 .
373.Pp
374The

--- 66 unchanged lines hidden (view full) ---

441movement report to the host computer.
442Typical supported values are 10, 20, 40, 60, 80, 100 and 200.
443Some mice may accept other arbitrary values too.
444.Pp
445The
446.Dv resolution
447of the pointing device must be one of
448.Dv MOUSE_RES_XXX
384the driver.
385.Pp
386The
387.Dv iftype
388is always
389.Dv MOUSE_IF_PS2 .
390.Pp
391The

--- 66 unchanged lines hidden (view full) ---

458movement report to the host computer.
459Typical supported values are 10, 20, 40, 60, 80, 100 and 200.
460Some mice may accept other arbitrary values too.
461.Pp
462The
463.Dv resolution
464of the pointing device must be one of
465.Dv MOUSE_RES_XXX
449constants or a positive value. The greater the value
466constants or a positive value.
467The greater the value
450is, the finer resolution the mouse will select.
451Actual resolution selected by the
452.Dv MOUSE_RES_XXX
468is, the finer resolution the mouse will select.
469Actual resolution selected by the
470.Dv MOUSE_RES_XXX
453constant varies according to the model of mouse. Typical resolutions are:
471constant varies according to the model of mouse.
472Typical resolutions are:
454.Pp
455.Bl -tag -width MOUSE_RES_MEDIUMHIGH__ -compact
456.It Dv MOUSE_RES_LOW
45725 ppi
458.It Dv MOUSE_RES_MEDIUMLOW
45950 ppi
460.It Dv MOUSE_RES_MEDIUMHIGH
461100 ppi

--- 4 unchanged lines hidden (view full) ---

466The
467.Dv accelfactor
468field holds a value to control acceleration feature
469.Pq see Sx Acceleration .
470It must be zero or greater. If it is zero, acceleration is disabled.
471.Pp
472The
473.Dv packetsize
473.Pp
474.Bl -tag -width MOUSE_RES_MEDIUMHIGH__ -compact
475.It Dv MOUSE_RES_LOW
47625 ppi
477.It Dv MOUSE_RES_MEDIUMLOW
47850 ppi
479.It Dv MOUSE_RES_MEDIUMHIGH
480100 ppi

--- 4 unchanged lines hidden (view full) ---

485The
486.Dv accelfactor
487field holds a value to control acceleration feature
488.Pq see Sx Acceleration .
489It must be zero or greater. If it is zero, acceleration is disabled.
490.Pp
491The
492.Dv packetsize
474field specifies the length of the data packet. It depends on the
493field specifies the length of the data packet.
494It depends on the
475operation level and the model of the pointing device.
476.Pp
477.Bl -tag -width level_0__ -compact
478.It Em level 0
4793 bytes
480.It Em level 1
4818 bytes
482.It Em level 2
483Depends on the model of the device
484.El
485.Pp
486The array
487.Dv syncmask
488holds a bit mask and pattern to detect the first byte of the
489data packet.
490.Dv syncmask[0]
495operation level and the model of the pointing device.
496.Pp
497.Bl -tag -width level_0__ -compact
498.It Em level 0
4993 bytes
500.It Em level 1
5018 bytes
502.It Em level 2
503Depends on the model of the device
504.El
505.Pp
506The array
507.Dv syncmask
508holds a bit mask and pattern to detect the first byte of the
509data packet.
510.Dv syncmask[0]
491is the bit mask to be ANDed with a byte. If the result is equal to
511is the bit mask to be ANDed with a byte.
512If the result is equal to
492.Dv syncmask[1] ,
493the byte is likely to be the first byte of the data packet.
494Note that this detection method is not 100% reliable,
495thus, should be taken only as an advisory measure.
496.Pp
497.It Dv MOUSE_SETMODE Ar mousemode_t *mode
498The command changes the current operation parameters of the mouse driver
499as specified in
500.Ar mode .
501Only
502.Dv rate ,
503.Dv resolution ,
504.Dv level
505and
506.Dv accelfactor
513.Dv syncmask[1] ,
514the byte is likely to be the first byte of the data packet.
515Note that this detection method is not 100% reliable,
516thus, should be taken only as an advisory measure.
517.Pp
518.It Dv MOUSE_SETMODE Ar mousemode_t *mode
519The command changes the current operation parameters of the mouse driver
520as specified in
521.Ar mode .
522Only
523.Dv rate ,
524.Dv resolution ,
525.Dv level
526and
527.Dv accelfactor
507may be modifiable. Setting values in the other field does not generate
528may be modifiable.
529Setting values in the other field does not generate
508error and has no effect.
509.Pp
510If you do not want to change the current setting of a field, put -1
511there.
512You may also put zero in
513.Dv resolution
514and
515.Dv rate ,

--- 151 unchanged lines hidden (view full) ---

667.Bl -tag -width Byte_1 -compact
668.It Byte 1
669.Bl -tag -width bit_6 -compact
670.It bit 7
671Reserved.
672.It bit 6
6730 - stream mode, 1 - remote mode.
674In the stream mode, the pointing device sends the device status
530error and has no effect.
531.Pp
532If you do not want to change the current setting of a field, put -1
533there.
534You may also put zero in
535.Dv resolution
536and
537.Dv rate ,

--- 151 unchanged lines hidden (view full) ---

689.Bl -tag -width Byte_1 -compact
690.It Byte 1
691.Bl -tag -width bit_6 -compact
692.It bit 7
693Reserved.
694.It bit 6
6950 - stream mode, 1 - remote mode.
696In the stream mode, the pointing device sends the device status
675whenever its state changes. In the remote mode, the host computer
697whenever its state changes.
698In the remote mode, the host computer
676must request the status to be sent.
677The
678.Nm
679driver puts the device in the stream mode.
680.It bit 5
699must request the status to be sent.
700The
701.Nm
702driver puts the device in the stream mode.
703.It bit 5
681Set if the pointing device is currently enabled. Otherwise zero.
704Set if the pointing device is currently enabled.
705Otherwise zero.
682.It bit 4
6830 - 1:1 scaling, 1 - 2:1 scaling.
6841:1 scaling is the default.
685.It bit 3
686Reserved.
687.It bit 2
688Left button status; set if pressed.
689.It bit 1
690Middle button status; set if pressed.
691.It bit 0
692Right button status; set if pressed.
693.El
694.It Byte 2
695.Bl -tag -width bit_6_0 -compact
696.It bit 7
697Reserved.
698.It bit 6..0
706.It bit 4
7070 - 1:1 scaling, 1 - 2:1 scaling.
7081:1 scaling is the default.
709.It bit 3
710Reserved.
711.It bit 2
712Left button status; set if pressed.
713.It bit 1
714Middle button status; set if pressed.
715.It bit 0
716Right button status; set if pressed.
717.El
718.It Byte 2
719.Bl -tag -width bit_6_0 -compact
720.It bit 7
721Reserved.
722.It bit 6..0
699Resolution code: zero through three. Actual resolution for
723Resolution code: zero through three.
724Actual resolution for
700the resolution code varies from one device to another.
701.El
702.It Byte 3
703The status report rate (reports/sec) at which the device will send
704movement report to the host computer.
705.El
706.Pp
707Note that the pointing device will not be enabled until the

--- 15 unchanged lines hidden (view full) ---

723.Em PSM_HOOKRESUME
724and
725.Em PSM_RESETAFTERSUSPEND
726options in order to recover from suspended state.
727Add these options to your kernel configuration file if the device
728does not seem to work properly after the system is resumed.
729.Pp
730Some PS/2 mouse models from MouseSystems require to be put in the
725the resolution code varies from one device to another.
726.El
727.It Byte 3
728The status report rate (reports/sec) at which the device will send
729movement report to the host computer.
730.El
731.Pp
732Note that the pointing device will not be enabled until the

--- 15 unchanged lines hidden (view full) ---

748.Em PSM_HOOKRESUME
749and
750.Em PSM_RESETAFTERSUSPEND
751options in order to recover from suspended state.
752Add these options to your kernel configuration file if the device
753does not seem to work properly after the system is resumed.
754.Pp
755Some PS/2 mouse models from MouseSystems require to be put in the
731high resolution mode to work properly. Use the driver flag to
756high resolution mode to work properly.
757Use the driver flag to
732set resolution.
733.Pp
734There is not a guaranteed way to re-synchronize with the first byte
735of the packet once we are out of synchronization with the data
758set resolution.
759.Pp
760There is not a guaranteed way to re-synchronize with the first byte
761of the packet once we are out of synchronization with the data
736stream. However, if you are using the \fIXFree86\fP server and experiencing
762stream.
763However, if you are using the \fIXFree86\fP server and experiencing
737the problem, you may be able to make the X server synchronize with the mouse
738by switching away to a virtual terminal and getting back to the X server,
739unless the X server is accessing the mouse via
740.Xr moused 8 .
741Clicking any button without moving the mouse may also work.
742.Sh BUGS
743The ioctl command
744.Dv MOUSEIOCREAD
764the problem, you may be able to make the X server synchronize with the mouse
765by switching away to a virtual terminal and getting back to the X server,
766unless the X server is accessing the mouse via
767.Xr moused 8 .
768Clicking any button without moving the mouse may also work.
769.Sh BUGS
770The ioctl command
771.Dv MOUSEIOCREAD
745has been removed. It was never functional anyway.
772has been removed.
773It was never functional anyway.
746.Sh SEE ALSO
747.Xr ioctl 2 ,
748.Xr syslog 3 ,
749.Xr atkbdc 4 ,
750.Xr mouse 4 ,
751.Xr mse 4 ,
752.Xr sysmouse 4 ,
753.Xr moused 8 ,

--- 18 unchanged lines hidden ---
774.Sh SEE ALSO
775.Xr ioctl 2 ,
776.Xr syslog 3 ,
777.Xr atkbdc 4 ,
778.Xr mouse 4 ,
779.Xr mse 4 ,
780.Xr sysmouse 4 ,
781.Xr moused 8 ,

--- 18 unchanged lines hidden ---