config_NB_IoT.c 38 KB
Newer Older
1 2 3 4 5 6 7 8 9 10

/*! \file config_NB_IoT.c
 * \brief configuration primitives between RRC and MAC
 * \author  NTUST BMW Lab./
 * \date 2017
 * \email: 
 * \version 1.0
 *
 */

Nick Ho's avatar
Nick Ho committed
11 12 13
#include "LAYER2/MAC/defs_NB_IoT.h"
#include "LAYER2/MAC/proto_NB_IoT.h"
#include "LAYER2/MAC/extern_NB_IoT.h"
Nick Ho's avatar
Nick Ho committed
14 15 16
#include "BCCH-DL-SCH-Message-NB.h"
#include "RRCConnectionSetup-NB.h"
#include "BCCH-BCH-Message-NB.h"
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
//#include "SIB-Type-NB-r13.h"

typedef struct eutra_bandentry_NB_s {
  //this should be the colum order of the table below
    int16_t   band;
    uint32_t  ul_min;
    uint32_t  ul_max;
    uint32_t  dl_min;
    uint32_t  dl_max;
    uint32_t  N_OFFs_DL;
} eutra_bandentry_NB_IoT_t;

typedef struct band_info_s {

    int                        nbands;
    eutra_bandentry_NB_IoT_t   band_info[100];

} band_info_t;

static const eutra_bandentry_NB_IoT_t eutra_bandtable[] = {
//[BAND] [FUL_low] [FUL_hi] [FDL_low] [FDL_hig] [NOFF_DL]
  { 1, 19200, 19800, 21100, 21700, 0},
  { 2, 18500, 19100, 19300, 19900, 6000},
  { 3, 17100, 17850, 18050, 18800, 12000},
  { 5,  8240,  8490,  8690,  8940, 24000},
  { 8,  8800, 9150,  9250,  9600, 34500},
  {11, 14279, 14529, 14759, 15009, 47500},
  {12,  6980,  7160,  7280,  7460, 50100},
  {13,  7770,  7870,  7460,  7560, 51800},
  {17,  7040,  7160,  7340,  7460, 57300},
  {18,  8150,  9650,  8600, 10100, 58500},
  {19,  8300,  8450,  8750,  8900, 60000},
  {20,  8320,  8620,  7910,  8210, 61500},
  {25, 18500, 19150, 19300, 19950, 80400},
  {26, 8140,  8490,  8590,  8940, 86900},
  {28, 7030,  7580,  7580,  8130, 92100},
  {31, 45250, 34900, 46250, 35900, 98700},
  {66, 17100, 18000, 21100, 22000, 664360},
  {70, 16950 , 17100,  19950,  20200, 683360}}; //may not used for Rel.13 equipment

//this function is used in phy_config_mib_NB for getting the DL Carrier Frequency from the EARFCN
uint32_t from_earfcn_NB_IoT(int eutra_bandP,uint32_t dl_earfcn, float m_dl) {

  int i;

 // float m_dl = 0; //for the moment we fix but maybe should be dynamic (anyway the 0 works for any case)

  AssertFatal(eutra_bandP <= 70,"eutra_band %d > 70\n",eutra_bandP);
  for (i=0;i<= 70 && eutra_bandtable[i].band!=eutra_bandP;i++);

  return(eutra_bandtable[i].dl_min + 0.0025*(2*m_dl+1)+(dl_earfcn-(eutra_bandtable[i].N_OFFs_DL/10)))*100000;
}


int32_t get_uldl_offset_NB_IoT(int eutra_band) {
  return(-eutra_bandtable[eutra_band].dl_min + eutra_bandtable[eutra_band].ul_min);
}

Nick Ho's avatar
Nick Ho committed
75
uint32_t to_earfcn_NB_IoT(int eutra_bandP,uint32_t dl_CarrierFreq, float m_dl) {
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97

  uint32_t dl_CarrierFreq_by_100k = dl_CarrierFreq/100000;

  int i;

  AssertFatal(eutra_bandP < 70,"eutra_band %d > 70\n",eutra_bandP);
  for (i=0;i<69 && eutra_bandtable[i].band!=eutra_bandP;i++);

  AssertFatal(dl_CarrierFreq_by_100k>=eutra_bandtable[i].dl_min,
        "Band %d : DL carrier frequency %u Hz < %u\n",
        eutra_bandP,dl_CarrierFreq,eutra_bandtable[i].dl_min);

  //I would say that for sure the EUTRA band is larger that 1 PRB for NB-IoT so this check may is unuseful
//  AssertFatal(dl_CarrierFreq_by_100k<=(eutra_bandtable[i].dl_max-bw_by_100),
//        "Band %d, bw %u: DL carrier frequency %u Hz > %d\n",
//        eutra_bandP,bw,dl_CarrierFreq,eutra_bandtable[i].dl_max-bw_by_100);


  //based on formula TS 36.101 5.7.3F
  return(dl_CarrierFreq_by_100k - eutra_bandtable[i].dl_min - 0.0025*(2*m_dl+ 1)+ (eutra_bandtable[i].N_OFFs_DL/10));
}

