NR specific enqueue_rlc_data_req function and some cleanup in NR PDCP
This commit is contained in:
@@ -150,12 +150,9 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance, sctp_assoc_t assoc_id
|
||||
|
||||
nr_pdcp_data_ind(&ctxt,
|
||||
1, // srb_flag
|
||||
0, // embms_flag
|
||||
msg.srb_id,
|
||||
msg.rrc_container_length,
|
||||
mb,
|
||||
NULL,
|
||||
NULL);
|
||||
mb);
|
||||
/* Free UL RRC Message Transfer */
|
||||
free_ul_rrc_message_transfer(&msg);
|
||||
return 0;
|
||||
|
||||
@@ -90,7 +90,7 @@ bool DURecvCb(protocol_ctxt_t *ctxt_pP,
|
||||
// The buffer comes from the stack in gtp-u thread, we have a make a separate buffer to enqueue in a inter-thread message queue
|
||||
uint8_t *sdu = malloc16(sdu_buffer_sizeP);
|
||||
memcpy(sdu, sdu_buffer_pP, sdu_buffer_sizeP);
|
||||
du_rlc_data_req(ctxt_pP, srb_flagP, false, rb_idP, muiP, confirmP, sdu_buffer_sizeP, sdu);
|
||||
du_rlc_data_req(ctxt_pP, srb_flagP, rb_idP, muiP, confirmP, sdu_buffer_sizeP, sdu);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
|
||||
#include "pdcp.h"
|
||||
#include "pdcp_messages_types.h"
|
||||
#include "rlc.h"
|
||||
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include "utils.h"
|
||||
|
||||
#define TODO do { \
|
||||
@@ -127,7 +127,6 @@ nr_pdcp_entity_t *nr_pdcp_get_rb(nr_pdcp_ue_t *ue, int rb_id, bool srb_flag)
|
||||
typedef struct {
|
||||
protocol_ctxt_t ctxt_pP;
|
||||
srb_flag_t srb_flagP;
|
||||
MBMS_flag_t MBMS_flagP;
|
||||
rb_id_t rb_idP;
|
||||
mui_t muiP;
|
||||
confirm_t confirmP;
|
||||
@@ -159,16 +158,12 @@ static void *rlc_data_req_thread(void *_)
|
||||
i = q.start;
|
||||
if (pthread_mutex_unlock(&q.m) != 0) abort();
|
||||
|
||||
rlc_data_req(&q.q[i].ctxt_pP,
|
||||
q.q[i].srb_flagP,
|
||||
q.q[i].MBMS_flagP,
|
||||
q.q[i].rb_idP,
|
||||
q.q[i].muiP,
|
||||
q.q[i].confirmP,
|
||||
q.q[i].sdu_sizeP,
|
||||
q.q[i].sdu_pP,
|
||||
NULL,
|
||||
NULL);
|
||||
nr_rlc_data_req(&q.q[i].ctxt_pP,
|
||||
q.q[i].srb_flagP,
|
||||
q.q[i].rb_idP,
|
||||
q.q[i].muiP,
|
||||
q.q[i].sdu_sizeP,
|
||||
q.q[i].sdu_pP);
|
||||
|
||||
if (pthread_mutex_lock(&q.m) != 0) abort();
|
||||
|
||||
@@ -195,7 +190,6 @@ static void init_nr_rlc_data_req_queue(void)
|
||||
|
||||
static void enqueue_rlc_data_req(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 mui_t muiP,
|
||||
confirm_t confirmP,
|
||||
@@ -219,7 +213,6 @@ static void enqueue_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
q.q[i].ctxt_pP = *ctxt_pP;
|
||||
q.q[i].srb_flagP = srb_flagP;
|
||||
q.q[i].MBMS_flagP = MBMS_flagP;
|
||||
q.q[i].rb_idP = rb_idP;
|
||||
q.q[i].muiP = muiP;
|
||||
q.q[i].confirmP = confirmP;
|
||||
@@ -232,7 +225,6 @@ static void enqueue_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
void du_rlc_data_req(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 mui_t muiP,
|
||||
confirm_t confirmP,
|
||||
@@ -241,7 +233,6 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
{
|
||||
enqueue_rlc_data_req(ctxt_pP,
|
||||
srb_flagP,
|
||||
MBMS_flagP,
|
||||
rb_idP, muiP,
|
||||
confirmP,
|
||||
sdu_sizeP,
|
||||
@@ -259,7 +250,6 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
typedef struct {
|
||||
protocol_ctxt_t ctxt_pP;
|
||||
srb_flag_t srb_flagP;
|
||||
MBMS_flag_t MBMS_flagP;
|
||||
rb_id_t rb_id;
|
||||
sdu_size_t sdu_buffer_size;
|
||||
uint8_t *sdu_buffer;
|
||||
@@ -279,7 +269,6 @@ static pdcp_data_ind_queue pq;
|
||||
|
||||
static void do_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)
|
||||
@@ -329,7 +318,6 @@ static void *pdcp_data_ind_thread(void *_)
|
||||
|
||||
do_pdcp_data_ind(&pq.q[i].ctxt_pP,
|
||||
pq.q[i].srb_flagP,
|
||||
pq.q[i].MBMS_flagP,
|
||||
pq.q[i].rb_id,
|
||||
pq.q[i].sdu_buffer_size,
|
||||
pq.q[i].sdu_buffer);
|
||||
@@ -359,7 +347,6 @@ static void init_nr_pdcp_data_ind_queue(void)
|
||||
|
||||
static void enqueue_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)
|
||||
@@ -381,7 +368,6 @@ static void enqueue_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
pq.q[i].ctxt_pP = *ctxt_pP;
|
||||
pq.q[i].srb_flagP = srb_flagP;
|
||||
pq.q[i].MBMS_flagP = MBMS_flagP;
|
||||
pq.q[i].rb_id = rb_id;
|
||||
pq.q[i].sdu_buffer_size = sdu_buffer_size;
|
||||
pq.q[i].sdu_buffer = sdu_buffer;
|
||||
@@ -392,19 +378,11 @@ static void enqueue_pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
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)
|
||||
uint8_t *const sdu_buffer)
|
||||
{
|
||||
enqueue_pdcp_data_ind(ctxt_pP,
|
||||
srb_flagP,
|
||||
MBMS_flagP,
|
||||
rb_id,
|
||||
sdu_buffer_size,
|
||||
sdu_buffer);
|
||||
enqueue_pdcp_data_ind(ctxt_pP, srb_flagP, rb_id, sdu_buffer_size, sdu_buffer);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -717,7 +695,7 @@ static void deliver_pdu_drb_ue(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
|
||||
uint8_t *memblock = malloc16(size);
|
||||
memcpy(memblock, buf, size);
|
||||
LOG_D(PDCP, "%s(): (drb %d) calling rlc_data_req size %d UE %ld/%04lx\n", __func__, rb_id, size, ctxt.rntiMaybeUEid, ctxt.rntiMaybeUEid);
|
||||
enqueue_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock);
|
||||
enqueue_rlc_data_req(&ctxt, 0, rb_id, sdu_id, 0, size, memblock);
|
||||
}
|
||||
|
||||
static void deliver_pdu_drb_gnb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
|
||||
@@ -735,7 +713,7 @@ static void deliver_pdu_drb_gnb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id
|
||||
uint8_t *memblock = malloc16(size);
|
||||
memcpy(memblock, buf, size);
|
||||
LOG_D(PDCP, "%s(): (drb %d) calling rlc_data_req size %d\n", __func__, rb_id, size);
|
||||
enqueue_rlc_data_req(&ctxt, 0, MBMS_FLAG_NO, rb_id, sdu_id, 0, size, memblock);
|
||||
enqueue_rlc_data_req(&ctxt, 0, rb_id, sdu_id, 0, size, memblock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,7 +772,7 @@ void deliver_pdu_srb_rlc(void *deliver_pdu_data, ue_id_t ue_id, int srb_id,
|
||||
protocol_ctxt_t ctxt = { .enb_flag = 1, .rntiMaybeUEid = ue_id };
|
||||
uint8_t *memblock = malloc16(size);
|
||||
memcpy(memblock, buf, size);
|
||||
enqueue_rlc_data_req(&ctxt, 1, MBMS_FLAG_NO, srb_id, sdu_id, 0, size, memblock);
|
||||
enqueue_rlc_data_req(&ctxt, 1, srb_id, sdu_id, 0, size, memblock);
|
||||
}
|
||||
|
||||
void add_srb(int is_gnb,
|
||||
@@ -1315,7 +1293,7 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
|
||||
exit(1);
|
||||
}
|
||||
memcpy(memblock, sdu_buffer, sdu_buffer_size);
|
||||
int ret = nr_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, rb_id, sdu_buffer_size, memblock);
|
||||
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 */
|
||||
|
||||
@@ -39,7 +39,6 @@ uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id);
|
||||
|
||||
void du_rlc_data_req(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 mui_t muiP,
|
||||
confirm_t confirmP,
|
||||
@@ -48,12 +47,9 @@ void du_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
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);
|
||||
uint8_t *const sdu_buffer);
|
||||
|
||||
void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
|
||||
ue_id_t UEid,
|
||||
|
||||
@@ -259,23 +259,18 @@ mac_rlc_status_resp_t nr_mac_rlc_status_ind(const uint16_t ue_id, const frame_t
|
||||
return ret;
|
||||
}
|
||||
|
||||
rlc_op_status_t rlc_data_req(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 mui_t muiP,
|
||||
confirm_t confirmP,
|
||||
sdu_size_t sdu_sizeP,
|
||||
uint8_t *sdu_pP,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id)
|
||||
rlc_op_status_t nr_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
sdu_size_t sdu_sizeP,
|
||||
uint8_t *sdu_pP)
|
||||
{
|
||||
int ue_id = ctxt_pP->rntiMaybeUEid;
|
||||
nr_rlc_ue_t *ue;
|
||||
nr_rlc_entity_t *rb;
|
||||
|
||||
LOG_D(RLC, "UE %d srb_flag %d rb_id %ld mui %d confirm %d sdu_size %d MBMS_flag %d\n",
|
||||
ue_id, srb_flagP, rb_idP, muiP, confirmP, sdu_sizeP, MBMS_flagP);
|
||||
LOG_D(RLC, "UE %d srb_flag %d rb_id %ld mui %d sdu_size %d\n", ue_id, srb_flagP, rb_idP, muiP, sdu_sizeP);
|
||||
|
||||
if (ctxt_pP->enb_flag)
|
||||
T(T_ENB_RLC_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rntiMaybeUEid), T_INT(rb_idP), T_INT(sdu_sizeP));
|
||||
@@ -455,7 +450,7 @@ rb_found:
|
||||
}
|
||||
memcpy(memblock, buf, size);
|
||||
LOG_D(PDCP, "Calling PDCP layer from RLC in %s\n", __FUNCTION__);
|
||||
if (!nr_pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock, NULL, NULL)) {
|
||||
if (!nr_pdcp_data_ind(&ctx, is_srb, 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 */
|
||||
}
|
||||
|
||||
@@ -53,6 +53,12 @@ tbs_size_t nr_mac_rlc_data_req(const module_id_t module_idP,
|
||||
const logical_chan_id_t channel_idP,
|
||||
const tb_size_t tb_sizeP,
|
||||
char *buffer_pP);
|
||||
rlc_op_status_t nr_rlc_data_req(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
sdu_size_t sdu_sizeP,
|
||||
uint8_t *sdu_pP);
|
||||
mac_rlc_status_resp_t nr_mac_rlc_status_ind(const uint16_t ue_id, const frame_t frame, const logical_chan_id_t channel_idP);
|
||||
|
||||
void nr_rlc_add_srb(int ue_id, int srb_id, const NR_RLC_BearerConfig_t *rlc_BearerConfig);
|
||||
|
||||
Reference in New Issue
Block a user