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);
1138 static void upload_err_inject_error(struct test_firmware_upload *tst,
1146 tst->inject.prog = prog;
1147 tst->inject.err_code = err;
1153 static void upload_err_inject_prog(struct test_firmware_upload *tst,
1163 upload_err_inject_error(tst, p + strlen(progs[i]),
1172 fw_upload_wait_on_cancel(struct test_firmware_upload *tst)
1178 if (tst->cancel_request)
1187 struct test_firmware_upload *tst = fwl->dd_handle;
1191 tst->cancel_request = false;
1199 upload_err_inject_prog(tst, data + strlen("inject:"));
1201 memset(tst->buf, 0, TEST_UPLOAD_MAX_SIZE);
1202 tst->size = size;
1204 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE ||
1205 strncmp(tst->inject.prog, progress, strlen(progress)) != 0)
1208 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED)
1209 ret = fw_upload_wait_on_cancel(tst);
1211 ret = tst->inject.err_code;
1218 tst->inject.err_code = FW_UPLOAD_ERR_NONE;
1219 tst->inject.prog = NULL;
1228 struct test_firmware_upload *tst = fwl->dd_handle;
1232 if (tst->cancel_request)
1236 memcpy(tst->buf + offset, data + offset, blk_size);
1240 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE ||
1241 strncmp(tst->inject.prog, progress, strlen(progress)) != 0)
1244 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED)
1245 return fw_upload_wait_on_cancel(tst);
1247 return tst->inject.err_code;
1252 struct test_firmware_upload *tst = fwl->dd_handle;
1255 if (tst->cancel_request)
1258 if (tst->inject.err_code == FW_UPLOAD_ERR_NONE ||
1259 strncmp(tst->inject.prog, progress, strlen(progress)) != 0)
1262 if (tst->inject.err_code == FW_UPLOAD_ERR_CANCELED)
1263 return fw_upload_wait_on_cancel(tst);
1265 return tst->inject.err_code;
1270 struct test_firmware_upload *tst = fwl->dd_handle;
1272 tst->cancel_request = true;
1277 struct test_firmware_upload *tst = fwl->dd_handle;
1279 tst->inject.err_code = FW_UPLOAD_ERR_NONE;
1280 tst->inject.prog = NULL;
1295 struct test_firmware_upload *tst;
1305 tst = upload_lookup_name(name);
1306 if (tst) {
1311 tst = kzalloc(sizeof(*tst), GFP_KERNEL);
1312 if (!tst) {
1317 tst->name = name;
1318 tst->buf = kzalloc(TEST_UPLOAD_MAX_SIZE, GFP_KERNEL);
1319 if (!tst->buf) {
1324 fwl = firmware_upload_register(THIS_MODULE, dev, tst->name,
1325 &upload_test_ops, tst);
1331 tst->fwl = fwl;
1332 list_add_tail(&tst->node, &test_upload_list);
1337 kfree(tst->buf);
1340 kfree(tst);
1354 struct test_firmware_upload *tst;
1358 tst = upload_lookup_name(buf);
1359 if (!tst) {
1364 if (test_fw_config->upload_name == tst->name)
1367 list_del(&tst->node);
1368 upload_release(tst);
1442 struct test_firmware_upload *tst = NULL;
1454 tst = tst_iter;
1458 if (!tst) {
1464 if (tst->size > PAGE_SIZE) {
1469 memcpy(buf, tst->buf, tst->size);
1470 ret = tst->size;