Nick Ho's avatar
Nick Ho committed
98 99


100 101 102 103 104 105 106 107 108 109 110 111 112 113
void config_mib_fapi_NB_IoT(

        int                     rntiP,
        int                     physCellId,
        uint8_t                 eutra_band,
        int                     Ncp,
        int                     Ncp_UL,
        int                     p_eNB,
        int                     p_rx_eNB,
        int                     dl_CarrierFreq,
        int                     ul_CarrierFreq,
        long                    *eutraControlRegionSize,
        BCCH_BCH_Message_NB_t   *mib_NB_IoT
        )
114

Nick Ho's avatar
Nick Ho committed
115 116
{

117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
    //XXX MP: one important problem to solve is how we decide when we deal with anchor or non anchor carrier?? configuration time?
    //anchor carrier refers to the allowed PRBs index in the in-band operation mode at the beginning the UE is always camp on an anchor carrier from which
    //receive NSSS, NPSSS ecc... but the RRCConnectionReconfiguration may could indicate non-anchor carrier to be used for data transmission
    //ASSUMPTION: we always use an anchor carrier

    float m_dl = 0; //this is the category offset for NB1/NB2 UE category used for EARFCN evaluation (TS 36.101 ch. 5.7.3F) (for the moment we keep this value fixed)
    config_INFO->get_MIB                                          = 1;
    config_INFO->rnti                                             = rntiP;
    config_INFO->cfg->nfapi_config.rf_bands.rf_band[0]            = (uint16_t)eutra_band;
    config_INFO->cfg->sch_config.physical_cell_id.value           = physCellId;
    config_INFO->cfg->subframe_config.dl_cyclic_prefix_type.value = Ncp;
    config_INFO->cfg->subframe_config.ul_cyclic_prefix_type.value = Ncp_UL;
    config_INFO->cfg->rf_config.tx_antenna_ports.value            = p_eNB;
    config_INFO->cfg->rf_config.rx_antenna_ports.value            = p_rx_eNB;

Nick Ho's avatar
Nick Ho committed
132 133


134 135 136 137 138
    //PROBLEM: we need to know the LTE bandwidht for In-band and Guard band operating mode in order to choose the proper PRB idex or is given at configuration time??
    //The prb index allowed are the one specified in R&shwarz pag 9 NB-IoT white papaer


    switch (mib_NB_IoT->message.operationModeInfo_r13.present)
Nick Ho's avatar
Nick Ho committed
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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
      //FAPI specs pag 135
      case MasterInformationBlock_NB__operationModeInfo_r13_PR_inband_SamePCI_r13:

              config_INFO->cfg->config_NB_IoT.operating_mode.value  = 0;
              config_INFO->cfg->config_NB_IoT.prb_index.value       = mib_NB_IoT->message.operationModeInfo_r13.choice.inband_SamePCI_r13.eutra_CRS_SequenceInfo_r13; //see TS 36.213 ch 16.0
              config_INFO->cfg->config_NB_IoT.assumed_crs_aps.value = -1; //is not defined so we put a negative value

              if(eutraControlRegionSize == NULL)
                   LOG_E(RRC, "rrc_mac_config_req_eNB_NB_IoT: operation mode is in-band but eutraControlRegionSize is not defined");
              else
                   config_INFO->cfg->config_NB_IoT.control_region_size.value = *eutraControlRegionSize;


              //m_dl = NB_Category_Offset_anchor[rand()%4];


          break;

      case MasterInformationBlock_NB__operationModeInfo_r13_PR_inband_DifferentPCI_r13:

           config_INFO->cfg->config_NB_IoT.operating_mode.value = 1;
           //XXX problem: fapi think to define also eutra_CRS_sequenceInfo also for in band with different PCI but the problem is that we don-t have i
           //XXX should pass the prb_index may defined by configuration file depending on the LTE band we are considering (see Rhode&Shwartz whitepaper pag9)
           //config_INFO->config_NB_IoT.prb_index.value =
           config_INFO->cfg->config_NB_IoT.assumed_crs_aps.value = mib_NB_IoT->message.operationModeInfo_r13.choice.inband_DifferentPCI_r13.eutra_NumCRS_Ports_r13;

             if(eutraControlRegionSize == NULL)
                   LOG_E(RRC, "rrc_mac_config_req_eNB_NB_IoT: operation mode is in-band but eutraControlRegionSize is not defined");
             else
                   config_INFO->cfg->config_NB_IoT.control_region_size.value = *eutraControlRegionSize;

        break;

      case MasterInformationBlock_NB__operationModeInfo_r13_PR_guardband_r13:
        
          config_INFO->cfg->config_NB_IoT.operating_mode.value      = 2;
          //XXX should pass the prb_index may defined by configuration file depending on the LTE band we are considering (see Rhode&Shwartz whitepaper pag9)
          //config_INFO->config_NB_IoT.prb_index.value =
            config_INFO->cfg->config_NB_IoT.control_region_size.value = -1; //should not being defined so we put a negative value
              config_INFO->cfg->config_NB_IoT.assumed_crs_aps.value     = -1; //is not defined so we put a negative value

        break;

      case MasterInformationBlock_NB__operationModeInfo_r13_PR_standalone_r13:

            config_INFO->cfg->config_NB_IoT.operating_mode.value       = 3;
            config_INFO->cfg->config_NB_IoT.prb_index.value            = -1;   // is not defined for this case (put a negative random value--> will be not considered for encoding, scrambling procedures)
            config_INFO->cfg->config_NB_IoT.control_region_size.value  = -1;   //is not defined so we put a negative value
              config_INFO->cfg->config_NB_IoT.assumed_crs_aps.value      = -1;   //is not defined so we put a negative value

        break;
      default:
            LOG_E(RRC, "rrc_mac_config_req_eNB_NB_IoT: NB-IoT operating Mode (MIB-NB) not set\n");
        break;
Nick Ho's avatar
Nick Ho committed
194 195
    }

