Commit 0dbd5a61 authored by Matthieu Kanj's avatar Matthieu Kanj

NPDCCH bug fix

parent 58b9481c
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file PHY/LTE_TRANSPORT/dci.c /*! \file PHY/LTE_TRANSPORT/dci_NB_IoT.c
* \brief Implements PDCCH physical channel TX/RX procedures (36.211) and DCI encoding/decoding (36.212/36.213). Current LTE compliance V8.6 2009-03. * \brief Implements PDCCH physical channel TX/RX procedures (36.211) and DCI encoding/decoding (36.212/36.213). Current LTE compliance V8.6 2009-03.
* \author R. Knopp * \author R. Knopp
* \date 2011 * \date 2011
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
* \note * \note
* \warning * \warning
*/ */
#ifdef USER_MODE #ifdef USER_MODE
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -45,10 +46,8 @@ ...@@ -45,10 +46,8 @@
/////////////////////////////#include "SCHED/defs_nb_iot.h" /////////////////////////////#include "SCHED/defs_nb_iot.h"
//#include "SIMULATION/TOOLS/defs.h" // for taus //#include "SIMULATION/TOOLS/defs.h" // for taus
//#include "PHY/sse_intrin.h" //#include "PHY/sse_intrin.h"
//#include "assertions.h" //#include "assertions.h"
//#include "T.h" //#include "T.h"
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
//static uint8_t d[2][3*(MAX_DCI_SIZE_BITS_NB_IoT + 16) + 96]; //static uint8_t d[2][3*(MAX_DCI_SIZE_BITS_NB_IoT + 16) + 96];
...@@ -66,17 +65,17 @@ void dci_encoding_NB_IoT(uint8_t *a, // Array of tw ...@@ -66,17 +65,17 @@ void dci_encoding_NB_IoT(uint8_t *a, // Array of tw
uint32_t RCC; uint32_t RCC;
uint8_t occupation_size=1; uint8_t occupation_size=1;
if(agr_level == 2 && ncce_index == 1) if(agr_level == 2 && ncce_index == 0)
{ {
occupation_size=1; occupation_size=1;
}else{ }else{
occupation_size=2; occupation_size=2;
} }
memset((void *)dlcch->npdcch_d[ncce_index-1],LTE_NULL_NB_IoT,96); memset((void *)dlcch->npdcch_d[ncce_index],LTE_NULL_NB_IoT,96);
ccode_encode_NB_IoT(A,2,a,dlcch->npdcch_d[ncce_index-1]+96,rnti); // CRC attachement & Tail-biting convolutional coding ccode_encode_NB_IoT(A,2,a,dlcch->npdcch_d[ncce_index]+96,rnti); // CRC attachement & Tail-biting convolutional coding
RCC = sub_block_interleaving_cc_NB_IoT(D,dlcch->npdcch_d[ncce_index-1]+96,dlcch->npdcch_w[ncce_index-1]); // Interleaving RCC = sub_block_interleaving_cc_NB_IoT(D,dlcch->npdcch_d[ncce_index]+96,dlcch->npdcch_w[ncce_index]); // Interleaving
lte_rate_matching_cc_NB_IoT(RCC,(G/occupation_size),dlcch->npdcch_w[ncce_index-1],dlcch->npdcch_e[ncce_index-1]); // Rate Matching lte_rate_matching_cc_NB_IoT(RCC,(G/occupation_size),dlcch->npdcch_w[ncce_index],dlcch->npdcch_e[ncce_index]); // Rate Matching
} }
...@@ -98,7 +97,7 @@ void npdcch_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -98,7 +97,7 @@ void npdcch_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
reset = 1; reset = 1;
if(agr_level == 2 && ncce_index == 1) if(agr_level == 2 && ncce_index == 0)
{ {
occupation_size=1; occupation_size=1;
}else{ }else{
...@@ -112,9 +111,8 @@ void npdcch_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -112,9 +111,8 @@ void npdcch_scrambling_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
s = lte_gold_generic_NB_IoT(&x1, &x2, reset); s = lte_gold_generic_NB_IoT(&x1, &x2, reset);
reset = 0; reset = 0;
} }
dlcch->npdcch_e[ncce_index-1][i] = (dlcch->npdcch_e[ncce_index-1][i]&1) ^ ((s>>(i&0x1f))&1); dlcch->npdcch_e[ncce_index][i] = (dlcch->npdcch_e[ncce_index][i]&1) ^ ((s>>(i&0x1f))&1);
} }
} }
...@@ -146,7 +144,7 @@ int dci_allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -146,7 +144,7 @@ int dci_allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
last_re = 12; last_re = 12;
if(ncce_index == 1 && agr_level == 2) if(ncce_index == 0 && agr_level == 2)
{ {
for (re=first_re; re<last_re; re++) { // re varies between 0 and 12 sub-carriers for (re=first_re; re<last_re; re++) { // re varies between 0 and 12 sub-carriers
...@@ -213,7 +211,7 @@ int dci_allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -213,7 +211,7 @@ int dci_allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
} else if(agr_level == 1) { } else if(agr_level == 1) {
for (re=(first_re + (ncce_index/2)*6); re<(6+((ncce_index/2)*6)); re++) { // re varies between 0 and 6 or 6 and 12 sub-carriers for (re=(first_re + ncce_index*6); re<(6 + ncce_index*6); re++) { // re varies between 0 and 6 or 6 and 12 sub-carriers
tti_offset = symbol_offset + re; // symbol_offset = 512 * L , re_offset = 512 - 3*12 , re tti_offset = symbol_offset + re; // symbol_offset = 512 * L , re_offset = 512 - 3*12 , re
...@@ -353,7 +351,7 @@ int dci_modulation_NB_IoT(int32_t **txdataF, ...@@ -353,7 +351,7 @@ int dci_modulation_NB_IoT(int32_t **txdataF,
txdataF, txdataF,
&jj, &jj,
symbol_offset, symbol_offset,
&dlcch->npdcch_e[ncce_index-1], &dlcch->npdcch_e[ncce_index],
pilots, pilots,
pilot_shift, pilot_shift,
amp, amp,
......
...@@ -80,64 +80,6 @@ ...@@ -80,64 +80,6 @@
// //
//// to be created LTE_eNB_DLSCH_t --> is duplicated for each number of UE and then indexed in the table //// to be created LTE_eNB_DLSCH_t --> is duplicated for each number of UE and then indexed in the table
// //
//typedef struct { // LTE_DL_eNB_HARQ_t
// /// Status Flag indicating for this DLSCH (idle,active,disabled)
// SCH_status_t status;
// /// Transport block size
// uint32_t TBS;
// /// The payload + CRC size in bits, "B" from 36-212
// uint32_t B; // keep this parameter
// /// Pointer to the payload
// uint8_t *b; // keep this parameter
// /// Pointers to transport block segments
// //uint8_t *c[MAX_NUM_DLSCH_SEGMENTS];
// /// RTC values for each segment (for definition see 36-212 V8.6 2009-03, p.15)
// // uint32_t RTC[MAX_NUM_DLSCH_SEGMENTS];
// /// Frame where current HARQ round was sent
// uint32_t frame;
// /// Subframe where current HARQ round was sent
// uint32_t subframe;
// /// Index of current HARQ round for this DLSCH
// uint8_t round;
// /// MCS format for this DLSCH
// uint8_t mcs;
// /// Redundancy-version of the current sub-frame
// uint8_t rvidx;
// /// MIMO mode for this DLSCH
// MIMO_mode_t mimo_mode;
// /// Current RB allocation
// uint32_t rb_alloc[4];
// /// distributed/localized flag
// vrb_t vrb_type;
// /// Current subband PMI allocation
// uint16_t pmi_alloc;
// /// Current subband RI allocation
// uint32_t ri_alloc;
// /// Current subband CQI1 allocation
// uint32_t cqi_alloc1;
// /// Current subband CQI2 allocation
// uint32_t cqi_alloc2;
// /// Current Number of RBs
// uint16_t nb_rb;
// /// downlink power offset field
// uint8_t dl_power_off;
// /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
// uint8_t e[MAX_NUM_CHANNEL_BITS_NB_IOT];
// /// data after scrambling
// uint8_t s_e[MAX_NUM_CHANNEL_BITS_NB_IOT];
// /// length of the table e
// uint16_t length_e // new parameter
// /// Tail-biting convolutional coding outputs
// uint8_t d[96+(3*(24+MAX_DL_SIZE_BITS_NB_IOT))]; // new parameter
// /// Sub-block interleaver outputs
// uint8_t w[3*3*(MAX_DL_SIZE_BITS_NB_IOT+24)]; // new parameter
// /// Number of MIMO layers (streams) (for definition see 36-212 V8.6 2009-03, p.17, TM3-4)
// uint8_t Nl;
// /// Number of layers for this PDSCH transmission (TM8-10)
// uint8_t Nlayers;
// /// First layer for this PSCH transmission
// uint8_t first_layer;
//} NB_IoT_DL_eNB_HARQ_t;
typedef enum { typedef enum {
...@@ -149,79 +91,6 @@ typedef enum { ...@@ -149,79 +91,6 @@ typedef enum {
} SCH_status_NB_IoT_t; } SCH_status_NB_IoT_t;
typedef struct {
uint16_t si_rnti;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
/// data after scrambling
uint8_t s_e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
//length of the table e
uint16_t length_e; // new parameter
/// Tail-biting convolutional coding outputs
uint8_t d[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter
/// Sub-block interleaver outputs
uint8_t w[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter
/// Status Flag indicating for this DLSCH (idle,active,disabled)
//SCH_status_t status;
/// Transport block size
uint32_t TBS;
/// The payload + CRC size in bits, "B" from 36-212
uint32_t B;
/// Pointer to the payload
uint8_t *b;
///pdu of the ndlsch message
uint8_t *pdu;
/// Frame where current HARQ round was sent
uint32_t frame;
/// Subframe where current HARQ round was sent
uint32_t subframe;
uint8_t pdu_buffer_index;
} NB_IoT_DL_eNB_SIB_t;
typedef struct {
uint16_t si_rnti;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
/// data after scrambling
uint8_t s_e[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
//length of the table e
uint16_t length_e; // new parameter
/// Tail-biting convolutional coding outputs
uint8_t d[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter
/// Sub-block interleaver outputs
uint8_t w[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter
/////////////////////////////////
uint16_t si_rnti_x;
/// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18)
uint8_t e_x[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
/// data after scrambling
uint8_t s_e_x[MAX_NUM_DL_CHANNEL_BITS_NB_IoT];
//length of the table e
uint16_t length_e_x; // new parameter
/// Tail-biting convolutional coding outputs
uint8_t d_x[96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))]; // new parameter
/// Sub-block interleaver outputs
uint8_t w_x[3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24)]; // new parameter
////////////////////////////////
/// Status Flag indicating for this DLSCH (idle,active,disabled)
//SCH_status_t status;
/// Transport block size
uint32_t TBS;
/// The payload + CRC size in bits, "B" from 36-212
uint32_t B;
/// Pointer to the payload
uint8_t *b;
///pdu of the ndlsch message
uint8_t *pdu;
/// Frame where current HARQ round was sent
uint32_t frame;
/// Subframe where current HARQ round was sent
uint32_t subframe;
uint8_t pdu_buffer_index;
} NB_IoT_DL_eNB_RAR_t;
typedef struct { typedef struct {
/// NB-IoT /// NB-IoT
SCH_status_NB_IoT_t status; SCH_status_NB_IoT_t status;
...@@ -272,58 +141,6 @@ typedef struct { ...@@ -272,58 +141,6 @@ typedef struct {
} NB_IoT_DL_eNB_HARQ_t; } NB_IoT_DL_eNB_HARQ_t;
/*
typedef struct { // LTE_eNB_DLSCH_t
/// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding)
uint32_t *txdataF[8];
/// Allocated RNTI (0 means DLSCH_t is not currently used)
uint16_t rnti;
/// Active flag for baseband transmitter processing
uint8_t active;
/// Indicator of TX activation per subframe. Used during PUCCH detection for ACK/NAK.
uint8_t subframe_tx[10];
/// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK.
uint8_t nCCE[10];
/// Current HARQ process id
uint8_t current_harq_pid;
/// Process ID's per subframe. Used to associate received ACKs on PUSCH/PUCCH to DLSCH harq process ids
uint8_t harq_ids[10];
/// Window size (in outgoing transport blocks) for fine-grain rate adaptation
uint8_t ra_window_size;
/// First-round error threshold for fine-grain rate adaptation
uint8_t error_threshold;
/// Pointers to 8 HARQ processes for the DLSCH
NB_IoT_DL_eNB_HARQ_t harq_process2;
NB_IoT_DL_eNB_SIB1_t harq_process;
/// circular list of free harq PIDs (the oldest come first)
/// (10 is arbitrary value, must be > to max number of DL HARQ processes in LTE)
int harq_pid_freelist[10];
/// the head position of the free list (if list is free then head=tail)
int head_freelist;
/// the tail position of the free list
int tail_freelist;
/// Number of soft channel bits
uint32_t G;
/// Codebook index for this dlsch (0,1,2,3)
uint8_t codebook_index;
/// Maximum number of HARQ processes (for definition see 36-212 V8.6 2009-03, p.17)
uint8_t Mdlharq;
/// Maximum number of HARQ rounds
uint8_t Mlimit;
/// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
uint8_t Kmimo;
/// Nsoft parameter related to UE Category
uint32_t Nsoft;
/// amplitude of PDSCH (compared to RS) in symbols without pilots
int16_t sqrt_rho_a;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
int16_t sqrt_rho_b;
} NB_IoT_eNB_DLSCH_t;
*/
typedef struct { typedef struct {
/// HARQ process id /// HARQ process id
uint8_t harq_id; uint8_t harq_id;
...@@ -608,13 +425,6 @@ typedef struct { ...@@ -608,13 +425,6 @@ typedef struct {
SCH_status_NB_IoT_t status; SCH_status_NB_IoT_t status;
/* //////////////////////////////////////////////////////////////////////
NB_IoT_DL_eNB_SIB_t content_sib1;
NB_IoT_DL_eNB_SIB_t content_sib23;
NB_IoT_DL_eNB_RAR_t content_rar;
*/ //////////////////////////////////////////////////////////////////////
/// Number of soft channel bits /// Number of soft channel bits
uint32_t G; uint32_t G;
......
/*
* 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 IF_Module_L1_primitives_NB_IoT.c
* \brief handling nfapi
* \author NTUST BMW Lab./
* \date 2017
* \email:
* \version 1.0
*
*/
#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h" #include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
...@@ -230,7 +259,7 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO) ...@@ -230,7 +259,7 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO)
nfapi_ul_config_request_pdu_t *ul_config_pdu; nfapi_ul_config_request_pdu_t *ul_config_pdu;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
//clear previous possible allocation (maybe someone else should be added) //clear previous possible allocation (maybe something else should be added)
for(int i = 0; i < NUMBER_OF_UE_MAX_NB_IoT; i++) for(int i = 0; i < NUMBER_OF_UE_MAX_NB_IoT; i++)
{ {
if(eNB->ndlsch[i]) if(eNB->ndlsch[i])
......
...@@ -753,12 +753,6 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0) ...@@ -753,12 +753,6 @@ if(proc->flag_msg4 == 1 && proc->counter_msg4 > 0)
common_signal_procedures_NB_IoT(eNB,proc); common_signal_procedures_NB_IoT(eNB,proc);
/////////////////////////// END /////////////////////////////////////// /////////////////////////// END ///////////////////////////////////////
...@@ -1506,7 +1500,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1506,7 +1500,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
} }
// Get scheduling info for next subframe // Get scheduling info for next subframe
// This is called only for the CC_id = 0 and triggers scheduling for all CC_id's // This is called only for the CC_id = 0 and triggers scheduling for all CC_id's
/* if (eNB->mac_enabled==1) { /* if (eNB->mac_enabled==1) {
...@@ -1523,7 +1516,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1523,7 +1516,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
} }
} }
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// test if there is detection, // test if there is detection,
//if yes proceed to setting flag to indicate that there is something to transmit //if yes proceed to setting flag to indicate that there is something to transmit
...@@ -1532,9 +1524,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1532,9 +1524,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
// store the PDU of DCI // store the PDU of DCI
// add two variable for frame and subframe , in order to know next transmission // add two variable for frame and subframe , in order to know next transmission
// varible to indicate the remaining repetition to transmit // varible to indicate the remaining repetition to transmit
///////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////
...@@ -1684,8 +1673,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1684,8 +1673,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
*/ */
// if we have DCI to generate do it now // if we have DCI to generate do it now
if ((DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci)>0) { if ((DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci)>0) {
...@@ -1777,23 +1764,21 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1777,23 +1764,21 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
eNB->ulsch[(uint32_t)UE_id]->Msg3_frame, eNB->ulsch[(uint32_t)UE_id]->Msg3_frame,
eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe); eNB->ulsch[(uint32_t)UE_id]->Msg3_subframe);
// pdsch_procedures(eNB,proc,eNB->dlsch_ra,(LTE_eNB_DLSCH_t*)NULL,(LTE_eNB_UE_stats*)NULL,1,num_pdcch_symbols); // pdsch_procedures(eNB,proc,eNB->dlsch_ra,(LTE_eNB_DLSCH_t*)NULL,(LTE_eNB_UE_stats*)NULL,1,num_pdcch_symbols);
eNB->dlsch_ra->active = 0; eNB->dlsch_ra->active = 0;
} }
// Now scan UE specific DLSCH // Now scan UE specific DLSCH
for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++)
{ {
if ((eNB->dlsch[(uint8_t)UE_id][0])&& if ((eNB->dlsch[(uint8_t)UE_id][0])&&
(eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&& (eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&&
(eNB->dlsch[(uint8_t)UE_id][0]->active == 1)) { (eNB->dlsch[(uint8_t)UE_id][0]->active == 1)) {
//pdsch_procedures(eNB,proc,eNB->dlsch[(uint8_t)UE_id][0],eNB->dlsch[(uint8_t)UE_id][1],&eNB->UE_stats[(uint32_t)UE_id],0,num_pdcch_symbols); //pdsch_procedures(eNB,proc,eNB->dlsch[(uint8_t)UE_id][0],eNB->dlsch[(uint8_t)UE_id][1],&eNB->UE_stats[(uint32_t)UE_id],0,num_pdcch_symbols);
}
}
else if ((eNB->dlsch[(uint8_t)UE_id][0])&& else if ((eNB->dlsch[(uint8_t)UE_id][0])&&
(eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&& (eNB->dlsch[(uint8_t)UE_id][0]->rnti>0)&&
...@@ -1804,8 +1789,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1804,8 +1789,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
} }
} }
// if we have PHICH to generate // if we have PHICH to generate
if (is_phich_subframe(fp,subframe)) if (is_phich_subframe(fp,subframe))
......
...@@ -256,7 +256,6 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -256,7 +256,6 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
//uint8_t *control_region_size = get_NB_IoT_SIB1_eutracontrolregionsize(); //uint8_t *control_region_size = get_NB_IoT_SIB1_eutracontrolregionsize();
//int G=0; //int G=0;
//NSSS only happened in the even frame //NSSS only happened in the even frame
if(frame%2==0) if(frame%2==0)
{ {
...@@ -314,8 +313,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -314,8 +313,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
RB_IoT_ID); RB_IoT_ID);
} }
///////////////////////////////////////////////////////// SIB1 ////////////////////////////////////
///////////////////////////////////////////////////////// SIB1 ////////////////////////////////////
// we need two parameter, NB-IoT cell_id and scheduling info for sib1 (can be found in the MIB) // we need two parameter, NB-IoT cell_id and scheduling info for sib1 (can be found in the MIB)
// using scheduling_info parameter we can get the TBS size. // using scheduling_info parameter we can get the TBS size.
// cell_id help to find the start subframe for sib1. // cell_id help to find the start subframe for sib1.
...@@ -326,8 +324,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -326,8 +324,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
LOG_I(PHY,"SIB1 NB-IoT content:\n"); LOG_I(PHY,"SIB1 NB-IoT content:\n");
for(int i = 0; i<6;i++) for(int i = 0; i<6;i++)
printf("%02X",sib1->pdu[i]); printf("%02X",sib1->pdu[i]);
printf("\n"); printf("\n");
if( frame%32 == 0 ) if( frame%32 == 0 )
{ {
...@@ -337,7 +334,6 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -337,7 +334,6 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
get_G_NB_IoT(fp), get_G_NB_IoT(fp),
1); //////////// G*2 1); //////////// G*2
dlsch_scrambling_Gen_NB_IoT(fp, dlsch_scrambling_Gen_NB_IoT(fp,
sib1, sib1,
1888, 1888,
...@@ -357,7 +353,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -357,7 +353,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
RB_IoT_ID); RB_IoT_ID);
} }
///////////////////////////////////////////////////////// END //////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// END ////////////////////////////////////////////////////////
//////////////////////////////////////////////////// SIB23 //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////// SIB23 ////////////////////////////////////////////////////////////////////////
if( (subframe >0) && (subframe !=5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) ) if( (subframe >0) && (subframe !=5) && (With_NSSS == 0) && (frame%2==1) && (frame%64<16) ) ////if((subframe != 0) && (subframe != 4) && (subframe != 9) )
...@@ -375,7 +371,6 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -375,7 +371,6 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
236, 236,
2); //////////// G*2 2); //////////// G*2
dlsch_scrambling_Gen_NB_IoT(fp, // is called only in subframe 4 dlsch_scrambling_Gen_NB_IoT(fp, // is called only in subframe 4
sib23, sib23,
1888, ////// total_bits 1888, ////// total_bits
...@@ -420,15 +415,15 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -420,15 +415,15 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
RB_IoT_ID, RB_IoT_ID,
With_NSSS); With_NSSS);
if(frame==1023 && subframe==9) if(frame==1023 && subframe==9)
{ {
//printf("%d",hyper_frame); //printf("%d",hyper_frame);
if(proc->HFN==1023) if(proc->HFN==1023)
{ {
proc->HFN=0; proc->HFN=0;
}else{ }else{
proc->HFN++; proc->HFN++;
} }
} }
......
/*
* 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 output_handler_NB_IoT.c /*! \file output_handler_NB_IoT.c
* \brief Convert MAC scheduler result and output the FAPI structure by subframe based * \brief Convert MAC scheduler result and output the FAPI structure by subframe based
* \author NTUST BMW Lab./ * \author NTUST BMW Lab./
...@@ -202,27 +223,27 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_ ...@@ -202,27 +223,27 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
} }
break; break;
case NPDSCH: case NPDSCH:
LOG_D(MAC,"NB-IoT fill DL Data\n"); LOG_D(MAC,"NB-IoT fill DL Data\n");
//LOG_I(MAC,"NB-IoT fill DL Data\n"); //LOG_I(MAC,"NB-IoT fill DL Data\n");
//SCHED_info->DL_req = (nfapi_dl_config_request_t*) malloc (sizeof(nfapi_dl_config_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.number_pdu = 0; //SCHED_info->DL_req->dl_config_request_body.number_pdu = 0;
//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)); //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; dl_config_pdu = SCHED_info->DL_req->dl_config_request_body.dl_config_pdu_list;
DCI_pdu = schedule_result_list_DL-> DCI_pdu; DCI_pdu = schedule_result_list_DL-> DCI_pdu;
SCHED_info->DL_req->dl_config_request_body.number_pdu = 1; 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_type = NFAPI_DL_CONFIG_NDLSCH_PDU_TYPE;
dl_config_pdu->pdu_size = 2+sizeof(nfapi_dl_config_ndlsch_pdu_rel13_t); 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.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.pdu_index = 1;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.rnti_type = 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.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.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.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.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); 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; 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;
//LOG_D(MAC,"A NB-IoT fill DL Data pdu : %d \n",schedule_result_list_DL->DLSCH_pdu); //LOG_D(MAC,"A NB-IoT fill DL Data pdu : %d \n",schedule_result_list_DL->DLSCH_pdu);
break; break;
default: default:
break; break;
......
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