fixed #320 issue
This commit is contained in:
@@ -230,47 +230,6 @@ void RCconfig_flexran()
|
||||
}
|
||||
|
||||
|
||||
/*void UE_config_stub_pnf(void) {
|
||||
int j;
|
||||
paramdef_t L1_Params[] = L1PARAMS_DESC;
|
||||
paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST,NULL,0};
|
||||
|
||||
config_getlist( &L1_ParamList,L1_Params,sizeof(L1_Params)/sizeof(paramdef_t), NULL);
|
||||
if (L1_ParamList.numelt > 0) {
|
||||
for (j=0; j<L1_ParamList.numelt; j++){
|
||||
//nb_L1_CC = *(L1_ParamList.paramarray[j][L1_CC_IDX].uptr); // Number of component carriers is of no use for the
|
||||
// phy_stub mode UE pnf. Maybe we can completely skip it.
|
||||
|
||||
if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) {
|
||||
sf_ahead = 4; // Need 4 subframe gap between RX and TX
|
||||
}
|
||||
// Panos: Right now that we have only one UE (thread) it is ok to put the eth_params in the UE_mac_inst.
|
||||
// Later I think we have to change that to attribute eth_params to a global element for all the UEs.
|
||||
else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) {
|
||||
stub_eth_params.local_if_name = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_IF_NAME_IDX].strptr));
|
||||
stub_eth_params.my_addr = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_ADDRESS_IDX].strptr));
|
||||
stub_eth_params.remote_addr = strdup(*(L1_ParamList.paramarray[j][L1_REMOTE_N_ADDRESS_IDX].strptr));
|
||||
stub_eth_params.my_portc = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTC_IDX].iptr);
|
||||
stub_eth_params.remote_portc = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTC_IDX].iptr);
|
||||
stub_eth_params.my_portd = *(L1_ParamList.paramarray[j][L1_LOCAL_N_PORTD_IDX].iptr);
|
||||
stub_eth_params.remote_portd = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr);
|
||||
stub_eth_params.transp_preference = ETH_UDP_MODE;
|
||||
|
||||
|
||||
sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2
|
||||
//configure_nfapi_pnf(UE_mac_inst[0].eth_params_n.remote_addr, UE_mac_inst[0].eth_params_n.remote_portc, UE_mac_inst[0].eth_params_n.my_addr, UE_mac_inst[0].eth_params_n.my_portd, UE_mac_inst[0].eth_params_n.remote_portd);
|
||||
configure_nfapi_pnf(stub_eth_params.remote_addr, stub_eth_params.remote_portc, stub_eth_params.my_addr, stub_eth_params.my_portd, stub_eth_params.remote_portd);
|
||||
}
|
||||
else { // other midhaul
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
void RCconfig_L1(void) {
|
||||
int i,j;
|
||||
paramdef_t L1_Params[] = L1PARAMS_DESC;
|
||||
@@ -338,7 +297,6 @@ void RCconfig_L1(void) {
|
||||
configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd, RC.eNB[j][0]->eth_params_n .remote_portd);
|
||||
}
|
||||
else { // other midhaul
|
||||
//printf("Panos-D: RCconfig_L1 12 \n");
|
||||
}
|
||||
}// j=0..num_inst
|
||||
printf("Initializing northbound interface for L1\n");
|
||||
|
||||
@@ -1006,7 +1006,7 @@ generate_Msg4(module_id_t module_idP, int CC_idP, frame_t frameP,
|
||||
#endif
|
||||
{
|
||||
// This is normal LTE case
|
||||
LOG_D(MAC, "Panos-D: generate_Msg4 1 ra->Msg4_frame SFN/SF: %d.%d, frameP SFN/SF: %d.%d FOR eNB_Mod: %d \n", ra->Msg4_frame, ra->Msg4_subframe, frameP, subframeP, module_idP);
|
||||
LOG_D(MAC, "generate_Msg4 1 ra->Msg4_frame SFN/SF: %d.%d, frameP SFN/SF: %d.%d FOR eNB_Mod: %d \n", ra->Msg4_frame, ra->Msg4_subframe, frameP, subframeP, module_idP);
|
||||
if ((ra->Msg4_frame == frameP) && (ra->Msg4_subframe == subframeP)) {
|
||||
|
||||
// Get RRCConnectionSetup for Piggyback
|
||||
@@ -1326,7 +1326,7 @@ check_Msg4_retransmission(module_id_t module_idP, int CC_idP,
|
||||
ra->rnti, round, frameP, subframeP);
|
||||
// DLSCH Config
|
||||
//DJP - fix this pdu_index = -1
|
||||
LOG_D(MAC, "Panos:D: check_Msg4_retransmission() before fill_nfapi_dlsch_config() with pdu_index = -1 \n");
|
||||
LOG_D(MAC, "check_Msg4_retransmission() before fill_nfapi_dlsch_config() with pdu_index = -1 \n");
|
||||
fill_nfapi_dlsch_config(mac, dl_req_body, ra->msg4_TBsize,
|
||||
-1
|
||||
/* retransmission, no pdu_index */
|
||||
|
||||
@@ -324,7 +324,6 @@ typedef struct {
|
||||
uint8_t Buffer_size0:6;
|
||||
} __attribute__ ((__packed__)) BSR_LONG;
|
||||
|
||||
// Panos:
|
||||
/*!\brief mac control element: sidelink buffer status report */
|
||||
typedef struct {
|
||||
uint8_t DST_1:4;
|
||||
@@ -1522,13 +1521,13 @@ typedef struct {
|
||||
time_stats_t rx_si;
|
||||
/// UE PCCH rx processing time including RLC interface (mac_rrc_data_ind)
|
||||
time_stats_t rx_p;
|
||||
/// Panos: Mutex for nfapi UL_INFO
|
||||
/// Mutex for nfapi UL_INFO
|
||||
pthread_mutex_t UL_INFO_mutex;
|
||||
/// Panos: UE_Mode variable should be used in the case of Phy_stub operation since we won't have access to PHY_VARS_UE
|
||||
/// UE_Mode variable should be used in the case of Phy_stub operation since we won't have access to PHY_VARS_UE
|
||||
/// where the UE_mode originally is for the full stack operation mode. The transitions between the states of the UE_Mode
|
||||
/// will be triggered within phy_stub_ue.c in this case
|
||||
UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
/// Panos: Phy_stub mode: Boolean variable to distinguish whether a Msg3 or a regular ULSCH data pdu should be generated
|
||||
/// Phy_stub mode: Boolean variable to distinguish whether a Msg3 or a regular ULSCH data pdu should be generated
|
||||
/// after the reception of NFAPI_UL_CONFIG_ULSCH_PDU_TYPE.
|
||||
uint8_t first_ULSCH_Tx;
|
||||
uint8_t SI_Decoded;
|
||||
|
||||
@@ -299,8 +299,8 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
|
||||
|
||||
uint8_t Size = 0;
|
||||
UE_MODE_t UE_mode;
|
||||
// Panos: Modification for phy_stub_ue operation
|
||||
if(nfapi_mode == 3) { // Panos: phy_stub_ue mode
|
||||
// Modification for phy_stub_ue operation
|
||||
if(nfapi_mode == 3) { // phy_stub_ue mode
|
||||
UE_mode = UE_mac_inst[module_idP].UE_mode[0];
|
||||
LOG_D(MAC, "ue_get_rach , UE_mode: %d", UE_mode);
|
||||
}
|
||||
|
||||
@@ -475,8 +475,8 @@ ue_send_sdu(module_id_t module_idP,
|
||||
LOG_E(MAC,
|
||||
"[UE %d][RAPROC] Contention detected, RA failed\n",
|
||||
module_idP);
|
||||
if(nfapi_mode == 3) { // Panos: phy_stub mode
|
||||
// Panos: Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
|
||||
if(nfapi_mode == 3) { // phy_stub mode
|
||||
// Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
|
||||
// PRACH state.
|
||||
LOG_I(MAC, "nfapi_mode3: Setting UE_mode BACK to PRACH 1\n");
|
||||
UE_mac_inst[module_idP].UE_mode[eNB_index] = PRACH;
|
||||
@@ -502,7 +502,7 @@ ue_send_sdu(module_id_t module_idP,
|
||||
RA_contention_resolution_timer_active = 0;
|
||||
if(nfapi_mode == 3) // phy_stub mode
|
||||
{
|
||||
//Panos: Modification for phy_stub mode operation here. We only need to change the ue_mode to PUSCH
|
||||
// Modification for phy_stub mode operation here. We only need to change the ue_mode to PUSCH
|
||||
UE_mac_inst[module_idP].UE_mode[eNB_index] = PUSCH;
|
||||
}
|
||||
else { // Full stack mode
|
||||
@@ -519,7 +519,7 @@ ue_send_sdu(module_id_t module_idP,
|
||||
payload_ptr[0]);
|
||||
#endif
|
||||
|
||||
// Panos: Eliminate call to process_timing_advance for the phy_stub UE operation mode. Is this correct?
|
||||
// Eliminate call to process_timing_advance for the phy_stub UE operation mode. Is this correct?
|
||||
if (nfapi_mode!=3)
|
||||
{
|
||||
process_timing_advance(module_idP,CC_id,payload_ptr[0]);
|
||||
@@ -881,17 +881,6 @@ void ue_send_sl_sdu(module_id_t module_idP,
|
||||
} else { //SL_DISCOVERY
|
||||
uint16_t len = sdu_len;
|
||||
LOG_I( MAC, "SL DISCOVERY \n");
|
||||
// Panos: Ask TTN if we should be calling mac_rrc_data_ind_ue() instead of mac_rrc_data_ind() now!
|
||||
/*mac_rrc_data_ind(module_idP,
|
||||
CC_id,
|
||||
frameP,subframeP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
SL_DISCOVERY,
|
||||
sdu, //(uint8_t*)&UE_mac_inst[Mod_id].SL_Discovery[0].Rx_buffer.Payload[0],
|
||||
len,
|
||||
ENB_FLAG_NO,
|
||||
eNB_index,
|
||||
0);*/
|
||||
mac_rrc_data_ind_ue(module_idP,
|
||||
CC_id,
|
||||
frameP,subframeP,
|
||||
@@ -1623,7 +1612,6 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
uint8_t * ulsch_buffer, uint16_t buflen, uint8_t * access_mode)
|
||||
{
|
||||
|
||||
//LOG_I(MAC, "Panos-D: UE[%d] In ue_get_sdu() 1 \n", module_idP);
|
||||
uint8_t total_rlc_pdu_header_len = 0, rlc_pdu_header_len_last = 0;
|
||||
uint16_t buflen_remain = 0;
|
||||
uint8_t bsr_len = 0, bsr_ce_len = 0, bsr_header_len = 0;
|
||||
@@ -1997,7 +1985,7 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
// build PHR and update the timers
|
||||
if (phr_ce_len == sizeof(POWER_HEADROOM_CMD)) {
|
||||
if(nfapi_mode ==3){
|
||||
//Panos: Substitute with a static value for the MAC layer abstraction (phy_stub mode)
|
||||
//Substitute with a static value for the MAC layer abstraction (phy_stub mode)
|
||||
phr_p->PH = 40;
|
||||
}
|
||||
else{
|
||||
@@ -2212,7 +2200,6 @@ ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
buflen - sdu_length_total - payload_offset);
|
||||
// cycle through SDUs and place in ulsch_buffer
|
||||
if (sdu_length_total) {
|
||||
//LOG_I(MAC, "Panos-D: [UE %d] ue_get_sdu() 2 before copying to ulsch_buffer, SFN/SF: %d/%d \n \n \n", module_idP, frameP, subframe);
|
||||
memcpy(&ulsch_buffer[payload_offset], ulsch_buff,
|
||||
sdu_length_total);
|
||||
}
|
||||
@@ -2466,8 +2453,8 @@ ue_scheduler(const module_id_t module_idP,
|
||||
LOG_E(MAC,
|
||||
"Module id %u Contention resolution timer expired, RA failed\n",
|
||||
module_idP);
|
||||
if(nfapi_mode == 3) { // Panos: phy_stub mode
|
||||
// Panos: Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
|
||||
if(nfapi_mode == 3) { // phy_stub mode
|
||||
// Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
|
||||
// PRACH state.
|
||||
LOG_I(MAC, "nfapi_mode3: Setting UE_mode to PRACH 2 \n");
|
||||
UE_mac_inst[module_idP].UE_mode[eNB_indexP] = PRACH;
|
||||
@@ -3201,16 +3188,6 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t
|
||||
|
||||
//UE_MAC_INST *ue = &UE_mac_inst[Mod_id];
|
||||
SLDCH_t *sldch = &UE_mac_inst[Mod_id].sldch;
|
||||
// Panos: Ask TTN if we should be calling mac_rrc_data_req_ue() instead of mac_rrc_data_req() now!
|
||||
/*sldch->payload_length = mac_rrc_data_req(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
SL_DISCOVERY,
|
||||
1,
|
||||
(char*)(sldch->payload), //&UE_mac_inst[Mod_id].SL_Discovery[0].Tx_buffer.Payload[0],
|
||||
0,
|
||||
0, //eNB_indexP
|
||||
0);*/
|
||||
|
||||
sldch->payload_length = mac_rrc_data_req_ue(Mod_id,
|
||||
CC_id,
|
||||
|
||||
@@ -491,7 +491,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
|
||||
int prose_addr_len;
|
||||
char send_buf[BUFSIZE], receive_buf[BUFSIZE];
|
||||
// Panos: Remove the following definitions due to warnings of unused variables.
|
||||
//int optval;
|
||||
int bytes_received;
|
||||
sidelink_pc5s_element *sl_pc5s_msg_recv = NULL;
|
||||
|
||||
@@ -368,19 +368,16 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
//LOG_I(RLC, "Panos-D mac_rlc_status_ind 1 enb_flagP: %d, channel_idP: %d, srb_flag: %d \n", enb_flagP, channel_idP, srb_flag);
|
||||
key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
|
||||
}
|
||||
}
|
||||
|
||||
//LOG_I(RLC, "Panos-D mac_rlc_status_ind 2 enb_flagP: %d, channel_idP: %d, srb_flag: %d \n", enb_flagP, channel_idP, srb_flag);
|
||||
h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
|
||||
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
rlc_mode = rlc_union_p->mode;
|
||||
} else {
|
||||
rlc_mode = RLC_MODE_NONE;
|
||||
//LOG_D(RLC , "Panos-D: mac_rlc_status_ind() In RLC_MODE_NONE \n");
|
||||
//LOG_W(RLC , "[%s] RLC not configured lcid %u module %u!\n", __FUNCTION__, channel_idP, module_idP);
|
||||
//LOG_D(RLC , "[%s] RLC not configured rb id %u lcid %u module %u!\n", __FUNCTION__, rb_id, channel_idP, ue_module_idP);
|
||||
}
|
||||
|
||||
@@ -192,14 +192,14 @@ typedef struct{
|
||||
}UE_MAC_BCH_indication_body_t;
|
||||
|
||||
|
||||
// Panos: Corresponding to inputs of MAC functions: ue_send_sdu(), ue_decode_si(), ue_decode_p().
|
||||
// Corresponding to inputs of MAC functions: ue_send_sdu(), ue_decode_si(), ue_decode_p().
|
||||
typedef struct{
|
||||
uint8_t* data;
|
||||
uint16_t data_len;
|
||||
}UE_MAC_dlsch_pdu;
|
||||
|
||||
|
||||
// Panos: Corresponding to inputs of MAC function: process_rar().
|
||||
// Corresponding to inputs of MAC function: process_rar().
|
||||
typedef struct{
|
||||
rnti_t ra_rnti;
|
||||
uint8_t* rar_input_buffer; // Originating from PHY
|
||||
|
||||
@@ -68,7 +68,7 @@ void fill_rx_indication_UE_MAC(module_id_t Mod_id,int frame,int subframe, UL_IND
|
||||
pdu->data = ulsch_buffer;
|
||||
// estimate timing advance for MAC
|
||||
//sync_pos = lte_est_timing_advance_pusch(eNB,UE_id);
|
||||
timing_advance_update = 0; //Panos: Don't know what to put here
|
||||
timing_advance_update = 0; // Don't know what to put here
|
||||
pdu->rx_indication_rel8.timing_advance = timing_advance_update;
|
||||
|
||||
int SNRtimes10 = 640;
|
||||
@@ -105,10 +105,10 @@ void fill_sr_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL_I
|
||||
pdu->instance_length = 0; // don't know what to do with this
|
||||
// pdu->rx_ue_information.handle = handle;
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
pdu->rx_ue_information.rnti = rnti; //UE_mac_inst[Mod_id].crnti;; //Panos: Is this the right RNTI?
|
||||
pdu->rx_ue_information.rnti = rnti; //UE_mac_inst[Mod_id].crnti
|
||||
|
||||
|
||||
// Panos dependency from PHY not sure how to substitute this. Should we hardcode it?
|
||||
// dependency from PHY not sure how to substitute this. Should we hardcode it?
|
||||
//int SNRtimes10 = dB_fixed_times10(stat) - 200;//(10*eNB->measurements.n0_power_dB[0]);
|
||||
int SNRtimes10 = 640;
|
||||
|
||||
@@ -130,7 +130,7 @@ void fill_crc_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL_
|
||||
|
||||
pthread_mutex_lock(&UE_mac_inst[Mod_id].UL_INFO_mutex);
|
||||
|
||||
//Panos: REMEMBER HAVE EXCHANGED THE FOLLOWING TWO LINES HERE!
|
||||
// REMEMBER HAVE EXCHANGED THE FOLLOWING TWO LINES HERE!
|
||||
nfapi_crc_indication_pdu_t *pdu = &UL_INFO->crc_ind.crc_indication_body.crc_pdu_list[UL_INFO->crc_ind.crc_indication_body.number_of_crcs];
|
||||
|
||||
UL_INFO->crc_ind.sfn_sf = frame<<4| subframe;
|
||||
@@ -172,9 +172,9 @@ void fill_rach_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL
|
||||
|
||||
UL_INFO->rach_ind.rach_indication_body.preamble_list = (nfapi_preamble_pdu_t*)malloc(UL_INFO->rach_ind.rach_indication_body.number_of_preambles*sizeof(nfapi_preamble_pdu_t));
|
||||
UL_INFO->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.tl.tag = NFAPI_PREAMBLE_REL8_TAG;
|
||||
UL_INFO->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance = 0; //Panos: Not sure about that
|
||||
UL_INFO->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.timing_advance = 0; // Not sure about that
|
||||
|
||||
//Panos: The two following should get extracted from the call to get_prach_resources().
|
||||
//The two following should get extracted from the call to get_prach_resources().
|
||||
UL_INFO->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.preamble = ra_PreambleIndex;
|
||||
UL_INFO->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti = ra_RNTI;
|
||||
//UL_INFO->rach_ind.rach_indication_body.number_of_preambles++;
|
||||
@@ -191,7 +191,7 @@ void fill_rach_indication_UE_MAC(int Mod_id,int frame,int subframe, UL_IND_t *UL
|
||||
UL_INFO->rach_ind.rach_indication_body.preamble_list[0].preamble_rel8.rnti,
|
||||
UL_INFO->rach_ind.rach_indication_body.preamble_list[0].preamble_rel13.rach_resource_type);
|
||||
|
||||
//Panos: This function is currently defined only in the nfapi-RU-RAU-split so we should call it when we merge
|
||||
// This function is currently defined only in the nfapi-RU-RAU-split so we should call it when we merge
|
||||
// with that branch.
|
||||
oai_nfapi_rach_ind(&UL_INFO->rach_ind);
|
||||
free(UL_INFO->rach_ind.rach_indication_body.preamble_list);
|
||||
@@ -210,12 +210,12 @@ void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, uint16_t frame,uint8_t subfram
|
||||
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
pdu->rx_ue_information.rnti = rnti;
|
||||
//Panos: Since we assume that CRC flag is always 0 (ACK) I guess that data_offset should always be 0.
|
||||
// Since we assume that CRC flag is always 0 (ACK) I guess that data_offset should always be 0.
|
||||
pdu->cqi_indication_rel9.data_offset = 0;
|
||||
|
||||
// by default set O to rank 1 value
|
||||
//pdu->cqi_indication_rel9.length = (ulsch_harq->Or1>>3) + ((ulsch_harq->Or1&7) > 0 ? 1 : 0);
|
||||
// Panos: Not useful field for our case
|
||||
// Not useful field for our case
|
||||
pdu->cqi_indication_rel9.tl.tag = NFAPI_CQI_INDICATION_REL9_TAG;
|
||||
pdu->cqi_indication_rel9.length = 0;
|
||||
pdu->cqi_indication_rel9.ri[0] = 0;
|
||||
@@ -225,7 +225,7 @@ void fill_ulsch_cqi_indication_UE_MAC(int Mod_id, uint16_t frame,uint8_t subfram
|
||||
pdu->cqi_indication_rel9.number_of_cc_reported = 1;
|
||||
pdu->ul_cqi_information.channel = 1; // PUSCH
|
||||
|
||||
//Panos: Not sure how to substitute this. This should be the actual CQI value? So can
|
||||
// Not sure how to substitute this. This should be the actual CQI value? So can
|
||||
// we hardcode it to a specific value?
|
||||
//memcpy((void*)raw_pdu->pdu,ulsch_harq->o,pdu->cqi_indication_rel9.length);
|
||||
raw_pdu->pdu[0] = 7;
|
||||
@@ -255,18 +255,18 @@ void fill_ulsch_harq_indication_UE_MAC(int Mod_id, int frame,int subframe, UL_IN
|
||||
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
pdu->rx_ue_information.rnti = rnti;
|
||||
|
||||
//Panos: For now we consider only FDD
|
||||
// For now we consider only FDD
|
||||
//if (eNB->frame_parms.frame_type == FDD) {
|
||||
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
|
||||
pdu->harq_indication_fdd_rel13.mode = 0;
|
||||
pdu->harq_indication_fdd_rel13.number_of_ack_nack = harq_information->harq_information_rel10.harq_size;
|
||||
|
||||
//Panos: Could this be wrong? Is the number_of_ack_nack field equivalent to O_ACK?
|
||||
// Could this be wrong? Is the number_of_ack_nack field equivalent to O_ACK?
|
||||
//pdu->harq_indication_fdd_rel13.number_of_ack_nack = ulsch_harq->O_ACK;
|
||||
|
||||
for (i=0;i<harq_information->harq_information_rel10.harq_size;i++) {
|
||||
|
||||
pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 1; //Panos: Assuming always an ACK (No NACK or DTX)
|
||||
pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 1; // Assuming always an ACK (No NACK or DTX)
|
||||
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id,
|
||||
pdu->harq_indication_fdd_rel13.number_of_ack_nack = 1;
|
||||
|
||||
//AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
|
||||
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = 1; //Panos: Assuming always an ACK (No NACK or DTX)
|
||||
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = 1; // Assuming always an ACK (No NACK or DTX)
|
||||
|
||||
|
||||
}
|
||||
@@ -328,8 +328,8 @@ void fill_uci_harq_indication_UE_MAC(int Mod_id,
|
||||
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
|
||||
pdu->harq_indication_fdd_rel13.mode = 0;
|
||||
pdu->harq_indication_fdd_rel13.number_of_ack_nack = 2;
|
||||
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = 1; //Panos: Assuming always an ACK (No NACK or DTX)
|
||||
pdu->harq_indication_fdd_rel13.harq_tb_n[1] = 1; //Panos: Assuming always an ACK (No NACK or DTX)
|
||||
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = 1; // Assuming always an ACK (No NACK or DTX)
|
||||
pdu->harq_indication_fdd_rel13.harq_tb_n[1] = 1; // Assuming always an ACK (No NACK or DTX)
|
||||
|
||||
}
|
||||
else AssertFatal(1==0,"only format 1a/b for now, received \n");
|
||||
@@ -362,15 +362,14 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
|
||||
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti);
|
||||
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, UE_mac_inst[Mod_id].RA_prach_resources.Msg3,buflen, rnti, index);
|
||||
Msg3_transmitted(Mod_id, 0, frame, 0);
|
||||
// Panos: Modification
|
||||
// Modification
|
||||
UE_mac_inst[Mod_id].UE_mode[0] = PUSCH;
|
||||
UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
|
||||
|
||||
// Panos: This should be done after the reception of the respective hi_dci0
|
||||
// This should be done after the reception of the respective hi_dci0
|
||||
//UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
|
||||
}
|
||||
else {
|
||||
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 2.3 \n");
|
||||
ue_get_sdu( Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode);
|
||||
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti);
|
||||
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_buffer,buflen, rnti, index);
|
||||
@@ -393,12 +392,11 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
|
||||
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, UE_mac_inst[Mod_id].RA_prach_resources.Msg3,buflen, rnti, index);
|
||||
Msg3_transmitted(Mod_id, 0, frame, 0);
|
||||
//UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
|
||||
// Panos: Modification
|
||||
// Modification
|
||||
UE_mac_inst[Mod_id].UE_mode[0] = PUSCH;
|
||||
UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
|
||||
}
|
||||
else {
|
||||
//LOG_I(MAC, "Panos-D: handle_nfapi_ul_pdu_UE_MAC 3.1 \n");
|
||||
ue_get_sdu( Mod_id, 0, frame, subframe, 0, ulsch_buffer, buflen, &access_mode);
|
||||
fill_crc_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, 0, index, rnti);
|
||||
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, ulsch_buffer,buflen, rnti, index);
|
||||
@@ -421,7 +419,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
|
||||
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, UE_mac_inst[Mod_id].RA_prach_resources.Msg3,buflen, rnti, index);
|
||||
Msg3_transmitted(Mod_id, 0, frame, 0);
|
||||
//UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
|
||||
// Panos: Modification
|
||||
// Modification
|
||||
UE_mac_inst[Mod_id].UE_mode[0] = PUSCH;
|
||||
UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
|
||||
}
|
||||
@@ -448,7 +446,7 @@ void handle_nfapi_ul_pdu_UE_MAC(module_id_t Mod_id,
|
||||
fill_rx_indication_UE_MAC(Mod_id, frame, subframe, UL_INFO, UE_mac_inst[Mod_id].RA_prach_resources.Msg3,buflen, rnti, index);
|
||||
Msg3_transmitted(Mod_id, 0, frame, 0);
|
||||
//UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
|
||||
// Panos: Modification
|
||||
// Modification
|
||||
UE_mac_inst[Mod_id].UE_mode[0] = PUSCH;
|
||||
UE_mac_inst[Mod_id].first_ULSCH_Tx = 0;
|
||||
}
|
||||
@@ -788,13 +786,9 @@ int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req, module_id_t Mod_id)
|
||||
int memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req)
|
||||
{
|
||||
|
||||
//module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
|
||||
|
||||
//for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){
|
||||
|
||||
dl_config_req = (nfapi_dl_config_request_t*)malloc(sizeof(nfapi_dl_config_request_t));
|
||||
//LOG_I(MAC, "Panos-D: memcpy_dl_config_req 1, Mod_id:%d \n", Mod_id);
|
||||
|
||||
|
||||
//UE_mac_inst[Mod_id].dl_config_req->header = req->header;
|
||||
dl_config_req->sfn_sf = req->sfn_sf;
|
||||
@@ -822,10 +816,6 @@ int memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request
|
||||
|
||||
int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req)
|
||||
{
|
||||
//LOG_D(MAC, "Panos-D: memcpy_ul_config_req 1 \n");
|
||||
|
||||
//module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
|
||||
|
||||
|
||||
//for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){
|
||||
|
||||
@@ -857,8 +847,6 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
|
||||
|
||||
int memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
|
||||
{
|
||||
//module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
|
||||
|
||||
|
||||
tx_req_num_elems = req->tx_request_body.number_of_pdus;
|
||||
tx_request_pdu_list = (nfapi_tx_request_pdu_t*) calloc(tx_req_num_elems, sizeof(nfapi_tx_request_pdu_t));
|
||||
@@ -884,7 +872,6 @@ int memcpy_hi_dci0_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t*
|
||||
{
|
||||
|
||||
//if(req!=0){
|
||||
//module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
|
||||
|
||||
//for (Mod_id=0; Mod_id<NB_UE_INST; Mod_id++){
|
||||
hi_dci0_req = (nfapi_hi_dci0_request_t*)malloc(sizeof(nfapi_hi_dci0_request_t));
|
||||
@@ -929,7 +916,7 @@ void UE_config_stub_pnf(void) {
|
||||
if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) {
|
||||
sf_ahead = 4; // Need 4 subframe gap between RX and TX
|
||||
}
|
||||
// Panos: Right now that we have only one UE (thread) it is ok to put the eth_params in the UE_mac_inst.
|
||||
// Right now that we have only one UE (thread) it is ok to put the eth_params in the UE_mac_inst.
|
||||
// Later I think we have to change that to attribute eth_params to a global element for all the UEs.
|
||||
else if (strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "nfapi") == 0) {
|
||||
stub_eth_params.local_if_name = strdup(*(L1_ParamList.paramarray[j][L1_LOCAL_N_IF_NAME_IDX].strptr));
|
||||
|
||||
@@ -21,7 +21,7 @@ UL_IND_t *UL_INFO;
|
||||
|
||||
nfapi_tx_request_pdu_t* tx_request_pdu_list;
|
||||
// New
|
||||
/// Panos: Pointers to config_request types. Used from nfapi callback functions.
|
||||
/// Pointers to config_request types. Used from nfapi callback functions.
|
||||
nfapi_dl_config_request_t* dl_config_req;
|
||||
nfapi_ul_config_request_t* ul_config_req;
|
||||
nfapi_hi_dci0_request_t* hi_dci0_req;
|
||||
@@ -35,7 +35,7 @@ eth_params_t stub_eth_params;
|
||||
|
||||
|
||||
|
||||
// Panos: This function should return all the sched_response config messages which concern a specific UE. Inside this
|
||||
// This function should return all the sched_response config messages which concern a specific UE. Inside this
|
||||
// function we should somehow make the translation of config message's rnti to Mod_ID.
|
||||
Sched_Rsp_t get_nfapi_sched_response(uint8_t Mod_id);
|
||||
|
||||
|
||||
@@ -403,7 +403,6 @@ void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
|
||||
UE_rrc_inst[Mod_idP].Info[eNB_index].N310_cnt=0;
|
||||
|
||||
if (UE_rrc_inst[Mod_idP].Info[eNB_index].T310_active==1) {
|
||||
LOG_D(RRC, "Panos-D: rrc_in_sync_ind 1 \n");
|
||||
UE_rrc_inst[Mod_idP].Info[eNB_index].N311_cnt++;
|
||||
}
|
||||
|
||||
|
||||
@@ -752,7 +752,6 @@ int rrc_ue_decode_ccch( const protocol_ctxt_t* const ctxt_pP, const SRB_INFO* co
|
||||
char message_string[10000];
|
||||
size_t message_string_size;
|
||||
|
||||
//LOG_I(RRC, "Panos-D: rrc_ue_decode_ccch, Before xer_sprint() \n");
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_CCCH_Message, (void *)dl_ccch_msg)) > 0) {
|
||||
MessageDef *msg_p;
|
||||
|
||||
@@ -1943,7 +1942,6 @@ rrc_ue_process_securityModeCommand(
|
||||
char message_string[20000];
|
||||
size_t message_string_size;
|
||||
|
||||
//LOG_I(RRC, "Panos-D: rrc_ue_process_securityModeCommand, Before xer_sprint() \n");
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_DCCH_Message, (void *) &ul_dcch_msg)) > 0) {
|
||||
MessageDef *msg_p;
|
||||
|
||||
@@ -2055,7 +2053,6 @@ rrc_ue_process_ueCapabilityEnquiry(
|
||||
char message_string[20000];
|
||||
size_t message_string_size;
|
||||
|
||||
//LOG_I(RRC, "Panos-D: rrc_ue_process_ueCapabilityEnquiry, Before xer_sprint() \n");
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_UL_DCCH_Message, (void *) &ul_dcch_msg)) > 0) {
|
||||
MessageDef *msg_p;
|
||||
|
||||
@@ -2450,7 +2447,6 @@ rrc_ue_decode_dcch(
|
||||
char message_string[30000];
|
||||
size_t message_string_size;
|
||||
|
||||
//LOG_I(RRC, "Panos-D: rrc_ue_decode_dcch, Before xer_sprint() \n");
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_DCCH_Message, (void *)dl_dcch_msg)) > 0) {
|
||||
msg_p = itti_alloc_new_message_sized (TASK_RRC_UE, RRC_DL_DCCH, message_string_size + sizeof (IttiMsgText));
|
||||
msg_p->ittiMsg.rrc_dl_dcch.size = message_string_size;
|
||||
@@ -2986,7 +2982,6 @@ int decode_BCCH_DLSCH_Message(
|
||||
char message_string[15000];
|
||||
size_t message_string_size;
|
||||
|
||||
//LOG_I(RRC, "Panos-D: decode_BCCH_DLSCH_Message, Before xer_sprint() \n");
|
||||
if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_BCCH_DL_SCH_Message, (void *)bcch_message)) > 0) {
|
||||
MessageDef *msg_p;
|
||||
|
||||
@@ -3012,8 +3007,6 @@ int decode_BCCH_DLSCH_Message(
|
||||
sizeof(SystemInformationBlockType1_t) );
|
||||
LOG_D( RRC, "[UE %"PRIu8"] Decoding First SIB1\n", ctxt_pP->module_id );
|
||||
|
||||
//LOG_I( RRC, "Panos-D: decode_BCCH_DLSCH_Message1 BEFORE decode_SIB1");
|
||||
//printf("Panos-D: decode_BCCH_DLSCH_Message1 BEFORE decode_SIB1");
|
||||
decode_SIB1( ctxt_pP, eNB_index, rsrq, rsrp );
|
||||
}
|
||||
}
|
||||
@@ -3032,8 +3025,6 @@ int decode_BCCH_DLSCH_Message(
|
||||
LOG_D( RRC, "[UE %"PRIu8"] Decoding SI for frameP %"PRIu32"\n",
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->frame );
|
||||
//LOG_I( RRC, "Panos-D: decode_BCCH_DLSCH_Message1 BEFORE OTHER decode_SI");
|
||||
//printf("Panos-D: decode_BCCH_DLSCH_Message1 BEFORE OTHER decode_SI");
|
||||
decode_SI( ctxt_pP, eNB_index );
|
||||
//if (nfapi_mode == 3)
|
||||
UE_mac_inst[ctxt_pP->module_id].SI_Decoded = 1;
|
||||
@@ -3881,12 +3872,10 @@ uint64_t arfcn_to_freq(long arfcn) {
|
||||
//-----------------------------------------------------------------------------
|
||||
int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index )
|
||||
{
|
||||
//LOG_D( RRC, "Panos-D: decode_SI 1 \n");
|
||||
SystemInformation_t** si = &UE_rrc_inst[ctxt_pP->module_id].si[eNB_index];
|
||||
int new_sib = 0;
|
||||
SystemInformationBlockType1_t* sib1 = UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index];
|
||||
|
||||
//LOG_D( RRC, "Panos-D: decode_SI 2 \n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_IN );
|
||||
|
||||
// Dump contents
|
||||
@@ -3895,20 +3884,16 @@ uint64_t arfcn_to_freq(long arfcn) {
|
||||
LOG_D( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n",
|
||||
(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count );
|
||||
} else {
|
||||
//LOG_D( RRC, "Panos-D: decode_SI 2.3 \n");
|
||||
LOG_D( RRC, "[UE] Unknown criticalExtension version (not Rel8)\n" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOG_D( RRC, "Panos-D: decode_SI 3 \n");
|
||||
for (int i=0; i<(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count; i++) {
|
||||
//LOG_I( RRC, "Panos-D: SI count %d\n", i );
|
||||
struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member *typeandinfo;
|
||||
typeandinfo = (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.array[i];
|
||||
|
||||
switch(typeandinfo->present) {
|
||||
case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2:
|
||||
//LOG_D( RRC, "Panos-D: decode_SI 4 \n");
|
||||
if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&2) == 0) {
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=2;
|
||||
new_sib=1;
|
||||
@@ -3998,7 +3983,6 @@ uint64_t arfcn_to_freq(long arfcn) {
|
||||
break; // case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2
|
||||
|
||||
case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3:
|
||||
//LOG_D( RRC, "Panos-D: decode_SI 5 \n");
|
||||
if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&4) == 0) {
|
||||
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=4;
|
||||
new_sib=1;
|
||||
|
||||
Reference in New Issue
Block a user