Lines Matching refs:tdata
65 static struct test_data tdata; variable
70 int *idx = spim ? &tdata.spim_alloc_idx : &tdata.spis_alloc_idx; in buf_alloc()
207 tdata.async = async; in run_test()
208 rv = k_work_schedule(&tdata.test_work, K_MSEC(10)); in run_test()
212 periph_rv = spi_transceive(spis_dev, &spis_config, tdata.stx_set, tdata.srx_set); in run_test()
217 rv = spi_transceive_signal(spis_dev, &spis_config, tdata.stx_set, tdata.srx_set, in run_test()
225 rv = k_sem_take(&tdata.sem, K_NO_WAIT); in run_test()
238 rv = k_sem_take(&tdata.sem, K_MSEC(100)); in run_test()
241 srx_len = peripheral_rx_len(tdata.mtx_set, tdata.srx_set); in run_test()
245 rv = check_buffers(tdata.mtx_set, tdata.srx_set, m_same_size); in run_test()
248 rv = check_buffers(tdata.stx_set, tdata.mrx_set, s_same_size); in run_test()
260 tdata.bufs[i].buf = buf_alloc(len, i < 2); in test_basic()
261 tdata.bufs[i].len = len; in test_basic()
262 tdata.sets[i].buffers = &tdata.bufs[i]; in test_basic()
263 tdata.sets[i].count = 1; in test_basic()
266 tdata.mtx_set = &tdata.sets[0]; in test_basic()
267 tdata.mrx_set = &tdata.sets[1]; in test_basic()
268 tdata.stx_set = &tdata.sets[2]; in test_basic()
269 tdata.srx_set = &tdata.sets[3]; in test_basic()
291 tdata.bufs[0].buf = buf_alloc(len, true); in test_basic_zero_len()
292 tdata.bufs[0].len = len; in test_basic_zero_len()
293 tdata.bufs[1].buf = buf_alloc(len, true); in test_basic_zero_len()
295 tdata.bufs[1].len = 0; in test_basic_zero_len()
296 tdata.sets[0].buffers = &tdata.bufs[0]; in test_basic_zero_len()
297 tdata.sets[0].count = 2; in test_basic_zero_len()
298 tdata.mtx_set = &tdata.sets[0]; in test_basic_zero_len()
300 tdata.bufs[2].buf = buf_alloc(len, true); in test_basic_zero_len()
301 tdata.bufs[2].len = len; in test_basic_zero_len()
302 tdata.bufs[3].buf = buf_alloc(len, true); in test_basic_zero_len()
304 tdata.bufs[3].len = 0; in test_basic_zero_len()
305 tdata.sets[1].buffers = &tdata.bufs[2]; in test_basic_zero_len()
306 tdata.sets[1].count = 2; in test_basic_zero_len()
307 tdata.mrx_set = &tdata.sets[1]; in test_basic_zero_len()
310 tdata.bufs[4].buf = buf_alloc(len, false); in test_basic_zero_len()
311 tdata.bufs[4].len = len; in test_basic_zero_len()
312 tdata.sets[2].buffers = &tdata.bufs[4]; in test_basic_zero_len()
313 tdata.sets[2].count = 1; in test_basic_zero_len()
314 tdata.stx_set = &tdata.sets[2]; in test_basic_zero_len()
316 tdata.bufs[6].buf = buf_alloc(len, false); in test_basic_zero_len()
317 tdata.bufs[6].len = len; in test_basic_zero_len()
318 tdata.sets[3].buffers = &tdata.bufs[6]; in test_basic_zero_len()
319 tdata.sets[3].count = 1; in test_basic_zero_len()
320 tdata.srx_set = &tdata.sets[3]; in test_basic_zero_len()
343 tdata.bufs[0].buf = buf_alloc(len, true); in test_short_rx()
344 tdata.bufs[0].len = len; in test_short_rx()
345 tdata.bufs[1].buf = buf_alloc(len, true); in test_short_rx()
346 tdata.bufs[1].len = len - 3; /* RX buffer */ in test_short_rx()
347 tdata.bufs[2].buf = buf_alloc(len, false); in test_short_rx()
348 tdata.bufs[2].len = len; in test_short_rx()
349 tdata.bufs[3].buf = buf_alloc(len, false); in test_short_rx()
350 tdata.bufs[3].len = len - 4; /* RX buffer */ in test_short_rx()
353 tdata.sets[i].buffers = &tdata.bufs[i]; in test_short_rx()
354 tdata.sets[i].count = 1; in test_short_rx()
357 tdata.mtx_set = &tdata.sets[0]; in test_short_rx()
358 tdata.mrx_set = &tdata.sets[1]; in test_short_rx()
359 tdata.stx_set = &tdata.sets[2]; in test_short_rx()
360 tdata.srx_set = &tdata.sets[3]; in test_short_rx()
381 tdata.bufs[0].buf = buf_alloc(len, true); in test_only_tx()
382 tdata.bufs[0].len = len; in test_only_tx()
383 tdata.sets[0].buffers = &tdata.bufs[0]; in test_only_tx()
384 tdata.sets[0].count = 1; in test_only_tx()
385 tdata.mtx_set = &tdata.sets[0]; in test_only_tx()
386 tdata.mrx_set = NULL; in test_only_tx()
389 tdata.bufs[1].buf = buf_alloc(len, false); in test_only_tx()
390 tdata.bufs[1].len = len; in test_only_tx()
391 tdata.sets[1].buffers = &tdata.bufs[1]; in test_only_tx()
392 tdata.sets[1].count = 1; in test_only_tx()
393 tdata.srx_set = &tdata.sets[1]; in test_only_tx()
394 tdata.stx_set = NULL; in test_only_tx()
416 tdata.bufs[0].buf = buf_alloc(len1 + len2, true); in test_only_tx_in_chunks()
417 tdata.bufs[0].len = len1 + len2; in test_only_tx_in_chunks()
418 tdata.sets[0].buffers = &tdata.bufs[0]; in test_only_tx_in_chunks()
419 tdata.sets[0].count = 1; in test_only_tx_in_chunks()
420 tdata.mtx_set = &tdata.sets[0]; in test_only_tx_in_chunks()
421 tdata.mrx_set = NULL; in test_only_tx_in_chunks()
424 tdata.bufs[1].buf = buf_alloc(len1, false); in test_only_tx_in_chunks()
425 tdata.bufs[1].len = len1; in test_only_tx_in_chunks()
426 tdata.bufs[2].buf = buf_alloc(len2, false); in test_only_tx_in_chunks()
427 tdata.bufs[2].len = len2; in test_only_tx_in_chunks()
428 tdata.sets[1].buffers = &tdata.bufs[1]; in test_only_tx_in_chunks()
429 tdata.sets[1].count = 2; in test_only_tx_in_chunks()
430 tdata.srx_set = &tdata.sets[1]; in test_only_tx_in_chunks()
431 tdata.stx_set = NULL; in test_only_tx_in_chunks()
452 tdata.bufs[0].buf = buf_alloc(len, true); in test_only_rx()
453 tdata.bufs[0].len = len; in test_only_rx()
454 tdata.sets[0].buffers = &tdata.bufs[0]; in test_only_rx()
455 tdata.sets[0].count = 1; in test_only_rx()
456 tdata.mrx_set = &tdata.sets[0]; in test_only_rx()
457 tdata.mtx_set = NULL; in test_only_rx()
460 tdata.bufs[1].buf = buf_alloc(len, false); in test_only_rx()
461 tdata.bufs[1].len = len; in test_only_rx()
462 tdata.sets[1].buffers = &tdata.bufs[1]; in test_only_rx()
463 tdata.sets[1].count = 1; in test_only_rx()
464 tdata.stx_set = &tdata.sets[1]; in test_only_rx()
465 tdata.srx_set = NULL; in test_only_rx()
487 tdata.bufs[0].buf = buf_alloc(len1 + len2, true); in test_only_rx_in_chunks()
488 tdata.bufs[0].len = len1 + len2; in test_only_rx_in_chunks()
489 tdata.sets[0].buffers = &tdata.bufs[0]; in test_only_rx_in_chunks()
490 tdata.sets[0].count = 1; in test_only_rx_in_chunks()
491 tdata.mrx_set = &tdata.sets[0]; in test_only_rx_in_chunks()
492 tdata.mtx_set = NULL; in test_only_rx_in_chunks()
495 tdata.bufs[1].buf = buf_alloc(len1, false); in test_only_rx_in_chunks()
496 tdata.bufs[1].len = len1; in test_only_rx_in_chunks()
497 tdata.bufs[2].buf = buf_alloc(len2, false); in test_only_rx_in_chunks()
498 tdata.bufs[2].len = len2; in test_only_rx_in_chunks()
499 tdata.sets[1].buffers = &tdata.bufs[1]; in test_only_rx_in_chunks()
500 tdata.sets[1].count = 2; in test_only_rx_in_chunks()
501 tdata.stx_set = &tdata.sets[1]; in test_only_rx_in_chunks()
502 tdata.srx_set = NULL; in test_only_rx_in_chunks()
521 memset(&tdata, 0, sizeof(tdata)); in before()
529 k_work_init_delayable(&tdata.test_work, work_handler); in before()
530 k_sem_init(&tdata.sem, 0, 1); in before()
537 k_work_cancel_delayable(&tdata.test_work); in after()