Commit 85d89164 authored by Robert Schmidt's avatar Robert Schmidt

Refactor F1 Setup Req: Move radio info into cell

parent 7456cf94
...@@ -90,6 +90,30 @@ typedef struct f1ap_plmn_t { ...@@ -90,6 +90,30 @@ typedef struct f1ap_plmn_t {
uint8_t mnc_digit_length; uint8_t mnc_digit_length;
} f1ap_plmn_t; } f1ap_plmn_t;
typedef enum f1ap_mode_t { F1AP_MODE_TDD = 0, F1AP_MODE_FDD = 1 } f1ap_mode_t;
typedef struct f1ap_nr_frequency_info_t {
uint32_t arfcn;
int band;
} f1ap_nr_frequency_info_t;
typedef struct f1ap_transmission_bandwidth_t {
uint8_t scs;
uint16_t nrb;
} f1ap_transmission_bandwidth_t;
typedef struct f1ap_fdd_info_t {
f1ap_nr_frequency_info_t ul_freqinfo;
f1ap_nr_frequency_info_t dl_freqinfo;
f1ap_transmission_bandwidth_t ul_tbw;
f1ap_transmission_bandwidth_t dl_tbw;
} f1ap_fdd_info_t;
typedef struct f1ap_tdd_info_t {
f1ap_nr_frequency_info_t freqinfo;
f1ap_transmission_bandwidth_t tbw;
} f1ap_tdd_info_t;
typedef struct f1ap_served_cell_info_t { typedef struct f1ap_served_cell_info_t {
// NR CGI // NR CGI
f1ap_plmn_t plmn; f1ap_plmn_t plmn;
...@@ -105,6 +129,12 @@ typedef struct f1ap_served_cell_info_t { ...@@ -105,6 +129,12 @@ typedef struct f1ap_served_cell_info_t {
uint16_t num_ssi; uint16_t num_ssi;
uint8_t sst; uint8_t sst;
uint8_t sd; uint8_t sd;
f1ap_mode_t mode;
union {
f1ap_fdd_info_t fdd;
f1ap_tdd_info_t tdd;
};
} f1ap_served_cell_info_t; } f1ap_served_cell_info_t;
typedef struct f1ap_setup_req_s { typedef struct f1ap_setup_req_s {
...@@ -119,52 +149,6 @@ typedef struct f1ap_setup_req_s { ...@@ -119,52 +149,6 @@ typedef struct f1ap_setup_req_s {
f1ap_served_cell_info_t info; f1ap_served_cell_info_t info;
} cell[F1AP_MAX_NB_CELLS]; } cell[F1AP_MAX_NB_CELLS];
// fdd_flag = 1 means FDD, 0 means TDD
int fdd_flag;
union {
struct fdd_s {
uint32_t ul_nr_arfcn;
uint8_t ul_scs;
uint16_t ul_nrb;
uint32_t dl_nr_arfcn;
uint8_t dl_scs;
uint16_t dl_nrb;
uint32_t sul_active;
uint32_t sul_nr_arfcn;
uint8_t sul_scs;
uint16_t sul_nrb;
uint8_t ul_num_frequency_bands;
uint16_t ul_nr_band[32];
uint8_t ul_num_sul_frequency_bands;
uint16_t ul_nr_sul_band[32];
uint8_t dl_num_frequency_bands;
uint16_t dl_nr_band[32];
uint8_t dl_num_sul_frequency_bands;
uint16_t dl_nr_sul_band[32];
} fdd;
struct tdd_s {
uint32_t nr_arfcn;
uint8_t scs;
uint16_t nrb;
uint32_t sul_active;
uint32_t sul_nr_arfcn;
uint8_t sul_scs;
uint16_t sul_nrb;
uint8_t num_frequency_bands;
uint16_t nr_band[32];
uint8_t num_sul_frequency_bands;
uint16_t nr_sul_band[32];
} tdd;
} nr_mode_info[F1AP_MAX_NB_CELLS];
char *measurement_timing_information[F1AP_MAX_NB_CELLS]; char *measurement_timing_information[F1AP_MAX_NB_CELLS];
uint8_t ranac[F1AP_MAX_NB_CELLS]; uint8_t ranac[F1AP_MAX_NB_CELLS];
......
...@@ -146,53 +146,45 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance, ...@@ -146,53 +146,45 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
// FDD Cells // FDD Cells
if (servedCellInformation->nR_Mode_Info.present==F1AP_NR_Mode_Info_PR_fDD) { if (servedCellInformation->nR_Mode_Info.present==F1AP_NR_Mode_Info_PR_fDD) {
struct fdd_s *FDDs=&req->nr_mode_info[i].fdd; req->cell[i].info.mode = F1AP_MODE_FDD;
f1ap_fdd_info_t *FDDs = &req->cell[i].info.fdd;
F1AP_FDD_Info_t * fDD_Info=servedCellInformation->nR_Mode_Info.choice.fDD; F1AP_FDD_Info_t * fDD_Info=servedCellInformation->nR_Mode_Info.choice.fDD;
FDDs->ul_nr_arfcn=fDD_Info->uL_NRFreqInfo.nRARFCN; FDDs->ul_freqinfo.arfcn = fDD_Info->uL_NRFreqInfo.nRARFCN;
FDDs->ul_num_frequency_bands=fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count; AssertFatal(fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count == 1, "cannot handle more than one frequency band\n");
for (int f=0; f < fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count; f++) { for (int f=0; f < fDD_Info->uL_NRFreqInfo.freqBandListNr.list.count; f++) {
F1AP_FreqBandNrItem_t * FreqItem=fDD_Info->uL_NRFreqInfo.freqBandListNr.list.array[f]; F1AP_FreqBandNrItem_t * FreqItem=fDD_Info->uL_NRFreqInfo.freqBandListNr.list.array[f];
FDDs->ul_nr_band[f]=FreqItem->freqBandIndicatorNr; FDDs->ul_freqinfo.band = FreqItem->freqBandIndicatorNr;
int num_available_supported_SULBands=FreqItem->supportedSULBandList.list.count; AssertFatal(FreqItem->supportedSULBandList.list.count == 0, "cannot handle SUL bands!\n");
for (int sul=0; sul < num_available_supported_SULBands; sul ++ ) {
F1AP_SupportedSULFreqBandItem_t * SulItem= FreqItem->supportedSULBandList.list.array[sul];
FDDs->ul_nr_sul_band[sul]=SulItem->freqBandIndicatorNr;
} }
} FDDs->dl_freqinfo.arfcn = fDD_Info->dL_NRFreqInfo.nRARFCN;
FDDs->dl_nr_arfcn=fDD_Info->dL_NRFreqInfo.nRARFCN;
int dlBands=fDD_Info->dL_NRFreqInfo.freqBandListNr.list.count; int dlBands=fDD_Info->dL_NRFreqInfo.freqBandListNr.list.count;
AssertFatal(dlBands == 0, "cannot handled more than one frequency band\n");
for (int dlB=0; dlB < dlBands; dlB++) { for (int dlB=0; dlB < dlBands; dlB++) {
F1AP_FreqBandNrItem_t * FreqItem=fDD_Info->dL_NRFreqInfo.freqBandListNr.list.array[dlB]; F1AP_FreqBandNrItem_t * FreqItem=fDD_Info->dL_NRFreqInfo.freqBandListNr.list.array[dlB];
FDDs->dl_nr_band[dlB]=FreqItem->freqBandIndicatorNr; FDDs->dl_freqinfo.band = FreqItem->freqBandIndicatorNr;
int num_available_supported_SULBands = FreqItem->supportedSULBandList.list.count; int num_available_supported_SULBands = FreqItem->supportedSULBandList.list.count;
for (int sul=0; sul < num_available_supported_SULBands; sul ++ ) { AssertFatal(num_available_supported_SULBands == 0, "cannot handle SUL bands!\n");
F1AP_SupportedSULFreqBandItem_t * SulItem= FreqItem->supportedSULBandList.list.array[sul];
FDDs->ul_nr_sul_band[sul]=SulItem->freqBandIndicatorNr;
}
} }
FDDs->ul_scs=fDD_Info->uL_Transmission_Bandwidth.nRSCS; FDDs->ul_tbw.scs = fDD_Info->uL_Transmission_Bandwidth.nRSCS;
FDDs->ul_nrb=nrb_lut[fDD_Info->uL_Transmission_Bandwidth.nRNRB]; FDDs->ul_tbw.nrb = nrb_lut[fDD_Info->uL_Transmission_Bandwidth.nRNRB];
FDDs->dl_scs=fDD_Info->dL_Transmission_Bandwidth.nRSCS; FDDs->dl_tbw.scs = fDD_Info->dL_Transmission_Bandwidth.nRSCS;
FDDs->dl_nrb=nrb_lut[fDD_Info->dL_Transmission_Bandwidth.nRNRB]; FDDs->dl_tbw.nrb = nrb_lut[fDD_Info->dL_Transmission_Bandwidth.nRNRB];
} } else if (servedCellInformation->nR_Mode_Info.present==F1AP_NR_Mode_Info_PR_tDD) {
req->cell[i].info.mode = F1AP_MODE_TDD;
// TDD f1ap_tdd_info_t *TDDs = &req->cell[i].info.tdd;
if (servedCellInformation->nR_Mode_Info.present==F1AP_NR_Mode_Info_PR_tDD) { F1AP_TDD_Info_t *tDD_Info = servedCellInformation->nR_Mode_Info.choice.tDD;
struct tdd_s *TDDs=&req->nr_mode_info[i].tdd; TDDs->freqinfo.arfcn = tDD_Info->nRFreqInfo.nRARFCN;
F1AP_TDD_Info_t * tDD_Info=servedCellInformation->nR_Mode_Info.choice.tDD; AssertFatal(tDD_Info->nRFreqInfo.freqBandListNr.list.count == 1, "cannot handle more than one frequency band\n");
TDDs->nr_arfcn=tDD_Info->nRFreqInfo.nRARFCN;
TDDs->num_frequency_bands=tDD_Info->nRFreqInfo.freqBandListNr.list.count;
for (int f=0; f < tDD_Info->nRFreqInfo.freqBandListNr.list.count; f++) { for (int f=0; f < tDD_Info->nRFreqInfo.freqBandListNr.list.count; f++) {
struct F1AP_FreqBandNrItem * FreqItem=tDD_Info->nRFreqInfo.freqBandListNr.list.array[f]; struct F1AP_FreqBandNrItem * FreqItem=tDD_Info->nRFreqInfo.freqBandListNr.list.array[f];
TDDs->nr_band[f]=FreqItem->freqBandIndicatorNr; TDDs->freqinfo.band = FreqItem->freqBandIndicatorNr;
int num_available_supported_SULBands=FreqItem->supportedSULBandList.list.count; int num_available_supported_SULBands = FreqItem->supportedSULBandList.list.count;
for (int sul=0; sul < num_available_supported_SULBands; sul ++ ) { AssertFatal(num_available_supported_SULBands == 0, "cannot hanlde SUL bands!\n");
struct F1AP_SupportedSULFreqBandItem * SulItem= FreqItem->supportedSULBandList.list.array[sul];
TDDs->nr_sul_band[sul]=SulItem->freqBandIndicatorNr;
}
} }
TDDs->scs=tDD_Info->transmission_Bandwidth.nRSCS; TDDs->tbw.scs = tDD_Info->transmission_Bandwidth.nRSCS;
TDDs->nrb=nrb_lut[tDD_Info->transmission_Bandwidth.nRNRB]; TDDs->tbw.nrb = nrb_lut[tDD_Info->transmission_Bandwidth.nRNRB];
} else {
AssertFatal(false, "unknown NR Mode info %d\n", servedCellInformation->nR_Mode_Info.present);
} }
struct F1AP_GNB_DU_System_Information * DUsi=served_cells_item->gNB_DU_System_Information; struct F1AP_GNB_DU_System_Information * DUsi=served_cells_item->gNB_DU_System_Information;
......
...@@ -1987,35 +1987,25 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) { ...@@ -1987,35 +1987,25 @@ int RCconfig_NR_DU_F1(MessageDef *msg_p, uint32_t i) {
if (rrc->configuration.scc->tdd_UL_DL_ConfigurationCommon) { if (rrc->configuration.scc->tdd_UL_DL_ConfigurationCommon) {
LOG_I(GNB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k); LOG_I(GNB_APP,"ngran_DU: Configuring Cell %d for TDD\n",k);
f1Setup->fdd_flag = 0; f1Setup->cell[k].info.mode = F1AP_MODE_TDD;
f1Setup->nr_mode_info[k].tdd.nr_arfcn = rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA; f1ap_tdd_info_t *tdd = &f1Setup->cell[k].info.tdd;
f1Setup->nr_mode_info[k].tdd.scs = rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing; tdd->freqinfo.arfcn = rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencyPointA;
f1Setup->nr_mode_info[k].tdd.nrb = rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth; tdd->tbw.scs = rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
f1Setup->nr_mode_info[k].tdd.num_frequency_bands = 1; tdd->tbw.nrb = rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
f1Setup->nr_mode_info[k].tdd.nr_band[0] = *rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]; tdd->freqinfo.band = *rrc->configuration.scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
f1Setup->nr_mode_info[k].tdd.sul_active = 0;
} else { } else {
/***************** for test *****************/ /***************** for test *****************/
LOG_I(GNB_APP,"ngran_DU: Configuring Cell %d for FDD\n",k); LOG_I(GNB_APP,"ngran_DU: Configuring Cell %d for FDD\n",k);
f1Setup->fdd_flag = 1; f1Setup->cell[k].info.mode = F1AP_MODE_FDD;
f1Setup->nr_mode_info[k].fdd.dl_nr_arfcn = 26200UL; f1ap_fdd_info_t *fdd = &f1Setup->cell[k].info.fdd;
f1Setup->nr_mode_info[k].fdd.ul_nr_arfcn = 26200UL; fdd->dl_freqinfo.arfcn = 26200UL;
// For LTE use scs field to carry prefix type and number of antennas fdd->ul_freqinfo.arfcn = 26200UL;
f1Setup->nr_mode_info[k].fdd.dl_scs = 0; fdd->dl_tbw.scs = 0;
f1Setup->nr_mode_info[k].fdd.ul_scs = 0; fdd->ul_tbw.scs = 0;
// use nrb field to hold LTE N_RB_DL (0...5) fdd->dl_tbw.nrb = 3;
f1Setup->nr_mode_info[k].fdd.ul_nrb = 3; fdd->ul_tbw.nrb = 3;
f1Setup->nr_mode_info[k].fdd.ul_nrb = 3; fdd->dl_freqinfo.band = 7;
// RK: we need to check there value for FDD's frequency_bands DL/UL fdd->ul_freqinfo.band = 7;
f1Setup->nr_mode_info[k].fdd.ul_num_frequency_bands = 1;
f1Setup->nr_mode_info[k].fdd.ul_nr_band[0] = 7;
f1Setup->nr_mode_info[k].fdd.dl_num_frequency_bands = 1;
f1Setup->nr_mode_info[k].fdd.dl_nr_band[0] = 7;
f1Setup->nr_mode_info[k].fdd.ul_num_sul_frequency_bands = 0;
f1Setup->nr_mode_info[k].fdd.ul_nr_sul_band[0] = 7;
f1Setup->nr_mode_info[k].fdd.dl_num_sul_frequency_bands = 0;
f1Setup->nr_mode_info[k].fdd.dl_nr_sul_band[0] = 7;
f1Setup->nr_mode_info[k].fdd.sul_active = 0;
/***************** for test *****************/ /***************** for test *****************/
} }
......
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