defs.h 13.5 KB
Newer Older
1 2 3 4 5
#ifndef __INIT_DEFS__H__
#define __INIT_DEFS__H__

#include "PHY/defs.h"

6

7 8 9 10 11
#include "SystemInformationBlockType2.h"
//#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h"
12
#include "MobilityControlInfo.h"
13 14
#ifdef Rel10
#include "SCellToAddMod-r10.h"
15
#endif
16 17 18 19 20 21 22 23 24
/** @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
25
 */
26 27 28 29
int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms);


/*!
30 31 32
\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
33 34 35
@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
36 37
@returns -1 if any memory allocation failed
@note The current implementation will never return -1, but segfault.
38
 */
39
int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
40 41
                    int          nb_connected_eNB,
                    uint8_t         abstraction_flag);
42 43

/*!
44 45 46
\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
47 48 49
@param is_secondary_eNb Flag to indicate this eNB gets synch from another
@param abstraction_flag 1 indicates memory should be allocated for abstracted MODEM
@returns 0 on success
50 51
@returns -1 if any memory allocation failed
@note The current implementation will never return -1, but segfault.
52
 */
53
int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNb,
54 55
                     unsigned char is_secondary_eNb,
                     unsigned char abstraction_flag);
56

57 58
/** \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$
59 60 61 62 63 64 65
@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
66
 */
67
void phy_config_mib(LTE_DL_FRAME_PARMS *lte_frame_parms,
68 69 70 71 72 73
                    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);
74 75


76 77
/** \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.
78
@param Mod_id Instance ID of eNB
Raymond Knopp's avatar
 
Raymond Knopp committed
79
@param CC_id Component Carrier index
80
@param tdd_Config TDD UL/DL and S-subframe configurations
81
@param SIwindowsize Size of a SI window in frames where repetitions of a unique System Information message block is repeated
82
@param SIperiod Periodicity of System Information Messages (in multiples of a frame)*/
83
void phy_config_sib1_eNB(module_id_t    Mod_id,
Raymond Knopp's avatar
 
Raymond Knopp committed
84
                         int CC_id,
85
                         TDD_Config_t  *tdd_Config,
86 87
                         uint8_t           SIwindowsize,
                         uint16_t            SIperiod);
88

89 90
/** \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.
91
@param Mod_id Instance ID of UE
Raymond Knopp's avatar
 
Raymond Knopp committed
92
@param CC_id Component Carrier index
93 94
@param CH_index Index of eNB for this configuration
@param tdd_Config TDD UL/DL and S-subframe configurations
95
@param SIwindowsize Size of a SI window in frames where repetitions of a unique System Information message block is repeated
96
@param SIperiod Periodicity of System Information Messages (in multiples of a frame)*/
97
void phy_config_sib1_ue(module_id_t   Mod_id,
Raymond Knopp's avatar
 
Raymond Knopp committed
98
                        int CC_id,
99
                        uint8_t          CH_index,
100 101 102
                        TDD_Config_t *tdd_Config,
                        uint8_t          SIwindowsize,
                        uint16_t           SIperiod);
103 104 105


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

132

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


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

182
 */
Raymond Knopp's avatar
 
Raymond Knopp committed
183 184
void phy_config_dedicated_ue(module_id_t Mod_id,
                             int CC_id,
185
                             uint8_t CH_index,
Raymond Knopp's avatar
 
Raymond Knopp committed
186 187
                             struct PhysicalConfigDedicated *physicalConfigDedicated);

188 189

/**
190 191
\brief Configure UE MBSFN common parameters.
\details Invoked upon reception of SIB13 from eNB.
192
@param Mod_id Instance ID for UE
Raymond Knopp's avatar
 
Raymond Knopp committed
193
@param CC_id Component Carrier Index
194 195 196
@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
197
 */
198

199
void phy_config_sib13_ue(module_id_t Mod_id,
Raymond Knopp's avatar
 
Raymond Knopp committed
200
                         int CC_id,uint8_t CH_index,int mbsfn_Area_idx,
201
                         long mbsfn_AreaId_r9);
202 203

/**
204 205
\brief Configure eNB MBSFN common parameters.
\details Invoked upon transmission of SIB13 from eNB.
206
@param Mod_id Instance ID for eNB
Raymond Knopp's avatar
 
Raymond Knopp committed
207
@param CC_id Component Carrier index
208 209
@param mbsfn_Area_idx Index of MBSFN-Area for which this command operates
@param mbsfn_AreaId_r9 MBSFN-Area Id
210 211
 */
void phy_config_sib13_eNB(module_id_t Mod_id,
212
                          int CC_id,
213 214
                          int mbsfn_Area_idx,
                          long mbsfn_AreaId_r9);
215 216 217 218

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

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

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

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

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

274 275 276 277 278 279 280 281 282 283 284 285
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);

286 287
#ifdef Rel10
void phy_config_dedicated_scell_ue(uint8_t Mod_id,
288 289 290
                                   uint8_t eNB_index,
                                   SCellToAddMod_r10_t *sCellToAddMod_r10,
                                   int CC_id);
291 292

void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
293 294 295
                                    uint16_t rnti,
                                    SCellToAddMod_r10_t *sCellToAddMod_r10,
                                    int CC_id);
296

297
#endif
298

299 300 301


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

305

306
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
307
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
308 309 310 311 312 313 314 315 316 317 318 319

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);
320 321 322 323

/** @} */
#endif