Re: [PATCH] v4l subdev: add dispatching for VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER.

2011-09-19 Thread martin
On Mon, Sep 19, 2011 at 12:53:07AM +0200, Laurent Pinchart wrote:
 Hi Martin,
 
 Thanks for the patch.
 
 On Saturday 17 September 2011 11:26:36 Martin Hostettler wrote:
  Ioctls on the subdevs node currently don't dispatch the register access
  debug driver callbacks. Add the dispatching with the same security checks
  are for non subdev video nodes (i.e. only capable(CAP_SYS_ADMIN may call
  the register access ioctls).
 
 Can we get your SoB line ? If you resubmit the patch, please fold the commit 
 message at 72 columns to keep git happy.

Yes, of course. Seems i forgot it.

 
  ---
   drivers/media/video/v4l2-subdev.c |   20 
   1 files changed, 20 insertions(+), 0 deletions(-)
  
  diff --git a/drivers/media/video/v4l2-subdev.c
  b/drivers/media/video/v4l2-subdev.c index b7967c9..8bf8397 100644
  --- a/drivers/media/video/v4l2-subdev.c
  +++ b/drivers/media/video/v4l2-subdev.c
  @@ -25,6 +25,7 @@
   #include linux/types.h
   #include linux/videodev2.h
  
  +#include media/v4l2-chip-ident.h
 
 Is this needed ?

No, it's an leftover.

I'll resend a patch fixed patch.

 - Martin Hostettler
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] v4l subdev: add dispatching for VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER.

2011-09-18 Thread Laurent Pinchart
Hi Martin,

Thanks for the patch.

On Saturday 17 September 2011 11:26:36 Martin Hostettler wrote:
 Ioctls on the subdevs node currently don't dispatch the register access
 debug driver callbacks. Add the dispatching with the same security checks
 are for non subdev video nodes (i.e. only capable(CAP_SYS_ADMIN may call
 the register access ioctls).

Can we get your SoB line ? If you resubmit the patch, please fold the commit 
message at 72 columns to keep git happy.

 ---
  drivers/media/video/v4l2-subdev.c |   20 
  1 files changed, 20 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/media/video/v4l2-subdev.c
 b/drivers/media/video/v4l2-subdev.c index b7967c9..8bf8397 100644
 --- a/drivers/media/video/v4l2-subdev.c
 +++ b/drivers/media/video/v4l2-subdev.c
 @@ -25,6 +25,7 @@
  #include linux/types.h
  #include linux/videodev2.h
 
 +#include media/v4l2-chip-ident.h

Is this needed ?

  #include media/v4l2-ctrls.h
  #include media/v4l2-device.h
  #include media/v4l2-ioctl.h
 @@ -173,6 +174,25 @@ static long subdev_do_ioctl(struct file *file,
 unsigned int cmd, void *arg)
 
   case VIDIOC_UNSUBSCRIBE_EVENT:
   return v4l2_subdev_call(sd, core, unsubscribe_event, vfh, arg);
 +
 +#ifdef CONFIG_VIDEO_ADV_DEBUG
 + case VIDIOC_DBG_G_REGISTER:
 + {
 + struct v4l2_dbg_register *p = arg;
 +
 + if (!capable(CAP_SYS_ADMIN))
 + return -EPERM;
 + return v4l2_subdev_call(sd, core, g_register, p);
 + }
 + case VIDIOC_DBG_S_REGISTER:
 + {
 + struct v4l2_dbg_register *p = arg;
 +
 + if (!capable(CAP_SYS_ADMIN))
 + return -EPERM;
 + return v4l2_subdev_call(sd, core, s_register, p);
 + }
 +#endif
  #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
   case VIDIOC_SUBDEV_G_FMT: {
   struct v4l2_subdev_format *format = arg;

-- 
Regards,

Laurent Pinchart
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] v4l subdev: add dispatching for VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER.

2011-09-17 Thread Martin Hostettler
Ioctls on the subdevs node currently don't dispatch the register access debug 
driver callbacks. Add
the dispatching with the same security checks are for non subdev video nodes
(i.e. only capable(CAP_SYS_ADMIN may call the register access ioctls).
---
 drivers/media/video/v4l2-subdev.c |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-subdev.c 
b/drivers/media/video/v4l2-subdev.c
index b7967c9..8bf8397 100644
--- a/drivers/media/video/v4l2-subdev.c
+++ b/drivers/media/video/v4l2-subdev.c
@@ -25,6 +25,7 @@
 #include linux/types.h
 #include linux/videodev2.h
 
+#include media/v4l2-chip-ident.h
 #include media/v4l2-ctrls.h
 #include media/v4l2-device.h
 #include media/v4l2-ioctl.h
@@ -173,6 +174,25 @@ static long subdev_do_ioctl(struct file *file, unsigned 
int cmd, void *arg)
 
case VIDIOC_UNSUBSCRIBE_EVENT:
return v4l2_subdev_call(sd, core, unsubscribe_event, vfh, arg);
+
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+   case VIDIOC_DBG_G_REGISTER:
+   {
+   struct v4l2_dbg_register *p = arg;
+
+   if (!capable(CAP_SYS_ADMIN))
+   return -EPERM;
+   return v4l2_subdev_call(sd, core, g_register, p);
+   }
+   case VIDIOC_DBG_S_REGISTER:
+   {
+   struct v4l2_dbg_register *p = arg;
+
+   if (!capable(CAP_SYS_ADMIN))
+   return -EPERM;
+   return v4l2_subdev_call(sd, core, s_register, p);
+   }
+#endif
 #if defined(CONFIG_VIDEO_V4L2_SUBDEV_API)
case VIDIOC_SUBDEV_G_FMT: {
struct v4l2_subdev_format *format = arg;
-- 
1.7.2.5

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html