Lines Matching refs:tst

141 	struct test_firmware_upload *tst;  in upload_lookup_name()  local
143 list_for_each_entry(tst, &test_upload_list, node) in upload_lookup_name()
144 if (strncmp(name, tst->name, strlen(tst->name)) == 0) in upload_lookup_name()
145 return tst; in upload_lookup_name()
464 struct test_firmware_upload *tst; in config_upload_name_store() local
468 tst = upload_lookup_name(buf); in config_upload_name_store()
469 if (tst) in config_upload_name_store()
470 test_fw_config->upload_name = tst->name; in config_upload_name_store()
1103 static void upload_release(struct test_firmware_upload *tst) in upload_release() argument
1105 firmware_upload_unregister(tst->fwl); in upload_release()
1106 kfree(tst->buf); in upload_release()
1107 kfree(tst->name); in upload_release()
1108 kfree(tst); in upload_release()
1113 struct test_firmware_upload *tst, *tmp; in upload_release_all() local
1115 list_for_each_entry_safe(tst, tmp, &test_upload_list, node) { in upload_release_all()
1116 list_del(&tst->node); in upload_release_all()
1117 upload_release(tst); in upload_release_all()
1138 static void upload_err_inject_error(struct test_firmware_upload *tst, in upload_err_inject_error() argument
1146 tst->inject.prog = prog; in upload_err_inject_error()
1147 tst->inject.err_code = err; in upload_err_inject_error()
1153 static void upload_err_inject_prog(struct test_firmware_upload *tst, in upload_err_inject_prog() argument
1163 upload_err_inject_error(tst, p + strlen(progs[i]), in upload_err_inject_prog()
1172 fw_upload_wait_on_cancel(struct test_firmware_upload *tst) in fw_upload_wait_on_cancel() argument
1178 if (tst->cancel_request) in fw_upload_wait_on_cancel()
1187 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_upload_prepare() local
1191 tst->cancel_request = false; in test_fw_upload_prepare()
1199 upload_err_inject_prog(tst, data + strlen("inject:")); in test_fw_upload_prepare()
1201 memset(tst->buf, 0, TEST_UPLOAD_MAX_SIZE); in test_fw_upload_prepare()
1202 tst->size = size; in test_fw_upload_prepare()
1204 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE || in test_fw_upload_prepare()
1205 strncmp(tst->inject.prog, progress, strlen(progress)) != 0) in test_fw_upload_prepare()
1208 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED) in test_fw_upload_prepare()
1209 ret = fw_upload_wait_on_cancel(tst); in test_fw_upload_prepare()
1211 ret = tst->inject.err_code; in test_fw_upload_prepare()
1218 tst->inject.err_code = FW_UPLOAD_ERR_NONE; in test_fw_upload_prepare()
1219 tst->inject.prog = NULL; in test_fw_upload_prepare()
1228 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_upload_write() local
1232 if (tst->cancel_request) in test_fw_upload_write()
1236 memcpy(tst->buf + offset, data + offset, blk_size); in test_fw_upload_write()
1240 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE || in test_fw_upload_write()
1241 strncmp(tst->inject.prog, progress, strlen(progress)) != 0) in test_fw_upload_write()
1244 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED) in test_fw_upload_write()
1245 return fw_upload_wait_on_cancel(tst); in test_fw_upload_write()
1247 return tst->inject.err_code; in test_fw_upload_write()
1252 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_upload_complete() local
1255 if (tst->cancel_request) in test_fw_upload_complete()
1258 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE || in test_fw_upload_complete()
1259 strncmp(tst->inject.prog, progress, strlen(progress)) != 0) in test_fw_upload_complete()
1262 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED) in test_fw_upload_complete()
1263 return fw_upload_wait_on_cancel(tst); in test_fw_upload_complete()
1265 return tst->inject.err_code; in test_fw_upload_complete()
1270 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_upload_cancel() local
1272 tst->cancel_request = true; in test_fw_upload_cancel()
1277 struct test_firmware_upload *tst = fwl->dd_handle; in test_fw_cleanup() local
1279 tst->inject.err_code = FW_UPLOAD_ERR_NONE; in test_fw_cleanup()
1280 tst->inject.prog = NULL; in test_fw_cleanup()
1295 struct test_firmware_upload *tst; in upload_register_store() local
1305 tst = upload_lookup_name(name); in upload_register_store()
1306 if (tst) { in upload_register_store()
1311 tst = kzalloc(sizeof(*tst), GFP_KERNEL); in upload_register_store()
1312 if (!tst) { in upload_register_store()
1317 tst->name = name; in upload_register_store()
1318 tst->buf = kzalloc(TEST_UPLOAD_MAX_SIZE, GFP_KERNEL); in upload_register_store()
1319 if (!tst->buf) { in upload_register_store()
1324 fwl = firmware_upload_register(THIS_MODULE, dev, tst->name, in upload_register_store()
1325 &upload_test_ops, tst); in upload_register_store()
1331 tst->fwl = fwl; in upload_register_store()
1332 list_add_tail(&tst->node, &test_upload_list); in upload_register_store()
1337 kfree(tst->buf); in upload_register_store()
1340 kfree(tst); in upload_register_store()
1354 struct test_firmware_upload *tst; in upload_unregister_store() local
1358 tst = upload_lookup_name(buf); in upload_unregister_store()
1359 if (!tst) { in upload_unregister_store()
1364 if (test_fw_config->upload_name == tst->name) in upload_unregister_store()
1367 list_del(&tst->node); in upload_unregister_store()
1368 upload_release(tst); in upload_unregister_store()
1442 struct test_firmware_upload *tst = NULL; in upload_read_show() local
1454 tst = tst_iter; in upload_read_show()
1458 if (!tst) { in upload_read_show()
1464 if (tst->size > PAGE_SIZE) { in upload_read_show()
1469 memcpy(buf, tst->buf, tst->size); in upload_read_show()
1470 ret = tst->size; in upload_read_show()