summaryrefslogtreecommitdiffstats
path: root/sys/dev/wscons (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant conditional. Inspecting flags is the correct way toanton2019-05-241-5/+3
| | | | | | determine if the device was opened in read/write mode. ok mpi@ visa@
* Cleanup debug macros in wscons. Favor __func__ over spelling out the actualanton2019-05-223-56/+54
| | | | | function name in order to reduce grep noise. Also, some of them where referring to the wrong function.
* A wscons device may only be opened in read/write mode once. However,anton2019-05-225-16/+25
| | | | | | | | | | | after checking for exclusive access, malloc() can sleep in wsevent_init() opening up for a potential race where more than one thread may be able open the device. Prevent this by checking if the race was won after calling malloc(). While here, switch to mallocarray as proposed by both cheloha@ and mpi@ ok mpi@
* A problem fixed in wskbd is also present in wsmux. Repeating theanton2019-05-211-2/+2
| | | | | | | | | | | | | | | | previous commit message: In wsmuxclose(), use the same logic as in wsmuxopen() to determine if the device was opened in write-only mode. Relying on me_evar being NULL does not work if the wsmux device was opened first followed attaching it to another wsmux. Closing the wsmux device first at this stage would cause the wscons_event queue inherited from the parent wsmux to be freed. This in turn could cause a panic if an ioctl(WSMUXIO_INJECTEVENT) command is issued on parent wsmux device. ok mpi@ visa@ Reported-by: syzbot+f6c2ed7901eb4b970720@syzkaller.appspotmail.com
* Add the colemak keyboard layout.abieber2019-05-111-2/+4
| | | | OK deraadt@
* Improve the interaction between efifb(4), inteldrm(4) and radeondrm(4)kettenis2019-05-042-5/+20
| | | | | | | | | | | | | | | | when we have a serial console by introducing the notion of a "primary" graphics device. The primary graphics device is the one set up and used by firmware (BIOS, UEFI). The goal is to make sure that wsdisplay0 and drm0 reliably attach to the primary graphics device such that X works out of the box even if you have multiple cards or if you are using a serial console. This also fixes the situation where inteldrm(4) or radeondrm(4) would take over the console on UEFI systems even if the kernel was booted with a serial console. ok jsg@
* Restrict the number of allowed wsmux devices, just like wskbd and wsmouseanton2019-03-301-1/+4
| | | | | | | | | already does. Otherwise, malloc could panic if the device minor is sufficiently large. ok kettenis@ mpi@ visa@ Reported-by: syzbot+5a77a0fd8810d0785f61@syzkaller.appspotmail.com
* Fix a precedence problem.bru2019-03-241-3/+6
|
* Switch to precision scrolling in wstpad.bru2019-03-243-64/+93
|
* Add new event types for precision scrolling.bru2019-03-241-1/+7
|
* Clear the me_evp pointer after calling wsmux_do_close() as opposed ofanton2019-03-161-2/+2
| | | | | | | | | before. The pointer indicates if a wsmux device is attached to another wsmux, clearing it therefore allows same device to attached again. This can be problematic since wsmux_do_close() can sleep. Swapping the order of operations prevents attaching a wsmux which is in a closing state. ok deraadt@ mpi@ visa@
* Limited the number of allowed stacked wsmux devices. A sufficiently long chainanton2019-03-021-7/+66
| | | | | | | of such devices can exhaust the kernel stack due to wsmux_do_open() being recursive. While here, serialize the operation of stacking a wsmux device. Joint effort with and ok visa@
* When adding a wsmux device to an existing wsmux device usinganton2019-02-201-2/+2
| | | | | | | | | | | ioctl(WSMUXIO_ADD_DEVICE), two distinct locks of the same type are acquired. Thus, witness will emit warning. Since acquiring two different locks of the same type is harmless in this context, relax the witness check by flagging the locks as RWL_DUPOK. ok visa@ Reported-by: syzbot+249e483406a1f7843915@syzkaller.appspotmail.com
* whitespace nitsanton2019-02-191-4/+4
|
* favor C99 initializers for improved grepability; ok mpi@anton2019-02-193-13/+22
|
* Serialize access to the list of attached child devices belonging to aanton2019-02-182-8/+47
| | | | | | | | | | wsmux. When invoking wsevsrc_* functions on a attached child device, underlying driver can sleep; this introduces a race where another thread is able to modify the list leading to all kinds of corruptions. ok visa@ Reported-by: syzbot+03f7377a9848d7d008c9@syzkaller.appspotmail.com
* free size for wscons_event; ok deraadt@ visa@anton2019-02-011-2/+2
|
* In wskbdclose(), use the same logic as in wskbdopen() to determine ifanton2019-02-011-2/+3
| | | | | | | | | | | | | the device was opened in write-only mode. Relying on me_evar being NULL does not work if the wskbd device was opened first followed by opening a wsmux device. Closing the wskbd device first at this stage would cause the wscons_event queue inherited from the wsmux device to be freed. This in turn could cause a panic if an ioctl(WSMUXIO_INJECTEVENT) command is issued to the wsmux device. ok deraadt@ visa@ Reported-by: syzbot+ed88256423ae8d882b8b@syzkaller.appspotmail.com
* Fix compilation of amd64 kernel when optimization is disabled.millert2019-01-311-3/+2
| | | | | C99 inline semantics resulted in undefined symbols. OK deraadt@ mpi@ dlg@
* tweak errno in previousanton2019-01-271-2/+2
|
* Validate the user-supplied device index given to WSMUXIO_ADD_DEVICE. The sameanton2019-01-271-1/+3
| | | | | | | | index is used to index an array which could cause a panic if it's negative. ok deraadt@ Reported-by: syzbot+c5997876fea393e6b948@syzkaller.appspotmail.com
* Cleanup: Initialize the pointers to position data early, and usebru2018-12-291-17/+15
| | | | them consistently.
* Use estimates of speed to improve gesture detection.bru2018-12-261-47/+136
| | | | ok mpi@ (to the concept)
* When no child devices are attached to a wsmux device, make sure to return ananton2018-12-171-3/+6
| | | | | | | | | error for inappropriate ioctl commands. Prevents a panic caused by using a wsmux device as the controlling terminal. ok deraadt@ visa@ Reported-by: syzbot+44bab40fc5a11357d774@syzkaller.appspotmail.com
* Use a time-based method for tracking motion states of touches.bru2018-12-051-50/+81
| | | | ok mpi@
* Add support for TIOCGPGRP ioctl commands to wscons.anton2018-11-203-3/+24
| | | | ok visa@
* No need for wscons to handle FIOSETOWN ioctl requests since sys_ioctl()anton2018-11-203-22/+3
| | | | | | translates such requests into TIOCSPGRP. ok visa@
* Utilize sigio with wscons. The old behavior of always making the process groupanton2018-11-195-37/+38
| | | | | | | | | | | | | | of the process who opens the device the default recipient of sigio is removed as a side-effect of this change. Issuing ioctl(FIOSETOWN) is therefore mandatory in order to receive sigio, which is more consistent with other subsystems supporting sigio. This change is all made possible by the new sigio(9) API and prevents wscons from keeping a pointer to the recipient process. Usage of such pointer could cause a panic since wscons is not inform on process deallocation, leaving a dangling pointer behind. ok mpi@ visa@
* in the magical language gcc, adding brackets allows correct code to compile.deraadt2018-11-111-3/+3
|
* Remove the strong hysteresis filter.bru2018-11-104-86/+36
| | | | | | | It seems that the filter is obsolete, the default method is sufficient. Simplify and clean up some related code in wsmouse. ok mpi@
* Improve the filters for scrolling.bru2018-11-051-16/+44
| | | | ok mpi@
* define WSMOUSE_TYPE_TOUCHPAD so non-elantech drivers can stopjcs2018-07-301-1/+2
| | | | claiming to be elantech devices
* Add logging options to wsmouse. Input and event logging for debugbru2018-05-074-5/+97
| | | | | purposes can be enabled and disabled by WSMOUSEIO_SETPARAMS requests.
* replace add_*_randomness with enqueue_randomness()jasper2018-04-281-2/+2
| | | | | | | | | this gets rid of the source annotation which doesn't really add anything other than adding complexitiy. randomess is generally good enough that the few extra bits that the source type would add are not worth it. ok mikeb@ deraadt@
* Try to get the layout from the default mux when attaching a consolempi2018-04-181-19/+8
| | | | | | | | | | | keyboard late. This makes keyboard re-attaching due to the machdep.forceukbd sysctl(2) respect /etc/kbdtype. Issue reported by Artturi Alm, jmc@ and landry@. ok kettenis@
* Remove almost unused `flags' argument of suser().mpi2018-02-192-5/+5
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* More sizes for free() in wscons(4).fcambus2018-01-222-4/+6
| | | | OK visa@
* Add sizes for free() in wscons(4).fcambus2018-01-172-4/+4
| | | | OK deraadt@, visa@, mpi@
* coordinate again: polishingbru2018-01-131-1/+5
|
* Improve the handling of coordinate inputs and filters.bru2018-01-113-170/+205
| | | | | | | | | | | | | | Single-touch and multi-touch coordinate inputs are treated more uniformly, and the hysteresis filters have a more consistent implementation. If possible, pointer control will be assigned to touches with coordinate updates that pass the default hysteresis filter (the function has been moved to wsmouse.c). The "strong" variant of hysteresis has been improved, the new version won't double the threshold when a movement changes the orientation on an axis. There is an additional change in wstpad_configure, which ensures that a zero size disables an edge area even if the coordinate limits are misconfigured.
* scrolling: take care of noise.bru2017-12-231-3/+5
|
* 1. Use unfiltered deltas for scrolling. 2. (Re-)Simplify the edge areabru2017-12-221-74/+63
| | | | setup.
* Add various improvements to the default configuration (better defaultbru2017-11-261-20/+22
| | | | | | sizes of edge areas, vertical edge areas as default, and a check for the WSMOUSE_TYPE that may detect clickpads where software buttons should be placed at the top edge).
* 1. Prepare a consistent treatment of edge areas. 2. Add mechanismsbru2017-11-233-69/+213
| | | | that identify and mask touches resting in the bottom area.
* Remove unused compat macros.anton2017-11-151-5/+1
| | | | ok kettenis@ mpi@
* remove defines for ioctls the kernel doesn't recognisejsg2017-10-241-10/+1
| | | | ok mpi@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-2/+1
|
* Reduce the delay before scrolling starts.bru2017-08-251-36/+41
|
* Backout because it breaks ramdisks. Anyone making changes in the kernelderaadt2017-08-181-3/+1
| | | | is required to consider or test ramdisks before commit.
* Add compressed fonts support in the kernel.fcambus2017-08-181-1/+3
| | | | | | | | | | | | The wsdisplay_font structure has been modified to add two new members (zdata and zdata_len) to store compressed font data and its size. We define compressed fonts by setting the data field to NULL and populating the zdata and zdata_len fields. In wsfont_lock(), we check if the selected font needs to be inflated, and we call the newly introduced wsfont_inflate() if required. OK kettenis@