Commit d0f0c40e authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'develop' of gitlab.eurecom.fr:oai/openairinterface5g into develop

parents f315bdbe fc3bbad7
...@@ -2016,11 +2016,11 @@ void prach_procedures(PHY_VARS_eNB *eNB) { ...@@ -2016,11 +2016,11 @@ void prach_procedures(PHY_VARS_eNB *eNB) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
} }
void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_pid) { void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_pid)
{
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0}; uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0};
int16_t n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3; int16_t n1_pucch0 = -1, n1_pucch1 = -1, n1_pucch2 = -1, n1_pucch3 = -1;
uint8_t do_SR = 0; uint8_t do_SR = 0;
uint8_t pucch_sel = 0; uint8_t pucch_sel = 0;
int32_t metric0=0,metric1=0,metric0_SR=0; int32_t metric0=0,metric1=0,metric0_SR=0;
...@@ -2089,7 +2089,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2089,7 +2089,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
eNB->UE_stats[UE_id].sr_total++; eNB->UE_stats[UE_id].sr_total++;
if (eNB->abstraction_flag == 0) if (eNB->abstraction_flag == 0) {
metric0_SR = rx_pucch(eNB, metric0_SR = rx_pucch(eNB,
pucch_format1, pucch_format1,
UE_id, UE_id,
...@@ -2100,7 +2100,14 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2100,7 +2100,14 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
frame, frame,
subframe, subframe,
PUCCH1_THRES); PUCCH1_THRES);
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (SR n1pucch is %d)\n",
eNB->Mod_id,
eNB->ulsch[UE_id]->rnti,
frame,
subframe,
SR_payload,
eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex);
}
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
metric0_SR = rx_pucch_emul(eNB, metric0_SR = rx_pucch_emul(eNB,
...@@ -2112,43 +2119,17 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2112,43 +2119,17 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",eNB->Mod_id, LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",eNB->Mod_id,
eNB->ulsch[UE_id]->rnti,frame,subframe,SR_payload,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex); eNB->ulsch[UE_id]->rnti,frame,subframe,SR_payload,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex);
} }
#endif #endif
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,
eNB->ulsch[UE_id]->rnti,frame,subframe);
eNB->UE_stats[UE_id].sr_received++;
if (eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
eNB->first_sr[UE_id] = 0;
eNB->dlsch[UE_id][0]->harq_processes[0]->round=0;
eNB->dlsch[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[UE_id]->rnti,frame,subframe);
}
if (eNB->mac_enabled==1) {
mac_xface->SR_indication(eNB->Mod_id,
eNB->CC_id,
frame,
eNB->dlsch[UE_id][0]->rnti,subframe);
}
}
}// do_SR==1 }// do_SR==1
if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR
} else if (eNB->frame_parms.frame_type==FDD) { // FDD } else if (fp->frame_type==FDD) { // FDD
// if SR was detected, use the n1_pucch from SR, else use n1_pucch0 // if SR was detected, use the n1_pucch from SR, else use n1_pucch0
// n1_pucch0 = (SR_payload==1) ? eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0; // n1_pucch0 = (SR_payload==1) ? eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0;
LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload); LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload);
if (eNB->abstraction_flag == 0) { if (eNB->abstraction_flag == 0) {
metric0 = rx_pucch(eNB, metric0 = rx_pucch(eNB,
pucch_format1a, pucch_format1a,
UE_id, UE_id,
...@@ -2159,53 +2140,26 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2159,53 +2140,26 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
frame, frame,
subframe, subframe,
PUCCH1a_THRES); PUCCH1a_THRES);
if (metric0 < metric0_SR)
metric0=rx_pucch(eNB,
pucch_format1a,
UE_id,
eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,
0, //n2_pucch
0, // shortened format
pucch_payload0,
frame,
subframe,
PUCCH1a_THRES);
}
if (eNB->mac_enabled==1) {
mac_xface->SR_indication(eNB->Mod_id,
eNB->CC_id,
frame,
eNB->dlsch[UE_id][0]->rnti,subframe);
} }
#ifdef PHY_ABSTRACTION
else {
metric0 = rx_pucch_emul(eNB,
proc,
UE_id,
pucch_format1a,
0,
pucch_payload0);
} }
}// do_SR==1 #endif
if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR /* cancel SR detection if reception on n1_pucch0 is better than on SR PUCCH resource index */
} else if (fp->frame_type==FDD) { // FDD if (do_SR && metric0 > metric0_SR) SR_payload = 0;
// if SR was detected, use the n1_pucch from SR, else use n1_pucch0
// n1_pucch0 = (SR_payload==1) ? eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0;
LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload); if (do_SR && metric0 <= metric0_SR) {
/* when transmitting ACK/NACK on SR PUCCH resource index, SR payload is always 1 */
SR_payload = 1;
if (eNB->abstraction_flag == 0) { if (eNB->abstraction_flag == 0) {
metric0 = rx_pucch(eNB,
pucch_format1a,
UE_id,
(uint16_t)n1_pucch0,
0, //n2_pucch
0, // shortened format
pucch_payload0,
frame,
subframe,
PUCCH1a_THRES);
if (metric0 < metric0_SR)
metric0=rx_pucch(eNB, metric0=rx_pucch(eNB,
pucch_format1a, pucch_format1a,
UE_id, UE_id,
...@@ -2217,14 +2171,15 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2217,14 +2171,15 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
subframe, subframe,
PUCCH1a_THRES); PUCCH1a_THRES);
} }
else {
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else {
metric0 = rx_pucch_emul(eNB, metric0 = rx_pucch_emul(eNB,
proc, proc,
UE_id, UE_id,
pucch_format1a, pucch_format1a,
0, 0,
pucch_payload0); pucch_payload0);
}
#endif #endif
} }
...@@ -2241,7 +2196,6 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2241,7 +2196,6 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
pucch_payload0, pucch_payload0,
2, 2,
SR_payload); SR_payload);
} // FDD } // FDD
else { //TDD else { //TDD
...@@ -2267,7 +2221,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2267,7 +2221,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
#endif #endif
if (eNB->abstraction_flag == 0) if (eNB->abstraction_flag == 0)
metric0_SR = rx_pucch(eNB, metric0 = rx_pucch(eNB,
format, format,
UE_id, UE_id,
eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,
...@@ -2375,6 +2329,29 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2375,6 +2329,29 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
pucch_payload, pucch_payload,
pucch_sel, pucch_sel,
SR_payload); SR_payload);
} // TDD
}
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,
eNB->ulsch[UE_id]->rnti,frame,subframe);
eNB->UE_stats[UE_id].sr_received++;
if (eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
eNB->first_sr[UE_id] = 0;
eNB->dlsch[UE_id][0]->harq_processes[0]->round=0;
eNB->dlsch[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[UE_id]->rnti,frame,subframe);
}
if (eNB->mac_enabled==1) {
mac_xface->SR_indication(eNB->Mod_id,
eNB->CC_id,
frame,
eNB->dlsch[UE_id][0]->rnti,subframe);
}
} }
} }
} }
......
...@@ -38,8 +38,9 @@ eNBs = ...@@ -38,8 +38,9 @@ eNBs =
Nid_cell_mbsfn = 0; Nid_cell_mbsfn = 0;
nb_antennas_tx = 1; nb_antennas_tx = 1;
nb_antennas_rx = 1; nb_antennas_rx = 1;
tx_gain = 10;//25; nb_antenna_ports = 1;
rx_gain = 120; tx_gain = 10; //25;
rx_gain = 10; //20;
prach_root = 0; prach_root = 0;
prach_config_index = 0; prach_config_index = 0;
prach_high_speed = "DISABLE"; prach_high_speed = "DISABLE";
...@@ -100,6 +101,8 @@ eNBs = ...@@ -100,6 +101,8 @@ eNBs =
ue_TimersAndConstants_t311 = 10000; ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20; ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1; ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 1;
} }
); );
......
...@@ -1775,7 +1775,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst ...@@ -1775,7 +1775,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
} }
} }
if (setup_eNB_buffers(PHY_vars_eNB_g[inst],&openair0_cfg[CC_id])!=0) { if (setup_eNB_buffers(PHY_vars_eNB_g[inst],&openair0_cfg[0])!=0) {
printf("Exiting, cannot initialize eNodeB Buffers\n"); printf("Exiting, cannot initialize eNodeB Buffers\n");
exit(-1); exit(-1);
} }
......
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