196 197 198 199 200
    //we shoud use dl_CarrierConfig for generating the earfcn for LTE-CAT N2 based on  TS 36.101 5.7.3F
    /*
     * 1) takes a random number from the offset of category NB1 and NB2 based on the operating mode (we assume always the usage of anchor carrier)
     * 2)evaluate the EARFCN value based on the corresponding formula
     */
Nick Ho's avatar
Nick Ho committed
201
    config_INFO->cfg->nfapi_config.earfcn.value = to_earfcn_NB_IoT(eutra_band,dl_CarrierFreq, m_dl);
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345

}

void config_sib2_fapi_NB_IoT(
                        int physCellId,
                        RadioResourceConfigCommonSIB_NB_r13_t   *radioResourceConfigCommon
                        )
{

    /*
     * Following the FAPI like approach:
     * 1)fill the PHY_Config_t structure (PHY_INTERFACE/IF_Module_NB_IoT.h)
     * 1.1) check for how many NPRACH resources has been set and enable the corresponding parameter
     * 1.2)fill the structure PHY_Config_t (shared structure of the IF_Module
     * 2)Call the PHY_config_req for trigger the NB_phy_config_sib2_eNB()
     */

    /*NPRACH Resources*/

    NPRACH_Parameters_NB_r13_t* nprach_parameter;

      config_INFO->cfg->config_NB_IoT.nprach_config_0_enabled.value = 0;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_enabled.value = 0;
      config_INFO->cfg->config_NB_IoT.nprach_config_2_enabled.value = 0;

    switch(radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.size)
    {
    case 0:
        LOG_E(MAC, "nprach_ParametersLis is empty\n");
      break;
    case 1:
      nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[0];
      config_INFO->cfg->config_NB_IoT.nprach_config_0_enabled.value = 1;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_sf_periodicity.value = nprach_parameter->nprach_Periodicity_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_start_time.value = nprach_parameter->nprach_StartTime_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;

      //MP: missed configuration for FAPI-style structure (I have added on my own byt maybe are not needed)
      config_INFO->extra_phy_parms.nprach_config_0_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
      config_INFO->extra_phy_parms.nprach_config_0_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
      config_INFO->extra_phy_parms.nprach_config_0_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13; //Rmax
      config_INFO->extra_phy_parms.nprach_config_0_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_0_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
      //rsrp_ThresholdsPrachInfoList_r13 /*OPTIONAL*/

      break;
    case 2:
      nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[0];
      config_INFO->cfg->config_NB_IoT.nprach_config_0_enabled.value = 1;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_sf_periodicity.value = nprach_parameter->nprach_Periodicity_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_start_time.value = nprach_parameter->nprach_StartTime_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;

      //MP: missed configuration for FAPI-style structure (I have added on my own byt maybe are not needed)
      config_INFO->extra_phy_parms.nprach_config_0_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
      config_INFO->extra_phy_parms.nprach_config_0_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
      config_INFO->extra_phy_parms.nprach_config_0_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_0_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_0_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
      //rsrp_ThresholdsPrachInfoList_r13 /*OPTIONAL*/


      nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[1];
      config_INFO->cfg->config_NB_IoT.nprach_config_1_enabled.value = 1;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_sf_periodicity.value = nprach_parameter->nprach_Periodicity_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_start_time.value = nprach_parameter->nprach_StartTime_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;

      //MP: missed configuration for FAPI-style structure (I have added on my own byt maybe are not needed)
      config_INFO->extra_phy_parms.nprach_config_1_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
      config_INFO->extra_phy_parms.nprach_config_1_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
      config_INFO->extra_phy_parms.nprach_config_1_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_1_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_1_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
      //rsrp_ThresholdsPrachInfoList_r13 /*OPTIONAL*/
      break;
    case 3:
      nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[0];
      config_INFO->cfg->config_NB_IoT.nprach_config_0_enabled.value = 1;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_sf_periodicity.value = nprach_parameter->nprach_Periodicity_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_start_time.value = nprach_parameter->nprach_StartTime_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_0_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;

      //MP: missed configuration for FAPI-style structure (I have added on my own byt maybe are not needed)
      config_INFO->extra_phy_parms.nprach_config_0_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
      config_INFO->extra_phy_parms.nprach_config_0_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
      config_INFO->extra_phy_parms.nprach_config_0_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_0_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_0_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
      //rsrp_ThresholdsPrachInfoList_r13 /*OPTIONAL*/


      nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[1];
      config_INFO->cfg->config_NB_IoT.nprach_config_1_enabled.value = 1;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_sf_periodicity.value = nprach_parameter->nprach_Periodicity_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_start_time.value = nprach_parameter->nprach_StartTime_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_1_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;

      //MP: missed configuration for FAPI-style structure (I have added on my own byt maybe are not needed)
      config_INFO->extra_phy_parms.nprach_config_1_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
      config_INFO->extra_phy_parms.nprach_config_1_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
      config_INFO->extra_phy_parms.nprach_config_1_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_1_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_1_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
      //rsrp_ThresholdsPrachInfoList_r13 /*OPTIONAL*/


      nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[2];
      config_INFO->cfg->config_NB_IoT.nprach_config_2_enabled.value = 1;
      config_INFO->cfg->config_NB_IoT.nprach_config_2_cp_length.value = radioResourceConfigCommon->nprach_Config_r13.nprach_CP_Length_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_2_sf_periodicity.value = nprach_parameter->nprach_Periodicity_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_2_start_time.value = nprach_parameter->nprach_StartTime_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_2_subcarrier_offset.value = nprach_parameter->nprach_SubcarrierOffset_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_2_number_of_subcarriers.value = nprach_parameter->nprach_NumSubcarriers_r13;
      config_INFO->cfg->config_NB_IoT.nprach_config_2_number_of_repetitions_per_attempt.value = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;

      //MP: missed configuration for FAPI-style structure (I have added on my own byt maybe are not needed)
      config_INFO->extra_phy_parms.nprach_config_2_subcarrier_MSG3_range_start = nprach_parameter->nprach_SubcarrierMSG3_RangeStart_r13;
      config_INFO->extra_phy_parms.nprach_config_2_max_num_preamble_attempt_CE = nprach_parameter->maxNumPreambleAttemptCE_r13;
      config_INFO->extra_phy_parms.nprach_config_2_npdcch_num_repetitions_RA = nprach_parameter->npdcch_NumRepetitions_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_2_npdcch_startSF_CSS_RA = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
      config_INFO->extra_phy_parms.nprach_config_2_npdcch_offset_RA = nprach_parameter->npdcch_Offset_RA_r13;
      //rsrp_ThresholdsPrachInfoList_r13 /*OPTIONAL*/
      break;

    default:
      LOG_E(RRC,"rrc_mac_config_req_eNB_NB_IoT: nprach_ParametersList size not valid\n");
      break;

Nick Ho's avatar
Nick Ho committed
346 347
    }

348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380
    /*NPDSCH ConfigCommon*/

    //FIXME: MP: FAPI specs define a range of value [0-255]==[0db - 63.75db] with 0.25db step -- corrispondence in 3GPP specs???
    config_INFO->cfg->rf_config.reference_signal_power.value = radioResourceConfigCommon->npdsch_ConfigCommon_r13.nrs_Power_r13;

    /*NPUSCH ConfigCommon*/

    //a pointer to the first element of the list
    config_INFO->extra_phy_parms.ack_nack_numRepetitions_MSG4 = radioResourceConfigCommon->npusch_ConfigCommon_r13.ack_NACK_NumRepetitions_Msg4_r13.list.array[0];


    if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13 != NULL)/* OPTIONAL */
    {
      /* OPTIONAL */
      if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_BaseSequence_r13!= NULL)
          config_INFO->cfg->config_NB_IoT.three_tone_base_sequence.value  = *(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_BaseSequence_r13);
      else
        config_INFO->cfg->config_NB_IoT.three_tone_base_sequence.value = physCellId%12; //see spec TS 36.331 NPUSCH-Config-NB

      /* OPTIONAL */
      if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_BaseSequence_r13!= NULL)
          config_INFO->cfg->config_NB_IoT.six_tone_base_sequence.value = *(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_BaseSequence_r13);
      else
        config_INFO->cfg->config_NB_IoT.six_tone_base_sequence.value = physCellId%14; //see spec TS 36.331 NPUSCH-Config-NB

      /* OPTIONAL */
      if(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->twelveTone_BaseSequence_r13!= NULL)
        config_INFO->cfg->config_NB_IoT.twelve_tone_base_sequence.value = *(radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->twelveTone_BaseSequence_r13);
      else
        config_INFO->cfg->config_NB_IoT.twelve_tone_base_sequence.value = physCellId%30; //see spec TS 36.331 NPUSCH-Config-NB

        config_INFO->cfg->config_NB_IoT.three_tone_cyclic_shift.value = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_CyclicShift_r13;
        config_INFO->cfg->config_NB_IoT.six_tone_cyclic_shift.value = radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_CyclicShift_r13;
