aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c3
-rw-r--r--drivers/media/video/pwc/pwc-v4l.c4
-rw-r--r--drivers/media/video/videodev.c57
3 files changed, 38 insertions, 26 deletions
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index 1beb296a1763..90f59c4155ae 100644
--- a/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -1632,6 +1632,7 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp,
1632 if (ivtv_debug & IVTV_DBGFLG_IOCTL) { 1632 if (ivtv_debug & IVTV_DBGFLG_IOCTL) {
1633 printk(KERN_INFO "ivtv%d ioctl: ", itv->num); 1633 printk(KERN_INFO "ivtv%d ioctl: ", itv->num);
1634 v4l_printk_ioctl(cmd); 1634 v4l_printk_ioctl(cmd);
1635 printk("\n");
1635 } 1636 }
1636 return ivtv_debug_ioctls(filp, cmd, arg); 1637 return ivtv_debug_ioctls(filp, cmd, arg);
1637 1638
@@ -1675,6 +1676,7 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp,
1675 if (ivtv_debug & IVTV_DBGFLG_IOCTL) { 1676 if (ivtv_debug & IVTV_DBGFLG_IOCTL) {
1676 printk(KERN_INFO "ivtv%d ioctl: ", itv->num); 1677 printk(KERN_INFO "ivtv%d ioctl: ", itv->num);
1677 v4l_printk_ioctl(cmd); 1678 v4l_printk_ioctl(cmd);
1679 printk("\n");
1678 } 1680 }
1679 return ivtv_v4l2_ioctls(itv, filp, cmd, arg); 1681 return ivtv_v4l2_ioctls(itv, filp, cmd, arg);
1680 1682
@@ -1688,6 +1690,7 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp,
1688 if (ivtv_debug & IVTV_DBGFLG_IOCTL) { 1690 if (ivtv_debug & IVTV_DBGFLG_IOCTL) {
1689 printk(KERN_INFO "ivtv%d ioctl: ", itv->num); 1691 printk(KERN_INFO "ivtv%d ioctl: ", itv->num);
1690 v4l_printk_ioctl(cmd); 1692 v4l_printk_ioctl(cmd);
1693 printk("\n");
1691 } 1694 }
1692 return ivtv_control_ioctls(itv, cmd, arg); 1695 return ivtv_control_ioctls(itv, cmd, arg);
1693 1696
diff --git a/drivers/media/video/pwc/pwc-v4l.c b/drivers/media/video/pwc/pwc-v4l.c
index 32fbe1ae6251..1742889874df 100644
--- a/drivers/media/video/pwc/pwc-v4l.c
+++ b/drivers/media/video/pwc/pwc-v4l.c
@@ -351,8 +351,10 @@ int pwc_video_do_ioctl(struct inode *inode, struct file *file,
351 return -EFAULT; 351 return -EFAULT;
352 352
353#ifdef CONFIG_USB_PWC_DEBUG 353#ifdef CONFIG_USB_PWC_DEBUG
354 if (PWC_DEBUG_LEVEL_IOCTL & pwc_trace) 354 if (PWC_DEBUG_LEVEL_IOCTL & pwc_trace) {
355 v4l_printk_ioctl(cmd); 355 v4l_printk_ioctl(cmd);
356 printk("\n");
357 }
356#endif 358#endif
357 359
358 360
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