Lines Matching refs:tst
141 struct test_firmware_upload *tst;
143 list_for_each_entry(tst, &test_upload_list, node)
144 if (strncmp(name, tst->name, strlen(tst->name)) == 0)
145 return tst;
464 struct test_firmware_upload *tst;
468 tst = upload_lookup_name(buf);
469 if (tst)
470 test_fw_config->upload_name = tst->name;
1103 static void upload_release(struct test_firmware_upload *tst)
1105 firmware_upload_unregister(tst->fwl);
1106 kfree(tst->buf);
1107 kfree(tst->name);
1108 kfree(tst);
1113 struct test_firmware_upload *tst, *tmp;
1115 list_for_each_entry_safe(tst, tmp, &test_upload_list, node) {
1116 list_del(&tst->node);
1117 upload_release(tst);
1137 static void upload_err_inject_error(struct test_firmware_upload *tst,
1145 tst->inject.prog = prog;
1146 tst->inject.err_code = err;
1152 static void upload_err_inject_prog(struct test_firmware_upload *tst,
1162 upload_err_inject_error(tst, p + strlen(progs[i]),
1171 fw_upload_wait_on_cancel(struct test_firmware_upload *tst)
1177 if (tst->cancel_request)
1186 struct test_firmware_upload *tst = fwl->dd_handle;
1190 tst->cancel_request = false;
1198 upload_err_inject_prog(tst, data + strlen("inject:"));
1200 memset(tst->buf, 0, TEST_UPLOAD_MAX_SIZE);
1201 tst->size = size;
1203 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE ||
1204 strncmp(tst->inject.prog, progress, strlen(progress)) != 0)
1207 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED)
1208 ret = fw_upload_wait_on_cancel(tst);
1210 ret = tst->inject.err_code;
1217 tst->inject.err_code = FW_UPLOAD_ERR_NONE;
1218 tst->inject.prog = NULL;
1227 struct test_firmware_upload *tst = fwl->dd_handle;
1231 if (tst->cancel_request)
1235 memcpy(tst->buf + offset, data + offset, blk_size);
1239 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE ||
1240 strncmp(tst->inject.prog, progress, strlen(progress)) != 0)
1243 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED)
1244 return fw_upload_wait_on_cancel(tst);
1246 return tst->inject.err_code;
1251 struct test_firmware_upload *tst = fwl->dd_handle;
1254 if (tst->cancel_request)
1257 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE ||
1258 strncmp(tst->inject.prog, progress, strlen(progress)) != 0)
1261 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED)
1262 return fw_upload_wait_on_cancel(tst);
1264 return tst->inject.err_code;
1269 struct test_firmware_upload *tst = fwl->dd_handle;
1271 tst->cancel_request = true;
1276 struct test_firmware_upload *tst = fwl->dd_handle;
1278 tst->inject.err_code = FW_UPLOAD_ERR_NONE;
1279 tst->inject.prog = NULL;
1294 struct test_firmware_upload *tst;
1304 tst = upload_lookup_name(name);
1305 if (tst) {
1310 tst = kzalloc(sizeof(*tst), GFP_KERNEL);
1311 if (!tst) {
1316 tst->name = name;
1317 tst->buf = kzalloc(TEST_UPLOAD_MAX_SIZE, GFP_KERNEL);
1318 if (!tst->buf) {
1323 fwl = firmware_upload_register(THIS_MODULE, dev, tst->name,
1324 &upload_test_ops, tst);
1330 tst->fwl = fwl;
1331 list_add_tail(&tst->node, &test_upload_list);
1336 kfree(tst->buf);
1339 kfree(tst);
1353 struct test_firmware_upload *tst;
1357 tst = upload_lookup_name(buf);
1358 if (!tst) {
1363 if (test_fw_config->upload_name == tst->name)
1366 list_del(&tst->node);
1367 upload_release(tst);
1441 struct test_firmware_upload *tst = NULL;
1453 tst = tst_iter;
1457 if (!tst) {
1463 if (tst->size > PAGE_SIZE) {
1468 memcpy(buf, tst->buf, tst->size);
1469 ret = tst->size;