Lines Matching refs:tst
142 struct test_firmware_upload *tst; in upload_lookup_name() local
144 list_for_each_entry(tst, &test_upload_list, node) in upload_lookup_name()
145 if (strncmp(name, tst->name, strlen(tst->name)) == 0) in upload_lookup_name()
146 return tst; in upload_lookup_name()
465 struct test_firmware_upload *tst; in config_upload_name_store() local
469 tst = upload_lookup_name(buf); in config_upload_name_store()
470 if (tst) in config_upload_name_store()
471 test_fw_config->upload_name = tst->name; in config_upload_name_store()
1104 static void upload_release(struct test_firmware_upload *tst) in upload_release() argument
1106 firmware_upload_unregister(tst->fwl); in upload_release()
1107 kfree(tst->buf); in upload_release()
1108 kfree(tst->name); in upload_release()
1109 kfree(tst); in upload_release()
1114 struct test_firmware_upload *tst, *tmp; in upload_release_all() local
1116 list_for_each_entry_safe(tst, tmp, &test_upload_list, node) { in upload_release_all()
1117 list_del(&tst->node); in upload_release_all()
1118 upload_release(tst); in upload_release_all()
1139 static void upload_err_inject_error(struct test_firmware_upload *tst, in upload_err_inject_error() argument
1147 tst->inject.prog = prog; in upload_err_inject_error()
1148 tst->inject.err_code = err; in upload_err_inject_error()
1154 static void upload_err_inject_prog(struct test_firmware_upload *tst, in upload_err_inject_prog() argument
1164 upload_err_inject_error(tst, p + strlen(progs[i]), in upload_err_inject_prog()
1173 fw_upload_wait_on_cancel(struct test_firmware_upload *tst) in fw_upload_wait_on_cancel() argument
1179 if (tst->cancel_request) in fw_upload_wait_on_cancel()
1188 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_upload_prepare() local
1192 tst->cancel_request = false; in test_fw_upload_prepare()
1200 upload_err_inject_prog(tst, data + strlen("inject:")); in test_fw_upload_prepare()
1202 memset(tst->buf, 0, TEST_UPLOAD_MAX_SIZE); in test_fw_upload_prepare()
1203 tst->size = size; in test_fw_upload_prepare()
1205 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE || in test_fw_upload_prepare()
1206 strncmp(tst->inject.prog, progress, strlen(progress)) != 0) in test_fw_upload_prepare()
1209 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED) in test_fw_upload_prepare()
1210 ret = fw_upload_wait_on_cancel(tst); in test_fw_upload_prepare()
1212 ret = tst->inject.err_code; in test_fw_upload_prepare()
1219 tst->inject.err_code = FW_UPLOAD_ERR_NONE; in test_fw_upload_prepare()
1220 tst->inject.prog = NULL; in test_fw_upload_prepare()
1229 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_upload_write() local
1233 if (tst->cancel_request) in test_fw_upload_write()
1237 memcpy(tst->buf + offset, data + offset, blk_size); in test_fw_upload_write()
1241 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE || in test_fw_upload_write()
1242 strncmp(tst->inject.prog, progress, strlen(progress)) != 0) in test_fw_upload_write()
1245 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED) in test_fw_upload_write()
1246 return fw_upload_wait_on_cancel(tst); in test_fw_upload_write()
1248 return tst->inject.err_code; in test_fw_upload_write()
1253 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_upload_complete() local
1256 if (tst->cancel_request) in test_fw_upload_complete()
1259 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE || in test_fw_upload_complete()
1260 strncmp(tst->inject.prog, progress, strlen(progress)) != 0) in test_fw_upload_complete()
1263 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED) in test_fw_upload_complete()
1264 return fw_upload_wait_on_cancel(tst); in test_fw_upload_complete()
1266 return tst->inject.err_code; in test_fw_upload_complete()
1271 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_upload_cancel() local
1273 tst->cancel_request = true; in test_fw_upload_cancel()
1278 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_cleanup() local
1280 tst->inject.err_code = FW_UPLOAD_ERR_NONE; in test_fw_cleanup()
1281 tst->inject.prog = NULL; in test_fw_cleanup()
1296 struct test_firmware_upload *tst; in upload_register_store() local
1306 tst = upload_lookup_name(name); in upload_register_store()
1307 if (tst) { in upload_register_store()
1312 tst = kzalloc_obj(*tst); in upload_register_store()
1313 if (!tst) { in upload_register_store()
1318 tst->name = name; in upload_register_store()
1319 tst->buf = kzalloc(TEST_UPLOAD_MAX_SIZE, GFP_KERNEL); in upload_register_store()
1320 if (!tst->buf) { in upload_register_store()
1325 fwl = firmware_upload_register(THIS_MODULE, dev, tst->name, in upload_register_store()
1326 &upload_test_ops, tst); in upload_register_store()
1332 tst->fwl = fwl; in upload_register_store()
1333 list_add_tail(&tst->node, &test_upload_list); in upload_register_store()
1338 kfree(tst->buf); in upload_register_store()
1341 kfree(tst); in upload_register_store()
1355 struct test_firmware_upload *tst; in upload_unregister_store() local
1359 tst = upload_lookup_name(buf); in upload_unregister_store()
1360 if (!tst) { in upload_unregister_store()
1365 if (test_fw_config->upload_name == tst->name) in upload_unregister_store()
1368 list_del(&tst->node); in upload_unregister_store()
1369 upload_release(tst); in upload_unregister_store()
1443 struct test_firmware_upload *tst = NULL; in upload_read_show() local
1455 tst = tst_iter; in upload_read_show()
1459 if (!tst) { in upload_read_show()
1465 if (tst->size > PAGE_SIZE) { in upload_read_show()
1470 memcpy(buf, tst->buf, tst->size); in upload_read_show()
1471 ret = tst->size; in upload_read_show()