develop&-nr up-to-date as of 30.7.19
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
|
||||
extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn);
|
||||
extern int32_t get_uldl_offset(int eutra_bandP);
|
||||
@@ -409,6 +410,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
|
||||
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF){
|
||||
common_vars->rxdata = (int32_t **)NULL;
|
||||
common_vars->txdataF = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t*));
|
||||
common_vars->rxdataF = (int32_t **)malloc16(64*sizeof(int32_t*));
|
||||
@@ -512,6 +514,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
|
||||
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++)
|
||||
eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id];
|
||||
}
|
||||
|
||||
eNB->pdsch_config_dedicated->p_a = dB0; //defaul value until overwritten by RRCConnectionReconfiguration
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#define CCEBITS 72
|
||||
#define CCEPERSYMBOL 33 // This is for 1200 RE
|
||||
#define CCEPERSYMBOL0 22 // This is for 1200 RE
|
||||
#define DCI_BITS_MAX ((2*CCEPERSYMBOL+CCEPERSYMBOL0)*CCEBITS)
|
||||
#define DCI_BITS_MAX ((2*CCEPERSYMBOL+CCEPERSYMBOL0)*CCEBITS + 64)
|
||||
|
||||
//#define Mquad (Msymb/4)
|
||||
|
||||
|
||||
@@ -379,9 +379,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
unsigned int G;
|
||||
unsigned int crc=1;
|
||||
unsigned char harq_pid = dlsch->harq_ids[frame%2][subframe];
|
||||
|
||||
if(harq_pid >= dlsch->Mdlharq) {
|
||||
LOG_E(PHY,"dlsch_encoding_2threads illegal harq_pid %d\n", harq_pid);
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch->Mdlharq)) {
|
||||
LOG_E(PHY,"dlsch_encoding_2threads illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -564,7 +563,12 @@ int dlsch_encoding_all(PHY_VARS_eNB *eNB,
|
||||
time_stats_t *i_stats) {
|
||||
int encoding_return = 0;
|
||||
unsigned int L,C,B;
|
||||
B = dlsch->harq_processes[dlsch->harq_ids[frame%2][subframe]]->B;
|
||||
uint8_t harq_pid = dlsch->harq_ids[frame%2][subframe];
|
||||
if(harq_pid >= dlsch->Mdlharq) {
|
||||
LOG_E(PHY,"dlsch_encoding_all illegal harq_pid %d\n", harq_pid);
|
||||
return(-1);
|
||||
}
|
||||
B = dlsch->harq_processes[harq_pid]->B;
|
||||
|
||||
LOG_D(PHY,"B %d, harq_pid %d\n",B,dlsch->harq_ids[frame%2][subframe]);
|
||||
|
||||
@@ -671,9 +675,8 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
unsigned int crc=1;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||
unsigned char harq_pid = dlsch->harq_ids[frame%2][subframe];
|
||||
|
||||
if(harq_pid >= dlsch->Mdlharq) {
|
||||
LOG_E(PHY,"dlsch_encoding illegal harq_pid %d\n", harq_pid);
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch->Mdlharq)) {
|
||||
LOG_E(PHY,"dlsch_encoding illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -2257,8 +2257,8 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
if ((dlsch0 != NULL) && (dlsch1 != NULL)){
|
||||
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe_offset];
|
||||
if(harq_pid >= dlsch0->Mdlharq) {
|
||||
LOG_E(PHY,"illegal harq_pid %d\n", harq_pid);
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
LOG_E(PHY,"illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return(-1);
|
||||
}
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
@@ -2278,8 +2278,8 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
}else if ((dlsch0 != NULL) && (dlsch1 == NULL)){
|
||||
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe_offset];
|
||||
if(harq_pid >= dlsch0->Mdlharq) {
|
||||
LOG_E(PHY,"illegal harq_pid %d\n", harq_pid);
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
LOG_E(PHY,"illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return(-1);
|
||||
}
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
@@ -2299,8 +2299,8 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
}else if ((dlsch0 == NULL) && (dlsch1 != NULL)){
|
||||
|
||||
harq_pid = dlsch1->harq_ids[frame%2][subframe_offset];
|
||||
if(harq_pid >= dlsch1->Mdlharq) {
|
||||
LOG_E(PHY,"illegal harq_pid %d\n", harq_pid);
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch1->Mdlharq)) {
|
||||
LOG_E(PHY,"illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return(-1);
|
||||
}
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
|
||||
@@ -1063,7 +1063,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
#endif
|
||||
}
|
||||
|
||||
for (l2=0,l=(nsymb>>1); l<(nsymb-1); l++,l2++) {
|
||||
for (l2=0,l=(nsymb>>1); l < nsymb; l++,l2++) {
|
||||
stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15))/nsymb;
|
||||
stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15))/nsymb;
|
||||
off+=2;
|
||||
@@ -1092,7 +1092,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
|
||||
// stat_max *= nsymb; // normalize to energy per symbol
|
||||
// stat_max /= (frame_parms->N_RB_UL*12); //
|
||||
stat_max /= (nsymb*12);
|
||||
stat_max /= 12;
|
||||
|
||||
#ifdef DEBUG_PUCCH_RX
|
||||
printf("[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max);
|
||||
@@ -1181,7 +1181,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
|
||||
stat_ref_re=0;
|
||||
stat_ref_im=0;
|
||||
|
||||
for (l2=0,l=(nsymb>>1); l<(nsymb-1); l++,l2++) {
|
||||
for (l2=0,l=(nsymb>>1); l< nsymb; l++,l2++) {
|
||||
if ((l2<2) || ((l2>(nsymb>>1) - 3)) ) { // data symbols
|
||||
stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
|
||||
stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
|
||||
|
||||
@@ -328,6 +328,8 @@ typedef struct {
|
||||
uint8_t subframe;
|
||||
/// corresponding UE RNTI
|
||||
uint16_t rnti;
|
||||
/// UE ID from Layer2
|
||||
uint16_t ue_id;
|
||||
/// Type (SR, HARQ, CQI, HARQ_SR, HARQ_CQI, SR_CQI, HARQ_SR_CQI)
|
||||
UCI_type_t type;
|
||||
/// SRS active flag
|
||||
|
||||
@@ -41,7 +41,7 @@ int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_
|
||||
uint16_t i;
|
||||
int16_t first_free_index=-1;
|
||||
AssertFatal(eNB!=NULL,"eNB is null\n");
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
for (i=0; i<NUMBER_OF_UCI_VARS_MAX; i++) {
|
||||
if ((eNB->uci_vars[i].active >0) &&
|
||||
(eNB->uci_vars[i].rnti==rnti) &&
|
||||
(eNB->uci_vars[i].frame==frame) &&
|
||||
|
||||
@@ -521,7 +521,7 @@ typedef struct PHY_VARS_eNB_s {
|
||||
LTE_eNB_PRACH prach_vars_br;
|
||||
#endif
|
||||
LTE_eNB_COMMON common_vars;
|
||||
LTE_eNB_UCI uci_vars[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_UCI uci_vars[NUMBER_OF_UCI_VARS_MAX];
|
||||
LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_PBCH pbch;
|
||||
LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX];
|
||||
|
||||
@@ -42,9 +42,9 @@ int16_t *primary_synch2_time;
|
||||
#include "PHY/MODULATION/modulation_vars.h"
|
||||
|
||||
|
||||
|
||||
PHY_VARS_UE ***PHY_vars_UE_g;
|
||||
RAN_CONTEXT_t RC;
|
||||
UL_RCC_IND_t UL_RCC_INFO;
|
||||
|
||||
unsigned short rev[2048],rev_times4[8192],rev_half[1024];
|
||||
unsigned short rev256[256],rev512[512],rev1024[1024],rev4096[4096],rev2048[2048],rev8192[8192];
|
||||
|
||||
+28
-22
@@ -42,7 +42,7 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req);
|
||||
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req);
|
||||
|
||||
|
||||
int oai_nfapi_ue_release_req(nfapi_ue_release_request_t *release_req);
|
||||
void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,
|
||||
int frame, int subframe,
|
||||
L1_rxtx_proc_t *proc,
|
||||
@@ -186,21 +186,11 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
|
||||
|
||||
#endif
|
||||
harq_pid = dlsch0->harq_ids[proc->frame_tx%2][proc->subframe_tx];
|
||||
AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7 frame:%d subframe:%d subframe(TX):%d rnti:%x UE_id:%d dlsch0[harq_ids:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d]\n",
|
||||
harq_pid,
|
||||
frame,subframe,
|
||||
proc->subframe_tx,rel8->rnti,UE_id,
|
||||
dlsch0->harq_ids[proc->frame_tx%2][0],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][1],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][2],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][3],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][4],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][5],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][6],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][7],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][8],
|
||||
dlsch0->harq_ids[proc->frame_tx%2][9]
|
||||
);
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
LOG_E(PHY,"illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n");
|
||||
@@ -588,6 +578,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,
|
||||
uci->frame = frame;
|
||||
uci->subframe = subframe;
|
||||
uci->rnti = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti;
|
||||
uci->ue_id = find_dlsch(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
uci->type = SR;
|
||||
uci->pucch_fmt = pucch_format1;
|
||||
uci->num_antenna_ports = 1;
|
||||
@@ -615,6 +606,7 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_
|
||||
uci->frame = frame;
|
||||
uci->subframe = subframe;
|
||||
uci->rnti = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti;
|
||||
uci->ue_id = find_dlsch(ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
uci->type = HARQ_SR;
|
||||
uci->num_antenna_ports = 1;
|
||||
uci->num_pucch_resources = 1;
|
||||
@@ -638,6 +630,7 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu
|
||||
uci->frame = frame;
|
||||
uci->subframe = subframe;
|
||||
uci->rnti = ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti;
|
||||
uci->ue_id = find_dlsch(ul_config_pdu->uci_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
|
||||
uci->type = HARQ;
|
||||
uci->srs_active = srs_active;
|
||||
uci->num_antenna_ports = ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel11.num_ant_ports;
|
||||
@@ -809,7 +802,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
|
||||
harq_pid = subframe2harq_pid(fp,ul_frame,ul_subframe);
|
||||
|
||||
// clear DCI allocation maps for new subframe
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF)
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
if (eNB->ulsch[i]) {
|
||||
ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid];
|
||||
@@ -825,7 +818,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
|
||||
//LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
|
||||
switch (dl_config_pdu->pdu_type) {
|
||||
case NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE:
|
||||
handle_nfapi_dci_dl_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu);
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF)
|
||||
handle_nfapi_dci_dl_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu);
|
||||
eNB->pdcch_vars[NFAPI_SFNSF2SF(DL_req->sfn_sf)&1].num_dci++;
|
||||
//LOG_E(PHY,"Incremented num_dci:%d but already set??? dl_config:num_dci:%d\n", eNB->pdcch_vars[subframe&1].num_dci, number_dci);
|
||||
do_oai=1;
|
||||
@@ -840,7 +834,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
|
||||
do_oai=1;
|
||||
//LOG_D(PHY,"%s() NFAPI_DL_CONFIG_BCH_PDU_TYPE TX:%d/%d RX:%d/%d TXREQ:%d/%d\n",
|
||||
//__FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, NFAPI_SFNSF2SFN(TX_req->sfn_sf), NFAPI_SFNSF2SF(TX_req->sfn_sf));
|
||||
handle_nfapi_bch_pdu(eNB,proc,dl_config_pdu,
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF)
|
||||
handle_nfapi_bch_pdu(eNB,proc,dl_config_pdu,
|
||||
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel8.pdu_index].segments[0].segment_data);
|
||||
break;
|
||||
|
||||
@@ -872,7 +867,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
|
||||
dlsch_pdu_rel8->transport_blocks);
|
||||
|
||||
if (1) { //sdu != NULL)
|
||||
handle_nfapi_dlsch_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu, dlsch_pdu_rel8->transport_blocks-1, sdu);
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF)
|
||||
handle_nfapi_dlsch_pdu(eNB,NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),proc,dl_config_pdu, dlsch_pdu_rel8->transport_blocks-1, sdu);
|
||||
} else {
|
||||
dont_send=1;
|
||||
LOG_E(MAC,"%s() NFAPI_DL_CONFIG_DLSCH_PDU_TYPE sdu is NULL DL_CFG:SFN/SF:%d:pdu_index:%d TX_REQ:SFN/SF:%d:pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(DL_req->sfn_sf), pdu_index,
|
||||
@@ -913,7 +909,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE:
|
||||
handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu);
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF)
|
||||
handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu);
|
||||
eNB->mpdcch_vars[subframe&1].num_dci++;
|
||||
break;
|
||||
#endif
|
||||
@@ -921,16 +918,24 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
|
||||
}
|
||||
|
||||
if ((NFAPI_MODE!=NFAPI_MONOLITHIC) && do_oai && !dont_send) {
|
||||
oai_nfapi_tx_req(Sched_INFO->TX_req);
|
||||
if(Sched_INFO->TX_req->tx_request_body.number_of_pdus > 0){
|
||||
Sched_INFO->TX_req->sfn_sf = frame << 4 | subframe;
|
||||
oai_nfapi_tx_req(Sched_INFO->TX_req);
|
||||
}
|
||||
Sched_INFO->DL_req->sfn_sf = frame << 4 | subframe;
|
||||
oai_nfapi_dl_config_req(Sched_INFO->DL_req); // DJP - .dl_config_request_body.dl_config_pdu_list[0]); // DJP - FIXME TODO - yuk - only copes with 1 pdu
|
||||
Sched_INFO->UE_release_req->sfn_sf = frame << 4 | subframe;
|
||||
oai_nfapi_ue_release_req(Sched_INFO->UE_release_req);
|
||||
}
|
||||
|
||||
if ((NFAPI_MODE!=NFAPI_MONOLITHIC) && number_hi_dci0_pdu!=0) {
|
||||
HI_DCI0_req->sfn_sf = frame << 4 | subframe;
|
||||
oai_nfapi_hi_dci0_req(HI_DCI0_req);
|
||||
eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_dci=0;
|
||||
eNB->pdcch_vars[NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf)&1].num_pdcch_symbols=0;
|
||||
}
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_VNF)
|
||||
for (i=0; i<number_hi_dci0_pdu; i++) {
|
||||
hi_dci0_req_pdu = &HI_DCI0_req->hi_dci0_request_body.hi_dci0_pdu_list[i];
|
||||
LOG_D(PHY,"NFAPI: hi_dci0_pdu %d : type %d\n",i,hi_dci0_req_pdu->pdu_type);
|
||||
@@ -955,6 +960,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO) {
|
||||
if (NFAPI_MODE!=NFAPI_MONOLITHIC) {
|
||||
if (number_ul_pdu>0) {
|
||||
//LOG_D(PHY, "UL_CONFIG to send to PNF\n");
|
||||
UL_req->sfn_sf = frame << 4 | subframe;
|
||||
oai_nfapi_ul_config_req(UL_req);
|
||||
UL_req->ul_config_request_body.number_of_pdus=0;
|
||||
number_ul_pdu=0;
|
||||
|
||||
@@ -48,8 +48,7 @@
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
|
||||
|
||||
nfapi_ue_release_request_body_t release_rntis;
|
||||
|
||||
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t harq_pid, uint8_t bw_factor) {
|
||||
uint32_t Nre,sumKr,MPR_x100,Kr,r;
|
||||
@@ -460,6 +459,11 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,num_pdcch_symbols);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME (VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO, (frame * 10) + subframe);
|
||||
|
||||
if (num_pdcch_symbols == 0){
|
||||
LOG_E(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8") num_pdcch_symbols:%d\n",eNB->Mod_id,frame, subframe, num_dci, num_pdcch_symbols);
|
||||
return;
|
||||
}
|
||||
|
||||
if (num_dci > 0)
|
||||
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (num_dci %"PRIu8") num_pdcch_symbols:%d\n",eNB->Mod_id,frame, subframe, num_dci, num_pdcch_symbols);
|
||||
|
||||
@@ -507,9 +511,9 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
) {
|
||||
// get harq_pid
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe];
|
||||
AssertFatal(harq_pid>=0,"harq_pid is negative\n");
|
||||
//AssertFatal(harq_pid>=0,"harq_pid is negative\n");
|
||||
|
||||
if (harq_pid>=8) {
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
|
||||
if (dlsch0->ue_type==0)
|
||||
@@ -598,7 +602,7 @@ void fill_sr_indication(PHY_VARS_eNB *eNB,uint16_t rnti,int frame,int subframe,u
|
||||
// pdu->rx_ue_information.handle = handle;
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
pdu->rx_ue_information.rnti = rnti;
|
||||
int SNRtimes10 = dB_fixed_times10(stat) - 300;//(10*eNB->measurements.n0_power_dB[0]);
|
||||
int SNRtimes10 = dB_fixed_times10(stat) - 10 * eNB->measurements.n0_subband_power_dB[0][0];
|
||||
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
|
||||
|
||||
if (SNRtimes10 < -640) pdu->ul_cqi_information.ul_cqi=0;
|
||||
@@ -631,7 +635,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
LTE_eNB_UCI *uci = NULL;
|
||||
LTE_DL_FRAME_PARMS *fp = &(eNB->frame_parms);
|
||||
|
||||
for (int i = 0; i < NUMBER_OF_UE_MAX; i++) {
|
||||
for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++) {
|
||||
uci = &(eNB->uci_vars[i]);
|
||||
|
||||
if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
|
||||
@@ -679,7 +683,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
int pucch1_thres = (uci->ue_type == 0) ? eNB->pucch1_DTX_threshold : eNB->pucch1_DTX_threshold_emtc[0];
|
||||
metric_SR = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->ue_id,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, // n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
@@ -721,7 +725,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
SR_payload);
|
||||
metric[0] = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->ue_id,
|
||||
uci->n_pucch_1[0][0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
@@ -745,7 +749,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
SR_payload = 1;
|
||||
metric[0]=rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->ue_id,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
@@ -775,7 +779,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
#if 1
|
||||
metric[0] = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->ue_id,
|
||||
uci->n_pucch_1[0][0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
@@ -795,7 +799,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
SR_payload = 1;
|
||||
metric[0] = rx_pucch(eNB,
|
||||
pucch_format1b,
|
||||
i,
|
||||
uci->ue_id,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
@@ -1133,11 +1137,11 @@ uci_procedures(PHY_VARS_eNB *eNB,
|
||||
if (SR_payload == 1) {
|
||||
LOG_D (PHY, "[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n", eNB->Mod_id, uci->rnti, frame, subframe);
|
||||
|
||||
if (eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
|
||||
eNB->first_sr[i] = 0;
|
||||
eNB->dlsch[i][0]->harq_processes[0]->round = 0;
|
||||
eNB->dlsch[i][0]->harq_processes[0]->status = SCH_IDLE;
|
||||
LOG_D (PHY, "[eNB %d][SR %x] Frame %d subframe %d First SR\n", eNB->Mod_id, eNB->ulsch[i]->rnti, frame, subframe);
|
||||
if (eNB->first_sr[uci->ue_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
|
||||
eNB->first_sr[uci->ue_id] = 0;
|
||||
eNB->dlsch[uci->ue_id][0]->harq_processes[0]->round = 0;
|
||||
eNB->dlsch[uci->ue_id][0]->harq_processes[0]->status = SCH_IDLE;
|
||||
LOG_D (PHY, "[eNB %d][SR %x] Frame %d subframe %d First SR\n", eNB->Mod_id, eNB->ulsch[uci->ue_id]->rnti, frame, subframe);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1466,7 +1470,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
|
||||
|
||||
pdu->rx_indication_rel8.timing_advance = timing_advance_update;
|
||||
// estimate UL_CQI for MAC (from antenna port 0 only)
|
||||
int SNRtimes10 = dB_fixed_times10(eNB->pusch_vars[UE_id]->ulsch_power[0]) - 300;//(10*eNB->measurements.n0_power_dB[0]);
|
||||
int SNRtimes10 = dB_fixed_times10(eNB->pusch_vars[UE_id]->ulsch_power[0]) - 10 * eNB->measurements.n0_subband_power_dB[0][0];
|
||||
|
||||
if (SNRtimes10 < -640)
|
||||
pdu->rx_indication_rel8.ul_cqi = 0;
|
||||
@@ -1519,8 +1523,10 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
|
||||
|
||||
harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx];
|
||||
|
||||
AssertFatal((harq_pid >= 0) && (harq_pid < 8),"harq_pid %d not in 0...7\n", harq_pid);
|
||||
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
LOG_E(PHY,"illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
|
||||
@@ -1569,37 +1575,39 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
|
||||
if (((1 << m) & mask) > 0) {
|
||||
harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx];
|
||||
|
||||
if ((harq_pid >= 0) && (harq_pid < dlsch0->Mdlharq)) {
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
|
||||
LOG_E(PHY,"illegal harq_pid %d %s:%d\n", harq_pid, __FILE__, __LINE__);
|
||||
return;
|
||||
}
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
|
||||
AssertFatal(dlsch0_harq != NULL, "Dlsch0_harq is null\n");
|
||||
AssertFatal(dlsch0_harq != NULL, "Dlsch0_harq is null\n");
|
||||
|
||||
#if T_TRACER
|
||||
if (after_rounds != -1) {
|
||||
T(T_ENB_PHY_DLSCH_UE_NACK,
|
||||
T_INT(0),
|
||||
T_INT(frame),
|
||||
T_INT(subframe),
|
||||
T_INT(dlsch0->rnti),
|
||||
T_INT(harq_pid));
|
||||
} else {
|
||||
T(T_ENB_PHY_DLSCH_UE_ACK,
|
||||
T_INT(0),
|
||||
T_INT(frame),
|
||||
T_INT(subframe),
|
||||
T_INT(dlsch0->rnti),
|
||||
T_INT(harq_pid));
|
||||
}
|
||||
if (after_rounds != -1) {
|
||||
T(T_ENB_PHY_DLSCH_UE_NACK,
|
||||
T_INT(0),
|
||||
T_INT(frame),
|
||||
T_INT(subframe),
|
||||
T_INT(dlsch0->rnti),
|
||||
T_INT(harq_pid));
|
||||
} else {
|
||||
T(T_ENB_PHY_DLSCH_UE_ACK,
|
||||
T_INT(0),
|
||||
T_INT(frame),
|
||||
T_INT(subframe),
|
||||
T_INT(dlsch0->rnti),
|
||||
T_INT(harq_pid));
|
||||
}
|
||||
#endif
|
||||
if (dlsch0_harq->round >= after_rounds) {
|
||||
dlsch0_harq->status = SCH_IDLE;
|
||||
if (dlsch0_harq->round >= after_rounds) {
|
||||
dlsch0_harq->status = SCH_IDLE;
|
||||
|
||||
if ((dlsch1_harq == NULL) || ((dlsch1_harq != NULL) && (dlsch1_harq->status == SCH_IDLE))) {
|
||||
dlsch0->harq_mask &= ~(1 << harq_pid);
|
||||
}
|
||||
if ((dlsch1_harq == NULL) || ((dlsch1_harq != NULL) && (dlsch1_harq->status == SCH_IDLE))) {
|
||||
dlsch0->harq_mask &= ~(1 << harq_pid);
|
||||
}
|
||||
} // end if ((harq_pid >= 0) && (harq_pid < dlsch0->Mdlharq))
|
||||
}
|
||||
} // end if (((1 << m) & mask) > 0)
|
||||
} // end for (int m=0; m < M; m++)
|
||||
} // end if TDD
|
||||
@@ -1638,7 +1646,7 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
|
||||
|
||||
harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx];
|
||||
|
||||
if (harq_pid>=0 && harq_pid<10) {
|
||||
if (harq_pid>=0 && harq_pid<dlsch0->Mdlharq) {
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n");
|
||||
@@ -1654,8 +1662,9 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
|
||||
|
||||
void fill_ulsch_cqi_indication (PHY_VARS_eNB *eNB, uint16_t frame, uint8_t subframe, LTE_UL_eNB_HARQ_t *ulsch_harq, uint16_t rnti) {
|
||||
pthread_mutex_lock (&eNB->UL_INFO_mutex);
|
||||
nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
|
||||
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.number_of_cqis];
|
||||
nfapi_cqi_indication_pdu_t *pdu = &eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list[eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis];
|
||||
nfapi_cqi_indication_raw_pdu_t *raw_pdu = &eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list[eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis];
|
||||
pdu->instance_length = 0;
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
pdu->rx_ue_information.rnti = rnti;
|
||||
|
||||
@@ -1681,9 +1690,11 @@ void fill_ulsch_cqi_indication (PHY_VARS_eNB *eNB, uint16_t frame, uint8_t subfr
|
||||
|
||||
pdu->cqi_indication_rel9.number_of_cc_reported = 1;
|
||||
pdu->ul_cqi_information.channel = 1; // PUSCH
|
||||
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
|
||||
memcpy ((void *) raw_pdu->pdu, ulsch_harq->o, pdu->cqi_indication_rel9.length);
|
||||
eNB->UL_INFO.cqi_ind.number_of_cqis++;
|
||||
LOG_D(PHY,"eNB->UL_INFO.cqi_ind.number_of_cqis:%d\n", eNB->UL_INFO.cqi_ind.number_of_cqis);
|
||||
eNB->UL_INFO.cqi_ind.cqi_indication_body.tl.tag = NFAPI_CQI_INDICATION_BODY_TAG;
|
||||
eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis++;
|
||||
LOG_D(PHY,"eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis:%d\n", eNB->UL_INFO.cqi_ind.cqi_indication_body.number_of_cqis);
|
||||
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
|
||||
}
|
||||
|
||||
@@ -1772,7 +1783,7 @@ void fill_uci_harq_indication (PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, i
|
||||
pdu->rx_ue_information.rnti = uci->rnti;
|
||||
// estimate UL_CQI for MAC (from antenna port 0 only)
|
||||
pdu->ul_cqi_information.tl.tag = NFAPI_UL_CQI_INFORMATION_TAG;
|
||||
int SNRtimes10 = dB_fixed_times10(uci->stat) - 300;//(10*eNB->measurements.n0_power_dB[0]);
|
||||
int SNRtimes10 = dB_fixed_times10(uci->stat) - 10 * eNB->measurements.n0_subband_power_dB[0][0];
|
||||
|
||||
if (SNRtimes10 < -100)
|
||||
LOG_I (PHY, "uci->stat %d \n", uci->stat);
|
||||
@@ -2000,3 +2011,44 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 );
|
||||
}
|
||||
|
||||
void release_rnti_of_phy(module_id_t mod_id){
|
||||
int i,j;
|
||||
int CC_id;
|
||||
rnti_t rnti;
|
||||
PHY_VARS_eNB *eNB_PHY = NULL;
|
||||
LTE_eNB_ULSCH_t *ulsch = NULL;
|
||||
LTE_eNB_DLSCH_t *dlsch = NULL;
|
||||
for(i = 0; i< release_rntis.number_of_TLVs;i++){
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
eNB_PHY = RC.eNB[mod_id][CC_id];
|
||||
rnti = release_rntis.ue_release_request_TLVs_list[i].rnti;
|
||||
for (j=0; j<NUMBER_OF_UE_MAX; j++) {
|
||||
ulsch = eNB_PHY->ulsch[j];
|
||||
if((ulsch != NULL) && (ulsch->rnti == rnti)){
|
||||
LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
|
||||
clean_eNb_ulsch(ulsch);
|
||||
}
|
||||
|
||||
dlsch = eNB_PHY->dlsch[j][0];
|
||||
if((dlsch != NULL) && (dlsch->rnti == rnti)){
|
||||
LOG_I(PHY, "clean_eNb_dlsch dlsch[%d] UE %x \n", j, rnti);
|
||||
clean_eNb_dlsch(dlsch);
|
||||
}
|
||||
}
|
||||
ulsch = eNB_PHY->ulsch[j];
|
||||
if((ulsch != NULL) && (ulsch->rnti == rnti)){
|
||||
LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
|
||||
clean_eNb_ulsch(ulsch);
|
||||
}
|
||||
for(j=0; j<NUMBER_OF_UCI_VARS_MAX; j++) {
|
||||
if(eNB_PHY->uci_vars[j].rnti == rnti){
|
||||
LOG_I(PHY, "clean eNb uci_vars[%d] UE %x \n",j, rnti);
|
||||
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
memset(&release_rntis, 0, sizeof(nfapi_ue_release_request_body_t));
|
||||
}
|
||||
|
||||
@@ -219,6 +219,7 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
|
||||
|
||||
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
|
||||
|
||||
void release_rnti_of_phy(module_id_t mod_id);
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0);}
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
|
||||
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
|
||||
|
||||
int oai_nfapi_ue_release_req(nfapi_ue_release_request_t *release_req){ return(0); }
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
|
||||
|
||||
|
||||
@@ -619,8 +619,8 @@ int main(int argc, char **argv) {
|
||||
eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = eNB->crc_pdu_list;
|
||||
eNB->UL_INFO.sr_ind.sr_indication_body.sr_pdu_list = eNB->sr_pdu_list;
|
||||
eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list = eNB->harq_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_pdu_list = eNB->cqi_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_pdu_list = eNB->cqi_pdu_list;
|
||||
eNB->UL_INFO.cqi_ind.cqi_indication_body.cqi_raw_pdu_list = eNB->cqi_raw_pdu_list;
|
||||
printf("lte_param_init done\n");
|
||||
// for a call to phy_reset_ue later we need PHY_vars_UE_g allocated and pointing to UE
|
||||
PHY_vars_UE_g = (PHY_VARS_UE ** *)malloc(sizeof(PHY_VARS_UE **));
|
||||
|
||||
Reference in New Issue
Block a user