aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videodev.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-13 14:06:24 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:08:48 -0400
commit5e28e00964cdc90dec5ebb4c00dfa2fc1ecf36fa (patch)
tree1182f566a69c7204405edb3dc59f74b93aa25da1 /drivers/media/video/videodev.c
parente9e6040df6c96678d7b776b3902e3b2c6bbfc5a3 (diff)
V4L/DVB (7558): videobuf: Improve command output for debug purposes
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/videodev.c')
-rw-r--r--drivers/media/video/videodev.c57
1 files changed, 32 insertions, 25 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 0bf056622d6a..4c4ee566d257 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -18,9 +18,9 @@
18 18
19#define dbgarg(cmd, fmt, arg...) \ 19#define dbgarg(cmd, fmt, arg...) \
20 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { \ 20 if (vfd->debug & V4L2_DEBUG_IOCTL_ARG) { \
21 printk (KERN_DEBUG "%s: ", vfd->name); \ 21 printk(KERN_DEBUG "%s: ", vfd->name); \
22 v4l_printk_ioctl(cmd); \ 22 v4l_printk_ioctl(cmd); \
23 printk (KERN_DEBUG "%s: " fmt, vfd->name, ## arg); \ 23 printk(" " fmt, ## arg); \
24 } 24 }
25 25
26#define dbgarg2(fmt, arg...) \ 26#define dbgarg2(fmt, arg...) \
@@ -378,38 +378,45 @@ static const char *v4l2_int_ioctls[] = {
378 external ioctl messages as well as internal V4L ioctl */ 378 external ioctl messages as well as internal V4L ioctl */
379void v4l_printk_ioctl(unsigned int cmd) 379void v4l_printk_ioctl(unsigned int cmd)
380{ 380{
381 char *dir; 381 char *dir, *type;
382 382
383 switch (_IOC_DIR(cmd)) {
384 case _IOC_NONE: dir = "--"; break;
385 case _IOC_READ: dir = "r-"; break;
386 case _IOC_WRITE: dir = "-w"; break;
387 case _IOC_READ | _IOC_WRITE: dir = "rw"; break;
388 default: dir = "*ERR*"; break;
389 }
390 switch (_IOC_TYPE(cmd)) { 383 switch (_IOC_TYPE(cmd)) {
391 case 'd': 384 case 'd':
392 printk("v4l2_int ioctl %s, dir=%s (0x%08x)\n", 385 if (_IOC_NR(cmd) >= V4L2_INT_IOCTLS) {
393 (_IOC_NR(cmd) < V4L2_INT_IOCTLS) ? 386 type = "v4l2_int";
394 v4l2_int_ioctls[_IOC_NR(cmd)] : "UNKNOWN", dir, cmd); 387 break;
395 break; 388 }
389 printk("%s", v4l2_int_ioctls[_IOC_NR(cmd)]);
390 return;
396#ifdef CONFIG_VIDEO_V4L1_COMPAT 391#ifdef CONFIG_VIDEO_V4L1_COMPAT
397 case 'v': 392 case 'v':
398 printk("v4l1 ioctl %s, dir=%s (0x%08x)\n", 393 if (_IOC_NR(cmd) >= V4L1_IOCTLS) {
399 (_IOC_NR(cmd) < V4L1_IOCTLS) ? 394 type = "v4l1";
400 v4l1_ioctls[_IOC_NR(cmd)] : "UNKNOWN", dir, cmd); 395 break;
401 break; 396 }
397 printk("%s", v4l1_ioctls[_IOC_NR(cmd)]);
398 return;
402#endif 399#endif
403 case 'V': 400 case 'V':
404 printk("v4l2 ioctl %s, dir=%s (0x%08x)\n", 401 if (_IOC_NR(cmd) >= V4L2_IOCTLS) {
405 (_IOC_NR(cmd) < V4L2_IOCTLS) ? 402 type = "v4l2";
406 v4l2_ioctls[_IOC_NR(cmd)] : "UNKNOWN", dir, cmd); 403 break;
407 break; 404 }
408 405 printk("%s", v4l2_ioctls[_IOC_NR(cmd)]);
406 return;
409 default: 407 default:
410 printk("unknown ioctl '%c', dir=%s, #%d (0x%08x)\n", 408 type = "unknown";
411 _IOC_TYPE(cmd), dir, _IOC_NR(cmd), cmd); 409 }
410
411 switch (_IOC_DIR(cmd)) {
412 case _IOC_NONE: dir = "--"; break;
413 case _IOC_READ: dir = "r-"; break;
414 case _IOC_WRITE: dir = "-w"; break;
415 case _IOC_READ | _IOC_WRITE: dir = "rw"; break;
416 default: dir = "*ERR*"; break;
412 } 417 }
418 printk("%s ioctl '%c', dir=%s, #%d (0x%08x)",
419 type, _IOC_TYPE(cmd), dir, _IOC_NR(cmd), cmd);
413} 420}
414EXPORT_SYMBOL(v4l_printk_ioctl); 421EXPORT_SYMBOL(v4l_printk_ioctl);
415 422