defs.h 14.9 KB
Newer Older
ghaddab's avatar
ghaddab committed
1
/*******************************************************************************
2
    OpenAirInterface
ghaddab's avatar
ghaddab committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
    Copyright(c) 1999 - 2014 Eurecom

    OpenAirInterface is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.


    OpenAirInterface is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
17
18
    along with OpenAirInterface.The full GNU General Public License is
   included in this distribution in the file called "COPYING". If not,
ghaddab's avatar
ghaddab committed
19
20
21
22
23
   see <http://www.gnu.org/licenses/>.

  Contact Information
  OpenAirInterface Admin: openair_admin@eurecom.fr
  OpenAirInterface Tech : openair_tech@eurecom.fr
24
  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
25

ghaddab's avatar
ghaddab committed
26
  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
ghaddab's avatar
ghaddab committed
27
28

 *******************************************************************************/
29
30
31
32
33
#ifndef __INIT_DEFS__H__
#define __INIT_DEFS__H__

#include "PHY/defs.h"

34

35
36
37
38
39
#include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h"
40
#include "MobilityControlInfo.h"
41
42
#ifdef Rel10
#include "SCellToAddMod-r10.h"
43
#endif
44
45
46
47
48
49
50
51
52
/** @addtogroup _PHY_STRUCTURES_
 * @{
 */

/*!
\fn int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms)
\brief Allocate and Initialize the PHY variables after receiving static configuration
@param frame_parms Pointer to LTE_DL_FRAME_PARMS (common configuration)
@returns 0 on success
gauthier's avatar
gauthier committed
53
 */
54
55
56
57
int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms);


/*!
58
59
60
\brief Allocate and Initialize the PHY variables relevant to the LTE implementation.
\details Only a subset of phy_vars_ue is initialized.
@param[out] phy_vars_ue Pointer to UE Variables
61
62
63
@param nb_connected_eNB Number of eNB that UE can process in one PDSCH demodulation subframe
@param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM
@returns 0 on success
64
65
@returns -1 if any memory allocation failed
@note The current implementation will never return -1, but segfault.
gauthier's avatar
gauthier committed
66
 */
67
int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
gauthier's avatar
gauthier committed
68
69
                    int          nb_connected_eNB,
                    uint8_t         abstraction_flag);
70
71

/*!
72
73
74
\brief Allocate and initialize the PHY variables relevant to the LTE implementation (eNB).
\details Only a subset of phy_vars_eNb is initialized.
@param[out] phy_vars_eNb Pointer to eNB Variables
75
@param is_secondary_eNb Flag to indicate this eNB gets synch from another
76
@param cooperation_flag 0 for no cooperation, 1 for Delay Diversity and 2 for Distributed Alamouti
77
78
@param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM
@returns 0 on success
79
80
@returns -1 if any memory allocation failed
@note The current implementation will never return -1, but segfault.
gauthier's avatar
gauthier committed
81
 */
82
int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNb,
gauthier's avatar
gauthier committed
83
84
85
                     unsigned char is_secondary_eNb,
                     unsigned char cooperation_flag,
                     unsigned char abstraction_flag);
86

87
88
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB decoding + primary/secondary synch).
\details The basically allows configuration of \f$N_{\mathrm{RB}}^{\mathrm{DL}}\f$, the cell id  \f$N_{\mathrm{ID}}^{\mathrm{cell}}\f$, the normal/extended prefix mode, the frame type (FDD/TDD), \f$N_{\mathrm{cp}}\f$, the number of TX antennas at eNB (\f$p\f$) and the number of PHICH groups, \f$N_{\mathrm{group}}^{\mathrm{PHICH}}\f$
89
90
91
92
93
94
95
@param lte_frame_parms pointer to LTE parameter structure
@param N_RB_DL Number of DL resource blocks
@param Nid_cell Cell ID
@param Ncp Normal/Extended Prefix flag
@param frame_type FDD/TDD framing
@param p_eNB Number of eNB TX antennas
@param phich_config Pointer to PHICH_CONFIG_COMMON
gauthier's avatar
gauthier committed
96
 */
97
void phy_config_mib(LTE_DL_FRAME_PARMS *lte_frame_parms,
gauthier's avatar
gauthier committed
98
99
100
101
102
103
                    uint8_t                N_RB_DL,
                    uint8_t                Nid_cell,
                    uint8_t                Ncp,
                    uint8_t                frame_type,
                    uint8_t                p_eNB,
                    PHICH_CONFIG_COMMON *phich_config);
