Lines Matching refs:cmd

103 	struct iommu_test_cmd cmd = {  in _test_cmd_mock_domain()  local
104 .size = sizeof(cmd), in _test_cmd_mock_domain()
111 ret = ioctl(fd, IOMMU_TEST_CMD, &cmd); in _test_cmd_mock_domain()
115 *stdev_id = cmd.mock_domain.out_stdev_id; in _test_cmd_mock_domain()
116 assert(cmd.id != 0); in _test_cmd_mock_domain()
118 *hwpt_id = cmd.mock_domain.out_hwpt_id; in _test_cmd_mock_domain()
120 *idev_id = cmd.mock_domain.out_idev_id; in _test_cmd_mock_domain()
134 struct iommu_test_cmd cmd = { in _test_cmd_mock_domain_flags() local
135 .size = sizeof(cmd), in _test_cmd_mock_domain_flags()
142 ret = ioctl(fd, IOMMU_TEST_CMD, &cmd); in _test_cmd_mock_domain_flags()
146 *stdev_id = cmd.mock_domain_flags.out_stdev_id; in _test_cmd_mock_domain_flags()
147 assert(cmd.id != 0); in _test_cmd_mock_domain_flags()
149 *hwpt_id = cmd.mock_domain_flags.out_hwpt_id; in _test_cmd_mock_domain_flags()
151 *idev_id = cmd.mock_domain_flags.out_idev_id; in _test_cmd_mock_domain_flags()
165 struct iommu_test_cmd cmd = { in _test_cmd_mock_domain_replace() local
166 .size = sizeof(cmd), in _test_cmd_mock_domain_replace()
175 ret = ioctl(fd, IOMMU_TEST_CMD, &cmd); in _test_cmd_mock_domain_replace()
179 *hwpt_id = cmd.mock_domain_replace.pt_id; in _test_cmd_mock_domain_replace()
194 struct iommu_hwpt_alloc cmd = { in _test_cmd_hwpt_alloc() local
195 .size = sizeof(cmd), in _test_cmd_hwpt_alloc()
206 ret = ioctl(fd, IOMMU_HWPT_ALLOC, &cmd); in _test_cmd_hwpt_alloc()
210 *hwpt_id = cmd.out_hwpt_id; in _test_cmd_hwpt_alloc()
297 struct iommu_hwpt_invalidate cmd = { in _test_cmd_hwpt_invalidate() local
298 .size = sizeof(cmd), in _test_cmd_hwpt_invalidate()
305 int rc = ioctl(fd, IOMMU_HWPT_INVALIDATE, &cmd); in _test_cmd_hwpt_invalidate()
306 *nreqs = cmd.entry_num; in _test_cmd_hwpt_invalidate()
328 struct iommu_hwpt_invalidate cmd = { in _test_cmd_viommu_invalidate() local
329 .size = sizeof(cmd), in _test_cmd_viommu_invalidate()
336 int rc = ioctl(fd, IOMMU_HWPT_INVALIDATE, &cmd); in _test_cmd_viommu_invalidate()
337 *nreqs = cmd.entry_num; in _test_cmd_viommu_invalidate()
359 struct iommu_test_cmd cmd = { in _test_cmd_access_replace_ioas() local
360 .size = sizeof(cmd), in _test_cmd_access_replace_ioas()
367 ret = ioctl(fd, IOMMU_TEST_CMD, &cmd); in _test_cmd_access_replace_ioas()
377 struct iommu_hwpt_set_dirty_tracking cmd = { in _test_cmd_set_dirty_tracking() local
378 .size = sizeof(cmd), in _test_cmd_set_dirty_tracking()
384 ret = ioctl(fd, IOMMU_HWPT_SET_DIRTY_TRACKING, &cmd); in _test_cmd_set_dirty_tracking()
396 struct iommu_hwpt_get_dirty_bitmap cmd = { in _test_cmd_get_dirty_bitmap() local
397 .size = sizeof(cmd), in _test_cmd_get_dirty_bitmap()
407 ret = ioctl(fd, IOMMU_HWPT_GET_DIRTY_BITMAP, &cmd); in _test_cmd_get_dirty_bitmap()
422 struct iommu_test_cmd cmd = { in _test_cmd_mock_domain_set_dirty() local
423 .size = sizeof(cmd), in _test_cmd_mock_domain_set_dirty()
435 ret = ioctl(fd, _IOMMU_TEST_CMD(IOMMU_TEST_OP_DIRTY), &cmd); in _test_cmd_mock_domain_set_dirty()
439 *dirty = cmd.dirty.out_nr_dirty; in _test_cmd_mock_domain_set_dirty()
508 struct iommu_test_cmd cmd = { in _test_cmd_create_access() local
509 .size = sizeof(cmd), in _test_cmd_create_access()
516 ret = ioctl(fd, IOMMU_TEST_CMD, &cmd); in _test_cmd_create_access()
519 *access_id = cmd.create_access.out_access_fd; in _test_cmd_create_access()
536 struct iommu_test_cmd cmd = { in _test_cmd_destroy_access_pages() local
537 .size = sizeof(cmd), in _test_cmd_destroy_access_pages()
542 return ioctl(fd, IOMMU_TEST_CMD, &cmd); in _test_cmd_destroy_access_pages()
553 struct iommu_destroy cmd = { in _test_ioctl_destroy() local
554 .size = sizeof(cmd), in _test_ioctl_destroy()
557 return ioctl(fd, IOMMU_DESTROY, &cmd); in _test_ioctl_destroy()
563 struct iommu_ioas_alloc cmd = { in _test_ioctl_ioas_alloc() local
564 .size = sizeof(cmd), in _test_ioctl_ioas_alloc()
568 ret = ioctl(fd, IOMMU_IOAS_ALLOC, &cmd); in _test_ioctl_ioas_alloc()
571 *id = cmd.out_ioas_id; in _test_ioctl_ioas_alloc()
583 struct iommu_ioas_map cmd = { in _test_ioctl_ioas_map() local
584 .size = sizeof(cmd), in _test_ioctl_ioas_map()
593 cmd.iova = *iova; in _test_ioctl_ioas_map()
595 ret = ioctl(fd, IOMMU_IOAS_MAP, &cmd); in _test_ioctl_ioas_map()
596 *iova = cmd.iova; in _test_ioctl_ioas_map()
655 struct iommu_ioas_unmap cmd = { in _test_ioctl_ioas_unmap() local
656 .size = sizeof(cmd), in _test_ioctl_ioas_unmap()
663 ret = ioctl(fd, IOMMU_IOAS_UNMAP, &cmd); in _test_ioctl_ioas_unmap()
665 *out_len = cmd.length; in _test_ioctl_ioas_unmap()
684 struct iommu_ioas_map_file cmd = { in _test_ioctl_ioas_map_file() local
685 .size = sizeof(cmd), in _test_ioctl_ioas_map_file()
695 cmd.iova = *iova; in _test_ioctl_ioas_map_file()
697 ret = ioctl(fd, IOMMU_IOAS_MAP_FILE, &cmd); in _test_ioctl_ioas_map_file()
698 *iova = cmd.iova; in _test_ioctl_ioas_map_file()
760 #define EXPECT_ERRNO(expected_errno, cmd) \ argument
762 ASSERT_EQ(-1, cmd); \
774 struct iommu_hw_info cmd = { in _test_cmd_get_hw_info() local
775 .size = sizeof(cmd), in _test_cmd_get_hw_info()
785 cmd.flags |= IOMMU_HW_INFO_FLAG_INPUT_TYPE; in _test_cmd_get_hw_info()
787 ret = ioctl(fd, IOMMU_GET_HW_INFO, &cmd); in _test_cmd_get_hw_info()
791 assert(cmd.out_data_type == IOMMU_HW_INFO_TYPE_SELFTEST); in _test_cmd_get_hw_info()
797 assert(cmd.data_len == sizeof(struct iommu_test_hw_info)); in _test_cmd_get_hw_info()
803 if (data_len > cmd.data_len) { in _test_cmd_get_hw_info()
804 char *ptr = (char *)(data + cmd.data_len); in _test_cmd_get_hw_info()
807 while (idx < data_len - cmd.data_len) { in _test_cmd_get_hw_info()
821 *max_pasid = cmd.out_max_pasid_log2; in _test_cmd_get_hw_info()
824 *capabilities = cmd.out_capabilities; in _test_cmd_get_hw_info()
850 struct iommu_fault_alloc cmd = { in _test_ioctl_fault_alloc() local
851 .size = sizeof(cmd), in _test_ioctl_fault_alloc()
855 ret = ioctl(fd, IOMMU_FAULT_QUEUE_ALLOC, &cmd); in _test_ioctl_fault_alloc()
858 *fault_id = cmd.out_fault_id; in _test_ioctl_fault_alloc()
859 *fault_fd = cmd.out_fault_fd; in _test_ioctl_fault_alloc()
919 struct iommu_viommu_alloc cmd = { in _test_cmd_viommu_alloc() local
920 .size = sizeof(cmd), in _test_cmd_viommu_alloc()
930 ret = ioctl(fd, IOMMU_VIOMMU_ALLOC, &cmd); in _test_cmd_viommu_alloc()
934 *viommu_id = cmd.out_viommu_id; in _test_cmd_viommu_alloc()
951 struct iommu_vdevice_alloc cmd = { in _test_cmd_vdevice_alloc() local
952 .size = sizeof(cmd), in _test_cmd_vdevice_alloc()
959 ret = ioctl(fd, IOMMU_VDEVICE_ALLOC, &cmd); in _test_cmd_vdevice_alloc()
963 *vdev_id = cmd.out_vdevice_id; in _test_cmd_vdevice_alloc()
979 struct iommu_hw_queue_alloc cmd = { in _test_cmd_hw_queue_alloc() local
980 .size = sizeof(cmd), in _test_cmd_hw_queue_alloc()
989 ret = ioctl(fd, IOMMU_HW_QUEUE_ALLOC, &cmd); in _test_cmd_hw_queue_alloc()
993 *hw_queue_id = cmd.out_hw_queue_id; in _test_cmd_hw_queue_alloc()
1009 struct iommu_veventq_alloc cmd = { in _test_cmd_veventq_alloc() local
1010 .size = sizeof(cmd), in _test_cmd_veventq_alloc()
1017 ret = ioctl(fd, IOMMU_VEVENTQ_ALLOC, &cmd); in _test_cmd_veventq_alloc()
1021 *veventq_id = cmd.out_veventq_id; in _test_cmd_veventq_alloc()
1023 *veventq_fd = cmd.out_veventq_fd; in _test_cmd_veventq_alloc()