defs.h 12.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
#ifndef __INIT_DEFS__H__
#define __INIT_DEFS__H__

#include "PHY/defs.h"

#ifdef OPENAIR_LTE
#include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h"
12
#include "MobilityControlInfo.h"
13
14
15
#ifdef Rel10
#include "SCellToAddMod-r10.h"
#endif 
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#else

/**
\fn int phy_init(unsigned char nb_antennas_tx)
\brief Allocate and Initialize the PHY variables after receiving static configuration
@param nb_antennas_tx Number of TX antennas
*/
int phy_init(unsigned char nb_antennas_tx);
#endif

#ifdef OPENAIR_LTE

/** @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
37
 */
38
39
40
41
42
43
44
45
46
int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms);


/*!
\brief Allocate and Initialize the PHY variables relevant to the LTE implementation
@param phy_vars_ue Pointer to UE Variables
@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
gauthier's avatar
gauthier committed
47
 */
48
int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
gauthier's avatar
gauthier committed
49
50
                    int          nb_connected_eNB,
                    uint8_t         abstraction_flag);
51
52
53
54
55
56
57
58

/*!
\brief Allocate and Initialize the PHY variables relevant to the LTE implementation (eNB)
@param phy_vars_eNb Pointer to eNB Variables
@param is_secondary_eNb Flag to indicate this eNB gets synch from another
@param cooperation_flag
@param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM
@returns 0 on success
gauthier's avatar
gauthier committed
59
 */
60
int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNb,
gauthier's avatar
gauthier committed
61
62
63
                     unsigned char is_secondary_eNb,
                     unsigned char cooperation_flag,
                     unsigned char abstraction_flag);
64
65
66
67
68
69
70
71
72

/** \brief Configure LTE_DL_FRAME_PARMS with components derived after initial synchronization (MIB decoding + primary/secondary synch).  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$ 
@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
73
 */
74
void phy_config_mib(LTE_DL_FRAME_PARMS *lte_frame_parms,
gauthier's avatar
gauthier committed
75
76
77
78
79
80
                    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);
81
82
83
84


/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1.  From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
@param Mod_id Instance ID of eNB
knopp's avatar
   
knopp committed
85
@param CC_id Component Carrier index
86
87
88
@param tdd_Config TDD UL/DL and S-subframe configurations
@param SIwindowsize Size of a SI window in frames where repetitions of a unique System Information message block is repeated 
@param SIperiod Periodicity of System Information Messages (in multiples of a frame)*/
gauthier's avatar
gauthier committed
89
void phy_config_sib1_eNB(module_id_t    Mod_id,
knopp's avatar
   
knopp committed
90
91
                         int CC_id,
			 TDD_Config_t  *tdd_Config,
gauthier's avatar
gauthier committed
92
93
                         uint8_t           SIwindowsize,
                         uint16_t            SIperiod);
94
95
96

/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1.  From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
@param Mod_id Instance ID of UE
knopp's avatar
   
knopp committed
97
@param CC_id Component Carrier index
98
99
100
101
@param CH_index Index of eNB for this configuration
@param tdd_Config TDD UL/DL and S-subframe configurations
@param SIwindowsize Size of a SI window in frames where repetitions of a unique System Information message block is repeated 
@param SIperiod Periodicity of System Information Messages (in multiples of a frame)*/
gauthier's avatar
gauthier committed
102
void phy_config_sib1_ue(module_id_t   Mod_id,
knopp's avatar
   
knopp committed
103
104
                        int CC_id,
			uint8_t          CH_index,
gauthier's avatar
gauthier committed
105
106
107
                        TDD_Config_t *tdd_Config,
                        uint8_t          SIwindowsize,
                        uint16_t           SIperiod);
108
109
110


/*!
knopp's avatar
   
knopp committed
111
  \fn void phy_config_sib2_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
112
113
114
115
116
117
118
			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).  
  @param Mod_id Instance id
knopp's avatar
   
knopp committed
119
  @param CC_id
120
  @param CH_index Index of CH to which UE is connected
knopp's avatar
   
knopp committed
121
  @param CC_id Component Carrier Index
122
123
124
125
126
  @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
127
 */
knopp's avatar
   
knopp committed
128
129
130
void phy_config_sib2_ue(module_id_t                     Mod_id,
                        int                         CC_id,
			uint8_t                         CH_index,
gauthier's avatar
gauthier committed
131
132
133
134
135
                        RadioResourceConfigCommonSIB_t  *radioResourceConfigCommon,
                        ARFCN_ValueEUTRA_t              *ul_CArrierFreq,
                        long                            *ul_Bandwidth,
                        AdditionalSpectrumEmission_t    *additionalSpectrumEmission,
                        struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList);
136

137
138
139
140
141

/*! 
  \fn phy_config_afterHO_ue
  \brief Configure Common PHY parameters from mobilityControlInfo
  @param Mod_id 
knopp's avatar
   
knopp committed
142
  @param CC_id
143
144
145
146
  @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
147
void phy_config_afterHO_ue(module_id_t Mod_id,
knopp's avatar
   
knopp committed
148
149
                           int CC_id,
			   uint8_t eNB_index,
gauthier's avatar
gauthier committed
150
151
                           MobilityControlInfo_t *mobilityControlInfo,
                           uint8_t ho_failed);
152
/*!
gauthier's avatar
gauthier committed
153
  \fn void phy_config_sib2_eNB(module_id_t Mod_id,
154
155
156
157
158
159
160
                               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 of SIB2 (at eNB).  
  @param Mod_id Instance id
knopp's avatar
   
knopp committed
161
  @param Mod_id Component Carrier index
162
163
164
165
166
  @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
167
 */
knopp's avatar
   