Nick Ho's avatar
Nick Ho committed
381 382
    }

383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402

    //NOTE: MP: FAPI specs for UL RS Configurations seems to be targeted for LTE and not for NB-IoT
    if(radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupHoppingEnabled_r13 == TRUE)
      config_INFO->cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 1; //RS_GROUP_HOPPING (FAPI specs pag 127)
    else
      config_INFO->cfg->uplink_reference_signal_config.uplink_rs_hopping.value = 0;//RS_NO_HOPPING

    config_INFO->cfg->uplink_reference_signal_config.group_assignment.value = radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupAssignmentNPUSCH_r13;

    //Some missed parameters are in UL_CONFIG.request message (P7) in FAPI specs. and not configured through P5 procedure
       //ack_NACK_NumRepetitions_Msg4_r13
       //srs_SubframeConfig_r13 /* OPTIONAL */

      /*DL GAP config */
    if(radioResourceConfigCommon->dl_Gap_r13 !=NULL)/* OPTIONAL */
    {
      config_INFO->cfg->config_NB_IoT.dl_gap_config_enable.value        = 1;
      config_INFO->cfg->config_NB_IoT.dl_gap_threshold.value            = radioResourceConfigCommon->dl_Gap_r13->dl_GapThreshold_r13;
          config_INFO->cfg->config_NB_IoT.dl_gap_duration_coefficient.value = radioResourceConfigCommon->dl_Gap_r13->dl_GapDurationCoeff_r13;
          config_INFO->cfg->config_NB_IoT.dl_gap_periodicity.value          = radioResourceConfigCommon->dl_Gap_r13->dl_GapPeriodicity_r13;
Nick Ho's avatar
Nick Ho committed
403
    }
