Commit 270e0067 authored by Nick Ho's avatar Nick Ho

Add brief description for each added files

parent 1dc1db41
/*! \file config_NB_IoT.c
* \brief configuration primitives between RRC and MAC
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
#include "LAYER2/MAC/defs_NB_IoT.h"
#include "LAYER2/MAC/proto_NB_IoT.h"
#include "LAYER2/MAC/extern_NB_IoT.h"
......
/*! \file config_NB_IoT.h
* \brief configured structures used by scheduler
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
#ifndef _CONFIG_H_
#define _CONFIG_H_
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
/*! \file defs_NB_IoT.c
* \brief MAC layer structures
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file LAYER2/MAC/defs.h
* \brief MAC data structures, constant, and function prototype
* \author Navid Nikaein and Raymond Knopp
* \date 2011
* \version 0.5
* \email navid.nikaein@eurecom.fr
*/
/** @defgroup _oai2 openair2 Reference Implementation
* @ingroup _ref_implementation_
* @{
*/
/*@}*/
#ifndef __LAYER2_MAC_DEFS_NB_IOT_H__
#define __LAYER2_MAC_DEFS_NB_IOT_H__
#ifdef USER_MODE
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file eNB_scheduler_nb_iot.c
/*! \file eNB_scheduler_NB_IoT.c
* \brief top level of the scheduler, it scheduled in pdcch period based.
* \author
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 0.5
* @ingroup _mac
* \version 1.0
*
*/
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file eNB_scheduler_RA_NB_IoT.c
* \brief primitives used for random access
* \author TaiwanTech
* \date 2017
* \brief functions used in Random access scheduling
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
* @ingroup _mac
*
*/
#include "defs_NB_IoT.h"
......
// function for schedule SI
/*! \file eNB_scheduler_bch_NB_IoT.c
* \brief schedule functions for SIBs transmission in NB-IoT
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
#include "defs_NB_IoT.h"
#include "proto_NB_IoT.h"
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file eNB_scheduler_dlsch_NB_IoT.c
* \brief procedures related to eNB for the DLSCH transport channel
* \author TaiwanTech
* \brief handle DL UE-specific scheduling
* \author NTUST BMW Lab./
* \date 2017
* \email: navid.nikaein@eurecom.fr
* \email:
* \version 1.0
* @ingroup _mac
*
*/
#include "defs_NB_IoT.h"
......
/*! \file eNB_scheduler_ulsch.c
* \brief eNB procedures for the ULSCH transport channel
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \email: navid.nikaein@eurecom.fr
* \version 1.0
* @ingroup _mac
/*! \file eNB_scheduler_ulsch_NB_IoT.c
* \brief handle UL UE-specific scheduling
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
#include "defs_NB_IoT.h"
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
/*! \file extern_NB_IoT.h
* \brief MAC extern
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file extern.h
* \brief mac externs
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \version 1.0
* \email navid.nikaein@eurecom.fr
* @ingroup _mac
*/
#ifndef __MAC_EXTERN_NB_IOT_H__
#define __MAC_EXTERN_NB_IOT_H__
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file main_nb_iot.c
/*! \file main_NB_IoT.c
* \brief top init of Layer 2
* \author
* \author NTUST BMW LAB./
* \date 2017
* \version 1.0
* \email:
* @ingroup _mac
*/
......
/*! \file output_handler_NB_IoT.c
* \brief Convert MAC scheduler result and output the FAPI structure by subframe based
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
#include "defs_NB_IoT.h"
#include "proto_NB_IoT.h"
#include "extern_NB_IoT.h"
int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_id, uint32_t hypersfn, uint32_t frame, uint32_t subframe, uint8_t MIB_flag, uint8_t SIB1_flag, uint32_t current_time)
{
//if(schedule_result_list_UL != (schedule_result_t *)0){
// printf("time %d\n", mac_inst->current_subframe);
// print_schedule_result_DL(); print_schedule_result_UL(); getchar();
//}
// MIB SIB1 PDU command here
uint8_t MIB_size = 0;
uint8_t SIB1_size = 0, i = 0;
Sched_Rsp_t *SCHED_info = (Sched_Rsp_t*) malloc(sizeof(Sched_Rsp_t));
nfapi_dl_config_request_pdu_t *dl_config_pdu;
nfapi_hi_dci0_request_pdu_t* hi_dci0_pdu;
nfapi_ul_config_request_pdu_t* ul_config_pdu;
schedule_result_t *tmp;
int DL_empty = 0, UL_empty = 0;
//uint32_t current_time = 0;
//current_time = hypersfn * 10240 + frame * 10 + subframe;
// filled common part of schedule_resoponse
SCHED_info->module_id = module_id;
SCHED_info->hypersfn = hypersfn;
SCHED_info->frame = frame;
SCHED_info->subframe = subframe;
void *DCI_pdu;
SCHED_info->TX_req = (nfapi_tx_request_t *) malloc (sizeof(nfapi_tx_request_t));
SCHED_info->DL_req = (nfapi_dl_config_request_t*) malloc (sizeof(nfapi_dl_config_request_t));
SCHED_info->DL_req->dl_config_request_body.dl_config_pdu_list = (nfapi_dl_config_request_pdu_t*)malloc(sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu = SCHED_info->DL_req->dl_config_request_body.dl_config_pdu_list;
//printf("first DL node output: %d current: %d\n",schedule_result_list_DL->output_subframe,current_time);
//printf("test current: %d\n",current_time);
if(MIB_flag == 1)
{
//printf("[%d]MIB\n",current_time);
//MIB_size = mac_rrc_data_req_eNB_NB_IoT(*MIB)
SCHED_info->DL_req->dl_config_request_body.number_pdu = 1;
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_NBCH_PDU_TYPE;
dl_config_pdu->pdu_size = 2+sizeof(nfapi_dl_config_nbch_pdu_rel13_t);
dl_config_pdu->nbch_pdu.nbch_pdu_rel13.length = MIB_size;
dl_config_pdu->nbch_pdu.nbch_pdu_rel13.pdu_index = 1;
dl_config_pdu->nbch_pdu.nbch_pdu_rel13.transmission_power = 6000;
// fill MIB PDU
//SCHED_info->TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->NB_IoTch_pdu.NB_IoTch_pdu_rel13.pdu_index].segments[0].segment_data = MIB;
//dl_scheduled(mac_inst->current_subframe, _NPBCH, 0, "MIB");
}
else if(SIB1_flag == 1)
{
//SIB1_size = mac_rrc_data_req_eNB_NB_IoT(*SIB1);
SCHED_info->DL_req->dl_config_request_body.number_pdu = 1;
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE;
dl_config_pdu->pdu_size = 2+sizeof(nfapi_dl_config_ndlsch_pdu_rel13_t);
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.length = SIB1_size;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.pdu_index = 1;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti_type = 0;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti = 0xFFFF; // SI-rnti
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.modulation = 2;
//SCHED_info->TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.pdu_index].segments[0].segment_data = SIB1;
//start symbol, Resource assignment, Repetition number, Number of subframe Resource assignment lost for now
//dl_scheduled(mac_inst->current_subframe, _NPDSCH, SI_RNTI, "SIB1");
}
else if(schedule_result_list_DL==NULL)
{
DL_empty = 1;
//printf("no remaining node of DL scheduling result\n");
}else
{
if(schedule_result_list_DL->output_subframe < current_time)
{
while(schedule_result_list_DL->output_subframe < current_time)
{
//printf("This error if there is DL scheduling result node before the current time\n");
tmp = schedule_result_list_DL;
schedule_result_list_DL = schedule_result_list_DL->next;
free(tmp);
//printf("test2 current: %d\n",current_time);
//break;
if(schedule_result_list_DL == NULL){
return -1;
}
}
//printf("return\n");
//return -1;
}
else if (schedule_result_list_DL->output_subframe == current_time)
{
switch(schedule_result_list_DL->channel)
{
case NPDCCH:
if(schedule_result_list_DL->direction == DL)
{
//printf("Sched Info DL DCI here\n");
SCHED_info->DL_req->dl_config_request_body.number_dci = 1;
DCI_pdu = schedule_result_list_DL->DCI_pdu;
// not consider the case transmitting 2 DCIs for the moment also not consider N2 now
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_NPDCCH_PDU_TYPE;
dl_config_pdu->pdu_size = 2+sizeof(nfapi_dl_config_npdcch_pdu_rel13_t);
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.length = schedule_result_list_DL->sdu_length;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.pdu_index = 1;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.ncce_index = 0;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.aggregation_level = 1;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti_type = schedule_result_list_DL->rnti_type; // 3 = UE-specific RNTI TODO: add RNTI type in scheduling result
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti = schedule_result_list_DL->rnti;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_format = 0; // N1
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.scheduling_delay = ((DCIFormatN1_t *)DCI_pdu)->Scheddly;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.resource_assignment = ((DCIFormatN1_t *)DCI_pdu)->ResAssign;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.repetition_number = ((DCIFormatN1_t *)DCI_pdu)->RepNum;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.mcs = ((DCIFormatN1_t *)DCI_pdu)->mcs;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.new_data_indicator = ((DCIFormatN1_t *)DCI_pdu)->ndi;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource = ((DCIFormatN1_t *)DCI_pdu)->HARQackRes;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.npdcch_order_indication = ((DCIFormatN1_t *)DCI_pdu)->orderIndicator;
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number = ((DCIFormatN1_t *)DCI_pdu)->DCIRep;
}else if(schedule_result_list_DL->direction == UL)
{
SCHED_info->HI_DCI0_req = (nfapi_hi_dci0_request_t*)malloc(sizeof(nfapi_hi_dci0_request_t));
SCHED_info->HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list = (nfapi_hi_dci0_request_pdu_t*)malloc(sizeof(nfapi_hi_dci0_request_pdu_t));
hi_dci0_pdu = SCHED_info->HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list;
DCI_pdu = schedule_result_list_DL-> DCI_pdu;
SCHED_info-> HI_DCI0_req->hi_dci0_request_body.number_of_dci =1;
hi_dci0_pdu->pdu_type = NFAPI_HI_DCI0_NPDCCH_DCI_PDU_TYPE;
hi_dci0_pdu->pdu_size = 2 + sizeof(nfapi_hi_dci0_npdcch_dci_pdu_rel13_t);
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.ncce_index = 0;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.aggregation_level = 1;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.rnti = schedule_result_list_DL->rnti;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.subcarrier_indication = ((DCIFormatN0_t *)DCI_pdu)->scind;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.resource_assignment = ((DCIFormatN0_t *)DCI_pdu)->ResAssign;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.scheduling_delay = ((DCIFormatN0_t *)DCI_pdu)->Scheddly;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.mcs = ((DCIFormatN0_t *)DCI_pdu)->mcs;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.redudancy_version = ((DCIFormatN0_t *)DCI_pdu)->rv;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.repetition_number = ((DCIFormatN0_t *)DCI_pdu)->RepNum;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.new_data_indicator = ((DCIFormatN0_t *)DCI_pdu)->ndi;
hi_dci0_pdu->npdcch_dci_pdu.npdcch_dci_pdu_rel13.dci_subframe_repetition_number = ((DCIFormatN0_t *)DCI_pdu)->DCIRep;
}
break;
case NPDSCH:
DCI_pdu = schedule_result_list_DL-> DCI_pdu;
SCHED_info->DL_req->dl_config_request_body.number_pdu = 1;
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE;
dl_config_pdu->pdu_size = 2+sizeof(nfapi_dl_config_ndlsch_pdu_rel13_t);
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.length = schedule_result_list_DL->sdu_length;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.pdu_index = 1;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti_type = 1;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti = schedule_result_list_DL->rnti; // C-RNTI
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.resource_assignment = ((DCIFormatN1_t *)DCI_pdu)->ResAssign;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.repetition_number = ((DCIFormatN1_t *)DCI_pdu)->RepNum;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.modulation = 2;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.number_of_subframes_for_resource_assignment = get_num_sf(dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.resource_assignment);
//SCHED_info->TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.pdu_index].segments[0].segment_data = schedule_result_list_DL->DLSCH_pdu;
break;
default:
break;
}
if(schedule_result_list_DL->DCI_release == 1)
free(schedule_result_list_DL->DCI_pdu);
tmp = schedule_result_list_DL;
schedule_result_list_DL = schedule_result_list_DL->next;
//printf("subframe check scheduling result next %d\n",schedule_result_list_DL->output_subframe);
}
}
//printf("There is no downlink transmission\n");
if(schedule_result_list_UL==NULL)
{
UL_empty = 1;
//printf("no remaining node of UL scheduling result\n");
}else
{
if(schedule_result_list_UL->output_subframe < current_time)
{
while(schedule_result_list_UL->output_subframe < current_time)
{
//printf("This error if there is UL scheduling result node before the current time\n");
tmp = schedule_result_list_UL;
schedule_result_list_UL = schedule_result_list_UL->next;
free(tmp);
return -1;
}
//printf("return\n");
//return -1;
}
else if(schedule_result_list_UL->output_subframe == current_time)
{
SCHED_info->UL_req = (nfapi_ul_config_request_t *)malloc(sizeof(nfapi_ul_config_request_t));
SCHED_info->UL_req->ul_config_request_body.number_of_pdus = 0;
SCHED_info->UL_req->ul_config_request_body.ul_config_pdu_list = (nfapi_ul_config_request_pdu_t *)malloc(5 * sizeof(nfapi_ul_config_request_pdu_t));
ul_config_pdu = SCHED_info->UL_req->ul_config_request_body.ul_config_pdu_list;
}
while(schedule_result_list_UL->output_subframe == current_time)
{
if(schedule_result_list_UL->channel == NPUSCH)
{
printf("first UL \n");
SCHED_info->UL_req->ul_config_request_body.number_of_pdus ++;
//SCHED_info->UL_req.sfn_sf = ;
(ul_config_pdu + i) ->pdu_type = NFAPI_UL_CONFIG_NULSCH_PDU_TYPE;
(ul_config_pdu + i) ->pdu_size = 2 + sizeof(nfapi_ul_config_nulsch_pdu_rel13_t);
if(schedule_result_list_UL->npusch_format == 0)
{
DCI_pdu = schedule_result_list_UL->DCI_pdu;
// bug here
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.nulsch_format = 0;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table[((DCIFormatN0_t *)DCI_pdu)->mcs][((DCIFormatN0_t *)DCI)->ResAssign];
//printf("test\n");
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.rnti = schedule_result_list_UL->rnti;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.subcarrier_indication = ((DCIFormatN0_t *)DCI_pdu)->scind;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.resource_assignment = ((DCIFormatN0_t *)DCI_pdu)->ResAssign;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.mcs = ((DCIFormatN0_t *)DCI_pdu)->mcs;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.redudancy_version = ((DCIFormatN0_t *)DCI_pdu)->rv;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.repetition_number = ((DCIFormatN0_t *)DCI_pdu)->RepNum;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.new_data_indication = ((DCIFormatN0_t *)DCI_pdu)->ndi;
}else if(schedule_result_list_UL->npusch_format == 1)
{
DCI_pdu = schedule_result_list_UL->DCI_pdu;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.nulsch_format = 1;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.rnti = schedule_result_list_UL->rnti;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.ue_information.ue_information_rel13.total_number_of_repetitions = schedule_result_list_UL->R_harq;
//for ACK /NACK
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource = ((DCIFormatN1_t *)DCI_pdu)->HARQackRes;
}
//print_scheduling_result_UL();
if(schedule_result_list_UL->DCI_release == 1){
free(schedule_result_list_UL->DCI_pdu);
}
tmp = schedule_result_list_UL;
schedule_result_list_UL = schedule_result_list_UL->next;
free(tmp);
i++;
if(schedule_result_list_UL == NULL)
break;
}else{
printf("error");
}
}
}
if(DL_empty == 1 )
{
//printf("[hypersfn:%2d][frame:%2d][subframe:%2d]No remaining DL result\n",hypersfn,frame,subframe);
}
if(UL_empty == 1)
{
//printf("[hypersfn:%2d][frame:%2d][subframe:%2d]no remaining UL result\n",hypersfn,frame,subframe);
}
//printf("[hypersfn:%2d][frame:%2d][subframe:%2d]filling the schedule response successfully\n",hypersfn,frame,subframe);
return 0;
}
/*! \file schedule_tool_NB_IoT.c
* \brief scheduler helper function
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
#include "defs_NB_IoT.h"
#include "proto_NB_IoT.h"
#include "extern_NB_IoT.h"
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
/*! \file vars_NB_IoT.h
* \brief declare the MAC global variables
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file vars.h
* \brief mac vars
* \author Navid Nikaein and Raymond Knopp
* \date 2010 - 2014
* \version 1.0
* \email navid.nikaein@eurecom.fr
* @ingroup _mac
*/
#ifndef __MAC_VARS_NB_IOT_H__
#define __MAC_VARS_NB_IOT_H__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment