diff options
author | Mike Isely <devnull@localhost> | 2006-01-14 21:11:17 +0000 |
---|---|---|
committer | Mike Isely <devnull@localhost> | 2006-01-14 21:11:17 +0000 |
commit | 1fe396338f08245ff63b2435a4e70cf176f14347 (patch) | |
tree | 8a0539574aadac0e9a50f7aea817dfc1c3b40962 /v4l_experimental | |
parent | 33a0cdc6392b4c4ae3b311bfd5ec8298f9117431 (diff) | |
download | mediapointer-dvb-s2-1fe396338f08245ff63b2435a4e70cf176f14347.tar.gz mediapointer-dvb-s2-1fe396338f08245ff63b2435a4e70cf176f14347.tar.bz2 |
Use v4l_print_ioctl() where appropriate
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'v4l_experimental')
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-hdw.c | 9 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-hdw.h | 5 | ||||
-rw-r--r-- | v4l_experimental/pvrusb2/pvrusb2-v4l2.c | 95 |
3 files changed, 29 insertions, 80 deletions
diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.c b/v4l_experimental/pvrusb2/pvrusb2-hdw.c index 664524705..c7b169d0f 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-hdw.c +++ b/v4l_experimental/pvrusb2/pvrusb2-hdw.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-hdw.c,v 1.11 2006/01/09 06:58:23 mcisely Exp $ + * $Id: pvrusb2-hdw.c,v 1.12 2006/01/14 21:11:17 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -1587,6 +1587,13 @@ unsigned int pvr2_hdw_get_ctl_count(struct pvr2_hdw *hdw) } +/* Return name for this driver instance */ +const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) +{ + return hdw->name; +} + + /* Return bit mask indicating signal status */ unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw) { diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.h b/v4l_experimental/pvrusb2/pvrusb2-hdw.h index a45da3223..d813d07d4 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-hdw.h +++ b/v4l_experimental/pvrusb2/pvrusb2-hdw.h @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-hdw.h,v 1.5 2006/01/09 06:24:23 mcisely Exp $ + * $Id: pvrusb2-hdw.h,v 1.6 2006/01/14 21:11:17 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * @@ -244,6 +244,9 @@ int pvr2_hdw_commit_ctl(struct pvr2_hdw *); through this value - 1. */ unsigned int pvr2_hdw_get_ctl_count(struct pvr2_hdw *); +/* Return name for this driver instance */ +const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *); + /* Return PVR2_SIGNAL_XXXX bit mask indicating signal status */ unsigned int pvr2_hdw_get_signal_status(struct pvr2_hdw *); diff --git a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c b/v4l_experimental/pvrusb2/pvrusb2-v4l2.c index 6d0f8621e..d963d99ba 100644 --- a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c +++ b/v4l_experimental/pvrusb2/pvrusb2-v4l2.c @@ -1,6 +1,6 @@ /* * - * $Id: pvrusb2-v4l2.c,v 1.5 2006/01/01 08:26:03 mcisely Exp $ + * $Id: pvrusb2-v4l2.c,v 1.6 2006/01/14 21:11:17 mcisely Exp $ * * Copyright (C) 2005 Mike Isely <isely@pobox.com> * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr> @@ -31,6 +31,7 @@ #include "pvrusb2-v4l2.h" #include "pvrusb2-ioread.h" #include <linux/videodev.h> +#include <media/v4l2-common.h> #define PVR_WIDTH_DVD 720 @@ -335,78 +336,6 @@ static int cnv_cid_pvr2_v4l2(int id) } #endif -static const char *get_cmd_code(int cmd) -{ - switch (cmd) { - case VIDIOC_QUERYCAP: - return "VIDIOC_QUERYCAP"; - case VIDIOC_G_PRIORITY: - return "VIDIOC_G_PRIORITY"; - case VIDIOC_S_PRIORITY: - return "VIDIOC_S_PRIORITY"; - case VIDIOC_ENUMSTD: - return "VIDIOC_ENUMSTD"; - case VIDIOC_G_STD: - return "VIDIOC_G_STD"; - case VIDIOC_S_STD: - return "VIDIOC_S_STD"; - case VIDIOC_ENUMINPUT: - return "VIDIOC_ENUMINPUT"; - case VIDIOC_G_INPUT: - return "VIDIOC_G_INPUT"; - case VIDIOC_S_INPUT: - return "VIDIOC_S_INPUT"; - case VIDIOC_ENUMAUDIO: - return "VIDIOC_ENUMAUDIO"; - case VIDIOC_G_AUDIO: - return "VIDIOC_G_AUDIO"; - case VIDIOC_S_AUDIO: - return "VIDIOC_S_AUDIO"; - case VIDIOC_G_TUNER: - return "VIDIOC_G_TUNER"; - case VIDIOC_S_TUNER: - return "VIDIOC_S_TUNER"; - case VIDIOC_S_FREQUENCY: - return "VIDIOC_S_FREQUENCY"; - case VIDIOC_G_FREQUENCY: - return "VIDIOC_G_FREQUENCY"; - case VIDIOC_ENUM_FMT: - return "VIDIOC_ENUM_FMT"; - case VIDIOC_G_FMT: - return "VIDIOC_G_FMT"; - case VIDIOC_TRY_FMT: - return "VIDIOC_TRY_FMT"; - case VIDIOC_S_FMT: - return "VIDIOC_S_FMT"; - case VIDIOC_QBUF: - return "VIDIOC_QBUF"; - case VIDIOC_QUERYBUF: - return "VIDIOC_QUERYBUF"; - case VIDIOC_DQBUF: - return "VIDIOC_DQBUF"; - case VIDIOC_REQBUFS: - return "VIDIOC_REQBUFS"; - case VIDIOC_STREAMON: - return "VIDIOC_STREAMON"; - case VIDIOC_STREAMOFF: - return "VIDIOC_STREAMOFF"; - case VIDIOC_QUERYCTRL: - return "VIDIOC_QUERYCTRL"; - case VIDIOC_QUERYMENU: - return "VIDIOC_QUERYMENU"; - case VIDIOC_G_CTRL: - return "VIDIOC_G_CTRL"; - case VIDIOC_S_CTRL: - return "VIDIOC_S_CTRL"; - case VIDIOCGMBUF: - return "VIDIOCGMBUF"; - default : - break; - } - return "unknown"; -} - - /* * pvr_ioctl() * @@ -422,8 +351,9 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; int ret = -EINVAL; - pvr2_trace(PVR2_TRACE_V4LIOCTL, - "pvr2_v4l2_do_ioctl cmd=%s (%d)",get_cmd_code(cmd),cmd); + if (debug & PVR2_TRACE_V4LIOCTL) { + v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw),cmd); + } if (!pvr2_hdw_dev_ok(hdw)) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, @@ -918,9 +848,18 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, pvr2_hdw_commit_ctl(hdw); if (ret < 0) { - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "pvr2_v4l2_do_ioctl failure, ret=%d (0x%x)", - ret,ret); + if (debug & PVR2_TRACE_V4LIOCTL) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "pvr2_v4l2_do_ioctl failure, ret=%d",ret); + } else { + if (debug & PVR2_TRACE_ERROR_LEGS) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "pvr2_v4l2_do_ioctl failure, ret=%d" + " command was:",ret); + v4l_print_ioctl(pvr2_hdw_get_driver_name(hdw), + cmd); + } + } } else { pvr2_trace(PVR2_TRACE_V4LIOCTL, "pvr2_v4l2_do_ioctl complete, ret=%d (0x%x)", |