Commit Graph

27 Commits

Author SHA1 Message Date
7af5e6593f evdev.c: fix typo in comment 2016-08-15 21:08:56 +00:00
484326dbd8 Consistently use printaddr for printing addresses
* bjm.c (SYS_FUNC(init_module)): Use printaddr.
* clone.c (SYS_FUNC(clone)): Likewise.
* evdev.c (ff_effect_ioctl): Likewise.
* mtd.c (decode_mtd_oob_buf): Likewise.
* net.c (SYS_FUNC(sendmmsg), SYS_FUNC(recvmmsg), SYS_FUNC(getsockopt)):
Likewise.
* print_sigevent.c (print_sigevent): Likewise.
* printsiginfo.c (printsigval, print_si_info): Likewise.
* signal.c (decode_new_sigaction): Likewise.
* sysmips.c (SYS_FUNC(sysmips)): Likewise.
* util.c (printpathn, printstr, umoven_or_printaddr): Likewise.
* v4l2.c (print_v4l2_buffer, print_v4l2_framebuffer,
umoven_or_printaddr_ignore_syserror): Likewise.
* tests/net-icmp_filter.c (main): Update.

Based on patch by Eugene Syromyatnikov <evgsyr@gmail.com>.
2016-06-11 09:26:49 +00:00
43c8a5d0e8 Mpersify EVIOC* ioctl parser
* defs.h (evdev_abs): New xlat prototype.
(evdev_ioctl): Remove.
* evdev.c: Do not include "xlat/evdev_abs.h".
Mpersify struct ff_effect and ioctl numbers.
(evdev_ioctl): Mpersify.
* NEWS: Mention this enhancement.
2016-05-28 00:56:47 +00:00
aa21c07f2e evdev.c: fix printing of unrecognized event type passed to EVIOCGBIT
* evdev.c (bit_ioctl): If event type is not unrecognized,
print the argument as an address.
2016-05-28 00:56:47 +00:00
47be9f2597 evdev.c: fix printing of EV_PWR's argument
* evdev.c (bit_ioctl): Fix printing of comma before EV_PWR's argument.
2016-05-28 00:56:47 +00:00
3f23c0c79f evdev.c: fix indentation
* evdev.c: Fix indentation of print formats.
2016-05-28 00:56:47 +00:00
10de2eb030 evdev.c: fix decoding of EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ
* evdev.c (evdev_read_ioctl): Fix printing of the string returned
in response to EVIOCGNAME, EVIOCGPHYS, and EVIOCGUNIQ requests.
2016-05-28 00:56:47 +00:00
b29569aa1d evdev.c: fix EVIOCGVERSION decoding
* evdev.c (evdev_read_ioctl): Print EVIOCGVERSION's argument
using #x format.
2016-05-28 00:56:47 +00:00
563f0cefb1 evdev.c: fix EVIOCGMTSLOTS decoding
* evdev.c (mtslots_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
14a810e6d8 evdev.c: fix bitset decoding
* evdev.c (decode_bitset): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
e54f98a223 evdev.c: fix decoding of struct input_id
* evdev.c (getid_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
13f8e8fb4e evdev.c: fix decoding of struct input_keymap_entry
* evdev.c (keycode_V2_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
7954e2a711 evdev.c: fix decoding of EVIOCGKEYCODE/EVIOCSKEYCODE
* evdev.c (keycode_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:47 +00:00
e167006908 evdev.c: fix decoding of struct input_absinfo
* evdev.c (abs_ioctl): Use umove_or_printaddr.
2016-05-28 00:56:46 +00:00
3a45eb3711 evdev.c: fix decoding of struct ff_effect
* evdev.c (ff_effect_ioctl): Use umove_or_printaddr.
Fix printing of struct ff_effect.u member names.
2016-05-28 00:37:06 +00:00
c758ed0f50 evdev.c: fix printing of struct ff_envelope.fade_level
* evdev.c (decode_envelope): Print struct ff_envelope.fade_level
using #x format.
2016-05-28 00:37:06 +00:00
9635df43b6 evdev.c: fix decoding of EVIOCGRAB and EVIOCREVOKE
* evdev.c (evdev_write_ioctl): Print argument of EVIOCGRAB
and EVIOCREVOKE as unsigned long.
2016-05-28 00:37:06 +00:00
0039424cb9 evdev.c: fix EVIOCRMFF decoding
* evdev.c (evdev_write_ioctl): Print EVIOCRMFF's argument as int.
2016-05-28 00:37:06 +00:00
53767d8ec5 evdev.c: move handling of EVIOCGBIT to a separate function
* evdev.c (evdev_read_ioctl): Move EVIOCGBIT handling to ...
(bit_ioctl): ... new function.
2016-05-28 00:37:05 +00:00
8a18f80a37 evdev.c: reorder ioctl command checks
Change the order of ioctl command cheks to match the kernel:
1st, check for fixed-number fixed-length commands,
2nd, check for fixed-number variable-length commands,
3rd, check for multi-number fixed-length commands,
4thm check for multi-number variable-length commands.

* evdev.c (evdev_read_ioctl, evdev_write_ioctl): Reorder
ioctl command checks.
2016-05-28 00:37:05 +00:00
2114e08a87 evdev.c: decode all directions except _IOC_READ on entering syscall
* evdev.c (evdev_write_ioctl): Remove exiting check.
(evdev_read_ioctl): Move entering check ...
(evdev_ioctl): ... here.  Add RVAL_DECODED to return code in _IOC_WRITE
and default cases.
2016-05-28 00:37:05 +00:00
8d85c233d2 evdev.c: fix indentation of preprocessor directives
* evdev.c: Fix indentation of preprocessor directives.
Move inclusion of <linux/ioctl.h> into [HAVE_LINUX_INPUT_H].
2016-05-28 00:37:05 +00:00
b679508f6e Use printpair_int
* evdev.c (repeat_ioctl): Use printpair_int.
* net.c (do_pipe, sys_socketpair): Likewise.
2015-07-09 01:43:44 +00:00
Felix Janda
3460dc486d Include <linux/ioctl.h> for _IOC_* macros
Fix a compilation failure with musl libc.

* evdev.c: Include <linux/ioctl.h>.
* ioctl.c: Include <linux/ioctl.h> instead of <asm/ioctl.h>.
* ioctlsort.c: Likewise.

Reported-by: Dima Krasner <dima@dimakrasner.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2015-03-28 22:37:30 +00:00
7d8b41a4f7 evdev: decode keycode value in EVIOC[GS]KEYCODE_V2 commands
* evdev.c (keycode_V2_ioctl): Use evdev_keycode to print
input_keymap_entry.keycode.
2015-02-22 02:29:55 +00:00
19dadf9401 evdev: fix build with old kernel headers
* configure.ac: Check whether struct input_absinfo.resolution is defined
in <linux/input.h>.
* evdev.c (SYN_MAX): Add fallback definition.
(abs_ioctl): Wrap use of struct input_absinfo.resolution in #ifdef check.
(keycode_V2_ioctl, mtslots_ioctl, repeat_ioctl): Wrap in #ifdef checks.
(evdev_read_ioctl): Wrap in #ifdef checks the code that uses EV_SW,
EVIOCGREP, EVIOCGKEYCODE_V2, EVIOCGMTSLOTS, EVIOCGPROP, and EVIOCGSW.
(evdev_write_ioctl): Wrap in #ifdef checks the code that uses EVIOCSREP,
EVIOCSKEYCODE_V2, EVIOCSCLOCKID, and EVIOCREVOKE.
2015-02-22 02:29:55 +00:00
Etienne Gemsa
4f750b9ad1 Add decoding for evdev ioctls
This patch introduces decoding for evdev ioctls.  For EVIOCSFF the five
first members are decoded, the union is not.  The code was compiled and
tested on x86_64 with Linux 3.13.

* evdev.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* defs.h (evdev_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call evdev_ioctl for 'E' ioctl commands.
* xlat/evdev_autorepeat.in: New file.
* xlat/evdev_ff_status.in: New file.
* xlat/evdev_ff_types.in: New file.
* xlat/evdev_keycode.in: New file.
* xlat/evdev_leds.in: New file.
* xlat/evdev_misc.in: New file.
* xlat/evdev_mtslots.in: New file.
* xlat/evdev_prop.in: New file.
* xlat/evdev_relative_axes.in: New file.
* xlat/evdev_snd.in: New file.
* xlat/evdev_switch.in: New file.
* xlat/evdev_sync.in: New file.

Signed-off-by: Etienne Gemsa <etienne.gemsa@lse.epita.fr>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2015-02-22 02:29:54 +00:00