Commit a0349279 authored by Eurecom's avatar Eurecom

integrated ABS patch for IP address string allocation in UE

parent eaada391
...@@ -249,12 +249,12 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl ...@@ -249,12 +249,12 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
NR_BWP_DownlinkDedicated_t *bwpd = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Dedicated : mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; NR_BWP_DownlinkDedicated_t *bwpd = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Dedicated : mac->cg->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
NR_BWP_DownlinkCommon_t *bwp_Common = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Common : &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP; NR_BWP_DownlinkCommon_t *bwp_Common = (bwp_id>0) ? mac->DLbwp[bwp_id-1]->bwp_Common : &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP;
LOG_I(MAC, "[DCI_CONFIG] ra_rnti %p (%x) crnti %p (%x) t_crnti %p (%x)\n", &ra->ra_rnti, ra->ra_rnti, &mac->crnti, mac->crnti, &ra->t_crnti, ra->t_crnti); LOG_D(NR_MAC, "[DCI_CONFIG] ra_rnti %p (%x) crnti %p (%x) t_crnti %p (%x)\n", &ra->ra_rnti, ra->ra_rnti, &mac->crnti, mac->crnti, &ra->t_crnti, ra->t_crnti);
// loop over all available SS for CORESET ID 1 // loop over all available SS for CORESET ID 1
if (bwpd) { if (bwpd) {
for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id][coreset_id - 1][ss_id] != NULL; ss_id++){ for (ss_id = 0; ss_id < FAPI_NR_MAX_SS_PER_CORESET && mac->SSpace[bwp_id][coreset_id - 1][ss_id] != NULL; ss_id++){
LOG_I(MAC, "[DCI_CONFIG] ss_id %d\n",ss_id); LOG_D(NR_MAC, "[DCI_CONFIG] ss_id %d\n",ss_id);
NR_SearchSpace_t *ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id]; NR_SearchSpace_t *ss = mac->SSpace[bwp_id][coreset_id - 1][ss_id];
fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15; fapi_nr_dl_config_dci_dl_pdu_rel15_t *rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon; NR_SetupRelease_PDCCH_ConfigCommon_t *pdcch_ConfigCommon = bwp_Common->pdcch_ConfigCommon;
...@@ -270,7 +270,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl ...@@ -270,7 +270,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
pdcch_ConfigCommon->choice.setup->searchSpaceSIB1=calloc(1,sizeof(*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1)); pdcch_ConfigCommon->choice.setup->searchSpaceSIB1=calloc(1,sizeof(*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1));
} }
*pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = 0; *pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = 0;
LOG_I(MAC, "[DCI_CONFIG] Configure SearchSpace#0 of the initial BWP\n"); LOG_D(NR_MAC, "[DCI_CONFIG] Configure SearchSpace#0 of the initial BWP\n");
} }
if (ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0){ if (ss->searchSpaceType->choice.common->dci_Format0_0_AndFormat1_0){
// check available SS IDs // check available SS IDs
...@@ -360,7 +360,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl ...@@ -360,7 +360,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
(ra->ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test) && (ra->ra_state == RA_SUCCEEDED || get_softmodem_params()->phy_test) &&
mac->crnti > 0) { mac->crnti > 0) {
// Monitors DCI 01 and 11 scrambled with C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI // Monitors DCI 01 and 11 scrambled with C-RNTI, or CS-RNTI(s), or SP-CSI-RNTI
LOG_I(MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in the user specific search space\n"); LOG_D(NR_MAC, "[DCI_CONFIG] Configure monitoring of PDCCH candidates in the user specific search space\n");
rel15->num_dci_options = 2; rel15->num_dci_options = 2;
rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_1; rel15->dci_format_options[0] = NR_DL_DCI_FORMAT_1_1;
rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_1; rel15->dci_format_options[1] = NR_UL_DCI_FORMAT_0_1;
...@@ -368,7 +368,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl ...@@ -368,7 +368,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl
fill_dci_search_candidates(ss, rel15); fill_dci_search_candidates(ss, rel15);
//#ifdef DEBUG_DCI //#ifdef DEBUG_DCI
LOG_I(MAC, "[DCI_CONFIG] ss %d ue_Specific %p searchSpaceType->present %d dci_Formats %d\n", LOG_D(NR_MAC, "[DCI_CONFIG] ss %d ue_Specific %p searchSpaceType->present %d dci_Formats %d\n",
ss_id, ss_id,
ss->searchSpaceType->choice.ue_Specific, ss->searchSpaceType->choice.ue_Specific,
(int)ss->searchSpaceType->present, (int)ss->searchSpaceType->present,
......
...@@ -1219,7 +1219,7 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1219,7 +1219,7 @@ int nr_acknack_scheduling(int mod_id,
} }
} }
LOG_D(NR_MAC,"1. DL slot %d, UL_ACK %d, DAI_C %d\n",slot,pucch->ul_slot,pucch->dai_c); LOG_D(NR_MAC,"1. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c);
/* if the UE's next PUCCH occasion is after the possible UL slots (within the /* if the UE's next PUCCH occasion is after the possible UL slots (within the
* same frame) or wrapped around to the next frame, then we assume there is * same frame) or wrapped around to the next frame, then we assume there is
* no possible PUCCH allocation anymore */ * no possible PUCCH allocation anymore */
...@@ -1247,7 +1247,7 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1247,7 +1247,7 @@ int nr_acknack_scheduling(int mod_id,
get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, pdsch_to_harq_feedback); get_pdsch_to_harq_feedback(mod_id, UE_id, bwp_Id, ss_type, pdsch_to_harq_feedback);
LOG_D(NR_MAC,"1b. DL slot %d, UL_ACK %d, DAI_C %d\n",slot,pucch->ul_slot,pucch->dai_c); LOG_D(NR_MAC,"1b. DL %d.%d, UL_ACK %d.%d, DAI_C %d\n",frame,slot,pucch->frame,pucch->ul_slot,pucch->dai_c);
/* there is a HARQ. Check whether we can use it for this ACKNACK */ /* there is a HARQ. Check whether we can use it for this ACKNACK */
if (pucch->dai_c > 0) { if (pucch->dai_c > 0) {
/* this UE already has a PUCCH occasion */ /* this UE already has a PUCCH occasion */
...@@ -1296,27 +1296,18 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1296,27 +1296,18 @@ int nr_acknack_scheduling(int mod_id,
} }
// advance ul_slot if it is not reachable by UE // advance ul_slot if it is not reachable by UE
pucch->ul_slot = max(pucch->ul_slot, slot + pdsch_to_harq_feedback[0]); int pucch_slot,ind_found=-1;
for (int i=0;i<8;i++) {
// Find the right timing_indicator value. pucch_slot = slot + pdsch_to_harq_feedback[i];
int i = 0; if ((pucch_slot%nr_slots_period) >= tdd->nrofDownlinkSlots) {
while (i < 8) { pucch->ul_slot = max(pucch->ul_slot, pucch_slot);
LOG_D(NR_MAC,"pdsch_to_harq_feedback[%d] = %d (pucch->ul_slot %d - slot %d)\n", ind_found=i;
i,pdsch_to_harq_feedback[i],pucch->ul_slot,slot); break;
if (pdsch_to_harq_feedback[i] == pucch->ul_slot - slot) }
break;
++i;
}
if (i >= 8) {
LOG_W(NR_MAC,
"%4d.%2d could not find pdsch_to_harq_feedback for UE %d: earliest "
"ack slot %d\n",
frame,
slot,
UE_id,
pucch->ul_slot);
return -1;
} }
if (pucch->ul_slot >= n_slots_frame) pucch->frame++;
pucch->ul_slot = pucch->ul_slot % n_slots_frame;
AssertFatal(ind_found!=-1,"couldn't find a valid UL_ACK slot for PUCCH, shouldn't happen\n");
// is there already CSI in this slot? // is there already CSI in this slot?
csi_pucch = &sched_ctrl->sched_pucch[1]; csi_pucch = &sched_ctrl->sched_pucch[1];
...@@ -1342,15 +1333,15 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1342,15 +1333,15 @@ int nr_acknack_scheduling(int mod_id,
} }
// multiplexing harq and csi in a pucch // multiplexing harq and csi in a pucch
else { else {
csi_pucch->timing_indicator = i; csi_pucch->timing_indicator = ind_found;
csi_pucch->dai_c++; csi_pucch->dai_c++;
return 1; return 1;
} }
} }
pucch->timing_indicator = i; // index in the list of timing indicators pucch->timing_indicator = ind_found; // index in the list of timing indicators
LOG_D(NR_MAC,"2. DL slot %d, UL_ACK %d (index %d)\n",slot,pucch->ul_slot,i); LOG_D(NR_MAC,"2. DL %d.%d, UL_ACK %d.%d (index %d)\n",frame,slot,pucch->frame,pucch->ul_slot,ind_found);
pucch->dai_c++; pucch->dai_c++;
pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources pucch->resource_indicator = 0; // each UE has dedicated PUCCH resources
......
...@@ -1188,7 +1188,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, ...@@ -1188,7 +1188,7 @@ void fill_initial_SpCellConfig(rnti_t rnti,
long *delay[8]; long *delay[8];
for (int i=0;i<8;i++) { for (int i=0;i<8;i++) {
delay[i] = calloc(1,sizeof(*delay[i])); delay[i] = calloc(1,sizeof(*delay[i]));
*delay[i] = (i+2); *delay[i] = (i+2+4);
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
} }
......
...@@ -840,6 +840,9 @@ void *nas_nrue_task(void *args_p) ...@@ -840,6 +840,9 @@ void *nas_nrue_task(void *args_p)
else if((pdu_buffer + 16) != NULL){ else if((pdu_buffer + 16) != NULL){
msg_type = *(pdu_buffer + 16); msg_type = *(pdu_buffer + 16);
if(msg_type == FGS_PDU_SESSION_ESTABLISHMENT_ACC){ if(msg_type == FGS_PDU_SESSION_ESTABLISHMENT_ACC){
if(baseNetAddress==NULL) {
baseNetAddress = calloc(1,8);
}
sprintf(baseNetAddress, "%d.%d", *(pdu_buffer + 39),*(pdu_buffer + 40)); sprintf(baseNetAddress, "%d.%d", *(pdu_buffer + 39),*(pdu_buffer + 40));
int third_octet = *(pdu_buffer + 41); int third_octet = *(pdu_buffer + 41);
int fourth_octet = *(pdu_buffer + 42); int fourth_octet = *(pdu_buffer + 42);
......
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