Bug 218627 - [PATCH] add Evdev ioctl handler to the Linux compat layer
Summary: [PATCH] add Evdev ioctl handler to the Linux compat layer
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Dmitry Chagin
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-04-13 11:21 UTC by Jan Kokemüller
Modified: 2017-04-30 06:17 UTC (History)
2 users (show)

See Also:


Attachments
add an Evdev ioctl handler to the Linux compat layer (4.36 KB, patch)
2017-04-13 11:21 UTC, Jan Kokemüller
no flags Details | Diff
add an Evdev ioctl handler to the Linux compat layer - v2 (4.17 KB, patch)
2017-04-17 15:32 UTC, Jan Kokemüller
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kokemüller 2017-04-13 11:21:41 UTC
Created attachment 181754 [details]
add an Evdev ioctl handler to the Linux compat layer

I've added an Evdev ioctl handler to the Linux compat layer.
This depends on the slightly changed definition of the EVIOCGRAB and EVIOCREVOKE ioctls (bug 218625).

To test this I've built libevdev in a Ubuntu 16.04 VM and ran the programs from the "tools" folder. They work with Evdev devices created by evdevfbsd (at least on amd64, I didn't test i386).
Comment 1 Jan Kokemüller 2017-04-17 15:32:12 UTC
Created attachment 181846 [details]
add an Evdev ioctl handler to the Linux compat layer - v2

I've updated the patch. Some comments are clarified and EVIOCRMFF (which is another IOWINT ioctl like EVIOCGRAB and EVIOCREVOKE) is now also translated.

Changing the definition of EVIOCGRAB and EVIOCREVOKE is not needed as I've learned (see bug 218625).

EVIOCRMFF is untested as it's related to force feedback (unsupported on FreeBSD for now).
Comment 2 Vladimir Kondratyev freebsd_committer freebsd_triage 2017-04-18 14:42:57 UTC
There are 3 more ioctls with directions defined in Linux and FreeBSD differently:

ioctl            Linux FreeBSD
EVIOCGKEYCODE(2) _IOR  _IOWR
EVIOCGMASK       _IOR  _IOW

They are not supported in in-kernel evdev driver yet, but should work in webcamd cuse-backed driver
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-04-23 07:44:42 UTC
A commit references this bug:

Author: dchagin
Date: Sun Apr 23 07:43:51 UTC 2017
New revision: 317323
URL: https://svnweb.freebsd.org/changeset/base/317323

Log:
  Add Evdev ioctl handler to the Linuxulator.

  PR:		218627
  Submitted by:	Jan Kokem?ller
  Reported by:	Jan Kokem?ller
  MFC after:	1 week

Changes:
  head/sys/compat/linux/linux_ioctl.c
  head/sys/compat/linux/linux_ioctl.h
Comment 4 Dmitry Chagin freebsd_committer freebsd_triage 2017-04-23 07:52:19 UTC
grab
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-04-30 06:15:49 UTC
A commit references this bug:

Author: dchagin
Date: Sun Apr 30 06:14:58 UTC 2017
New revision: 317602
URL: https://svnweb.freebsd.org/changeset/base/317602

Log:
  MFC r317323:

  Add Evdev ioctl handler to the Linuxulator.

  PR:		218627

Changes:
_U  stable/11/
  stable/11/sys/compat/linux/linux_ioctl.c
  stable/11/sys/compat/linux/linux_ioctl.h