Lines Matching refs:test_fw_config

106 static struct test_config *test_fw_config;  variable
132 if (!test_fw_config->reqs) in __test_release_all_firmware()
135 for (i = 0; i < test_fw_config->num_requests; i++) { in __test_release_all_firmware()
136 req = &test_fw_config->reqs[i]; in __test_release_all_firmware()
141 vfree(test_fw_config->reqs); in __test_release_all_firmware()
142 test_fw_config->reqs = NULL; in __test_release_all_firmware()
156 kfree_const(test_fw_config->name); in __test_firmware_config_free()
157 test_fw_config->name = NULL; in __test_firmware_config_free()
177 ret = __kstrncpy(&test_fw_config->name, TEST_FIRMWARE_NAME, in __test_firmware_config_init()
182 test_fw_config->num_requests = TEST_FIRMWARE_NUM_REQS; in __test_firmware_config_init()
183 test_fw_config->send_uevent = true; in __test_firmware_config_init()
184 test_fw_config->into_buf = false; in __test_firmware_config_init()
185 test_fw_config->sync_direct = false; in __test_firmware_config_init()
186 test_fw_config->req_firmware = request_firmware; in __test_firmware_config_init()
187 test_fw_config->test_result = 0; in __test_firmware_config_init()
188 test_fw_config->reqs = NULL; in __test_firmware_config_init()
237 if (test_fw_config->name) in config_show()
240 test_fw_config->name); in config_show()
246 "num_requests:\t%u\n", test_fw_config->num_requests); in config_show()
250 test_fw_config->send_uevent ? in config_show()
255 test_fw_config->into_buf ? "true" : "false"); in config_show()
258 test_fw_config->sync_direct ? "true" : "false"); in config_show()
260 "read_fw_idx:\t%u\n", test_fw_config->read_fw_idx); in config_show()
275 kfree_const(test_fw_config->name); in config_name_store()
276 ret = __kstrncpy(&test_fw_config->name, buf, count, GFP_KERNEL); in config_name_store()
371 return config_test_show_str(buf, test_fw_config->name); in config_name_show()
382 if (test_fw_config->reqs) { in config_num_requests_store()
391 &test_fw_config->num_requests); in config_num_requests_store()
401 return test_dev_config_show_u8(buf, test_fw_config->num_requests); in config_num_requests_show()
411 &test_fw_config->into_buf); in config_into_buf_store()
418 return test_dev_config_show_bool(buf, test_fw_config->into_buf); in config_into_buf_show()
427 &test_fw_config->sync_direct); in config_sync_direct_store()
430 test_fw_config->req_firmware = test_fw_config->sync_direct ? in config_sync_direct_store()
440 return test_dev_config_show_bool(buf, test_fw_config->sync_direct); in config_sync_direct_show()
449 &test_fw_config->send_uevent); in config_send_uevent_store()
456 return test_dev_config_show_bool(buf, test_fw_config->send_uevent); in config_send_uevent_show()
465 &test_fw_config->read_fw_idx); in config_read_fw_idx_store()
472 return test_dev_config_show_u8(buf, test_fw_config->read_fw_idx); in config_read_fw_idx_show()
610 test_fw_config->test_result = -EINVAL; in test_fw_run_batch_request()
614 if (test_fw_config->into_buf) { in test_fw_run_batch_request()
629 req->rc = test_fw_config->req_firmware(&req->fw, in test_fw_run_batch_request()
637 if (!test_fw_config->test_result) in test_fw_run_batch_request()
638 test_fw_config->test_result = req->rc; in test_fw_run_batch_request()
667 test_fw_config->reqs = in trigger_batched_requests_store()
669 test_fw_config->num_requests, 2)); in trigger_batched_requests_store()
670 if (!test_fw_config->reqs) { in trigger_batched_requests_store()
676 test_fw_config->name, test_fw_config->num_requests); in trigger_batched_requests_store()
678 for (i = 0; i < test_fw_config->num_requests; i++) { in trigger_batched_requests_store()
679 req = &test_fw_config->reqs[i]; in trigger_batched_requests_store()
682 req->name = test_fw_config->name; in trigger_batched_requests_store()
706 for (i = 0; i < test_fw_config->num_requests; i++) { in trigger_batched_requests_store()
707 req = &test_fw_config->reqs[i]; in trigger_batched_requests_store()
714 test_fw_config->test_result = rc; in trigger_batched_requests_store()
731 test_fw_config->test_result = -EINVAL; in trigger_batched_cb()
747 if (!fw && !test_fw_config->test_result) in trigger_batched_cb()
748 test_fw_config->test_result = -ENOENT; in trigger_batched_cb()
765 test_fw_config->reqs = in trigger_batched_requests_async_store()
767 test_fw_config->num_requests, 2)); in trigger_batched_requests_async_store()
768 if (!test_fw_config->reqs) { in trigger_batched_requests_async_store()
774 test_fw_config->name, test_fw_config->num_requests); in trigger_batched_requests_async_store()
776 send_uevent = test_fw_config->send_uevent ? FW_ACTION_HOTPLUG : in trigger_batched_requests_async_store()
779 for (i = 0; i < test_fw_config->num_requests; i++) { in trigger_batched_requests_async_store()
780 req = &test_fw_config->reqs[i]; in trigger_batched_requests_async_store()
781 req->name = test_fw_config->name; in trigger_batched_requests_async_store()
810 for (i = 0; i < test_fw_config->num_requests; i++) { in trigger_batched_requests_async_store()
811 req = &test_fw_config->reqs[i]; in trigger_batched_requests_async_store()
818 test_fw_config->test_result = rc; in trigger_batched_requests_async_store()
831 return test_dev_config_show_int(buf, test_fw_config->test_result); in test_result_show()
854 idx = test_fw_config->read_fw_idx; in read_firmware_show()
855 if (idx >= test_fw_config->num_requests) { in read_firmware_show()
860 if (!test_fw_config->reqs) { in read_firmware_show()
865 req = &test_fw_config->reqs[idx]; in read_firmware_show()
930 test_fw_config = kzalloc(sizeof(struct test_config), GFP_KERNEL); in test_firmware_init()
931 if (!test_fw_config) in test_firmware_init()
936 kfree(test_fw_config); in test_firmware_init()
943 kfree(test_fw_config); in test_firmware_init()
961 kfree(test_fw_config); in test_firmware_exit()