summaryrefslogtreecommitdiff
path: root/sys/dev/wscons
AgeCommit message (Collapse)Author
2019-10-13Convert all tsleep(9) calls to tsleep_nsec(9) in wsdisplay(4).Frederic Cambus
OK ratchov@, visa@
2019-10-13Move ws_get_param/ws_set_param into wsdisplay code.Mark Kettenis
ok deraadt@, jsg@
2019-08-31Fix a bug of the tap-detection code.Ulf Brosziewski
Do not switch from the DETECT state to IGNORE when the last (active) touch has been released. Otherwise, depending on how events are reported and synchronized, it may happen that the handler does not switch back to DETECT when necessary.
2019-08-19Add a configuration option for reverse scrolling.Ulf Brosziewski
ok patrick@
2019-08-08wskbd, wsmouse(4): tsleep(9) -> tsleep_nsec(9); ok mpi@ kn@cheloha
2019-07-01Use timeout_add_msec(9)kn
Trivial conversion from ticks to milliseconds where macros already come in milliseconds and timeout values only need reduction by hz to use the new API. OK mpi
2019-05-24Remove redundant conditional. Inspecting flags is the correct way toanton
determine if the device was opened in read/write mode. ok mpi@ visa@
2019-05-22Cleanup debug macros in wscons. Favor __func__ over spelling out the actualanton
function name in order to reduce grep noise. Also, some of them where referring to the wrong function.
2019-05-22A wscons device may only be opened in read/write mode once. However,anton
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@
2019-05-21A problem fixed in wskbd is also present in wsmux. Repeating theanton
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
2019-05-11Add the colemak keyboard layout.Aaron Bieber
OK deraadt@
2019-05-04Improve the interaction between efifb(4), inteldrm(4) and radeondrm(4)Mark Kettenis
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@
2019-03-30Restrict the number of allowed wsmux devices, just like wskbd and wsmouseanton
already does. Otherwise, malloc could panic if the device minor is sufficiently large. ok kettenis@ mpi@ visa@ Reported-by: syzbot+5a77a0fd8810d0785f61@syzkaller.appspotmail.com
2019-03-24Fix a precedence problem.Ulf Brosziewski
2019-03-24Switch to precision scrolling in wstpad.Ulf Brosziewski
2019-03-24Add new event types for precision scrolling.Ulf Brosziewski
2019-03-16Clear the me_evp pointer after calling wsmux_do_close() as opposed ofanton
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@
2019-03-02Limited the number of allowed stacked wsmux devices. A sufficiently long chainanton
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@
2019-02-20When adding a wsmux device to an existing wsmux device usinganton
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
2019-02-19whitespace nitsanton
2019-02-19favor C99 initializers for improved grepability; ok mpi@anton
2019-02-18Serialize access to the list of attached child devices belonging to aanton
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
2019-02-01free size for wscons_event; ok deraadt@ visa@anton
2019-02-01In wskbdclose(), use the same logic as in wskbdopen() to determine ifanton
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
2019-01-31Fix compilation of amd64 kernel when optimization is disabled.Todd C. Miller
C99 inline semantics resulted in undefined symbols. OK deraadt@ mpi@ dlg@
2019-01-27tweak errno in previousanton
2019-01-27Validate the user-supplied device index given to WSMUXIO_ADD_DEVICE. The sameanton
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
2018-12-29Cleanup: Initialize the pointers to position data early, and useUlf Brosziewski
them consistently.
2018-12-26Use estimates of speed to improve gesture detection.Ulf Brosziewski
ok mpi@ (to the concept)
2018-12-17When no child devices are attached to a wsmux device, make sure to return ananton
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
2018-12-05Use a time-based method for tracking motion states of touches.Ulf Brosziewski
ok mpi@
2018-11-20Add support for TIOCGPGRP ioctl commands to wscons.anton
ok visa@
2018-11-20No need for wscons to handle FIOSETOWN ioctl requests since sys_ioctl()anton
translates such requests into TIOCSPGRP. ok visa@
2018-11-19Utilize sigio with wscons. The old behavior of always making the process groupanton
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@
2018-11-11in the magical language gcc, adding brackets allows correct code to compile.Theo de Raadt
2018-11-10Remove the strong hysteresis filter.Ulf Brosziewski
It seems that the filter is obsolete, the default method is sufficient. Simplify and clean up some related code in wsmouse. ok mpi@
2018-11-05Improve the filters for scrolling.Ulf Brosziewski
ok mpi@
2018-07-30define WSMOUSE_TYPE_TOUCHPAD so non-elantech drivers can stopJoshua Stein
claiming to be elantech devices
2018-05-07Add logging options to wsmouse. Input and event logging for debugUlf Brosziewski
purposes can be enabled and disabled by WSMOUSEIO_SETPARAMS requests.
2018-04-28replace add_*_randomness with enqueue_randomness()Jasper Lievisse Adriaanse
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@
2018-04-18Try to get the layout from the default mux when attaching a consoleMartin Pieuchot
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@
2018-02-19Remove almost unused `flags' argument of suser().Martin Pieuchot
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@
2018-01-22More sizes for free() in wscons(4).Frederic Cambus
OK visa@
2018-01-17Add sizes for free() in wscons(4).Frederic Cambus
OK deraadt@, visa@, mpi@
2018-01-13coordinate again: polishingUlf Brosziewski
2018-01-11Improve the handling of coordinate inputs and filters.Ulf Brosziewski
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.
2017-12-23scrolling: take care of noise.Ulf Brosziewski
2017-12-221. Use unfiltered deltas for scrolling. 2. (Re-)Simplify the edge areaUlf Brosziewski
setup.
2017-11-26Add various improvements to the default configuration (better defaultUlf Brosziewski
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).
2017-11-231. Prepare a consistent treatment of edge areas. 2. Add mechanismsUlf Brosziewski
that identify and mask touches resting in the bottom area.