v4l2-compliance: remove ChipIdent tests
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 3 Apr 2013 06:31:50 +0000 (08:31 +0200)
committerHans Verkuil <hans.verkuil@cisco.com>
Wed, 3 Apr 2013 06:31:50 +0000 (08:31 +0200)
These tests are no longer necessary: VIDIOC_DBG_G_CHIP_IDENT is deprecated
and is replaced by VIDIOC_DBG_G_CHIP_NAME, which is a core ioctl that is
always available.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
utils/v4l2-compliance/v4l2-compliance.cpp
utils/v4l2-compliance/v4l2-compliance.h
utils/v4l2-compliance/v4l2-test-debug.cpp

index b27d60c..052f548 100644 (file)
@@ -606,7 +606,6 @@ int main(int argc, char **argv)
        /* Debug ioctls */
 
        printf("Debug ioctls:\n");
-       printf("\ttest VIDIOC_DBG_G_CHIP_IDENT: %s\n", ok(testChipIdent(&node)));
        printf("\ttest VIDIOC_DBG_G/S_REGISTER: %s\n", ok(testRegister(&node)));
        printf("\ttest VIDIOC_LOG_STATUS: %s\n", ok(testLogStatus(&node)));
        printf("\n");
index 08f1ec6..f9b5291 100644 (file)
@@ -153,7 +153,6 @@ int check_ustring(const __u8 *s, int len);
 int check_0(const void *p, int len);
 
 // Debug ioctl tests
-int testChipIdent(struct node *node);
 int testRegister(struct node *node);
 int testLogStatus(struct node *node);
 
index 55d0631..a178f78 100644 (file)
 #include <math.h>
 #include "v4l2-compliance.h"
 
-int testChipIdent(struct node *node)
-{
-       struct v4l2_dbg_chip_ident chip;
-       int ret;
-
-       memset(&chip, 0, sizeof(chip));
-       chip.match.type = V4L2_CHIP_MATCH_HOST;
-       chip.match.addr = 0;
-       ret = doioctl(node, VIDIOC_DBG_G_CHIP_IDENT, &chip);
-       // Must return either 0 (OK) or EINVAL (not supported)
-       if (ret == 0) {
-               struct v4l2_dbg_chip_ident orig;
-
-               memset(&orig, 0, sizeof(orig));
-               // set invalid match_type
-               chip.match.type = V4L2_CHIP_MATCH_I2C_ADDR + 1;
-               chip.match.addr = 0xdeadbeef;
-               chip.ident = 0xdeadbeef;
-               chip.revision = 0xdeadbeef;
-               orig = chip;
-               ret = doioctl(node, VIDIOC_DBG_G_CHIP_IDENT, &chip);
-               if (ret != EINVAL)
-                       return fail("Invalid match_type accepted\n");
-               fail_on_test(memcmp(&orig, &chip, sizeof(chip)));
-               return 0;
-       }
-       return ret;
-}
-
 int testRegister(struct node *node)
 {
        struct v4l2_dbg_register reg;
-       struct v4l2_dbg_chip_ident chip;
+       struct v4l2_dbg_chip_name chip;
        int ret;
        int uid = getuid();
 
-       reg.match.type = V4L2_CHIP_MATCH_HOST;
+       reg.match.type = V4L2_CHIP_MATCH_BRIDGE;
        reg.match.addr = 0;
        reg.reg = 0;
        ret = doioctl(node, VIDIOC_DBG_G_REGISTER, &reg);
@@ -79,9 +50,9 @@ int testRegister(struct node *node)
        // Not allowed to call VIDIOC_DBG_G_REGISTER unless root
        fail_on_test(uid && ret != EPERM);
        fail_on_test(uid == 0 && ret);
-       chip.match.type = V4L2_CHIP_MATCH_HOST;
+       chip.match.type = V4L2_CHIP_MATCH_BRIDGE;
        chip.match.addr = 0;
-       fail_on_test(doioctl(node, VIDIOC_DBG_G_CHIP_IDENT, &chip));
+       fail_on_test(doioctl(node, VIDIOC_DBG_G_CHIP_NAME, &chip));
        if (uid) {
                // Don't test S_REGISTER as root, don't want to risk
                // messing with registers in the compliance test.