summaryrefslogtreecommitdiff
path: root/cesar/cp2/cl_interf/cl_interf.h
blob: 9114dc85cefba432edfe56dbdd3b6cf2842b6e15 (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
#ifndef cp2_cl_interf_cl_interf_h
#define cp2_cl_interf_cl_interf_h
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp2/cl_interf/cl_interf.h
 * \brief   CP2 cl interface. 
 * \ingroup cp2_cl_interf 
 *
 */

/** Forward declaration. */
typedef struct cp_cl_interf_t cp_cl_interf_t;

/**
 * Initialise the module.
 * \param  ctx  the module context.
 *
 */
void
cp_cl_interf_init (cp_t *ctx);

/**
 * Process the MME received.
 * \param  ctx  the module context.
 *
 * It shall use the MSG function to read the header and get a mme_rx_t
 * context.  
 *   - If the MME is complete, it process it and store the data need in
 *     the mme_rx_t context and call the MSG dispatch function.
 *   - if the MMe is fragmented, it shall  verify if the segment has not
 *     already been process.
 *       * if it was process, it shall drop it.
 *       * If not, process it
 */
void
cp_cl_interf_process_mme (cp_t *ctx);

/**
 * Get the available buffer.
 * \param  ctx  the module context.
 * \return MME TX buffer. 
 *
 *  Return null if no buffers are available
 */
cp_mme_tx_t *
cp_cl_interf_get_tx_buffer (cp_t *ctx);

/**
 * Send a MME over the PWL or the HLE.
 * \param  ctx  the module context.
 * \param  mme  The MME to send.
 *
 */
void
cp_cl_interf_mme_send (cp_t *ctx, cp_mme_tx_t * mme);

/**
 * Add a buffer to the circular list.
 * \param  ctx  the module context.
 * \param  buffer  The buffer received.
 *
 */
void
cp_cl_interf_add_buffer_tx (cp_t *ctx, u8 * buffer);

/**
 * Remove all oldest MME received.
 * \param  ctx  the module context.
 *
 */
void
cp_cl_interf_garbage_collector (cp_t *ctx);

/**
 * Uninitialise the module.
 * \param  ctx  the module context.
 *
 */
void
cp_cl_interf_uninit (cp_t *ctx);

#endif /* cp2_cl_interf_cl_interf_h */