Commit d1d4bb9f authored by Elena_Lukashova's avatar Elena_Lukashova

Merge branch 'feature-59-tm4' of...

Merge branch 'feature-59-tm4' of https://gitlab.eurecom.fr/oai/openairinterface5g into feature-59-tm4
parents 024af3e7 41a26126
...@@ -85,11 +85,11 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) ...@@ -85,11 +85,11 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
#endif #endif
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) { for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) {
#ifdef DEBUG_DLSCH_FREE #ifdef DEBUG_DLSCH_FREE
printf("Freeing dlsch process %d c[%d] (%p)\n",i,r,dlsch->harq_processes[i]->c[r]); printf("Freeing dlsch process %d c[%d] (%p)\n",i,r,dlsch->harq_processes[i]->c[r]);
#endif #endif
if (dlsch->harq_processes[i]->c[r]) { if (dlsch->harq_processes[i]->c[r]) {
free16(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768); free16(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768);
dlsch->harq_processes[i]->c[r] = NULL; dlsch->harq_processes[i]->c[r] = NULL;
...@@ -98,17 +98,17 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) ...@@ -98,17 +98,17 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
free16(dlsch->harq_processes[i]->d[r],(96+12+3+(3*6144))); free16(dlsch->harq_processes[i]->d[r],(96+12+3+(3*6144)));
dlsch->harq_processes[i]->d[r] = NULL; dlsch->harq_processes[i]->d[r] = NULL;
} }
} }
free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t)); free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t));
dlsch->harq_processes[i] = NULL; dlsch->harq_processes[i] = NULL;
} }
} }
free16(dlsch,sizeof(LTE_eNB_DLSCH_t)); free16(dlsch,sizeof(LTE_eNB_DLSCH_t));
dlsch = NULL; dlsch = NULL;
} }
} }
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms) LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag, LTE_DL_FRAME_PARMS* frame_parms)
...@@ -218,7 +218,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_ ...@@ -218,7 +218,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
if (dlsch->harq_processes[i]->d[r]) if (dlsch->harq_processes[i]->d[r])
dlsch->harq_processes[i]->d[r][j] = LTE_NULL; dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
} }
} }
return(dlsch); return(dlsch);
...@@ -257,7 +257,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch) ...@@ -257,7 +257,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++)
if (dlsch->harq_processes[i]->d[r]) if (dlsch->harq_processes[i]->d[r])
dlsch->harq_processes[i]->d[r][j] = LTE_NULL; dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
} }
} }
} }
...@@ -553,8 +553,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, ...@@ -553,8 +553,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
return(0); return(0);
} }
int dlsch_encoding(unsigned char *a, int dlsch_encoding(PHY_VARS_eNB *eNB,
LTE_DL_FRAME_PARMS *frame_parms, unsigned char *a,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch,
int frame, int frame,
...@@ -568,6 +568,7 @@ int dlsch_encoding(unsigned char *a, ...@@ -568,6 +568,7 @@ int dlsch_encoding(unsigned char *a,
unsigned int crc=1; unsigned int crc=1;
unsigned short iind; unsigned short iind;
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
unsigned char harq_pid = dlsch->current_harq_pid; unsigned char harq_pid = dlsch->current_harq_pid;
unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb; unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb;
unsigned int A; unsigned int A;
...@@ -602,7 +603,7 @@ int dlsch_encoding(unsigned char *a, ...@@ -602,7 +603,7 @@ int dlsch_encoding(unsigned char *a,
printf("\n"); printf("\n");
*/ */
// Add 24-bit crc (polynomial A) to payload // Add 24-bit crc (polynomial A) to payload
crc = crc24a(a, //input bits for computation, A is a size of a crc = crc24a(a,
A)>>8; A)>>8;
a[A>>3] = ((uint8_t*)&crc)[2]; a[A>>3] = ((uint8_t*)&crc)[2];
a[1+(A>>3)] = ((uint8_t*)&crc)[1]; a[1+(A>>3)] = ((uint8_t*)&crc)[1];
...@@ -613,15 +614,15 @@ int dlsch_encoding(unsigned char *a, ...@@ -613,15 +614,15 @@ int dlsch_encoding(unsigned char *a,
// dlsch->harq_processes[harq_pid]->b = a; // dlsch->harq_processes[harq_pid]->b = a;
memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4); memcpy(dlsch->harq_processes[harq_pid]->b,a,(A/8)+4);
if (lte_segmentation(dlsch->harq_processes[harq_pid]->b, // bits after CRC attachement if (lte_segmentation(dlsch->harq_processes[harq_pid]->b,
dlsch->harq_processes[harq_pid]->c, // output from segmentation dlsch->harq_processes[harq_pid]->c,
dlsch->harq_processes[harq_pid]->B, //size of B=L+A dlsch->harq_processes[harq_pid]->B,
&dlsch->harq_processes[harq_pid]->C, //number of codeblocks &dlsch->harq_processes[harq_pid]->C,
&dlsch->harq_processes[harq_pid]->Cplus, //Number of segments of size K+ &dlsch->harq_processes[harq_pid]->Cplus,
&dlsch->harq_processes[harq_pid]->Cminus,//Number of segments of size K_ &dlsch->harq_processes[harq_pid]->Cminus,
&dlsch->harq_processes[harq_pid]->Kplus, //First segmentation size &dlsch->harq_processes[harq_pid]->Kplus,
&dlsch->harq_processes[harq_pid]->Kminus, //Second segmentation size &dlsch->harq_processes[harq_pid]->Kminus,
&dlsch->harq_processes[harq_pid]->F)<0) //Number of filler bits &dlsch->harq_processes[harq_pid]->F)<0)
return(-1); return(-1);
for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) { for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) {
...@@ -703,7 +704,7 @@ int dlsch_encoding(unsigned char *a, ...@@ -703,7 +704,7 @@ int dlsch_encoding(unsigned char *a,
r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r], r_offset += lte_rate_matching_turbo(dlsch->harq_processes[harq_pid]->RTC[r],
G, //G G, //G
dlsch->harq_processes[harq_pid]->w[r], dlsch->harq_processes[harq_pid]->w[r],
dlsch->harq_processes[harq_pid]->e+r_offset, // sequence of bits for transmission dlsch->harq_processes[harq_pid]->e+r_offset,
dlsch->harq_processes[harq_pid]->C, // C dlsch->harq_processes[harq_pid]->C, // C
dlsch->Nsoft, // Nsoft, dlsch->Nsoft, // Nsoft,
dlsch->Mdlharq, dlsch->Mdlharq,
...@@ -715,7 +716,6 @@ int dlsch_encoding(unsigned char *a, ...@@ -715,7 +716,6 @@ int dlsch_encoding(unsigned char *a,
nb_rb, nb_rb,
m); // r m); // r
stop_meas(rm_stats); stop_meas(rm_stats);
//printf("dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx);
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
if (r==dlsch->harq_processes[harq_pid]->C-1) if (r==dlsch->harq_processes[harq_pid]->C-1)
......
...@@ -312,8 +312,8 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a) ...@@ -312,8 +312,8 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a)
AMP); AMP);
if (dlsch_encoding(a, if (dlsch_encoding(eNB,
&eNB->frame_parms, a,
1, 1,
eNB->dlsch_MCH, eNB->dlsch_MCH,
proc->frame_tx, proc->frame_tx,
......
...@@ -111,8 +111,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag); ...@@ -111,8 +111,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag);
@param i_stats Time statistics for interleaving @param i_stats Time statistics for interleaving
@returns status @returns status
*/ */
int32_t dlsch_encoding(uint8_t *a, int32_t dlsch_encoding(PHY_VARS_eNB *eNB,
LTE_DL_FRAME_PARMS *frame_parms, uint8_t *a,
uint8_t num_pdcch_symbols, uint8_t num_pdcch_symbols,
LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch,
int frame, int frame,
......
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