|
|
86f512 |
From e94797108b98045fcdbdebe2237f9d98b951fa96 Mon Sep 17 00:00:00 2001
|
|
|
86f512 |
From: Eugene Syromyatnikov <evgsyr@gmail.com>
|
|
|
86f512 |
Date: Sun, 13 Oct 2019 17:13:52 +0200
|
|
|
86f512 |
Subject: [PATCH 60/76] evdev: remove additional indentation level for switch
|
|
|
86f512 |
case labels
|
|
|
86f512 |
|
|
|
86f512 |
And while we are here, factor out evdev_write_ioctl_mpers call
|
|
|
86f512 |
out of the switch statement.
|
|
|
86f512 |
|
|
|
86f512 |
* evdev.c (bit_ioctl, evdev_read_ioctl, evdev_ioctl): Remove
|
|
|
86f512 |
one indentation level inside the switch statements.
|
|
|
86f512 |
(evedev_write_ioctl): Remove one indentation level inside the switch
|
|
|
86f512 |
statement; move default branch out of the switch statement.
|
|
|
86f512 |
|
|
|
86f512 |
Conflicts:
|
|
|
86f512 |
evdev.c
|
|
|
86f512 |
---
|
|
|
86f512 |
evdev.c | 231 +++++++++++++++++++++++++++++-----------------------------
|
|
|
86f512 |
evdev_mpers.c | 86 +++++++++++-----------
|
|
|
86f512 |
2 files changed, 158 insertions(+), 159 deletions(-)
|
|
|
86f512 |
|
|
|
86f512 |
diff --git a/evdev.c b/evdev.c
|
|
|
86f512 |
index e402d26..b9ac666 100644
|
|
|
86f512 |
--- a/evdev.c
|
|
|
86f512 |
+++ b/evdev.c
|
|
|
86f512 |
@@ -238,48 +238,48 @@ bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr,
|
|
|
86f512 |
const kernel_ulong_t arg)
|
|
|
86f512 |
{
|
|
|
86f512 |
switch (ev_nr) {
|
|
|
86f512 |
- case 0:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_ev,
|
|
|
86f512 |
- EV_MAX, "EV_???", XT_SORTED);
|
|
|
86f512 |
- case EV_KEY:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_keycode,
|
|
|
86f512 |
- KEY_MAX, "KEY_???", XT_INDEXED);
|
|
|
86f512 |
- case EV_REL:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_relative_axes,
|
|
|
86f512 |
- REL_MAX, "REL_???", XT_INDEXED);
|
|
|
86f512 |
- case EV_ABS:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_abs,
|
|
|
86f512 |
- ABS_MAX, "ABS_???", XT_INDEXED);
|
|
|
86f512 |
- case EV_MSC:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_misc,
|
|
|
86f512 |
- MSC_MAX, "MSC_???", XT_INDEXED);
|
|
|
86f512 |
- case EV_SW:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_switch,
|
|
|
86f512 |
- SW_MAX, "SW_???", XT_INDEXED);
|
|
|
86f512 |
- case EV_LED:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_leds,
|
|
|
86f512 |
- LED_MAX, "LED_???", XT_INDEXED);
|
|
|
86f512 |
- case EV_SND:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_snd,
|
|
|
86f512 |
- SND_MAX, "SND_???", XT_INDEXED);
|
|
|
86f512 |
- case EV_REP:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_autorepeat,
|
|
|
86f512 |
- REP_MAX, "REP_???", XT_INDEXED);
|
|
|
86f512 |
- case EV_FF:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_ff_types,
|
|
|
86f512 |
- FF_MAX, "FF_???", XT_SORTED);
|
|
|
86f512 |
- case EV_PWR:
|
|
|
86f512 |
- tprints(", ");
|
|
|
86f512 |
- printnum_int(tcp, arg, "%d");
|
|
|
86f512 |
- return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
- case EV_FF_STATUS:
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_ff_status,
|
|
|
86f512 |
- FF_STATUS_MAX, "FF_STATUS_???",
|
|
|
86f512 |
- XT_INDEXED);
|
|
|
86f512 |
- default:
|
|
|
86f512 |
- tprints(", ");
|
|
|
86f512 |
- printaddr(arg);
|
|
|
86f512 |
- return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
+ case 0:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_ev,
|
|
|
86f512 |
+ EV_MAX, "EV_???", XT_SORTED);
|
|
|
86f512 |
+ case EV_KEY:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_keycode,
|
|
|
86f512 |
+ KEY_MAX, "KEY_???", XT_INDEXED);
|
|
|
86f512 |
+ case EV_REL:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_relative_axes,
|
|
|
86f512 |
+ REL_MAX, "REL_???", XT_INDEXED);
|
|
|
86f512 |
+ case EV_ABS:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_abs,
|
|
|
86f512 |
+ ABS_MAX, "ABS_???", XT_INDEXED);
|
|
|
86f512 |
+ case EV_MSC:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_misc,
|
|
|
86f512 |
+ MSC_MAX, "MSC_???", XT_INDEXED);
|
|
|
86f512 |
+ case EV_SW:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_switch,
|
|
|
86f512 |
+ SW_MAX, "SW_???", XT_INDEXED);
|
|
|
86f512 |
+ case EV_LED:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_leds,
|
|
|
86f512 |
+ LED_MAX, "LED_???", XT_INDEXED);
|
|
|
86f512 |
+ case EV_SND:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_snd,
|
|
|
86f512 |
+ SND_MAX, "SND_???", XT_INDEXED);
|
|
|
86f512 |
+ case EV_REP:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_autorepeat,
|
|
|
86f512 |
+ REP_MAX, "REP_???", XT_INDEXED);
|
|
|
86f512 |
+ case EV_FF:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_ff_types,
|
|
|
86f512 |
+ FF_MAX, "FF_???", XT_SORTED);
|
|
|
86f512 |
+ case EV_PWR:
|
|
|
86f512 |
+ tprints(", ");
|
|
|
86f512 |
+ printnum_int(tcp, arg, "%d");
|
|
|
86f512 |
+ return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
+ case EV_FF_STATUS:
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_ff_status,
|
|
|
86f512 |
+ FF_STATUS_MAX, "FF_STATUS_???",
|
|
|
86f512 |
+ XT_INDEXED);
|
|
|
86f512 |
+ default:
|
|
|
86f512 |
+ tprints(", ");
|
|
|
86f512 |
+ printaddr(arg);
|
|
|
86f512 |
+ return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
}
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
@@ -289,63 +289,63 @@ evdev_read_ioctl(struct tcb *const tcp, const unsigned int code,
|
|
|
86f512 |
{
|
|
|
86f512 |
/* fixed-number fixed-length commands */
|
|
|
86f512 |
switch (code) {
|
|
|
86f512 |
- case EVIOCGVERSION:
|
|
|
86f512 |
- tprints(", ");
|
|
|
86f512 |
- printnum_int(tcp, arg, "%#x");
|
|
|
86f512 |
- return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
- case EVIOCGEFFECTS:
|
|
|
86f512 |
- tprints(", ");
|
|
|
86f512 |
- printnum_int(tcp, arg, "%u");
|
|
|
86f512 |
- return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
- case EVIOCGID:
|
|
|
86f512 |
- return getid_ioctl(tcp, arg);
|
|
|
86f512 |
+ case EVIOCGVERSION:
|
|
|
86f512 |
+ tprints(", ");
|
|
|
86f512 |
+ printnum_int(tcp, arg, "%#x");
|
|
|
86f512 |
+ return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
+ case EVIOCGEFFECTS:
|
|
|
86f512 |
+ tprints(", ");
|
|
|
86f512 |
+ printnum_int(tcp, arg, "%u");
|
|
|
86f512 |
+ return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
+ case EVIOCGID:
|
|
|
86f512 |
+ return getid_ioctl(tcp, arg);
|
|
|
86f512 |
# ifdef EVIOCGREP
|
|
|
86f512 |
- case EVIOCGREP:
|
|
|
86f512 |
- return repeat_ioctl(tcp, arg);
|
|
|
86f512 |
+ case EVIOCGREP:
|
|
|
86f512 |
+ return repeat_ioctl(tcp, arg);
|
|
|
86f512 |
# endif
|
|
|
86f512 |
- case EVIOCGKEYCODE:
|
|
|
86f512 |
- return keycode_ioctl(tcp, arg);
|
|
|
86f512 |
+ case EVIOCGKEYCODE:
|
|
|
86f512 |
+ return keycode_ioctl(tcp, arg);
|
|
|
86f512 |
# ifdef EVIOCGKEYCODE_V2
|
|
|
86f512 |
- case EVIOCGKEYCODE_V2:
|
|
|
86f512 |
- return keycode_V2_ioctl(tcp, arg);
|
|
|
86f512 |
+ case EVIOCGKEYCODE_V2:
|
|
|
86f512 |
+ return keycode_V2_ioctl(tcp, arg);
|
|
|
86f512 |
# endif
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
/* fixed-number variable-length commands */
|
|
|
86f512 |
switch (_IOC_NR(code)) {
|
|
|
86f512 |
# ifdef EVIOCGMTSLOTS
|
|
|
86f512 |
- case _IOC_NR(EVIOCGMTSLOTS(0)):
|
|
|
86f512 |
- return mtslots_ioctl(tcp, code, arg);
|
|
|
86f512 |
+ case _IOC_NR(EVIOCGMTSLOTS(0)):
|
|
|
86f512 |
+ return mtslots_ioctl(tcp, code, arg);
|
|
|
86f512 |
# endif
|
|
|
86f512 |
- case _IOC_NR(EVIOCGNAME(0)):
|
|
|
86f512 |
- case _IOC_NR(EVIOCGPHYS(0)):
|
|
|
86f512 |
- case _IOC_NR(EVIOCGUNIQ(0)):
|
|
|
86f512 |
- tprints(", ");
|
|
|
86f512 |
- if (syserror(tcp))
|
|
|
86f512 |
- printaddr(arg);
|
|
|
86f512 |
- else
|
|
|
86f512 |
- printstrn(tcp, arg, tcp->u_rval);
|
|
|
86f512 |
- return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
+ case _IOC_NR(EVIOCGNAME(0)):
|
|
|
86f512 |
+ case _IOC_NR(EVIOCGPHYS(0)):
|
|
|
86f512 |
+ case _IOC_NR(EVIOCGUNIQ(0)):
|
|
|
86f512 |
+ tprints(", ");
|
|
|
86f512 |
+ if (syserror(tcp))
|
|
|
86f512 |
+ printaddr(arg);
|
|
|
86f512 |
+ else
|
|
|
86f512 |
+ printstrn(tcp, arg, tcp->u_rval);
|
|
|
86f512 |
+ return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
# ifdef EVIOCGPROP
|
|
|
86f512 |
- case _IOC_NR(EVIOCGPROP(0)):
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_prop,
|
|
|
86f512 |
- INPUT_PROP_MAX, "PROP_???",
|
|
|
86f512 |
- XT_INDEXED);
|
|
|
86f512 |
+ case _IOC_NR(EVIOCGPROP(0)):
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_prop,
|
|
|
86f512 |
+ INPUT_PROP_MAX, "PROP_???",
|
|
|
86f512 |
+ XT_INDEXED);
|
|
|
86f512 |
# endif
|
|
|
86f512 |
- case _IOC_NR(EVIOCGSND(0)):
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_snd,
|
|
|
86f512 |
- SND_MAX, "SND_???", XT_INDEXED);
|
|
|
86f512 |
+ case _IOC_NR(EVIOCGSND(0)):
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_snd,
|
|
|
86f512 |
+ SND_MAX, "SND_???", XT_INDEXED);
|
|
|
86f512 |
# ifdef EVIOCGSW
|
|
|
86f512 |
- case _IOC_NR(EVIOCGSW(0)):
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_switch,
|
|
|
86f512 |
- SW_MAX, "SW_???", XT_INDEXED);
|
|
|
86f512 |
+ case _IOC_NR(EVIOCGSW(0)):
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_switch,
|
|
|
86f512 |
+ SW_MAX, "SW_???", XT_INDEXED);
|
|
|
86f512 |
# endif
|
|
|
86f512 |
- case _IOC_NR(EVIOCGKEY(0)):
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_keycode,
|
|
|
86f512 |
- KEY_MAX, "KEY_???", XT_INDEXED);
|
|
|
86f512 |
- case _IOC_NR(EVIOCGLED(0)):
|
|
|
86f512 |
- return decode_bitset(tcp, arg, evdev_leds,
|
|
|
86f512 |
- LED_MAX, "LED_???", XT_INDEXED);
|
|
|
86f512 |
+ case _IOC_NR(EVIOCGKEY(0)):
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_keycode,
|
|
|
86f512 |
+ KEY_MAX, "KEY_???", XT_INDEXED);
|
|
|
86f512 |
+ case _IOC_NR(EVIOCGLED(0)):
|
|
|
86f512 |
+ return decode_bitset(tcp, arg, evdev_leds,
|
|
|
86f512 |
+ LED_MAX, "LED_???", XT_INDEXED);
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
/* multi-number fixed-length commands */
|
|
|
86f512 |
@@ -366,38 +366,37 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code,
|
|
|
86f512 |
/* fixed-number fixed-length commands */
|
|
|
86f512 |
switch (code) {
|
|
|
86f512 |
# ifdef EVIOCSREP
|
|
|
86f512 |
- case EVIOCSREP:
|
|
|
86f512 |
- return repeat_ioctl(tcp, arg);
|
|
|
86f512 |
+ case EVIOCSREP:
|
|
|
86f512 |
+ return repeat_ioctl(tcp, arg);
|
|
|
86f512 |
# endif
|
|
|
86f512 |
- case EVIOCSKEYCODE:
|
|
|
86f512 |
- return keycode_ioctl(tcp, arg);
|
|
|
86f512 |
+ case EVIOCSKEYCODE:
|
|
|
86f512 |
+ return keycode_ioctl(tcp, arg);
|
|
|
86f512 |
# ifdef EVIOCSKEYCODE_V2
|
|
|
86f512 |
- case EVIOCSKEYCODE_V2:
|
|
|
86f512 |
- return keycode_V2_ioctl(tcp, arg);
|
|
|
86f512 |
+ case EVIOCSKEYCODE_V2:
|
|
|
86f512 |
+ return keycode_V2_ioctl(tcp, arg);
|
|
|
86f512 |
# endif
|
|
|
86f512 |
- case EVIOCRMFF:
|
|
|
86f512 |
- tprintf(", %d", (int) arg);
|
|
|
86f512 |
- return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
- case EVIOCGRAB:
|
|
|
86f512 |
+ case EVIOCRMFF:
|
|
|
86f512 |
+ tprintf(", %d", (int) arg);
|
|
|
86f512 |
+ return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
+ case EVIOCGRAB:
|
|
|
86f512 |
# ifdef EVIOCREVOKE
|
|
|
86f512 |
- case EVIOCREVOKE:
|
|
|
86f512 |
+ case EVIOCREVOKE:
|
|
|
86f512 |
# endif
|
|
|
86f512 |
- tprintf(", %" PRI_klu, arg);
|
|
|
86f512 |
- return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
+ tprintf(", %" PRI_klu, arg);
|
|
|
86f512 |
+ return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
# ifdef EVIOCSCLOCKID
|
|
|
86f512 |
- case EVIOCSCLOCKID:
|
|
|
86f512 |
- tprints(", ");
|
|
|
86f512 |
- printnum_int(tcp, arg, "%u");
|
|
|
86f512 |
- return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
+ case EVIOCSCLOCKID:
|
|
|
86f512 |
+ tprints(", ");
|
|
|
86f512 |
+ printnum_int(tcp, arg, "%u");
|
|
|
86f512 |
+ return RVAL_IOCTL_DECODED;
|
|
|
86f512 |
# endif
|
|
|
86f512 |
- default: {
|
|
|
86f512 |
- int rc = evdev_write_ioctl_mpers(tcp, code, arg);
|
|
|
86f512 |
-
|
|
|
86f512 |
- if (rc != RVAL_DECODED)
|
|
|
86f512 |
- return rc;
|
|
|
86f512 |
- }
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
+ int rc = evdev_write_ioctl_mpers(tcp, code, arg);
|
|
|
86f512 |
+
|
|
|
86f512 |
+ if (rc != RVAL_DECODED)
|
|
|
86f512 |
+ return rc;
|
|
|
86f512 |
+
|
|
|
86f512 |
/* multi-number fixed-length commands */
|
|
|
86f512 |
if ((_IOC_NR(code) & ~ABS_MAX) == _IOC_NR(EVIOCSABS(0)))
|
|
|
86f512 |
return abs_ioctl(tcp, arg);
|
|
|
86f512 |
@@ -416,14 +415,14 @@ evdev_ioctl(struct tcb *const tcp,
|
|
|
86f512 |
const unsigned int code, const kernel_ulong_t arg)
|
|
|
86f512 |
{
|
|
|
86f512 |
switch (_IOC_DIR(code)) {
|
|
|
86f512 |
- case _IOC_READ:
|
|
|
86f512 |
- if (entering(tcp))
|
|
|
86f512 |
- return 0;
|
|
|
86f512 |
- return evdev_read_ioctl(tcp, code, arg);
|
|
|
86f512 |
- case _IOC_WRITE:
|
|
|
86f512 |
- return evdev_write_ioctl(tcp, code, arg) | RVAL_DECODED;
|
|
|
86f512 |
- default:
|
|
|
86f512 |
- return RVAL_DECODED;
|
|
|
86f512 |
+ case _IOC_READ:
|
|
|
86f512 |
+ if (entering(tcp))
|
|
|
86f512 |
+ return 0;
|
|
|
86f512 |
+ return evdev_read_ioctl(tcp, code, arg);
|
|
|
86f512 |
+ case _IOC_WRITE:
|
|
|
86f512 |
+ return evdev_write_ioctl(tcp, code, arg) | RVAL_DECODED;
|
|
|
86f512 |
+ default:
|
|
|
86f512 |
+ return RVAL_DECODED;
|
|
|
86f512 |
}
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
diff --git a/evdev_mpers.c b/evdev_mpers.c
|
|
|
86f512 |
index ff99544..ebf9658 100644
|
|
|
86f512 |
--- a/evdev_mpers.c
|
|
|
86f512 |
+++ b/evdev_mpers.c
|
|
|
86f512 |
@@ -71,45 +71,45 @@ ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg)
|
|
|
86f512 |
ffe.replay.delay);
|
|
|
86f512 |
|
|
|
86f512 |
switch (ffe.type) {
|
|
|
86f512 |
- case FF_CONSTANT:
|
|
|
86f512 |
- tprintf(", constant={level=%" PRId16,
|
|
|
86f512 |
- ffe.u.constant.level);
|
|
|
86f512 |
- decode_envelope(&ffe.u.constant.envelope);
|
|
|
86f512 |
- tprints("}");
|
|
|
86f512 |
- break;
|
|
|
86f512 |
- case FF_RAMP:
|
|
|
86f512 |
- tprintf(", ramp={start_level=%" PRId16
|
|
|
86f512 |
- ", end_level=%" PRId16,
|
|
|
86f512 |
- ffe.u.ramp.start_level,
|
|
|
86f512 |
- ffe.u.ramp.end_level);
|
|
|
86f512 |
- decode_envelope(&ffe.u.ramp.envelope);
|
|
|
86f512 |
- tprints("}");
|
|
|
86f512 |
- break;
|
|
|
86f512 |
- case FF_PERIODIC:
|
|
|
86f512 |
- tprintf(", periodic={waveform=%" PRIu16
|
|
|
86f512 |
- ", period=%" PRIu16
|
|
|
86f512 |
- ", magnitude=%" PRId16
|
|
|
86f512 |
- ", offset=%" PRId16
|
|
|
86f512 |
- ", phase=%" PRIu16,
|
|
|
86f512 |
- ffe.u.periodic.waveform,
|
|
|
86f512 |
- ffe.u.periodic.period,
|
|
|
86f512 |
- ffe.u.periodic.magnitude,
|
|
|
86f512 |
- ffe.u.periodic.offset,
|
|
|
86f512 |
- ffe.u.periodic.phase);
|
|
|
86f512 |
- decode_envelope(&ffe.u.periodic.envelope);
|
|
|
86f512 |
- tprintf(", custom_len=%u, custom_data=",
|
|
|
86f512 |
- ffe.u.periodic.custom_len);
|
|
|
86f512 |
- printaddr(ptr_to_kulong(ffe.u.periodic.custom_data));
|
|
|
86f512 |
- tprints("}");
|
|
|
86f512 |
- break;
|
|
|
86f512 |
- case FF_RUMBLE:
|
|
|
86f512 |
- tprintf(", rumble={strong_magnitude=%" PRIu16
|
|
|
86f512 |
- ", weak_magnitude=%" PRIu16 "}",
|
|
|
86f512 |
- ffe.u.rumble.strong_magnitude,
|
|
|
86f512 |
- ffe.u.rumble.weak_magnitude);
|
|
|
86f512 |
- break;
|
|
|
86f512 |
- default:
|
|
|
86f512 |
- break;
|
|
|
86f512 |
+ case FF_CONSTANT:
|
|
|
86f512 |
+ tprintf(", constant={level=%" PRId16,
|
|
|
86f512 |
+ ffe.u.constant.level);
|
|
|
86f512 |
+ decode_envelope(&ffe.u.constant.envelope);
|
|
|
86f512 |
+ tprints("}");
|
|
|
86f512 |
+ break;
|
|
|
86f512 |
+ case FF_RAMP:
|
|
|
86f512 |
+ tprintf(", ramp={start_level=%" PRId16
|
|
|
86f512 |
+ ", end_level=%" PRId16,
|
|
|
86f512 |
+ ffe.u.ramp.start_level,
|
|
|
86f512 |
+ ffe.u.ramp.end_level);
|
|
|
86f512 |
+ decode_envelope(&ffe.u.ramp.envelope);
|
|
|
86f512 |
+ tprints("}");
|
|
|
86f512 |
+ break;
|
|
|
86f512 |
+ case FF_PERIODIC:
|
|
|
86f512 |
+ tprintf(", periodic={waveform=%" PRIu16
|
|
|
86f512 |
+ ", period=%" PRIu16
|
|
|
86f512 |
+ ", magnitude=%" PRId16
|
|
|
86f512 |
+ ", offset=%" PRId16
|
|
|
86f512 |
+ ", phase=%" PRIu16,
|
|
|
86f512 |
+ ffe.u.periodic.waveform,
|
|
|
86f512 |
+ ffe.u.periodic.period,
|
|
|
86f512 |
+ ffe.u.periodic.magnitude,
|
|
|
86f512 |
+ ffe.u.periodic.offset,
|
|
|
86f512 |
+ ffe.u.periodic.phase);
|
|
|
86f512 |
+ decode_envelope(&ffe.u.periodic.envelope);
|
|
|
86f512 |
+ tprintf(", custom_len=%u, custom_data=",
|
|
|
86f512 |
+ ffe.u.periodic.custom_len);
|
|
|
86f512 |
+ printaddr(ptr_to_kulong(ffe.u.periodic.custom_data));
|
|
|
86f512 |
+ tprints("}");
|
|
|
86f512 |
+ break;
|
|
|
86f512 |
+ case FF_RUMBLE:
|
|
|
86f512 |
+ tprintf(", rumble={strong_magnitude=%" PRIu16
|
|
|
86f512 |
+ ", weak_magnitude=%" PRIu16 "}",
|
|
|
86f512 |
+ ffe.u.rumble.strong_magnitude,
|
|
|
86f512 |
+ ffe.u.rumble.weak_magnitude);
|
|
|
86f512 |
+ break;
|
|
|
86f512 |
+ default:
|
|
|
86f512 |
+ break;
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
tprints("}");
|
|
|
86f512 |
@@ -121,10 +121,10 @@ MPERS_PRINTER_DECL(int, evdev_write_ioctl_mpers, struct tcb *const tcp,
|
|
|
86f512 |
const unsigned int code, const kernel_ulong_t arg)
|
|
|
86f512 |
{
|
|
|
86f512 |
switch (code) {
|
|
|
86f512 |
- case EVIOCSFF:
|
|
|
86f512 |
- return ff_effect_ioctl(tcp, arg);
|
|
|
86f512 |
- default:
|
|
|
86f512 |
- return RVAL_DECODED;
|
|
|
86f512 |
+ case EVIOCSFF:
|
|
|
86f512 |
+ return ff_effect_ioctl(tcp, arg);
|
|
|
86f512 |
+ default:
|
|
|
86f512 |
+ return RVAL_DECODED;
|
|
|
86f512 |
}
|
|
|
86f512 |
}
|
|
|
86f512 |
|
|
|
86f512 |
--
|
|
|
86f512 |
2.1.4
|
|
|
86f512 |
|