Commit f5eaa7d7 authored by Sandeep Kumar's avatar Sandeep Kumar

minimal fixes from base rru run

parent 1f274a7b
...@@ -56,7 +56,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type) ...@@ -56,7 +56,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type)
uint16_t symbol_id, element_id; uint16_t symbol_id, element_id;
uint16_t db_fulllength, db_halflength; uint16_t db_fulllength, db_halflength;
int slotoffsetF, blockoffsetF; int slotoffsetF=0, blockoffsetF=0;
void *tx_buffer=NULL; void *tx_buffer=NULL;
int16_t *data_block=NULL; int16_t *data_block=NULL;
...@@ -105,7 +105,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type) ...@@ -105,7 +105,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type)
slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1; slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength; blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength;
tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF4_dl_header_t + db_fulllength*sizeof(int16_t)); tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF4_ul_header_t + db_fulllength*sizeof(int16_t));
IF4_ul_header_t *ul_header = (IF4_ul_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES); IF4_ul_header_t *ul_header = (IF4_ul_header_t *)(tx_buffer + MAC_HEADER_SIZE_BYTES);
data_block = (int16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4_ul_header_t); data_block = (int16_t*)(tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF4_ul_header_t);
...@@ -126,7 +126,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type) ...@@ -126,7 +126,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type)
// Write the packet(s) to the fronthaul // Write the packet(s) to the fronthaul
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice, if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
(int64_t) symbol_id, symbol_id,
&tx_buffer, &tx_buffer,
db_fulllength, db_fulllength,
1, 1,
...@@ -156,7 +156,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type) ...@@ -156,7 +156,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type)
// Write the packet to the fronthaul // Write the packet to the fronthaul
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice, if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
(int64_t) symbol_id, symbol_id,
&tx_buffer, &tx_buffer,
db_fulllength, db_fulllength,
1, 1,
...@@ -172,7 +172,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type) ...@@ -172,7 +172,7 @@ void send_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type)
} }
void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type, uint32_t *symbol_number) { void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type, uint32_t *symbol_number, uint16_t expected_packet) {
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
int32_t **txdataF = eNB->common_vars.txdataF[0]; int32_t **txdataF = eNB->common_vars.txdataF[0];
int32_t **rxdataF = eNB->common_vars.rxdataF[0]; int32_t **rxdataF = eNB->common_vars.rxdataF[0];
...@@ -182,30 +182,31 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type, ...@@ -182,30 +182,31 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
uint16_t db_fulllength, db_halflength; uint16_t db_fulllength, db_halflength;
int slotoffsetF, blockoffsetF; int slotoffsetF, blockoffsetF;
*packet_type = 0; if (expected_packet == IF4_PDLFFT) {
db_fulllength = = (12*fp->N_RB_DL);
} else {
db_fulllength = = (12*fp->N_RB_UL);
}
db_halflength = db_fulllength>>1;
int64_t *ret_type=(int64_t*)malloc(sizeof(int64_t)); int64_t *ret_type=(int64_t*)malloc(sizeof(int64_t));
void *rx_buffer=NULL; void *rx_buffer=NULL;
void **buff=NULL;
int16_t *data_block=NULL; int16_t *data_block=NULL;
// Read packet(s) from the fronthaul // Read packet(s) from the fronthaul
if (eNB->ifdevice.trx_read_func(&eNB->ifdevice, if (eNB->ifdevice.trx_read_func(&eNB->ifdevice,
ret_type, ret_type,
buff, &rx_buffer,
0, db_fulllength,
0) < 0) { 0) < 0) {
perror("ETHERNET read"); perror("ETHERNET read");
} }
*packet_type = *ret_type; *packet_type = *ret_type;
rx_buffer = buff[0];
if (*packet_type == IF4_PDLFFT) { if (*packet_type == IF4_PDLFFT) {
data_block = (int16_t*) (rx_buffer+sizeof_IF4_dl_header_t); data_block = (int16_t*) (rx_buffer+sizeof_IF4_dl_header_t);
db_halflength = (12*fp->N_RB_DL)>>1;
// Calculate from received packet // Calculate from received packet
slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1; slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength; blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength;
...@@ -224,9 +225,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type, ...@@ -224,9 +225,7 @@ void recv_IF4(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t *packet_type,
} else if (*packet_type == IF4_PULFFT) { } else if (*packet_type == IF4_PULFFT) {
data_block = (int16_t*) (rx_buffer+sizeof_IF4_ul_header_t); data_block = (int16_t*) (rx_buffer+sizeof_IF4_ul_header_t);
db_halflength = (12*fp->N_RB_UL)>>1;
// Calculate from received packet // Calculate from received packet
slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1; slotoffsetF = (subframe)*(fp->ofdm_symbol_size)*((fp->Ncp==1) ? 12 : 14) + 1;
blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength; blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength;
......
...@@ -2604,9 +2604,8 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl ...@@ -2604,9 +2604,8 @@ void phy_procedures_eNB_common_RX(PHY_VARS_eNB *eNB,const uint8_t abstraction_fl
if (eNB->node_function == NGFI_RRU_IF4 && is_prach_subframe(fp, frame, subframe)<=0) { if (eNB->node_function == NGFI_RRU_IF4 && is_prach_subframe(fp, frame, subframe)<=0) {
/// **** send_IF4 of rxdataF to RCC (no prach now) **** /// /// **** send_IF4 of rxdataF to RCC (no prach now) **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
//send_IF4(eNB, frame, subframe, IF4_PULFFT); send_IF4(eNB, frame, subframe, IF4_PULFFT);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
} }
......
...@@ -303,14 +303,15 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi ...@@ -303,14 +303,15 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi
int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) { int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
// Read nblocks info from packet itself
int nblocks = nsamps; int nblocks = nsamps;
int bytes_received=0; int bytes_received=0;
eth_state_t *eth = (eth_state_t*)device->priv; eth_state_t *eth = (eth_state_t*)device->priv;
int Mod_id = device->Mod_id; int Mod_id = device->Mod_id;
ssize_t packet_size = MAC_HEADER_SIZE_BYTES + sizeof_IF4_dl_header_t; ssize_t packet_size = MAC_HEADER_SIZE_BYTES + sizeof_IF4_dl_header_t;
void *test_buffer = (void*)malloc(packet_size); void *test_buffer = (void*)malloc(packet_size);
void *rx_buffer=NULL; void *rx_buffer=NULL;
IF4_dl_header_t *test_header = (IF4_dl_header_t*)(test_buffer + MAC_HEADER_SIZE_BYTES); IF4_dl_header_t *test_header = (IF4_dl_header_t*)(test_buffer + MAC_HEADER_SIZE_BYTES);
...@@ -339,7 +340,7 @@ int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp, ...@@ -339,7 +340,7 @@ int trx_eth_read_raw_IF4(openair0_device *device, openair0_timestamp *timestamp,
packet_size = RAW_IF4_PRACH_SIZE_BYTES - packet_size; packet_size = RAW_IF4_PRACH_SIZE_BYTES - packet_size;
} }
memcpy(buff[0], test_header, sizeof_IF4_dl_header_t); memcpy(buff[0], test_header, sizeof_IF4_dl_header_t);
rx_buffer = (void*)(buff[0]+sizeof_IF4_dl_header_t); rx_buffer = (void*)(buff[0]+sizeof_IF4_dl_header_t);
bytes_received = 0; bytes_received = 0;
......
...@@ -654,8 +654,8 @@ extern "C" { ...@@ -654,8 +654,8 @@ extern "C" {
} }
/* device specific */ /* device specific */
openair0_cfg[0].txlaunch_wait = 1;//manage when TX processing is triggered //openair0_cfg[0].txlaunch_wait = 1;//manage when TX processing is triggered
openair0_cfg[0].txlaunch_wait_slotcount = 1; //manage when TX processing is triggered //openair0_cfg[0].txlaunch_wait_slotcount = 1; //manage when TX processing is triggered
openair0_cfg[0].iq_txshift = 4;//shift openair0_cfg[0].iq_txshift = 4;//shift
openair0_cfg[0].iq_rxrescale = 15;//rescale iqs openair0_cfg[0].iq_rxrescale = 15;//rescale iqs
......
...@@ -127,7 +127,7 @@ extern volatile int start_UE; ...@@ -127,7 +127,7 @@ extern volatile int start_UE;
#endif #endif
extern volatile int oai_exit; extern volatile int oai_exit;
extern openair0_config_t *openair0_cfg; extern openair0_config_t openair0_cfg[MAX_CARDS];
extern pthread_cond_t sync_cond; extern pthread_cond_t sync_cond;
extern pthread_mutex_t sync_mutex; extern pthread_mutex_t sync_mutex;
...@@ -483,10 +483,9 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -483,10 +483,9 @@ static void* eNB_thread_rxtx( void* param ) {
} }
} else { } else {
/// **** recv_IF4 of txdataF from RCC **** /// /// **** recv_IF4 of txdataF from RCC **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
//recv_IF4(eNB, frame, subframe, packet_type, symbol_number); //recv_IF4(PHY_vars_eNB_g[0][proc->CC_id], proc->frame_tx, proc->subframe_tx, packet_type, symbol_number);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
} }
...@@ -533,8 +532,7 @@ static void* eNB_thread_rxtx( void* param ) { ...@@ -533,8 +532,7 @@ static void* eNB_thread_rxtx( void* param ) {
} else { } else {
/// **** send_IF4 of txdataF to RRU **** /// /// **** send_IF4 of txdataF to RRU **** ///
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
send_IF4(PHY_vars_eNB_g[0][proc->CC_id], proc->frame_tx, proc->subframe_tx, IF4_PDLFFT); send_IF4(PHY_vars_eNB_g[0][proc->CC_id], proc->frame_tx, proc->subframe_tx, IF4_PDLFFT);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 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