Lines Matching refs:packet
61 struct test_data_var *packet = (struct test_data_var *)item; in drop() local
64 zassert_equal(packet->hdr.len, exp_dropped_len[drop_cnt], in drop()
66 drop_cnt, packet->hdr.len, exp_dropped_len[drop_cnt]); in drop()
67 zassert_equal(packet->hdr.data, exp_dropped_data[drop_cnt], in drop()
69 drop_cnt, packet->hdr.data, exp_dropped_data[drop_cnt]); in drop()
71 int err = memcmp(packet->data, &exp_dropped_data[drop_cnt], in drop()
524 struct test_data_var *packet; in item_alloc_commit() local
529 packet = (struct test_data_var *)mpsc_pbuf_alloc(&buffer, len, in item_alloc_commit()
531 packet->hdr.len = len; in item_alloc_commit()
533 packet->data[j] = i + j; in item_alloc_commit()
536 mpsc_pbuf_commit(&buffer, (union mpsc_pbuf_generic *)packet); in item_alloc_commit()
538 packet = (struct test_data_var *)mpsc_pbuf_claim(&buffer); in item_alloc_commit()
539 zassert_true(packet); in item_alloc_commit()
540 zassert_equal(packet->hdr.len, len); in item_alloc_commit()
543 zassert_equal(packet->data[j], i + j); in item_alloc_commit()
546 mpsc_pbuf_free(&buffer, (union mpsc_pbuf_generic *)packet); in item_alloc_commit()
559 struct test_data_var *packet; in item_max_alloc() local
565 packet = (struct test_data_var *)mpsc_pbuf_alloc(&buffer, in item_max_alloc()
568 zassert_true(packet != NULL); in item_max_alloc()
569 packet->hdr.len = buffer.size; in item_max_alloc()
570 mpsc_pbuf_commit(&buffer, (union mpsc_pbuf_generic *)packet); in item_max_alloc()
572 packet = (struct test_data_var *)mpsc_pbuf_claim(&buffer); in item_max_alloc()
573 mpsc_pbuf_free(&buffer, (union mpsc_pbuf_generic *)packet); in item_max_alloc()
577 packet = (struct test_data_var *)mpsc_pbuf_alloc(&buffer, in item_max_alloc()
580 zassert_true(packet == NULL); in item_max_alloc()
592 struct test_data_var *packet; in saturate_buffer_uneven() local
600 packet = (struct test_data_var *)mpsc_pbuf_alloc(buffer, len, in saturate_buffer_uneven()
602 packet->hdr.len = len; in saturate_buffer_uneven()
603 mpsc_pbuf_commit(buffer, (union mpsc_pbuf_generic *)packet); in saturate_buffer_uneven()
605 packet = (struct test_data_var *)mpsc_pbuf_claim(buffer); in saturate_buffer_uneven()
606 zassert_true(packet); in saturate_buffer_uneven()
607 mpsc_pbuf_free(buffer, (union mpsc_pbuf_generic *)packet); in saturate_buffer_uneven()
611 packet = (struct test_data_var *)mpsc_pbuf_alloc(buffer, len, in saturate_buffer_uneven()
613 zassert_true(packet); in saturate_buffer_uneven()
614 packet->hdr.len = len; in saturate_buffer_uneven()
615 packet->hdr.data = i; in saturate_buffer_uneven()
617 packet->data[j] = i + j; in saturate_buffer_uneven()
620 mpsc_pbuf_commit(buffer, (union mpsc_pbuf_generic *)packet); in saturate_buffer_uneven()
635 struct test_data_var *packet; in item_alloc_commit_saturate() local
638 packet = (struct test_data_var *)mpsc_pbuf_alloc(&buffer, len, in item_alloc_commit_saturate()
640 zassert_is_null(packet); in item_alloc_commit_saturate()
643 packet = (struct test_data_var *)mpsc_pbuf_claim(&buffer); in item_alloc_commit_saturate()
644 zassert_true(packet); in item_alloc_commit_saturate()
645 mpsc_pbuf_free(&buffer, (union mpsc_pbuf_generic *)packet); in item_alloc_commit_saturate()
648 packet = (struct test_data_var *)mpsc_pbuf_alloc(&buffer, len, in item_alloc_commit_saturate()
650 zassert_true(packet); in item_alloc_commit_saturate()
898 static void validate_packet(struct test_data_var *packet) in validate_packet() argument
900 zassert_equal((uintptr_t)packet->hdr.data, current_rd_idx, in validate_packet()
902 (uintptr_t)packet->hdr.data, current_rd_idx); in validate_packet()
1280 struct test_data_var *packet; in ZTEST() local
1285 packet = (struct test_data_var *)mpsc_pbuf_alloc(&buffer, len, K_NO_WAIT); in ZTEST()
1286 packet->hdr.len = len; in ZTEST()
1288 mpsc_pbuf_commit(&buffer, (union mpsc_pbuf_generic *)packet); in ZTEST()
1292 packet = (struct test_data_var *)mpsc_pbuf_alloc(&buffer, len, K_NO_WAIT); in ZTEST()
1294 zassert_true(packet == NULL); in ZTEST()