summaryrefslogtreecommitdiff
path: root/cesar/cp/inc/context.h
blob: a8bd13fcd81085496c31fbaded6843bd508f074d (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#ifndef cp_inc_cp_h
#define cp_inc_cp_h
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    cp/inc/cp_private.h
 * \brief   Control plane context.
 * \ingroup cp
 *
 */
#include "lib/rnd.h"

#include "mac/common/config.h"
#include "interface/interface.h"
#include "cl/cl.h"

#include "hal/phy/phy.h"
#include "hal/timer/timer.h"

/* Public interfaces. */
#include "cp/sta/mgr/sta_mgr.h"
#include "cp/sta/core/core.h"
#include "cp/sta/action/action.h"
#include "cp/cco/action/cco_action.h"
#include "cp/cco/region/region.h"
#include "cp/cco/bw/bw.h"
#include "cp/beacon/beacon.h"
#include "cp/conn/conn_mgr.h"
#include "cp/cl_interf/cl_interf.h"
#include "cp/fsm/forward.h"
#include "cp/fsm/fsm.h"
#include "cp/msg/msg.h"
#include "cp/secu/secu.h"
#include "ce/rx/forward.h"
#include "bsu/beacon/beacon.h"
#include "bsu/aclf/aclf.h"
#include "bufmgr/bufmgr.h"

/* Private interfaces. */
#include "cp/inc/trace.h"
#include "cp/sta/mgr/inc/sta_mgr.h"
#include "cp/sta/core/inc/core.h"
#include "cp/sta/action/inc/context.h"
#include "cp/cco/action/inc/cco_action.h"
#include "cp/cco/region/inc/context.h"
#include "cp/cco/bw/inc/context.h"
#include "cp/beacon/inc/beacon.h"
#include "cp/cl_interf/inc/context.h"
#include "cp/msg/inc/context.h"
#include "cp/fsm/inc/context.h"
#include "ce/tx/inc/tx.h"

enum cp_handover_reason_t
{
    CP_HANDOVER_REASON_CCO_SELECTION,
    CP_HANDOVER_REASON_CCO_LEAVING,
    CP_HANDOVER_REASON_USER_APPOINT,
    CP_HANDOVER_REASON_NB,
};

enum cp_handover_soft_hard_t
{
    CP_HANDOVER_SOFT_HARD_SOFT,
    CP_HANDOVER_SOFT_HARD_HARD,
    CP_HANDOVER_NB,
};

struct cp_handover_t
{
    /** Handover timeout. */
    cp_sta_core_timed_event_def_t handover_timeout;

    /** handover reason. */
    enum cp_handover_reason_t reason;

    /** Handover soft hard */
    enum cp_handover_soft_hard_t soft_hard;
};

struct cp_t
{
#if CONFIG_TRACE
    /** Trace context. */
    trace_buffer_t trace;
    /** Verbose trace context. */
    trace_buffer_t trace_verbose;
#endif /* CONFIG_TRACE */

    /** FSM context. */
    cp_fsm_t fsm;

    /** station core context. */
    cp_sta_core_t sta_core;

    /** station manager context. */
    cp_sta_mgr_t sta_mgr;

    /** CCo Action. */
    cp_cco_action_t cco_action;

    /** Sta action. */
    cp_sta_action_t sta_action;

    /** Beacon module. */
    cp_beacon_t beacon;

    /** Region manager context. */
    cp_cco_region_t region;

    /** Bandwidth Manager context. */
    cp_cco_bw_t bw;

    /** Connection manager context. */
    cp_conn_mgr_t conn_mgr;

    /** Cl Interface context. */
    cp_cl_interf_t cl_interf;

    /** MSG context. */
    cp_msg_t msg;

    /** The mac config context. */
    mac_config_t *mac_config;

    /** The interface context. */
    interface_t *interface;

    /** Convergence layer context. */
    cl_t *cl;

    /** Phy context. */
    phy_t *phy;

    /** Hal timer context. */
    hal_timer_t *hal_timer;

    /** Mac Store. */
    mac_store_t *mac_store;

    /** Channel access context. */
    ca_t *ca;

    /** PBProc. */
    pbproc_t *pbproc;

    /** SAR layer. */
    sar_t *sar;

    /** Random generator. */
    lib_rnd_t rnd;

    /** Handover context. */
    struct cp_handover_t handover;

    /** Context of the CE in TX. */
    ce_tx_t ce_tx;

    /** Context of the CE in RX. */
    ce_rx_t *ce_rx;

    /** Context of the bsu. */
    bsu_t *bsu;

    /** Context of the aclf. */
    bsu_aclf_t *bsu_aclf;

    /** Context of the buffer manager. */
    bufmgr_t *bufmgr;
};

#endif /* cp_inc_cp_h */