IF_Module_L2_primitives_NB_IoT.c 1.89 KB
Newer Older
1
#include "IF_Module_L2_primitives_NB_IoT.h"
2

Nick Ho's avatar
Nick Ho committed
3 4
// Sched_INFO as a input for the scheduler
void UL_indication(UL_IND_t *UL_INFO)
5 6
{
    int i=0;
7 8

      /*If there is a preamble, do the initiate RA procedure*/
Nick Ho's avatar
Nick Ho committed
9
      if(UL_INFO->NRACH.number_of_initial_scs_detected>0)
10
        {
Nick Ho's avatar
Nick Ho committed
11
          for(i=0;i<UL_INFO->NRACH.number_of_initial_scs_detected;i++)
12
            {
13 14 15 16 17 18 19 20
              initiate_ra_proc_NB_IoT(UL_INFO->module_id,
                                      UL_INFO->CC_id,
                                      UL_INFO->frame,
                                      (UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
                                      //timing_offset = Timing_advance * 16
                                      (UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance * 16,
                                      UL_INFO->subframe
                                     );
21
            }
22
        }
Nick Ho's avatar
Nick Ho committed
23
        if(UL_INFO->RX_NPUSCH.number_of_pdus>0)
24 25
          {
            /*If there is a Uplink SDU (even MSG3, NAK) need to send to MAC*/
Nick Ho's avatar
Nick Ho committed
26
            for(i=0;i<UL_INFO->RX_NPUSCH.number_of_pdus;i++)
27
              {
28
                /*For MSG3, Normal Uplink Data, NAK*/
29 30 31 32 33 34 35 36 37
                rx_sdu_NB_IoT(UL_INFO->module_id,
                              UL_INFO->CC_id,
                              UL_INFO->frame,
                              UL_INFO->subframe,
                              (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.rnti,
                              (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->data,
                              (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_indication_rel8.length,
                              (UL_INFO->RX_NPUSCH.rx_pdu_list+i)->rx_ue_information.harq_pid
                              );
38 39 40


              }
41 42

          }
43

44
    //eNB_dlsch_ulsch_scheduler_NB_IoT(UL_INFO.module_id,0,UL_INFO.frame,UL_INFO.subframe); TODO: to be implemented
45
}