Commit 9a10ec0d authored by ivan's avatar ivan

panos patches for user-plane PDCP, log removal

parent 6849e297
...@@ -760,7 +760,7 @@ void ulsch_extract_rbs_single(int32_t **rxdataF, ...@@ -760,7 +760,7 @@ void ulsch_extract_rbs_single(int32_t **rxdataF,
rxF = &rxdataF[aarx][(6*(2*first_rb - frame_parms->N_RB_UL) + symbol*frame_parms->ofdm_symbol_size)]; rxF = &rxdataF[aarx][(6*(2*first_rb - frame_parms->N_RB_UL) + symbol*frame_parms->ofdm_symbol_size)];
#ifdef DEBUG_ULSCH #ifdef DEBUG_ULSCH
LOG_D(PHY,"copying %d REs from %p to %p\n",nb_rb2*6,rxF,rxF_ext); //LOG_D(PHY,"copying %d REs from %p to %p\n",nb_rb2*6,rxF,rxF_ext);
#endif #endif
memcpy(rxF_ext, rxF, nb_rb2*6*sizeof(int)); memcpy(rxF_ext, rxF, nb_rb2*6*sizeof(int));
rxF_ext += nb_rb2*6; rxF_ext += nb_rb2*6;
...@@ -846,7 +846,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext, ...@@ -846,7 +846,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
#endif #endif
for (rb=0; rb<nb_rb; rb++) { for (rb=0; rb<nb_rb; rb++) {
LOG_D(PHY,"comp: symbol %d rb %d\n",symbol,rb); //LOG_D(PHY,"comp: symbol %d rb %d\n",symbol,rb);
// just compute channel magnitude without scaling, this is done after equalization for SC-FDMA // just compute channel magnitude without scaling, this is done after equalization for SC-FDMA
...@@ -869,7 +869,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext, ...@@ -869,7 +869,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU1 = _mm_packs_epi32(mmtmpU0,mmtmpU0); mmtmpU1 = _mm_packs_epi32(mmtmpU0,mmtmpU0);
ul_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpU1,mmtmpU1); ul_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpU1,mmtmpU1);
LOG_D(PHY,"comp: symbol %d rb %d => %d,%d,%d (output_shift %d)\n",symbol,rb,*((int16_t*)&ul_ch_mag128[0]),*((int16_t*)&ul_ch_mag128[1]),*((int16_t*)&ul_ch_mag128[2]),output_shift); //LOG_D(PHY,"comp: symbol %d rb %d => %d,%d,%d (output_shift %d)\n",symbol,rb,*((int16_t*)&ul_ch_mag128[0]),*((int16_t*)&ul_ch_mag128[1]),*((int16_t*)&ul_ch_mag128[2]),output_shift);
#elif defined(__arm__) #elif defined(__arm__)
......
...@@ -37,8 +37,9 @@ ...@@ -37,8 +37,9 @@
#include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "LAYER2/MAC/mac_proto.h" #include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
//#define PSSCH_DEBUG 1 //#define PSSCH_DEBUG 1
#define DEBUG_SCI_DECODING 1 //#define DEBUG_SCI_DECODING 1
extern int extern int
multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP); multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
...@@ -398,7 +399,7 @@ void pscch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx,uint32_ ...@@ -398,7 +399,7 @@ void pscch_codingmodulation(PHY_VARS_UE *ue,int frame_tx,int subframe_tx,uint32_
int length = log2_approx(slsch->N_SL_RB_data*((ue->slsch_rx.N_SL_RB_data+1)>>1))+32; int length = log2_approx(slsch->N_SL_RB_data*((ue->slsch_rx.N_SL_RB_data+1)>>1))+32;
LOG_D(PHY,"sci %lx (%d bits): freq_hopping_flag %d,resource_block_coding %d,time_resource_pattern %d,mcs %d,timing_advance_indication %d, group_destination_id %d\n",sci,length, LOG_D(PHY,"sci %lx (%d bits): freq_hopping_flag %d,resource_block_coding %d,time_resource_pattern %d,mcs %d,timing_advance_indication %d, group_destination_id %d\n",sci,length,
slsch->freq_hopping_flag, slsch->freq_hopping_flag,
slsch->resource_block_coding, slsch->resource_block_coding,
slsch->time_resource_pattern, slsch->time_resource_pattern,
...@@ -1100,7 +1101,7 @@ void pscch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra ...@@ -1100,7 +1101,7 @@ void pscch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra
else else
ue->slcch_received = 0; ue->slcch_received = 0;
//ue->slcch_received = 1; ue->slcch_received = 1;
ue->slsch_decoded = 0; ue->slsch_decoded = 0;
#ifdef DEBUG_SCI_DECODING #ifdef DEBUG_SCI_DECODING
printf("%d.%d sci %lx (%d bits,RAbits %d) : freq_hop %d, resource_block_coding %d, time_resource_pattern %d, mcs %d, timing_advance_indication %d, group_destination_id %d (gid shift %d result %lx => %lx\n", printf("%d.%d sci %lx (%d bits,RAbits %d) : freq_hop %d, resource_block_coding %d, time_resource_pattern %d, mcs %d, timing_advance_indication %d, group_destination_id %d (gid shift %d result %lx => %lx\n",
...@@ -1216,8 +1217,14 @@ void rx_slcch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subframe_rx) ...@@ -1216,8 +1217,14 @@ void rx_slcch(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subframe_rx)
if (frame_rx < 100) LOG_D(PHY,"%d.%d: Checking n_pscch %d => a1 %d, a2 %d, b1 %d, b2 %d (LPSCCH %d, M_RB_PSCCH_RP %d)\n", if (frame_rx < 100) LOG_D(PHY,"%d.%d: Checking n_pscch %d => a1 %d, a2 %d, b1 %d, b2 %d (LPSCCH %d, M_RB_PSCCH_RP %d)\n",
frame_rx,subframe_rx,n_pscch,a1,a2,b1,b2,LPSCCH,M_RB_PSCCH_RP); frame_rx,subframe_rx,n_pscch,a1,a2,b1,b2,LPSCCH,M_RB_PSCCH_RP);
if (absSF_modP == b1) pscch_decoding(ue,proc,frame_rx,subframe_rx,a1,0); if (absSF_modP == b1) {
else if (absSF_modP == b2) pscch_decoding(ue,proc,frame_rx,subframe_rx,a2,1); LOG_D(PHY, "About to decode SCI at b1: %d \n \n \n", b1);
pscch_decoding(ue,proc,frame_rx,subframe_rx,a1,0);
}
else if (absSF_modP == b2){
LOG_D(PHY, "About to decode SCI at b2: %d \n \n \n", b2);
pscch_decoding(ue,proc,frame_rx,subframe_rx,a2,1);
}
else continue; else continue;
} }
...@@ -1529,6 +1536,9 @@ void slsch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra ...@@ -1529,6 +1536,9 @@ void slsch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra
slsch->group_destination_id,slsch->L_CRBs,slsch->mcs, slsch->group_destination_id,slsch->L_CRBs,slsch->mcs,
slsch->rvidx,ret); slsch->rvidx,ret);
/*LOG_I(PDCP, "In slsch_decoding() before calling ue_send_sl_sdu() 1 \n");
list_display_memory_head_tail(&pdcp_sdu_list);*/
ue_send_sl_sdu(0, ue_send_sl_sdu(0,
0, 0,
frame_rx,subframe_rx, frame_rx,subframe_rx,
...@@ -1536,6 +1546,8 @@ void slsch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra ...@@ -1536,6 +1546,8 @@ void slsch_decoding(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,int frame_rx,int subfra
ue->dlsch_rx_slsch->harq_processes[0]->TBS>>3, ue->dlsch_rx_slsch->harq_processes[0]->TBS>>3,
0, 0,
SL_DISCOVERY_FLAG_NO); SL_DISCOVERY_FLAG_NO);
/*LOG_I(PDCP, "In slsch_decoding() before calling ue_send_sl_sdu() 1 \n");
list_display_memory_head_tail(&pdcp_sdu_list);*/
if (slsch->rvidx == 0 ) ue->slsch_rxcnt[0]++; if (slsch->rvidx == 0 ) ue->slsch_rxcnt[0]++;
else if (slsch->rvidx == 2 ) ue->slsch_rxcnt[1]++; else if (slsch->rvidx == 2 ) ue->slsch_rxcnt[1]++;
......
...@@ -891,8 +891,7 @@ void ue_send_sl_sdu(module_id_t module_idP, ...@@ -891,8 +891,7 @@ void ue_send_sl_sdu(module_id_t module_idP,
uint8_t eNB_index, uint8_t eNB_index,
sl_discovery_flag_t sl_discovery_flag sl_discovery_flag_t sl_discovery_flag
) { ) {
int rlc_sdu_len;
int rlc_sdu_len;
unsigned char *rlc_sdu; unsigned char *rlc_sdu;
int lcid=-1; int lcid=-1;
uint32_t destinationL2Id =0x00000000; uint32_t destinationL2Id =0x00000000;
...@@ -921,7 +920,7 @@ void ue_send_sl_sdu(module_id_t module_idP, ...@@ -921,7 +920,7 @@ void ue_send_sl_sdu(module_id_t module_idP,
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); LOG_D(MAC, "Found corresponding receiver LCID for group communication: %d \n", lcid);
break; break;
} }
...@@ -931,7 +930,7 @@ void ue_send_sl_sdu(module_id_t module_idP, ...@@ -931,7 +930,7 @@ void ue_send_sl_sdu(module_id_t module_idP,
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; //lcid = longh->LCID;
lcid = UE_mac_inst[module_idP].sl_info[j].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); LOG_D(MAC, "Found corresponding receiver LCID for DATA direct communication: %d \n", lcid);
break; break;
} }
} }
...@@ -1011,10 +1010,10 @@ void ue_send_sl_sdu(module_id_t module_idP, ...@@ -1011,10 +1010,10 @@ void ue_send_sl_sdu(module_id_t module_idP,
} }
AssertFatal(lcid>0,"lcid %d should not happen\n",lcid); AssertFatal(lcid>0,"lcid %d should not happen\n",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); 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);
if(UE_rrc_inst[0].Info[0].rnti == 0){ if(UE_rrc_inst[0].Info[0].rnti == 0){
mac_rlc_data_ind( mac_rlc_data_ind(
module_idP, module_idP,
0x1234, 0x1234,
eNB_index, eNB_index,
...@@ -3614,9 +3613,17 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -3614,9 +3613,17 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
if (ue->sl_info[i].LCID > 0) { if (ue->sl_info[i].LCID > 0) {
// for (int j = 0; j < ue->numCommFlows; j++){ // for (int j = 0; j < ue->numCommFlows; j++){
if ((ue->sourceL2Id > 0) && (ue->sl_info[i].destinationL2Id >0) ){ if ((ue->sourceL2Id > 0) && (ue->sl_info[i].destinationL2Id >0) ){
/*LOG_I(MAC,"In ue_get_slsch before mac_rlc_status_ind \n");
list_display_memory_head_tail(&pdcp_sdu_list);*/
rlc_status = mac_rlc_status_ind(module_idP, ue_rnti,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO, rlc_status = mac_rlc_status_ind(module_idP, ue_rnti,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].destinationL2Id ); ue->sl_info[i].LCID, 0xFFFF, ue->sourceL2Id, ue->sl_info[i].destinationL2Id );
LOG_D(MAC,"absSF_offset %d (test %d): Checking status (%d,Dest %d) => LCID %d => %d bytes\n",absSF_offset,slsch_test,ue->sourceL2Id,ue->sl_info[i].destinationL2Id,ue->sl_info[i].LCID,rlc_status.bytes_in_buffer);
/*LOG_I(MAC,"In ue_get_slsch after mac_rlc_status_ind \n");
list_display_memory_head_tail(&pdcp_sdu_list);*/
LOG_D(MAC,"absSF_offset %d (test %d): Checking status (%d,Dest %d) => LCID %d => %d bytes\n",absSF_offset,slsch_test,ue->sourceL2Id,ue->sl_info[i].destinationL2Id,ue->sl_info[i].LCID,rlc_status.bytes_in_buffer);
if (rlc_status.bytes_in_buffer > 2 || slsch_test == 1){ if (rlc_status.bytes_in_buffer > 2 || slsch_test == 1){
if (slsch_test == 1 && rlc_status.bytes_in_buffer <= 2) rlc_status.bytes_in_buffer = 300; if (slsch_test == 1 && rlc_status.bytes_in_buffer <= 2) rlc_status.bytes_in_buffer = 300;
LOG_D(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer \n",frameP,subframeP,rlc_status.bytes_in_buffer); LOG_D(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer \n",frameP,subframeP,rlc_status.bytes_in_buffer);
...@@ -3662,7 +3669,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -3662,7 +3669,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
slsch->RB_start = RB_start; slsch->RB_start = RB_start;
slsch->L_CRBs = L_CRBs; slsch->L_CRBs = L_CRBs;
// fill in SCI fields // fill in SCI fields
slsch->n_pscch = ue->sourceL2Id; slsch->n_pscch = 2; //ue->sourceL2Id;
slsch->format = 0; slsch->format = 0;
slsch->freq_hopping_flag = 0; slsch->freq_hopping_flag = 0;
slsch->resource_block_coding = computeRIV(slsch->N_SL_RB_data,RB_start,L_CRBs); slsch->resource_block_coding = computeRIV(slsch->N_SL_RB_data,RB_start,L_CRBs);
...@@ -3714,7 +3721,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -3714,7 +3721,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
else req = rlc_status.bytes_in_buffer+2; else req = rlc_status.bytes_in_buffer+2;
if (req>0) { if (req>0) {
sdu_length = mac_rlc_data_req(module_idP, sdu_length = mac_rlc_data_req(module_idP,
ue_rnti, ue_rnti,
0, 0,
frameP, frameP,
...@@ -3728,15 +3735,14 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -3728,15 +3735,14 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
ue->destinationL2Id ue->destinationL2Id
#endif #endif
); );
if (sdu_length == 0 && slsch_test == 1) sdu_length = 300; if (sdu_length == 0 && slsch_test == 1) sdu_length = 300;
// 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_I(MAC,"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)\n",frameP,subframeP,sdu_length,req); LOG_D(MAC,"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)\n",frameP,subframeP,sdu_length,req);
LOG_I(MAC,"sourceL2Id: 0x%08x \n",ue->sourceL2Id); LOG_D(MAC,"sourceL2Id: 0x%08x \n",ue->sourceL2Id);
LOG_I(MAC,"groupL2Id/destinationL2Id: 0x%08x \n",ue->destinationL2Id); LOG_D(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) {
......
...@@ -64,6 +64,8 @@ ...@@ -64,6 +64,8 @@
#endif #endif
extern int otg_enabled; extern int otg_enabled;
extern int sidelink_active;
#if defined(ENABLE_USE_MME) #if defined(ENABLE_USE_MME)
extern uint8_t nfapi_mode; extern uint8_t nfapi_mode;
#endif #endif
...@@ -176,7 +178,6 @@ boolean_t pdcp_data_req( ...@@ -176,7 +178,6 @@ boolean_t pdcp_data_req(
if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) { if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) {
LOG_D(PDCP, " [TM] Asking for a new mem_block of size %d\n",sdu_buffer_sizeP); LOG_D(PDCP, " [TM] Asking for a new mem_block of size %d\n",sdu_buffer_sizeP);
pdcp_pdu_p = get_free_mem_block(sdu_buffer_sizeP, __func__); pdcp_pdu_p = get_free_mem_block(sdu_buffer_sizeP, __func__);
if (pdcp_pdu_p != NULL) { if (pdcp_pdu_p != NULL) {
memcpy(&pdcp_pdu_p->data[0], sdu_buffer_pP, sdu_buffer_sizeP); memcpy(&pdcp_pdu_p->data[0], sdu_buffer_pP, sdu_buffer_sizeP);
#if defined(DEBUG_PDCP_PAYLOAD) #if defined(DEBUG_PDCP_PAYLOAD)
...@@ -184,7 +185,6 @@ boolean_t pdcp_data_req( ...@@ -184,7 +185,6 @@ boolean_t pdcp_data_req(
(unsigned char *)&pdcp_pdu_p->data[0], (unsigned char *)&pdcp_pdu_p->data[0],
sdu_buffer_sizeP); sdu_buffer_sizeP);
#endif #endif
LOG_D(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,NULL, NULL ,NULL, NULL
...@@ -220,7 +220,6 @@ boolean_t pdcp_data_req( ...@@ -220,7 +220,6 @@ boolean_t pdcp_data_req(
* Allocate a new block for the new PDU (i.e. PDU header and SDU payload) * Allocate a new block for the new PDU (i.e. PDU header and SDU payload)
*/ */
pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__); pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__);
if (pdcp_pdu_p != NULL) { if (pdcp_pdu_p != NULL) {
/* /*
* Create a Data PDU with header and append data * Create a Data PDU with header and append data
...@@ -291,14 +290,12 @@ boolean_t pdcp_data_req( ...@@ -291,14 +290,12 @@ boolean_t pdcp_data_req(
LOG_D(PDCP, "Sequence number %d is assigned to current PDU\n", current_sn); LOG_D(PDCP, "Sequence number %d is assigned to current PDU\n", current_sn);
/* Then append data... */ /* Then append data... */
memcpy(&pdcp_pdu_p->data[pdcp_header_len], sdu_buffer_pP, sdu_buffer_sizeP); memcpy(&pdcp_pdu_p->data[pdcp_header_len], sdu_buffer_pP, sdu_buffer_sizeP);
//For control plane data that are not integrity protected, //For control plane data that are not integrity protected,
// the MAC-I field is still present and should be padded with padding bits set to 0. // the MAC-I field is still present and should be padded with padding bits set to 0.
// NOTE: user-plane data are never integrity protected // NOTE: user-plane data are never integrity protected
for (i=0; i<pdcp_tailer_len; i++) { for (i=0; i<pdcp_tailer_len; i++) {
pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP + i] = 0x00;// pdu_header.mac_i[i]; pdcp_pdu_p->data[pdcp_header_len + sdu_buffer_sizeP + i] = 0x00;// pdu_header.mac_i[i];
} }
#if defined(ENABLE_SECURITY) #if defined(ENABLE_SECURITY)
if ((pdcp_p->security_activated != 0) && if ((pdcp_p->security_activated != 0) &&
...@@ -359,13 +356,18 @@ boolean_t pdcp_data_req( ...@@ -359,13 +356,18 @@ boolean_t pdcp_data_req(
*/ */
LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)pdcp_pdu_p->data,pdcp_pdu_size, LOG_DUMPMSG(PDCP,DEBUG_PDCP,(char *)pdcp_pdu_p->data,pdcp_pdu_size,
"[MSG] PDCP DL %s PDU on rb_id %d\n",(srb_flagP)? "CONTROL" : "DATA", rb_idP); "[MSG] PDCP DL %s PDU on rb_id %d\n",(srb_flagP)? "CONTROL" : "DATA", rb_idP);
LOG_D(PDCP, "Before rlc_data_req 2, srb_flagP: %d, rb_idP: %d \n", srb_flagP, rb_idP);
//LOG_I(PDCP, "In pdcp_data_req() before calling rlc_data_req() 1 \n");
//list_display_memory_head_tail(&pdcp_sdu_list);
rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p rlc_status = rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,sourceL2Id ,sourceL2Id
,destinationL2Id ,destinationL2Id
#endif #endif
); );
//LOG_I(PDCP, "In pdcp_data_req() after calling rlc_data_req() 1 \n");
//list_display_memory_head_tail(&pdcp_sdu_list);
} }
switch (rlc_status) { switch (rlc_status) {
...@@ -406,10 +408,15 @@ boolean_t pdcp_data_req( ...@@ -406,10 +408,15 @@ boolean_t pdcp_data_req(
* so we return TRUE afterwards * so we return TRUE afterwards
*/ */
for (pdcp_uid=0; pdcp_uid< MAX_MOBILES_PER_ENB; pdcp_uid++) { LOG_D(PDCP, "In pdcp_data_req(), MAX_MOBILES_PER_ENB: %d, ctxt_pP->module_id: %d, ctxt_pP->rnti: %d \n \n", MAX_MOBILES_PER_ENB, ctxt_pP->module_id, ctxt_pP->rnti);
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti )
break; if (!sidelink_active){
} for (pdcp_uid=0; pdcp_uid< MAX_MOBILES_PER_ENB; pdcp_uid++) {
LOG_I(PDCP, "In pdcp_data_req(), pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid]: %d", pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid]);
if (pdcp_enb[ctxt_pP->module_id].rnti[pdcp_uid] == ctxt_pP->rnti )
break;
}
//LOG_I(PDCP,"ueid %d lcid %d tx seq num %d\n", pdcp_uid, rb_idP+rb_offset, current_sn); //LOG_I(PDCP,"ueid %d lcid %d tx seq num %d\n", pdcp_uid, rb_idP+rb_offset, current_sn);
Pdcp_stats_tx[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++; Pdcp_stats_tx[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]++;
...@@ -421,6 +428,12 @@ boolean_t pdcp_data_req( ...@@ -421,6 +428,12 @@ boolean_t pdcp_data_req(
Pdcp_stats_tx_aiat_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]); Pdcp_stats_tx_aiat_tmp_w[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]+= (pdcp_enb[ctxt_pP->module_id].sfn - Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]);
Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn; Pdcp_stats_tx_iat[ctxt_pP->module_id][pdcp_uid][rb_idP+rb_offset]=pdcp_enb[ctxt_pP->module_id].sfn;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_OUT);
} //if (!sidelink_active)
/*LOG_I(PDCP, "In pdcp_data_req() just before returning... \n");
list_display_memory_head_tail(&pdcp_sdu_list);*/
return ret; return ret;
} }
...@@ -437,7 +450,6 @@ pdcp_data_ind( ...@@ -437,7 +450,6 @@ pdcp_data_ind(
) )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
{ {
//LOG_I(RLC, "Panos-D: pdcp_data_ind() 1 \n");
pdcp_t *pdcp_p = NULL; pdcp_t *pdcp_p = NULL;
list_t *sdu_list_p = NULL; list_t *sdu_list_p = NULL;
mem_block_t *new_sdu_p = NULL; mem_block_t *new_sdu_p = NULL;
...@@ -568,6 +580,7 @@ pdcp_data_ind( ...@@ -568,6 +580,7 @@ pdcp_data_ind(
PROTOCOL_PDCP_CTXT_FMT"Incoming (from RLC) SDU is short of size (size:%d)! Ignoring...\n", PROTOCOL_PDCP_CTXT_FMT"Incoming (from RLC) SDU is short of size (size:%d)! Ignoring...\n",
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p), PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p),
sdu_buffer_sizeP); sdu_buffer_sizeP);
free_mem_block(sdu_buffer_pP, __func__); free_mem_block(sdu_buffer_pP, __func__);
if (ctxt_pP->enb_flag) { if (ctxt_pP->enb_flag) {
...@@ -756,7 +769,8 @@ pdcp_data_ind( ...@@ -756,7 +769,8 @@ pdcp_data_ind(
#endif #endif
if (FALSE == packet_forwarded) { if (FALSE == packet_forwarded) {
new_sdu_p = get_free_mem_block(sdu_buffer_sizeP - payload_offset + sizeof (pdcp_data_ind_header_t), __func__);
new_sdu_p = get_free_mem_block(sdu_buffer_sizeP - payload_offset + sizeof (pdcp_data_ind_header_t), __func__);
if (new_sdu_p) { if (new_sdu_p) {
if ((MBMS_flagP == 0) && (pdcp_p->rlc_mode == RLC_MODE_AM)) { if ((MBMS_flagP == 0) && (pdcp_p->rlc_mode == RLC_MODE_AM)) {
...@@ -816,9 +830,13 @@ pdcp_data_ind( ...@@ -816,9 +830,13 @@ pdcp_data_ind(
LOG_D(PDCP, "inst=%d size=%d\n", ((pdcp_data_ind_header_t*) new_sdu_p->data)->inst, ((pdcp_data_ind_header_t *) new_sdu_p->data)->data_size); LOG_D(PDCP, "inst=%d size=%d\n", ((pdcp_data_ind_header_t*) new_sdu_p->data)->inst, ((pdcp_data_ind_header_t *) new_sdu_p->data)->data_size);
#endif #endif
//((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 1; //pdcp_inst++; //((pdcp_data_ind_header_t*) new_sdu_p->data)->inst = 1; //pdcp_inst++;
LOG_D(PDCP, "sizeof (pdcp_data_ind_header_t): %d, payload_offset: %d \n \n \n", sizeof (pdcp_data_ind_header_t), payload_offset);
memcpy(&new_sdu_p->data[sizeof (pdcp_data_ind_header_t)], \ memcpy(&new_sdu_p->data[sizeof (pdcp_data_ind_header_t)], \
&sdu_buffer_pP->data[payload_offset], \ &sdu_buffer_pP->data[payload_offset], \
sdu_buffer_sizeP - payload_offset); sdu_buffer_sizeP - payload_offset); //payload_offset sizeof (pdcp_data_ind_header_t)
list_add_tail_eurecom (new_sdu_p, sdu_list_p); list_add_tail_eurecom (new_sdu_p, sdu_list_p);
} }
...@@ -862,7 +880,6 @@ pdcp_data_ind( ...@@ -862,7 +880,6 @@ pdcp_data_ind(
} }
free_mem_block(sdu_buffer_pP, __func__); free_mem_block(sdu_buffer_pP, __func__);
if (ctxt_pP->enb_flag) { if (ctxt_pP->enb_flag) {
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].data_ind); stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].data_ind);
} else { } else {
...@@ -1034,8 +1051,14 @@ pdcp_run ( ...@@ -1034,8 +1051,14 @@ pdcp_run (
start_meas(&UE_pdcp_stats[ctxt_pP->module_id].pdcp_ip); start_meas(&UE_pdcp_stats[ctxt_pP->module_id].pdcp_ip);
} }
//LOG_I(PDCP, "In pdcp_run() before calling pdcp_fifo_flush_sdus() 1 \n");
//list_display_memory_head_tail(&pdcp_sdu_list);
pdcp_fifo_flush_sdus(ctxt_pP); pdcp_fifo_flush_sdus(ctxt_pP);
//LOG_I(PDCP, "In pdcp_run() after calling pdcp_fifo_flush_sdus() 1 \n");
//list_display_memory_head_tail(&pdcp_sdu_list);
if (ctxt_pP->enb_flag) { if (ctxt_pP->enb_flag) {
stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].pdcp_ip); stop_meas(&eNB_pdcp_stats[ctxt_pP->module_id].pdcp_ip);
} else { } else {
......
...@@ -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;
...@@ -163,7 +163,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -163,7 +163,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
#endif #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_FLUSH, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_FLUSH, 1 );
while (sdu_p && cont && sdu_p!=0x01 && sdu_p!=0x02) { //&& sdu_p!=0x01 && sdu_p!=0x02 while (sdu_p && cont) { //&& sdu_p!=0x01 && sdu_p!=0x02 && sdu_p!=0x100000000 && sdu_p!=0x200000000
#ifdef DEBUG_PDCP_FIFO_FLUSH_SDU #ifdef DEBUG_PDCP_FIFO_FLUSH_SDU
LOG_D(PDCP, "[%s] SFN/SF=%d/%d inst=%d size=%d\n", LOG_D(PDCP, "[%s] SFN/SF=%d/%d inst=%d size=%d\n",
...@@ -216,7 +216,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -216,7 +216,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
#endif /* defined(ENABLE_USE_MME) */ #endif /* defined(ENABLE_USE_MME) */
#ifdef PDCP_DEBUG #ifdef PDCP_DEBUG
LOG_I(PDCP, "PDCP->IP TTI %d INST %d: Preparing %d Bytes of data from rab %d to Nas_mesh\n", LOG_D(PDCP, "PDCP->IP TTI %d INST %d: Preparing %d Bytes of data from rab %d to Nas_mesh\n",
ctxt_pP->frame, ((pdcp_data_ind_header_t *)(sdu_p->data))->inst, ctxt_pP->frame, ((pdcp_data_ind_header_t *)(sdu_p->data))->inst,
((pdcp_data_ind_header_t *)(sdu_p->data))->data_size, ((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id); ((pdcp_data_ind_header_t *)(sdu_p->data))->data_size, ((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id);
#endif //PDCP_DEBUG #endif //PDCP_DEBUG
...@@ -276,9 +276,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -276,9 +276,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
bytes_wrote = pdcp_output_header_bytes_to_write; bytes_wrote = pdcp_output_header_bytes_to_write;
#endif //PDCP_USE_RT_FIFO #endif //PDCP_USE_RT_FIFO
LOG_I(PDCP, "Frame %d Sent %d Bytes of header to Nas_mesh\n",
ctxt_pP->frame,
bytes_wrote);
#ifdef PDCP_DEBUG #ifdef PDCP_DEBUG
LOG_D(PDCP, "Frame %d Sent %d Bytes of header to Nas_mesh\n", LOG_D(PDCP, "Frame %d Sent %d Bytes of header to Nas_mesh\n",
ctxt_pP->frame, ctxt_pP->frame,
...@@ -354,7 +351,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -354,7 +351,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
if (!pdcp_output_sdu_bytes_to_write) { // OK finish with this SDU if (!pdcp_output_sdu_bytes_to_write) { // OK finish with this SDU
// LOG_D(PDCP, "rb sent a sdu qos_sap %d\n", sapiP); // LOG_D(PDCP, "rb sent a sdu qos_sap %d\n", sapiP);
LOG_I(PDCP, LOG_D(PDCP,
"[FRAME %05d][xxx][PDCP][MOD xx/xx][RB %u][--- PDCP_DATA_IND / %d Bytes --->][IP][INSTANCE %u][RB %u]\n", "[FRAME %05d][xxx][PDCP][MOD xx/xx][RB %u][--- PDCP_DATA_IND / %d Bytes --->][IP][INSTANCE %u][RB %u]\n",
ctxt_pP->frame, ctxt_pP->frame,
((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id, ((pdcp_data_ind_header_t *)(sdu_p->data))->rb_id,
...@@ -364,6 +361,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP) ...@@ -364,6 +361,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t* const ctxt_pP)
list_remove_head (&pdcp_sdu_list); list_remove_head (&pdcp_sdu_list);
free_mem_block (sdu_p, __func__); free_mem_block (sdu_p, __func__);
cont = 1; cont = 1;
pdcp_nb_sdu_sent += 1; pdcp_nb_sdu_sent += 1;
sdu_p = list_get_head (&pdcp_sdu_list); sdu_p = list_get_head (&pdcp_sdu_list);
...@@ -763,13 +761,13 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -763,13 +761,13 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
rab_id = pdcp_p->rb_id; rab_id = pdcp_p->rb_id;
#ifdef PDCP_DEBUG #ifdef PDCP_DEBUG
LOG_I(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d on Rab %d \n", LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d on Rab %d \n",
ctxt.frame, ctxt.frame,
pc5s_header->inst, pc5s_header->inst,
bytes_received, bytes_received,
pc5s_header->rb_id); pc5s_header->rb_id);
LOG_I(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n", LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n",
ctxt.frame, ctxt.frame,
pc5s_header->inst, pc5s_header->inst,
pc5s_header->rb_id, pc5s_header->rb_id,
...@@ -790,6 +788,9 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -790,6 +788,9 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
rab_id, rab_id,
pc5s_header->data_size); pc5s_header->data_size);
/*LOG_I(PDCP, "In pdcp_fifo_read_input_sdus() before calling pdcp_data_req() 1 \n");
list_display_memory_head_tail(&pdcp_sdu_list);*/
pdcp_data_req( pdcp_data_req(
&ctxt, &ctxt,
SRB_FLAG_NO, SRB_FLAG_NO,
...@@ -804,6 +805,9 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -804,6 +805,9 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
,&pc5s_header->destinationL2Id ,&pc5s_header->destinationL2Id
#endif #endif
); );
/*LOG_I(PDCP, "In pdcp_fifo_read_input_sdus() after calling pdcp_data_req 1() \n");
list_display_memory_head_tail(&pdcp_sdu_list);*/
} else { } else {
MSC_LOG_RX_DISCARDED_MESSAGE( MSC_LOG_RX_DISCARDED_MESSAGE(
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE, (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
...@@ -847,7 +851,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -847,7 +851,6 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
pc5s_header->rb_id, pc5s_header->rb_id,
DEFAULT_RAB_ID, DEFAULT_RAB_ID,
pc5s_header->data_size); pc5s_header->data_size);
pdcp_data_req ( pdcp_data_req (
&ctxt, &ctxt,
SRB_FLAG_NO, SRB_FLAG_NO,
...@@ -1076,7 +1079,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -1076,7 +1079,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
if (h_rc == HASH_TABLE_OK) { if (h_rc == HASH_TABLE_OK) {
rab_id = pdcp_p->rb_id; rab_id = pdcp_p->rb_id;
#ifdef PDCP_DEBUG #ifdef PDCP_DEBUG
LOG_I(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n", LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
ctxt.frame, ctxt.frame,
pdcp_read_header_g.inst, pdcp_read_header_g.inst,
len, len,
...@@ -1120,7 +1123,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -1120,7 +1123,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
); );
}else{ }else{
//TTN - for traffic from OIP1 (to eNB), sourceL2/DestL2 should be set to NULL //TTN - for traffic from OIP1 (to eNB), sourceL2/DestL2 should be set to NULL
LOG_I(PDCP, "[THINH] source L2 Id: 0x%08x, destL2 0x%08x \n",pdcp_read_header_g.sourceL2Id, pdcp_read_header_g.destinationL2Id); LOG_D(PDCP, "[THINH] source L2 Id: 0x%08x, destL2 0x%08x \n",pdcp_read_header_g.sourceL2Id, pdcp_read_header_g.destinationL2Id);
if (pdcp_read_header_g.inst == 0 ){ //INST == 0 (OIP0) if (pdcp_read_header_g.inst == 0 ){ //INST == 0 (OIP0)
pdcp_data_req(&ctxt, pdcp_data_req(&ctxt,
SRB_FLAG_NO, SRB_FLAG_NO,
...@@ -1213,7 +1216,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP) ...@@ -1213,7 +1216,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
}else{ }else{
//TTN - for traffic from OIP1 (to eNB), sourceL2/DestL2 should be set to NULL //TTN - for traffic from OIP1 (to eNB), sourceL2/DestL2 should be set to NULL
if (pdcp_read_header_g.inst == 0){ //INST == 0 (OIP0) if (pdcp_read_header_g.inst == 0){ //INST == 0 (OIP0)
LOG_I(PDCP, "[THINH] source L2 Id: 0x%08x, destL2 0x%08x \n",pdcp_read_header_g.sourceL2Id, pdcp_read_header_g.destinationL2Id); LOG_D(PDCP, "[THINH] source L2 Id: 0x%08x, destL2 0x%08x \n",pdcp_read_header_g.sourceL2Id, pdcp_read_header_g.destinationL2Id);
pdcp_data_req ( pdcp_data_req (
&ctxt, &ctxt,
SRB_FLAG_NO, SRB_FLAG_NO,
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "mac_primitives.h" #include "mac_primitives.h"
#include "LAYER2/MAC/mac_extern.h" #include "LAYER2/MAC/mac_extern.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
//#include "LAYER2/PDCP_v10.1.0/pdcp.h"
#include "rlc_um_very_simple_test.h" #include "rlc_um_very_simple_test.h"
......
...@@ -397,13 +397,13 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP, ...@@ -397,13 +397,13 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
key = RLC_COLL_KEY_MBMS_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_id_p->service_id, mbms_id_p->session_id); key = RLC_COLL_KEY_MBMS_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, mbms_id_p->service_id, mbms_id_p->session_id);
} }
if (sourceL2Id && destinationL2Id){ if (sourceL2Id && destinationL2Id){
LOG_I (RLC, "In sidelink case: RLC_COLL_KEY_VALUE: ctxt_pP->module_id: %d, ctxt_pP->rnti: %d, ctxt_pP->enb_flag: %d, rb_idP:%d, srb_flagP: %d \n \n", ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP); LOG_D (RLC, "In sidelink case: RLC_COLL_KEY_VALUE: ctxt_pP->module_id: %d, ctxt_pP->rnti: %d, ctxt_pP->enb_flag: %d, rb_idP:%d, srb_flagP: %d \n \n", ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
key = RLC_COLL_KEY_SOURCE_DEST_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, *sourceL2Id, *destinationL2Id, srb_flagP); key = RLC_COLL_KEY_SOURCE_DEST_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, *sourceL2Id, *destinationL2Id, srb_flagP);
} else } else
#endif #endif
{ {
LOG_I (RLC, "Not in sidelink case: RLC_COLL_KEY_VALUE: ctxt_pP->module_id: %d, ctxt_pP->rnti: %d, ctxt_pP->enb_flag: %d, rb_idP:%d, srb_flagP: %d \n \n", ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP); LOG_D (RLC, "Not in sidelink case: RLC_COLL_KEY_VALUE: ctxt_pP->module_id: %d, ctxt_pP->rnti: %d, ctxt_pP->enb_flag: %d, rb_idP:%d, srb_flagP: %d \n \n", ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP); key = RLC_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rnti, ctxt_pP->enb_flag, rb_idP, srb_flagP);
} }
......
...@@ -184,7 +184,7 @@ int oai_nw_drv_netlink_send(unsigned char *data,unsigned int len) ...@@ -184,7 +184,7 @@ int oai_nw_drv_netlink_send(unsigned char *data,unsigned int len)
// mutex_unlock(&nasmesh_mutex); // mutex_unlock(&nasmesh_mutex);
if (status < 0) { if (status < 0) {
printk("[OAI_IP_DRV][NETLINK] SEND status is %d\n",status); //printk("[OAI_IP_DRV][NETLINK] SEND status is %d\n",status);
return(0); return(0);
} else { } else {
#ifdef NETLINK_DEBUG #ifdef NETLINK_DEBUG
......
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
ntohs((addr)->s6_addr16[7]) ntohs((addr)->s6_addr16[7])
#define OAI_DRV_DEBUG_SEND //#define OAI_DRV_DEBUG_SEND
#define OAI_DRV_DEBUG_RECEIVE //#define OAI_DRV_DEBUG_RECEIVE
void void
ue_ip_common_class_wireless2ip( ue_ip_common_class_wireless2ip(
...@@ -286,7 +286,7 @@ ue_ip_common_ip2wireless( ...@@ -286,7 +286,7 @@ ue_ip_common_ip2wireless(
if (skb_pP->mark && instP == 0) { if (skb_pP->mark && instP == 0) {
pdcph.rb_id = skb_pP->mark; pdcph.rb_id = skb_pP->mark;
printk("[UE_IP_DRV_PROSE] skb_pP->mark %d, oip instance: %d\n",skb_pP->mark, instP); //printk("[UE_IP_DRV_PROSE] skb_pP->mark %d, oip instance: %d\n",skb_pP->mark, instP);
} else { } else {
pdcph.rb_id = UE_IP_DEFAULT_RAB_ID; pdcph.rb_id = UE_IP_DEFAULT_RAB_ID;
} }
...@@ -299,14 +299,16 @@ ue_ip_common_ip2wireless( ...@@ -299,14 +299,16 @@ ue_ip_common_ip2wireless(
switch (ipv_p->version) { switch (ipv_p->version) {
case 6: case 6:
#ifdef OAI_DRV_DEBUG_RECEIVE
printk("[UE_IP_DRV][%s] receive IPv6 message\n",__FUNCTION__); printk("[UE_IP_DRV][%s] receive IPv6 message\n",__FUNCTION__);
#endif
//TODO //TODO
break; break;
case 4: case 4:
src_addr = (unsigned char *)&((struct iphdr *)&skb_pP->data[hard_header_len])->saddr; src_addr = (unsigned char *)&((struct iphdr *)&skb_pP->data[hard_header_len])->saddr;
dst_addr = (unsigned char *)&((struct iphdr *)&skb_pP->data[hard_header_len])->daddr; dst_addr = (unsigned char *)&((struct iphdr *)&skb_pP->data[hard_header_len])->daddr;
#ifdef OAI_DRV_DEBUG_SEND
if (src_addr) { if (src_addr) {
printk("[UE_IP_DRV][%s] Source %d.%d.%d.%d\n",__FUNCTION__, src_addr[0],src_addr[1],src_addr[2],src_addr[3]); printk("[UE_IP_DRV][%s] Source %d.%d.%d.%d\n",__FUNCTION__, src_addr[0],src_addr[1],src_addr[2],src_addr[3]);
} }
...@@ -314,7 +316,7 @@ ue_ip_common_ip2wireless( ...@@ -314,7 +316,7 @@ ue_ip_common_ip2wireless(
printk("[UE_IP_DRV][%s] Dest %d.%d.%d.%d\n",__FUNCTION__, dst_addr[0],dst_addr[1],dst_addr[2],dst_addr[3]); printk("[UE_IP_DRV][%s] Dest %d.%d.%d.%d\n",__FUNCTION__, dst_addr[0],dst_addr[1],dst_addr[2],dst_addr[3]);
} }
printk("[UE_IP_DRV][%s] slrb_id %d\n",__FUNCTION__, pdcph.rb_id); printk("[UE_IP_DRV][%s] slrb_id %d\n",__FUNCTION__, pdcph.rb_id);
#endif
// modify inst by IP address for the U-Plane of multiple UEs while L2 fapi simulator start // modify inst by IP address for the U-Plane of multiple UEs while L2 fapi simulator start
#ifdef UESIM_EXPANSION #ifdef UESIM_EXPANSION
if ((src_addr[3] - 2)> instP) { if ((src_addr[3] - 2)> instP) {
...@@ -341,8 +343,10 @@ ue_ip_common_ip2wireless( ...@@ -341,8 +343,10 @@ ue_ip_common_ip2wireless(
//get Ipv4 address and pass to PCDP header //get Ipv4 address and pass to PCDP header
//pdcph.sourceL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->saddr) & 0x00FFFFFF; //pdcph.sourceL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->saddr) & 0x00FFFFFF;
//pdcph.destinationL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->daddr) & 0x00FFFFFF; //pdcph.destinationL2Id = ntohl( ((struct iphdr *)&skb_pP->data[hard_header_len])->daddr) & 0x00FFFFFF;
#ifdef OAI_DRV_DEBUG_SEND
printk("[UE_IP_DRV] source Id: 0x%08x\n",pdcph.sourceL2Id ); printk("[UE_IP_DRV] source Id: 0x%08x\n",pdcph.sourceL2Id );
printk("[UE_IP_DRV] destinationL2Id Id: 0x%08x\n",pdcph.destinationL2Id ); printk("[UE_IP_DRV] destinationL2Id Id: 0x%08x\n",pdcph.destinationL2Id );
#endif
break; break;
default: default:
...@@ -357,8 +361,10 @@ ue_ip_common_ip2wireless( ...@@ -357,8 +361,10 @@ ue_ip_common_ip2wireless(
#endif #endif
if (bytes_wrote != UE_IP_PDCPH_SIZE) { if (bytes_wrote != UE_IP_PDCPH_SIZE) {
#ifdef OAI_DRV_DEBUG_SEND
printk("[UE_IP_DRV][%s] problem while writing PDCP's header (bytes wrote = %d)\n",__FUNCTION__,bytes_wrote); printk("[UE_IP_DRV][%s] problem while writing PDCP's header (bytes wrote = %d)\n",__FUNCTION__,bytes_wrote);
printk("rb_id %d, Wrote %d, Header Size %d \n", pdcph.rb_id , bytes_wrote, UE_IP_PDCPH_SIZE); printk("rb_id %d, Wrote %d, Header Size %d \n", pdcph.rb_id , bytes_wrote, UE_IP_PDCPH_SIZE);
#endif
priv_p->stats.tx_dropped ++; priv_p->stats.tx_dropped ++;
return; return;
} }
...@@ -367,6 +373,7 @@ ue_ip_common_ip2wireless( ...@@ -367,6 +373,7 @@ ue_ip_common_ip2wireless(
if (bytes_wrote != skb_pP->len+UE_IP_PDCPH_SIZE) { if (bytes_wrote != skb_pP->len+UE_IP_PDCPH_SIZE) {
#ifdef OAI_DRV_DEBUG_SEND
printk("[UE_IP_DRV][%s] Inst %d, RB_ID %d: problem while writing PDCP's data, bytes_wrote = %d, Data_len %d, PDCPH_SIZE %d\n", printk("[UE_IP_DRV][%s] Inst %d, RB_ID %d: problem while writing PDCP's data, bytes_wrote = %d, Data_len %d, PDCPH_SIZE %d\n",
__FUNCTION__, __FUNCTION__,
instP, instP,
...@@ -374,6 +381,7 @@ ue_ip_common_ip2wireless( ...@@ -374,6 +381,7 @@ ue_ip_common_ip2wireless(
bytes_wrote, bytes_wrote,
skb_pP->len, skb_pP->len,
UE_IP_PDCPH_SIZE); // congestion UE_IP_PDCPH_SIZE); // congestion
#endif
priv_p->stats.tx_dropped ++; priv_p->stats.tx_dropped ++;
return; return;
......
...@@ -188,7 +188,9 @@ int ue_ip_netlink_send(unsigned char *data,unsigned int len) ...@@ -188,7 +188,9 @@ int ue_ip_netlink_send(unsigned char *data,unsigned int len)
// mutex_unlock(&nasmesh_mutex); // mutex_unlock(&nasmesh_mutex);
if (status < 0) { if (status < 0) {
#ifdef NETLINK_DEBUG
printk("[UE_IP_DRV][NETLINK] SEND status is %d\n",status); printk("[UE_IP_DRV][NETLINK] SEND status is %d\n",status);
#endif
return(0); return(0);
} else { } else {
#ifdef NETLINK_DEBUG #ifdef NETLINK_DEBUG
...@@ -197,7 +199,9 @@ int ue_ip_netlink_send(unsigned char *data,unsigned int len) ...@@ -197,7 +199,9 @@ int ue_ip_netlink_send(unsigned char *data,unsigned int len)
return len; return len;
} }
} else { } else {
#ifdef NETLINK_DEBUG
printk("[UE_IP_DRV][SEND] socket is NULL\n"); printk("[UE_IP_DRV][SEND] socket is NULL\n");
#endif
return(0); return(0);
} }
} }
...@@ -178,6 +178,14 @@ list_add_head (mem_block_t * elementP, list_t * listP) ...@@ -178,6 +178,14 @@ list_add_head (mem_block_t * elementP, list_t * listP)
} }
} }
void
list_display_memory_head_tail(list_t * listP){
/*printf("Displaying list's head address: %p \n", listP->head);
printf("Displaying list's tail address: %p \n \n", listP->tail);*/
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/* /*
* add an element to the end of a list * add an element to the end of a list
...@@ -194,12 +202,25 @@ list_add_tail_eurecom (mem_block_t * elementP, list_t * listP) ...@@ -194,12 +202,25 @@ list_add_tail_eurecom (mem_block_t * elementP, list_t * listP)
// access optimisation // access optimisation
listP->nb_elements = listP->nb_elements + 1; listP->nb_elements = listP->nb_elements + 1;
elementP->next = NULL; elementP->next = NULL;
//printf("In list_add_tail_eurecom 3\n");
//list_display_memory_head_tail(listP);
tail = listP->tail; tail = listP->tail;
//printf("In list_add_tail_eurecom 4\n");
//list_display_memory_head_tail(listP);
// almost one element // almost one element
if (tail == NULL || tail == 0x100000000) { //|| tail == 0x100000000 if (tail == NULL) { //|| tail == 0x100000000
//printf("In list_add_tail_eurecom 5\n");
//list_display_memory_head_tail(listP);
listP->head = elementP; listP->head = elementP;
} else { } else {
//printf("In list_add_tail_eurecom 6\n");
//list_display_memory_head_tail(listP);
tail->next = elementP; tail->next = elementP;
} }
......
...@@ -59,6 +59,7 @@ void list_add_head (mem_block_t* , list_t* ); ...@@ -59,6 +59,7 @@ void list_add_head (mem_block_t* , list_t* );
void list_add_tail_eurecom (mem_block_t* , list_t* ); void list_add_tail_eurecom (mem_block_t* , list_t* );
void list_add_list (list_t* , list_t* ); void list_add_list (list_t* , list_t* );
void list_display (list_t* ); void list_display (list_t* );
void list_display_memory_head_tail(list_t * listP);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void list2_init (list2_t*, char*); void list2_init (list2_t*, char*);
void list2_free (list2_t* ); void list2_free (list2_t* );
......
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