your v4l2_ioctl_ops should be ignored. You can mark such ioctls by calling this
function before video_device_register is called:
-void v4l2_dont_use_cmd(struct video_device *vdev, unsigned int cmd);
+void v4l2_disable_ioctl(struct video_device *vdev, unsigned int cmd);
This tends to be needed if based on external factors (e.g. which card is
being used) you want to turns off certain features in v4l2_ioctl_ops without
lock will be used for unlocked_ioctl, but you can disable locking for
selected ioctls by calling:
- void v4l2_dont_use_lock(struct video_device *vdev, unsigned int cmd);
+ void v4l2_disable_ioctl_locking(struct video_device *vdev, unsigned int cmd);
-E.g.: v4l2_dont_use_lock(vdev, VIDIOC_DQBUF);
+E.g.: v4l2_disable_ioctl_locking(vdev, VIDIOC_DQBUF);
You have to call this before you register the video_device.
* usb_lock is taken for a long time, e.g. when changing a control
* value, and a new frame is ready to be dequeued.
*/
- v4l2_dont_use_lock(&gspca_dev->vdev, VIDIOC_DQBUF);
- v4l2_dont_use_lock(&gspca_dev->vdev, VIDIOC_QBUF);
- v4l2_dont_use_lock(&gspca_dev->vdev, VIDIOC_QUERYBUF);
+ v4l2_disable_ioctl_locking(&gspca_dev->vdev, VIDIOC_DQBUF);
+ v4l2_disable_ioctl_locking(&gspca_dev->vdev, VIDIOC_QBUF);
+ v4l2_disable_ioctl_locking(&gspca_dev->vdev, VIDIOC_QUERYBUF);
/* init video stuff */
ret = video_register_device(&gspca_dev->vdev,
* v4l2_lock is taken for a long time, e.g. when changing a control
* value, and a new frame is ready to be dequeued.
*/
- v4l2_dont_use_lock(&pdev->vdev, VIDIOC_DQBUF);
- v4l2_dont_use_lock(&pdev->vdev, VIDIOC_QBUF);
- v4l2_dont_use_lock(&pdev->vdev, VIDIOC_QUERYBUF);
+ v4l2_disable_ioctl_locking(&pdev->vdev, VIDIOC_DQBUF);
+ v4l2_disable_ioctl_locking(&pdev->vdev, VIDIOC_QBUF);
+ v4l2_disable_ioctl_locking(&pdev->vdev, VIDIOC_QUERYBUF);
rc = video_register_device(&pdev->vdev, VFL_TYPE_GRABBER, -1);
if (rc < 0) {
if (vdev->lock) {
/* always lock unless the cmd is marked as "don't use lock" */
locked = !v4l2_is_known_ioctl(cmd) ||
- !test_bit(_IOC_NR(cmd), vdev->dont_use_lock);
+ !test_bit(_IOC_NR(cmd), vdev->disable_locking);
if (locked && mutex_lock_interruptible(vdev->lock))
return -ERESTARTSYS;
DECLARE_BITMAP(valid_ioctls, BASE_VIDIOC_PRIVATE);
/* serialization lock */
- DECLARE_BITMAP(dont_use_lock, BASE_VIDIOC_PRIVATE);
+ DECLARE_BITMAP(disable_locking, BASE_VIDIOC_PRIVATE);
struct mutex *lock;
};
bool v4l2_is_known_ioctl(unsigned int cmd);
/* mark that this command shouldn't use core locking */
-static inline void v4l2_dont_use_lock(struct video_device *vdev, unsigned int cmd)
+static inline void v4l2_disable_ioctl_locking(struct video_device *vdev, unsigned int cmd)
{
if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE)
- set_bit(_IOC_NR(cmd), vdev->dont_use_lock);
+ set_bit(_IOC_NR(cmd), vdev->disable_locking);
}
-/* Mark that this command isn't implemented, must be called before
+/* Mark that this command isn't implemented. This must be called before
video_device_register. See also the comments in determine_valid_ioctls().
This function allows drivers to provide just one v4l2_ioctl_ops struct, but
disable ioctls based on the specific card that is actually found. */
-static inline void v4l2_dont_use_cmd(struct video_device *vdev, unsigned int cmd)
+static inline void v4l2_disable_ioctl(struct video_device *vdev, unsigned int cmd)
{
if (_IOC_NR(cmd) < BASE_VIDIOC_PRIVATE)
set_bit(_IOC_NR(cmd), vdev->valid_ioctls);
set_bit(V4L2_FL_USE_FH_PRIO, &tea->vd.flags);
/* disable hw_freq_seek if we can't use it */
if (tea->cannot_read_data)
- v4l2_dont_use_cmd(&tea->vd, VIDIOC_S_HW_FREQ_SEEK);
+ v4l2_disable_ioctl(&tea->vd, VIDIOC_S_HW_FREQ_SEEK);
v4l2_ctrl_handler_init(&tea->ctrl_handler, 1);
v4l2_ctrl_new_std(&tea->ctrl_handler, &tea575x_ctrl_ops, V4L2_CID_AUDIO_MUTE, 0, 1, 1, 1);