Commit 3ce5d400 authored by laurent's avatar laurent

add comments in data structures, gcc warnings fixed

parent aa10676e
...@@ -615,7 +615,7 @@ void pusch_procedures_fromsplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB * ...@@ -615,7 +615,7 @@ void pusch_procedures_fromsplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB *
&ulsch_harq->Kplus, &ulsch_harq->Kplus,
&ulsch_harq->Kminus, &ulsch_harq->Kminus,
&ulsch_harq->F); &ulsch_harq->F);
int ret = ulsch_decoding_data(eNB, proc, i, harq_pid, ulsch_decoding_data(eNB, proc, i, harq_pid,
ulsch_harq->nb_rb>20 ? 1 : 0); ulsch_harq->nb_rb>20 ? 1 : 0);
stop_meas(&eNB->ulsch_decoding_stats); stop_meas(&eNB->ulsch_decoding_stats);
} // if ((ulsch) && } // if ((ulsch) &&
......
...@@ -623,8 +623,7 @@ void rx_rf(RU_t *ru, L1_rxtx_proc_t *proc) { ...@@ -623,8 +623,7 @@ void rx_rf(RU_t *ru, L1_rxtx_proc_t *proc) {
setAllfromTS(timestamp_rx, proc); setAllfromTS(timestamp_rx, proc);
} }
int tx_rf(RU_t *ru, L1_rxtx_proc_t *proc) { void tx_rf(RU_t *ru, L1_rxtx_proc_t *proc) {
int ret=0;
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
void *txp[ru->nb_tx]; void *txp[ru->nb_tx];
int i; int i;
...@@ -672,7 +671,7 @@ int tx_rf(RU_t *ru, L1_rxtx_proc_t *proc) { ...@@ -672,7 +671,7 @@ int tx_rf(RU_t *ru, L1_rxtx_proc_t *proc) {
/* add fail safe for late command end */ /* add fail safe for late command end */
// prepare tx buffer pointers // prepare tx buffer pointers
ret=ru->rfdevice.trx_write_func(&ru->rfdevice, ru->rfdevice.trx_write_func(&ru->rfdevice,
proc->timestamp_tx+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension, proc->timestamp_tx+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
txp, txp,
siglen+sf_extension, siglen+sf_extension,
...@@ -682,7 +681,7 @@ int tx_rf(RU_t *ru, L1_rxtx_proc_t *proc) { ...@@ -682,7 +681,7 @@ int tx_rf(RU_t *ru, L1_rxtx_proc_t *proc) {
(long long unsigned int)proc->timestamp_tx,proc->frame_tx,proc->subframe_tx); (long long unsigned int)proc->timestamp_tx,proc->frame_tx,proc->subframe_tx);
} }
return ret; return;
} }
static void *ru_thread( void *param ) { static void *ru_thread( void *param ) {
......
...@@ -13,10 +13,9 @@ ...@@ -13,10 +13,9 @@
#define MTU 65536 #define MTU 65536
#define UDP_TIMEOUT 900000L // in micro second (struct timeval, NOT struct timespec) #define UDP_TIMEOUT 900000L // in micro second (struct timeval, NOT struct timespec)
// linux may timeout for a much longer time (up to 10ms) // linux may timeout for a much longer time (up to 10ms)
#define MAX_BLOCKS 16 #define blockAlign 32 //bytes to align memory for SIMD copy (256 bits vectors)
#define blockAlign 32 //bytes
// FS6 transport configuration and handler
typedef struct { typedef struct {
char *sourceIP; char *sourceIP;
char *sourcePort; char *sourcePort;
...@@ -29,6 +28,8 @@ typedef struct { ...@@ -29,6 +28,8 @@ typedef struct {
#define CTsentCUv0 0xA500 #define CTsentCUv0 0xA500
#define CTsentDUv0 0x5A00 #define CTsentDUv0 0x5A00
// Main FS6 transport layer header
// All packets starts with this header
typedef struct commonUDP_s { typedef struct commonUDP_s {
uint64_t timestamp; // id of the group (subframe for LTE) uint64_t timestamp; // id of the group (subframe for LTE)
uint16_t nbBlocks; // total number of blocks for this timestamp uint16_t nbBlocks; // total number of blocks for this timestamp
...@@ -37,14 +38,8 @@ typedef struct commonUDP_s { ...@@ -37,14 +38,8 @@ typedef struct commonUDP_s {
uint16_t contentBytes; // will be sent in a UDP packet, so must be < 2^16 bytes uint16_t contentBytes; // will be sent in a UDP packet, so must be < 2^16 bytes
} commonUDP_t; } commonUDP_t;
typedef struct frequency_s { // FS6 UL common header (DU to CU)
int frame; // gives the RACH detection data and is always sent to inform the CU that a subframe arrived
int subframe;
int sampleSize;
int nbAnt;
int nbSamples;
} frequency_t;
typedef struct { typedef struct {
uint16_t max_preamble[4]; uint16_t max_preamble[4];
uint16_t max_preamble_energy[4]; uint16_t max_preamble_energy[4];
...@@ -52,6 +47,8 @@ typedef struct { ...@@ -52,6 +47,8 @@ typedef struct {
uint16_t avg_preamble_energy[4]; uint16_t avg_preamble_energy[4];
} fs6_ul_t; } fs6_ul_t;
// FS6 DL common header (CU to DU)
// gives the DCI configuration from each subframe
typedef struct { typedef struct {
uint8_t pbch_pdu[4]; uint8_t pbch_pdu[4];
int num_pdcch_symbols; int num_pdcch_symbols;
...@@ -62,6 +59,9 @@ typedef struct { ...@@ -62,6 +59,9 @@ typedef struct {
LTE_eNB_PHICH phich_vars; LTE_eNB_PHICH phich_vars;
} fs6_dl_t; } fs6_dl_t;
// a value to type all sub packets,
// to detect errors, and to be able to extend to other versions
// the first byte of each sub structure should match one of these values
enum pckType { enum pckType {
fs6UlConfig=25, fs6UlConfig=25,
fs6DlConfig=26, fs6DlConfig=26,
...@@ -72,6 +72,8 @@ enum pckType { ...@@ -72,6 +72,8 @@ enum pckType {
fs6ULindicationSr=41, fs6ULindicationSr=41,
}; };
// CU to DU definition of a future UL subframe decode
// defines a UE future data plane
typedef struct { typedef struct {
enum pckType type:8; enum pckType type:8;
uint16_t UE_id; uint16_t UE_id;
...@@ -136,6 +138,8 @@ typedef struct { ...@@ -136,6 +138,8 @@ typedef struct {
uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP]; uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP];
} fs6_dl_ulsched_t; } fs6_dl_ulsched_t;
// CU to DU defintion of a DL packet for a given UE
// The data itself is padded at the end of this structure
typedef struct { typedef struct {
enum pckType type:8; enum pckType type:8;
int UE_id; int UE_id;
...@@ -150,24 +154,28 @@ typedef struct { ...@@ -150,24 +154,28 @@ typedef struct {
uint8_t pdsch_start; uint8_t pdsch_start;
uint8_t sib1_br_flag; uint8_t sib1_br_flag;
uint16_t i0; uint16_t i0;
uint32_t rb_alloc[4];; uint32_t rb_alloc[4];
int dataLen; int dataLen;
} fs6_dl_uespec_t; } fs6_dl_uespec_t;
// CU to DU definition of CCH channel
typedef struct { typedef struct {
int16_t UE_id; int16_t UE_id;
LTE_eNB_UCI cch_vars; LTE_eNB_UCI cch_vars;
} fs6_dl_uespec_ulcch_element_t; } fs6_dl_uespec_ulcch_element_t;
// header to group all UE CCH channels definitions in one UDP packet
typedef struct { typedef struct {
enum pckType type:8; enum pckType type:8;
int16_t nb_active_ue; int16_t nb_active_ue;
} fs6_dl_uespec_ulcch_t; } fs6_dl_uespec_ulcch_t;
// code internal, not transmitted as this
typedef struct { typedef struct {
int ta; int ta;
} ul_propagation_t; } ul_propagation_t;
// One UE UL data, data plane, UE data appended after the header
typedef struct { typedef struct {
enum pckType type:8; enum pckType type:8;
short UE_id; short UE_id;
...@@ -184,6 +192,7 @@ typedef struct { ...@@ -184,6 +192,7 @@ typedef struct {
uint8_t cqi_crc_status; uint8_t cqi_crc_status;
} fs6_ul_uespec_t; } fs6_ul_uespec_t;
// UL UCI (control plane), per UE
typedef struct { typedef struct {
enum pckType type:8; enum pckType type:8;
int UEid; int UEid;
...@@ -198,6 +207,7 @@ typedef struct { ...@@ -198,6 +207,7 @@ typedef struct {
int32_t stat; int32_t stat;
} fs6_ul_uespec_uci_element_t; } fs6_ul_uespec_uci_element_t;
// all segments UCI grouped in one UDP packet
typedef struct { typedef struct {
enum pckType type:8; enum pckType type:8;
int16_t nb_active_ue; int16_t nb_active_ue;
...@@ -239,7 +249,7 @@ void *du_fs6(void *arg); ...@@ -239,7 +249,7 @@ void *du_fs6(void *arg);
void fill_rf_config(RU_t *ru, char *rf_config_file); void fill_rf_config(RU_t *ru, char *rf_config_file);
int init_rf(RU_t *ru); int init_rf(RU_t *ru);
void rx_rf(RU_t *ru, L1_rxtx_proc_t *proc); void rx_rf(RU_t *ru, L1_rxtx_proc_t *proc);
int tx_rf(RU_t *ru, L1_rxtx_proc_t *proc); void tx_rf(RU_t *ru, L1_rxtx_proc_t *proc);
void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe); void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe);
void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc); void pmch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc);
bool dlsch_procedures(PHY_VARS_eNB *eNB, bool dlsch_procedures(PHY_VARS_eNB *eNB,
......
...@@ -1187,11 +1187,9 @@ void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) { ...@@ -1187,11 +1187,9 @@ void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) {
} else { } else {
if ( rdata->nbSegments != ulsch_harq->processedSegments ) { if ( rdata->nbSegments != ulsch_harq->processedSegments ) {
int nb=abortTpool(&proc->threadPool, req->key); int nb=abortTpool(&proc->threadPool, req->key);
printf("nb1:%d\n", nb);
nb+=abortNotifiedFIFO(&proc->respDecode, req->key); nb+=abortNotifiedFIFO(&proc->respDecode, req->key);
printf("nb2:%d\n", nb);
proc->nbDecode-=nb; proc->nbDecode-=nb;
LOG_I(PHY,"uplink segment error %d/%d, aborted %d segments",rdata->segment_r,rdata->nbSegments, nb); LOG_I(PHY,"uplink segment error %d/%d, aborted %d segments\n",rdata->segment_r,rdata->nbSegments, nb);
AssertFatal(ulsch_harq->processedSegments+nb == rdata->nbSegments,"processed: %d, aborted: %d, total %d\n", AssertFatal(ulsch_harq->processedSegments+nb == rdata->nbSegments,"processed: %d, aborted: %d, total %d\n",
ulsch_harq->processedSegments, nb, rdata->nbSegments); ulsch_harq->processedSegments, nb, rdata->nbSegments);
ulsch_harq->processedSegments=rdata->nbSegments; ulsch_harq->processedSegments=rdata->nbSegments;
...@@ -1253,7 +1251,7 @@ void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) { ...@@ -1253,7 +1251,7 @@ void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) {
} }
void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
uint32_t ret=0,i; uint32_t i;
uint32_t harq_pid; uint32_t harq_pid;
uint8_t nPRS; uint8_t nPRS;
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms; LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
...@@ -1262,7 +1260,6 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { ...@@ -1262,7 +1260,6 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
const int subframe = proc->subframe_rx; const int subframe = proc->subframe_rx;
const int frame = proc->frame_rx; const int frame = proc->frame_rx;
uint32_t harq_pid0 = subframe2harq_pid(&eNB->frame_parms,frame,subframe); uint32_t harq_pid0 = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
int rvidx_tab[4] = {0,2,3,1};
for (i = 0; i < NUMBER_OF_UE_MAX; i++) { for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
ulsch = eNB->ulsch[i]; ulsch = eNB->ulsch[i];
...@@ -1316,7 +1313,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) { ...@@ -1316,7 +1313,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
rx_ulsch(eNB,proc, i); rx_ulsch(eNB,proc, i);
stop_meas(&eNB->ulsch_demodulation_stats); stop_meas(&eNB->ulsch_demodulation_stats);
start_meas(&eNB->ulsch_decoding_stats); start_meas(&eNB->ulsch_decoding_stats);
ret = ulsch_decoding(eNB,proc, ulsch_decoding(eNB,proc,
i, i,
0, // control_only_flag 0, // control_only_flag
ulsch_harq->V_UL_DAI, ulsch_harq->V_UL_DAI,
......
...@@ -184,7 +184,7 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -184,7 +184,7 @@ rx_sdu(const module_id_t enb_mod_idP,
UE_template_ptr->scheduled_ul_bytes = 0; UE_template_ptr->scheduled_ul_bytes = 0;
} }
} else { // sduP == NULL => error } else { // sduP == NULL => error
LOG_W(MAC, "[eNB %d][PUSCH %d] CC_id %d %d.%d ULSCH in error in round %d, ul_cqi %d, UE_id %d, RNTI %x\n", LOG_W(MAC, "[eNB %d][PUSCH %d] CC_id %d %d.%d ULSCH in error in round %d, ul_cqi %d, UE_id %d, RNTI %x (len %d)\n",
enb_mod_idP, enb_mod_idP,
harq_pid, harq_pid,
CC_idP, CC_idP,
...@@ -193,7 +193,8 @@ rx_sdu(const module_id_t enb_mod_idP, ...@@ -193,7 +193,8 @@ rx_sdu(const module_id_t enb_mod_idP,
UE_scheduling_control->round_UL[CC_idP][harq_pid], UE_scheduling_control->round_UL[CC_idP][harq_pid],
ul_cqi, ul_cqi,
UE_id, UE_id,
current_rnti); current_rnti,
sdu_lenP);
if (ul_cqi > 200) { // too high energy pattern if (ul_cqi > 200) { // too high energy pattern
UE_scheduling_control->pusch_snr[CC_idP] = ul_cqi; UE_scheduling_control->pusch_snr[CC_idP] = ul_cqi;
......
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