Commit a634f14f authored by rmagueta's avatar rmagueta

Merge remote-tracking branch 'origin/develop' into develop-CSI

# Conflicts:
#	openair1/PHY/NR_TRANSPORT/nr_sch_dmrs.c
#	openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
#	openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
#	openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
parents bb89ae3a a45bbd40
...@@ -106,6 +106,9 @@ class Containerize(): ...@@ -106,6 +106,9 @@ class Containerize():
self.registrySvrId = '' self.registrySvrId = ''
self.testSvrId = '' self.testSvrId = ''
#checkers from xml
self.ran_checkers={}
#----------------------------------------------------------- #-----------------------------------------------------------
# Container management functions # Container management functions
#----------------------------------------------------------- #-----------------------------------------------------------
...@@ -624,7 +627,7 @@ class Containerize(): ...@@ -624,7 +627,7 @@ class Containerize():
else: else:
if containerToKill: if containerToKill:
logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + self.eNB_logFile[self.eNB_instance]) logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + self.eNB_logFile[self.eNB_instance])
logStatus = RAN.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance], HTML) logStatus = RAN.AnalyzeLogFile_eNB(self.eNB_logFile[self.eNB_instance], HTML, self.ran_checkers)
else: else:
logStatus = 0 logStatus = 0
if (logStatus < 0): if (logStatus < 0):
...@@ -788,9 +791,10 @@ class Containerize(): ...@@ -788,9 +791,10 @@ class Containerize():
continue continue
logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m') logging.debug('\u001B[1m Analyzing xNB logfile ' + filename + ' \u001B[0m')
logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML) logStatus = RAN.AnalyzeLogFile_eNB(filename, HTML, self.ran_checkers)
if (logStatus < 0): if (logStatus < 0):
fullStatus = False fullStatus = False
self.exitStatus = 1
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus) HTML.CreateHtmlTestRow(RAN.runtime_stats, 'KO', logStatus)
else: else:
HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(RAN.runtime_stats, 'OK', CONST.ALL_PROCESSES_OK)
......
Active_gNBs = ( "gNB-OAI");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
gNBs =
(
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_name = "gNB-OAI";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
plmn_list = ({
mcc = 208;
mnc = 99;
mnc_length = 2;
snssaiList = (
{
sst = 1;
sd = 0x1; // 0 false, else true
},
{
sst = 1;
sd = 0x112233; // 0 false, else true
}
);
});
nr_cellid = 12345678L;
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
sib1_tda = 15;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
{
controlResourceSetZero = 2;
searchSpaceZero = 0;
}
);
servingCellConfigCommon = (
{
#spCellConfigCommon
physCellId = 0;
# downlinkConfigCommon
#frequencyInfoDL
# this is 3600 MHz + 12 PRBs@30kHz SCS (same as initial BWP)
absoluteFrequencySSB = 640288;
dl_frequencyBand = 78;
# this is 3600 MHz
dl_absoluteFrequencyPointA = 640000;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_subcarrierSpacing = 1;
dl_carrierBandwidth = 24;
#initialDownlinkBWP
#genericParameters
# this is RBstart=27,L=48 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6325;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
#pdcch-ConfigCommon
initialDLBWPcontrolResourceSetZero = 2;
initialDLBWPsearchSpaceZero = 0;
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 78;
#scs-SpecificCarrierList
ul_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
ul_subcarrierSpacing = 1;
ul_carrierBandwidth = 24;
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6325;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
#rach-ConfigCommon
#rach-ConfigGeneric
prach_ConfigurationIndex = 98;
#prach_msg1_FDM
#0 = one, 1=two, 2=four, 3=eight
prach_msg1_FDM = 0;
prach_msg1_FrequencyStart = 0;
zeroCorrelationZoneConfig = 13;
preambleReceivedTargetPower = -96;
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
preambleTransMax = 6;
#powerRampingStep
# 0=dB0,1=dB2,2=dB4,3=dB6
powerRampingStep = 1;
#ra_ReponseWindow
#1,2,4,8,10,20,40,80
ra_ResponseWindow = 4;
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
#oneHalf (0..15) 4,8,12,16,...60,64
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
#ra_ContentionResolutionTimer
#(0..7) 8,16,24,32,40,48,56,64
ra_ContentionResolutionTimer = 7;
rsrp_ThresholdSSB = 19;
#prach-RootSequenceIndex_PR
#1 = 839, 2 = 139
prach_RootSequenceIndex_PR = 2;
prach_RootSequenceIndex = 1;
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
#
msg1_SubcarrierSpacing = 1,
# restrictedSetConfig
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
# pucch-ConfigCommon setup :
# pucchGroupHopping
# 0 = neither, 1= group hopping, 2=sequence hopping
pucchGroupHopping = 0;
hoppingId = 40;
p0_nominal = -90;
# ssb_PositionsInBurs_BitmapPR
# 1=short, 2=medium, 3=long
ssb_PositionsInBurst_PR = 2;
ssb_PositionsInBurst_Bitmap = 1;
# ssb_periodicityServingCell
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
ssb_periodicityServingCell = 2;
# dmrs_TypeA_position
# 0 = pos2, 1 = pos3
dmrs_TypeA_Position = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
subcarrierSpacing = 1;
#tdd-UL-DL-ConfigurationCommon
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
referenceSubcarrierSpacing = 1;
# pattern1
# dl_UL_TransmissionPeriodicity
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
dl_UL_TransmissionPeriodicity = 6;
nrofDownlinkSlots = 7;
nrofDownlinkSymbols = 6;
nrofUplinkSlots = 2;
nrofUplinkSymbols = 4;
ssPBCH_BlockPower = -25;
}
);
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.70.132";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
);
MACRLCs = (
{
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 150;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 1;
}
);
L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
pusch_proc_threads = 8;
prach_dtx_threshold = 120;
pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
RUs = (
{
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 0
att_rx = 0;
bands = [78];
max_pdschReferenceSignalPower = -27;
max_rxgain = 114;
sf_extension = 0;
eNB_instances = [0];
#beamforming 1x4 matrix:
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
clock_src = "internal";
}
);
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
rfsimulator :
{
serveraddr = "server";
serverport = "4043";
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
security = {
# preferred ciphering algorithms
# the first one of the list that an UE supports in chosen
# valid values: nea0, nea1, nea2, nea3
ciphering_algorithms = ( "nea0" );
# preferred integrity algorithms
# the first one of the list that an UE supports in chosen
# valid values: nia0, nia1, nia2, nia3
integrity_algorithms = ( "nia2", "nia0" );
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
drb_ciphering = "yes";
drb_integrity = "no";
};
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
ngap_log_level ="debug";
ngap_log_verbosity ="medium";
};
...@@ -45,6 +45,7 @@ ENB_PROCESS_REALTIME_ISSUE = -13 ...@@ -45,6 +45,7 @@ ENB_PROCESS_REALTIME_ISSUE = -13
ENB_PROCESS_NOLOGFILE_TO_ANALYZE = -14 ENB_PROCESS_NOLOGFILE_TO_ANALYZE = -14
ENB_PROCESS_SLAVE_RRU_NOT_SYNCED = -15 ENB_PROCESS_SLAVE_RRU_NOT_SYNCED = -15
ENB_REAL_TIME_PROCESSING_ISSUE = -16 ENB_REAL_TIME_PROCESSING_ISSUE = -16
ENB_RETX_ISSUE = -17
HSS_PROCESS_FAILED = -2 HSS_PROCESS_FAILED = -2
HSS_PROCESS_OK = +2 HSS_PROCESS_OK = +2
MME_PROCESS_FAILED = -3 MME_PROCESS_FAILED = -3
......
...@@ -401,6 +401,12 @@ def GetParametersFromXML(action): ...@@ -401,6 +401,12 @@ def GetParametersFromXML(action):
string_field=test.findtext('nb_healthy') string_field=test.findtext('nb_healthy')
if (string_field is not None): if (string_field is not None):
CONTAINERS.nb_healthy[0] = int(string_field) CONTAINERS.nb_healthy[0] = int(string_field)
string_field=test.findtext('d_retx_th')
if (string_field is not None):
CONTAINERS.ran_checkers['d_retx_th']= string_field
string_field=test.findtext('u_retx_th')
if (string_field is not None):
CONTAINERS.ran_checkers['u_retx_th']= string_field
elif action == 'PingFromContainer': elif action == 'PingFromContainer':
string_field = test.findtext('container_name') string_field = test.findtext('container_name')
......
...@@ -39,6 +39,7 @@ import time ...@@ -39,6 +39,7 @@ import time
from multiprocessing import Process, Lock, SimpleQueue from multiprocessing import Process, Lock, SimpleQueue
import yaml import yaml
#----------------------------------------------------------- #-----------------------------------------------------------
# OAI Testing modules # OAI Testing modules
#----------------------------------------------------------- #-----------------------------------------------------------
...@@ -758,7 +759,7 @@ class RANManagement(): ...@@ -758,7 +759,7 @@ class RANManagement():
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15) mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15)
mySSH.close() mySSH.close()
def AnalyzeLogFile_eNB(self, eNBlogFile, HTML): def AnalyzeLogFile_eNB(self, eNBlogFile, HTML, checkers={}):
if (not os.path.isfile('./' + eNBlogFile)): if (not os.path.isfile('./' + eNBlogFile)):
return -1 return -1
enb_log_file = open('./' + eNBlogFile, 'r') enb_log_file = open('./' + eNBlogFile, 'r')
...@@ -815,10 +816,12 @@ class RANManagement(): ...@@ -815,10 +816,12 @@ class RANManagement():
removing_ue = 0 removing_ue = 0
#count"X2AP-PDU" #count"X2AP-PDU"
x2ap_pdu = 0 x2ap_pdu = 0
#NSA specific log markers #gnb specific log markers
nsa_markers ={'SgNBReleaseRequestAcknowledge': [],'FAILURE': [], 'scgFailureInformationNR-r15': [], 'SgNBReleaseRequest': []} gnb_markers ={'SgNBReleaseRequestAcknowledge': [],'FAILURE': [], 'scgFailureInformationNR-r15': [], 'SgNBReleaseRequest': [], 'Detected UL Failure on PUSCH':[]}
nodeB_prefix_found = False nodeB_prefix_found = False
RealTimeProcessingIssue = False RealTimeProcessingIssue = False
DLRetxIssue = False
ULRetxIssue = False
line_cnt=0 #log file line counter line_cnt=0 #log file line counter
for line in enb_log_file.readlines(): for line in enb_log_file.readlines():
...@@ -1008,11 +1011,11 @@ class RANManagement(): ...@@ -1008,11 +1011,11 @@ class RANManagement():
result = re.search('X2AP-PDU', str(line)) result = re.search('X2AP-PDU', str(line))
if result is not None: if result is not None:
x2ap_pdu += 1 x2ap_pdu += 1
#nsa markers logging #gnb markers logging
for k in nsa_markers: for k in gnb_markers:
result = re.search(k, line) result = re.search(k, line)
if result is not None: if result is not None:
nsa_markers[k].append(line_cnt) gnb_markers[k].append(line_cnt)
enb_log_file.close() enb_log_file.close()
...@@ -1096,31 +1099,77 @@ class RANManagement(): ...@@ -1096,31 +1099,77 @@ class RANManagement():
htmlMsg = statMsg+'\n' htmlMsg = statMsg+'\n'
logging.debug(statMsg) logging.debug(statMsg)
htmleNBFailureMsg += htmlMsg htmleNBFailureMsg += htmlMsg
#nsa markers #gnb markers
statMsg = 'logfile line count = ' + str(line_cnt) statMsg = 'logfile line count = ' + str(line_cnt)
htmlMsg = statMsg+'\n' htmlMsg = statMsg+'\n'
logging.debug(statMsg) logging.debug(statMsg)
htmleNBFailureMsg += htmlMsg htmleNBFailureMsg += htmlMsg
if len(nsa_markers['SgNBReleaseRequestAcknowledge'])!=0: if len(gnb_markers['SgNBReleaseRequestAcknowledge'])!=0:
statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(nsa_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences , starting line ' + str(nsa_markers['SgNBReleaseRequestAcknowledge'][0]) statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(gnb_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences , starting line ' + str(gnb_markers['SgNBReleaseRequestAcknowledge'][0])
else: else:
statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(nsa_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences' statMsg = 'SgNBReleaseRequestAcknowledge = ' + str(len(gnb_markers['SgNBReleaseRequestAcknowledge'])) + ' occurences'
htmlMsg = statMsg+'\n' htmlMsg = statMsg+'\n'
logging.debug(statMsg) logging.debug(statMsg)
htmleNBFailureMsg += htmlMsg htmleNBFailureMsg += htmlMsg
statMsg = 'FAILURE = ' + str(len(nsa_markers['FAILURE'])) + ' occurences' statMsg = 'FAILURE = ' + str(len(gnb_markers['FAILURE'])) + ' occurences'
htmlMsg = statMsg+'\n'
logging.debug(statMsg)
htmleNBFailureMsg += htmlMsg
statMsg = 'Detected UL Failure on PUSCH = ' + str(len(gnb_markers['Detected UL Failure on PUSCH'])) + ' occurences'
htmlMsg = statMsg+'\n' htmlMsg = statMsg+'\n'
logging.debug(statMsg) logging.debug(statMsg)
htmleNBFailureMsg += htmlMsg htmleNBFailureMsg += htmlMsg
#ulsch and dlsch statistics #ulsch and dlsch statistics and checkers
#print statistics into html
if len(dlsch_ulsch_stats)!=0: #check if dictionary is not empty if len(dlsch_ulsch_stats)!=0: #check if dictionary is not empty
#for each dictionary key, generate the msg for html as information
statMsg='' statMsg=''
for key in dlsch_ulsch_stats: #for each dictionary key for key in dlsch_ulsch_stats:
statMsg += dlsch_ulsch_stats[key] + '\n' statMsg += dlsch_ulsch_stats[key] + '\n'
logging.debug(dlsch_ulsch_stats[key]) logging.debug(dlsch_ulsch_stats[key])
htmleNBFailureMsg += statMsg htmleNBFailureMsg += statMsg
#checker
if (len(dlsch_ulsch_stats)!=0) and (len(checkers)!=0):
if 'd_retx_th' in checkers:
checkers['d_retx_th'] = [float(x) for x in checkers['d_retx_th'].split(',')]
dlsch_checker_status = list(0 for i in checkers['d_retx_th'])#status 0 / -1
d_perc_retx = list(0 for i in checkers['d_retx_th'])#results in %
if 'u_retx_th' in checkers:
checkers['u_retx_th'] = [float(x) for x in checkers['u_retx_th'].split(',')]
ulsch_checker_status = list(0 for i in checkers['u_retx_th'])
u_perc_retx = list(0 for i in checkers['u_retx_th'])
#ul and dl retransmissions checkers
#NOTICE: DL and UL regex are different
if ('dlsch_rounds' in dlsch_ulsch_stats) and ('d_retx_th' in checkers):
tmp=re.match(r'^.*dlsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+dlsch_errors\s+(\d+)',dlsch_ulsch_stats['dlsch_rounds'])
if tmp is not None :
#captures the different groups from the regex
retx_data=[float(x) for x in tmp.groups()]
for i in range(0,len(d_perc_retx)):
#case where numerator > denumerator with denum ==0 is disregarded, cannot hapen in principle, will lead to 0%
d_perc_retx[i] = 0 if (retx_data[i] == 0) else 100*retx_data[i+1]/retx_data[i]
#treating % > 100 , % > requirement
if (d_perc_retx[i] > 100) or (d_perc_retx[i] > checkers['d_retx_th'][i]): dlsch_checker_status[i] = -1
if -1 in dlsch_checker_status:
DLRetxIssue = True
if ('ulsch_rounds' in dlsch_ulsch_stats) and ('u_retx_th' in checkers):
tmp=re.match(r'^.*ulsch_rounds\s+(\d+)\/(\d+)\/(\d+)\/(\d+),\s+.*,\s+ulsch_errors\s+(\d+)',dlsch_ulsch_stats['ulsch_rounds'])
if tmp is not None :
retx_data=[float(x) for x in tmp.groups()]
for i in range(0,len(d_perc_retx)):
u_perc_retx[i] = 0 if (retx_data[i] == 0) else 100*retx_data[i+1]/retx_data[i]
if (u_perc_retx[i] > 100) or (u_perc_retx[i] > checkers['u_retx_th'][i]): ulsch_checker_status[i] = -1
if -1 in ulsch_checker_status:
ULRetxIssue = True
#real time statistics #real time statistics
datalog_rt_stats['Data']={} datalog_rt_stats['Data']={}
if len(real_time_stats)!=0: #check if dictionary is not empty if len(real_time_stats)!=0: #check if dictionary is not empty
...@@ -1158,18 +1207,34 @@ class RANManagement(): ...@@ -1158,18 +1207,34 @@ class RANManagement():
htmlMsg = statMsg+'\n' htmlMsg = statMsg+'\n'
logging.debug(statMsg) logging.debug(statMsg)
htmleNBFailureMsg += htmlMsg htmleNBFailureMsg += htmlMsg
if len(nsa_markers['SgNBReleaseRequest'])!=0: if len(gnb_markers['SgNBReleaseRequest'])!=0:
statMsg = 'SgNBReleaseRequest = ' + str(len(nsa_markers['SgNBReleaseRequest'])) + ' occurences , starting line ' + str(nsa_markers['SgNBReleaseRequest'][0]) statMsg = 'SgNBReleaseRequest = ' + str(len(gnb_markers['SgNBReleaseRequest'])) + ' occurences , starting line ' + str(gnb_markers['SgNBReleaseRequest'][0])
else: else:
statMsg = 'SgNBReleaseRequest = ' + str(len(nsa_markers['SgNBReleaseRequest'])) + ' occurences' statMsg = 'SgNBReleaseRequest = ' + str(len(gnb_markers['SgNBReleaseRequest'])) + ' occurences'
htmlMsg = statMsg+'\n' htmlMsg = statMsg+'\n'
logging.debug(statMsg) logging.debug(statMsg)
htmleNBFailureMsg += htmlMsg htmleNBFailureMsg += htmlMsg
statMsg = 'scgFailureInformationNR-r15 = ' + str(len(nsa_markers['scgFailureInformationNR-r15'])) + ' occurences' statMsg = 'scgFailureInformationNR-r15 = ' + str(len(gnb_markers['scgFailureInformationNR-r15'])) + ' occurences'
htmlMsg = statMsg+'\n' htmlMsg = statMsg+'\n'
logging.debug(statMsg) logging.debug(statMsg)
htmleNBFailureMsg += htmlMsg htmleNBFailureMsg += htmlMsg
if DLRetxIssue:
retx_checker_status_str = ''
for status in dlsch_checker_status : retx_checker_status_str+=str(status)+ ' '
logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with too many retransmissions / errors issue in DL ! \u001B[0m')
logging.debug('\u001B[1;37;41m Status : ' + retx_checker_status_str + ' \u001B[0m')
htmleNBFailureMsg += 'Fail due to retransmissions / errors issue in DL, status : ' + retx_checker_status_str + '\n'
global_status = CONST.ENB_RETX_ISSUE
if ULRetxIssue:
retx_checker_status_str = ''
for status in ulsch_checker_status : retx_checker_status_str+=str(status)+ ' '
logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with too many retransmissions / errors issue in UL ! \u001B[0m')
logging.debug('\u001B[1;37;41m Status : ' + retx_checker_status_str + ' \u001B[0m')
htmleNBFailureMsg += 'Fail due to retransmissions / errors issue in UL, status : ' + retx_checker_status_str + '\n'
global_status = CONST.ENB_RETX_ISSUE
if RealTimeProcessingIssue: if RealTimeProcessingIssue:
logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with real time processing issue! \u001B[0m') logging.debug('\u001B[1;37;41m ' + nodeB_prefix + 'NB ended with real time processing issue! \u001B[0m')
htmleNBFailureMsg += 'Fail due to real time processing issue\n' htmleNBFailureMsg += 'Fail due to real time processing issue\n'
......
...@@ -756,7 +756,7 @@ function report_test { ...@@ -756,7 +756,7 @@ function report_test {
EPC_CONFIGS=("noS1") EPC_CONFIGS=("noS1")
TRANS_MODES=("tdd") TRANS_MODES=("tdd")
FR_MODE=("SA") FR_MODE=("SA")
BW_CASES=(106) BW_CASES=(106 24)
for CN_CONFIG in ${EPC_CONFIGS[@]} for CN_CONFIG in ${EPC_CONFIGS[@]}
do do
for TMODE in ${TRANS_MODES[@]} for TMODE in ${TRANS_MODES[@]}
......
...@@ -1401,8 +1401,11 @@ function start_rf_sim_nr_ue { ...@@ -1401,8 +1401,11 @@ function start_rf_sim_nr_ue {
elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option
then then
echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor,time --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1 echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor,time --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1
else #SA test => use --sa option elif [ $LOC_RA_SA_TEST -eq 2 ] #SA test 106PRB => use --sa option
then
echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1 echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1
else # -eq 3 SA test 24PRB
echo "echo \"./nr-uesoftmodem -r 24 -s 24 --numerology 1 --band 78 -C 3604320000 --rfsim --sa --log_config.global_log_options level,nocolor,time\" > ./my-nr-softmodem-run.sh " >> $1
fi fi
fi fi
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1 echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
...@@ -2270,7 +2273,7 @@ function run_test_on_vm { ...@@ -2270,7 +2273,7 @@ function run_test_on_vm {
mkdir --parents $ARCHIVES_LOC mkdir --parents $ARCHIVES_LOC
echo "############################################################" echo "############################################################"
echo "SA TEST" echo "SA TEST 106PRB"
echo "############################################################" echo "############################################################"
#SA test, attention : has a different config file from the rest of the test #SA test, attention : has a different config file from the rest of the test
CN_CONFIG="noS1" CN_CONFIG="noS1"
...@@ -2305,7 +2308,7 @@ function run_test_on_vm { ...@@ -2305,7 +2308,7 @@ function run_test_on_vm {
echo "${CN_CONFIG} : Starting the NR-UE" echo "${CN_CONFIG} : Starting the NR-UE"
echo "############################################################" echo "############################################################"
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log
#last argument = 2 is to enable --sa for SA test #last argument = 2 is to enable --sa for SA test for 106PRB
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 2 start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 2
if [ $NR_UE_SYNC -eq 0 ] if [ $NR_UE_SYNC -eq 0 ]
then then
...@@ -2340,9 +2343,94 @@ function run_test_on_vm { ...@@ -2340,9 +2343,94 @@ function run_test_on_vm {
echo "SA test NOT OK" echo "SA test NOT OK"
echo "try_cnt = " $try_cnt echo "try_cnt = " $try_cnt
try_cnt=$((try_cnt+1)) try_cnt=$((try_cnt+1))
SA_106PRB_STATUS = -1
else
echo "SA test OK"
try_cnt=$((try_cnt+10))
SA_106PRB_STATUS = 0
fi
done
########### end SA test
sleep 30
echo "############################################################"
echo "SA TEST 24PRB"
echo "############################################################"
#SA test, attention : has a different config file from the rest of the test
CN_CONFIG="noS1"
CONF_FILE=gnb.sa.band78.fr1.24PRB.usrpb210.conf
S1_NOS1_CFG=0
PRB=24
FREQUENCY=3600
if [ ! -d $ARCHIVES_LOC ]
then
mkdir --parents $ARCHIVES_LOC
fi
local try_cnt=0
######### start of SA TEST loop
while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI
do
SYNC_STATUS=0
SA_STATUS=0
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*sa_test.log
echo "############################################################"
echo "${CN_CONFIG} : Starting the gNB"
echo "############################################################"
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_sa_test.log
#last argument = 2 is to enable --sa for SA test
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 2
echo "############################################################"
echo "${CN_CONFIG} : Starting the NR-UE"
echo "############################################################"
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log
#last argument = 3 is to enable --sa for SA test for 24PRB
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 3
if [ $NR_UE_SYNC -eq 0 ]
then
echo "Problem w/ gNB and NR-UE not syncing"
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
SYNC_STATUS=-1
try_cnt=$((try_cnt+1))
continue
fi
echo "############################################################"
echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators"
echo "############################################################"
sleep 20
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
#check SA markers in gNB and NR UE log files
echo "############################################################"
echo "${CN_CONFIG} : Checking SA on gNB / NR-UE"
echo "############################################################"
# Proper check to be done when SA test is working!
check_sa_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE
if [ $SA_STATUS -ne 0 ]
then
echo "SA test NOT OK"
echo "try_cnt = " $try_cnt
try_cnt=$((try_cnt+1))
SA_24PRB_STATUS = -1
else else
echo "SA test OK" echo "SA test OK"
try_cnt=$((try_cnt+10)) try_cnt=$((try_cnt+10))
SA_24PRB_STATUS = 0
fi fi
done done
########### end SA test ########### end SA test
...@@ -2351,6 +2439,9 @@ function run_test_on_vm { ...@@ -2351,6 +2439,9 @@ function run_test_on_vm {
echo "############################################################" echo "############################################################"
echo "RA TEST FR2" echo "RA TEST FR2"
echo "############################################################" echo "############################################################"
...@@ -2661,7 +2752,8 @@ function run_test_on_vm { ...@@ -2661,7 +2752,8 @@ function run_test_on_vm {
echo "Checking run status" echo "Checking run status"
echo "############################################################" echo "############################################################"
if [ $SA_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $SA_106PRB_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $SA_24PRB_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $RA_FR2_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $RA_FR2_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $RA_FR1_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $RA_FR1_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi
......
...@@ -116,6 +116,8 @@ ...@@ -116,6 +116,8 @@
<class>UndeployGenObject</class> <class>UndeployGenObject</class>
<desc>Undeploy all OAI 5G stack</desc> <desc>Undeploy all OAI 5G stack</desc>
<yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path> <yaml_path>yaml_files/5g_f1_rfsimulator</yaml_path>
<d_retx_th>5,0,0,0</d_retx_th>
<u_retx_th>5,0,0,0</u_retx_th>
</testCase> </testCase>
</testCaseList> </testCaseList>
...@@ -111,6 +111,8 @@ ...@@ -111,6 +111,8 @@
<class>UndeployGenObject</class> <class>UndeployGenObject</class>
<desc>Undeploy all OAI 5G stack</desc> <desc>Undeploy all OAI 5G stack</desc>
<yaml_path>yaml_files/5g_fdd_rfsimulator</yaml_path> <yaml_path>yaml_files/5g_fdd_rfsimulator</yaml_path>
<d_retx_th>5,0,0,0</d_retx_th>
<u_retx_th>5,0,0,0</u_retx_th>
</testCase> </testCase>
</testCaseList> </testCaseList>
...@@ -109,6 +109,8 @@ ...@@ -109,6 +109,8 @@
<class>UndeployGenObject</class> <class>UndeployGenObject</class>
<desc>Undeploy all OAI 5G stack</desc> <desc>Undeploy all OAI 5G stack</desc>
<yaml_path>yaml_files/5g_rfsimulator</yaml_path> <yaml_path>yaml_files/5g_rfsimulator</yaml_path>
<d_retx_th>5,0,0,0</d_retx_th>
<u_retx_th>5,0,0,0</u_retx_th>
</testCase> </testCase>
</testCaseList> </testCaseList>
...@@ -92,6 +92,5 @@ uint8_t get_l0(uint16_t dlDmrsSymbPos) { ...@@ -92,6 +92,5 @@ uint8_t get_l0(uint16_t dlDmrsSymbPos) {
if ((mask&1) == 1) break; if ((mask&1) == 1) break;
mask>>=1; mask>>=1;
} }
AssertFatal(l0 < 4,"impossible l0 %d, dlDmrsSymbPos %x\n", l0, dlDmrsSymbPos);
return (l0); return (l0);
} }
...@@ -130,76 +130,75 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr, ...@@ -130,76 +130,75 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
*/ */
int c = 0, r = 0; int c = 0, r = 0;
uint16_t bundle_j = 0, f_bundle_j = 0, f_reg = 0; uint16_t f_bundle_j = 0;
uint32_t coreset_C = 0; uint32_t coreset_C = 0;
uint16_t index_z, index_llr; uint16_t index_z, index_llr;
int coreset_interleaved = 0; int coreset_interleaved = 0;
int N_regs = coreset_nbr_rb*coreset_time_dur;
if (reg_bundle_size_L != 0) { // interleaving will be done only if reg_bundle_size_L != 0 if (reg_bundle_size_L != 0) { // interleaving will be done only if reg_bundle_size_L != 0
coreset_interleaved = 1; coreset_interleaved = 1;
coreset_C = (uint32_t) (coreset_nbr_rb / (coreset_interleaver_size_R * reg_bundle_size_L)); coreset_C = (uint32_t) (N_regs / (coreset_interleaver_size_R * reg_bundle_size_L));
} else { } else {
reg_bundle_size_L = 6; reg_bundle_size_L = 6;
} }
int B_rb = reg_bundle_size_L/coreset_time_dur; // nb of RBs occupied by each REG bundle
int num_bundles_per_cce = 6/reg_bundle_size_L;
int max_bundles = NR_MAX_PDCCH_AGG_LEVEL*num_bundles_per_cce;
int f_bundle_j_list[max_bundles];
int f_bundle_j_list[(2*NR_MAX_PDCCH_AGG_LEVEL) - 1] = {}; // for each bundle
for (int nb = 0; nb < max_bundles; nb++) {
for (int reg = 0; reg < coreset_nbr_rb; reg++) { if (coreset_interleaved == 0) f_bundle_j = nb;
if ((reg % reg_bundle_size_L) == 0) { else {
if (r == coreset_interleaver_size_R) { if (r == coreset_interleaver_size_R) {
r = 0; r = 0;
c++; c++;
} }
f_bundle_j = ((r * coreset_C) + c + n_shift) % (N_regs / reg_bundle_size_L);
bundle_j = (c * coreset_interleaver_size_R) + r; r++;
f_bundle_j = ((r * coreset_C) + c + n_shift) % (coreset_nbr_rb / reg_bundle_size_L);
if (coreset_interleaved == 0) f_bundle_j = bundle_j;
f_bundle_j_list[reg / 6] = f_bundle_j;
} }
if ((reg % reg_bundle_size_L) == 0) r++; f_bundle_j_list[nb] = f_bundle_j;
} }
// Get cce_list indices by reg_idx in ascending order // Get cce_list indices by bundle index in ascending order
int f_bundle_j_list_id = 0; int f_bundle_j_list_ord[number_of_candidates][max_bundles];
int f_bundle_j_list_ord[(2*NR_MAX_PDCCH_AGG_LEVEL)-1] = {};
for (int c_id = 0; c_id < number_of_candidates; c_id++ ) { for (int c_id = 0; c_id < number_of_candidates; c_id++ ) {
f_bundle_j_list_id = CCE[c_id]; int start_bund_cand = CCE[c_id]*num_bundles_per_cce;
for (int p = 0; p < NR_MAX_PDCCH_AGG_LEVEL; p++) { int max_bund_per_cand = L[c_id]*num_bundles_per_cce;
for (int p2 = CCE[c_id]; p2 < CCE[c_id] + L[c_id]; p2++) { int f_bundle_j_list_id = 0;
AssertFatal(p2<2*NR_MAX_PDCCH_AGG_LEVEL,"number_of_candidates %d : p2 %d, CCE[%d] %d, L[%d] %d\n",number_of_candidates,p2,c_id,CCE[c_id],c_id,L[c_id]); for(int nb = 0; nb < max_bundles; nb++) {
if (f_bundle_j_list[p2] == p) { for(int bund_cand = start_bund_cand; bund_cand < start_bund_cand+max_bund_per_cand; bund_cand++){
AssertFatal(f_bundle_j_list_id < 2*NR_MAX_PDCCH_AGG_LEVEL,"f_bundle_j_list_id %d\n",f_bundle_j_list_id); if (f_bundle_j_list[bund_cand] == nb) {
f_bundle_j_list_ord[f_bundle_j_list_id] = p; f_bundle_j_list_ord[c_id][f_bundle_j_list_id] = nb;
f_bundle_j_list_id++; f_bundle_j_list_id++;
break;
} }
} }
} }
} }
int rb = 0; int rb_count = 0;
int data_sc = 9; // 9 sub-carriers with data per PRB
for (int c_id = 0; c_id < number_of_candidates; c_id++ ) { for (int c_id = 0; c_id < number_of_candidates; c_id++ ) {
for (int symbol_idx = start_symbol; symbol_idx < start_symbol+coreset_time_dur; symbol_idx++) { for (int symbol_idx = start_symbol; symbol_idx < start_symbol+coreset_time_dur; symbol_idx++) {
for (int cce_count = CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur; cce_count < CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur+L[c_id]; cce_count += coreset_time_dur) { for (int cce_count = 0; cce_count < L[c_id]; cce_count ++) {
for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) { for (int k=0; k<NR_NB_REG_PER_CCE/reg_bundle_size_L; k++) { // loop over REG bundles
int f = f_bundle_j_list_ord[c_id][k+NR_NB_REG_PER_CCE*cce_count/reg_bundle_size_L];
f_reg = (f_bundle_j_list_ord[cce_count] * reg_bundle_size_L) + reg_in_cce_idx; for(int rb=0; rb<B_rb; rb++) { // loop over the RBs of the bundle
index_z = 9 * rb; index_z = data_sc * rb_count;
index_llr = (uint16_t) (f_reg + symbol_idx * coreset_nbr_rb) * 9; index_llr = (uint16_t) (f*B_rb + rb + symbol_idx * coreset_nbr_rb) * data_sc;
for (int i = 0; i < data_sc; i++) {
for (int i = 0; i < 9; i++) { z[index_z + i] = llr[index_llr + i];
z[index_z + i] = llr[index_llr + i];
#ifdef NR_PDCCH_DCI_DEBUG #ifdef NR_PDCCH_DCI_DEBUG
LOG_I(PHY,"[cce_count=%d,reg_in_cce_idx=%d,bundle_j=%d,symbol_idx=%d,candidate=%d] z[%d]=(%d,%d) <-> \t[f_reg=%d,fbundle_j=%d] llr[%d]=(%d,%d) \n", LOG_I(PHY,"[candidate=%d,symbol_idx=%d,cce=%d,REG bundle=%d,PRB=%d] z[%d]=(%d,%d) <-> \t llr[%d]=(%d,%d) \n",
cce_count,reg_in_cce_idx,bundle_j,symbol_idx,c_id,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]), c_id,symbol_idx,cce_count,k,f*B_rb + rb,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]),
f_reg,f_bundle_j,(index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i])); (index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i]));
#endif #endif
}
rb_count++;
} }
rb++;
} }
} }
} }
...@@ -783,15 +782,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue, ...@@ -783,15 +782,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
rel15->number_of_candidates, rel15->number_of_candidates,
rel15->CCE, rel15->CCE,
rel15->L); rel15->L);
/*
nr_pdcch_unscrambling(rel15->rnti,
frame_parms,
slot,
pdcch_vars->e_rx,
rel15->coreset.duration*n_rb*9*2,
// get_nCCE(n_pdcch_symbols, frame_parms, mi) * 72,
rel15->coreset.pdcch_dmrs_scrambling_id);
*/
LOG_D(PHY,"we end nr_pdcch_unscrambling()\n"); LOG_D(PHY,"we end nr_pdcch_unscrambling()\n");
LOG_D(PHY,"Ending nr_rx_pdcch() function\n"); LOG_D(PHY,"Ending nr_rx_pdcch() function\n");
...@@ -870,6 +861,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, ...@@ -870,6 +861,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
//int gNB_id = 0; //int gNB_id = 0;
int16_t tmp_e[16*108]; int16_t tmp_e[16*108];
rnti_t n_rnti; rnti_t n_rnti;
int e_rx_cand_idx = 0;
for (int j=0;j<rel15->number_of_candidates;j++) { for (int j=0;j<rel15->number_of_candidates;j++) {
int CCEind = rel15->CCE[j]; int CCEind = rel15->CCE[j];
...@@ -892,13 +884,13 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, ...@@ -892,13 +884,13 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
uint64_t dci_estimation[2]= {0}; uint64_t dci_estimation[2]= {0};
LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n",
j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]); j, rel15->number_of_candidates, CCEind, e_rx_cand_idx, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]);
nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e); nr_pdcch_unscrambling(&pdcch_vars->e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
uint32_t * z = (uint32_t *) &pdcch_vars->e_rx[CCEind*108]; uint32_t *z = (uint32_t *) &pdcch_vars->e_rx[e_rx_cand_idx];
for (int index_z = 0; index_z < 96; index_z++){ for (int index_z = 0; index_z < L*6; index_z++){
for (int i=0; i<9; i++) { for (int i=0; i<9; i++) {
LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i])); LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]));
} }
...@@ -937,6 +929,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue, ...@@ -937,6 +929,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
LOG_D(PHY,"(%i.%i) Decoded crc %x does not match rnti %x for DCI format %d\n", proc->frame_rx, proc->nr_slot_rx, crc, n_rnti, rel15->dci_format_options[k]); LOG_D(PHY,"(%i.%i) Decoded crc %x does not match rnti %x for DCI format %d\n", proc->frame_rx, proc->nr_slot_rx, crc, n_rnti, rel15->dci_format_options[k]);
} }
} }
e_rx_cand_idx += 9*L*6*2; //e_rx index for next candidate (L CCEs, 6 REGs per CCE and 9 REs per REG and 2 uint16_t per RE)
} }
pdcch_vars->nb_search_space = 0; pdcch_vars->nb_search_space = 0;
return(dci_ind->number_of_dcis); return(dci_ind->number_of_dcis);
......
...@@ -228,43 +228,43 @@ void configure_dlsch(NR_UE_DLSCH_t *dlsch0, ...@@ -228,43 +228,43 @@ void configure_dlsch(NR_UE_DLSCH_t *dlsch0,
LOG_D(PHY,"current_harq_pid = %d\n", current_harq_pid); LOG_D(PHY,"current_harq_pid = %d\n", current_harq_pid);
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid]; NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid];
if (dlsch0_harq){ AssertFatal(dlsch0_harq, "no harq_process for HARQ PID %d\n", current_harq_pid);
dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart;
dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize; dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart;
dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs; dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize;
dlsch0_harq->start_rb = dlsch_config_pdu->start_rb; dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs;
dlsch0_harq->nb_symbols = dlsch_config_pdu->number_symbols; dlsch0_harq->start_rb = dlsch_config_pdu->start_rb;
dlsch0_harq->start_symbol = dlsch_config_pdu->start_symbol; dlsch0_harq->nb_symbols = dlsch_config_pdu->number_symbols;
dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos; dlsch0_harq->start_symbol = dlsch_config_pdu->start_symbol;
dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType; dlsch0_harq->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos;
dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups; dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType;
dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports; dlsch0_harq->n_dmrs_cdm_groups = dlsch_config_pdu->n_dmrs_cdm_groups;
dlsch0_harq->mcs = dlsch_config_pdu->mcs; dlsch0_harq->dmrs_ports = dlsch_config_pdu->dmrs_ports;
dlsch0_harq->rvidx = dlsch_config_pdu->rv; dlsch0_harq->mcs = dlsch_config_pdu->mcs;
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH; dlsch0_harq->rvidx = dlsch_config_pdu->rv;
//get nrOfLayers from DCI info dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
uint8_t Nl = 0; //get nrOfLayers from DCI info
for (int i = 0; i < 12; i++) { // max 12 ports uint8_t Nl = 0;
if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1; for (int i = 0; i < 12; i++) { // max 12 ports
} if ((dlsch_config_pdu->dmrs_ports>>i)&0x01) Nl += 1;
dlsch0_harq->Nl = Nl; }
dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table; dlsch0_harq->Nl = Nl;
downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type); dlsch0_harq->mcs_table=dlsch_config_pdu->mcs_table;
if (dlsch0_harq->status != ACTIVE) { downlink_harq_process(dlsch0_harq, dlsch0->current_harq_pid, dlsch_config_pdu->ndi, dlsch_config_pdu->rv, dlsch0->rnti_type);
// dlsch0_harq->status not ACTIVE may be due to false retransmission. if (dlsch0_harq->status != ACTIVE) {
// Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status. // dlsch0_harq->status not ACTIVE due to false retransmission
dlsch0->active = 0; // Reset the following flag to skip PDSCH procedures in that case and retrasmit harq status
update_harq_status(module_id,dlsch0->current_harq_pid,dlsch0_harq->ack); dlsch0->active = 0;
} update_harq_status(module_id,dlsch0->current_harq_pid,dlsch0_harq->ack);
/* PTRS */
dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity;
dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity;
dlsch0_harq->PTRSPortIndex = dlsch_config_pdu->PTRSPortIndex;
dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS;
dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset;
dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap;
LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs);
} }
/* PTRS */
dlsch0_harq->PTRSFreqDensity = dlsch_config_pdu->PTRSFreqDensity;
dlsch0_harq->PTRSTimeDensity = dlsch_config_pdu->PTRSTimeDensity;
dlsch0_harq->PTRSPortIndex = dlsch_config_pdu->PTRSPortIndex;
dlsch0_harq->nEpreRatioOfPDSCHToPTRS = dlsch_config_pdu->nEpreRatioOfPDSCHToPTRS;
dlsch0_harq->PTRSReOffset = dlsch_config_pdu->PTRSReOffset;
dlsch0_harq->pduBitmap = dlsch_config_pdu->pduBitmap;
LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs);
} }
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
......
...@@ -611,7 +611,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_ ...@@ -611,7 +611,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_
dual_stream_UE = 0; dual_stream_UE = 0;
gNB_id_i = gNB_id+1; gNB_id_i = gNB_id+1;
i_mod = 0; i_mod = 0;
if (( m==first_symbol_with_data ) && (m<4)) if (m==first_symbol_with_data)
first_symbol_flag = 1; first_symbol_flag = 1;
else else
first_symbol_flag = 0; first_symbol_flag = 0;
......
...@@ -353,9 +353,18 @@ typedef struct pdusession_tobeswitched_s { ...@@ -353,9 +353,18 @@ typedef struct pdusession_tobeswitched_s {
uint32_t gtp_teid; uint32_t gtp_teid;
} pdusession_tobeswitched_t; } pdusession_tobeswitched_t;
typedef struct qos_flow_tobe_modified_s {
uint8_t qfi; // 0~63
} qos_flow_tobe_modified_t;
typedef struct pdusession_modify_s { typedef struct pdusession_modify_s {
/* Unique pdusession_id for the UE. */ /* Unique pdusession_id for the UE. */
uint8_t pdusession_id; uint8_t pdusession_id;
uint8_t nb_of_qos_flow;
// qos_flow_add_or_modify
qos_flow_tobe_modified_t qos[QOSFLOW_MAX_VALUE];
} pdusession_modify_t; } pdusession_modify_t;
typedef enum ngap_Cause_e { typedef enum ngap_Cause_e {
...@@ -821,7 +830,7 @@ typedef struct ngap_pdusession_modify_req_s { ...@@ -821,7 +830,7 @@ typedef struct ngap_pdusession_modify_req_s {
/* Number of pdusession to be modify in the list */ /* Number of pdusession to be modify in the list */
uint8_t nb_pdusessions_tomodify; uint8_t nb_pdusessions_tomodify;
/* E RAB modify request */ /* pdu session modify request */
pdusession_t pdusession_modify_params[NGAP_MAX_PDUSESSION]; pdusession_t pdusession_modify_params[NGAP_MAX_PDUSESSION];
} ngap_pdusession_modify_req_t; } ngap_pdusession_modify_req_t;
......
...@@ -315,21 +315,21 @@ void get_info_from_tda_tables(int default_abc, ...@@ -315,21 +315,21 @@ void get_info_from_tda_tables(int default_abc,
int tda, int tda,
int dmrs_TypeA_Position, int dmrs_TypeA_Position,
int normal_CP, int normal_CP,
bool *is_mapping_typeA,
int *startSymbolIndex, int *startSymbolIndex,
int *nrOfSymbols) { int *nrOfSymbols) {
int k0 = 0; int k0 = 0;
int is_mapping_typeA = 1;
switch(default_abc){ switch(default_abc){
case 1: case 1:
if (normal_CP){ if (normal_CP){
if (dmrs_TypeA_Position){ if (dmrs_TypeA_Position){
is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][0]; *is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][0];
k0 = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][1]; k0 = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][1];
*startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][2]; *startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][2];
*nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][3]; *nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos3[tda][3];
} }
else{ else{
is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][0]; *is_mapping_typeA = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][0];
k0 = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][1]; k0 = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][1];
*startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][2]; *startSymbolIndex = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][2];
*nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][3]; *nrOfSymbols = table_5_1_2_1_1_2_time_dom_res_alloc_A_dmrs_typeA_pos2[tda][3];
...@@ -337,13 +337,13 @@ void get_info_from_tda_tables(int default_abc, ...@@ -337,13 +337,13 @@ void get_info_from_tda_tables(int default_abc,
} }
else{ else{
if (dmrs_TypeA_Position){ if (dmrs_TypeA_Position){
is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][0]; *is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][0];
k0 = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][1]; k0 = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][1];
*startSymbolIndex = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][2]; *startSymbolIndex = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][2];
*nrOfSymbols = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][3]; *nrOfSymbols = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos3[tda][3];
} }
else{ else{
is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][0]; *is_mapping_typeA = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][0];
k0 = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][1]; k0 = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][1];
*startSymbolIndex = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][2]; *startSymbolIndex = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][2];
*nrOfSymbols = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][3]; *nrOfSymbols = table_5_1_2_1_1_3_time_dom_res_alloc_A_extCP_dmrs_typeA_pos2[tda][3];
...@@ -352,13 +352,13 @@ void get_info_from_tda_tables(int default_abc, ...@@ -352,13 +352,13 @@ void get_info_from_tda_tables(int default_abc,
break; break;
case 2: case 2:
if (dmrs_TypeA_Position){ if (dmrs_TypeA_Position){
is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][0]; *is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][0];
k0 = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][1]; k0 = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][1];
*startSymbolIndex = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][2]; *startSymbolIndex = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][2];
*nrOfSymbols = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][3]; *nrOfSymbols = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos3[tda][3];
} }
else{ else{
is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][0]; *is_mapping_typeA = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][0];
k0 = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][1]; k0 = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][1];
*startSymbolIndex = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][2]; *startSymbolIndex = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][2];
*nrOfSymbols = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][3]; *nrOfSymbols = table_5_1_2_1_1_4_time_dom_res_alloc_B_dmrs_typeA_pos2[tda][3];
...@@ -366,13 +366,13 @@ void get_info_from_tda_tables(int default_abc, ...@@ -366,13 +366,13 @@ void get_info_from_tda_tables(int default_abc,
break; break;
case 3: case 3:
if (dmrs_TypeA_Position){ if (dmrs_TypeA_Position){
is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][0]; *is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][0];
k0 = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][1]; k0 = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][1];
*startSymbolIndex = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][2]; *startSymbolIndex = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][2];
*nrOfSymbols = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][3]; *nrOfSymbols = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos3[tda][3];
} }
else{ else{
is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][0]; *is_mapping_typeA = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][0];
k0 = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][1]; k0 = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][1];
*startSymbolIndex = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][2]; *startSymbolIndex = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][2];
*nrOfSymbols = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][3]; *nrOfSymbols = table_5_1_2_1_1_5_time_dom_res_alloc_C_dmrs_typeA_pos2[tda][3];
...@@ -382,7 +382,6 @@ void get_info_from_tda_tables(int default_abc, ...@@ -382,7 +382,6 @@ void get_info_from_tda_tables(int default_abc,
AssertFatal(1==0,"Invalid default time domaing allocation type\n"); AssertFatal(1==0,"Invalid default time domaing allocation type\n");
} }
AssertFatal(k0==0,"Only k0 = 0 is supported\n"); AssertFatal(k0==0,"Only k0 = 0 is supported\n");
AssertFatal(is_mapping_typeA==1,"Only mapping type A is currently supported\n");
} }
const char *prachfmt[]={"0","1","2","3", "A1","A2","A3","B1","B4","C0","C2","A1/B1","A2/B2","A3/B3"}; const char *prachfmt[]={"0","1","2","3", "A1","A2","A3","B1","B4","C0","C2","A1/B1","A2/B2","A3/B3"};
...@@ -2721,6 +2720,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, ...@@ -2721,6 +2720,7 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
LOG_D(NR_MAC,"DAI1 nbits %d\n",dci_pdu->dai[0].nbits); LOG_D(NR_MAC,"DAI1 nbits %d\n",dci_pdu->dai[0].nbits);
// 2nd DAI // 2nd DAI
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig && if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig &&
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup &&
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { //TODO not sure about that cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { //TODO not sure about that
dci_pdu->dai[1].nbits = 2; dci_pdu->dai[1].nbits = 2;
size += dci_pdu->dai[1].nbits; size += dci_pdu->dai[1].nbits;
...@@ -2991,7 +2991,8 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP, ...@@ -2991,7 +2991,8 @@ uint16_t nr_dci_size(const NR_BWP_DownlinkCommon_t *initialDownlinkBWP,
dci_pdu->srs_request.nbits = 3; dci_pdu->srs_request.nbits = 3;
size += dci_pdu->srs_request.nbits; size += dci_pdu->srs_request.nbits;
// CBGTI // CBGTI
if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig&& if (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig &&
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup &&
cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) { cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission != NULL) {
uint8_t maxCBGperTB = (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock + 1) * 2; uint8_t maxCBGperTB = (cg->spCellConfig->spCellConfigDedicated->pdsch_ServingCellConfig->choice.setup->codeBlockGroupTransmission->choice.setup->maxCodeBlockGroupsPerTransportBlock + 1) * 2;
long *maxCWperDCI_rrc = pdsch_Config->maxNrofCodeWordsScheduledByDCI; long *maxCWperDCI_rrc = pdsch_Config->maxNrofCodeWordsScheduledByDCI;
......
...@@ -140,6 +140,7 @@ void get_info_from_tda_tables(int default_abc, ...@@ -140,6 +140,7 @@ void get_info_from_tda_tables(int default_abc,
int tda, int tda,
int dmrs_TypeA_Position, int dmrs_TypeA_Position,
int normal_CP, int normal_CP,
bool *is_mapping_typeA,
int *startSymbolIndex, int *startSymbolIndex,
int *nrOfSymbols); int *nrOfSymbols);
......
...@@ -272,6 +272,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac, ...@@ -272,6 +272,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList, NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList,
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
int *mappingtype,
uint8_t time_domain_ind, uint8_t time_domain_ind,
int default_abc, int default_abc,
bool use_default); bool use_default);
......
...@@ -470,6 +470,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac, ...@@ -470,6 +470,7 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList, NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList,
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu, nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu, fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
int *mapping_type,
uint8_t time_domain_ind, uint8_t time_domain_ind,
int default_abc, int default_abc,
bool use_default){ bool use_default){
...@@ -547,13 +548,15 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac, ...@@ -547,13 +548,15 @@ int8_t nr_ue_process_dci_time_dom_resource_assignment(NR_UE_MAC_INST_t *mac,
} }
else {// Default configuration from tables else {// Default configuration from tables
bool is_typeA;
get_info_from_tda_tables(default_abc, get_info_from_tda_tables(default_abc,
time_domain_ind, time_domain_ind,
dmrs_typeA_pos, dmrs_typeA_pos,
1, // normal CP 1, // normal CP
&is_typeA,
&sliv_S, &sliv_S,
&sliv_L); &sliv_L);
*mapping_type = is_typeA? typeA : typeB;
dlsch_config_pdu->number_symbols = sliv_L; dlsch_config_pdu->number_symbols = sliv_L;
dlsch_config_pdu->start_symbol = sliv_S; dlsch_config_pdu->start_symbol = sliv_S;
} }
...@@ -859,12 +862,17 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr ...@@ -859,12 +862,17 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup) else if (mac->scc_SIB && mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup)
pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; pdsch_TimeDomainAllocationList = mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
int mappingtype;
/* TIME_DOM_RESOURCE_ASSIGNMENT */ /* TIME_DOM_RESOURCE_ASSIGNMENT */
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,NULL,dlsch_config_pdu_1_0,dci->time_domain_assignment.val,default_abc,rnti==SI_RNTI) < 0) { if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,
NULL,dlsch_config_pdu_1_0,&mappingtype,
dci->time_domain_assignment.val,
default_abc,rnti==SI_RNTI) < 0) {
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot); LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
return -1; return -1;
} }
int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_0->start_symbol <= 3)? typeA: typeB); if(pdsch_TimeDomainAllocationList && rnti!=SI_RNTI)
mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType;
/* dmrs symbol positions*/ /* dmrs symbol positions*/
dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config, dlsch_config_pdu_1_0->dlDmrsSymbPos = fill_dmrs_mask(pdsch_config,
...@@ -1056,13 +1064,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr ...@@ -1056,13 +1064,16 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
return -1; return -1;
} }
/* TIME_DOM_RESOURCE_ASSIGNMENT */ /* TIME_DOM_RESOURCE_ASSIGNMENT */
int mappingtype;
NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = choose_dl_tda_list(pdsch_Config,bwpc->pdsch_ConfigCommon->choice.setup); NR_PDSCH_TimeDomainResourceAllocationList_t *pdsch_TimeDomainAllocationList = choose_dl_tda_list(pdsch_Config,bwpc->pdsch_ConfigCommon->choice.setup);
if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,NULL,dlsch_config_pdu_1_1,dci->time_domain_assignment.val,0,false) < 0) { if (nr_ue_process_dci_time_dom_resource_assignment(mac,NULL,pdsch_TimeDomainAllocationList,
NULL,dlsch_config_pdu_1_1,&mappingtype,
dci->time_domain_assignment.val,0,false) < 0) {
LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot); LOG_W(MAC, "[%d.%d] Invalid time_domain_assignment. Possibly due to false DCI. Ignoring DCI!\n", frame, slot);
return -1; return -1;
} }
if(pdsch_TimeDomainAllocationList)
int mappingtype = pdsch_TimeDomainAllocationList ? pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->mappingType : ((dlsch_config_pdu_1_1->start_symbol <= 3)? typeA: typeB); mappingtype = pdsch_TimeDomainAllocationList->list.array[dci->time_domain_assignment.val]->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; dlsch_config_pdu_1_1->dmrsConfigType = pdsch_Config->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type == NULL ? NFAPI_NR_DMRS_TYPE1 : NFAPI_NR_DMRS_TYPE2;
......
...@@ -768,7 +768,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac, ...@@ -768,7 +768,7 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
return -1; return -1;
} }
/* TIME_DOM_RESOURCE_ASSIGNMENT */ /* TIME_DOM_RESOURCE_ASSIGNMENT */
if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_TimeDomainAllocationList, NULL, pusch_config_pdu, NULL, dci->time_domain_assignment.val,0,false) < 0) { if (nr_ue_process_dci_time_dom_resource_assignment(mac, pusch_TimeDomainAllocationList, NULL, pusch_config_pdu, NULL, NULL, dci->time_domain_assignment.val,0,false) < 0) {
return -1; return -1;
} }
...@@ -2340,213 +2340,211 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in ...@@ -2340,213 +2340,211 @@ void nr_ue_pucch_scheduler(module_id_t module_idP, frame_t frameP, int slotP, in
void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) { void nr_schedule_csi_for_im(NR_UE_MAC_INST_t *mac, int frame, int slot) {
if (mac->ra.ra_state == RA_SUCCEEDED || if (mac->ra.ra_state != RA_SUCCEEDED && get_softmodem_params()->phy_test == 0)
get_softmodem_params()->phy_test == 1) { return;
NR_CellGroupConfig_t *CellGroup = mac->cg; NR_CellGroupConfig_t *CellGroup = mac->cg;
if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated ||
!CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig)
return; return;
NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
if (csi_measconfig->csi_IM_ResourceToAddModList == NULL) if (csi_measconfig->csi_IM_ResourceToAddModList == NULL)
return; return;
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request;
NR_CSI_IM_Resource_t *imcsi; NR_CSI_IM_Resource_t *imcsi;
int period, offset; int period, offset;
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = NULL;
if(dl_bwp_id > 0 && mac->DLbwp[dl_bwp_id-1]) { if(dl_bwp_id > 0 && mac->DLbwp[dl_bwp_id-1]) {
genericParameters = &mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters; genericParameters = &mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters;
} else { } else {
genericParameters = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters; genericParameters = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
} }
int mu = genericParameters->subcarrierSpacing; int mu = genericParameters->subcarrierSpacing;
uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
for (int id = 0; id < csi_measconfig->csi_IM_ResourceToAddModList->list.count; id++){ for (int id = 0; id < csi_measconfig->csi_IM_ResourceToAddModList->list.count; id++){
imcsi = csi_measconfig->csi_IM_ResourceToAddModList->list.array[id]; imcsi = csi_measconfig->csi_IM_ResourceToAddModList->list.array[id];
csi_period_offset(NULL,imcsi->periodicityAndOffset,&period,&offset); csi_period_offset(NULL,imcsi->periodicityAndOffset,&period,&offset);
if((frame*nr_slots_per_frame[mu]+slot-offset)%period == 0) { if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0)
fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csiim_config_pdu.csiim_config_rel15; continue;
csiim_config_pdu->bwp_size = bwp_size; fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csiim_config_pdu.csiim_config_rel15;
csiim_config_pdu->bwp_start = bwp_start; csiim_config_pdu->bwp_size = bwp_size;
csiim_config_pdu->subcarrier_spacing = mu; csiim_config_pdu->bwp_start = bwp_start;
csiim_config_pdu->start_rb = imcsi->freqBand->startingRB; csiim_config_pdu->subcarrier_spacing = mu;
csiim_config_pdu->nr_of_rbs = imcsi->freqBand->nrofRBs; csiim_config_pdu->start_rb = imcsi->freqBand->startingRB;
// As specified in 5.2.2.4 of 38.214 csiim_config_pdu->nr_of_rbs = imcsi->freqBand->nrofRBs;
switch (imcsi->csi_IM_ResourceElementPattern->present) { // As specified in 5.2.2.4 of 38.214
case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0: switch (imcsi->csi_IM_ResourceElementPattern->present) {
for (int i = 0; i<4; i++) { case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern0:
csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern0->subcarrierLocation_p0<<1) + (i>>1); for (int i = 0; i<4; i++) {
csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern0->symbolLocation_p0 + (i%2); csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern0->subcarrierLocation_p0<<1) + (i>>1);
} csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern0->symbolLocation_p0 + (i%2);
break;
case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1:
for (int i = 0; i<4; i++) {
csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1<<2) + i;
csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1;
}
break;
default:
AssertFatal(1==0, "Invalid CSI-IM pattern\n");
} }
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_IM; break;
dl_config->number_pdus += 1; case NR_CSI_IM_Resource__csi_IM_ResourceElementPattern_PR_pattern1:
} for (int i = 0; i<4; i++) {
csiim_config_pdu->k_csiim[i] = (imcsi->csi_IM_ResourceElementPattern->choice.pattern1->subcarrierLocation_p1<<2) + i;
csiim_config_pdu->l_csiim[i] = imcsi->csi_IM_ResourceElementPattern->choice.pattern1->symbolLocation_p1;
}
break;
default:
AssertFatal(1==0, "Invalid CSI-IM pattern\n");
} }
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_IM;
dl_config->number_pdus += 1;
} }
} }
void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) { void nr_schedule_csirs_reception(NR_UE_MAC_INST_t *mac, int frame, int slot) {
if (mac->ra.ra_state == RA_SUCCEEDED || if (mac->ra.ra_state != RA_SUCCEEDED && get_softmodem_params()->phy_test == 0)
get_softmodem_params()->phy_test == 1) { return;
NR_CellGroupConfig_t *CellGroup = mac->cg; NR_CellGroupConfig_t *CellGroup = mac->cg;
if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated || if (!CellGroup || !CellGroup->spCellConfig || !CellGroup->spCellConfig->spCellConfigDedicated ||
!CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig) !CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig)
return; return;
NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup; NR_CSI_MeasConfig_t *csi_measconfig = CellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList == NULL) if (csi_measconfig->nzp_CSI_RS_ResourceToAddModList == NULL)
return; return;
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request;
NR_NZP_CSI_RS_Resource_t *nzpcsi; NR_NZP_CSI_RS_Resource_t *nzpcsi;
int period, offset; int period, offset;
NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id; NR_BWP_Id_t dl_bwp_id = mac->DL_BWP_Id;
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = NULL;
if(dl_bwp_id > 0 && mac->DLbwp[dl_bwp_id-1]) { if(dl_bwp_id > 0 && mac->DLbwp[dl_bwp_id-1]) {
genericParameters = &mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters; genericParameters = &mac->DLbwp[dl_bwp_id-1]->bwp_Common->genericParameters;
} else { } else {
genericParameters = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters; genericParameters = &mac->scc_SIB->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
} }
int mu = genericParameters->subcarrierSpacing; int mu = genericParameters->subcarrierSpacing;
uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); uint16_t bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); uint16_t bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){ for (int id = 0; id < csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.count; id++){
nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id]; nzpcsi = csi_measconfig->nzp_CSI_RS_ResourceToAddModList->list.array[id];
csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset); csi_period_offset(NULL,nzpcsi->periodicityAndOffset,&period,&offset);
if((frame*nr_slots_per_frame[mu]+slot-offset)%period == 0) { if((frame*nr_slots_per_frame[mu]+slot-offset)%period != 0)
LOG_D(MAC,"Scheduling reception of CSI-RS in frame %d slot %d\n",frame,slot); continue;
fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csirs_config_pdu.csirs_config_rel15; LOG_D(MAC,"Scheduling reception of CSI-RS in frame %d slot %d\n",frame,slot);
NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping; fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu = &dl_config->dl_config_list[dl_config->number_pdus].csirs_config_pdu.csirs_config_rel15;
csirs_config_pdu->bwp_size = bwp_size; NR_CSI_RS_ResourceMapping_t resourceMapping = nzpcsi->resourceMapping;
csirs_config_pdu->bwp_start = bwp_start; csirs_config_pdu->bwp_size = bwp_size;
csirs_config_pdu->subcarrier_spacing = mu; csirs_config_pdu->bwp_start = bwp_start;
csirs_config_pdu->cyclic_prefix = genericParameters->cyclicPrefix ? *genericParameters->cyclicPrefix : 0; csirs_config_pdu->subcarrier_spacing = mu;
csirs_config_pdu->start_rb = resourceMapping.freqBand.startingRB; csirs_config_pdu->cyclic_prefix = genericParameters->cyclicPrefix ? *genericParameters->cyclicPrefix : 0;
csirs_config_pdu->nr_of_rbs = resourceMapping.freqBand.nrofRBs; csirs_config_pdu->start_rb = resourceMapping.freqBand.startingRB;
csirs_config_pdu->csi_type = 1; // NZP-CSI-RS csirs_config_pdu->nr_of_rbs = resourceMapping.freqBand.nrofRBs;
csirs_config_pdu->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain; csirs_config_pdu->csi_type = 1; // NZP-CSI-RS
if (resourceMapping.firstOFDMSymbolInTimeDomain2) csirs_config_pdu->symb_l0 = resourceMapping.firstOFDMSymbolInTimeDomain;
csirs_config_pdu->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2; if (resourceMapping.firstOFDMSymbolInTimeDomain2)
csirs_config_pdu->cdm_type = resourceMapping.cdm_Type; csirs_config_pdu->symb_l1 = *resourceMapping.firstOFDMSymbolInTimeDomain2;
csirs_config_pdu->freq_density = resourceMapping.density.present; csirs_config_pdu->cdm_type = resourceMapping.cdm_Type;
if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5) csirs_config_pdu->freq_density = resourceMapping.density.present;
&& (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs)) if ((resourceMapping.density.present == NR_CSI_RS_ResourceMapping__density_PR_dot5)
csirs_config_pdu->freq_density--; && (resourceMapping.density.choice.dot5 == NR_CSI_RS_ResourceMapping__density__dot5_evenPRBs))
csirs_config_pdu->scramb_id = nzpcsi->scramblingID; csirs_config_pdu->freq_density--;
csirs_config_pdu->power_control_offset = nzpcsi->powerControlOffset + 8; csirs_config_pdu->scramb_id = nzpcsi->scramblingID;
if (nzpcsi->powerControlOffsetSS) csirs_config_pdu->power_control_offset = nzpcsi->powerControlOffset + 8;
csirs_config_pdu->power_control_offset_ss = *nzpcsi->powerControlOffsetSS; if (nzpcsi->powerControlOffsetSS)
else csirs_config_pdu->power_control_offset_ss = *nzpcsi->powerControlOffsetSS;
csirs_config_pdu->power_control_offset_ss = 1; // 0 dB else
switch(resourceMapping.frequencyDomainAllocation.present){ csirs_config_pdu->power_control_offset_ss = 1; // 0 dB
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1: switch(resourceMapping.frequencyDomainAllocation.present){
csirs_config_pdu->row = 1; case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row1:
csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f; csirs_config_pdu->row = 1;
csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row1.buf[0])>>4)&0x0f;
break;
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2:
csirs_config_pdu->row = 2;
csirs_config_pdu->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) |
((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<4)&0xff0));
break;
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4:
csirs_config_pdu->row = 4;
csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07;
break;
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other:
csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f;
// determining the row of table 7.4.1.5.3-1 in 38.211
switch(resourceMapping.nrofPorts){
case NR_CSI_RS_ResourceMapping__nrofPorts_p1:
AssertFatal(1==0,"Resource with 1 CSI port shouldn't be within other rows\n");
break; break;
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row2: case NR_CSI_RS_ResourceMapping__nrofPorts_p2:
csirs_config_pdu->row = 2; csirs_config_pdu->row = 3;
csirs_config_pdu->freq_domain = (((resourceMapping.frequencyDomainAllocation.choice.row2.buf[1]>>4)&0x0f) |
((resourceMapping.frequencyDomainAllocation.choice.row2.buf[0]<<4)&0xff0));
break; break;
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_row4: case NR_CSI_RS_ResourceMapping__nrofPorts_p4:
csirs_config_pdu->row = 4; csirs_config_pdu->row = 5;
csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.row4.buf[0])>>5)&0x07;
break; break;
case NR_CSI_RS_ResourceMapping__frequencyDomainAllocation_PR_other: case NR_CSI_RS_ResourceMapping__nrofPorts_p8:
csirs_config_pdu->freq_domain = ((resourceMapping.frequencyDomainAllocation.choice.other.buf[0])>>2)&0x3f; if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
// determining the row of table 7.4.1.5.3-1 in 38.211 csirs_config_pdu->row = 8;
switch(resourceMapping.nrofPorts){ else{
case NR_CSI_RS_ResourceMapping__nrofPorts_p1: int num_k = 0;
AssertFatal(1==0,"Resource with 1 CSI port shouldn't be within other rows\n"); for (int k=0; k<6; k++)
break; num_k+=(((csirs_config_pdu->freq_domain)>>k)&0x01);
case NR_CSI_RS_ResourceMapping__nrofPorts_p2: if(num_k==4)
csirs_config_pdu->row = 3; csirs_config_pdu->row = 6;
break; else
case NR_CSI_RS_ResourceMapping__nrofPorts_p4: csirs_config_pdu->row = 7;
csirs_config_pdu->row = 5;
break;
case NR_CSI_RS_ResourceMapping__nrofPorts_p8:
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
csirs_config_pdu->row = 8;
else{
int num_k = 0;
for (int k=0; k<6; k++)
num_k+=(((csirs_config_pdu->freq_domain)>>k)&0x01);
if(num_k==4)
csirs_config_pdu->row = 6;
else
csirs_config_pdu->row = 7;
}
break;
case NR_CSI_RS_ResourceMapping__nrofPorts_p12:
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
csirs_config_pdu->row = 10;
else
csirs_config_pdu->row = 9;
break;
case NR_CSI_RS_ResourceMapping__nrofPorts_p16:
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
csirs_config_pdu->row = 12;
else
csirs_config_pdu->row = 11;
break;
case NR_CSI_RS_ResourceMapping__nrofPorts_p24:
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
csirs_config_pdu->row = 14;
else{
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4)
csirs_config_pdu->row = 15;
else
csirs_config_pdu->row = 13;
}
break;
case NR_CSI_RS_ResourceMapping__nrofPorts_p32:
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
csirs_config_pdu->row = 17;
else{
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4)
csirs_config_pdu->row = 18;
else
csirs_config_pdu->row = 16;
}
break;
default:
AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n");
} }
break; break;
default: case NR_CSI_RS_ResourceMapping__nrofPorts_p12:
AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n"); if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
csirs_config_pdu->row = 10;
else
csirs_config_pdu->row = 9;
break;
case NR_CSI_RS_ResourceMapping__nrofPorts_p16:
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
csirs_config_pdu->row = 12;
else
csirs_config_pdu->row = 11;
break;
case NR_CSI_RS_ResourceMapping__nrofPorts_p24:
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
csirs_config_pdu->row = 14;
else{
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4)
csirs_config_pdu->row = 15;
else
csirs_config_pdu->row = 13;
}
break;
case NR_CSI_RS_ResourceMapping__nrofPorts_p32:
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm4_FD2_TD2)
csirs_config_pdu->row = 17;
else{
if (resourceMapping.cdm_Type == NR_CSI_RS_ResourceMapping__cdm_Type_cdm8_FD2_TD4)
csirs_config_pdu->row = 18;
else
csirs_config_pdu->row = 16;
}
break;
default:
AssertFatal(1==0,"Invalid number of ports in CSI-RS resource\n");
} }
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_RS; break;
dl_config->number_pdus += 1; default:
} AssertFatal(1==0,"Invalid freqency domain allocation in CSI-RS resource\n");
} }
dl_config->dl_config_list[dl_config->number_pdus].pdu_type = FAPI_NR_DL_CONFIG_TYPE_CSI_RS;
dl_config->number_pdus += 1;
} }
} }
......
...@@ -1029,6 +1029,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, ...@@ -1029,6 +1029,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
int start_symbol_index,nr_of_symbols; int start_symbol_index,nr_of_symbols;
SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols); SLIV2SL(startSymbolAndLength, &start_symbol_index, &nr_of_symbols);
int mcsindex = -1; // init value
pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA; pusch_pdu->pdu_bit_map = PUSCH_PDU_BITMAP_PUSCH_DATA;
pusch_pdu->rnti = rnti; pusch_pdu->rnti = rnti;
...@@ -1037,10 +1038,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, ...@@ -1037,10 +1038,7 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
pusch_pdu->bwp_size = bwp_size; pusch_pdu->bwp_size = bwp_size;
pusch_pdu->subcarrier_spacing = scs; pusch_pdu->subcarrier_spacing = scs;
pusch_pdu->cyclic_prefix = 0; pusch_pdu->cyclic_prefix = 0;
pusch_pdu->mcs_index = 1;
pusch_pdu->mcs_table = 0; pusch_pdu->mcs_table = 0;
pusch_pdu->target_code_rate = nr_get_code_rate_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table);
pusch_pdu->qam_mod_order = nr_get_Qm_ul(pusch_pdu->mcs_index,pusch_pdu->mcs_table);
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL) if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder == NULL)
pusch_pdu->transform_precoding = 1; pusch_pdu->transform_precoding = 1;
else else
...@@ -1077,15 +1075,23 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu, ...@@ -1077,15 +1075,23 @@ void fill_msg3_pusch_pdu(nfapi_nr_pusch_pdu_t *pusch_pdu,
for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++) for(int i = start_symbol_index; i < start_symbol_index+nr_of_symbols; i++)
num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1; num_dmrs_symb += (pusch_pdu->ul_dmrs_symb_pos >> i) & 1;
pusch_pdu->pusch_data.tb_size = nr_compute_tbs(pusch_pdu->qam_mod_order, int TBS = 0;
pusch_pdu->target_code_rate, while(TBS<7) { // TBS for msg3 is 7 bytes (except for RRCResumeRequest1 currently not implemented)
pusch_pdu->rb_size, mcsindex++;
pusch_pdu->nr_of_symbols, pusch_pdu->target_code_rate = nr_get_code_rate_ul(mcsindex,pusch_pdu->mcs_table);
num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol pusch_pdu->qam_mod_order = nr_get_Qm_ul(mcsindex,pusch_pdu->mcs_table);
0, //nb_rb_oh TBS = nr_compute_tbs(pusch_pdu->qam_mod_order,
0, // to verify tb scaling pusch_pdu->target_code_rate,
pusch_pdu->nrOfLayers)>>3; pusch_pdu->rb_size,
pusch_pdu->nr_of_symbols,
num_dmrs_symb*12, // nb dmrs set for no data in dmrs symbol
0, //nb_rb_oh
0, // to verify tb scaling
pusch_pdu->nrOfLayers)>>3;
pusch_pdu->mcs_index = mcsindex;
pusch_pdu->pusch_data.tb_size = TBS;
}
} }
void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP, NR_RA_t *ra, uint8_t *RAR_pdu) void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t slotP, NR_RA_t *ra, uint8_t *RAR_pdu)
...@@ -1179,7 +1185,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1179,7 +1185,7 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
time_domain_assignment = 1; time_domain_assignment = 1;
else else
time_domain_assignment = 0; time_domain_assignment = 0;
uint8_t mcsIndex = 0; int mcsIndex = -1; // initialization value
int rbStart = 0; int rbStart = 0;
int rbSize = 8; int rbSize = 8;
...@@ -1336,9 +1342,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1336,9 +1342,6 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
pdsch_pdu_rel15->SubcarrierSpacing = genericParameters->subcarrierSpacing; pdsch_pdu_rel15->SubcarrierSpacing = genericParameters->subcarrierSpacing;
pdsch_pdu_rel15->CyclicPrefix = 0; pdsch_pdu_rel15->CyclicPrefix = 0;
pdsch_pdu_rel15->NrOfCodewords = 1; pdsch_pdu_rel15->NrOfCodewords = 1;
pdsch_pdu_rel15->targetCodeRate[0] = nr_get_code_rate_dl(mcsIndex,mcsTableIdx);
pdsch_pdu_rel15->qamModOrder[0] = 2;
pdsch_pdu_rel15->mcsIndex[0] = mcsIndex;
pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx; pdsch_pdu_rel15->mcsTable[0] = mcsTableIdx;
pdsch_pdu_rel15->rvIndex[0] = 0; pdsch_pdu_rel15->rvIndex[0] = 0;
pdsch_pdu_rel15->dataScramblingId = *scc->physCellId; pdsch_pdu_rel15->dataScramblingId = *scc->physCellId;
...@@ -1363,9 +1366,38 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1363,9 +1366,38 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
mappingtype, mappingtype,
1); 1);
int x_Overhead = 0;
uint8_t tb_scaling = 0; uint8_t tb_scaling = 0;
nr_get_tbs_dl(&dl_tti_pdsch_pdu->pdsch_pdu, x_Overhead, pdsch_pdu_rel15->numDmrsCdmGrpsNoData, tb_scaling); int R, Qm;
uint8_t N_PRB_DMRS;
uint32_t TBS=0;
if (dmrsConfigType == NFAPI_NR_DMRS_TYPE1) {
// if no data in dmrs cdm group is 1 only even REs have no data
// if no data in dmrs cdm group is 2 both odd and even REs have no data
N_PRB_DMRS = pdsch_pdu_rel15->numDmrsCdmGrpsNoData*6;
}
else {
N_PRB_DMRS = pdsch_pdu_rel15->numDmrsCdmGrpsNoData*4;
}
uint16_t dmrs_length = get_num_dmrs(pdsch_pdu_rel15->dlDmrsSymbPos);
while(TBS<9) { // min TBS for RAR is 9 bytes
mcsIndex++;
R = nr_get_code_rate_dl(mcsIndex, mcsTableIdx);
Qm = nr_get_Qm_dl(mcsIndex, mcsTableIdx);
TBS = nr_compute_tbs(Qm,
R,
rbSize,
nrOfSymbols,
N_PRB_DMRS*dmrs_length,
0, // overhead
tb_scaling, // tb scaling
1)>>3; // layers
pdsch_pdu_rel15->targetCodeRate[0] = R;
pdsch_pdu_rel15->qamModOrder[0] = Qm;
pdsch_pdu_rel15->mcsIndex[0] = mcsIndex;
pdsch_pdu_rel15->TBSize[0] = TBS;
}
// Fill PDCCH DL DCI PDU // Fill PDCCH DL DCI PDU
nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci]; nfapi_nr_dl_dci_pdu_t *dci_pdu = &pdcch_pdu_rel15->dci_pdu[pdcch_pdu_rel15->numDlDci];
...@@ -1652,23 +1684,17 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1652,23 +1684,17 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
int rbSize = 0; int rbSize = 0;
uint8_t tb_scaling = 0; uint8_t tb_scaling = 0;
uint16_t *vrb_map = cc[CC_id].vrb_map; uint16_t *vrb_map = cc[CC_id].vrb_map;
// increase PRBs until we get to BWPSize or TBS is bigger than MAC PDU size
do {
rbSize++;
LOG_D(NR_MAC,"Msg4 Allocation : RBloop Calling nr_compute_tbs with N_PRB_DMRS %d, N_DMRS_SLOT %d\n",N_PRB_DMRS,N_DMRS_SLOT);
harq->tb_size = nr_compute_tbs(nr_get_Qm_dl(mcsIndex, mcsTableIdx),
nr_get_code_rate_dl(mcsIndex, mcsTableIdx),
rbSize, nrOfSymbols, N_PRB_DMRS * N_DMRS_SLOT, 0, tb_scaling,1) >> 3;
} while (rbSize < BWPSize && harq->tb_size < ra->mac_pdu_length);
// increase mcs until we get a TBS that is big enough to fix the MAC PDU
do { do {
mcsIndex++; if(rbSize < BWPSize)
LOG_D(NR_MAC,"Msg4 Allocation: MCSloop Calling nr_compute_tbs with N_PRB_DMRS %d, N_DMRS_SLOT %d\n",N_PRB_DMRS,N_DMRS_SLOT); rbSize++;
else
mcsIndex++;
LOG_D(NR_MAC,"Calling nr_compute_tbs with N_PRB_DMRS %d, N_DMRS_SLOT %d\n",N_PRB_DMRS,N_DMRS_SLOT);
harq->tb_size = nr_compute_tbs(nr_get_Qm_dl(mcsIndex, mcsTableIdx), harq->tb_size = nr_compute_tbs(nr_get_Qm_dl(mcsIndex, mcsTableIdx),
nr_get_code_rate_dl(mcsIndex, mcsTableIdx), nr_get_code_rate_dl(mcsIndex, mcsTableIdx),
rbSize, nrOfSymbols, N_PRB_DMRS * N_DMRS_SLOT, 0, tb_scaling,1) >> 3; rbSize, nrOfSymbols, N_PRB_DMRS * N_DMRS_SLOT, 0, tb_scaling,1) >> 3;
} while (harq->tb_size < ra->mac_pdu_length && mcsIndex<10); } while (harq->tb_size < ra->mac_pdu_length && mcsIndex<=28);
AssertFatal(mcsIndex<10,"Cannot fit Msg4 in %d PRBs with QPSK\n",(int)BWPSize);
int i = 0; int i = 0;
while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) { while ((i < rbSize) && (rbStart + rbSize <= BWPSize)) {
if (vrb_map[BWPStart + rbStart + i]&SL_to_bitmap(startSymbolIndex, nrOfSymbols)) { if (vrb_map[BWPStart + rbStart + i]&SL_to_bitmap(startSymbolIndex, nrOfSymbols)) {
......
...@@ -612,14 +612,15 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) ...@@ -612,14 +612,15 @@ void schedule_nr_sib1(module_id_t module_idP, frame_t frameP, sub_frame_t slotP)
int startSymbolIndex = 0; int startSymbolIndex = 0;
int nrOfSymbols = 0; int nrOfSymbols = 0;
bool is_typeA;
get_info_from_tda_tables(type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern, get_info_from_tda_tables(type0_PDCCH_CSS_config->type0_pdcch_ss_mux_pattern,
time_domain_allocation, time_domain_allocation,
gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position,
1, &startSymbolIndex, &nrOfSymbols); 1, &is_typeA,
&startSymbolIndex, &nrOfSymbols);
// TODO: There are exceptions to this in table 5.1.2.1.1-4,5 (Default time domain allocation tables B, C) int mappingtype = is_typeA? typeA: typeB;
int mappingtype = (startSymbolIndex <= 3)? typeA: typeB;
uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1); uint16_t dlDmrsSymbPos = fill_dmrs_mask(NULL, gNB_mac->common_channels->ServingCellConfigCommon->dmrs_TypeA_Position, nrOfSymbols, startSymbolIndex, mappingtype, 1);
// Configure sched_ctrlCommon for SIB1 // Configure sched_ctrlCommon for SIB1
......
...@@ -173,14 +173,17 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon, ...@@ -173,14 +173,17 @@ void config_csirs(NR_ServingCellConfigCommon_t *servingcellconfigcommon,
void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){
lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing); lte_frame_type_t frame_type = get_frame_type(*scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0], *scc->ssbSubcarrierSpacing);
int curr_bwp = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
// coreset duration setting to be improved in the framework of RRC harmonization, potentially using a common function
int len_coreset = 1;
if (curr_bwp < 48)
len_coreset = 2;
// setting default TDA for DL with // setting default TDA for DL with
struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); struct NR_PDSCH_TimeDomainResourceAllocation *timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t));
timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,13); // basic slot configuration starting in symbol 1 til the end of the slot timedomainresourceallocation->startSymbolAndLength = get_SLIV(len_coreset,14-len_coreset); // basic slot configuration starting in symbol 1 til the end of the slot
ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,
timedomainresourceallocation); timedomainresourceallocation);
if(frame_type==TDD) { if(frame_type==TDD) {
// TDD // TDD
if(scc->tdd_UL_DL_ConfigurationCommon) { if(scc->tdd_UL_DL_ConfigurationCommon) {
...@@ -188,7 +191,7 @@ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){ ...@@ -188,7 +191,7 @@ void nr_rrc_config_dl_tda(NR_ServingCellConfigCommon_t *scc){
if(dl_symb > 1) { if(dl_symb > 1) {
timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t)); timedomainresourceallocation = CALLOC(1,sizeof(NR_PDSCH_TimeDomainResourceAllocation_t));
timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA; timedomainresourceallocation->mappingType = NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA;
timedomainresourceallocation->startSymbolAndLength = get_SLIV(1,dl_symb-1); // mixed slot configuration starting in symbol 1 til the end of the dl allocation timedomainresourceallocation->startSymbolAndLength = get_SLIV(len_coreset,dl_symb-len_coreset); // mixed slot configuration starting in symbol 1 til the end of the dl allocation
ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list, ASN_SEQUENCE_ADD(&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list,
timedomainresourceallocation); timedomainresourceallocation);
} }
......
...@@ -345,14 +345,18 @@ typedef struct gNB_RRC_UE_s { ...@@ -345,14 +345,18 @@ typedef struct gNB_RRC_UE_s {
uint8_t setup_e_rabs; uint8_t setup_e_rabs;
/* Number of e_rab to be setup in the list */ /* Number of e_rab to be setup in the list */
uint8_t nb_of_e_rabs; uint8_t nb_of_e_rabs;
/* Total number of pdu session already setup in the list */
uint8_t setup_pdu_sessions;
/* Number of pdu session to be setup in the list */
uint8_t nb_of_pdusessions;
/* Number of e_rab to be modified in the list */ /* Number of e_rab to be modified in the list */
uint8_t nb_of_modify_e_rabs; uint8_t nb_of_modify_e_rabs;
uint8_t nb_of_failed_e_rabs; uint8_t nb_of_failed_e_rabs;
e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB]; e_rab_param_t modify_e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
/* Total number of pdu session already setup in the list */
uint8_t setup_pdu_sessions;
/* Number of pdu session to be setup in the list */
uint8_t nb_of_pdusessions;
/* Number of e_rab to be modified in the list */
uint8_t nb_of_modify_pdusessions;
uint8_t nb_of_failed_pdusessions;
pdu_session_param_t modify_pdusession[NR_NB_RB_MAX];
/* list of e_rab to be setup by RRC layers */ /* list of e_rab to be setup by RRC layers */
/* list of pdu session to be setup by RRC layers */ /* list of pdu session to be setup by RRC layers */
e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB]; e_rab_param_t e_rab[NB_RB_MAX];//[S1AP_MAX_E_RAB];
......
...@@ -1026,6 +1026,176 @@ rrc_gNB_generate_dedicatedRRCReconfiguration( ...@@ -1026,6 +1026,176 @@ rrc_gNB_generate_dedicatedRRCReconfiguration(
#endif #endif
} }
//-----------------------------------------------------------------------------
void
rrc_gNB_modify_dedicatedRRCReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *ue_context_pP)
//-----------------------------------------------------------------------------
{
NR_DRB_ToAddMod_t *DRB_config = NULL;
NR_DRB_ToAddModList_t **DRB_configList = NULL;
NR_DRB_ToAddModList_t *DRB_configList2 = NULL;
struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList
*dedicatedNAS_MessageList = NULL;
NR_DedicatedNAS_Message_t *dedicatedNAS_Message = NULL;
uint8_t buffer[RRC_BUF_SIZE];
uint16_t size;
int qos_flow_index = 0;
int i, j;
uint8_t xid = rrc_gNB_get_next_transaction_identifier(ctxt_pP->module_id);
DRB_configList = &ue_context_pP->ue_context.DRB_configList;
DRB_configList2 = CALLOC(1, sizeof(NR_DRB_ToAddModList_t));
memset(DRB_configList2, 0, sizeof(NR_DRB_ToAddModList_t));
dedicatedNAS_MessageList = CALLOC(1, sizeof(struct NR_RRCReconfiguration_v1530_IEs__dedicatedNAS_MessageList));
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) {
// bypass the new and already configured pdu sessions
if (ue_context_pP->ue_context.modify_pdusession[i].status >= PDU_SESSION_STATUS_DONE) {
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
continue;
}
if (ue_context_pP->ue_context.modify_pdusession[i].cause != NGAP_CAUSE_NOTHING) {
// set xid of failure pdu session
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED;
continue;
}
// search exist DRB_config
for (j = 0; j < (*DRB_configList)->list.count; j++) {
if ((*DRB_configList)->list.array[j]->cnAssociation->choice.sdap_Config->pdu_Session ==
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id) {
DRB_config = (*DRB_configList)->list.array[j];
break;
}
}
if (DRB_config == NULL) {
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED;
ue_context_pP->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_pP->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_unspecified;
ue_context_pP->ue_context.nb_of_failed_pdusessions++;
continue;
}
// Reference TS23501 Table 5.7.4-1: Standardized 5QI to QoS characteristics mapping
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) {
switch (ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI) {
case 1: //100ms
case 2: //150ms
case 3: //50ms
case 4: //300ms
case 5: //100ms
case 6: //300ms
case 7: //100ms
case 8: //300ms
case 9: //300ms Video (Buffered Streaming)TCP-based (e.g., www, e-mail, chat, ftp, p2p file sharing, progressive video, etc.)
// TODO
break;
default:
LOG_E(NR_RRC,"not supported 5qi %lu\n", ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI);
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_FAILED;
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
ue_context_pP->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_pP->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_not_supported_5QI_value;
ue_context_pP->ue_context.nb_of_failed_pdusessions++;
continue;
}
LOG_I(NR_RRC, "PDU SESSION ID %ld, DRB ID %ld (index %d), QOS flow %d, 5QI %ld \n",
DRB_config->cnAssociation->choice.sdap_Config->pdu_Session,
DRB_config->drb_Identity, i,
qos_flow_index,
ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].fiveQI
);
}
ASN_SEQUENCE_ADD(&DRB_configList2->list, DRB_config);
ue_context_pP->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_DONE;
ue_context_pP->ue_context.modify_pdusession[i].xid = xid;
if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) {
dedicatedNAS_Message = CALLOC(1, sizeof(NR_DedicatedNAS_Message_t));
memset(dedicatedNAS_Message, 0, sizeof(OCTET_STRING_t));
OCTET_STRING_fromBuf(dedicatedNAS_Message,
(char *)ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer,
ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.length);
ASN_SEQUENCE_ADD(&dedicatedNAS_MessageList->list, dedicatedNAS_Message);
LOG_I(NR_RRC,"add NAS info with size %d (pdusession id %d)\n",ue_context_pP->ue_context.pduSession[i].param.nas_pdu.length,
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id);
} else {
// TODO
LOG_E(NR_RRC,"no NAS info (pdusession id %d)\n", ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id);
}
}
/* If list is empty free the list and reset the address */
if (dedicatedNAS_MessageList->list.count == 0) {
free(dedicatedNAS_MessageList);
dedicatedNAS_MessageList = NULL;
}
memset(buffer, 0, sizeof(buffer));
size = do_RRCReconfiguration(ctxt_pP, buffer, sizeof(buffer),
xid,
NULL,
DRB_configList2,
NULL,
NULL,
NULL,
NULL,
dedicatedNAS_MessageList,
NULL,
NULL);
LOG_DUMPMSG(NR_RRC, DEBUG_RRC, (char *)buffer, size, "[MSG] RRC Reconfiguration\n");
/* Free all NAS PDUs */
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) {
if (ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer != NULL) {
/* Free the NAS PDU buffer and invalidate it */
free(ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer);
ue_context_pP->ue_context.modify_pdusession[i].param.nas_pdu.buffer = NULL;
}
}
LOG_I(NR_RRC,
"[gNB %d] Frame %d, Logical Channel DL-DCCH, Generate RRCReconfiguration (bytes %d, UE RNTI %x)\n",
ctxt_pP->module_id, ctxt_pP->frame, size, ue_context_pP->ue_context.rnti);
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);
#ifdef ITTI_SIM
MessageDef *message_p;
uint8_t *message_buffer;
message_buffer = itti_malloc (TASK_RRC_GNB_SIM, TASK_RRC_UE_SIM, size);
memcpy (message_buffer, buffer, size);
message_p = itti_alloc_new_message (TASK_RRC_GNB_SIM, 0, GNB_RRC_DCCH_DATA_IND);
GNB_RRC_DCCH_DATA_IND (message_p).rbid = DCCH;
GNB_RRC_DCCH_DATA_IND (message_p).sdu = message_buffer;
GNB_RRC_DCCH_DATA_IND (message_p).size = size;
itti_send_msg_to_task (TASK_RRC_UE_SIM, ctxt_pP->instance, message_p);
#else
nr_rrc_data_req(
ctxt_pP,
DCCH,
rrc_gNB_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL);
#endif
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void void
rrc_gNB_generate_dedicatedRRCReconfiguration_release( rrc_gNB_generate_dedicatedRRCReconfiguration_release(
...@@ -2197,10 +2367,23 @@ rrc_gNB_decode_dcch( ...@@ -2197,10 +2367,23 @@ rrc_gNB_decode_dcch(
//NGAP_PDUSESSION_RELEASE_RESPONSE //NGAP_PDUSESSION_RELEASE_RESPONSE
rrc_gNB_send_NGAP_PDUSESSION_RELEASE_RESPONSE(ctxt_pP, ue_context_p, xid); 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) { } else if (ue_context_p->ue_context.established_pdu_sessions_flag != 1) {
if (ue_context_p->ue_context.setup_pdu_sessions > 0) { if (ue_context_p->ue_context.nb_of_pdusessions > 0) {
rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(ctxt_pP, rrc_gNB_send_NGAP_PDUSESSION_SETUP_RESP(ctxt_pP,
ue_context_p, ue_context_p,
ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier); ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier);
ue_context_p->ue_context.nb_of_pdusessions = 0;
}
}
if (ue_context_p->ue_context.nb_of_modify_pdusessions > 0) {
rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(ctxt_pP,
ue_context_p,
ul_dcch_msg->message.choice.c1->choice.rrcReconfigurationComplete->rrc_TransactionIdentifier);
ue_context_p->ue_context.nb_of_modify_pdusessions = 0;
ue_context_p->ue_context.nb_of_failed_pdusessions = 0;
memset(ue_context_p->ue_context.modify_pdusession, 0, sizeof(ue_context_p->ue_context.modify_pdusession));
for(int i = 0; i < NR_NB_RB_MAX; i++) {
ue_context_p->ue_context.modify_pdusession[i].xid = -1;
} }
} }
} }
...@@ -3477,6 +3660,10 @@ void *rrc_gnb_task(void *args_p) { ...@@ -3477,6 +3660,10 @@ void *rrc_gnb_task(void *args_p) {
rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(msg_p, msg_name_p, instance); rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(msg_p, msg_name_p, instance);
break; break;
case NGAP_PDUSESSION_MODIFY_REQ:
rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(msg_p, msg_name_p, instance);
break;
case NGAP_PDUSESSION_RELEASE_COMMAND: case NGAP_PDUSESSION_RELEASE_COMMAND:
rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(msg_p, msg_name_p, instance); rrc_gNB_process_NGAP_PDUSESSION_RELEASE_COMMAND(msg_p, msg_name_p, instance);
break; break;
......
...@@ -1058,6 +1058,264 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ( ...@@ -1058,6 +1058,264 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
} }
} }
//------------------------------------------------------------------------------
int
rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(
MessageDef *msg_p,
const char *msg_name,
instance_t instance
)
//------------------------------------------------------------------------------
{
uint16_t ue_initial_id;
uint32_t gNB_ue_ngap_id;
uint8_t nb_pdusessions_tomodify;
rrc_gNB_ue_context_t *ue_context_p = NULL;
uint8_t i;
uint8_t qos_flow_index;
protocol_ctxt_t ctxt;
ue_initial_id = NGAP_PDUSESSION_MODIFY_REQ(msg_p).ue_initial_id;
gNB_ue_ngap_id = NGAP_PDUSESSION_MODIFY_REQ(msg_p).gNB_ue_ngap_id;
nb_pdusessions_tomodify = NGAP_PDUSESSION_MODIFY_REQ(msg_p).nb_pdusessions_tomodify;
ue_context_p = rrc_gNB_get_ue_context_from_ngap_ids(instance, ue_initial_id, gNB_ue_ngap_id);
if (ue_context_p == NULL) {
LOG_W(NR_RRC, "[gNB %ld] In NGAP_PDUSESSION_MODIFY_REQ: unknown UE from NGAP ids (%d, %u)\n", instance, ue_initial_id, gNB_ue_ngap_id);
// TODO
return (-1);
} else {
PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, GNB_FLAG_YES, ue_context_p->ue_context.rnti, 0, 0);
ctxt.eNB_index = 0;
ue_context_p->ue_context.gNB_ue_ngap_id = gNB_ue_ngap_id;
{
int j;
boolean_t is_treated[NGAP_MAX_PDUSESSION] = {FALSE};
uint8_t nb_of_failed_pdusessions = 0;
for (i = 0; i < nb_pdusessions_tomodify; i++) {
if (is_treated[i] == TRUE) {
continue;
}
//Check if same PDU session ID to handle multiple pdu sessions
for (j = i+1; j < nb_pdusessions_tomodify; j++) {
if (is_treated[j] == FALSE &&
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id ==
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id) {
// handle multiple pdu session id
LOG_D(NR_RRC, "handle multiple pdu session id \n");
ue_context_p->ue_context.modify_pdusession[j].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.modify_pdusession[j].param.pdusession_id =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[j].pdusession_id;
ue_context_p->ue_context.modify_pdusession[j].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_p->ue_context.modify_pdusession[j].cause_value = NGAP_CauseRadioNetwork_multiple_PDU_session_ID_instances;
nb_of_failed_pdusessions++;
is_treated[i] = TRUE;
is_treated[j] = TRUE;
}
}
// handle multiple pdu session id case
if (is_treated[i] == TRUE) {
LOG_D(NR_RRC, "handle multiple pdu session id \n");
ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id;
ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_p->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_multiple_PDU_session_ID_instances;
nb_of_failed_pdusessions++;
continue;
}
// Check pdu session ID is established
for (j = 0; j < NR_NB_RB_MAX -3; j++) {
if (ue_context_p->ue_context.pduSession[j].param.pdusession_id ==
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id) {
if (ue_context_p->ue_context.pduSession[j].status == PDU_SESSION_STATUS_TORELEASE ||
ue_context_p->ue_context.pduSession[j].status == PDU_SESSION_STATUS_DONE) {
break;
}
// Found established pdu session, prepare to send RRC message
ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id;
ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_NOTHING;
if (NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.buffer != NULL) {
ue_context_p->ue_context.modify_pdusession[i].param.nas_pdu.buffer =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.buffer;
ue_context_p->ue_context.modify_pdusession[i].param.nas_pdu.length =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nas_pdu.length;
}
// Save new pdu session parameters, qos, upf addr, teid
for (qos_flow_index = 0; qos_flow_index < NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nb_qos; qos_flow_index++) {
ue_context_p->ue_context.modify_pdusession[i].param.qos[qos_flow_index] =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].qos[qos_flow_index];
}
ue_context_p->ue_context.modify_pdusession[i].param.nb_qos =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].nb_qos;
ue_context_p->ue_context.modify_pdusession[i].param.upf_addr =
ue_context_p->ue_context.pduSession[j].param.upf_addr;
ue_context_p->ue_context.modify_pdusession[i].param.gtp_teid =
ue_context_p->ue_context.pduSession[j].param.gtp_teid;
is_treated[i] = TRUE;
break;
}
}
// handle Unknown pdu session ID
if (is_treated[i] == FALSE) {
LOG_D(NR_RRC, "handle Unknown pdu session ID \n");
ue_context_p->ue_context.modify_pdusession[i].status = PDU_SESSION_STATUS_NEW;
ue_context_p->ue_context.modify_pdusession[i].param.pdusession_id =
NGAP_PDUSESSION_MODIFY_REQ(msg_p).pdusession_modify_params[i].pdusession_id;
ue_context_p->ue_context.modify_pdusession[i].cause = NGAP_CAUSE_RADIO_NETWORK;
ue_context_p->ue_context.modify_pdusession[i].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID;
nb_of_failed_pdusessions++;
is_treated[i] = TRUE;
}
}
ue_context_p->ue_context.nb_of_modify_pdusessions = nb_pdusessions_tomodify;
ue_context_p->ue_context.nb_of_failed_pdusessions = nb_of_failed_pdusessions;
}
if (ue_context_p->ue_context.nb_of_failed_pdusessions < ue_context_p->ue_context.nb_of_modify_pdusessions) {
LOG_D(NR_RRC, "generate RRCReconfiguration \n");
rrc_gNB_modify_dedicatedRRCReconfiguration(&ctxt, ue_context_p);
} else { // all pdu modification failed
LOG_I(NR_RRC, "pdu session modify failed, fill NGAP_PDUSESSION_MODIFY_RESP with the pdu session information that failed to modify \n");
uint8_t nb_of_pdu_sessions_failed = 0;
MessageDef *msg_fail_p = NULL;
msg_fail_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP);
if (msg_fail_p == NULL) {
LOG_E(NR_RRC, "itti_alloc_new_message failed, msg_fail_p is NULL \n");
return (-1);
}
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).gNB_ue_ngap_id = gNB_ue_ngap_id;
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).nb_of_pdusessions = 0;
for (nb_of_pdu_sessions_failed = 0; nb_of_pdu_sessions_failed < ue_context_p->ue_context.nb_of_failed_pdusessions; nb_of_pdu_sessions_failed++) {
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].pdusession_id =
ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].param.pdusession_id;
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].cause =
ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].cause;
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).pdusessions_failed[nb_of_pdu_sessions_failed].cause_value =
ue_context_p->ue_context.modify_pdusession[nb_of_pdu_sessions_failed].cause_value;
}
NGAP_PDUSESSION_MODIFY_RESP(msg_fail_p).nb_of_pdusessions_failed =
ue_context_p->ue_context.nb_of_failed_pdusessions;
itti_send_msg_to_task(TASK_NGAP, instance, msg_fail_p);
ue_context_p->ue_context.nb_of_modify_pdusessions = 0;
ue_context_p->ue_context.nb_of_failed_pdusessions = 0;
memset(ue_context_p->ue_context.modify_pdusession, 0, sizeof(ue_context_p->ue_context.modify_pdusession));
return (0);
}
}
return 0;
}
//------------------------------------------------------------------------------
int
rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
uint8_t xid
)
//------------------------------------------------------------------------------
{
MessageDef *msg_p = NULL;
int i, j;
uint8_t qos_flow_index;
uint8_t pdu_sessions_failed = 0;
uint8_t pdu_sessions_done = 0;
msg_p = itti_alloc_new_message (TASK_RRC_GNB, 0, NGAP_PDUSESSION_MODIFY_RESP);
if (msg_p == NULL) {
LOG_E(NR_RRC, "itti_alloc_new_message failed, msg_p is NULL \n");
return (-1);
}
LOG_I(NR_RRC, "send message NGAP_PDUSESSION_MODIFY_RESP \n");
NGAP_PDUSESSION_MODIFY_RESP(msg_p).gNB_ue_ngap_id = ue_context_pP->ue_context.gNB_ue_ngap_id;
for (i = 0; i < ue_context_pP->ue_context.nb_of_modify_pdusessions; i++) {
if (xid == ue_context_pP->ue_context.modify_pdusession[i].xid) {
if (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_DONE) {
for (j = 0; j < ue_context_pP->ue_context.setup_pdu_sessions; j++) {
if (ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id ==
ue_context_pP->ue_context.pduSession[j].param.pdusession_id) {
LOG_I(NR_RRC, "update pdu session %d \n", ue_context_pP->ue_context.pduSession[j].param.pdusession_id);
// Update ue_context_pP->ue_context.pduSession
ue_context_pP->ue_context.pduSession[j].status = PDU_SESSION_STATUS_ESTABLISHED;
ue_context_pP->ue_context.pduSession[j].cause = NGAP_CAUSE_NOTHING;
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) {
ue_context_pP->ue_context.pduSession[j].param.qos[qos_flow_index] =
ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index];
}
break;
}
}
if (j < ue_context_pP->ue_context.setup_pdu_sessions) {
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id =
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id;
for (qos_flow_index = 0; qos_flow_index < ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos; qos_flow_index++) {
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].qos[qos_flow_index].qfi =
ue_context_pP->ue_context.modify_pdusession[i].param.qos[qos_flow_index].qfi;
}
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].nb_of_qos_flow =
ue_context_pP->ue_context.modify_pdusession[i].param.nb_qos;
LOG_I(NR_RRC, "Modify Resp (msg index %d, pdu session index %d, status %d, xid %d): nb_of_modify_pdusessions %d, pdusession_id %d \n ",
pdu_sessions_done, i, ue_context_pP->ue_context.modify_pdusession[i].status, xid,
ue_context_pP->ue_context.nb_of_modify_pdusessions,
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions[pdu_sessions_done].pdusession_id);
pdu_sessions_done++;
} else {
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id =
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause = NGAP_CAUSE_RADIO_NETWORK;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause_value = NGAP_CauseRadioNetwork_unknown_PDU_session_ID;
pdu_sessions_failed++;
}
} else if ((ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_NEW) ||
(ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_ESTABLISHED)) {
LOG_D (NR_RRC, "PDU SESSION is NEW or already ESTABLISHED\n");
} else if (ue_context_pP->ue_context.modify_pdusession[i].status == PDU_SESSION_STATUS_FAILED) {
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].pdusession_id =
ue_context_pP->ue_context.modify_pdusession[i].param.pdusession_id;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause =
ue_context_pP->ue_context.modify_pdusession[i].cause;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).pdusessions_failed[pdu_sessions_failed].cause_value =
ue_context_pP->ue_context.modify_pdusession[i].cause_value;
pdu_sessions_failed++;
}
} else {
LOG_D(NR_RRC,"xid does not correspond (context pdu session index %d, status %d, xid %d/%d) \n ",
i, ue_context_pP->ue_context.modify_pdusession[i].status, xid, ue_context_pP->ue_context.modify_pdusession[i].xid);
}
}
NGAP_PDUSESSION_MODIFY_RESP(msg_p).nb_of_pdusessions = pdu_sessions_done;
NGAP_PDUSESSION_MODIFY_RESP(msg_p).nb_of_pdusessions_failed = pdu_sessions_failed;
if (pdu_sessions_done > 0 || pdu_sessions_failed > 0) {
LOG_D(NR_RRC,"NGAP_PDUSESSION_MODIFY_RESP: sending the message: nb_of_pdusessions %d, total pdu session %d, index %d\n",
ue_context_pP->ue_context.nb_of_modify_pdusessions, ue_context_pP->ue_context.setup_pdu_sessions, i);
itti_send_msg_to_task (TASK_NGAP, ctxt_pP->instance, msg_p);
} else {
itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
}
return 0;
}
//------------------------------------------------------------------------------
void void
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ(
const module_id_t gnb_mod_idP, const module_id_t gnb_mod_idP,
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "NR_RRCSetupComplete-IEs.h" #include "NR_RRCSetupComplete-IEs.h"
#include "NR_RegisteredAMF.h" #include "NR_RegisteredAMF.h"
#include "NR_UL-DCCH-Message.h" #include "NR_UL-DCCH-Message.h"
#include "NGAP_CauseRadioNetwork.h"
typedef struct rrc_ue_ngap_ids_s { typedef struct rrc_ue_ngap_ids_s {
/* Tree related data */ /* Tree related data */
...@@ -107,6 +108,27 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ( ...@@ -107,6 +108,27 @@ rrc_gNB_process_NGAP_PDUSESSION_SETUP_REQ(
instance_t instance instance_t instance
); );
int
rrc_gNB_process_NGAP_PDUSESSION_MODIFY_REQ(
MessageDef *msg_p,
const char *msg_name,
instance_t instance
);
int
rrc_gNB_send_NGAP_PDUSESSION_MODIFY_RESP(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *const ue_context_pP,
uint8_t xid
);
void
rrc_gNB_modify_dedicatedRRCReconfiguration(
const protocol_ctxt_t *const ctxt_pP,
rrc_gNB_ue_context_t *ue_context_pP
);
void void
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ( rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ(
const module_id_t gnb_mod_idP, const module_id_t gnb_mod_idP,
......
...@@ -2203,7 +2203,7 @@ nr_rrc_ue_establish_srb2( ...@@ -2203,7 +2203,7 @@ nr_rrc_ue_establish_srb2(
// nr_rrc_ue_process_measConfig(ctxt_pP, gNB_index, ie->measConfig); // nr_rrc_ue_process_measConfig(ctxt_pP, gNB_index, ie->measConfig);
} }
if(ie->nonCriticalExtension->masterCellGroup!=NULL) { if((ie->nonCriticalExtension) && (ie->nonCriticalExtension->masterCellGroup!=NULL)) {
nr_rrc_ue_process_masterCellGroup( nr_rrc_ue_process_masterCellGroup(
ctxt_pP, ctxt_pP,
gNB_index, gNB_index,
...@@ -2216,7 +2216,7 @@ nr_rrc_ue_establish_srb2( ...@@ -2216,7 +2216,7 @@ nr_rrc_ue_establish_srb2(
} }
/* Check if there is dedicated NAS information to forward to NAS */ /* Check if there is dedicated NAS information to forward to NAS */
if (ie->nonCriticalExtension->dedicatedNAS_MessageList != NULL) { if ((ie->nonCriticalExtension) && (ie->nonCriticalExtension->dedicatedNAS_MessageList != NULL)) {
int list_count; int list_count;
uint32_t pdu_length; uint32_t pdu_length;
uint8_t *pdu_buffer; uint8_t *pdu_buffer;
......
...@@ -621,7 +621,12 @@ void x2ap_eNB_handle_sgNB_release_request(instance_t instance, ...@@ -621,7 +621,12 @@ void x2ap_eNB_handle_sgNB_release_request(instance_t instance,
} }
target = x2ap_get_eNB(NULL, x2ap_release_req->assoc_id, 0); target = x2ap_get_eNB(NULL, x2ap_release_req->assoc_id, 0);
DevAssert(target != NULL); if (target == NULL) {
X2AP_ERROR("no X2AP target eNB on assoc_id %d, dropping sgNB release request\n", x2ap_release_req->assoc_id);
/* x2ap_gNB_handle_ENDC_sGNB_release_request_acknowledge() would handle the
* ack, but does not do anything */
return;
}
/* id_source is not used by oai's gNB so it's not big deal. For /* id_source is not used by oai's gNB so it's not big deal. For
* interoperability with other gNBs things may need to be refined. * interoperability with other gNBs things may need to be refined.
......
...@@ -87,6 +87,9 @@ ...@@ -87,6 +87,9 @@
#include "NGAP_PDUSessionResourceModifyItemModReq.h" #include "NGAP_PDUSessionResourceModifyItemModReq.h"
#include "NGAP_PDUSessionResourceModifyRequestTransfer.h" #include "NGAP_PDUSessionResourceModifyRequestTransfer.h"
#include "NGAP_QosFlowAddOrModifyRequestItem.h" #include "NGAP_QosFlowAddOrModifyRequestItem.h"
#include "NGAP_PDUSessionResourceModifyResponseTransfer.h"
#include "NGAP_QosFlowAddOrModifyResponseList.h"
#include "NGAP_QosFlowAddOrModifyResponseItem.h"
#include "NGAP_TAIListForPagingItem.h" #include "NGAP_TAIListForPagingItem.h"
#include "NGAP_GNB-ID.h" #include "NGAP_GNB-ID.h"
#include "NGAP_GlobalGNB-ID.h" #include "NGAP_GlobalGNB-ID.h"
......
...@@ -1614,13 +1614,6 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, ...@@ -1614,13 +1614,6 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
return -1; return -1;
} }
/* PDUSession Resource modify request = UE-related procedure -> stream != 0 */
if (stream == 0) {
NGAP_ERROR("[SCTP %d] Received UE-related procedure on stream (%d)\n",
assoc_id, stream);
return -1;
}
ue_desc_p->rx_stream = stream; ue_desc_p->rx_stream = stream;
if (ue_desc_p->amf_ue_ngap_id != amf_ue_ngap_id) { if (ue_desc_p->amf_ue_ngap_id != amf_ue_ngap_id) {
...@@ -1702,14 +1695,20 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, ...@@ -1702,14 +1695,20 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
switch(pdusessionTransfer_ies->id) { switch(pdusessionTransfer_ies->id) {
/* optional PDUSessionAggregateMaximumBitRate */ /* optional PDUSessionAggregateMaximumBitRate */
case NGAP_ProtocolIE_ID_id_PDUSessionAggregateMaximumBitRate: case NGAP_ProtocolIE_ID_id_PDUSessionAggregateMaximumBitRate:
// TODO
NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_PDUSessionAggregateMaximumBitRate\n");
break; break;
/* optional UL-NGU-UP-TNLModifyList */ /* optional UL-NGU-UP-TNLModifyList */
case NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLModifyList: case NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLModifyList:
// TODO
NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLModifyList\n");
break; break;
/* optional NetworkInstance */ /* optional NetworkInstance */
case NGAP_ProtocolIE_ID_id_NetworkInstance: case NGAP_ProtocolIE_ID_id_NetworkInstance:
// TODO
NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_NetworkInstance\n");
break; break;
/* optional QosFlowAddOrModifyRequestList */ /* optional QosFlowAddOrModifyRequestList */
...@@ -1729,6 +1728,12 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, ...@@ -1729,6 +1728,12 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
/* Set the QOS informations */ /* Set the QOS informations */
NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].qfi = (uint8_t)qosFlowItem_p->qosFlowIdentifier; NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].qfi = (uint8_t)qosFlowItem_p->qosFlowIdentifier;
if(qosFlowItem_p->qosFlowLevelQosParameters) { if(qosFlowItem_p->qosFlowLevelQosParameters) {
if (qosFlowItem_p->qosFlowLevelQosParameters->qosCharacteristics.present == NGAP_QosCharacteristics_PR_nonDynamic5QI) {
NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].fiveQI =
qosFlowItem_p->qosFlowLevelQosParameters->qosCharacteristics.choice.nonDynamic5QI->fiveQI;
} else if (qosFlowItem_p->qosFlowLevelQosParameters->qosCharacteristics.present == NGAP_QosCharacteristics_PR_dynamic5QI) {
// TODO
}
NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].allocation_retention_priority.priority_level = NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].allocation_retention_priority.priority_level =
qosFlowItem_p->qosFlowLevelQosParameters->allocationAndRetentionPriority.priorityLevelARP; qosFlowItem_p->qosFlowLevelQosParameters->allocationAndRetentionPriority.priorityLevelARP;
NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].allocation_retention_priority.pre_emp_capability = NGAP_PDUSESSION_MODIFY_REQ(message_p).pdusession_modify_params[i].qos[qosIdx].allocation_retention_priority.pre_emp_capability =
...@@ -1742,14 +1747,20 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id, ...@@ -1742,14 +1747,20 @@ int ngap_gNB_handle_pdusession_modify_request(uint32_t assoc_id,
/* optional QosFlowToReleaseList */ /* optional QosFlowToReleaseList */
case NGAP_ProtocolIE_ID_id_QosFlowToReleaseList: case NGAP_ProtocolIE_ID_id_QosFlowToReleaseList:
// TODO
NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_QosFlowToReleaseList\n");
break; break;
/* optional AdditionalUL-NGU-UP-TNLInformation */ /* optional AdditionalUL-NGU-UP-TNLInformation */
case NGAP_ProtocolIE_ID_id_AdditionalUL_NGU_UP_TNLInformation: case NGAP_ProtocolIE_ID_id_AdditionalUL_NGU_UP_TNLInformation:
// TODO
NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_AdditionalUL_NGU_UP_TNLInformation\n");
break; break;
/* optional CommonNetworkInstance */ /* optional CommonNetworkInstance */
case NGAP_ProtocolIE_ID_id_CommonNetworkInstance: case NGAP_ProtocolIE_ID_id_CommonNetworkInstance:
// TODO
NGAP_ERROR("Cant' handle NGAP_ProtocolIE_ID_id_CommonNetworkInstance\n");
break; break;
default: default:
......
...@@ -1179,7 +1179,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ...@@ -1179,7 +1179,7 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
ie->value.choice.RAN_UE_NGAP_ID = pdusession_modify_resp_p->gNB_ue_ngap_id; ie->value.choice.RAN_UE_NGAP_ID = pdusession_modify_resp_p->gNB_ue_ngap_id;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
/* optional */ /* PDUSessionResourceModifyListModRes optional */
if (pdusession_modify_resp_p->nb_of_pdusessions > 0) { if (pdusession_modify_resp_p->nb_of_pdusessions > 0) {
ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t)); ie = (NGAP_PDUSessionResourceModifyResponseIEs_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseIEs_t));
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceModifyListModRes; ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceModifyListModRes;
...@@ -1187,13 +1187,32 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance, ...@@ -1187,13 +1187,32 @@ int ngap_gNB_pdusession_modify_resp(instance_t instance,
ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_PDUSessionResourceModifyListModRes; ie->value.present = NGAP_PDUSessionResourceModifyResponseIEs__value_PR_PDUSessionResourceModifyListModRes;
for (i = 0; i < pdusession_modify_resp_p->nb_of_pdusessions; i++) { for (i = 0; i < pdusession_modify_resp_p->nb_of_pdusessions; i++) {
NGAP_PDUSessionResourceModifyItemModRes_t *item; NGAP_PDUSessionResourceModifyItemModRes_t *item;
NGAP_PDUSessionResourceModifyResponseTransfer_t *transfer_p = NULL;
item = (NGAP_PDUSessionResourceModifyItemModRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyItemModRes_t));
item->pDUSessionID = pdusession_modify_resp_p->pdusessions[i].pdusession_id; item = (NGAP_PDUSessionResourceModifyItemModRes_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyItemModRes_t));
item->pDUSessionID = pdusession_modify_resp_p->pdusessions[i].pdusession_id;
NGAP_DEBUG("pdusession_modify_resp: modified pdusession ID %ld\n", item->pDUSessionID);
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceModifyListModRes.list, item); transfer_p = (NGAP_PDUSessionResourceModifyResponseTransfer_t *)calloc(1, sizeof(NGAP_PDUSessionResourceModifyResponseTransfer_t));
transfer_p->qosFlowAddOrModifyResponseList = (NGAP_QosFlowAddOrModifyResponseList_t *)calloc(1, sizeof(NGAP_QosFlowAddOrModifyResponseList_t));
uint8_t qos_flow_index;
for (qos_flow_index = 0; qos_flow_index < pdusession_modify_resp_p->pdusessions[i].nb_of_qos_flow; qos_flow_index++) {
NGAP_QosFlowAddOrModifyResponseItem_t *qosFlowAddOrModifyResponseItem_p = calloc(1, sizeof(NGAP_QosFlowAddOrModifyResponseItem_t));
qosFlowAddOrModifyResponseItem_p->qosFlowIdentifier =
pdusession_modify_resp_p->pdusessions[i].qos[qos_flow_index].qfi;
ASN_SEQUENCE_ADD(&transfer_p->qosFlowAddOrModifyResponseList->list, qosFlowAddOrModifyResponseItem_p);
}
memset(&res, 0, sizeof(res));
res = asn_encode_to_new_buffer(NULL, ATS_ALIGNED_CANONICAL_PER, &asn_DEF_NGAP_PDUSessionResourceModifyResponseTransfer, transfer_p);
item->pDUSessionResourceModifyResponseTransfer.buf = res.buffer;
item->pDUSessionResourceModifyResponseTransfer.size = res.result.encoded;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_NGAP_PDUSessionResourceModifyResponseTransfer, transfer_p);
NGAP_DEBUG("pdusession_modify_resp: modified pdusession ID %ld\n", item->pDUSessionID);
ASN_SEQUENCE_ADD(&ie->value.choice.PDUSessionResourceModifyListModRes.list, item);
} }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie); ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
......
Active_gNBs = ( "gNB-OAI");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
gNBs =
(
{
////////// Identification parameters:
gNB_ID = 0xe00;
gNB_name = "gNB-OAI";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
plmn_list = ({
mcc = 208;
mnc = 99;
mnc_length = 2;
snssaiList = (
{
sst = 1;
sd = 0x1; // 0 false, else true
},
{
sst = 1;
sd = 0x112233; // 0 false, else true
}
);
});
nr_cellid = 12345678L;
////////// Physical parameters:
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
sib1_tda = 15;
min_rxtxtime = 6;
pdcch_ConfigSIB1 = (
{
controlResourceSetZero = 2;
searchSpaceZero = 0;
}
);
servingCellConfigCommon = (
{
#spCellConfigCommon
physCellId = 0;
# downlinkConfigCommon
#frequencyInfoDL
# this is 3600 MHz + 12 PRBs@30kHz SCS (same as initial BWP)
absoluteFrequencySSB = 640288;
dl_frequencyBand = 78;
# this is 3600 MHz
dl_absoluteFrequencyPointA = 640000;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_subcarrierSpacing = 1;
dl_carrierBandwidth = 24;
#initialDownlinkBWP
#genericParameters
# this is RBstart=27,L=48 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6325;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1;
#pdcch-ConfigCommon
initialDLBWPcontrolResourceSetZero = 2;
initialDLBWPsearchSpaceZero = 0;
#uplinkConfigCommon
#frequencyInfoUL
ul_frequencyBand = 78;
#scs-SpecificCarrierList
ul_offstToCarrier = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
ul_subcarrierSpacing = 1;
ul_carrierBandwidth = 24;
pMax = 20;
#initialUplinkBWP
#genericParameters
initialULBWPlocationAndBandwidth = 6325;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1;
#rach-ConfigCommon
#rach-ConfigGeneric
prach_ConfigurationIndex = 98;
#prach_msg1_FDM
#0 = one, 1=two, 2=four, 3=eight
prach_msg1_FDM = 0;
prach_msg1_FrequencyStart = 0;
zeroCorrelationZoneConfig = 13;
preambleReceivedTargetPower = -96;
#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
preambleTransMax = 6;
#powerRampingStep
# 0=dB0,1=dB2,2=dB4,3=dB6
powerRampingStep = 1;
#ra_ReponseWindow
#1,2,4,8,10,20,40,80
ra_ResponseWindow = 4;
#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4;
#oneHalf (0..15) 4,8,12,16,...60,64
ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14;
#ra_ContentionResolutionTimer
#(0..7) 8,16,24,32,40,48,56,64
ra_ContentionResolutionTimer = 7;
rsrp_ThresholdSSB = 19;
#prach-RootSequenceIndex_PR
#1 = 839, 2 = 139
prach_RootSequenceIndex_PR = 2;
prach_RootSequenceIndex = 1;
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
#
msg1_SubcarrierSpacing = 1,
# restrictedSetConfig
# 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0,
msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90;
# pucch-ConfigCommon setup :
# pucchGroupHopping
# 0 = neither, 1= group hopping, 2=sequence hopping
pucchGroupHopping = 0;
hoppingId = 40;
p0_nominal = -90;
# ssb_PositionsInBurs_BitmapPR
# 1=short, 2=medium, 3=long
ssb_PositionsInBurst_PR = 2;
ssb_PositionsInBurst_Bitmap = 1;
# ssb_periodicityServingCell
# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
ssb_periodicityServingCell = 2;
# dmrs_TypeA_position
# 0 = pos2, 1 = pos3
dmrs_TypeA_Position = 0;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
subcarrierSpacing = 1;
#tdd-UL-DL-ConfigurationCommon
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
referenceSubcarrierSpacing = 1;
# pattern1
# dl_UL_TransmissionPeriodicity
# 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
dl_UL_TransmissionPeriodicity = 6;
nrofDownlinkSlots = 7;
nrofDownlinkSymbols = 6;
nrofUplinkSlots = 2;
nrofUplinkSymbols = 4;
ssPBCH_BlockPower = -25;
}
);
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.70.132";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
GNB_PORT_FOR_S1U = 2152; # Spec 2152
};
}
);
MACRLCs = (
{
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
pusch_TargetSNRx10 = 150;
pucch_TargetSNRx10 = 200;
ulsch_max_frame_inactivity = 1;
}
);
L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
pusch_proc_threads = 8;
prach_dtx_threshold = 120;
pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
RUs = (
{
local_rf = "yes"
nb_tx = 1
nb_rx = 1
att_tx = 0
att_rx = 0;
bands = [78];
max_pdschReferenceSignalPower = -27;
max_rxgain = 114;
sf_extension = 0;
eNB_instances = [0];
#beamforming 1x4 matrix:
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
clock_src = "internal";
}
);
THREAD_STRUCT = (
{
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
parallel_config = "PARALLEL_SINGLE_THREAD";
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
worker_config = "WORKER_ENABLE";
}
);
rfsimulator :
{
serveraddr = "server";
serverport = "4043";
options = (); #("saviq"); or/and "chanmod"
modelname = "AWGN";
IQfile = "/tmp/rfsimulator.iqs";
};
security = {
# preferred ciphering algorithms
# the first one of the list that an UE supports in chosen
# valid values: nea0, nea1, nea2, nea3
ciphering_algorithms = ( "nea0" );
# preferred integrity algorithms
# the first one of the list that an UE supports in chosen
# valid values: nia0, nia1, nia2, nia3
integrity_algorithms = ( "nia2", "nia0" );
# setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
# what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
drb_ciphering = "yes";
drb_integrity = "no";
};
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
ngap_log_level ="debug";
ngap_log_verbosity ="medium";
};
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