Commit 9549537e authored by yilmazt's avatar yilmazt

WIP: Minor changes

parent d908559a
......@@ -1762,7 +1762,8 @@ void kill_NR_RU_proc(int inst) {
pthread_cond_destroy(&proc->cond_gNBs);
}
int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) {
int check_capabilities(RU_t *ru,RRU_capabilities_t *cap)
{
FH_fmt_options_t fmt = cap->FH_fmt;
int i;
int found_band=0;
......@@ -1818,7 +1819,8 @@ char rru_formats[3][20] = {"OAI_IF5","MBP_IF5","OAI_IF4p5"};
char ru_if_formats[4][20] = {"LOCAL_RF","REMOTE_OAI_IF5","REMOTE_MBP_IF5","REMOTE_OAI_IF4p5"};
void configure_ru(int idx,
void *arg) {
void *arg)
{
RU_t *ru = RC.ru[idx];
RRU_config_t *config = (RRU_config_t *)arg;
RRU_capabilities_t *capabilities = (RRU_capabilities_t *)arg;
......@@ -1859,25 +1861,25 @@ void configure_ru(int idx,
void configure_rru(int idx,
void *arg) {
RRU_config_t *config = (RRU_config_t *)arg;
RRU_config_t *config = (RRU_config_t *)arg;
RU_t *ru = RC.ru[idx];
nfapi_nr_config_request_t *gNB_config = &ru->gNB_list[0]->gNB_config;
ru->nr_frame_parms->eutra_band = config->band_list[0];
ru->nr_frame_parms->dl_CarrierFreq = config->tx_freq[0];
ru->nr_frame_parms->ul_CarrierFreq = config->rx_freq[0];
ru->nr_frame_parms->eutra_band = config->band_list[0];
ru->nr_frame_parms->dl_CarrierFreq = config->tx_freq[0];
ru->nr_frame_parms->ul_CarrierFreq = config->rx_freq[0];
if (ru->nr_frame_parms->dl_CarrierFreq == ru->nr_frame_parms->ul_CarrierFreq) {
gNB_config->subframe_config.duplex_mode.value = TDD;
//ru->nr_frame_parms->tdd_config = config->tdd_config[0];
//ru->nr_frame_parms->tdd_config_S = config->tdd_config_S[0];
//ru->nr_frame_parms->tdd_config = config->tdd_config[0];
//ru->nr_frame_parms->tdd_config_S = config->tdd_config_S[0];
} else
gNB_config->subframe_config.duplex_mode.value = FDD;
gNB_config->subframe_config.duplex_mode.value = FDD;
ru->att_tx = config->att_tx[0];
ru->att_rx = config->att_rx[0];
gNB_config->rf_config.dl_carrier_bandwidth.value = config->N_RB_DL[0];
gNB_config->rf_config.ul_carrier_bandwidth.value = config->N_RB_UL[0];
ru->nr_frame_parms->threequarter_fs = config->threequarter_fs[0];
ru->att_tx = config->att_tx[0];
ru->att_rx = config->att_rx[0];
gNB_config->rf_config.dl_carrier_bandwidth.value = config->N_RB_DL[0];
gNB_config->rf_config.ul_carrier_bandwidth.value = config->N_RB_UL[0];
ru->nr_frame_parms->threequarter_fs = config->threequarter_fs[0];
//ru->nr_frame_parms->pdsch_config_common.referenceSignalPower = ru->max_pdschReferenceSignalPower-config->att_tx[0];
if (ru->function==NGFI_RRU_IF4p5) {
......@@ -2016,9 +2018,9 @@ void set_function_spec_param(RU_t *ru) {
ru->feprx = (get_nprocs()<=2) ? fep_full : fep_full; // this is frequency-shift + DFTs
ru->feptx_prec = feptx_prec; // need to do transmit Precoding + IDFTs
ru->feptx_ofdm = (get_nprocs()<=2) ? nr_feptx_ofdm : nr_feptx_ofdm_2thread; // need to do transmit Precoding + IDFTs
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
ru->fh_south_asynch_in = NULL; // no asynchronous UL
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
ru->fh_south_asynch_in = NULL; // no asynchronous UL
ru->start_rf = NULL; // no local RF
ru->stop_rf = NULL;
ru->start_if = start_if; // need to start if interface for IF5
......@@ -2173,11 +2175,11 @@ void RCconfig_RU(void) {
printf("Set RU mask to %lx\n",RC.ru_mask);
for (j = 0; j < RC.nb_RU; j++) {
RC.ru[j] = (RU_t *)malloc(sizeof(RU_t));
RC.ru[j] = (RU_t *)malloc(sizeof(RU_t));
memset((void *)RC.ru[j],0,sizeof(RU_t));
RC.ru[j]->idx = j;
RC.ru[j]->nr_frame_parms = (NR_DL_FRAME_PARMS *)malloc(sizeof(NR_DL_FRAME_PARMS));
RC.ru[j]->frame_parms = (LTE_DL_FRAME_PARMS *)malloc(sizeof(LTE_DL_FRAME_PARMS));
RC.ru[j]->frame_parms = (LTE_DL_FRAME_PARMS *)malloc(sizeof(LTE_DL_FRAME_PARMS));
printf("Creating RC.ru[%d]:%p\n", j, RC.ru[j]);
RC.ru[j]->if_timing = synch_to_ext_device;
......@@ -2213,13 +2215,13 @@ void RCconfig_RU(void) {
RC.ru[j]->function = gNodeB_3GPP;
printf("Setting function for RU %d to gNodeB_3GPP\n",j);
} else {
RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
RC.ru[j]->if_south = LOCAL_RF;
......@@ -2252,13 +2254,13 @@ void RCconfig_RU(void) {
} //strcmp(local_rf, "yes") == 0
else {
printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr));
RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
RC.ru[j]->if_south = REMOTE_IF5;
......
......@@ -894,8 +894,8 @@ int main( int argc, char **argv )
mode = normal_txrx;
memset(&openair0_cfg[0],0,sizeof(openair0_config_t)*MAX_CARDS);
memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
configure_linux();
logInit();
configure_linux();
printf("Reading in command-line options\n");
get_options ();
......
......@@ -63,8 +63,8 @@ void nr_gold_pbch(PHY_VARS_NR_UE* ue)
}
void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
unsigned short n_idDMRS,
unsigned short length_dmrs)
unsigned short n_idDMRS,
unsigned short length_dmrs)
{
unsigned char ns,l;
unsigned int n,x1,x2,x2tmp0;
......@@ -107,9 +107,9 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
}
void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
unsigned short lbar,
unsigned short *n_idDMRS,
unsigned short length_dmrs)
unsigned short lbar,
unsigned short *n_idDMRS,
unsigned short length_dmrs)
{
unsigned char ns,l;
unsigned int n,x1,x2,x2tmp0;
......@@ -164,8 +164,8 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
}
void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
uint16_t *N_n_scid,
uint8_t n_scid)
uint16_t *N_n_scid,
uint8_t n_scid)
{
uint32_t x1, x2, n;
uint8_t reset, slot, symb, q;
......
......@@ -32,8 +32,8 @@
@param PHY_VARS_NR_UE* ue structure provides configuration, frame parameters and the pointers to the 32 bits sequence storage tables
*/
int nr_pbch_dmrs_rx(int dmrss,
unsigned int *nr_gold_pbch,
int32_t *output);
unsigned int *nr_gold_pbch,
int32_t *output);
/*!\brief This function generates the NR Gold sequence (38-211, Sec 5.2.1) for the PDCCH DMRS.
@param PHY_VARS_NR_UE* ue structure provides configuration, frame parameters and the pointers to the 32 bits sequence storage tables
......@@ -66,7 +66,7 @@ void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
unsigned short length_dmrs);
void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
uint16_t *N_n_scid,
uint8_t n_scid);
uint16_t *N_n_scid,
uint8_t n_scid);
#endif
......@@ -207,9 +207,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
gNB_L1_rxtx_proc_t *proc,
int UE_id,
uint8_t harq_pid)
gNB_L1_rxtx_proc_t *proc,
int UE_id,
uint8_t harq_pid)
{
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
nfapi_nr_ul_config_ulsch_pdu *rel15_ul = &gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->ulsch_pdu;
......@@ -221,20 +221,20 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
G = nr_get_G(nfapi_ulsch_pdu_rel15->number_rbs,
nfapi_ulsch_pdu_rel15->number_symbols,
nfapi_ulsch_pdu_rel15->nb_re_dmrs,
nfapi_ulsch_pdu_rel15->length_dmrs,
nfapi_ulsch_pdu_rel15->Qm,
nfapi_ulsch_pdu_rel15->n_layers);
nfapi_ulsch_pdu_rel15->nb_re_dmrs,
nfapi_ulsch_pdu_rel15->length_dmrs,
nfapi_ulsch_pdu_rel15->Qm,
nfapi_ulsch_pdu_rel15->n_layers);
//----------------------------------------------------------
//------------------- ULSCH unscrambling -------------------
//----------------------------------------------------------
nr_ulsch_unscrambling(gNB->pusch_vars[UE_id]->llr,
G,
0,
Nid_cell,
rel15_ul->rnti);
G,
0,
Nid_cell,
rel15_ul->rnti);
//----------------------------------------------------------
//--------------------- ULSCH decoding ---------------------
......@@ -243,13 +243,13 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
//ret = nr_ulsch_decoding(gNB,
nr_ulsch_decoding(gNB,
UE_id,
gNB->pusch_vars[UE_id]->llr,
frame_parms,
proc->frame_rx,
nfapi_ulsch_pdu_rel15->number_symbols,
proc->slot_rx,
harq_pid,
0);
gNB->pusch_vars[UE_id]->llr,
frame_parms,
proc->frame_rx,
nfapi_ulsch_pdu_rel15->number_symbols,
proc->slot_rx,
harq_pid,
0);
// if (ret > ulsch_gNB->max_ldpc_iterations)
// n_errors++;
......
......@@ -2464,9 +2464,9 @@ void ue_pucch_procedures(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_
void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
uint8_t gNB_id,
uint8_t thread_id)
UE_nr_rxtx_proc_t *proc,
uint8_t gNB_id,
uint8_t thread_id)
{
fapi_nr_dci_pdu_rel15_t *ul_dci_pdu;
NR_UE_ULSCH_t *ulsch_ue;
......
......@@ -130,7 +130,8 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
uint8_t *pdu_buffer, unsigned int pdu_buffer_size);
static int MAC_LTE_PCAP_WritePDU(MAC_Context_Info_t *context,
const unsigned char *PDU, unsigned int length);
const unsigned char *PDU,
unsigned int length);
static void *opt_listener_thread(void *arg) {
ssize_t ret;
......@@ -333,7 +334,7 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
/* Write an individual PDU (PCAP packet header + mac-context + mac-pdu) */
static int MAC_LTE_PCAP_WritePDU(MAC_Context_Info_t *context,
const uint8_t *PDU,
unsigned int length)
unsigned int length)
{
pcaprec_hdr_t packet_header;
uint8_t context_header[256];
......
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