Commit 7967701d authored by Cedric Roux's avatar Cedric Roux

lte-softmodem: fix if4p5 (maybe incorrect)

For whatever reason, ru->frame_parms was NULL and the RRU crashed.
Let's allocated memory.

Also, don't do fp = ru->frame_parms in ru_thread, it seems that it
takes the value before allocation (so: NULL) and the code crashes
later on.

Maybe it's not the correct solution. To be refined at some point.
parent 98757d76
...@@ -1706,7 +1706,6 @@ static void *ru_thread( void *param ) ...@@ -1706,7 +1706,6 @@ static void *ru_thread( void *param )
{ {
RU_t *ru = (RU_t *)param; RU_t *ru = (RU_t *)param;
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
int subframe = 9; int subframe = 9;
int frame = 1023; int frame = 1023;
int resynch_done = 0; int resynch_done = 0;
...@@ -1895,13 +1894,13 @@ static void *ru_thread( void *param ) ...@@ -1895,13 +1894,13 @@ static void *ru_thread( void *param )
} }
else { else {
LOG_D(PHY,"RU thread %d, frame %d, subframe %d (do_prach %d, is_prach_subframe %d)\n", LOG_D(PHY,"RU thread %d, frame %d, subframe %d (do_prach %d, is_prach_subframe %d)\n",
ru->idx, frame, subframe, ru->do_prach, is_prach_subframe(fp, proc->frame_rx, proc->tti_rx)); ru->idx, frame, subframe, ru->do_prach, is_prach_subframe(ru->frame_parms, proc->frame_rx, proc->tti_rx));
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->tti_rx)==1)) { if ((ru->do_prach>0) && (is_prach_subframe(ru->frame_parms, proc->frame_rx, proc->tti_rx)==1)) {
LOG_D(PHY,"Waking up prach for %d.%d\n", proc->frame_rx, proc->tti_rx); LOG_D(PHY,"Waking up prach for %d.%d\n", proc->frame_rx, proc->tti_rx);
wakeup_prach_ru(ru); wakeup_prach_ru(ru);
} }
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
else if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->tti_rx)>1)) { else if ((ru->do_prach>0) && (is_prach_subframe(ru->frame_parms, proc->frame_rx, proc->tti_rx)>1)) {
wakeup_prach_ru_br(ru); wakeup_prach_ru_br(ru);
} }
#endif #endif
...@@ -1963,11 +1962,11 @@ static void *ru_thread( void *param ) ...@@ -1963,11 +1962,11 @@ static void *ru_thread( void *param )
for (int i=0; i<ru->nb_tx; i++) { for (int i=0; i<ru->nb_tx; i++) {
if(proc->frame_tx == 2) { if(proc->frame_tx == 2) {
sprintf(filename,"txdataF%d_frame%d_sf%d.m",i,proc->frame_tx,proc->tti_tx); sprintf(filename,"txdataF%d_frame%d_sf%d.m",i,proc->frame_tx,proc->tti_tx);
LOG_M(filename,"txdataF_frame",ru->common.txdataF_BF[i],fp->symbols_per_tti*fp->ofdm_symbol_size, 1, 1); LOG_M(filename,"txdataF_frame",ru->common.txdataF_BF[i],ru->frame_parms->symbols_per_tti*ru->frame_parms->ofdm_symbol_size, 1, 1);
} }
if(proc->frame_tx == 2 && proc->tti_tx==0){ if(proc->frame_tx == 2 && proc->tti_tx==0){
sprintf(filename,"txdata%d_frame%d.m",i,proc->frame_tx); sprintf(filename,"txdata%d_frame%d.m",i,proc->frame_tx);
LOG_M(filename,"txdata_frame",ru->common.txdata[i],fp->samples_per_tti*10, 1, 1); LOG_M(filename,"txdata_frame",ru->common.txdata[i],ru->frame_parms->samples_per_tti*10, 1, 1);
} }
} }
} }
...@@ -2000,7 +1999,6 @@ static void *ru_thread( void *param ) ...@@ -2000,7 +1999,6 @@ static void *ru_thread( void *param )
return NULL; return NULL;
} }
// This thread run the initial synchronization like a UE // This thread run the initial synchronization like a UE
void *ru_thread_synch(void *arg) void *ru_thread_synch(void *arg)
{ {
......
...@@ -574,6 +574,7 @@ void* ru_thread_control( void* param ) ...@@ -574,6 +574,7 @@ void* ru_thread_control( void* param )
((RRU_config_t *)&rru_config_msg.msg[0])->prach_FreqOffset[0], ((RRU_config_t *)&rru_config_msg.msg[0])->prach_FreqOffset[0],
((RRU_config_t *)&rru_config_msg.msg[0])->prach_ConfigIndex[0]); ((RRU_config_t *)&rru_config_msg.msg[0])->prach_ConfigIndex[0]);
ru->frame_parms = calloc(1, sizeof(*ru->frame_parms));
configure_rru(ru->idx, (void*)&rru_config_msg.msg[0]); configure_rru(ru->idx, (void*)&rru_config_msg.msg[0]);
......
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