History log of /dflybsd-src/sys/dev/misc/syscons/sysmouse.c (Results 1 – 25 of 41)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# a162a738 06-Apr-2024 Michael Neumann <mneumann@ntecs.de>

Sync psm/evdev/atkbd with FreeBSD

Partially sync psm, evdev and atkbd drivers with FreeBSD HEAD as of now.

The result should be much better input device support (Touchpad etc.) on
some Laptops.

Te

Sync psm/evdev/atkbd with FreeBSD

Partially sync psm, evdev and atkbd drivers with FreeBSD HEAD as of now.

The result should be much better input device support (Touchpad etc.) on
some Laptops.

Tested on following hardware:

* Panasonic CF-SV (myself)
* Tuxedo InfinityBook 14 (myself)
* Lenovo Thinkpad T480 (Antonio)
* Lenovo Thinkpad T490 (Peeter)

As for the Panasonic CF-SV and Tuxedo InfinityBook 14, it works so much
better than before. Without this commit, the touchpad was either not
recognized (missing active AUX port multiplexing) or barely useable.

Credits go as well to the authors of Bug report #3206 (htse, daftaupe)
who did similar work in parallel.

To summarize some of the changes:

* psm, evdev (w/o uinput) and to some degree the atkbd driver is synced
with FreeBSD.

* As for atkbd, mainly the parts related to support active AUX port
multiplexer code is synced from FreeBSD. Active AUX port MUX is
required to detect for example my synaptics touchpad on the Pansonic
CF-SV, otherwise the touchpad is only recognized as standard PS/2 mouse.
Other laptops use the same "method" to attach "multiple" mice to the AUX
port.

* This patch also includes the patch given in Bug report #3206:
https://bugs.dragonflybsd.org/issues/3206

* Adds kern.features sysctl. Xorg uses e.g. kern.features.evdev
and kern.features.evdev_support to detect if evdev is available.

* Tested with a Synaptics Touchpad using both moused/sysmouse and
libinput under X11. Both work reliably.

* This patch enables hw.psm.{synaptics,trackpoint,elantech}_support
by default. This should give a better user-experience by default.

