aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/evdev/cdev.c
Commit message (Collapse)AuthorAgeFilesLines
* kern: Make fileops and filterops tables const where possibleMark Johnston2024-11-261-1/+1
| | | | | | No functional change intended. MFC after: 1 week
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* evdev: Multitouch code style changes.Vladimir Kondratyev2021-08-241-1/+1
| | | | | | | | | | | 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. MFC after: 2 weeks
* evdev: Make variable-size ioctls return actual length of copyouted dataVladimir Kondratyev2021-01-201-6/+23
| | | | | | | | | on success instead of 0 to match Linux. Imprivata binary depends on this. Submitted by: Shunchao Hu <ankohuu_outlook.com> Reviewed by: wulf Differential revision: https://reviews.freebsd.org/D28218
* hid: Add missing input enter/exit epoch pairs.Vladimir Kondratyev2021-01-141-0/+5
| | | | This was affecting unloading keyboard driver and kdb-related code.
* evdev: Allow open() handler to be interrupted by a signalVladimir Kondratyev2021-01-071-5/+6
| | | | | | | It is possible that the client list lock is taken by other process for too long due to e.g. IO timeouts. Allow user to terminate open() in this case. Reviewed by: markj (as part of D27865)
* evdev: Make open(2) and close(3) handlers sleepable.Vladimir Kondratyev2021-01-071-12/+11
| | | | | | | | | | | | | | | | | | | | At the beginning of evdev there was a LOR between hardware driver's and evdev client list locks as they were taken in different order at driver's interrupt and evdev open()/close() handlers. The LOR was fixed with introduction of evdev_register_mtx() function which allowed to use a hardware driver's lock as evdev client list lock. While this works good with PS/2 and USB, this does not work with I2C. Unlike PS/2 and USB, I2C open()/close() handlers do unbound sleeps while waiting for I2C bus to release and while performing IO. This change uses epoch(9) for traversing evdev client list in interrupt handler to avoid the LOR thus making possible to convert evdev client list lock to sleepable sx. While here add brief locking protocol description. Reviewed by: markj Differential revision: https://reviews.freebsd.org/D27865
* evdev: return error rather than zero-length data on blocked read()Vladimir Kondratyev2020-03-291-0/+2
| | | | | | | | | if blocked process has been woken up by evdev device destruction. MFC after: 2 weeks Notes: svn path=/head/; revision=359429
* evdev: Add COMPAT_FREEBSD32 support for amd64 archVladimir Kondratyev2020-03-291-12/+68
| | | | | | | | | | | | | | Incompatibility between i386 and amd64 evdev ABIs was caused by presence of 'struct timeval' in evdev protocol. Replace it with 'struct timeval32' for 32 bit binaries. Big-endian platforms may require additional work due to bitstr_t (array of unsigned longs) usage in ioctl interface. MFC after: 2 weeks Notes: svn path=/head/; revision=359428
* evdev: disable evdev if it is invoked from KDB or panic contextVladimir Kondratyev2018-10-271-0/+13
| | | | | | | | | | | | | | | This allow to prevent deadlock on entering KDB if one of evdev locks is already taken by userspace process. Also this change discards all but LED console events produced by KDB as unrelated to userspace. Tested by: dumbbell (as part of D15070) Objected by: bde (as 'KDB lock an already locked mutex' problem solution) MFC after: 1 month Notes: svn path=/head/; revision=339824
* evdev: remove soft context from evdev methods parameter list.Vladimir Kondratyev2018-08-131-2/+2
| | | | | | | | | | | | | Now softc should be retrieved from struct edvev * pointer with evdev_get_softc() helper. wmt(4) is a sample of driver that support both KPI. Reviewed by: hselasky, gonzo Differential Revision: https://reviews.freebsd.org/D16614 Notes: svn path=/head/; revision=337720
* Change my email address to wulf@FreeBSD.org in copyright headers.Vladimir Kondratyev2017-07-231-1/+1
| | | | | | | | Approved by: gonzo (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=321399
* evdev: style(9), sort headers alphabeticallyVladimir Kondratyev2017-07-231-9/+8
| | | | | | | | | | Pointed out by: bde Reviewed by: gonzo Approved by: gonzo (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=321397
* [evdev] Fix race condition between client's event queue reading and droppingOleksandr Tymoshenko2017-03-121-3/+4
| | | | | | | | | Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9320 Notes: svn path=/head/; revision=315177
* Remove semicolon from the end of the macro definitionOleksandr Tymoshenko2016-09-121-1/+1
| | | | | | | Reported by: hans Notes: svn path=/head/; revision=305749
* Add evdev protocol implementationOleksandr Tymoshenko2016-09-111-0/+860
evdev is a generic input event interface compatible with Linux evdev API at ioctl level. It allows using unmodified (apart from header name) input evdev drivers in Xorg, Wayland, Qt. This commit has only generic kernel API. evdev support for individual hardware drivers like ukbd, ums, atkbd, etc. will be committed later. Project was started by Jakub Klama as part of GSoC 2014. Jakub's evdev implementation was later used as a base, updated and finished by Vladimir Kondratiev. Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru> Reviewed by: adrian, hans Differential Revision: https://reviews.freebsd.org/D6998 Notes: svn path=/head/; revision=305706