develop&-nr up-to-date as of 30.7.19
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user