404 405 406 407 408 409 410 411 412 413 414 415
    else
      config_INFO->cfg->config_NB_IoT.dl_gap_config_enable.value        = 0;


      /*UL Power Control ConfigCommon*/
    //nothing defined in FAPI specs
    config_INFO->extra_phy_parms.p0_nominal_npusch  = radioResourceConfigCommon->uplinkPowerControlCommon_r13.p0_NominalNPUSCH_r13;
    config_INFO->extra_phy_parms.alpha              = radioResourceConfigCommon->uplinkPowerControlCommon_r13.alpha_r13;
    config_INFO->extra_phy_parms.delta_preamle_MSG3 = radioResourceConfigCommon->uplinkPowerControlCommon_r13.deltaPreambleMsg3_r13;

      /*RACH Config Common*/
    //nothing defined in FAPI specs
Nick Ho's avatar
Nick Ho committed
416 417 418

}

419 420 421 422 423 424 425 426 427 428 429 430 431 432
///-------------------------------------------Function---------------------------------------------///

void rrc_mac_config_req_NB_IoT(
    module_id_t                             Mod_idP,
    int                                     CC_idP,
    int                                     rntiP,
    rrc_eNB_carrier_data_NB_IoT_t           *carrier,
    SystemInformationBlockType1_NB_t        *sib1_NB_IoT,
    RadioResourceConfigCommonSIB_NB_r13_t   *radioResourceConfigCommon,
    PhysicalConfigDedicated_NB_r13_t        *physicalConfigDedicated,
    LogicalChannelConfig_NB_r13_t           *logicalChannelConfig,            //FIXME: decide how to use it
    rrc_config_NB_IoT_t                     *mac_config,
    uint8_t                                 ded_flag,
    uint8_t                                 ue_list_ded_num)