104
105


106
107
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1.
\details From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
108
@param Mod_id Instance ID of eNB
knopp's avatar
   
knopp committed
109
@param CC_id Component Carrier index
110
@param tdd_Config TDD UL/DL and S-subframe configurations
111
@param SIwindowsize Size of a SI window in frames where repetitions of a unique System Information message block is repeated
112
@param SIperiod Periodicity of System Information Messages (in multiples of a frame)*/
gauthier's avatar
gauthier committed
113
void phy_config_sib1_eNB(module_id_t    Mod_id,
knopp's avatar
   
knopp committed
114
                         int CC_id,
115
                         TDD_Config_t  *tdd_Config,
gauthier's avatar
gauthier committed
116
117
                         uint8_t           SIwindowsize,
                         uint16_t            SIperiod);
118

119
120
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1.
\details From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
121
@param Mod_id Instance ID of UE
knopp's avatar
   
knopp committed
122
@param CC_id Component Carrier index
123
124
@param CH_index Index of eNB for this configuration
@param tdd_Config TDD UL/DL and S-subframe configurations
125
@param SIwindowsize Size of a SI window in frames where repetitions of a unique System Information message block is repeated
126
@param SIperiod Periodicity of System Information Messages (in multiples of a frame)*/
gauthier's avatar
gauthier committed
127
void phy_config_sib1_ue(module_id_t   Mod_id,
knopp's avatar
   
knopp committed
128
                        int CC_id,
129
                        uint8_t          CH_index,
gauthier's avatar
gauthier committed
130
131
132
                        TDD_Config_t *tdd_Config,
                        uint8_t          SIwindowsize,
                        uint16_t           SIperiod);
133
134
135


/*!
knopp's avatar
   
knopp committed
136
  \fn void phy_config_sib2_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
137
138
139
140
141
142
      RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
      ARFCN_ValueEUTRA_t *ul_CArrierFreq,
            long *ul_Bandwidth,
      AdditionalSpectrumEmission_t additionalSpectrumEmission,
      struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
  \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB2 (at UE).
143
  @param Mod_id Instance id
knopp's avatar
   
knopp committed
144
  @param CC_id
145
  @param CH_index Index of CH to which UE is connected
knopp's avatar
   
knopp committed
146
  @param CC_id Component Carrier Index
147
148
149
150
151
  @param radioResourceConfigCommon Radio Configuration from SIB2
  @param ul_CarrierFreq UL carrier ARFCN, null if optional (i.e. implicit from DL)
  @param ul_Bandwidth UL bandwidth, null if optional (i.e. same as DL)
  @param additionalSpectrumEmission UL parameter (see 36.101)
  @param mbsfn_SubframeConfigList MBSFN subframe configuration
gauthier's avatar
gauthier committed
152
 */
knopp's avatar
   
