Merge remote-tracking branch 'origin/pdcp-callbacks-simplify' into integration_2023_w13
This commit is contained in:
@@ -1340,6 +1340,7 @@ INPUT = \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_UE/nr_ue_dci_configuration.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/NR_MAC_UE/mac_extern.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_timer_thread.h \
|
||||
@CMAKE_CURRENT_SOURCE_DIR@/../openair2/LAYER2/nr_pdcp/nr_pdcp_integrity_nia2.h \
|
||||
|
||||
+8
-10
@@ -327,25 +327,23 @@ successful_delivery() and max_retx_reached(): in ??? trigger, the RLC sends a it
|
||||
The PDCP implementation is also protected through a general mutex.
|
||||
The design is very similar to rlc layer. The pdcp data is isolated and encapsulated.
|
||||
|
||||
pdcp_layer_init(): same as rlc init
|
||||
nr_pdcp_layer_init(): same as rlc init
|
||||
we have to call a second init function: pdcp_module_init()
|
||||
|
||||
At Tx side (DL in gNB), pdcp_data_req() is the entry function that the upper layer calls.
|
||||
At Tx side (DL in gNB), `pdcp_data_req_drb()` and `pdcp_data_req_srb()` are the entry functions that the upper layer calls.
|
||||
The upper layer can be GTP or a PDCP internal thread enb_tun_read_thread() that read directly from Linux socket in case we skip 3GPP core implementation.
|
||||
PDCP internals for pdcp_data_req() is thread safe: inside pdcp_data_req_drb(), the pdcp manager protects with the mutex the access to the SDU receiving function of PDCP (recv_sdu() callback, corresponding to nr_pdcp_entity_drb_am_recv_sdu() for DRBs). When it needs, the pdcp layer push this data to rlc by calling : rlc_data_req()
|
||||
|
||||
Also, incoming downlink sdu can comme from internal RRC: in this case, pdcp_run() reads a itti queue, for message RRC_DCCH_DATA_REQ, to0 only call 'pdcp_data_req()'
|
||||
PDCP internals for nr_pdcp_data_req_srb()/nr_pdcp_data_req_drb() are thread safe: inside them, the pdcp manager protects with the mutex the access to the SDU receiving function of PDCP (recv_sdu() callback, corresponding to nr_pdcp_entity_drb_am_recv_sdu() for DRBs). When it needs, the pdcp layer push this data to rlc by calling : rlc_data_req()
|
||||
|
||||
At Rx side, pdcp_data_ind() is the entry point that receives the data from RLC.
|
||||
- Inside pdcp_data_ind(), the pdcp manager mutex protects the access to the PDU receiving function of PDCP (recv_pdu() callback corresponding to nr_pdcp_entity_drb_am_recv_pdu() for DRBs)
|
||||
- Then deliver_sdu_drb() function sends the received data to GTP thread through an ITTI message (GTPV1U_TUNNEL_DATA_REQ).
|
||||
|
||||
pdcp_config_set_security(): not yet developped
|
||||
nr_pdcp_config_set_security(): sets the keys for AS security of a UE
|
||||
|
||||
nr_DRB_preconfiguration(): the mac layer calls this for ???
|
||||
nr_DRB_preconfiguration(): the mac layer calls this for configuration in phy-test/do-ra mode
|
||||
|
||||
nr_pdcp_add_srbs() adds UE SRBs in pdcp, pdcp_remove_UE() removes it
|
||||
nr_pdcp_add_drbs() adds UE DRBs in pdcp, pdcp_remove_UE() removes it
|
||||
nr_pdcp_add_srbs() adds UE SRBs in pdcp, nr_pdcp_remove_UE() removes it
|
||||
nr_pdcp_add_drbs() adds UE DRBs in pdcp, nr_pdcp_remove_UE() removes it
|
||||
|
||||
# GTP
|
||||
Gtp + UDP are two twin threads performing the data plane interface to the core network
|
||||
@@ -357,7 +355,7 @@ PDCP layer push to the GTP queue (outside UDP thread that do almost nothing and
|
||||
|
||||
|
||||
## GTP thread running code from other layers
|
||||
gtp thread calls directly pdcp_data_req(), so it runs inside it's context internal pdcp structures updates
|
||||
gtp thread calls directly nr_pdcp_data_req_drb(), so it runs inside it's context internal pdcp structures updates
|
||||
|
||||
## inside other threads
|
||||
gtpv1u_create_s1u_tunnel(), delete tunnel, ... functions are called inside the other threads, without mutex.
|
||||
|
||||
@@ -181,6 +181,21 @@ bool sdap_data_req(protocol_ctxt_t *ctxt_p,
|
||||
abort();
|
||||
}
|
||||
|
||||
/* hack: gtp_itf.cpp requires this empty function to be defined here */
|
||||
bool nr_pdcp_data_req_drb(protocol_ctxt_t *ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t mode,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "openair2/F1AP/f1ap_common.h"
|
||||
#include "openair2/GNB_APP/gnb_config.h"
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
THREAD_STRUCT thread_struct;
|
||||
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
|
||||
AssertFatal(rc >= 0, "Create task for GTPV1U failed\n");
|
||||
rc = itti_create_task(TASK_CUUP_E1, E1AP_CUUP_task, NULL);
|
||||
AssertFatal(rc >= 0, "Create task for CUUP E1 failed\n");
|
||||
pdcp_layer_init();
|
||||
nr_pdcp_layer_init();
|
||||
MessageDef *msg = RCconfig_NR_CU_E1(true);
|
||||
AssertFatal(msg != NULL, "Send init to task for E1AP UP failed\n");
|
||||
itti_send_msg_to_task(TASK_CUUP_E1, 0, msg);
|
||||
|
||||
@@ -59,7 +59,7 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "pdcp.h"
|
||||
#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
@@ -176,6 +176,12 @@ openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
double cpuf;
|
||||
|
||||
/* hack: pdcp_run() is required by 4G scheduler which is compiled into
|
||||
* nr-softmodem because of linker issues */
|
||||
void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
|
||||
* this is very hackish - find a proper solution
|
||||
@@ -556,13 +562,8 @@ void init_pdcp(void) {
|
||||
PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT:
|
||||
LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
|
||||
if (!get_softmodem_params()->nsa) {
|
||||
if (!NODE_IS_DU(get_node_type())) {
|
||||
pdcp_layer_init();
|
||||
nr_pdcp_module_init(pdcp_initmask, 0);
|
||||
}
|
||||
} else {
|
||||
pdcp_layer_init();
|
||||
if (!NODE_IS_DU(get_node_type())) {
|
||||
nr_pdcp_layer_init();
|
||||
nr_pdcp_module_init(pdcp_initmask, 0);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-14
@@ -33,7 +33,7 @@
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
|
||||
#include "radio/COMMON/common_lib.h"
|
||||
#include "pdcp.h"
|
||||
#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
/*
|
||||
* NR SLOT PROCESSING SEQUENCE
|
||||
@@ -356,12 +356,6 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
|
||||
nr_ue_ul_scheduler(&ul_info);
|
||||
nr_ue_pucch_scheduler(mod_id, ul_info.frame_tx, ul_info.slot_tx, NULL);
|
||||
}
|
||||
if (!IS_SOFTMODEM_NOS1 && get_softmodem_params()->sa) {
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
protocol_ctxt_t ctxt;
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_NO, mac->crnti, frame, slot, 0);
|
||||
pdcp_run(&ctxt);
|
||||
}
|
||||
process_queued_nr_nfapi_msgs(mac, sfn_slot);
|
||||
}
|
||||
return NULL;
|
||||
@@ -638,13 +632,6 @@ void UE_processing(nr_rxtx_thread_data_t *rxtxD) {
|
||||
phy_procedures_nrUE_RX(UE, proc, &phy_data);
|
||||
LOG_D(PHY, "In %s: slot %d, time %llu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc_oai()-a)/3500);
|
||||
#endif
|
||||
|
||||
if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa){
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
protocol_ctxt_t ctxt;
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO, mac->crnti, proc->frame_rx, proc->nr_slot_rx, 0);
|
||||
pdcp_run(&ctxt);
|
||||
}
|
||||
}
|
||||
|
||||
ue_ta_procedures(UE, proc->nr_slot_tx, proc->frame_tx);
|
||||
|
||||
@@ -61,7 +61,7 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "enb_config.h"
|
||||
#include "pdcp.h"
|
||||
#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
@@ -393,7 +393,7 @@ static void init_pdcp(int ue_id) {
|
||||
if (get_softmodem_params()->nsa && rlc_module_init(0) != 0) {
|
||||
LOG_I(RLC, "Problem at RLC initiation \n");
|
||||
}
|
||||
pdcp_layer_init();
|
||||
nr_pdcp_layer_init();
|
||||
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);
|
||||
|
||||
@@ -112,9 +112,7 @@ static int drb_config_N3gtpu_create(e1ap_bearer_setup_req_t * const req,
|
||||
create_tunnel_req.ue_id = (req->gNB_cu_cp_ue_id & 0xFFFF);
|
||||
|
||||
// Create N3 tunnel
|
||||
int ret = gtpv1u_create_ngu_tunnel(instance,
|
||||
&create_tunnel_req,
|
||||
create_tunnel_resp);
|
||||
int ret = gtpv1u_create_ngu_tunnel(instance, &create_tunnel_req, create_tunnel_resp, nr_pdcp_data_req_drb, sdap_data_req);
|
||||
if (ret != 0) {
|
||||
LOG_E(NR_RRC,"rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ : gtpv1u_create_ngu_tunnel failed,start to release UE id %ld\n",
|
||||
create_tunnel_req.ue_id);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "f1ap_cu_rrc_message_transfer.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "openair3/UTILS/conversions.h"
|
||||
#include "pdcp.h"
|
||||
#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
/*
|
||||
Initial UL RRC Message Transfer
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "rrc_extern.h"
|
||||
#include "openair2/RRC/NR/rrc_gNB_NGAP.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "pdcp.h"
|
||||
#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
static void setQos(F1AP_NonDynamic5QIDescriptor_t *toFill) {
|
||||
asn1cCalloc(toFill, tmp);
|
||||
@@ -958,7 +958,7 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
|
||||
LOG_E(F1AP, "could not find ue_context of UE RNTI %x\n", rnti);
|
||||
}
|
||||
|
||||
pdcp_remove_UE(&ctxt);
|
||||
nr_pdcp_remove_UE(ctxt.rntiMaybeUEid);
|
||||
|
||||
LOG_I(F1AP, "Received UE CONTEXT RELEASE COMPLETE: Removing CU UE entry for RNTI %x\n", rnti);
|
||||
f1ap_remove_ue(CUtype, instance, rnti);
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include "f1ap_du_task.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include <openair2/LAYER2/nr_pdcp/nr_pdcp.h>
|
||||
#include "openair2/LAYER2/PDCP_v10.1.0/pdcp.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
#include "openair2/E1AP/e1ap.h"
|
||||
#include "gnb_config.h"
|
||||
extern unsigned char NB_gNB_INST;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include "radio/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
|
||||
#include "nfapi_vnf.h"
|
||||
#include "nfapi_pnf.h"
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
//#include "L1_paramdef.h"
|
||||
#include "prs_nr_paramdef.h"
|
||||
@@ -2244,6 +2244,6 @@ void nr_read_config_and_init(void) {
|
||||
}
|
||||
|
||||
if (NODE_IS_CU(RC.nrrrc[0]->node_type) && RC.nrrrc[0]->node_type != ngran_gNB_CUCP) {
|
||||
pdcp_layer_init();
|
||||
nr_pdcp_layer_init();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp.h"
|
||||
#include "openair2/LAYER2/PDCP_v10.1.0/pdcp.h"
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
#include <pthread.h>
|
||||
|
||||
static NR_UE_MAC_INST_t *nr_ue_mac_inst;
|
||||
@@ -65,7 +65,7 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst) {
|
||||
nr_rrc_mac_config_req_ue(0,0,0,NULL,NULL,NULL,rrc_inst->scell_group_config);
|
||||
AssertFatal(rlc_module_init(0) == 0, "%s: Could not initialize RLC layer\n", __FUNCTION__);
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
pdcp_layer_init();
|
||||
nr_pdcp_layer_init();
|
||||
nr_DRB_preconfiguration(nr_ue_mac_inst->crnti);
|
||||
nr_ue_mac_inst->logicalChannelBearer_exist[0] = true;
|
||||
}
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
|
||||
#include "RRC/NR/nr_rrc_extern.h"
|
||||
|
||||
//#include "LAYER2/MAC/pre_processor.c"
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
@@ -137,7 +136,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
start_meas(&gNB->eNB_scheduler);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
|
||||
|
||||
pdcp_run(&ctxt);
|
||||
/* send tick to RLC and RRC every ms */
|
||||
if ((slot & ((1 << *scc->ssbSubcarrierSpacing) - 1)) == 0) {
|
||||
void nr_rlc_tick(int frame, int subframe);
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
|
||||
|
||||
#include "pdcp.h"
|
||||
|
||||
#define ENABLE_MAC_PAYLOAD_DEBUG
|
||||
#define DEBUG_eNB_SCHEDULER 1
|
||||
|
||||
|
||||
@@ -33,9 +33,8 @@
|
||||
#include "NR_MAC_gNB/mac_proto.h"
|
||||
#include "NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "assertions.h"
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
#include "LAYER2/nr_pdcp/nr_pdcp_entity.h"
|
||||
#include "RRC/NR/nr_rrc_defs.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
//#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
@@ -250,7 +249,7 @@ void mac_top_init_gNB(ngran_node_t node_type)
|
||||
AssertFatal(rlc_module_init(1) == 0,"Could not initialize RLC layer\n");
|
||||
|
||||
// These should be out of here later
|
||||
if (get_softmodem_params()->usim_test == 0 ) pdcp_layer_init();
|
||||
if (get_softmodem_params()->usim_test == 0 ) nr_pdcp_layer_init();
|
||||
|
||||
if(IS_SOFTMODEM_NOS1 && get_softmodem_params()->phy_test)
|
||||
nr_DRB_preconfiguration(0x1234);
|
||||
|
||||
@@ -402,9 +402,7 @@ void pdcp_mbms_run (
|
||||
void pdcp_run (
|
||||
const protocol_ctxt_t *const ctxt_pP);
|
||||
uint64_t pdcp_module_init (uint64_t pdcp_optmask, int ue_id);
|
||||
uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id);
|
||||
void pdcp_module_cleanup (void);
|
||||
void nr_ip_over_LTE_DRB_preconfiguration (void);
|
||||
void pdcp_layer_init (void);
|
||||
void pdcp_layer_cleanup (void);
|
||||
#define PDCP2NW_DRIVER_FIFO 21
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "pdcp.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
int decode_t_reordering(int v)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "common/utils/oai_asn1.h"
|
||||
#include "NR_RadioBearerConfig.h"
|
||||
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp_oai_api.h"
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
|
||||
|
||||
@@ -176,14 +176,19 @@ static void nr_pdcp_entity_recv_pdu(nr_pdcp_entity_t *entity,
|
||||
}
|
||||
}
|
||||
|
||||
static void nr_pdcp_entity_recv_sdu(nr_pdcp_entity_t *entity,
|
||||
char *buffer, int size, int sdu_id)
|
||||
static int nr_pdcp_entity_process_sdu(nr_pdcp_entity_t *entity,
|
||||
char *buffer,
|
||||
int size,
|
||||
int sdu_id,
|
||||
char *pdu_buffer,
|
||||
int pdu_max_size)
|
||||
{
|
||||
uint32_t count;
|
||||
int sn;
|
||||
int header_size;
|
||||
int integrity_size;
|
||||
char buf[size + 3 + 4];
|
||||
char *buf = pdu_buffer;
|
||||
DevAssert(size + 3 + 4 <= pdu_max_size);
|
||||
int dc_bit;
|
||||
entity->stats.rxsdu_pkts++;
|
||||
entity->stats.rxsdu_bytes += size;
|
||||
@@ -243,13 +248,11 @@ static void nr_pdcp_entity_recv_sdu(nr_pdcp_entity_t *entity,
|
||||
|
||||
entity->tx_next++;
|
||||
|
||||
entity->deliver_pdu(entity->deliver_pdu_data, entity, buf,
|
||||
header_size + size + integrity_size, sdu_id);
|
||||
entity->stats.txpdu_pkts++;
|
||||
entity->stats.txpdu_bytes += header_size + size + integrity_size;
|
||||
entity->stats.txpdu_sn = sn;
|
||||
|
||||
|
||||
return header_size + size + integrity_size;
|
||||
}
|
||||
|
||||
/* may be called several times, take care to clean previous settings */
|
||||
@@ -398,7 +401,7 @@ nr_pdcp_entity_t *new_nr_pdcp_entity(
|
||||
void (*deliver_sdu)(void *deliver_sdu_data, struct nr_pdcp_entity_t *entity,
|
||||
char *buf, int size),
|
||||
void *deliver_sdu_data,
|
||||
void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity,
|
||||
void (*deliver_pdu)(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
|
||||
char *buf, int size, int sdu_id),
|
||||
void *deliver_pdu_data,
|
||||
int sn_size,
|
||||
@@ -420,7 +423,7 @@ nr_pdcp_entity_t *new_nr_pdcp_entity(
|
||||
ret->type = type;
|
||||
|
||||
ret->recv_pdu = nr_pdcp_entity_recv_pdu;
|
||||
ret->recv_sdu = nr_pdcp_entity_recv_sdu;
|
||||
ret->process_sdu = nr_pdcp_entity_process_sdu;
|
||||
ret->set_security = nr_pdcp_entity_set_security;
|
||||
ret->set_time = nr_pdcp_entity_set_time;
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ typedef struct nr_pdcp_entity_t {
|
||||
|
||||
/* functions provided by the PDCP module */
|
||||
void (*recv_pdu)(struct nr_pdcp_entity_t *entity, char *buffer, int size);
|
||||
void (*recv_sdu)(struct nr_pdcp_entity_t *entity, char *buffer, int size,
|
||||
int sdu_id);
|
||||
int (*process_sdu)(struct nr_pdcp_entity_t *entity, char *buffer, int size,
|
||||
int sdu_id, char *pdu_buffer, int pdu_max_size);
|
||||
void (*delete_entity)(struct nr_pdcp_entity_t *entity);
|
||||
void (*get_stats)(struct nr_pdcp_entity_t *entity, nr_pdcp_statistics_t *out);
|
||||
|
||||
@@ -95,7 +95,7 @@ typedef struct nr_pdcp_entity_t {
|
||||
void (*deliver_sdu)(void *deliver_sdu_data, struct nr_pdcp_entity_t *entity,
|
||||
char *buf, int size);
|
||||
void *deliver_sdu_data;
|
||||
void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity,
|
||||
void (*deliver_pdu)(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
|
||||
char *buf, int size, int sdu_id);
|
||||
void *deliver_pdu_data;
|
||||
|
||||
@@ -176,7 +176,7 @@ nr_pdcp_entity_t *new_nr_pdcp_entity(
|
||||
void (*deliver_sdu)(void *deliver_sdu_data, struct nr_pdcp_entity_t *entity,
|
||||
char *buf, int size),
|
||||
void *deliver_sdu_data,
|
||||
void (*deliver_pdu)(void *deliver_pdu_data, struct nr_pdcp_entity_t *entity,
|
||||
void (*deliver_pdu)(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
|
||||
char *buf, int size, int sdu_id),
|
||||
void *deliver_pdu_data,
|
||||
int sn_size,
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
/* from OAI */
|
||||
#include "oai_asn1.h"
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp_oai_api.h"
|
||||
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
|
||||
@@ -73,7 +73,7 @@ static ngran_node_t node_type;
|
||||
/* NR PDCP and RLC both use "big locks". In some cases a thread may do
|
||||
* lock(rlc) followed by lock(pdcp) (typically when running 'rx_sdu').
|
||||
* Another thread may first do lock(pdcp) and then lock(rlc) (typically
|
||||
* the GTP module calls 'pdcp_data_req' that, in a previous implementation
|
||||
* the GTP module calls 'nr_pdcp_data_req' that, in a previous implementation
|
||||
* was indirectly calling 'rlc_data_req' which does lock(rlc)).
|
||||
* To avoid the resulting deadlock it is enough to ensure that a call
|
||||
* to lock(pdcp) will never be followed by a call to lock(rlc). So,
|
||||
@@ -531,7 +531,13 @@ static void set_node_type() {
|
||||
node_type = get_node_type();
|
||||
}
|
||||
|
||||
/* hack: dummy function needed due to LTE dependencies */
|
||||
void pdcp_layer_init(void)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
void nr_pdcp_layer_init(void)
|
||||
{
|
||||
/* hack: be sure to initialize only once */
|
||||
static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
|
||||
@@ -647,35 +653,12 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
|
||||
}
|
||||
}
|
||||
|
||||
static void deliver_pdu_drb(void *_ue, nr_pdcp_entity_t *entity,
|
||||
static void deliver_pdu_drb(void *deliver_pdu_data, ue_id_t ue_id, int rb_id,
|
||||
char *buf, int size, int sdu_id)
|
||||
{
|
||||
nr_pdcp_ue_t *ue = _ue;
|
||||
int rb_id;
|
||||
protocol_ctxt_t ctxt;
|
||||
int i;
|
||||
mem_block_t *memblock;
|
||||
DevAssert(deliver_pdu_data == NULL);
|
||||
protocol_ctxt_t ctxt = { .enb_flag = 1, .rntiMaybeUEid = ue_id };
|
||||
|
||||
for (i = 0; i < MAX_DRBS_PER_UE; i++) {
|
||||
if (entity == ue->drb[i]) {
|
||||
rb_id = i+1;
|
||||
goto rb_found;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_E(PDCP, "%s:%d:%s: fatal, no RB found for UE ID/RNTI %ld\n", __FILE__, __LINE__, __FUNCTION__, ue->rntiMaybeUEid);
|
||||
exit(1);
|
||||
|
||||
rb_found:
|
||||
ctxt.module_id = 0;
|
||||
ctxt.enb_flag = 1;
|
||||
ctxt.instance = 0;
|
||||
ctxt.frame = 0;
|
||||
ctxt.subframe = 0;
|
||||
ctxt.eNB_index = 0;
|
||||
ctxt.brOption = 0;
|
||||
|
||||
ctxt.rntiMaybeUEid = ue->rntiMaybeUEid;
|
||||
if (NODE_IS_CU(node_type)) {
|
||||
MessageDef *message_p = itti_alloc_new_message_sized(TASK_PDCP_ENB, 0,
|
||||
GTPV1U_TUNNEL_DATA_REQ,
|
||||
@@ -690,14 +673,14 @@ rb_found:
|
||||
req->buffer = gtpu_buffer_p;
|
||||
req->length = size;
|
||||
req->offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
req->ue_id = ue->rntiMaybeUEid;
|
||||
req->ue_id = ue_id;
|
||||
req->bearer_id = rb_id;
|
||||
LOG_I(PDCP, "%s() (drb %d) sending message to gtp size %d\n",
|
||||
__func__, rb_id, size);
|
||||
extern instance_t CUuniqInstance;
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p);
|
||||
} else {
|
||||
memblock = get_free_mem_block(size, __FUNCTION__);
|
||||
mem_block_t *memblock = get_free_mem_block(size, __FUNCTION__);
|
||||
memcpy(memblock->data, buf, size);
|
||||
LOG_D(PDCP, "%s(): (drb %d) calling rlc_data_req size %d\n", __func__, rb_id, size);
|
||||
//for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]);
|
||||
@@ -749,101 +732,26 @@ srb_found:
|
||||
}
|
||||
}
|
||||
|
||||
static void deliver_pdu_srb(void *_ue, nr_pdcp_entity_t *entity,
|
||||
char *buf, int size, int sdu_id)
|
||||
void deliver_pdu_srb_rlc(void *deliver_pdu_data, ue_id_t ue_id, int srb_id,
|
||||
char *buf, int size, int sdu_id)
|
||||
{
|
||||
nr_pdcp_ue_t *ue = _ue;
|
||||
int srb_id;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sizeofArray(ue->srb) ; i++) {
|
||||
if (entity == ue->srb[i]) {
|
||||
srb_id = i+1;
|
||||
goto srb_found;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_E(PDCP, "%s:%d:%s: fatal, no SRB found for UE ID/RNTI %ld\n", __FILE__, __LINE__, __FUNCTION__, ue->rntiMaybeUEid);
|
||||
exit(1);
|
||||
|
||||
srb_found:
|
||||
|
||||
|
||||
LOG_D(PDCP, "%s(): (srb %d) calling rlc_data_req size %d\n", __func__, srb_id, size);
|
||||
//for (i = 0; i < size; i++) printf(" %2.2x", (unsigned char)memblock->data[i]);
|
||||
//printf("\n");
|
||||
if ((RC.nrrrc == NULL) || (!NODE_IS_CU(node_type))) {
|
||||
if (entity->is_gnb) {
|
||||
f1ap_dl_rrc_message_t dl_rrc = {.old_gNB_DU_ue_id = 0xFFFFFF, .rrc_container = (uint8_t *)buf, .rrc_container_length = size, .rnti = ue->rntiMaybeUEid, .srb_id = srb_id};
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[0];
|
||||
rrc->mac_rrc.dl_rrc_message_transfer(0, &dl_rrc);
|
||||
} else { // UE
|
||||
mem_block_t *memblock;
|
||||
protocol_ctxt_t ctxt = {.module_id = 0, .enb_flag = 1, .instance = 0, .frame = 0, .subframe = 0, .eNB_index = 0, .brOption = 0, .rntiMaybeUEid = ue->rntiMaybeUEid};
|
||||
memblock = get_free_mem_block(size, __FUNCTION__);
|
||||
memcpy(memblock->data, buf, size);
|
||||
enqueue_rlc_data_req(&ctxt, 1, MBMS_FLAG_NO, srb_id, sdu_id, 0, size, memblock);
|
||||
}
|
||||
} else {
|
||||
MessageDef *message_p = itti_alloc_new_message (TASK_RRC_GNB, 0, F1AP_DL_RRC_MESSAGE);
|
||||
uint8_t *message_buffer = itti_malloc (TASK_RRC_GNB, TASK_CU_F1, size);
|
||||
memcpy (message_buffer, buf, size);
|
||||
F1AP_DL_RRC_MESSAGE (message_p).rrc_container = message_buffer;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).rrc_container_length = size;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).gNB_CU_ue_id = 0;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).gNB_DU_ue_id = 0;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).old_gNB_DU_ue_id = 0xFFFFFFFF; // unknown
|
||||
F1AP_DL_RRC_MESSAGE(message_p).rnti = ue->rntiMaybeUEid;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).srb_id = srb_id;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).execute_duplication = 1;
|
||||
F1AP_DL_RRC_MESSAGE (message_p).RAT_frequency_priority_information.en_dc = 0;
|
||||
itti_send_msg_to_task (TASK_CU_F1, 0, message_p);
|
||||
LOG_D(PDCP, "Send F1AP_DL_RRC_MESSAGE with ITTI\n");
|
||||
}
|
||||
protocol_ctxt_t ctxt = { .enb_flag = 1, .rntiMaybeUEid = ue_id };
|
||||
mem_block_t *memblock = get_free_mem_block(size, __FUNCTION__);
|
||||
memcpy(memblock->data, buf, size);
|
||||
enqueue_rlc_data_req(&ctxt, 1, MBMS_FLAG_NO, srb_id, sdu_id, 0, size, memblock);
|
||||
}
|
||||
|
||||
void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
|
||||
void deliver_pdu_srb_f1(void *deliver_pdu_data, ue_id_t ue_id, int srb_id,
|
||||
char *buf, int size, int sdu_id)
|
||||
{
|
||||
MessageDef *msg_p;
|
||||
int result;
|
||||
protocol_ctxt_t ctxt = {.module_id = 0, .enb_flag = 1, .instance = 0, .rntiMaybeUEid = 0, .frame = -1, .subframe = -1, .eNB_index = 0, .brOption = false};
|
||||
|
||||
while (1) {
|
||||
itti_poll_msg(ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE, &msg_p);
|
||||
if (msg_p == NULL){
|
||||
break;
|
||||
}
|
||||
switch (ITTI_MSG_ID(msg_p)) {
|
||||
case RRC_DCCH_DATA_REQ:
|
||||
LOG_D(PDCP, "Received RRC_DCCH_DATA_REQ type at PDCP task \n");
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(
|
||||
&ctxt,
|
||||
RRC_DCCH_DATA_REQ(msg_p).module_id,
|
||||
RRC_DCCH_DATA_REQ(msg_p).enb_flag,
|
||||
RRC_DCCH_DATA_REQ(msg_p).rnti,
|
||||
RRC_DCCH_DATA_REQ(msg_p).frame,
|
||||
0,
|
||||
RRC_DCCH_DATA_REQ(msg_p).eNB_index);
|
||||
result = pdcp_data_req(&ctxt,
|
||||
SRB_FLAG_YES,
|
||||
RRC_DCCH_DATA_REQ(msg_p).rb_id,
|
||||
RRC_DCCH_DATA_REQ(msg_p).muip,
|
||||
RRC_DCCH_DATA_REQ(msg_p).confirmp,
|
||||
RRC_DCCH_DATA_REQ(msg_p).sdu_size,
|
||||
RRC_DCCH_DATA_REQ(msg_p).sdu_p,
|
||||
RRC_DCCH_DATA_REQ(msg_p).mode,
|
||||
NULL, NULL);
|
||||
|
||||
if (result != true)
|
||||
LOG_E(PDCP, "PDCP data request failed!\n");
|
||||
result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), RRC_DCCH_DATA_REQ(msg_p).sdu_p);
|
||||
AssertFatal(result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
break;
|
||||
default:
|
||||
LOG_E(PDCP, "Received unexpected message %s\n", ITTI_MSG_NAME(msg_p));
|
||||
break;
|
||||
}
|
||||
}
|
||||
DevAssert(deliver_pdu_data != NULL);
|
||||
gNB_RRC_INST *rrc = deliver_pdu_data;
|
||||
f1ap_dl_rrc_message_t dl_rrc = {.old_gNB_DU_ue_id = 0xFFFFFF,
|
||||
.rrc_container = (uint8_t *)buf,
|
||||
.rrc_container_length = size,
|
||||
.rnti = ue_id,
|
||||
.srb_id = srb_id};
|
||||
rrc->mac_rrc.dl_rrc_message_transfer(0, &dl_rrc);
|
||||
}
|
||||
|
||||
static void add_srb(int is_gnb, ue_id_t rntiMaybeUEid, struct NR_SRB_ToAddMod *s, int ciphering_algorithm, int integrity_algorithm, unsigned char *ciphering_key, unsigned char *integrity_key)
|
||||
@@ -864,7 +772,7 @@ static void add_srb(int is_gnb, ue_id_t rntiMaybeUEid, struct NR_SRB_ToAddMod *s
|
||||
} else {
|
||||
pdcp_srb = new_nr_pdcp_entity(NR_PDCP_SRB, is_gnb, srb_id,
|
||||
0, false, false, // sdap parameters
|
||||
deliver_sdu_srb, ue, deliver_pdu_srb, ue,
|
||||
deliver_sdu_srb, ue, NULL, ue,
|
||||
12, t_Reordering, -1,
|
||||
ciphering_algorithm,
|
||||
integrity_algorithm,
|
||||
@@ -1131,30 +1039,43 @@ uint64_t get_pdcp_optmask(void)
|
||||
return pdcp_optmask;
|
||||
}
|
||||
|
||||
/* hack: dummy function needed due to LTE dependencies */
|
||||
bool pdcp_remove_UE(const protocol_ctxt_t *const ctxt_pP)
|
||||
{
|
||||
ue_id_t rntiMaybeUEid = ctxt_pP->rntiMaybeUEid;
|
||||
abort();
|
||||
}
|
||||
|
||||
bool nr_pdcp_remove_UE(ue_id_t ue_id)
|
||||
{
|
||||
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
|
||||
nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager, rntiMaybeUEid);
|
||||
nr_pdcp_manager_remove_ue(nr_pdcp_ue_manager, ue_id);
|
||||
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void pdcp_config_set_security(
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
pdcp_t *const pdcp_pP,
|
||||
const rb_id_t rb_id,
|
||||
const uint16_t lc_idP,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc_pP,
|
||||
uint8_t *const kRRCint_pP,
|
||||
uint8_t *const kUPenc_pP)
|
||||
/* hack: dummy function needed due to LTE dependencies */
|
||||
void pdcp_config_set_security(const protocol_ctxt_t *const ctxt_pP,
|
||||
pdcp_t *const pdcp_pP,
|
||||
const rb_id_t rb_id,
|
||||
const uint16_t lc_idP,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc_pP,
|
||||
uint8_t *const kRRCint_pP,
|
||||
uint8_t *const kUPenc_pP)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
void nr_pdcp_config_set_security(ue_id_t ue_id,
|
||||
const rb_id_t rb_id,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc_pP,
|
||||
uint8_t *const kRRCint_pP,
|
||||
uint8_t *const kUPenc_pP)
|
||||
{
|
||||
nr_pdcp_ue_t *ue;
|
||||
nr_pdcp_entity_t *rb;
|
||||
ue_id_t ue_id = ctxt_pP->rntiMaybeUEid;
|
||||
int integrity_algorithm;
|
||||
int ciphering_algorithm;
|
||||
|
||||
@@ -1186,27 +1107,17 @@ void pdcp_config_set_security(
|
||||
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
|
||||
}
|
||||
|
||||
static bool pdcp_data_req_srb(protocol_ctxt_t *ctxt_pP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer)
|
||||
bool nr_pdcp_data_req_srb(ue_id_t ue_id,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
deliver_pdu deliver_pdu_cb,
|
||||
void *data)
|
||||
{
|
||||
LOG_D(PDCP, "%s() called, size %d\n", __func__, sdu_buffer_size);
|
||||
nr_pdcp_ue_t *ue;
|
||||
nr_pdcp_entity_t *rb;
|
||||
ue_id_t ue_id = ctxt_pP->rntiMaybeUEid;
|
||||
|
||||
if (ctxt_pP->module_id != 0 ||
|
||||
//ctxt_pP->enb_flag != 1 ||
|
||||
ctxt_pP->instance != 0 ||
|
||||
ctxt_pP->eNB_index != 0 /*||
|
||||
ctxt_pP->configured != 1 ||
|
||||
ctxt_pP->brOption != 0*/) {
|
||||
LOG_E(PDCP, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
|
||||
|
||||
@@ -1223,21 +1134,31 @@ static bool pdcp_data_req_srb(protocol_ctxt_t *ctxt_pP,
|
||||
return 0;
|
||||
}
|
||||
|
||||
rb->recv_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP);
|
||||
int max_size = sdu_buffer_size + 3 + 4; // 3: max header, 4: max integrity
|
||||
char pdu_buf[max_size];
|
||||
int pdu_size = rb->process_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP, pdu_buf, max_size);
|
||||
AssertFatal(rb->deliver_pdu == NULL, "SRB callback should be NULL, to be provided on every invocation\n");
|
||||
|
||||
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
|
||||
|
||||
deliver_pdu_cb(data, ue_id, rb_id, pdu_buf, pdu_size, muiP);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static bool pdcp_data_req_drb(protocol_ctxt_t *ctxt_pP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer)
|
||||
bool nr_pdcp_data_req_drb(protocol_ctxt_t *ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t mode,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id)
|
||||
{
|
||||
DevAssert(srb_flagP == SRB_FLAG_NO);
|
||||
|
||||
LOG_D(PDCP, "%s() called, size %d\n", __func__, sdu_buffer_size);
|
||||
nr_pdcp_ue_t *ue;
|
||||
nr_pdcp_entity_t *rb;
|
||||
@@ -1268,10 +1189,15 @@ static bool pdcp_data_req_drb(protocol_ctxt_t *ctxt_pP,
|
||||
return 0;
|
||||
}
|
||||
|
||||
rb->recv_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP);
|
||||
int max_size = sdu_buffer_size + 3 + 4; // 3: max header, 4: max integrity
|
||||
char pdu_buf[max_size];
|
||||
int pdu_size = rb->process_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP, pdu_buf, max_size);
|
||||
deliver_pdu deliver_pdu_cb = rb->deliver_pdu;
|
||||
|
||||
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
|
||||
|
||||
deliver_pdu_cb(NULL, ue_id, rb_id, pdu_buf, pdu_size, muiP);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1301,23 +1227,20 @@ bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* hack: dummy function needed due to LTE dependencies */
|
||||
bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t mode,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
unsigned char *const sdu_buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id)
|
||||
{
|
||||
if (srb_flagP) {
|
||||
return pdcp_data_req_srb(ctxt_pP, rb_id, muiP, confirmP, sdu_buffer_size, sdu_buffer);
|
||||
}
|
||||
else{
|
||||
return pdcp_data_req_drb(ctxt_pP, rb_id, muiP, confirmP, sdu_buffer_size, sdu_buffer);
|
||||
}
|
||||
abort();
|
||||
return false;
|
||||
}
|
||||
|
||||
void pdcp_set_pdcp_data_ind_func(pdcp_data_ind_func_t pdcp_data_ind)
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef NR_PDCP_OAI_API_H
|
||||
#define NR_PDCP_OAI_API_H
|
||||
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp_ue_manager.h"
|
||||
|
||||
void nr_pdcp_layer_init(void);
|
||||
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,
|
||||
sdu_size_t sdu_sizeP,
|
||||
mem_block_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,
|
||||
mem_block_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 rntiMaybeUEid,
|
||||
ue_id_t reestablish_ue_id,
|
||||
NR_DRB_ToAddModList_t *const drb2add_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kUPenc,
|
||||
uint8_t *const kUPint,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid);
|
||||
|
||||
bool nr_pdcp_remove_UE(ue_id_t ue_id);
|
||||
|
||||
void nr_pdcp_config_set_security(ue_id_t ue_id,
|
||||
const rb_id_t rb_id,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc_pP,
|
||||
uint8_t *const kRRCint_pP,
|
||||
uint8_t *const kUPenc_pP);
|
||||
|
||||
bool cu_f1u_data_req(protocol_ctxt_t *ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t mode,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id);
|
||||
|
||||
typedef void (*deliver_pdu)(void *data, ue_id_t ue_id, int srb_id,
|
||||
char *buf, int size, int sdu_id);
|
||||
/* default implementation of deliver_pdu */
|
||||
void deliver_pdu_srb_rlc(void *data, ue_id_t ue_id, int srb_id, char *buf,
|
||||
int size, int sdu_id);
|
||||
void deliver_pdu_srb_f1(void *data, ue_id_t ue_id, int srb_id, char *buf,
|
||||
int size, int sdu_id);
|
||||
bool nr_pdcp_data_req_srb(ue_id_t ue_id,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
deliver_pdu deliver_cb,
|
||||
void *data);
|
||||
bool nr_pdcp_data_req_drb(protocol_ctxt_t *ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const rb_id_t rb_id,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_buffer_size,
|
||||
unsigned char *const sdu_buffer,
|
||||
const pdcp_transmission_mode_t mode,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id);
|
||||
|
||||
void nr_pdcp_tick(int frame, int subframe);
|
||||
|
||||
nr_pdcp_ue_manager_t *nr_pdcp_sdap_get_ue_manager();
|
||||
|
||||
const bool nr_pdcp_get_statistics(ue_id_t ue_id, int srb_flag, int rb_id, nr_pdcp_statistics_t *out);
|
||||
|
||||
#endif /* NR_PDCP_OAI_API_H */
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/* from openair */
|
||||
#include "rlc.h"
|
||||
#include "pdcp.h"
|
||||
#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
/* from nr rlc module */
|
||||
#include "nr_rlc_asn1_utils.h"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "LAYER2/RLC/rlc.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
|
||||
#include "LAYER2/nr_pdcp/nr_pdcp_oai_api.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
|
||||
@@ -921,10 +921,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
|
||||
|
||||
create_tunnel_req.rnti = ue_context_p->ue_context.rnti; // warning put zero above
|
||||
// create_tunnel_req.num_tunnels = i;
|
||||
ret = gtpv1u_create_s1u_tunnel(
|
||||
instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
ret = gtpv1u_create_s1u_tunnel(instance, &create_tunnel_req, &create_tunnel_resp, pdcp_data_req);
|
||||
|
||||
if ( ret != 0 ) {
|
||||
LOG_E(RRC,"rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ : gtpv1u_create_s1u_tunnel failed,start to release UE %x\n",ue_context_p->ue_context.rnti);
|
||||
@@ -1234,10 +1231,7 @@ int rrc_eNB_process_S1AP_E_RAB_SETUP_REQ(MessageDef *msg_p, const char *msg_name
|
||||
create_tunnel_req.rnti = ue_context_p->ue_context.rnti; // warning put zero above
|
||||
create_tunnel_req.num_tunnels = e_rab_done;
|
||||
// NN: not sure if we should create a new tunnel: need to check teid, etc.
|
||||
ret = gtpv1u_create_s1u_tunnel(
|
||||
instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
ret = gtpv1u_create_s1u_tunnel(instance, &create_tunnel_req, &create_tunnel_resp, pdcp_data_req);
|
||||
|
||||
if ( ret != 0 ) {
|
||||
LOG_E(RRC,"rrc_eNB_process_S1AP_E_RAB_SETUP_REQ : gtpv1u_create_s1u_tunnel failed,start to release UE %x\n",ue_context_p->ue_context.rnti);
|
||||
@@ -1908,14 +1902,8 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs = e_rabs_done;
|
||||
create_tunnel_req.rnti = ue_context_pP->ue_context.rnti;
|
||||
create_tunnel_req.num_tunnels = e_rabs_done;
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
ctxt_pP->instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
ctxt_pP,
|
||||
&create_tunnel_resp,
|
||||
&inde_list[0]);
|
||||
gtpv1u_create_s1u_tunnel(ctxt_pP->instance, &create_tunnel_req, &create_tunnel_resp, pdcp_data_req);
|
||||
rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(ctxt_pP, &create_tunnel_resp, &inde_list[0]);
|
||||
|
||||
for (e_rab = 0; e_rab < e_rabs_done; e_rab++) {
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).e_rabs_tobeswitched[e_rab].e_rab_id = create_tunnel_resp.eps_bearer_id[e_rab];
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "nr_rrc_defs.h"
|
||||
#include "nr_rrc_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "pdcp.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
@@ -43,6 +42,7 @@
|
||||
#include "NR_BCCH-BCH-Message.h"
|
||||
#include "rrc_gNB_UE_context.h"
|
||||
#include <openair2/RRC/NR/MESSAGES/asn1_msg.h>
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
@@ -55,56 +55,6 @@ nr_rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
return 0;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
uint8_t
|
||||
nr_rrc_data_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
MessageDef *message_p;
|
||||
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
|
||||
uint8_t *message_buffer;
|
||||
message_buffer = itti_malloc (
|
||||
ctxt_pP->enb_flag ? TASK_RRC_GNB : TASK_RRC_UE,
|
||||
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
|
||||
sdu_sizeP);
|
||||
memcpy (message_buffer, buffer_pP, sdu_sizeP);
|
||||
message_p = itti_alloc_new_message (ctxt_pP->enb_flag ? TASK_RRC_GNB : TASK_RRC_UE, 0, RRC_DCCH_DATA_REQ);
|
||||
RRC_DCCH_DATA_REQ (message_p).frame = ctxt_pP->frame;
|
||||
RRC_DCCH_DATA_REQ (message_p).enb_flag = ctxt_pP->enb_flag;
|
||||
RRC_DCCH_DATA_REQ (message_p).rb_id = rb_idP;
|
||||
RRC_DCCH_DATA_REQ (message_p).muip = muiP;
|
||||
RRC_DCCH_DATA_REQ (message_p).confirmp = confirmP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_size = sdu_sizeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
|
||||
//memcpy (NR_RRC_DCCH_DATA_REQ (message_p).sdu_p, buffer_pP, sdu_sizeP);
|
||||
RRC_DCCH_DATA_REQ (message_p).mode = modeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id;
|
||||
RRC_DCCH_DATA_REQ(message_p).rnti = ctxt_pP->rntiMaybeUEid;
|
||||
RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
|
||||
itti_send_msg_to_task (
|
||||
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
|
||||
ctxt_pP->instance,
|
||||
message_p);
|
||||
LOG_I(NR_RRC,"send RRC_DCCH_DATA_REQ to PDCP\n");
|
||||
|
||||
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
|
||||
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
|
||||
* messages automatically */
|
||||
if (ctxt_pP->enb_flag)
|
||||
pdcp_run(ctxt_pP);
|
||||
|
||||
return true; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
|
||||
}
|
||||
|
||||
uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
|
||||
@@ -120,7 +120,11 @@ static int drb_config_gtpu_create(const protocol_ctxt_t *const ctxt_p,
|
||||
}
|
||||
create_tunnel_req.num_tunnels = UE->nb_of_pdusessions;
|
||||
create_tunnel_req.ue_id = UE->rnti;
|
||||
int ret = gtpv1u_create_ngu_tunnel(getCxtE1(instance)->gtpInstN3, &create_tunnel_req, &create_tunnel_resp);
|
||||
int ret = gtpv1u_create_ngu_tunnel(getCxtE1(instance)->gtpInstN3,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp,
|
||||
nr_pdcp_data_req_drb,
|
||||
sdap_data_req);
|
||||
|
||||
if (ret != 0) {
|
||||
LOG_E(NR_RRC,"rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ : gtpv1u_create_ngu_tunnel failed,start to release UE rnti %ld\n",
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "asn1_msg.h"
|
||||
#include "pdcp.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
|
||||
@@ -136,17 +136,6 @@ void nr_rrc_trigger(protocol_ctxt_t *ctxt, int CC_id, int frame, int subframe);
|
||||
\ *reOffset Pointer to RE Offset Value */
|
||||
void rrc_config_dl_ptrs_params(NR_BWP_Downlink_t *bwp, int *ptrsNrb, int *ptrsMcs, int *epre_Ratio, int * reOffset);
|
||||
|
||||
uint8_t
|
||||
nr_rrc_data_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_size,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
int
|
||||
nr_rrc_mac_remove_ue(module_id_t mod_idP,
|
||||
rnti_t rntiP);
|
||||
|
||||
+34
-64
@@ -82,7 +82,7 @@
|
||||
#include "rrc_gNB_GTPV1U.h"
|
||||
|
||||
#include "nr_pdcp/nr_pdcp_entity.h"
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
#include "intertask_interface.h"
|
||||
#include "SIMULATION/TOOLS/sim.h" // for taus
|
||||
@@ -105,15 +105,6 @@
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
extern void pdcp_config_set_security(const protocol_ctxt_t *const ctxt_pP,
|
||||
pdcp_t *const pdcp_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const uint16_t lc_idP,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc);
|
||||
|
||||
static inline uint64_t bitStr_to_uint64(BIT_STRING_t *asn);
|
||||
|
||||
mui_t rrc_gNB_mui = 0;
|
||||
@@ -582,7 +573,7 @@ static void rrc_gNB_generate_defaultRRCReconfiguration(const protocol_ctxt_t *co
|
||||
ue_context_pP->ue_context.rnti);
|
||||
AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
|
||||
|
||||
nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
|
||||
@@ -771,14 +762,7 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
ctxt_pP->module_id,
|
||||
DCCH);
|
||||
|
||||
nr_rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
nr_mac_update_cellgroup(RC.nrmac[rrc->module_id], ue_context_pP->ue_context.rnti, ue_context_pP->ue_context.masterCellGroup);
|
||||
@@ -945,22 +929,16 @@ rrc_gNB_modify_dedicatedRRCReconfiguration(
|
||||
ctxt_pP->module_id,
|
||||
DCCH);
|
||||
|
||||
nr_rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
|
||||
if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
uint32_t delay_ms = ue_p->masterCellGroup && ue_p->masterCellGroup->spCellConfig && ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated
|
||||
&& ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList
|
||||
? NR_RRC_RECONFIGURATION_DELAY_MS + NR_RRC_BWP_SWITCHING_DELAY_MS
|
||||
: NR_RRC_RECONFIGURATION_DELAY_MS;
|
||||
|
||||
nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, ue_p->rnti, *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, delay_ms);
|
||||
nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, ue_p->rnti, *rrc->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, delay_ms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1035,22 +1013,17 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
|
||||
rrc_gNB_mui,
|
||||
ctxt_pP->module_id,
|
||||
DCCH);
|
||||
nr_rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
|
||||
if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
uint32_t delay_ms = ue_p->masterCellGroup && ue_p->masterCellGroup->spCellConfig && ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated
|
||||
&& ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList
|
||||
? NR_RRC_RECONFIGURATION_DELAY_MS + NR_RRC_BWP_SWITCHING_DELAY_MS
|
||||
: NR_RRC_RECONFIGURATION_DELAY_MS;
|
||||
|
||||
nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, ue_p->rnti, *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, delay_ms);
|
||||
nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, ue_p->rnti, *rrc->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, delay_ms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1289,20 +1262,21 @@ void rrc_gNB_generate_RRCReestablishment(const protocol_ctxt_t *ctxt_pP,
|
||||
} // if (*SRB_configList != NULL)
|
||||
|
||||
LOG_I(NR_RRC, "Set PDCP security RNTI %04lx nca %ld nia %d in RRCReestablishment\n", ctxt_pP->rntiMaybeUEid, ue_p->ciphering_algorithm, ue_p->integrity_algorithm);
|
||||
pdcp_config_set_security(ctxt_pP,
|
||||
NULL, /* pdcp_pP not used anymore in NR */
|
||||
DCCH,
|
||||
DCCH + 2,
|
||||
enable_ciphering ? ue_p->ciphering_algorithm | (ue_p->integrity_algorithm << 4) : 0 | (ue_p->integrity_algorithm << 4),
|
||||
kRRCenc,
|
||||
kRRCint,
|
||||
kUPenc);
|
||||
uint8_t security_mode =
|
||||
enable_ciphering ? ue_p->ciphering_algorithm | (ue_p->integrity_algorithm << 4) : 0 | (ue_p->integrity_algorithm << 4);
|
||||
|
||||
nr_pdcp_config_set_security(ctxt_pP->rntiMaybeUEid,
|
||||
DCCH,
|
||||
security_mode,
|
||||
kRRCenc,
|
||||
kRRCint,
|
||||
kUPenc);
|
||||
|
||||
if (!NODE_IS_CU(rrc->node_type)) {
|
||||
apply_macrlc_config_reest(rrc, ue_context_pP, ctxt_pP, ctxt_pP->rntiMaybeUEid);
|
||||
}
|
||||
|
||||
nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -1515,7 +1489,7 @@ cellGroupConfig->physicalCellGroupConfig = ue_p->masterCellGroup->physicalCellGr
|
||||
DCCH);
|
||||
|
||||
nr_mac_update_cellgroup(RC.nrmac[rrc->module_id], ue_context_pP->ue_context.rnti, cellGroupConfig);
|
||||
nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
}
|
||||
|
||||
if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
|
||||
@@ -1566,21 +1540,16 @@ int nr_rrc_reconfiguration_req(rrc_gNB_ue_context_t *const ue_context_pP
|
||||
|
||||
nr_mac_update_cellgroup(RC.nrmac[ctxt_pP->module_id], ue_context_pP->ue_context.rnti, masterCellGroup);
|
||||
|
||||
nr_rrc_data_req(ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
|
||||
if (NODE_IS_DU(RC.nrrrc[ctxt_pP->module_id]->node_type) || NODE_IS_MONOLITHIC(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
|
||||
if (NODE_IS_DU(rrc->node_type) || NODE_IS_MONOLITHIC(rrc->node_type)) {
|
||||
uint32_t delay_ms = ue_p->masterCellGroup && ue_p->masterCellGroup->spCellConfig && ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated
|
||||
&& ue_p->masterCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList
|
||||
? NR_RRC_RECONFIGURATION_DELAY_MS + NR_RRC_BWP_SWITCHING_DELAY_MS
|
||||
: NR_RRC_RECONFIGURATION_DELAY_MS;
|
||||
|
||||
nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, ue_p->rnti, *RC.nrrrc[ctxt_pP->module_id]->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, delay_ms);
|
||||
nr_mac_enable_ue_rrc_processing_timer(ctxt_pP->module_id, ue_p->rnti, *rrc->carrier.servingcellconfigcommon->ssbSubcarrierSpacing, delay_ms);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -3225,7 +3194,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[ctxt_pP->module_id]; // WHAT A BEAUTIFULL RACE CONDITION !!!
|
||||
mac_remove_nr_ue(nrmac, UE->rnti);
|
||||
rrc_rlc_remove_ue(ctxt_pP);
|
||||
pdcp_remove_UE(ctxt_pP);
|
||||
nr_pdcp_remove_UE(ctxt_pP->rntiMaybeUEid);
|
||||
|
||||
/* remove RRC UE Context */
|
||||
ue_context_p = rrc_gNB_get_ue_context_by_rnti(rrc, UE->rnti);
|
||||
@@ -3262,7 +3231,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
mac_remove_nr_ue(nrmac, UE->rnti);
|
||||
}
|
||||
rrc_rlc_remove_ue(ctxt_pP);
|
||||
pdcp_remove_UE(ctxt_pP);
|
||||
nr_pdcp_remove_UE(ctxt_pP->rntiMaybeUEid);
|
||||
newGtpuDeleteAllTunnels(ctxt_pP->instance, UE->rnti);
|
||||
|
||||
/* remove RRC UE Context */
|
||||
@@ -3623,7 +3592,7 @@ rrc_gNB_generate_SecurityModeCommand(
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
|
||||
|
||||
nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3649,7 +3618,7 @@ rrc_gNB_generate_UECapabilityEnquiry(
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
AssertFatal(!NODE_IS_DU(rrc->node_type), "illegal node type DU!\n");
|
||||
|
||||
nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -3683,7 +3652,8 @@ rrc_gNB_generate_RRCRelease(
|
||||
rrc_gNB_mui,
|
||||
DCCH);
|
||||
|
||||
nr_rrc_data_req(ctxt_pP, DCCH, rrc_gNB_mui++, SDU_CONFIRM_NO, size, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
gNB_RRC_INST *rrc = RC.nrrrc[ctxt_pP->module_id];
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, rrc_gNB_mui++, size, buffer, deliver_pdu_srb_f1, rrc);
|
||||
|
||||
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(ctxt_pP->instance, ue_context_pP->ue_context.gNB_ue_ngap_id);
|
||||
ue_context_pP->ue_context.ue_release_timer_rrc = 1;
|
||||
@@ -3697,7 +3667,7 @@ rrc_gNB_generate_RRCRelease(
|
||||
ue_context_pP->ue_context.ue_release_timer_thres_rrc = 5;
|
||||
LOG_I(RRC, "delaying UE %ld context removal by 5ms\n", ctxt_pP->rntiMaybeUEid);
|
||||
|
||||
if (NODE_IS_CU(RC.nrrrc[ctxt_pP->module_id]->node_type)) {
|
||||
if (NODE_IS_CU(rrc->node_type)) {
|
||||
uint8_t *message_buffer = itti_malloc (TASK_RRC_GNB, TASK_CU_F1, size);
|
||||
memcpy (message_buffer, buffer, size);
|
||||
MessageDef *m = itti_alloc_new_message(TASK_RRC_GNB, 0, F1AP_UE_CONTEXT_RELEASE_CMD);
|
||||
|
||||
@@ -36,8 +36,9 @@
|
||||
|
||||
#include "oai_asn1.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
#include "pdcp_primitives.h"
|
||||
#include "SDAP/nr_sdap/nr_sdap.h"
|
||||
|
||||
#include "openair3/ocp-gtpu/gtp_itf.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
@@ -153,14 +154,9 @@ nr_rrc_pdcp_config_security(
|
||||
}
|
||||
}
|
||||
|
||||
pdcp_config_set_security(ctxt_pP,
|
||||
NULL, /* pdcp_pP not used anymore in NR */
|
||||
DCCH,
|
||||
DCCH + 2,
|
||||
enable_ciphering ? UE->ciphering_algorithm | (UE->integrity_algorithm << 4) : 0 | (UE->integrity_algorithm << 4),
|
||||
kRRCenc,
|
||||
kRRCint,
|
||||
kUPenc);
|
||||
uint8_t security_mode =
|
||||
enable_ciphering ? UE->ciphering_algorithm | (UE->integrity_algorithm << 4) : 0 | (UE->integrity_algorithm << 4);
|
||||
nr_pdcp_config_set_security(ctxt_pP->rntiMaybeUEid, DCCH, security_mode, kRRCenc, kRRCint, kUPenc);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -396,7 +392,7 @@ int rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, instance_t
|
||||
}
|
||||
create_tunnel_req.ue_id = UE->rnti;
|
||||
gtpv1u_gnb_create_tunnel_resp_t create_tunnel_resp = {0};
|
||||
int ret = gtpv1u_create_ngu_tunnel(instance, &create_tunnel_req, &create_tunnel_resp);
|
||||
int ret = gtpv1u_create_ngu_tunnel(instance, &create_tunnel_req, &create_tunnel_resp, nr_pdcp_data_req_drb, sdap_data_req);
|
||||
if (ret != 0) {
|
||||
LOG_E(NR_RRC, "rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ : gtpv1u_create_ngu_tunnel failed,start to release UE %x\n", UE->rnti);
|
||||
UE->ue_release_timer_ng = 1;
|
||||
@@ -625,7 +621,7 @@ int rrc_gNB_process_NGAP_DOWNLINK_NAS(MessageDef *msg_p, instance_t instance, mu
|
||||
AssertFatal(!NODE_IS_DU(RC.nrrrc[ctxt.module_id]->node_type), "illegal node type DU: receiving NGAP messages at this node\n");
|
||||
/* Transfer data to PDCP */
|
||||
rb_id_t srb_id = UE->Srb[2].Active ? DCCH1 : DCCH;
|
||||
nr_rrc_data_req(&ctxt, srb_id, (*rrc_gNB_mui)++, SDU_CONFIRM_NO, length, buffer, PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt.rntiMaybeUEid, srb_id, (*rrc_gNB_mui)++, length, buffer, deliver_pdu_srb_f1, RC.nrrrc[instance]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
|
||||
void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info)
|
||||
{
|
||||
@@ -282,10 +282,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc, rrc_gNB_ue_context_t *ue_context_p, x2a
|
||||
memset(&create_tunnel_resp, 0, sizeof(create_tunnel_resp));
|
||||
if (!IS_SOFTMODEM_NOS1) {
|
||||
LOG_D(RRC, "Calling gtpv1u_create_s1u_tunnel()\n");
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
ctxt.instance,
|
||||
&create_tunnel_req,
|
||||
&create_tunnel_resp);
|
||||
gtpv1u_create_s1u_tunnel(ctxt.instance, &create_tunnel_req, &create_tunnel_resp, nr_pdcp_data_req_drb);
|
||||
rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
&ctxt,
|
||||
&create_tunnel_resp,
|
||||
@@ -391,7 +388,7 @@ void rrc_remove_nsa_user(gNB_RRC_INST *rrc, int rnti) {
|
||||
return;
|
||||
}
|
||||
|
||||
pdcp_remove_UE(&ctxt);
|
||||
nr_pdcp_remove_UE(ctxt.rntiMaybeUEid);
|
||||
|
||||
rrc_rlc_remove_ue(&ctxt);
|
||||
|
||||
|
||||
@@ -149,43 +149,6 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
rrc_data_req_nr_ue(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
)
|
||||
{
|
||||
MessageDef *message_p;
|
||||
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
|
||||
uint8_t *message_buffer;
|
||||
message_buffer = itti_malloc (TASK_RRC_UE, TASK_PDCP_UE, sdu_sizeP);
|
||||
LOG_D(RRC,"Sending RRC message for SRB %ld, sdu_size %d\n",rb_idP, sdu_sizeP);
|
||||
memcpy (message_buffer, buffer_pP, sdu_sizeP);
|
||||
message_p = itti_alloc_new_message ( TASK_RRC_UE, 0, RRC_DCCH_DATA_REQ);
|
||||
RRC_DCCH_DATA_REQ (message_p).frame = ctxt_pP->frame;
|
||||
RRC_DCCH_DATA_REQ (message_p).enb_flag = ctxt_pP->enb_flag;
|
||||
RRC_DCCH_DATA_REQ (message_p).rb_id = rb_idP;
|
||||
RRC_DCCH_DATA_REQ (message_p).muip = muiP;
|
||||
RRC_DCCH_DATA_REQ (message_p).confirmp = confirmP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_size = sdu_sizeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).sdu_p = message_buffer;
|
||||
RRC_DCCH_DATA_REQ (message_p).mode = modeP;
|
||||
RRC_DCCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id;
|
||||
RRC_DCCH_DATA_REQ(message_p).rnti = ctxt_pP->rntiMaybeUEid;
|
||||
RRC_DCCH_DATA_REQ (message_p).eNB_index = ctxt_pP->eNB_index;
|
||||
itti_send_msg_to_task (
|
||||
TASK_PDCP_UE,
|
||||
ctxt_pP->instance,
|
||||
message_p);
|
||||
return true; // TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
|
||||
|
||||
}
|
||||
|
||||
int8_t nr_rrc_RA_succeeded(const module_id_t mod_id, const uint8_t gNB_index)
|
||||
{
|
||||
if (NR_UE_rrc_inst[mod_id].Info[gNB_index].T304_active == 1) {
|
||||
@@ -194,4 +157,4 @@ int8_t nr_rrc_RA_succeeded(const module_id_t mod_id, const uint8_t gNB_index)
|
||||
NR_UE_rrc_inst[mod_id].Info[gNB_index].T304_cnt = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
+10
-62
@@ -58,7 +58,7 @@
|
||||
#include "nr-uesoftmodem.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "plmn_data.h"
|
||||
#include "pdcp.h"
|
||||
#include "nr_pdcp/nr_pdcp_oai_api.h"
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
@@ -90,17 +90,6 @@ static const char nr_nas_attach_req_imsi[] = {
|
||||
0x01, 0x27, 0x11,
|
||||
};
|
||||
|
||||
extern void pdcp_config_set_security(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
pdcp_t *const pdcp_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const uint16_t lc_idP,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc
|
||||
);
|
||||
|
||||
void
|
||||
nr_rrc_ue_process_ueCapabilityEnquiry(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
@@ -1426,14 +1415,7 @@ static void rrc_ue_generate_RRCSetupComplete(
|
||||
//for (int i=0;i<size;i++) printf("%02x ",buffer[i]);
|
||||
//printf("\n");
|
||||
|
||||
// ctxt_pP_local.rnti = ctxt_pP->rnti;
|
||||
rrc_data_req_nr_ue(ctxt_pP,
|
||||
DCCH,
|
||||
nr_rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, nr_rrc_mui++, size, buffer, deliver_pdu_srb_rlc, NULL);
|
||||
}
|
||||
|
||||
int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB_INFO *const Srb_info, const uint8_t gNB_index ){
|
||||
@@ -1704,10 +1686,9 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
|
||||
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[28], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[29], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[30], NR_UE_rrc_inst[ctxt_pP->module_id].kgnb[31]);
|
||||
|
||||
if (securityMode != 0xff) {
|
||||
pdcp_config_set_security(ctxt_pP, NULL, DCCH, DCCH+2,
|
||||
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm
|
||||
| (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4),
|
||||
kRRCenc, kRRCint, kUPenc);
|
||||
uint8_t security_mode =
|
||||
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm | (NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4);
|
||||
nr_pdcp_config_set_security(ctxt_pP->rntiMaybeUEid, DCCH, security_mode, kRRCenc, kRRCint, kUPenc);
|
||||
} else {
|
||||
LOG_I(NR_RRC, "skipped pdcp_config_set_security() as securityMode == 0x%02x", securityMode);
|
||||
}
|
||||
@@ -1739,13 +1720,7 @@ int8_t nr_rrc_ue_decode_ccch( const protocol_ctxt_t *const ctxt_pP, const NR_SRB
|
||||
}
|
||||
|
||||
LOG_T(NR_RRC, "\n");
|
||||
rrc_data_req_nr_ue (ctxt_pP,
|
||||
DCCH,
|
||||
nr_rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
(enc_rval.encoded + 7) / 8,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, nr_rrc_mui++, (enc_rval.encoded + 7) / 8, buffer, deliver_pdu_srb_rlc, NULL);
|
||||
} else
|
||||
LOG_W(NR_RRC,"securityModeCommand->criticalExtensions.present (%d) != NR_SecurityModeCommand__criticalExtensions_PR_securityModeCommand\n",
|
||||
securityModeCommand->criticalExtensions.present);
|
||||
@@ -2231,14 +2206,7 @@ nr_rrc_ue_establish_srb2(
|
||||
nr_rrc_mui,
|
||||
UE_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id),
|
||||
DCCH);
|
||||
rrc_data_req_nr_ue (
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
nr_rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
size,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, nr_rrc_mui++, size, buffer, deliver_pdu_srb_rlc, NULL);
|
||||
}
|
||||
|
||||
// from NR SRB1
|
||||
@@ -2485,21 +2453,8 @@ nr_rrc_ue_establish_srb2(
|
||||
/* Transfer data to PDCP */
|
||||
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, GNB_FLAG_NO, NR_UE_rrc_inst[ue_mod_id].Info[0].rnti, 0, 0,0);
|
||||
// check if SRB2 is created, if yes request data_req on DCCH1 (SRB2)
|
||||
if(NR_UE_rrc_inst[ue_mod_id].SRB2_config[0] == NULL) {
|
||||
rrc_data_req_nr_ue (&ctxt,
|
||||
DCCH,
|
||||
nr_rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
length, buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
} else {
|
||||
rrc_data_req_nr_ue (&ctxt,
|
||||
DCCH1,
|
||||
nr_rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
length, buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
}
|
||||
rb_id_t srb_id = NR_UE_rrc_inst[ue_mod_id].SRB2_config[0] == NULL ? DCCH : DCCH1;
|
||||
nr_pdcp_data_req_srb(ctxt.rntiMaybeUEid, srb_id, nr_rrc_mui++, length, buffer, deliver_pdu_srb_rlc, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2643,14 +2598,7 @@ nr_rrc_ue_process_ueCapabilityEnquiry(
|
||||
}
|
||||
|
||||
LOG_I(NR_RRC, "UECapabilityInformation Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
|
||||
rrc_data_req_nr_ue (
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
nr_rrc_mui++,
|
||||
SDU_CONFIRM_NO,
|
||||
(enc_rval.encoded + 7) / 8,
|
||||
buffer,
|
||||
PDCP_TRANSMISSION_MODE_CONTROL);
|
||||
nr_pdcp_data_req_srb(ctxt_pP->rntiMaybeUEid, DCCH, nr_rrc_mui++, (enc_rval.encoded + 7) / 8, buffer, deliver_pdu_srb_rlc, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,17 +145,6 @@ int8_t nr_mac_rrc_data_req_ue(const module_id_t Mod_idP,
|
||||
const rb_id_t Srb_id,
|
||||
uint8_t *buffer_pP);
|
||||
|
||||
uint8_t
|
||||
rrc_data_req_nr_ue(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t rb_idP,
|
||||
const mui_t muiP,
|
||||
const confirm_t confirmP,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
uint8_t *const buffer_pP,
|
||||
const pdcp_transmission_mode_t modeP
|
||||
);
|
||||
|
||||
int8_t nr_rrc_RA_succeeded(const module_id_t mod_id, const uint8_t gNB_index);
|
||||
|
||||
/**\brief RRC UE task.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include "nr_sdap_entity.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include <openair2/LAYER2/PDCP_v10.1.0/pdcp.h>
|
||||
#include <openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "openair2/LAYER2/nr_pdcp/nr_pdcp_ue_manager.h"
|
||||
|
||||
@@ -37,15 +37,20 @@ static nr_sdap_entity_info sdap_info;
|
||||
|
||||
instance_t *N3GTPUInst = NULL;
|
||||
|
||||
nr_pdcp_ue_manager_t *nr_pdcp_sdap_get_ue_manager(void);
|
||||
|
||||
void nr_pdcp_submit_sdap_ctrl_pdu(ue_id_t ue_id, rb_id_t sdap_ctrl_pdu_drb, nr_sdap_ul_hdr_t ctrl_pdu)
|
||||
{
|
||||
nr_pdcp_ue_t *ue;
|
||||
nr_pdcp_ue_manager_t *nr_pdcp_ue_manager;
|
||||
nr_pdcp_ue_manager = nr_pdcp_sdap_get_ue_manager();
|
||||
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, ue_id);
|
||||
ue->drb[sdap_ctrl_pdu_drb-1]->recv_sdu(ue->drb[sdap_ctrl_pdu_drb-1], (char*)&ctrl_pdu, SDAP_HDR_LENGTH, RLC_MUI_UNDEFINED);
|
||||
|
||||
protocol_ctxt_t ctxt = { .rntiMaybeUEid = ue_id };
|
||||
nr_pdcp_data_req_drb(&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
sdap_ctrl_pdu_drb,
|
||||
RLC_MUI_UNDEFINED,
|
||||
SDU_CONFIRM_NO,
|
||||
SDAP_HDR_LENGTH,
|
||||
(unsigned char *)&ctrl_pdu,
|
||||
PDCP_TRANSMISSION_MODE_UNKNOWN,
|
||||
NULL,
|
||||
NULL);
|
||||
LOG_D(SDAP, "Control PDU - Submitting Control PDU to DRB ID: %ld\n", sdap_ctrl_pdu_drb);
|
||||
LOG_D(SDAP, "QFI: %u\n R: %u\n D/C: %u\n", ctrl_pdu.QFI, ctrl_pdu.R, ctrl_pdu.DC);
|
||||
return;
|
||||
@@ -87,16 +92,16 @@ static bool nr_sdap_tx_entity(nr_sdap_entity_t *entity,
|
||||
|
||||
if(!pdcp_ent_has_sdap){
|
||||
LOG_D(SDAP, "TX - DRB ID: %ld does not have SDAP\n", entity->qfi2drb_table[qfi].drb_id);
|
||||
ret = pdcp_data_req(ctxt_p,
|
||||
srb_flag,
|
||||
sdap_drb_id,
|
||||
mui,
|
||||
confirm,
|
||||
sdu_buffer_size,
|
||||
sdu_buffer,
|
||||
pt_mode,
|
||||
sourceL2Id,
|
||||
destinationL2Id);
|
||||
ret = nr_pdcp_data_req_drb(ctxt_p,
|
||||
srb_flag,
|
||||
sdap_drb_id,
|
||||
mui,
|
||||
confirm,
|
||||
sdu_buffer_size,
|
||||
sdu_buffer,
|
||||
pt_mode,
|
||||
sourceL2Id,
|
||||
destinationL2Id);
|
||||
|
||||
if(!ret)
|
||||
LOG_E(SDAP, "%s:%d:%s: PDCP refused PDU\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
@@ -155,16 +160,16 @@ static bool nr_sdap_tx_entity(nr_sdap_entity_t *entity,
|
||||
*
|
||||
* Downlink gNB side
|
||||
*/
|
||||
ret = pdcp_data_req(ctxt_p,
|
||||
srb_flag,
|
||||
sdap_drb_id,
|
||||
mui,
|
||||
confirm,
|
||||
sdu_buffer_size+offset,
|
||||
sdap_buf,
|
||||
pt_mode,
|
||||
sourceL2Id,
|
||||
destinationL2Id);
|
||||
ret = nr_pdcp_data_req_drb(ctxt_p,
|
||||
srb_flag,
|
||||
sdap_drb_id,
|
||||
mui,
|
||||
confirm,
|
||||
sdu_buffer_size + offset,
|
||||
sdap_buf,
|
||||
pt_mode,
|
||||
sourceL2Id,
|
||||
destinationL2Id);
|
||||
|
||||
if(!ret)
|
||||
LOG_E(SDAP, "%s:%d:%s: PDCP refused PDU\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
|
||||
@@ -17,6 +17,7 @@ extern "C" {
|
||||
#include <openair2/COMMON/gtpv1_u_messages_types.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include <openair2/LAYER2/PDCP_v10.1.0/pdcp.h>
|
||||
#include <openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.h>
|
||||
#include <openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h>
|
||||
#include "openair2/SDAP/nr_sdap/nr_sdap.h"
|
||||
#include "sim.h"
|
||||
@@ -647,7 +648,9 @@ teid_t newGtpuCreateTunnel(instance_t instance,
|
||||
|
||||
int gtpv1u_create_s1u_tunnel(instance_t instance,
|
||||
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp) {
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp,
|
||||
gtpCallback callBack)
|
||||
{
|
||||
LOG_D(GTPU, "[%ld] Start create tunnels for UE ID %u, num_tunnels %d, sgw_S1u_teid %x\n",
|
||||
instance,
|
||||
create_tunnel_req->rnti,
|
||||
@@ -674,7 +677,7 @@ int gtpv1u_create_s1u_tunnel(instance_t instance,
|
||||
-1, // no pdu session in 4G
|
||||
create_tunnel_req->sgw_addr[i],
|
||||
dstport,
|
||||
pdcp_data_req,
|
||||
callBack,
|
||||
NULL);
|
||||
create_tunnel_resp->status=0;
|
||||
create_tunnel_resp->rnti=create_tunnel_req->rnti;
|
||||
@@ -711,10 +714,10 @@ int gtpv1u_update_s1u_tunnel(
|
||||
auto it=inst->ue2te_mapping.find(prior_rnti);
|
||||
|
||||
if ( it != inst->ue2te_mapping.end() ) {
|
||||
LOG_W(GTPU,"[%ld] Update a not existing tunnel, start create the new one (new ue id %u, old ue id %u)\n", instance, create_tunnel_req->rnti, prior_rnti);
|
||||
pthread_mutex_unlock(&globGtp.gtp_lock);
|
||||
gtpv1u_enb_create_tunnel_resp_t tmp;
|
||||
(void)gtpv1u_create_s1u_tunnel(instance, create_tunnel_req, &tmp);
|
||||
AssertFatal(false, "logic bug: update of non-existing tunnel (new ue id %u, old ue id %u)\n", create_tunnel_req->rnti, prior_rnti);
|
||||
/* we don't know if we need 4G or 5G PDCP and can therefore not create a
|
||||
* new tunnel */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -724,9 +727,12 @@ int gtpv1u_update_s1u_tunnel(
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gtpv1u_create_ngu_tunnel( const instance_t instance,
|
||||
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req,
|
||||
gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp) {
|
||||
int gtpv1u_create_ngu_tunnel(const instance_t instance,
|
||||
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req,
|
||||
gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp,
|
||||
gtpCallback callBack,
|
||||
gtpCallbackSDAP callBackSDAP)
|
||||
{
|
||||
LOG_D(GTPU, "[%ld] Start create tunnels for ue id %lu, num_tunnels %d, sgw_S1u_teid %x\n",
|
||||
instance,
|
||||
create_tunnel_req->ue_id,
|
||||
@@ -748,8 +754,8 @@ int gtpv1u_create_ngu_tunnel( const instance_t instance,
|
||||
create_tunnel_req->outgoing_qfi[i],
|
||||
create_tunnel_req->dst_addr[i],
|
||||
dstport,
|
||||
pdcp_data_req,
|
||||
sdap_data_req);
|
||||
callBack,
|
||||
callBackSDAP);
|
||||
create_tunnel_resp->status=0;
|
||||
create_tunnel_resp->ue_id=create_tunnel_req->ue_id;
|
||||
create_tunnel_resp->num_tunnels=create_tunnel_req->num_tunnels;
|
||||
|
||||
@@ -51,8 +51,10 @@ extern "C" {
|
||||
// the parameter originInstance will be sent back in each message from gtp to the creator
|
||||
void gtpv1uReceiver(int h);
|
||||
void gtpv1uProcessTimeout(int handle,void *arg);
|
||||
int gtpv1u_create_s1u_tunnel(const instance_t instance, const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp);
|
||||
int gtpv1u_create_s1u_tunnel(const instance_t instance,
|
||||
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req,
|
||||
gtpv1u_enb_create_tunnel_resp_t *create_tunnel_resp,
|
||||
gtpCallback callBack);
|
||||
int gtpv1u_update_s1u_tunnel(const instance_t instanceP,
|
||||
const gtpv1u_enb_create_tunnel_req_t *create_tunnel_req_pP,
|
||||
const rnti_t prior_rnti
|
||||
@@ -66,12 +68,12 @@ extern "C" {
|
||||
|
||||
int gtpv1u_delete_x2u_tunnel( const instance_t instanceP,
|
||||
const gtpv1u_enb_delete_tunnel_req_t *const req_pP);
|
||||
int
|
||||
gtpv1u_create_ngu_tunnel(
|
||||
const instance_t instanceP,
|
||||
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP,
|
||||
gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp_pP);
|
||||
|
||||
int gtpv1u_create_ngu_tunnel(const instance_t instanceP,
|
||||
const gtpv1u_gnb_create_tunnel_req_t *const create_tunnel_req_pP,
|
||||
gtpv1u_gnb_create_tunnel_resp_t *const create_tunnel_resp_pP,
|
||||
gtpCallback callBack,
|
||||
gtpCallbackSDAP callBackSDAP);
|
||||
|
||||
int gtpv1u_delete_ngu_tunnel( const instance_t instance,
|
||||
gtpv1u_gnb_delete_tunnel_req_t *req);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user