Commit e753e773 authored by chenhsunyang0922's avatar chenhsunyang0922

fix error in phy_procedures_lte_common_NB_IoT.c and MAC LAYER

parent befd0112
......@@ -235,7 +235,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
//AssertFatal(UE_id==-1,"no existing ue specific dlsch_context\n");
ndlsch = eNB->ndlsch[(uint8_t)UE_id];
ndlsch_harq = eNB->ndlsch[(uint8_t)UE_id]->harq_process;
ndlsch_harq = eNB->ndlsch[(uint8_t)UE_id][0]->harq_process;
AssertFatal(ndlsch_harq!=NULL,"dlsch_harq for ue specific is null\n");
ndlsch->active = 1;
......@@ -322,16 +322,16 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO)
{
if(eNB->ndlsch[i])
{
eNB->ndlsch[i]->harq_process->round=0; // may not needed
eNB->ndlsch[i][0]->harq_process->round=0; // may not needed
/*clear previous allocation information for all UEs*/
eNB->ndlsch[i]->subframe_tx[subframe] = 0;
eNB->ndlsch[i][0]->subframe_tx[subframe] = 0;
}
/*clear the DCI allocation maps for new subframe*/
if(eNB->nulsch[i])
if(eNB->ulsch_NB_IoT[i])
{
eNB->nulsch[i]->harq_process->dci_alloc = 0; //flag for indicating that a DCI has been allocated for UL
eNB->nulsch[i]->harq_process->rar_alloc = 0; //Flag indicating that this ULSCH has been allocated by a RAR (for Msg3)
eNB->ulsch_NB_IoT[i]->harq_process->dci_alloc = 0; //flag for indicating that a DCI has been allocated for UL
eNB->ulsch_NB_IoT[i]->harq_process->rar_alloc = 0; //Flag indicating that this ULSCH has been allocated by a RAR (for Msg3)
//no phich for NB-IoT so no DMRS should be utilized
}
......
......@@ -1094,14 +1094,14 @@ int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *eNB)
return(-1);
}
*/
int8_t find_ue_NB_IoT(uint16_t rnti, PHY_VARS_eNB *eNB)
int8_t find_ue_NB_IoT(uint16_t rnti, PHY_VARS_eNB_NB_IoT *eNB)
{
uint8_t i;
for (i=0; i<NUMBER_OF_UE_MAX_NB_IoT; i++) {
if ((eNB->ndlsch[i]) &&
(eNB->ndlsch[i]->rnti==rnti)) {
(eNB->ndlsch[i][0]->rnti==rnti)) {
return(i);
}
}
......
......@@ -49,16 +49,16 @@ int16_t get_hundred_times_delta_IF_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,uint8_t U
DevAssert( UE_id < NUMBER_OF_UE_MAX_NB_IoT+1 );
DevAssert( harq_pid < 8 );
Nre = eNB->nulsch[UE_id]->harq_process->Nsymb_initial *
eNB->nulsch[UE_id]->harq_process->nb_rb*12;
Nre = eNB->ulsch_NB_IoT[UE_id]->harq_process->Nsymb_initial *
eNB->ulsch_NB_IoT[UE_id]->harq_process->nb_rb*12;
sumKr = 0;
for (r=0; r<eNB->nulsch[UE_id]->harq_process->C; r++) {
if (r<eNB->nulsch[UE_id]->harq_process->Cminus)
Kr = eNB->nulsch[UE_id]->harq_process->Kminus;
for (r=0; r<eNB->ulsch_NB_IoT[UE_id]->harq_process->C; r++) {
if (r<eNB->ulsch_NB_IoT[UE_id]->harq_process->Cminus)
Kr = eNB->ulsch_NB_IoT[UE_id]->harq_process->Kminus;
else
Kr = eNB->nulsch[UE_id]->harq_process->Kplus;
Kr = eNB->ulsch_NB_IoT[UE_id]->harq_process->Kplus;
sumKr += Kr;
}
......@@ -80,7 +80,7 @@ int16_t get_hundred_times_delta_IF_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,uint8_t U
if (eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) {
// This is the formula from Section 5.1.1.1 in 36.213 10*log10(deltaIF_PUSCH = (2^(MPR*Ks)-1)*beta_offset_pusch)
if (bw_factor == 1) {
uint8_t nb_rb = eNB->nulsch[UE_id]->harq_process->nb_rb;
uint8_t nb_rb = eNB->ulsch_NB_IoT[UE_id]->harq_process->nb_rb;
return(hundred_times_delta_TF_NB_IoT[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch)>>3)) + hundred_times_log10_NPRB_NB_IoT[nb_rb-1];
} else
return(hundred_times_delta_TF_NB_IoT[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch)>>3));
......
......@@ -980,6 +980,7 @@ typedef struct {
} UE_list_t;
/*! \brief eNB common channels */
/*
typedef struct {
int physCellId;
int p_eNB;
......@@ -1046,7 +1047,9 @@ typedef struct {
BCCH_PDU BCCH_BR_pdu[20];
#endif
} COMMON_channels_t;
*/
/*! \brief top level eNB MAC structure */
/*
typedef struct eNB_MAC_INST_s {
/// Ethernet parameters for northbound midhaul interface
eth_params_t eth_params_n;
......@@ -1119,7 +1122,7 @@ typedef struct eNB_MAC_INST_s {
/// processing time of eNB ULSCH reception
time_stats_t rx_ulsch_sdu; // include rlc_data_ind
} eNB_MAC_INST_nb_iot;
*/
/*
* UE part
*/
......
......@@ -21,6 +21,7 @@
#include "PHY/defs_L1_NB_IoT.h"
#include "openair2/PHY_INTERFACE/IF_Module_NB_IoT.h"
#include "config_NB_IoT.h"
#include "LAYER2/MAC/mac.h"
// MAC definition
//#define MAX_FRAME 0xfffff
//#define NUM_FRAME 0x100000
......@@ -560,6 +561,9 @@ typedef struct eNB_MAC_INST_NB_IoT_s{
// channel config
/// Common cell resources
COMMON_channels_t common_channels[MAX_NUM_CCs];
//USS list
//Number of USS period is used
int num_uss_list;
......
......@@ -77,6 +77,7 @@
#include "PHY_INTERFACE/IF_Module.h"
#include "PHY/TOOLS/time_meas.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_common.h" // for PRACH_RESOURCES_t
#include "PHY/LTE_TRANSPORT/transport_common.h"
......@@ -1390,7 +1391,7 @@ typedef struct {
BCCH_PDU BCCH_MBMS_pdu;
uint8_t FeMBMS_flag;
#endif
LTE_eNB_PDCCH DCI_pdu;
} COMMON_channels_t;
/*! \brief top level eNB MAC structure */
typedef struct eNB_MAC_INST_s {
......
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