summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/cp/mme.h
blob: bf244679b3e94eea0be4ad85725eb2078025ec8e (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
#ifndef ce_rx_cp_mme_h
#define ce_rx_cp_mme_h
/* Cesar project {{{
 *
 * Copyright (C) 2009 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    ce/rx/cp/mme.h
 * \brief   Generation of MME for the CE in RX.
 * \ingroup ce_rx_cp
 *
 * MME should be sent in two cases:
 *  - sending a tone map. This function compute the best (less bits to use)
 *  MME to send with a tone map.
 *  - refreshing tone map active list (to prevent expirations with the
 *  corresponding peer.
 *
 * This module is "private" because the CP should only use the function
 * provided in the ce/rx/cp.h header file.
 * \warning this function must be executed in the context of the CP.
 */

#include "cp/cp.h"
#include "cp/sta/mgr/sta.h"
#include "mac/common/tonemap.h"

BEGIN_DECLS

/**
 * Send a tone map using a MME.
 * \param  ctx  Control Plane context.
 * \param  sta  the destination of the MME.
 * \param  tmi_list  the list of valid TMI (not the one contained in the tone
 * maps structure).
 * \param  default_tmi  the default TMI.
 * \param  int_list  the list of intervals (not the one contained in the tone
 * maps structure).
 * \param  new_tmi  the new TMI of the tone map (or 0 if no tone map
 * associated).
 * \param  old_tmi  the old TMI of the tone map (for example, if the tone map
 * is derived from another one).
 * \param  tms  the tone maps structure (in RX).
 * \param  initial_ce  initial channel estimation procedure?
 *
 * This function compute the MME that use the less bits and use this one to
 * send the MME.
 */
void
ce_rx_cp_mme_send_tone_map (cp_t *ctx, cp_sta_t *sta, u32 tmi_list,
                            u8 default_tmi, tonemap_intervals_t *int_list,
                            u8 new_tmi, u8 old_tmi, tonemaps_t *tms,
                            bool initial_ce);

/**
 * Send MME to prevent tone map expiration.
 * \param  ctx  the Control Plane context.
 * \param  sta  the destination of the MME.
 * \param  tmi_list  the list of valid TMI (not the one contained in the tone
 * maps structure).
 * \param  default_tmi  the default TMI.
 * \param  int_list  the list of intervals (not the one contained in the tone
 * maps structure).
 * \param  tms  the tone maps structure (in RX).
 */
void
ce_rx_mme_refresh_tone_map_list (cp_t *ctx, cp_sta_t *sta, u32 tmi_list, u8
                                 default_tmi, tonemap_intervals_t *int_list,
                                 tonemaps_t *tms);

/**
 * Send a CM_TM_UPDATE.IND to restart initial CE.
 * \param  ctx  the Control Plane context.
 * \param  sta  the destination of the MME.
 * \param  tms  the tone maps structure (in RX).
 */
void
ce_rx_mme_restart_initial_ce (cp_t *ctx, cp_sta_t *sta, tonemaps_t *tms);

END_DECLS

#endif /* ce_rx_cp_mme_h */