提交 201f5c9c 编写于 作者: M Mike Isely 提交者: Mauro Carvalho Chehab

V4L/DVB (5175): Pvrusb2: VIDIOC_DBG_[S|G]_REGISTER fixups

Support 64 bit register IDs internally.  Only allow root access to
this API (for both set and get).  Note that actual 64 bit access only
becomes possible once the definition for v4l2_register is updated, but
this change clears the way for it from the viewpoint of the pvrusb2
driver.
Signed-off-by: NMike Isely <isely@pobox.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 6fe7d2c4
......@@ -3253,7 +3253,7 @@ static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
u32 chip_id, u32 reg_id,
u32 chip_id, u64 reg_id,
int setFl,u32 *val_ptr)
{
#ifdef CONFIG_VIDEO_ADV_DEBUG
......@@ -3263,6 +3263,8 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
int stat = 0;
int okFl = 0;
if (!capable(CAP_SYS_ADMIN)) return -EPERM;
req.i2c_id = chip_id;
req.reg = reg_id;
if (setFl) req.val = *val_ptr;
......
......@@ -222,7 +222,7 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,
setFl - true to set the register, false to read it
val_ptr - storage location for source / result. */
int pvr2_hdw_register_access(struct pvr2_hdw *,
u32 chip_id,u32 reg_id,
u32 chip_id,u64 reg_id,
int setFl,u32 *val_ptr);
/* The following entry points are all lower level things you normally don't
......
......@@ -738,10 +738,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
}
#ifdef CONFIG_VIDEO_ADV_DEBUG
case VIDIOC_DBG_S_REGISTER:
if (!capable(CAP_SYS_ADMIN)) {
ret = -EPERM;
break;
} /* fall through */
case VIDIOC_DBG_G_REGISTER:
{
u32 val;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册