Commit 589ced9c authored by matzakos's avatar matzakos

Downlink IP traffic flow using LTE RAN stack over NR-PHY. Downlink traffic...

Downlink IP traffic flow using LTE RAN stack over NR-PHY. Downlink traffic reaching PHY of gNB now using the noS1 mode. Extensions required for the reception through the LTE RAN stack at the UE side.
parent 7e99e1f6
......@@ -142,6 +142,8 @@ void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
NR_gNB_DLSCH_t *dlsch = gNB->dlsch[0][0];
NR_DL_gNB_HARQ_t **harq = dlsch->harq_processes;
dlsch->harq_ids[subframe] = pdu_rel15->harq_pid; //New addition
uint16_t N_RB = params_rel15->n_RB_BWP;
uint8_t fsize=0, pos=0, cand_idx=0;
......
......@@ -53,6 +53,44 @@ void handle_nr_nfapi_bch_pdu(PHY_VARS_gNB *gNB,
// adjust transmit amplitude here based on NFAPI info
}
void handle_nr_nfapi_dlsch_pdu(PHY_VARS_gNB *gNB,int frame,int subframe,gNB_L1_rxtx_proc_t *proc,
uint8_t codeword_index,
uint8_t *sdu)
{
int UE_id = 0; //Hardcode UE_id for now
int harq_pid;
NR_gNB_DLSCH_t *dlsch0=NULL, *dlsch1=NULL;
NR_DL_gNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL;
// Based on nr_fill_dci_and_dlsch only gNB->dlsch[0][0] gets filled now. So maybe we do not need dlsch1.
dlsch0 = gNB->dlsch[UE_id][0];
dlsch1 = gNB->dlsch[UE_id][1];
harq_pid = dlsch0->harq_ids[subframe];
dlsch0_harq = dlsch0->harq_processes[harq_pid];
dlsch1_harq = dlsch1->harq_processes[harq_pid];
//if (dlsch0_harq->round==0) { //get pointer to SDU if this a new SDU
if(sdu == NULL) {
LOG_E(PHY,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0 \n",
frame,subframe,
proc->frame_tx,proc->slot_tx);
return;
}
//AssertFatal(sdu!=NULL,"NFAPI: SFN/SF:%04d%d proc:TX:[frame %d subframe %d]: programming dlsch for round 0, rnti %x, UE_id %d, harq_pid %d : sdu is null for pdu_index %d dlsch0_harq[round:%d SFN/SF:%d%d pdu:%p mcs:%d ndi:%d pdschstart:%d]\n",
// frame,subframe,
// proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid,
// dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index,dlsch0_harq->round,dlsch0_harq->frame,dlsch0_harq->subframe,dlsch0_harq->pdu,dlsch0_harq->mcs,dlsch0_harq->ndi,dlsch0_harq->pdsch_start);
if (codeword_index == 0) dlsch0_harq->pdu = sdu;
else dlsch1_harq->pdu = sdu;
LOG_I(PHY, "dlsch PDU filled \n");
// }
}
void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB,
int frame, int slot,
......@@ -129,7 +167,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
break;
case NFAPI_NR_DL_CONFIG_DCI_DL_PDU_TYPE:
dl_config_dlsch_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[++i];
dl_config_dlsch_pdu = &DL_req->dl_config_request_body.dl_config_pdu_list[i+1];
handle_nfapi_nr_dci_dl_pdu(gNB,
frame, slot,
proc,
......@@ -139,6 +177,17 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
gNB->pdcch_vars.num_pdsch_rnti++;
do_oai=1;
break;
case NFAPI_NR_DL_CONFIG_DLSCH_PDU_TYPE:
//gNB_MAC_INST *nr_mac = RC.nrmac[module_idP];
//TX_req = TX_req->tx_request_body.tx_pdu_list[TX_req->tx_request_body.number_of_pdus].segments[0].segment_data;
LOG_I(PHY, "Before calling handle_nr_nfapi_dlsch_pdu() \n \n \n \n");
handle_nr_nfapi_dlsch_pdu(gNB, frame,slot,proc,
0,
TX_req->tx_request_body.tx_pdu_list[TX_req->tx_request_body.number_of_pdus].segments[0].segment_data);
break;
}
}
......
......@@ -41,3 +41,6 @@ void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB,
gNB_L1_rxtx_proc_t *proc,
nfapi_nr_dl_config_request_pdu_t *dl_config_pdu,
nfapi_nr_dl_config_request_pdu_t *dl_config_dlsch_pdu);
void handle_nr_nfapi_dlsch_pdu(PHY_VARS_gNB *gNB,int frame,int subframe,gNB_L1_rxtx_proc_t *proc,
uint8_t codeword_index,
uint8_t *sdu);
......@@ -331,8 +331,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
coreset,
frameP,
slotP,
*cfg))
*cfg)){
LOG_I(MAC, "About to call nr_schedule_uss_dlsch_phytest() because there is a dci opportunity... \n \n \n");
nr_schedule_uss_dlsch_phytest(module_idP, frameP, slotP);
}
rnti = UE_RNTI(module_idP, i);
CC_id = UE_PCCID(module_idP, i);
......@@ -439,8 +441,10 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
/*if (slotP==2)
nr_schedule_css_dlsch_phytest(module_idP, frameP, slotP);*/
if (slotP==1)
if (slotP==1){
LOG_I(MAC, "About to call nr_schedule_uss_dlsch_phytest() because we are on slotP=1... \n \n \n");
nr_schedule_uss_dlsch_phytest(module_idP, frameP, slotP);
}
/*
// Allocate CCEs for good after scheduling is done
......
......@@ -181,12 +181,13 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
}
}
/*Scheduling of DLSCH with associated DCI in user specific search space
* current version has only a DCI for type 1 PDCCH for C_RNTI*/
void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
frame_t frameP,
sub_frame_t slotP)
{
LOG_I(MAC, "In nr_schedule_uss_dlsch_phytest \n");
uint8_t CC_id;
gNB_MAC_INST *nr_mac = RC.nrmac[module_idP];
......@@ -205,12 +206,81 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
// everything here is hard-coded to 30 kHz
//int scs = get_dlscs(cfg);
//int slots_per_frame = get_spf(cfg);
//Connection with the LTE protocol stack
/* int ta_len = 0;
unsigned char sdu_lcids[NB_RB_MAX];
int lcid, offset, num_sdus = 0;
int nb_rb, nb_rb_temp, nb_available_rb;
uint16_t sdu_lengths[NB_RB_MAX];
int TBS, j, rnti, padding = 0, post_padding = 0;
unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES];
int sdu_length_total = 0;
*/
int TBS;
int lcid;
int ta_len = 0;
UE_sched_ctrl *ue_sched_ctl;
int header_length_total=0;
int header_length_last;
int sdu_length_total = 0;
mac_rlc_status_resp_t rlc_status;
uint16_t sdu_lengths[NB_RB_MAX];
int num_sdus = 0;
unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES];
int offset;
int UE_id;
unsigned char sdu_lcids[NB_RB_MAX];
int padding = 0, post_padding = 0;
UE_list_t *UE_list = &nr_mac->UE_list;
DLSCH_PDU DLSCH_pdu;
//DLSCH_PDU *DLSCH_pdu = (DLSCH_PDU*) malloc(sizeof(DLSCH_PDU));
memset(&DLSCH_pdu, 0, sizeof(DLSCH_pdu));
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
LOG_I(MAC, "Scheduling UE specific search space DCI type 1 for CC_id %d\n",CC_id);
nfapi_nr_coreset_t* coreset = &nr_mac->coreset[CC_id][1];
nfapi_nr_search_space_t* search_space = &nr_mac->search_space[CC_id][1];
//for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id]) {
LOG_I(MAC, "UE list loop \n");
//Not sure if TA update procedures are required at this point. Maybe we can skip
//lines 326-337
/*ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
int ta_update;
if (ue_sched_ctl->ta_timer == 0) {
ta_update = ue_sched_ctl->ta_update;
// if we send TA then set timer to not send it for a while
if (ta_update != 31)
ue_sched_ctl->ta_timer = 20;
// reset ta_update
ue_sched_ctl->ta_update = 31;
} else {
ta_update = 31;
}
ta_len = (ta_update != 31) ? 2 : 0;*/
int ta_update = 31;
ta_len = 0;
/*dl_req = &nr_mac->DL_req[CC_id].dl_config_request_body;
dl_config_dlsch_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu+1];
dl_config_dci_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
nr_get_tbs(&dl_config_dlsch_pdu->dlsch_pdu, dl_config_dci_pdu->dci_dl_pdu, *cfg);
TBS = dl_config_dlsch_pdu->dlsch_pdu.dlsch_pdu_rel15.transport_block_size;*/
dl_req = &nr_mac->DL_req[CC_id].dl_config_request_body;
dl_config_dci_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
memset((void*)dl_config_dci_pdu,0,sizeof(nfapi_nr_dl_config_request_pdu_t));
......@@ -287,6 +357,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
params_rel15->first_symbol,
params_rel15->search_space_type);
nr_get_tbs(&dl_config_dlsch_pdu->dlsch_pdu, dl_config_dci_pdu->dci_dl_pdu, *cfg);
TBS = dl_config_dlsch_pdu->dlsch_pdu.dlsch_pdu_rel15.transport_block_size;
LOG_I(MAC, "DLSCH PDU: start PRB %d n_PRB %d start symbol %d nb_symbols %d nb_layers %d nb_codewords %d mcs %d\n",
dlsch_pdu_rel15->start_prb,
dlsch_pdu_rel15->n_prb,
......@@ -300,6 +371,123 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
dl_req->number_pdsch_rnti++;
dl_req->number_pdu+=2;
for (lcid = NB_RB_MAX - 1; lcid >= DTCH; lcid--) {
// TODO: check if the lcid is active
LOG_I(MAC, "[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
module_idP, frameP, lcid, TBS,
TBS - ta_len - header_length_total - sdu_length_total - 3);
if (TBS - ta_len - header_length_total - sdu_length_total - 3 > 0) {
rlc_status = mac_rlc_status_ind(module_idP,
rnti,
module_idP,
frameP,
slotP,
ENB_FLAG_YES,
MBMS_FLAG_NO,
lcid,
TBS - ta_len - header_length_total - sdu_length_total - 3
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0, 0
#endif
);
if (rlc_status.bytes_in_buffer > 0) {
LOG_I(MAC,
"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n \n",
module_idP, frameP,
TBS - ta_len - header_length_total - sdu_length_total - 3,
lcid,
header_length_total);
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP, rnti, module_idP, frameP, ENB_FLAG_YES, MBMS_FLAG_NO, lcid,
TBS, //not used
(char *)&dlsch_buffer[sdu_length_total]
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0, 0
#endif
);
/* T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP),
T_INT(CC_id), T_INT(rnti), T_INT(frameP),
T_INT(subframeP), T_INT(harq_pid),
T_INT(lcid), T_INT(sdu_lengths[num_sdus]));*/
LOG_D(MAC,
"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",
module_idP, sdu_lengths[num_sdus], lcid);
sdu_lcids[num_sdus] = lcid;
sdu_length_total += sdu_lengths[num_sdus];
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]++;
UE_list->eNB_UE_stats[CC_id][UE_id].lcid_sdu[num_sdus] = lcid;
UE_list->eNB_UE_stats[CC_id][UE_id].sdu_length_tx[lcid] = sdu_lengths[num_sdus];
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[num_sdus];
header_length_last = 1 + 1 + (sdu_lengths[num_sdus] >= 128);
header_length_total += header_length_last;
num_sdus++;
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
}
} else {
// no TBS left
break;
}
}
/* last header does not have length field */
if (header_length_total) {
header_length_total -= header_length_last;
header_length_total++;
}
if (ta_len + sdu_length_total + header_length_total > 0) {
if (TBS - header_length_total - sdu_length_total - ta_len <= 2) {
padding = TBS - header_length_total - sdu_length_total - ta_len;
post_padding = 0;
} else {
padding = 0;
post_padding = 1;
}
// Since we do not have an active UE_list for now we replace with a single DLSCH_pdu
/*offset = generate_dlsch_header((unsigned char *) UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0],
num_sdus, //num_sdus
sdu_lengths, //
sdu_lcids, 255, // no drx
ta_update, // timing advance
NULL, // contention res id
padding, post_padding);*/
offset = generate_dlsch_header((unsigned char *) DLSCH_pdu.payload[0],
num_sdus, //num_sdus
sdu_lengths, //
sdu_lcids, 255, // no drx
ta_update, // timing advance
NULL, // contention res id
padding, post_padding);
// Probably there should be other actions done before that
// cycle through SDUs and place in dlsch_buffer
// Since we do not have an active UE_list for now we replace with a single DLSCH_pdu
//memcpy(&UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset], dlsch_buffer, sdu_length_total);
memcpy(&DLSCH_pdu.payload[0][offset], dlsch_buffer, sdu_length_total);
// fill remainder of DLSCH with 0
for (int j = 0; j < (TBS - sdu_length_total - offset); j++) {
// Since we do not have an active UE_list for now we replace with a single DLSCH_pdu
//UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset + sdu_length_total + j] = 0;
DLSCH_pdu.payload[0][offset + sdu_length_total + j] = 0;
}
TX_req = &nr_mac->TX_req[CC_id].tx_request_body.tx_pdu_list[nr_mac->TX_req[CC_id].tx_request_body.number_of_pdus];
TX_req->pdu_length = 6;
TX_req->pdu_index = nr_mac->pdu_index[CC_id]++;
......@@ -315,10 +503,19 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
TX_req->pdu_index = nr_mac->pdu_index[CC_id]++;
TX_req->num_segments = 1;
TX_req->segments[0].segment_length = 8;
// Since we do not have an active UE_list for now we replace with a single DLSCH_pdu
//TX_req->segments[0].segment_data = nr_mac->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0];
TX_req->segments[0].segment_data = DLSCH_pdu.payload[0];
nr_mac->TX_req[CC_id].tx_request_body.number_of_pdus++;
nr_mac->TX_req[CC_id].sfn_sf = sfn_sf;
nr_mac->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
nr_mac->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
}
} //if (ta_len + sdu_length_total + header_length_total > 0)
//} //for (UE_id = UE_list->head; UE_id >= 0; UE_id = UE_list->next[UE_id])
} //for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
}
......@@ -152,6 +152,11 @@ void mac_top_init_gNB(void)
UE_list->next[list_el] = -1;
UE_list->next_ul[list_el] = -1;
/*memset(UE_list->DLSCH_pdu, 0, sizeof(UE_list->DLSCH_pdu));
memset(UE_list->UE_template, 0, sizeof(UE_list->UE_template));
memset(UE_list->eNB_UE_stats, 0, sizeof(UE_list->eNB_UE_stats));
memset(UE_list->UE_sched_ctrl, 0, sizeof(UE_list->UE_sched_ctrl));
memset(UE_list->active, 0, sizeof(UE_list->active));*/
}
}
......@@ -126,6 +126,7 @@ boolean_t pdcp_data_req(
T(T_ENB_PDCP_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP));
#endif
LOG_I(PDCP, "In pdcp_data_req \n \n");
if (sdu_buffer_sizeP == 0) {
LOG_W(PDCP, "Handed SDU is of size 0! Ignoring...\n");
return FALSE;
......@@ -2091,6 +2092,110 @@ void pdcp_layer_init(void)
memset(Pdcp_stats_rx_iat, 0, sizeof(Pdcp_stats_rx_iat));
memset(Pdcp_stats_rx_outoforder, 0, sizeof(Pdcp_stats_rx_outoforder));
// Addition for the use-case of 4G stack on top of 5G-NR.
// We need to configure pdcp and rlc instances without having an actual
// UE RRC Connection. Just to be able to test the NR PHY with some injected
// on top of the LTE stack.
protocol_ctxt_t ctxt;
DRB_ToAddModList_t* DRB_configList=NULL;
DRB_configList = CALLOC(1, sizeof(DRB_ToAddModList_t));
struct LogicalChannelConfig *DRB_lchan_config = NULL;
struct RLC_Config *DRB_rlc_config = NULL;
struct PDCP_Config *DRB_pdcp_config = NULL;
struct PDCP_Config__rlc_UM *PDCP_rlc_UM = NULL;
struct DRB_ToAddMod *DRB_config = NULL;
struct LogicalChannelConfig__ul_SpecificParameters *DRB_ul_SpecificParameters = NULL;
long *logicalchannelgroup_drb;
//Static preconfiguration of DRB
DRB_config = CALLOC(1, sizeof(*DRB_config));
DRB_config->eps_BearerIdentity = CALLOC(1, sizeof(long));
// allowed value 5..15, value : x+4
*(DRB_config->eps_BearerIdentity) = 1; //ue_context_pP->ue_context.e_rab[i].param.e_rab_id;//+ 4; // especial case generation
// DRB_config->drb_Identity = 1 + drb_identity_index + e_rab_done;// + i ;// (DRB_Identity_t) ue_context_pP->ue_context.e_rab[i].param.e_rab_id;
// 1 + drb_identiy_index;
DRB_config->drb_Identity = 1;
DRB_config->logicalChannelIdentity = CALLOC(1, sizeof(long));
*(DRB_config->logicalChannelIdentity) = DRB_config->drb_Identity + 2; //(long) (ue_context_pP->ue_context.e_rab[i].param.e_rab_id + 2); // value : x+2
DRB_rlc_config = CALLOC(1, sizeof(*DRB_rlc_config));
DRB_config->rlc_Config = DRB_rlc_config;
DRB_pdcp_config = CALLOC(1, sizeof(*DRB_pdcp_config));
DRB_config->pdcp_Config = DRB_pdcp_config;
DRB_pdcp_config->discardTimer = CALLOC(1, sizeof(long));
*DRB_pdcp_config->discardTimer = PDCP_Config__discardTimer_infinity;
DRB_pdcp_config->rlc_AM = NULL;
DRB_pdcp_config->rlc_UM = NULL;
DRB_rlc_config->present = RLC_Config_PR_um_Bi_Directional;
DRB_rlc_config->choice.um_Bi_Directional.ul_UM_RLC.sn_FieldLength = SN_FieldLength_size10;
DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.sn_FieldLength = SN_FieldLength_size10;
DRB_rlc_config->choice.um_Bi_Directional.dl_UM_RLC.t_Reordering = T_Reordering_ms35;
// PDCP
PDCP_rlc_UM = CALLOC(1, sizeof(*PDCP_rlc_UM));
DRB_pdcp_config->rlc_UM = PDCP_rlc_UM;
PDCP_rlc_UM->pdcp_SN_Size = PDCP_Config__rlc_UM__pdcp_SN_Size_len12bits;
DRB_pdcp_config->headerCompression.present = PDCP_Config__headerCompression_PR_notUsed;
DRB_lchan_config = CALLOC(1, sizeof(*DRB_lchan_config));
DRB_config->logicalChannelConfig = DRB_lchan_config;
DRB_ul_SpecificParameters = CALLOC(1, sizeof(*DRB_ul_SpecificParameters));
DRB_lchan_config->ul_SpecificParameters = DRB_ul_SpecificParameters;
DRB_ul_SpecificParameters->priority= 4;
DRB_ul_SpecificParameters->prioritisedBitRate = LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_kBps8;
//LogicalChannelConfig__ul_SpecificParameters__prioritisedBitRate_infinity;
DRB_ul_SpecificParameters->bucketSizeDuration =
LogicalChannelConfig__ul_SpecificParameters__bucketSizeDuration_ms50;
logicalchannelgroup_drb = CALLOC(1, sizeof(long));
*logicalchannelgroup_drb = 1;//(i+1) % 3;
DRB_ul_SpecificParameters->logicalChannelGroup = logicalchannelgroup_drb;
// Have to dins out how to fill the DRB_config and then feed it back to the list
/*
if (DRB_configList != NULL) {
LOG_D(RRC, "get DRB_config from (ue_context_pP->ue_context.DRB_configList)\n");
for (i = 0; (i < DRB_configList->list.count) && (i < 3); i++) {
DRB_config = DRB_configList->list.array[i];
// Add DRB to DRB configuration list, for RRCConnectionReconfigurationComplete
ASN_SEQUENCE_ADD(&(*DRB_configList2)->list, DRB_config);
}
}
*/
ASN_SEQUENCE_ADD(&DRB_configList->list,DRB_config);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_YES, 0x1234, 0, 0,0);
rrc_pdcp_config_asn1_req(&ctxt,
(SRB_ToAddModList_t *) NULL,
DRB_configList,
(DRB_ToReleaseList_t*) NULL,
0xff, NULL, NULL, NULL
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
, (PMCH_InfoList_r9_t *) NULL
#endif
,NULL);
rrc_rlc_config_asn1_req(&ctxt,
(SRB_ToAddModList_t*)NULL,
DRB_configList,
(DRB_ToReleaseList_t*)NULL
#if (RRC_VERSION >= MAKE_VERSION(10, 0, 0))
,(PMCH_InfoList_r9_t *)NULL
, 0, 0
#endif
);
}
//-----------------------------------------------------------------------------
......
......@@ -516,7 +516,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
h_rc = hashtable_get(pdcp_coll_p, key, (void**)&pdcp_p);
if (h_rc != HASH_TABLE_OK) {
LOG_W(PDCP, PROTOCOL_CTXT_FMT" Dropped IP PACKET cause no PDCP instanciated\n",
LOG_I(PDCP, PROTOCOL_CTXT_FMT" Dropped IP PACKET cause no PDCP instanciated\n",
PROTOCOL_CTXT_ARGS(ctxt_pP));
free(data_p->data);
free(data_p);
......@@ -529,7 +529,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
AssertFatal (rab_id < maxDRB, "RB id is too high (%u/%d)!\n", rab_id, maxDRB);
if (rab_id != 0) {
LOG_D(PDCP, "[FRAME %05d][%s][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ "
LOG_I(PDCP, "[FRAME %05d][%s][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ "
"/ %d Bytes --->][PDCP][MOD %u][RB %u]\n",
ctxt_cpy.frame,
(ctxt_cpy.enb_flag) ? "eNB" : "UE",
......@@ -625,6 +625,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
return 0;
# else /* PDCP_USE_NETLINK_QUEUES*/
//LOG_I(PDCP, "Not using PDCP_USE_NETLINK_QUEUES ! \n \n \n");
int len = 1;
int msg_len;
rb_id_t rab_id = 0;
......@@ -791,7 +792,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
pc5s_header->rb_id,
rab_id,
pc5s_header->data_size);
LOG_D(PDCP,
LOG_I(PDCP,
"[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
ctxt.frame,
pc5s_header->inst,
......@@ -849,37 +850,55 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
while ((len > 0) && (rlc_data_req_flag !=0)) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ, 1 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 1 );
len = recvmsg(nas_sock_fd, &nas_msg_rx, 0);
//len = read(nas_sock_fd, &nl_rx_buf, NL_MAX_PAYLOAD);
len = recvmsg(nas_sock_fd, &nas_msg_rx, 0); //Initial
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_FIFO_READ_BUFFER, 0 );
if (len<=0) {
// nothing in pdcp NAS socket
//LOG_D(PDCP, "[PDCP][NETLINK] Nothing in socket, length %d \n", len);
LOG_I(PDCP, "[PDCP][NETLINK] Nothing in socket, length %d \n", len);
} else {
LOG_I(PDCP, "Something in queue ! \n \n \n");
msg_len = len;
for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf;
for (nas_nlh_rx = (struct nlmsghdr *) nl_rx_buf; //nas_msg_rx;
NLMSG_OK (nas_nlh_rx, msg_len);
nas_nlh_rx = NLMSG_NEXT (nas_nlh_rx, msg_len)) {
if (nas_nlh_rx->nlmsg_type == NLMSG_DONE) {
LOG_D(PDCP, "[PDCP][NETLINK] RX NLMSG_DONE\n");
LOG_I(PDCP, "[PDCP][NETLINK] RX NLMSG_DONE\n");
//return;
}
if (nas_nlh_rx->nlmsg_type == NLMSG_ERROR) {
LOG_D(PDCP, "[PDCP][NETLINK] RX NLMSG_ERROR\n");
else if (nas_nlh_rx->nlmsg_type == NLMSG_ERROR) {
LOG_I(PDCP, "[PDCP][NETLINK] RX NLMSG_ERROR\n");
}
else if (nas_nlh_rx->nlmsg_type == NLMSG_NOOP) {
LOG_I(PDCP, "[PDCP][NETLINK] RX NLMSG_NOOP\n");
}
else if (nas_nlh_rx->nlmsg_type == NLMSG_OVERRUN) {
LOG_I(PDCP, "[PDCP][NETLINK] RX NLMSG_OVERRUN\n");
}
else if (nas_nlh_rx->nlmsg_type == NLMSG_MIN_TYPE) {
LOG_I(PDCP, "[PDCP][NETLINK] RX NLMSG_OVERRUN\n");
}
else{
LOG_I (PDCP, "[PDCP][NETLINK] No valid type received %hu \n", nas_nlh_rx->nlmsg_type);
}
if (pdcp_read_state_g == 0) {
if (nas_nlh_rx->nlmsg_len == sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)) {
pdcp_read_state_g = 1; //get
memcpy((void *)&pdcp_read_header_g, (void *)NLMSG_DATA(nas_nlh_rx), sizeof(pdcp_data_req_header_t));
LOG_D(PDCP, "[PDCP][NETLINK] RX pdcp_data_req_header_t inst %u, rb_id %u data_size %d, source L2Id 0x%08x, destination L2Id 0x%08x\n",
LOG_I(PDCP, "[PDCP][NETLINK] RX pdcp_data_req_header_t inst %u, rb_id %u data_size %d, source L2Id 0x%08x, destination L2Id 0x%08x\n",
pdcp_read_header_g.inst, pdcp_read_header_g.rb_id, pdcp_read_header_g.data_size,pdcp_read_header_g.sourceL2Id, pdcp_read_header_g.destinationL2Id );
} else {
LOG_E(PDCP, "[PDCP][NETLINK] WRONG size %d should be sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr)\n",
nas_nlh_rx->nlmsg_len);
LOG_E(PDCP, "[PDCP][NETLINK] WRONG size %d should be sizeof (pdcp_data_req_header_t): %d + sizeof(struct nlmsghdr):%d, sum: %d \n",
nas_nlh_rx->nlmsg_len, sizeof (pdcp_data_req_header_t), sizeof(struct nlmsghdr), sizeof (pdcp_data_req_header_t) + sizeof(struct nlmsghdr));
}
} else {
pdcp_read_state_g = 0;
......@@ -943,12 +962,13 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
if (h_rc == HASH_TABLE_OK) {
#ifdef PDCP_DEBUG
LOG_D(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
LOG_I(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d for rnti: %d \n",
ctxt.frame,
pdcp_read_header_g.inst,
len,
nas_nlh_rx->nlmsg_len-sizeof(struct nlmsghdr),
pdcp_read_header_g.rb_id);
pdcp_read_header_g.rb_id,
ctxt.rnti);
#endif
MSC_LOG_RX_MESSAGE(
......@@ -962,7 +982,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
pdcp_read_header_g.rb_id,
rab_id,
pdcp_read_header_g.data_size);
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u]UE %u][RB %u]\n",
LOG_I(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u]UE %u][RB %u]\n",
ctxt_cpy.frame,
pdcp_read_header_g.inst,
pdcp_read_header_g.rb_id,
......@@ -984,7 +1004,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
#endif
);
} else {
LOG_D(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE, DROPPED\n",
LOG_I(PDCP, "[FRAME %5u][eNB][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE, DROPPED\n",
ctxt.frame,
pdcp_read_header_g.inst,
pdcp_read_header_g.rb_id,
......@@ -1045,14 +1065,14 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
if (h_rc == HASH_TABLE_OK) {
rab_id = pdcp_p->rb_id;
#ifdef PDCP_DEBUG
LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
LOG_I(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
ctxt.frame,
pdcp_read_header_g.inst,
len,
nas_nlh_rx->nlmsg_len-sizeof(struct nlmsghdr),
pdcp_read_header_g.rb_id);
LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n",
LOG_I(PDCP, "[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %u][RB %u]\n",
ctxt.frame,
pdcp_read_header_g.inst,
pdcp_read_header_g.rb_id,
......@@ -1099,7 +1119,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
pdcp_read_header_g.rb_id,
rab_id,
pdcp_read_header_g.data_size);
LOG_D(PDCP,
LOG_I(PDCP,
"[FRAME %5u][UE][IP][INSTANCE %u][RB %u][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %u] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
ctxt.frame,
pdcp_read_header_g.inst,
......
......@@ -634,7 +634,7 @@ void nas_CLASS_send(struct sk_buff *skb,int inst)
printk("[NAS][CLASS][SEND] Got packet from kernel:\n");
for (i=0; i<256; i++)
for (int i=0; i<256; i++)
printk("%2x ",((unsigned char *)skb->data)[i]);
printk("\n");
......@@ -790,6 +790,7 @@ void nas_CLASS_send(struct sk_buff *skb,int inst)
dscp, sprotocol, sp->classref, sfct, sp->rab_id);
#endif
//printk(" About to trigger a new message sending through nas_CLASS_send \n \n");
sp->fct(skb, cx, sp,inst, NULL);
} // if classifier entry match found
......
......@@ -387,6 +387,11 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class
pdcph.data_size = skb->len;
pdcph.rb_id = (gc->rb)->rab_id;
pdcph.inst = inst;
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
pdcph.sourceL2Id = 0;
pdcph.destinationL2Id = 0;
#endif
#ifdef PDCP_USE_NETLINK
......
......@@ -160,6 +160,10 @@ typedef struct pdcp_data_req_header_s {
sdu_size_t data_size;
signed int inst;
ip_traffic_type_t traffic_type;
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
uint32_t sourceL2Id;
uint32_t destinationL2Id;
#endif
} pdcp_data_req_header_t;
typedef struct pdcp_data_ind_header_s {
......
......@@ -161,7 +161,7 @@ int nas_netlink_send(unsigned char *data,unsigned int len)
int status;
// printk("[NAS][NETLINK] Sending %d bytes (%d)\n",len,NLMSG_SPACE(len));
//printk("[NAS][NETLINK] Sending %d bytes (%d)\n",len,NLMSG_SPACE(len));
skb_put(nl_skb, NLMSG_SPACE(len));
memcpy(NLMSG_DATA(nlh),data,len);
......
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