Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangjie
OpenXG-RAN
Commits
3dbf4e94
Commit
3dbf4e94
authored
May 30, 2021
by
Eurecom
Committed by
francescomani
Jun 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handling for UL failure. added do_precoding flag to nr-ru procedures. testing with 2x2 N310.
parent
9a030b42
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
501 additions
and
121 deletions
+501
-121
executables/nr-gnb.c
executables/nr-gnb.c
+1
-1
executables/nr-ru.c
executables/nr-ru.c
+1
-0
openair1/PHY/INIT/nr_init_ru.c
openair1/PHY/INIT/nr_init_ru.c
+2
-1
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
+1
-1
openair1/SCHED_NR/nr_ru_procedures.c
openair1/SCHED_NR/nr_ru_procedures.c
+15
-9
openair2/COMMON/rrc_messages_types.h
openair2/COMMON/rrc_messages_types.h
+1
-0
openair2/ENB_APP/enb_paramdef.h
openair2/ENB_APP/enb_paramdef.h
+4
-2
openair2/F1AP/f1ap_cu_ue_context_management.c
openair2/F1AP/f1ap_cu_ue_context_management.c
+45
-23
openair2/F1AP/f1ap_du_ue_context_management.c
openair2/F1AP/f1ap_du_ue_context_management.c
+26
-5
openair2/GNB_APP/gnb_config.c
openair2/GNB_APP/gnb_config.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
+30
-29
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+1
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+1
-0
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
+1
-0
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+6
-1
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+1
-1
openair2/RRC/NR/L2_nr_interface.c
openair2/RRC/NR/L2_nr_interface.c
+21
-1
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+290
-1
openair2/RRC/NR/rrc_gNB_NGAP.c
openair2/RRC/NR/rrc_gNB_NGAP.c
+16
-0
openair2/RRC/NR/rrc_gNB_NGAP.h
openair2/RRC/NR/rrc_gNB_NGAP.h
+4
-0
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+33
-45
No files found.
executables/nr-gnb.c
View file @
3dbf4e94
...
...
@@ -356,7 +356,7 @@ void *nrL1_stats_thread(void *param) {
while
(
!
oai_exit
)
{
sleep
(
1
);
fd
=
fopen
(
"nrL1_stats.log"
,
"w"
);
AssertFatal
(
fd
!=
NULL
,
"Cannot open n
g
L1_stats.log
\n
"
);
AssertFatal
(
fd
!=
NULL
,
"Cannot open n
r
L1_stats.log
\n
"
);
dump_nr_I0_stats
(
fd
,
gNB
);
dump_pusch_stats
(
fd
,
gNB
);
// nr_dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
...
...
executables/nr-ru.c
View file @
3dbf4e94
...
...
@@ -2049,6 +2049,7 @@ static void NRRCconfig_RU(void)
RC
.
ru
[
j
]
->
att_rx
=
*
(
RUParamList
.
paramarray
[
j
][
RU_ATT_RX_IDX
].
uptr
);
RC
.
ru
[
j
]
->
if_frequency
=
*
(
RUParamList
.
paramarray
[
j
][
RU_IF_FREQUENCY
].
u64ptr
);
RC
.
ru
[
j
]
->
if_freq_offset
=
*
(
RUParamList
.
paramarray
[
j
][
RU_IF_FREQ_OFFSET
].
iptr
);
RC
.
ru
[
j
]
->
do_precoding
=
*
(
RUParamList
.
paramarray
[
j
][
RU_DO_PRECODING
].
iptr
);
if
(
config_isparamset
(
RUParamList
.
paramarray
[
j
],
RU_BF_WEIGHTS_LIST_IDX
))
{
RC
.
ru
[
j
]
->
nb_bfw
=
RUParamList
.
paramarray
[
j
][
RU_BF_WEIGHTS_LIST_IDX
].
numelt
;
...
...
openair1/PHY/INIT/nr_init_ru.c
View file @
3dbf4e94
...
...
@@ -138,8 +138,9 @@ int nr_phy_init_RU(RU_t *ru) {
ru
->
beam_weights
[
i
][
p
]
=
(
int32_t
**
)
malloc16_clear
(
ru
->
nb_tx
*
sizeof
(
int32_t
*
));
for
(
j
=
0
;
j
<
ru
->
nb_tx
;
j
++
)
{
ru
->
beam_weights
[
i
][
p
][
j
]
=
(
int32_t
*
)
malloc16_clear
(
fp
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
AssertFatal
(
ru
->
bw_list
[
i
],
"ru->bw_list[%d] is null
\n
"
,
i
);
for
(
re
=
0
;
re
<
fp
->
ofdm_symbol_size
;
re
++
)
ru
->
beam_weights
[
i
][
p
][
j
][
re
]
=
ru
->
bw_list
[
j
][
l_ind
];
ru
->
beam_weights
[
i
][
p
][
j
][
re
]
=
ru
->
bw_list
[
i
][
l_ind
];
//printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j);
l_ind
++
;
}
// for j
...
...
openair1/PHY/NR_TRANSPORT/nr_ulsch.c
View file @
3dbf4e94
...
...
@@ -150,7 +150,7 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
gNB
->
ulsch_stats
[
i
].
rnti
,
aa
,
gNB
->
ulsch_stats
[
i
].
power
[
aa
]
/
10
,
gNB
->
ulsch_stats
[
i
].
power
[
aa
]
%
10
,
aa
,
gNB
->
ulsch_stats
[
i
].
noise_power
[
aa
]
/
10
,
gNB
->
ulsch_stats
[
i
].
noise_power
[
aa
]
%
10
);
else
stroff
+=
sprintf
(
output
+
stroff
,
"
ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d
\n
"
,
else
stroff
+=
sprintf
(
output
+
stroff
,
"
ulsch_power[%d] %d.%d ulsch_noise_power[%d] %d.%d
\n
"
,
aa
,
gNB
->
ulsch_stats
[
i
].
power
[
aa
]
/
10
,
gNB
->
ulsch_stats
[
i
].
power
[
aa
]
%
10
,
aa
,
gNB
->
ulsch_stats
[
i
].
noise_power
[
aa
]
/
10
,
gNB
->
ulsch_stats
[
i
].
noise_power
[
aa
]
%
10
);
...
...
openair1/SCHED_NR/nr_ru_procedures.c
View file @
3dbf4e94
...
...
@@ -197,18 +197,17 @@ void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC
+
j
,
1
);
start_meas
(
&
ru
->
txdataF_copy_stats
);
if
(
ru
->
num_gNB
==
1
){
gNB
=
ru
->
gNB_list
[
0
];
cfg
=
&
gNB
->
gNB_config
;
AssertFatal
(
ru
->
num_gNB
==
1
,
"num_gNB>1, help
\n
"
);
gNB
=
ru
->
gNB_list
[
0
];
cfg
=
&
gNB
->
gNB_config
;
for
(
i
=
0
;
i
<
ru
->
nb_tx
;
++
i
){
memcpy
((
void
*
)
&
ru
->
common
.
txdataF
[
i
][
j
*
fp
->
ofdm_symbol_size
],
(
void
*
)
&
gNB
->
common_vars
.
txdataF
[
i
][
j
*
fp
->
ofdm_symbol_size
+
txdataF_offset
],
fp
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
for
(
i
=
0
;
i
<
ru
->
nb_tx
;
++
i
){
memcpy
((
void
*
)
&
ru
->
common
.
txdataF
[
i
][
j
*
fp
->
ofdm_symbol_size
],
(
void
*
)
&
gNB
->
common_vars
.
txdataF
[
i
][
j
*
fp
->
ofdm_symbol_size
+
txdataF_offset
],
fp
->
ofdm_symbol_size
*
sizeof
(
int32_t
));
}
}
}
//num_gNB == 1
stop_meas
(
&
ru
->
txdataF_copy_stats
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC
+
j
,
0
);
...
...
@@ -317,6 +316,13 @@ static void *nr_feptx_thread(void *param) {
(
void
*
)
&
ru
->
gNB_list
[
0
]
->
common_vars
.
txdataF
[
0
][
txdataF_offset
+
l
*
fp
->
ofdm_symbol_size
],
(
fp
->
samples_per_slot_wCP
>>
1
)
*
sizeof
(
int32_t
));
}
else
if
(
ru
->
do_precoding
==
0
)
{
int
gNB_tx
=
ru
->
gNB_list
[
0
]
->
frame_parms
.
nb_antennas_tx
;
for
(
int
aa
=
0
;
aa
<
ru
->
nb_tx
;
aa
++
)
memcpy
((
void
*
)
&
ru
->
common
.
txdataF_BF
[
aa
][
l
*
fp
->
ofdm_symbol_size
],
(
void
*
)
&
ru
->
gNB_list
[
0
]
->
common_vars
.
txdataF
[
aa
%
gNB_tx
][
txdataF_offset
+
l
*
fp
->
ofdm_symbol_size
],
(
fp
->
samples_per_slot_wCP
>>
1
)
*
sizeof
(
int32_t
));
}
else
{
bw
=
ru
->
beam_weights
[
0
];
for
(
i
=
0
;
i
<
fp
->
symbols_per_slot
>>
1
;
++
i
){
...
...
openair2/COMMON/rrc_messages_types.h
View file @
3dbf4e94
...
...
@@ -405,6 +405,7 @@ typedef struct NRRrcConfigurationReq_s {
uint16_t
mcc
[
PLMN_LIST_MAX_SIZE
];
uint16_t
mnc
[
PLMN_LIST_MAX_SIZE
];
uint8_t
mnc_digit_length
[
PLMN_LIST_MAX_SIZE
];
uint8_t
num_plmn
;
NR_ServingCellConfigCommon_t
*
scc
;
NR_ServingCellConfig_t
*
scd
;
int
ssb_SubcarrierOffset
;
...
...
openair2/ENB_APP/enb_paramdef.h
View file @
3dbf4e94
...
...
@@ -98,6 +98,7 @@ typedef enum {
#define CONFIG_STRING_RU_BF_WEIGHTS_LIST "bf_weights"
#define CONFIG_STRING_RU_IF_FREQUENCY "if_freq"
#define CONFIG_STRING_RU_IF_FREQ_OFFSET "if_offset"
#define CONFIG_STRING_RU_DO_PRECODING "do_precoding"
#define RU_LOCAL_IF_NAME_IDX 0
#define RU_LOCAL_ADDRESS_IDX 1
...
...
@@ -127,7 +128,7 @@ typedef enum {
#define RU_BF_WEIGHTS_LIST_IDX 25
#define RU_IF_FREQUENCY 26
#define RU_IF_FREQ_OFFSET 27
#define RU_DO_PRECODING 28
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
/* RU configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
...
...
@@ -160,7 +161,8 @@ typedef enum {
{CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
{CONFIG_STRING_RU_BF_WEIGHTS_LIST, NULL, 0, iptr:NULL, defintarrayval:DEFBFW, TYPE_INTARRAY, 0}, \
{CONFIG_STRING_RU_IF_FREQUENCY, NULL, 0, u64ptr:NULL, defuintval:0, TYPE_UINT64, 0}, \
{CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
{CONFIG_STRING_RU_IF_FREQ_OFFSET, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
{CONFIG_STRING_RU_DO_PRECODING, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
}
/*---------------------------------------------------------------------------------------------------------------------------------------*/
...
...
openair2/F1AP/f1ap_cu_ue_context_management.c
View file @
3dbf4e94
...
...
@@ -39,8 +39,10 @@
#include "rrc_extern.h"
#include "rrc_eNB_UE_context.h"
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
#include "rrc_eNB_S1AP.h"
#include "rrc_eNB_GTPV1U.h"
#include "openair2/RRC/NR/rrc_gNB_NGAP.h"
extern
f1ap_setup_req_t
*
f1ap_du_data_from_du
;
extern
f1ap_cudu_inst_t
f1ap_cu_inst
[
MAX_eNB
];
...
...
@@ -1029,35 +1031,55 @@ int CU_handle_UE_CONTEXT_RELEASE_COMPLETE(instance_t instance,
// F1AP_CriticalityDiagnostics_IE_List
}
struct
rrc_eNB_ue_context_s
*
ue_context_p
=
rrc_eNB_get_ue_context
(
RC
.
rrc
[
instance
],
rnti
);
protocol_ctxt_t
ctxt
;
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
instance
,
ENB_FLAG_YES
,
rnti
,
0
,
0
,
instance
);
if
(
ue_context_p
)
{
/* The following is normally done in the function rrc_rx_tx() */
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT
(
instance
,
ue_context_p
->
ue_context
.
eNB_ue_s1ap_id
);
rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ
(
instance
,
ue_context_p
);
// erase data of GTP tunnels in UE context
for
(
int
e_rab
=
0
;
e_rab
<
ue_context_p
->
ue_context
.
nb_of_e_rabs
;
e_rab
++
)
{
ue_context_p
->
ue_context
.
enb_gtp_teid
[
e_rab
]
=
0
;
memset
(
&
ue_context_p
->
ue_context
.
enb_gtp_addrs
[
e_rab
],
0
,
sizeof
(
ue_context_p
->
ue_context
.
enb_gtp_addrs
[
e_rab
]));
ue_context_p
->
ue_context
.
enb_gtp_ebi
[
e_rab
]
=
0
;
}
if
(
RC
.
nrrrc
[
instance
]
->
node_type
==
ngran_gNB_CU
)
{
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
instance
],
rnti
);
struct
rrc_ue_s1ap_ids_s
*
rrc_ue_s1ap_ids
=
rrc_eNB_S1AP_get_ue_ids
(
RC
.
rrc
[
instance
],
0
,
ue_context_p
->
ue_context
.
eNB_ue_s1ap_id
);
if
(
rrc_ue_s1ap_ids
)
rrc_eNB_S1AP_remove_ue_ids
(
RC
.
rrc
[
instance
],
rrc_ue_s1ap_ids
);
if
(
ue_context_p
)
{
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_CU_F1
,
0
,
NGAP_UE_CONTEXT_RELEASE_COMPLETE
);
NGAP_UE_CONTEXT_RELEASE_COMPLETE
(
msg
).
gNB_ue_ngap_id
=
ue_context_p
->
ue_context
.
gNB_ue_ngap_id
;
itti_send_msg_to_task
(
TASK_NGAP
,
instance
,
msg
);
rrc_gNB_remove_ue_context
(
&
ctxt
,
RC
.
nrrrc
[
instance
],
ue_context_p
);
}
else
{
LOG_E
(
F1AP
,
"could not find ue_context of UE RNTI %x
\n
"
,
rnti
);
}
#ifdef ITTI_SIM
return
0
;
#endif
/* trigger UE release in RRC */
rrc_eNB_remove_ue_context
(
&
ctxt
,
RC
.
rrc
[
instance
],
ue_context_p
);
}
else
{
LOG_E
(
F1AP
,
"could not find ue_context of UE RNTI %x
\n
"
,
rnti
);
struct
rrc_eNB_ue_context_s
*
ue_context_p
=
rrc_eNB_get_ue_context
(
RC
.
rrc
[
instance
],
rnti
);
if
(
ue_context_p
)
{
/* The following is normally done in the function rrc_rx_tx() */
rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_CPLT
(
instance
,
ue_context_p
->
ue_context
.
eNB_ue_s1ap_id
);
rrc_eNB_send_GTPV1U_ENB_DELETE_TUNNEL_REQ
(
instance
,
ue_context_p
);
// erase data of GTP tunnels in UE context
for
(
int
e_rab
=
0
;
e_rab
<
ue_context_p
->
ue_context
.
nb_of_e_rabs
;
e_rab
++
)
{
ue_context_p
->
ue_context
.
enb_gtp_teid
[
e_rab
]
=
0
;
memset
(
&
ue_context_p
->
ue_context
.
enb_gtp_addrs
[
e_rab
],
0
,
sizeof
(
ue_context_p
->
ue_context
.
enb_gtp_addrs
[
e_rab
]));
ue_context_p
->
ue_context
.
enb_gtp_ebi
[
e_rab
]
=
0
;
}
struct
rrc_ue_s1ap_ids_s
*
rrc_ue_s1ap_ids
=
rrc_eNB_S1AP_get_ue_ids
(
RC
.
rrc
[
instance
],
0
,
ue_context_p
->
ue_context
.
eNB_ue_s1ap_id
);
if
(
rrc_ue_s1ap_ids
)
rrc_eNB_S1AP_remove_ue_ids
(
RC
.
rrc
[
instance
],
rrc_ue_s1ap_ids
);
/* trigger UE release in RRC */
rrc_eNB_remove_ue_context
(
&
ctxt
,
RC
.
rrc
[
instance
],
ue_context_p
);
}
else
{
LOG_E
(
F1AP
,
"could not find ue_context of UE RNTI %x
\n
"
,
rnti
);
}
}
pdcp_remove_UE
(
&
ctxt
);
...
...
openair2/F1AP/f1ap_du_ue_context_management.c
View file @
3dbf4e94
...
...
@@ -38,6 +38,8 @@
#include "rrc_extern.h"
#include "rrc_eNB_UE_context.h"
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
// undefine C_RNTI from
// openair1/PHY/LTE_TRANSPORT/transport_common.h which
...
...
@@ -664,11 +666,21 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
rnti
,
ctxt
.
rnti
);
int
UE_out_of_sync
=
0
;
for
(
int
n
=
0
;
n
<
MAX_MOBILES_PER_ENB
;
++
n
)
{
if
(
RC
.
mac
[
instance
]
->
UE_info
.
active
[
n
]
==
TRUE
&&
rnti
==
UE_RNTI
(
instance
,
n
))
{
UE_out_of_sync
=
RC
.
mac
[
instance
]
->
UE_info
.
UE_sched_ctrl
[
n
].
ul_out_of_sync
;
break
;
if
(
RC
.
nrrrc
[
instance
]
->
node_type
==
ngran_gNB_DU
)
{
for
(
int
n
=
0
;
n
<
MAX_MOBILES_PER_GNB
;
++
n
)
{
if
(
RC
.
nrmac
[
instance
]
->
UE_info
.
active
[
n
]
==
TRUE
&&
rnti
==
RC
.
nrmac
[
instance
]
->
UE_info
.
rnti
[
n
])
{
UE_out_of_sync
=
0
;
break
;
}
}
}
else
{
for
(
int
n
=
0
;
n
<
MAX_MOBILES_PER_ENB
;
++
n
)
{
if
(
RC
.
mac
[
instance
]
->
UE_info
.
active
[
n
]
==
TRUE
&&
rnti
==
UE_RNTI
(
instance
,
n
))
{
UE_out_of_sync
=
RC
.
mac
[
instance
]
->
UE_info
.
UE_sched_ctrl
[
n
].
ul_out_of_sync
;
break
;
}
}
}
...
...
@@ -718,6 +730,15 @@ int DU_handle_UE_CONTEXT_RELEASE_COMMAND(instance_t instance,
}
}
if
(
RC
.
nrrrc
[
instance
]
->
node_type
==
ngran_gNB_DU
)
{
// struct rrc_gNB_ue_context_s *ue_context_p;
f1ap_ue_context_release_cplt_t
cplt
;
cplt
.
rnti
=
ctxt
.
rnti
;
DU_send_UE_CONTEXT_RELEASE_COMPLETE
(
instance
,
&
cplt
);
return
0
;
}
struct
rrc_eNB_ue_context_s
*
ue_context_p
;
ue_context_p
=
rrc_eNB_get_ue_context
(
RC
.
rrc
[
ctxt
.
module_id
],
ctxt
.
rnti
);
...
...
openair2/GNB_APP/gnb_config.c
View file @
3dbf4e94
...
...
@@ -1028,7 +1028,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
AssertFatal
(
0
,
"The number of PLMN IDs must be in [1,6], but is %d
\n
"
,
PLMNParamList
.
numelt
);
RRC_CONFIGURATION_REQ
(
msg_p
).
num_plmn
=
PLMNParamList
.
numelt
;
NR
RRC_CONFIGURATION_REQ
(
msg_p
).
num_plmn
=
PLMNParamList
.
numelt
;
for
(
int
l
=
0
;
l
<
PLMNParamList
.
numelt
;
++
l
)
{
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c
View file @
3dbf4e94
...
...
@@ -55,55 +55,56 @@
#include "nfapi/oai_integration/vendor_ext.h"
#include "executables/nr-softmodem.h"
#include <errno.h>
#include <string.h>
uint16_t
nr_pdcch_order_table
[
6
]
=
{
31
,
31
,
511
,
2047
,
2047
,
8191
};
void
clear_mac_stats
(
gNB_MAC_INST
*
gNB
)
{
memset
((
void
*
)
gNB
->
UE_info
.
mac_stats
,
0
,
MAX_MOBILES_PER_GNB
*
sizeof
(
NR_mac_stats_t
));
}
#define MACSTATSSTRLEN 16384
void
dump_mac_stats
(
gNB_MAC_INST
*
gNB
)
{
NR_UE_info_t
*
UE_info
=
&
gNB
->
UE_info
;
int
num
=
1
;
FILE
*
fd
=
fopen
(
"nrMAC_stats.log"
,
"w"
);
AssertFatal
(
fd
!=
NULL
,
"Cannot open nrMAC_stats.log, error %s
\n
"
,
strerror
(
errno
));
char
output
[
MACSTATSSTRLEN
];
memset
(
output
,
0
,
MACSTATSSTRLEN
);
int
stroff
=
0
;
for
(
int
UE_id
=
UE_info
->
list
.
head
;
UE_id
>=
0
;
UE_id
=
UE_info
->
list
.
next
[
UE_id
])
{
LOG_I
(
NR_MAC
,
"UE ID %d RNTI %04x (%d/%d) PH %d dB PCMAX %d dBm
\n
"
,
UE_id
,
UE_info
->
rnti
[
UE_id
],
num
++
,
UE_info
->
num_UEs
,
UE_info
->
UE_sched_ctrl
[
UE_id
].
ph
,
UE_info
->
UE_sched_ctrl
[
UE_id
].
pcmax
);
stroff
=
sprintf
(
output
,
"UE ID %d RNTI %04x (%d/%d)
\n
"
,
UE_id
,
UE_info
->
rnti
[
UE_id
],
num
++
,
UE_info
->
num_UEs
);
NR_mac_stats_t
*
stats
=
&
UE_info
->
mac_stats
[
UE_id
];
const
int
avg_rsrp
=
stats
->
num_rsrp_meas
>
0
?
stats
->
cumul_rsrp
/
stats
->
num_rsrp_meas
:
0
;
LOG_I
(
NR_MAC
,
"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)
\n
"
,
UE_id
,
stats
->
dlsch_rounds
[
0
],
stats
->
dlsch_rounds
[
1
],
stats
->
dlsch_rounds
[
2
],
stats
->
dlsch_rounds
[
3
],
stats
->
dlsch_errors
,
avg_rsrp
,
stats
->
num_rsrp_meas
);
stroff
+=
sprintf
(
output
+
stroff
,
"UE %d: dlsch_rounds %d/%d/%d/%d, dlsch_errors %d, average RSRP %d (%d meas)
\n
"
,
UE_id
,
stats
->
dlsch_rounds
[
0
],
stats
->
dlsch_rounds
[
1
],
stats
->
dlsch_rounds
[
2
],
stats
->
dlsch_rounds
[
3
],
stats
->
dlsch_errors
,
avg_rsrp
,
stats
->
num_rsrp_meas
);
stats
->
num_rsrp_meas
=
0
;
stats
->
cumul_rsrp
=
0
;
LOG_I
(
NR_MAC
,
"UE %d: dlsch_total_bytes %d
\n
"
,
UE_id
,
stats
->
dlsch_total_bytes
);
const
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
LOG_I
(
NR_MAC
,
"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_errors %d, PUSCH SNR %2.1f dB, PUCCH SNR %2.1f dB, noise rssi %2.1f dB
\n
"
,
UE_id
,
stats
->
ulsch_rounds
[
0
],
stats
->
ulsch_rounds
[
1
],
stats
->
ulsch_rounds
[
2
],
stats
->
ulsch_rounds
[
3
],
stats
->
ulsch_errors
,
(
float
)
sched_ctrl
->
pusch_snrx10
/
10
,
(
float
)
sched_ctrl
->
pucch_snrx10
/
10
,
(
float
)
(
sched_ctrl
->
raw_rssi
-
1280
)
/
10
);
LOG_I
(
NR_MAC
,
"UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d
\n
"
,
UE_id
,
stats
->
ulsch_total_bytes_scheduled
,
stats
->
ulsch_total_bytes_rx
);
stroff
+=
sprintf
(
output
+
stroff
,
"UE %d: dlsch_total_bytes %d
\n
"
,
UE_id
,
stats
->
dlsch_total_bytes
);
stroff
+=
sprintf
(
output
+
stroff
,
"UE %d: ulsch_rounds %d/%d/%d/%d, ulsch_DTX %d, ulsch_errors %d
\n
"
,
UE_id
,
stats
->
ulsch_rounds
[
0
],
stats
->
ulsch_rounds
[
1
],
stats
->
ulsch_rounds
[
2
],
stats
->
ulsch_rounds
[
3
],
stats
->
ulsch_DTX
,
stats
->
ulsch_errors
);
stroff
+=
sprintf
(
output
+
stroff
,
"UE %d: ulsch_total_bytes_scheduled %d, ulsch_total_bytes_received %d
\n
"
,
UE_id
,
stats
->
ulsch_total_bytes_scheduled
,
stats
->
ulsch_total_bytes_rx
);
for
(
int
lc_id
=
0
;
lc_id
<
63
;
lc_id
++
)
{
if
(
stats
->
lc_bytes_tx
[
lc_id
]
>
0
)
LOG_D
(
NR_MAC
,
"UE %d: LCID %d: %d bytes TX
\n
"
,
UE_id
,
lc_id
,
stats
->
lc_bytes_tx
[
lc_id
]);
stroff
+=
sprintf
(
output
+
stroff
,
"UE %d: LCID %d: %d bytes TX
\n
"
,
UE_id
,
lc_id
,
stats
->
lc_bytes_tx
[
lc_id
]);
if
(
stats
->
lc_bytes_rx
[
lc_id
]
>
0
)
LOG_D
(
NR_MAC
,
"UE %d: LCID %d: %d bytes RX
\n
"
,
UE_id
,
lc_id
,
stats
->
lc_bytes_rx
[
lc_id
]);
stroff
+=
sprintf
(
output
+
stroff
,
"UE %d: LCID %d: %d bytes RX
\n
"
,
UE_id
,
lc_id
,
stats
->
lc_bytes_rx
[
lc_id
]);
}
}
print_meas
(
&
gNB
->
eNB_scheduler
,
"DL & UL scheduling timing stats"
,
NULL
,
NULL
);
if
(
stroff
>
0
)
fprintf
(
fd
,
"%s"
,
output
);
fclose
(
fd
);
}
void
clear_nr_nfapi_information
(
gNB_MAC_INST
*
gNB
,
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
3dbf4e94
...
...
@@ -574,6 +574,7 @@ void pf_dl(module_id_t module_id,
NR_UE_sched_ctrl_t
*
sched_ctrl
=
&
UE_info
->
UE_sched_ctrl
[
UE_id
];
NR_sched_pdsch_t
*
sched_pdsch
=
&
sched_ctrl
->
sched_pdsch
;
NR_pdsch_semi_static_t
*
ps
=
&
sched_ctrl
->
pdsch_semi_static
;
if
(
sched_ctrl
->
ul_failure
==
1
)
continue
;
/* get the PID of a HARQ process awaiting retrnasmission, or -1 otherwise */
sched_pdsch
->
dl_harq_pid
=
sched_ctrl
->
retrans_dl_harq
.
head
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
3dbf4e94
...
...
@@ -659,6 +659,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if
(
UE_info
->
UE_sched_ctrl
[
UE_id
].
pusch_consecutive_dtx_cnt
>=
pusch_failure_thres
)
{
LOG_D
(
NR_MAC
,
"Detected UL Failure on PUSCH, stopping scheduling
\n
"
);
UE_info
->
UE_sched_ctrl
[
UE_id
].
ul_failure
=
1
;
nr_mac_eNB_rrc_ul_failure
(
gnb_mod_idP
,
CC_idP
,
frameP
,
slotP
,
rntiP
);
}
}
}
else
if
(
sduP
)
{
...
...
openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h
View file @
3dbf4e94
...
...
@@ -609,6 +609,7 @@ typedef struct {
int
dlsch_current_bytes
;
int
ulsch_rounds
[
8
];
int
ulsch_errors
;
int
ulsch_DTX
;
int
ulsch_total_bytes_scheduled
;
int
ulsch_total_bytes_rx
;
int
ulsch_current_bytes
;
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
View file @
3dbf4e94
...
...
@@ -890,7 +890,7 @@ boolean_t nr_rrc_pdcp_config_asn1_req(
//ctxt_pP->configured != 2 ||
//srb2add_list == NULL ||
//drb2add_list != NULL ||
drb2release_list
!=
NULL
||
//
drb2release_list != NULL ||
//security_modeP != 255 ||
//kRRCenc != NULL ||
//kRRCint != NULL ||
...
...
@@ -919,6 +919,10 @@ boolean_t nr_rrc_pdcp_config_asn1_req(
if
(
kRRCint
!=
NULL
)
{
/* todo */
}
if
(
drb2release_list
!=
NULL
)
{
// TODO
}
free
(
kRRCenc
);
free
(
kRRCint
);
...
...
@@ -1184,6 +1188,7 @@ static boolean_t pdcp_data_req_drb(
if
(
rb
==
NULL
)
{
LOG_E
(
PDCP
,
"%s:%d:%s: no DRB found (rnti %d, rb_id %ld)
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
rnti
,
rb_id
);
nr_pdcp_manager_unlock
(
nr_pdcp_ue_manager
);
return
0
;
}
...
...
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
View file @
3dbf4e94
...
...
@@ -918,7 +918,7 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt
if
(
drb2release_listP
!=
NULL
)
{
LOG_E
(
RLC
,
"%s:%d:%s: TODO
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
//
exit(1);
}
if
(
srb2add_listP
!=
NULL
)
{
...
...
openair2/RRC/NR/L2_nr_interface.c
View file @
3dbf4e94
...
...
@@ -361,4 +361,24 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
}
return
0
;
}
\ No newline at end of file
}
void
nr_mac_eNB_rrc_ul_failure
(
const
module_id_t
Mod_instP
,
const
int
CC_idP
,
const
frame_t
frameP
,
const
sub_frame_t
subframeP
,
const
rnti_t
rntiP
)
{
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
NULL
;
ue_context_p
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
Mod_instP
],
rntiP
);
if
(
ue_context_p
!=
NULL
)
{
LOG_I
(
RRC
,
"Frame %d, Subframe %d: UE %x UL failure, activating timer
\n
"
,
frameP
,
subframeP
,
rntiP
);
if
(
ue_context_p
->
ue_context
.
ul_failure_timer
==
0
)
ue_context_p
->
ue_context
.
ul_failure_timer
=
1
;
}
else
{
LOG_W
(
RRC
,
"Frame %d, Subframe %d: UL failure: UE %x unknown
\n
"
,
frameP
,
subframeP
,
rntiP
);
}
}
openair2/RRC/NR/rrc_gNB.c
View file @
3dbf4e94
...
...
@@ -2770,9 +2770,291 @@ void rrc_gNB_process_dc_overall_timeout(const module_id_t gnb_mod_idP, x2ap_ENDC
rrc_remove_nsa_user
(
rrc
,
m
->
rnti
);
}
unsigned
int
mask_flip
(
unsigned
int
x
)
{
return
((((
x
>>
8
)
+
(
x
<<
8
))
&
0xffff
)
>>
6
);
}
unsigned
int
get_dl_bw_mask
(
gNB_RRC_INST
*
rrc
,
NR_UE_NR_Capability_t
*
cap
)
{
int
common_band
=
*
rrc
->
carrier
.
servingcellconfigcommon
->
downlinkConfigCommon
->
frequencyInfoDL
->
frequencyBandList
.
list
.
array
[
0
];
int
common_scs
=
rrc
->
carrier
.
servingcellconfigcommon
->
downlinkConfigCommon
->
frequencyInfoDL
->
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
;
for
(
int
i
=
0
;
i
<
cap
->
rf_Parameters
.
supportedBandListNR
.
list
.
count
;
i
++
)
{
NR_BandNR_t
*
bandNRinfo
=
cap
->
rf_Parameters
.
supportedBandListNR
.
list
.
array
[
i
];
if
(
bandNRinfo
->
bandNR
==
common_band
)
{
if
(
common_band
<
257
)
{
// FR1
switch
(
common_scs
)
{
case
NR_SubcarrierSpacing_kHz15
:
if
(
bandNRinfo
->
channelBWs_DL
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr1
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr1
->
scs_15kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_DL
->
choice
.
fr1
->
scs_15kHz
->
buf
));
break
;
case
NR_SubcarrierSpacing_kHz30
:
if
(
bandNRinfo
->
channelBWs_DL
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr1
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr1
->
scs_30kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_DL
->
choice
.
fr1
->
scs_30kHz
->
buf
));
break
;
case
NR_SubcarrierSpacing_kHz60
:
if
(
bandNRinfo
->
channelBWs_DL
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr1
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr1
->
scs_60kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_DL
->
choice
.
fr1
->
scs_60kHz
->
buf
));
break
;
}
}
else
{
switch
(
common_scs
)
{
case
NR_SubcarrierSpacing_kHz60
:
if
(
bandNRinfo
->
channelBWs_DL
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr2
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr2
->
scs_60kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_DL
->
choice
.
fr2
->
scs_60kHz
->
buf
));
break
;
case
NR_SubcarrierSpacing_kHz120
:
if
(
bandNRinfo
->
channelBWs_DL
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr2
&&
bandNRinfo
->
channelBWs_DL
->
choice
.
fr2
->
scs_120kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_DL
->
choice
.
fr2
->
scs_120kHz
->
buf
));
break
;
}
}
}
}
return
(
0
);
}
unsigned
int
get_ul_bw_mask
(
gNB_RRC_INST
*
rrc
,
NR_UE_NR_Capability_t
*
cap
)
{
int
common_band
=
*
rrc
->
carrier
.
servingcellconfigcommon
->
uplinkConfigCommon
->
frequencyInfoUL
->
frequencyBandList
->
list
.
array
[
0
];
int
common_scs
=
rrc
->
carrier
.
servingcellconfigcommon
->
uplinkConfigCommon
->
frequencyInfoUL
->
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
;
for
(
int
i
=
0
;
i
<
cap
->
rf_Parameters
.
supportedBandListNR
.
list
.
count
;
i
++
)
{
NR_BandNR_t
*
bandNRinfo
=
cap
->
rf_Parameters
.
supportedBandListNR
.
list
.
array
[
i
];
if
(
bandNRinfo
->
bandNR
==
common_band
)
{
if
(
common_band
<
257
)
{
// FR1
switch
(
common_scs
)
{
case
NR_SubcarrierSpacing_kHz15
:
if
(
bandNRinfo
->
channelBWs_UL
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr1
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr1
->
scs_15kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_UL
->
choice
.
fr1
->
scs_15kHz
->
buf
));
break
;
case
NR_SubcarrierSpacing_kHz30
:
if
(
bandNRinfo
->
channelBWs_UL
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr1
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr1
->
scs_30kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_UL
->
choice
.
fr1
->
scs_30kHz
->
buf
));
break
;
case
NR_SubcarrierSpacing_kHz60
:
if
(
bandNRinfo
->
channelBWs_UL
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr1
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr1
->
scs_60kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_UL
->
choice
.
fr1
->
scs_60kHz
->
buf
));
break
;
}
}
else
{
switch
(
common_scs
)
{
case
NR_SubcarrierSpacing_kHz60
:
if
(
bandNRinfo
->
channelBWs_UL
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr2
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr2
->
scs_60kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_UL
->
choice
.
fr2
->
scs_60kHz
->
buf
));
break
;
case
NR_SubcarrierSpacing_kHz120
:
if
(
bandNRinfo
->
channelBWs_UL
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr2
&&
bandNRinfo
->
channelBWs_UL
->
choice
.
fr2
->
scs_120kHz
)
return
(
mask_flip
((
unsigned
int
)
*
(
uint16_t
*
)
bandNRinfo
->
channelBWs_UL
->
choice
.
fr2
->
scs_120kHz
->
buf
));
break
;
}
}
}
}
return
(
0
);
}
int
is_dl_256QAM_supported
(
gNB_RRC_INST
*
rrc
,
NR_UE_NR_Capability_t
*
cap
)
{
int
common_band
=
*
rrc
->
carrier
.
servingcellconfigcommon
->
downlinkConfigCommon
->
frequencyInfoDL
->
frequencyBandList
.
list
.
array
[
0
];
int
common_scs
=
rrc
->
carrier
.
servingcellconfigcommon
->
downlinkConfigCommon
->
frequencyInfoDL
->
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
;
if
(
common_band
>
256
)
{
for
(
int
i
=
0
;
i
<
cap
->
rf_Parameters
.
supportedBandListNR
.
list
.
count
;
i
++
)
{
NR_BandNR_t
*
bandNRinfo
=
cap
->
rf_Parameters
.
supportedBandListNR
.
list
.
array
[
i
];
if
(
bandNRinfo
->
bandNR
==
common_band
&&
!
bandNRinfo
->
pdsch_256QAM_FR2
)
return
(
0
);
}
}
else
if
(
cap
->
phy_Parameters
.
phy_ParametersFR1
&&
!
cap
->
phy_Parameters
.
phy_ParametersFR1
->
pdsch_256QAM_FR1
)
return
(
0
);
// check featureSet
NR_FeatureSets_t
*
fs
=
cap
->
featureSets
;
if
(
fs
)
{
// go through DL feature sets and look for one with current SCS
for
(
int
i
=
0
;
i
<
fs
->
featureSetsDownlinkPerCC
->
list
.
count
;
i
++
)
{
if
(
fs
->
featureSetsDownlinkPerCC
->
list
.
array
[
i
]
->
supportedSubcarrierSpacingDL
==
common_scs
&&
fs
->
featureSetsDownlinkPerCC
->
list
.
array
[
i
]
->
supportedModulationOrderDL
&&
*
fs
->
featureSetsDownlinkPerCC
->
list
.
array
[
i
]
->
supportedModulationOrderDL
==
NR_ModulationOrder_qam256
)
return
(
1
);
}
}
return
(
0
);
}
int
is_ul_256QAM_supported
(
gNB_RRC_INST
*
rrc
,
NR_UE_NR_Capability_t
*
cap
)
{
int
common_band
=
*
rrc
->
carrier
.
servingcellconfigcommon
->
uplinkConfigCommon
->
frequencyInfoUL
->
frequencyBandList
->
list
.
array
[
0
];
int
common_scs
=
rrc
->
carrier
.
servingcellconfigcommon
->
uplinkConfigCommon
->
frequencyInfoUL
->
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
;
for
(
int
i
=
0
;
i
<
cap
->
rf_Parameters
.
supportedBandListNR
.
list
.
count
;
i
++
)
{
NR_BandNR_t
*
bandNRinfo
=
cap
->
rf_Parameters
.
supportedBandListNR
.
list
.
array
[
i
];
if
(
bandNRinfo
->
bandNR
==
common_band
&&
!
bandNRinfo
->
pusch_256QAM
)
return
(
0
);
}
// check featureSet
NR_FeatureSets_t
*
fs
=
cap
->
featureSets
;
if
(
fs
)
{
// go through UL feature sets and look for one with current SCS
for
(
int
i
=
0
;
i
<
fs
->
featureSetsUplinkPerCC
->
list
.
count
;
i
++
)
{
if
(
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
supportedSubcarrierSpacingUL
==
common_scs
&&
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
supportedModulationOrderUL
&&
*
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
supportedModulationOrderUL
==
NR_ModulationOrder_qam256
)
return
(
1
);
}
}
return
(
0
);
}
int
get_ul_mimo_layersCB
(
gNB_RRC_INST
*
rrc
,
NR_UE_NR_Capability_t
*
cap
)
{
int
common_scs
=
rrc
->
carrier
.
servingcellconfigcommon
->
uplinkConfigCommon
->
frequencyInfoUL
->
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
;
// check featureSet
NR_FeatureSets_t
*
fs
=
cap
->
featureSets
;
if
(
fs
)
{
// go through UL feature sets and look for one with current SCS
for
(
int
i
=
0
;
i
<
fs
->
featureSetsUplinkPerCC
->
list
.
count
;
i
++
)
{
if
(
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
supportedSubcarrierSpacingUL
==
common_scs
&&
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
mimo_CB_PUSCH
&&
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
mimo_CB_PUSCH
->
maxNumberMIMO_LayersCB_PUSCH
)
return
(
1
<<*
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
mimo_CB_PUSCH
->
maxNumberMIMO_LayersCB_PUSCH
);
}
}
return
(
1
);
}
int
get_ul_mimo_layers
(
gNB_RRC_INST
*
rrc
,
NR_UE_NR_Capability_t
*
cap
)
{
int
common_scs
=
rrc
->
carrier
.
servingcellconfigcommon
->
uplinkConfigCommon
->
frequencyInfoUL
->
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
;
// check featureSet
NR_FeatureSets_t
*
fs
=
cap
->
featureSets
;
if
(
fs
)
{
// go through UL feature sets and look for one with current SCS
for
(
int
i
=
0
;
i
<
fs
->
featureSetsUplinkPerCC
->
list
.
count
;
i
++
)
{
if
(
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
supportedSubcarrierSpacingUL
==
common_scs
&&
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
maxNumberMIMO_LayersNonCB_PUSCH
)
return
(
1
<<*
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
maxNumberMIMO_LayersNonCB_PUSCH
);
}
}
return
(
1
);
}
int
get_dl_mimo_layers
(
gNB_RRC_INST
*
rrc
,
NR_UE_NR_Capability_t
*
cap
)
{
int
common_scs
=
rrc
->
carrier
.
servingcellconfigcommon
->
downlinkConfigCommon
->
frequencyInfoDL
->
scs_SpecificCarrierList
.
list
.
array
[
0
]
->
subcarrierSpacing
;
// check featureSet
NR_FeatureSets_t
*
fs
=
cap
->
featureSets
;
if
(
fs
)
{
// go through UL feature sets and look for one with current SCS
for
(
int
i
=
0
;
i
<
fs
->
featureSetsDownlinkPerCC
->
list
.
count
;
i
++
)
{
if
(
fs
->
featureSetsUplinkPerCC
->
list
.
array
[
i
]
->
supportedSubcarrierSpacingUL
==
common_scs
&&
fs
->
featureSetsDownlinkPerCC
->
list
.
array
[
i
]
->
maxNumberMIMO_LayersPDSCH
)
return
(
2
<<*
fs
->
featureSetsDownlinkPerCC
->
list
.
array
[
i
]
->
maxNumberMIMO_LayersPDSCH
);
}
}
return
(
1
);
}
void
nr_rrc_subframe_process
(
protocol_ctxt_t
*
const
ctxt_pP
,
const
int
CC_id
)
{
MessageDef
*
msg
;
rrc_gNB_ue_context_t
*
ue_context_p
=
NULL
;
FILE
*
fd
=
fopen
(
"nrRRCstats.log"
,
"w"
);
RB_FOREACH
(
ue_context_p
,
rrc_nr_ue_tree_s
,
&
(
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
rrc_ue_head
))
{
ctxt_pP
->
rnti
=
ue_context_p
->
ue_id_rnti
;
if
(
fd
)
{
if
(
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
presence
==
TRUE
)
{
fprintf
(
fd
,
"NR RRC UE rnti %x: S-TMSI %x failure timer %d/8
\n
"
,
ue_context_p
->
ue_id_rnti
,
ue_context_p
->
ue_context
.
Initialue_identity_5g_s_TMSI
.
fiveg_tmsi
,
ue_context_p
->
ue_context
.
ul_failure_timer
);
}
else
{
fprintf
(
fd
,
"NR RRC UE rnti %x failure timer %d/8
\n
"
,
ue_context_p
->
ue_id_rnti
,
ue_context_p
->
ue_context
.
ul_failure_timer
);
}
if
(
ue_context_p
->
ue_context
.
UE_Capability_nr
)
{
fprintf
(
fd
,
"NR RRC UE cap: BW DL %x. BW UL %x, 256 QAM DL %s, 256 QAM UL %s, DL MIMO Layers %d UL MIMO Layers (CB) %d UL MIMO Layers (nonCB) %d
\n
"
,
get_dl_bw_mask
(
RC
.
nrrrc
[
0
],
ue_context_p
->
ue_context
.
UE_Capability_nr
),
get_ul_bw_mask
(
RC
.
nrrrc
[
0
],
ue_context_p
->
ue_context
.
UE_Capability_nr
),
is_dl_256QAM_supported
(
RC
.
nrrrc
[
0
],
ue_context_p
->
ue_context
.
UE_Capability_nr
)
==
1
?
"yes"
:
"no"
,
is_ul_256QAM_supported
(
RC
.
nrrrc
[
0
],
ue_context_p
->
ue_context
.
UE_Capability_nr
)
==
1
?
"yes"
:
"no"
,
get_dl_mimo_layers
(
RC
.
nrrrc
[
0
],
ue_context_p
->
ue_context
.
UE_Capability_nr
),
get_ul_mimo_layersCB
(
RC
.
nrrrc
[
0
],
ue_context_p
->
ue_context
.
UE_Capability_nr
),
get_ul_mimo_layers
(
RC
.
nrrrc
[
0
],
ue_context_p
->
ue_context
.
UE_Capability_nr
));
}
}
if
(
ue_context_p
->
ue_context
.
ul_failure_timer
>
0
)
{
ue_context_p
->
ue_context
.
ul_failure_timer
++
;
if
(
ue_context_p
->
ue_context
.
ul_failure_timer
>=
20000
)
{
// remove UE after 20 seconds after MAC (or else) has indicated UL failure
LOG_I
(
RRC
,
"Removing UE %x instance, because of uplink failure timer timeout
\n
"
,
ue_context_p
->
ue_context
.
rnti
);
if
(
ue_context_p
->
ue_context
.
StatusRrc
>=
NR_RRC_CONNECTED
){
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_REQ
(
ctxt_pP
->
module_id
,
ue_context_p
,
NGAP_CAUSE_RADIO_NETWORK
,
30
);
}
else
{
mac_remove_nr_ue
(
ctxt_pP
->
module_id
,
ctxt_pP
->
rnti
);
rrc_rlc_remove_ue
(
ctxt_pP
);
pdcp_remove_UE
(
ctxt_pP
);
/* remove RRC UE Context */
ue_context_p
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
ctxt_pP
->
module_id
],
ctxt_pP
->
rnti
);
if
(
ue_context_p
)
{
rrc_gNB_remove_ue_context
(
ctxt_pP
,
RC
.
nrrrc
[
ctxt_pP
->
module_id
],
ue_context_p
);
LOG_I
(
NR_RRC
,
"remove UE %x
\n
"
,
ctxt_pP
->
rnti
);
}
}
break
;
// break RB_FOREACH
}
}
if
(
ue_context_p
->
ue_context
.
ue_release_timer_rrc
>
0
)
{
ue_context_p
->
ue_context
.
ue_release_timer_rrc
++
;
if
(
ue_context_p
->
ue_context
.
ue_release_timer_rrc
>=
ue_context_p
->
ue_context
.
ue_release_timer_thres_rrc
)
{
LOG_I
(
NR_RRC
,
"Removing UE %x instance after UE_CONTEXT_RELEASE_Complete (ue_release_timer_rrc timeout)
\n
"
,
ue_context_p
->
ue_context
.
rnti
);
ue_context_p
->
ue_context
.
ue_release_timer_rrc
=
0
;
mac_remove_nr_ue
(
ctxt_pP
->
module_id
,
ctxt_pP
->
rnti
);
rrc_rlc_remove_ue
(
ctxt_pP
);
pdcp_remove_UE
(
ctxt_pP
);
/* remove RRC UE Context */
ue_context_p
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
ctxt_pP
->
module_id
],
ctxt_pP
->
rnti
);
if
(
ue_context_p
)
{
rrc_gNB_remove_ue_context
(
ctxt_pP
,
RC
.
nrrrc
[
ctxt_pP
->
module_id
],
ue_context_p
);
LOG_I
(
NR_RRC
,
"remove UE %x
\n
"
,
ctxt_pP
->
rnti
);
}
break
;
// break RB_FOREACH
}
}
}
fclose
(
fd
);
/* send a tick to x2ap */
if
(
is_x2ap_enabled
()){
msg
=
itti_alloc_new_message
(
TASK_RRC_ENB
,
0
,
X2AP_SUBFRAME_PROCESS
);
...
...
@@ -3210,6 +3492,8 @@ rrc_gNB_generate_RRCRelease(
size
=
do_NR_RRCRelease
(
buffer
,
rrc_gNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
));
ue_context_pP
->
ue_context
.
ue_reestablishment_timer
=
0
;
ue_context_pP
->
ue_context
.
ue_release_timer
=
0
;
ue_context_pP
->
ue_context
.
ul_failure_timer
=
0
;
ue_context_pP
->
ue_context
.
ue_release_timer_rrc
=
0
;
LOG_I
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" Logical Channel DL-DCCH, Generate RRCRelease (bytes %d)
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
...
...
@@ -3243,11 +3527,13 @@ rrc_gNB_generate_RRCRelease(
itti_send_msg_to_task
(
TASK_RRC_UE_SIM
,
ctxt_pP
->
instance
,
message_p
);
#else
if
(
NODE_IS_CU
(
RC
.
nrrrc
[
ctxt_pP
->
module_id
]
->
node_type
))
{
uint8_t
*
message_buffer
=
itti_malloc
(
TASK_RRC_GNB
,
TASK_CU_F1
,
size
);
memcpy
(
message_buffer
,
buffer
,
size
);
MessageDef
*
m
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
0
,
F1AP_UE_CONTEXT_RELEASE_CMD
);
F1AP_UE_CONTEXT_RELEASE_CMD
(
m
).
rnti
=
ctxt_pP
->
rnti
;
F1AP_UE_CONTEXT_RELEASE_CMD
(
m
).
cause
=
F1AP_CAUSE_RADIO_NETWORK
;
F1AP_UE_CONTEXT_RELEASE_CMD
(
m
).
cause_value
=
10
;
// 10 = F1AP_CauseRadioNetwork_normal_release
F1AP_UE_CONTEXT_RELEASE_CMD
(
m
).
rrc_container
=
buffer
;
F1AP_UE_CONTEXT_RELEASE_CMD
(
m
).
rrc_container
=
message_
buffer
;
F1AP_UE_CONTEXT_RELEASE_CMD
(
m
).
rrc_container_length
=
size
;
itti_send_msg_to_task
(
TASK_CU_F1
,
ctxt_pP
->
module_id
,
m
);
}
else
{
...
...
@@ -3258,6 +3544,9 @@ rrc_gNB_generate_RRCRelease(
size
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE
(
ctxt_pP
->
instance
,
ue_context_pP
->
ue_context
.
gNB_ue_ngap_id
);
ue_context_pP
->
ue_context
.
ue_release_timer_rrc
=
1
;
}
#endif
}
...
...
openair2/RRC/NR/rrc_gNB_NGAP.c
View file @
3dbf4e94
...
...
@@ -735,6 +735,7 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS(
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
NULL
;
protocol_ctxt_t
ctxt
;
memset
(
&
ctxt
,
0
,
sizeof
(
protocol_ctxt_t
));
ue_initial_id
=
NGAP_DOWNLINK_NAS
(
msg_p
).
ue_initial_id
;
gNB_ue_ngap_id
=
NGAP_DOWNLINK_NAS
(
msg_p
).
gNB_ue_ngap_id
;
ue_context_p
=
rrc_gNB_get_ue_context_from_ngap_ids
(
instance
,
ue_initial_id
,
gNB_ue_ngap_id
);
...
...
@@ -823,6 +824,7 @@ rrc_gNB_process_NGAP_DOWNLINK_NAS(
{
// rrc_mac_config_req_gNB
#ifdef ITTI_SIM
MessageDef
*
message_p
;
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
TASK_RRC_GNB
,
TASK_RRC_UE_SIM
,
length
);
memcpy
(
message_buffer
,
buffer
,
length
);
...
...
@@ -1174,11 +1176,25 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(
return
-
1
;
}
else
{
ue_context_p
->
ue_context
.
ue_release_timer_ng
=
0
;
ue_context_p
->
ue_context
.
ue_release_timer_thres_rrc
=
1000
;
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
instance
,
GNB_FLAG_YES
,
ue_context_p
->
ue_context
.
rnti
,
0
,
0
);
ctxt
.
eNB_index
=
0
;
rrc_gNB_generate_RRCRelease
(
&
ctxt
,
ue_context_p
);
return
0
;
}
}
void
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE
(
instance_t
instance
,
uint32_t
gNB_ue_ngap_id
)
{
MSC_LOG_TX_MESSAGE
(
MSC_RRC_GNB
,
MSC_NGAP_GNB
,
NULL
,
0
,
"0 NGAP_UE_CONTEXT_RELEASE_COMPLETE gNB_ue_ngap_id 0x%06"
PRIX32
" "
,
gNB_ue_ngap_id
);
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_RRC_GNB
,
0
,
NGAP_UE_CONTEXT_RELEASE_COMPLETE
);
NGAP_UE_CONTEXT_RELEASE_COMPLETE
(
msg
).
gNB_ue_ngap_id
=
gNB_ue_ngap_id
;
itti_send_msg_to_task
(
TASK_NGAP
,
instance
,
msg
);
}
//------------------------------------------------------------------------------
/*
* Remove UE ids (ue_initial_id and ng_id) from hashtables.
...
...
openair2/RRC/NR/rrc_gNB_NGAP.h
View file @
3dbf4e94
...
...
@@ -129,6 +129,10 @@ rrc_gNB_process_NGAP_UE_CONTEXT_RELEASE_COMMAND(
instance_t
instance
);
void
rrc_gNB_send_NGAP_UE_CONTEXT_RELEASE_COMPLETE
(
instance_t
instance
,
uint32_t
gNB_ue_ngap_id
);
void
rrc_gNB_NGAP_remove_ue_ids
(
gNB_RRC_INST
*
const
rrc_instance_pP
,
...
...
targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
View file @
3dbf4e94
...
...
@@ -647,69 +647,57 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
default:
AssertFatal
(
1
==
0
,
"Shouldn't be here
\n
"
);
}
if
(
cc
>
1
)
{
// receive multiple channels (e.g. RF A and RF B)
std
::
vector
<
void
*>
buff_ptrs
;
samples_received
=
0
;
while
(
samples_received
!=
nsamps
)
{
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
buff_ptrs
.
push_back
(
buff_tmp
[
i
]
+
samples_received
);
samples_received
+=
s
->
rx_stream
->
recv
(
buff_ptrs
,
nsamps
-
samples_received
,
s
->
rx_md
);
samples_received
=
0
;
while
(
samples_received
!=
nsamps
)
{
if
((
s
->
wait_for_first_pps
==
0
)
&&
(
s
->
rx_md
.
error_code
!=
uhd
::
rx_metadata_t
::
ERROR_CODE_NONE
))
break
;
if
(
cc
>
1
)
{
// receive multiple channels (e.g. RF A and RF B)
std
::
vector
<
void
*>
buff_ptrs
;
if
((
s
->
wait_for_first_pps
==
1
)
&&
(
samples_received
!=
nsamps
))
{
printf
(
"sleep...
\n
"
);
//usleep(100);
}
}
if
(
samples_received
==
nsamps
)
s
->
wait_for_first_pps
=
0
;
}
else
{
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
buff_ptrs
.
push_back
(
buff_tmp
[
i
]
+
samples_received
);
samples_received
+=
s
->
rx_stream
->
recv
(
buff_ptrs
,
nsamps
,
s
->
rx_md
);
}
else
{
// receive a single channel (e.g. from connector RF A)
samples_received
=
0
;
while
(
samples_received
!=
nsamps
)
{
samples_received
+=
s
->
rx_stream
->
recv
((
void
*
)((
int32_t
*
)
buff_tmp
[
0
]
+
samples_received
),
nsamps
-
samples_received
,
s
->
rx_md
);
if
((
s
->
wait_for_first_pps
==
0
)
&&
(
s
->
rx_md
.
error_code
!=
uhd
::
rx_metadata_t
::
ERROR_CODE_NONE
))
break
;
samples_received
+=
s
->
rx_stream
->
recv
((
void
*
)((
int32_t
*
)
buff_tmp
[
0
]
+
samples_received
),
nsamps
-
samples_received
,
s
->
rx_md
);
}
if
((
s
->
wait_for_first_pps
==
0
)
&&
(
s
->
rx_md
.
error_code
!=
uhd
::
rx_metadata_t
::
ERROR_CODE_NONE
))
break
;
if
((
s
->
wait_for_first_pps
==
1
)
&&
(
samples_received
!=
nsamps
))
{
printf
(
"sleep...
\n
"
);
//usleep(100);
}
}
if
(
samples_received
==
nsamps
)
s
->
wait_for_first_pps
=
0
;
if
((
s
->
wait_for_first_pps
==
1
)
&&
(
samples_received
!=
nsamps
))
{
printf
(
"sleep...
\n
"
);
//usleep(100);
}
}
if
(
samples_received
==
nsamps
)
s
->
wait_for_first_pps
=
0
;
// bring RX data into 12 LSBs for softmodem RX
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
// bring RX data into 12 LSBs for softmodem RX
for
(
int
i
=
0
;
i
<
cc
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nsamps2
;
j
++
)
{
#if defined(__x86_64__) || defined(__i386__)
#ifdef __AVX2__
// FK: in some cases the buffer might not be 32 byte aligned, so we cannot use avx2
// FK: in some cases the buffer might not be 32 byte aligned, so we cannot use avx2
if
((((
uintptr_t
)
buff
[
i
])
&
0x1F
)
==
0
)
{
((
__m256i
*
)
buff
[
i
])[
j
]
=
_mm256_srai_epi16
(
buff_tmp
[
i
][
j
],
rxshift
);
}
else
{
((
__m128i
*
)
buff
[
i
])[
2
*
j
]
=
_mm_srai_epi16
(((
__m128i
*
)
buff_tmp
[
i
])[
2
*
j
],
rxshift
);
((
__m128i
*
)
buff
[
i
])[
2
*
j
+
1
]
=
_mm_srai_epi16
(((
__m128i
*
)
buff_tmp
[
i
])[
2
*
j
+
1
],
rxshift
);
}
if
((((
uintptr_t
)
buff
[
i
])
&
0x1F
)
==
0
)
{
((
__m256i
*
)
buff
[
i
])[
j
]
=
_mm256_srai_epi16
(
buff_tmp
[
i
][
j
],
rxshift
);
}
else
{
((
__m128i
*
)
buff
[
i
])[
2
*
j
]
=
_mm_srai_epi16
(((
__m128i
*
)
buff_tmp
[
i
])[
2
*
j
],
rxshift
);
((
__m128i
*
)
buff
[
i
])[
2
*
j
+
1
]
=
_mm_srai_epi16
(((
__m128i
*
)
buff_tmp
[
i
])[
2
*
j
+
1
],
rxshift
);
}
#else
((
__m128i
*
)
buff
[
i
])[
j
]
=
_mm_srai_epi16
(
buff_tmp
[
i
][
j
],
rxshift
);
((
__m128i
*
)
buff
[
i
])[
j
]
=
_mm_srai_epi16
(
buff_tmp
[
i
][
j
],
rxshift
);
#endif
#elif defined(__arm__)
((
int16x8_t
*
)
buff
[
i
])[
j
]
=
vshrq_n_s16
(
buff_tmp
[
i
][
j
],
rxshift
);
((
int16x8_t
*
)
buff
[
i
])[
j
]
=
vshrq_n_s16
(
buff_tmp
[
i
][
j
],
rxshift
);
#endif
}
}
}
if
(
samples_received
<
nsamps
)
{
LOG_E
(
HW
,
"[recv] received %d samples out of %d
\n
"
,
samples_received
,
nsamps
);
}
if
(
samples_received
<
nsamps
)
{
LOG_E
(
HW
,
"[recv] received %d samples out of %d
\n
"
,
samples_received
,
nsamps
);
}
if
(
s
->
rx_md
.
error_code
!=
uhd
::
rx_metadata_t
::
ERROR_CODE_NONE
)
LOG_E
(
HW
,
"%s
\n
"
,
s
->
rx_md
.
to_pp_string
(
true
).
c_str
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment