Lines Matching refs:fd

31 	int fd;  in writeat()  local
33 fd = openat(dfd, fn, O_WRONLY); in writeat()
34 if (fd == -1) in writeat()
36 res = write(fd, val, val_len); in writeat()
38 close(fd); in writeat()
207 int fd; in FIXTURE() local
213 self->fd = -1; in FIXTURE_SETUP()
226 teardown_iommufd(self->fd, _metadata); in FIXTURE_TEARDOWN()
238 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
239 if (self->fd == -1) in TEST_FAIL_NTH()
242 if (_test_ioctl_ioas_alloc(self->fd, &ioas_id)) in TEST_FAIL_NTH()
252 if (ioctl(self->fd, IOMMU_IOAS_IOVA_RANGES, &ranges_cmd)) in TEST_FAIL_NTH()
266 if (ioctl(self->fd, IOMMU_IOAS_ALLOW_IOVAS, &allow_cmd)) in TEST_FAIL_NTH()
270 if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, BUFFER_SIZE, &iova, in TEST_FAIL_NTH()
286 if (ioctl(self->fd, IOMMU_IOAS_COPY, &copy_cmd)) in TEST_FAIL_NTH()
290 if (_test_ioctl_ioas_unmap(self->fd, ioas_id, iova, BUFFER_SIZE, in TEST_FAIL_NTH()
294 _test_ioctl_ioas_unmap(self->fd, ioas_id, iova, BUFFER_SIZE, NULL); in TEST_FAIL_NTH()
306 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
307 if (self->fd == -1) in TEST_FAIL_NTH()
310 if (_test_ioctl_ioas_alloc(self->fd, &ioas_id)) in TEST_FAIL_NTH()
313 if (_test_ioctl_set_temp_memory_limit(self->fd, 32)) in TEST_FAIL_NTH()
318 if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id, NULL)) in TEST_FAIL_NTH()
321 if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, 262144, &iova, in TEST_FAIL_NTH()
326 if (_test_ioctl_destroy(self->fd, stdev_id)) in TEST_FAIL_NTH()
329 if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id, NULL)) in TEST_FAIL_NTH()
343 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
344 if (self->fd == -1) in TEST_FAIL_NTH()
347 if (_test_ioctl_ioas_alloc(self->fd, &ioas_id)) in TEST_FAIL_NTH()
350 if (_test_ioctl_set_temp_memory_limit(self->fd, 32)) in TEST_FAIL_NTH()
353 if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id, NULL)) in TEST_FAIL_NTH()
358 if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id2, &hwpt_id2, in TEST_FAIL_NTH()
362 if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, 262144, &iova, in TEST_FAIL_NTH()
367 if (_test_ioctl_destroy(self->fd, stdev_id)) in TEST_FAIL_NTH()
370 if (_test_ioctl_destroy(self->fd, stdev_id2)) in TEST_FAIL_NTH()
373 if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id, NULL)) in TEST_FAIL_NTH()
375 if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id2, &hwpt_id2, in TEST_FAIL_NTH()
388 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
389 if (self->fd == -1) in TEST_FAIL_NTH()
392 if (_test_ioctl_ioas_alloc(self->fd, &ioas_id)) in TEST_FAIL_NTH()
395 if (_test_ioctl_set_temp_memory_limit(self->fd, 32)) in TEST_FAIL_NTH()
398 if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, 262144, &iova, in TEST_FAIL_NTH()
405 if (_test_cmd_create_access(self->fd, ioas_id, &self->access_id, 0)) in TEST_FAIL_NTH()
419 if (ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_ACCESS_RW), in TEST_FAIL_NTH()
424 if (ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_ACCESS_RW), in TEST_FAIL_NTH()
429 if (ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_ACCESS_RW), in TEST_FAIL_NTH()
434 if (ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_ACCESS_RW), in TEST_FAIL_NTH()
450 if (ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_ACCESS_RW), in TEST_FAIL_NTH()
467 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
468 if (self->fd == -1) in TEST_FAIL_NTH()
471 if (_test_ioctl_ioas_alloc(self->fd, &ioas_id)) in TEST_FAIL_NTH()
474 if (_test_ioctl_set_temp_memory_limit(self->fd, 32)) in TEST_FAIL_NTH()
477 if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, BUFFER_SIZE, &iova, in TEST_FAIL_NTH()
482 if (_test_cmd_create_access(self->fd, ioas_id, &self->access_id, in TEST_FAIL_NTH()
498 if (ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_ACCESS_RW), in TEST_FAIL_NTH()
504 if (_test_cmd_destroy_access_pages(self->fd, self->access_id, in TEST_FAIL_NTH()
523 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
524 if (self->fd == -1) in TEST_FAIL_NTH()
527 if (_test_ioctl_ioas_alloc(self->fd, &ioas_id)) in TEST_FAIL_NTH()
530 if (_test_ioctl_set_temp_memory_limit(self->fd, 32)) in TEST_FAIL_NTH()
533 if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, &hwpt_id, NULL)) in TEST_FAIL_NTH()
536 if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, BUFFER_SIZE, &iova, in TEST_FAIL_NTH()
541 if (_test_cmd_create_access(self->fd, ioas_id, &self->access_id, in TEST_FAIL_NTH()
557 if (ioctl(self->fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_ACCESS_RW), in TEST_FAIL_NTH()
563 if (_test_cmd_destroy_access_pages(self->fd, self->access_id, in TEST_FAIL_NTH()
571 if (_test_ioctl_destroy(self->fd, stdev_id)) in TEST_FAIL_NTH()
587 self->fd = open("/dev/iommu", O_RDWR); in TEST_FAIL_NTH()
588 if (self->fd == -1) in TEST_FAIL_NTH()
591 if (_test_ioctl_ioas_alloc(self->fd, &ioas_id)) in TEST_FAIL_NTH()
594 if (_test_ioctl_ioas_alloc(self->fd, &ioas_id2)) in TEST_FAIL_NTH()
598 if (_test_ioctl_ioas_map(self->fd, ioas_id, buffer, PAGE_SIZE, &iova, in TEST_FAIL_NTH()
603 if (_test_ioctl_ioas_map(self->fd, ioas_id2, buffer, PAGE_SIZE, &iova, in TEST_FAIL_NTH()
611 if (_test_cmd_mock_domain(self->fd, ioas_id, &stdev_id, NULL, in TEST_FAIL_NTH()
615 if (_test_cmd_get_hw_info(self->fd, idev_id, &info, sizeof(info))) in TEST_FAIL_NTH()
618 if (_test_cmd_hwpt_alloc(self->fd, idev_id, ioas_id, &hwpt_id)) in TEST_FAIL_NTH()
621 if (_test_cmd_mock_domain_replace(self->fd, stdev_id, ioas_id2, NULL)) in TEST_FAIL_NTH()
624 if (_test_cmd_mock_domain_replace(self->fd, stdev_id, hwpt_id, NULL)) in TEST_FAIL_NTH()