summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2020-03-05 16:11:53 +0100
committerEugene Syromyatnikov <evgsyr@gmail.com>2020-03-23 13:32:14 +0100
commit27a4da08772c4c369257028d3d456ad006171545 (patch)
treefb809a3524378f97bfcac0ed78681b252012c5fe
parentd8667df8dfcb64a9a7d3c99a52b68975d16725a3 (diff)
downloadstrace-27a4da08772c4c369257028d3d456ad006171545.tar.gz
v4l2: update struct v4l2_tuner (VIDIOC_G_TUNER/VIDIOC_S_TUNER) decoder
-rw-r--r--tests/ioctl_v4l2-success.c11
-rw-r--r--tests/ioctl_v4l2.c7
-rw-r--r--v4l2.c31
-rw-r--r--xlat/v4l2_tuner_rxsubchannels.in (renamed from xlat/v4l2_tuner_rxsubchanses.in)0
4 files changed, 31 insertions, 18 deletions
diff --git a/tests/ioctl_v4l2-success.c b/tests/ioctl_v4l2-success.c
index 132a958bf..7fe272c3c 100644
--- a/tests/ioctl_v4l2-success.c
+++ b/tests/ioctl_v4l2-success.c
@@ -1383,6 +1383,10 @@ main(int argc, char **argv)
tuner->audmode =
tuner_amodes[j % ARRAY_SIZE(tuner_amodes)].val;
+ if (!((i + j) % 2))
+ memset(tuner->reserved, 0,
+ sizeof(tuner->reserved));
+
ioctl(-1, tuner_cmds[i].val, tuner);
printf("ioctl(-1, %s, {index=2158018784",
sprintxlat(tuner_cmds[i].str,
@@ -1397,7 +1401,7 @@ main(int argc, char **argv)
", rangelow=2158018795"
", rangehigh=2158018796, rxsubchans=%s"
", audmode=%s, signal=-2136948497"
- ", afc=-2136948496",
+ ", afc=-2136948496%s",
tuner_types[j %
ARRAY_SIZE(tuner_types)].str,
tuner_caps[j %
@@ -1405,7 +1409,10 @@ main(int argc, char **argv)
tuner_rxsc[j %
ARRAY_SIZE(tuner_rxsc)].str,
tuner_amodes[j %
- ARRAY_SIZE(tuner_amodes)].str);
+ ARRAY_SIZE(tuner_amodes)].str,
+ (i + j) % 2 ? ", reserved=[0x80a0c0f1"
+ ", 0x80a0c0f2, 0x80a0c0f3"
+ ", 0x80a0c0f4]" : "");
}
printf("}) = %ld (INJECTED)\n", inject_retval);
}
diff --git a/tests/ioctl_v4l2.c b/tests/ioctl_v4l2.c
index a60afad74..1d6afb010 100644
--- a/tests/ioctl_v4l2.c
+++ b/tests/ioctl_v4l2.c
@@ -1315,12 +1315,15 @@ main(void)
", type=" XLAT_FMT ", capability=" XLAT_FMT
", rangelow=%u, rangehigh=%u"
", rxsubchans=" XLAT_FMT ", audmode=" XLAT_FMT
- ", signal=%d, afc=%d}) = -1 EBADF (%m)\n",
+ ", signal=%d, afc=%d, reserved=[%#x, %#x, %#x, %#x]}"
+ ") = -1 EBADF (%m)\n",
XLAT_STR(VIDIOC_S_TUNER), p_tuner->index,
XLAT_ARGS(V4L2_TUNER_RADIO), XLAT_ARGS(V4L2_TUNER_CAP_LOW),
p_tuner->rangelow, p_tuner->rangehigh,
XLAT_ARGS(V4L2_TUNER_SUB_MONO), XLAT_ARGS(V4L2_TUNER_MODE_MONO),
- p_tuner->signal, p_tuner->afc);
+ p_tuner->signal, p_tuner->afc,
+ p_tuner->reserved[0], p_tuner->reserved[1],
+ p_tuner->reserved[2], p_tuner->reserved[3]);
/* VIDIOC_QUERYCTRL */
ioctl(-1, VIDIOC_QUERYCTRL, 0);
diff --git a/v4l2.c b/v4l2.c
index d9ded6799..49e43b090 100644
--- a/v4l2.c
+++ b/v4l2.c
@@ -877,7 +877,7 @@ print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg,
#include "xlat/v4l2_tuner_types.h"
#include "xlat/v4l2_tuner_capabilities.h"
-#include "xlat/v4l2_tuner_rxsubchanses.h"
+#include "xlat/v4l2_tuner_rxsubchannels.h"
#include "xlat/v4l2_tuner_audmodes.h"
static int
@@ -885,11 +885,12 @@ print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg,
const bool is_get)
{
struct v4l2_tuner c;
+
if (entering(tcp)) {
tprints(", ");
if (umove_or_printaddr(tcp, arg, &c))
return RVAL_IOCTL_DECODED;
- tprintf("{index=%u", c.index);
+ PRINT_FIELD_U("{", c, index);
if (is_get)
return 0;
tprints(", ");
@@ -902,19 +903,21 @@ print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg,
}
PRINT_FIELD_CSTRING("", c, name);
- tprints(", type=");
- printxval(v4l2_tuner_types, c.type, "V4L2_TUNER_???");
- tprints(", capability=");
- printflags(v4l2_tuner_capabilities, c.capability,
- "V4L2_TUNER_CAP_???");
- tprintf(", rangelow=%u, rangehigh=%u, rxsubchans=",
- c.rangelow, c.rangehigh);
- printflags(v4l2_tuner_rxsubchanses, c.rxsubchans,
+ PRINT_FIELD_XVAL(", ", c, type, v4l2_tuner_types, "V4L2_TUNER_???");
+ PRINT_FIELD_FLAGS(", ", c, capability, v4l2_tuner_capabilities,
+ "V4L2_TUNER_CAP_???");
+ PRINT_FIELD_U(", ", c, rangelow);
+ PRINT_FIELD_U(", ", c, rangehigh);
+ PRINT_FIELD_FLAGS(", ", c, rxsubchans, v4l2_tuner_rxsubchannels,
"V4L2_TUNER_SUB_???");
- tprints(", audmode=");
- printxval(v4l2_tuner_audmodes, c.audmode,
- "V4L2_TUNER_MODE_???");
- tprintf(", signal=%d, afc=%d", c.signal, c.afc);
+ PRINT_FIELD_XVAL(", ", c, audmode, v4l2_tuner_audmodes,
+ "V4L2_TUNER_MODE_???");
+ PRINT_FIELD_D(", ", c, signal);
+ PRINT_FIELD_D(", ", c, afc);
+
+ if (!IS_ARRAY_ZERO(c.reserved))
+ PRINT_FIELD_ARRAY(", ", c, reserved, tcp,
+ print_xint32_array_member);
if (entering(tcp)) {
return 0;
diff --git a/xlat/v4l2_tuner_rxsubchanses.in b/xlat/v4l2_tuner_rxsubchannels.in
index 578309cae..578309cae 100644
--- a/xlat/v4l2_tuner_rxsubchanses.in
+++ b/xlat/v4l2_tuner_rxsubchannels.in