knopp committed
153
154
void phy_config_sib2_ue(module_id_t                     Mod_id,
                        int                         CC_id,
155
                        uint8_t                         CH_index,
gauthier's avatar
gauthier committed
156
157
158
159
160
                        RadioResourceConfigCommonSIB_t  *radioResourceConfigCommon,
                        ARFCN_ValueEUTRA_t              *ul_CArrierFreq,
                        long                            *ul_Bandwidth,
                        AdditionalSpectrumEmission_t    *additionalSpectrumEmission,
                        struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
161

162

163
/*!
164
165
  \fn phy_config_afterHO_ue
  \brief Configure Common PHY parameters from mobilityControlInfo
166
  @param Mod_id
knopp's avatar
   
knopp committed
167
  @param CC_id
168
169
170
171
  @param eNB_index
  @param mobilityControlInfo pointer to the mobility control information for handover
  @param ho_failed flag to indicated whether the ho was successful or not
 */
gauthier's avatar
gauthier committed
172
void phy_config_afterHO_ue(module_id_t Mod_id,
173
                           uint8_t CC_id,
174
                           uint8_t eNB_index,
gauthier's avatar
gauthier committed
175
176
                           MobilityControlInfo_t *mobilityControlInfo,
                           uint8_t ho_failed);
177
/*!
gauthier's avatar
gauthier committed
178
  \fn void phy_config_sib2_eNB(module_id_t Mod_id,
179
                               RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
180
181
182
183
184
             ARFCN_ValueEUTRA_t *ul_CArrierFreq,
             long *ul_Bandwidth,
             AdditionalSpectrumEmission_t additionalSpectrumEmission,
             struct MBSFN_SubframeConfigList  *mbsfn_SubframeConfigList)
  \brief Configure LTE_DL_FRAME_PARMS with components of SIB2 (at eNB).
185
  @param Mod_id Instance id
knopp's avatar
   
knopp committed
186
  @param Mod_id Component Carrier index
187
188
189
190
191
  @param radioResourceConfigCommon Radio Configuration from SIB2
  @param ul_CarrierFreq UL carrier ARFCN, null if optional (i.e. implicit from DL)
  @param ul_Bandwidth UL bandwidth, null if optional (i.e. same as DL)
  @param additionalSpectrumEmission UL parameter (see 36.101)
  @param mbsfn_SubframeConfigList MBSFN subframe configuration
gauthier's avatar
gauthier committed
192
 */
knopp's avatar
   
knopp committed
193
194
void phy_config_sib2_eNB(module_id_t                            Mod_id,
                         int                                CC_id,
195
                         RadioResourceConfigCommonSIB_t         *radioResourceConfigCommon,
gauthier's avatar
gauthier committed
196
197
198
199
                         ARFCN_ValueEUTRA_t                     *ul_CArrierFreq,
                         long                                   *ul_Bandwidth,
                         AdditionalSpectrumEmission_t           *additionalSpectrumEmission,
                         struct MBSFN_SubframeConfigList        *mbsfn_SubframeConfigList);
200
201
202


/*!
knopp's avatar
   
knopp committed
203
\fn void phy_config_dedicated_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
204
               struct PhysicalConfigDedicated *physicalConfigDedicated)
205
206
\brief Configure UE dedicated parameters.
\details Invoked upon reception of RRCConnectionSetup or RRCConnectionReconfiguration from eNB.
207
@param Mod_id Instance ID for eNB
knopp's avatar
   
knopp committed
208
@param CC_id Component Carrier index
209
210
211
@param CH_index Index of eNB for this configuration
@param physicalConfigDedicated PHY Configuration information

gauthier's avatar
gauthier committed
212
 */
knopp's avatar
   
knopp committed
213
214
void phy_config_dedicated_ue(module_id_t Mod_id,
                             int CC_id,
215
                             uint8_t CH_index,
knopp's avatar
   
knopp committed
216
217
                             struct PhysicalConfigDedicated *physicalConfigDedicated);

218
219

/**
220
221
\brief Configure UE MBSFN common parameters.
\details Invoked upon reception of SIB13 from eNB.
222
@param Mod_id Instance ID for UE
knopp's avatar
   
knopp committed
223
@param CC_id Component Carrier Index
224
225
226
@param CH_index eNB id (for multiple eNB reception)
@param mbsfn_Area_idx Index of MBSFN-Area for which this command operates
@param mbsfn_AreaId_r9 MBSFN-Area Id
gauthier's avatar
gauthier committed
227
 */
228

gauthier's avatar
gauthier committed
229
void phy_config_sib13_ue(module_id_t Mod_id,
knopp's avatar
   
knopp committed
230
                         int CC_id,uint8_t CH_index,int mbsfn_Area_idx,
gauthier's avatar
gauthier committed
231
                         long mbsfn_AreaId_r9);
232
233

/**
234
235
\brief Configure eNB MBSFN common parameters.
\details Invoked upon transmission of SIB13 from eNB.
236
@param Mod_id Instance ID for eNB
knopp's avatar
   
knopp committed
237
@param CC_id Component Carrier index
238
239
@param mbsfn_Area_idx Index of MBSFN-Area for which this command operates
@param mbsfn_AreaId_r9 MBSFN-Area Id
gauthier's avatar
gauthier committed
240
241
 */
void phy_config_sib13_eNB(module_id_t Mod_id,
242
                          int CC_id,
gauthier's avatar
gauthier committed
243
244
                          int mbsfn_Area_idx,
                          long mbsfn_AreaId_r9);
245
246
247
248

/**
\brief Configure cba rnti for .
@param Mod_id Instance ID for eNB
knopp's avatar
   
knopp committed
249
@param CC_id Component Carrier Index
250
@param eNB_flag flag indicating whether the nodeis eNB (1) or UE (0)
251
@param index index of the node
252
253
@param cba_rnti rnti for the cba transmission
@param num_active_cba_groups num active cba group
gauthier's avatar
gauthier committed
254
 */
knopp's avatar
   
knopp committed
255
void  phy_config_cba_rnti (module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, rnti_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
256
257
258

/** \brief Configure RRC inter-cell measurements procedures
@param Mod_id Index of UE
knopp's avatar
   
knopp committed
259
@param CC_id
260
261
262
@param eNB_index Index of corresponding eNB
@param n_adj_cells Number of adjacent cells on which to perform the measuremnts
@param adj_cell_id Array of cell ids of adjacent cells
gauthier's avatar
gauthier committed
263
264
 */
void phy_config_meas_ue(module_id_t Mod_id,
265
                        uint8_t CC_id,
266
                        uint8_t eNB_index,
gauthier's avatar
gauthier committed
267
268
                        uint8_t n_adj_cells,
                        uint32_t *adj_cell_id);
269
270

/*!
gauthier's avatar
gauthier committed
271
\fn void phy_config_dedicated_eNB(module_id_t Mod_id,uint16_t rnti,
272
                                  struct PhysicalConfigDedicated *physicalConfigDedicated)
273
274
\brief Prepare for configuration of PHY with dedicated parameters.
\details Invoked just prior to transmission of RRCConnectionSetup or RRCConnectionReconfiguration at eNB.
275
@param Mod_id Instance ID for eNB
knopp's avatar
   
knopp committed
276
@param CC_id Component Carrier index
277
278
@param rnti rnti for UE context
@param physicalConfigDedicated PHY Configuration information
gauthier's avatar
gauthier committed
279
280
 */
void phy_config_dedicated_eNB(module_id_t Mod_id,
knopp's avatar
   
knopp committed
281
                              int CC_id,
282
                              rnti_t rnti,
gauthier's avatar
gauthier committed
283
                              struct PhysicalConfigDedicated *physicalConfigDedicated);
284
285
286
287
288

/*!
\fn void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *phy_vars_eNB)
\brief Configure PHY with dedicated parameters between configuration of DLSCH (n) and ULSCH (n+4) in current subframe (n).
@param phy_vars_eNB Pointer to PHY_VARS_eNB structure
gauthier's avatar
gauthier committed
289
 */
290
291
292
293
void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *phy_vars_eNB);

/*
  \fn int phy_init_secsys_eNB(PHY_VARS_eNB *phy_vars_eNb)
294
\brief Allocate and Initialize the PHY variables relevant to the LTE implementation.
295
@param phy_vars_eNb pointer to LTE parameter structure for the eNb
gauthier's avatar
gauthier committed
296
 */
297
298
299
300
301
302
303
int phy_init_secsys_eNB(PHY_VARS_eNB *phy_vars_eNb);


void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms);

