Code clean up part one.

This commit includes about 1/3 of the code clean up
in preparation for the merge to the OAI develop
branch. Several of the changes are white space changes,
removing of logs, comment removals, and updating any
changed code for our use-case to be clear for NSA mode.
This commit is contained in:
Melissa Elkadi
2021-09-23 12:53:38 -07:00
parent 30065ef014
commit 82ba5a3531
30 changed files with 102 additions and 203 deletions
+1 -1
View File
@@ -220,7 +220,7 @@ typedef struct kenb_refresh_req_s {
} kenb_refresh_req_t;
typedef struct nsa_oai_tun_nsa_s {
uint8_t buffer[500]; //Melissa TODO
uint8_t buffer[500];
} nas_oai_tun_nsa_t;
/*
+2 -2
View File
@@ -206,8 +206,8 @@ void *gNB_app_task(void *args_p)
configure_nr_rrc(gnb_id);
}
if (RC.nb_nr_inst > 0) {
//init_pdcp();
if (RC.nb_nr_inst > 0 && !get_softmodem_params()->nsa) {
init_pdcp();
}
if (is_x2ap_enabled() ) { //&& !NODE_IS_DU(RC.rrc[0]->node_type)
+4 -11
View File
@@ -421,7 +421,6 @@ uint16_t set_ra_rnti(NR_UE_MAC_INST_t *mac, fapi_nr_ul_config_prach_pdu *prach_p
uint8_t s_id = prach_pdu->prach_start_symbol;
ra->ra_rnti = 1 + s_id + 14 * t_id + 1120 * f_id + 8960 * ul_carrier_id;
//gNB: ra_rnti = 1 + symbol + (slotP * 14) + (freq_index * 14 * 80) + (ul_carrier_id * 14 * 80 * 8);
LOG_D(MAC, "Computed ra_RNTI is %x \n", ra->ra_rnti);
@@ -543,7 +542,6 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
RA_config_t *ra = &mac->ra;
uint8_t mac_sdus[MAX_NR_ULSCH_PAYLOAD_BYTES];
uint8_t lcid = UL_SCH_LCID_CCCH;
uint8_t *payload;
uint16_t size_sdu = 0;
unsigned short post_padding;
@@ -554,9 +552,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric;
NR_RACH_ConfigDedicated_t *rach_ConfigDedicated = ra->rach_ConfigDedicated;
uint8_t sdu_lcids[NB_RB_MAX] = {0};
uint16_t sdu_lengths[NB_RB_MAX] = {0};
int num_sdus = 0;
int offset = 0;
int TBS_bytes = 848;
int header_length_total=0;
@@ -564,8 +560,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
// Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side
if (!prach_resources->init_msg1) {
if ( (mac->common_configuration_complete>0 || get_softmodem_params()->do_ra==1 || get_softmodem_params()->nsa) &&
((MAX_FRAME_NUMBER + frame - prach_resources->sync_frame) % MAX_FRAME_NUMBER) > 150){
if ((mac->common_configuration_complete > 0 || get_softmodem_params()->do_ra || get_softmodem_params()->nsa) &&
((MAX_FRAME_NUMBER + frame - prach_resources->sync_frame) % MAX_FRAME_NUMBER) > 150) {
prach_resources->init_msg1 = 1;
} else {
LOG_D(NR_MAC,"PRACH Condition not met: frame %d, prach_resources->sync_frame %d\n",frame,prach_resources->sync_frame);
@@ -574,7 +570,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
}
LOG_D(NR_MAC,"frame %d prach_resources->init_msg1 %d, ra->ra_state %d, ra->RA_active %d\n",
frame,prach_resources->init_msg1,ra->ra_state,ra->RA_active);
frame, prach_resources->init_msg1, ra->ra_state, ra->RA_active);
if (prach_resources->init_msg1 && ra->ra_state != RA_SUCCEEDED) {
@@ -586,9 +582,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
int TBS_max = 848; //8 + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT);
payload = (uint8_t*) mac->CCCH_pdu.payload;
mac_ce_len = 0;
num_sdus = 1;
post_padding = 1;
sdu_lcids[0] = lcid;
// initialisation by RRC
@@ -605,8 +599,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
mac_sdus[i] = (unsigned char) (lrand48()&0xff);
}
//Sending SDUs with size 1
//Initialize elements of sdu_lcids and sdu_lengths
sdu_lcids[0] = lcid;
//Initialize elements of sdu_lengths
sdu_lengths[0] = TBS_bytes - 3 - post_padding - mac_ce_len;
header_length_total += 2 + (sdu_lengths[0] >= 128);
size_sdu += sdu_lengths[0];
+1 -1
View File
@@ -539,7 +539,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
else if (mac->scc_SIB) n_RB_DLBWP = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
else n_RB_DLBWP = mac->type0_PDCCH_CSS_config.num_rbs;
LOG_I(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP);
LOG_D(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP);
switch(dci_format){
case NR_UL_DCI_FORMAT_0_0: {
+1 -1
View File
@@ -1893,7 +1893,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
prach_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu;
memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu));
ul_config->number_pdus += 1; //Melissa Elkadi come back here!
ul_config->number_pdus += 1;
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PRACH);
LOG_D(PHY, "In %s: (%p) %d UL PDUs:\n", __FUNCTION__, ul_config, ul_config->number_pdus);
@@ -356,7 +356,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
const int bwp_id = 1;
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
NR_COMMON_channels_t *cc = gNB->common_channels;
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
@@ -288,6 +288,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
}else if (N_RA_slot <= 1) { //1 PRACH slot in a subframe
slot_index = 0;
}
UL_tti_req->SFN = frameP;
UL_tti_req->Slot = slotP;
for (int fdm_index=0; fdm_index < fdm; fdm_index++) { // one structure per frequency domain occasion
@@ -135,7 +135,6 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
}
}
// Compute and write all MAC CEs and subheaders, and return number of written
// bytes
int nr_write_ce_dlsch_pdu(module_id_t module_idP,
@@ -883,7 +882,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
const int coresetid = bwp ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId;
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid];
if (!pdcch_pdu) {
LOG_I(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n");
LOG_D(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n");
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t));
dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE;
@@ -1086,8 +1086,8 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
DevAssert(harq->is_waiting);
const int8_t pid = sched_ctrl->feedback_dl_harq.head;
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
/* Melissa: according to nfapi_nr_interface_scf.h, harq_value = 0 is a pass
(check below was for harq_value == 1 in develop branch) */
/* According to nfapi_nr_interface_scf.h, harq_value = 0 is a pass
(The check below was for harq_value == 1 in the develop branch) */
handle_dl_harq(mod_id, UE_id, pid, harq_value == 0 && harq_confidence == 0);
}
}
@@ -1273,7 +1273,6 @@ int nr_acknack_scheduling(int mod_id,
* scheduled a lot and used all AckNacks, pucch->frame might have been
* wrapped around to next frame */
if (frame != pucch->frame || pucch->ul_slot < first_ul_slot_tdd) {
AssertFatal(pucch->sr_flag + pucch->dai_c == 0,
"expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n",
UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot);
@@ -1458,6 +1458,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
sched_ctrl->sched_ul_bytes,
sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes);
/* PUSCH in a later slot, but corresponding DCI now! */
nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_id]->UL_tti_req_ahead[0][sched_pusch->slot];
AssertFatal(future_ul_tti_req->SFN == sched_pusch->frame
+1 -3
View File
@@ -45,6 +45,7 @@
#include "LTE_MBMS-SessionInfoList-r9.h"
#include "LTE_PMCH-InfoList-r9.h"
typedef rlc_op_status_t (*send_rlc_data_req_func_t)(const protocol_ctxt_t *const,
const srb_flag_t, const MBMS_flag_t,
const rb_id_t, const mui_t,
@@ -91,9 +92,6 @@ extern int pdcp_instance_cnt;
int init_pdcp_thread(void);
void cleanup_pdcp_thread(void);
// Global variable to identify each UE. Updated in main() of lte-uesoftmodem.c
//extern uint16_t ue_id_g;
extern uint32_t Pdcp_stats_tx_window_ms[MAX_eNB][MAX_MOBILES_PER_ENB];
extern uint32_t Pdcp_stats_tx_bytes[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
extern uint32_t Pdcp_stats_tx_bytes_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
+7 -6
View File
@@ -89,7 +89,7 @@ extern struct msghdr nas_msg_rx;
extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP);
uint16_t ue_id_g;// global variable to identify ue id for each ue. Change happens only in main function of lte-uesoftmodem.c
uint16_t ue_id_g; // Global variable to identify the ID for each UE. It is updated in main() of lte-uesoftmodem.c
void debug_pdcp_pc5s_sdu(sidelink_pc5s_element *sl_pc5s_msg, char *title) {
LOG_I(PDCP,"%s: \nPC5S message, header traffic_type: %d)\n", title, sl_pc5s_msg->pc5s_header.traffic_type);
@@ -147,7 +147,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
nas_nlh_tx->nlmsg_len = sizeToWrite;
ret = sendmsg(nas_sock_fd[0],&nas_msg_tx,0);
} // PDCP_USE_NETLINK
AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s), nas_sock_fd[0]: %d\n", errno, strerror(errno), nas_sock_fd[0]);
if( LOG_DEBUGFLAG(DEBUG_PDCP) )
@@ -562,8 +562,8 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
pdcp_read_header_g.data_size,
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
PDCP_TRANSMISSION_MODE_DATA,
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)?NULL:&pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)?NULL:&pdcp_read_header_g.destinationL2Id
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id
);
} else { /* else of h_rc == HASH_TABLE_OK */
MSC_LOG_RX_DISCARDED_MESSAGE(
@@ -607,8 +607,8 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
pdcp_read_header_g.data_size,
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
PDCP_TRANSMISSION_MODE_DATA,
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL :&pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL :&pdcp_read_header_g.destinationL2Id
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id
);
} /* rab_id == 0 */
} /*pdcp_read_state_g != 0 */
@@ -875,3 +875,4 @@ pdcp_pc5_socket_init() {
exit(1);
}
}
+1 -8
View File
@@ -42,10 +42,7 @@ void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int si
nr_pdcp_entity_srb_t *entity = (nr_pdcp_entity_srb_t *)_entity;
int sn;
char buf[size+6];
char buf_mel[1024];
hexdump(buffer, size, buf_mel, sizeof(buf_mel));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s recevied in PDCP layer directly\n",
__FUNCTION__, buf_mel);
sn = entity->common.next_nr_pdcp_tx_sn;
entity->common.next_nr_pdcp_tx_sn++;
@@ -65,10 +62,6 @@ void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int si
entity->common.deliver_pdu(entity->common.deliver_pdu_data,
(nr_pdcp_entity_t *)entity, buf, size+6, sdu_id);
char buf_meli[1024];
hexdump(buf, size + 3, buf_meli, sizeof(buf_meli));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s After delivering to RLC\n",
__FUNCTION__, buf_meli);
}
void nr_pdcp_entity_srb_set_integrity_key(nr_pdcp_entity_t *_entity, char *key)
+2 -12
View File
@@ -296,9 +296,6 @@ static void *ue_tun_read_thread(void *_)
}
LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len);
char buffer[1024];
hexdump(rx_buf, len, buffer, sizeof(buffer));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s from tunnel interface\n", buffer);
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
rnti = nr_pdcp_get_first_rnti(nr_pdcp_ue_manager);
@@ -416,9 +413,6 @@ uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id)
nas_getparams();
if(UE_NAS_USE_TUN) {
/* Melissa TODO: Brute force changes made below to allow nr-UE to have unique tunnel interfaces.
When the NODE_NUMBER param is not used to determine functionality and LTE tunnel
interfaces, we should update the netlink_init_tun() and nas_config() calls below as well. */
int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)? MAX_MOBILES_PER_ENB : 1;
netlink_init_tun("nrue", num_if, id);
//Add --nr-ip-over-lte option check for next line
@@ -836,10 +830,9 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s,
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti);
if (ue->drb[drb_id-1] != NULL) {
LOG_I(PDCP, "Melissa Elkadi %s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n",
LOG_D(PDCP, "%s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n",
__FILE__, __LINE__, __FUNCTION__, drb_id, rnti);
} else {
LOG_I(PDCP, "%s:%d:%s: Melissa Elkadi, we will call deliver_sdu_drb\n", __FILE__, __LINE__, __FUNCTION__);
pdcp_drb = new_nr_pdcp_entity(NR_PDCP_DRB_AM, is_gnb, drb_id,pdusession_id,has_sdap,
has_sdapULheader,has_sdapDLheader,
deliver_sdu_drb, ue, deliver_pdu_drb, ue,
@@ -1207,10 +1200,7 @@ static boolean_t pdcp_data_req_drb(
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
return 0;
}
char buffer[1024];
hexdump((char *)sdu_buffer, sdu_buffer_size, buffer, sizeof(buffer));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s from tunnel interface in PDCP layer\n",
__FUNCTION__, buffer);
rb->recv_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP);
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
+4 -30
View File
@@ -204,7 +204,6 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn)
int so = 0;
int bad_sdu = 0;
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
/* go to first segment of sn */
pdu = entity->rx_list;
while (pdu->sn != sn)
@@ -232,7 +231,6 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn)
return;
/* deliver */
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
entity->common.deliver_sdu(entity->common.deliver_sdu_data,
(nr_rlc_entity_t *)entity,
sdu, so);
@@ -246,16 +244,13 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu)
entity->rx_next_highest = (x + 1) % entity->sn_modulus;
/* todo: room for optimization: we can run through rx_list only once */
LOG_I(RLC, "Melissa Elkadi, checking if sdu_full is true %s()\n", __FUNCTION__);
if (sdu_full(entity, x)) {
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
reassemble_and_deliver(entity, x);
if (x == entity->rx_highest_status) {
int rx_highest_status = entity->rx_highest_status;
while (sdu_delivered(entity, rx_highest_status))
rx_highest_status = (rx_highest_status + 1) % entity->sn_modulus;
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
entity->rx_highest_status = rx_highest_status;
}
@@ -278,10 +273,8 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu)
entity->rx_next = rx_next;
}
}
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
if (entity->t_reassembly_start) {
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
if (entity->rx_next_status_trigger == entity->rx_next ||
(entity->rx_next_status_trigger == (entity->rx_next + 1)
% entity->sn_modulus &&
@@ -294,7 +287,6 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu)
}
if (entity->t_reassembly_start == 0) {
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
if (sn_compare_rx(entity, entity->rx_next_highest,
(entity->rx_next + 1) % entity->sn_modulus) > 0 ||
(entity->rx_next_highest == (entity->rx_next + 1)
@@ -552,13 +544,9 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity,
int control_e2;
int control_e3;
unsigned char sn_set[32768]; /* used to dec retx_count only once per sdu */
char buf_3[1024];
hexdump(buffer, size, buf_3, sizeof(buf_3));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_3, __FUNCTION__, __LINE__);
nr_rlc_pdu_decoder_init(&decoder, buffer, size);
dc = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder);
LOG_I(RLC, "Melissa Elkadi, we are here %s(): %d. dc = %d\n", __FUNCTION__, __LINE__, dc);
if (dc == 0) goto control;
/* data PDU */
@@ -622,7 +610,6 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity,
entity->rx_list, pdu);
/* do reception actions (38.322 5.2.3.2.3) */
LOG_I(RLC, "Melissa Elkadi, we are calling reception_actions from %s()\n", __FUNCTION__);
reception_actions(entity, pdu);
if (p) {
@@ -831,20 +818,9 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity,
nr_rlc_pdu_encoder_put_bits(&encoder, 1, 1); /* D/C: 1 = data */
nr_rlc_pdu_encoder_put_bits(&encoder, 0, 1); /* P: reserve, set later */
char buf_1[1024];
hexdump(sdu->sdu->data, sdu->size, buf_1, sizeof(buf_1));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_1, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */
char buf_2[1024];
hexdump(sdu->sdu->data, sdu->size, buf_2, sizeof(buf_2));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_2, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */
char buf_3[1024];
hexdump(sdu->sdu->data, sdu->size, buf_3, sizeof(buf_3));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_3, __FUNCTION__, __LINE__);
if (entity->sn_field_length == 18)
nr_rlc_pdu_encoder_put_bits(&encoder, 0, 2); /* R */
@@ -860,10 +836,7 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity,
if (p)
include_poll(entity, buffer);
char buf[1024];
hexdump(buffer + encoder.byte, sdu->size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling generate_pdu in %s\n",
buf, __FUNCTION__);
return encoder.byte + sdu->size;
}
@@ -1599,6 +1572,7 @@ int nr_rlc_entity_am_generate_pdu(nr_rlc_entity_t *_entity,
if (ret != 0)
return ret;
}
return generate_tx_pdu(entity, buffer, size);
}
@@ -104,7 +104,6 @@ int nr_rlc_entity_tm_generate_pdu(nr_rlc_entity_t *_entity,
char *buffer, int size)
{
nr_rlc_entity_tm_t *entity = (nr_rlc_entity_tm_t *)_entity;
LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__);
return generate_tx_pdu(entity, buffer, size);
}
+3 -35
View File
@@ -353,20 +353,9 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity,
/* generate header */
nr_rlc_pdu_encoder_init(&encoder, buffer, bufsize);
char buf_1[1024];
hexdump(sdu->sdu->data, sdu->size, buf_1, sizeof(buf_1));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_1, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */
char buf_2[1024];
hexdump(sdu->sdu->data, sdu->size, buf_2, sizeof(buf_2));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_2, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */
char buf_3[1024];
hexdump(sdu->sdu->data, sdu->size, buf_3, sizeof(buf_3));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_3, __FUNCTION__, __LINE__);
/* SN, if required */
if (sdu->is_first == 1 && sdu->is_last == 1) {
nr_rlc_pdu_encoder_put_bits(&encoder, 0, 6); /* R */
@@ -380,23 +369,9 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity,
if (!sdu->is_first)
nr_rlc_pdu_encoder_put_bits(&encoder, sdu->so, 16); /* SO */
char buf_sdu[1024];
hexdump(sdu->sdu->data, sdu->size, buf_sdu, sizeof(buf_sdu));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of sdu->data %s in %s\n",
buf_sdu, __FUNCTION__);
/* data */
memcpy(buffer + encoder.byte, sdu->sdu->data + sdu->so, sdu->size);
char buf_5[1024];
hexdump(buffer, sdu->size, buf_5, sizeof(buf_5));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after memcpy of just buffer %s\n",
buf_5, __FUNCTION__);
char buf[1024];
hexdump(buffer + encoder.byte, sdu->size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after memcpy sdu into buffer in %s\n",
buf, __FUNCTION__);
return encoder.byte + sdu->size;
}
@@ -504,15 +479,9 @@ static int generate_tx_pdu(nr_rlc_entity_um_t *entity, char *buffer, int size)
/* update tx_next if the SDU is an SDU segment and is the last */
if (!sdu->is_first && sdu->is_last)
entity->tx_next = (entity->tx_next + 1) % entity->sn_modulus;
char buf[1024];
hexdump(buffer, sdu->size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right before calling serialize_sdu in %s\n",
buf, __FUNCTION__);
ret = serialize_sdu(entity, sdu, buffer, size);
char buf_1[1024];
hexdump(buffer, size, buf_1, sizeof(buf_1));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling serialize_sdu in %s\n",
buf_1, __FUNCTION__);
entity->tx_size -= sdu->size;
nr_rlc_free_sdu_segment(sdu);
@@ -554,7 +523,6 @@ int nr_rlc_entity_um_generate_pdu(nr_rlc_entity_t *_entity,
char *buffer, int size)
{
nr_rlc_entity_um_t *entity = (nr_rlc_entity_um_t *)_entity;
LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__);
return generate_tx_pdu(entity, buffer, size);
}
+1 -5
View File
@@ -218,10 +218,6 @@ tbs_size_t mac_rlc_data_req(
rb->set_time(rb, nr_rlc_current_time);
maxsize = tb_sizeP;
ret = rb->generate_pdu(rb, buffer_pP, maxsize);
char buffer[1024];
hexdump(buffer_pP, ret, buffer, sizeof(buffer));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling generate_pdu in %s\n",
buffer, __FUNCTION__);
} else {
ret = 0;
}
@@ -508,7 +504,7 @@ rb_found:
return;
}
}
LOG_I(PDCP, "Melissa Elkadi we are calling PDCP layer from RLC in %s\n", __FUNCTION__);
LOG_D(PDCP, "Calling PDCP layer from RLC in %s\n", __FUNCTION__);
if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock)) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
/* what to do in case of failure? for the moment: nothing */
+1 -6
View File
@@ -106,16 +106,11 @@ void nr_rlc_pdu_decoder_init(nr_rlc_pdu_decoder_t *decoder,
static int get_bit(nr_rlc_pdu_decoder_t *decoder)
{
int ret;
LOG_I(RLC, "Melissa Elkadi, in %s():. bytes = %d size = %d, bit %d, shifted bit %d \n",
__FUNCTION__, decoder->byte, decoder->size, decoder->bit, (7-decoder->bit));
if (decoder->byte >= decoder->size) {
decoder->error = 1;
return 0;
}
LOG_I(RLC, "Melissa Elkadi, in %s():. (%d >> (7 - decoder->bit)) & 1 = %d (returned val) \n",
__FUNCTION__,
decoder->buffer[decoder->byte],
((decoder->buffer[decoder->byte] >> (7 - decoder->bit)) & 1));
ret = (decoder->buffer[decoder->byte] >> (7 - decoder->bit)) & 1;