summaryrefslogtreecommitdiff
path: root/cesar/mac/sar/test/functional/test_functions.h
blob: 0fbfa36b10a3997f87e0fe968789b620e13fa3cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef mac_sar_test_functional_test_functions_h
#define mac_sar_test_functional_test_functions_h
/* Cesar project {{{
 *
 * Copyright (C) 2009 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    mac/sar/test/functional/test_functions.h
 * \brief   Common functions for tests.
 * \ingroup mac_sar
 */
#include "mac/sar/sar.h"
#include "hal/phy/soft/bridgedma/inc/bridgedma.h"

struct sar_test_ctx_t
{
    sar_t *sar;
    mac_store_t *mac_store;
    mac_config_t mac_config;
};
typedef struct sar_test_ctx_t sar_test_ctx_t;

BEGIN_DECLS

void
ce_measurements (void *data, pbproc_rx_params_t *rx_params,
                 uint total_pb_count, pb_t *chan_data,
                 uint chan_data_count, u8 false_pb_count, u32 ber_sum);

/**
 * Initialise the test context.
 * \param  ctx  the sar test context.
 */
void
sar_test_init (sar_test_ctx_t *test_ctx);

/**
 * Uninitialise the sar test context.
 * \param  ctx  the sar test context.
 */
void
sar_test_uninit (sar_test_ctx_t *test_ctx);

/**
 * Get the number of frames reassemblied.
 * \return  the number of correctly reassemblied Ethernet frames.
 */
uint
sar_test_nb_ethernet_frames_received (void);

/**
 * Create N frames_nb Ethernet packet of frames_len bytes long embedded in a
 * MUPDU.
 * \param  frames_nb  number of expected reassembly frames.
 * \param  frames_len  the length of the frames.
 */
void
sar_test_rx_multiple_frames (uint frames_nb, uint frames_len);

/**
 * Create N MSDU to send,
 * \param  frames_nb  number of expected reassembly frames.
 * \param  frames_len  the length of the frames.
 */
void
sar_test_tx_multiple_frames (uint frames_nb, uint frames_len);

/**
 * Create N MSDU and MPDU to simulate a TX and RX.
 * \param  frames_nb  number of expected reassembly frames.
 * \param  frames_len  the length of the frames.
 */
void
sar_test_tx_rx_multiple_frames (uint frames_nb, uint frames_len);

/**
 * Create N MPDU and MSDU to simulate a RX and TX.
 * \param  frames_nb  number of expected reassembly frames.
 * \param  frames_len  the length of the frames.
 */
void
sar_test_rx_tx_multiple_frames (uint frames_nb, uint frames_len);

END_DECLS

#endif /* mac_sar_test_functional_test_functions_h */