Commit 849c5e0c authored by Raymond Knopp's avatar Raymond Knopp

F1_SETUP tested

parent 9a71d555
......@@ -244,6 +244,8 @@ void *eNB_app_task(void *args_p) {
}
LOG_I(ENB_APP,"TASK_ENB_APP is ready\n");
do {
// Wait for a message
itti_receive_msg (TASK_ENB_APP, &msg_p);
......
......@@ -1991,7 +1991,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nrb = rrc->carrier[0].mib.message.dl_Bandwidth;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.num_frequency_bands = 1;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nr_band[0] = rrc->carrier[0].sib1->freqBandIndicator;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.sul_active = 0;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.sul_active = 0;
} else {
LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for FDD\n",k);
F1AP_SETUP_REQ (msg_p).fdd_flag = 1;
......@@ -2716,12 +2716,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
"value of X2ParamList.numelt %d must be lower than X2AP_MAX_NB_ENB_IP_ADDRESS %d value: reconsider to increase X2AP_MAX_NB_ENB_IP_ADDRESS\n",
X2ParamList.numelt,X2AP_MAX_NB_ENB_IP_ADDRESS);
X2AP_REGISTER_ENB_REQ (msg_p).nb_x2 = 0;
LOG_I(X2AP,"X2ParamList.numelt %d\n",X2ParamList.numelt);
for (l = 0; l < X2ParamList.numelt; l++) {
X2AP_REGISTER_ENB_REQ (msg_p).nb_x2 += 1;
strcpy(X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4_address,*(X2ParamList.paramarray[l][ENB_X2_IPV4_ADDRESS_IDX].strptr));
strcpy(X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6_address,*(X2ParamList.paramarray[l][ENB_X2_IPV6_ADDRESS_IDX].strptr));
LOG_I(X2AP,"registering with ip : %s\n",*(X2ParamList.paramarray[l][ENB_X2_IPV4_ADDRESS_IDX].strptr));
if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) {
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1;
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6 = 0;
......@@ -2901,7 +2902,7 @@ void extract_and_decode_SI(int inst,int si_ind,uint8_t *si_container,int si_cont
eNB_RRC_INST *rrc = RC.rrc[inst];
rrc_eNB_carrier_data_t *carrier = &rrc->carrier[0];
LTE_BCCH_DL_SCH_Message_t *bcch_message ;
AssertFatal(si_ind==0,"Can only handle a single SI block for now\n");
AssertFatal(si_ind==2,"Can only handle a single SI block for now\n");
LOG_I(ENB_APP, "rrc inst %d: Trying to decode SI block %d @ %p, length %d\n",inst,si_ind,si_container,si_container_length);
// point to first SI block
bcch_message = &carrier->systemInformation;
......@@ -3088,15 +3089,19 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
(check_plmn_identity(carrier, resp->mcc[j], resp->mnc[j], resp->mnc_digit_length[j])>0 &&
resp->nrpci[j] == carrier->physCellId)) {
// copy system information and decode it
for (si_ind=0; si_ind<resp->num_SI[j]; si_ind++) {
for (si_ind=2; si_ind<10; si_ind++) {
//printf("SI %d size %d: ", si_ind, resp->SI_container_length[j][si_ind]);
//for (int n=0;n<resp->SI_container_length[j][si_ind];n++)
// printf("%02x ",resp->SI_container[j][si_ind][n]);
//printf("\n");
extract_and_decode_SI(i,
si_ind,
resp->SI_container[j][si_ind],
resp->SI_container_length[j][si_ind]);
if (si_ind==6) si_ind=9;
if (resp->SI_container[j][si_ind] != NULL) {
extract_and_decode_SI(i,
si_ind,
resp->SI_container[j][si_ind],
resp->SI_container_length[j][si_ind]);
}
}
// perform MAC/L1 common configuration
......
......@@ -357,18 +357,20 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
//for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
// printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
//printf("\n");
for (int sIBtype=2;sIBtype<33;sIBtype++) {
if (f1ap_setup_resp->SI_container[i][sIBtype]!=NULL) {
AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
for (int j=2;
j<10;
j++) {
if (j==6) j=9;
if (f1ap_setup_resp->SI_container[i][j]!=NULL) {
LOG_I(F1AP,"SETUP RESP: SI %d, Type %d\n",i,j);
AssertFatal((j < 6) || (j == 9), "Illegal SI type %d\n",j);
F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
memset((void*)sib_item,0,sizeof(*sib_item));
sib_item->sIBtype = sIBtype;
sib_item->sIBtype = j;
OCTET_STRING_fromBuf(&sib_item->sIBmessage,
(const char*)f1ap_setup_resp->SI_container[i][sIBtype],
f1ap_setup_resp->SI_container_length[i][sIBtype]);
(const char*)f1ap_setup_resp->SI_container[i][j],
f1ap_setup_resp->SI_container_length[i][j]);
LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->SI_container_length[i][sIBtype]);
LOG_I(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,j,f1ap_setup_resp->SI_container_length[i][j]);
ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
}
}
......
......@@ -228,7 +228,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
/* FDD.1.3 freqBandListNr */
int fdd_ul_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_frequency_bands;
LOG_D(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
LOG_I(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
int fdd_ul_j;
for (fdd_ul_j=0;
fdd_ul_j<fdd_ul_num_available_freq_Bands;
......@@ -270,7 +270,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
/* FDD.2.3 freqBandListNr */
int fdd_dl_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.dl_num_frequency_bands;
LOG_D(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
LOG_I(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
int fdd_dl_j;
for (fdd_dl_j=0;
fdd_dl_j<fdd_dl_num_available_freq_Bands;
......@@ -324,7 +324,8 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
/* TDD.1.3 freqBandListNr */
int tdd_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].tdd.num_frequency_bands;
LOG_D(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
LOG_I(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
AssertFatal(tdd_num_available_freq_Bands > 0, "should have at least one TDD band available\n");
int j;
for (j=0;
j<tdd_num_available_freq_Bands;
......@@ -518,9 +519,9 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
for (int si =0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
size_t size = sib_item->sIBmessage.size;
F1AP_SETUP_RESP (msg_p).SI_container_length[i][si] = size;
LOG_D(F1AP, "F1AP: F1Setup-Resp SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
F1AP_SETUP_RESP (msg_p).SI_container[i][si] = malloc(F1AP_SETUP_RESP (msg_p).SI_container_length[i][si]);
F1AP_SETUP_RESP (msg_p).SI_container_length[i][sib_item->sIBtype] = size;
LOG_I(F1AP, "F1AP: F1Setup-Resp SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
F1AP_SETUP_RESP (msg_p).SI_container[i][sib_item->sIBtype] = malloc(size);
memcpy((void*)F1AP_SETUP_RESP (msg_p).SI_container[i][sib_item->sIBtype],
(void*)sib_item->sIBmessage.buf,
size);
......@@ -565,7 +566,7 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
itti_send_msg_to_task(TASK_ENB_APP, instance, msg_p);
return 0;
}
......
......@@ -84,12 +84,8 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
LOG_E(F1AP, "----------------- ASN1 ENCODER PRINT END----------------- \n");
}
encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer);
if (encoded < 0) {
LOG_E(F1AP, "Failed to encode F1AP message\n");
return -1;
}
AssertFatal((encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer))>0,
"Failed to encode F1AP message\n");
*length = encoded;
......
......@@ -8914,14 +8914,13 @@ void handle_f1_setup_req(f1ap_setup_req_t *f1_setup_req) {
F1AP_SETUP_RESP (msg_p).nr_cellid[cu_cell_ind] = rrc->nr_cellid;
F1AP_SETUP_RESP (msg_p).nrpci[cu_cell_ind] = f1_setup_req->nr_pci[i];
int num_SI= 0;
if (rrc->carrier[0].SIB23) {
F1AP_SETUP_RESP (msg_p).SI_container[cu_cell_ind][num_SI] = rrc->carrier[0].SIB23;
F1AP_SETUP_RESP (msg_p).SI_container_length[cu_cell_ind][num_SI] = rrc->carrier[0].sizeof_SIB23;
//printf("SI %d size %d: ", 0, F1AP_SETUP_RESP(msg_p).SI_container_length[j][num_SI]);
//for (int n = 0; n < F1AP_SETUP_RESP(msg_p).SI_container_length[j][num_SI]; n++)
// printf("%02x ", F1AP_SETUP_RESP(msg_p).SI_container[0][num_SI][n]);
//printf("\n");
F1AP_SETUP_RESP (msg_p).SI_container[cu_cell_ind][2+num_SI] = rrc->carrier[0].SIB23;
F1AP_SETUP_RESP (msg_p).SI_container_length[cu_cell_ind][2+num_SI] = rrc->carrier[0].sizeof_SIB23;
printf("SI %d size %d: ", 0, F1AP_SETUP_RESP(msg_p).SI_container_length[j][2+num_SI]);
for (int n = 0; n < F1AP_SETUP_RESP(msg_p).SI_container_length[j][2+num_SI]; n++)
printf("%02x ", F1AP_SETUP_RESP(msg_p).SI_container[0][2+num_SI][n]);
printf("\n");
num_SI++;
}
......
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