2014-11-03 23:27:40 +03:00
/*
* Copyright ( c ) 2014 Philippe De Muyter < phdm @ macqel . be >
* Copyright ( c ) 2014 William Manley < will @ williammanley . net >
* Copyright ( c ) 2011 Peter Zotov < whitequark @ whitequark . org >
2018-02-14 01:00:00 +03:00
* Copyright ( c ) 2014 - 2018 The strace developers .
2014-11-03 23:27:40 +03:00
* All rights reserved .
*
2018-12-10 03:00:00 +03:00
* SPDX - License - Identifier : LGPL - 2.1 - or - later
2014-11-03 23:27:40 +03:00
*/
# include "defs.h"
2018-01-19 20:50:09 +03:00
# include <stdint.h>
# include <linux/ioctl.h>
# include <linux/types.h>
# include <linux/videodev2.h>
2016-05-04 01:30:41 +03:00
# include DEF_MPERS_TYPE(struct_v4l2_buffer)
2017-04-14 02:39:03 +03:00
# include DEF_MPERS_TYPE(struct_v4l2_clip)
2018-01-19 20:50:09 +03:00
# ifdef VIDIOC_CREATE_BUFS
# include DEF_MPERS_TYPE(struct_v4l2_create_buffers)
# endif
2016-05-04 01:30:41 +03:00
# include DEF_MPERS_TYPE(struct_v4l2_ext_control)
# include DEF_MPERS_TYPE(struct_v4l2_ext_controls)
# include DEF_MPERS_TYPE(struct_v4l2_format)
# include DEF_MPERS_TYPE(struct_v4l2_framebuffer)
# include DEF_MPERS_TYPE(struct_v4l2_input)
# include DEF_MPERS_TYPE(struct_v4l2_standard)
typedef struct v4l2_buffer struct_v4l2_buffer ;
2017-04-14 02:39:03 +03:00
typedef struct v4l2_clip struct_v4l2_clip ;
2018-01-19 20:50:09 +03:00
# ifdef VIDIOC_CREATE_BUFS
2016-05-04 01:30:41 +03:00
typedef struct v4l2_create_buffers struct_v4l2_create_buffers ;
2018-01-19 20:50:09 +03:00
# endif
2016-05-04 01:30:41 +03:00
typedef struct v4l2_ext_control struct_v4l2_ext_control ;
typedef struct v4l2_ext_controls struct_v4l2_ext_controls ;
typedef struct v4l2_format struct_v4l2_format ;
typedef struct v4l2_framebuffer struct_v4l2_framebuffer ;
typedef struct v4l2_input struct_v4l2_input ;
typedef struct v4l2_standard struct_v4l2_standard ;
# include MPERS_DEFS
2017-07-11 03:20:54 +03:00
# include "print_fields.h"
2018-01-06 04:45:16 +03:00
# include "xstring.h"
2017-07-11 03:20:54 +03:00
2018-02-15 23:16:15 +03:00
/* v4l2_fourcc_be was added by Linux commit v3.18-rc1~101^2^2~127 */
# ifndef v4l2_fourcc_be
# define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1 << 31))
# endif
2014-11-03 23:27:40 +03:00
# define FMT_FRACT "%u / %u"
# define ARGS_FRACT(x) ((x).numerator), ((x).denominator)
2016-05-01 20:25:24 +03:00
# define FMT_RECT "{left=%d, top=%d, width=%u, height=%u}"
2014-11-03 23:27:40 +03:00
# define ARGS_RECT(x) (x).left, (x).top, (x).width, (x).height
2018-02-15 23:16:15 +03:00
# include "xlat/v4l2_pix_fmts.h"
# include "xlat/v4l2_sdr_fmts.h"
2016-05-01 20:25:24 +03:00
static void
2018-02-15 23:16:15 +03:00
print_pixelformat ( uint32_t fourcc , const struct xlat * xlat )
2014-11-03 23:27:40 +03:00
{
2018-03-02 02:45:16 +03:00
unsigned char a [ ] = {
( unsigned char ) fourcc ,
( unsigned char ) ( fourcc > > 8 ) ,
( unsigned char ) ( fourcc > > 16 ) ,
( unsigned char ) ( fourcc > > 24 ) ,
2016-05-13 06:51:43 +03:00
} ;
2015-01-25 03:27:00 +03:00
unsigned int i ;
tprints ( " v4l2_fourcc( " ) ;
2018-03-02 02:45:16 +03:00
for ( i = 0 ; i < ARRAY_SIZE ( a ) ; + + i ) {
unsigned char c = a [ i ] ;
2015-01-25 03:27:00 +03:00
if ( i )
tprints ( " , " ) ;
2016-05-01 20:25:24 +03:00
if ( c = = ' \' ' | | c = = ' \\ ' ) {
char sym [ ] = {
' \' ' ,
' \\ ' ,
c ,
' \' ' ,
' \0 '
} ;
tprints ( sym ) ;
} else if ( c > = ' ' & & c < = 0x7e ) {
2015-01-25 03:27:00 +03:00
char sym [ ] = {
' \' ' ,
2016-05-01 20:25:24 +03:00
c ,
' \' ' ,
' \0 '
2015-01-25 03:27:00 +03:00
} ;
tprints ( sym ) ;
} else {
char hex [ ] = {
' \' ' ,
' \\ ' ,
' x ' ,
" 0123456789abcdef " [ c > > 4 ] ,
" 0123456789abcdef " [ c & 0xf ] ,
' \' ' ,
' \0 '
} ;
tprints ( hex ) ;
}
}
tprints ( " ) " ) ;
2018-02-15 23:16:15 +03:00
if ( xlat ) {
const char * pixfmt_name = xlookup ( xlat , fourcc ) ;
if ( pixfmt_name )
tprints_comment ( pixfmt_name ) ;
}
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
# include "xlat/v4l2_device_capabilities_flags.h"
static int
2016-12-26 13:26:03 +03:00
print_v4l2_capability ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
struct v4l2_capability caps ;
if ( entering ( tcp ) )
return 0 ;
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & caps ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2017-07-11 03:20:54 +03:00
PRINT_FIELD_CSTRING ( " { " , caps , driver ) ;
PRINT_FIELD_CSTRING ( " , " , caps , card ) ;
PRINT_FIELD_CSTRING ( " , " , caps , bus_info ) ;
2016-05-01 20:25:24 +03:00
tprintf ( " , version=%u.%u.%u, capabilities= " ,
( caps . version > > 16 ) & 0xFF ,
( caps . version > > 8 ) & 0xFF ,
caps . version & 0xFF ) ;
printflags ( v4l2_device_capabilities_flags , caps . capabilities ,
" V4L2_CAP_??? " ) ;
# ifdef V4L2_CAP_DEVICE_CAPS
tprints ( " , device_caps= " ) ;
printflags ( v4l2_device_capabilities_flags , caps . device_caps ,
" V4L2_CAP_??? " ) ;
# endif
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
# include "xlat/v4l2_buf_types.h"
# include "xlat/v4l2_format_description_flags.h"
static int
2016-12-26 13:26:03 +03:00
print_v4l2_fmtdesc ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
struct v4l2_fmtdesc f ;
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & f ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprintf ( " {index=%u, type= " , f . index ) ;
printxval ( v4l2_buf_types , f . type , " V4L2_BUF_TYPE_??? " ) ;
return 0 ;
}
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & f ) ) {
tprints ( " , flags= " ) ;
printflags ( v4l2_format_description_flags , f . flags ,
" V4L2_FMT_FLAG_??? " ) ;
2017-07-11 03:20:54 +03:00
PRINT_FIELD_CSTRING ( " , " , f , description ) ;
2016-05-01 20:25:24 +03:00
tprints ( " , pixelformat= " ) ;
2018-02-15 23:16:15 +03:00
print_pixelformat ( f . pixelformat , v4l2_pix_fmts ) ;
2016-05-01 20:25:24 +03:00
}
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
# include "xlat/v4l2_fields.h"
# include "xlat/v4l2_colorspaces.h"
2017-04-14 02:39:03 +03:00
# include "xlat/v4l2_vbi_flags.h"
# include "xlat/v4l2_sliced_flags.h"
2016-05-01 20:25:24 +03:00
2017-04-14 02:39:03 +03:00
static bool
2017-06-18 01:23:09 +03:00
print_v4l2_clip ( struct tcb * tcp , void * elem_buf , size_t elem_size , void * data )
2017-04-14 02:39:03 +03:00
{
const struct_v4l2_clip * p = elem_buf ;
tprintf ( FMT_RECT , ARGS_RECT ( p - > c ) ) ;
return true ;
}
static bool
print_v4l2_format_fmt ( struct tcb * const tcp , const char * prefix ,
const struct_v4l2_format * f )
2014-11-03 23:27:40 +03:00
{
2017-04-14 02:39:03 +03:00
bool ret = true ;
2014-11-03 23:27:40 +03:00
switch ( f - > type ) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE :
2016-05-01 20:25:24 +03:00
case V4L2_BUF_TYPE_VIDEO_OUTPUT :
tprints ( prefix ) ;
tprintf ( " fmt.pix={width=%u, height=%u, pixelformat= " ,
f - > fmt . pix . width , f - > fmt . pix . height ) ;
2018-02-15 23:16:15 +03:00
print_pixelformat ( f - > fmt . pix . pixelformat , v4l2_pix_fmts ) ;
2014-11-03 23:27:40 +03:00
tprints ( " , field= " ) ;
2016-05-01 20:25:24 +03:00
printxval ( v4l2_fields , f - > fmt . pix . field , " V4L2_FIELD_??? " ) ;
2014-11-03 23:27:40 +03:00
tprintf ( " , bytesperline=%u, sizeimage=%u, colorspace= " ,
2016-05-01 20:25:24 +03:00
f - > fmt . pix . bytesperline , f - > fmt . pix . sizeimage ) ;
printxval ( v4l2_colorspaces , f - > fmt . pix . colorspace ,
2014-11-03 23:27:40 +03:00
" V4L2_COLORSPACE_??? " ) ;
tprints ( " } " ) ;
break ;
# if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE :
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE : {
unsigned int i , max ;
2016-05-01 20:25:24 +03:00
tprints ( prefix ) ;
tprintf ( " fmt.pix_mp={width=%u, height=%u, pixelformat= " ,
f - > fmt . pix_mp . width , f - > fmt . pix_mp . height ) ;
2018-02-15 23:16:15 +03:00
print_pixelformat ( f - > fmt . pix_mp . pixelformat , v4l2_pix_fmts ) ;
2014-11-03 23:27:40 +03:00
tprints ( " , field= " ) ;
2016-05-01 20:25:24 +03:00
printxval ( v4l2_fields , f - > fmt . pix_mp . field , " V4L2_FIELD_??? " ) ;
2014-11-03 23:27:40 +03:00
tprints ( " , colorspace= " ) ;
2016-05-01 20:25:24 +03:00
printxval ( v4l2_colorspaces , f - > fmt . pix_mp . colorspace ,
2014-11-03 23:27:40 +03:00
" V4L2_COLORSPACE_??? " ) ;
2016-05-01 20:25:24 +03:00
tprints ( " , plane_fmt=[ " ) ;
max = f - > fmt . pix_mp . num_planes ;
2014-11-03 23:27:40 +03:00
if ( max > VIDEO_MAX_PLANES )
max = VIDEO_MAX_PLANES ;
for ( i = 0 ; i < max ; i + + ) {
if ( i > 0 )
tprints ( " , " ) ;
tprintf ( " {sizeimage=%u, bytesperline=%u} " ,
2016-05-01 20:25:24 +03:00
f - > fmt . pix_mp . plane_fmt [ i ] . sizeimage ,
f - > fmt . pix_mp . plane_fmt [ i ] . bytesperline ) ;
2014-11-03 23:27:40 +03:00
}
2017-04-14 02:39:03 +03:00
tprintf ( " ], num_planes=%u} " ,
( unsigned ) f - > fmt . pix_mp . num_planes ) ;
2014-11-03 23:27:40 +03:00
break ;
}
# endif
2017-04-14 02:39:03 +03:00
/* OUTPUT_OVERLAY since Linux v2.6.22-rc1~1118^2~179 */
2015-01-09 07:53:19 +03:00
# if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
2014-11-03 23:27:40 +03:00
case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY :
2015-01-09 07:53:19 +03:00
# endif
2017-04-14 02:39:03 +03:00
case V4L2_BUF_TYPE_VIDEO_OVERLAY : {
struct_v4l2_clip clip ;
2016-05-01 20:25:24 +03:00
tprints ( prefix ) ;
2017-04-14 02:39:03 +03:00
tprintf ( " fmt.win={left=%d, top=%d, width=%u, height=%u, field= " ,
ARGS_RECT ( f - > fmt . win . w ) ) ;
printxval ( v4l2_fields , f - > fmt . win . field , " V4L2_FIELD_??? " ) ;
tprintf ( " , chromakey=%#x, clips= " , f - > fmt . win . chromakey ) ;
ret = print_array ( tcp , ptr_to_kulong ( f - > fmt . win . clips ) ,
f - > fmt . win . clipcount , & clip , sizeof ( clip ) ,
print_array: enhance printing of unfetchable object addresses
When umoven_func invocation fails to fetch data, it prints the faulty
address. If this happens to a subsequent umoven_func invocation,
the printed address may be undistinguishable from a valid data printed
by print_func, e.g. when the data is printed in a numeric form like
[0x1, 0x2, 0x3, 0xdefaced].
Fix this source of confusion by moving the printing of the faulty
address from umoven_func to print_array itself. This change renames
umoven_func to tfetch_mem_func and changes its semantics, so that
- tfetch_mem_func never prints anything;
- tfetch_mem_func returns true if the fetch succeeded,
and false otherwise.
* defs.h (print_array): Replace umoven_func argument with
tfetch_mem_func.
* util.c (print_array): Replace umoven_func argument with
tfetch_mem_func, document expected tfetch_mem_func return value
semantics. When tfetch_mem_func returns false, print either addr
or "... /* addr */" depending on the context (inside the array or not).
* bpf.c (print_ebpf_prog, print_bpf_prog_info,
BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Replace umoven_or_printaddr
argument of print_array with tfetch_mem.
* bpf_filter.c (print_bpf_fprog): Likewise.
* btrfs.c (btrfs_print_logical_ino_container,
btrfs_print_ino_path_container, btrfs_print_qgroup_inherit,
btrfs_ioctl): Likewise.
* dm.c (dm_decode_dm_target_deps): Likewise.
* epoll.c (epoll_wait_common): Likewise.
* file_ioctl.c (file_ioctl): Likewise.
* ipc_sem.c (tprint_sembuf_array): Likewise.
* kexec.c (print_kexec_segments): Likewise.
* mem.c (SYS_FUNC(subpage_prot)): Likewise.
* net.c (print_getsockopt): Likewise.
* netlink.c (decode_nlmsgerr_attr_cookie): Likewise.
* netlink_netlink_diag.c (decode_netlink_diag_groups): Likewise.
* netlink_packet_diag.c (decode_packet_diag_mclist): Likewise.
* netlink_unix_diag.c (decode_unix_diag_inode): Likewise.
* nlattr.c (decode_nla_meminfo): Likewise.
* numa.c (print_nodemask, SYS_FUNC(move_pages),
* perf_ioctl.c (perf_ioctl_query_bpf): Likewise.
* poll.c (decode_poll_entering): Likewise.
* printsiginfo.c (print_siginfo_array): Likewise.
* rtnl_tc.c (decode_tca_stab_data): Likewise.
* sock.c (decode_ifconf): Likewise.
* uid.c (print_groups): Likewise.
* io.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents)): Replace
umoven_or_printaddr argument of print_array with tfetch_mem.
(tprint_iov_upto): Replace umoven_or_printaddr_ignore_syserror
with tfetch_mem_ignore_syserror.
* v4l2.c (print_v4l2_format_fmt): Replace umoven_or_printaddr argument
of print_array with tfetch_mem.
(print_v4l2_ext_controls): Replace umoven_or_printaddr_ignore_syserror
with tfetch_mem_ignore_syserror.
* mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Rename
to fetch_struct_mmsghdr_for_print, do not print address, return bool.
(decode_mmsgvec): Replace fetch_struct_mmsghdr_or_printaddr
with fetch_struct_mmsghdr_for_print.
* tests/aio.c (main): Update expected output.
* tests/bpf.c (print_BPF_PROG_QUERY_attr5): Likewise.
* tests/ioctl_perf-success.c (main): Likewise.
* tests/ioctl_v4l2.c (main): Update expected output.
* tests/kexec_load.c (main): Likewise.
* tests/mmsg_name.c (test_mmsg_name): Update expected output.
* tests/move_pages.c (print_page_array, print_node_array): Likewise.
* tests/poll.c (print_pollfd_array_entering): Likewise.
* tests/preadv-pwritev.c (main): Likewise.
* tests/preadv2-pwritev2.c (dumpio): Likewise.
* tests/process_vm_readv_writev.c (print_iov): Likewise.
* tests/pwritev.c (print_iovec): Likewise.
* tests/readv.c (main): Likewise.
* tests/seccomp-filter-v.c
* tests/semop.c (main): Likewise.
* tests/set_mempolicy.c (print_nodes): Likewise.
* tests/setgroups.c (main): Likewise.
* tests/test_nlattr.h (print_nlattr) Likewise.
Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>
2018-05-29 04:15:19 +03:00
tfetch_mem , print_v4l2_clip , 0 ) ;
2017-04-14 02:39:03 +03:00
tprintf ( " , clipcount=%u, bitmap= " , f - > fmt . win . clipcount ) ;
printaddr ( ptr_to_kulong ( f - > fmt . win . bitmap ) ) ;
2017-06-14 00:00:04 +03:00
# ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA
2017-04-14 02:39:03 +03:00
tprintf ( " , global_alpha=%#x " , f - > fmt . win . global_alpha ) ;
# endif
tprints ( " } " ) ;
2014-11-03 23:27:40 +03:00
break ;
2017-04-14 02:39:03 +03:00
}
2014-11-03 23:27:40 +03:00
case V4L2_BUF_TYPE_VBI_CAPTURE :
case V4L2_BUF_TYPE_VBI_OUTPUT :
2016-05-01 20:25:24 +03:00
tprints ( prefix ) ;
2017-04-14 02:39:03 +03:00
tprintf ( " fmt.vbi={sampling_rate=%u, offset=%u, "
" samples_per_line=%u, sample_format= " ,
f - > fmt . vbi . sampling_rate , f - > fmt . vbi . offset ,
f - > fmt . vbi . samples_per_line ) ;
2018-02-15 23:16:15 +03:00
print_pixelformat ( f - > fmt . vbi . sample_format , v4l2_pix_fmts ) ;
2017-04-14 02:39:03 +03:00
tprintf ( " , start=[%u, %u], count=[%u, %u], " ,
f - > fmt . vbi . start [ 0 ] , f - > fmt . vbi . start [ 1 ] ,
f - > fmt . vbi . count [ 0 ] , f - > fmt . vbi . count [ 1 ] ) ;
tprints ( " flags= " ) ;
printxval ( v4l2_vbi_flags , f - > fmt . vbi . flags , " V4L2_VBI_??? " ) ;
tprints ( " } " ) ;
2014-11-03 23:27:40 +03:00
break ;
2017-04-14 02:39:03 +03:00
/* both since Linux v2.6.14-rc2~64 */
# if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
2014-11-03 23:27:40 +03:00
case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE :
2017-04-14 02:39:03 +03:00
case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT : {
unsigned int i , j ;
2016-05-01 20:25:24 +03:00
tprints ( prefix ) ;
2017-04-14 02:39:03 +03:00
tprints ( " fmt.sliced={service_set= " ) ;
printxval ( v4l2_sliced_flags , f - > fmt . sliced . service_set ,
" V4L2_SLICED_??? " ) ;
tprintf ( " , io_size=%u, service_lines=[ " ,
f - > fmt . sliced . io_size ) ;
for ( i = 0 ; i < ARRAY_SIZE ( f - > fmt . sliced . service_lines ) ; i + + ) {
if ( i > 0 )
tprints ( " , " ) ;
tprints ( " [ " ) ;
for ( j = 0 ;
j < ARRAY_SIZE ( f - > fmt . sliced . service_lines [ 0 ] ) ;
j + + ) {
if ( j > 0 )
tprints ( " , " ) ;
tprintf ( " %#x " ,
f - > fmt . sliced . service_lines [ i ] [ j ] ) ;
}
tprints ( " ] " ) ;
}
tprints ( " ]} " ) ;
2014-11-03 23:27:40 +03:00
break ;
2017-04-14 02:39:03 +03:00
}
# endif
/* since Linux v4.4-rc1~118^2~14 */
# if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT
case V4L2_BUF_TYPE_SDR_OUTPUT :
# endif
/* since Linux v3.15-rc1~85^2~213 */
2016-05-01 20:25:24 +03:00
# if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE
case V4L2_BUF_TYPE_SDR_CAPTURE :
tprints ( prefix ) ;
2017-04-14 02:39:03 +03:00
tprints ( " fmt.sdr={pixelformat= " ) ;
2018-02-15 23:16:15 +03:00
print_pixelformat ( f - > fmt . sdr . pixelformat , v4l2_sdr_fmts ) ;
2018-12-30 18:35:21 +03:00
# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
2017-04-14 02:39:03 +03:00
tprintf ( " , buffersize=%u " ,
f - > fmt . sdr . buffersize ) ;
2018-12-30 18:35:21 +03:00
# endif
2017-04-14 02:39:03 +03:00
tprints ( " } " ) ;
break ;
2016-05-01 20:25:24 +03:00
# endif
2014-11-03 23:27:40 +03:00
}
2017-04-14 02:39:03 +03:00
return ret ;
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
static int
2016-12-26 13:26:03 +03:00
print_v4l2_format ( struct tcb * const tcp , const kernel_ulong_t arg ,
v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t
* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
to kernel_ureg_t.
2016-12-21 04:22:18 +03:00
const bool is_get )
2014-11-03 23:27:40 +03:00
{
2016-05-04 01:30:41 +03:00
struct_v4l2_format f ;
2016-05-01 20:25:24 +03:00
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & f ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprints ( " {type= " ) ;
printxval ( v4l2_buf_types , f . type , " V4L2_BUF_TYPE_??? " ) ;
if ( is_get )
return 0 ;
2017-04-14 02:39:03 +03:00
if ( ! print_v4l2_format_fmt ( tcp , " , " , & f ) ) {
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2017-04-14 02:39:03 +03:00
}
2017-08-27 02:12:08 +03:00
return 0 ;
2016-05-01 20:25:24 +03:00
}
2017-08-27 02:12:08 +03:00
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & f ) )
print_v4l2_format_fmt ( tcp , is_get ? " , " : " => " , & f ) ;
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
# include "xlat/v4l2_memories.h"
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
static int
2016-12-26 13:26:03 +03:00
print_v4l2_requestbuffers ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
struct v4l2_requestbuffers reqbufs ;
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
2017-08-27 02:10:00 +03:00
2016-05-01 20:25:24 +03:00
if ( umove_or_printaddr ( tcp , arg , & reqbufs ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2017-08-27 02:10:00 +03:00
tprintf ( " {type= " ) ;
2016-05-01 20:25:24 +03:00
printxval ( v4l2_buf_types , reqbufs . type , " V4L2_BUF_TYPE_??? " ) ;
tprints ( " , memory= " ) ;
printxval ( v4l2_memories , reqbufs . memory , " V4L2_MEMORY_??? " ) ;
2017-08-27 02:10:00 +03:00
tprintf ( " , count=%u " , reqbufs . count ) ;
2016-05-01 20:25:24 +03:00
return 0 ;
2017-08-27 02:10:00 +03:00
}
2016-05-01 20:25:24 +03:00
2017-08-27 02:10:00 +03:00
if ( ! syserror ( tcp ) ) {
tprints ( " => " ) ;
if ( ! umove ( tcp , arg , & reqbufs ) )
tprintf ( " %u " , reqbufs . count ) ;
else
tprints ( " ??? " ) ;
2014-11-03 23:27:40 +03:00
}
2017-08-27 02:10:00 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
# include "xlat/v4l2_buf_flags.h"
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
static int
v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t
* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
to kernel_ureg_t.
2016-12-21 04:22:18 +03:00
print_v4l2_buffer ( struct tcb * const tcp , const unsigned int code ,
2016-12-26 13:26:03 +03:00
const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
2016-05-04 01:30:41 +03:00
struct_v4l2_buffer b ;
2016-05-01 20:25:24 +03:00
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & b ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprints ( " {type= " ) ;
printxval ( v4l2_buf_types , b . type , " V4L2_BUF_TYPE_??? " ) ;
if ( code ! = VIDIOC_DQBUF )
tprintf ( " , index=%u " , b . index ) ;
2017-08-27 02:12:08 +03:00
return 0 ;
}
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & b ) ) {
if ( code = = VIDIOC_DQBUF )
tprintf ( " , index=%u " , b . index ) ;
tprints ( " , memory= " ) ;
printxval ( v4l2_memories , b . memory , " V4L2_MEMORY_??? " ) ;
if ( b . memory = = V4L2_MEMORY_MMAP ) {
tprintf ( " , m.offset=%#x " , b . m . offset ) ;
} else if ( b . memory = = V4L2_MEMORY_USERPTR ) {
tprints ( " , m.userptr= " ) ;
printaddr ( b . m . userptr ) ;
2014-11-03 23:27:40 +03:00
}
2017-08-27 02:12:08 +03:00
tprintf ( " , length=%u, bytesused=%u, flags= " ,
b . length , b . bytesused ) ;
printflags ( v4l2_buf_flags , b . flags , " V4L2_BUF_FLAG_??? " ) ;
if ( code = = VIDIOC_DQBUF ) {
tprints ( " , timestamp = " ) ;
MPERS_FUNC_NAME ( print_struct_timeval ) ( & b . timestamp ) ;
}
tprints ( " , ... " ) ;
2014-11-03 23:27:40 +03:00
}
2017-08-27 02:12:08 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
static int
2016-12-26 13:26:03 +03:00
print_v4l2_framebuffer ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
2016-05-04 01:30:41 +03:00
struct_v4l2_framebuffer b ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
tprints ( " , " ) ;
if ( ! umove_or_printaddr ( tcp , arg , & b ) ) {
2016-06-11 04:28:21 +03:00
tprintf ( " {capability=%#x, flags=%#x, base= " ,
b . capability , b . flags ) ;
2016-12-26 04:37:21 +03:00
printaddr ( ptr_to_kulong ( b . base ) ) ;
2016-06-11 04:28:21 +03:00
tprints ( " } " ) ;
2016-05-01 20:25:24 +03:00
}
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
static int
2016-12-26 13:26:03 +03:00
print_v4l2_buf_type ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
int type ;
tprints ( " , " ) ;
if ( ! umove_or_printaddr ( tcp , arg , & type ) ) {
tprints ( " [ " ) ;
printxval ( v4l2_buf_types , type , " V4L2_BUF_TYPE_??? " ) ;
tprints ( " ] " ) ;
}
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
# include "xlat/v4l2_streaming_capabilities.h"
# include "xlat/v4l2_capture_modes.h"
static int
2016-12-26 13:26:03 +03:00
print_v4l2_streamparm ( struct tcb * const tcp , const kernel_ulong_t arg ,
v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t
* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
to kernel_ureg_t.
2016-12-21 04:22:18 +03:00
const bool is_get )
2016-05-01 20:25:24 +03:00
{
struct v4l2_streamparm s ;
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & s ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprints ( " {type= " ) ;
printxval ( v4l2_buf_types , s . type , " V4L2_BUF_TYPE_??? " ) ;
switch ( s . type ) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE :
case V4L2_BUF_TYPE_VIDEO_OUTPUT :
if ( is_get )
return 0 ;
tprints ( " , " ) ;
break ;
default :
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
} else {
if ( syserror ( tcp ) | | umove ( tcp , arg , & s ) < 0 ) {
2014-11-03 23:27:40 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
tprints ( is_get ? " , " : " => " ) ;
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
if ( s . type = = V4L2_BUF_TYPE_VIDEO_CAPTURE ) {
tprints ( " parm.capture={capability= " ) ;
printflags ( v4l2_streaming_capabilities ,
s . parm . capture . capability , " V4L2_CAP_??? " ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
tprints ( " , capturemode= " ) ;
printflags ( v4l2_capture_modes ,
s . parm . capture . capturemode , " V4L2_MODE_??? " ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
tprintf ( " , timeperframe= " FMT_FRACT ,
ARGS_FRACT ( s . parm . capture . timeperframe ) ) ;
tprintf ( " , extendedmode=%u, readbuffers=%u} " ,
s . parm . capture . extendedmode ,
s . parm . capture . readbuffers ) ;
} else {
tprints ( " parm.output={capability= " ) ;
printflags ( v4l2_streaming_capabilities ,
s . parm . output . capability , " V4L2_CAP_??? " ) ;
tprintf ( " , outputmode=%u " , s . parm . output . outputmode ) ;
tprintf ( " , timeperframe= " FMT_FRACT ,
ARGS_FRACT ( s . parm . output . timeperframe ) ) ;
tprintf ( " , extendedmode=%u, writebuffers=%u} " ,
s . parm . output . extendedmode ,
s . parm . output . writebuffers ) ;
}
2017-08-28 03:39:15 +03:00
if ( entering ( tcp ) ) {
return 0 ;
} else {
2016-05-01 20:25:24 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
}
2016-05-01 20:25:24 +03:00
}
static int
2016-12-26 13:26:03 +03:00
print_v4l2_standard ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
2016-05-04 01:30:41 +03:00
struct_v4l2_standard s ;
2016-05-01 20:25:24 +03:00
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & s ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprintf ( " {index=%u " , s . index ) ;
2017-08-27 02:12:08 +03:00
return 0 ;
}
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & s ) ) {
PRINT_FIELD_CSTRING ( " , " , s , name ) ;
tprintf ( " , frameperiod= " FMT_FRACT ,
ARGS_FRACT ( s . frameperiod ) ) ;
tprintf ( " , framelines=%d " , s . framelines ) ;
2014-11-03 23:27:40 +03:00
}
2017-08-27 02:12:08 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
# include "xlat/v4l2_input_types.h"
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
static int
2016-12-26 13:26:03 +03:00
print_v4l2_input ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
2016-05-04 01:30:41 +03:00
struct_v4l2_input i ;
2016-05-01 20:25:24 +03:00
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & i ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprintf ( " {index=%u " , i . index ) ;
2017-08-27 02:12:08 +03:00
return 0 ;
}
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & i ) ) {
PRINT_FIELD_CSTRING ( " , " , i , name ) ;
tprints ( " , type= " ) ;
printxval ( v4l2_input_types , i . type , " V4L2_INPUT_TYPE_??? " ) ;
2016-05-01 20:25:24 +03:00
}
2017-08-27 02:12:08 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
2014-11-03 23:27:40 +03:00
2018-04-10 09:52:25 +03:00
/*
* We include it here and not before print_v4l2_ext_controls as we need
* V4L2_CTRL_CLASS_ * definitions for V4L2_CID_ * _BASE ones .
*/
# include "xlat/v4l2_control_classes.h"
# include "xlat/v4l2_control_id_bases.h"
2016-05-01 20:25:24 +03:00
# include "xlat/v4l2_control_ids.h"
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
static int
2016-12-26 13:26:03 +03:00
print_v4l2_control ( struct tcb * const tcp , const kernel_ulong_t arg ,
v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t
* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
to kernel_ureg_t.
2016-12-21 04:22:18 +03:00
const bool is_get )
2016-05-01 20:25:24 +03:00
{
struct v4l2_control c ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & c ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprints ( " {id= " ) ;
printxval ( v4l2_control_ids , c . id , " V4L2_CID_??? " ) ;
if ( ! is_get )
tprintf ( " , value=%d " , c . value ) ;
return 0 ;
}
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & c ) ) {
tprints ( is_get ? " , " : " => " ) ;
tprintf ( " value=%d " , c . value ) ;
}
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
tprints ( " } " ) ;
2017-08-27 02:12:08 +03:00
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
v4l2: Add decoding for VIDIOC_G/S_TUNER's arg
* v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h",
"xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h".
(print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg.
(v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg.
* xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and
V4L2_TUNER_ANALOG_TV introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel
commit v2.6.11-rc4~55^2~20.
Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit
v3.15-rc1~85^2~215.
Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17
(as the replacement of V4L2_TUNER_ADC).
* xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW,
V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2,
V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel
commit 2.5.46~39^2~23^2~4.
Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP
introduced by linux kernel commit v3.6-rc1~28^2~306.
Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189.
Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS
introduced by linux kernel commit v2.6.37-rc1~64^2~110.
Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit
v3.6-rc1~28^2~46.
Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit
v3.6-rc1~28^2~40.
Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit
v3.15-rc1~85^2~214.
* xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO,
V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and
V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit
v2.6.17-rc1~739^2~9.
* xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO,
V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and
V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit
v2.6.32-rc1~679^2~189.
Signed-off-by: Edgar Kaziahmedov <edos@linux.com>
2017-04-23 04:53:47 +03:00
# include "xlat/v4l2_tuner_types.h"
# include "xlat/v4l2_tuner_capabilities.h"
# include "xlat/v4l2_tuner_rxsubchanses.h"
# include "xlat/v4l2_tuner_audmodes.h"
static int
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 ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
v4l2: Add decoding for VIDIOC_G/S_TUNER's arg
* v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h",
"xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h".
(print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg.
(v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg.
* xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and
V4L2_TUNER_ANALOG_TV introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel
commit v2.6.11-rc4~55^2~20.
Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit
v3.15-rc1~85^2~215.
Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17
(as the replacement of V4L2_TUNER_ADC).
* xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW,
V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2,
V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel
commit 2.5.46~39^2~23^2~4.
Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP
introduced by linux kernel commit v3.6-rc1~28^2~306.
Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189.
Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS
introduced by linux kernel commit v2.6.37-rc1~64^2~110.
Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit
v3.6-rc1~28^2~46.
Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit
v3.6-rc1~28^2~40.
Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit
v3.15-rc1~85^2~214.
* xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO,
V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and
V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit
v2.6.17-rc1~739^2~9.
* xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO,
V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and
V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit
v2.6.32-rc1~679^2~189.
Signed-off-by: Edgar Kaziahmedov <edos@linux.com>
2017-04-23 04:53:47 +03:00
tprintf ( " {index=%u " , c . index ) ;
if ( is_get )
return 0 ;
tprints ( " , " ) ;
} else {
if ( syserror ( tcp ) | | umove ( tcp , arg , & c ) < 0 ) {
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
v4l2: Add decoding for VIDIOC_G/S_TUNER's arg
* v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h",
"xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h".
(print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg.
(v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg.
* xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and
V4L2_TUNER_ANALOG_TV introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel
commit v2.6.11-rc4~55^2~20.
Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit
v3.15-rc1~85^2~215.
Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17
(as the replacement of V4L2_TUNER_ADC).
* xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW,
V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2,
V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel
commit 2.5.46~39^2~23^2~4.
Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP
introduced by linux kernel commit v3.6-rc1~28^2~306.
Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189.
Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS
introduced by linux kernel commit v2.6.37-rc1~64^2~110.
Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit
v3.6-rc1~28^2~46.
Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit
v3.6-rc1~28^2~40.
Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit
v3.15-rc1~85^2~214.
* xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO,
V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and
V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit
v2.6.17-rc1~739^2~9.
* xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO,
V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and
V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit
v2.6.32-rc1~679^2~189.
Signed-off-by: Edgar Kaziahmedov <edos@linux.com>
2017-04-23 04:53:47 +03:00
}
tprints ( is_get ? " , " : " => " ) ;
}
2017-07-11 03:20:54 +03:00
PRINT_FIELD_CSTRING ( " " , c , name ) ;
v4l2: Add decoding for VIDIOC_G/S_TUNER's arg
* v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h",
"xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h".
(print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg.
(v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg.
* xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and
V4L2_TUNER_ANALOG_TV introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel
commit v2.6.11-rc4~55^2~20.
Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit
v3.15-rc1~85^2~215.
Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17
(as the replacement of V4L2_TUNER_ADC).
* xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW,
V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2,
V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel
commit 2.5.46~39^2~23^2~4.
Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP
introduced by linux kernel commit v3.6-rc1~28^2~306.
Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189.
Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS
introduced by linux kernel commit v2.6.37-rc1~64^2~110.
Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit
v3.6-rc1~28^2~46.
Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit
v3.6-rc1~28^2~40.
Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit
v3.15-rc1~85^2~214.
* xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO,
V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and
V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit
v2.6.17-rc1~739^2~9.
* xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO,
V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and
V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit
v2.6.32-rc1~679^2~189.
Signed-off-by: Edgar Kaziahmedov <edos@linux.com>
2017-04-23 04:53:47 +03:00
tprints ( " , type= " ) ;
printxval ( v4l2_tuner_types , c . type , " V4L2_TUNER_TYPE_??? " ) ;
tprints ( " , capability= " ) ;
printxval ( v4l2_tuner_capabilities , c . capability ,
" V4L2_TUNER_CAP_??? " ) ;
tprintf ( " , rangelow=%u, rangehigh=%u, rxsubchans= " ,
c . rangelow , c . rangehigh ) ;
printxval ( v4l2_tuner_rxsubchanses , c . rxsubchans ,
" V4L2_TUNER_SUB_??? " ) ;
tprints ( " , audmode= " ) ;
printxval ( v4l2_tuner_audmodes , c . audmode ,
" V4L2_TUNER_MODE_??? " ) ;
tprintf ( " , signal=%d, afc=%d " , c . signal , c . afc ) ;
2017-08-28 03:39:15 +03:00
if ( entering ( tcp ) ) {
return 0 ;
} else {
v4l2: Add decoding for VIDIOC_G/S_TUNER's arg
* v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h",
"xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h".
(print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg.
(v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg.
* xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and
V4L2_TUNER_ANALOG_TV introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel
commit v2.6.11-rc4~55^2~20.
Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit
v3.15-rc1~85^2~215.
Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17
(as the replacement of V4L2_TUNER_ADC).
* xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW,
V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2,
V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel
commit 2.5.46~39^2~23^2~4.
Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP
introduced by linux kernel commit v3.6-rc1~28^2~306.
Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189.
Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS
introduced by linux kernel commit v2.6.37-rc1~64^2~110.
Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit
v3.6-rc1~28^2~46.
Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit
v3.6-rc1~28^2~40.
Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit
v3.15-rc1~85^2~214.
* xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO,
V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and
V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit
v2.6.17-rc1~739^2~9.
* xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO,
V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and
V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit
v2.6.32-rc1~679^2~189.
Signed-off-by: Edgar Kaziahmedov <edos@linux.com>
2017-04-23 04:53:47 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
}
v4l2: Add decoding for VIDIOC_G/S_TUNER's arg
* v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h",
"xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h".
(print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg.
(v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg.
* xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and
V4L2_TUNER_ANALOG_TV introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel
commit v2.6.11-rc4~55^2~20.
Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit
v3.15-rc1~85^2~215.
Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17
(as the replacement of V4L2_TUNER_ADC).
* xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW,
V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2,
V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel
commit 2.5.46~39^2~23^2~4.
Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP
introduced by linux kernel commit v3.6-rc1~28^2~306.
Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189.
Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS
introduced by linux kernel commit v2.6.37-rc1~64^2~110.
Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit
v3.6-rc1~28^2~46.
Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit
v3.6-rc1~28^2~40.
Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit
v3.15-rc1~85^2~214.
* xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO,
V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and
V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit
v2.6.17-rc1~739^2~9.
* xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO,
V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and
V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit
v2.6.32-rc1~679^2~189.
Signed-off-by: Edgar Kaziahmedov <edos@linux.com>
2017-04-23 04:53:47 +03:00
}
2016-05-01 20:25:24 +03:00
# include "xlat/v4l2_control_types.h"
# include "xlat/v4l2_control_flags.h"
static int
2016-12-26 13:26:03 +03:00
print_v4l2_queryctrl ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
struct v4l2_queryctrl c ;
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & c ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprints ( " {id= " ) ;
} else {
if ( syserror ( tcp ) | | umove ( tcp , arg , & c ) < 0 ) {
2014-11-03 23:27:40 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
2016-07-15 19:08:19 +03:00
if ( get_tcb_priv_ulong ( tcp ) )
2016-05-01 20:25:24 +03:00
tprints ( " => " ) ;
2014-11-03 23:27:40 +03:00
}
2016-07-15 19:08:19 +03:00
if ( entering ( tcp ) | | get_tcb_priv_ulong ( tcp ) ) {
2015-02-22 05:13:04 +03:00
# ifdef V4L2_CTRL_FLAG_NEXT_CTRL
2016-07-15 19:08:19 +03:00
const unsigned long next = c . id & V4L2_CTRL_FLAG_NEXT_CTRL ;
set_tcb_priv_ulong ( tcp , next ) ;
if ( next ) {
2018-03-10 08:56:40 +03:00
print_xlat ( V4L2_CTRL_FLAG_NEXT_CTRL ) ;
tprints ( " | " ) ;
2016-05-01 20:25:24 +03:00
c . id & = ~ V4L2_CTRL_FLAG_NEXT_CTRL ;
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
# endif
printxval ( v4l2_control_ids , c . id , " V4L2_CID_??? " ) ;
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
if ( exiting ( tcp ) ) {
tprints ( " , type= " ) ;
printxval ( v4l2_control_types , c . type , " V4L2_CTRL_TYPE_??? " ) ;
2017-07-11 03:20:54 +03:00
PRINT_FIELD_CSTRING ( " , " , c , name ) ;
2016-05-01 20:25:24 +03:00
tprintf ( " , minimum=%d, maximum=%d, step=%d "
" , default_value=%d, flags= " ,
c . minimum , c . maximum , c . step , c . default_value ) ;
printflags ( v4l2_control_flags , c . flags , " V4L2_CTRL_FLAG_??? " ) ;
tprints ( " } " ) ;
}
2017-08-28 03:39:15 +03:00
return entering ( tcp ) ? 0 : RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
static int
2016-12-26 13:26:03 +03:00
print_v4l2_cropcap ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
struct v4l2_cropcap c ;
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & c ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprints ( " {type= " ) ;
printxval ( v4l2_buf_types , c . type , " V4L2_BUF_TYPE_??? " ) ;
2017-08-27 02:12:08 +03:00
2016-05-01 20:25:24 +03:00
return 0 ;
}
2017-08-27 02:12:08 +03:00
2016-05-01 20:25:24 +03:00
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & c ) ) {
tprintf ( " , bounds= " FMT_RECT
" , defrect= " FMT_RECT
" , pixelaspect= " FMT_FRACT ,
ARGS_RECT ( c . bounds ) ,
ARGS_RECT ( c . defrect ) ,
ARGS_FRACT ( c . pixelaspect ) ) ;
}
2017-08-27 02:12:08 +03:00
2016-05-01 20:25:24 +03:00
tprints ( " } " ) ;
2017-08-27 02:12:08 +03:00
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
static int
2016-12-26 13:26:03 +03:00
print_v4l2_crop ( struct tcb * const tcp , const kernel_ulong_t arg ,
v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t
* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
to kernel_ureg_t.
2016-12-21 04:22:18 +03:00
const bool is_get )
2016-05-01 20:25:24 +03:00
{
struct v4l2_crop c ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & c ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprints ( " {type= " ) ;
printxval ( v4l2_buf_types , c . type , " V4L2_BUF_TYPE_??? " ) ;
if ( is_get )
2014-11-03 23:27:40 +03:00
return 0 ;
2016-05-01 20:25:24 +03:00
tprintf ( " , c= " FMT_RECT , ARGS_RECT ( c . c ) ) ;
} else {
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & c ) )
tprintf ( " , c= " FMT_RECT , ARGS_RECT ( c . c ) ) ;
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
tprints ( " } " ) ;
2017-08-27 02:12:08 +03:00
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
2015-02-22 05:13:04 +03:00
# ifdef VIDIOC_S_EXT_CTRLS
2016-05-08 02:15:36 +03:00
static bool
print_v4l2_ext_control ( struct tcb * tcp , void * elem_buf , size_t elem_size , void * data )
2016-05-01 20:25:24 +03:00
{
2016-05-08 02:15:36 +03:00
const struct_v4l2_ext_control * p = elem_buf ;
2016-05-01 20:25:24 +03:00
2016-05-08 02:15:36 +03:00
tprints ( " {id= " ) ;
printxval ( v4l2_control_ids , p - > id , " V4L2_CID_??? " ) ;
2015-02-22 05:13:04 +03:00
# if HAVE_DECL_V4L2_CTRL_TYPE_STRING
2016-05-08 02:15:36 +03:00
tprintf ( " , size=%u " , p - > size ) ;
if ( p - > size > 0 ) {
tprints ( " , string= " ) ;
2016-12-26 04:37:21 +03:00
printstrn ( tcp , ptr_to_kulong ( p - > string ) , p - > size ) ;
2016-05-08 02:15:36 +03:00
} else
2015-02-22 05:13:04 +03:00
# endif
2016-12-19 19:19:40 +03:00
tprintf ( " , value=%d, value64=% " PRId64 , p - > value , ( int64_t ) p - > value64 ) ;
2016-05-08 02:15:36 +03:00
tprints ( " } " ) ;
return true ;
2016-05-01 20:25:24 +03:00
}
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
static int
2016-12-26 13:26:03 +03:00
print_v4l2_ext_controls ( struct tcb * const tcp , const kernel_ulong_t arg ,
v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t
* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
to kernel_ureg_t.
2016-12-21 04:22:18 +03:00
const bool is_get )
2016-05-01 20:25:24 +03:00
{
2016-05-04 01:30:41 +03:00
struct_v4l2_ext_controls c ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & c ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprints ( " {ctrl_class= " ) ;
printxval ( v4l2_control_classes , c . ctrl_class ,
" V4L2_CTRL_CLASS_??? " ) ;
tprintf ( " , count=%u " , c . count ) ;
if ( ! c . count ) {
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
if ( is_get )
2014-11-03 23:27:40 +03:00
return 0 ;
2016-05-01 20:25:24 +03:00
tprints ( " , " ) ;
} else {
if ( umove ( tcp , arg , & c ) < 0 ) {
2014-11-03 23:27:40 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
tprints ( is_get ? " , " : " => " ) ;
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
tprints ( " controls= " ) ;
2016-05-08 02:15:36 +03:00
struct_v4l2_ext_control ctrl ;
2016-12-26 04:37:21 +03:00
bool fail = ! print_array ( tcp , ptr_to_kulong ( c . controls ) , c . count ,
2016-05-08 02:15:36 +03:00
& ctrl , sizeof ( ctrl ) ,
print_array: enhance printing of unfetchable object addresses
When umoven_func invocation fails to fetch data, it prints the faulty
address. If this happens to a subsequent umoven_func invocation,
the printed address may be undistinguishable from a valid data printed
by print_func, e.g. when the data is printed in a numeric form like
[0x1, 0x2, 0x3, 0xdefaced].
Fix this source of confusion by moving the printing of the faulty
address from umoven_func to print_array itself. This change renames
umoven_func to tfetch_mem_func and changes its semantics, so that
- tfetch_mem_func never prints anything;
- tfetch_mem_func returns true if the fetch succeeded,
and false otherwise.
* defs.h (print_array): Replace umoven_func argument with
tfetch_mem_func.
* util.c (print_array): Replace umoven_func argument with
tfetch_mem_func, document expected tfetch_mem_func return value
semantics. When tfetch_mem_func returns false, print either addr
or "... /* addr */" depending on the context (inside the array or not).
* bpf.c (print_ebpf_prog, print_bpf_prog_info,
BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Replace umoven_or_printaddr
argument of print_array with tfetch_mem.
* bpf_filter.c (print_bpf_fprog): Likewise.
* btrfs.c (btrfs_print_logical_ino_container,
btrfs_print_ino_path_container, btrfs_print_qgroup_inherit,
btrfs_ioctl): Likewise.
* dm.c (dm_decode_dm_target_deps): Likewise.
* epoll.c (epoll_wait_common): Likewise.
* file_ioctl.c (file_ioctl): Likewise.
* ipc_sem.c (tprint_sembuf_array): Likewise.
* kexec.c (print_kexec_segments): Likewise.
* mem.c (SYS_FUNC(subpage_prot)): Likewise.
* net.c (print_getsockopt): Likewise.
* netlink.c (decode_nlmsgerr_attr_cookie): Likewise.
* netlink_netlink_diag.c (decode_netlink_diag_groups): Likewise.
* netlink_packet_diag.c (decode_packet_diag_mclist): Likewise.
* netlink_unix_diag.c (decode_unix_diag_inode): Likewise.
* nlattr.c (decode_nla_meminfo): Likewise.
* numa.c (print_nodemask, SYS_FUNC(move_pages),
* perf_ioctl.c (perf_ioctl_query_bpf): Likewise.
* poll.c (decode_poll_entering): Likewise.
* printsiginfo.c (print_siginfo_array): Likewise.
* rtnl_tc.c (decode_tca_stab_data): Likewise.
* sock.c (decode_ifconf): Likewise.
* uid.c (print_groups): Likewise.
* io.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents)): Replace
umoven_or_printaddr argument of print_array with tfetch_mem.
(tprint_iov_upto): Replace umoven_or_printaddr_ignore_syserror
with tfetch_mem_ignore_syserror.
* v4l2.c (print_v4l2_format_fmt): Replace umoven_or_printaddr argument
of print_array with tfetch_mem.
(print_v4l2_ext_controls): Replace umoven_or_printaddr_ignore_syserror
with tfetch_mem_ignore_syserror.
* mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Rename
to fetch_struct_mmsghdr_for_print, do not print address, return bool.
(decode_mmsgvec): Replace fetch_struct_mmsghdr_or_printaddr
with fetch_struct_mmsghdr_for_print.
* tests/aio.c (main): Update expected output.
* tests/bpf.c (print_BPF_PROG_QUERY_attr5): Likewise.
* tests/ioctl_perf-success.c (main): Likewise.
* tests/ioctl_v4l2.c (main): Update expected output.
* tests/kexec_load.c (main): Likewise.
* tests/mmsg_name.c (test_mmsg_name): Update expected output.
* tests/move_pages.c (print_page_array, print_node_array): Likewise.
* tests/poll.c (print_pollfd_array_entering): Likewise.
* tests/preadv-pwritev.c (main): Likewise.
* tests/preadv2-pwritev2.c (dumpio): Likewise.
* tests/process_vm_readv_writev.c (print_iov): Likewise.
* tests/pwritev.c (print_iovec): Likewise.
* tests/readv.c (main): Likewise.
* tests/seccomp-filter-v.c
* tests/semop.c (main): Likewise.
* tests/set_mempolicy.c (print_nodes): Likewise.
* tests/setgroups.c (main): Likewise.
* tests/test_nlattr.h (print_nlattr) Likewise.
Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>
2018-05-29 04:15:19 +03:00
tfetch_mem_ignore_syserror ,
2016-05-08 02:15:36 +03:00
print_v4l2_ext_control , 0 ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
if ( exiting ( tcp ) & & syserror ( tcp ) )
tprintf ( " , error_idx=%u " , c . error_idx ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
if ( exiting ( tcp ) | | fail ) {
2014-11-03 23:27:40 +03:00
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2014-11-03 23:27:40 +03:00
}
2017-08-27 01:18:27 +03:00
/* entering */
return 0 ;
2016-05-01 20:25:24 +03:00
}
# endif /* VIDIOC_S_EXT_CTRLS */
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
# ifdef VIDIOC_ENUM_FRAMESIZES
# include "xlat / v4l2_framesize_types.h"
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
static int
2016-12-26 13:26:03 +03:00
print_v4l2_frmsizeenum ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
struct v4l2_frmsizeenum s ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & s ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprintf ( " {index=%u, pixel_format= " , s . index ) ;
2018-02-15 23:16:15 +03:00
print_pixelformat ( s . pixel_format , v4l2_pix_fmts ) ;
2016-05-01 20:25:24 +03:00
return 0 ;
2014-11-03 23:27:40 +03:00
}
2016-05-01 20:25:24 +03:00
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & s ) ) {
tprints ( " , type= " ) ;
printxval ( v4l2_framesize_types , s . type , " V4L2_FRMSIZE_TYPE_??? " ) ;
switch ( s . type ) {
case V4L2_FRMSIZE_TYPE_DISCRETE :
tprintf ( " , discrete={width=%u, height=%u} " ,
s . discrete . width , s . discrete . height ) ;
break ;
case V4L2_FRMSIZE_TYPE_STEPWISE :
tprintf ( " , stepwise={min_width=%u, max_width=%u, "
" step_width=%u, min_height=%u, max_height=%u, "
" step_height=%u} " ,
s . stepwise . min_width , s . stepwise . max_width ,
s . stepwise . step_width , s . stepwise . min_height ,
s . stepwise . max_height , s . stepwise . step_height ) ;
break ;
}
}
tprints ( " } " ) ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
# endif /* VIDIOC_ENUM_FRAMESIZES */
2015-01-09 07:53:19 +03:00
# ifdef VIDIOC_ENUM_FRAMEINTERVALS
2016-05-01 20:25:24 +03:00
# include "xlat / v4l2_frameinterval_types.h"
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
static int
2016-12-26 13:26:03 +03:00
print_v4l2_frmivalenum ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
struct v4l2_frmivalenum f ;
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & f ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprintf ( " {index=%u, pixel_format= " , f . index ) ;
2018-02-15 23:16:15 +03:00
print_pixelformat ( f . pixel_format , v4l2_pix_fmts ) ;
2014-11-03 23:27:40 +03:00
tprintf ( " , width=%u, height=%u " , f . width , f . height ) ;
2016-05-01 20:25:24 +03:00
return 0 ;
}
2017-08-27 02:12:08 +03:00
2016-05-01 20:25:24 +03:00
if ( ! syserror ( tcp ) & & ! umove ( tcp , arg , & f ) ) {
tprints ( " , type= " ) ;
printxval ( v4l2_frameinterval_types , f . type ,
" V4L2_FRMIVAL_TYPE_??? " ) ;
switch ( f . type ) {
case V4L2_FRMIVAL_TYPE_DISCRETE :
tprintf ( " , discrete= " FMT_FRACT ,
ARGS_FRACT ( f . discrete ) ) ;
break ;
case V4L2_FRMIVAL_TYPE_STEPWISE :
case V4L2_FRMSIZE_TYPE_CONTINUOUS :
tprintf ( " , stepwise={min= " FMT_FRACT " , max= "
FMT_FRACT " , step= " FMT_FRACT " } " ,
ARGS_FRACT ( f . stepwise . min ) ,
ARGS_FRACT ( f . stepwise . max ) ,
ARGS_FRACT ( f . stepwise . step ) ) ;
break ;
2014-11-03 23:27:40 +03:00
}
}
2017-08-27 02:12:08 +03:00
2016-05-01 20:25:24 +03:00
tprints ( " } " ) ;
2017-08-27 02:12:08 +03:00
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
}
2015-01-09 07:53:19 +03:00
# endif /* VIDIOC_ENUM_FRAMEINTERVALS */
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
# ifdef VIDIOC_CREATE_BUFS
static int
2016-12-26 13:26:03 +03:00
print_v4l2_create_buffers ( struct tcb * const tcp , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
2017-08-27 02:12:08 +03:00
static const char fmt [ ] = " {index=%u, count=%u} " ;
static char outstr [ sizeof ( fmt ) + sizeof ( int ) * 6 ] ;
2016-05-04 01:30:41 +03:00
struct_v4l2_create_buffers b ;
2016-05-01 20:25:24 +03:00
if ( entering ( tcp ) ) {
tprints ( " , " ) ;
if ( umove_or_printaddr ( tcp , arg , & b ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2016-05-01 20:25:24 +03:00
tprintf ( " {count=%u, memory= " , b . count ) ;
printxval ( v4l2_memories , b . memory , " V4L2_MEMORY_??? " ) ;
tprints ( " , format={type= " ) ;
printxval ( v4l2_buf_types , b . format . type ,
" V4L2_BUF_TYPE_??? " ) ;
2017-04-14 02:39:03 +03:00
print_v4l2_format_fmt ( tcp , " , " ,
2016-05-04 01:30:41 +03:00
( struct_v4l2_format * ) & b . format ) ;
2016-05-01 20:25:24 +03:00
tprints ( " }} " ) ;
return 0 ;
2014-11-03 23:27:40 +03:00
}
2017-08-27 02:12:08 +03:00
if ( syserror ( tcp ) | | umove ( tcp , arg , & b ) )
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2017-08-27 02:12:08 +03:00
2018-01-06 04:45:16 +03:00
xsprintf ( outstr , fmt , b . index , b . count ) ;
2017-08-27 02:12:08 +03:00
tcp - > auxstr = outstr ;
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED | RVAL_STR ;
2016-05-01 20:25:24 +03:00
}
# endif /* VIDIOC_CREATE_BUFS */
2014-11-03 23:27:40 +03:00
v4l2: change type of ioctl 3rd argument from long to kernel_ureg_t
* v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, print_v4l2_format,
print_v4l2_requestbuffers, print_v4l2_buffer, print_v4l2_framebuffer,
print_v4l2_buf_type, print_v4l2_streamparm, print_v4l2_standard,
print_v4l2_input, print_v4l2_control, print_v4l2_queryctrl,
print_v4l2_cropcap, print_v4l2_crop, print_v4l2_ext_controls,
print_v4l2_frmsizeenum, print_v4l2_frmivalenum,
print_v4l2_create_buffers, v4l2_ioctl): Change arg type from long
to kernel_ureg_t.
2016-12-21 04:22:18 +03:00
MPERS_PRINTER_DECL ( int , v4l2_ioctl , struct tcb * const tcp ,
2016-12-26 13:26:03 +03:00
const unsigned int code , const kernel_ulong_t arg )
2016-05-01 20:25:24 +03:00
{
if ( ! verbose ( tcp ) )
return RVAL_DECODED ;
2015-05-20 18:50:21 +03:00
2016-05-01 20:25:24 +03:00
switch ( code ) {
case VIDIOC_QUERYCAP : /* R */
return print_v4l2_capability ( tcp , arg ) ;
2015-05-20 18:50:21 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_ENUM_FMT : /* RW */
return print_v4l2_fmtdesc ( tcp , arg ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_G_FMT : /* RW */
case VIDIOC_S_FMT : /* RW */
case VIDIOC_TRY_FMT : /* RW */
return print_v4l2_format ( tcp , arg , code = = VIDIOC_G_FMT ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_REQBUFS : /* RW */
return print_v4l2_requestbuffers ( tcp , arg ) ;
2015-04-18 16:06:43 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_QUERYBUF : /* RW */
case VIDIOC_QBUF : /* RW */
case VIDIOC_DQBUF : /* RW */
return print_v4l2_buffer ( tcp , code , arg ) ;
case VIDIOC_G_FBUF : /* R */
if ( entering ( tcp ) )
2015-04-18 16:06:43 +03:00
return 0 ;
2018-03-07 02:52:08 +03:00
ATTRIBUTE_FALLTHROUGH ;
2016-05-01 20:25:24 +03:00
case VIDIOC_S_FBUF : /* W */
return print_v4l2_framebuffer ( tcp , arg ) ;
2015-04-18 16:06:43 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_STREAMON : /* W */
case VIDIOC_STREAMOFF : /* W */
return print_v4l2_buf_type ( tcp , arg ) ;
2015-04-18 16:06:43 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_G_PARM : /* RW */
case VIDIOC_S_PARM : /* RW */
return print_v4l2_streamparm ( tcp , arg , code = = VIDIOC_G_PARM ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_G_STD : /* R */
if ( entering ( tcp ) )
2014-11-03 23:27:40 +03:00
return 0 ;
2018-03-07 02:52:08 +03:00
ATTRIBUTE_FALLTHROUGH ;
2016-05-01 20:25:24 +03:00
case VIDIOC_S_STD : /* W */
tprints ( " , " ) ;
printnum_int64 ( tcp , arg , " %# " PRIx64 ) ;
2017-08-27 02:12:08 +03:00
break ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_ENUMSTD : /* RW */
return print_v4l2_standard ( tcp , arg ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_ENUMINPUT : /* RW */
return print_v4l2_input ( tcp , arg ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_G_CTRL : /* RW */
case VIDIOC_S_CTRL : /* RW */
return print_v4l2_control ( tcp , arg , code = = VIDIOC_G_CTRL ) ;
2014-11-03 23:27:40 +03:00
v4l2: Add decoding for VIDIOC_G/S_TUNER's arg
* v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h",
"xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h".
(print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg.
(v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg.
* xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and
V4L2_TUNER_ANALOG_TV introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel
commit v2.6.11-rc4~55^2~20.
Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit
v3.15-rc1~85^2~215.
Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17
(as the replacement of V4L2_TUNER_ADC).
* xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW,
V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2,
V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel
commit 2.5.46~39^2~23^2~4.
Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP
introduced by linux kernel commit v3.6-rc1~28^2~306.
Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189.
Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS
introduced by linux kernel commit v2.6.37-rc1~64^2~110.
Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit
v3.6-rc1~28^2~46.
Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit
v3.6-rc1~28^2~40.
Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit
v3.15-rc1~85^2~214.
* xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO,
V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and
V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit
v2.6.17-rc1~739^2~9.
* xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO,
V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and
V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit
2.5.46~39^2~23^2~4.
Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit
v2.6.32-rc1~679^2~189.
Signed-off-by: Edgar Kaziahmedov <edos@linux.com>
2017-04-23 04:53:47 +03:00
case VIDIOC_G_TUNER : /* RW */
case VIDIOC_S_TUNER : /* RW */
return print_v4l2_tuner ( tcp , arg , code = = VIDIOC_G_TUNER ) ;
2016-05-01 20:25:24 +03:00
case VIDIOC_QUERYCTRL : /* RW */
return print_v4l2_queryctrl ( tcp , arg ) ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_G_INPUT : /* R */
if ( entering ( tcp ) )
2014-11-03 23:27:40 +03:00
return 0 ;
2018-03-07 02:52:08 +03:00
ATTRIBUTE_FALLTHROUGH ;
2016-05-01 20:25:24 +03:00
case VIDIOC_S_INPUT : /* RW */
tprints ( " , " ) ;
printnum_int ( tcp , arg , " %u " ) ;
2017-08-27 02:12:08 +03:00
break ;
2014-11-03 23:27:40 +03:00
2016-05-01 20:25:24 +03:00
case VIDIOC_CROPCAP : /* RW */
return print_v4l2_cropcap ( tcp , arg ) ;
case VIDIOC_G_CROP : /* RW */
case VIDIOC_S_CROP : /* W */
return print_v4l2_crop ( tcp , arg , code = = VIDIOC_G_CROP ) ;
# ifdef VIDIOC_S_EXT_CTRLS
case VIDIOC_S_EXT_CTRLS : /* RW */
case VIDIOC_TRY_EXT_CTRLS : /* RW */
case VIDIOC_G_EXT_CTRLS : /* RW */
return print_v4l2_ext_controls ( tcp , arg ,
code = = VIDIOC_G_EXT_CTRLS ) ;
# endif /* VIDIOC_S_EXT_CTRLS */
# ifdef VIDIOC_ENUM_FRAMESIZES
case VIDIOC_ENUM_FRAMESIZES : /* RW */
return print_v4l2_frmsizeenum ( tcp , arg ) ;
# endif /* VIDIOC_ENUM_FRAMESIZES */
# ifdef VIDIOC_ENUM_FRAMEINTERVALS
case VIDIOC_ENUM_FRAMEINTERVALS : /* RW */
return print_v4l2_frmivalenum ( tcp , arg ) ;
# endif /* VIDIOC_ENUM_FRAMEINTERVALS */
# ifdef VIDIOC_CREATE_BUFS
case VIDIOC_CREATE_BUFS : /* RW */
return print_v4l2_create_buffers ( tcp , arg ) ;
# endif /* VIDIOC_CREATE_BUFS */
default :
return RVAL_DECODED ;
2014-11-03 23:27:40 +03:00
}
2017-08-27 02:12:08 +03:00
2017-08-28 03:39:15 +03:00
return RVAL_IOCTL_DECODED ;
2014-11-03 23:27:40 +03:00
}