//void copy_lte_parms_to_phy_framing(LTE_DL_FRAME_PARMS *frame_parm, PHY_FRAMING *phy_framing);

304
305
306
307
308
309
310
311
312
313
314
315
void lte_param_init(unsigned char N_tx, 
		    unsigned char N_rx,
		    unsigned char transmission_mode,
		    uint8_t extended_prefix_flag,
		    frame_t frame_type, 
		    uint16_t Nid_cell,
		    uint8_t tdd_config,
		    uint8_t N_RB_DL,
		    uint8_t threequarter_fs,
                    uint8_t osf,
		    uint32_t perfect_ce);

316
317
#ifdef Rel10
void phy_config_dedicated_scell_ue(uint8_t Mod_id,
318
319
320
                                   uint8_t eNB_index,
                                   SCellToAddMod_r10_t *sCellToAddMod_r10,
                                   int CC_id);
321
322

void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
323
324
325
                                    uint16_t rnti,
                                    SCellToAddMod_r10_t *sCellToAddMod_r10,
                                    int CC_id);
326

327
#endif
328

329
330
331


/*! !\fn void phy_cleanup(void)
332
\brief Cleanup the PHY variables*/
333
334
void phy_cleanup(void);

335

gauthier's avatar
gauthier committed
336
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
337
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
338
339
340
341
342
343
344
345
346
347
348
349

void lte_param_init(unsigned char N_tx, 
		    unsigned char N_rx,
		    unsigned char transmission_mode,
		    uint8_t extended_prefix_flag,
		    frame_t frame_type, 
		    uint16_t Nid_cell,
		    uint8_t tdd_config,
		    uint8_t N_RB_DL,
		    uint8_t threequarter_fs,
                    uint8_t osf,
		    uint32_t perfect_ce);
350
351
352
353

/** @} */
#endif