Commit 40607f89 authored by Raymond Knopp's avatar Raymond Knopp

Fixed issues related to the establishemt of one-to-one direct connection. The...

Fixed issues related to the establishemt of one-to-one direct connection. The connection is now established when there are no PC5-s signaling packet losses due to the lower layers.
parent 80ba639f
...@@ -864,21 +864,28 @@ void ue_send_sl_sdu(module_id_t module_idP, ...@@ -864,21 +864,28 @@ void ue_send_sl_sdu(module_id_t module_idP,
int j = 0; int j = 0;
for (i=0; i< MAX_NUM_LCID; i++) for (i=0; i< MAX_NUM_LCID; i++)
if ((UE_mac_inst[module_idP].sl_info[i].groupL2Id == destinationL2Id) && (UE_mac_inst[module_idP].sl_info[i].sourceL2Id != sourceL2Id)) { if ((UE_mac_inst[module_idP].sl_info[i].groupL2Id == destinationL2Id) && (UE_mac_inst[module_idP].sl_info[i].sourceL2Id != sourceL2Id)) {
lcid = UE_mac_inst[module_idP].sl_info[i].LCID; lcid = UE_mac_inst[module_idP].sl_info[i].LCID;
LOG_I(MAC, "Found corresponding receiver LCID for group communication: %d \n", lcid);
break; break;
} }
for (j = 0; j< MAX_NUM_LCID; j++){ for (j = 0; j< MAX_NUM_LCID; j++){
if ((longh->LCID < MAX_NUM_LCID_DATA) && (j < MAX_NUM_LCID_DATA)){ if ((longh->LCID < MAX_NUM_LCID_DATA) && (j < MAX_NUM_LCID_DATA)){
if ((UE_mac_inst[module_idP].sl_info[j].destinationL2Id == sourceL2Id) && (UE_mac_inst[module_idP].sl_info[j].sourceL2Id == destinationL2Id)) { if ((UE_mac_inst[module_idP].sl_info[j].destinationL2Id == sourceL2Id) && (UE_mac_inst[module_idP].sl_info[j].sourceL2Id == destinationL2Id)) {
lcid = longh->LCID; //UE_mac_inst[module_idP].sl_info[j].LCID; //lcid = longh->LCID;
lcid = UE_mac_inst[module_idP].sl_info[j].LCID;
LOG_I(MAC, "Found corresponding receiver LCID for DATA direct communication: %d \n", lcid);
break; break;
} }
} }
if ((longh->LCID >= MAX_NUM_LCID_DATA) && (j >= MAX_NUM_LCID_DATA)){ if ((longh->LCID >= MAX_NUM_LCID_DATA) && (j >= MAX_NUM_LCID_DATA)){
//PC5-S (receive message after transmitting, e.g, security-command...) //PC5-S (receive message after transmitting, e.g, security-command...)
if ((UE_mac_inst[module_idP].sl_info[j].sourceL2Id == destinationL2Id) && (UE_mac_inst[module_idP].sl_info[j].destinationL2Id == 0)) { if ((UE_mac_inst[module_idP].sl_info[j].sourceL2Id == destinationL2Id) && (UE_mac_inst[module_idP].sl_info[j].destinationL2Id == 0)) {
if (UE_mac_inst[module_idP].sl_info[j].LCID > 0) lcid = longh->LCID;//UE_mac_inst[module_idP].sl_info[j].LCID; LOG_I(MAC, "Received a PC5-S message, Tx LCID: %d Rx LCID: %d \n \n", longh->LCID, UE_mac_inst[module_idP].sl_info[j].LCID);
if (UE_mac_inst[module_idP].sl_info[j].LCID > 0) {
lcid = UE_mac_inst[module_idP].sl_info[j].LCID; //lcid = longh->LCID;
LOG_I(MAC, "Found corresponding receiver LCID for SIGNALING direct communication: %d \n", lcid);
}
break; break;
} }
...@@ -912,7 +919,9 @@ void ue_send_sl_sdu(module_id_t module_idP, ...@@ -912,7 +919,9 @@ void ue_send_sl_sdu(module_id_t module_idP,
} }
*/ */
lcid = longh->LCID;
//lcid = longh->LCID;
//LOG_I(MAC, "Actually assigned receiver bearer: %d \n", lcid);
// LOG_I( MAC, "DestinationL2Id: 0x%08x, sl_rbid %d, longh->LCID %d \n", destinationL2Id, lcid, longh->LCID ); // LOG_I( MAC, "DestinationL2Id: 0x%08x, sl_rbid %d, longh->LCID %d \n", destinationL2Id, lcid, longh->LCID );
...@@ -945,7 +954,7 @@ void ue_send_sl_sdu(module_id_t module_idP, ...@@ -945,7 +954,7 @@ void ue_send_sl_sdu(module_id_t module_idP,
} }
LOG_D(MAC,"%d.%d myL2Id %d sending sdu of size %d, sourceL2Id %d, lcid %d to RLC\n",frameP,subframeP,UE_mac_inst[module_idP].sourceL2Id,rlc_sdu_len,sourceL2Id,lcid); LOG_I(MAC,"%d.%d myL2Id %d sending sdu of size %d, sourceL2Id %d, lcid %d to RLC\n",frameP,subframeP,UE_mac_inst[module_idP].sourceL2Id,rlc_sdu_len,sourceL2Id,lcid);
mac_rlc_data_ind( mac_rlc_data_ind(
module_idP, module_idP,
...@@ -3586,9 +3595,9 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -3586,9 +3595,9 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
// Notes: 1. hard-coded to 24-bit destination format for now // Notes: 1. hard-coded to 24-bit destination format for now
if (sdu_length > 0) { if (sdu_length > 0) {
LOG_D(MAC,"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)\n",frameP,subframeP,sdu_length,req); LOG_I(MAC,"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)\n",frameP,subframeP,sdu_length,req);
LOG_D(MAC,"sourceL2Id: 0x%08x \n",ue->sourceL2Id); LOG_I(MAC,"sourceL2Id: 0x%08x \n",ue->sourceL2Id);
LOG_D(MAC,"groupL2Id/destinationL2Id: 0x%08x \n",ue->destinationL2Id); LOG_I(MAC,"groupL2Id/destinationL2Id: 0x%08x \n",ue->destinationL2Id);
slsch->payload = (unsigned char*)ue->slsch_pdu.payload; slsch->payload = (unsigned char*)ue->slsch_pdu.payload;
if (sdu_length < 128) { if (sdu_length < 128) {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
*/ */
#define PDCP_FIFO_C #define PDCP_FIFO_C
//#define PDCP_DEBUG 1 #define PDCP_DEBUG 1
//#define DEBUG_PDCP_FIFO_FLUSH_SDU //#define DEBUG_PDCP_FIFO_FLUSH_SDU
extern int otg_enabled; extern int otg_enabled;
...@@ -207,12 +207,12 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -207,12 +207,12 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
#ifdef PDCP_DEBUG #ifdef PDCP_DEBUG
sl_pc5s_msg_recv = calloc(1, sizeof(sidelink_pc5s_element)); sl_pc5s_msg_recv = calloc(1, sizeof(sidelink_pc5s_element));
memcpy((void*)sl_pc5s_msg_recv, (void*)(sdu_p->data+sizeof(pdcp_data_ind_header_t)), sizeof(sidelink_pc5s_element)); memcpy((void*)sl_pc5s_msg_recv, (void*)(sdu_p->data+sizeof(pdcp_data_ind_header_t)), sizeof(sidelink_pc5s_element));
LOG_D(PDCP,"Received PC5S message, header traffic_type: %d)\n", sl_pc5s_msg_recv->pc5s_header.traffic_type); LOG_I(PDCP,"Received PC5S message, header traffic_type: %d)\n", sl_pc5s_msg_recv->pc5s_header.traffic_type);
LOG_D(PDCP,"Received PC5S message, header rb_id: %d)\n", sl_pc5s_msg_recv->pc5s_header.rb_id); LOG_I(PDCP,"Received PC5S message, header rb_id: %d)\n", sl_pc5s_msg_recv->pc5s_header.rb_id);
LOG_D(PDCP,"Received PC5S message, header data_size: %d)\n", sl_pc5s_msg_recv->pc5s_header.data_size); LOG_I(PDCP,"Received PC5S message, header data_size: %d)\n", sl_pc5s_msg_recv->pc5s_header.data_size);
LOG_D(PDCP,"Received PC5S message, header inst: %d)\n", sl_pc5s_msg_recv->pc5s_header.inst); LOG_I(PDCP,"Received PC5S message, header inst: %d)\n", sl_pc5s_msg_recv->pc5s_header.inst);
LOG_D(PDCP,"Received PC5-S message, sourceL2Id: 0x%08x\n)\n", sl_pc5s_msg_recv->pc5s_header.sourceL2Id); LOG_I(PDCP,"Received PC5-S message, sourceL2Id: 0x%08x\n)\n", sl_pc5s_msg_recv->pc5s_header.sourceL2Id);
LOG_D(PDCP,"Received PC5-S message, destinationL1Id: 0x%08x\n)\n", sl_pc5s_msg_recv->pc5s_header.destinationL2Id); LOG_I(PDCP,"Received PC5-S message, destinationL1Id: 0x%08x\n)\n", sl_pc5s_msg_recv->pc5s_header.destinationL2Id);
free(sl_pc5s_msg_recv); free(sl_pc5s_msg_recv);
#endif #endif
memset(send_buf, 0, BUFSIZE); memset(send_buf, 0, BUFSIZE);
...@@ -593,14 +593,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -593,14 +593,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} else if (pc5s_header->traffic_type == TRAFFIC_PC5S_SIGNALLING) { //if containing PC5-S message -> send to other UE } else if (pc5s_header->traffic_type == TRAFFIC_PC5S_SIGNALLING) { //if containing PC5-S message -> send to other UE
LOG_D(PDCP,"Received PC5-S message ... send to the other UE\n"); LOG_I(PDCP,"Received PC5-S message ... send to the other UE\n");
#ifdef PDCP_DEBUG #ifdef PDCP_DEBUG
LOG_D(PDCP,"Received PC5-S message, traffic_type: %d)\n", pc5s_header->traffic_type); LOG_I(PDCP,"Received PC5-S message, traffic_type: %d)\n", pc5s_header->traffic_type);
LOG_D(PDCP,"Received PC5-S message, rbid: %d)\n", pc5s_header->rb_id); LOG_I(PDCP,"Received PC5-S message, rbid: %d)\n", pc5s_header->rb_id);
LOG_D(PDCP,"Received PC5-S message, data_size: %d)\n", pc5s_header->data_size); LOG_I(PDCP,"Received PC5-S message, data_size: %d)\n", pc5s_header->data_size);
LOG_D(PDCP,"Received PC5-S message, inst: %d)\n", pc5s_header->inst); LOG_I(PDCP,"Received PC5-S message, inst: %d)\n", pc5s_header->inst);
LOG_D(PDCP,"Received PC5-S message,sourceL2Id: 0x%08x\n)\n", pc5s_header->sourceL2Id); LOG_I(PDCP,"Received PC5-S message,sourceL2Id: 0x%08x\n)\n", pc5s_header->sourceL2Id);
LOG_D(PDCP,"Received PC5-S message,destinationL1Id: 0x%08x\n)\n", pc5s_header->destinationL2Id); LOG_I(PDCP,"Received PC5-S message,destinationL1Id: 0x%08x\n)\n", pc5s_header->destinationL2Id);
#endif #endif
......
...@@ -5756,7 +5756,7 @@ void *rrc_control_socket_thread_fct(void *arg) ...@@ -5756,7 +5756,7 @@ void *rrc_control_socket_thread_fct(void *arg)
//configure MAC with sourceL2Id/groupL2ID //configure MAC with sourceL2Id/groupL2ID
LOG_I(PHY,"Configuration MAC for sourceL2Id/GroupL2ID %d/%d\n",sourceL2Id,groupL2Id); LOG_I(PHY,"Configuration MAC for sourceL2Id/GroupL2ID, %d/%d, UE->DRB_config[0][0]->drb_Identity: %d, group_comm_rbid: %d \n",sourceL2Id,groupL2Id,UE->DRB_config[0][0]->drb_Identity, group_comm_rbid);
rrc_mac_config_req_ue(module_id,0,0, //eNB_index =0 rrc_mac_config_req_ue(module_id,0,0, //eNB_index =0
(RadioResourceConfigCommonSIB_t *)NULL, (RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL, (struct PhysicalConfigDedicated *)NULL,
...@@ -5791,8 +5791,8 @@ void *rrc_control_socket_thread_fct(void *arg) ...@@ -5791,8 +5791,8 @@ void *rrc_control_socket_thread_fct(void *arg)
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
,CONFIG_ACTION_ADD, ,CONFIG_ACTION_ADD,
&sourceL2Id, &sourceL2Id,
&groupL2Id,
NULL, NULL,
&groupL2Id,
NULL, NULL,
1025, // indicates that there is no update in the frame number 1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number 11, // /indicates that there isno update in the subframe number
...@@ -6387,7 +6387,8 @@ void *rrc_control_socket_thread_fct(void *arg) ...@@ -6387,7 +6387,8 @@ void *rrc_control_socket_thread_fct(void *arg)
#endif #endif
(MeasObjectToAddMod_t **)NULL, (MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL, (MAC_MainConfig_t *)NULL,
10, //LCID //10, //LCID
pc5s_rbid, //LCID
(struct LogicalChannelConfig *)NULL, (struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL, (MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL, (TDD_Config_t *)NULL,
......
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