Nick Ho's avatar
Nick Ho committed
433
{
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566

    int UE_id = -1;

    //find ue_id here

    config_INFO->get_MIB                                 = 0;
    config_INFO->get_COMMON                              = 0;
    config_INFO->get_DEDICATED                           = 0;
    config_INFO->mod_id                                  = Mod_idP;
    config_INFO->CC_id                                   = CC_idP;
    config_INFO->cfg->subframe_config.duplex_mode.value  = 2;               //HD-FDD for NB-IoT

    if (&carrier->mib_NB_IoT != NULL){
           /*printf(MAC,
            "Configuring MIB for instance %d, CCid %d : (band %ld,Nid_cell %d,TX antenna port (p) %d,DL freq %u\n",
            Mod_idP,
            CC_idP,
            sib1_NB_IoT->freqBandIndicator_r13,
            carrier->physCellId,
            carrier->p_eNB,
            carrier->dl_CarrierFreq
           );*/

    /*
     * Following the FAPI like approach:
     * 1)fill the PHY_Config_t structure (PHY_INTERFACE/IF_Module_NB_IoT.h)
     * 2)Call the PHY_config_req for trigger the NB_phy_config_mib_eNB() at the end
     */

    //XXX where allocate memory for cfg??
    if(config_INFO->cfg != NULL) LOG_E(MAC, "rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");


    //Mapping OAI params into FAPI params
            config_mib_fapi_NB_IoT( rntiP,
                                    carrier->physCellId,
                                    sib1_NB_IoT->freqBandIndicator_r13,
                                    carrier->Ncp,
                                    carrier->Ncp_UL,
                                    carrier->p_eNB,
                                    carrier->p_rx_eNB,
                                    carrier->dl_CarrierFreq,
                                    carrier->ul_CarrierFreq,
                                    sib1_NB_IoT->eutraControlRegionSize_r13,
                                    &carrier->mib_NB_IoT
                                    );


    }

    if(sib1_NB_IoT != NULL)
    {
        mac_config->sib1_NB_IoT_sched_config.repetitions = 4;
        mac_config->sib1_NB_IoT_sched_config.starting_rf = sib1_NB_IoT->si_RadioFrameOffset_r13[0];
        mac_config->si_window_length = sib1_NB_IoT->si_WindowLength_r13;

        SchedulingInfo_NB_r13_t *scheduling_info_list;

        ///CE level 0
        scheduling_info_list = sib1_NB_IoT->schedulingInfoList_r13.list.array[0];

        mac_config->sibs_NB_IoT_sched[0].si_periodicity =           scheduling_info_list->si_Periodicity_r13 ;
        mac_config->sibs_NB_IoT_sched[0].si_repetition_pattern =    scheduling_info_list->si_RepetitionPattern_r13 ;
        mac_config->sibs_NB_IoT_sched[0].sib_mapping_info =         scheduling_info_list->sib_MappingInfo_r13.list.array[0][0] | scheduling_info_list->sib_MappingInfo_r13.list.array[1][0];
        mac_config->sibs_NB_IoT_sched[0].si_tb =                    scheduling_info_list->si_TB_r13  ;

        ///CE level 1
        scheduling_info_list = sib1_NB_IoT->schedulingInfoList_r13.list.array[1];

        mac_config->sibs_NB_IoT_sched[1].si_periodicity =           scheduling_info_list->si_Periodicity_r13 ;
        mac_config->sibs_NB_IoT_sched[1].si_repetition_pattern =    scheduling_info_list->si_RepetitionPattern_r13 ;
        mac_config->sibs_NB_IoT_sched[1].sib_mapping_info =         scheduling_info_list->sib_MappingInfo_r13.list.array[0][0] | scheduling_info_list->sib_MappingInfo_r13.list.array[1][0];
        mac_config->sibs_NB_IoT_sched[1].si_tb =                    scheduling_info_list->si_TB_r13  ;

        ///CE level 2
        scheduling_info_list = sib1_NB_IoT->schedulingInfoList_r13.list.array[2];

        mac_config->sibs_NB_IoT_sched[2].si_periodicity =           scheduling_info_list->si_Periodicity_r13 ;
        mac_config->sibs_NB_IoT_sched[2].si_repetition_pattern =    scheduling_info_list->si_RepetitionPattern_r13 ;
        mac_config->sibs_NB_IoT_sched[2].sib_mapping_info =         scheduling_info_list->sib_MappingInfo_r13.list.array[0][0] | scheduling_info_list->sib_MappingInfo_r13.list.array[1][0];
        mac_config->sibs_NB_IoT_sched[2].si_tb =                    scheduling_info_list->si_TB_r13  ;

        mac_config->sibs_NB_IoT_sched[3].sib_mapping_info = 0x0;
        mac_config->sibs_NB_IoT_sched[4].sib_mapping_info = 0x0;
        mac_config->sibs_NB_IoT_sched[5].sib_mapping_info = 0x0;
    }


    if (radioResourceConfigCommon!=NULL) {

        //if(config_INFO->cfg == NULL) LOG_E(MAC, "rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");

        config_INFO->get_COMMON = 1;

        //LOG_I(MAC,"[CONFIG]SIB2/3-NB radioResourceConfigCommon Contents (partial)\n");

        //LOG_I(MAC,"[CONFIG]npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_CyclicShift_r13= %ld\n", radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->threeTone_CyclicShift_r13);
        //LOG_I(MAC,"[CONFIG]npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_CyclicShift_r13= %ld\n", radioResourceConfigCommon->npusch_ConfigCommon_r13.dmrs_Config_r13->sixTone_CyclicShift_r13);
        //LOG_I(MAC,"[CONFIG]npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupHoppingEnabled_r13= %d\n", radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupHoppingEnabled_r13);
        //LOG_I(MAC,"[CONFIG]npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupAssignmentNPUSCH_r13= %ld\n", radioResourceConfigCommon->npusch_ConfigCommon_r13.ul_ReferenceSignalsNPUSCH_r13.groupAssignmentNPUSCH_r13);

        NPRACH_Parameters_NB_r13_t* nprach_parameter;

        ///CE level 0
        nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[0];

        mac_config->mac_NPRACH_ConfigSIB[0].mac_numRepetitionsPerPreambleAttempt_NB_IoT = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
        mac_config->mac_NPRACH_ConfigSIB[0].mac_npdcch_NumRepetitions_RA_NB_IoT         = nprach_parameter->npdcch_NumRepetitions_RA_r13;
        mac_config->mac_NPRACH_ConfigSIB[0].mac_npdcch_StartSF_CSS_RA_NB_IoT            = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
        mac_config->mac_NPRACH_ConfigSIB[0].mac_npdcch_Offset_RA_NB_IoT                 = nprach_parameter->npdcch_Offset_RA_r13;

        ///CE level 1
        nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[1];

        mac_config->mac_NPRACH_ConfigSIB[1].mac_numRepetitionsPerPreambleAttempt_NB_IoT = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
        mac_config->mac_NPRACH_ConfigSIB[1].mac_npdcch_NumRepetitions_RA_NB_IoT         = nprach_parameter->npdcch_NumRepetitions_RA_r13;
        mac_config->mac_NPRACH_ConfigSIB[1].mac_npdcch_StartSF_CSS_RA_NB_IoT            = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
        mac_config->mac_NPRACH_ConfigSIB[1].mac_npdcch_Offset_RA_NB_IoT                 = nprach_parameter->npdcch_Offset_RA_r13;

        ///CE level 2
        nprach_parameter = radioResourceConfigCommon->nprach_Config_r13.nprach_ParametersList_r13.list.array[2];

        mac_config->mac_NPRACH_ConfigSIB[2].mac_numRepetitionsPerPreambleAttempt_NB_IoT = nprach_parameter->numRepetitionsPerPreambleAttempt_r13;
        mac_config->mac_NPRACH_ConfigSIB[2].mac_npdcch_NumRepetitions_RA_NB_IoT         = nprach_parameter->npdcch_NumRepetitions_RA_r13;
        mac_config->mac_NPRACH_ConfigSIB[2].mac_npdcch_StartSF_CSS_RA_NB_IoT            = nprach_parameter->npdcch_StartSF_CSS_RA_r13;
        mac_config->mac_NPRACH_ConfigSIB[2].mac_npdcch_Offset_RA_NB_IoT                 = nprach_parameter->npdcch_Offset_RA_r13;


        //eNB_mac_inst_NB_IoT[Mod_idP].common_channels[CC_idP].radioResourceConfigCommon  = radioResourceConfigCommon;
        if (carrier->ul_CarrierFreq>0)
        //eNB_mac_inst_NB_IoT[Mod_idP].common_channels[CC_idP].ul_CarrierFreq   = ul_CarrierFreq;

        config_sib2_fapi_NB_IoT(carrier->physCellId,radioResourceConfigCommon);
Nick Ho's avatar
Nick Ho committed
567 568 569

    }

570
    if (logicalChannelConfig!= NULL) {
Nick Ho's avatar
Nick Ho committed
571 572


573
        if(config_INFO->cfg == NULL) LOG_E(MAC, "rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");
Nick Ho's avatar
Nick Ho committed
574

575 576 577 578 579 580 581 582 583 584
        if (UE_id == -1)
        {
            LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
        }
        else
        {
        //logical channel group not defined for nb-iot --> no UL specific Parameter
        // or at least LCGID should be set to 0 for NB-IoT (See TS 36.321 ch 6.1.3.1) so no make sense to store this
        }
    }
Nick Ho's avatar
Nick Ho committed
585

586
    if (physicalConfigDedicated != NULL) {
Nick Ho's avatar
Nick Ho committed
587 588


589
        if(config_INFO->cfg == NULL) LOG_E(MAC, "rrc_mac_config_req_eNB_NB_IoT: trying to configure PHY but no config.request message in config_INFO is allocated\n");
Nick Ho's avatar
Nick Ho committed
590

591 592 593 594
        if (UE_id == -1)
            LOG_E(MAC,"%s:%d:%s: ERROR, UE_id == -1\n", __FILE__, __LINE__, __FUNCTION__);
        else
        {
Nick Ho's avatar
Nick Ho committed
595

596
        config_INFO->get_DEDICATED = 1;
Nick Ho's avatar
Nick Ho committed
597

598 599 600 601 602 603 604
        //XXX this parameters seems to be not defined by FAPi specs
        //this are UE specific information that should be transmitted to the PHY layer
        //use UE-specific structure at phy layer where to store this information (NPDCCH structure) this structure will be scrambled based on the rnti
        //config_INFO->rnti = UE_RNTI_NB_IoT(Mod_idP, UE_id);
        config_INFO->extra_phy_parms.npdcch_NumRepetitions = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13; //Rmax
        config_INFO->extra_phy_parms.npdcch_Offset_USS     = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13;
        config_INFO->extra_phy_parms.npdcch_StartSF_USS    = physicalConfigDedicated->npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13;
Nick Ho's avatar
Nick Ho committed
605

606 607 608 609 610 611 612 613 614 615
        //config_INFO->extra_phy_parms.phy_config_dedicated = physicalConfigDedicated; //for the moment fapi not allow this so not used

        }
    }

    //Now trigger the phy_config_xxx for configuring PHY through the PHY_config_req
     AssertFatal(if_inst->PHY_config_req != NULL, "rrc_mac_config_req_eNB_NB_IoT: PHY_config_req pointer function is NULL\n");
    if(if_inst->PHY_config_req)
        if_inst->PHY_config_req(config_INFO);

616
    //return 0;
Nick Ho's avatar
Nick Ho committed
617

618 619
      init_mac_NB_IoT(mac_inst);

Nick Ho's avatar
Nick Ho committed
620

Nick Ho's avatar
Nick Ho committed
621
   /*if( ded_flag!=0 )
Nick Ho's avatar
Nick Ho committed
622
   {
Nick Ho's avatar
Nick Ho committed
623
    
Nick Ho's avatar
Nick Ho committed
624 625 626 627 628 629 630 631 632 633 634
    mac_config->npdcch_ConfigDedicated[0].R_max         =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[0].npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13;
    mac_config->npdcch_ConfigDedicated[1].R_max         =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[1].npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13;
    mac_config->npdcch_ConfigDedicated[2].R_max         =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[2].npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13;

    mac_config->npdcch_ConfigDedicated[0].G             =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[0].npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13;
    mac_config->npdcch_ConfigDedicated[1].G             =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[1].npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13;
    mac_config->npdcch_ConfigDedicated[2].G             =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[2].npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13;

    mac_config->npdcch_ConfigDedicated[0].a_offset      =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[0].npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13;
    mac_config->npdcch_ConfigDedicated[1].a_offset      =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[1].npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13;
    mac_config->npdcch_ConfigDedicated[2].a_offset      =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[2].npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13;
Nick Ho's avatar
Nick Ho committed
635
    
Nick Ho's avatar
Nick Ho committed
636 637
    // now we only have 3 UE list USS
    mac_config->npdcch_ConfigDedicated[ue_list_ded_num].R_max         =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[ue_list_ded_num].npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13;
638

Nick Ho's avatar
Nick Ho committed
639
    mac_config->npdcch_ConfigDedicated[ue_list_ded_num].G             =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[ue_list_ded_num].npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13;
640

Nick Ho's avatar
Nick Ho committed
641 642 643 644
    mac_config->npdcch_ConfigDedicated[ue_list_ded_num].a_offset      =DED_Config.radioResourceConfigDedicated_r13.physicalConfigDedicated_r13[ue_list_ded_num].npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13;
    }


Nick Ho's avatar
Nick Ho committed
645
    return 0;*/
Nick Ho's avatar
Nick Ho committed
646 647 648


}