Merge remote-tracking branch 'origin/develop' into NR_MIMO_memory
This commit is contained in:
@@ -19,18 +19,12 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
MESSAGE_DEF(GTPV1U_ENB_UPDATE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_update_tunnel_req_t, Gtpv1uUpdateTunnelReq)
|
||||
MESSAGE_DEF(GTPV1U_ENB_UPDATE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_update_tunnel_resp_t, Gtpv1uUpdateTunnelResp)
|
||||
MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_req_t, Gtpv1uDeleteTunnelReq)
|
||||
MESSAGE_DEF(GTPV1U_ENB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_enb_delete_tunnel_resp_t, Gtpv1uDeleteTunnelResp)
|
||||
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_ind_t, Gtpv1uTunnelDataInd)
|
||||
|
||||
MESSAGE_DEF(GTPV1U_ENB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_tunnel_data_req_t, Gtpv1uTunnelDataReq)
|
||||
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_req_t,Gtpv1uDataForwardingReq)
|
||||
MESSAGE_DEF(GTPV1U_ENB_DATA_FORWARDING_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_data_forwarding_ind_t,Gtpv1uDataForwardingInd)
|
||||
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_REQ, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_req_t, Gtpv1uEndMarkerReq)
|
||||
MESSAGE_DEF(GTPV1U_ENB_END_MARKER_IND, MESSAGE_PRIORITY_MED, gtpv1u_enb_end_marker_ind_t, Gtpv1uEndMarkerInd)
|
||||
MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq)
|
||||
MESSAGE_DEF(GTPV1U_REQ, MESSAGE_PRIORITY_MED, Gtpv1uReq, gtpv1uReq)
|
||||
|
||||
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_req_t, NRGtpv1uDeleteTunnelReq)
|
||||
MESSAGE_DEF(GTPV1U_GNB_DELETE_TUNNEL_RESP, MESSAGE_PRIORITY_MED, gtpv1u_gnb_delete_tunnel_resp_t, NRGtpv1uDeleteTunnelResp)
|
||||
MESSAGE_DEF(GTPV1U_GNB_TUNNEL_DATA_REQ, MESSAGE_PRIORITY_MED, gtpv1u_gnb_tunnel_data_req_t, NRGtpv1uTunnelDataReq)
|
||||
|
||||
@@ -28,10 +28,6 @@
|
||||
#define GTPV1U_MAX_BEARERS_PER_UE max_val_LTE_DRB_Identity
|
||||
#define NR_GTPV1U_MAX_BEARERS_PER_UE max_val_NR_DRB_Identity
|
||||
|
||||
#define GTPV1U_ENB_UPDATE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelReq
|
||||
#define GTPV1U_ENB_UPDATE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uUpdateTunnelResp
|
||||
#define GTPV1U_ENB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelReq
|
||||
#define GTPV1U_ENB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDeleteTunnelResp
|
||||
#define GTPV1U_ENB_TUNNEL_DATA_IND(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataInd
|
||||
#define GTPV1U_ENB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uTunnelDataReq
|
||||
#define GTPV1U_ENB_DATA_FORWARDING_REQ(mSGpTR) (mSGpTR)->ittiMsg.Gtpv1uDataForwardingReq
|
||||
@@ -41,8 +37,6 @@
|
||||
|
||||
#define GTPV1U_REQ(mSGpTR) (mSGpTR)->ittiMsg.gtpv1uReq
|
||||
|
||||
#define GTPV1U_GNB_DELETE_TUNNEL_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelReq
|
||||
#define GTPV1U_GNB_DELETE_TUNNEL_RESP(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uDeleteTunnelResp
|
||||
#define GTPV1U_GNB_TUNNEL_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.NRGtpv1uTunnelDataReq
|
||||
|
||||
#define GTPV1U_ALL_TUNNELS_TEID (teid_t)0xFFFFFFFF
|
||||
@@ -200,7 +194,6 @@ typedef struct gtpv1u_gnb_create_tunnel_resp_s {
|
||||
pdusessionid_t pdusession_id[NR_GTPV1U_MAX_BEARERS_PER_UE];
|
||||
transport_layer_addr_t gnb_addr;
|
||||
} gtpv1u_gnb_create_tunnel_resp_t;
|
||||
|
||||
typedef struct gtpv1u_gnb_delete_tunnel_req_s {
|
||||
rnti_t rnti;
|
||||
uint8_t num_pdusession;
|
||||
@@ -212,7 +205,6 @@ typedef struct gtpv1u_gnb_delete_tunnel_resp_s {
|
||||
uint8_t status; ///< Status of NGU endpoint deleteion (Failed = 0xFF or Success = 0x0)
|
||||
teid_t gnb_NGu_teid; ///< local NGU Tunnel Endpoint Identifier to be deleted
|
||||
} gtpv1u_gnb_delete_tunnel_resp_t;
|
||||
|
||||
typedef struct gtpv1u_gnb_tunnel_data_req_s {
|
||||
uint8_t *buffer;
|
||||
uint32_t length;
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "RRC_config_tools.h"
|
||||
#include "enb_paramdef.h"
|
||||
#include "proto_agent.h"
|
||||
#include "executables/thread-common.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
@@ -2080,7 +2079,7 @@ int RCconfig_gtpu(void ) {
|
||||
GTPV1U_REQ(message).localPort = enb_port_for_S1U;
|
||||
strcpy(GTPV1U_REQ(message).localAddrStr,address);
|
||||
sprintf(GTPV1U_REQ(message).localPortStr,"%d", enb_port_for_S1U);
|
||||
itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
} else
|
||||
LOG_E(GTPU,"invalid address for S1U\n");
|
||||
|
||||
|
||||
@@ -357,7 +357,6 @@
|
||||
#include <arpa/inet.h>
|
||||
#include "T.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "msc.h"
|
||||
|
||||
/* Checking version of ASN1C compiler */
|
||||
#if (ASN1C_ENVIRONMENT_VERSION < ASN1C_MINIMUM_VERSION)
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "f1ap_cu_rrc_message_transfer.h"
|
||||
#include "f1ap_cu_ue_context_management.h"
|
||||
#include "f1ap_cu_task.h"
|
||||
#include "proto_agent.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
|
||||
@@ -47,7 +46,7 @@ static instance_t cu_task_create_gtpu_instance_to_du(eth_params_t *IPaddrs) {
|
||||
strncpy(tmp.destinationHost, IPaddrs->remote_addr, sizeof(tmp.destinationHost)-1);
|
||||
sprintf(tmp.originService, "%d", IPaddrs->my_portd);
|
||||
sprintf(tmp.destinationService, "%d", IPaddrs->remote_portd);
|
||||
return ocp_gtpv1Init(tmp);
|
||||
return gtpv1Init(tmp);
|
||||
}
|
||||
|
||||
static void cu_task_handle_sctp_association_ind(instance_t instance, sctp_new_association_ind_t *sctp_new_association_ind,
|
||||
|
||||
@@ -481,14 +481,6 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
|
||||
for (int i=0; i<num_cells_to_activate; i++)
|
||||
AssertFatal(F1AP_SETUP_RESP (msg_p).cells_to_activate[i].num_SI > 0, "System Information %d is missing",i);
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_F1AP_DU,
|
||||
MSC_F1AP_CU,
|
||||
0,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DU_handle_F1_SETUP_RESPONSE successfulOutcome assoc_id %d",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
assoc_id);
|
||||
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message\n");
|
||||
itti_send_msg_to_task(TASK_F1APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
|
||||
return 0;
|
||||
@@ -910,14 +902,6 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
|
||||
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
|
||||
LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate);
|
||||
F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).num_cells_to_activate = num_cells_to_activate;
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_F1AP_DU,
|
||||
MSC_F1AP_CU,
|
||||
0,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DU_handle_GNB_CU_CONFIGURATION_UPDATE initiatingMessage assoc_id %d",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
assoc_id);
|
||||
LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message \n");
|
||||
itti_send_msg_to_task(TASK_F1APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
|
||||
return 0;
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "f1ap_du_ue_context_management.h"
|
||||
#include "f1ap_du_rrc_message_transfer.h"
|
||||
#include "f1ap_du_task.h"
|
||||
#include "proto_agent.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
//Fixme: Uniq dirty DU instance, by global var, datamodel need better management
|
||||
@@ -103,7 +102,7 @@ static instance_t du_create_gtpu_instance_to_cu(char *CUaddr, uint16_t CUport, c
|
||||
strncpy(tmp.destinationHost, CUaddr, sizeof(tmp.destinationHost)-1);
|
||||
sprintf(tmp.originService, "%d", DUport);
|
||||
sprintf(tmp.destinationService, "%d", CUport);
|
||||
return ocp_gtpv1Init(tmp);
|
||||
return gtpv1Init(tmp);
|
||||
}
|
||||
|
||||
void *F1AP_DU_task(void *arg) {
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#include <stdio.h>
|
||||
#include <nr_pdcp/nr_pdcp.h>
|
||||
#include <softmodem-common.h>
|
||||
#include <nr-softmodem.h>
|
||||
#include <split_headers.h>
|
||||
#include <proto_agent.h>
|
||||
|
||||
#include "gnb_app.h"
|
||||
#include "gnb_config.h"
|
||||
@@ -135,34 +135,6 @@ static uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end)
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
static void init_pdcp(void) {
|
||||
if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) {
|
||||
pdcp_layer_init();
|
||||
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
|
||||
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
|
||||
if (IS_SOFTMODEM_NOS1) {
|
||||
LOG_I(PDCP, "IS_SOFTMODEM_NOS1 option enabled\n");
|
||||
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
|
||||
}
|
||||
|
||||
nr_pdcp_module_init(pdcp_initmask, 0);
|
||||
|
||||
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
|
||||
LOG_I(PDCP, "node is CU, pdcp send rlc_data_req by proto_agent \n");
|
||||
pdcp_set_rlc_data_req_func(proto_agent_send_rlc_data_req);
|
||||
} else {
|
||||
LOG_I(PDCP, "node is gNB \n");
|
||||
pdcp_set_rlc_data_req_func(rlc_data_req);
|
||||
pdcp_set_pdcp_data_ind_func(pdcp_data_ind);
|
||||
}
|
||||
} else {
|
||||
LOG_I(PDCP, "node is DU, rlc send pdcp_data_ind by proto_agent \n");
|
||||
pdcp_set_pdcp_data_ind_func(proto_agent_send_pdcp_data_ind);
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
void *gNB_app_task(void *args_p)
|
||||
{
|
||||
|
||||
|
||||
@@ -1227,7 +1227,7 @@ int RCconfig_nr_gtpu(void ) {
|
||||
GTPV1U_REQ(message).localPort = port;
|
||||
strcpy(GTPV1U_REQ(message).localAddrStr,address);
|
||||
sprintf(GTPV1U_REQ(message).localPortStr,"%d", port);
|
||||
itti_send_msg_to_task (TASK_VARIABLE, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
} else
|
||||
LOG_E(GTPU,"invalid address for NGU or S1U\n");
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
#include "assertions.h"
|
||||
#include "platform_types.h"
|
||||
#include "msc.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
@@ -1421,8 +1420,6 @@ cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
rnti_t rnti) {
|
||||
unsigned char i;
|
||||
RA_t *ra = (RA_t *) & RC.mac[module_idP]->common_channels[CC_id].ra[0];
|
||||
MSC_LOG_EVENT(MSC_PHY_ENB, "RA Cancelling procedure ue %" PRIx16 " ",
|
||||
rnti);
|
||||
LOG_D(MAC,
|
||||
"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",
|
||||
module_idP, CC_id, frameP, rnti);
|
||||
|
||||
@@ -216,7 +216,6 @@ void mac_init_cell_params(int Mod_idP, int CC_idP)
|
||||
int j;
|
||||
UE_TEMPLATE *UE_template;
|
||||
|
||||
LOG_D(MAC, "[MSC_NEW][FRAME 00000][MAC_eNB][MOD %02d][]\n", Mod_idP);
|
||||
//COMMON_channels_t *cc = &RC.mac[Mod_idP]->common_channels[CC_idP];
|
||||
|
||||
memset(&RC.mac[Mod_idP]->eNB_stats, 0, sizeof(eNB_STATS));
|
||||
|
||||
@@ -348,7 +348,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
|
||||
Size16 = (uint16_t) Size;
|
||||
// LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",module_idP,frameP,Size);
|
||||
LOG_I(RRC,
|
||||
"[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n",
|
||||
"[FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n",
|
||||
frameP, module_idP, eNB_indexP, module_idP);
|
||||
LOG_I(MAC,
|
||||
"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",
|
||||
|
||||
@@ -2328,11 +2328,6 @@ static inline uint8_t get_table_idx(uint8_t mcs_table, uint8_t dci_format, uint8
|
||||
}
|
||||
|
||||
|
||||
/* returns the total DMRS symbols in a slot*/
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype){
|
||||
return get_num_dmrs(fill_dmrs_mask(pdsch_Config,dmrs_TypeA_Position,NrOfSymbols, startSymbol, mappingtype));
|
||||
}
|
||||
|
||||
// Table 5.1.2.2.1-1 38.214
|
||||
uint8_t getRBGSize(uint16_t bwp_size, long rbg_size_config) {
|
||||
|
||||
@@ -3115,9 +3110,9 @@ int is_nr_UL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon, sl
|
||||
else return(slot_in_period >= slots1+tdd_UL_DL_ConfigurationCommon->pattern2->nrofDownlinkSlots ? 1 : 0);
|
||||
}
|
||||
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI) {
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols, int startSymbol, int mappingtype_fromDCI, int length) {
|
||||
|
||||
int l0;int dmrs_AdditionalPosition = 0;int maxLength = 0;
|
||||
int l0;int dmrs_AdditionalPosition = 0;
|
||||
NR_DMRS_DownlinkConfig_t *dmrs_config = NULL;
|
||||
|
||||
LOG_D(MAC, "NrofSymbols:%d, startSymbol:%d, mappingtype:%d, dmrs_TypeA_Position:%d\n", NrOfSymbols, startSymbol, mappingtype_fromDCI, dmrs_TypeA_Position);
|
||||
@@ -3129,7 +3124,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
||||
// in case of DCI FORMAT 1_0 or dedicated pdsch config not received additionposition = pos2, len1 should be used
|
||||
// referred to section 5.1.6.2 in 38.214
|
||||
dmrs_AdditionalPosition = 2;
|
||||
maxLength = 1;
|
||||
|
||||
if (pdsch_Config != NULL) {
|
||||
if (mappingtype_fromDCI == typeA) { // Type A
|
||||
@@ -3144,8 +3138,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
||||
|
||||
AssertFatal(dmrs_config != NULL," DMRS configs not present in PDSCH DMRS Downlink config\n");
|
||||
|
||||
// default values of maxlength = len2, additionalposition is pos2
|
||||
if (dmrs_config->maxLength != NULL) maxLength = 2;
|
||||
// default values of additionalposition is pos2
|
||||
if (dmrs_config->dmrs_AdditionalPosition != NULL) dmrs_AdditionalPosition = *dmrs_config->dmrs_AdditionalPosition;
|
||||
}
|
||||
|
||||
@@ -3160,11 +3153,6 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
||||
// For TypeB, ld is the duration of the scheduled PDSCH resources
|
||||
ld = (mappingtype_fromDCI == typeA) ? (NrOfSymbols + startSymbol) : NrOfSymbols;
|
||||
|
||||
// Section 7.4.1.1.2 in Spec 38.211
|
||||
//For PDSCH Mapping typeB, if PDSCH duration ld <=4, only single symbol DMRS is supported
|
||||
if (mappingtype_fromDCI == typeB && ld <= 4)
|
||||
maxLength = 1;
|
||||
|
||||
AssertFatal(ld > 2 && ld < 15,"Illegal NrOfSymbols according to Table 5.1.2.1-1 Spec 38.214 %d\n",ld);
|
||||
AssertFatal((NrOfSymbols + startSymbol) < 15,"Illegal S+L according to Table 5.1.2.1-1 Spec 38.214 S:%d L:%d\n",startSymbol, NrOfSymbols);
|
||||
|
||||
@@ -3181,7 +3169,8 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
||||
|
||||
}
|
||||
|
||||
if (maxLength == 1) {
|
||||
// number of front loaded symbols
|
||||
if (length == 1) {
|
||||
row = ld - 2;
|
||||
l_prime = table_7_4_1_1_2_3_pdsch_dmrs_positions_l[row][column];
|
||||
l0 = 1 << l0;
|
||||
@@ -3192,7 +3181,7 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
||||
l0 = 1<<l0 | 1<<(l0+1);
|
||||
}
|
||||
|
||||
LOG_D(MAC, "l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, column, dmrs_AdditionalPosition, maxLength);
|
||||
LOG_D(MAC, "l0:%d, ld:%d,row:%d, column:%d, addpos:%d, maxlen:%d\n", l0, ld, row, column, dmrs_AdditionalPosition, length);
|
||||
AssertFatal(l_prime>=0,"ERROR in configuration.Check Time Domain allocation of this Grant. l_prime < 1. row:%d, column:%d\n", row, column);
|
||||
|
||||
l_prime = (mappingtype_fromDCI == typeA) ? (l_prime | l0) : (l_prime << startSymbol);
|
||||
|
||||
@@ -41,7 +41,7 @@ uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
|
||||
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI);
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype_fromDCI,int length);
|
||||
|
||||
int is_nr_DL_slot(NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon,slot_t slotP);
|
||||
|
||||
@@ -177,8 +177,6 @@ bool set_ul_ptrs_values(NR_PTRS_UplinkConfig_t *ul_ptrs_config,
|
||||
uint8_t *reOffset, uint8_t *maxNumPorts, uint8_t *ulPower,
|
||||
uint8_t NrOfSymbols);
|
||||
|
||||
uint8_t get_num_dmrs_symbols(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols,int startSymbol,int mappingtype);
|
||||
|
||||
/* \brief Set the transform precoding according to 6.1.3 of 3GPP TS 38.214 version 16.3.0 Release 16
|
||||
@param *pusch_config, pointer to pusch config
|
||||
@param *ubwp pointer to uplink bwp
|
||||
|
||||
@@ -57,12 +57,12 @@ extern const uint8_t table_7_3_1_1_2_21[19][4];
|
||||
extern const uint8_t table_7_3_1_1_2_22[6][5];
|
||||
extern const uint8_t table_7_3_1_1_2_23[5][6];
|
||||
extern const uint8_t table_7_3_2_3_3_1[12][5];
|
||||
extern const uint8_t table_7_3_2_3_3_2_oneCodeword[31][6];
|
||||
extern const uint8_t table_7_3_2_3_3_2_oneCodeword[31][10];
|
||||
extern const uint8_t table_7_3_2_3_3_2_twoCodeword[4][10];
|
||||
extern const uint8_t table_7_3_2_3_3_3_oneCodeword[24][5];
|
||||
extern const uint8_t table_7_3_2_3_3_3_oneCodeword[24][7];
|
||||
extern const uint8_t table_7_3_2_3_3_3_twoCodeword[2][7];
|
||||
extern const uint8_t table_7_3_2_3_3_4_oneCodeword[58][6];
|
||||
extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10];
|
||||
extern const uint8_t table_7_3_2_3_3_4_oneCodeword[58][14];
|
||||
extern const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14];
|
||||
|
||||
extern const uint16_t table_7_2_1[16];
|
||||
|
||||
|
||||
@@ -257,161 +257,161 @@ const uint8_t table_7_3_1_1_2_23[5][6] = {
|
||||
};
|
||||
|
||||
const uint8_t table_7_3_2_3_3_1[12][5] = {
|
||||
{1,0,0,0,0},
|
||||
{1,1,0,0,0},
|
||||
{1,0,1,0,0},
|
||||
{2,0,0,0,0},
|
||||
{1,1,1,0,0},
|
||||
{2,1,0,0,0},
|
||||
{2,2,0,0,0},
|
||||
{2,3,0,0,0},
|
||||
{2,0,1,0,0},
|
||||
{2,2,3,0,0},
|
||||
{2,0,1,2,0},
|
||||
{2,0,1,2,3},
|
||||
{2,0,2,0,0}
|
||||
{2,0,0,1,0},
|
||||
{2,0,0,0,1},
|
||||
{2,1,1,0,0},
|
||||
{2,0,0,1,1},
|
||||
{2,1,1,1,0},
|
||||
{2,1,1,1,1},
|
||||
{2,1,0,1,0}
|
||||
};
|
||||
|
||||
const uint8_t table_7_3_2_3_3_2_oneCodeword[31][6] = {
|
||||
{1,0,0,0,0,1},
|
||||
{1,1,0,0,0,1},
|
||||
{1,0,1,0,0,1},
|
||||
{2,0,0,0,0,1},
|
||||
{2,1,0,0,0,1},
|
||||
{2,2,0,0,0,1},
|
||||
{2,3,0,0,0,1},
|
||||
{2,0,1,0,0,1},
|
||||
{2,2,3,0,0,1},
|
||||
{2,0,1,2,0,1},
|
||||
{2,0,1,2,3,1},
|
||||
{2,0,2,0,0,1},
|
||||
{2,0,0,0,0,2},
|
||||
{2,1,0,0,0,2},
|
||||
{2,2,0,0,0,2},
|
||||
{2,3,0,0,0,2},
|
||||
{2,4,0,0,0,2},
|
||||
{2,5,0,0,0,2},
|
||||
{2,6,0,0,0,2},
|
||||
{2,7,0,0,0,2},
|
||||
{2,0,1,0,0,2},
|
||||
{2,2,3,0,0,2},
|
||||
{2,4,5,0,0,2},
|
||||
{2,6,7,0,0,2},
|
||||
{2,0,4,0,0,2},
|
||||
{2,2,6,0,0,2},
|
||||
{2,0,1,4,0,2},
|
||||
{2,2,3,6,0,2},
|
||||
{2,0,1,4,5,2},
|
||||
{2,2,3,6,7,2},
|
||||
{2,0,2,4,6,2}
|
||||
const uint8_t table_7_3_2_3_3_2_oneCodeword[31][10] = {
|
||||
{1,1,0,0,0,0,0,0,0,1},
|
||||
{1,0,1,0,0,0,0,0,0,1},
|
||||
{1,1,1,0,0,0,0,0,0,1},
|
||||
{2,1,0,0,0,0,0,0,0,1},
|
||||
{2,0,1,0,0,0,0,0,0,1},
|
||||
{2,0,0,1,0,0,0,0,0,1},
|
||||
{2,0,0,0,1,0,0,0,0,1},
|
||||
{2,1,1,0,0,0,0,0,0,1},
|
||||
{2,0,0,1,1,0,0,0,0,1},
|
||||
{2,1,1,1,0,0,0,0,0,1},
|
||||
{2,1,1,1,1,0,0,0,0,1},
|
||||
{2,1,0,1,0,0,0,0,0,1},
|
||||
{2,1,0,0,0,0,0,0,0,2},
|
||||
{2,0,1,0,0,0,0,0,0,2},
|
||||
{2,0,0,1,0,0,0,0,0,2},
|
||||
{2,0,0,0,1,0,0,0,0,2},
|
||||
{2,0,0,0,0,1,0,0,0,2},
|
||||
{2,0,0,0,0,0,1,0,0,2},
|
||||
{2,0,0,0,0,0,0,1,0,2},
|
||||
{2,0,0,0,0,0,0,0,1,2},
|
||||
{2,1,1,0,0,0,0,0,0,2},
|
||||
{2,0,0,1,1,0,0,0,0,2},
|
||||
{2,0,0,0,0,1,1,0,0,2},
|
||||
{2,0,0,0,0,0,0,1,1,2},
|
||||
{2,1,0,0,0,1,0,0,0,2},
|
||||
{2,0,0,1,0,0,0,1,0,2},
|
||||
{2,1,1,0,0,1,0,0,0,2},
|
||||
{2,0,0,1,1,0,0,1,0,2},
|
||||
{2,1,1,0,0,1,1,0,0,2},
|
||||
{2,0,0,1,1,0,0,1,1,2},
|
||||
{2,1,0,1,0,1,0,1,0,2}
|
||||
};
|
||||
|
||||
const uint8_t table_7_3_2_3_3_2_twoCodeword[4][10] = {
|
||||
{2,0,1,2,3,4,0,0,0,2},
|
||||
{2,0,1,2,3,4,6,0,0,2},
|
||||
{2,0,1,2,3,4,5,6,0,2},
|
||||
{2,0,1,2,3,4,5,6,7,2}
|
||||
{2,1,1,1,1,1,0,0,0,2},
|
||||
{2,1,1,1,1,1,0,1,0,2},
|
||||
{2,1,1,1,1,1,1,1,0,2},
|
||||
{2,1,1,1,1,1,1,1,1,2}
|
||||
};
|
||||
|
||||
const uint8_t table_7_3_2_3_3_3_oneCodeword[24][5] = {
|
||||
{1,0,0,0,0},
|
||||
{1,1,0,0,0},
|
||||
{1,0,1,0,0},
|
||||
{2,0,0,0,0},
|
||||
{2,1,0,0,0},
|
||||
{2,2,0,0,0},
|
||||
{2,3,0,0,0},
|
||||
{2,0,1,0,0},
|
||||
{2,2,3,0,0},
|
||||
{2,0,1,2,0},
|
||||
{2,0,1,2,3},
|
||||
{3,0,0,0,0},
|
||||
{3,1,0,0,0},
|
||||
{3,2,0,0,0},
|
||||
{3,3,0,0,0},
|
||||
{3,4,0,0,0},
|
||||
{3,5,0,0,0},
|
||||
{3,0,1,0,0},
|
||||
{3,2,3,0,0},
|
||||
{3,4,5,0,0},
|
||||
{3,0,1,2,0},
|
||||
{3,3,4,5,0},
|
||||
{3,0,1,2,3},
|
||||
{2,0,2,0,0}
|
||||
const uint8_t table_7_3_2_3_3_3_oneCodeword[24][7] = {
|
||||
{1,1,0,0,0,0,0},
|
||||
{1,0,1,0,0,0,0},
|
||||
{1,1,1,0,0,0,0},
|
||||
{2,1,0,0,0,0,0},
|
||||
{2,0,1,0,0,0,0},
|
||||
{2,0,0,1,0,0,0},
|
||||
{2,0,0,0,1,0,0},
|
||||
{2,1,1,0,0,0,0},
|
||||
{2,0,0,1,1,0,0},
|
||||
{2,1,1,1,0,0,0},
|
||||
{2,1,1,1,1,0,0},
|
||||
{3,1,0,0,0,0,0},
|
||||
{3,0,1,0,0,0,0},
|
||||
{3,0,0,1,0,0,0},
|
||||
{3,0,0,0,1,0,0},
|
||||
{3,0,0,0,0,1,0},
|
||||
{3,0,0,0,0,0,1},
|
||||
{3,1,1,0,0,0,0},
|
||||
{3,0,0,1,1,0,0},
|
||||
{3,0,0,0,0,1,1},
|
||||
{3,1,1,1,0,0,0},
|
||||
{3,0,0,0,1,1,1},
|
||||
{3,1,1,1,1,0,0},
|
||||
{3,1,0,1,0,0,0}
|
||||
};
|
||||
|
||||
const uint8_t table_7_3_2_3_3_3_twoCodeword[2][7] = {
|
||||
{3,0,1,2,3,4,0},
|
||||
{3,0,1,2,3,4,5}
|
||||
{3,1,1,1,1,1,0},
|
||||
{3,1,1,1,1,1,1}
|
||||
};
|
||||
|
||||
const uint8_t table_7_3_2_3_3_4_oneCodeword[58][6] = {
|
||||
{1,0,0,0,0,1},
|
||||
{1,1,0,0,0,1},
|
||||
{1,0,1,0,0,1},
|
||||
{2,0,0,0,0,1},
|
||||
{2,1,0,0,0,1},
|
||||
{2,2,0,0,0,1},
|
||||
{2,3,0,0,0,1},
|
||||
{2,0,1,0,0,1},
|
||||
{2,2,3,0,0,1},
|
||||
{2,0,1,2,0,1},
|
||||
{2,0,1,2,3,1},
|
||||
{3,0,0,0,0,1},
|
||||
{3,1,0,0,0,1},
|
||||
{3,2,0,0,0,1},
|
||||
{3,3,0,0,0,1},
|
||||
{3,4,0,0,0,1},
|
||||
{3,5,0,0,0,1},
|
||||
{3,0,1,0,0,1},
|
||||
{3,2,3,0,0,1},
|
||||
{3,4,5,0,0,1},
|
||||
{3,0,1,2,0,1},
|
||||
{3,3,4,5,0,1},
|
||||
{3,0,1,2,3,1},
|
||||
{2,0,2,0,0,1},
|
||||
{3,0,0,0,0,2},
|
||||
{3,1,0,0,0,2},
|
||||
{3,2,0,0,0,2},
|
||||
{3,3,0,0,0,2},
|
||||
{3,4,0,0,0,2},
|
||||
{3,5,0,0,0,2},
|
||||
{3,6,0,0,0,2},
|
||||
{3,7,0,0,0,2},
|
||||
{3,8,0,0,0,2},
|
||||
{3,9,0,0,0,2},
|
||||
{3,10,0,0,0,2},
|
||||
{3,11,0,0,0,2},
|
||||
{3,0,1,0,0,2},
|
||||
{3,2,3,0,0,2},
|
||||
{3,4,5,0,0,2},
|
||||
{3,6,7,0,0,2},
|
||||
{3,8,9,0,0,2},
|
||||
{3,10,11,0,0,2},
|
||||
{3,0,1,6,0,2},
|
||||
{3,2,3,8,0,2},
|
||||
{3,4,5,10,0,2},
|
||||
{3,0,1,6,7,2},
|
||||
{3,2,3,8,9,2},
|
||||
{3,4,5,10,11,2},
|
||||
{1,0,0,0,0,2},
|
||||
{1,1,0,0,0,2},
|
||||
{1,6,0,0,0,2},
|
||||
{1,7,0,0,0,2},
|
||||
{1,0,1,0,0,2},
|
||||
{1,6,7,0,0,2},
|
||||
{2,0,1,0,0,2},
|
||||
{2,2,3,0,0,2},
|
||||
{2,6,7,0,0,2},
|
||||
{2,8,9,0,0,2}
|
||||
const uint8_t table_7_3_2_3_3_4_oneCodeword[58][14] = {
|
||||
{1,1,0,0,0,0,0,0,0,0,0,0,0,1},
|
||||
{1,0,1,0,0,0,0,0,0,0,0,0,0,1},
|
||||
{1,1,1,0,0,0,0,0,0,0,0,0,0,1},
|
||||
{2,1,0,0,0,0,0,0,0,0,0,0,0,1},
|
||||
{2,0,1,0,0,0,0,0,0,0,0,0,0,1},
|
||||
{2,0,0,1,0,0,0,0,0,0,0,0,0,1},
|
||||
{2,0,0,0,1,0,0,0,0,0,0,0,0,1},
|
||||
{2,1,1,0,0,0,0,0,0,0,0,0,0,1},
|
||||
{2,0,0,1,1,0,0,0,0,0,0,0,0,1},
|
||||
{2,1,1,1,0,0,0,0,0,0,0,0,0,1},
|
||||
{2,1,1,1,1,0,0,0,0,0,0,0,0,1},
|
||||
{3,1,0,0,0,0,0,0,0,0,0,0,0,1},
|
||||
{3,0,1,0,0,0,0,0,0,0,0,0,0,1},
|
||||
{3,0,0,1,0,0,0,0,0,0,0,0,0,1},
|
||||
{3,0,0,0,1,0,0,0,0,0,0,0,0,1},
|
||||
{3,0,0,0,0,1,0,0,0,0,0,0,0,1},
|
||||
{3,0,0,0,0,0,1,0,0,0,0,0,0,1},
|
||||
{3,1,1,0,0,0,0,0,0,0,0,0,0,1},
|
||||
{3,0,0,1,1,0,0,0,0,0,0,0,0,1},
|
||||
{3,0,0,0,0,1,1,0,0,0,0,0,0,1},
|
||||
{3,1,1,1,0,0,0,0,0,0,0,0,0,1},
|
||||
{3,0,0,0,1,1,1,0,0,0,0,0,0,1},
|
||||
{3,1,1,1,1,0,0,0,0,0,0,0,0,1},
|
||||
{2,1,0,1,0,0,0,0,0,0,0,0,0,1},
|
||||
{3,1,0,0,0,0,0,0,0,0,0,0,0,2},
|
||||
{3,0,1,0,0,0,0,0,0,0,0,0,0,2},
|
||||
{3,0,0,1,0,0,0,0,0,0,0,0,0,2},
|
||||
{3,0,0,0,1,0,0,0,0,0,0,0,0,2},
|
||||
{3,0,0,0,0,1,0,0,0,0,0,0,0,2},
|
||||
{3,0,0,0,0,0,1,0,0,0,0,0,0,2},
|
||||
{3,0,0,0,0,0,0,1,0,0,0,0,0,2},
|
||||
{3,0,0,0,0,0,0,0,1,0,0,0,0,2},
|
||||
{3,0,0,0,0,0,0,0,0,1,0,0,0,2},
|
||||
{3,0,0,0,0,0,0,0,0,0,1,0,0,2},
|
||||
{3,0,0,0,0,0,0,0,0,0,0,1,0,2},
|
||||
{3,0,0,0,0,0,0,0,0,0,0,0,1,2},
|
||||
{3,1,1,0,0,0,0,0,0,0,0,0,0,2},
|
||||
{3,0,0,1,1,0,0,0,0,0,0,0,0,2},
|
||||
{3,0,0,0,0,1,1,0,0,0,0,0,0,2},
|
||||
{3,0,0,0,0,0,0,1,1,0,0,0,0,2},
|
||||
{3,0,0,0,0,0,0,0,0,1,1,0,0,2},
|
||||
{3,0,0,0,0,0,0,0,0,0,0,1,1,2},
|
||||
{3,1,1,0,0,0,0,1,0,0,0,0,0,2},
|
||||
{3,0,0,1,1,0,0,0,0,1,0,0,0,2},
|
||||
{3,0,0,0,0,1,1,0,0,0,0,1,0,2},
|
||||
{3,1,1,0,0,0,0,1,1,0,0,0,0,2},
|
||||
{3,0,0,1,1,0,0,0,0,1,1,0,0,2},
|
||||
{3,0,0,0,0,1,1,0,0,0,0,1,1,2},
|
||||
{1,1,0,0,0,0,0,0,0,0,0,0,0,2},
|
||||
{1,0,1,0,0,0,0,0,0,0,0,0,0,2},
|
||||
{1,0,0,0,0,0,0,1,0,0,0,0,0,2},
|
||||
{1,0,0,0,0,0,0,0,1,0,0,0,0,2},
|
||||
{1,1,1,0,0,0,0,0,0,0,0,0,0,2},
|
||||
{1,0,0,0,0,0,0,1,1,0,0,0,0,2},
|
||||
{2,1,1,0,0,0,0,0,0,0,0,0,0,2},
|
||||
{2,0,0,1,1,0,0,0,0,0,0,0,0,2},
|
||||
{2,0,0,0,0,0,0,1,1,0,0,0,0,2},
|
||||
{2,0,0,0,0,0,0,0,0,1,1,0,0,2}
|
||||
};
|
||||
|
||||
const uint8_t table_7_3_2_3_3_4_twoCodeword[6][10] = {
|
||||
{3,0,1,2,3,4,0,0,0,1},
|
||||
{3,0,1,2,3,4,5,0,0,1},
|
||||
{2,0,1,2,3,6,0,0,0,2},
|
||||
{2,0,1,2,3,6,8,0,0,2},
|
||||
{2,0,1,2,3,6,7,8,0,2},
|
||||
{2,0,1,2,3,6,7,8,9,2}
|
||||
const uint8_t table_7_3_2_3_3_4_twoCodeword[6][14] = {
|
||||
{3,1,1,1,1,1,0,0,0,0,0,0,0,1},
|
||||
{3,1,1,1,1,1,1,0,0,0,0,0,0,1},
|
||||
{2,1,1,1,1,0,0,1,0,0,0,0,0,2},
|
||||
{2,1,1,1,1,0,0,1,0,1,0,0,0,2},
|
||||
{2,1,1,1,1,0,0,1,1,1,0,0,0,2},
|
||||
{2,1,1,1,1,0,0,1,1,1,1,0,0,2},
|
||||
};
|
||||
|
||||
// table 7.2-1 TS 38.321
|
||||
|
||||
@@ -871,14 +871,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
(get_softmodem_params()->nsa) ? mac->scc->dmrs_TypeA_Position : mac->mib->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_0->number_symbols,
|
||||
dlsch_config_pdu_1_0->start_symbol,
|
||||
mappingtype);
|
||||
mappingtype, 1);
|
||||
dlsch_config_pdu_1_0->dmrsConfigType = (mac->DLbwp[0] != NULL) ?
|
||||
(mac->DLbwp[0]->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
|
||||
|
||||
/* number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214 version 15.9.0 Release 15 */
|
||||
if (dlsch_config_pdu_1_0->number_symbols == 2)
|
||||
dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 1;
|
||||
else
|
||||
dlsch_config_pdu_1_0->n_dmrs_cdm_groups = 2;
|
||||
dlsch_config_pdu_1_0->dmrs_ports = 1; // only port 0 in case of DCI 1_0
|
||||
/* VRB_TO_PRB_MAPPING */
|
||||
dlsch_config_pdu_1_0->vrb_to_prb_mapping = (dci->vrb_to_prb_mapping.val == 0) ? vrb_to_prb_mapping_non_interleaved:vrb_to_prb_mapping_interleaved;
|
||||
/* MCS TABLE INDEX */
|
||||
@@ -1062,13 +1064,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
|
||||
int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_1->start_symbol <= 3)? typeA: typeB);
|
||||
|
||||
/* dmrs symbol positions*/
|
||||
dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_Config,
|
||||
mac->scc? mac->scc->dmrs_TypeA_Position:mac->mib->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_1->number_symbols,
|
||||
dlsch_config_pdu_1_1->start_symbol,
|
||||
mappingtype);
|
||||
|
||||
dlsch_config_pdu_1_1->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2;
|
||||
|
||||
/* TODO: fix number of DM-RS CDM groups without data according to subclause 5.1.6.2 of 3GPP TS 38.214,
|
||||
@@ -1132,6 +1127,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
uint8_t n_codewords = 1; // FIXME!!!
|
||||
long *max_length = NULL;
|
||||
long *dmrs_type = NULL;
|
||||
dlsch_config_pdu_1_1->n_front_load_symb = 1; // default value
|
||||
if (pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA) {
|
||||
max_length = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength;
|
||||
dmrs_type = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type;
|
||||
@@ -1143,31 +1139,35 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
if ((dmrs_type == NULL) && (max_length == NULL)){
|
||||
// Table 7.3.1.2.2-1: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=1
|
||||
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_1[dci->antenna_ports.val][0];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_1[dci->antenna_ports.val][1];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_1[dci->antenna_ports.val][2];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_1[dci->antenna_ports.val][3];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_1[dci->antenna_ports.val][4];
|
||||
dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_1[dci->antenna_ports.val][1] +
|
||||
(table_7_3_2_3_3_1[dci->antenna_ports.val][2]<<1) +
|
||||
(table_7_3_2_3_3_1[dci->antenna_ports.val][3]<<2) +
|
||||
(table_7_3_2_3_3_1[dci->antenna_ports.val][4]<<3));
|
||||
}
|
||||
if ((dmrs_type == NULL) && (max_length != NULL)){
|
||||
// Table 7.3.1.2.2-2: Antenna port(s) (1000 + DMRS port), dmrs-Type=1, maxLength=2
|
||||
if (n_codewords == 1) {
|
||||
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][0];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][3];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4];
|
||||
dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5];
|
||||
dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][1] +
|
||||
(table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][2]<<1) +
|
||||
(table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][3]<<2) +
|
||||
(table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][4]<<3) +
|
||||
(table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][5]<<4) +
|
||||
(table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][6]<<5) +
|
||||
(table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][7]<<6) +
|
||||
(table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][8]<<7));
|
||||
dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_oneCodeword[dci->antenna_ports.val][9];
|
||||
}
|
||||
if (n_codewords == 2) {
|
||||
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][0];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][3];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[6] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][7];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[7] = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][8];
|
||||
dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][1] +
|
||||
(table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][2]<<1) +
|
||||
(table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][3]<<2) +
|
||||
(table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][4]<<3) +
|
||||
(table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][5]<<4) +
|
||||
(table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][6]<<5) +
|
||||
(table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][7]<<6) +
|
||||
(table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][8]<<7));
|
||||
dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_2_twoCodeword[dci->antenna_ports.val][9];
|
||||
}
|
||||
}
|
||||
@@ -1175,44 +1175,67 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
|
||||
// Table 7.3.1.2.2-3: Antenna port(s) (1000 + DMRS port), dmrs-Type=2, maxLength=1
|
||||
if (n_codewords == 1) {
|
||||
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][0];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][3];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4];
|
||||
dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][1] +
|
||||
(table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][2]<<1) +
|
||||
(table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][3]<<2) +
|
||||
(table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][4]<<3) +
|
||||
(table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][5]<<4) +
|
||||
(table_7_3_2_3_3_3_oneCodeword[dci->antenna_ports.val][6]<<5));
|
||||
}
|
||||
if (n_codewords == 2) {
|
||||
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][0];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][3];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6];
|
||||
dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][1] +
|
||||
(table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][2]<<1) +
|
||||
(table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][3]<<2) +
|
||||
(table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][4]<<3) +
|
||||
(table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][5]<<4) +
|
||||
(table_7_3_2_3_3_3_twoCodeword[dci->antenna_ports.val][6]<<5));
|
||||
}
|
||||
}
|
||||
if ((dmrs_type != NULL) && (max_length != NULL)){
|
||||
// Table 7.3.1.2.2-4: Antenna port(s) (1000 + DMRS port), dmrs-Type=2, maxLength=2
|
||||
if (n_codewords == 1) {
|
||||
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][0];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][3];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4];
|
||||
dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5];
|
||||
dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][1] +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][2]<<1) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][3]<<2) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][4]<<3) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][5]<<4) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][6]<<5) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][7]<<6) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][8]<<7) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][9]<<8) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][10]<<9) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][11]<<10) +
|
||||
(table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][12]<<11));
|
||||
dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_oneCodeword[dci->antenna_ports.val][13];
|
||||
}
|
||||
if (n_codewords == 2) {
|
||||
dlsch_config_pdu_1_1->n_dmrs_cdm_groups = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][0];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[0] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[1] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[2] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][3];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[3] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[4] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[5] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[6] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][7];
|
||||
dlsch_config_pdu_1_1->dmrs_ports[7] = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][8];
|
||||
dlsch_config_pdu_1_1->dmrs_ports = (table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][1] +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][2]<<1) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][3]<<2) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][4]<<3) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][5]<<4) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][6]<<5) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][7]<<6) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][8]<<7) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9]<<8) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][10]<<9) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][11]<<10) +
|
||||
(table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][12]<<11));
|
||||
dlsch_config_pdu_1_1->n_front_load_symb = table_7_3_2_3_3_4_twoCodeword[dci->antenna_ports.val][9];
|
||||
}
|
||||
}
|
||||
|
||||
/* dmrs symbol positions*/
|
||||
dlsch_config_pdu_1_1->dlDmrsSymbPos = fill_dmrs_mask(pdsch_Config,
|
||||
mac->scc? mac->scc->dmrs_TypeA_Position:mac->mib->dmrs_TypeA_Position,
|
||||
dlsch_config_pdu_1_1->number_symbols,
|
||||
dlsch_config_pdu_1_1->start_symbol,
|
||||
mappingtype,
|
||||
dlsch_config_pdu_1_1->n_front_load_symb);
|
||||
|
||||
/* TCI */
|
||||
if (mac->dl_config_request.dl_config_list[0].dci_config_pdu.dci_config_rel15.coreset.tci_present_in_dci == 1){
|
||||
// 0 bit if higher layer parameter tci-PresentInDCI is not enabled
|
||||
|
||||
@@ -365,8 +365,9 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask.tl.tag = NFAPI_NR_CONFIG_SSB_MASK_TAG;
|
||||
cfg->num_tlv+=2;
|
||||
|
||||
// logical antenna ports
|
||||
cfg->carrier_config.num_tx_ant.value = pdsch_AntennaPorts;
|
||||
AssertFatal(pdsch_AntennaPorts > 0 && pdsch_AntennaPorts < 13, "pdsch_AntennaPorts in 1...12\n");
|
||||
AssertFatal(pdsch_AntennaPorts > 0 && pdsch_AntennaPorts < 33, "pdsch_AntennaPorts in 1...32\n");
|
||||
cfg->carrier_config.num_tx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_TX_ANT_TAG;
|
||||
|
||||
int num_ssb=0;
|
||||
|
||||
@@ -1360,7 +1360,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
nr_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position,
|
||||
nrOfSymbols,
|
||||
startSymbolIndex,
|
||||
mappingtype);
|
||||
mappingtype, 1);
|
||||
|
||||
int x_Overhead = 0;
|
||||
uint8_t tb_scaling = 0;
|
||||
@@ -1609,7 +1609,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
|
||||
scc->dmrs_TypeA_Position,
|
||||
nrOfSymbols,
|
||||
startSymbolIndex,
|
||||
mappingtype);
|
||||
mappingtype, 1);
|
||||
|
||||
uint16_t N_DMRS_SLOT = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
|
||||
@@ -388,7 +388,6 @@ uint32_t schedule_control_sib1(module_id_t module_id,
|
||||
// Calculate number of PRB_DMRS
|
||||
uint8_t N_PRB_DMRS = gNB_mac->sched_ctrlCommon->pdsch_semi_static.numDmrsCdmGrpsNoData * 6;
|
||||
uint16_t dmrs_length = get_num_dmrs(dlDmrsSymbPos);
|
||||
|
||||
LOG_D(MAC,"dlDmrsSymbPos %x\n",dlDmrsSymbPos);
|
||||
int rbSize = 0;
|
||||
uint32_t TBS = 0;
|
||||
@@ -621,8 +620,7 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
|
||||
|
||||
// TODO: There are exceptions to this in table 5.1.2.1.1-4,5 (Default time domain allocation tables B, C)
|
||||
int mappingtype = (startSymbolIndex <= 3)? typeA: typeB;
|
||||
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype);
|
||||
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1);
|
||||
|
||||
// Configure sched_ctrlCommon for SIB1
|
||||
uint32_t TBS = schedule_control_sib1(module_idP, CC_id,
|
||||
|
||||
@@ -563,7 +563,7 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
int rbStart = 0; // start wrt BWPstart
|
||||
|
||||
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
|
||||
const long f = (sched_ctrl->active_bwp ||bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
|
||||
|
||||
int rbSize = 0;
|
||||
const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot];
|
||||
AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n");
|
||||
@@ -587,26 +587,29 @@ bool allocate_dl_retransmission(module_id_t module_id,
|
||||
/* check whether we need to switch the TDA allocation since the last
|
||||
* (re-)transmission */
|
||||
if (ps->time_domain_allocation != tda)
|
||||
nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, ps);
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, ps);
|
||||
} else {
|
||||
/* the retransmission will use a different time domain allocation, check
|
||||
* that we have enough resources */
|
||||
NR_pdsch_semi_static_t temp_ps;
|
||||
temp_ps.nrOfLayers = 1;
|
||||
nr_set_pdsch_semi_static(scc, cg, sched_ctrl->active_bwp, bwpd, tda, f, &temp_ps);
|
||||
|
||||
NR_pdsch_semi_static_t temp_ps = *ps;
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, &temp_ps);
|
||||
while (rbStart < bwpSize &&
|
||||
!(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
|
||||
rbStart++;
|
||||
while (rbStart + rbSize < bwpSize &&
|
||||
(rballoc_mask[rbStart + rbSize]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
|
||||
rbSize++;
|
||||
|
||||
uint32_t new_tbs;
|
||||
uint16_t new_rbSize;
|
||||
bool success = nr_find_nb_rb(retInfo->Qm,
|
||||
retInfo->R,
|
||||
temp_ps.nrOfLayers,
|
||||
temp_ps.nrOfSymbols,
|
||||
temp_ps.N_PRB_DMRS * temp_ps.N_DMRS_SLOT,
|
||||
retInfo->tb_size,
|
||||
1, /* minimum of 1RB: need to find exact TBS, don't preclude any number */
|
||||
rbSize,
|
||||
&new_tbs,
|
||||
&new_rbSize);
|
||||
@@ -702,6 +705,7 @@ void pf_dl(module_id_t module_id,
|
||||
float coeff_ue[MAX_MOBILES_PER_GNB];
|
||||
// UEs that could be scheduled
|
||||
int ue_array[MAX_MOBILES_PER_GNB];
|
||||
int layers[MAX_MOBILES_PER_GNB];
|
||||
NR_list_t UE_sched = { .head = -1, .next = ue_array, .tail = -1, .len = MAX_MOBILES_PER_GNB };
|
||||
|
||||
/* Loop UE_info->list to check retransmission */
|
||||
@@ -714,6 +718,8 @@ void pf_dl(module_id_t module_id,
|
||||
/* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */
|
||||
sched_pdsch->dl_harq_pid = sched_ctrl->retrans_dl_harq.head;
|
||||
|
||||
layers[UE_id] = ps->nrOfLayers; // initialization of layers to the previous value in the strcuture
|
||||
|
||||
/* Calculate Throughput */
|
||||
const float a = 0.0005f; // corresponds to 200ms window
|
||||
const uint32_t b = UE_info->mac_stats[UE_id].dlsch_current_bytes;
|
||||
@@ -737,9 +743,19 @@ void pf_dl(module_id_t module_id,
|
||||
continue;
|
||||
|
||||
/* Calculate coeff */
|
||||
ps->nrOfLayers = 1;
|
||||
set_dl_mcs(sched_pdsch,sched_ctrl,&mac->dl_max_mcs,ps->mcsTableIdx);
|
||||
sched_pdsch->mcs = get_mcs_from_bler(module_id, /* CC_id = */ 0, frame, slot, UE_id);
|
||||
uint32_t tbs = pf_tbs[ps->mcsTableIdx][sched_pdsch->mcs];
|
||||
layers[UE_id] = set_dl_nrOfLayers(sched_ctrl);
|
||||
const uint8_t Qm = nr_get_Qm_dl(sched_pdsch->mcs, ps->mcsTableIdx);
|
||||
const uint16_t R = nr_get_code_rate_dl(sched_pdsch->mcs, ps->mcsTableIdx);
|
||||
uint32_t tbs = nr_compute_tbs(Qm,
|
||||
R,
|
||||
1, /* rbSize */
|
||||
10, /* hypothetical number of slots */
|
||||
0, /* N_PRB_DMRS * N_DMRS_SLOT */
|
||||
0 /* N_PRB_oh, 0 for initialBWP */,
|
||||
0 /* tb_scaling */,
|
||||
layers[UE_id]) >> 3;
|
||||
coeff_ue[UE_id] = (float) tbs / thr_ue[UE_id];
|
||||
LOG_D(NR_MAC,"b %d, thr_ue[%d] %f, tbs %d, coeff_ue[%d] %f\n",
|
||||
b, UE_id, thr_ue[UE_id], tbs, UE_id, coeff_ue[UE_id]);
|
||||
@@ -748,8 +764,9 @@ void pf_dl(module_id_t module_id,
|
||||
}
|
||||
}
|
||||
|
||||
const int min_rbSize = 5;
|
||||
/* Loop UE_sched to find max coeff and allocate transmission */
|
||||
while (max_num_ue > 0 && n_rb_sched > 0 && UE_sched.head >= 0) {
|
||||
while (max_num_ue > 0 && n_rb_sched >= min_rbSize && UE_sched.head >= 0) {
|
||||
|
||||
/* Find max coeff from UE_sched*/
|
||||
int *max = &UE_sched.head; /* assume head is max */
|
||||
@@ -809,9 +826,6 @@ void pf_dl(module_id_t module_id,
|
||||
LOG_D(NR_MAC, "%4d.%2d could not find CCE for DL DCI UE %d/RNTI %04x\n", frame, slot, UE_id, rnti);
|
||||
continue;
|
||||
}
|
||||
/* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */
|
||||
max_num_ue--;
|
||||
if (max_num_ue < 0) return;
|
||||
|
||||
/* Find PUCCH occasion: if it fails, undo CCE allocation (undoing PUCCH
|
||||
* allocation after CCE alloc fail would be more complex) */
|
||||
@@ -825,9 +839,14 @@ void pf_dl(module_id_t module_id,
|
||||
frame,
|
||||
slot);
|
||||
mac->pdcch_cand[cid]--;
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE
|
||||
* and PUCCH */
|
||||
max_num_ue--;
|
||||
AssertFatal(max_num_ue >= 0, "Illegal max_num_ue %d\n", max_num_ue);
|
||||
|
||||
sched_ctrl->cce_index = CCEIndex;
|
||||
|
||||
fill_pdcch_vrb_map(mac,
|
||||
@@ -842,9 +861,10 @@ void pf_dl(module_id_t module_id,
|
||||
AssertFatal(tda>=0,"Unable to find PDSCH time domain allocation in list\n");
|
||||
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
|
||||
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
|
||||
const long f = (sched_ctrl->active_bwp || bwpd) ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
|
||||
if (ps->time_domain_allocation != tda)
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, f, ps);
|
||||
|
||||
if (ps->nrOfLayers != layers[UE_id] ||
|
||||
ps->time_domain_allocation != tda)
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, layers[UE_id], sched_ctrl, ps);
|
||||
|
||||
const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
|
||||
// Freq-demain allocation
|
||||
@@ -865,9 +885,11 @@ void pf_dl(module_id_t module_id,
|
||||
const int oh = 3 + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024);
|
||||
nr_find_nb_rb(sched_pdsch->Qm,
|
||||
sched_pdsch->R,
|
||||
ps->nrOfLayers,
|
||||
ps->nrOfSymbols,
|
||||
ps->N_PRB_DMRS * ps->N_DMRS_SLOT,
|
||||
sched_ctrl->num_total_bytes + oh,
|
||||
min_rbSize,
|
||||
max_rbSize,
|
||||
&TBS,
|
||||
&rbSize);
|
||||
@@ -1048,8 +1070,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
harq->is_waiting = true;
|
||||
UE_info->mac_stats[UE_id].dlsch_rounds[harq->round]++;
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) PUCCH allocation %d TPC %d\n",
|
||||
LOG_D(NR_MAC,"%4d.%2d [DLSCH/PDSCH/PUCCH] UE %d RNTI %04x DCI L %d start %3d RBs %3d startSymbol %2d nb_symbol %2d dmrspos %x MCS %2d nrOfLayers %d TBS %4d HARQ PID %2d round %d RV %d NDI %d dl_data_to_ULACK %d (%d.%d) PUCCH allocation %d TPC %d\n",
|
||||
frame,
|
||||
slot,
|
||||
UE_id,
|
||||
@@ -1061,6 +1082,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
ps->nrOfSymbols,
|
||||
ps->dl_dmrs_symb_pos,
|
||||
sched_pdsch->mcs,
|
||||
nrOfLayers,
|
||||
TBS,
|
||||
current_harq_pid,
|
||||
harq->round,
|
||||
|
||||
@@ -163,7 +163,7 @@ void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
scc->dmrs_TypeA_Position,
|
||||
NrOfSymbols,
|
||||
StartSymbolIndex,
|
||||
mappingtype);
|
||||
mappingtype, 1);
|
||||
|
||||
/*
|
||||
AssertFatal(k0==0,"k0 is not zero for Initial DL BWP TimeDomain Alloc\n");
|
||||
@@ -276,12 +276,11 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
UE_id);
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
const int tda = sched_ctrl->active_bwp ? RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp->bwp_Id][slot] : 1;
|
||||
const long f = sched_ctrl->active_bwp ? sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats : 0;
|
||||
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
|
||||
ps->nrOfLayers = target_dl_Nl;
|
||||
if (ps->time_domain_allocation != tda)
|
||||
nr_set_pdsch_semi_static(
|
||||
scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, f, ps);
|
||||
|
||||
if (ps->time_domain_allocation != tda || ps->nrOfLayers != target_dl_Nl)
|
||||
nr_set_pdsch_semi_static(scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, target_dl_Nl, sched_ctrl, ps);
|
||||
|
||||
/* find largest unallocated chunk */
|
||||
const int bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
|
||||
@@ -518,12 +517,14 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
|
||||
sched_ctrl->coreset,
|
||||
Y);
|
||||
|
||||
if (sched_ctrl->cce_index < 0) {
|
||||
if (CCEIndex < 0) {
|
||||
LOG_E(MAC, "%s(): CCE list not empty, couldn't schedule PUSCH\n", __func__);
|
||||
nr_mac->pdcch_cand[cid]--;
|
||||
return false;
|
||||
}
|
||||
|
||||
sched_ctrl->cce_index = CCEIndex;
|
||||
|
||||
const int mcs = target_ul_mcs;
|
||||
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
|
||||
sched_pusch->mcs = mcs;
|
||||
|
||||
@@ -113,6 +113,20 @@ uint8_t nr_ss_first_symb_idx_scs_120_120_mux3[4] = {4,8,2,6};
|
||||
uint8_t nr_max_number_of_candidates_per_slot[4] = {44, 36, 22, 20};
|
||||
uint8_t nr_max_number_of_cces_per_slot[4] = {56, 56, 48, 32};
|
||||
|
||||
// CQI TABLES
|
||||
// Table 1 (38.214 5.2.2.1-2)
|
||||
uint16_t cqi_table1[16][2] = {{0,0},{2,78},{2,120},{2,193},{2,308},{2,449},{2,602},{4,378},
|
||||
{4,490},{4,616},{6,466},{6,567},{6,666},{6,772},{6,873},{6,948}};
|
||||
|
||||
// Table 2 (38.214 5.2.2.1-3)
|
||||
uint16_t cqi_table2[16][2] = {{0,0},{2,78},{2,193},{2,449},{4,378},{4,490},{4,616},{6,466},
|
||||
{6,567},{6,666},{6,772},{6,873},{8,711},{8,797},{8,885},{8,948}};
|
||||
|
||||
// Table 2 (38.214 5.2.2.1-4)
|
||||
uint16_t cqi_table3[16][2] = {{0,0},{2,30},{2,50},{2,78},{2,120},{2,193},{2,308},{2,449},
|
||||
{2,602},{4,378},{4,490},{4,616},{6,466},{6,567},{6,666},{6,772}};
|
||||
|
||||
|
||||
static inline uint8_t get_max_candidates(uint8_t scs) {
|
||||
AssertFatal(scs<4, "Invalid PDCCH subcarrier spacing %d\n", scs);
|
||||
return (nr_max_number_of_candidates_per_slot[scs]);
|
||||
@@ -123,6 +137,59 @@ static inline uint8_t get_max_cces(uint8_t scs) {
|
||||
return (nr_max_number_of_cces_per_slot[scs]);
|
||||
}
|
||||
|
||||
uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
// TODO check this but it should be enough for now
|
||||
// if there is not csi report RI is 0 from initialization
|
||||
return (sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri + 1);
|
||||
|
||||
}
|
||||
|
||||
void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
uint8_t *target_mcs,
|
||||
uint8_t mcs_table_idx) {
|
||||
|
||||
if (sched_ctrl->set_mcs) {
|
||||
// TODO for wideband case and multiple TB
|
||||
int cqi_idx = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb;
|
||||
uint16_t target_coderate,target_qm;
|
||||
if (cqi_idx>0) {
|
||||
int cqi_table = sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table;
|
||||
AssertFatal(cqi_table == mcs_table_idx, "Indices of MCS tables don't correspond\n");
|
||||
switch (cqi_table) {
|
||||
case 0:
|
||||
target_qm = cqi_table1[cqi_idx][0];
|
||||
target_coderate = cqi_table1[cqi_idx][1];
|
||||
break;
|
||||
case 1:
|
||||
target_qm = cqi_table2[cqi_idx][0];
|
||||
target_coderate = cqi_table2[cqi_idx][1];
|
||||
break;
|
||||
case 2:
|
||||
target_qm = cqi_table3[cqi_idx][0];
|
||||
target_coderate = cqi_table3[cqi_idx][1];
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid cqi table index %d\n",cqi_table);
|
||||
}
|
||||
int max_mcs = 28;
|
||||
int R,Qm;
|
||||
if (mcs_table_idx == 1)
|
||||
max_mcs = 27;
|
||||
for (int i=0; i<=max_mcs; i++) {
|
||||
R = nr_get_code_rate_dl(i, mcs_table_idx);
|
||||
Qm = nr_get_Qm_dl(i, mcs_table_idx);
|
||||
if ((Qm == target_qm) && (target_coderate <= R)) {
|
||||
*target_mcs = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sched_ctrl->set_mcs = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
|
||||
|
||||
//TODO first basic implementation of dmrs port selection
|
||||
@@ -130,23 +197,29 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
|
||||
// for now it assumes a selection of Nl consecutive dmrs ports
|
||||
// and a single front loaded symbol
|
||||
// dmrs_ports_id is the index of Tables 7.3.1.2.2-1/2/3/4
|
||||
// number of front loaded symbols need to be consistent with maxLength
|
||||
// when a more complete implementation is done
|
||||
|
||||
switch (ps->nrOfLayers) {
|
||||
case 1:
|
||||
ps->dmrs_ports_id = 0;
|
||||
ps->numDmrsCdmGrpsNoData = 1;
|
||||
ps->frontloaded_symb = 1;
|
||||
break;
|
||||
case 2:
|
||||
ps->dmrs_ports_id = 2;
|
||||
ps->numDmrsCdmGrpsNoData = 1;
|
||||
ps->frontloaded_symb = 1;
|
||||
break;
|
||||
case 3:
|
||||
ps->dmrs_ports_id = 9;
|
||||
ps->numDmrsCdmGrpsNoData = 2;
|
||||
ps->frontloaded_symb = 1;
|
||||
break;
|
||||
case 4:
|
||||
ps->dmrs_ports_id = 10;
|
||||
ps->numDmrsCdmGrpsNoData = 2;
|
||||
ps->frontloaded_symb = 1;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Number of layers %d\n not supported or not valid\n",ps->nrOfLayers);
|
||||
@@ -385,16 +458,18 @@ void fill_pdcch_vrb_map(gNB_MAC_INST *mac,
|
||||
|
||||
bool nr_find_nb_rb(uint16_t Qm,
|
||||
uint16_t R,
|
||||
uint8_t nrOfLayers,
|
||||
uint16_t nb_symb_sch,
|
||||
uint16_t nb_dmrs_prb,
|
||||
uint32_t bytes,
|
||||
uint16_t nb_rb_min,
|
||||
uint16_t nb_rb_max,
|
||||
uint32_t *tbs,
|
||||
uint16_t *nb_rb)
|
||||
{
|
||||
/* is the maximum (not even) enough? */
|
||||
*nb_rb = nb_rb_max;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
|
||||
/* check whether it does not fit, or whether it exactly fits. Some algorithms
|
||||
* might depend on the return value! */
|
||||
if (bytes > *tbs)
|
||||
@@ -403,17 +478,17 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
return true;
|
||||
|
||||
/* is the minimum enough? */
|
||||
*nb_rb = 5;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
|
||||
*nb_rb = nb_rb_min;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
|
||||
if (bytes <= *tbs)
|
||||
return true;
|
||||
|
||||
/* perform binary search to allocate all bytes within a TBS up to nb_rb_max
|
||||
* RBs */
|
||||
int hi = nb_rb_max;
|
||||
int lo = 1;
|
||||
int lo = nb_rb_min;
|
||||
for (int p = (hi + lo) / 2; lo + 1 < hi; p = (hi + lo) / 2) {
|
||||
const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
|
||||
const uint32_t TBS = nr_compute_tbs(Qm, R, p, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
|
||||
if (bytes == TBS) {
|
||||
hi = p;
|
||||
break;
|
||||
@@ -424,7 +499,7 @@ bool nr_find_nb_rb(uint16_t Qm,
|
||||
}
|
||||
}
|
||||
*nb_rb = hi;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, 1) >> 3;
|
||||
*tbs = nr_compute_tbs(Qm, R, *nb_rb, nb_symb_sch, nb_dmrs_prb, 0, 0, nrOfLayers) >> 3;
|
||||
/* return whether we could allocate all bytes and stay below nb_rb_max */
|
||||
return *tbs >= bytes && *nb_rb <= nb_rb_max;
|
||||
}
|
||||
@@ -434,18 +509,12 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_BWP_Downlink_t *bwp,
|
||||
const NR_BWP_DownlinkDedicated_t *bwpd0,
|
||||
int tda,
|
||||
const long dci_format,
|
||||
uint8_t layers,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
NR_pdsch_semi_static_t *ps)
|
||||
{
|
||||
ps->time_domain_allocation = tda;
|
||||
bool reset_dmrs = false;
|
||||
|
||||
const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ?
|
||||
bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList :
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count);
|
||||
const int mapping_type = tdaList->list.array[tda]->mappingType;
|
||||
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
|
||||
SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols);
|
||||
NR_BWP_DownlinkDedicated_t *bwpd;
|
||||
|
||||
if (bwp && bwp->bwp_Dedicated) {
|
||||
@@ -454,7 +523,6 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
bwpd = (NR_BWP_DownlinkDedicated_t*)bwpd0;
|
||||
}
|
||||
|
||||
ps->mcsTableIdx = 0;
|
||||
if (bwpd->pdsch_Config &&
|
||||
bwpd->pdsch_Config->choice.setup &&
|
||||
bwpd->pdsch_Config->choice.setup->mcs_Table) {
|
||||
@@ -465,15 +533,67 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
}
|
||||
else ps->mcsTableIdx = 0;
|
||||
|
||||
if(dci_format == 0) // format 1_0
|
||||
ps->numDmrsCdmGrpsNoData = (ps->nrOfSymbols == 2 ? 1 : 2);
|
||||
NR_PDSCH_Config_t *pdsch_Config;
|
||||
if (bwp &&
|
||||
bwp->bwp_Dedicated &&
|
||||
bwp->bwp_Dedicated->pdsch_Config &&
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup)
|
||||
pdsch_Config = bwp->bwp_Dedicated->pdsch_Config->choice.setup;
|
||||
else
|
||||
set_dl_dmrs_ports(ps);
|
||||
ps->dmrsConfigType = bwp!=NULL ? (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1) : 0;
|
||||
pdsch_Config = NULL;
|
||||
|
||||
if (ps->time_domain_allocation != tda) {
|
||||
reset_dmrs = true;
|
||||
ps->time_domain_allocation = tda;
|
||||
const struct NR_PDSCH_TimeDomainResourceAllocationList *tdaList = bwp ?
|
||||
bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList :
|
||||
scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
|
||||
AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count);
|
||||
ps->mapping_type = tdaList->list.array[tda]->mappingType;
|
||||
if (pdsch_Config) {
|
||||
if (ps->mapping_type == NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB)
|
||||
ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type == NULL ? 0 : 1;
|
||||
else
|
||||
ps->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? 0 : 1;
|
||||
}
|
||||
else
|
||||
ps->dmrsConfigType = NFAPI_NR_DMRS_TYPE1;
|
||||
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
|
||||
SLIV2SL(startSymbolAndLength, &ps->startSymbolIndex, &ps->nrOfSymbols);
|
||||
}
|
||||
|
||||
const long f = sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats;
|
||||
int dci_format;
|
||||
if (sched_ctrl->search_space) {
|
||||
dci_format = f ? NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0;
|
||||
}
|
||||
else {
|
||||
dci_format = NR_DL_DCI_FORMAT_1_0;
|
||||
}
|
||||
if (dci_format == NR_DL_DCI_FORMAT_1_0) {
|
||||
if (ps->nrOfSymbols == 2)
|
||||
ps->numDmrsCdmGrpsNoData = 1;
|
||||
else
|
||||
ps->numDmrsCdmGrpsNoData = 2;
|
||||
ps->dmrs_ports_id = 0;
|
||||
ps->frontloaded_symb = 1;
|
||||
ps->nrOfLayers = 1;
|
||||
}
|
||||
else {
|
||||
if (ps->nrOfLayers != layers ||
|
||||
ps->numDmrsCdmGrpsNoData == 0) {
|
||||
reset_dmrs = true;
|
||||
ps->nrOfLayers = layers;
|
||||
set_dl_dmrs_ports(ps);
|
||||
}
|
||||
}
|
||||
|
||||
ps->N_PRB_DMRS = ps->numDmrsCdmGrpsNoData * (ps->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4);
|
||||
ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, mapping_type);
|
||||
ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos);
|
||||
|
||||
if (reset_dmrs) {
|
||||
ps->dl_dmrs_symb_pos = fill_dmrs_mask(bwpd ? bwpd->pdsch_Config->choice.setup : NULL, scc->dmrs_TypeA_Position, ps->nrOfSymbols, ps->startSymbolIndex, ps->mapping_type, ps->frontloaded_symb);
|
||||
ps->N_DMRS_SLOT = get_num_dmrs(ps->dl_dmrs_symb_pos);
|
||||
}
|
||||
LOG_D(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d\n",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT);
|
||||
}
|
||||
|
||||
@@ -2027,6 +2147,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
|
||||
compute_csi_bitlen (CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup, UE_info, UE_id, mod_idP);
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
memset(sched_ctrl, 0, sizeof(*sched_ctrl));
|
||||
sched_ctrl->set_mcs = TRUE;
|
||||
sched_ctrl->lcid_mask = 0;
|
||||
if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra && !get_softmodem_params()->sa) {
|
||||
sched_ctrl->lcid_mask = 1<<DL_SCH_LCID_DTCH;
|
||||
|
||||
@@ -161,7 +161,7 @@ void nr_schedule_pucch(int Mod_idP,
|
||||
|
||||
|
||||
//! Calculating number of bits set
|
||||
uint8_t number_of_bits_set (uint8_t buf,uint8_t * max_ri){
|
||||
uint8_t number_of_bits_set (uint8_t buf){
|
||||
uint8_t nb_of_bits_set = 0;
|
||||
uint8_t mask = 0xff;
|
||||
uint8_t index = 0;
|
||||
@@ -172,14 +172,13 @@ uint8_t number_of_bits_set (uint8_t buf,uint8_t * max_ri){
|
||||
|
||||
mask>>=1;
|
||||
}
|
||||
*max_ri = 8-index;
|
||||
return nb_of_bits_set;
|
||||
}
|
||||
|
||||
|
||||
void compute_rsrp_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
uint8_t nb_resources,
|
||||
nr_csi_report_t *csi_report){
|
||||
nr_csi_report_t *csi_report) {
|
||||
|
||||
if (NR_CSI_ReportConfig__groupBasedBeamReporting_PR_disabled == csi_reportconfig->groupBasedBeamReporting.present) {
|
||||
if (NULL != csi_reportconfig->groupBasedBeamReporting.choice.disabled->nrofReportedRS)
|
||||
@@ -211,42 +210,24 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
nr_csi_report_t *csi_report){
|
||||
|
||||
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
|
||||
uint8_t nb_allowed_ri, ri_restriction,ri_bitlen;
|
||||
uint8_t max_ri = 0;
|
||||
uint8_t nb_allowed_ri, ri_bitlen;
|
||||
uint8_t ri_restriction = 0;
|
||||
|
||||
if (codebookConfig == NULL) {
|
||||
csi_report->csi_meas_bitlen.ri_bitlen=0;
|
||||
return max_ri;
|
||||
return ri_restriction;
|
||||
}
|
||||
|
||||
// codebook type1 single panel
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present){
|
||||
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
|
||||
if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two){
|
||||
// two antenna ports case
|
||||
/* From Spec 38.212
|
||||
* If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
|
||||
* values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
|
||||
* TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
|
||||
* 5.2.2.2.1 [6, TS 38.214].
|
||||
*
|
||||
* But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to
|
||||
* calculate RI for antennas equal or more than two.
|
||||
* */
|
||||
AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present");
|
||||
|
||||
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||
|
||||
/* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
config when equalent ASN structure present */
|
||||
if (0==*(csi_reportconfig->dummy)){
|
||||
nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
else{
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction, &max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
|
||||
ri_bitlen = ri_bitlen<1?ri_bitlen:1; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
||||
}
|
||||
@@ -254,43 +235,27 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present ==
|
||||
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) {
|
||||
// 4 ports
|
||||
AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present");
|
||||
|
||||
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||
|
||||
/* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
config when equalent ASN structure present*/
|
||||
if (0==*(csi_reportconfig->dummy)){
|
||||
nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0), &max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
else{
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction,&max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
|
||||
ri_bitlen = ri_bitlen<2?ri_bitlen:2; //from the spec 38.212 and table 6.3.1.1.2-3: RI, LI, CQI, and CRI of codebookType=typeI-SinglePanel
|
||||
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
||||
}
|
||||
else {
|
||||
// more than 4 ports
|
||||
AssertFatal (NULL!=csi_reportconfig->dummy, "nrofCQIsPerReport is not present");
|
||||
|
||||
ri_restriction = csi_reportconfig->codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->typeI_SinglePanel_ri_Restriction.buf[0];
|
||||
|
||||
/* Replace dummy with the nrofCQIsPerReport from the CSIreport
|
||||
config when equalent ASN structure present */
|
||||
if (0==*(csi_reportconfig->dummy)){
|
||||
nb_allowed_ri = number_of_bits_set((ri_restriction & 0xf0),&max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
else{
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction, &max_ri);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
}
|
||||
nb_allowed_ri = number_of_bits_set(ri_restriction);
|
||||
ri_bitlen = ceil(log2(nb_allowed_ri));
|
||||
|
||||
csi_report->csi_meas_bitlen.ri_bitlen=ri_bitlen;
|
||||
}
|
||||
}
|
||||
return max_ri;
|
||||
return ri_restriction;
|
||||
}
|
||||
else
|
||||
AssertFatal(1==0,"Other configurations not yet implemented\n");
|
||||
@@ -298,66 +263,295 @@ uint8_t compute_ri_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
}
|
||||
|
||||
void compute_li_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
uint8_t max_ri,
|
||||
uint8_t ri_restriction,
|
||||
nr_csi_report_t *csi_report){
|
||||
|
||||
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
|
||||
if (codebookConfig == NULL) {
|
||||
csi_report->csi_meas_bitlen.li_bitlen=0;
|
||||
return;
|
||||
for(int i=0; i<8; i++) {
|
||||
if (codebookConfig == NULL || ((ri_restriction>>i)&0x01) == 0)
|
||||
csi_report->csi_meas_bitlen.li_bitlen[i]=0;
|
||||
else {
|
||||
// codebook type1 single panel
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present)
|
||||
csi_report->csi_meas_bitlen.li_bitlen[i]=ceil(log2(i+1))<2?ceil(log2(i+1)):2;
|
||||
else
|
||||
AssertFatal(1==0,"Other configurations not yet implemented\n");
|
||||
}
|
||||
}
|
||||
// codebook type1 single panel
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel==codebookConfig->codebookType.choice.type1->subType.present){
|
||||
/* From Spec 38.212
|
||||
* If the higher layer parameter nrofCQIsPerReport=1, nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator
|
||||
* values in the 4 LSBs of the higher layer parameter typeI-SinglePanel-ri-Restriction according to Subclause 5.2.2.2.1 [6,
|
||||
* TS 38.214]; otherwise nRI in Table 6.3.1.1.2-3 is the number of allowed rank indicator values according to Subclause
|
||||
* 5.2.2.2.1 [6, TS 38.214].
|
||||
*
|
||||
* But from Current RRC ASN structures nrofCQIsPerReport is not present. Present a dummy variable is present so using it to
|
||||
* calculate RI for antennas equal or more than two.
|
||||
*/
|
||||
//! TODO: The bit length of LI is as follows LI = log2(RI), Need to confirm wheather we should consider maximum RI can be reported from ri_restricted
|
||||
// or we should consider reported RI. If we need to consider reported RI for calculating LI bit length then we need to modify the code.
|
||||
csi_report->csi_meas_bitlen.li_bitlen=ceil(log2(max_ri))<2?ceil(log2(max_ri)):2;
|
||||
}
|
||||
else
|
||||
AssertFatal(1==0,"Other configurations not yet implemented\n");
|
||||
}
|
||||
|
||||
|
||||
void get_n1n2_o1o2_singlepanel(int *n1, int *n2, int *o1, int *o2,
|
||||
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo *morethantwo) {
|
||||
|
||||
// Table 5.2.2.2.1-2 in 38.214 for supported configurations
|
||||
switch(morethantwo->n1_n2.present){
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 2;
|
||||
*n2 = 1;
|
||||
*o1 = 4;
|
||||
*o2 = 1;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_two_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 2;
|
||||
*n2 = 2;
|
||||
*o1 = 4;
|
||||
*o2 = 4;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_one_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 4;
|
||||
*n2 = 1;
|
||||
*o1 = 4;
|
||||
*o2 = 1;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_three_two_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 3;
|
||||
*n2 = 2;
|
||||
*o1 = 4;
|
||||
*o2 = 4;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_one_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 6;
|
||||
*n2 = 1;
|
||||
*o1 = 4;
|
||||
*o2 = 1;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_two_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 4;
|
||||
*n2 = 2;
|
||||
*o1 = 4;
|
||||
*o2 = 4;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_one_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 8;
|
||||
*n2 = 1;
|
||||
*o1 = 4;
|
||||
*o2 = 1;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_three_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 4;
|
||||
*n2 = 3;
|
||||
*o1 = 4;
|
||||
*o2 = 4;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_six_two_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 4;
|
||||
*n2 = 2;
|
||||
*o1 = 4;
|
||||
*o2 = 4;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_twelve_one_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 12;
|
||||
*n2 = 1;
|
||||
*o1 = 4;
|
||||
*o2 = 1;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_four_four_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 4;
|
||||
*n2 = 4;
|
||||
*o1 = 4;
|
||||
*o2 = 4;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_eight_two_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 8;
|
||||
*n2 = 2;
|
||||
*o1 = 4;
|
||||
*o2 = 4;
|
||||
break;
|
||||
case (NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_sixteen_one_TypeI_SinglePanel_Restriction):
|
||||
*n1 = 16;
|
||||
*n2 = 1;
|
||||
*o1 = 4;
|
||||
*o2 = 1;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Not supported configuration for n1_n2 in codebook configuration");
|
||||
}
|
||||
}
|
||||
|
||||
void get_x1x2_bitlen_singlepanel(int n1, int n2, int o1, int o2,
|
||||
int *x1, int *x2, int rank, int codebook_mode) {
|
||||
|
||||
// Table 6.3.1.1.2-1 in 38.212
|
||||
switch(rank){
|
||||
case 1:
|
||||
if(n2>1) {
|
||||
if (codebook_mode == 1) {
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
||||
*x2 = 2;
|
||||
}
|
||||
else {
|
||||
*x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2));
|
||||
*x2 = 4;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (codebook_mode == 1) {
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
||||
*x2 = 2;
|
||||
}
|
||||
else {
|
||||
*x1 = ceil(log2(n1*o1/2));
|
||||
*x2 = 4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(n1*n2 == 2) {
|
||||
if (codebook_mode == 1) {
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
||||
*x2 = 1;
|
||||
}
|
||||
else {
|
||||
*x1 = ceil(log2(n1*o1/2));
|
||||
*x2 = 3;
|
||||
}
|
||||
*x1 += 1;
|
||||
}
|
||||
else {
|
||||
if(n2>1) {
|
||||
if (codebook_mode == 1) {
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
||||
*x2 = 3;
|
||||
}
|
||||
else {
|
||||
*x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2/2));
|
||||
*x2 = 3;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (codebook_mode == 1) {
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
||||
*x2 = 1;
|
||||
}
|
||||
else {
|
||||
*x1 = ceil(log2(n1*o1/2));
|
||||
*x2 = 3;
|
||||
}
|
||||
}
|
||||
*x1 += 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
if(n1*n2 == 2) {
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
||||
*x2 = 1;
|
||||
}
|
||||
else {
|
||||
if(n1*n2 >= 8) {
|
||||
*x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2)) + 2;
|
||||
*x2 = 1;
|
||||
}
|
||||
else {
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2)) + 2;
|
||||
*x2 = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
||||
*x2 = 1;
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
if(n1 == 4 && n2 == 1) {
|
||||
*x1 = ceil(log2(n1*o1/2)) + ceil(log2(n2*o2));
|
||||
*x2 = 1;
|
||||
}
|
||||
else {
|
||||
if(n1 > 2 && n2 == 2) {
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2/2));
|
||||
*x2 = 1;
|
||||
}
|
||||
else {
|
||||
*x1 = ceil(log2(n1*o1)) + ceil(log2(n2*o2));
|
||||
*x2 = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid rank in x1 x2 bit length computation\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void compute_pmi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
uint8_t ri_restriction,
|
||||
nr_csi_report_t *csi_report){
|
||||
|
||||
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
|
||||
for(int i=0; i<8; i++) {
|
||||
csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=0;
|
||||
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=0;
|
||||
if (codebookConfig == NULL || ((ri_restriction>>i)&0x01) == 0)
|
||||
return;
|
||||
else {
|
||||
if(codebookConfig->codebookType.present == NR_CodebookConfig__codebookType_PR_type1) {
|
||||
if(codebookConfig->codebookType.choice.type1->subType.present == NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel) {
|
||||
if(codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.present ==
|
||||
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_two) {
|
||||
if (i==0)
|
||||
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=2;
|
||||
if (i==1)
|
||||
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=1;
|
||||
}
|
||||
else { // more than two
|
||||
int n1,n2,o1,o2,x1,x2;
|
||||
get_n1n2_o1o2_singlepanel(&n1,&n2,&o1,&o2,codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel->nrOfAntennaPorts.choice.moreThanTwo);
|
||||
get_x1x2_bitlen_singlepanel(n1,n2,o1,o2,&x1,&x2,i+1,codebookConfig->codebookType.choice.type1->codebookMode);
|
||||
csi_report->csi_meas_bitlen.pmi_x1_bitlen[i]=x1;
|
||||
csi_report->csi_meas_bitlen.pmi_x2_bitlen[i]=x2;
|
||||
}
|
||||
}
|
||||
else
|
||||
AssertFatal(1==0,"Type1 Multi-panel Codebook Config not yet implemented\n");
|
||||
}
|
||||
else
|
||||
AssertFatal(1==0,"Type2 Codebook Config not yet implemented\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void compute_cqi_bitlen(struct NR_CSI_ReportConfig *csi_reportconfig,
|
||||
uint8_t max_ri,
|
||||
uint8_t ri_restriction,
|
||||
nr_csi_report_t *csi_report){
|
||||
|
||||
struct NR_CodebookConfig *codebookConfig = csi_reportconfig->codebookConfig;
|
||||
struct NR_CSI_ReportConfig__reportFreqConfiguration *freq_config = csi_reportconfig->reportFreqConfiguration;
|
||||
|
||||
if (*freq_config->cqi_FormatIndicator == NR_CSI_ReportConfig__reportFreqConfiguration__cqi_FormatIndicator_widebandCQI) {
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen = 4;
|
||||
if(codebookConfig != NULL) {
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel == codebookConfig->codebookType.choice.type1->subType.present){
|
||||
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
|
||||
if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) {
|
||||
if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present >
|
||||
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) {
|
||||
// more than 4 antenna ports
|
||||
if (max_ri > 4)
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen += 4; // CQI for second TB
|
||||
for(int i=0; i<8; i++) {
|
||||
if ((ri_restriction>>i)&0x01) {
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen[i] = 4;
|
||||
if(codebookConfig != NULL) {
|
||||
if (NR_CodebookConfig__codebookType__type1__subType_PR_typeI_SinglePanel == codebookConfig->codebookType.choice.type1->subType.present){
|
||||
struct NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel *type1single = codebookConfig->codebookType.choice.type1->subType.choice.typeI_SinglePanel;
|
||||
if (type1single->nrOfAntennaPorts.present == NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts_PR_moreThanTwo) {
|
||||
if (type1single->nrOfAntennaPorts.choice.moreThanTwo->n1_n2.present >
|
||||
NR_CodebookConfig__codebookType__type1__subType__typeI_SinglePanel__nrOfAntennaPorts__moreThanTwo__n1_n2_PR_two_one_TypeI_SinglePanel_Restriction) {
|
||||
// more than 4 antenna ports
|
||||
if (i > 4)
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen[i] += 4; // CQI for second TB
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen[i] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
AssertFatal(1==0,"Sub-band CQI reporting not yet supported");
|
||||
}
|
||||
|
||||
|
||||
//!TODO : same function can be written to handle csi_resources
|
||||
void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_info, int UE_id, module_id_t Mod_idP){
|
||||
uint8_t csi_report_id = 0;
|
||||
uint8_t nb_resources = 0;
|
||||
uint8_t max_ri = 0;
|
||||
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type;
|
||||
NR_CSI_ResourceConfigId_t csi_ResourceConfigId;
|
||||
struct NR_CSI_ResourceConfig *csi_resourceconfig;
|
||||
@@ -428,8 +622,21 @@ void compute_csi_bitlen(NR_CSI_MeasConfig_t *csi_MeasConfig, NR_UE_info_t *UE_in
|
||||
break;
|
||||
case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI):
|
||||
csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources));
|
||||
max_ri = compute_ri_bitlen(csi_reportconfig, csi_report);
|
||||
compute_cqi_bitlen(csi_reportconfig, max_ri, csi_report);
|
||||
csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report);
|
||||
compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
|
||||
break;
|
||||
case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI):
|
||||
csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources));
|
||||
csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report);
|
||||
compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
|
||||
compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
|
||||
break;
|
||||
case (NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI):
|
||||
csi_report->csi_meas_bitlen.cri_bitlen=ceil(log2(nb_resources));
|
||||
csi_report->csi_meas_bitlen.ri_restriction = compute_ri_bitlen(csi_reportconfig, csi_report);
|
||||
compute_li_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
|
||||
compute_cqi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
|
||||
compute_pmi_bitlen(csi_reportconfig, csi_report->csi_meas_bitlen.ri_restriction, csi_report);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Not yet supported CSI report quantity type");
|
||||
@@ -442,7 +649,8 @@ uint16_t nr_get_csi_bitlen(int Mod_idP,
|
||||
int UE_id,
|
||||
uint8_t csi_report_id) {
|
||||
|
||||
uint16_t csi_bitlen =0;
|
||||
uint16_t csi_bitlen = 0;
|
||||
uint16_t max_bitlen = 0;
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
|
||||
L1_RSRP_bitlen_t * CSI_report_bitlen = NULL;
|
||||
CSI_Meas_bitlen_t * csi_meas_bitlen = NULL;
|
||||
@@ -455,7 +663,18 @@ uint16_t nr_get_csi_bitlen(int Mod_idP,
|
||||
(CSI_report_bitlen->nb_ssbri_cri -1 )));
|
||||
} else{
|
||||
csi_meas_bitlen = &(UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen); //This might need to be moodif for Aperiodic CSI-RS measurements
|
||||
csi_bitlen+= (csi_meas_bitlen->cri_bitlen +csi_meas_bitlen->ri_bitlen+csi_meas_bitlen->li_bitlen+csi_meas_bitlen->cqi_bitlen+csi_meas_bitlen->pmi_x1_bitlen+csi_meas_bitlen->pmi_x2_bitlen);
|
||||
uint16_t temp_bitlen;
|
||||
for (int i=0; i<8; i++) {
|
||||
temp_bitlen = (csi_meas_bitlen->cri_bitlen+
|
||||
csi_meas_bitlen->ri_bitlen+
|
||||
csi_meas_bitlen->li_bitlen[i]+
|
||||
csi_meas_bitlen->cqi_bitlen[i]+
|
||||
csi_meas_bitlen->pmi_x1_bitlen[i]+
|
||||
csi_meas_bitlen->pmi_x2_bitlen[i]);
|
||||
if(temp_bitlen>max_bitlen)
|
||||
max_bitlen = temp_bitlen;
|
||||
}
|
||||
csi_bitlen += max_bitlen;
|
||||
}
|
||||
|
||||
return csi_bitlen;
|
||||
@@ -718,36 +937,32 @@ void tci_handling(module_id_t Mod_idP, int UE_id, frame_t frame, slot_t slot) {
|
||||
idx: resource set index
|
||||
*/
|
||||
|
||||
//for all reported SSB
|
||||
for (idx = 0; idx < nb_of_csi_ssb_report; idx++) {
|
||||
nr_ssbri_cri = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri;
|
||||
//extracting the ssb indexes
|
||||
for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) {
|
||||
ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[ssb_idx];
|
||||
}
|
||||
|
||||
//if strongest measured RSRP is configured
|
||||
strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
|
||||
ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp;
|
||||
LOG_D(NR_MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
|
||||
|
||||
//if current ssb rsrp is greater than better rsrp
|
||||
if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) {
|
||||
better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report];
|
||||
target_ssb_beam_index = idx * nb_of_csi_ssb_report;
|
||||
}
|
||||
|
||||
for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) {
|
||||
ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp);
|
||||
|
||||
//if current reported rsrp is greater than better rsrp
|
||||
if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) {
|
||||
better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx];
|
||||
target_ssb_beam_index = idx * nb_of_csi_ssb_report + diff_rsrp_idx;
|
||||
}
|
||||
}
|
||||
nr_ssbri_cri = sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri;
|
||||
//extracting the ssb indexes
|
||||
for (ssb_idx = 0; ssb_idx < nr_ssbri_cri; ssb_idx++) {
|
||||
ssb_index[idx * nb_of_csi_ssb_report + ssb_idx] = sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[ssb_idx];
|
||||
}
|
||||
|
||||
//if strongest measured RSRP is configured
|
||||
strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP);
|
||||
ssb_rsrp[idx * nb_of_csi_ssb_report] = strongest_ssb_rsrp;
|
||||
LOG_D(NR_MAC,"ssb_rsrp = %d\n",strongest_ssb_rsrp);
|
||||
|
||||
//if current ssb rsrp is greater than better rsrp
|
||||
if(ssb_rsrp[idx * nb_of_csi_ssb_report] > better_rsrp_reported) {
|
||||
better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report];
|
||||
target_ssb_beam_index = idx * nb_of_csi_ssb_report;
|
||||
}
|
||||
|
||||
for(diff_rsrp_idx =1; diff_rsrp_idx < nr_ssbri_cri; diff_rsrp_idx++) {
|
||||
ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] = get_diff_rsrp(sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx-1], strongest_ssb_rsrp);
|
||||
|
||||
//if current reported rsrp is greater than better rsrp
|
||||
if(ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx] > better_rsrp_reported) {
|
||||
better_rsrp_reported = ssb_rsrp[idx * nb_of_csi_ssb_report + diff_rsrp_idx];
|
||||
target_ssb_beam_index = idx * nb_of_csi_ssb_report + diff_rsrp_idx;
|
||||
}
|
||||
}
|
||||
|
||||
if(ssb_index[target_ssb_beam_index] != ssb_index[curr_ssb_beam_index] && ssb_rsrp[target_ssb_beam_index] > ssb_rsrp[curr_ssb_beam_index]) {
|
||||
if( ssb_rsrp[target_ssb_beam_index] - ssb_rsrp[curr_ssb_beam_index] > L1_RSRP_HYSTERIS) {
|
||||
@@ -876,7 +1091,8 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info,
|
||||
int *cumul_bits,
|
||||
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type){
|
||||
|
||||
uint8_t cri_ssbri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.cri_ssbri_bitlen;
|
||||
nr_csi_report_t *csi_report = &UE_info->csi_report_template[UE_id][csi_report_id];
|
||||
uint8_t cri_ssbri_bitlen = csi_report->CSI_report_bitlen.cri_ssbri_bitlen;
|
||||
uint16_t curr_payload;
|
||||
|
||||
/*! As per the spec 38.212 and table: 6.3.1.1.2-12 in a single UCI sequence we can have multiple CSI_report
|
||||
@@ -897,44 +1113,43 @@ void evaluate_rsrp_report(NR_UE_info_t *UE_info,
|
||||
multiple simultaneous spatial domain receive filter
|
||||
*/
|
||||
|
||||
int idx = 0; //Since for SSB RSRP reporting in RRC can configure only one ssb resource set per one report config
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri = UE_info->csi_report_template[UE_id][csi_report_id].CSI_report_bitlen.nb_ssbri_cri;
|
||||
sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri = csi_report->CSI_report_bitlen.nb_ssbri_cri;
|
||||
|
||||
for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) {
|
||||
for (int csi_ssb_idx = 0; csi_ssb_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri ; csi_ssb_idx++) {
|
||||
curr_payload = pickandreverse_bits(payload, cri_ssbri_bitlen, *cumul_bits);
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type)
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
|
||||
*(UE_info->csi_report_template[UE_id][csi_report_id].SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
|
||||
else
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
|
||||
*(UE_info->csi_report_template[UE_id][csi_report_id].CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
|
||||
|
||||
if (NR_CSI_ReportConfig__reportQuantity_PR_ssb_Index_RSRP == reportQuantity_type) {
|
||||
sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
|
||||
*(csi_report->SSB_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
|
||||
LOG_D(MAC,"SSB_index = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
|
||||
}
|
||||
else {
|
||||
sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx] =
|
||||
*(csi_report->CSI_Index_list[cri_ssbri_bitlen>0?((curr_payload)&~(~1<<(cri_ssbri_bitlen-1))):cri_ssbri_bitlen]);
|
||||
LOG_D(MAC,"CSI-RS Resource Indicator = %d\n",sched_ctrl->CSI_report.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
|
||||
}
|
||||
*cumul_bits += cri_ssbri_bitlen;
|
||||
if(UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type == NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP)
|
||||
LOG_D(MAC,"CSI-RS Resource Indicator = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
|
||||
else
|
||||
LOG_D(MAC,"SSB Resource Indicator = %d\n",sched_ctrl->CSI_report[idx].choice.ssb_cri_report.CRI_SSBRI[csi_ssb_idx]);
|
||||
|
||||
}
|
||||
|
||||
curr_payload = pickandreverse_bits(payload, 7, *cumul_bits);
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP = curr_payload & 0x7f;
|
||||
sched_ctrl->CSI_report.ssb_cri_report.RSRP = curr_payload & 0x7f;
|
||||
*cumul_bits += 7;
|
||||
|
||||
for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report[idx].choice.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) {
|
||||
for (int diff_rsrp_idx =0; diff_rsrp_idx < sched_ctrl->CSI_report.ssb_cri_report.nr_ssbri_cri - 1; diff_rsrp_idx++ ) {
|
||||
curr_payload = pickandreverse_bits(payload, 4, *cumul_bits);
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f;
|
||||
sched_ctrl->CSI_report.ssb_cri_report.diff_RSRP[diff_rsrp_idx] = curr_payload & 0x0f;
|
||||
*cumul_bits += 4;
|
||||
}
|
||||
UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report++;
|
||||
int strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP);
|
||||
csi_report->nb_of_csi_ssb_report++;
|
||||
int strongest_ssb_rsrp = get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP);
|
||||
NR_mac_stats_t *stats = &UE_info->mac_stats[UE_id];
|
||||
// including ssb rsrp in mac stats
|
||||
stats->cumul_rsrp += strongest_ssb_rsrp;
|
||||
stats->num_rsrp_meas++;
|
||||
LOG_D(MAC,"rsrp_id = %d rsrp = %d\n",
|
||||
sched_ctrl->CSI_report[idx].choice.ssb_cri_report.RSRP,
|
||||
strongest_ssb_rsrp);
|
||||
sched_ctrl->CSI_report.ssb_cri_report.RSRP,
|
||||
get_measured_rsrp(sched_ctrl->CSI_report.ssb_cri_report.RSRP));
|
||||
}
|
||||
|
||||
|
||||
@@ -943,39 +1158,122 @@ void evaluate_cri_report(uint8_t *payload,
|
||||
int cumul_bits,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl){
|
||||
|
||||
int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id?
|
||||
|
||||
uint8_t temp_cri = pickandreverse_bits(payload, cri_bitlen, cumul_bits);
|
||||
sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.cri = temp_cri;
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cri = temp_cri;
|
||||
}
|
||||
|
||||
void evaluate_ri_report(uint8_t *payload,
|
||||
uint8_t ri_bitlen,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl){
|
||||
int evaluate_ri_report(uint8_t *payload,
|
||||
uint8_t ri_bitlen,
|
||||
uint8_t ri_restriction,
|
||||
int cumul_bits,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl){
|
||||
|
||||
AssertFatal(1==0,"Evaluation of RI report not yet implemented\n");
|
||||
uint8_t ri_index = pickandreverse_bits(payload, ri_bitlen, cumul_bits);
|
||||
int count=0;
|
||||
for (int i=0; i<8; i++) {
|
||||
if ((ri_restriction>>i)&0x01) {
|
||||
if(count == ri_index) {
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.ri = i;
|
||||
LOG_I(MAC,"CSI Reported Rank %d\n", i+1);
|
||||
return i;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
AssertFatal(1==0, "Decoded ri %d does not correspond to any valid value in ri_restriction %d\n",ri_index,ri_restriction);
|
||||
}
|
||||
|
||||
|
||||
void evaluate_cqi_report(uint8_t *payload,
|
||||
uint8_t cqi_bitlen,
|
||||
int *cumul_bits,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl){
|
||||
nr_csi_report_t *csi_report,
|
||||
int cumul_bits,
|
||||
uint8_t ri,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
long *cqi_Table){
|
||||
|
||||
//TODO sub-band CQI report not yet implemented
|
||||
int idx = 0; // FIXME not sure about this index. Should it be the same as csi_report_id?
|
||||
|
||||
uint8_t temp_cqi = pickandreverse_bits(payload, 4, *cumul_bits);
|
||||
sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi;
|
||||
*cumul_bits += 4;
|
||||
int cqi_bitlen = csi_report->csi_meas_bitlen.cqi_bitlen[ri];
|
||||
|
||||
uint8_t temp_cqi = pickandreverse_bits(payload, 4, cumul_bits);
|
||||
|
||||
// NR_CSI_ReportConfig__cqi_Table_table1 = 0
|
||||
// NR_CSI_ReportConfig__cqi_Table_table2 = 1
|
||||
// NR_CSI_ReportConfig__cqi_Table_table3 = 2
|
||||
if (cqi_Table)
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.cqi_table = *cqi_Table;
|
||||
else
|
||||
AssertFatal(1==0,"CQI Table not present in RRC configuration\n");
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_1tb = temp_cqi;
|
||||
LOG_I(MAC,"Wide-band CQI for the first TB %d\n", temp_cqi);
|
||||
if (cqi_bitlen > 4) {
|
||||
temp_cqi = pickandreverse_bits(payload, 4, *cumul_bits);
|
||||
sched_ctrl->CSI_report[idx].choice.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi;
|
||||
temp_cqi = pickandreverse_bits(payload, 4, cumul_bits);
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.wb_cqi_2tb = temp_cqi;
|
||||
LOG_D(MAC,"Wide-band CQI for the second TB %d\n", temp_cqi);
|
||||
}
|
||||
sched_ctrl->set_mcs = TRUE;
|
||||
}
|
||||
|
||||
|
||||
uint8_t evaluate_pmi_report(uint8_t *payload,
|
||||
nr_csi_report_t *csi_report,
|
||||
int cumul_bits,
|
||||
uint8_t ri,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl){
|
||||
|
||||
int x1_bitlen = csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri];
|
||||
int x2_bitlen = csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri];
|
||||
int tot_bitlen = x1_bitlen + x2_bitlen;
|
||||
|
||||
//in case of 2 port CSI configuration x1 is empty and the information bits are in x2
|
||||
int temp_pmi = pickandreverse_bits(payload, tot_bitlen, cumul_bits);
|
||||
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1 = temp_pmi&((1<<x1_bitlen)-1);
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2 = (temp_pmi>>x1_bitlen)&((1<<x2_bitlen)-1);
|
||||
LOG_I(MAC,"PMI Report: X1 %d X2 %d\n",
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x1,
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.pmi_x2);
|
||||
|
||||
return tot_bitlen;
|
||||
|
||||
}
|
||||
|
||||
|
||||
int evaluate_li_report(uint8_t *payload,
|
||||
nr_csi_report_t *csi_report,
|
||||
int cumul_bits,
|
||||
uint8_t ri,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl){
|
||||
|
||||
int li_bitlen = csi_report->csi_meas_bitlen.li_bitlen[ri];
|
||||
|
||||
if (li_bitlen>0) {
|
||||
int temp_li = pickandreverse_bits(payload, li_bitlen, cumul_bits);
|
||||
LOG_I(MAC,"LI %d\n",temp_li);
|
||||
sched_ctrl->CSI_report.cri_ri_li_pmi_cqi_report.li = temp_li;
|
||||
}
|
||||
return li_bitlen;
|
||||
|
||||
}
|
||||
|
||||
void skip_zero_padding(int *cumul_bits,
|
||||
nr_csi_report_t *csi_report,
|
||||
uint8_t ri,
|
||||
uint16_t max_bitlen) {
|
||||
|
||||
// actual number of reported bits depends on the reported rank
|
||||
// zero padding bits are added to have a predetermined max bit length to decode
|
||||
|
||||
uint16_t reported_bitlen = csi_report->csi_meas_bitlen.cri_bitlen+
|
||||
csi_report->csi_meas_bitlen.ri_bitlen+
|
||||
csi_report->csi_meas_bitlen.li_bitlen[ri]+
|
||||
csi_report->csi_meas_bitlen.cqi_bitlen[ri]+
|
||||
csi_report->csi_meas_bitlen.pmi_x1_bitlen[ri]+
|
||||
csi_report->csi_meas_bitlen.pmi_x2_bitlen[ri];
|
||||
|
||||
*cumul_bits+=(max_bitlen-reported_bitlen);
|
||||
}
|
||||
|
||||
|
||||
void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu,
|
||||
frame_t frame,
|
||||
@@ -988,21 +1286,25 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
RC.nrmac[Mod_idP]->common_channels->ServingCellConfigCommon;
|
||||
const int n_slots_frame = nr_slots_per_frame[*scc->ssbSubcarrierSpacing];
|
||||
uint8_t *payload = uci_pdu->csi_part1.csi_part1_payload;
|
||||
uint16_t bitlen = uci_pdu->csi_part1.csi_part1_bit_len;
|
||||
NR_CSI_ReportConfig__reportQuantity_PR reportQuantity_type = NR_CSI_ReportConfig__reportQuantity_PR_NOTHING;
|
||||
NR_UE_info_t *UE_info = &(RC.nrmac[Mod_idP]->UE_info);
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
int cumul_bits = 0;
|
||||
int r_index = -1;
|
||||
for (int csi_report_id = 0; csi_report_id < csi_MeasConfig->csi_ReportConfigToAddModList->list.count; csi_report_id++ ) {
|
||||
UE_info->csi_report_template[UE_id][csi_report_id].nb_of_csi_ssb_report = 0;
|
||||
nr_csi_report_t *csi_report = &UE_info->csi_report_template[UE_id][csi_report_id];
|
||||
csi_report->nb_of_csi_ssb_report = 0;
|
||||
uint8_t cri_bitlen = 0;
|
||||
uint8_t ri_bitlen = 0;
|
||||
uint8_t cqi_bitlen = 0;
|
||||
uint8_t li_bitlen = 0;
|
||||
uint8_t pmi_bitlen = 0;
|
||||
NR_CSI_ReportConfig_t *csirep = csi_MeasConfig->csi_ReportConfigToAddModList->list.array[csi_report_id];
|
||||
int period, offset;
|
||||
csi_period_offset(csirep, NULL, &period, &offset);
|
||||
// verify if report with current id has been scheduled for this frame and slot
|
||||
if ((n_slots_frame*frame + slot - offset)%period == 0) {
|
||||
reportQuantity_type = UE_info->csi_report_template[UE_id][csi_report_id].reportQuantity_type;
|
||||
reportQuantity_type = csi_report->reportQuantity_type;
|
||||
LOG_D(MAC,"SFN/SF:%d/%d reportQuantity type = %d\n",frame,slot,reportQuantity_type);
|
||||
switch(reportQuantity_type){
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RSRP:
|
||||
@@ -1012,18 +1314,49 @@ void extract_pucch_csi_report(NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
evaluate_rsrp_report(UE_info,sched_ctrl,UE_id,csi_report_id,payload,&cumul_bits,reportQuantity_type);
|
||||
break;
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_CQI:
|
||||
cri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cri_bitlen;
|
||||
cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen;
|
||||
if(cri_bitlen)
|
||||
evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl);
|
||||
cumul_bits += cri_bitlen;
|
||||
ri_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.ri_bitlen;
|
||||
ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen;
|
||||
if(ri_bitlen)
|
||||
evaluate_ri_report(payload,ri_bitlen,sched_ctrl);
|
||||
r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl);
|
||||
cumul_bits += ri_bitlen;
|
||||
//TODO add zero padding bits when needed
|
||||
cqi_bitlen = UE_info->csi_report_template[UE_id][csi_report_id].csi_meas_bitlen.cqi_bitlen;
|
||||
if(cqi_bitlen)
|
||||
evaluate_cqi_report(payload,cqi_bitlen,&cumul_bits,sched_ctrl);
|
||||
if (r_index != -1)
|
||||
skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen);
|
||||
evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table);
|
||||
break;
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_PMI_CQI:
|
||||
cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen;
|
||||
if(cri_bitlen)
|
||||
evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl);
|
||||
cumul_bits += cri_bitlen;
|
||||
ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen;
|
||||
if(ri_bitlen)
|
||||
r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl);
|
||||
cumul_bits += ri_bitlen;
|
||||
if (r_index != -1)
|
||||
skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen);
|
||||
pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl);
|
||||
cumul_bits += pmi_bitlen;
|
||||
evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table);
|
||||
break;
|
||||
case NR_CSI_ReportConfig__reportQuantity_PR_cri_RI_LI_PMI_CQI:
|
||||
cri_bitlen = csi_report->csi_meas_bitlen.cri_bitlen;
|
||||
if(cri_bitlen)
|
||||
evaluate_cri_report(payload,cri_bitlen,cumul_bits,sched_ctrl);
|
||||
cumul_bits += cri_bitlen;
|
||||
ri_bitlen = csi_report->csi_meas_bitlen.ri_bitlen;
|
||||
if(ri_bitlen)
|
||||
r_index = evaluate_ri_report(payload,ri_bitlen,csi_report->csi_meas_bitlen.ri_restriction,cumul_bits,sched_ctrl);
|
||||
cumul_bits += ri_bitlen;
|
||||
li_bitlen = evaluate_li_report(payload,csi_report,cumul_bits,r_index,sched_ctrl);
|
||||
cumul_bits += li_bitlen;
|
||||
if (r_index != -1)
|
||||
skip_zero_padding(&cumul_bits,csi_report,r_index,bitlen);
|
||||
pmi_bitlen = evaluate_pmi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl);
|
||||
cumul_bits += pmi_bitlen;
|
||||
evaluate_cqi_report(payload,csi_report,cumul_bits,r_index,sched_ctrl,csirep->cqi_Table);
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0, "Invalid or not supported CSI measurement report\n");
|
||||
|
||||
@@ -720,7 +720,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt++;
|
||||
UE_info->mac_stats[UE_id].ulsch_DTX++;
|
||||
}
|
||||
if (UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) {
|
||||
if (!get_softmodem_params()->phy_test && UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt >= pusch_failure_thres) {
|
||||
LOG_W(NR_MAC,"Detected UL Failure on PUSCH after %d PUSCH DTX, stopping scheduling\n",
|
||||
UE_info->UE_sched_ctrl[UE_id].pusch_consecutive_dtx_cnt);
|
||||
UE_info->UE_sched_ctrl[UE_id].ul_failure = 1;
|
||||
@@ -1010,9 +1010,11 @@ bool allocate_ul_retransmission(module_id_t module_id,
|
||||
uint16_t new_rbSize;
|
||||
bool success = nr_find_nb_rb(retInfo->Qm,
|
||||
retInfo->R,
|
||||
1, // layers
|
||||
temp_ps.nrOfSymbols,
|
||||
temp_ps.N_PRB_DMRS * temp_ps.num_dmrs_symb,
|
||||
retInfo->tb_size,
|
||||
1, /* minimum of 1RB: need to find exact TBS, don't preclude any number */
|
||||
rbSize,
|
||||
&new_tbs,
|
||||
&new_rbSize);
|
||||
@@ -1265,8 +1267,9 @@ void pf_ul(module_id_t module_id,
|
||||
}
|
||||
|
||||
|
||||
const int min_rbSize = 5;
|
||||
/* Loop UE_sched to find max coeff and allocate transmission */
|
||||
while (UE_sched.head >= 0 && max_num_ue> 0 && n_rb_sched > 0) {
|
||||
while (UE_sched.head >= 0 && max_num_ue> 0 && n_rb_sched >= min_rbSize) {
|
||||
/* Find max coeff */
|
||||
int *max = &UE_sched.head; /* Find max coeff: assume head is max */
|
||||
int *p = &UE_sched.next[*max];
|
||||
@@ -1312,8 +1315,7 @@ void pf_ul(module_id_t module_id,
|
||||
|
||||
/* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */
|
||||
max_num_ue--;
|
||||
if (max_num_ue < 0)
|
||||
return;
|
||||
AssertFatal(max_num_ue >= 0, "Illegal max_num_ue %d\n", max_num_ue);
|
||||
|
||||
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
|
||||
NR_BWP_UplinkDedicated_t *ubwpd= cg ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP:NULL;
|
||||
@@ -1355,9 +1357,11 @@ void pf_ul(module_id_t module_id,
|
||||
uint32_t TBS = 0;
|
||||
nr_find_nb_rb(sched_pusch->Qm,
|
||||
sched_pusch->R,
|
||||
1, // layers
|
||||
ps->nrOfSymbols,
|
||||
ps->N_PRB_DMRS * ps->num_dmrs_symb,
|
||||
B,
|
||||
min_rbSize,
|
||||
max_rbSize,
|
||||
&TBS,
|
||||
&rbSize);
|
||||
|
||||
@@ -245,7 +245,7 @@ void nr_configure_pucch(nfapi_nr_pucch_pdu_t* pucch_pdu,
|
||||
uint16_t O_csi,
|
||||
uint16_t O_ack,
|
||||
uint8_t O_sr,
|
||||
int r_pucch);
|
||||
int r_pucch);
|
||||
|
||||
void find_search_space(int ss_type,
|
||||
NR_BWP_Downlink_t *bwp,
|
||||
@@ -310,7 +310,8 @@ void nr_set_pdsch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
const NR_BWP_Downlink_t *bwp,
|
||||
const NR_BWP_DownlinkDedicated_t *bwpd0,
|
||||
int tda,
|
||||
const long dci_format,
|
||||
uint8_t layers,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
NR_pdsch_semi_static_t *ps);
|
||||
|
||||
void nr_set_pusch_semi_static(const NR_ServingCellConfigCommon_t *scc,
|
||||
@@ -454,6 +455,13 @@ void find_SSB_and_RO_available(module_id_t module_idP);
|
||||
|
||||
void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps);
|
||||
|
||||
void set_dl_mcs(NR_sched_pdsch_t *sched_pdsch,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
uint8_t *target_mcs,
|
||||
uint8_t mcs_table_idx);
|
||||
|
||||
uint8_t set_dl_nrOfLayers(NR_UE_sched_ctrl_t *sched_ctrl);
|
||||
|
||||
void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *bwp);
|
||||
void calculate_preferred_ul_tda(module_id_t module_id, const NR_BWP_Uplink_t *ubwp);
|
||||
|
||||
@@ -461,9 +469,11 @@ bool find_free_CCE(module_id_t module_id, sub_frame_t slot, int UE_id);
|
||||
|
||||
bool nr_find_nb_rb(uint16_t Qm,
|
||||
uint16_t R,
|
||||
uint8_t nrOfLayers,
|
||||
uint16_t nb_symb_sch,
|
||||
uint16_t nb_dmrs_prb,
|
||||
uint32_t bytes,
|
||||
uint16_t nb_rb_min,
|
||||
uint16_t nb_rb_max,
|
||||
uint32_t *tbs,
|
||||
uint16_t *nb_rb);
|
||||
|
||||
@@ -391,7 +391,8 @@ typedef struct NR_sched_srs {
|
||||
typedef struct NR_pdsch_semi_static {
|
||||
int time_domain_allocation;
|
||||
uint8_t numDmrsCdmGrpsNoData;
|
||||
|
||||
uint8_t frontloaded_symb;
|
||||
int mapping_type;
|
||||
int startSymbolIndex;
|
||||
int nrOfSymbols;
|
||||
uint8_t nrOfLayers;
|
||||
@@ -477,6 +478,7 @@ struct CRI_RI_LI_PMI_CQI {
|
||||
uint8_t pmi_x2;
|
||||
uint8_t wb_cqi_1tb;
|
||||
uint8_t wb_cqi_2tb;
|
||||
uint8_t cqi_table;
|
||||
};
|
||||
|
||||
typedef struct CRI_SSB_RSRP {
|
||||
@@ -487,11 +489,8 @@ typedef struct CRI_SSB_RSRP {
|
||||
} CRI_SSB_RSRP_t;
|
||||
|
||||
struct CSI_Report {
|
||||
NR_CSI_Report_Config_PR present;
|
||||
union Config_CSI_Report {
|
||||
struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report;
|
||||
struct CRI_SSB_RSRP ssb_cri_report;
|
||||
} choice;
|
||||
struct CRI_RI_LI_PMI_CQI cri_ri_li_pmi_cqi_report;
|
||||
struct CRI_SSB_RSRP ssb_cri_report;
|
||||
};
|
||||
|
||||
#define MAX_SR_BITLEN 8
|
||||
@@ -504,12 +503,13 @@ typedef struct {
|
||||
}L1_RSRP_bitlen_t;
|
||||
|
||||
typedef struct{
|
||||
uint8_t ri_restriction;
|
||||
uint8_t cri_bitlen;
|
||||
uint8_t ri_bitlen;
|
||||
uint8_t li_bitlen;
|
||||
uint8_t pmi_x1_bitlen;
|
||||
uint8_t pmi_x2_bitlen;
|
||||
uint8_t cqi_bitlen;
|
||||
uint8_t li_bitlen[8];
|
||||
uint8_t pmi_x1_bitlen[8];
|
||||
uint8_t pmi_x2_bitlen[8];
|
||||
uint8_t cqi_bitlen[8];
|
||||
} CSI_Meas_bitlen_t;
|
||||
|
||||
typedef struct nr_csi_report {
|
||||
@@ -618,9 +618,9 @@ typedef struct {
|
||||
int pusch_consecutive_dtx_cnt;
|
||||
int pucch_consecutive_dtx_cnt;
|
||||
int ul_failure;
|
||||
struct CSI_Report CSI_report[MAX_CSI_REPORTS];
|
||||
struct CSI_Report CSI_report;
|
||||
bool SR;
|
||||
|
||||
bool set_mcs;
|
||||
/// information about every HARQ process
|
||||
NR_UE_harq_t harq_processes[NR_MAX_NB_HARQ_PROCESSES];
|
||||
/// HARQ processes that are free
|
||||
@@ -673,7 +673,6 @@ typedef struct {
|
||||
NR_mac_stats_t mac_stats[MAX_MOBILES_PER_GNB];
|
||||
NR_list_t list;
|
||||
int num_UEs;
|
||||
|
||||
bool active[MAX_MOBILES_PER_GNB];
|
||||
rnti_t rnti[MAX_MOBILES_PER_GNB];
|
||||
NR_CellGroupConfig_t *CellGroup[MAX_MOBILES_PER_GNB];
|
||||
|
||||
@@ -48,7 +48,6 @@
|
||||
#include "platform_constants.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "msc.h"
|
||||
#include "common/ngran_types.h"
|
||||
#include "targets/COMMON/openairinterface5g_limits.h"
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
@@ -60,7 +59,6 @@
|
||||
#include <pthread.h>
|
||||
|
||||
# include "gtpv1u_eNB_task.h"
|
||||
# include "gtpv1u.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
|
||||
#include "ENB_APP/enb_config.h"
|
||||
@@ -229,7 +227,7 @@ rlc_op_status_t cu_send_to_du(const protocol_ctxt_t *const ctxt,
|
||||
LOG_D(PDCP, "%s() (drb %ld) sending message to gtp size %d\n",
|
||||
__func__, rb_id, size);
|
||||
extern instance_t CUuniqInstance;
|
||||
itti_send_msg_to_task(TASK_VARIABLE, CUuniqInstance, message_p);
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -1058,14 +1056,6 @@ pdcp_data_ind(
|
||||
ctxt_pP->rnti,
|
||||
rb_id + 4,
|
||||
sdu_buffer_sizeP - payload_offset );
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_PDCP_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
"0 GTPV1U_ENB_TUNNEL_DATA_REQ ue %x rab %u len %u",
|
||||
ctxt_pP->rnti,
|
||||
rb_id + 4,
|
||||
sdu_buffer_sizeP - payload_offset);
|
||||
//LOG_T(PDCP,"Sending to GTPV1U %d bytes\n", sdu_buffer_sizeP - payload_offset);
|
||||
gtpu_buffer_p = itti_malloc(TASK_PDCP_ENB, TASK_GTPV1_U,
|
||||
sdu_buffer_sizeP - payload_offset + GTPU_HEADER_OVERHEAD_MAX);
|
||||
@@ -1078,7 +1068,7 @@ pdcp_data_ind(
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rnti = ctxt_pP->rnti;
|
||||
GTPV1U_ENB_TUNNEL_DATA_REQ(message_p).rab_id = rb_id + 4;
|
||||
itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
|
||||
packet_forwarded = TRUE;
|
||||
}
|
||||
} else {
|
||||
@@ -2228,20 +2218,6 @@ pdcp_config_set_security(
|
||||
pdcp_pP->kUPenc = kUPenc;
|
||||
/* Activate security */
|
||||
pdcp_pP->security_activated = 1;
|
||||
MSC_LOG_EVENT(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
"0 Set security ciph %X integ %x UE %"PRIx16" ",
|
||||
pdcp_pP->cipheringAlgorithm,
|
||||
pdcp_pP->integrityProtAlgorithm,
|
||||
ctxt_pP->rnti);
|
||||
} else {
|
||||
MSC_LOG_EVENT(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
"0 Set security failed UE %"PRIx16" ",
|
||||
ctxt_pP->rnti);
|
||||
LOG_E(PDCP,PROTOCOL_PDCP_CTXT_FMT" bad security mode %d",
|
||||
PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
|
||||
security_modeP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ extern int otg_enabled;
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "platform_constants.h"
|
||||
#include "msc.h"
|
||||
#include "pdcp.h"
|
||||
|
||||
#include "assertions.h"
|
||||
@@ -85,8 +84,6 @@ extern struct msghdr nas_msg_rx;
|
||||
|
||||
|
||||
# include "gtpv1u_eNB_task.h"
|
||||
# include "gtpv1u_eNB_defs.h"
|
||||
|
||||
|
||||
extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP);
|
||||
uint16_t ue_id_g; // Global variable to identify the ID for each UE. It is updated in main() of lte-uesoftmodem.c
|
||||
@@ -343,12 +340,6 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p
|
||||
LOG_D(PDCP, "[FRAME %5u][UE][IP][INSTANCE %ld][RB %ld][--- PDCP_DATA_REQ / %d Bytes --->][PDCP][MOD %u][UE %04x][RB %ld]\n",
|
||||
ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id,
|
||||
ctxt.rnti, rab_id);
|
||||
MSC_LOG_RX_MESSAGE((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
|
||||
NULL, 0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt.instance, rab_id, rab_id, len);
|
||||
pdcp_data_req(
|
||||
&ctxt,
|
||||
SRB_FLAG_NO,
|
||||
@@ -368,14 +359,6 @@ int pdcp_fifo_read_input_mbms_sdus_fromtun (const protocol_ctxt_t *const ctxt_p
|
||||
// , NULL, NULL
|
||||
// );
|
||||
} else {
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt.instance, rab_id, rab_id, len);
|
||||
LOG_D(PDCP,
|
||||
"[FRAME %5u][UE][IP][INSTANCE %ld][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %04x][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
|
||||
ctxt.frame, ctxt.instance, rab_id, len, ctxt.module_id,
|
||||
@@ -566,17 +549,6 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
|
||||
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id
|
||||
);
|
||||
} else { /* else of h_rc == HASH_TABLE_OK */
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pdcp_read_header_g.inst,
|
||||
pdcp_read_header_g.rb_id,
|
||||
rab_id,
|
||||
pdcp_read_header_g.data_size);
|
||||
LOG_D(PDCP,
|
||||
"[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
|
||||
ctxt.frame,
|
||||
@@ -739,17 +711,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
rab_id);
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
rab_id,
|
||||
pc5s_header->data_size);
|
||||
/* pointers to pc5s_header fields possibly not aligned because pc5s_header points to a packed structure
|
||||
* Using these possibly unaligned pointers in a function call may trigger alignment errors at run time and
|
||||
* gcc, from v9, now warns about it. fix these warnings by using local variables
|
||||
@@ -771,17 +732,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
|
||||
pc5s_header->sourceL2Id = sourceL2Id;
|
||||
pc5s_header->destinationL2Id=destinationL2Id;
|
||||
} else { /* else of h_rc == HASH_TABLE_OK */
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
rab_id,
|
||||
pc5s_header->data_size);
|
||||
LOG_D(PDCP,
|
||||
"[FRAME %5u][UE][IP][INSTANCE %u][RB %ld][--- PDCP_DATA_REQ / %d Bytes ---X][PDCP][MOD %u][UE %u][RB %ld] NON INSTANCIATED INSTANCE key 0x%"PRIx64", DROPPED\n",
|
||||
ctxt.frame,
|
||||
@@ -803,16 +753,6 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
|
||||
ctxt.module_id,
|
||||
ctxt.rnti,
|
||||
DEFAULT_RAB_ID);
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_IP_ENB:MSC_IP_UE,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" DATA-REQ inst %u rb %u default rab %u size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
pc5s_header->inst,
|
||||
pc5s_header->rb_id,
|
||||
DEFAULT_RAB_ID,
|
||||
pc5s_header->data_size);
|
||||
/* pointers to pc5s_header fields possibly not aligned because pc5s_header points to a packed structure
|
||||
* Using these possibly unaligned pointers in a function call may trigger alignment errors at run time and
|
||||
* gcc, from v9, now warns about it. fix these warnings by using local variables
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
|
||||
#include "pdcp.h"
|
||||
#include "pdcp_primitives.h"
|
||||
#include "msc.h"
|
||||
|
||||
|
||||
#define PDCP_QUEUE_NB_ELEMENTS 200
|
||||
@@ -187,7 +186,6 @@ void *pdcp_netlink_thread_fct(void *arg)
|
||||
pdcp_thread_read_state = 0;
|
||||
memset(nl_rx_buf, 0, NL_MAX_PAYLOAD);
|
||||
LOG_I(PDCP, "[NETLINK_THREAD] binding to fd %d\n",nas_sock_fd);
|
||||
MSC_START_USE();
|
||||
|
||||
while (1) {
|
||||
len = recvmsg(nas_sock_fd, &nas_msg_rx, 0);
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
|
||||
#include "pdcp.h"
|
||||
#include "msc.h"
|
||||
#include "pdcp_primitives.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -223,11 +222,6 @@ pdcp_validate_security(
|
||||
if (stream_check_integrity(pdcp_pP->integrityProtAlgorithm,
|
||||
&decrypt_params,
|
||||
&pdcp_pdu_buffer[sdu_buffer_size]) != 0) {
|
||||
MSC_LOG_EVENT(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
" Security: failed MAC-I Algo %X UE %"PRIx16" ",
|
||||
pdcp_pP->integrityProtAlgorithm,
|
||||
ctxt_pP->rnti);
|
||||
LOG_E(PDCP, "[OSA][RB %ld] %s failed to validate MAC-I (key %llx) of incoming PDU\n",
|
||||
rb_id, (pdcp_pP->is_ue != 0) ? "UE" : "eNB",((long long unsigned int*)decrypt_params.key)[0]);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_VALIDATE_SECURITY, VCD_FUNCTION_OUT);
|
||||
|
||||
@@ -1,172 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "ENB_APP/enb_paramdef.h"
|
||||
#include "LAYER2/PROTO_AGENT/proto_agent.h"
|
||||
#define BUF_MAX 1400
|
||||
|
||||
int recv_client = 0;
|
||||
FILE *output;
|
||||
|
||||
void usage(char *prg_name) {
|
||||
fprintf(stderr, "usage: %s <file or ->\n", prg_name);
|
||||
fprintf(stderr, " - is stdin\n");
|
||||
fprintf(stderr, " received packets are written to stdout\n");
|
||||
}
|
||||
|
||||
long uelapsed(struct timeval *s, struct timeval *e) {
|
||||
return e->tv_sec * 1000000 + e->tv_usec - (s->tv_sec * 1000000 + s->tv_usec);
|
||||
}
|
||||
|
||||
boolean_t
|
||||
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,
|
||||
mem_block_t *const sdu_buffer_pP
|
||||
) {
|
||||
fwrite(sdu_buffer_pP->data, sdu_buffer_sizeP, 1, stdout);
|
||||
fflush(stdout);
|
||||
free_mem_block(sdu_buffer_pP, __func__);
|
||||
/* cannot free because of const */
|
||||
//free(ctxt_pP);
|
||||
recv_client = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void close_proto_agent(void) {
|
||||
proto_agent_stop(0);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
const cudu_params_t params = {
|
||||
.local_ipv4_address = "192.168.12.45",
|
||||
.local_port = 6464,
|
||||
.remote_ipv4_address = "192.168.12.45",
|
||||
.remote_port = 6465
|
||||
};
|
||||
protocol_ctxt_t p;
|
||||
memset(&p, 0, sizeof p);
|
||||
mem_block_t mem;
|
||||
char s[BUF_MAX];
|
||||
size_t size, totsize = 0;
|
||||
struct timeval t_start, t_end;
|
||||
FILE *f;
|
||||
|
||||
if (argc != 2) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "-") == 0) {
|
||||
f = stdin;
|
||||
} else {
|
||||
f = fopen(argv[1], "r");
|
||||
}
|
||||
|
||||
if (!f) {
|
||||
fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno));
|
||||
return 2;
|
||||
}
|
||||
|
||||
pool_buffer_init();
|
||||
|
||||
if (proto_agent_start(0, ¶ms) != 0) {
|
||||
fprintf(stderr, "error on proto_agent_start()\n");
|
||||
fclose(f);
|
||||
return 3;
|
||||
}
|
||||
|
||||
atexit(close_proto_agent);
|
||||
|
||||
/* wait for first packet of client */
|
||||
while (!recv_client) sleep(1);
|
||||
|
||||
fprintf(stderr, "reading file\n");
|
||||
/* now send back at the same time */
|
||||
gettimeofday(&t_start, NULL);
|
||||
|
||||
while ((size = fread(s, 1, BUF_MAX, f)) > 0) {
|
||||
usleep(10);
|
||||
totsize += size;
|
||||
mem.data = &s[0];
|
||||
proto_agent_send_rlc_data_req(&p, 0, 0, 0, 0, 0, size, &mem);
|
||||
}
|
||||
|
||||
gettimeofday(&t_end, NULL);
|
||||
fclose(f);
|
||||
long us = uelapsed(&t_start, &t_end);
|
||||
fprintf(stderr, "read %zu bytes in %ld ms -> %.3fMB/s, %.3fMbps\n",
|
||||
totsize, us / 1000, ((float) totsize ) / us,
|
||||
((float) totsize) / us * 8);
|
||||
fprintf(stderr, "check files using 'diff afile bfile'\n");
|
||||
/* give some time in case the other direction is slower */
|
||||
sleep(5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
*********************************************************
|
||||
* arbitrary functions, needed for linking (used or not) *
|
||||
*********************************************************
|
||||
*/
|
||||
|
||||
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,
|
||||
mem_block_t *sdu_pP,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id
|
||||
) {
|
||||
fprintf(stderr, "This should never be called on the CU\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
pthread_t new_thread(void *(*f)(void *), void *b) {
|
||||
pthread_t t;
|
||||
pthread_attr_t att;
|
||||
|
||||
if (pthread_attr_init(&att)) {
|
||||
fprintf(stderr, "pthread_attr_init err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) {
|
||||
fprintf(stderr, "pthread_attr_setdetachstate err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pthread_create(&t, &att, f, b)) {
|
||||
fprintf(stderr, "pthread_create err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pthread_attr_destroy(&att)) {
|
||||
fprintf(stderr, "pthread_attr_destroy err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_get(paramdef_t *params,int numparams, char *prefix) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "ENB_APP/enb_paramdef.h"
|
||||
#include "LAYER2/PROTO_AGENT/proto_agent.h"
|
||||
|
||||
#define BUF_MAX 1400
|
||||
|
||||
void usage(char *prg_name) {
|
||||
fprintf(stderr, "usage: %s <file or ->\n", prg_name);
|
||||
fprintf(stderr, " - is stdin\n");
|
||||
fprintf(stderr, " received packets are written to stdout\n");
|
||||
}
|
||||
|
||||
long uelapsed(struct timeval *s, struct timeval *e) {
|
||||
return e->tv_sec * 1000000 + e->tv_usec - (s->tv_sec * 1000000 + s->tv_usec);
|
||||
}
|
||||
|
||||
|
||||
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,
|
||||
mem_block_t *sdu_pP,
|
||||
const uint32_t *const sourceL2Id,
|
||||
const uint32_t *const destinationL2Id
|
||||
) {
|
||||
fwrite(sdu_pP->data, sdu_sizeP, 1, stdout);
|
||||
fflush(stdout);
|
||||
free_mem_block(sdu_pP, __func__);
|
||||
//free(ctxt_pP);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void close_proto_agent(void) {
|
||||
proto_agent_stop(0);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
const cudu_params_t params = {
|
||||
.local_ipv4_address = "192.168.12.45",
|
||||
.local_port = 6465,
|
||||
.remote_ipv4_address = "192.168.12.45",
|
||||
.remote_port = 6464
|
||||
};
|
||||
protocol_ctxt_t p;
|
||||
memset(&p, 0, sizeof p);
|
||||
mem_block_t mem;
|
||||
char s[BUF_MAX];
|
||||
size_t size, totsize = 0;
|
||||
struct timeval t_start, t_end;
|
||||
FILE *f;
|
||||
|
||||
if (argc != 2) {
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(argv[1], "-") == 0) {
|
||||
f = stdin;
|
||||
} else {
|
||||
f = fopen(argv[1], "r");
|
||||
}
|
||||
|
||||
if (!f) {
|
||||
fprintf(stderr, "cannot open %s: %s\n", argv[1], strerror(errno));
|
||||
return 2;
|
||||
}
|
||||
|
||||
pool_buffer_init();
|
||||
|
||||
if (proto_agent_start(0, ¶ms) != 0) {
|
||||
fprintf(stderr, "error on proto_agent_start()\n");
|
||||
fclose(f);
|
||||
return 3;
|
||||
}
|
||||
|
||||
atexit(close_proto_agent);
|
||||
gettimeofday(&t_start, NULL);
|
||||
|
||||
while ((size = fread(s, 1, BUF_MAX, f)) > 0) {
|
||||
usleep(10);
|
||||
totsize += size;
|
||||
mem.data = &s[0];
|
||||
proto_agent_send_pdcp_data_ind(&p, 0, 0, 0, size, &mem);
|
||||
}
|
||||
|
||||
gettimeofday(&t_end, NULL);
|
||||
fclose(f);
|
||||
long us = uelapsed(&t_start, &t_end);
|
||||
fprintf(stderr, "read %zu bytes in %ld ms -> %.3fMB/s, %.3fMbps\n",
|
||||
totsize, us / 1000, ((float) totsize ) / us,
|
||||
((float) totsize) / us * 8);
|
||||
fprintf(stderr, "check files using 'diff afile bfile'\n");
|
||||
/* wait, we are possibly receiving data */
|
||||
sleep(5);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
*********************************************************
|
||||
* arbitrary functions, needed for linking (used or not) *
|
||||
*********************************************************
|
||||
*/
|
||||
|
||||
boolean_t
|
||||
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,
|
||||
mem_block_t *const sdu_buffer_pP
|
||||
) {
|
||||
fprintf(stderr, "This should never be called on the DU\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
pthread_t new_thread(void *(*f)(void *), void *b) {
|
||||
pthread_t t;
|
||||
pthread_attr_t att;
|
||||
|
||||
if (pthread_attr_init(&att)) {
|
||||
fprintf(stderr, "pthread_attr_init err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED)) {
|
||||
fprintf(stderr, "pthread_attr_setdetachstate err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pthread_create(&t, &att, f, b)) {
|
||||
fprintf(stderr, "pthread_create err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (pthread_attr_destroy(&att)) {
|
||||
fprintf(stderr, "pthread_attr_destroy err\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
int log_header(char *log_buffer, int buffsize, int comp, int level,const char *format) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_get(paramdef_t *params,int numparams, char *prefix) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1,278 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file enb_agent.h
|
||||
* \brief top level enb agent receive thread and itti task
|
||||
* \author Navid Nikaein and Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#include "proto_agent_common.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "proto_agent.h"
|
||||
#include "assertions.h"
|
||||
#include "proto_agent_net_comm.h"
|
||||
#include "proto_agent_async.h"
|
||||
#include <common/utils/system.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#define ENB_AGENT_MAX 9
|
||||
|
||||
proto_agent_instance_t proto_agent[MAX_DU];
|
||||
|
||||
//pthread_t new_thread(void *(*f)(void *), void *b);
|
||||
|
||||
Protocol__FlexsplitMessage *proto_agent_timeout_fsp(void *args);
|
||||
|
||||
#define TEST_MOD 0
|
||||
|
||||
#define ECHO
|
||||
|
||||
/* Server side function; upon a new connection
|
||||
reception, sends the hello packets
|
||||
*/
|
||||
int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p) {
|
||||
int channel_id;
|
||||
// RS: CUDU does not work!
|
||||
//DevAssert(p->local_interface);
|
||||
//DevAssert(p->local_ipv4_address);
|
||||
//DevAssert(p->local_port > 1024); // "unprivileged" port
|
||||
//DevAssert(p->remote_ipv4_address);
|
||||
//DevAssert(p->remote_port > 1024); // "unprivileged" port
|
||||
proto_agent[mod_id].mod_id = mod_id;
|
||||
proto_agent[mod_id].exit = 0;
|
||||
/* Initialize the channel container */
|
||||
/* TODO only initialize the first time */
|
||||
proto_agent_init_channel_container();
|
||||
/*Create the async channel info*/
|
||||
proto_agent_async_channel_t *channel_info;
|
||||
channel_info = proto_agent_async_channel_info(mod_id, p->local_ipv4_address, p->local_port,
|
||||
p->remote_ipv4_address, p->remote_port);
|
||||
|
||||
if (!channel_info) goto error;
|
||||
|
||||
/* Create a channel using the async channel info */
|
||||
channel_id = proto_agent_create_channel((void *) channel_info,
|
||||
proto_agent_async_msg_send,
|
||||
proto_agent_async_msg_recv,
|
||||
proto_agent_async_release);
|
||||
|
||||
if (channel_id <= 0) goto error;
|
||||
|
||||
proto_agent_channel_t *channel = proto_agent_get_channel(channel_id);
|
||||
|
||||
if (!channel) goto error;
|
||||
|
||||
proto_agent[mod_id].channel = channel;
|
||||
/* Register the channel for all underlying agents (use ENB_AGENT_MAX) */
|
||||
proto_agent_register_channel(mod_id, channel, ENB_AGENT_MAX);
|
||||
// Code for sending the HELLO/ECHO_REQ message once a connection is established
|
||||
//uint8_t *msg = NULL;
|
||||
//Protocol__FlexsplitMessage *init_msg=NULL;
|
||||
//if (udp == 0)
|
||||
//{
|
||||
// // If the comm is not UDP, allow the server to send the first packet over the channel
|
||||
// //printf( "Proto agent Server: Calling the echo_request packet constructor\n");
|
||||
// msg_flag = proto_agent_echo_request(mod_id, NULL, &init_msg);
|
||||
// if (msg_flag != 0)
|
||||
// goto error;
|
||||
//
|
||||
// int msgsize = 0;
|
||||
// if (init_msg != NULL)
|
||||
// msg = proto_agent_pack_message(init_msg, &msgsize);
|
||||
// if (msg!= NULL)
|
||||
// {
|
||||
// LOG_D(PROTO_AGENT, "Server sending the message over the async channel\n");
|
||||
// proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, (void *) channel_info);
|
||||
// }
|
||||
// /* After sending the message, wait for any replies;
|
||||
// the server thread blocks until it reads any data
|
||||
// over the channel
|
||||
// */
|
||||
//}
|
||||
//proto_agent[mod_id].recv_thread = new_thread(proto_agent_receive, &proto_agent[mod_id]);
|
||||
threadCreate(&proto_agent[mod_id].recv_thread, proto_agent_receive, &proto_agent[mod_id], "proto", -1, OAI_PRIORITY_RT_LOW);
|
||||
fprintf(stderr, "[PROTO_AGENT] server started at port %s:%d\n", p->local_ipv4_address, p->local_port);
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(PROTO_AGENT, "there was an error\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
void proto_agent_stop(mod_id_t mod_id) {
|
||||
if (!proto_agent[mod_id].channel) return;
|
||||
|
||||
/* unlock the independent read thread proto_agent_receive() */
|
||||
proto_agent[mod_id].exit = 1;
|
||||
proto_agent_async_msg_recv_unlock(proto_agent[mod_id].channel->channel_info);
|
||||
proto_agent_async_release(proto_agent[mod_id].channel);
|
||||
proto_agent_destroy_channel(proto_agent[mod_id].channel->channel_id);
|
||||
free(proto_agent[mod_id].channel);
|
||||
proto_agent[mod_id].channel = NULL;
|
||||
LOG_W(PROTO_AGENT, "server stopped\n");
|
||||
}
|
||||
|
||||
//void
|
||||
//proto_agent_send_hello(void)
|
||||
//{
|
||||
// uint8_t *msg = NULL;
|
||||
// Protocol__FlexsplitMessage *init_msg=NULL;
|
||||
// int msg_flag = 0;
|
||||
//
|
||||
//
|
||||
// //printf( "PDCP agent: Calling the HELLO packet constructor\n");
|
||||
// msg_flag = proto_agent_hello(proto_agent[TEST_MOD].mod_id, NULL, &init_msg);
|
||||
//
|
||||
// int msgsize = 0;
|
||||
// if (msg_flag == 0)
|
||||
// {
|
||||
// proto_agent_serialize_message(init_msg, &msg, &msgsize);
|
||||
// }
|
||||
//
|
||||
// LOG_D(PROTO_AGENT, "Agent sending the message over the async channel\n");
|
||||
// proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, (void *) client_channel[TEST_MOD]);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
rlc_op_status_t proto_agent_send_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,const uint32_t *const SrcID, const uint32_t *const DstID) {
|
||||
uint8_t *msg = NULL;
|
||||
Protocol__FlexsplitMessage *init_msg=NULL;
|
||||
int msg_flag = 0;
|
||||
int msgsize = 0;
|
||||
mod_id_t mod_id = ctxt_pP->module_id;
|
||||
data_req_args args;
|
||||
DevAssert(proto_agent[mod_id].channel);
|
||||
DevAssert(proto_agent[mod_id].channel->channel_info);
|
||||
args.ctxt = ctxt_pP;
|
||||
args.srb_flag = srb_flagP;
|
||||
args.MBMS_flag = MBMS_flagP;
|
||||
args.rb_id = rb_idP;
|
||||
args.mui = muiP;
|
||||
args.confirm = confirmP;
|
||||
args.sdu_size = sdu_sizeP;
|
||||
args.sdu_p = sdu_pP;
|
||||
msg_flag = proto_agent_pdcp_data_req(mod_id, (void *) &args, &init_msg);
|
||||
|
||||
if (msg_flag != 0 || !init_msg) goto error;
|
||||
|
||||
msg = proto_agent_pack_message(init_msg, &msgsize);
|
||||
|
||||
if (!msg) goto error;
|
||||
|
||||
proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info);
|
||||
free_mem_block(sdu_pP, __func__);
|
||||
return RLC_OP_STATUS_OK;
|
||||
error:
|
||||
LOG_E(PROTO_AGENT, "PROTO_AGENT there was an error\n");
|
||||
return RLC_OP_STATUS_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
|
||||
boolean_t proto_agent_send_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,
|
||||
sdu_size_t sdu_sizeP, mem_block_t *sdu_pP,
|
||||
const uint32_t *const SrcID, const uint32_t *const DstID) {
|
||||
uint8_t *msg = NULL;
|
||||
Protocol__FlexsplitMessage *init_msg = NULL;
|
||||
int msg_flag = 0;
|
||||
int msgsize = 0;
|
||||
mod_id_t mod_id = ctxt_pP->module_id;
|
||||
data_req_args args;
|
||||
DevAssert(proto_agent[mod_id].channel);
|
||||
DevAssert(proto_agent[mod_id].channel->channel_info);
|
||||
args.ctxt = ctxt_pP;
|
||||
args.srb_flag = srb_flagP;
|
||||
args.MBMS_flag = MBMS_flagP;
|
||||
args.rb_id = rb_idP;
|
||||
args.sdu_size = sdu_sizeP;
|
||||
args.sdu_p = sdu_pP;
|
||||
msg_flag = proto_agent_pdcp_data_ind(mod_id, (void *) &args, &init_msg);
|
||||
|
||||
if (msg_flag != 0 || !init_msg) goto error;
|
||||
|
||||
msg = proto_agent_pack_message(init_msg, &msgsize);
|
||||
|
||||
if (!msg) goto error;
|
||||
|
||||
proto_agent_async_msg_send((void *)msg, (int) msgsize, 1, proto_agent[mod_id].channel->channel_info);
|
||||
free_mem_block(sdu_pP, __func__);
|
||||
return TRUE;
|
||||
error:
|
||||
LOG_E(PROTO_AGENT, "there was an error in %s\n", __func__);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void *
|
||||
proto_agent_receive(void *args) {
|
||||
proto_agent_instance_t *inst = args;
|
||||
void *data = NULL;
|
||||
int size;
|
||||
int priority;
|
||||
err_code_t err_code;
|
||||
pthread_setname_np(pthread_self(), "proto_rx");
|
||||
Protocol__FlexsplitMessage *msg;
|
||||
uint8_t *ser_msg;
|
||||
|
||||
while (1) {
|
||||
msg = NULL;
|
||||
ser_msg = NULL;
|
||||
|
||||
if ((size = proto_agent_async_msg_recv(&data, &priority, inst->channel->channel_info)) < 0) {
|
||||
err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (inst->exit) break;
|
||||
|
||||
LOG_D(PROTO_AGENT, "Server side Received message with size %d and priority %d, calling message handle\n", size, priority);
|
||||
msg = proto_agent_handle_message(inst->mod_id, data, size);
|
||||
|
||||
if (!msg) {
|
||||
LOG_D(PROTO_AGENT, "msg to send back is NULL\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
ser_msg = proto_agent_pack_message(msg, &size);
|
||||
|
||||
if (!ser_msg) {
|
||||
continue;
|
||||
}
|
||||
|
||||
LOG_D(PROTO_AGENT, "Server sending the reply message over the async channel\n");
|
||||
|
||||
if (proto_agent_async_msg_send((void *)ser_msg, (int) size, 1, inst->channel->channel_info)) {
|
||||
err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENQUEUING;
|
||||
goto error;
|
||||
}
|
||||
|
||||
LOG_D(PROTO_AGENT, "sent message with size %d\n", size);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
error:
|
||||
LOG_E(PROTO_AGENT, "proto_agent_receive(): error %d occured\n",err_code);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file proto_agent.h
|
||||
* \brief top level protocol agent
|
||||
* \author Navid Nikaein and Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef PROTO_AGENT_H_
|
||||
#define PROTO_AGENT_H_
|
||||
#include "ENB_APP/enb_config.h" // for enb properties
|
||||
#include "proto_agent_common.h"
|
||||
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "RRC/NR/nr_rrc_defs.h"
|
||||
|
||||
|
||||
void *proto_agent_receive(void *args);
|
||||
|
||||
int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p);
|
||||
void proto_agent_stop(mod_id_t mod_id);
|
||||
|
||||
rlc_op_status_t proto_agent_send_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,const uint32_t *const SrcID, const uint32_t *const DstID);
|
||||
|
||||
pdcp_data_ind_t proto_agent_send_pdcp_data_ind;
|
||||
|
||||
#endif
|
||||
@@ -1,93 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "proto_agent_async.h"
|
||||
#include "proto_agent_defs.h"
|
||||
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
proto_agent_async_channel_t *
|
||||
proto_agent_async_channel_info(mod_id_t mod_id, const char *bind_ip, uint16_t bind_port,
|
||||
const char* peer_ip, uint16_t peer_port)
|
||||
{
|
||||
proto_agent_async_channel_t *channel;
|
||||
channel = malloc(sizeof(proto_agent_async_channel_t));
|
||||
|
||||
if (channel == NULL)
|
||||
goto error;
|
||||
|
||||
channel->enb_id = mod_id;
|
||||
channel->link = new_link_udp_server(bind_ip, bind_port);
|
||||
|
||||
if (channel->link == NULL) goto error;
|
||||
|
||||
channel->send_queue = new_message_queue();
|
||||
if (channel->send_queue == NULL) goto error;
|
||||
channel->receive_queue = new_message_queue();
|
||||
if (channel->receive_queue == NULL) goto error;
|
||||
|
||||
channel->manager = create_link_manager(channel->send_queue,
|
||||
channel->receive_queue,
|
||||
channel->link);
|
||||
/* manually set remote IP&port for UDP server remote end */
|
||||
channel->manager->peer_port = peer_port;
|
||||
channel->manager->peer_addr = peer_ip;
|
||||
|
||||
if (channel->manager == NULL) goto error;
|
||||
|
||||
return channel;
|
||||
|
||||
error:
|
||||
if (channel)
|
||||
free(channel);
|
||||
LOG_E(PROTO_AGENT, "error creating proto_agent_async_channel_t\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int proto_agent_async_msg_send(void *data, int size, int priority, void *channel_info)
|
||||
{
|
||||
proto_agent_async_channel_t *channel = channel_info;
|
||||
return message_put(channel->send_queue, data, size, priority);
|
||||
}
|
||||
|
||||
int proto_agent_async_msg_recv(void **data, int *priority, void *channel_info)
|
||||
{
|
||||
proto_agent_async_channel_t *channel = channel_info;
|
||||
return message_get(channel->receive_queue, data, priority);
|
||||
}
|
||||
|
||||
void proto_agent_async_msg_recv_unlock(proto_agent_async_channel_t *channel) {
|
||||
message_get_unlock(channel->receive_queue);
|
||||
}
|
||||
|
||||
void proto_agent_async_release(proto_agent_channel_t *channel)
|
||||
{
|
||||
proto_agent_async_channel_t *channel_info = channel->channel_info;
|
||||
|
||||
destroy_link_manager(channel_info->manager);
|
||||
|
||||
destroy_message_queue(channel_info->send_queue);
|
||||
destroy_message_queue(channel_info->receive_queue);
|
||||
|
||||
close_link(channel_info->link);
|
||||
free(channel_info);
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file enb_agent_async.h
|
||||
* \brief channel implementation for async interface
|
||||
* \author Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#ifndef PROTO_AGENT_ASYNC_H_
|
||||
#define PROTO_AGENT_ASYNC_H_
|
||||
|
||||
#include "proto_agent_net_comm.h"
|
||||
|
||||
typedef struct proto_agent_async_channel_s {
|
||||
mod_id_t enb_id;
|
||||
socket_link_t *link;
|
||||
message_queue_t *send_queue;
|
||||
message_queue_t *receive_queue;
|
||||
link_manager_t *manager;
|
||||
} proto_agent_async_channel_t;
|
||||
|
||||
proto_agent_async_channel_t *
|
||||
proto_agent_async_channel_info(mod_id_t mod_id, const char *bind_ip, uint16_t bind_port,
|
||||
const char *peer_ip, uint16_t peer_port);
|
||||
|
||||
int proto_agent_async_msg_send(void *data, int size, int priority, void *channel_info);
|
||||
|
||||
int proto_agent_async_msg_recv(void **data, int *priority, void *channel_info);
|
||||
|
||||
/* unlocks a running proto_agent_async_msg_recv() */
|
||||
void proto_agent_async_msg_recv_unlock(proto_agent_async_channel_t *channel);
|
||||
|
||||
void proto_agent_async_release(proto_agent_channel_t *channel);
|
||||
|
||||
|
||||
#endif /*PROTO_AGENT_ASYNC_H_*/
|
||||
@@ -1,719 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file proto_agent_common.c
|
||||
* \brief common primitives for all agents
|
||||
* \author Navid Nikaein and Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include<stdio.h>
|
||||
#include <dlfcn.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "proto_agent_common.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
/*
|
||||
* message primitives
|
||||
*/
|
||||
|
||||
// Function to fill in the dl_data header (32bits) with the appropriate fields (doing bitwise operations)
|
||||
void fill_dl_data_header(int pdu_type, int spare, int seq_no, uint32_t *header) {
|
||||
uint32_t type = pdu_type;
|
||||
uint32_t spare_ = spare;
|
||||
uint32_t seq = seq_no;
|
||||
type = type << 28;
|
||||
spare_ = spare_ << 24;
|
||||
*header = (type | spare_);
|
||||
*header = (*header | seq);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Function to retrieve data from the dl_data header (32bits) (doing bitwise operations)
|
||||
void read_dl_data_header(int *pdu_type, int *spare, int *seqno, uint32_t header) {
|
||||
*pdu_type = header;
|
||||
*spare = header;
|
||||
*seqno = header;
|
||||
*pdu_type = *pdu_type >> 28;
|
||||
*spare = *spare << 4;
|
||||
*spare = *spare >> 28;
|
||||
*seqno = *seqno << 8;
|
||||
*seqno = *seqno >> 8;
|
||||
return;
|
||||
}
|
||||
|
||||
int f1u_serialize_message(Protocol__F1uMessage *msg, void **buf,int *size) {
|
||||
*size = protocol__f1u_message__get_packed_size(msg);
|
||||
*buf = malloc(*size);
|
||||
|
||||
if (!(*buf))
|
||||
goto error;
|
||||
|
||||
protocol__f1u_message__pack(msg, *buf);
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(F1U, "an error occured\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
int f1u_deserialize_message(void *data, int size, Protocol__F1uMessage **msg) {
|
||||
*msg = protocol__f1u_message__unpack(NULL, size, data);
|
||||
|
||||
if (*msg == NULL)
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(F1U, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int f1u_dl_data_create_header(uint32_t pdu_type, uint32_t f1u_sn, Protocol__DlDataHeader **header) {
|
||||
*header = malloc(sizeof(Protocol__DlDataHeader));
|
||||
|
||||
if(*header == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__dl_data_header__init(*header);
|
||||
LOG_D(F1U, "Initialized the DL Data User header\n");
|
||||
fill_dl_data_header(pdu_type, 0, f1u_sn, &(*header)->fields);
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(F1U, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int f1u_dl_data(const void *params, Protocol__F1uMessage **msg) {
|
||||
// Initialize the PDCP params
|
||||
dl_data_args *args = (dl_data_args *)params;
|
||||
Protocol__DlDataHeader *header;
|
||||
|
||||
if (f1u_dl_data_create_header(args->pdu_type, args->sn, &header) != 0)
|
||||
goto error;
|
||||
|
||||
Protocol__DlUserData *dl_data = NULL;
|
||||
*msg = malloc(sizeof(Protocol__DlUserData));
|
||||
|
||||
if(*msg == NULL)
|
||||
goto error;
|
||||
|
||||
// FIXME: Is the following used? It seems to be overwritten by the function
|
||||
// protocol__dl_user_data__init() anyway
|
||||
//dl_data = *msg;
|
||||
protocol__dl_user_data__init(dl_data);
|
||||
// Copy data to the bytes structure
|
||||
dl_data->pdu.data = malloc(args->sdu_size);
|
||||
dl_data->pdu.len = args->sdu_size;
|
||||
memcpy(dl_data->pdu.data, args->sdu_p, args->sdu_size);
|
||||
dl_data->frame = args->frame;
|
||||
dl_data->subframe = args->subframe;
|
||||
dl_data->rnti = args->rnti;
|
||||
dl_data->header = header;
|
||||
return 0;
|
||||
error:
|
||||
|
||||
if(header != NULL)
|
||||
free(header);
|
||||
|
||||
if(*msg != NULL)
|
||||
free(*msg);
|
||||
|
||||
LOG_E(F1U, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_serialize_message(Protocol__FlexsplitMessage *msg, uint8_t **buf, int *size) {
|
||||
*size = protocol__flexsplit_message__get_packed_size(msg);
|
||||
*buf = malloc(*size);
|
||||
|
||||
if (!(*buf))
|
||||
goto error;
|
||||
|
||||
protocol__flexsplit_message__pack(msg, *buf);
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(MAC, "an error occured\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* We assume that the buffer size is equal to the message size.
|
||||
Should be chekced durint Tx/Rx */
|
||||
int proto_agent_deserialize_message(void *data, int size, Protocol__FlexsplitMessage **msg) {
|
||||
*msg = protocol__flexsplit_message__unpack(NULL, size, data);
|
||||
|
||||
if (*msg == NULL)
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fsp_create_header(xid_t xid, Protocol__FspType type, Protocol__FspHeader **header) {
|
||||
*header = malloc(sizeof(Protocol__FspHeader));
|
||||
|
||||
if(*header == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__fsp_header__init(*header);
|
||||
LOG_D(PROTO_AGENT, "Initialized the PROTOBUF message header\n");
|
||||
(*header)->version = FLEXSPLIT_VERSION;
|
||||
LOG_D(PROTO_AGENT, "Set the vversion to FLEXSPLIT_VERSION\n");
|
||||
(*header)->has_version = 1;
|
||||
(*header)->type = type;
|
||||
(*header)->has_type = 1;
|
||||
(*header)->xid = xid;
|
||||
(*header)->has_xid = 1;
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int just_print(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int proto_agent_pdcp_data_req(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
|
||||
Protocol__FspCtxt *ctxt = NULL;
|
||||
Protocol__FspRlcPdu *pdu = NULL;
|
||||
Protocol__FspRlcData *rlc_data = NULL;
|
||||
Protocol__FspRlcDataReq *data_req = NULL;
|
||||
// Initialize the PDCP params
|
||||
data_req_args *args = (data_req_args *)params;
|
||||
// Create the protobuf header
|
||||
Protocol__FspHeader *header;
|
||||
xid_t xid = mod_id;
|
||||
LOG_D(PROTO_AGENT, "creating the data_req message\n");
|
||||
|
||||
if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_RLC_DATA_REQ, &header) != 0)
|
||||
goto error;
|
||||
|
||||
/* Begin constructing the messages. They are defined as follows:
|
||||
* 1) fspRlcPdu is storing the bytes of the packet
|
||||
* 2) Message fspRlcData is packing the packet + the context of the PDCP (separate message)
|
||||
* 3) Messge fspRlcDataReq is packing the header, enb_id and fspRlcData
|
||||
*/
|
||||
ctxt = malloc(sizeof(Protocol__FspCtxt));
|
||||
pdu = malloc(sizeof(Protocol__FspRlcPdu));
|
||||
rlc_data = malloc(sizeof(Protocol__FspRlcData));
|
||||
data_req = malloc(sizeof(Protocol__FspRlcDataReq));
|
||||
protocol__fsp_ctxt__init(ctxt);
|
||||
protocol__fsp_rlc_pdu__init(pdu);
|
||||
protocol__fsp_rlc_data__init(rlc_data);
|
||||
protocol__fsp_rlc_data_req__init(data_req);
|
||||
// Copy data to the RlcPdu structure
|
||||
pdu->fsp_pdu_data.data = malloc(args->sdu_size);
|
||||
pdu->fsp_pdu_data.len = args->sdu_size;
|
||||
memcpy(pdu->fsp_pdu_data.data, args->sdu_p->data, args->sdu_size);
|
||||
pdu->has_fsp_pdu_data = 1;
|
||||
// Copy data to the ctxt structure
|
||||
ctxt->fsp_mod_id = args->ctxt->module_id;
|
||||
ctxt->fsp_enb_flag = args->ctxt->enb_flag;
|
||||
ctxt->fsp_instance = args->ctxt->instance;
|
||||
ctxt->fsp_rnti = args->ctxt->rnti;
|
||||
ctxt->fsp_frame = args->ctxt->frame;
|
||||
ctxt->fsp_subframe = args->ctxt->subframe;
|
||||
ctxt->fsp_enb_index = args->ctxt->eNB_index;
|
||||
ctxt->has_fsp_mod_id = 1;
|
||||
ctxt->has_fsp_enb_flag = 1;
|
||||
ctxt->has_fsp_instance = 1;
|
||||
ctxt->has_fsp_rnti = 1;
|
||||
ctxt->has_fsp_frame = 1;
|
||||
ctxt->has_fsp_subframe = 1;
|
||||
ctxt->has_fsp_enb_index = 1;
|
||||
rlc_data->fsp_ctxt = ctxt;
|
||||
rlc_data->fsp_srb_flag = args->srb_flag;
|
||||
rlc_data->fsp_mbms_flag = args->MBMS_flag;
|
||||
rlc_data->fsp_rb_id = args->rb_id;
|
||||
rlc_data->fsp_muip = args->mui;
|
||||
rlc_data->fsp_confirm = args->confirm;
|
||||
rlc_data->fsp_sdu_buffer_size = args->sdu_size;
|
||||
rlc_data->fsp_pdu = pdu;
|
||||
rlc_data->has_fsp_srb_flag = 1;
|
||||
rlc_data->has_fsp_mbms_flag = 1;
|
||||
rlc_data->has_fsp_rb_id = 1;
|
||||
rlc_data->has_fsp_muip = 1;
|
||||
rlc_data->has_fsp_confirm = 1;
|
||||
rlc_data->has_fsp_sdu_buffer_size = 1;
|
||||
// Up to here, everything is a signle message that is packed inside another. The final data_req
|
||||
// will be created later, after the setting of all variables
|
||||
data_req->header = header;
|
||||
data_req->enb_id = mod_id;
|
||||
data_req->has_enb_id = 1;
|
||||
data_req->pdcp_data = rlc_data;
|
||||
*msg = malloc(sizeof(Protocol__FlexsplitMessage));
|
||||
|
||||
if(*msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__flexsplit_message__init(*msg);
|
||||
(*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG;
|
||||
(*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; //we will be waiting for the ACK
|
||||
(*msg)->has_msg_dir = 1;
|
||||
(*msg)->data_req_msg = data_req;
|
||||
return 0;
|
||||
error:
|
||||
|
||||
if(header != NULL)
|
||||
free(header);
|
||||
|
||||
if(pdu!=NULL)
|
||||
free(pdu);
|
||||
|
||||
if(rlc_data!=NULL)
|
||||
free(rlc_data);
|
||||
|
||||
if(data_req!= NULL)
|
||||
free(data_req);
|
||||
|
||||
if(*msg != NULL)
|
||||
free(*msg);
|
||||
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg) {
|
||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_REQ_MSG)
|
||||
goto error;
|
||||
|
||||
free(msg->data_req_msg->header);
|
||||
free(msg->data_req_msg->pdcp_data->fsp_pdu->fsp_pdu_data.data);
|
||||
free(msg->data_req_msg->pdcp_data->fsp_pdu);
|
||||
free(msg->data_req_msg->pdcp_data->fsp_ctxt);
|
||||
free(msg->data_req_msg->pdcp_data);
|
||||
free(msg->data_req_msg);
|
||||
free(msg);
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_get_ack_result(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
|
||||
/* code useless in this status: return 0 anyways
|
||||
rlc_op_status_t result = 0;
|
||||
printf("PROTO_AGENT: handling the data_req_ack message\n");
|
||||
Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
|
||||
Protocol__FspRlcDataReqAck *data_ack = input->data_req_ack;
|
||||
result = data_ack->result;
|
||||
printf("PROTO_AGENT: ACK RESULT IS %u\n", result);
|
||||
ack_result = result;
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
|
||||
rlc_op_status_t result = 0;
|
||||
Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
|
||||
Protocol__FspRlcDataReq *data_req = input->data_req_msg;
|
||||
Protocol__FspCtxt *ctxt = NULL;
|
||||
Protocol__FspRlcData *rlc_data = NULL;
|
||||
rlc_data = data_req->pdcp_data;
|
||||
ctxt = rlc_data->fsp_ctxt;
|
||||
protocol_ctxt_t ctxt_pP;
|
||||
srb_flag_t srb_flagP = 0;
|
||||
rb_id_t rb_idP = 0;
|
||||
mui_t muiP = 0;
|
||||
confirm_t confirmP = 0;
|
||||
MBMS_flag_t flag_MBMS = 0;
|
||||
sdu_size_t pdcp_pdu_size = 0;
|
||||
mem_block_t *pdcp_pdu_p = NULL;
|
||||
// Create a new protocol context for handling the packet
|
||||
ctxt_pP.module_id = ctxt->fsp_mod_id;
|
||||
ctxt_pP.enb_flag = ctxt->fsp_enb_flag;
|
||||
ctxt_pP.instance = ctxt->fsp_instance;
|
||||
ctxt_pP.rnti = ctxt->fsp_rnti;
|
||||
ctxt_pP.frame = ctxt->fsp_frame;
|
||||
ctxt_pP.subframe = ctxt->fsp_subframe;
|
||||
ctxt_pP.eNB_index = ctxt->fsp_enb_index;
|
||||
srb_flagP = rlc_data->fsp_srb_flag;
|
||||
flag_MBMS = rlc_data->fsp_mbms_flag;
|
||||
rb_idP = rlc_data->fsp_rb_id;
|
||||
muiP = rlc_data->fsp_muip;
|
||||
confirmP = rlc_data->fsp_confirm;
|
||||
pdcp_pdu_size = rlc_data->fsp_pdu->fsp_pdu_data.len;
|
||||
pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__);
|
||||
|
||||
if (!pdcp_pdu_p) {
|
||||
LOG_E(PROTO_AGENT, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memcpy(pdcp_pdu_p->data, rlc_data->fsp_pdu->fsp_pdu_data.data, pdcp_pdu_size);
|
||||
if (RC.nrrrc) {
|
||||
LOG_D(PROTO_AGENT, "proto_agent received pdcp_data_req \n");
|
||||
// for (int i = 0; i < pdcp_pdu_size; i++)
|
||||
// printf(" %2.2x", (unsigned char)pdcp_pdu_p->data[i]);
|
||||
// printf("\n");
|
||||
du_rlc_data_req(&ctxt_pP, srb_flagP, flag_MBMS, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p);
|
||||
result = 1;
|
||||
} else {
|
||||
result = rlc_data_req(&ctxt_pP, srb_flagP, flag_MBMS, rb_idP, muiP, confirmP, pdcp_pdu_size, pdcp_pdu_p, NULL, NULL);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg) {
|
||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG)
|
||||
goto error;
|
||||
|
||||
free(msg->data_ind_msg->header);
|
||||
free(msg->data_ind_msg->rlc_data->fsp_pdu->fsp_pdu_data.data);
|
||||
free(msg->data_ind_msg->rlc_data->fsp_pdu);
|
||||
free(msg->data_ind_msg->rlc_data->fsp_ctxt);
|
||||
free(msg->data_ind_msg->rlc_data);
|
||||
free(msg->data_ind_msg);
|
||||
free(msg);
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_pdcp_data_ind(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
|
||||
Protocol__FspCtxt *ctxt = NULL;
|
||||
Protocol__FspRlcPdu *pdu = NULL;
|
||||
Protocol__FspRlcData *rlc_data = NULL;
|
||||
Protocol__FspPdcpDataInd *data_ind = NULL;
|
||||
// Initialize the PDCP params
|
||||
data_req_args *args = (data_req_args *)params;
|
||||
// Create the protobuf header
|
||||
Protocol__FspHeader *header;
|
||||
xid_t xid = mod_id;
|
||||
LOG_D(PROTO_AGENT, "creating the data_ind message\n");
|
||||
|
||||
if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_PDCP_DATA_IND, &header) != 0)
|
||||
goto error;
|
||||
|
||||
/* Begin constructing the messages. They are defined as follows:
|
||||
* 1) fspRlcPdu is storing the bytes of the packet
|
||||
* 2) Message fspRlcData is packing the packet + the context of the PDCP (separate message)
|
||||
* 3) Messge fspRlcDataReq is packing the header, enb_id and fspRlcData
|
||||
*/
|
||||
ctxt = malloc(sizeof(Protocol__FspCtxt));
|
||||
pdu = malloc(sizeof(Protocol__FspRlcPdu));
|
||||
rlc_data = malloc(sizeof(Protocol__FspRlcData));
|
||||
data_ind = malloc(sizeof(Protocol__FspPdcpDataInd));
|
||||
protocol__fsp_ctxt__init(ctxt);
|
||||
protocol__fsp_rlc_pdu__init(pdu);
|
||||
protocol__fsp_rlc_data__init(rlc_data);
|
||||
protocol__fsp_pdcp_data_ind__init(data_ind);
|
||||
// Copy data to the RlcPdu structure
|
||||
pdu->fsp_pdu_data.data = malloc(args->sdu_size);
|
||||
pdu->fsp_pdu_data.len = args->sdu_size;
|
||||
memcpy(pdu->fsp_pdu_data.data, args->sdu_p->data, args->sdu_size);
|
||||
pdu->has_fsp_pdu_data = 1;
|
||||
// Copy data to the ctxt structure
|
||||
ctxt->fsp_mod_id = args->ctxt->module_id;
|
||||
ctxt->fsp_enb_flag = args->ctxt->enb_flag;
|
||||
ctxt->fsp_instance = args->ctxt->instance;
|
||||
ctxt->fsp_rnti = args->ctxt->rnti;
|
||||
ctxt->fsp_frame = args->ctxt->frame;
|
||||
ctxt->fsp_subframe = args->ctxt->subframe;
|
||||
ctxt->fsp_enb_index = args->ctxt->eNB_index;
|
||||
ctxt->has_fsp_mod_id = 1;
|
||||
ctxt->has_fsp_enb_flag = 1;
|
||||
ctxt->has_fsp_instance = 1;
|
||||
ctxt->has_fsp_rnti = 1;
|
||||
ctxt->has_fsp_frame = 1;
|
||||
ctxt->has_fsp_subframe = 1;
|
||||
ctxt->has_fsp_enb_index = 1;
|
||||
rlc_data->fsp_ctxt = ctxt;
|
||||
rlc_data->fsp_srb_flag = args->srb_flag;
|
||||
rlc_data->fsp_mbms_flag = args->MBMS_flag;
|
||||
rlc_data->fsp_rb_id = args->rb_id;
|
||||
rlc_data->fsp_sdu_buffer_size = args->sdu_size;
|
||||
rlc_data->fsp_pdu = pdu;
|
||||
rlc_data->has_fsp_srb_flag = 1;
|
||||
rlc_data->has_fsp_mbms_flag = 1;
|
||||
rlc_data->has_fsp_rb_id = 1;
|
||||
rlc_data->has_fsp_sdu_buffer_size = 1;
|
||||
// Up to here, everything is a signle message that is packed inside another. The final data_req
|
||||
// will be created later, after the setting of all variables
|
||||
data_ind->header = header;
|
||||
data_ind->enb_id = mod_id;
|
||||
data_ind->has_enb_id = 1;
|
||||
data_ind->rlc_data = rlc_data;
|
||||
*msg = malloc(sizeof(Protocol__FlexsplitMessage));
|
||||
|
||||
if(*msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__flexsplit_message__init(*msg);
|
||||
LOG_D(PROTO_AGENT,"setting the message case to %d\n", PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG);
|
||||
(*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_DATA_IND_MSG;
|
||||
(*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE; //we will be waiting for the ACK
|
||||
(*msg)->has_msg_dir = 1;
|
||||
(*msg)->data_ind_msg = data_ind; //data_req;
|
||||
return 0;
|
||||
error:
|
||||
|
||||
if(header != NULL)
|
||||
free(header);
|
||||
|
||||
if(pdu!=NULL)
|
||||
free(pdu);
|
||||
|
||||
if(rlc_data!=NULL)
|
||||
free(rlc_data);
|
||||
|
||||
if(data_ind!= NULL)
|
||||
free(data_ind);
|
||||
|
||||
if(*msg != NULL)
|
||||
free(*msg);
|
||||
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
|
||||
boolean_t result = 0;
|
||||
Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
|
||||
Protocol__FspPdcpDataInd *data_ind = input->data_ind_msg;
|
||||
Protocol__FspCtxt *ctxt = NULL;
|
||||
Protocol__FspRlcData *rlc_data = NULL;
|
||||
rlc_data = data_ind->rlc_data;
|
||||
ctxt = rlc_data->fsp_ctxt;
|
||||
protocol_ctxt_t ctxt_pP;
|
||||
srb_flag_t srb_flagP = 0;
|
||||
rb_id_t rb_idP = 0;
|
||||
sdu_size_t pdcp_pdu_size = 0;
|
||||
MBMS_flag_t flag_MBMS = 0;
|
||||
mem_block_t *pdcp_pdu_p = NULL;
|
||||
// Create a new protocol context for handling the packet
|
||||
ctxt_pP.module_id = ctxt->fsp_mod_id;
|
||||
ctxt_pP.enb_flag = ctxt->fsp_enb_flag;
|
||||
ctxt_pP.instance = ctxt->fsp_instance;
|
||||
ctxt_pP.rnti = ctxt->fsp_rnti;
|
||||
ctxt_pP.frame = ctxt->fsp_frame;
|
||||
ctxt_pP.subframe = ctxt->fsp_subframe;
|
||||
ctxt_pP.brOption = 0;
|
||||
ctxt_pP.eNB_index = ctxt->fsp_enb_index;
|
||||
srb_flagP = rlc_data->fsp_srb_flag;
|
||||
flag_MBMS = rlc_data->fsp_mbms_flag;
|
||||
rb_idP = rlc_data->fsp_rb_id;
|
||||
pdcp_pdu_size = rlc_data->fsp_pdu->fsp_pdu_data.len;
|
||||
pdcp_pdu_p = get_free_mem_block(pdcp_pdu_size, __func__);
|
||||
|
||||
if (!pdcp_pdu_p) goto error;
|
||||
|
||||
memcpy(pdcp_pdu_p->data, rlc_data->fsp_pdu->fsp_pdu_data.data, pdcp_pdu_size);
|
||||
// if (xid == 1)
|
||||
// pdcp_data_ind_wifi((const protocol_ctxt_t*) ctxt_pP, (const srb_flag_t) srb_flagP, (const MBMS_flag_t) flag_MBMS, (const rb_id_t) rb_idP, pdcp_pdu_size, pdcp_pdu_p);
|
||||
// else if (xid == 0) // FIXME: USE a preprocessed definition
|
||||
LOG_D(PROTO_AGENT, "[inst %ld] Received PDCP PDU with size %d for UE RNTI %x RB %ld, Calling pdcp_data_ind\n", ctxt_pP.instance, pdcp_pdu_size,ctxt_pP.rnti,rb_idP);
|
||||
result = pdcp_data_ind(&ctxt_pP,
|
||||
srb_flagP,
|
||||
flag_MBMS,
|
||||
rb_idP,
|
||||
pdcp_pdu_size,
|
||||
pdcp_pdu_p, NULL, NULL);
|
||||
return result;
|
||||
error:
|
||||
|
||||
if (pdcp_pdu_p)
|
||||
free_mem_block(pdcp_pdu_p, __func__);
|
||||
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_hello(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
|
||||
Protocol__FspHeader *header;
|
||||
Protocol__FspHello *hello_msg = NULL;
|
||||
/*TODO: Need to set random xid or xid from received hello message*/
|
||||
xid_t xid = mod_id;
|
||||
|
||||
if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_HELLO, &header) != 0)
|
||||
goto error;
|
||||
|
||||
LOG_D(PROTO_AGENT, "creating the HELLO message\n");
|
||||
hello_msg = malloc(sizeof(Protocol__FspHello));
|
||||
|
||||
if(hello_msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__fsp_hello__init(hello_msg);
|
||||
hello_msg->header = header;
|
||||
*msg = malloc(sizeof(Protocol__FlexsplitMessage));
|
||||
|
||||
if(*msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__flexsplit_message__init(*msg);
|
||||
(*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_HELLO_MSG;
|
||||
(*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__SUCCESSFUL_OUTCOME;
|
||||
(*msg)->has_msg_dir = 1;
|
||||
(*msg)->hello_msg = hello_msg;
|
||||
return 0;
|
||||
error:
|
||||
|
||||
if(header != NULL)
|
||||
free(header);
|
||||
|
||||
if(hello_msg!=NULL)
|
||||
free(hello_msg);
|
||||
|
||||
if(*msg != NULL)
|
||||
free(*msg);
|
||||
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int proto_agent_destroy_hello(Protocol__FlexsplitMessage *msg) {
|
||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_HELLO_MSG)
|
||||
goto error;
|
||||
|
||||
free(msg->hello_msg->header);
|
||||
free(msg->hello_msg);
|
||||
free(msg);
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_echo_request(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
|
||||
Protocol__FspHeader *header;
|
||||
Protocol__FspEchoRequest *echo_request_msg = NULL;
|
||||
xid_t xid = mod_id;
|
||||
|
||||
if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_ECHO_REQUEST, &header) != 0)
|
||||
goto error;
|
||||
|
||||
LOG_D(PROTO_AGENT, "creating the echo request message\n");
|
||||
echo_request_msg = malloc(sizeof(Protocol__FspEchoRequest));
|
||||
|
||||
if(echo_request_msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__fsp_echo_request__init(echo_request_msg);
|
||||
echo_request_msg->header = header;
|
||||
*msg = malloc(sizeof(Protocol__FlexsplitMessage));
|
||||
|
||||
if(*msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__flexsplit_message__init(*msg);
|
||||
LOG_D(PROTO_AGENT,"setting the message direction to %d\n", PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG);
|
||||
(*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG;
|
||||
(*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__INITIATING_MESSAGE;
|
||||
(*msg)->has_msg_dir = 1;
|
||||
(*msg)->echo_request_msg = echo_request_msg;
|
||||
return 0;
|
||||
error:
|
||||
|
||||
if(header != NULL)
|
||||
free(header);
|
||||
|
||||
if(echo_request_msg != NULL)
|
||||
free(echo_request_msg);
|
||||
|
||||
if(*msg != NULL)
|
||||
free(*msg);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_destroy_echo_request(Protocol__FlexsplitMessage *msg) {
|
||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REQUEST_MSG)
|
||||
goto error;
|
||||
|
||||
free(msg->echo_request_msg->header);
|
||||
free(msg->echo_request_msg);
|
||||
free(msg);
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_echo_reply(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg) {
|
||||
xid_t xid;
|
||||
Protocol__FlexsplitMessage *input = (Protocol__FlexsplitMessage *)params;
|
||||
Protocol__FspEchoRequest *echo_req = input->echo_request_msg;
|
||||
Protocol__FspEchoReply *echo_reply_msg = NULL;
|
||||
xid = (echo_req->header)->xid;
|
||||
LOG_D(PROTO_AGENT, "creating the echo reply message\n");
|
||||
Protocol__FspHeader *header;
|
||||
|
||||
if (fsp_create_header(xid, PROTOCOL__FSP_TYPE__FSPT_ECHO_REPLY, &header) != 0)
|
||||
goto error;
|
||||
|
||||
echo_reply_msg = malloc(sizeof(Protocol__FspEchoReply));
|
||||
|
||||
if(echo_reply_msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__fsp_echo_reply__init(echo_reply_msg);
|
||||
echo_reply_msg->header = header;
|
||||
*msg = malloc(sizeof(Protocol__FlexsplitMessage));
|
||||
|
||||
if(*msg == NULL)
|
||||
goto error;
|
||||
|
||||
protocol__flexsplit_message__init(*msg);
|
||||
(*msg)->msg_case = PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG;
|
||||
(*msg)->msg_dir = PROTOCOL__FLEXSPLIT_DIRECTION__SUCCESSFUL_OUTCOME;
|
||||
(*msg)->has_msg_dir = 1;
|
||||
(*msg)->echo_reply_msg = echo_reply_msg;
|
||||
return 0;
|
||||
error:
|
||||
|
||||
if(header != NULL)
|
||||
free(header);
|
||||
|
||||
if(echo_reply_msg != NULL)
|
||||
free(echo_reply_msg);
|
||||
|
||||
if(*msg != NULL)
|
||||
free(*msg);
|
||||
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int proto_agent_destroy_echo_reply(Protocol__FlexsplitMessage *msg) {
|
||||
if(msg->msg_case != PROTOCOL__FLEXSPLIT_MESSAGE__MSG_ECHO_REPLY_MSG)
|
||||
goto error;
|
||||
|
||||
free(msg->echo_reply_msg->header);
|
||||
free(msg->echo_reply_msg);
|
||||
free(msg);
|
||||
return 0;
|
||||
error:
|
||||
LOG_E(MAC, "%s: an error occured\n", __FUNCTION__);
|
||||
return -1;
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file enb_agent_common.h
|
||||
* \brief common message primitves and utilities
|
||||
* \author Navid Nikaein and Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifndef PROTO_AGENT_COMMON_H_
|
||||
#define PROTO_AGENT_COMMON_H_
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "flexsplit.pb-c.h"
|
||||
|
||||
// Do not need these
|
||||
//#include "stats_messages.pb-c.h"
|
||||
//#include "stats_common.pb-c.h"
|
||||
|
||||
#include "proto_agent_defs.h"
|
||||
//#include "ENB_APP/enb_config.h"
|
||||
#include "UTIL/MEM/mem_block.h"
|
||||
|
||||
//#include "LAYER2/MAC/extern.h"
|
||||
//#include "LAYER2/RLC/rlc.h"
|
||||
|
||||
# include "tree.h"
|
||||
# include "intertask_interface.h"
|
||||
|
||||
#define FLEXSPLIT_VERSION 0
|
||||
|
||||
typedef int (*proto_agent_message_decoded_callback)(
|
||||
mod_id_t mod_id,
|
||||
const void *params,
|
||||
Protocol__FlexsplitMessage **msg
|
||||
);
|
||||
|
||||
typedef int (*proto_agent_message_destruction_callback)(
|
||||
Protocol__FlexsplitMessage *msg
|
||||
);
|
||||
|
||||
|
||||
|
||||
/**********************************
|
||||
* progRAN protocol messages helper
|
||||
* functions and generic handlers
|
||||
**********************************/
|
||||
|
||||
int proto_agent_serialize_message(Protocol__FlexsplitMessage *msg, uint8_t **buf, int *size);
|
||||
int proto_agent_deserialize_message(void *data, int size, Protocol__FlexsplitMessage **msg);
|
||||
|
||||
uint8_t *proto_agent_pack_message(Protocol__FlexsplitMessage *msg, int *size);
|
||||
|
||||
err_code_t proto_agent_destroy_flexsplit_message(Protocol__FlexsplitMessage *msg);
|
||||
|
||||
int fsp_create_header(xid_t xid, Protocol__FspType type, Protocol__FspHeader **header);
|
||||
|
||||
int proto_agent_hello(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
|
||||
int proto_agent_destroy_hello(Protocol__FlexsplitMessage *msg);
|
||||
int proto_agent_echo_request(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
|
||||
int proto_agent_destroy_echo_request(Protocol__FlexsplitMessage *msg);
|
||||
int proto_agent_echo_reply(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
|
||||
int proto_agent_destroy_echo_reply(Protocol__FlexsplitMessage *msg);
|
||||
|
||||
int proto_agent_pdcp_data_req(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
|
||||
int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
|
||||
int proto_agent_destroy_pdcp_data_req(Protocol__FlexsplitMessage *msg);
|
||||
int proto_agent_pdcp_data_ind(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
|
||||
int proto_agent_destroy_pdcp_data_ind(Protocol__FlexsplitMessage *msg);
|
||||
int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
|
||||
|
||||
int just_print(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
|
||||
|
||||
|
||||
int proto_agent_get_ack_result(mod_id_t mod_id, const void *params, Protocol__FlexsplitMessage **msg);
|
||||
|
||||
|
||||
Protocol__FlexsplitMessage* proto_agent_handle_message (mod_id_t mod_id,
|
||||
uint8_t *data,
|
||||
int size);
|
||||
|
||||
Protocol__FlexsplitMessage *proto_agent_handle_timed_task(void *args);
|
||||
|
||||
typedef struct _data_req_args data_req_args;
|
||||
typedef struct _dl_data_args dl_data_args;
|
||||
|
||||
struct _data_req_args{
|
||||
const protocol_ctxt_t* ctxt;
|
||||
srb_flag_t srb_flag;
|
||||
MBMS_flag_t MBMS_flag;
|
||||
rb_id_t rb_id;
|
||||
mui_t mui;
|
||||
confirm_t confirm;
|
||||
sdu_size_t sdu_size;
|
||||
mem_block_t *sdu_p;
|
||||
};
|
||||
|
||||
struct _dl_data_args{
|
||||
uint8_t pdu_type;
|
||||
uint32_t sn;
|
||||
frame_t frame;
|
||||
sub_frame_t subframe;
|
||||
rnti_t rnti;
|
||||
sdu_size_t sdu_size;
|
||||
mem_block_t *sdu_p;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file enb_agent_defs.h
|
||||
* \brief enb agent common definitions
|
||||
* \author Navid Nikaein and Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
#ifndef PROTO_AGENT_DEFS_H_
|
||||
#define PROTO_AGENT_DEFS_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "openairinterface5g_limits.h"
|
||||
#include "UTIL/ASYNC_IF/link_manager.h"
|
||||
|
||||
#define DEFAULT_PROTO_AGENT_IPv4_ADDRESS "127.0.0.1"
|
||||
#define DEFAULT_PROTO_AGENT_PORT 2210
|
||||
#define DEFAULT_PROTO_AGENT_CACHE "/mnt/oai_agent_cache"
|
||||
|
||||
typedef enum {
|
||||
|
||||
PROTO_AGENT_DEFAULT=0,
|
||||
|
||||
ENB_AGENT_PHY=1,
|
||||
ENB_AGENT_MAC=2,
|
||||
ENB_AGENT_RLC=3,
|
||||
ENB_AGENT_PDCP=4,
|
||||
ENB_AGENT_RRC=5,
|
||||
ENB_AGENT_S1AP=6,
|
||||
ENB_AGENT_GTP=7,
|
||||
ENB_AGENT_X2AP=8,
|
||||
|
||||
ENB_AGENT_MAX=9,
|
||||
|
||||
} proto_agent_id_t;
|
||||
|
||||
/*
|
||||
typedef enum {
|
||||
ENB_AGENT_ACTION_NONE = 0x0,
|
||||
|
||||
ENB_AGENT_ACTION_SEND = 0x1,
|
||||
|
||||
ENB_AGENT_ACTION_APPLY = 0x2,
|
||||
|
||||
ENB_AGENT_ACTION_CLEAR = 0x4,
|
||||
|
||||
ENB_AGENT_ACTION_WRITE = 0x8,
|
||||
|
||||
ENB_AGENT_ACTION_FILTER = 0x10,
|
||||
|
||||
ENB_AGENT_ACTION_PREPROCESS = 0x20,
|
||||
|
||||
ENB_AGENT_ACTION_METER = 0x40,
|
||||
|
||||
ENB_AGENT_ACTION_MAX = 0x7f,
|
||||
} agent_action_t;
|
||||
*/
|
||||
/*
|
||||
typedef enum {
|
||||
|
||||
RAN_LTE_OAI= 0,
|
||||
|
||||
RAN_NAME_MAX = 0x7f,
|
||||
} ran_name_t;
|
||||
*/
|
||||
typedef uint8_t xid_t;
|
||||
typedef uint8_t mod_id_t; // module or enb id
|
||||
typedef uint8_t lcid_t;
|
||||
typedef int32_t err_code_t;
|
||||
|
||||
typedef struct {
|
||||
/* general info */
|
||||
|
||||
/* stats */
|
||||
|
||||
uint32_t total_rx_msg;
|
||||
uint32_t total_tx_msg;
|
||||
|
||||
uint32_t rx_msg[NUMBER_OF_eNB_MAX];
|
||||
uint32_t tx_msg[NUMBER_OF_eNB_MAX];
|
||||
|
||||
} proto_agent_info_t;
|
||||
|
||||
/* forward declaration */
|
||||
struct proto_agent_channel_s;
|
||||
|
||||
typedef struct proto_agent_instance_s {
|
||||
mod_id_t mod_id;
|
||||
proto_agent_info_t agent_info;
|
||||
struct proto_agent_channel_s *channel;
|
||||
pthread_t recv_thread;
|
||||
uint8_t exit;
|
||||
} proto_agent_instance_t;
|
||||
|
||||
#endif
|
||||
@@ -1,138 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file enb_agent_handler.c
|
||||
* \brief enb agent tx and rx message handler
|
||||
* \author Navid Nikaein and Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
|
||||
#include "proto_agent_common.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
|
||||
proto_agent_message_decoded_callback proto_agent_messages_callback[][3] = {
|
||||
{proto_agent_hello, 0, 0}, /* agent hello */
|
||||
{proto_agent_echo_reply, 0, 0}, /* echo */
|
||||
{0, just_print, 0}, /* just print */
|
||||
{proto_agent_pdcp_data_req_process, proto_agent_pdcp_data_req_process, 0}, /* PDCP data REQ */
|
||||
{0, proto_agent_get_ack_result, 0}, /* get ACK result */
|
||||
{proto_agent_pdcp_data_ind_process, proto_agent_pdcp_data_ind_process, 0}, /* PDCP data IND */
|
||||
{0, just_print, 0}, /* just print */
|
||||
};
|
||||
|
||||
proto_agent_message_destruction_callback proto_message_destruction_callback[] = {
|
||||
proto_agent_destroy_hello,
|
||||
proto_agent_destroy_echo_request,
|
||||
proto_agent_destroy_echo_reply,
|
||||
proto_agent_destroy_pdcp_data_req,
|
||||
0,
|
||||
proto_agent_destroy_pdcp_data_ind,
|
||||
0,
|
||||
};
|
||||
|
||||
//static const char *proto_agent_direction2String[] = {
|
||||
// "", /* not_set */
|
||||
// "originating message", /* originating message */
|
||||
// "successfull outcome", /* successfull outcome */
|
||||
// "unsuccessfull outcome", /* unsuccessfull outcome */
|
||||
//};
|
||||
|
||||
|
||||
Protocol__FlexsplitMessage* proto_agent_handle_message (mod_id_t mod_id,
|
||||
uint8_t *data,
|
||||
int size){
|
||||
|
||||
Protocol__FlexsplitMessage *decoded_message = NULL;
|
||||
Protocol__FlexsplitMessage *reply_message = NULL;
|
||||
err_code_t err_code;
|
||||
DevAssert(data != NULL);
|
||||
|
||||
LOG_D(PROTO_AGENT, "Deserializing message with size %u \n", size);
|
||||
if (proto_agent_deserialize_message(data, (int) size, &decoded_message) < 0) {
|
||||
err_code= PROTOCOL__FLEXSPLIT_ERR__MSG_DECODING;
|
||||
goto error;
|
||||
}
|
||||
/* after deserialization, we don't need the original data memory anymore */
|
||||
free(data);
|
||||
Protocol__FspHeader *header = (Protocol__FspHeader*) decoded_message;
|
||||
if (header->has_type)
|
||||
{
|
||||
LOG_D(PROTO_AGENT, "Deserialized MSG type is %d and %u\n", decoded_message->msg_case, decoded_message->msg_dir);
|
||||
}
|
||||
|
||||
if ((decoded_message->msg_case > sizeof(proto_agent_messages_callback) / (3*sizeof(proto_agent_message_decoded_callback))) ||
|
||||
(decoded_message->msg_dir > PROTOCOL__FLEXSPLIT_DIRECTION__UNSUCCESSFUL_OUTCOME))
|
||||
{
|
||||
err_code= PROTOCOL__FLEXSPLIT_ERR__MSG_NOT_HANDLED;
|
||||
LOG_D(PROTO_AGENT,"Handling message: MSG NOT handled, going to error\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
err_code = ((*proto_agent_messages_callback[decoded_message->msg_case-1][decoded_message->msg_dir-1])(mod_id, (void *) decoded_message, &reply_message));
|
||||
|
||||
if ( err_code < 0 )
|
||||
{
|
||||
LOG_I(PROTO_AGENT, "decoded_message case : %d, direction : %d \n", decoded_message->msg_case-1, decoded_message->msg_dir-1);
|
||||
goto error;
|
||||
}
|
||||
|
||||
protocol__flexsplit_message__free_unpacked(decoded_message, NULL);
|
||||
LOG_D(PROTO_AGENT,"Returning REPLY message after the callback\n");
|
||||
return reply_message;
|
||||
|
||||
error:
|
||||
LOG_E(PROTO_AGENT,"errno %d occured\n",err_code);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
uint8_t *proto_agent_pack_message(Protocol__FlexsplitMessage *msg, int *size)
|
||||
{
|
||||
uint8_t *buffer;
|
||||
err_code_t err_code = PROTOCOL__FLEXSPLIT_ERR__NO_ERR;
|
||||
|
||||
if (proto_agent_serialize_message(msg, &buffer, size) < 0 ) {
|
||||
err_code = PROTOCOL__FLEXSPLIT_ERR__MSG_ENCODING;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (proto_message_destruction_callback[msg->msg_case-1])
|
||||
err_code = ((*proto_message_destruction_callback[msg->msg_case-1])(msg));
|
||||
|
||||
DevAssert(buffer !=NULL);
|
||||
|
||||
LOG_D(PROTO_AGENT,"Serialized the enb mac stats reply (size %d)\n", *size);
|
||||
return buffer;
|
||||
|
||||
error :
|
||||
LOG_E(PROTO_AGENT,"errno %d occured\n",err_code);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
err_code_t proto_agent_destroy_flexsplit_message(Protocol__FlexsplitMessage *msg) {
|
||||
return ((*proto_message_destruction_callback[msg->msg_case-1])(msg));
|
||||
}
|
||||
@@ -1,152 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file enb_agent_net_comm.c
|
||||
* \brief enb agent network interface abstraction
|
||||
* \author Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
|
||||
#include "proto_agent_net_comm.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
|
||||
proto_agent_channel_t *proto_channel[NUMBER_OF_eNB_MAX][ENB_AGENT_MAX];
|
||||
static proto_agent_channel_instance_t channel_instance;
|
||||
int proto_agent_channel_id = 0;
|
||||
|
||||
int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id) {
|
||||
int i;
|
||||
|
||||
if (channel == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (agent_id == ENB_AGENT_MAX) {
|
||||
for (i = 0; i < ENB_AGENT_MAX; i++) {
|
||||
proto_channel[mod_id][i] = channel;
|
||||
}
|
||||
} else {
|
||||
proto_channel[mod_id][agent_id] = channel;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void proto_agent_unregister_channel(mod_id_t mod_id, proto_agent_id_t agent_id) {
|
||||
int i;
|
||||
|
||||
if (agent_id == ENB_AGENT_MAX) {
|
||||
for (i = 0; i < ENB_AGENT_MAX; i++) {
|
||||
proto_channel[mod_id][i] = NULL;
|
||||
}
|
||||
} else {
|
||||
proto_channel[mod_id][agent_id] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int proto_agent_create_channel(void *channel_info,
|
||||
int (*msg_send)(void *data, int size, int priority, void *channel_info),
|
||||
int (*msg_recv)(void **data, int *priority, void *channel_info),
|
||||
void (*release)(proto_agent_channel_t *channel)) {
|
||||
|
||||
int channel_id = ++proto_agent_channel_id;
|
||||
proto_agent_channel_t *channel = (proto_agent_channel_t *) malloc(sizeof(proto_agent_channel_t));
|
||||
channel->channel_id = channel_id;
|
||||
channel->channel_info = channel_info;
|
||||
channel->msg_send = msg_send;
|
||||
channel->msg_recv = msg_recv;
|
||||
channel->release = release;
|
||||
|
||||
/*element should be a real pointer*/
|
||||
RB_INSERT(proto_agent_channel_map, &channel_instance.proto_agent_head, channel);
|
||||
|
||||
LOG_D(PROTO_AGENT, "Created a new channel with id 0x%x\n", channel->channel_id);
|
||||
|
||||
return channel_id;
|
||||
}
|
||||
|
||||
int proto_agent_destroy_channel(int channel_id) {
|
||||
int i, j;
|
||||
|
||||
/*Check to see if channel exists*/
|
||||
struct proto_agent_channel_s *e = NULL;
|
||||
struct proto_agent_channel_s search;
|
||||
memset(&search, 0, sizeof(struct proto_agent_channel_s));
|
||||
|
||||
e = RB_FIND(proto_agent_channel_map, &channel_instance.proto_agent_head, &search);
|
||||
|
||||
if (e == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*Unregister the channel from all agents*/
|
||||
for (i = 0; i < NUMBER_OF_eNB_MAX; i++) {
|
||||
for (j = 0; j < ENB_AGENT_MAX; j++) {
|
||||
if (proto_channel[i][j] != NULL) {
|
||||
if (proto_channel[i][j]->channel_id == e->channel_id) {
|
||||
proto_channel[i][j] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*Remove the channel from the tree and free memory*/
|
||||
RB_REMOVE(proto_agent_channel_map, &channel_instance.proto_agent_head, e);
|
||||
e->release(e);
|
||||
free(e);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
err_code_t proto_agent_init_channel_container(void) {
|
||||
int i, j;
|
||||
LOG_D(PROTO_AGENT, "init RB tree for channel container\n");
|
||||
|
||||
RB_INIT(&channel_instance.proto_agent_head);
|
||||
|
||||
for (i = 0; i < NUMBER_OF_eNB_MAX; i++) {
|
||||
for (j = 0; j < ENB_AGENT_MAX; j++) {
|
||||
proto_channel[i][j] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
RB_GENERATE(proto_agent_channel_map,proto_agent_channel_s, entry, proto_agent_compare_channel);
|
||||
|
||||
int proto_agent_compare_channel(struct proto_agent_channel_s *a, struct proto_agent_channel_s *b) {
|
||||
if (a->channel_id < b->channel_id) return -1;
|
||||
if (a->channel_id > b->channel_id) return 1;
|
||||
|
||||
// equal timers
|
||||
return 0;
|
||||
}
|
||||
|
||||
proto_agent_channel_t * proto_agent_get_channel(int channel_id) {
|
||||
|
||||
struct proto_agent_channel_s search;
|
||||
memset(&search, 0, sizeof(struct proto_agent_channel_s));
|
||||
search.channel_id = channel_id;
|
||||
|
||||
return RB_FIND(proto_agent_channel_map, &channel_instance.proto_agent_head, &search);
|
||||
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file enb_agent_net_comm.h
|
||||
* \brief enb agent network interface abstraction
|
||||
* \autho Xenofon Foukas
|
||||
* \date 2016
|
||||
* \version 0.1
|
||||
*/
|
||||
#ifndef PROTO_AGENT_NET_COMM_H_
|
||||
#define PROTO_AGENT_NET_COMM_H_
|
||||
|
||||
#include "proto_agent_defs.h"
|
||||
|
||||
#include "tree.h"
|
||||
#define ENB_AGENT_MAX 9
|
||||
|
||||
/* forward declaration */
|
||||
struct proto_agent_async_channel_s;
|
||||
|
||||
/*Channel related information used for Tx/Rx of protocol messages*/
|
||||
typedef struct proto_agent_channel_s {
|
||||
RB_ENTRY(proto_agent_channel_s) entry;
|
||||
int channel_id;
|
||||
struct proto_agent_async_channel_s *channel_info;
|
||||
/*Callbacks for channel message Tx and Rx*/
|
||||
int (*msg_send)(void *data, int size, int priority, void *channel_info);
|
||||
int (*msg_recv)(void **data, int *priority, void *channel_info);
|
||||
void (*release)(struct proto_agent_channel_s *channel);
|
||||
} proto_agent_channel_t;
|
||||
|
||||
typedef struct proto_agent_channel_instance_s{
|
||||
RB_HEAD(proto_agent_channel_map, proto_agent_channel_s) proto_agent_head;
|
||||
} proto_agent_channel_instance_t;
|
||||
|
||||
|
||||
/*Register a channel to an agent. Use ENB_AGENT_MAX to register the
|
||||
*same channel to all agents*/
|
||||
int proto_agent_register_channel(mod_id_t mod_id, proto_agent_channel_t *channel, proto_agent_id_t agent_id);
|
||||
|
||||
/*Unregister the current channel of an agent. Use ENB_AGENT_MAX to unregister all channels*/
|
||||
void proto_agent_unregister_channel(mod_id_t mod_id, proto_agent_id_t agent_id);
|
||||
|
||||
/*Create a new channel. Returns the id of the new channel or negative number otherwise*/
|
||||
int proto_agent_create_channel(void *channel_info,
|
||||
int (*msg_send)(void *data, int size, int priority, void *channel_info),
|
||||
int (*msg_recv)(void **data, int *priority, void *channel_info),
|
||||
void (*release)(proto_agent_channel_t *channel));
|
||||
|
||||
/*Unregister a channel from all agents and destroy it. Returns 0 in case of success*/
|
||||
int proto_agent_destroy_channel(int channel_id);
|
||||
|
||||
/*Return an agent communication channel based on its id*/
|
||||
proto_agent_channel_t * proto_agent_get_channel(int channel_id);
|
||||
|
||||
/*Should be called before performing any channel operations*/
|
||||
err_code_t proto_agent_init_channel_container(void);
|
||||
|
||||
int proto_agent_compare_channel(struct proto_agent_channel_s *a, struct proto_agent_channel_s *b);
|
||||
|
||||
/* RB_PROTOTYPE is for .h files */
|
||||
RB_PROTOTYPE(proto_agent_channel_map, proto_agent_channel_s, entry, proto_agent_compare_channel);
|
||||
|
||||
#endif /*ENB_AGENT_COMM_H_*/
|
||||
@@ -27,7 +27,6 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
#include "hashtable.h"
|
||||
#include "rlc_am.h"
|
||||
#include "rlc_am_segment.h"
|
||||
@@ -238,17 +237,6 @@ void config_req_rlc_am_asn1 (
|
||||
(config_am_pP->ul_AM_RLC.t_PollRetransmit<LTE_T_PollRetransmit_spare5) &&
|
||||
(config_am_pP->dl_AM_RLC.t_Reordering<32) &&
|
||||
(config_am_pP->dl_AM_RLC.t_StatusProhibit<LTE_T_StatusProhibit_spare2) ) {
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_PollRetx %u t_Reord %u t_StatusPro %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
PollRetransmit_tab[config_am_pP->ul_AM_RLC.t_PollRetransmit],
|
||||
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
|
||||
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CONFIG_REQ (max_retx_threshold=%d poll_pdu=%d poll_byte=%d t_poll_retransmit=%d t_reord=%d t_status_prohibit=%d)\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
|
||||
maxRetxThreshold_tab[config_am_pP->ul_AM_RLC.maxRetxThreshold],
|
||||
@@ -267,14 +255,6 @@ void config_req_rlc_am_asn1 (
|
||||
am_t_Reordering_tab[config_am_pP->dl_AM_RLC.t_Reordering],
|
||||
t_StatusProhibit_tab[config_am_pP->dl_AM_RLC.t_StatusProhibit]);
|
||||
} else {
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p));
|
||||
LOG_D(RLC,
|
||||
PROTOCOL_RLC_AM_CTXT_FMT"ILLEGAL CONFIG_REQ (max_retx_threshold=%ld poll_pdu=%ld poll_byte=%ld t_poll_retransmit=%ld t_reord=%ld t_status_prohibit=%ld), RLC-AM NOT CONFIGURED\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
|
||||
@@ -537,27 +517,6 @@ rlc_am_mac_status_indication (
|
||||
}
|
||||
}
|
||||
|
||||
if (MESSAGE_CHART_GENERATOR) {
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-IND %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc));
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_MAC_ENB:MSC_MAC_UE,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS-RESP BO:%u/n%u(%u) %s sdu remain %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc),
|
||||
status_resp.buffer_occupancy_in_bytes,
|
||||
status_resp.buffer_occupancy_in_pdus,rlc->nb_sdu,
|
||||
(status_resp.head_sdu_is_segmented)?"sdu seg":"sdu not seg",
|
||||
status_resp.head_sdu_remaining_size_to_send);
|
||||
}
|
||||
|
||||
if (LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
LOG_UI(RLC, PROTOCOL_RLC_AM_CTXT_FMT" MAC_STATUS_INDICATION (DATA) -> %d bytes\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc),
|
||||
@@ -610,7 +569,7 @@ rlc_am_mac_data_request (
|
||||
|
||||
data_req.rlc_info.rlc_protocol_state = l_rlc_p->protocol_state;
|
||||
|
||||
if ( (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC))&& data_req.data.nb_elements > 0) {
|
||||
if ( (LOG_DEBUGFLAG(DEBUG_RLC))&& data_req.data.nb_elements > 0) {
|
||||
tb_p = data_req.data.head;
|
||||
|
||||
while (tb_p != NULL) {
|
||||
@@ -619,39 +578,6 @@ rlc_am_mac_data_request (
|
||||
|
||||
if ((((struct mac_tb_req *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) {
|
||||
if (rlc_am_get_data_pdu_infos(ctxt_pP,l_rlc_p,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) {
|
||||
if (MESSAGE_CHART_GENERATOR) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size],
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA SN %u size %u RF %u P %u FI %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
pdu_info.sn,
|
||||
tb_size_in_bytes,
|
||||
pdu_info.rf,
|
||||
pdu_info.p,
|
||||
pdu_info.fi);
|
||||
|
||||
if (pdu_info.rf) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " LSF %u\n", pdu_info.lsf);
|
||||
message_string_size += sprintf(&message_string[message_string_size], " SO %u\n", pdu_info.so);
|
||||
}
|
||||
|
||||
if (pdu_info.e) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], "| HE:");
|
||||
|
||||
for (index=0; index < pdu_info.num_li; index++) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
|
||||
(char *)rlc_am_pdu_sn_10_p,
|
||||
tb_size_in_bytes,
|
||||
message_string);
|
||||
}
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
|
||||
@@ -723,34 +649,6 @@ rlc_am_mac_data_request (
|
||||
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) {
|
||||
tb_size_in_bytes = ((struct mac_tb_req *) (tb_p->data))->tb_size; //tb_size_in_bytes modified by rlc_am_get_control_pdu_infos!
|
||||
|
||||
if (MESSAGE_CHART_GENERATOR ) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size],
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS ACK_SN %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
l_rlc_p->control_pdu_info.ack_sn);
|
||||
|
||||
for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) {
|
||||
if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u",
|
||||
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn,
|
||||
l_rlc_p->control_pdu_info.nack_list[num_nack].so_start,
|
||||
l_rlc_p->control_pdu_info.nack_list[num_nack].so_end);
|
||||
} else {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u",
|
||||
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn);
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
|
||||
(char *)rlc_am_pdu_sn_10_p,
|
||||
tb_size_in_bytes,
|
||||
message_string);
|
||||
}
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
|
||||
@@ -780,7 +678,7 @@ rlc_am_mac_data_request (
|
||||
|
||||
tb_p = tb_p->next;
|
||||
} /* while */
|
||||
} /* MESSAGE_CHART_GENERATOR && data_req.data.nb_elements > 0 */
|
||||
} /* data_req.data.nb_elements > 0 */
|
||||
|
||||
data_req.buffer_occupancy_in_pdus = 0;
|
||||
return data_req;
|
||||
@@ -812,7 +710,7 @@ rlc_am_mac_data_indication (
|
||||
(void)index;
|
||||
(void)l_rlc_p; /* avoid gcc warning "unused variable" */
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_RLC) || MESSAGE_CHART_GENERATOR ) {
|
||||
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
if (data_indP.data.nb_elements > 0) {
|
||||
tb_p = data_indP.data.head;
|
||||
|
||||
@@ -822,39 +720,6 @@ rlc_am_mac_data_indication (
|
||||
|
||||
if ((((struct mac_tb_ind *) (tb_p->data))->data_ptr[0] & RLC_DC_MASK) == RLC_DC_DATA_PDU ) {
|
||||
if (rlc_am_get_data_pdu_infos(ctxt_pP,l_rlc_p,rlc_am_pdu_sn_10_p, tb_size_in_bytes, &pdu_info) >= 0) {
|
||||
if (MESSAGE_CHART_GENERATOR) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size],
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA SN %u size %u RF %u P %u FI %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
pdu_info.sn,
|
||||
tb_size_in_bytes,
|
||||
pdu_info.rf,
|
||||
pdu_info.p,
|
||||
pdu_info.fi);
|
||||
|
||||
if (pdu_info.rf) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " LSF %u\n", pdu_info.lsf);
|
||||
message_string_size += sprintf(&message_string[message_string_size], " SO %u\n", pdu_info.so);
|
||||
}
|
||||
|
||||
if (pdu_info.e) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], "| HE:");
|
||||
|
||||
for (index=0; index < pdu_info.num_li; index++) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
|
||||
(char *)rlc_am_pdu_sn_10_p,
|
||||
tb_size_in_bytes,
|
||||
message_string);
|
||||
}
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
|
||||
@@ -923,34 +788,6 @@ rlc_am_mac_data_indication (
|
||||
}
|
||||
} else {
|
||||
if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, &tb_size_in_bytes, &l_rlc_p->control_pdu_info) >= 0) {
|
||||
if (MESSAGE_CHART_GENERATOR) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size],
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" STATUS size ACK_SN %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
l_rlc_p->control_pdu_info.ack_sn);
|
||||
|
||||
for (num_nack = 0; num_nack < l_rlc_p->control_pdu_info.num_nack; num_nack++) {
|
||||
if (l_rlc_p->control_pdu_info.nack_list[num_nack].e2) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u SO START %u SO END %u",
|
||||
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn,
|
||||
l_rlc_p->control_pdu_info.nack_list[num_nack].so_start,
|
||||
l_rlc_p->control_pdu_info.nack_list[num_nack].so_end);
|
||||
} else {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " NACK SN %u",
|
||||
l_rlc_p->control_pdu_info.nack_list[num_nack].nack_sn);
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
|
||||
(char *)rlc_am_pdu_sn_10_p,
|
||||
tb_size_in_bytes,
|
||||
message_string);
|
||||
}
|
||||
|
||||
if ( LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
|
||||
@@ -1009,16 +846,6 @@ rlc_am_data_req (
|
||||
mui = ((struct rlc_am_data_req *) (sdu_pP->data))->mui;
|
||||
data_offset = ((struct rlc_am_data_req *) (sdu_pP->data))->data_offset;
|
||||
data_size = ((struct rlc_am_data_req *) (sdu_pP->data))->data_size;
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(const char *)(&sdu_pP->data[data_offset]),
|
||||
data_size,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-REQ size %u mui %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
data_size,
|
||||
mui);
|
||||
|
||||
if (LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
|
||||
@@ -1094,22 +921,6 @@ rlc_am_data_req (
|
||||
l_rlc_p->vt_s);
|
||||
}
|
||||
} else {
|
||||
if( MESSAGE_CHART_GENERATOR) {
|
||||
mui = ((struct rlc_am_data_req *) (sdu_pP->data))->mui;
|
||||
data_offset = ((struct rlc_am_data_req *) (sdu_pP->data))->data_offset;
|
||||
data_size = ((struct rlc_am_data_req *) (sdu_pP->data))->data_size;
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(const char *)(&sdu_pP->data[data_offset]),
|
||||
data_size,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-REQ size %u mui %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
data_size,
|
||||
mui);
|
||||
}
|
||||
|
||||
LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RLC_AM_DATA_REQ BUFFER FULL, NB SDU %d current_sdu_index=%d next_sdu_index=%d size_input_sdus_buffer=%d vtA=%d vtS=%d\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
|
||||
l_rlc_p->nb_sdu,
|
||||
|
||||
@@ -78,16 +78,7 @@
|
||||
int pmtl_rc = pthread_mutex_trylock(mUTEX);\
|
||||
if (pmtl_rc != 0){\
|
||||
if (pmtl_rc == EBUSY) {\
|
||||
MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 " PROTOCOL_RLC_AM_MSC_FMT " Warning try lock %s busy",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\
|
||||
#mUTEX);\
|
||||
pthread_mutex_lock(mUTEX);\
|
||||
} else {\
|
||||
MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 " PROTOCOL_RLC_AM_MSC_FMT " Error try lock %s %d",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(cTXT,rLC),\
|
||||
#mUTEX, pmtl_rc);\
|
||||
}\
|
||||
}\
|
||||
} while (0);
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "list.h"
|
||||
//#include "LAYER2/MAC/extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "msc.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
inline void
|
||||
@@ -152,16 +151,6 @@ rlc_am_send_sdu (
|
||||
#if !ENABLE_ITTI
|
||||
RLC_AM_MUTEX_UNLOCK(&rlc_pP->lock_input_sdus);
|
||||
#endif
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(const char *)(rlc_pP->output_sdu_in_construction->data),
|
||||
rlc_pP->output_sdu_size_to_write,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" DATA-IND size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP),
|
||||
rlc_pP->output_sdu_size_to_write
|
||||
);
|
||||
rlc_data_ind (ctxt_pP,
|
||||
BOOL_NOT(rlc_pP->is_data_plane),
|
||||
MBMS_FLAG_NO,
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "platform_types.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
#include "rlc.h"
|
||||
#include "rlc_am.h"
|
||||
#include "list.h"
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "rlc.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "msc.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
boolean_t rlc_am_nack_pdu (
|
||||
const protocol_ctxt_t* const ctxt_pP,
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "platform_types.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "msc.h"
|
||||
#include "list.h"
|
||||
#include "rlc_am.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "rlc_am.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "msc.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rlc_am_check_timer_poll_retransmit(
|
||||
@@ -69,11 +68,6 @@ rlc_am_check_timer_poll_retransmit(
|
||||
rlc_pP->t_poll_retransmit.running = 0;
|
||||
rlc_pP->t_poll_retransmit.timed_out = 1;
|
||||
rlc_pP->stat_timer_poll_retransmit_timed_out += 1;
|
||||
#if MESSAGE_CHART_GENERATOR_RLC_MAC
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit timed-out",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
|
||||
#endif
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] TIME-OUT\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
|
||||
|
||||
@@ -144,11 +138,6 @@ rlc_am_stop_and_reset_timer_poll_retransmit(
|
||||
rlc_pP->t_poll_retransmit.ms_time_out = 0;
|
||||
rlc_pP->t_poll_retransmit.ms_start = 0;
|
||||
rlc_pP->t_poll_retransmit.timed_out = 0;
|
||||
#if MESSAGE_CHART_GENERATOR_RLC_MAC
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit stopped & reseted",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
|
||||
#endif
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
@@ -167,11 +156,6 @@ rlc_am_start_timer_poll_retransmit(
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] STARTED (TIME-OUT = FRAME %05d)\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
|
||||
rlc_pP->t_poll_retransmit.ms_time_out);
|
||||
#if MESSAGE_CHART_GENERATOR_RLC_MAC
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit started (TO %u ms)",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_poll_retransmit.ms_time_out);
|
||||
#endif
|
||||
} else {
|
||||
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "rlc_am.h"
|
||||
# include "LAYER2/MAC/mac_extern.h"
|
||||
#include "common/utils//LOG/log.h"
|
||||
#include "msc.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rlc_am_check_timer_reordering(
|
||||
@@ -64,12 +63,6 @@ rlc_am_check_timer_reordering(
|
||||
// - start t-Reordering;
|
||||
// - set VR(X) to VR(H).
|
||||
|
||||
#if MESSAGE_CHART_GENERATOR_RLC_MAC
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering timed out",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
|
||||
#endif
|
||||
|
||||
//AssertFatal (rlc_pP->vr_x != RLC_SN_UNDEFINED, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id);
|
||||
if(rlc_pP->vr_x == RLC_SN_UNDEFINED){
|
||||
LOG_E(RLC, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id);
|
||||
@@ -153,11 +146,6 @@ rlc_am_stop_and_reset_timer_reordering(
|
||||
rlc_pP->t_reordering.ms_time_out = 0;
|
||||
rlc_pP->t_reordering.ms_start = 0;
|
||||
rlc_pP->t_reordering.timed_out = 0;
|
||||
#if MESSAGE_CHART_GENERATOR_RLC_MAC
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering stopped & reseted",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
|
||||
#endif
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
@@ -175,11 +163,6 @@ rlc_am_start_timer_reordering(
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] STARTED (TIME-OUT = %5u ms)\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
|
||||
rlc_pP->t_reordering.ms_time_out);
|
||||
#if MESSAGE_CHART_GENERATOR_RLC_MAC
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_reordering started (TO %u ms)",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_reordering.ms_time_out);
|
||||
#endif
|
||||
} else {
|
||||
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "rlc_am.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "msc.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
void
|
||||
rlc_am_check_timer_status_prohibit(
|
||||
@@ -60,12 +59,6 @@ rlc_am_check_timer_status_prohibit(
|
||||
rlc_pP->t_status_prohibit.running = 0;
|
||||
rlc_pP->t_status_prohibit.timed_out = 1;
|
||||
rlc_pP->stat_timer_status_prohibit_timed_out += 1;
|
||||
|
||||
#if MESSAGE_CHART_GENERATOR_RLC_MAC
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit timed out",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
|
||||
#endif
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] TIME-OUT\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
|
||||
//#warning TO DO rlc_am_check_timer_status_prohibit
|
||||
@@ -91,11 +84,6 @@ rlc_am_stop_and_reset_timer_status_prohibit(
|
||||
rlc_pP->t_status_prohibit.ms_time_out = 0;
|
||||
rlc_pP->t_status_prohibit.ms_start = 0;
|
||||
rlc_pP->t_status_prohibit.timed_out = 0;
|
||||
#if MESSAGE_CHART_GENERATOR_RLC_MAC
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit stopped & reseted",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -117,11 +105,6 @@ rlc_am_start_timer_status_prohibit(
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
|
||||
rlc_pP->t_status_prohibit.ms_time_out);
|
||||
LOG_D(RLC, "TIME-OUT = FRAME %u\n", rlc_pP->t_status_prohibit.ms_time_out);
|
||||
#if MESSAGE_CHART_GENERATOR_RLC_MAC
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" t_status_prohibit started (TO %u ms)",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_status_prohibit.ms_time_out);
|
||||
#endif
|
||||
} else {
|
||||
LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "intertask_interface.h"
|
||||
#endif
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
#include "rlc_um.h"
|
||||
#include "list.h"
|
||||
#include "rlc_primitives.h"
|
||||
@@ -166,7 +165,6 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind
|
||||
char message_string[10000];
|
||||
mem_block_t *tb_p;
|
||||
int16_t tb_size_in_bytes;
|
||||
size_t message_string_size = 0;
|
||||
rlc_um_pdu_info_t pdu_info;
|
||||
int index;
|
||||
int octet_index;
|
||||
@@ -183,38 +181,15 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind
|
||||
LOG_I(RLC, PROTOCOL_RLC_UM_CTXT_FMT" ERROR MAC_DATA_IND IN RLC_NULL_STATE\n",
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p));
|
||||
|
||||
if (data_indP.data.nb_elements > 0 && MESSAGE_CHART_GENERATOR) {
|
||||
if (data_indP.data.nb_elements > 0) {
|
||||
tb_p = data_indP.data.head;
|
||||
|
||||
while (tb_p != NULL) {
|
||||
tb_size_in_bytes = ((struct mac_tb_ind *) (tb_p->data))->size;
|
||||
rlc_um_get_pdu_infos(ctxt_pP,l_rlc_p,(rlc_um_pdu_sn_10_t *) ((struct mac_tb_ind *) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length);
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size],
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT"DATA SN %u size %u FI %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
pdu_info.sn,
|
||||
tb_size_in_bytes,
|
||||
pdu_info.fi);
|
||||
|
||||
if (pdu_info.e) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], "| HE:");
|
||||
|
||||
for (index=0; index < pdu_info.num_li; index++) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
|
||||
(const char *)pdu_info.payload,
|
||||
tb_size_in_bytes,
|
||||
message_string);
|
||||
tb_p = tb_p->next;
|
||||
}
|
||||
}/*MESSAGE_CHART_GENERATOR*/
|
||||
}
|
||||
|
||||
list_free (&data_indP.data);
|
||||
break;
|
||||
@@ -237,7 +212,7 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind
|
||||
// - enters the LOCAL_SUSPEND state.
|
||||
data_indP.tb_size = data_indP.tb_size >> 3;
|
||||
|
||||
if (data_indP.data.nb_elements > 0 && (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC))) {
|
||||
if (data_indP.data.nb_elements > 0 && (LOG_DEBUGFLAG(DEBUG_RLC))) {
|
||||
LOG_D(RLC, PROTOCOL_RLC_UM_CTXT_FMT" MAC_DATA_IND %d TBs\n",
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,l_rlc_p),
|
||||
data_indP.data.nb_elements);
|
||||
@@ -251,32 +226,6 @@ rlc_um_rx (const protocol_ctxt_t *const ctxt_pP, void *argP, struct mac_data_ind
|
||||
&pdu_info,
|
||||
l_rlc_p->rx_sn_length);
|
||||
|
||||
if (MESSAGE_CHART_GENERATOR) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size],
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT"DATA SN %u size %u FI %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
pdu_info.sn,
|
||||
tb_size_in_bytes,
|
||||
pdu_info.fi);
|
||||
|
||||
if (pdu_info.e) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], "| HE:");
|
||||
|
||||
for (index=0; index < pdu_info.num_li; index++) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
|
||||
(char *)pdu_info.payload,
|
||||
tb_size_in_bytes,
|
||||
message_string);
|
||||
}
|
||||
|
||||
if (LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
|
||||
@@ -483,89 +432,61 @@ rlc_um_mac_data_request (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP,cons
|
||||
continue;
|
||||
}
|
||||
|
||||
if (MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC) ) {
|
||||
if (LOG_DEBUGFLAG(DEBUG_RLC) ) {
|
||||
rlc_um_get_pdu_infos(ctxt_pP, l_rlc_p,(rlc_um_pdu_sn_10_t *) ((struct mac_tb_req *) (tb_p->data))->data_ptr, tb_size_in_bytes, &pdu_info, l_rlc_p->rx_sn_length);
|
||||
|
||||
if(MESSAGE_CHART_GENERATOR) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size],
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA SN %u size %u FI %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, l_rlc_p),
|
||||
pdu_info.sn,
|
||||
tb_size_in_bytes,
|
||||
pdu_info.fi);
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Header :\n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi);
|
||||
message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e);
|
||||
message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn);
|
||||
|
||||
if (pdu_info.e) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], "|HE:");
|
||||
if (pdu_info.e) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n");
|
||||
|
||||
for (index=0; index < pdu_info.num_li; index++) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " LI %u", pdu_info.li_list[index]);
|
||||
}
|
||||
for (index=0; index < pdu_info.num_li; index++) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]);
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_UE:MSC_RLC_ENB,
|
||||
(const char *)pdu_info.payload,
|
||||
pdu_info.payload_size,
|
||||
message_string);
|
||||
}
|
||||
|
||||
if(LOG_DEBUGFLAG(DEBUG_RLC)) {
|
||||
message_string_size = 0;
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Bearer : %ld\n", l_rlc_p->rb_id);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "PDU size : %u\n", tb_size_in_bytes);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Header size : %u\n", pdu_info.header_size);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Payload size: %u\n", pdu_info.payload_size);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "PDU type : RLC UM DATA IND: UMD PDU\n\n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], "Header :\n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], " FI : %u\n", pdu_info.fi);
|
||||
message_string_size += sprintf(&message_string[message_string_size], " E : %u\n", pdu_info.e);
|
||||
message_string_size += sprintf(&message_string[message_string_size], " SN : %u\n", pdu_info.sn);
|
||||
message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
|
||||
|
||||
if (pdu_info.e) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], "\nHeader extension : \n");
|
||||
|
||||
for (index=0; index < pdu_info.num_li; index++) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " LI : %u\n", pdu_info.li_list[index]);
|
||||
}
|
||||
}
|
||||
|
||||
message_string_size += sprintf(&message_string[message_string_size], "\nPayload : \n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\n");
|
||||
message_string_size += sprintf(&message_string[message_string_size], "------+-------------------------------------------------|\n");
|
||||
|
||||
for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) {
|
||||
if ((octet_index % 16) == 0) {
|
||||
if (octet_index != 0) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " |\n");
|
||||
}
|
||||
|
||||
message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index);
|
||||
for (octet_index = 0; octet_index < pdu_info.payload_size; octet_index++) {
|
||||
if ((octet_index % 16) == 0) {
|
||||
if (octet_index != 0) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " |\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Print every single octet in hexadecimal form
|
||||
*/
|
||||
message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]);
|
||||
/*
|
||||
* Align newline and pipes according to the octets in groups of 2
|
||||
*/
|
||||
message_string_size += sprintf(&message_string[message_string_size], " %04d |", octet_index);
|
||||
}
|
||||
|
||||
/*
|
||||
* Append enough spaces and put final pipe
|
||||
* Print every single octet in hexadecimal form
|
||||
*/
|
||||
for (index = octet_index; index < 16; ++index) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " ");
|
||||
}
|
||||
message_string_size += sprintf(&message_string[message_string_size], " %02x", pdu_info.payload[octet_index]);
|
||||
/*
|
||||
* Align newline and pipes according to the octets in groups of 2
|
||||
*/
|
||||
}
|
||||
|
||||
message_string_size += sprintf(&message_string[message_string_size], " |\n");
|
||||
LOG_UI(RLC, "%s\n", message_string);
|
||||
} /*LOG_DEBUGFLAG(DEBUG_RLC) */
|
||||
} /* MESSAGE_CHART_GENERATOR || LOG_DEBUGFLAG(DEBUG_RLC) */
|
||||
/*
|
||||
* Append enough spaces and put final pipe
|
||||
*/
|
||||
for (index = octet_index; index < 16; ++index) {
|
||||
message_string_size += sprintf(&message_string[message_string_size], " ");
|
||||
}
|
||||
|
||||
message_string_size += sprintf(&message_string[message_string_size], " |\n");
|
||||
LOG_UI(RLC, "%s\n", message_string);
|
||||
} /* LOG_DEBUGFLAG(DEBUG_RLC) */
|
||||
|
||||
tb_p = tb_p->next;
|
||||
} /* while (tb_p != NULL) */
|
||||
@@ -607,15 +528,6 @@ rlc_um_data_req (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, mem_block_t
|
||||
//rlc_p->next_sdu_index = (rlc_p->next_sdu_index + 1) % rlc_p->size_input_sdus_buffer;
|
||||
rlc_p->stat_tx_pdcp_sdu += 1;
|
||||
rlc_p->stat_tx_pdcp_bytes += ((struct rlc_um_tx_sdu_management *) (sdu_pP->data))->sdu_size;
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA-REQ size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP, rlc_p),
|
||||
((struct rlc_um_tx_sdu_management *) (sdu_pP->data))->sdu_size);
|
||||
|
||||
if (LOG_DEBUGFLAG(DEBUG_RLC) ) {
|
||||
data_offset = sizeof (struct rlc_um_data_req_alloc);
|
||||
@@ -660,14 +572,6 @@ rlc_um_data_req (const protocol_ctxt_t *const ctxt_pP, void *rlc_pP, mem_block_t
|
||||
list_add_tail_eurecom(sdu_pP, &rlc_p->input_sdus);
|
||||
RLC_UM_MUTEX_UNLOCK(&rlc_p->lock_input_sdus);
|
||||
|
||||
if (MESSAGE_CHART_GENERATOR) {
|
||||
if (rlc_p->buffer_occupancy > 4096) {
|
||||
MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 "PROTOCOL_RLC_AM_MSC_FMT" BO %u bytes",\
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_p), rlc_p->buffer_occupancy);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_T(RLC, PROTOCOL_RLC_UM_CTXT_FMT" BO %d , NB SDU %d\n",
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
|
||||
rlc_p->buffer_occupancy,
|
||||
|
||||
@@ -56,28 +56,13 @@
|
||||
rLC_Pp->rb_id,\
|
||||
__FUNCTION__
|
||||
|
||||
#define PROTOCOL_RLC_UM_MSC_FMT "[RNTI %" PRIx16 " %s %02ld]"
|
||||
#define PROTOCOL_RLC_UM_MSC_ARGS(CTXT_Pp, rLC_Pp) \
|
||||
CTXT_Pp->rnti,\
|
||||
(rLC_Pp->is_data_plane) ? "DRB UM" : "SRB UM",\
|
||||
rLC_Pp->rb_id
|
||||
|
||||
#if defined(TRACE_RLC_MUTEX)
|
||||
#define RLC_UM_MUTEX_LOCK(mUTEX, cTXT, rLC) \
|
||||
do {\
|
||||
int pmtl_rc = pthread_mutex_trylock(mUTEX);\
|
||||
if (pmtl_rc != 0){\
|
||||
if (pmtl_rc == EBUSY) {\
|
||||
MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 " PROTOCOL_RLC_UM_MSC_FMT " Warning try lock %s busy",\
|
||||
PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\
|
||||
#mUTEX);\
|
||||
pthread_mutex_lock(mUTEX);\
|
||||
} else {\
|
||||
MSC_LOG_EVENT((cTXT->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
|
||||
"0 " PROTOCOL_RLC_UM_MSC_FMT " Error try lock %s %d",\
|
||||
PROTOCOL_RLC_UM_MSC_ARGS(cTXT,rLC),\
|
||||
#mUTEX, pmtl_rc);\
|
||||
}\
|
||||
}\
|
||||
} while (0);
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "rlc_um_control_primitives.h"
|
||||
#include "LTE_T-Reordering.h"
|
||||
#include "msc.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void config_req_rlc_um (
|
||||
@@ -173,15 +172,6 @@ void config_req_rlc_um_asn1 (
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
|
||||
rlc_p->rb_id,
|
||||
ul_rlc_pP->sn_FieldLength);
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ UL sn_FieldLength %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
|
||||
ul_rlc_pP->sn_FieldLength);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -201,15 +191,6 @@ void config_req_rlc_um_asn1 (
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
|
||||
rlc_p->rb_id,
|
||||
dl_rlc_pP->sn_FieldLength);
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ DL sn_FieldLength %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
|
||||
dl_rlc_pP->sn_FieldLength);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -220,15 +201,6 @@ void config_req_rlc_um_asn1 (
|
||||
PROTOCOL_RLC_UM_CTXT_ARGS(ctxt_pP,rlc_p),
|
||||
rlc_p->rb_id,
|
||||
dl_rlc_pP->t_Reordering);
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
|
||||
dl_rlc_pP->t_Reordering);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -239,34 +211,12 @@ void config_req_rlc_um_asn1 (
|
||||
ul_sn_FieldLength,
|
||||
dl_sn_FieldLength,
|
||||
mbms_flagP);
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
|
||||
t_Reordering,
|
||||
ul_sn_FieldLength,
|
||||
dl_sn_FieldLength);
|
||||
} else {
|
||||
rlc_um_configure(ctxt_pP,rlc_p,
|
||||
t_Reordering,
|
||||
dl_sn_FieldLength,
|
||||
ul_sn_FieldLength,
|
||||
mbms_flagP);
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RRC_ENB:MSC_RRC_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_AM_MSC_FMT" CONFIG-REQ t_Reord %u rx snfl %u tx snfl %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP, rlc_p),
|
||||
t_Reordering,
|
||||
dl_sn_FieldLength,
|
||||
ul_sn_FieldLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "platform_types.h"
|
||||
#include "assertions.h"
|
||||
//-----------------------------------------------------------------------------
|
||||
#include "msc.h"
|
||||
#include "rlc.h"
|
||||
#include "rlc_um.h"
|
||||
#include "rlc_primitives.h"
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "list.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "msc.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
inline void
|
||||
@@ -117,17 +116,6 @@ rlc_um_send_sdu (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t *rlc_pP)
|
||||
rlc_pP->stat_rx_pdcp_sdu += 1;
|
||||
rlc_pP->stat_rx_pdcp_bytes += rlc_pP->output_sdu_size_to_write;
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
|
||||
(ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_PDCP_ENB:MSC_PDCP_UE,
|
||||
(const char*)(rlc_pP->output_sdu_in_construction->data),
|
||||
rlc_pP->output_sdu_size_to_write,
|
||||
MSC_AS_TIME_FMT" "PROTOCOL_RLC_UM_MSC_FMT" DATA-IND size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
PROTOCOL_RLC_UM_MSC_ARGS(ctxt_pP,rlc_pP),
|
||||
rlc_pP->output_sdu_size_to_write
|
||||
);
|
||||
|
||||
#if TEST_RLC_UM
|
||||
#if TRACE_RLC_UM_DISPLAY_ASCII_DATA
|
||||
rlc_pP->output_sdu_in_construction->data[rlc_pP->output_sdu_size_to_write] = 0;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
#include <assert.h>
|
||||
#include "assertions.h"
|
||||
#include "msc.h"
|
||||
#include "list.h"
|
||||
#include "rlc_um.h"
|
||||
#include "rlc_primitives.h"
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
|
||||
#ifndef __PROTO_AGENT_RLC_PRIMITIVES_H__
|
||||
#define __PROTO_AGENT_RLC_PRIMITIVES_H__
|
||||
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
#include "LAYER2/PROTO_AGENT/proto_agent.h"
|
||||
// PROTO AGENT
|
||||
pthread_t async_server_thread;
|
||||
int async_server_thread_finalize (void);
|
||||
void async_server_thread_init (void);
|
||||
|
||||
pthread_mutex_t async_server_lock;
|
||||
pthread_cond_t async_server_notify;
|
||||
int async_server_shutdown;
|
||||
|
||||
#endif
|
||||
@@ -674,7 +674,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
|
||||
sdap_gnb_ul_header_handler(buf[0]); // Handler for the UL gNB SDAP Header
|
||||
}
|
||||
LOG_D(PDCP, "%s() (drb %d) sending message to gtp size %d\n", __func__, rb_id, size-offset);
|
||||
itti_send_msg_to_task(TASK_VARIABLE, INSTANCE_DEFAULT, message_p);
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, INSTANCE_DEFAULT, message_p);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -728,7 +728,7 @@ rb_found:
|
||||
LOG_D(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_VARIABLE, CUuniqInstance, message_p);
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, CUuniqInstance, message_p);
|
||||
} else {
|
||||
|
||||
memblock = get_free_mem_block(size, __FUNCTION__);
|
||||
@@ -1103,7 +1103,7 @@ boolean_t nr_rrc_pdcp_config_asn1_req(
|
||||
if (kRRCint != NULL) {
|
||||
/* todo */
|
||||
}
|
||||
|
||||
|
||||
if (drb2release_list != NULL) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@
|
||||
|
||||
#include "openair2/F1AP/f1ap_du_rrc_message_transfer.h"
|
||||
|
||||
#include "openair2/LAYER2/PROTO_AGENT/proto_agent.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
#include <stdint.h>
|
||||
@@ -518,7 +516,7 @@ rb_found:
|
||||
req->pdusession_id=rb_id;
|
||||
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
|
||||
extern instance_t DUuniqInstance;
|
||||
itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg);
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,7 +440,7 @@ rb_found:
|
||||
req->rnti=ue->rnti;
|
||||
req->rab_id=rb_id+4;
|
||||
LOG_D(RLC, "Received uplink user-plane traffic at RLC-DU to be sent to the CU, size %d \n", size);
|
||||
itti_send_msg_to_task(OCP_GTPV1_U, DUuniqInstance, msg);
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, DUuniqInstance, msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
|
||||
#include "m2ap_itti_messaging.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
|
||||
@@ -174,8 +173,6 @@ int m2ap_MCE_generate_m2_setup_request(
|
||||
return -1;
|
||||
}
|
||||
|
||||
//MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id);
|
||||
|
||||
m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
@@ -311,8 +308,6 @@ int m2ap_MCE_generate_m2_setup_response(m2ap_MCE_instance_t *instance_p, m2ap_MC
|
||||
|
||||
m2ap_MCE_data_p->state = M2AP_MCE_STATE_READY;
|
||||
|
||||
//MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id);
|
||||
|
||||
m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
@@ -367,11 +362,6 @@ int m2ap_MCE_generate_m2_setup_failure(instance_t instance,
|
||||
return -1;
|
||||
}
|
||||
|
||||
//MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE,
|
||||
// MSC_M2AP_TARGET_MCE, NULL, 0,
|
||||
// "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u",
|
||||
// assoc_id, cause_type, cause_value);
|
||||
|
||||
m2ap_MCE_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
@@ -557,8 +547,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p,
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id);
|
||||
//
|
||||
// m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1);
|
||||
//
|
||||
// return ret;
|
||||
@@ -650,8 +638,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p,
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_MCE_data_p->assoc_id);
|
||||
//
|
||||
// m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1);
|
||||
//
|
||||
// return ret;
|
||||
@@ -712,8 +698,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p,
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id);
|
||||
//
|
||||
// m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1);
|
||||
//
|
||||
// return ret;
|
||||
@@ -796,8 +780,6 @@ int m2ap_MCE_set_cause (M2AP_Cause_t * cause_p,
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_MCE, MSC_M2AP_TARGET_MCE, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_MCE_data_p->assoc_id);
|
||||
//
|
||||
// m2ap_MCE_itti_send_sctp_data_req(instance_p->instance, m2ap_MCE_data_p->assoc_id, buffer, len, 1);
|
||||
//
|
||||
// return ret;
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include "m2ap_MCE_interface_management.h"
|
||||
//#include "m2ap_eNB_interface_management.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
|
||||
|
||||
@@ -210,16 +210,7 @@ int MCE_handle_MBMS_SESSION_START_RESPONSE(instance_t instance,
|
||||
AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n");
|
||||
AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n");
|
||||
//M2AP_SESSION_START_RESP(msg_p).
|
||||
// MSC_LOG_RX_MESSAGE(
|
||||
// MSC_M2AP_MCE,
|
||||
// MSC_M2AP_ENB,
|
||||
//return 0;
|
||||
// 0,
|
||||
// 0,
|
||||
// MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// assoc_id);
|
||||
//
|
||||
|
||||
LOG_D(M2AP, "Sending M2AP_SESSION_START_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
|
||||
itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_g);
|
||||
@@ -348,14 +339,6 @@ int MCE_handle_MBMS_SESSION_STOP_RESPONSE(instance_t instance,
|
||||
AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n");
|
||||
AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n");
|
||||
// M2AP_SESSION_STOP_RESP(msg_p).
|
||||
// MSC_LOG_RX_MESSAGE(
|
||||
// MSC_M2AP_MCE,
|
||||
// MSC_M2AP_ENB,
|
||||
// 0,
|
||||
// 0,
|
||||
// MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_STOP_RESPONSE successfulOutcome assoc_id %d",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// assoc_id);
|
||||
|
||||
// LOG_D(M2AP, "Sending M2AP_SESSION_START_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
// assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
|
||||
@@ -645,14 +628,6 @@ int MCE_handle_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance,
|
||||
// }
|
||||
//
|
||||
// M2AP_SESSION_STOP_RESP(msg_p).
|
||||
// MSC_LOG_RX_MESSAGE(
|
||||
// MSC_M2AP_MCE,
|
||||
// MSC_M2AP_ENB,
|
||||
// 0,
|
||||
// 0,
|
||||
// MSC_AS_TIME_FMT" MCE_handle_M2_SCHEDULING_INFORMATION_RESPONSE successfulOutcome assoc_id %d",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// assoc_id);
|
||||
//
|
||||
// LOG_D(M2AP, "Sending M2AP_SCHEDULING_INFO_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
// assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
|
||||
@@ -836,15 +811,6 @@ int MCE_handle_M2_SETUP_REQUEST(instance_t instance,
|
||||
*m2ap_mce_data_from_enb = M2AP_SETUP_REQ(message_p);
|
||||
//printf("m2ap_mce_data_from_enb->assoc_id %d %d\n",m2ap_mce_data_from_enb->assoc_id,assoc_id);
|
||||
|
||||
// MSC_LOG_TX_MESSAGE(
|
||||
// MSC_M2AP_MCE,
|
||||
// MSC_RRC_ENB,
|
||||
// 0,
|
||||
// 0,
|
||||
// MSC_AS_TIME_FMT" MCE_handle_M2_SETUP_REQUEST",
|
||||
// 0,0//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// );
|
||||
//
|
||||
if (num_mbms_available > 0) {
|
||||
itti_send_msg_to_task(TASK_MCE_APP, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
|
||||
} else {
|
||||
@@ -1217,15 +1183,6 @@ int MCE_handle_MCE_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
|
||||
//for (int i=0;i<num_cells_to_activate;i++)
|
||||
// AssertFatal(M2AP_SETUP_RESP (msg_p).num_SI[i] > 0, "System Information %d is missing",i);
|
||||
|
||||
//MSC_LOG_RX_MESSAGE(
|
||||
// MSC_M2AP_eNB,
|
||||
// MSC_M2AP_CU,
|
||||
// 0,
|
||||
// 0,
|
||||
// MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// assoc_id);
|
||||
|
||||
//LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
// assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id));
|
||||
|
||||
@@ -1430,16 +1387,7 @@ int MCE_handle_MBMS_SERVICE_COUNTING_RESPONSE(instance_t instance,
|
||||
//AssertFatal(MCE_MBMS_M2AP_ID!=-1,"MCE_MBMS_M2AP_ID was not sent\n");
|
||||
//AssertFatal(ENB_MBMS_M2AP_ID!=-1,"ENB_MBMS_M2AP_ID was not sent\n");
|
||||
//M2AP_SESSION_START_RESP(msg_p).
|
||||
// MSC_LOG_RX_MESSAGE(
|
||||
// MSC_M2AP_MCE,
|
||||
// MSC_M2AP_ENB,
|
||||
//return 0;
|
||||
// 0,
|
||||
// 0,
|
||||
// MSC_AS_TIME_FMT" MCE_handle_M2_SESSION_START_RESPONSE successfulOutcome assoc_id %d",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// assoc_id);
|
||||
//
|
||||
|
||||
//LOG_D(M2AP, "Sending ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
//assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
|
||||
#include "m2ap_itti_messaging.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
|
||||
@@ -169,15 +168,6 @@
|
||||
//
|
||||
//
|
||||
// LOG_W(M2AP,"pdu.present %d\n",pdu.present);
|
||||
// // MSC_LOG_TX_MESSAGE(
|
||||
// // MSC_M2AP_eNB,
|
||||
// // MSC_M2AP_MCE,
|
||||
// // (const char *)buffer,
|
||||
// // len,
|
||||
// // MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
|
||||
// // 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// // m2ap_eNB_data_p->ENBname);
|
||||
//
|
||||
// m2ap_eNB_itti_send_sctp_data_req(instance_p, m2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
//
|
||||
// return 0;
|
||||
@@ -315,8 +305,6 @@
|
||||
//
|
||||
// m2ap_eNB_data_p->state = M2AP_ENB_STATE_READY;
|
||||
//
|
||||
// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 M2Setup/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id);
|
||||
//
|
||||
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
//
|
||||
// return ret;
|
||||
@@ -371,11 +359,6 @@
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// //MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB,
|
||||
// // MSC_M2AP_TARGET_ENB, NULL, 0,
|
||||
// // "0 M2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u",
|
||||
// // assoc_id, cause_type, cause_value);
|
||||
//
|
||||
// m2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0);
|
||||
//
|
||||
// return ret;
|
||||
@@ -561,8 +544,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p,
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id);
|
||||
//
|
||||
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
//
|
||||
// return ret;
|
||||
@@ -654,8 +635,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p,
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", m2ap_eNB_data_p->assoc_id);
|
||||
//
|
||||
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
//
|
||||
// return ret;
|
||||
@@ -716,8 +695,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p,
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id);
|
||||
//
|
||||
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
//
|
||||
// return ret;
|
||||
@@ -800,8 +777,6 @@ int m2ap_eNB_set_cause (M2AP_Cause_t * cause_p,
|
||||
// return -1;
|
||||
// }
|
||||
//
|
||||
// MSC_LOG_TX_MESSAGE (MSC_M2AP_SRC_ENB, MSC_M2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", m2ap_eNB_data_p->assoc_id);
|
||||
//
|
||||
// m2ap_eNB_itti_send_sctp_data_req(instance_p->instance, m2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
//
|
||||
// return ret;
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
//#include "m2ap_MCE_interface_management.h"
|
||||
#include "m2ap_eNB_interface_management.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
|
||||
#include "m2ap_itti_messaging.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
|
||||
@@ -255,15 +254,6 @@ int eNB_send_MBMS_SCHEDULING_INFORMATION_RESPONSE(instance_t instance, m2ap_mbms
|
||||
|
||||
|
||||
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
|
||||
// MSC_LOG_TX_MESSAGE(
|
||||
// MSC_M2AP_eNB,
|
||||
// MSC_M2AP_MCE,
|
||||
// (const char *)buffer,
|
||||
// len,
|
||||
// MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// m2ap_eNB_data_p->ENBname);
|
||||
|
||||
m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0);
|
||||
return 0;
|
||||
}
|
||||
@@ -359,14 +349,6 @@ int eNB_send_MBMS_SESSION_START_RESPONSE(instance_t instance, m2ap_session_start
|
||||
|
||||
|
||||
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
|
||||
// MSC_LOG_TX_MESSAGE(
|
||||
// MSC_M2AP_eNB,
|
||||
// MSC_M2AP_MCE,
|
||||
// (const char *)buffer,
|
||||
// len,
|
||||
// MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// m2ap_eNB_data_p->ENBname);
|
||||
|
||||
m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0);
|
||||
return 0;
|
||||
@@ -531,14 +513,6 @@ int eNB_send_MBMS_SESSION_STOP_RESPONSE(instance_t instance, m2ap_session_stop_r
|
||||
|
||||
|
||||
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
|
||||
// MSC_LOG_TX_MESSAGE(
|
||||
// MSC_M2AP_eNB,
|
||||
// MSC_M2AP_MCE,
|
||||
// (const char *)buffer,
|
||||
// len,
|
||||
// MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// m2ap_eNB_data_p->ENBname);
|
||||
|
||||
m2ap_eNB_itti_send_sctp_data_req(instance, m2ap_enb_data_g->assoc_id, buffer, len, 0);
|
||||
return 0;
|
||||
@@ -700,15 +674,6 @@ int eNB_send_M2_SETUP_REQUEST(m2ap_eNB_instance_t *instance_p, m2ap_eNB_data_t*
|
||||
|
||||
|
||||
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
|
||||
// MSC_LOG_TX_MESSAGE(
|
||||
// MSC_M2AP_eNB,
|
||||
// MSC_M2AP_MCE,
|
||||
// (const char *)buffer,
|
||||
// len,
|
||||
// MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// m2ap_eNB_data_p->ENBname);
|
||||
|
||||
|
||||
// buffer = &bytes[0];
|
||||
// len = 40;
|
||||
@@ -826,15 +791,6 @@ int eNB_handle_M2_SETUP_RESPONSE(instance_t instance,
|
||||
//for (int i=0;i<num_cells_to_activate;i++)
|
||||
// AssertFatal(M2AP_SETUP_RESP (msg_p).num_SI[i] > 0, "System Information %d is missing",i);
|
||||
|
||||
//MSC_LOG_RX_MESSAGE(
|
||||
// MSC_M2AP_eNB,
|
||||
// MSC_M2AP_CU,
|
||||
// 0,
|
||||
// 0,
|
||||
// MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// assoc_id);
|
||||
|
||||
//LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
// assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id));
|
||||
//itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p2);
|
||||
@@ -880,15 +836,6 @@ int eNB_handle_M2_SETUP_FAILURE(instance_t instance,
|
||||
//for (int i=0;i<num_cells_to_activate;i++)
|
||||
// AssertFatal(M2AP_SETUP_RESP (msg_p).num_SI[i] > 0, "System Information %d is missing",i);
|
||||
|
||||
//MSC_LOG_RX_MESSAGE(
|
||||
// MSC_M2AP_eNB,
|
||||
// MSC_M2AP_CU,
|
||||
// 0,
|
||||
// 0,
|
||||
// MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// assoc_id);
|
||||
|
||||
//LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
// assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id));
|
||||
|
||||
@@ -1025,15 +972,6 @@ int eNB_send_eNB_CONFIGURATION_UPDATE(instance_t instance, m2ap_enb_configuratio
|
||||
|
||||
|
||||
LOG_D(M2AP,"pdu.present %d\n",pdu.present);
|
||||
// MSC_LOG_TX_MESSAGE(
|
||||
// MSC_M2AP_eNB,
|
||||
// MSC_M2AP_MCE,
|
||||
// (const char *)buffer,
|
||||
// len,
|
||||
// MSC_AS_TIME_FMT" M2_SETUP_REQUEST initiatingMessage MCEname %s",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// m2ap_eNB_data_p->ENBname);
|
||||
|
||||
|
||||
// buffer = &bytes[0];
|
||||
// len = 40;
|
||||
@@ -1086,15 +1024,6 @@ int eNB_handle_eNB_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
|
||||
//for (int i=0;i<num_cells_to_activate;i++)
|
||||
// AssertFatal(M2AP_SETUP_RESP (msg_p).num_SI[i] > 0, "System Information %d is missing",i);
|
||||
|
||||
//MSC_LOG_RX_MESSAGE(
|
||||
// MSC_M2AP_eNB,
|
||||
// MSC_M2AP_CU,
|
||||
// 0,
|
||||
// 0,
|
||||
// MSC_AS_TIME_FMT" eNB_handle_M2_SETUP_RESPONSE successfulOutcome assoc_id %d",
|
||||
// 0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
// assoc_id);
|
||||
|
||||
//LOG_D(M2AP, "Sending M2AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
|
||||
// assoc_id,ENB_MOeNBLE_ID_TO_INSTANCE(assoc_id));
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include "m2ap_MCE_interface_management.h"
|
||||
#include "m2ap_eNB_interface_management.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
|
||||
|
||||
@@ -54,8 +54,6 @@
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "RRC_config_tools.h"
|
||||
#include "enb_paramdef.h"
|
||||
#include "proto_agent.h"
|
||||
|
||||
#include "m3ap_MCE.h"
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "NR_IF_Module.h"
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "pdcp.h"
|
||||
#include "msc.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "pdcp.h"
|
||||
#include "msc.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#include "intertask_interface.h"
|
||||
@@ -62,16 +61,6 @@ rrc_data_req(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE,
|
||||
ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE,
|
||||
buffer_pP,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt_pP->rnti,
|
||||
muiP,
|
||||
sdu_sizeP);
|
||||
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;
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "pdcp.h"
|
||||
#include "msc.h"
|
||||
|
||||
|
||||
#include "intertask_interface.h"
|
||||
@@ -274,16 +273,6 @@ rrc_data_req_ue(
|
||||
)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
ctxt_pP->enb_flag ? MSC_RRC_ENB : MSC_RRC_UE,
|
||||
ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE,
|
||||
buffer_pP,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt_pP->rnti,
|
||||
muiP,
|
||||
sdu_sizeP);
|
||||
{
|
||||
MessageDef *message_p;
|
||||
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
|
||||
#include "pdcp.h"
|
||||
#include "plmn_data.h"
|
||||
#include "msc.h"
|
||||
#include <common/utils/system.h>
|
||||
|
||||
#include "intertask_interface.h"
|
||||
@@ -1390,16 +1389,6 @@ rrc_ue_process_radioResourceConfigDedicated(
|
||||
uint8_t *kUPenc = NULL;
|
||||
derive_key_up_enc(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm,
|
||||
UE_rrc_inst[ctxt_pP->module_id].kenb, &kUPenc);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_UE,
|
||||
MSC_PDCP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security %X)",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt_pP->rnti,
|
||||
UE_rrc_inst[ctxt_pP->module_id].ciphering_algorithm |
|
||||
(UE_rrc_inst[ctxt_pP->module_id].integrity_algorithm << 4));
|
||||
// Refresh DRBs
|
||||
rrc_pdcp_config_asn1_req(ctxt_pP,
|
||||
(LTE_SRB_ToAddModList_t *)NULL,
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
#include "rlc.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "platform_types.h"
|
||||
#include "msc.h"
|
||||
#include "LTE_SL-CommConfig-r12.h"
|
||||
#include "LTE_PeriodicBSR-Timer-r12.h"
|
||||
#include "LTE_RetxBSR-Timer-r12.h"
|
||||
@@ -1247,16 +1246,6 @@ rrc_eNB_generate_SecurityModeCommand(
|
||||
size,
|
||||
rrc_eNB_mui,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" securityModeCommand UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
|
||||
if (!NODE_IS_DU(RC.rrc[ctxt_pP->module_id]->node_type)) {
|
||||
LOG_I(RRC,"calling rrc_data_req :securityModeCommand\n");
|
||||
@@ -1301,16 +1290,6 @@ rrc_eNB_generate_UECapabilityEnquiry(
|
||||
size,
|
||||
rrc_eNB_mui,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" rrcUECapabilityEnquiry UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
@@ -1352,16 +1331,6 @@ rrc_eNB_generate_NR_UECapabilityEnquiry(
|
||||
size,
|
||||
rrc_eNB_mui,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" rrcNRUECapabilityEnquiry UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
@@ -1391,15 +1360,6 @@ rrc_eNB_generate_RRCConnectionReject(
|
||||
(char *)(ue_p->Srb0.Tx_buffer.Payload),
|
||||
ue_p->Srb0.Tx_buffer.payload_size,
|
||||
"[MSG] RRCConnectionReject\n");
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
ue_p->Srb0.Tx_buffer.Header,
|
||||
ue_p->Srb0.Tx_buffer.payload_size,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReject UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti,
|
||||
ue_p->Srb0.Tx_buffer.payload_size);
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReject (bytes %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -1509,14 +1469,6 @@ rrc_eNB_generate_RRCConnectionReestablishment(
|
||||
} // for (int cnt = 0; cnt < (*SRB_configList)->list.count; cnt++)
|
||||
} // if (*SRB_configList != NULL)
|
||||
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
ue_context->Srb0.Tx_buffer.Header,
|
||||
ue_context->Srb0.Tx_buffer.payload_size,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishment UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context->rnti,
|
||||
ue_context->Srb0.Tx_buffer.payload_size);
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishment (bytes %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
ue_context->Srb0.Tx_buffer.payload_size);
|
||||
@@ -2058,16 +2010,6 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete(
|
||||
LOG_D(RRC,
|
||||
"[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
@@ -2154,15 +2096,6 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
|
||||
(char *)(ue_p->Srb0.Tx_buffer.Payload),
|
||||
ue_p->Srb0.Tx_buffer.payload_size,
|
||||
"[MSG] RRCConnectionReestablishmentReject\n");
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
ue_p->Srb0.Tx_buffer.Header,
|
||||
ue_p->Srb0.Tx_buffer.payload_size,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishmentReject UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti,
|
||||
ue_p->Srb0.Tx_buffer.payload_size);
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating LTE_RRCConnectionReestablishmentReject (bytes %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -2230,16 +2163,6 @@ rrc_eNB_generate_RRCConnectionRelease(
|
||||
size,
|
||||
rrc_eNB_mui,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionRelease UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
pthread_mutex_lock(&rrc_release_freelist);
|
||||
|
||||
for (release_num = 0; release_num < NUMBER_OF_UE_MAX; release_num++) {
|
||||
@@ -2525,16 +2448,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *co
|
||||
LOG_D(RRC,
|
||||
"[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" dedicated LTE_RRCConnectionReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
@@ -2773,16 +2686,6 @@ rrc_eNB_modify_dedicatedRRCConnectionReconfiguration(const protocol_ctxt_t *cons
|
||||
LOG_D(RRC,
|
||||
"[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" dedicated LTE_RRCConnectionReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
@@ -2883,16 +2786,6 @@ rrc_eNB_generate_dedicatedRRCConnectionReconfiguration_release( const protocol_
|
||||
LOG_D(RRC,
|
||||
"[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" dedicated LTE_RRCConnectionReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
@@ -3603,15 +3496,6 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
|
||||
rrc_eNB_mui,
|
||||
ctxt_pP->module_id,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(ctxt_pP,
|
||||
DCCH,
|
||||
rrc_eNB_mui++,
|
||||
@@ -4316,15 +4200,6 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
|
||||
rrc_eNB_mui,
|
||||
ctxt_pP->module_id,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(ctxt_pP,
|
||||
DCCH,
|
||||
rrc_eNB_mui++,
|
||||
@@ -4392,16 +4267,6 @@ rrc_eNB_generate_RRCConnectionReconfiguration_SCell(
|
||||
);
|
||||
LOG_I(RRC,"[eNB %d] Frame %d, Logical Channel DL-DCCH, Generate LTE_RRCConnectionReconfiguration (bytes %d, UE id %x)\n",
|
||||
ctxt_pP->module_id,ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
rrc_data_req(
|
||||
ctxt_pP,
|
||||
DCCH,
|
||||
@@ -4996,7 +4861,6 @@ void rrc_eNB_handover_ue_context_release(
|
||||
//msg_release_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE);
|
||||
//itti_send_msg_to_task(TASK_S1AP, ctxt_pP->module_id, msg_release_p);
|
||||
s1ap_ue_context_release(ctxt_pP->instance, ue_context_p->ue_context.eNB_ue_s1ap_id);
|
||||
//MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_GTPU_ENB, NULL,0, "0 GTPV1U_ENB_DELETE_TUNNEL_REQ rnti %x ", eNB_ue_s1ap_id);
|
||||
gtpv1u_enb_delete_tunnel_req_t delete_tunnels={0};
|
||||
delete_tunnels.rnti = ue_context_p->ue_context.rnti;
|
||||
delete_tunnels.from_gnb = 0;
|
||||
@@ -6330,16 +6194,6 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct
|
||||
LOG_D(RRC,
|
||||
"[FRAME %05d][RRC_eNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration handover to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_eNB_mui, ctxt_pP->module_id, DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" rrcConnectionReconfiguration handover UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_eNB_mui,
|
||||
size);
|
||||
/* Refresh SRBs/DRBs */
|
||||
rrc_pdcp_config_asn1_req(ctxt_pP,
|
||||
*SRB_configList2, // NULL,
|
||||
@@ -6535,9 +6389,6 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
ue_context_pP->ue_context.kenb,
|
||||
&kRRCint);
|
||||
/* Refresh SRBs/DRBs */
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_PDCP_ENB, NULL, 0, MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security unchanged)",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti);
|
||||
rrc_pdcp_config_asn1_req(ctxt_pP,
|
||||
SRB_configList, // NULL,
|
||||
DRB_configList,
|
||||
@@ -6906,15 +6757,6 @@ rrc_eNB_generate_RRCConnectionSetup(
|
||||
LOG_W(RRC, "Unknown node type %d\n", RC.rrc[ctxt_pP->module_id]->node_type);
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
ue_p->Srb0.Tx_buffer.Header, // LG WARNING
|
||||
ue_p->Srb0.Tx_buffer.payload_size,
|
||||
MSC_AS_TIME_FMT" RRCConnectionSetup UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
ue_p->Srb0.Tx_buffer.payload_size);
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCConnectionSetup (bytes %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -7326,13 +7168,6 @@ rrc_eNB_decode_ccch(
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
Idx);
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB,
|
||||
MSC_PDCP_ENB,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" CONFIG_REQ UE %x SRB",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti);
|
||||
rrc_pdcp_config_asn1_req(ctxt_pP,
|
||||
ue_context_p->ue_context.SRB_configList,
|
||||
(LTE_DRB_ToAddModList_t *) NULL,
|
||||
@@ -7373,15 +7208,6 @@ rrc_eNB_decode_ccch(
|
||||
if (ue_context_p != NULL) {
|
||||
// erase content
|
||||
rrc_eNB_free_mem_UE_context(ctxt_pP, ue_context_p);
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
dec_rval.consumed,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionRequest UE %x size %u (UE already in context)",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
dec_rval.consumed);
|
||||
} else {
|
||||
rrcConnectionRequest = &ul_ccch_msg->message.choice.c1.choice.rrcConnectionRequest.criticalExtensions.choice.rrcConnectionRequest_r8;
|
||||
{
|
||||
@@ -7467,18 +7293,6 @@ rrc_eNB_decode_ccch(
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
dec_rval.consumed,
|
||||
MSC_AS_TIME_FMT" RRCConnectionRequest UE %x size %u (s-TMSI mmec %u m_TMSI %u random UE id (0x%" PRIx64 ")",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
dec_rval.consumed,
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code,
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
|
||||
ue_context_p->ue_context.random_ue_identity);
|
||||
} else {
|
||||
LOG_E(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionRequest without random UE identity or S-TMSI not supported, let's reject the UE\n",
|
||||
@@ -7567,14 +7381,6 @@ rrc_eNB_decode_ccch(
|
||||
LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
Idx);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_PDCP_ENB,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" CONFIG_REQ UE %x SRB",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti);
|
||||
rrc_pdcp_config_asn1_req(ctxt_pP,
|
||||
ue_context_p->ue_context.SRB_configList,
|
||||
(LTE_DRB_ToAddModList_t *) NULL,
|
||||
@@ -7949,15 +7755,6 @@ rrc_eNB_decode_dcch(
|
||||
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)(Rx_sdu),sdu_sizeP,
|
||||
"[MSG] RRC Connection Reconfiguration Complete\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReconfigurationComplete UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_D(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(RRCConnectionReconfigurationComplete) ---> RRC_eNB]\n",
|
||||
@@ -8169,15 +7966,6 @@ rrc_eNB_decode_dcch(
|
||||
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC Connection Reestablishment Complete\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReestablishmentComplete UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(rrcConnectionReestablishmentComplete) ---> RRC_eNB\n",
|
||||
@@ -8254,15 +8042,6 @@ rrc_eNB_decode_dcch(
|
||||
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC Connection SetupComplete\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionSetupComplete UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_D(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(RRCConnectionSetupComplete) ---> RRC_eNB\n",
|
||||
@@ -8308,15 +8087,6 @@ rrc_eNB_decode_dcch(
|
||||
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC Security Mode Complete\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" securityModeComplete UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" received securityModeComplete on UL-DCCH %d from UE\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -8345,15 +8115,6 @@ rrc_eNB_decode_dcch(
|
||||
T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC Security Mode Failure\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" securityModeFailure UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_W(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(securityModeFailure) ---> RRC_eNB\n",
|
||||
@@ -8383,15 +8144,6 @@ rrc_eNB_decode_dcch(
|
||||
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC UECapablility Information\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" ueCapabilityInformation UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" received ueCapabilityInformation on UL-DCCH %d from UE\n",
|
||||
PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -8569,15 +8321,6 @@ rrc_eNB_decode_dcch(
|
||||
LOG_D(RRC,"[MSG] RRC UL Information Transfer \n");
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC UL Information Transfer \n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" ulInformationTransfer UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
|
||||
if (EPC_MODE_ENABLED == 1) {
|
||||
rrc_eNB_send_S1AP_UPLINK_NAS(ctxt_pP,
|
||||
@@ -8668,15 +8411,6 @@ rrc_eNB_decode_dcch(
|
||||
LOG_I(RRC,"THINH [LTE_UL_DCCH_MessageType__messageClassExtension_PR_c2]\n");
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC SidelinkUEInformation \n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" SidelinkUEInformation UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_I(RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(SidelinkUEInformation) ---> RRC_eNB\n",
|
||||
@@ -9572,20 +9306,6 @@ void *rrc_enb_process_itti_msg(void *notUsed) {
|
||||
rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
case GTPV1U_ENB_DELETE_TUNNEL_RESP: {
|
||||
rrc_eNB_ue_context_t *ue = rrc_eNB_get_ue_context(RC.rrc[instance], GTPV1U_ENB_DELETE_TUNNEL_RESP(msg_p).rnti);
|
||||
|
||||
if (ue != NULL
|
||||
&& ue->ue_context.ue_release_timer_rrc > 0
|
||||
&& (ue->ue_context.handover_info == NULL ||
|
||||
(ue->ue_context.handover_info->state != HO_RELEASE &&
|
||||
ue->ue_context.handover_info->state != HO_CANCEL))) {
|
||||
ue->ue_context.ue_release_timer_rrc = ue->ue_context.ue_release_timer_thres_rrc;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case S1AP_PATH_SWITCH_REQ_ACK:
|
||||
LOG_I(RRC, "[eNB %ld] received path switch ack %s\n", instance, msg_name_p);
|
||||
rrc_eNB_process_S1AP_PATH_SWITCH_REQ_ACK(msg_p, msg_name_p, instance);
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
# include "RRC/LTE/MESSAGES/asn1_msg.h"
|
||||
# include "rrc_eNB_GTPV1U.h"
|
||||
# include "rrc_eNB_UE_context.h"
|
||||
# include "msc.h"
|
||||
|
||||
|
||||
#include "asn1_conversions.h"
|
||||
@@ -77,15 +76,6 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
create_tunnel_resp_pP->enb_addr.length);
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u ebid %u enb-s1u teid %u",
|
||||
0,0,rnti,
|
||||
create_tunnel_resp_pP->num_tunnels,
|
||||
ue_context_p->ue_context.enb_gtp_ebi[0],
|
||||
ue_context_p->ue_context.enb_gtp_teid[0]);
|
||||
(void)rnti; /* avoid gcc warning "set but not used" */
|
||||
return 0;
|
||||
} else {
|
||||
@@ -210,7 +200,7 @@ boolean_t gtpv_data_req_new (
|
||||
GTPV1U_ENB_END_MARKER_REQ(msg).offset = GTPU_HEADER_OVERHEAD_MAX;
|
||||
LOG_I(GTPU, "Send End Marker to GTPV1-U at frame %d and subframe %d \n", ctxt->frame,ctxt->subframe);
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, ENB_MODULE_ID_TO_INSTANCE(ctxt->module_id), msg);
|
||||
return NW_GTPV1U_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* target enb */
|
||||
@@ -225,7 +215,7 @@ boolean_t gtpv_data_req_new (
|
||||
gtpv1u_enb_delete_tunnel_req_t delete_tunnel_req;
|
||||
memset(&delete_tunnel_req, 0, sizeof(delete_tunnel_req));
|
||||
delete_tunnel_req.rnti = ctxt->rnti;
|
||||
gtpv1u_delete_x2u_tunnel(ctxt->module_id, &delete_tunnel_req, GTPV1U_TARGET_ENB);
|
||||
gtpv1u_delete_x2u_tunnel(ctxt->module_id, &delete_tunnel_req);
|
||||
return true;
|
||||
} else {
|
||||
/* data packet */
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
# include "RRC/LTE/MESSAGES/asn1_msg.h"
|
||||
# include "rrc_eNB_M2AP.h"
|
||||
//# include "rrc_eNB_UE_context.h"
|
||||
# include "msc.h"
|
||||
# include "asn1_conversions.h"
|
||||
# include "intertask_interface.h"
|
||||
# include "common/ran_context.h"
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "rrc_eNB_S1AP.h"
|
||||
#include "enb_config.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "gtpv1u.h"
|
||||
|
||||
#include "s1ap_eNB.h"
|
||||
#include "s1ap_eNB_defs.h"
|
||||
@@ -48,7 +47,6 @@
|
||||
#include "pdcp_primitives.h"
|
||||
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
#include <common/utils/msc/msc.h>
|
||||
|
||||
#include "LTE_UERadioAccessCapabilityInformation.h"
|
||||
|
||||
@@ -586,17 +584,6 @@ rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(
|
||||
// TODO add cause when it will be integrated
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p),
|
||||
sizeof(s1ap_initial_context_setup_resp_t),
|
||||
MSC_AS_TIME_FMT" INITIAL_CONTEXT_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_INITIAL_CONTEXT_SETUP_RESP (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done, e_rabs_failed);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -804,14 +791,6 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
|
||||
ue_context_pP->ue_context.ue_gummei.mnc_len = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len;
|
||||
ue_context_pP->ue_context.ue_gummei.mme_code = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code;
|
||||
ue_context_pP->ue_context.ue_gummei.mme_group_id = S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_group_id;
|
||||
MSC_LOG_TX_MESSAGE(MSC_S1AP_ENB,
|
||||
MSC_S1AP_MME,
|
||||
(const char *)&message_p->ittiMsg.s1ap_nas_first_req,
|
||||
sizeof(s1ap_nas_first_req_t),
|
||||
MSC_AS_TIME_FMT" S1AP_NAS_FIRST_REQ eNB %u UE %x",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->rnti);
|
||||
LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ adding in s_TMSI: GUMMEI mme_code %u mme_group_id %u ue %x\n",
|
||||
ctxt_pP->module_id,
|
||||
S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code,
|
||||
@@ -852,15 +831,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
|
||||
eNB_ue_s1ap_id);
|
||||
|
||||
if (ue_context_p == NULL) {
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u eNB_ue_s1ap_id %u",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_initial_id,
|
||||
eNB_ue_s1ap_id);
|
||||
/* Can not associate this message to an UE index, send a failure to S1AP and discard it! */
|
||||
MessageDef *msg_fail_p;
|
||||
LOG_W(RRC, "[eNB %ld] In S1AP_DOWNLINK_NAS: unknown UE from S1AP ids (%d, %d)\n", instance, ue_initial_id, eNB_ue_s1ap_id);
|
||||
@@ -869,15 +839,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
|
||||
S1AP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.length = S1AP_DOWNLINK_NAS (msg_p).nas_pdu.length;
|
||||
S1AP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.buffer = S1AP_DOWNLINK_NAS (msg_p).nas_pdu.buffer;
|
||||
// TODO add failure cause when defined!
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" S1AP_NAS_NON_DELIVERY_IND UE initial id %u eNB_ue_s1ap_id %u (ue ctxt !found)",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_initial_id,
|
||||
eNB_ue_s1ap_id);
|
||||
itti_send_msg_to_task (TASK_S1AP, instance, msg_fail_p);
|
||||
return (-1);
|
||||
} else {
|
||||
@@ -889,15 +850,6 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
|
||||
ue_context_p->ue_context.eNB_ue_s1ap_id = S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id;
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u eNB_ue_s1ap_id %u",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_initial_id,
|
||||
S1AP_DOWNLINK_NAS (msg_p).eNB_ue_s1ap_id);
|
||||
/* Create message for PDCP (DLInformationTransfer_t) */
|
||||
length = do_DLInformationTransfer (
|
||||
instance,
|
||||
@@ -1195,12 +1147,6 @@ rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(
|
||||
if (ue_context_pP == NULL) {
|
||||
LOG_E(RRC, "[eNB] In S1AP_UE_CONTEXT_RELEASE_REQ: invalid UE\n");
|
||||
} else {
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
NULL,
|
||||
0,
|
||||
"0 S1AP_UE_CONTEXT_RELEASE_REQ eNB_ue_s1ap_id 0x%06"PRIX32" ",
|
||||
ue_context_pP->ue_context.eNB_ue_s1ap_id);
|
||||
MessageDef *msg_context_release_req_p = NULL;
|
||||
msg_context_release_req_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE_REQ);
|
||||
S1AP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
|
||||
@@ -1214,9 +1160,6 @@ void rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT(
|
||||
module_id_t enb_mod_idP,
|
||||
uint32_t eNB_ue_s1ap_id
|
||||
) {
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB, MSC_S1AP_ENB, NULL, 0,
|
||||
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ",
|
||||
eNB_ue_s1ap_id);
|
||||
MessageDef *msg = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE_COMPLETE);
|
||||
S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
itti_send_msg_to_task(TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_mod_idP), msg);
|
||||
@@ -1247,14 +1190,6 @@ rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND(
|
||||
LOG_W(RRC, "[eNB %ld] In S1AP_UE_CONTEXT_RELEASE_COMMAND: unknown UE from eNB_ue_s1ap_id (%d)\n",
|
||||
instance,
|
||||
eNB_ue_s1ap_id);
|
||||
MSC_LOG_EVENT(MSC_RRC_ENB, "0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" context not found",
|
||||
eNB_ue_s1ap_id);
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
NULL,
|
||||
0,
|
||||
"0 S1AP_UE_CONTEXT_RELEASE_COMPLETE eNB_ue_s1ap_id 0x%06"PRIX32" ",
|
||||
eNB_ue_s1ap_id);
|
||||
msg_complete_p = itti_alloc_new_message(TASK_RRC_ENB, 0, S1AP_UE_CONTEXT_RELEASE_COMPLETE);
|
||||
S1AP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).eNB_ue_s1ap_id = eNB_ue_s1ap_id;
|
||||
itti_send_msg_to_task(TASK_S1AP, instance, msg_complete_p);
|
||||
@@ -1432,16 +1367,6 @@ int rrc_eNB_send_S1AP_E_RAB_SETUP_RESP(const protocol_ctxt_t *const ctxt_pP,
|
||||
if ((e_rabs_done > 0) ) {
|
||||
LOG_I(RRC,"S1AP_E_RAB_SETUP_RESP: sending the message: nb_of_erabs %d, total e_rabs %d, index %d\n",
|
||||
ue_context_pP->ue_context.nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&S1AP_E_RAB_SETUP_RESP (msg_p),
|
||||
sizeof(s1ap_e_rab_setup_resp_t),
|
||||
MSC_AS_TIME_FMT" E_RAB_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_E_RAB_SETUP_RESP (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done, e_rabs_failed);
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
|
||||
@@ -1667,16 +1592,6 @@ int rrc_eNB_send_S1AP_E_RAB_MODIFY_RESP(const protocol_ctxt_t *const ctxt_pP,
|
||||
if (e_rabs_done > 0 || e_rabs_failed > 0) {
|
||||
LOG_D(RRC,"S1AP_E_RAB_MODIFY_RESP: sending the message: nb_of_modify_e_rabs %d, total e_rabs %d, index %d\n",
|
||||
ue_context_pP->ue_context.nb_of_modify_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&S1AP_E_RAB_SETUP_RESP (msg_p),
|
||||
sizeof(s1ap_e_rab_setup_resp_t),
|
||||
MSC_AS_TIME_FMT" E_RAB_MODIFY_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_E_RAB_MODIFY_RESP (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done, e_rabs_failed);
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
} else {
|
||||
itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
@@ -2067,16 +1982,6 @@ int rrc_eNB_send_PATH_SWITCH_REQ(const protocol_ctxt_t *const ctxt_pP,
|
||||
if (e_rabs_done > 0) {
|
||||
LOG_I(RRC,"S1AP_PATH_SWITCH_REQ: sending the message: nb_of_erabstobeswitched %d, total e_rabs %d, index %d\n",
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).nb_of_e_rabs, ue_context_pP->ue_context.setup_e_rabs, e_rab);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&S1AP_PATH_SWITCH_REQ (msg_p),
|
||||
sizeof(s1ap_path_switch_req_t),
|
||||
MSC_AS_TIME_FMT" PATH_SWITCH_REQ UE %X eNB_ue_s1ap_id %u e_rabs:%u succ",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_PATH_SWITCH_REQ (msg_p).eNB_ue_s1ap_id,
|
||||
e_rabs_done);
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
} else {
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
@@ -2355,16 +2260,6 @@ int rrc_eNB_send_E_RAB_Modification_Indication(const protocol_ctxt_t *const ctxt
|
||||
if (e_rab_modify_index > 0) {
|
||||
LOG_I(RRC,"S1AP_E_RAB_MODIFICATION_IND: sending the message: nb_of_erabstobemodified %d, total e_rabs %d, index %d\n",
|
||||
S1AP_E_RAB_MODIFICATION_IND (msg_p).nb_of_e_rabs_tobemodified, ue_context_pP->ue_context.setup_e_rabs, e_rab);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&S1AP_E_RAB_MODIFICATION_IND (msg_p),
|
||||
sizeof(s1ap_e_rab_modification_ind_t),
|
||||
MSC_AS_TIME_FMT" E RAB MODIFICATION IND UE %X eNB_ue_s1ap_id %u e_rabs:%u succ",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
S1AP_E_RAB_MODIFICATION_IND (msg_p).eNB_ue_s1ap_id,
|
||||
e_rab_modify_index);
|
||||
itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
|
||||
} else {
|
||||
itti_free(ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "msc.h"
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -210,10 +209,6 @@ void rrc_eNB_remove_ue_context(
|
||||
}
|
||||
|
||||
RB_REMOVE(rrc_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP);
|
||||
MSC_LOG_EVENT(
|
||||
MSC_RRC_ENB,
|
||||
"0 Removed UE %"PRIx16" ",
|
||||
ue_context_pP->ue_context.rnti);
|
||||
rrc_eNB_free_mem_UE_context(ctxt_pP, ue_context_pP);
|
||||
uid_linear_allocator_free(rrc_instance_pP, ue_context_pP->local_uid);
|
||||
free(ue_context_pP);
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "nr_rrc_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "pdcp.h"
|
||||
#include "msc.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
@@ -172,16 +171,6 @@ nr_rrc_data_req(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
ctxt_pP->enb_flag ? MSC_RRC_GNB : MSC_RRC_UE,
|
||||
ctxt_pP->enb_flag ? MSC_PDCP_ENB : MSC_PDCP_UE,
|
||||
buffer_pP,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT"RRC_DCCH_DATA_REQ UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt_pP->rnti,
|
||||
muiP,
|
||||
sdu_sizeP);
|
||||
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;
|
||||
@@ -372,10 +361,10 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
|
||||
}
|
||||
|
||||
void nr_mac_gNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP) {
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP) {
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
|
||||
ue_context_p = rrc_gNB_get_ue_context(
|
||||
RC.nrrrc[Mod_instP],
|
||||
|
||||
@@ -458,7 +458,6 @@ typedef struct {
|
||||
NR_CellGroupConfig_t *secondaryCellGroup[MAX_NR_RRC_UE_CONTEXTS];
|
||||
NR_SRB_INFO SI;
|
||||
NR_SRB_INFO Srb0;
|
||||
int initial_csi_index[MAX_NR_RRC_UE_CONTEXTS];
|
||||
int p_gNB;
|
||||
|
||||
} rrc_gNB_carrier_data_t;
|
||||
|
||||
@@ -82,10 +82,13 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
int minRXTXTIMEpdsch,
|
||||
int do_csirs,
|
||||
int do_srs,
|
||||
int initial_csi_index,
|
||||
int uid);
|
||||
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs);
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
int dl_antenna_ports,
|
||||
int curr_bwp,
|
||||
int do_csirs);
|
||||
|
||||
void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_ServingCellConfig_t *servingcellconfigdedicated,
|
||||
@@ -95,7 +98,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
|
||||
int minRXTXTIMEpdsch,
|
||||
int do_csirs,
|
||||
int do_srs,
|
||||
int initial_csi_index,
|
||||
int uid);
|
||||
|
||||
void fill_default_rbconfig(NR_RadioBearerConfig_t *rbconfig,
|
||||
@@ -112,9 +114,6 @@ void apply_macrlc_config(gNB_RRC_INST *rrc,
|
||||
rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP );
|
||||
|
||||
void apply_pdcp_config(rrc_gNB_ue_context_t *const ue_context_pP,
|
||||
const protocol_ctxt_t *const ctxt_pP );
|
||||
|
||||
void
|
||||
rrc_gNB_generate_RRCSetup(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
|
||||
+17
-223
@@ -30,6 +30,10 @@
|
||||
#define RRC_GNB_C
|
||||
#define RRC_GNB_C
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include "nr_rrc_config.h"
|
||||
#include "nr_rrc_defs.h"
|
||||
#include "nr_rrc_extern.h"
|
||||
@@ -66,7 +70,6 @@
|
||||
#include "rlc.h"
|
||||
#include "rrc_eNB_UE_context.h"
|
||||
#include "platform_types.h"
|
||||
#include "msc.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "T.h"
|
||||
@@ -103,27 +106,6 @@
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
extern boolean_t nr_rrc_pdcp_config_asn1_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
NR_SRB_ToAddModList_t *const srb2add_list,
|
||||
NR_DRB_ToAddModList_t *const drb2add_list,
|
||||
NR_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc,
|
||||
uint8_t *const kUPint
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
,rb_id_t *const defaultDRB,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
static inline uint64_t bitStr_to_uint64(BIT_STRING_t *asn);
|
||||
|
||||
mui_t rrc_gNB_mui = 0;
|
||||
@@ -424,15 +406,6 @@ rrc_gNB_generate_RRCSetup(
|
||||
LOG_D(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_UE_FMT" RRC_gNB --- MAC_CONFIG_REQ (SRB1) ---> MAC_gNB\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP));
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
ue_p->Srb0.Tx_buffer.Header, // LG WARNING
|
||||
ue_p->Srb0.Tx_buffer.payload_size,
|
||||
MSC_AS_TIME_FMT" RRCSetup UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
ue_p->Srb0.Tx_buffer.payload_size);
|
||||
LOG_I(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -503,15 +476,6 @@ rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(
|
||||
(NR_CellGroupConfig_t *)NULL
|
||||
);
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
ue_p->Srb0.Tx_buffer.Header, // LG WARNING
|
||||
ue_p->Srb0.Tx_buffer.payload_size,
|
||||
MSC_AS_TIME_FMT" RRCSetup UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
ue_p->Srb0.Tx_buffer.payload_size);
|
||||
LOG_I(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCSetup (bytes %d)\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -553,14 +517,6 @@ rrc_gNB_generate_RRCReject(
|
||||
(char *)(ue_p->Srb0.Tx_buffer.Payload),
|
||||
ue_p->Srb0.Tx_buffer.payload_size,
|
||||
"[MSG] RRCReject \n");
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
ue_p->Srb0.Tx_buffer.Header,
|
||||
ue_p->Srb0.Tx_buffer.payload_size,
|
||||
MSC_AS_TIME_FMT" NR_RRCReject UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti,
|
||||
ue_p->Srb0.Tx_buffer.payload_size);
|
||||
LOG_I(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating NR_RRCReject (bytes %d)\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -821,15 +777,6 @@ rrc_gNB_generate_defaultRRCReconfiguration(
|
||||
rrc_gNB_mui,
|
||||
ctxt_pP->module_id,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" NR_RRCReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_gNB_mui,
|
||||
size);
|
||||
nr_rrc_data_req(ctxt_pP,
|
||||
DCCH,
|
||||
rrc_gNB_mui++,
|
||||
@@ -1051,16 +998,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
LOG_D(NR_RRC,
|
||||
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" dedicated RRCReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_gNB_mui,
|
||||
size);
|
||||
|
||||
#ifdef ITTI_SIM
|
||||
MessageDef *message_p;
|
||||
@@ -1159,16 +1096,6 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
|
||||
LOG_D(NR_RRC,
|
||||
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" dedicated NR_RRCReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_gNB_mui,
|
||||
size);
|
||||
#ifdef ITTI_SIM
|
||||
MessageDef *message_p;
|
||||
uint8_t *message_buffer;
|
||||
@@ -1233,9 +1160,6 @@ rrc_gNB_process_RRCReconfigurationComplete(
|
||||
ue_context_pP->ue_context.kgnb,
|
||||
&kRRCint);
|
||||
/* Refresh SRBs/DRBs */
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, MSC_PDCP_ENB, NULL, 0, MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security unchanged)",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti);
|
||||
|
||||
#ifndef ITTI_SIM
|
||||
LOG_D(NR_RRC,"Configuring PDCP DRBs/SRBs for UE %x\n",ue_context_pP->ue_context.rnti);
|
||||
@@ -1464,14 +1388,6 @@ rrc_gNB_generate_RRCReestablishment(
|
||||
}
|
||||
} // if (*SRB_configList != NULL)
|
||||
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
ue_context->Srb0.Tx_buffer.Header,
|
||||
ue_context->Srb0.Tx_buffer.payload_size,
|
||||
MSC_AS_TIME_FMT" NR_RRCReestablishment UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context->rnti,
|
||||
ue_context->Srb0.Tx_buffer.payload_size);
|
||||
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-DCCH, Generating NR_RRCReestablishment (bytes %d)\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
ue_context->Srb0.Tx_buffer.payload_size);
|
||||
@@ -1734,16 +1650,6 @@ rrc_gNB_process_RRCConnectionReestablishmentComplete(
|
||||
LOG_D(NR_RRC,
|
||||
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcConnectionReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]\n",
|
||||
ctxt_pP->frame, ctxt_pP->module_id, size, ue_context_pP->ue_context.rnti, rrc_gNB_mui, ctxt_pP->module_id, DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" LTE_RRCConnectionReconfiguration UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_gNB_mui,
|
||||
size);
|
||||
#ifdef ITTI_SIM
|
||||
MessageDef *message_p;
|
||||
uint8_t *message_buffer;
|
||||
@@ -1814,15 +1720,6 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
|
||||
ue_context_p = rrc_gNB_get_ue_context(gnb_rrc_inst, ctxt_pP->rnti);
|
||||
if (ue_context_p != NULL) {
|
||||
rrc_gNB_free_mem_UE_context(ctxt_pP, ue_context_p);
|
||||
MSC_LOG_RX_DISCARDED_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
dec_rval.consumed,
|
||||
MSC_AS_TIME_FMT" NR_RRCSetupRequest UE %x size %u (UE already in context)",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
dec_rval.consumed);
|
||||
} else {
|
||||
rrcSetupRequest = &ul_ccch_msg->message.choice.c1->choice.rrcSetupRequest->rrcSetupRequest;
|
||||
if (NR_InitialUE_Identity_PR_randomValue == rrcSetupRequest->ue_Identity.present) {
|
||||
@@ -2114,13 +2011,6 @@ int nr_rrc_gNB_decode_ccch(protocol_ctxt_t *const ctxt_pP,
|
||||
LOG_I(NR_RRC, PROTOCOL_NR_RRC_CTXT_UE_FMT"CALLING RLC CONFIG SRB1 (rbid %d)\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
Idx);
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_GNB,
|
||||
MSC_PDCP_GNB,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" CONFIG_REQ UE %x SRB",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti);
|
||||
// nr_rrc_pdcp_config_asn1_req(ctxt_pP,
|
||||
// ue_context_p->ue_context.SRB_configList,
|
||||
// NULL,
|
||||
@@ -2195,7 +2085,6 @@ rrc_gNB_decode_dcch(
|
||||
asn_dec_rval_t dec_rval;
|
||||
NR_UL_DCCH_Message_t *ul_dcch_msg = NULL;
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
|
||||
MessageDef *msg_delete_tunnels_p = NULL;
|
||||
uint8_t xid;
|
||||
|
||||
int i;
|
||||
@@ -2264,15 +2153,6 @@ rrc_gNB_decode_dcch(
|
||||
|
||||
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)(Rx_sdu), sdu_sizeP,
|
||||
"[MSG] RRC Connection Reconfiguration Complete\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" NR_RRCReconfigurationComplete UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_D(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(RRCReconfigurationComplete) ---> RRC_gNB]\n",
|
||||
@@ -2294,21 +2174,17 @@ rrc_gNB_decode_dcch(
|
||||
xid = ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier;
|
||||
ue_context_p->ue_context.pdu_session_release_command_flag = 0;
|
||||
//gtp tunnel delete
|
||||
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_GNB, 0, GTPV1U_GNB_DELETE_TUNNEL_REQ);
|
||||
memset(>PV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
|
||||
GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
|
||||
|
||||
gtpv1u_gnb_delete_tunnel_req_t req={0};
|
||||
for(i = 0; i < NB_RB_MAX; i++) {
|
||||
if(xid == ue_context_p->ue_context.pduSession[i].xid) {
|
||||
GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).pdusession_id[GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_pdusession++] =
|
||||
req.pdusession_id[req.num_pdusession++] =
|
||||
ue_context_p->ue_context.gnb_gtp_psi[i];
|
||||
ue_context_p->ue_context.gnb_gtp_teid[i] = 0;
|
||||
memset(&ue_context_p->ue_context.gnb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.gnb_gtp_addrs[i]));
|
||||
ue_context_p->ue_context.gnb_gtp_psi[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, ctxt_pP->instance, msg_delete_tunnels_p);
|
||||
gtpv1u_delete_ngu_tunnel(ctxt_pP->instance, &req);
|
||||
//NGAP_PDUSESSION_RELEASE_RESPONSE
|
||||
rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(ctxt_pP, ue_context_p, xid);
|
||||
} else if (ue_context_p->ue_context.established_pdu_sessions_flag != 1) {
|
||||
@@ -2334,15 +2210,6 @@ rrc_gNB_decode_dcch(
|
||||
|
||||
LOG_DUMPMSG(NR_RRC, DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC SetupComplete\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" NR_RRCSetupComplete UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_D(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(RRCSetupComplete) ---> RRC_gNB\n",
|
||||
@@ -2421,15 +2288,6 @@ rrc_gNB_decode_dcch(
|
||||
LOG_D(NR_RRC,"[MSG] RRC UL Information Transfer \n");
|
||||
LOG_DUMPMSG(RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] RRC UL Information Transfer \n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" ulInformationTransfer UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
|
||||
if (AMF_MODE_ENABLED == 1) {
|
||||
rrc_gNB_send_NGAP_UPLINK_NAS(ctxt_pP,
|
||||
@@ -2469,15 +2327,6 @@ rrc_gNB_decode_dcch(
|
||||
case NR_UL_DCCH_MessageType__c1_PR_securityModeFailure:
|
||||
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] NR RRC Security Mode Failure\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" securityModeFailure UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_W(NR_RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(securityModeFailure) ---> RRC_gNB\n",
|
||||
@@ -2500,15 +2349,6 @@ rrc_gNB_decode_dcch(
|
||||
|
||||
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] NR_RRC UECapablility Information\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" ueCapabilityInformation UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_I(NR_RRC,
|
||||
PROTOCOL_NR_RRC_CTXT_UE_FMT" received ueCapabilityInformation on UL-DCCH %d from UE\n",
|
||||
PROTOCOL_NR_RRC_CTXT_UE_ARGS(ctxt_pP),
|
||||
@@ -2614,15 +2454,6 @@ rrc_gNB_decode_dcch(
|
||||
case NR_UL_DCCH_MessageType__c1_PR_rrcReestablishmentComplete:
|
||||
LOG_DUMPMSG(NR_RRC,DEBUG_RRC,(char *)Rx_sdu,sdu_sizeP,
|
||||
"[MSG] NR_RRC Connection Reestablishment Complete\n");
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
Rx_sdu,
|
||||
sdu_sizeP,
|
||||
MSC_AS_TIME_FMT" NR_RRCConnectionReestablishmentComplete UE %x size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_p->ue_context.rnti,
|
||||
sdu_sizeP);
|
||||
LOG_I(NR_RRC,
|
||||
PROTOCOL_RRC_CTXT_UE_FMT" RLC RB %02d --- RLC_DATA_IND %d bytes "
|
||||
"(rrcConnectionReestablishmentComplete) ---> RRC_gNB\n",
|
||||
@@ -3426,20 +3257,20 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
RB_FOREACH(ue_context_p, rrc_nr_ue_tree_s, &(RC.nrrrc[ctxt_pP->module_id]->rrc_ue_head)) {
|
||||
ctxt_pP->rnti = ue_context_p->ue_id_rnti;
|
||||
|
||||
if (fd) {
|
||||
if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) {
|
||||
fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n",
|
||||
if (fd) {
|
||||
if (ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.presence == TRUE) {
|
||||
fprintf(fd,"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8\n",
|
||||
ue_context_p->ue_id_rnti,
|
||||
ue_context_p->ue_context.Initialue_identity_5g_s_TMSI.fiveg_tmsi,
|
||||
ue_context_p->ue_context.ul_failure_timer);
|
||||
} else {
|
||||
fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n",
|
||||
} else {
|
||||
fprintf(fd,"NR RRC UE rnti %x failure timer %d/8\n",
|
||||
ue_context_p->ue_id_rnti,
|
||||
ue_context_p->ue_context.ul_failure_timer);
|
||||
}
|
||||
}
|
||||
|
||||
if (ue_context_p->ue_context.UE_Capability_nr) {
|
||||
fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n",
|
||||
if (ue_context_p->ue_context.UE_Capability_nr) {
|
||||
fprintf(fd,"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d\n",
|
||||
get_dl_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
|
||||
get_ul_bw_mask(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
|
||||
is_dl_256QAM_supported(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr) == 1 ? "yes" : "no",
|
||||
@@ -3447,7 +3278,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
get_dl_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
|
||||
get_ul_mimo_layersCB(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr),
|
||||
get_ul_mimo_layers(RC.nrrrc[0],ue_context_p->ue_context.UE_Capability_nr));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ue_context_p->ue_context.ul_failure_timer > 0) {
|
||||
ue_context_p->ue_context.ul_failure_timer++;
|
||||
@@ -3508,6 +3339,7 @@ void nr_rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) {
|
||||
|
||||
if (fd) fclose(fd);
|
||||
|
||||
|
||||
/* send a tick to x2ap */
|
||||
if (is_x2ap_enabled()){
|
||||
msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_SUBFRAME_PROCESS);
|
||||
@@ -3641,9 +3473,6 @@ void *rrc_gnb_task(void *args_p) {
|
||||
rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
|
||||
case GTPV1U_GNB_DELETE_TUNNEL_RESP:
|
||||
break;
|
||||
|
||||
/* Messages from gNB app */
|
||||
case NRRRC_CONFIGURATION_REQ:
|
||||
LOG_I(NR_RRC, "[gNB %ld] Received %s : %p\n", instance, msg_name_p,&NRRRC_CONFIGURATION_REQ(msg_p));
|
||||
@@ -3693,11 +3522,6 @@ void *rrc_gnb_task(void *args_p) {
|
||||
rrc_gNB_process_dc_overall_timeout(GNB_INSTANCE_TO_MODULE_ID(instance), &X2AP_ENDC_DC_OVERALL_TIMEOUT(msg_p));
|
||||
break;
|
||||
|
||||
/* Messages from GTP */
|
||||
case GTPV1U_ENB_DELETE_TUNNEL_RESP:
|
||||
/* nothing to do? */
|
||||
break;
|
||||
|
||||
case NGAP_UE_CONTEXT_RELEASE_REQ:
|
||||
rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_REQ(msg_p, msg_name_p, instance);
|
||||
break;
|
||||
@@ -3771,16 +3595,6 @@ rrc_gNB_generate_SecurityModeCommand(
|
||||
size,
|
||||
rrc_gNB_mui,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" securityModeCommand UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_gNB_mui,
|
||||
size);
|
||||
#ifdef ITTI_SIM
|
||||
MessageDef *message_p;
|
||||
uint8_t *message_buffer;
|
||||
@@ -3853,16 +3667,6 @@ rrc_gNB_generate_UECapabilityEnquiry(
|
||||
size,
|
||||
rrc_gNB_mui,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" rrcNRUECapabilityEnquiry UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_gNB_mui,
|
||||
size);
|
||||
#ifdef ITTI_SIM
|
||||
MessageDef *message_p;
|
||||
uint8_t *message_buffer;
|
||||
@@ -3922,16 +3726,6 @@ rrc_gNB_generate_RRCRelease(
|
||||
size,
|
||||
rrc_gNB_mui,
|
||||
DCCH);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_RRC_UE,
|
||||
buffer,
|
||||
size,
|
||||
MSC_AS_TIME_FMT" NR_RRCRelease UE %x MUI %d size %u",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_context.rnti,
|
||||
rrc_gNB_mui,
|
||||
size);
|
||||
|
||||
#ifdef ITTI_SIM
|
||||
MessageDef *message_p;
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
# include "RRC/LTE/MESSAGES/asn1_msg.h"
|
||||
# include "rrc_eNB_GTPV1U.h"
|
||||
# include "rrc_eNB_UE_context.h"
|
||||
# include "msc.h"
|
||||
# include "openair2/RRC/NR/rrc_gNB_UE_context.h"
|
||||
|
||||
//# if defined(ENABLE_ITTI)
|
||||
@@ -77,15 +76,6 @@ rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
create_tunnel_resp_pP->enb_addr.length);
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_GTPU_ENB,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u ebid %u enb-s1u teid %u",
|
||||
0,0,rnti,
|
||||
create_tunnel_resp_pP->num_tunnels,
|
||||
ue_context_p->ue_context.gnb_gtp_ebi[0],
|
||||
ue_context_p->ue_context.gnb_gtp_teid[0]);
|
||||
(void)rnti; /* avoid gcc warning "set but not used" */
|
||||
return 0;
|
||||
} else {
|
||||
@@ -126,15 +116,6 @@ nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
create_tunnel_resp_pP->gnb_addr.length);
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_GTPU_GNB,
|
||||
NULL,0,
|
||||
MSC_AS_TIME_FMT" CREATE_TUNNEL_RESP RNTI %"PRIx16" ntuns %u psid %u enb-s1u teid %u",
|
||||
0,0,rnti,
|
||||
create_tunnel_resp_pP->num_tunnels,
|
||||
ue_context_p->ue_context.gnb_gtp_psi[0],
|
||||
ue_context_p->ue_context.gnb_gtp_teid[0]);
|
||||
(void)rnti; /* avoid gcc warning "set but not used" */
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
@@ -33,17 +33,15 @@
|
||||
#include "rrc_eNB_S1AP.h"
|
||||
#include "gnb_config.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "gtpv1u.h"
|
||||
|
||||
#include "asn1_conversions.h"
|
||||
#include "intertask_interface.h"
|
||||
#include "pdcp.h"
|
||||
#include "pdcp_primitives.h"
|
||||
|
||||
#include "msc.h"
|
||||
|
||||
#include "gtpv1u_eNB_task.h"
|
||||
#include "gtpv1u_gNB_task.h"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "RRC/LTE/rrc_eNB_GTPV1U.h"
|
||||
#include "RRC/NR/rrc_gNB_GTPV1U.h"
|
||||
|
||||
@@ -453,14 +451,6 @@ rrc_gNB_send_NGAP_NAS_FIRST_REQ(
|
||||
ue_context_pP->ue_context.ue_guami.amf_set_id = NGAP_NAS_FIRST_REQ(message_p).ue_identity.guami.amf_set_id;
|
||||
ue_context_pP->ue_context.ue_guami.amf_pointer = NGAP_NAS_FIRST_REQ(message_p).ue_identity.guami.amf_pointer;
|
||||
|
||||
MSC_LOG_TX_MESSAGE(MSC_NGAP_GNB,
|
||||
MSC_NGAP_AMF,
|
||||
(const char *)&message_p->ittiMsg.ngap_nas_first_req,
|
||||
sizeof(ngap_nas_first_req_t),
|
||||
MSC_AS_TIME_FMT" NGAP_NAS_FIRST_REQ gNB %u UE %x",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt_pP->module_id,
|
||||
ctxt_pP->rnti);
|
||||
LOG_I(NGAP, "[gNB %d] Build NGAP_NAS_FIRST_REQ adding in s_TMSI: GUAMI amf_set_id %u amf_region_id %u ue %x\n",
|
||||
ctxt_pP->module_id,
|
||||
NGAP_NAS_FIRST_REQ (message_p).ue_identity.guami.amf_set_id,
|
||||
@@ -636,16 +626,6 @@ rrc_gNB_send_NGAP_INITIAL_CONTEXT_SETUP_RESP(
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_S1AP_ENB,
|
||||
(const char *)&NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p),
|
||||
sizeof(ngap_initial_context_setup_resp_t),
|
||||
MSC_AS_TIME_FMT" INITIAL_CONTEXT_SETUP_RESP UE %X eNB_ue_s1ap_id %u e_rabs:%u succ %u fail",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).gNB_ue_ngap_id,
|
||||
pdu_sessions_done, pdu_sessions_failed);
|
||||
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).nb_of_pdusessions = pdu_sessions_done;
|
||||
NGAP_INITIAL_CONTEXT_SETUP_RESP (msg_p).nb_of_pdusessions_failed = pdu_sessions_failed;
|
||||
itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p);
|
||||
@@ -794,15 +774,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS(
|
||||
gNB_ue_ngap_id);
|
||||
|
||||
if (ue_context_p == NULL) {
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_NGAP_GNB,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u gNB_ue_ngap_id %u",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_initial_id,
|
||||
gNB_ue_ngap_id);
|
||||
/* Can not associate this message to an UE index, send a failure to NGAP and discard it! */
|
||||
MessageDef *msg_fail_p;
|
||||
LOG_W(NR_RRC, "[gNB %ld] In NGAP_DOWNLINK_NAS: unknown UE from NGAP ids (%d, %u)\n", instance, ue_initial_id, gNB_ue_ngap_id);
|
||||
@@ -811,15 +782,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS(
|
||||
NGAP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.length = NGAP_DOWNLINK_NAS (msg_p).nas_pdu.length;
|
||||
NGAP_NAS_NON_DELIVERY_IND (msg_fail_p).nas_pdu.buffer = NGAP_DOWNLINK_NAS (msg_p).nas_pdu.buffer;
|
||||
// TODO add failure cause when defined!
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_ENB,
|
||||
MSC_NGAP_GNB,
|
||||
(const char *)NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" NGAP_NAS_NON_DELIVERY_IND UE initial id %u gNB_ue_ngap_id %u (ue ctxt !found)",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_initial_id,
|
||||
gNB_ue_ngap_id);
|
||||
itti_send_msg_to_task (TASK_NGAP, instance, msg_fail_p);
|
||||
return (-1);
|
||||
} else {
|
||||
@@ -830,15 +792,6 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS(
|
||||
ue_context_p->ue_context.gNB_ue_ngap_id = NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id;
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_NGAP_GNB,
|
||||
(const char *)NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" DOWNLINK-NAS UE initial id %u gNB_ue_ngap_id %u",
|
||||
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_initial_id,
|
||||
NGAP_DOWNLINK_NAS (msg_p).gNB_ue_ngap_id);
|
||||
/* Create message for PDCP (DLInformationTransfer_t) */
|
||||
length = do_NR_DLInformationTransfer (
|
||||
instance,
|
||||
@@ -997,16 +950,6 @@ rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(
|
||||
if ((pdu_sessions_done > 0) ) {
|
||||
LOG_I(NR_RRC,"NGAP_PDUSESSION_SETUP_RESP: sending the message: nb_of_pdusessions %d, total pdu_sessions %d, index %d\n",
|
||||
ue_context_pP->ue_context.nb_of_pdusessions, ue_context_pP->ue_context.setup_pdu_sessions, pdusession);
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_GNB,
|
||||
MSC_NGAP_GNB,
|
||||
(const char *)&NGAP_PDUSESSION_SETUP_RESP (msg_p),
|
||||
sizeof(ngap_pdusession_setup_resp_t),
|
||||
MSC_AS_TIME_FMT" PDUSESSION_SETUP_RESP UE %X gNB_ue_ngap_id %u pdu_sessions:%u succ %u fail",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ue_context_pP->ue_id_rnti,
|
||||
NGAP_PDUSESSION_SETUP_RESP (msg_p).gNB_ue_ngap_id,
|
||||
pdu_sessions_done, pdu_sessions_failed);
|
||||
itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p);
|
||||
}
|
||||
|
||||
@@ -1126,12 +1069,6 @@ rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ(
|
||||
if (ue_context_pP == NULL) {
|
||||
LOG_E(RRC, "[gNB] In NGAP_UE_CONTEXT_RELEASE_REQ: invalid UE\n");
|
||||
} else {
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_GNB,
|
||||
MSC_NGAP_GNB,
|
||||
NULL,
|
||||
0,
|
||||
"0 NGAP_UE_CONTEXT_RELEASE_REQ gNB_ue_ngap_id 0x%06"PRIX32" ",
|
||||
ue_context_pP->ue_context.gNB_ue_ngap_id);
|
||||
MessageDef *msg_context_release_req_p = NULL;
|
||||
msg_context_release_req_p = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_REQ);
|
||||
NGAP_UE_CONTEXT_RELEASE_REQ(msg_context_release_req_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id;
|
||||
@@ -1204,14 +1141,6 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(
|
||||
LOG_W(NR_RRC, "[gNB %ld] In NGAP_UE_CONTEXT_RELEASE_COMMAND: unknown UE from gNB_ue_ngap_id (%u)\n",
|
||||
instance,
|
||||
gNB_ue_ngap_id);
|
||||
MSC_LOG_EVENT(MSC_RRC_GNB, "0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" context not found",
|
||||
gNB_ue_ngap_id);
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_GNB,
|
||||
MSC_NGAP_GNB,
|
||||
NULL,
|
||||
0,
|
||||
"0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" ",
|
||||
gNB_ue_ngap_id);
|
||||
msg_complete_p = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE);
|
||||
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg_complete_p).gNB_ue_ngap_id = gNB_ue_ngap_id;
|
||||
itti_send_msg_to_task(TASK_NGAP, instance, msg_complete_p);
|
||||
@@ -1235,9 +1164,6 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(
|
||||
void rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE(
|
||||
instance_t instance,
|
||||
uint32_t gNB_ue_ngap_id) {
|
||||
MSC_LOG_TX_MESSAGE(MSC_RRC_GNB, MSC_NGAP_GNB, NULL, 0,
|
||||
"0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"PRIX32" ",
|
||||
gNB_ue_ngap_id);
|
||||
MessageDef *msg = itti_alloc_new_message(TASK_RRC_GNB, 0, NGAP_UE_CONTEXT_RELEASE_COMPLETE);
|
||||
NGAP_UE_CONTEXT_RELEASE_COMPLETE(msg).gNB_ue_ngap_id = gNB_ue_ngap_id;
|
||||
itti_send_msg_to_task(TASK_NGAP, instance, msg);
|
||||
@@ -1395,7 +1321,6 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
|
||||
protocol_ctxt_t ctxt;
|
||||
pdusession_release_t pdusession_release_params[NGAP_MAX_PDUSESSION];
|
||||
uint8_t nb_pdusessions_torelease;
|
||||
MessageDef *msg_delete_tunnels_p = NULL;
|
||||
uint8_t xid;
|
||||
int i, pdusession;
|
||||
uint8_t b_existed,is_existed;
|
||||
@@ -1473,20 +1398,18 @@ rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(
|
||||
} else {
|
||||
//gtp tunnel delete
|
||||
LOG_I(NR_RRC, "gtp tunnel delete \n");
|
||||
msg_delete_tunnels_p = itti_alloc_new_message(TASK_RRC_GNB, 0, GTPV1U_GNB_DELETE_TUNNEL_REQ);
|
||||
memset(>PV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p), 0, sizeof(GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p)));
|
||||
GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
|
||||
gtpv1u_gnb_delete_tunnel_req_t req={0};
|
||||
req.rnti = ue_context_p->ue_context.rnti;
|
||||
|
||||
for(i = 0; i < NB_RB_MAX; i++) {
|
||||
if(xid == ue_context_p->ue_context.pduSession[i].xid) {
|
||||
GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).pdusession_id[GTPV1U_GNB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_pdusession++] = ue_context_p->ue_context.gnb_gtp_psi[i];
|
||||
req.pdusession_id[req.num_pdusession++] = ue_context_p->ue_context.gnb_gtp_psi[i];
|
||||
ue_context_p->ue_context.gnb_gtp_teid[i] = 0;
|
||||
memset(&ue_context_p->ue_context.gnb_gtp_addrs[i], 0, sizeof(ue_context_p->ue_context.gnb_gtp_addrs[i]));
|
||||
ue_context_p->ue_context.gnb_gtp_psi[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
itti_send_msg_to_task(TASK_GTPV1_U, instance, msg_delete_tunnels_p);
|
||||
gtpv1u_delete_ngu_tunnel(instance, &req);
|
||||
//NGAP_PDUSESSION_RELEASE_RESPONSE
|
||||
rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(&ctxt, ue_context_p, xid);
|
||||
LOG_I(NR_RRC, "Send PDU Session Release Response \n");
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "rrc_gNB_UE_context.h"
|
||||
#include "msc.h"
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -208,10 +207,6 @@ void rrc_gNB_remove_ue_context(
|
||||
}
|
||||
|
||||
RB_REMOVE(rrc_nr_ue_tree_s, &rrc_instance_pP->rrc_ue_head, ue_context_pP);
|
||||
MSC_LOG_EVENT(
|
||||
MSC_RRC_ENB,
|
||||
"0 Removed UE %"PRIx16" ",
|
||||
ue_context_pP->ue_context.rnti);
|
||||
rrc_gNB_free_mem_UE_context(ctxt_pP, ue_context_pP);
|
||||
nr_uid_linear_allocator_free(rrc_instance_pP, ue_context_pP->local_uid);
|
||||
free(ue_context_pP);
|
||||
|
||||
@@ -177,7 +177,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
||||
ue_context_p->ue_context.reconfig->criticalExtensions.present = NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration;
|
||||
NR_RRCReconfiguration_IEs_t *reconfig_ies=calloc(1,sizeof(NR_RRCReconfiguration_IEs_t));
|
||||
ue_context_p->ue_context.reconfig->criticalExtensions.choice.rrcReconfiguration = reconfig_ies;
|
||||
carrier->initial_csi_index[ue_context_p->local_uid + 1] = 0;
|
||||
ue_context_p->ue_context.rb_config = calloc(1,sizeof(NR_RRCReconfiguration_t));
|
||||
if (get_softmodem_params()->phy_test == 1 || get_softmodem_params()->do_ra == 1 || get_softmodem_params()->sa == 1){
|
||||
fill_default_rbconfig(ue_context_p->ue_context.rb_config,
|
||||
@@ -270,7 +269,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
||||
carrier->minRXTXTIME,
|
||||
carrier->do_CSIRS,
|
||||
carrier->do_SRS,
|
||||
carrier->initial_csi_index[ue_context_p->local_uid + 1],
|
||||
ue_context_p->local_uid);
|
||||
} else {
|
||||
fill_default_reconfig(carrier->servingcellconfigcommon,
|
||||
@@ -281,7 +279,6 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
|
||||
carrier->minRXTXTIME,
|
||||
carrier->do_CSIRS,
|
||||
carrier->do_SRS,
|
||||
carrier->initial_csi_index[ue_context_p->local_uid + 1],
|
||||
ue_context_p->local_uid);
|
||||
}
|
||||
ue_context_p->ue_id_rnti = ue_context_p->ue_context.secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
|
||||
@@ -58,8 +58,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
int minRXTXTIME,
|
||||
int do_csirs,
|
||||
int do_srs,
|
||||
int initial_csi_index,
|
||||
int uid) {
|
||||
|
||||
AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
|
||||
AssertFatal(secondaryCellGroup!=NULL,"secondaryCellGroup is null\n");
|
||||
|
||||
@@ -560,7 +560,9 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
}
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dataScramblingIdentityPDSCH = NULL;
|
||||
|
||||
if (dl_antenna_ports > 1)// for MIMO, we use DMRS Config Type 2
|
||||
if ((get_softmodem_params()->do_ra ||
|
||||
get_softmodem_params()->phy_test) &&
|
||||
dl_antenna_ports > 1) // for MIMO, we use DMRS Config Type 2 but only with OAI UE
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type));
|
||||
else
|
||||
bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL;
|
||||
@@ -1056,7 +1058,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
pdsch_servingcellconfig->pucch_Cell= NULL;
|
||||
pdsch_servingcellconfig->ext1=calloc(1,sizeof(*pdsch_servingcellconfig->ext1));
|
||||
pdsch_servingcellconfig->ext1->maxMIMO_Layers = calloc(1,sizeof(*pdsch_servingcellconfig->ext1->maxMIMO_Layers));
|
||||
*pdsch_servingcellconfig->ext1->maxMIMO_Layers = 2;
|
||||
*pdsch_servingcellconfig->ext1->maxMIMO_Layers = dl_antenna_ports;
|
||||
pdsch_servingcellconfig->ext1->processingType2Enabled = NULL;
|
||||
|
||||
secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig=NULL;
|
||||
@@ -1077,7 +1079,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
imres0->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1 = 6;
|
||||
imres0->freqBand = calloc(1,sizeof(*imres0->freqBand));
|
||||
imres0->freqBand->startingRB = 0;
|
||||
imres0->freqBand->nrofRBs = 108;
|
||||
imres0->freqBand->nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2;
|
||||
imres0->periodicityAndOffset = calloc(1,sizeof(*imres0->periodicityAndOffset));
|
||||
imres0->periodicityAndOffset->present = NR_CSI_ResourcePeriodicityAndOffset_PR_slots320;
|
||||
imres0->periodicityAndOffset->choice.slots320 = 0;
|
||||
@@ -1096,7 +1098,6 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
}
|
||||
|
||||
csi_MeasConfig->csi_IM_ResourceToReleaseList = NULL;
|
||||
csi_MeasConfig->csi_IM_ResourceSetToAddModList = NULL;
|
||||
csi_MeasConfig->csi_IM_ResourceSetToReleaseList = NULL;
|
||||
|
||||
if (do_csirs) {
|
||||
@@ -1116,7 +1117,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceSetToReleaseList = NULL;
|
||||
|
||||
config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,do_csirs);
|
||||
config_csirs(servingcellconfigcommon, csi_MeasConfig,dl_antenna_ports,curr_bwp,do_csirs);
|
||||
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToAddModList = calloc(1,sizeof(*csi_MeasConfig->csi_SSB_ResourceSetToAddModList));
|
||||
csi_MeasConfig->csi_SSB_ResourceSetToReleaseList = NULL;
|
||||
@@ -1171,6 +1172,8 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
NR_CSI_IM_ResourceSetId_t *csiim00 = calloc(1,sizeof(*csiim00));
|
||||
*csiim00 = 0;
|
||||
ASN_SEQUENCE_ADD(&csires2->csi_RS_ResourceSetList.choice.csi_IM_ResourceSetList->list,csiim00);
|
||||
csires2->bwp_Id = 1;
|
||||
csires2->resourceType = NR_CSI_ResourceConfig__resourceType_periodic;
|
||||
ASN_SEQUENCE_ADD(&csi_MeasConfig->csi_ResourceConfigToAddModList->list,csires2);
|
||||
}
|
||||
|
||||
@@ -1315,7 +1318,11 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
|
||||
}
|
||||
|
||||
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_MeasConfig_t *csi_MeasConfig, int dl_antenna_ports, int do_csirs) {
|
||||
void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
|
||||
NR_CSI_MeasConfig_t *csi_MeasConfig,
|
||||
int dl_antenna_ports,
|
||||
int curr_bwp,
|
||||
int do_csirs) {
|
||||
|
||||
if (do_csirs) {
|
||||
csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList = calloc(1,sizeof(*csi_MeasConfig->nzp_CSI_RS_ResourceToAddModList));
|
||||
@@ -1350,7 +1357,7 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CSI_
|
||||
resourceMapping.density.present = NR_CSI_RS_ResourceMapping__density_PR_one;
|
||||
resourceMapping.density.choice.one = (NULL_t)0;
|
||||
resourceMapping.freqBand.startingRB = 0;
|
||||
resourceMapping.freqBand.nrofRBs = 108;
|
||||
resourceMapping.freqBand.nrofRBs = ((curr_bwp>>2)+(curr_bwp%4>0))<<2;
|
||||
nzpcsi0->resourceMapping = resourceMapping;
|
||||
nzpcsi0->powerControlOffset = 0;
|
||||
nzpcsi0->powerControlOffsetSS=calloc(1,sizeof(*nzpcsi0->powerControlOffsetSS));
|
||||
@@ -1375,7 +1382,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
|
||||
int minRXTXTIME,
|
||||
int do_csirs,
|
||||
int do_srs,
|
||||
int initial_csi_index,
|
||||
int uid) {
|
||||
AssertFatal(servingcellconfigcommon!=NULL,"servingcellconfigcommon is null\n");
|
||||
AssertFatal(reconfig!=NULL,"reconfig is null\n");
|
||||
@@ -1392,7 +1398,6 @@ void fill_default_reconfig(NR_ServingCellConfigCommon_t *servingcellconfigcommon
|
||||
minRXTXTIME,
|
||||
do_csirs,
|
||||
do_srs,
|
||||
initial_csi_index,
|
||||
uid);
|
||||
|
||||
xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
|
||||
|
||||
@@ -2164,17 +2164,6 @@ nr_rrc_ue_establish_srb2(
|
||||
nr_derive_key_up_int(NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm,
|
||||
NR_UE_rrc_inst[ctxt_pP->module_id].kgnb, &kUPint);
|
||||
|
||||
MSC_LOG_TX_MESSAGE(
|
||||
MSC_RRC_UE,
|
||||
MSC_PDCP_UE,
|
||||
NULL,
|
||||
0,
|
||||
MSC_AS_TIME_FMT" CONFIG_REQ UE %x DRB (security %X)",
|
||||
MSC_AS_TIME_ARGS(ctxt_pP),
|
||||
ctxt_pP->rnti,
|
||||
NR_UE_rrc_inst[ctxt_pP->module_id].cipheringAlgorithm |
|
||||
(NR_UE_rrc_inst[ctxt_pP->module_id].integrityProtAlgorithm << 4));
|
||||
|
||||
// Refresh DRBs
|
||||
nr_rrc_pdcp_config_asn1_req(ctxt_pP,
|
||||
NULL,
|
||||
|
||||
@@ -36,8 +36,6 @@
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
#include <common/utils/assertions.h>
|
||||
|
||||
#include "msc.h"
|
||||
|
||||
#include "common/ran_context.h"
|
||||
|
||||
#include "common/config/config_userapi.h"
|
||||
@@ -572,9 +570,6 @@ int main( int argc, char **argv )
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
itti_init(TASK_MAX, tasks_info);
|
||||
// initialize mscgen log after ITTI
|
||||
MSC_INIT(MSC_E_UTRAN, ADDED_QUEUES_MAX+TASK_MAX);
|
||||
|
||||
|
||||
init_opt();
|
||||
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
May 10, 2001
|
||||
Modified in June, 2001, to include the length non multiple of 8
|
||||
crc_byte.c
|
||||
Byte oriented implementation of CRC's
|
||||
|
||||
*/
|
||||
#include "rtos_header.h"
|
||||
#include "platform_types.h"
|
||||
|
||||
|
||||
/*ref 25.222 v4.0.0 , p12 */
|
||||
/* the highest degree is set by default */
|
||||
unsigned int poly24 = 0x80006100; // 1000 0000 0000 0000 0110 0001 D^24 + D^23 + D^6 + D^5 + D + 1
|
||||
unsigned int poly16 = 0x10210000; // 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1
|
||||
unsigned int poly12 = 0x80F00000; // 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1
|
||||
unsigned int poly8 = 0x9B000000; // 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1
|
||||
/*********************************************************
|
||||
|
||||
For initialization && verification purposes,
|
||||
bit by bit implementation with any polynomial
|
||||
|
||||
The first bit is in the MSB of each byte
|
||||
|
||||
*********************************************************/
|
||||
static unsigned int
|
||||
crcbit (unsigned char * inputptr, int octetlen, unsigned int poly)
|
||||
{
|
||||
unsigned int i, crc = 0, c;
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
c = (*inputptr++) << 24;
|
||||
|
||||
for (i = 8; i != 0; i--) {
|
||||
if ((1 << 31) & (c ^ crc))
|
||||
crc = (crc << 1) ^ poly;
|
||||
else
|
||||
crc <<= 1;
|
||||
|
||||
c <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
/*********************************************************
|
||||
|
||||
crc table initialization
|
||||
|
||||
*********************************************************/
|
||||
static unsigned int crc24Table[256];
|
||||
static unsigned short crc16Table[256];
|
||||
static unsigned short crc12Table[256];
|
||||
static unsigned char crc8Table[256];
|
||||
void
|
||||
crcTableInit ()
|
||||
{
|
||||
unsigned char c = 0;
|
||||
|
||||
do {
|
||||
crc24Table[c] = crcbit (&c, 1, poly24);
|
||||
crc16Table[c] = (unsigned short) (crcbit (&c, 1, poly16) >> 16);
|
||||
crc12Table[c] = (unsigned short) (crcbit (&c, 1, poly12) >> 16);
|
||||
crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24);
|
||||
} while (++c);
|
||||
}
|
||||
|
||||
/*********************************************************
|
||||
|
||||
Byte by byte implementations,
|
||||
assuming initial byte is 0 padded (in MSB) if necessary
|
||||
|
||||
*********************************************************/
|
||||
unsigned int
|
||||
crc24 (unsigned char * inptr, int bitlen)
|
||||
{
|
||||
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
crc = (crc << 8) ^ crc24Table[(*inptr++) ^ (crc >> 24)];
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
crc = (crc << resbit) ^ crc24Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
crc16 (unsigned char * inptr, int bitlen)
|
||||
{
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
crc = (crc << 8) ^ (crc16Table[(*inptr++) ^ (crc >> 24)] << 16);
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
crc = (crc << resbit) ^ (crc16Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 16);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
crc12 (unsigned char * inptr, int bitlen)
|
||||
{
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
crc = (crc << 8) ^ (crc12Table[(*inptr++) ^ (crc >> 24)] << 16);
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
crc = (crc << resbit) ^ (crc12Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 16);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
crc8 (unsigned char * inptr, int bitlen)
|
||||
{
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
crc = crc8Table[(*inptr++) ^ (crc >> 24)] << 24;
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
crc = (crc << resbit) ^ (crc8Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))] << 24);
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
/*******************************************************************/
|
||||
/**
|
||||
Test code
|
||||
********************************************************************/
|
||||
|
||||
/* #ifdef MAIN
|
||||
#include <stdio.h>
|
||||
main()
|
||||
{
|
||||
unsigned char test[] = "Thebigredfox";
|
||||
crcTableInit();
|
||||
printf("%x\n", crcbit(test, sizeof(test) - 1, poly24));
|
||||
printf("%x\n", crc24(test, (sizeof(test) - 1)*8));
|
||||
printf("%x\n", crcbit(test, sizeof(test) - 1, poly8));
|
||||
printf("%x\n", crc8(test, (sizeof(test) - 1)*8));
|
||||
}
|
||||
#endif */
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
random_proto_extern.h
|
||||
-------------------
|
||||
AUTHOR : Lionel GAUTHIER
|
||||
COMPANY : EURECOM
|
||||
EMAIL : Lionel.Gauthier@eurecom.fr
|
||||
***************************************************************************/
|
||||
extern int uniform (void);
|
||||
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file taus.c
|
||||
* \brief random number generator per OAI component
|
||||
* \author Navid Nikaein
|
||||
* \date 2011 - 2014
|
||||
* \version 0.1
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* \warning
|
||||
* @ingroup util
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
#include "oml.h"
|
||||
|
||||
unsigned int s0[MAX_NUM_COMPS], s1[MAX_NUM_COMPS], s2[MAX_NUM_COMPS], b[MAX_NUM_COMPS], r[MAX_NUM_COMPS];
|
||||
|
||||
|
||||
|
||||
|
||||
inline unsigned int taus(unsigned int comp) {
|
||||
b[comp] = (((s0[comp] << 13) ^ s0[comp]) >> 19);
|
||||
s0[comp] = (((s0[comp] & 0xFFFFFFFE) << 12)^ b[comp]);
|
||||
b[comp] = (((s1[comp] << 2) ^ s1[comp]) >> 25);
|
||||
s1[comp] = (((s1[comp] & 0xFFFFFFF8) << 4)^ b[comp]);
|
||||
b[comp] = (((s2[comp] << 3) ^ s2[comp]) >> 11);
|
||||
s2[comp] = (((s2[comp] & 0xFFFFFFF0) << 17)^ b[comp]);
|
||||
r[comp] = s0[comp] ^ s1[comp] ^ s2[comp];
|
||||
return r[comp];
|
||||
}
|
||||
|
||||
/*void set_taus_seed(unsigned int seed_type) {
|
||||
unsigned int i; // i index of component
|
||||
|
||||
for (i=MIN_NUM_COMPS; i < MAX_NUM_COMPS ; i ++) {
|
||||
switch (seed_type) {
|
||||
case 0: // use rand func
|
||||
if (i == 0) srand(time(NULL));
|
||||
|
||||
s0[i] = ((unsigned int)rand());
|
||||
s1[i] = ((unsigned int)rand());
|
||||
s2[i] = ((unsigned int)rand());
|
||||
printf("Initial seeds use rand: s0[%u] = 0x%x, s1[%u] = 0x%x, s2[%u] = 0x%x\n", i, s0[i], i, s1[i], i, s2[i]);
|
||||
break;
|
||||
|
||||
case 1: // use rand with seed
|
||||
if (i == 0) srand(0x1e23d851);
|
||||
|
||||
s0[i] = ((unsigned int)rand());
|
||||
s1[i] = ((unsigned int)rand());
|
||||
s2[i] = ((unsigned int)rand());
|
||||
printf("Initial seeds use rand with seed : s0[%u] = 0x%x, s1[%u] = 0x%x, s2[%u] = 0x%x\n", i, s0[i], i, s1[i], i, s2[i]);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
int get_rand (unsigned int comp) {
|
||||
if ((comp > MIN_NUM_COMPS) && (comp < MAX_NUM_COMPS))
|
||||
return r[comp];
|
||||
else {
|
||||
//LOG_E(RNG,"unknown component %d\n",comp);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int dtaus(unsigned int comp, unsigned int a, unsigned b) {
|
||||
return (int) (((double)taus(comp)/(double)0xffffffff)* (double)(b-a) + (double)a);
|
||||
}
|
||||
/*
|
||||
#ifdef STANDALONE
|
||||
main() {
|
||||
|
||||
unsigned int i,randomg, randphy;
|
||||
|
||||
set_taus_seed(0);
|
||||
printf("dtaus %d \n",dtaus(PHY, 1000, 1000000));
|
||||
|
||||
do {//for (i=0;i<10;i++){
|
||||
randphy = taus(PHY);
|
||||
randomg = taus(OTG);
|
||||
i++;
|
||||
// printf("rand for OMG (%d,0x%x) PHY (%d,0x%x)\n",OMG, randomg, PHY, randphy);
|
||||
} while (randphy != randomg);
|
||||
printf("after %d run: get rand for (OMG 0x%x, PHY 0x%x)\n",i, get_rand(OTG), get_rand(PHY));
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
*/
|
||||
@@ -40,7 +40,6 @@
|
||||
|
||||
#include "x2ap_eNB_itti_messaging.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
|
||||
@@ -260,8 +259,6 @@ int x2ap_eNB_generate_x2_setup_request(
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
@@ -486,8 +483,6 @@ int x2ap_eNB_generate_x2_setup_response(x2ap_eNB_instance_t *instance_p, x2ap_eN
|
||||
|
||||
x2ap_eNB_data_p->state = X2AP_ENB_STATE_READY;
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/successfulOutcome assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
@@ -542,11 +537,6 @@ int x2ap_eNB_generate_x2_setup_failure(instance_t instance,
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB,
|
||||
MSC_X2AP_TARGET_ENB, NULL, 0,
|
||||
"0 X2Setup/unsuccessfulOutcome assoc_id %u cause %u value %u",
|
||||
assoc_id, cause_type, cause_value);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance, assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
@@ -732,8 +722,6 @@ int x2ap_eNB_generate_x2_handover_request (x2ap_eNB_instance_t *instance_p, x2ap
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Handover/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
|
||||
return ret;
|
||||
@@ -846,8 +834,6 @@ int x2ap_eNB_generate_x2_handover_request_ack (x2ap_eNB_instance_t *instance_p,
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Handover/successfulOutcome assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
|
||||
return ret;
|
||||
@@ -908,8 +894,6 @@ int x2ap_eNB_generate_x2_ue_context_release (x2ap_eNB_instance_t *instance_p, x2
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2UEContextRelease/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
|
||||
return ret;
|
||||
@@ -992,8 +976,6 @@ int x2ap_eNB_generate_x2_handover_cancel (x2ap_eNB_instance_t *instance_p, x2ap_
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2HandoverCancel/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
|
||||
return ret;
|
||||
@@ -1090,8 +1072,6 @@ int x2ap_eNB_generate_senb_addition_request (x2ap_eNB_instance_t *instance_p, x2
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2SeNBAdditionRequest/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 1);
|
||||
|
||||
return ret;
|
||||
@@ -1367,8 +1347,6 @@ MCC_MNC_TO_PLMNID(instance_p->mcc, instance_p->mnc, instance_p->mnc_digit_length
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
@@ -1578,8 +1556,6 @@ int x2ap_eNB_generate_ENDC_x2_setup_response(
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
@@ -1737,8 +1713,6 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(
|
||||
# if 0 // TODO: Sanitizer complains we are trying to access this after free.
|
||||
free(ie->value.choice.MeNBtoSgNBContainer.buf);
|
||||
#endif
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
@@ -1844,8 +1818,6 @@ int x2ap_gNB_generate_ENDC_x2_SgNB_addition_request_ACK( x2ap_eNB_instance_t *in
|
||||
return -1;
|
||||
}
|
||||
|
||||
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);
|
||||
|
||||
x2ap_eNB_itti_send_sctp_data_req(instance_p->instance, x2ap_eNB_data_p->assoc_id, buffer, len, 0);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include "x2ap_eNB_management_procedures.h"
|
||||
#include "x2ap_eNB_generate_messages.h"
|
||||
|
||||
#include "msc.h"
|
||||
#include "assertions.h"
|
||||
#include "conversions.h"
|
||||
#include "X2AP_FreqBandNrItem.h"
|
||||
|
||||
Reference in New Issue
Block a user