Commit cc698b52 authored by AlanLi's avatar AlanLi

MIB/SIBs

parent cf44f391
...@@ -289,9 +289,12 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -289,9 +289,12 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
RB_IoT_ID); RB_IoT_ID);
} }
uint8_t *npbch_pdu = get_NB_IoT_MIB(); //uint8_t *npbch_pdu = get_NB_IoT_MIB();
uint8_t *sib1_pdu = get_NB_IoT_SIB1(); uint8_t *npbch_pdu = broadcast_str->pdu;
uint8_t *sib23_pdu = get_NB_IoT_SIB23(); //uint8_t *sib1_pdu = get_NB_IoT_SIB1();
uint8_t *sib1_pdu = sib1->pdu;
//uint8_t *sib23_pdu = get_NB_IoT_SIB23();
uint8_t *sib23_pdu = sib23->pdu;
if(subframe == 0) if(subframe == 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_bch_NB_IoT.c /*! \file eNB_scheduler_bch_NB_IoT.c
* \brief schedule functions for SIBs transmission in NB-IoT * \brief schedule functions for SIBs transmission in NB-IoT
* \author NTUST BMW Lab./Calvin HSU * \author NTUST BMW Lab./
* \date 2017 - 2018 * \date 2017
* \email: kai-hsiang.hsu@eurecom.fr * \email:
* \version 1.0 * \version 1.0
* *
*/ */
...@@ -30,7 +11,7 @@ ...@@ -30,7 +11,7 @@
#include "defs_NB_IoT.h" #include "defs_NB_IoT.h"
#include "proto_NB_IoT.h" #include "proto_NB_IoT.h"
#include "extern_NB_IoT.h" #include "extern_NB_IoT.h"
#include "openair2/RRC/LITE/proto_NB_IoT.h"
char str[6][7] = { "SIBs_1", "SIBs_2", "SIBs_3", "SIBs_4", "SIBs_5", "SIBs_6" }; char str[6][7] = { "SIBs_1", "SIBs_2", "SIBs_3", "SIBs_4", "SIBs_5", "SIBs_6" };
...@@ -46,6 +27,8 @@ void schedule_sibs(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t sibs_order, int start ...@@ -46,6 +27,8 @@ void schedule_sibs(eNB_MAC_INST_NB_IoT *mac_inst, uint32_t sibs_order, int start
schedule_result_t *new_node; schedule_result_t *new_node;
DCIFormatN1_t *sibs_dci; DCIFormatN1_t *sibs_dci;
uint32_t j, i, k; uint32_t j, i, k;
uint8_t SIB23_size = 0;
uint8_t *SIB23_pdu = get_NB_IoT_SIB23();
int residual_subframe, num_subframe, last_subframe; int residual_subframe, num_subframe, last_subframe;
num_subframe = mac_inst->rrc_config.sibs_NB_IoT_sched[sibs_order].si_tb; num_subframe = mac_inst->rrc_config.sibs_NB_IoT_sched[sibs_order].si_tb;
...@@ -96,9 +79,11 @@ LOG_D(MAC,"for1 k=%d j=%d i=%d rep=%d\n", k, j, i, si_repetition_pattern[mac_ins ...@@ -96,9 +79,11 @@ LOG_D(MAC,"for1 k=%d j=%d i=%d rep=%d\n", k, j, i, si_repetition_pattern[mac_ins
if((available_resource_DL_t *)0 != pt[k]){ if((available_resource_DL_t *)0 != pt[k]){
new_node = (schedule_result_t *)malloc(sizeof(schedule_result_t)); new_node = (schedule_result_t *)malloc(sizeof(schedule_result_t));
// fill new node // fill new node
SIB23_size = get_NB_IoT_SIB23_size();
new_node->output_subframe = first_subframe[k]; new_node->output_subframe = first_subframe[k];
new_node->end_subframe = (j==i)?last_subframe:j+9; new_node->end_subframe = (j==i)?last_subframe:j+9;
new_node->sdu_length = 0; new_node->sdu_length = SIB23_size;
new_node->DLSCH_pdu = SIB23_pdu;
new_node->direction = DL; new_node->direction = DL;
new_node->DCI_release = (j==i); new_node->DCI_release = (j==i);
new_node->channel = NPDSCH; new_node->channel = NPDSCH;
......
This diff is collapsed.
...@@ -6,26 +6,27 @@ ...@@ -6,26 +6,27 @@
// Sched_INFO as a input for the scheduler // Sched_INFO as a input for the scheduler
void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO) void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
{ {
// int i=0; int i=0;
uint32_t abs_subframe; uint32_t abs_subframe;
Sched_Rsp_NB_IoT_t *SCHED_info = &mac_inst->Sched_INFO;;
//UE_TEMPLATE_NB_IoT *UE_info; //UE_TEMPLATE_NB_IoT *UE_info;
/* Disable uplink RX function for now /* Disable uplink RX function for now
//If there is a preamble, do the initiate RA procedure //If there is a preamble, do the initiate RA procedure
if(UL_INFO->nrach_ind.number_of_initial_scs_detected>0) if(UL_INFO->NRACH.number_of_initial_scs_detected>0)
{ {
for(i=0;i<UL_INFO->nrach_ind.number_of_initial_scs_detected;i++) for(i=0;i<UL_INFO->NRACH.number_of_initial_scs_detected;i++)
{ {
// initiate_ra here, some useful inforamtion : // initiate_ra here, some useful inforamtion :
//(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc //(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc
//(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance //(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance
init_RA_NB_IoT(mac_inst, init_RA_NB_IoT(mac_inst,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc, (UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.nrach_ce_level, (UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.nrach_ce_level,
UL_INFO->frame, UL_INFO->frame,
//timing_offset = Timing_advance * 16 //timing_offset = Timing_advance * 16
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance*16 (UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance*16
); );
...@@ -68,99 +69,25 @@ void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO) ...@@ -68,99 +69,25 @@ void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
} }
*/ */
//LOG_I(MAC,"IF L2 frame: %d ,subframe: %d \n",UL_INFO->frame,UL_INFO->subframe);
abs_subframe = UL_INFO->frame*10+UL_INFO->subframe; abs_subframe = UL_INFO->frame*10+UL_INFO->subframe +4;
//LOG_I(MAC,"Enter scheduler in subframe %d\n",abs_subframe); //LOG_I(MAC,"Enter scheduler in subframe %d\n",abs_subframe);
//scheduler here //scheduler here
//Schedule subframe should be next four subframe, means that UL_INFO->frame*10+UL_INFO->subframe + 4 //Schedule subframe should be next four subframe, means that UL_INFO->frame*10+UL_INFO->subframe + 4
eNB_dlsch_ulsch_scheduler_NB_IoT(mac_inst,abs_subframe);
}
///////////////////////////////////////////////////////////////////////////////
////////////////////////////// backup ////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Sched_INFO as a input for the scheduler
/// void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
/// {
// int i=0;
/// uint32_t abs_subframe;
//UE_TEMPLATE_NB_IoT *UE_info;
/* Disable uplink RX function for now
//If there is a preamble, do the initiate RA procedure
if(UL_INFO->nrach_ind.number_of_initial_scs_detected>0)
{
for(i=0;i<UL_INFO->nrach_ind.number_of_initial_scs_detected;i++)
{
// initiate_ra here, some useful inforamtion :
//(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc
//(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance
init_RA_NB_IoT(mac_inst,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.nrach_ce_level,
UL_INFO->frame,
//timing_offset = Timing_advance * 16
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance*16
);
}
}
// crc indication if there is error for this round UL transmission
if(UL_INFO->crc_ind.number_of_crcs>0)
{
for(i=0;i<UL_INFO->crc_ind.number_of_crcs;i++)
{
if((UL_INFO->crc_ind.crc_pdu_list+i)->crc_indication_rel8.crc_flag == 0)
{
//unsuccessfully received this UE PDU
//UE_info = get_ue_from_rnti(mac_inst,((UL_INFO->crc_ind.crc_pdu_list)+i)->rx_ue_information.rnti);
//UE_info->HARQ_round++;
}
}
}
//If there is a Uplink SDU which needs to send to MAC
if(UL_INFO->RX_NPUSCH.number_of_pdus>0)
{
for(i=0;i<UL_INFO->RX_NPUSCH.number_of_pdus;i++)
{
//For MSG3, Normal Uplink Data, NAK
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
);
}
}
eNB_dlsch_ulsch_scheduler_NB_IoT(mac_inst,abs_subframe);
mac_inst->if_inst_NB_IoT->schedule_response(&mac_inst->Sched_INFO);
/*
free(SCHED_info->TX_req->tx_request_body.tx_pdu_list);
free(SCHED_info->HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list);
free(SCHED_info->DL_req->dl_config_request_body.dl_config_pdu_list);
free(SCHED_info->UL_req->ul_config_request_body.ul_config_pdu_list);
free(SCHED_info->TX_req);
free(SCHED_info->HI_DCI0_req);
free(SCHED_info->DL_req);
free(SCHED_info->UL_req);
*/ */
}
/// abs_subframe = UL_INFO->frame*10+UL_INFO->subframe; \ No newline at end of file
//LOG_I(MAC,"Enter scheduler in subframe %d\n",abs_subframe);
//scheduler here
//Schedule subframe should be next four subframe, means that UL_INFO->frame*10+UL_INFO->subframe + 4
/// eNB_dlsch_ulsch_scheduler_NB_IoT(mac_inst,abs_subframe);
/// }
///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////
\ No newline at end of file
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