* Set hw.psm.mux_disabled=1 if your keyboard no longer works due
to the AUX MUX code (I haven't synced the quirks code yet).

* atkbd - periodic polling is disabled. Can be turned on by setting
loader tunable hw.atkbd.hz to 1 or 10 (as it was before).

How to use this with Xorg? Set:

sysctl kern.evdev.rcpt_mask=6

Then, either add moused_enable=YES to /etc/rc.conf. Then you can
use this with the default xorg.conf.

To use this with libinput, which I do, I had to add the following to
/etc/X11/xorg.conf:

Section "InputClass"
Identifier "libinput pointer catchall"
MatchIsPointer "on"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
EndSection

and in $HOME/.xinitrc:

xinput set-prop 'SynPS/2 Synaptics TouchPad' 'libinput Tapping Enabled' 1

to enable tapping. Not needed if sysmouse is used (requires running
moused). Scrolling feels better with libinput, but that is likely just
a better default setting.

---

In the following, each commit message is listed:

psm - Fix choosing wrong mode for synaptic device + trackpoint

With guest trackpoint present trackpoint probing switched synaptics
device to absolute mode with different protocol instead of keeping it
in relative mode.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/dcc414b888bd855d3ad30bea0e20fb35733097cb

psm - Fix calculation for clickpad softbuttons at the top

On laptops like the ThinkPad X240, ClickPad buttons are located at the
top. The hw.psm.synaptics.softbuttons_y sysctl was supposed to allow this
by setting the value to a negative one (e.g. -1700). However, the
condition was wrong (double negative), and doing that placed the buttons
in an unreachable area.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/f3bae0ea25e2f2b76f5dcd8a6a800344803a900f

psm - Fix triple-finger taps reported as double-finger for Elan hw v.4 touchpads

Wait for all advertised head packets after status packet have been received.
This fixes rare but quite annoying issue in Elan hw v.4 touchpads support
when triple-finger taps are reported as double-finger taps under several
circumstances.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/933ef2d3b285966c604d21848963afc9e9a07a0b

psm - Reduce default tap_min_queue size for Elan touchpads

Elan hw v.4 touchpads often sends touchpad release packet right after
touchpad touch one. Most probably this happens due to PS/2 limited bandwith.
Reducing of tap_min_queue size to 1 makes multifinger tap detection
more reliable in this case.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/51de77dd3d64846b8ed8462b366f83f4cfabc1b7

psm - Adjust Elantech palm width threshold to nearly match synaptics defaults

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/8a98c8c412d0c7171054423dced8874f62cd6082

psm - reduce cursor jumping on palm detection

This is done with discarding pointer movements rather then mouse packets

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/848714bcb443af01596a455cad58beda33caf98b

psm - Enable palm detection on two finger touches for multitouch trackpads

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/eb65854355fe829af8c9b0d5c5a2c324a220ed10

psm - Report 3-rd and 4-th fingers as first finger for Elan hw v.2/v.3

as Linux does. It should not affect gesture processing in current state
as it ignores finger coords on 3-finger tap detection but it should make
evdev reports looking more Linux-alike.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/6c85d7cb3230313a90ae2f5fb4fe943d5ad686f0

psm - Set predefined logical touchpad sizes for several ancient Elan hw v.2 models

This change is based on Linux driver. Determine logical trace size. It
used for calculation of touch sizes in surface units for MT-protocol
type B evdev reports.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/21cb8f6288d49b2a274db0fa531306a25220abd8

psm - Reduce synaptics touch sensitivity

Increase hw.psm.synaptics.min_pressure default value from 16 to 32
to nearly match Linux driver (30-35 hysteresis loop).
This makes libinput tap detection more reliable.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/ae3b1e4a342724a1ac2151f2526cd8b8f69c60b5

psm - Add sanity checks to Synaptics touchpad driver resolution parser

This fixes "Kernel has only x or y resolution, not both" libinput error.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/8352f326c3db80e16d43d5b29a9cf55d914becdd

psm - Skip sync check when `PSM_CONFIG_NOCHECKSYNC` is set

In psmprobe(), we set the initial `syncmask` to the vendor default value
if the `PSM_CONFIG_NOCHECKSYNC` bit is unset. However, we currently only
set it for the Elantech touchpad later in psmattach(), thus `syncmask`
is always configured.

Now, we check `PSM_CONFIG_NOCHECKSYNC` and skip sync check if it is set.
This fixes Elantech touchpad support for units which have `hascrc` set.

To clarify that, when we log the `syncmask` and `syncbits` fields, also
mention if they are actually used.

Finally, when we set `PSM_CONFIG_NOCHECKSYNC`, clear `PSM_NEED_SYNCBITS`
flag.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/9402bd96df8000c2ac5d9c239ff746919af0dd66

psm - Don't try to detect trackpoint packets if the Elantech device has none

This fixes a panic when `EVDEV_SUPPORT` is enabled: if a trackpoint
packet was detected but there was no trackpoint, we still tried to emit an
evdev event even though the associated relative evdev device (`evdev_r`)
was not initialized.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/b9b766ae4708627ab5f62377c30ec070b6dd103d

psm - Log syncmask[1], not syncmask[0] twice

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/90b0eb9b4a7b94c81f4183937210371c02fc3f58

psm - Add support for HP EliteBook 1040 ForcePads.

ForcePads do not have any physical buttons, instead they detect click
based on finger pressure. Forcepads erroneously report button click
if there are 2 or more fingers on the touchpad breaking multifinger
gestures. To workaround this start reporting a click only after
4 consecutive single touch packets has been received. Skip these packets
in case more contacts appear.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/7d1460a4b1a0e5cd9fbed912b7d4480d0f769d4a

psm - Reduce psm watchdog verbosity

Modern touchpads do not issue interrupts on inactivity so "lost interrupt"
message became annoying spam nowadays. This change quiets the message
if debug.psm.loglevel=5 (or less) is set in /boot/loader.conf

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/f451e00544de30a6ce00b15bf056bedb880e882f

psm - Fix panic occuring soon after PS/2 packet has been rejected by synaptics or elantech sanity checker

This patch has already been partially applied in commit 906090f3.

After packet has been rejected contents of packet buffer is not cleared
with setting of inputbytes counter to 0. So when this packet buffer is
filled again being an element of circular queue, new data appends to old
data rather than overwrites it. This leads to packet buffer overflow
after 10 rounds.

Fix it with setting of packet's inputbytes counter to 0 after rejection.

While here add extra logging of rejected packets.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/74a53bd1315341bc33f9dd0dc589d0397080f270

psm - Always initialize used values in debug print

'status' array passed to get_mouse_status() is usually uninitialized by
callers.

Fully populating it with values in get_mouse_status() can fail due to
read_aux_data().

Additionally, nothing in API constrains 'len' to be >= 3. In practice,
every caller passes three, so perhaps that argument should just be removed.
Refactoring is a larger change, though.

Remove use of potentially uninitialized values by:
1. Only printing 3 debug statuses if the passed array was at least
'len' >= 3;
2. Populating 'status' array up to first three elements, if read_aux_data()
failed.

No functional change intended.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/893daee680dcb62886ce0c3d74457834a1c2ead9

psm - Initialize variables before use

dxp/dyp could have been used uninitialized in the subsequent debugging log
invocation.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/015ab098439452cb798dbea5dd2d4fe57c72808c

psm - Add minimal support for active AUX port multiplexers

Active PS/2 multiplexing is a method for attaching up to four PS/2
pointing devices to a computer. Enabling of multiplexed mode allows
commands to be directed to individual devices using routing prefixes.
Multiplexed mode reports input with each byte tagged to identify
its source. This method differs from one currently supported by psm(4)
where so called guest device (trackpoint) is attached to special
interface located on the host device (touchpad) and latter performs
guest protocol conversion to special encapsulation packet format.

At present time active PS/2 multiplexing is used in some models of
HP laptops e.g. EliteBook 8560w, 9470m. Enabling of absolute operation
mode on such touchpads is connected with following problems:
1. Touchpad's port priority is lower than trackpoint's. That blocks
information queries thus prevents touchpad detection and configuration.
2. Touchpad and trackpoint have different protocol packet sizes and
sync bytes.

As PS/2 usage is on decline only minimal possible set of changes to
support Synaptics touchpad and generic mouses is implemented.
Active multiplexing mode is enabled only at probe stage to scan through
attached PS/2 devices to query and configure Synaptics touchpad.
After touchpad has been configured, mux is switched back to legacy
(hidden multiplexing) mode to perform normal interrupt-driven input
data processing. Overflow bit values rather than tags are used to
separate packets produced by different devices. Switching back to
legacy mode allows to avoid psm(4) and atkbd(4) rework to support
4 instances of mouse driver.

Note: While in hidden multiplexing mode KBC does some editing of the
packet stream. It remembers the button bits from the last packet
received from each device, and replaces the button bits of every
packet with the logical OR of all devices’ most recent button bits.
This sort of button crosstalk results in spurious button events
which are inhibitted with various tricks. E.g. trackpoint middle
button events are suppressed while trackpad surface is touched and
touchpad left and right button events are suppressed if corresponding
trackpoint buttons are pressed.

Not applied is a section related to EVDEV support.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/80203ccefd77badf5dc58a63047a1da2d303472c

psm - do not process gestures when palm is present

Ignoring of gesture processing when the palm is detected helps to reduce
some of the erratic pointer behavior.

This fixes regression introduced in FreeBSD r317814.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/51319286ed34e70b00a709ac36a1120c26d95a5d

psm - respect tap_disabled configuration with enabled Extended support

This fixes a bug where, even when hw.psm.tap_enabled=0, touchpad taps
were processed.
tap_enabled has three states: unconfigured, disabled, and enabled (-1, 0, 1).
To respect PR kern/139272, taps are ignored only when explicity disabled.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/0c8a908463dd601a860c6ec9e52742684df3e63b

psm - give names to synaptics commands

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/bf33f20d962c1b4443324af205170a35acce63f7

psm - Add natural scrolling support to sysmouse protocol

This change enables natural scrolling with two finger scroll enabled
and when user is using a trackpad (mouse and trackpoint are not affected).
Depending on trackpad model it can be activated with setting of
hw.psm.synaptics.natural_scroll or hw.psm.elantech.natural_scroll sysctl
values to 1.

Evdev protocol is not affected by this change too. Tune userland client
e.g. libinput to enable natural scrolling in that case.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/3b11e3b6e195d08f6ca6e32464f49b7495697045

psm - Fix Elantech trackpoint support.

Sign bits for X and Y motion data were taken from wrong places.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/8fa46200391063bd5c15a25d9f9b06354fcd4147

psm - Add extra sanity checks to Elantech trackpoint packet parser

Not included are parts related to evedev.

Add strict checks for unused bit states in Elantech trackpoint packet
parser to filter out spurious events produces by some hardware which
are detected as trackpoint packets. See comment on r328191 for example.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/6c53fea7d62edeeb7d1e0d2d1da922a3a67c0bce

psm - Enable touchpads and trackpads by default

Enable synaptics and elantech touchpads, as well as IBM/Lenovo TrackPoints
by default, instead of having users find and toggle a loader tunable.
This makes things like two finger scroll and other modern features work out
of the box with X. By enabling these settings by default, we get a better
desktop experience in X, since xserver and evdev can make use of the more
advanced synaptics and elantech features.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/2dd9a967d299a1c0c1363e82a1e3f0c19b4b9846

psm - Add macOS-like three finger drag trackpad gesture

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/5a037b11974c8c74c7df22378633caca71456a53

psm - properly check for atkbdc_open failure

atkbdc_open can return NULL if the unit's out of bounds or the softc isn't
setup. Check it to be safe.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/6d3c9beedb7f100922a61f1e089254be24e48547

psm - Do not disable trackpoint when hw.psm.elantech.touchpad_off is enabled

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/8137fb2e38f7b88d2cce9c29a2f00cda33a89d1c

psm - Workaround active PS/2 multiplexor hang

which happens on some laptops after returning to legacy multiplexing mode
at initialization stage.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/ec45be6c36dcb373103014e16a3623e0c182a5bb

psm - Always initialize Synaptics touchpad report range with defaults

Otherwise libinput refuses to recoginize some Synaptics touchpads with
"kernel bug: device has min == max on ABS_X" message in Xorg.log.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/2ac1c1927258e649e3ca3269aea40fb4c63e2296

psm - Probe Synaptics touchpad with active multiplexing mode enabled

if it is only multiplexed device. Also enable syncbit checks for them.
This fixes touchpad recognition on Panasonic Toughbook CF-MX4 laptop.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/f5998d20ed80fdc1cb3ba0c245cae5f179e22fe2

psm - Disable KVM switch "jitter" clamping for absolute touchpads

FreeBSD commit r123442 [1] introduced solution for clamping of PS/2
mice jitter when using a KVM. Solution is to buffer mouse packets for
0.050ms if mouse activity has not been seen for more than 0.5 seconds.
Then flush that data to driver if no validation errors found or drop the
entire queue otherwise.

While it works well with relative devices it has issues with absolute ones
Depending on history buffering may results in delaying of the touch front
edge for 0.050ms that affects gesture processing (tap detection).

As absolute touchpads usually are built-in devices we can safely disable
bufferization and KVM jitter clamping to avoid such a delays.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/bedf31ad7e15c7d3e3ff9e5295bfd5454fbb42fa

[1]: https://svnweb.freebsd.org/base?view=revision&revision=123442

atkbd - Reduce polling rate from 10Hz to ~1Hz

In my understanding this is only needed to workaround lost interrupts.
I was thinking to remove it completely, but the comment about edge-
triggered interrupt may be true and needs deeper investigation. ~1Hz
should be often enough to handle the supposedly rare loss cases, but
rare enough to not appear in top. Add sysctl hw.atkbd.hz to tune it.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/9e007a88d65ba0d23e73c3c052d474a78260d503

psm - Remove write-only variables

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/9b0eb55048e6294c00db70f8ebecf18c1c3c1dbe

psm - Swap the unit member in the softc for a device_t

This also adds a device_log() function to subr_bus.c.

This entails various changes to make this driver more "modern"
(new-bus vs pre-new-bus) using device_log() and device_printf() rather
than psm%d.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/a6c09f20e8e00bec7d9eb088b4f32dd38bf7f490

psm - Fix typo in comment

s/diable/disable/

Taken-from: FreeBSD

psm - recognize post-IBM trackpoints on Thinkpads

Newer Thinkpads (e.g. X1 Carbon 7th Gen) come with trackpoints from
different vendors. They are mostly compatible with the original one.
Not sure all features are going to work, but at least this fixes resume
operation.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/2bcef59d428a672a9144c574b4b4f42f5f0e5b2a

psm/atkbd - Sync with FreeBSD (partially)

Drop MOUSE_GETVARS and MOUSE_SETVARS ioctls support

These ioctls are not documented and only stubbed in a few drivers:
psm(4) and syscon's sysmouse(4). The only exception is MOUSE_GETVARS
implemented in psm(4)

Given the fact that they were introduced 20 years ago and implementation
has never been completed, remove any related code.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/67580198b70aa58d572a2602a02d1a70d9971350

evdev/psm - update evdev, add evdev-support to psm(4)

* Partially update evdev from FreeBSD and add evdev-support to psm

* Touches ums(4)

atkbd - Disable periodic polling by default

If this cause keyboard/mouse freezes on some hardware, please set
loader tunable hw.atkbd.hz=1 as workaround and report the issue.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/ce881170088c4c98c036fe561f8ee8413c2e2585

psm - use evdev_register_mtx()

This uses psm_softc->lock for evdev operations

evdev - Hide "kern.evdev.rcpt_mask" sysctl if kernel compiled w/o EVDEV_SUPPORT

Now presence of this sysctl can be used for discovery if evdev support
for hybrid devices is compiled into kernel or not.
Hide "kern.evdev.sysmouse_t_axis" sysctl for the same reason.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/233e10741a791bfa570a69804ae40f9fffcdcd43

evdev - Take driver's lock in cdev write handler if necessary

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/f3f8069493a5a9db77a5f660f4f9e613742fdc42

evdev - Disable value normalization and state filtering for SND events

Some events can take sound pitch as a value so can not be represented
as binary on/off events. Tracking for on/off state is left in place
as it is a part of the evdev API.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/c6e809423fde2f5ce02b9fef5910c34e434e7c36

evdev - Do not start/stop softrepeat callout if no clients attached

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/37ff33454873d8639d10dc5c72d76fb3a1eb540f

evdev - Fix evdev codes for slash and asterisk numpad keys of AT-keyboards

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/b12ac17ef1928858ed236a9a5851c30f465f8d26

evdev - Fix pause key release event in AT keyboard set 1 to evdev xlat-or

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/a0e9218c019b30a68fe137f8540a8c8da947480b

evdev - export event device properties through sysctl interface

A big security advantage of Wayland is not allowing applications to read
input devices all the time. Having /dev/input/* accessible to the user
account subverts this advantage.

libudev-devd was opening the evdev devices to detect their types (mouse,
keyboard, touchpad, etc). This don't work if /dev/input/* is inaccessible.
With the kernel exposing this information as sysctls (kern.evdev.input.*),
we can work w/o /dev/input/* access, preserving the Wayland security model.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/f99e7b1aed7ea65ca0dbe5b182f2b9cbfdfe54db
FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/dd3a67a0781261c1fdd670456f492ecb695b8fe5

evdev - return error rather than zero-length data on blocked read()

if blocked process has been woken up by evdev device destruction.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/006eb44926d6949e0b60b21920f1ea93f03efd2f

evdev - Use proper mutex reference in autorepeat callout initialization

This fixes panic occuring when evdev key autorepeat is enabled by driver
which initializes evdev with external mutex.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/68cc053763eec2f2afef8de8a12f6786805c9e24

evdev - Use LIST_FOREACH_MUTABLE

instead of LIST_FOREACH as we are removing elements in the middle.

This fixes a panic when detaching USB mouse.

Note that LIST_FOREACH_SAFE in FreeBSD corresponds to our
LIST_FOREACH_MUTABLE.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/5396856ee0e158a1505dce733aad4f9b42afafbb

evdev - Add AT translated set1 scancodes for F-unlocked F1-12 keys

"F lock" is a switch between two sets of scancodes for function keys F1-F12
found on some Logitech and Microsoft PS/2 keyboards [1]. When "F lock" is
pressed, then F1-F12 act as function keys and produce usual keyscans for
these keys. When "F lock" is depressed, F1-F12 produced the same keyscans
but prefixed with E0.
Some laptops use [2] E0-prefixed F1-F12 scancodes for non-standard keys.

[1] https://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html
[2] https://reviews.freebsd.org/D21565

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/8701adbeb0d4e29c9aae68b493317fb581ae520e

evdev - Sync event codes with Linux kernel 5.6

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/d316504953cf0890433ac2cb75d10c6fcf0c0263

evdev - Add AT translated set1 scancodes for 'Eisu' & 'Kana' keys

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/94811094f8357824108a57169d1f5b1e2ffb56ca

evdev - recognize the Chromebook menu key as F13 like Linux does

This is the key on the right side of the function keys, with the
"hamburger menu" icon on it.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/54cca285fc3d32e0be4028d17c055424b49f4f7d

evdev - Implement fuzz

Fuzz is used to filter noise from the event stream.
Upcoming gamepad drivers use it.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/3b2175fdb62c7f872e78ce732952f2ac2ff99c8d

evdev - Linux evdev does not terminate truncated strings with 0

It seems that DragonFly ioctl(2) cannot return the actual length of
copyouted data as only error=0 is treated as "no-error".

Based-on-FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/7a810290b8f6c6885fdb9917cf590d46fa270a61

Revert "evdev - Linux evdev does not terminate truncated strings with 0"

This reverts commit 12ac6b7825fba8f53f9cbfe3a6aaed27983c1848.

I think it's safer to properly 0-terminate the strings. The only reason
why this commit landed in FreeBSD was to support a Linux binary Imprivata,
which we can't run anyways.

evdev - Do not check maximal contact number for MT initialization

This allows singletouch devices which use multitouch protocols to work.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/e40fec4ec9a7a6625b3e332d4f856eb1d05f0def

evdev - Multitouch code style changes

1. Move touch count reporting helpers to utils. They are not multitouch.
2. Use evdev_mt prefix for private multitouch support routines.
3. Use int instead of int32_t where fixed size is not required.
4. Export some internal functions.

This change should be no-op.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/98a7606b85e05132f328a2498dccab78df31cb7e

evdev - Use bitsets to track active touches and slots changed in current report

Obtained from: OpenBSD

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/2dc7188e532f0147b36a44ce5c033d9f59cbd9f4

evdev - Send first active rather than 0-th slot state as ST report

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/fbe17f9017e785dd564ce7fc5553a9136d3a0b03

kern - Add kern.features sysctl and FEATURE macro

Similar to FreeBSD.

xorg-server checks e.g. for kern.features.evdev or
kern.features.evdev_support.

Add evdev_support feature

evdev - force no fuzz for autogenerated single touch compat events

As fuzz has already been applied on multitouch event processing.
This allows to remove existing workaround for double fuzz procesing.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/314913ed7c6e6e1b7c80a1063620f478961419b7

evdev - Normalize width and pressure of single touch compat events

to match Synaptics touchpad reporting range.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/127e54deb6d8899e1dc1bc6251d512e19f21b0f1

evdev - Give short aliases to items of evdev_mt_slot array

with using of unioned anonymous structure.

Access to the same data by using different members of union generally
works despite it is not supported by C specs.

Also add helper function to report entire slot state.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/059360287e3344f48f5a7839e2d6d54016b18b19

evdev - Make MT tracking IDs monotonically increasing sequence

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/66bd52f5e241bd2548015f847f12cdff69176c40

evdev - Import support for touch-tracking

Touch tracking is a process of assignment of unique trackingID to each
initiated contact on the surface. Keeping the trackingIDs persistent
across multitouch reports requires solving of so called Euclidian
Bipartite Matching problem.

This commit imports EBM-solver implementation based on Dinitz-Kronrod
algorithm to find minimum cost matching between contacts listed in two
consecutive reports.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/4c0a134e32a7f4dec556fea15c8de22f69864492
Obtained-from: OpenBSD

evdev - Add implicit mode for touch tracking

In implicit mode assignment of slot number and tracking id is performed
automatically on each synchronization requested by device driver.

This is done with creation of intermediate buffer for multitouch events.
This buffer holds untracked events until synchronization is requested by
device driver. It is needed as touch assigment requires
knowledges of all touch positions pushed in current and previous reports.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/f76051c7dabe952b75127a8031d87d78b603be20

evdev - Add support for automatic MT protocol type A to type B conversion

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/d056693d7bc6c1b5f2c1612e5b34807f173e21c7

evdev - Do not export multitouch functions which are unused outside evdev

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/35bc295b30ef91f1835a0ee0225e8d957a9ebddd

evdev - Fix a typo in a commit

- s/prefered/preferred/

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/efd8749fe5cccb6c3d6b5f3c3515bf89ad306bcc

evdev - Fix "hancha" and "han/yong" korean keys handling

The Korean keyboard has two keys, the Korean/Chinese and the
Korean/English toggles, that generate scancodes 0xF1 and 0xF2
(respectively) when pressed, and nothing when released. They do not
repeat.
As Hanyong/Hancha keys are generally greater than 0x80, which is
generally considered a release key, add extra preceding press key event
to generate press/release pair.
Swap Hanyong/Hancha key codes to match reality.

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/6a26c99f827ffa9da5e23d466eeb17131fc75238

evdev - Sync event codes with Linux kernel 6.5

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/87a53bef41fe769920f925e74fedddafd5187b93

Fix commit "Import support for touch tracking" (afa7dd1f)

- Fix maybe-uninitialized warning
- use bitcount32
- bring in bit_foreach_at from FreeBSD
- reorder "static"

evdev - Sync our copy of freebsd-bitstring.h with FreeBSD

- Mostly using proper functions returning the result
instead of assigning it to a pointer.

- Specify bit positions using size_t instead of int.

evdev - Conditionalize kern.features.evdev_support

evdev - Sync with FreeBSD

atkbdc: use proper pointer type for KBDC

FreeBSD-commit: https://github.com/freebsd/freebsd-src/commit/e9305818c1ba2762ec0ac40294cde0a4b96806c7

atkbdc - add quirks from FreeBSD

atkbd - sync with FreeBSD

atkbd - Incoorperate patch from bugreport #3206

https://bugs.dragonflybsd.org/issues/3206

show more ...


# 2b3f93ea 13-Oct-2023 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Add per-process capability-based restrictions

* This new system allows userland to set capability restrictions which
turns off numerous kernel features and root accesses. These restricti

kernel - Add per-process capability-based restrictions

* This new system allows userland to set capability restrictions which
turns off numerous kernel features and root accesses. These restrictions
are inherited by sub-processes recursively. Once set, restrictions cannot
be removed.

Basic restrictions that mimic an unadorned jail can be enabled without
creating a jail, but generally speaking real security also requires
creating a chrooted filesystem topology, and a jail is still needed
to really segregate processes from each other. If you do so, however,
you can (for example) disable mount/umount and most global root-only
features.

* Add new system calls and a manual page for syscap_get(2) and syscap_set(2)

* Add sys/caps.h

* Add the "setcaps" userland utility and manual page.

* Remove priv.9 and the priv_check infrastructure, replacing it with
a newly designed caps infrastructure.

* The intention is to add path restriction lists and similar features to
improve jailess security in the near future, and to optimize the
priv_check code.

show more ...


Revision tags: v6.4.0, v6.4.0rc1, v6.5.0, v6.2.2, v6.2.1, v6.3.0, v6.0.1, v6.0.0, v6.0.0rc1, v6.1.0, v5.8.3, v5.8.2, v5.8.1
# b2dae643 12-Apr-2020 Peeter Must <karu.pruun@gmail.com>

kernel/sysmouse: Add evdev support

Obtained-from: FreeBSD


Revision tags: v5.8.0, v5.9.0, v5.8.0rc1, v5.6.3, v5.6.2, v5.6.1, v5.6.0, v5.6.0rc1, v5.7.0, v5.4.3, v5.4.2
# fcf6efef 02-Mar-2019 Sascha Wildner <saw@online.de>

kernel: Remove numerous #include <sys/thread2.h>.

Most of them were added when we converted spl*() calls to
crit_enter()/crit_exit(), almost 14 years ago. We can now
remove a good chunk of them agai

kernel: Remove numerous #include <sys/thread2.h>.

Most of them were added when we converted spl*() calls to
crit_enter()/crit_exit(), almost 14 years ago. We can now
remove a good chunk of them again for where crit_*() are
no longer used.

I had to adjust some files that were relying on thread2.h
or headers that it includes coming in via other headers
that it was removed from.

show more ...


Revision tags: v5.4.1, v5.4.0, v5.5.0, v5.4.0rc1, v5.2.2, v5.2.1, v5.2.0, v5.3.0, v5.2.0rc
# 2a070c43 28-Feb-2018 Imre Vadász <imre@vdsz.com>

sysmouse - Fix sigio handling after c2962d9da8200947ee394b190eea39d437fb1af7


# c2962d9d 22-Feb-2018 Imre Vadász <imre@vdsz.com>

syscons - Detangle sysmouse from tty handling, implement a custom FIFO.

* This avoids unnecessary IPIs and other overhead from the tty handling.

* This also makes reads from the character device al

syscons - Detangle sysmouse from tty handling, implement a custom FIFO.

* This avoids unnecessary IPIs and other overhead from the tty handling.

* This also makes reads from the character device always get only complete
sysmouse packets.

show more ...


# 095f0dab 22-Feb-2018 Imre Vadász <imre@vdsz.com>

syscons - No special minor device number is needed anymore for sysmouse.


Revision tags: v5.0.2, v5.0.1, v5.0.0, v5.0.0rc2, v5.1.0, v5.0.0rc1, v4.8.1, v4.8.0, v4.6.2, v4.9.0, v4.8.0rc
# 481d12aa 09-Jan-2017 Matthew Dillon <dillon@apollo.backplane.com>

kernel - Incidental MPLOCK removal (non-performance)

* Remove the MPLOCK in a ton of places that don't need it or can be
trivially tokenized or locked.

* Mostly non-performance adjustments, thoug

kernel - Incidental MPLOCK removal (non-performance)

* Remove the MPLOCK in a ton of places that don't need it or can be
trivially tokenized or locked.

* Mostly non-performance adjustments, though the X server does use
scmouse or sysmouse.

show more ...


Revision tags: v4.6.1, v4.6.0, v4.6.0rc2, v4.6.0rc, v4.7.0, v4.4.3, v4.4.2
# b0a45e06 19-Dec-2015 Imre Vadasz <imre@vdsz.com>

syscons: Remove leftover CDEV_MAJOR #define from sysmouse.c


Revision tags: v4.4.1, v4.4.0, v4.5.0, v4.4.0rc, v4.2.4, v4.3.1, v4.2.3, v4.2.1, v4.2.0, v4.0.6, v4.3.0, v4.2.0rc, v4.0.5
# f3f3eadb 12-Mar-2015 Sascha Wildner <saw@online.de>

kernel: Move semicolon from the definition of SYSINIT() to its invocations.

This affected around 70 of our (more or less) 270 SYSINIT() calls.

style(9) advocates the terminating semicolon to be sup

kernel: Move semicolon from the definition of SYSINIT() to its invocations.

This affected around 70 of our (more or less) 270 SYSINIT() calls.

style(9) advocates the terminating semicolon to be supplied by the
invocation too, because it can make life easier for editors and other
source code parsing programs.

show more ...


Revision tags: v4.0.4, v4.0.3, v4.0.2, v4.0.1, v4.0.0, v4.0.0rc3, v4.0.0rc2, v4.0.0rc, v4.1.0, v3.8.2, v3.8.1, v3.6.3, v3.8.0, v3.8.0rc2, v3.9.0, v3.8.0rc, v3.6.2, v3.6.1, v3.6.0, v3.7.1, v3.6.0rc, v3.4.3, v3.4.2, v3.4.1, v3.4.0, v3.4.0rc, v3.5.0, v3.2.2, v3.2.1, v3.2.0, v3.3.0, v3.0.3, v3.0.2, v3.0.1, v3.1.0, v3.0.0
# 86d7f5d3 26-Nov-2011 John Marino <draco@marino.st>

Initial import of binutils 2.22 on the new vendor branch

Future versions of binutils will also reside on this branch rather
than continuing to create new binutils branches for each new version.


Revision tags: v2.12.0, v2.13.0, v2.10.1, v2.11.0, v2.10.0, v2.9.1, v2.8.2, v2.8.1, v2.8.0, v2.9.0, v2.6.3, v2.7.3, v2.6.2, v2.7.2, v2.7.1, v2.6.1, v2.7.0, v2.6.0, v2.5.1, v2.4.1, v2.5.0, v2.4.0
# 3e82b46c 01-Aug-2009 Matthew Dillon <dillon@apollo.backplane.com>

DEVFS - remove dev_ops_add(), dev_ops_get(), and get_dev()


Revision tags: v2.3.2
# 37b65fbb 12-Jul-2009 Peter Avalos <pavalos@theshell.com>

Merge branch 'master' of /home/www-data/gitweb/dragonfly


# a32446b7 11-Jul-2009 Matthew Dillon <dillon@apollo.backplane.com>

vrevoke/single-user - fix more revoke issues.

* vrevoke() no longer clears vp->v_rdev. Doing so interferes with specfs's
ability to call dev_dclose(). Fixing this will allow the regular close

vrevoke/single-user - fix more revoke issues.

* vrevoke() no longer clears vp->v_rdev. Doing so interferes with specfs's
ability to call dev_dclose(). Fixing this will allow the regular close
of the vnode to close the underlying device.

Since the revoke code detaches the vnode from any user-visible file
descriptors the vnode will end up being closed the moment the last
referenced to the detached fp goes away.

* kill 1 no longer leaves the syscons in a state where both /dev/ttyv0 and
/dev/console are marked open (due to the above bug). This state would
cause the keyboard to stop working sometimes when dropping into single
user.

* Add dev_drevoke() and friends. This allows a device to do something
when an attempt is made to revoke() the related vnode.

TTY and PTY devices now attempt to break out of any ttysleep() operation
(such as when processes are blocked in read()). This is advisory and
if it fails to break a process out of a blocked condition that process
will still detach after the blocked condition is resolved normally.

show more ...


Revision tags: v2.3.1, v2.2.1, v2.2.0, v2.3.0
# 08abcb65 03-Jan-2009 Matthew Dillon <dillon@apollo.backplane.com>

Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into devel


# 4173863d 30-Dec-2008 Matthias Schmidt <matthias@dragonflybsd.org>

Merge branch 'master' of git://chlamydia.fs.ei.tum.de/dragonfly


# 8a27f1c9 31-Dec-2008 Michael Neumann <mneumann@ntecs.de>

Merge branches 'master' and 'suser_to_priv'

Conflicts:

sys/netinet/ip_carp.c
sys/platform/pc64/amd64/machdep.c


# 895c1f85 15-Dec-2008 Michael Neumann <mneumann@ntecs.de>

suser_* to priv_* conversion


Revision tags: v2.1.1, v2.0.1
# b13267a5 10-Sep-2006 Matthew Dillon <dillon@dragonflybsd.org>

Change the kernel dev_t, representing a pointer to a specinfo structure,
to cdev_t. Change struct specinfo to struct cdev. The name 'cdev' was taken
from FreeBSD. Remove the dev_t shim for the ker

Change the kernel dev_t, representing a pointer to a specinfo structure,
to cdev_t. Change struct specinfo to struct cdev. The name 'cdev' was taken
from FreeBSD. Remove the dev_t shim for the kernel.

This commit generally removes the overloading of 'dev_t' between userland and
the kernel.

Also fix a bug in libkvm where a kernel dev_t (now cdev_t) was not being
properly converted to a userland dev_t.

show more ...


# fef8985e 28-Jul-2006 Matthew Dillon <dillon@dragonflybsd.org>

MASSIVE reorganization of the device operations vector. Change cdevsw
to dev_ops. dev_ops is a syslink-compatible operations vector structure
similar to the vop_ops structure used by vnodes.

Remov

MASSIVE reorganization of the device operations vector. Change cdevsw
to dev_ops. dev_ops is a syslink-compatible operations vector structure
similar to the vop_ops structure used by vnodes.

Remove a huge number of instances where a thread pointer is still being
passed as an argument to various device ops and other related routines.
The device OPEN and IOCTL calls now take a ucred instead of a thread pointer,
and the CLOSE call no longer takes a thread pointer.

show more ...


# eda99557 01-Feb-2006 Simon Schubert <corecode@dragonflybsd.org>

Set proper termio flags for the sysmouse tty


# 6bc31f17 11-Jun-2005 Matthew Dillon <dillon@dragonflybsd.org>

spl->critical section conversions.


# e4c9c0c8 19-May-2004 Matthew Dillon <dillon@dragonflybsd.org>

Device layer rollup commit.

* cdevsw_add() is now required. cdevsw_add() and cdevsw_remove() may specify
a mask/match indicating the range of supported minor numbers. Multiple
cdevsw_add()'s u

Device layer rollup commit.

* cdevsw_add() is now required. cdevsw_add() and cdevsw_remove() may specify
a mask/match indicating the range of supported minor numbers. Multiple
cdevsw_add()'s using the same major number, but distinctly different
ranges, may be issued. All devices that failed to call cdevsw_add() before
now do.

* cdevsw_remove() now automatically marks all devices within its supported
range as being destroyed.

* vnode->v_rdev is no longer resolved when the vnode is created. Instead,
only v_udev (a newly added field) is resolved. v_rdev is resolved when
the vnode is opened and cleared on the last close.

* A great deal of code was making rather dubious assumptions with regards
to the validity of devices associated with vnodes, primarily due to
the persistence of a device structure due to being indexed by (major, minor)
instead of by (cdevsw, major, minor). In particular, if you run a program
which connects to a USB device and then you pull the USB device and plug
it back in, the vnode subsystem will continue to believe that the device
is open when, in fact, it isn't (because it was destroyed and recreated).

In particular, note that all the VFS mount procedures now check devices
via v_udev instead of v_rdev prior to calling VOP_OPEN(), since v_rdev
is NULL prior to the first open.

* The disk layer's device interaction has been rewritten. The disk layer
(i.e. the slice and disklabel management layer) no longer overloads
its data onto the device structure representing the underlying physical
disk. Instead, the disk layer uses the new cdevsw_add() functionality
to register its own cdevsw using the underlying device's major number,
and simply does NOT register the underlying device's cdevsw. No
confusion is created because the device hash is now based on
(cdevsw,major,minor) rather then (major,minor).

NOTE: This also means that underlying raw disk devices may use the entire
device minor number instead of having to reserve the bits used by the disk
layer, and also means that can we (theoretically) stack a fully
disklabel-supported 'disk' on top of any block device.

* The new reference counting scheme prevents this by associating a device
with a cdevsw and disconnecting the device from its cdevsw when the cdevsw
is removed. Additionally, all udev2dev() lookups run through the cdevsw
mask/match and only successfully find devices still associated with an
active cdevsw.

* Major work on MFS: MFS no longer shortcuts vnode and device creation. It
now creates a real vnode and a real device and implements real open and
close VOPs. Additionally, due to the disk layer changes, MFS is no longer
limited to 255 mounts. The new limit is 16 million. Since MFS creates a
real device node, mount_mfs will now create a real /dev/mfs<PID> device
that can be read from userland (e.g. so you can dump an MFS filesystem).

* BUF AND DEVICE STRATEGY changes. The struct buf contains a b_dev field.
In order to properly handle stacked devices we now require that the b_dev
field be initialized before the device strategy routine is called. This
required some additional work in various VFS implementations. To enforce
this requirement, biodone() now sets b_dev to NODEV. The new disk layer
will adjust b_dev before forwarding a request to the actual physical
device.

* A bug in the ISO CD boot sequence which resulted in a panic has been fixed.

Testing by: lots of people, but David Rhodus found the most aggregious bugs.

show more ...


# 455fcd7e 13-May-2004 Matthew Dillon <dillon@dragonflybsd.org>

device switch 1/many: Remove d_autoq, add d_clone (where d_autoq was).

d_autoq was used to allow the device port dispatch to mix old-style synchronous
calls with new style messaging calls within a p

device switch 1/many: Remove d_autoq, add d_clone (where d_autoq was).

d_autoq was used to allow the device port dispatch to mix old-style synchronous
calls with new style messaging calls within a particular device. It was never
used for that purpose.

d_clone will be more fully implemented as work continues. We are going to
install d_port in the dev_t (struct specinfo) structure itself and d_clone
will be needed to allow devices to 'revector' the port on a minor-number
by minor-number basis, in particular allowing minor numbers to be directly
dispatched to distinct threads. This is something we will be needing later
on.

show more ...


# 1f2de5d4 07-Aug-2003 Matthew Dillon <dillon@dragonflybsd.org>

kernel tree reorganization stage 1: Major cvs repository work (not logged as
commits) plus a major reworking of the #include's to accomodate the
relocations.

* CVS repository files manually move

kernel tree reorganization stage 1: Major cvs repository work (not logged as
commits) plus a major reworking of the #include's to accomodate the
relocations.

* CVS repository files manually moved. Old directories left intact
and empty (temporary).

* Reorganize all filesystems into vfs/, most devices into dev/,
sub-divide devices by function.

* Begin to move device-specific architecture files to the device
subdirs rather then throwing them all into, e.g. i386/include

* Reorganize files related to system busses, placing the related code
in a new bus/ directory. Also move cam to bus/cam though this may
not have been the best idea in retrospect.

* Reorganize emulation code and place it in a new emulation/ directory.

* Remove the -I- compiler option in order to allow #include file
localization, rename all config generated X.h files to use_X.h to
clean up the conflicts.

* Remove /usr/src/include (or /usr/include) dependancies during the
kernel build, beyond what is normally needed to compile helper
programs.

* Make config create 'machine' softlinks for architecture specific
directories outside of the standard <arch>/include.

* Bump the config rev.

WARNING! after this commit /usr/include and /usr/src/sys/compile/*
should be regenerated from scratch.

show more ...


12