Commit e50978e7 authored by Robert Schmidt's avatar Robert Schmidt

4G RLC/PDCP interface: remove function pointers

Remove function pointers that were used in the past to implement the
F1(-U) interface in 4G, i.e., to have different functions to handle
split/monolithic operations. As we don't have F1 in 4G anymore (see
commit 9dc22822), we don't need the
function pointers anymore.

On that occasion, rename the 5G functions by prepending nr_ to them;
this allows to refactor the interface in 5G further (which is not the
focus of this changeset).
parent 3d7ab0eb
......@@ -416,9 +416,6 @@ static void init_pdcp(void)
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_W_MBMS_BIT;
pdcp_module_init(pdcp_initmask, 0);
pdcp_set_rlc_data_req_func(rlc_data_req);
pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
}
static void wait_nfapi_init(char *thread_name) {
......
......@@ -498,8 +498,6 @@ static void init_pdcp(int ue_id) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
pdcp_module_init(pdcp_initmask, ue_id);
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
}
// Stupid function addition because UE itti messages queues definition is common with eNB
......
......@@ -340,8 +340,6 @@ static void init_pdcp(int ue_id)
}
nr_pdcp_layer_init(false);
nr_pdcp_module_init(pdcp_initmask, ue_id);
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
}
// Stupid function addition because UE itti messages queues definition is common with eNB
......
......@@ -279,14 +279,13 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id
uint8_t *mb = malloc16(ie->value.choice.RRCContainer.size);
memcpy(mb, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
LOG_D(F1AP, "Calling pdcp_data_ind for UE RNTI %lx srb_id %lu with size %ld (DCCH) \n", ctxt.rntiMaybeUEid, srb_id, ie->value.choice.RRCContainer.size);
//for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
// printf("%02x ", mb->data[i]);
//printf("\n");
pdcp_data_ind (&ctxt,
1, // srb_flag
0, // embms_flag
srb_id,
ie->value.choice.RRCContainer.size,
mb, NULL, NULL);
nr_pdcp_data_ind(&ctxt,
1, // srb_flag
0, // embms_flag
srb_id,
ie->value.choice.RRCContainer.size,
mb,
NULL,
NULL);
return 0;
}
......@@ -113,7 +113,7 @@ struct sockaddr_in prose_ctrl_addr;
struct sockaddr_in prose_pdcp_addr;
struct sockaddr_in pdcp_sin;
/* pdcp module parameters and related functions*/
static pdcp_params_t pdcp_params= {0,NULL};
static pdcp_params_t pdcp_params = {0};
rnti_t pdcp_UE_UE_module_id_to_rnti[MAX_MOBILES_PER_ENB];
rnti_t pdcp_eNB_UE_instance_to_rnti[MAX_MOBILES_PER_ENB]; // for noS1 mode
unsigned int pdcp_eNB_UE_instance_to_rnti_index;
......@@ -298,8 +298,8 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
LOG_UI(PDCP, "Before rlc_data_req 1, srb_flagP: %d, rb_idP: %ld \n", srb_flagP, rb_idP);
}
rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP,
confirmP, sdu_buffer_sizeP, pdcp_pdu_p,NULL,NULL);
rlc_status =
rlc_data_req(ctxt_pP, srb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p, NULL, NULL);
} else {
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
LOG_E(PDCP,PROTOCOL_CTXT_FMT" PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
......@@ -467,9 +467,16 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
if ((pdcp_pdu_p!=NULL) && (srb_flagP == 0) && (ctxt_pP->enb_flag == 1)) {
LOG_D(PDCP, "pdcp data req on drb %ld, size %d, rnti %lx\n", rb_idP, pdcp_pdu_size, ctxt_pP->rntiMaybeUEid);
rlc_status = pdcp_params.send_rlc_data_req_func(ctxt_pP, srb_flagP, MBMS_FLAG_NO, rb_idP, muiP,
confirmP, pdcp_pdu_size, pdcp_pdu_p,sourceL2Id,
destinationL2Id);
rlc_status = rlc_data_req(ctxt_pP,
srb_flagP,
MBMS_FLAG_NO,
rb_idP,
muiP,
confirmP,
pdcp_pdu_size,
pdcp_pdu_p,
sourceL2Id,
destinationL2Id);
ret = false;
switch (rlc_status) {
case RLC_OP_STATUS_OK:
......@@ -2279,18 +2286,6 @@ void rrc_pdcp_config_req (
}
}
pdcp_data_ind_func_t get_pdcp_data_ind_func() {
return pdcp_params.pdcp_data_ind_func;
}
void pdcp_set_rlc_data_req_func(send_rlc_data_req_func_t send_rlc_data_req) {
pdcp_params.send_rlc_data_req_func = send_rlc_data_req;
}
void pdcp_set_pdcp_data_ind_func(pdcp_data_ind_func_t pdcp_data_ind) {
pdcp_params.pdcp_data_ind_func = pdcp_data_ind;
}
uint64_t pdcp_module_init( uint64_t pdcp_optmask, int id) {
/* temporary enforce netlink when UE_NAS_USE_TUN is set,
this is while switching from noS1 as build option
......
......@@ -47,27 +47,6 @@
#include "openair3/SECU/secu_defs.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,
confirm_t,
sdu_size_t,
uint8_t *,
const uint32_t *const,
const uint32_t *const);
typedef bool(pdcp_data_ind_t)(const protocol_ctxt_t *,
const srb_flag_t,
const MBMS_flag_t,
const rb_id_t,
const sdu_size_t,
uint8_t *,
const uint32_t *const,
const uint32_t *const);
typedef pdcp_data_ind_t* pdcp_data_ind_func_t;
#define MAX_NUMBER_NETIF 1 //16
#define ENB_NAS_USE_TUN_W_MBMS_BIT (1<< 10)
#define PDCP_USE_NETLINK_BIT (1<< 11)
......@@ -77,8 +56,6 @@ typedef pdcp_data_ind_t* pdcp_data_ind_func_t;
#define ENB_NAS_USE_TUN_BIT (1<< 16)
typedef struct {
uint64_t optmask;
send_rlc_data_req_func_t send_rlc_data_req_func;
pdcp_data_ind_func_t pdcp_data_ind_func;
} pdcp_params_t;
......@@ -279,7 +256,7 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
const uint32_t *const sourceL2Id,
const uint32_t *const destinationL2Id);
/*! \fn bool pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, uint8_t*, bool)
/*! \fn bool pdcp_data_ind(const protocol_ctxt_t* const, srb_flag_t, MBMS_flag_t, rb_id_t, sdu_size_t, uint8_t*, uint32_t, uint32_t)
* \brief This functions handles data transfer indications coming from RLC
* \param[in] ctxt_pP Running context.
* \param[in] Shows if rb is SRB
......@@ -287,12 +264,20 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
* \param[in] rab_id Radio Bearer ID
* \param[in] sdu_buffer_size Size of incoming SDU in bytes
* \param[in] sdu_buffer Buffer carrying SDU
* \param[in] is_data_plane flag to indicate whether the userplane data belong to the control plane or data plane
* \param[in] srcID
* \param[in] dstID
* \return TRUE on success, false otherwise
* \note None
* @ingroup _pdcp
*/
pdcp_data_ind_t pdcp_data_ind;
bool pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_idP,
const sdu_size_t sdu_buffer_sizeP,
uint8_t *const sdu_buffer_pP,
const uint32_t *const srcID,
const uint32_t *const dstID);
/*! \fn void rrc_pdcp_config_req(const protocol_ctxt_t* const ,uint32_t,rb_id_t,uint8_t)
* \brief This functions initializes relevant PDCP entity
......@@ -381,9 +366,6 @@ int pdcp_fifo_flush_sdus ( const protocol_ctxt_t *const ct
int pdcp_fifo_read_input_sdus_remaining_bytes ( const protocol_ctxt_t *const ctxt_pP);
int pdcp_fifo_read_input_sdus ( const protocol_ctxt_t *const ctxt_pP);
void pdcp_fifo_read_input_sdus_from_otg ( const protocol_ctxt_t *const ctxt_pP);
void pdcp_set_rlc_data_req_func(send_rlc_data_req_func_t send_rlc_data_req);
void pdcp_set_pdcp_data_ind_func(pdcp_data_ind_func_t pdcp_data_ind);
pdcp_data_ind_func_t get_pdcp_data_ind_func(void);
//-----------------------------------------------------------------------------
int pdcp_fifo_flush_mbms_sdus ( const protocol_ctxt_t *const ctxt_pP);
int pdcp_fifo_read_input_mbms_sdus_fromtun ( const protocol_ctxt_t *const ctxt_pP);
......
......@@ -367,14 +367,14 @@ static void enqueue_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
if (pthread_mutex_unlock(&pq.m) != 0) abort();
}
bool pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_id,
const sdu_size_t sdu_buffer_size,
uint8_t *const sdu_buffer,
const uint32_t *const srcID,
const uint32_t *const dstID)
bool nr_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_id,
const sdu_size_t sdu_buffer_size,
uint8_t *const sdu_buffer,
const uint32_t *const srcID,
const uint32_t *const dstID)
{
enqueue_pdcp_data_ind(ctxt_pP,
srb_flagP,
......@@ -1313,7 +1313,7 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
exit(1);
}
memcpy(memblock, sdu_buffer, sdu_buffer_size);
int ret=pdcp_data_ind(ctxt_pP,srb_flagP, false, rb_id, sdu_buffer_size, memblock, NULL, NULL);
int ret = nr_pdcp_data_ind(ctxt_pP, srb_flagP, false, rb_id, sdu_buffer_size, memblock, NULL, NULL);
if (!ret) {
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 */
......@@ -1337,16 +1337,6 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
return false;
}
void pdcp_set_pdcp_data_ind_func(pdcp_data_ind_func_t pdcp_data_ind)
{
/* nothing to do */
}
void pdcp_set_rlc_data_req_func(send_rlc_data_req_func_t send_rlc_data_req)
{
/* nothing to do */
}
//Dummy function needed due to LTE dependencies
void
pdcp_mbms_run ( const protocol_ctxt_t *const ctxt_pP){
......
......@@ -37,14 +37,14 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
sdu_size_t sdu_sizeP,
uint8_t *sdu_pP);
bool pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_id,
const sdu_size_t sdu_buffer_size,
uint8_t *const sdu_buffer,
const uint32_t *const srcID,
const uint32_t *const dstID);
bool nr_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
const srb_flag_t srb_flagP,
const MBMS_flag_t MBMS_flagP,
const rb_id_t rb_id,
const sdu_size_t sdu_buffer_size,
uint8_t *const sdu_buffer,
const uint32_t *const srcID,
const uint32_t *const dstID);
void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
ue_id_t UEid,
......
......@@ -519,7 +519,7 @@ rb_found:
}
memcpy(memblock, buf, size);
LOG_D(PDCP, "Calling PDCP layer from RLC in %s\n", __FUNCTION__);
if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock, NULL, NULL)) {
if (!nr_pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock, NULL, NULL)) {
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 */
}
......
......@@ -418,7 +418,7 @@ rb_found:
exit(1);
}
memcpy(memblock, buf, size);
if (!get_pdcp_data_ind_func()(&ctx, is_srb, is_mbms, rb_id, size, memblock, NULL, NULL)) {
if (!pdcp_data_ind(&ctx, is_srb, is_mbms, rb_id, size, memblock, NULL, NULL)) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed (is_srb %d rb_id %d rnti %d)\n",
__FILE__, __LINE__, __FUNCTION__,
is_srb, rb_id, ue->rnti);
......
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