knopp committed
168
169
170
void phy_config_sib2_eNB(module_id_t                            Mod_id,
                         int                                CC_id,
			 RadioResourceConfigCommonSIB_t         *radioResourceConfigCommon,
gauthier's avatar
gauthier committed
171
172
173
174
                         ARFCN_ValueEUTRA_t                     *ul_CArrierFreq,
                         long                                   *ul_Bandwidth,
                         AdditionalSpectrumEmission_t           *additionalSpectrumEmission,
                         struct MBSFN_SubframeConfigList        *mbsfn_SubframeConfigList);
175
176
177


/*!
knopp's avatar
   
knopp committed
178
\fn void phy_config_dedicated_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
179
180
181
 			         struct PhysicalConfigDedicated *physicalConfigDedicated)
\brief Configure UE dedicated parameters. Invoked upon reception of RRCConnectionSetup or RRCConnectionReconfiguration from eNB.
@param Mod_id Instance ID for eNB
knopp's avatar
   
knopp committed
182
@param CC_id Component Carrier index
183
184
185
@param CH_index Index of eNB for this configuration
@param physicalConfigDedicated PHY Configuration information

gauthier's avatar
gauthier committed
186
 */
knopp's avatar
   
knopp committed
187
188
189
190
191
void phy_config_dedicated_ue(module_id_t Mod_id,
                             int CC_id,
			     uint8_t CH_index,
                             struct PhysicalConfigDedicated *physicalConfigDedicated);

192
193
194
195

/**
\brief Configure UE MBSFN common parameters. Invoked upon reception of SIB13 from eNB.
@param Mod_id Instance ID for UE
knopp's avatar
   
knopp committed
196
@param CC_id Component Carrier Index
197
198
199
@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
200
 */
201

gauthier's avatar
gauthier committed
202
void phy_config_sib13_ue(module_id_t Mod_id,
knopp's avatar
   
knopp committed
203
                         int CC_id,uint8_t CH_index,int mbsfn_Area_idx,
gauthier's avatar
gauthier committed
204
                         long mbsfn_AreaId_r9);
205
206
207
208

/**
\brief Configure eNB MBSFN common parameters. Invoked upon transmission of SIB13 from eNB.
@param Mod_id Instance ID for eNB
knopp's avatar
   
knopp committed
209
@param CC_id Component Carrier index
210
211
@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
212
213
 */
void phy_config_sib13_eNB(module_id_t Mod_id,
knopp's avatar
   
knopp committed
214
			  int CC_id,
gauthier's avatar
gauthier committed
215
216
                          int mbsfn_Area_idx,
                          long mbsfn_AreaId_r9);
217
218
219
220

/**
\brief Configure cba rnti for .
@param Mod_id Instance ID for eNB
knopp's avatar
   
knopp committed
221
@param CC_id Component Carrier Index
222
223
224
225
@param eNB_flag flag indicating whether the nodeis eNB (1) or UE (0)
@param index index of the node 
@param cba_rnti rnti for the cba transmission
@param num_active_cba_groups num active cba group
gauthier's avatar
gauthier committed
226
 */
knopp's avatar
   
knopp committed
227
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);
228
229
230

/** \brief Configure RRC inter-cell measurements procedures
@param Mod_id Index of UE
knopp's avatar
   
knopp committed
231
@param CC_id
232
233
234
@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
235
236
 */
void phy_config_meas_ue(module_id_t Mod_id,
knopp's avatar
   
knopp committed
237
238
                        int CC_id,
			uint8_t eNB_index,
gauthier's avatar
gauthier committed
239
240
                        uint8_t n_adj_cells,
                        uint32_t *adj_cell_id);
241
242

/*!
gauthier's avatar
gauthier committed
243
\fn void phy_config_dedicated_eNB(module_id_t Mod_id,uint16_t rnti,
244
245
246
                                  struct PhysicalConfigDedicated *physicalConfigDedicated)
\brief Prepare for configuration of PHY with dedicated parameters. Invoked just prior to transmission of RRCConnectionSetup or RRCConnectionReconfiguration at eNB.
@param Mod_id Instance ID for eNB
knopp's avatar
   
knopp committed
247
@param CC_id Component Carrier index
248
249
@param rnti rnti for UE context
@param physicalConfigDedicated PHY Configuration information
gauthier's avatar
gauthier committed
250
251
 */
void phy_config_dedicated_eNB(module_id_t Mod_id,
knopp's avatar
   
knopp committed
252
253
                              int CC_id,
			      rnti_t rnti,
gauthier's avatar
gauthier committed
254
                              struct PhysicalConfigDedicated *physicalConfigDedicated);
255
256
257
258
259

/*!
\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
260
 */
261
262
263
264
265
266
void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *phy_vars_eNB);

/*
  \fn int phy_init_secsys_eNB(PHY_VARS_eNB *phy_vars_eNb)
\brief Allocate and Initialize the PHY variables relevant to the LTE implementation. 
@param phy_vars_eNb pointer to LTE parameter structure for the eNb
gauthier's avatar
gauthier committed
267
 */
268
269
270
271
272
273
274
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);

275
276
277
278
279
280
281
282
283
284
285
286
#ifdef Rel10
void phy_config_dedicated_scell_ue(uint8_t Mod_id,
				   uint8_t eNB_index,
				   SCellToAddMod_r10_t *sCellToAddMod_r10, 
				   int CC_id);

void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
				    uint16_t rnti,
				    SCellToAddMod_r10_t *sCellToAddMod_r10, 
				    int CC_id);

#endif 
287
288
289
290
291
292
293
294
#endif


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

#ifdef OPENAIR_LTE
gauthier's avatar
gauthier committed
295
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
296
297
298
299
300
301
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
#endif

/** @} */
#endif