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
lizhongxiao
OpenXG-RAN
Commits
cff0675e
Commit
cff0675e
authored
Nov 30, 2022
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/srb0-use-rlc' into integration_2022_wk48
parents
d3ac2bf1
3cd4b3c3
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
293 additions
and
170 deletions
+293
-170
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
+27
-4
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
+31
-29
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+14
-6
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+2
-2
openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
+4
-6
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+95
-9
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h
+13
-0
openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.c
openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.c
+23
-5
openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h
openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h
+1
-0
openair2/RRC/NR/L2_nr_interface.c
openair2/RRC/NR/L2_nr_interface.c
+1
-23
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+4
-4
openair2/RRC/NR/MESSAGES/asn1_msg.h
openair2/RRC/NR/MESSAGES/asn1_msg.h
+2
-2
openair2/RRC/NR/nr_rrc_defs.h
openair2/RRC/NR/nr_rrc_defs.h
+0
-2
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+76
-78
No files found.
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c
View file @
cff0675e
...
@@ -41,6 +41,9 @@
...
@@ -41,6 +41,9 @@
#include "UTIL/OPT/opt.h"
#include "UTIL/OPT/opt.h"
#include "SIMULATION/TOOLS/sim.h" // for taus
#include "SIMULATION/TOOLS/sim.h" // for taus
/* rlc */
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include <executables/softmodem-common.h>
#include <executables/softmodem-common.h>
extern
RAN_CONTEXT_t
RC
;
extern
RAN_CONTEXT_t
RC
;
extern
const
uint8_t
nr_slots_per_frame
[
5
];
extern
const
uint8_t
nr_slots_per_frame
[
5
];
...
@@ -1418,9 +1421,19 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
...
@@ -1418,9 +1421,19 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
int
current_harq_pid
=
sched_ctrl
->
retrans_dl_harq
.
head
;
int
current_harq_pid
=
sched_ctrl
->
retrans_dl_harq
.
head
;
if
(
ra
->
msg3_dcch_dtch
==
false
&&
current_harq_pid
<
0
)
{
if
(
ra
->
msg3_dcch_dtch
==
false
&&
current_harq_pid
<
0
)
{
mac_sdu_length
=
mac_rrc_nr_data_req
(
module_idP
,
CC_id
,
frameP
,
CCCH
,
ra
->
rnti
,
1
,
NULL
);
/* need to wait until RRCSetup is ready */
if
(
mac_sdu_length
<=
0
)
mac_rlc_status_resp_t
srb0_status
=
mac_rlc_status_ind
(
module_idP
,
return
;
// need to wait until RRCSetup is encoded
ra
->
rnti
,
module_idP
,
frameP
,
slotP
,
ENB_FLAG_YES
,
MBMS_FLAG_NO
,
0
/* lcid 0 */
,
0
,
0
);
if
(
srb0_status
.
bytes_in_buffer
==
0
)
return
;
mac_sdu_length
=
srb0_status
.
bytes_in_buffer
;
}
}
long
BWPStart
=
0
;
long
BWPStart
=
0
;
...
@@ -1559,7 +1572,17 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
...
@@ -1559,7 +1572,17 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
LOG_D
(
NR_MAC
,
"Encoded contention resolution mac_pdu_length %d
\n
"
,
mac_pdu_length
);
LOG_D
(
NR_MAC
,
"Encoded contention resolution mac_pdu_length %d
\n
"
,
mac_pdu_length
);
uint8_t
buffer
[
CCCH_SDU_SIZE
];
uint8_t
buffer
[
CCCH_SDU_SIZE
];
uint8_t
mac_subheader_len
=
sizeof
(
NR_MAC_SUBHEADER_SHORT
);
uint8_t
mac_subheader_len
=
sizeof
(
NR_MAC_SUBHEADER_SHORT
);
uint16_t
mac_sdu_length
=
mac_rrc_nr_data_req
(
module_idP
,
CC_id
,
frameP
,
CCCH
,
ra
->
rnti
,
1
,
buffer
);
mac_sdu_length
=
mac_rlc_data_req
(
module_idP
,
ra
->
rnti
,
module_idP
,
frameP
,
ENB_FLAG_YES
,
MBMS_FLAG_NO
,
CCCH
,
CCCH_SDU_SIZE
,
(
char
*
)
buffer
,
0
,
0
);
if
(
mac_sdu_length
<
256
)
{
if
(
mac_sdu_length
<
256
)
{
((
NR_MAC_SUBHEADER_SHORT
*
)
&
buf
[
mac_pdu_length
])
->
R
=
0
;
((
NR_MAC_SUBHEADER_SHORT
*
)
&
buf
[
mac_pdu_length
])
->
R
=
0
;
((
NR_MAC_SUBHEADER_SHORT
*
)
&
buf
[
mac_pdu_length
])
->
F
=
0
;
((
NR_MAC_SUBHEADER_SHORT
*
)
&
buf
[
mac_pdu_length
])
->
F
=
0
;
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c
View file @
cff0675e
...
@@ -44,6 +44,8 @@
...
@@ -44,6 +44,8 @@
#include "OCG.h"
#include "OCG.h"
#include "OCG_extern.h"
#include "OCG_extern.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
/* TODO REMOVE_DU_RRC: the RRC in the DU is a hack and should be taken out in the future */
/* TODO REMOVE_DU_RRC: the RRC in the DU is a hack and should be taken out in the future */
#include "RRC/LTE/rrc_extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/NR/nr_rrc_extern.h"
#include "RRC/NR/nr_rrc_extern.h"
...
@@ -2700,28 +2702,30 @@ void reset_ul_harq_list(NR_UE_sched_ctrl_t *sched_ctrl) {
...
@@ -2700,28 +2702,30 @@ void reset_ul_harq_list(NR_UE_sched_ctrl_t *sched_ctrl) {
void
mac_remove_nr_ue
(
gNB_MAC_INST
*
nr_mac
,
rnti_t
rnti
)
void
mac_remove_nr_ue
(
gNB_MAC_INST
*
nr_mac
,
rnti_t
rnti
)
{
{
NR_UEs_t
*
UE_info
=
&
nr_mac
->
UE_info
;
nr_rlc_remove_ue
(
rnti
);
pthread_mutex_lock
(
&
UE_info
->
mutex
);
UE_iterator
(
UE_info
->
list
,
UE
)
{
NR_UEs_t
*
UE_info
=
&
nr_mac
->
UE_info
;
if
(
UE
->
rnti
==
rnti
)
pthread_mutex_lock
(
&
UE_info
->
mutex
);
break
;
UE_iterator
(
UE_info
->
list
,
UE
)
{
}
if
(
UE
->
rnti
==
rnti
)
break
;
if
(
!
UE
)
{
}
LOG_W
(
NR_MAC
,
"Call to del rnti %04x, but not existing
\n
"
,
rnti
);
pthread_mutex_unlock
(
&
UE_info
->
mutex
);
if
(
!
UE
)
{
return
;
LOG_W
(
NR_MAC
,
"Call to del rnti %04x, but not existing
\n
"
,
rnti
);
}
pthread_mutex_unlock
(
&
UE_info
->
mutex
);
return
;
NR_UE_info_t
*
newUEs
[
MAX_MOBILES_PER_GNB
+
1
]
=
{
0
};
}
int
newListIdx
=
0
;
for
(
int
i
=
0
;
i
<
MAX_MOBILES_PER_GNB
;
i
++
)
NR_UE_info_t
*
newUEs
[
MAX_MOBILES_PER_GNB
+
1
]
=
{
0
};
if
(
UE_info
->
list
[
i
]
&&
UE_info
->
list
[
i
]
->
rnti
!=
rnti
)
int
newListIdx
=
0
;
newUEs
[
newListIdx
++
]
=
UE_info
->
list
[
i
];
for
(
int
i
=
0
;
i
<
MAX_MOBILES_PER_GNB
;
i
++
)
memcpy
(
UE_info
->
list
,
newUEs
,
sizeof
(
UE_info
->
list
));
if
(
UE_info
->
list
[
i
]
&&
UE_info
->
list
[
i
]
->
rnti
!=
rnti
)
pthread_mutex_unlock
(
&
UE_info
->
mutex
);
newUEs
[
newListIdx
++
]
=
UE_info
->
list
[
i
];
memcpy
(
UE_info
->
list
,
newUEs
,
sizeof
(
UE_info
->
list
));
delete_nr_ue_data
(
UE
,
nr_mac
->
common_channels
,
&
UE_info
->
uid_allocator
);
pthread_mutex_unlock
(
&
UE_info
->
mutex
);
delete_nr_ue_data
(
UE
,
nr_mac
->
common_channels
,
&
UE_info
->
uid_allocator
);
}
}
void
nr_mac_remove_ra_rnti
(
module_id_t
mod_id
,
rnti_t
rnti
)
{
void
nr_mac_remove_ra_rnti
(
module_id_t
mod_id
,
rnti_t
rnti
)
{
...
@@ -3097,15 +3101,14 @@ void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCom
...
@@ -3097,15 +3101,14 @@ void UL_tti_req_ahead_initialization(gNB_MAC_INST * gNB, NR_ServingCellConfigCom
void
send_initial_ul_rrc_message
(
module_id_t
module_id
,
void
send_initial_ul_rrc_message
(
module_id_t
module_id
,
int
CC_id
,
int
CC_id
,
const
NR_UE_info_t
*
UE
,
int
rnti
,
rb_id_t
srb_
id
,
int
u
id
,
const
uint8_t
*
sdu
,
const
uint8_t
*
sdu
,
sdu_size_t
sdu_len
)
{
sdu_size_t
sdu_len
)
{
const
gNB_MAC_INST
*
mac
=
RC
.
nrmac
[
module_id
];
const
gNB_MAC_INST
*
mac
=
RC
.
nrmac
[
module_id
];
const
rnti_t
rnti
=
UE
->
rnti
;
LOG_W
(
MAC
,
LOG_W
(
MAC
,
"[RAPROC] Received SDU for CCCH
on SRB %ld
length %d for UE %04x
\n
"
,
"[RAPROC] Received SDU for CCCH length %d for UE %04x
\n
"
,
s
rb_id
,
s
du_len
,
rnti
);
sdu_len
,
rnti
);
/* TODO REMOVE_DU_RRC: the RRC in the DU is a hack and should be taken out in the future */
/* TODO REMOVE_DU_RRC: the RRC in the DU is a hack and should be taken out in the future */
if
(
NODE_IS_DU
(
RC
.
nrrrc
[
module_id
]
->
node_type
))
{
if
(
NODE_IS_DU
(
RC
.
nrrrc
[
module_id
]
->
node_type
))
{
...
@@ -3113,14 +3116,13 @@ void send_initial_ul_rrc_message(module_id_t module_id,
...
@@ -3113,14 +3116,13 @@ void send_initial_ul_rrc_message(module_id_t module_id,
ue_context_p
->
ue_id_rnti
=
rnti
;
ue_context_p
->
ue_id_rnti
=
rnti
;
ue_context_p
->
ue_context
.
rnti
=
rnti
;
ue_context_p
->
ue_context
.
rnti
=
rnti
;
ue_context_p
->
ue_context
.
random_ue_identity
=
rnti
;
ue_context_p
->
ue_context
.
random_ue_identity
=
rnti
;
ue_context_p
->
ue_context
.
Srb0
.
Active
=
1
;
RB_INSERT
(
rrc_nr_ue_tree_s
,
&
RC
.
nrrrc
[
module_id
]
->
rrc_ue_head
,
ue_context_p
);
RB_INSERT
(
rrc_nr_ue_tree_s
,
&
RC
.
nrrrc
[
module_id
]
->
rrc_ue_head
,
ue_context_p
);
}
}
const
NR_ServingCellConfigCommon_t
*
scc
=
RC
.
nrrrc
[
module_id
]
->
carrier
.
servingcellconfigcommon
;
const
NR_ServingCellConfigCommon_t
*
scc
=
RC
.
nrrrc
[
module_id
]
->
carrier
.
servingcellconfigcommon
;
const
NR_ServingCellConfig_t
*
sccd
=
RC
.
nrrrc
[
module_id
]
->
configuration
.
scd
;
const
NR_ServingCellConfig_t
*
sccd
=
RC
.
nrrrc
[
module_id
]
->
configuration
.
scd
;
NR_CellGroupConfig_t
cellGroupConfig
=
{
0
};
NR_CellGroupConfig_t
cellGroupConfig
=
{
0
};
fill_initial_cellGroupConfig
(
UE
->
uid
,
&
cellGroupConfig
,
scc
,
sccd
,
&
RC
.
nrrrc
[
module_id
]
->
configuration
);
fill_initial_cellGroupConfig
(
uid
,
&
cellGroupConfig
,
scc
,
sccd
,
&
RC
.
nrrrc
[
module_id
]
->
configuration
);
uint8_t
du2cu_rrc_container
[
1024
];
uint8_t
du2cu_rrc_container
[
1024
];
asn_enc_rval_t
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_CellGroupConfig
,
asn_enc_rval_t
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_CellGroupConfig
,
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
cff0675e
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "utils.h"
#include "utils.h"
#include <openair2/UTIL/OPT/opt.h>
#include <openair2/UTIL/OPT/opt.h>
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
#include "LAYER2/nr_rlc/nr_rlc_oai_api.h"
//#define SRS_IND_DEBUG
//#define SRS_IND_DEBUG
...
@@ -363,12 +364,19 @@ int nr_process_mac_pdu(instance_t module_idP,
...
@@ -363,12 +364,19 @@ int nr_process_mac_pdu(instance_t module_idP,
mac_len
=
6
;
mac_len
=
6
;
}
}
send_initial_ul_rrc_message
(
module_idP
,
nr_rlc_activate_srb0
(
UE
->
rnti
,
module_idP
,
CC_id
,
UE
->
uid
,
send_initial_ul_rrc_message
);
CC_id
,
UE
,
mac_rlc_data_ind
(
module_idP
,
CCCH
,
UE
->
rnti
,
pduP
+
mac_subheader_len
,
module_idP
,
mac_len
);
frameP
,
ENB_FLAG_YES
,
MBMS_FLAG_NO
,
0
,
(
char
*
)
(
pduP
+
mac_subheader_len
),
mac_len
,
1
,
NULL
);
break
;
break
;
case
UL_SCH_LCID_DTCH
...
(
UL_SCH_LCID_DTCH
+
28
):
case
UL_SCH_LCID_DTCH
...
(
UL_SCH_LCID_DTCH
+
28
):
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
cff0675e
...
@@ -510,8 +510,8 @@ void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sche
...
@@ -510,8 +510,8 @@ void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sche
void
send_initial_ul_rrc_message
(
module_id_t
module_id
,
void
send_initial_ul_rrc_message
(
module_id_t
module_id
,
int
CC_id
,
int
CC_id
,
const
NR_UE_info_t
*
UE
,
int
rnti
,
rb_id_t
srb_
id
,
int
u
id
,
const
uint8_t
*
sdu
,
const
uint8_t
*
sdu
,
sdu_size_t
sdu_len
);
sdu_size_t
sdu_len
);
...
...
openair2/LAYER2/NR_MAC_gNB/mac_rrc_dl_handler.c
View file @
cff0675e
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "mac_proto.h"
#include "mac_proto.h"
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
#include "openair2/RRC/NR/rrc_gNB_UE_context.h"
#include "openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h"
#include "NR_RRCSetup.h"
#include "NR_RRCSetup.h"
#include "NR_DL-CCCH-Message.h"
#include "NR_DL-CCCH-Message.h"
...
@@ -111,13 +112,10 @@ int dl_rrc_message_rrcSetup(module_id_t module_id, const f1ap_dl_rrc_message_t *
...
@@ -111,13 +112,10 @@ int dl_rrc_message_rrcSetup(module_id_t module_id, const f1ap_dl_rrc_message_t *
gNB_RRC_INST
*
rrc
=
RC
.
nrrrc
[
module_id
];
gNB_RRC_INST
*
rrc
=
RC
.
nrrrc
[
module_id
];
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
rrc_gNB_get_ue_context
(
rrc
,
dl_rrc
->
rnti
);
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
rrc_gNB_get_ue_context
(
rrc
,
dl_rrc
->
rnti
);
gNB_RRC_UE_t
*
ue_p
=
&
ue_context_p
->
ue_context
;
gNB_RRC_UE_t
*
ue_p
=
&
ue_context_p
->
ue_context
;
ue_
context_p
->
ue_context
.
SRB_configList
=
rrcSetup_ies
->
radioBearerConfig
.
srb_ToAddModList
;
ue_
p
->
SRB_configList
=
rrcSetup_ies
->
radioBearerConfig
.
srb_ToAddModList
;
ue_
context_p
->
ue_context
.
masterCellGroup
=
cellGroup
;
ue_
p
->
masterCellGroup
=
cellGroup
;
/* TODO: this should pass through RLC and NOT the RRC with a shared buffer */
nr_rlc_srb0_recv_sdu
(
dl_rrc
->
rnti
,
dl_rrc
->
rrc_container
,
dl_rrc
->
rrc_container_length
);
AssertFatal
(
ue_p
->
Srb0
.
Active
==
1
,
"SRB0 is not active
\n
"
);
memcpy
(
ue_p
->
Srb0
.
Tx_buffer
.
Payload
,
dl_rrc
->
rrc_container
,
dl_rrc
->
rrc_container_length
);
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
=
dl_rrc
->
rrc_container_length
;
protocol_ctxt_t
ctxt
=
{
.
module_id
=
module_id
,
.
rnti
=
dl_rrc
->
rnti
};
protocol_ctxt_t
ctxt
=
{
.
module_id
=
module_id
,
.
rnti
=
dl_rrc
->
rnti
};
nr_rrc_rlc_config_asn1_req
(
&
ctxt
,
nr_rrc_rlc_config_asn1_req
(
&
ctxt
,
...
...
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
View file @
cff0675e
...
@@ -164,9 +164,10 @@ void mac_rlc_data_ind (
...
@@ -164,9 +164,10 @@ void mac_rlc_data_ind (
LOG_I
(
RLC
,
"RLC instance for the given UE was not found
\n
"
);
LOG_I
(
RLC
,
"RLC instance for the given UE was not found
\n
"
);
switch
(
channel_idP
)
{
switch
(
channel_idP
)
{
case
1
...
3
:
rb
=
ue
->
srb
[
channel_idP
-
1
];
break
;
case
0
:
rb
=
ue
->
srb0
;
break
;
case
1
...
3
:
rb
=
ue
->
srb
[
channel_idP
-
1
];
break
;
case
4
...
32
:
rb
=
ue
->
drb
[
channel_idP
-
4
];
break
;
case
4
...
32
:
rb
=
ue
->
drb
[
channel_idP
-
4
];
break
;
default:
rb
=
NULL
;
break
;
default:
rb
=
NULL
;
break
;
}
}
if
(
rb
!=
NULL
)
{
if
(
rb
!=
NULL
)
{
...
@@ -205,7 +206,8 @@ tbs_size_t mac_rlc_data_req(
...
@@ -205,7 +206,8 @@ tbs_size_t mac_rlc_data_req(
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rntiP
);
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rntiP
);
switch
(
channel_idP
)
{
switch
(
channel_idP
)
{
case
1
...
3
:
rb
=
ue
->
srb
[
channel_idP
-
1
];
break
;
case
0
:
rb
=
ue
->
srb0
;
break
;
case
1
...
3
:
rb
=
ue
->
srb
[
channel_idP
-
1
];
break
;
case
4
...
32
:
rb
=
ue
->
drb
[
channel_idP
-
4
];
break
;
case
4
...
32
:
rb
=
ue
->
drb
[
channel_idP
-
4
];
break
;
default:
default:
rb
=
NULL
;
rb
=
NULL
;
...
@@ -253,9 +255,10 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
...
@@ -253,9 +255,10 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rntiP
);
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rntiP
);
switch
(
channel_idP
)
{
switch
(
channel_idP
)
{
case
1
...
3
:
rb
=
ue
->
srb
[
channel_idP
-
1
];
break
;
case
0
:
rb
=
ue
->
srb0
;
break
;
case
1
...
3
:
rb
=
ue
->
srb
[
channel_idP
-
1
];
break
;
case
4
...
NGAP_MAX_DRBS_PER_UE
:
rb
=
ue
->
drb
[
channel_idP
-
4
];
break
;
case
4
...
NGAP_MAX_DRBS_PER_UE
:
rb
=
ue
->
drb
[
channel_idP
-
4
];
break
;
default:
rb
=
NULL
;
break
;
default:
rb
=
NULL
;
break
;
}
}
if
(
rb
!=
NULL
)
{
if
(
rb
!=
NULL
)
{
...
@@ -271,7 +274,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
...
@@ -271,7 +274,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
+
buf_stat
.
retx_size
+
buf_stat
.
retx_size
+
buf_stat
.
tx_size
;
+
buf_stat
.
tx_size
;
}
else
{
}
else
{
if
(
!
(
frameP
%
128
))
//to suppress this warning message
if
(
!
(
frameP
%
128
)
||
channel_idP
==
0
)
//to suppress this warning message
LOG_W
(
RLC
,
"[%s] Radio Bearer (channel ID %d) is NULL for UE with rntiP %x
\n
"
,
__FUNCTION__
,
channel_idP
,
rntiP
);
LOG_W
(
RLC
,
"[%s] Radio Bearer (channel ID %d) is NULL for UE with rntiP %x
\n
"
,
__FUNCTION__
,
channel_idP
,
rntiP
);
ret
.
bytes_in_buffer
=
0
;
ret
.
bytes_in_buffer
=
0
;
}
}
...
@@ -1017,6 +1020,66 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt
...
@@ -1017,6 +1020,66 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt
return
RLC_OP_STATUS_OK
;
return
RLC_OP_STATUS_OK
;
}
}
struct
srb0_data
{
int
module_id
;
int
CC_id
;
int
rnti
;
int
uid
;
void
(
*
send_initial_ul_rrc_message
)(
module_id_t
module_id
,
int
CC_id
,
int
rnti
,
int
uid
,
const
uint8_t
*
sdu
,
sdu_size_t
sdu_len
);
};
void
deliver_sdu_srb0
(
void
*
deliver_sdu_data
,
struct
nr_rlc_entity_t
*
entity
,
char
*
buf
,
int
size
)
{
struct
srb0_data
*
s0
=
(
struct
srb0_data
*
)
deliver_sdu_data
;
s0
->
send_initial_ul_rrc_message
(
s0
->
module_id
,
s0
->
CC_id
,
s0
->
rnti
,
s0
->
uid
,
(
unsigned
char
*
)
buf
,
size
);
}
void
nr_rlc_activate_srb0
(
int
rnti
,
int
module_id
,
int
cc_id
,
int
uid
,
void
(
*
send_initial_ul_rrc_message
)(
module_id_t
module_id
,
int
CC_id
,
int
rnti
,
int
uid
,
const
uint8_t
*
sdu
,
sdu_size_t
sdu_len
))
{
nr_rlc_entity_t
*
nr_rlc_tm
;
nr_rlc_ue_t
*
ue
;
struct
srb0_data
*
srb0_data
;
srb0_data
=
calloc
(
1
,
sizeof
(
struct
srb0_data
));
AssertFatal
(
srb0_data
!=
NULL
,
"out of memory
\n
"
);
srb0_data
->
module_id
=
module_id
;
srb0_data
->
CC_id
=
cc_id
;
srb0_data
->
rnti
=
rnti
;
srb0_data
->
uid
=
uid
;
srb0_data
->
send_initial_ul_rrc_message
=
send_initial_ul_rrc_message
;
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
if
(
ue
->
srb0
!=
NULL
)
{
LOG_W
(
RLC
,
"SRB0 already exists for UE with RNTI 0x%x, do nothing
\n
"
,
rnti
);
free
(
srb0_data
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
return
;
}
nr_rlc_tm
=
new_nr_rlc_entity_tm
(
10000
,
deliver_sdu_srb0
,
srb0_data
);
nr_rlc_ue_add_srb_rlc_entity
(
ue
,
0
,
nr_rlc_tm
);
LOG_I
(
RLC
,
"activated srb0 for UE with RNTI 0x%x
\n
"
,
rnti
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
rlc_op_status_t
rrc_rlc_config_req
(
rlc_op_status_t
rrc_rlc_config_req
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
srb_flag_t
srb_flagP
,
const
srb_flag_t
srb_flagP
,
...
@@ -1081,13 +1144,17 @@ void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t r
...
@@ -1081,13 +1144,17 @@ void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_data_conf_cb_t r
/* nothing to do */
/* nothing to do */
}
}
rlc_op_status_t
rrc_rlc_remove_ue
(
const
protocol_ctxt_t
*
const
x
)
void
nr_rlc_remove_ue
(
int
rnti
)
{
{
LOG_
D
(
RLC
,
"%s:%d:%s: remove UE %d
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
x
->
rnti
);
LOG_
W
(
RLC
,
"remove UE %x
\n
"
,
rnti
);
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
nr_rlc_manager_remove_ue
(
nr_rlc_ue_manager
,
x
->
rnti
);
nr_rlc_manager_remove_ue
(
nr_rlc_ue_manager
,
rnti
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
rlc_op_status_t
rrc_rlc_remove_ue
(
const
protocol_ctxt_t
*
const
x
)
{
nr_rlc_remove_ue
(
x
->
rnti
);
return
RLC_OP_STATUS_OK
;
return
RLC_OP_STATUS_OK
;
}
}
...
@@ -1173,3 +1240,22 @@ const bool nr_rlc_get_statistics(
...
@@ -1173,3 +1240,22 @@ const bool nr_rlc_get_statistics(
return
ret
;
return
ret
;
}
}
void
nr_rlc_srb0_recv_sdu
(
int
rnti
,
unsigned
char
*
buf
,
int
size
)
{
nr_rlc_ue_t
*
ue
;
nr_rlc_entity_t
*
rb
;
T
(
T_ENB_RLC_DL
,
T_INT
(
0
),
T_INT
(
rnti
),
T_INT
(
0
),
T_INT
(
size
));
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
rb
=
ue
->
srb0
;
AssertFatal
(
rb
!=
NULL
,
"SDU sent to unknown RB rnti %d srb0
\n
"
,
rnti
);
rb
->
set_time
(
rb
,
nr_rlc_current_time
);
rb
->
recv_sdu
(
rb
,
(
char
*
)
buf
,
size
,
-
1
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.h
View file @
cff0675e
...
@@ -48,6 +48,8 @@ void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config
...
@@ -48,6 +48,8 @@ void nr_drb_config(struct NR_RLC_Config *rlc_Config, NR_RLC_Config_PR rlc_config
void
nr_rlc_bearer_init_ul_spec
(
struct
NR_LogicalChannelConfig
*
mac_LogicalChannelConfig
);
void
nr_rlc_bearer_init_ul_spec
(
struct
NR_LogicalChannelConfig
*
mac_LogicalChannelConfig
);
void
nr_rlc_remove_ue
(
int
rnti
);
int
nr_rlc_get_available_tx_space
(
int
nr_rlc_get_available_tx_space
(
const
rnti_t
rntiP
,
const
rnti_t
rntiP
,
const
logical_chan_id_t
channel_idP
);
const
logical_chan_id_t
channel_idP
);
...
@@ -56,3 +58,14 @@ void nr_rlc_activate_avg_time_to_tx(
...
@@ -56,3 +58,14 @@ void nr_rlc_activate_avg_time_to_tx(
const
rnti_t
rnti
,
const
rnti_t
rnti
,
const
logical_chan_id_t
channel_id
,
const
logical_chan_id_t
channel_id
,
const
bool
is_on
);
const
bool
is_on
);
void
nr_rlc_srb0_recv_sdu
(
int
rnti
,
unsigned
char
*
buf
,
int
size
);
void
nr_rlc_activate_srb0
(
int
rnti
,
int
module_id
,
int
cc_id
,
int
uid
,
void
(
*
send_initial_ul_rrc_message
)(
module_id_t
module_id
,
int
CC_id
,
int
rnti
,
int
uid
,
const
uint8_t
*
sdu
,
sdu_size_t
sdu_len
));
openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.c
View file @
cff0675e
...
@@ -117,7 +117,7 @@ void nr_rlc_manager_remove_ue(nr_rlc_ue_manager_t *_m, int rnti)
...
@@ -117,7 +117,7 @@ void nr_rlc_manager_remove_ue(nr_rlc_ue_manager_t *_m, int rnti)
break
;
break
;
if
(
i
==
m
->
ue_count
)
{
if
(
i
==
m
->
ue_count
)
{
LOG_W
(
RLC
,
"%s:%d:%s: warning: ue %
d
not found
\n
"
,
LOG_W
(
RLC
,
"%s:%d:%s: warning: ue %
x
not found
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
rnti
);
rnti
);
return
;
return
;
...
@@ -125,11 +125,17 @@ void nr_rlc_manager_remove_ue(nr_rlc_ue_manager_t *_m, int rnti)
...
@@ -125,11 +125,17 @@ void nr_rlc_manager_remove_ue(nr_rlc_ue_manager_t *_m, int rnti)
ue
=
m
->
ue_list
[
i
];
ue
=
m
->
ue_list
[
i
];
for
(
j
=
0
;
j
<
2
;
j
++
)
if
(
ue
->
srb0
!=
NULL
)
{
/* deliver_sdu_data for srb0 is allocated, needs a free() */
free
(
ue
->
srb0
->
deliver_sdu_data
);
ue
->
srb0
->
delete
(
ue
->
srb0
);
}
for
(
j
=
0
;
j
<
3
;
j
++
)
if
(
ue
->
srb
[
j
]
!=
NULL
)
if
(
ue
->
srb
[
j
]
!=
NULL
)
ue
->
srb
[
j
]
->
delete
(
ue
->
srb
[
j
]);
ue
->
srb
[
j
]
->
delete
(
ue
->
srb
[
j
]);
for
(
j
=
0
;
j
<
5
;
j
++
)
for
(
j
=
0
;
j
<
MAX_DRBS_PER_UE
;
j
++
)
if
(
ue
->
drb
[
j
]
!=
NULL
)
if
(
ue
->
drb
[
j
]
!=
NULL
)
ue
->
drb
[
j
]
->
delete
(
ue
->
drb
[
j
]);
ue
->
drb
[
j
]
->
delete
(
ue
->
drb
[
j
]);
...
@@ -154,11 +160,23 @@ void nr_rlc_manager_remove_ue(nr_rlc_ue_manager_t *_m, int rnti)
...
@@ -154,11 +160,23 @@ void nr_rlc_manager_remove_ue(nr_rlc_ue_manager_t *_m, int rnti)
/* must be called with lock acquired */
/* must be called with lock acquired */
void
nr_rlc_ue_add_srb_rlc_entity
(
nr_rlc_ue_t
*
ue
,
int
srb_id
,
nr_rlc_entity_t
*
entity
)
void
nr_rlc_ue_add_srb_rlc_entity
(
nr_rlc_ue_t
*
ue
,
int
srb_id
,
nr_rlc_entity_t
*
entity
)
{
{
if
(
srb_id
<
1
||
srb_id
>
2
)
{
if
(
srb_id
<
0
||
srb_id
>
3
)
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal, bad srb id
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
LOG_E
(
RLC
,
"%s:%d:%s: fatal, bad srb id
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
exit
(
1
);
}
}
/* special case: srb0 */
if
(
srb_id
==
0
)
{
if
(
ue
->
srb0
!=
NULL
)
{
LOG_E
(
RLC
,
"fatal, srb0 already present
\n
"
);
exit
(
1
);
}
ue
->
srb0
=
entity
;
return
;
}
srb_id
--
;
srb_id
--
;
if
(
ue
->
srb
[
srb_id
]
!=
NULL
)
{
if
(
ue
->
srb
[
srb_id
]
!=
NULL
)
{
...
@@ -173,7 +191,7 @@ void nr_rlc_ue_add_srb_rlc_entity(nr_rlc_ue_t *ue, int srb_id, nr_rlc_entity_t *
...
@@ -173,7 +191,7 @@ void nr_rlc_ue_add_srb_rlc_entity(nr_rlc_ue_t *ue, int srb_id, nr_rlc_entity_t *
/* must be called with lock acquired */
/* must be called with lock acquired */
void
nr_rlc_ue_add_drb_rlc_entity
(
nr_rlc_ue_t
*
ue
,
int
drb_id
,
nr_rlc_entity_t
*
entity
)
void
nr_rlc_ue_add_drb_rlc_entity
(
nr_rlc_ue_t
*
ue
,
int
drb_id
,
nr_rlc_entity_t
*
entity
)
{
{
if
(
drb_id
<
1
||
drb_id
>
5
)
{
if
(
drb_id
<
1
||
drb_id
>
MAX_DRBS_PER_UE
)
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal, bad drb id
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
LOG_E
(
RLC
,
"%s:%d:%s: fatal, bad drb id
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
exit
(
1
);
}
}
...
...
openair2/LAYER2/nr_rlc/nr_rlc_ue_manager.h
View file @
cff0675e
...
@@ -28,6 +28,7 @@ typedef void nr_rlc_ue_manager_t;
...
@@ -28,6 +28,7 @@ typedef void nr_rlc_ue_manager_t;
typedef
struct
nr_rlc_ue_t
{
typedef
struct
nr_rlc_ue_t
{
int
rnti
;
int
rnti
;
nr_rlc_entity_t
*
srb0
;
nr_rlc_entity_t
*
srb
[
3
];
nr_rlc_entity_t
*
srb
[
3
];
nr_rlc_entity_t
*
drb
[
MAX_DRBS_PER_UE
];
nr_rlc_entity_t
*
drb
[
MAX_DRBS_PER_UE
];
}
nr_rlc_ue_t
;
}
nr_rlc_ue_t
;
...
...
openair2/RRC/NR/L2_nr_interface.c
View file @
cff0675e
...
@@ -161,29 +161,7 @@ uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
...
@@ -161,29 +161,7 @@ uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
// CCCH
// CCCH
if
((
Srb_id
&
RAB_OFFSET
)
==
CCCH
)
{
if
((
Srb_id
&
RAB_OFFSET
)
==
CCCH
)
{
LOG_D
(
NR_RRC
,
"[gNB %d] Frame %d CCCH request (Srb_id %ld)
\n
"
,
Mod_idP
,
frameP
,
Srb_id
);
AssertFatal
(
0
,
"CCCH is managed by rlc of srb 0, not anymore by mac_rrc_nr_data_req
\n
"
);
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
Mod_idP
],
rnti
);
LOG_D
(
NR_RRC
,
"[gNB %d] Frame %d CCCH request (Srb_id %ld)
\n
"
,
Mod_idP
,
frameP
,
Srb_id
);
if
(
ue_context_p
==
NULL
)
{
if
(
buffer_pP
!=
NULL
)
LOG_E
(
NR_RRC
,
"[gNB %d] Frame %d CCCH request but no ue_context
\n
"
,
Mod_idP
,
frameP
);
return
0
;
}
uint16_t
payload_size
=
ue_context_p
->
ue_context
.
Srb0
.
Tx_buffer
.
payload_size
;
if
(
buffer_pP
==
NULL
)
return
payload_size
;
// check if data is there for MAC
if
(
payload_size
>
0
)
{
char
*
payload_pP
=
ue_context_p
->
ue_context
.
Srb0
.
Tx_buffer
.
Payload
;
LOG_D
(
NR_RRC
,
"[gNB %d] CCCH has %d bytes (dest: %p, src %p)
\n
"
,
Mod_idP
,
payload_size
,
buffer_pP
,
payload_pP
);
// Fill buffer
memcpy
((
void
*
)
buffer_pP
,
(
void
*
)
payload_pP
,
payload_size
);
ue_context_p
->
ue_context
.
Srb0
.
Tx_buffer
.
payload_size
=
0
;
}
return
payload_size
;
}
}
return
0
;
return
0
;
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
cff0675e
...
@@ -726,11 +726,11 @@ void do_SpCellConfig(gNB_RRC_INST *rrc,
...
@@ -726,11 +726,11 @@ void do_SpCellConfig(gNB_RRC_INST *rrc,
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
uint8_
t
do_RRCReject
(
uint8_t
Mod_id
,
in
t
do_RRCReject
(
uint8_t
Mod_id
,
uint8_t
*
const
buffer
)
uint8_t
*
const
buffer
)
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
{
{
asn_enc_rval_t
enc_rval
;
;
asn_enc_rval_t
enc_rval
;
NR_DL_CCCH_Message_t
dl_ccch_msg
;
NR_DL_CCCH_Message_t
dl_ccch_msg
;
NR_RRCReject_t
*
rrcReject
;
NR_RRCReject_t
*
rrcReject
;
NR_RejectWaitTime_t
waitTime
=
1
;
NR_RejectWaitTime_t
waitTime
=
1
;
...
@@ -767,7 +767,7 @@ uint8_t do_RRCReject(uint8_t Mod_id,
...
@@ -767,7 +767,7 @@ uint8_t do_RRCReject(uint8_t Mod_id,
LOG_D
(
NR_RRC
,
"RRCReject Encoded %zd bits (%zd bytes)
\n
"
,
LOG_D
(
NR_RRC
,
"RRCReject Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
enc_rval
.
encoded
,(
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
)
;
return
(
enc_rval
.
encoded
+
7
)
/
8
;
}
}
void
fill_initial_SpCellConfig
(
int
uid
,
void
fill_initial_SpCellConfig
(
int
uid
,
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.h
View file @
cff0675e
...
@@ -72,8 +72,8 @@ uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier,
...
@@ -72,8 +72,8 @@ uint8_t do_SIB23_NR(rrc_gNB_carrier_data_t *carrier,
void
do_SpCellConfig
(
gNB_RRC_INST
*
rrc
,
void
do_SpCellConfig
(
gNB_RRC_INST
*
rrc
,
struct
NR_SpCellConfig
*
spconfig
);
struct
NR_SpCellConfig
*
spconfig
);
uint8_
t
do_RRCReject
(
uint8_t
Mod_id
,
in
t
do_RRCReject
(
uint8_t
Mod_id
,
uint8_t
*
const
buffer
);
uint8_t
*
const
buffer
);
void
fill_initial_SpCellConfig
(
int
uid
,
void
fill_initial_SpCellConfig
(
int
uid
,
NR_SpCellConfig_t
*
SpCellConfig
,
NR_SpCellConfig_t
*
SpCellConfig
,
...
...
openair2/RRC/NR/nr_rrc_defs.h
View file @
cff0675e
...
@@ -286,7 +286,6 @@ typedef struct gNB_RRC_UE_s {
...
@@ -286,7 +286,6 @@ typedef struct gNB_RRC_UE_s {
uint8_t
DRB_active
[
NGAP_MAX_DRBS_PER_UE
];
uint8_t
DRB_active
[
NGAP_MAX_DRBS_PER_UE
];
NR_SRB_INFO
SI
;
NR_SRB_INFO
SI
;
NR_SRB_INFO
Srb0
;
NR_SRB_INFO_TABLE_ENTRY
Srb1
;
NR_SRB_INFO_TABLE_ENTRY
Srb1
;
NR_SRB_INFO_TABLE_ENTRY
Srb2
;
NR_SRB_INFO_TABLE_ENTRY
Srb2
;
NR_MeasConfig_t
*
measConfig
;
NR_MeasConfig_t
*
measConfig
;
...
@@ -452,7 +451,6 @@ typedef struct {
...
@@ -452,7 +451,6 @@ typedef struct {
NR_PDCCH_ConfigSIB1_t
*
pdcch_ConfigSIB1
;
NR_PDCCH_ConfigSIB1_t
*
pdcch_ConfigSIB1
;
NR_CellGroupConfig_t
*
secondaryCellGroup
[
MAX_NR_RRC_UE_CONTEXTS
];
NR_CellGroupConfig_t
*
secondaryCellGroup
[
MAX_NR_RRC_UE_CONTEXTS
];
NR_SRB_INFO
SI
;
NR_SRB_INFO
SI
;
NR_SRB_INFO
Srb0
;
int
p_gNB
;
int
p_gNB
;
}
rrc_gNB_carrier_data_t
;
}
rrc_gNB_carrier_data_t
;
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
cff0675e
This diff is collapsed.
Click to expand it.
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