Lines Matching refs:cmd
75 struct iommu_destroy cmd = { .size = sizeof(cmd), .id = 0 }; in TEST_F() local
84 &cmd)); in TEST_F()
92 struct _struct cmd; \ in TEST_F()
94 } cmd = { .cmd = { .size = sizeof(struct _struct) - 1 }, \ in TEST_F()
99 EXPECT_ERRNO(EINVAL, ioctl(self->fd, _ioctl, &cmd)); \ in TEST_F()
100 cmd.cmd.size = sizeof(struct _struct) + 1; \ in TEST_F()
101 EXPECT_ERRNO(E2BIG, ioctl(self->fd, _ioctl, &cmd)); \ in TEST_F()
102 cmd.cmd.size = sizeof(struct _struct); \ in TEST_F()
103 rc = ioctl(self->fd, _ioctl, &cmd); \ in TEST_F()
105 cmd.cmd.size = sizeof(struct _struct) + 1; \ in TEST_F()
106 cmd.extra = 0; \ in TEST_F()
109 ioctl(self->fd, _ioctl, &cmd)); \ in TEST_F()
111 ASSERT_EQ(0, ioctl(self->fd, _ioctl, &cmd)); \ in TEST_F()
131 struct iommu_destroy cmd; in TEST_F() member
133 } cmd = { .cmd = { .size = sizeof(cmd), .id = 0 } }; in TEST_F() local
136 EXPECT_ERRNO(ENOENT, ioctl(self->fd, IOMMU_DESTROY, &cmd)); in TEST_F()
138 cmd.future = 1; in TEST_F()
139 EXPECT_ERRNO(E2BIG, ioctl(self->fd, IOMMU_DESTROY, &cmd)); in TEST_F()
141 cmd.cmd.size = sizeof(cmd.cmd); in TEST_F()
142 EXPECT_ERRNO(ENOENT, ioctl(self->fd, IOMMU_DESTROY, &cmd)); in TEST_F()
144 cmd.cmd.size = sizeof(cmd.cmd) - 1; in TEST_F()
145 EXPECT_ERRNO(EINVAL, ioctl(self->fd, IOMMU_DESTROY, &cmd)); in TEST_F()
150 struct iommu_option cmd = { in TEST_F() local
151 .size = sizeof(cmd), in TEST_F()
157 cmd.option_id = IOMMU_OPTION_RLIMIT_MODE; in TEST_F()
158 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
159 ASSERT_EQ(0, cmd.val64); in TEST_F()
162 cmd.op = IOMMU_OPTION_OP_SET; in TEST_F()
163 cmd.val64 = 1; in TEST_F()
164 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
165 cmd.val64 = 2; in TEST_F()
166 EXPECT_ERRNO(EINVAL, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
168 cmd.op = IOMMU_OPTION_OP_GET; in TEST_F()
169 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
170 ASSERT_EQ(1, cmd.val64); in TEST_F()
172 cmd.op = IOMMU_OPTION_OP_SET; in TEST_F()
173 cmd.val64 = 0; in TEST_F()
174 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
176 cmd.op = IOMMU_OPTION_OP_GET; in TEST_F()
177 cmd.option_id = IOMMU_OPTION_HUGE_PAGES; in TEST_F()
178 EXPECT_ERRNO(ENOENT, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
179 cmd.op = IOMMU_OPTION_OP_SET; in TEST_F()
180 EXPECT_ERRNO(ENOENT, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
935 struct iommu_option cmd = { in TEST_F() local
936 .size = sizeof(cmd), in TEST_F()
943 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
944 ASSERT_EQ(1, cmd.val64); in TEST_F()
946 cmd.op = IOMMU_OPTION_OP_SET; in TEST_F()
947 cmd.val64 = 0; in TEST_F()
948 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
950 cmd.op = IOMMU_OPTION_OP_GET; in TEST_F()
951 cmd.val64 = 3; in TEST_F()
952 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
953 ASSERT_EQ(0, cmd.val64); in TEST_F()
955 cmd.op = IOMMU_OPTION_OP_SET; in TEST_F()
956 cmd.val64 = 2; in TEST_F()
957 EXPECT_ERRNO(EINVAL, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
959 cmd.op = IOMMU_OPTION_OP_SET; in TEST_F()
960 cmd.val64 = 1; in TEST_F()
961 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
981 struct iommu_option cmd = { in TEST_F() local
982 .size = sizeof(cmd), in TEST_F()
1001 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
1007 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
1010 cmd.val64 = 1; in TEST_F()
1011 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
1016 cmd.val64 = 0; in TEST_F()
1017 EXPECT_ERRNO(EADDRINUSE, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
1567 struct iommu_option cmd = { in TEST_F() local
1568 .size = sizeof(cmd), in TEST_F()
1575 ASSERT_EQ(0, ioctl(self->fd, IOMMU_OPTION, &cmd)); in TEST_F()
1577 ASSERT_EQ(0, cmd.val64); in TEST_F()
1579 ASSERT_EQ(1, cmd.val64); in TEST_F()
1597 #define ioctl_check_buf(fd, cmd) \ argument
1602 ASSERT_EQ(0, ioctl(fd, cmd, buffer)); \