aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2018-09-07 12:02:35 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2018-09-07 12:02:35 +0200
commit1121e071aec3af327aa01cac296e0737614dc48f (patch)
tree10ade09859b853ea0b373c835826925ab8cf5ba1 /utils
parenta8c766b75f82d0facbeed5a392d91f4469ffd716 (diff)
v4l2-compliance: allow EILSEQ as well as error
If the UVC driver couldn't get/set a control it used to return EIO, but this has changed to EILSEQ with a recent kernel change. Actually, EIO is now split into multiple errors, but I am getting EILSEQ where I used to get EIO. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/v4l2-compliance/v4l2-test-controls.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp b/utils/v4l2-compliance/v4l2-test-controls.cpp
index 508daf05..b00aa7d9 100644
--- a/utils/v4l2-compliance/v4l2-test-controls.cpp
+++ b/utils/v4l2-compliance/v4l2-test-controls.cpp
@@ -433,6 +433,9 @@ int testSimpleControls(struct node *node)
} else if (ret == EIO) {
warn("s_ctrl returned EIO\n");
ret = 0;
+ } else if (ret == EILSEQ) {
+ warn("s_ctrl returned EILSEQ\n");
+ ret = 0;
} else if (ret) {
return fail("s_ctrl returned an error (%d)\n", ret);
}
@@ -446,7 +449,7 @@ int testSimpleControls(struct node *node)
ctrl.id = qctrl.id;
ctrl.value = qctrl.minimum - 1;
ret = doioctl(node, VIDIOC_S_CTRL, &ctrl);
- if (ret && ret != EIO && ret != ERANGE)
+ if (ret && ret != EIO && ret != EILSEQ && ret != ERANGE)
return fail("invalid minimum range check\n");
if (!ret && checkSimpleCtrl(ctrl, qctrl))
return fail("invalid control %08x\n", qctrl.id);
@@ -456,7 +459,7 @@ int testSimpleControls(struct node *node)
ctrl.id = qctrl.id;
ctrl.value = qctrl.maximum + 1;
ret = doioctl(node, VIDIOC_S_CTRL, &ctrl);
- if (ret && ret != EIO && ret != ERANGE)
+ if (ret && ret != EIO && ret != EILSEQ && ret != ERANGE)
return fail("invalid maximum range check\n");
if (!ret && checkSimpleCtrl(ctrl, qctrl))
return fail("invalid control %08x\n", qctrl.id);
@@ -469,7 +472,7 @@ int testSimpleControls(struct node *node)
if (ret == ERANGE)
warn("%s: returns ERANGE for in-range, but non-step-multiple value\n",
qctrl.name);
- else if (ret && ret != EIO)
+ else if (ret && ret != EIO && ret != EILSEQ)
return fail("returns error for in-range, but non-step-multiple value\n");
}
@@ -499,15 +502,15 @@ int testSimpleControls(struct node *node)
ctrl.id = qctrl.id;
ctrl.value = qctrl.minimum;
ret = doioctl(node, VIDIOC_S_CTRL, &ctrl);
- if (ret && ret != EIO)
+ if (ret && ret != EIO && ret != EILSEQ)
return fail("could not set minimum value\n");
ctrl.value = qctrl.maximum;
ret = doioctl(node, VIDIOC_S_CTRL, &ctrl);
- if (ret && ret != EIO)
+ if (ret && ret != EIO && ret != EILSEQ)
return fail("could not set maximum value\n");
ctrl.value = qctrl.default_value;
ret = doioctl(node, VIDIOC_S_CTRL, &ctrl);
- if (ret && ret != EIO)
+ if (ret && ret != EIO && ret != EILSEQ)
return fail("could not set default value\n");
}
}
@@ -641,6 +644,9 @@ int testExtendedControls(struct node *node)
if (ret == EIO) {
warn("g_ext_ctrls returned EIO\n");
ret = 0;
+ } else if (ret == EILSEQ) {
+ warn("g_ext_ctrls returned EILSEQ\n");
+ ret = 0;
}
if (ret)
return fail("g_ext_ctrls returned an error (%d)\n", ret);
@@ -670,6 +676,9 @@ int testExtendedControls(struct node *node)
if (ret == EIO) {
warn("s_ext_ctrls returned EIO\n");
ret = 0;
+ } else if (ret == EILSEQ) {
+ warn("s_ext_ctrls returned EILSEQ\n");
+ ret = 0;
}
if (ret)
return fail("s_ext_ctrls returned an error (%d)\n", ret);
@@ -739,6 +748,9 @@ int testExtendedControls(struct node *node)
if (ret == EIO) {
warn("s_ext_ctrls returned EIO\n");
ret = 0;
+ } else if (ret == EILSEQ) {
+ warn("s_ext_ctrls returned EILSEQ\n");
+ ret = 0;
}
if (ret)
return fail("could not set all controls\n");
@@ -765,6 +777,9 @@ int testExtendedControls(struct node *node)
if (ret == EIO) {
warn("s_ext_ctrls returned EIO\n");
ret = 0;
+ } else if (ret == EILSEQ) {
+ warn("s_ext_ctrls returned EILSEQ\n");
+ ret = 0;
}
if (ret && !multiple_classes)
return fail("could not set all controls of a specific class\n");

Privacy Policy