Commit a7df59c8 authored by Vaibhav Shrivastava's avatar Vaibhav Shrivastava

Rebased with 3GPP_TTCN_System_Branch

parents 49352bf1 55813f3f
......@@ -864,10 +864,9 @@ if ($ENV{NR_ENABLE})
add_integer_option(MAX_NUM_CCs 1 "????")
Message("Cell configuration for NR is 1. MULTI CELLS NOT IMPLEMENTED")
else()
add_integer_option(MAX_NUM_CCs 2 "????")
add_integer_option(MAX_NUM_CCs 3 "????")
Message("Cell configuration for LTE is ${MAX_NUM_CCs}: MULTI CELLS IS IMPLEMENTED")
endif()
add_boolean_option(SMBV False "Rohde&Schwarz SMBV100A vector signal generator")
add_boolean_option(DEBUG_PHY False "Enable PHY layer debugging options")
add_boolean_option(DEBUG_PHY_PROC False "Enable debugging of PHY layer procedures")
......
......@@ -616,7 +616,7 @@ void logRecord_tp(const char *file,
else
snprintf(header, sizeof(header)-1, "SS-%s", c->name);
LOG_SS(header, buf) ;
LOG_SS(header, func, line, buf) ;
}
void vlogRecord_mt(const char *file,
......
......@@ -488,11 +488,17 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
if(g_log->log_component[c].level >= OAILOG_TRACE) { \
logRecord_tp(__FILE__, __FUNCTION__, __LINE__, c, OAILOG_TRACE, x); \
} } while(0)
# define LOG_P(lvl, _string, buf, len) do { \
if(g_log->log_component[PKT].level >= lvl) { \
LOG_SS_PKT(PKT, _string, buf, len); \
} } while(0)
# define LOG_MAC_P(lvl, _string, sfn, sf, mac_pack_info, buf, len) do { \
if(g_log->log_component[PKT].level >= lvl) { \
LOG_SS_MAC_PKT(PKT, _string, sfn, sf, mac_pack_info, buf, len); \
} } while(0)
/* avoid warnings for variables only used in LOG macro's but set outside debug section */
#define GCC_NOTUSED __attribute__((unused))
#define LOG_USEDINLOG_VAR(A,B) GCC_NOTUSED A B
......
......@@ -51,13 +51,23 @@
evId, g_log->sfn, g_log->sf, \
__func__, __LINE__, buf); \
} } while (0)
#define LOG_SS(component, log) tracepoint(SSeNB, SS_LOG, \
component, -1, g_log->sfn, \
g_log->sf, __func__, __LINE__,\
log)
#define LOG_SS(component, func, line, log) do { \
tracepoint(SSeNB, SS_LOG, \
component, -1, g_log->sfn, \
g_log->sf, func, line, log); \
} while(0)
#define LOG_SS_PKT(component, _string, buf, len) do { \
tracepoint(SSeNB, SS_PKT, \
"SS-PDU", -1, g_log->sfn, \
g_log->sf, _string, buf, len); \
} while(0)
#define LOG_SS_MAC_PKT(component, _string, sfn, sf, mac_pack_info, buf, len) do { \
tracepoint(SSeNB, SS_MAC_PKT, \
"SS-MAC-PDU", -1, sfn, sf, \
__func__, __LINE__, mac_pack_info, \
_string, buf, len); \
} while(0)
#endif /** __SS_LOG_H__ */
......@@ -153,7 +153,48 @@ TRACEPOINT_EVENT(
)
)
#if !defined(_SS_MAC_PKT_T)
typedef struct mac_pkt_info_s {
int direction;
int rnti_type;
int rnti;
int harq_pid;
int preamble;
} mac_pkt_info_t;
#define _SS_MAC_PKT_T
#endif
TRACEPOINT_EVENT(
SSeNB,
SS_MAC_PKT,
TP_ARGS(
const char*, component,
int, event_id,
int, sfn,
int, slot,
const char*, funcName,
int, lineNo,
mac_pkt_info_t, mac_pkt,
const char*, log_string,
uint8_t *, array_arg,
unsigned int, length
),
TP_FIELDS(
ctf_string(MODNAME, component)
ctf_integer(int32_t, EVENTID, event_id)
ctf_integer(int32_t, SFN, sfn)
ctf_integer(int32_t, SLOT, slot)
ctf_string(FUNCTION, funcName)
ctf_integer(int32_t, LINE, lineNo)
ctf_integer(int32_t, DIRECTION, mac_pkt.direction)
ctf_integer(int32_t, RNTI_TYPE, mac_pkt.rnti_type)
ctf_integer(int32_t, RNTI, mac_pkt.rnti)
ctf_integer(int32_t, HARQ_PID, mac_pkt.harq_pid)
ctf_integer(int32_t, PREAMBLE, mac_pkt.preamble)
ctf_string(Event, log_string)
ctf_sequence_hex(uint8_t, Buffer, array_arg, unsigned int, length)
)
)
#endif /* _SS_TP_H */
......
......@@ -1722,8 +1722,8 @@ int start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_start_response_t
phy_info *phy = pnf->phys;
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
uint16_t port =htons(phy->remote_port);
char *remote_addr = (char *) malloc(strlen(phy->remote_addr));
memset(remote_addr, 0, strlen(phy->remote_addr));
char *remote_addr = (char *) malloc(strlen(phy->remote_addr)+1);
memset(remote_addr, 0, strlen(phy->remote_addr)+1);
strncpy(remote_addr, phy->remote_addr, strlen(phy->remote_addr));
for(int i=0; i < pnf->num_phys; i++ )
{
......
......@@ -46,6 +46,13 @@
#include "LTE_LogicalChannelConfig.h"
#include "LTE_SecurityAlgorithmConfig.h"
#include "LTE_CipheringAlgorithm-r12.h"
#include "LTE_SIB-Type.h"
#include "LTE_Q-OffsetRange.h"
#include "LTE_SchedulingInfo.h"
#include "LTE_SpeedStateScaleFactors.h"
#include "LTE_InterFreqNeighCellInfo.h"
#include "LTE_PhysCellIdRange.h"
#include "LTE_NeighCellConfig.h"
#define MAX_RBS (LTE_maxDRB + 3)
......@@ -296,6 +303,59 @@ typedef struct RadioResourceConfig_s {
BOOLEAN_t mbms_dedicated_serving_cell;
} RadioResourceConfig;
typedef struct lte_sib_MappingInfo_s {
e_LTE_SIB_Type LTE_SIB_Type[5];
}lte_sib_MappingInfo_t;
typedef struct lte_SchedulingInfo_s {
e_LTE_SchedulingInfo__si_Periodicity si_Periodicity;
lte_sib_MappingInfo_t sib_MappingInfo;
}lte_SchedulingInfo_t;
typedef struct PhysCellIdRange_s {
long start;
e_LTE_PhysCellIdRange__range range;
}PhysCellIdRange_t;
typedef struct threshX_Q_r9_s {
long threshX_HighQ_r9;
long threshX_LowQ_r9;
}threshX_Q_r9_t;
typedef struct InterFreqCarrierFreqInfo_s {
long dl_CarrierFreq[MAX_NUM_CCs];
long q_RxLevMin[MAX_NUM_CCs];
bool p_Max_Present[MAX_NUM_CCs];
long p_Max[MAX_NUM_CCs]; /* OPTIONAL */
long t_ReselectionEUTRA[MAX_NUM_CCs];
bool t_ReselectionEUTRA_SF_Present[MAX_NUM_CCs];
LTE_SpeedStateScaleFactors_t *t_ReselectionEUTRA_SF[MAX_NUM_CCs]; /* OPTIONAL */
long threshX_High[MAX_NUM_CCs];
long threshX_Low[MAX_NUM_CCs];
long allowedMeasBandwidth[MAX_NUM_CCs];
bool presenceAntennaPort1[MAX_NUM_CCs];
bool cellReselectionPriority_Present[MAX_NUM_CCs];
long *cellReselectionPriority[MAX_NUM_CCs];/* OPTIONAL */
LTE_NeighCellConfig_t neighCellConfig[MAX_NUM_CCs];
bool q_OffsetFreqPresent[MAX_NUM_CCs];
e_LTE_Q_OffsetRange *q_OffsetFreq[MAX_NUM_CCs];/* OPTIONAL */
bool interFreqNeighCellList_Present[MAX_NUM_CCs];
LTE_InterFreqNeighCellInfo_t *interFreqNeighCellList[MAX_NUM_CCs];/* OPTIONAL */
bool interFreqBlackCellList_Present[MAX_NUM_CCs];
PhysCellIdRange_t *interFreqBlackCellList[MAX_NUM_CCs];/* OPTIONAL */
bool q_QualMin_r9_Present[MAX_NUM_CCs];
long *q_QualMin_r9[MAX_NUM_CCs];/* OPTIONAL */
bool threshX_Q_r9_Present[MAX_NUM_CCs];
threshX_Q_r9_t threshX_Q_r9[MAX_NUM_CCs];/* OPTIONAL */
bool q_QualMinWB_r11_Present[MAX_NUM_CCs];
long *q_QualMinWB_r11[MAX_NUM_CCs];/* OPTIONAL */
}InterFreqCarrierFreqInfo_t;
typedef struct IntraFreqNeighCellInfo_s {
long physCellId;
e_LTE_Q_OffsetRange q_OffsetCell;
}IntraFreqNeighCellInfo_t;
// eNB: ENB_APP -> RRC messages
typedef struct RrcConfigurationReq_s {
uint16_t tac[MAX_NUM_CCs];
......@@ -304,6 +364,7 @@ typedef struct RrcConfigurationReq_s {
uint16_t mcc[MAX_NUM_CCs][PLMN_LIST_MAX_SIZE];
uint16_t mnc[MAX_NUM_CCs][PLMN_LIST_MAX_SIZE];
uint8_t mnc_digit_length[MAX_NUM_CCs][PLMN_LIST_MAX_SIZE];
uint32_t cellReservedForOperatorUse[MAX_NUM_CCs][PLMN_LIST_MAX_SIZE];
uint8_t num_plmn[MAX_NUM_CCs];
int enable_measurement_reports;
int enable_x2;
......@@ -326,6 +387,8 @@ typedef struct RrcConfigurationReq_s {
int eMTC_configured;
int SL_configured;
uint8_t systemInfoValueTag[MAX_NUM_CCs];
int schedulingInfo_count;
lte_SchedulingInfo_t *schedulingInfo;
RadioResourceConfig radioresourceconfig[MAX_NUM_CCs];
RadioResourceConfig radioresourceconfig_BR[MAX_NUM_CCs];
......@@ -334,6 +397,7 @@ typedef struct RrcConfigurationReq_s {
//MIB
long schedulingInfoSIB1_BR_r13[MAX_NUM_CCs];
//SIB1 BR options
BOOLEAN_t stopSib1Transmission[MAX_NUM_CCs];
uint16_t *hyperSFN_r13 [MAX_NUM_CCs];
long *eDRX_Allowed_r13 [MAX_NUM_CCs];
BOOLEAN_t cellSelectionInfoCE_r13 [MAX_NUM_CCs];
......@@ -414,6 +478,16 @@ typedef struct RrcConfigurationReq_s {
long sib3_q_RxLevMin[MAX_NUM_CCs];
long t_ReselectionEUTRA[MAX_NUM_CCs];
//SIB4
bool sib4_Present;
bool intraFreqNeighCellListPresent;
IntraFreqNeighCellInfo_t *intraFreqNeighCellList;
//SIB5
bool sib5_Present;
int InterFreqCarrierFreqInfoCount;
InterFreqCarrierFreqInfo_t *InterFreqCarrierFreqInfo;
//SIB18
e_LTE_SL_CP_Len_r12 rxPool_sc_CP_Len[MAX_NUM_CCs];
e_LTE_SL_PeriodComm_r12 rxPool_sc_Period[MAX_NUM_CCs];
......
......@@ -422,6 +422,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
paramlist_def_t PLMNParamList = {ENB_CONFIG_STRING_PLMN_LIST, NULL, 0};
/* map parameter checking array instances to parameter definition array instances */
checkedparam_t config_check_PLMNParams [] = PLMNPARAMS_CHECK;
RRC_CONFIGURATION_REQ (msg_p).InterFreqCarrierFreqInfo = CALLOC(1,sizeof(struct InterFreqCarrierFreqInfo_s));
for (int I = 0; I < sizeof(PLMNParams) / sizeof(paramdef_t); ++I)
PLMNParams[I].chkPptr = &(config_check_PLMNParams[I]);
......@@ -433,6 +434,11 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
RRC_CONFIGURATION_REQ (msg_p).cellReselectionPriority[M]=7;
RRC_CONFIGURATION_REQ (msg_p).sib3_q_RxLevMin[M]=-70;
RRC_CONFIGURATION_REQ (msg_p).t_ReselectionEUTRA[M]=1;
RRC_CONFIGURATION_REQ (msg_p).InterFreqCarrierFreqInfo[k].dl_CarrierFreq[M]=300;
RRC_CONFIGURATION_REQ (msg_p).InterFreqCarrierFreqInfo[k].q_RxLevMin[M]=-53;
RRC_CONFIGURATION_REQ (msg_p).InterFreqCarrierFreqInfo[k].threshX_High[M]=10;
RRC_CONFIGURATION_REQ (msg_p).InterFreqCarrierFreqInfo[k].threshX_Low[M]=1;
RRC_CONFIGURATION_REQ (msg_p).InterFreqCarrierFreqInfo[k].allowedMeasBandwidth[M]=3;
}
// In the configuration file it is in seconds. For RRC it has to be in milliseconds
......@@ -463,6 +469,7 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
RRC_CONFIGURATION_REQ(msg_p).mcc[M][l] = *PLMNParamList.paramarray[l][ENB_MOBILE_COUNTRY_CODE_IDX].uptr;
RRC_CONFIGURATION_REQ(msg_p).mnc[M][l] = *PLMNParamList.paramarray[l][ENB_MOBILE_NETWORK_CODE_IDX].uptr;
RRC_CONFIGURATION_REQ(msg_p).mnc_digit_length[M][l] = *PLMNParamList.paramarray[l][ENB_MNC_DIGIT_LENGTH].u8ptr;
RRC_CONFIGURATION_REQ(msg_p).cellReservedForOperatorUse[M][l] = LTE_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved;
AssertFatal(RRC_CONFIGURATION_REQ(msg_p).mnc_digit_length[M][l] == 3
|| RRC_CONFIGURATION_REQ(msg_p).mnc[M][l] < 100,
"MNC %d cannot be encoded in two digits as requested (change mnc_digit_length to 3)\n",
......@@ -3060,12 +3067,12 @@ void extract_and_decode_SI(int inst,int si_ind,uint8_t *si_container,int si_cont
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib4:
//carrier->sib4 = &typeandinfo->choice.sib4;
carrier->sib4 = &typeandinfo->choice.sib4;
LOG_I( ENB_APP, "[RRC %"PRIu8"] Found SIB4 in CU F1AP_SETUP_RESP message\n", inst);
break;
case LTE_SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib5:
//carrier->sib5 = &typeandinfo->choice.sib5;
carrier->sib5 = &typeandinfo->choice.sib5;
LOG_I( ENB_APP, "[RRC %"PRIu8"] Found SIB5 in CU F1AP_SETUP_RESP message\n", inst);
break;
......
......@@ -984,7 +984,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, ENB_FLAG_YES, NOT_A_RNTI, frameP, subframeP, module_idP);
rlc_tick(frameP, subframeP);
pdcp_run(&ctxt);
pdcp_mbms_run(&ctxt);
//TODO: comment here for workaround as something wrong make tun read block
//pdcp_mbms_run(&ctxt);
rrc_rx_tx(&ctxt, CC_id);
}
#endif
......
......@@ -1378,12 +1378,13 @@ initiate_ra_proc(module_id_t module_idP,
ra[i].Msg2_subframe = (subframeP + offset) % 10;
/* TODO: find better procedure to allocate RNTI */
set_taus_seed(0); //TODO: add workaround here (set_taus_seed already called at begining of main,but something goes wrong when built with 3 cells)
do {
if (IS_SOFTMODEM_IQPLAYER) { /* iq player mode, use deterministic rnti */
static int drnti[MAX_MOBILES_PER_ENB];
static int drnti_def[]={ 0xbda7, 0x71da, 0x9c40, 0xc350, 0x2710, 0x4e20, 0x7530, 0x1388, 0x3a98, 0x61a8, 0x88b8, 0xafc8, 0xd6d8, 0x1b58, 0x4268, 0x6978 };
for (int j=0; j<MAX_MOBILES_PER_ENB && j< (sizeof(drnti_def)/sizeof(int));j++)
drnti[i]=drnti_def[i];
drnti[j]=drnti_def[j];
int nb_ue = 0;
......@@ -1403,6 +1404,7 @@ initiate_ra_proc(module_id_t module_idP,
ra[i].rnti = drnti[nb_ue];
} else {
ra[i].rnti = taus();
LOG_D(MAC, "[RAPROC] try rnti:0x%x\n",ra[i].rnti);
}
loop++;
} while (loop != 100 &&
......
......@@ -1481,6 +1481,15 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
T(T_GNB_MAC_DL_RAR_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(ra->RA_rnti), T_INT(frameP),
T_INT(slotP), T_INT(0), T_BUFFER(&tx_req->TLVs[0].value.direct[0], tx_req->TLVs[0].length));
// Trace MACPDU
mac_pkt_info_t mac_pkt;
mac_pkt.direction = DIR_DOWNLINK;
mac_pkt.rnti_type = map_nr_rnti_type(NR_RNTI_RA);
mac_pkt.rnti = ra->RA_rnti;
mac_pkt.harq_pid = 0;
mac_pkt.preamble = -1; /* TODO */
LOG_MAC_P(OAILOG_INFO, "MAC_DL_RAR_PDU", frameP, slotP, mac_pkt, (uint8_t *)&tx_req->TLVs[0].value.direct[0], (int)tx_req->TLVs[0].length);
tx_req->PDU_length = pdsch_pdu_rel15->TBSize[0];
tx_req->PDU_index = pduindex;
tx_req->num_TLV = 1;
......@@ -1880,6 +1889,15 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
T(T_GNB_MAC_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(ra->rnti),
T_INT(frameP), T_INT(slotP), T_INT(current_harq_pid), T_BUFFER(harq->tb, harq->tb_size));
// Trace MACPDU
mac_pkt_info_t mac_pkt;
mac_pkt.direction = DIR_DOWNLINK;
mac_pkt.rnti_type = map_nr_rnti_type(NR_RNTI_C);
mac_pkt.rnti = ra->rnti;
mac_pkt.harq_pid = current_harq_pid;
mac_pkt.preamble = -1; /* TODO */
LOG_MAC_P(OAILOG_INFO, "MAC_DL_PDU", frameP, slotP, mac_pkt, (uint8_t *)harq->tb, (int)harq->tb_size);
// DL TX request
nfapi_nr_pdu_t *tx_req = &nr_mac->TX_req[CC_id].pdu_list[nr_mac->TX_req[CC_id].Number_of_PDUs];
memcpy(tx_req->TLVs[0].value.direct, harq->tb, sizeof(uint8_t) * harq->tb_size);
......
......@@ -693,6 +693,14 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
T(T_GNB_MAC_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(SI_RNTI),
T_INT(frameP), T_INT(slotP), T_INT(0), T_BUFFER(sib1_payload, sib1_sdu_length));
// Trace MACPDU
mac_pkt_info_t mac_pkt;
mac_pkt.direction = DIR_DOWNLINK;
mac_pkt.rnti_type = map_nr_rnti_type(NR_RNTI_SI);
mac_pkt.rnti = SI_RNTI;
mac_pkt.harq_pid = 0;
mac_pkt.preamble = -1; /* TODO */
LOG_MAC_P(OAILOG_INFO, "MAC_DL_PDU", frameP, slotP, mac_pkt, (uint8_t *)sib1_payload, (int)sib1_sdu_length);
}
}
}
......@@ -30,6 +30,7 @@
*/
#include "common/utils/nr/nr_common.h"
#include "UTIL/OPT/opt.h"
/*MAC*/
#include "NR_MAC_COMMON/nr_mac.h"
#include "NR_MAC_gNB/nr_mac_gNB.h"
......@@ -1321,6 +1322,16 @@ void nr_schedule_ue_spec(module_id_t module_id,
T(T_GNB_MAC_RETRANSMISSION_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti),
T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_INT(harq->round), T_BUFFER(harq->tb, TBS));
// Trace MACPDU
mac_pkt_info_t mac_pkt;
mac_pkt.direction = DIR_DOWNLINK;
mac_pkt.rnti_type = map_nr_rnti_type(rnti_type);
mac_pkt.rnti = rnti;
mac_pkt.harq_pid = current_harq_pid;
mac_pkt.preamble = -1; /* TODO */
LOG_MAC_P(OAILOG_INFO, "MAC_RETRANSMISSION_DL_PDU", frame, slot, mac_pkt, (uint8_t *)harq->tb, (int)TBS);
} else { /* initial transmission */
LOG_D(NR_MAC, "[%s] Initial HARQ transmission in %d.%d\n", __FUNCTION__, frame, slot);
......@@ -1456,6 +1467,15 @@ void nr_schedule_ue_spec(module_id_t module_id,
T(T_GNB_MAC_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti),
T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_BUFFER(harq->tb, TBS));
// Trace MACPDU
mac_pkt_info_t mac_pkt;
mac_pkt.direction = DIR_DOWNLINK;
mac_pkt.rnti_type = map_nr_rnti_type(rnti_type);
mac_pkt.rnti = rnti;
mac_pkt.harq_pid = current_harq_pid;
mac_pkt.preamble = -1; /* TODO */
LOG_MAC_P(OAILOG_INFO, "MAC_DL_PDU", frame, slot, mac_pkt, (uint8_t *)harq->tb, (int)TBS);
}
const int ntx_req = gNB_mac->TX_req[CC_id].Number_of_PDUs;
......
......@@ -676,11 +676,21 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
NR_UE_sched_ctrl_t *UE_scheduling_control = &UE_info->UE_sched_ctrl[UE_id];
const int8_t harq_pid = UE_scheduling_control->feedback_ul_harq.head;
if (sduP)
if (sduP) {
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(harq_pid),
T_BUFFER(sduP, sdu_lenP));
// Trace MACPDU
mac_pkt_info_t mac_pkt;
mac_pkt.direction = DIR_UPLINK;
mac_pkt.rnti_type = map_nr_rnti_type(NR_RNTI_C);
mac_pkt.rnti = current_rnti;
mac_pkt.harq_pid = harq_pid;
mac_pkt.preamble = -1; /* TODO */
LOG_MAC_P(OAILOG_INFO, "MAC_UL_PDU", frameP, slotP, mac_pkt, (uint8_t *)sduP, (int)sdu_lenP);
}
UE_info->mac_stats[UE_id].ulsch_total_bytes_rx += sdu_lenP;
LOG_D(NR_MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d TA %d sduP %p, rssi %d\n",
gnb_mod_idP,
......@@ -770,6 +780,15 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */,
T_BUFFER(sduP, sdu_lenP));
// Trace MACPDU
mac_pkt_info_t mac_pkt;
mac_pkt.direction = DIR_UPLINK;
mac_pkt.rnti_type = map_nr_rnti_type(NR_RNTI_TC);
mac_pkt.rnti = rntiP;
mac_pkt.harq_pid = -1;
mac_pkt.preamble = -1; /* TODO */
LOG_MAC_P(OAILOG_INFO, "MAC_UL_PDU", frameP, slotP, mac_pkt, (uint8_t *)sduP, (int)sdu_lenP);
/* we don't know this UE (yet). Check whether there is a ongoing RA (Msg 3)
* and check the corresponding UE's RNTI match, in which case we activate
* it. */
......
......@@ -81,11 +81,16 @@ mac_rrc_data_req(
eNB_RRC_INST *rrc;
rrc_eNB_carrier_data_t *carrier;
LTE_BCCH_BCH_Message_t *mib;
LTE_SystemInformationBlockType1_t *SIB1;
LTE_SchedulingInfo_t *SchedulingInfo;
LTE_SIB_Type_t *sib_type;
LTE_BCCH_BCH_Message_MBMS_t *mib_fembms;
rrc = RC.rrc[Mod_idP];
carrier = &rrc->carrier[CC_id];
mib = &carrier->mib;
mib_fembms = &carrier->mib_fembms;
SIB1 = &carrier->SIB1;
SchedulingInfo = &SIB1->schedulingInfoList.list;
if((Srb_id & RAB_OFFSET) == BCCH_SI_MBMS){
if (frameP%8 == 0) {
......@@ -117,6 +122,11 @@ mac_rrc_data_req(
"[eNB %d] MAC Request for SIB1 and SIB1 not initialized\n",Mod_idP);
if ((frameP%2) == 0) {
if(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1 == 0){
//stopSib1Transmission
LOG_D(RRC,"[eNB %d] CC_id:%d Frame %d : stopSib1Transmission\n",Mod_idP,CC_id,frameP);
return 0;
}
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB1,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1);
......@@ -149,7 +159,25 @@ mac_rrc_data_req(
} /* LOG_DEBUGFLAG(DEBUG_RRC) */
return(RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23);
} else {
}
else if ((true == RC.rrc[Mod_idP]->carrier[CC_id].sib5_Scheduled) && ((frameP%16) == 3)) {
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB5,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB5);
if (LOG_DEBUGFLAG(DEBUG_RRC)) {
LOG_T(RRC,"[eNB %d] Frame %d : BCCH request => SIB 5\n",Mod_idP,frameP);
for (int i=0; i<RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB5; i++) {
LOG_T(RRC,"%x.",buffer_pP[i]);
}
LOG_T(RRC,"\n");
} /* LOG_DEBUGFLAG(DEBUG_RRC) */
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB5);
}
else {
return(0);
}
}
......
This diff is collapsed.
......@@ -131,6 +131,30 @@ uint8_t do_SIB23(uint8_t Mod_id,int CC_id, BOOLEAN_t brOption,
RrcConfigurationReq *configuration
);
/**
\brief Generate a default configuration for SIB4 in one System Information PDU (eNB).
@param Mod_id Index of eNB (used to derive some parameters)
@param buffer Pointer to PER-encoded ASN.1 description of SI PDU
@param systemInformation Pointer to asn1c C representation of SI PDU
@param sib4 Pointer (returned) to sib4 component withing SI PDU
@return size of encoded bit stream in bytes*/
uint8_t do_SIB4(uint8_t Mod_id,int CC_id, BOOLEAN_t brOption,
RrcConfigurationReq *configuration
);
/**
\brief Generate a default configuration for SIB5 in one System Information PDU (eNB).
@param Mod_id Index of eNB (used to derive some parameters)
@param buffer Pointer to PER-encoded ASN.1 description of SI PDU
@param systemInformation Pointer to asn1c C representation of SI PDU
@param sib5 Pointer (returned) to sib5 component withing SI PDU
@return size of encoded bit stream in bytes*/
uint8_t do_SIB5(uint8_t Mod_id,int CC_id, BOOLEAN_t brOption,
RrcConfigurationReq *configuration
);
/**
\brief Generate an RRCConnectionRequest UL-CCCH-Message (UE) based on random string or S-TMSI. This
routine only generates an mo-data establishment cause.
......
......@@ -693,6 +693,10 @@ typedef struct {
uint8_t sizeof_SIB1;
uint8_t *SIB23;
uint8_t sizeof_SIB23;
uint8_t *SIB4;
uint8_t sizeof_SIB4;
uint8_t *SIB5;
uint8_t sizeof_SIB5;
uint8_t *SIB1_BR;
uint8_t sizeof_SIB1_BR;
uint8_t *SIB23_BR;
......@@ -725,6 +729,8 @@ typedef struct {
LTE_SystemInformationBlockType1_t *sib1;
LTE_SystemInformationBlockType2_t *sib2;
LTE_SystemInformationBlockType3_t *sib3;
LTE_SystemInformationBlockType4_t *sib4;
LTE_SystemInformationBlockType5_t *sib5;
LTE_SystemInformationBlockType1_t *sib1_BR;
LTE_SystemInformationBlockType2_t *sib2_BR;
LTE_SystemInformationBlockType1_MBMS_r14_t *sib1_MBMS;
......@@ -743,6 +749,7 @@ typedef struct {
LTE_MCCH_Message_t mcch_counting;
LTE_MBMSCountingRequest_r10_t *mcch_message_counting;
SRB_INFO MCCH_MESS_COUNTING[8];// MAX_MBSFN_AREA
bool sib5_Scheduled;
//TTN - SIB 18,19,21 for D2D
LTE_SystemInformationBlockType18_r12_t *sib18;
......
......@@ -247,6 +247,8 @@ init_SI(
if(NULL==carrier->MIB) {carrier->MIB = (uint8_t *) malloc16(4);}
carrier->sizeof_SIB1 = 0;
carrier->sizeof_SIB23 = 0;
carrier->sizeof_SIB4 = 0;
carrier->sizeof_SIB5 = 0;
if(NULL==carrier->SIB1) {carrier->SIB1 = (uint8_t *) malloc16(32);}
AssertFatal(carrier->SIB1!=NULL,PROTOCOL_RRC_CTXT_FMT" init_SI: FATAL, no memory for SIB1 allocated\n",
......@@ -337,6 +339,34 @@ init_SI(
PROTOCOL_RRC_CTXT_ARGS(ctxt_pP),
carrier->sib2->radioResourceConfigCommon.pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift);
if(true == configuration->sib4_Present) {
if(NULL == carrier->SIB4) {
carrier->SIB4 = (uint8_t *) malloc16(64);
}
AssertFatal(carrier->SIB4!=NULL,"cannot allocate memory for SIB4");
carrier->sizeof_SIB4 = do_SIB4(ctxt_pP->module_id,
CC_id,
FALSE,
configuration
);
LOG_I(RRC,"do_SIB4, size %d \n ", carrier->sizeof_SIB4);
AssertFatal(carrier->sizeof_SIB4 != 255,"FATAL, RC.rrc[mod].carrier[CC_id].sizeof_SIB4 == 255");
}
if(true == configuration->sib5_Present) {
if(NULL == carrier->SIB5) {
carrier->SIB5 = (uint8_t *) malloc16(64);
}
AssertFatal(carrier->SIB5!=NULL,"cannot allocate memory for SIB5");
carrier->sizeof_SIB5 = do_SIB5(ctxt_pP->module_id,
CC_id,
FALSE,
configuration
);
LOG_I(RRC,"do_SIB5, size %d \n ", carrier->sizeof_SIB5);
AssertFatal(carrier->sizeof_SIB5 != 255,"FATAL, RC.rrc[mod].carrier[CC_id].sizeof_SIB5 == 255");
}
if (carrier->MBMS_flag > 0) {
for (i = 0; i < carrier->sib2->mbsfn_SubframeConfigList->list.count; i++) {
// SIB 2
......
......@@ -60,6 +60,7 @@ typedef uint32_t guint32;
typedef guint8 gboolean;
#include <openair2/UTIL/OPT/wireshark_headers.h>
#include <openair2/LAYER2/NR_MAC_COMMON/nr_mac.h>
#include "mac_pcap.h"
......@@ -121,4 +122,33 @@ void terminate_opt(void);
//double *timing_analyzer(int index, int direction );
/* In Wireshark, only these RNTI Types are support today */
static inline int map_nr_rnti_type(nr_rnti_type_t r_type)
{
switch(r_type) {
case NR_RNTI_C:
return WS_C_RNTI;
case NR_RNTI_RA:
return WS_RA_RNTI;
case NR_RNTI_P:
return WS_P_RNTI;
case NR_RNTI_CS:
return WS_CS_RNTI;
case NR_RNTI_SI:
return WS_SI_RNTI;
case NR_RNTI_new:
return WS_NO_RNTI;
case NR_RNTI_TC:
case NR_RNTI_SP_CSI:
case NR_RNTI_SFI:
case NR_RNTI_INT:
case NR_RNTI_TPC_PUSCH:
case NR_RNTI_TPC_PUCCH:
case NR_RNTI_TPC_SRS:
case NR_RNTI_MCS_C:
return WS_NO_RNTI;
}
}
#endif /* OPT_H_ */
......@@ -22,5 +22,5 @@
#pragma once
#define ACP_VERSION "1.1.30"
#define ACP_VERSION_CKSM "fe1196c636726d0acaedfd8a3158d63c"
#define ACP_VERSION "1.1.31"
#define ACP_VERSION_CKSM "fc6be432378419cb932a2a16306ffbb4"
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment