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
ZhouShuya
OpenXG-RAN
Commits
70a43df6
Commit
70a43df6
authored
Jan 07, 2021
by
Fang-WANG
Browse files
Options
Browse Files
Download
Plain Diff
merge srb and rrc
parents
287f47bf
21f36b24
Changes
27
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1746 additions
and
79 deletions
+1746
-79
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+1
-0
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+25
-0
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+1
-0
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+1
-0
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+2
-1
openair1/SCHED_NR/phy_procedures_nr_gNB.c
openair1/SCHED_NR/phy_procedures_nr_gNB.c
+2
-1
openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
+3
-1
openair2/COMMON/platform_constants.h
openair2/COMMON/platform_constants.h
+2
-0
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+11
-4
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+4
-6
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
+27
-1
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h
+3
-2
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c
+2
-2
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.h
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.h
+2
-1
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c
+75
-0
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.h
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.h
+38
-0
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+333
-18
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+143
-1
openair2/RRC/NR/L2_nr_interface.c
openair2/RRC/NR/L2_nr_interface.c
+2
-2
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+62
-0
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+30
-14
openair2/RRC/NR/rrc_gNB_reconfig.c
openair2/RRC/NR/rrc_gNB_reconfig.c
+1
-1
openair2/RRC/NR_UE/L2_interface_ue.c
openair2/RRC/NR_UE/L2_interface_ue.c
+3
-3
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+81
-21
targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.gtp-itti.conf
...LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.gtp-itti.conf
+303
-0
targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf
...LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf
+304
-0
targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp.conf
...ERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp.conf
+285
-0
No files found.
cmake_targets/CMakeLists.txt
View file @
70a43df6
...
@@ -1969,6 +1969,7 @@ set(NR_PDCP_SRC
...
@@ -1969,6 +1969,7 @@ set(NR_PDCP_SRC
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_entity.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_entity.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/asn1_utils.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/asn1_utils.c
${
OPENAIR2_DIR
}
/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c
)
)
set
(
L2_SRC
set
(
L2_SRC
...
...
executables/nr-uesoftmodem.c
View file @
70a43df6
...
@@ -188,7 +188,22 @@ struct timespec clock_difftime(struct timespec start, struct timespec end) {
...
@@ -188,7 +188,22 @@ struct timespec clock_difftime(struct timespec start, struct timespec end) {
void
print_difftimes
(
void
)
{
void
print_difftimes
(
void
)
{
LOG_I
(
HW
,
"difftimes min = %lu ns ; max = %lu ns
\n
"
,
min_diff_time
.
tv_nsec
,
max_diff_time
.
tv_nsec
);
LOG_I
(
HW
,
"difftimes min = %lu ns ; max = %lu ns
\n
"
,
min_diff_time
.
tv_nsec
,
max_diff_time
.
tv_nsec
);
}
}
int
create_tasks_nrue
(
uint32_t
ue_nb
)
{
LOG_D
(
NR_RRC
,
"%s(ue_nb:%d)
\n
"
,
__FUNCTION__
,
ue_nb
);
itti_wait_ready
(
1
);
if
(
ue_nb
>
0
)
{
LOG_I
(
NR_RRC
,
"create TASK_RRC_NRUE
\n
"
);
if
(
itti_create_task
(
TASK_RRC_NRUE
,
rrc_nrue_task
,
NULL
)
<
0
)
{
LOG_E
(
NR_RRC
,
"Create task for RRC UE failed
\n
"
);
return
-
1
;
}
}
itti_wait_ready
(
0
);
return
0
;
}
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
void
exit_function
(
const
char
*
file
,
const
char
*
function
,
const
int
line
,
const
char
*
s
)
{
int
CC_id
;
int
CC_id
;
...
@@ -585,6 +600,16 @@ int main( int argc, char **argv ) {
...
@@ -585,6 +600,16 @@ int main( int argc, char **argv ) {
// wait for end of program
// wait for end of program
printf
(
"TYPE <CTRL-C> TO TERMINATE
\n
"
);
printf
(
"TYPE <CTRL-C> TO TERMINATE
\n
"
);
if
(
create_tasks_nrue
(
1
)
<
0
)
{
printf
(
"cannot create ITTI tasks
\n
"
);
exit
(
-
1
);
// need a softer mode
}
protocol_ctxt_t
ctxt_pP
=
{
0
};
ctxt_pP
.
enb_flag
=
ENB_FLAG_NO
;
ctxt_pP
.
rnti
=
0x1234
;
rrc_ue_generate_RRCSetupRequest
(
&
ctxt_pP
,
0
);
while
(
true
)
while
(
true
)
sleep
(
3600
);
sleep
(
3600
);
...
...
openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
View file @
70a43df6
...
@@ -391,6 +391,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
...
@@ -391,6 +391,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
LOG_D(PHY,"%02x\n",a[i]);
LOG_D(PHY,"%02x\n",a[i]);
LOG_D(PHY,"\n");
LOG_D(PHY,"\n");
*/
*/
log_dump
(
PHY
,
a
,
16
,
LOG_DUMP_CHAR
,
"gNB pdsch tx frame %d %d: "
,
frame
,
slot
);
if
(
A
>
3824
)
{
if
(
A
>
3824
)
{
// Add 24-bit crc (polynomial A) to payload
// Add 24-bit crc (polynomial A) to payload
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
View file @
70a43df6
...
@@ -735,6 +735,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
...
@@ -735,6 +735,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG
,
VCD_FUNCTION_OUT
);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG
,
VCD_FUNCTION_OUT
);
dlsch
->
last_iteration_cnt
=
ret
;
dlsch
->
last_iteration_cnt
=
ret
;
log_dump
(
PHY
,
harq_process
->
b
,
16
,
LOG_DUMP_CHAR
,
"nrue pdsch rx frame %d %d: "
,
frame
,
nr_slot_rx
);
return
(
ret
);
return
(
ret
);
}
}
...
...
openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
View file @
70a43df6
...
@@ -157,7 +157,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
...
@@ -157,7 +157,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
///////////
///////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
log_dump
(
PHY
,
harq_process_ul_ue
->
a
,
16
,
LOG_DUMP_CHAR
,
"nrue pusch tx frame %d %d: "
,
frame
,
slot
);
/////////////////////////ULSCH scrambling/////////////////////////
/////////////////////////ULSCH scrambling/////////////////////////
///////////
///////////
...
...
openair1/SCHED_NR/phy_procedures_nr_gNB.c
View file @
70a43df6
...
@@ -265,8 +265,9 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
...
@@ -265,8 +265,9 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
LOG_D
(
PHY
,
"ULSCH received ok
\n
"
);
LOG_D
(
PHY
,
"ULSCH received ok
\n
"
);
nr_fill_indication
(
gNB
,
ulsch_harq
->
frame
,
ulsch_harq
->
slot
,
rdata
->
ulsch_id
,
rdata
->
harq_pid
,
0
);
nr_fill_indication
(
gNB
,
ulsch_harq
->
frame
,
ulsch_harq
->
slot
,
rdata
->
ulsch_id
,
rdata
->
harq_pid
,
0
);
log_dump
(
PHY
,
ulsch_harq
->
b
,
16
,
LOG_DUMP_CHAR
,
"gnb pusch rx frame %d %d: "
,
ulsch_harq
->
frame
,
ulsch_harq
->
slot
);
}
else
{
}
else
{
LOG_
D
(
PHY
,
"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) r %d
\n
"
,
LOG_
I
(
PHY
,
"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) r %d
\n
"
,
gNB
->
Mod_id
,
ulsch_harq
->
frame
,
ulsch_harq
->
slot
,
gNB
->
Mod_id
,
ulsch_harq
->
frame
,
ulsch_harq
->
slot
,
rdata
->
harq_pid
,
ulsch_harq
->
status
,
ulsch_harq
->
round
,
ulsch_harq
->
TBS
,
r
);
rdata
->
harq_pid
,
ulsch_harq
->
status
,
ulsch_harq
->
round
,
ulsch_harq
->
TBS
,
r
);
if
(
ulsch_harq
->
round
>=
ulsch
->
Mlimit
)
{
if
(
ulsch_harq
->
round
>=
ulsch
->
Mlimit
)
{
...
...
openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
View file @
70a43df6
...
@@ -1016,7 +1016,9 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, NR_UE_MAC_INST_t *mac, uint8
...
@@ -1016,7 +1016,9 @@ boolean_t select_pucch_resource(PHY_VARS_NR_UE *ue, NR_UE_MAC_INST_t *mac, uint8
return
(
FALSE
);
return
(
FALSE
);
}
}
/* check if resource indexing by pucch_resource_indicator of this set is compatible */
/* check if resource indexing by pucch_resource_indicator of this set is compatible */
if
((
ready_pucch_resource_id
==
TRUE
)
||
(
mac
->
ULbwp
[
bwp_id
-
1
]
->
bwp_Dedicated
->
pucch_Config
->
choice
.
setup
->
resourceSetToAddModList
->
list
.
array
[
pucch_resource_set_id
]
->
resourceList
.
list
.
array
[
pucch_resource_indicator
][
0
]
!=
MAX_NB_OF_PUCCH_RESOURCES
))
{
if
((
ready_pucch_resource_id
==
TRUE
)
||
((
mac
->
ULbwp
[
bwp_id
-
1
]
->
bwp_Dedicated
->
pucch_Config
->
choice
.
setup
->
resourceSetToAddModList
->
list
.
array
[
pucch_resource_set_id
]
->
resourceList
.
list
.
array
[
pucch_resource_indicator
]
!=
NULL
)
&&
(
mac
->
ULbwp
[
bwp_id
-
1
]
->
bwp_Dedicated
->
pucch_Config
->
choice
.
setup
->
resourceSetToAddModList
->
list
.
array
[
pucch_resource_set_id
]
->
resourceList
.
list
.
array
[
pucch_resource_indicator
][
0
]
!=
MAX_NB_OF_PUCCH_RESOURCES
)))
{
if
(
ready_pucch_resource_id
==
TRUE
)
{
if
(
ready_pucch_resource_id
==
TRUE
)
{
current_resource_id
=
*
resource_id
;
current_resource_id
=
*
resource_id
;
...
...
openair2/COMMON/platform_constants.h
View file @
70a43df6
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
***************************************************************************/
***************************************************************************/
#include "LTE_asn_constant.h"
#include "LTE_asn_constant.h"
#include "NR_asn_constant.h"
#ifndef __PLATFORM_CONSTANTS_H__
#ifndef __PLATFORM_CONSTANTS_H__
# define __PLATFORM_CONSTANTS_H__
# define __PLATFORM_CONSTANTS_H__
...
@@ -103,6 +104,7 @@
...
@@ -103,6 +104,7 @@
#define DEFAULT_RAB_ID 1
#define DEFAULT_RAB_ID 1
#define NB_RB_MAX (LTE_maxDRB + 3)
/* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#define NB_RB_MAX (LTE_maxDRB + 3)
/* was 11, now 14, maxDRB comes from asn1_constants.h, + 3 because of 3 SRB, one invisible id 0, then id 1 and 2 */
#define NR_NB_RB_MAX (NR_maxDRB + 3)
#define NB_RB_MBMS_MAX (LTE_maxSessionPerPMCH*LTE_maxServiceCount)
#define NB_RB_MBMS_MAX (LTE_maxSessionPerPMCH*LTE_maxServiceCount)
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
70a43df6
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
#define HALFWORD 16
#define HALFWORD 16
#define WORD 32
#define WORD 32
//#define SIZE_OF_POINTER sizeof (void *)
//#define SIZE_OF_POINTER sizeof (void *)
static
boolean_t
loop_dcch_dtch
=
TRUE
;
int
nr_generate_dlsch_pdu
(
module_id_t
module_idP
,
int
nr_generate_dlsch_pdu
(
module_id_t
module_idP
,
NR_UE_sched_ctrl_t
*
ue_sched_ctl
,
NR_UE_sched_ctrl_t
*
ue_sched_ctl
,
unsigned
char
*
sdus_payload
,
unsigned
char
*
sdus_payload
,
...
@@ -393,8 +393,8 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
...
@@ -393,8 +393,8 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
{
{
/* Retrieve amount of data to send for this UE */
/* Retrieve amount of data to send for this UE */
sched_ctrl
->
num_total_bytes
=
0
;
sched_ctrl
->
num_total_bytes
=
0
;
const
int
lcid
=
DL_SCH_LCID_DTCH
;
loop_dcch_dtch
=
BOOL_NOT
(
loop_dcch_dtch
)
;
const
int
lcid
=
loop_dcch_dtch
?
DL_SCH_LCID_DTCH
:
DL_SCH_LCID_DCCH
;
sched_ctrl
->
rlc_status
[
lcid
]
=
mac_rlc_status_ind
(
module_id
,
sched_ctrl
->
rlc_status
[
lcid
]
=
mac_rlc_status_ind
(
module_id
,
rnti
,
rnti
,
module_id
,
module_id
,
...
@@ -406,6 +406,13 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
...
@@ -406,6 +406,13 @@ void nr_simple_dlsch_preprocessor(module_id_t module_id,
0
,
0
,
0
);
0
);
sched_ctrl
->
num_total_bytes
+=
sched_ctrl
->
rlc_status
[
lcid
].
bytes_in_buffer
;
sched_ctrl
->
num_total_bytes
+=
sched_ctrl
->
rlc_status
[
lcid
].
bytes_in_buffer
;
LOG_I
(
MAC
,
"%d.%d, LCID%d:->DLSCH, RLC status %d bytes.
\n
"
,
frame
,
slot
,
lcid
,
sched_ctrl
->
num_total_bytes
);
if
(
sched_ctrl
->
num_total_bytes
==
0
if
(
sched_ctrl
->
num_total_bytes
==
0
&&
!
sched_ctrl
->
ta_apply
)
/* If TA should be applied, give at least one RB */
&&
!
sched_ctrl
->
ta_apply
)
/* If TA should be applied, give at least one RB */
return
;
return
;
...
@@ -723,7 +730,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
...
@@ -723,7 +730,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
uint16_t
sdu_lengths
[
NB_RB_MAX
]
=
{
0
};
uint16_t
sdu_lengths
[
NB_RB_MAX
]
=
{
0
};
uint8_t
mac_sdus
[
MAX_NR_DLSCH_PAYLOAD_BYTES
];
uint8_t
mac_sdus
[
MAX_NR_DLSCH_PAYLOAD_BYTES
];
unsigned
char
sdu_lcids
[
NB_RB_MAX
]
=
{
0
};
unsigned
char
sdu_lcids
[
NB_RB_MAX
]
=
{
0
};
const
int
lcid
=
DL_SCH_LCID_DT
CH
;
const
int
lcid
=
loop_dcch_dtch
?
DL_SCH_LCID_DTCH
:
DL_SCH_LCID_DC
CH
;
if
(
sched_ctrl
->
num_total_bytes
>
0
)
{
if
(
sched_ctrl
->
num_total_bytes
>
0
)
{
/* this is the data from the RLC we would like to request (e.g., only
/* this is the data from the RLC we would like to request (e.g., only
* some bytes for first LC and some more from a second one */
* some bytes for first LC and some more from a second one */
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
70a43df6
...
@@ -179,11 +179,7 @@ void nr_process_mac_pdu(
...
@@ -179,11 +179,7 @@ void nr_process_mac_pdu(
// end of MAC PDU, can ignore the rest.
// end of MAC PDU, can ignore the rest.
break
;
break
;
// MAC SDUs
case
UL_SCH_LCID_SRB2
:
case
UL_SCH_LCID_SRB1
:
// todo
break
;
case
UL_SCH_LCID_SRB2
:
// todo
// todo
break
;
break
;
case
UL_SCH_LCID_SRB3
:
case
UL_SCH_LCID_SRB3
:
...
@@ -197,6 +193,8 @@ void nr_process_mac_pdu(
...
@@ -197,6 +193,8 @@ void nr_process_mac_pdu(
mac_subheader_len
=
2
;
mac_subheader_len
=
2
;
break
;
break
;
// MAC SDUs
case
UL_SCH_LCID_SRB1
:
case
UL_SCH_LCID_DTCH
:
case
UL_SCH_LCID_DTCH
:
// check if LCID is valid at current time.
// check if LCID is valid at current time.
if
(((
NR_MAC_SUBHEADER_SHORT
*
)
pdu_ptr
)
->
F
){
if
(((
NR_MAC_SUBHEADER_SHORT
*
)
pdu_ptr
)
->
F
){
...
@@ -210,7 +208,7 @@ void nr_process_mac_pdu(
...
@@ -210,7 +208,7 @@ void nr_process_mac_pdu(
mac_subheader_len
=
2
;
mac_subheader_len
=
2
;
}
}
LOG_
D
(
MAC
,
"[UE %d] Frame %d : ULSCH -> UL-DTCH %d (gNB %d, %d bytes)
\n
"
,
module_idP
,
frameP
,
rx_lcid
,
module_idP
,
mac_sdu_len
);
LOG_
I
(
MAC
,
"[UE %d] Frame %d : ULSCH -> UL-DTCH %d (gNB %d, %d bytes)
\n
"
,
module_idP
,
frameP
,
rx_lcid
,
module_idP
,
mac_sdu_len
);
int
UE_id
=
find_nr_UE_id
(
module_idP
,
rnti
);
int
UE_id
=
find_nr_UE_id
(
module_idP
,
rnti
);
RC
.
nrmac
[
module_idP
]
->
UE_info
.
mac_stats
[
UE_id
].
lc_bytes_rx
[
rx_lcid
]
+=
mac_sdu_len
;
RC
.
nrmac
[
module_idP
]
->
UE_info
.
mac_stats
[
UE_id
].
lc_bytes_rx
[
rx_lcid
]
+=
mac_sdu_len
;
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.c
View file @
70a43df6
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include "nr_pdcp_entity.h"
#include "nr_pdcp_entity.h"
#include "nr_pdcp_entity_drb_am.h"
#include "nr_pdcp_entity_drb_am.h"
#include "nr_pdcp_entity_srb.h"
#include "LOG/log.h"
#include "LOG/log.h"
...
@@ -34,7 +35,32 @@ nr_pdcp_entity_t *new_nr_pdcp_entity_srb(
...
@@ -34,7 +35,32 @@ nr_pdcp_entity_t *new_nr_pdcp_entity_srb(
char
*
buf
,
int
size
,
int
sdu_id
),
char
*
buf
,
int
size
,
int
sdu_id
),
void
*
deliver_pdu_data
)
void
*
deliver_pdu_data
)
{
{
abort
();
nr_pdcp_entity_srb_t
*
ret
;
ret
=
calloc
(
1
,
sizeof
(
nr_pdcp_entity_srb_t
));
if
(
ret
==
NULL
)
{
LOG_E
(
PDCP
,
"%s:%d:%s: out of memory
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
ret
->
common
.
recv_pdu
=
nr_pdcp_entity_srb_recv_pdu
;
ret
->
common
.
recv_sdu
=
nr_pdcp_entity_srb_recv_sdu
;
ret
->
common
.
set_integrity_key
=
nr_pdcp_entity_srb_set_integrity_key
;
ret
->
common
.
delete
=
nr_pdcp_entity_srb_delete
;
ret
->
common
.
deliver_sdu
=
deliver_sdu
;
ret
->
common
.
deliver_sdu_data
=
deliver_sdu_data
;
ret
->
common
.
deliver_pdu
=
deliver_pdu
;
ret
->
common
.
deliver_pdu_data
=
deliver_pdu_data
;
ret
->
srb_id
=
rb_id
;
ret
->
common
.
maximum_nr_pdcp_sn
=
4095
;
return
(
nr_pdcp_entity_t
*
)
ret
;
}
}
nr_pdcp_entity_t
*
new_nr_pdcp_entity_drb_am
(
nr_pdcp_entity_t
*
new_nr_pdcp_entity_drb_am
(
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h
View file @
70a43df6
...
@@ -23,17 +23,18 @@
...
@@ -23,17 +23,18 @@
#ifndef _NR_PDCP_ENTITY_H_
#ifndef _NR_PDCP_ENTITY_H_
#define _NR_PDCP_ENTITY_H_
#define _NR_PDCP_ENTITY_H_
#include "platform_types.h"
typedef
struct
nr_pdcp_entity_t
{
typedef
struct
nr_pdcp_entity_t
{
/* functions provided by the PDCP module */
/* functions provided by the PDCP module */
void
(
*
recv_pdu
)(
struct
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
);
void
(
*
recv_pdu
)(
protocol_ctxt_t
*
ctxt_pP
,
struct
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
);
void
(
*
recv_sdu
)(
struct
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
,
void
(
*
recv_sdu
)(
struct
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
,
int
sdu_id
);
int
sdu_id
);
void
(
*
delete
)(
struct
nr_pdcp_entity_t
*
entity
);
void
(
*
delete
)(
struct
nr_pdcp_entity_t
*
entity
);
void
(
*
set_integrity_key
)(
struct
nr_pdcp_entity_t
*
entity
,
char
*
key
);
void
(
*
set_integrity_key
)(
struct
nr_pdcp_entity_t
*
entity
,
char
*
key
);
/* callbacks provided to the PDCP module */
/* callbacks provided to the PDCP module */
void
(
*
deliver_sdu
)(
void
*
deliver_sdu_data
,
struct
nr_pdcp_entity_t
*
entity
,
void
(
*
deliver_sdu
)(
protocol_ctxt_t
*
ctxt_pP
,
void
*
deliver_sdu_data
,
struct
nr_pdcp_entity_t
*
entity
,
char
*
buf
,
int
size
);
char
*
buf
,
int
size
);
void
*
deliver_sdu_data
;
void
*
deliver_sdu_data
;
void
(
*
deliver_pdu
)(
void
*
deliver_pdu_data
,
struct
nr_pdcp_entity_t
*
entity
,
void
(
*
deliver_pdu
)(
void
*
deliver_pdu_data
,
struct
nr_pdcp_entity_t
*
entity
,
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.c
View file @
70a43df6
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include <string.h>
#include <string.h>
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/log.h"
void
nr_pdcp_entity_drb_am_recv_pdu
(
nr_pdcp_entity_t
*
_entity
,
char
*
buffer
,
int
size
)
void
nr_pdcp_entity_drb_am_recv_pdu
(
protocol_ctxt_t
*
ctxt_pP
,
nr_pdcp_entity_t
*
_entity
,
char
*
buffer
,
int
size
)
{
{
nr_pdcp_entity_drb_am_t
*
entity
=
(
nr_pdcp_entity_drb_am_t
*
)
_entity
;
nr_pdcp_entity_drb_am_t
*
entity
=
(
nr_pdcp_entity_drb_am_t
*
)
_entity
;
...
@@ -35,7 +35,7 @@ void nr_pdcp_entity_drb_am_recv_pdu(nr_pdcp_entity_t *_entity, char *buffer, int
...
@@ -35,7 +35,7 @@ void nr_pdcp_entity_drb_am_recv_pdu(nr_pdcp_entity_t *_entity, char *buffer, int
if
(
!
(
buffer
[
0
]
&
0x80
))
if
(
!
(
buffer
[
0
]
&
0x80
))
LOG_E
(
PDCP
,
"%s:%d:%s: fatal
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
LOG_E
(
PDCP
,
"%s:%d:%s: fatal
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
entity
->
common
.
deliver_sdu
(
entity
->
common
.
deliver_sdu_data
,
entity
->
common
.
deliver_sdu
(
ctxt_pP
,
entity
->
common
.
deliver_sdu_data
,
(
nr_pdcp_entity_t
*
)
entity
,
buffer
+
3
,
size
-
3
);
(
nr_pdcp_entity_t
*
)
entity
,
buffer
+
3
,
size
-
3
);
}
}
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.h
View file @
70a43df6
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#define _NR_PDCP_ENTITY_DRB_AM_H_
#define _NR_PDCP_ENTITY_DRB_AM_H_
#include "nr_pdcp_entity.h"
#include "nr_pdcp_entity.h"
#include "platform_types.h"
typedef
struct
{
typedef
struct
{
nr_pdcp_entity_t
common
;
nr_pdcp_entity_t
common
;
...
@@ -32,7 +33,7 @@ typedef struct {
...
@@ -32,7 +33,7 @@ typedef struct {
int
discard_timer
;
/* unit: ms, -1 means infinity */
int
discard_timer
;
/* unit: ms, -1 means infinity */
}
nr_pdcp_entity_drb_am_t
;
}
nr_pdcp_entity_drb_am_t
;
void
nr_pdcp_entity_drb_am_recv_pdu
(
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
);
void
nr_pdcp_entity_drb_am_recv_pdu
(
protocol_ctxt_t
*
ctxt_pP
,
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
);
void
nr_pdcp_entity_drb_am_recv_sdu
(
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
,
void
nr_pdcp_entity_drb_am_recv_sdu
(
nr_pdcp_entity_t
*
entity
,
char
*
buffer
,
int
size
,
int
sdu_id
);
int
sdu_id
);
void
nr_pdcp_entity_drb_am_set_integrity_key
(
nr_pdcp_entity_t
*
entity
,
char
*
key
);
void
nr_pdcp_entity_drb_am_set_integrity_key
(
nr_pdcp_entity_t
*
entity
,
char
*
key
);
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.c
0 → 100644
View file @
70a43df6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "nr_pdcp_entity_srb.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void
nr_pdcp_entity_srb_recv_pdu
(
protocol_ctxt_t
*
ctxt_pP
,
nr_pdcp_entity_t
*
_entity
,
char
*
buffer
,
int
size
)
{
nr_pdcp_entity_srb_t
*
entity
=
(
nr_pdcp_entity_srb_t
*
)
_entity
;
if
(
size
<
2
)
abort
();
entity
->
common
.
deliver_sdu
(
ctxt_pP
,
entity
->
common
.
deliver_sdu_data
,
(
nr_pdcp_entity_t
*
)
entity
,
buffer
+
2
,
size
-
6
);
}
void
nr_pdcp_entity_srb_recv_sdu
(
nr_pdcp_entity_t
*
_entity
,
char
*
buffer
,
int
size
,
int
sdu_id
)
{
nr_pdcp_entity_srb_t
*
entity
=
(
nr_pdcp_entity_srb_t
*
)
_entity
;
int
sn
;
char
buf
[
size
+
6
];
sn
=
entity
->
common
.
next_nr_pdcp_tx_sn
;
entity
->
common
.
next_nr_pdcp_tx_sn
++
;
if
(
entity
->
common
.
next_nr_pdcp_tx_sn
>
entity
->
common
.
maximum_nr_pdcp_sn
)
{
entity
->
common
.
next_nr_pdcp_tx_sn
=
0
;
entity
->
common
.
tx_hfn
++
;
}
buf
[
0
]
=
(
sn
>>
8
)
&
0x0f
;
buf
[
1
]
=
sn
&
0xff
;
memcpy
(
buf
+
2
,
buffer
,
size
);
/* For now use padding for the MAC-I bytes (normally carrying message authentication code)
* which come after the data payload bytes (38.323, section 6.2.2.1) */
for
(
int
i
=
size
+
2
;
i
<
size
+
6
;
i
++
)
buf
[
i
]
=
0x11
*
(
i
-
size
-
1
);
entity
->
common
.
deliver_pdu
(
entity
->
common
.
deliver_pdu_data
,
(
nr_pdcp_entity_t
*
)
entity
,
buf
,
size
+
6
,
sdu_id
);
}
void
nr_pdcp_entity_srb_set_integrity_key
(
nr_pdcp_entity_t
*
_entity
,
char
*
key
)
{
/* nothing to do */
}
void
nr_pdcp_entity_srb_delete
(
nr_pdcp_entity_t
*
_entity
)
{
nr_pdcp_entity_srb_t
*
entity
=
(
nr_pdcp_entity_srb_t
*
)
_entity
;
free
(
entity
);
}
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_srb.h
0 → 100644
View file @
70a43df6
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef _NR_PDCP_ENTITY_SRB_H_
#define _NR_PDCP_ENTITY_SRB_H_
#include "nr_pdcp_entity.h"
typedef
struct
{
nr_pdcp_entity_t
common
;
int
srb_id
;
}
nr_pdcp_entity_srb_t
;
void
nr_pdcp_entity_srb_recv_pdu
(
protocol_ctxt_t
*
ctxt_pP
,
nr_pdcp_entity_t
*
_entity
,
char
*
buffer
,
int
size
);
void
nr_pdcp_entity_srb_recv_sdu
(
nr_pdcp_entity_t
*
_entity
,
char
*
buffer
,
int
size
,
int
sdu_id
);
void
nr_pdcp_entity_srb_set_integrity_key
(
nr_pdcp_entity_t
*
_entity
,
char
*
key
);
void
nr_pdcp_entity_srb_delete
(
nr_pdcp_entity_t
*
_entity
);
#endif
/* _NR_PDCP_ENTITY_SRB_H_ */
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
View file @
70a43df6
This diff is collapsed.
Click to expand it.
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
View file @
70a43df6
...
@@ -766,6 +766,78 @@ static void add_drb_am(int rnti, struct NR_DRB_ToAddMod *s, NR_RLC_BearerConfig_
...
@@ -766,6 +766,78 @@ static void add_drb_am(int rnti, struct NR_DRB_ToAddMod *s, NR_RLC_BearerConfig_
}
}
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
}
static
void
srb_add_drb_am
(
int
rnti
,
struct
NR_DRB_ToAddMod
*
s
,
NR_RLC_BearerConfig_t
*
rlc_BearerConfig
)
{
nr_rlc_entity_t
*
nr_rlc_am
;
nr_rlc_ue_t
*
ue
;
struct
NR_RLC_Config
*
r
=
rlc_BearerConfig
->
rlc_Config
;
struct
NR_LogicalChannelConfig
*
l
=
rlc_BearerConfig
->
mac_LogicalChannelConfig
;
int
srb_id
=
1
;
int
channel_id
=
1
;
//rlc_BearerConfig->logicalChannelIdentity;
int
logical_channel_group
;
int
t_status_prohibit
;
int
t_poll_retransmit
;
int
poll_pdu
;
int
poll_byte
;
int
max_retx_threshold
;
int
t_reassembly
;
int
sn_field_length
;
logical_channel_group
=
*
l
->
ul_SpecificParameters
->
logicalChannelGroup
;
/* TODO: accept other values? */
if
(
logical_channel_group
!=
1
)
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal error
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
switch
(
r
->
present
)
{
case
NR_RLC_Config_PR_am
:
{
struct
NR_RLC_Config__am
*
am
;
am
=
r
->
choice
.
am
;
t_reassembly
=
decode_t_reassembly
(
am
->
dl_AM_RLC
.
t_Reassembly
);
t_status_prohibit
=
decode_t_status_prohibit
(
am
->
dl_AM_RLC
.
t_StatusProhibit
);
t_poll_retransmit
=
decode_t_poll_retransmit
(
am
->
ul_AM_RLC
.
t_PollRetransmit
);
poll_pdu
=
decode_poll_pdu
(
am
->
ul_AM_RLC
.
pollPDU
);
poll_byte
=
decode_poll_byte
(
am
->
ul_AM_RLC
.
pollByte
);
max_retx_threshold
=
decode_max_retx_threshold
(
am
->
ul_AM_RLC
.
maxRetxThreshold
);
if
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
!=
*
am
->
ul_AM_RLC
.
sn_FieldLength
)
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
sn_field_length
=
decode_sn_field_length_am
(
*
am
->
dl_AM_RLC
.
sn_FieldLength
);
break
;
}
default:
LOG_E
(
RLC
,
"%s:%d:%s: fatal error
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
if
(
ue
->
srb
[
srb_id
-
1
]
!=
NULL
)
{
LOG_W
(
RLC
,
"%s:%d:%s: warning DRB %d already exist for ue %d, do nothing
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
srb_id
,
rnti
);
}
else
{
nr_rlc_am
=
new_nr_rlc_entity_am
(
100000
,
100000
,
deliver_sdu
,
ue
,
successful_delivery
,
ue
,
max_retx_reached
,
ue
,
t_poll_retransmit
,
t_reassembly
,
t_status_prohibit
,
poll_pdu
,
poll_byte
,
max_retx_threshold
,
sn_field_length
);
//nr_rlc_ue_add_drb_rlc_entity(ue, srb_id, nr_rlc_am);
ue
->
srb
[
srb_id
-
1
]
=
nr_rlc_am
;
LOG_I
(
RLC
,
"%s:%d:%s: added srb %d to ue %d
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
srb_id
,
rnti
);
}
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
static
void
add_drb_um
(
int
rnti
,
struct
NR_DRB_ToAddMod
*
s
,
NR_RLC_BearerConfig_t
*
rlc_BearerConfig
)
static
void
add_drb_um
(
int
rnti
,
struct
NR_DRB_ToAddMod
*
s
,
NR_RLC_BearerConfig_t
*
rlc_BearerConfig
)
{
{
...
@@ -834,6 +906,75 @@ static void add_drb_um(int rnti, struct NR_DRB_ToAddMod *s, NR_RLC_BearerConfig_
...
@@ -834,6 +906,75 @@ static void add_drb_um(int rnti, struct NR_DRB_ToAddMod *s, NR_RLC_BearerConfig_
}
}
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
}
static
void
srb_add_drb_um
(
int
rnti
,
struct
NR_DRB_ToAddMod
*
s
,
NR_RLC_BearerConfig_t
*
rlc_BearerConfig
)
{
nr_rlc_entity_t
*
nr_rlc_um
;
nr_rlc_ue_t
*
ue
;
struct
NR_RLC_Config
*
r
=
rlc_BearerConfig
->
rlc_Config
;
struct
NR_LogicalChannelConfig
*
l
=
rlc_BearerConfig
->
mac_LogicalChannelConfig
;
int
srb_id
=
1
;
int
channel_id
=
rlc_BearerConfig
->
logicalChannelIdentity
;
int
logical_channel_group
;
int
sn_field_length
;
int
t_reassembly
;
// if (!(drb_id >= 1 && drb_id <= 5)) {
// LOG_E(RLC, "%s:%d:%s: fatal, bad srb id %d\n",
// __FILE__, __LINE__, __FUNCTION__, drb_id);
// exit(1);
// }
// if (channel_id != drb_id + 3) {
// LOG_E(RLC, "%s:%d:%s: todo, remove this limitation\n",
// __FILE__, __LINE__, __FUNCTION__);
// exit(1);
// }
logical_channel_group
=
*
l
->
ul_SpecificParameters
->
logicalChannelGroup
;
/* TODO: accept other values? */
if
(
logical_channel_group
!=
1
)
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal error
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
switch
(
r
->
present
)
{
case
NR_RLC_Config_PR_um_Bi_Directional
:
{
struct
NR_RLC_Config__um_Bi_Directional
*
um
;
um
=
r
->
choice
.
um_Bi_Directional
;
t_reassembly
=
decode_t_reassembly
(
um
->
dl_UM_RLC
.
t_Reassembly
);
if
(
*
um
->
dl_UM_RLC
.
sn_FieldLength
!=
*
um
->
ul_UM_RLC
.
sn_FieldLength
)
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
sn_field_length
=
decode_sn_field_length_um
(
*
um
->
dl_UM_RLC
.
sn_FieldLength
);
break
;
}
default:
LOG_E
(
RLC
,
"%s:%d:%s: fatal error
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
rnti
);
if
(
ue
->
srb
[
srb_id
-
1
]
!=
NULL
)
{
LOG_W
(
RLC
,
"%s:%d:%s: warning DRB %d already exist for ue %d, do nothing
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
srb_id
,
rnti
);
}
else
{
nr_rlc_um
=
new_nr_rlc_entity_um
(
1000000
,
1000000
,
deliver_sdu
,
ue
,
t_reassembly
,
sn_field_length
);
// nr_rlc_ue_add_drb_rlc_entity(ue, srb_id, nr_rlc_um);
ue
->
srb
[
srb_id
-
1
]
=
nr_rlc_um
;
LOG_I
(
RLC
,
"%s:%d:%s: added srb %d to ue %d
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
srb_id
,
rnti
);
}
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
static
void
add_drb
(
int
rnti
,
struct
NR_DRB_ToAddMod
*
s
,
struct
NR_RLC_BearerConfig
*
rlc_BearerConfig
)
static
void
add_drb
(
int
rnti
,
struct
NR_DRB_ToAddMod
*
s
,
struct
NR_RLC_BearerConfig
*
rlc_BearerConfig
)
{
{
...
@@ -895,7 +1036,8 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt
...
@@ -895,7 +1036,8 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt
if
(
srb2add_listP
!=
NULL
)
{
if
(
srb2add_listP
!=
NULL
)
{
for
(
i
=
0
;
i
<
srb2add_listP
->
list
.
count
;
i
++
)
{
for
(
i
=
0
;
i
<
srb2add_listP
->
list
.
count
;
i
++
)
{
add_srb
(
rnti
,
srb2add_listP
->
list
.
array
[
i
]);
// add_srb(rnti, srb2add_listP->list.array[i]);
srb_add_drb_am
(
rnti
,
drb2add_listP
->
list
.
array
[
0
],
rlc_bearer2add_list
->
list
.
array
[
0
]);
}
}
}
}
...
...
openair2/RRC/NR/L2_nr_interface.c
View file @
70a43df6
...
@@ -108,8 +108,8 @@ nr_rrc_data_req(
...
@@ -108,8 +108,8 @@ nr_rrc_data_req(
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
/* Hack: only trigger PDCP if in CU, otherwise it is triggered by RU threads
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
* Ideally, PDCP would not neet to be triggered like this but react to ITTI
* messages automatically */
* messages automatically */
if
(
ctxt_pP
->
enb_flag
&&
NODE_IS_CU
(
RC
.
rrc
[
ctxt_pP
->
module_id
]
->
node_type
))
//
if (ctxt_pP->enb_flag && NODE_IS_CU(RC.rrc[ctxt_pP->module_id]->node_type))
pdcp_run
(
ctxt_pP
);
//
pdcp_run(ctxt_pP);
return
TRUE
;
// TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
return
TRUE
;
// TODO should be changed to a CNF message later, currently RRC lite does not used the returned value anyway.
}
}
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
70a43df6
...
@@ -68,6 +68,7 @@
...
@@ -68,6 +68,7 @@
#include "NR_SDAP-Config.h"
#include "NR_SDAP-Config.h"
#include "NR_RRCReconfigurationComplete.h"
#include "NR_RRCReconfigurationComplete.h"
#include "NR_RRCReconfigurationComplete-IEs.h"
#include "NR_RRCReconfigurationComplete-IEs.h"
#include "NR_DLInformationTransfer.h"
#if defined(NR_Rel16)
#if defined(NR_Rel16)
#include "NR_SCS-SpecificCarrier.h"
#include "NR_SCS-SpecificCarrier.h"
#include "NR_TDD-UL-DL-ConfigCommon.h"
#include "NR_TDD-UL-DL-ConfigCommon.h"
...
@@ -1260,3 +1261,64 @@ int do_DLInformationTransfer_NR (void * p) {
...
@@ -1260,3 +1261,64 @@ int do_DLInformationTransfer_NR (void * p) {
return
0
;
return
0
;
}
}
//------------------------------------------------------------------------------
uint8_t
do_NR_DLInformationTransfer
(
uint8_t
Mod_id
,
uint8_t
**
buffer
,
uint8_t
transaction_id
,
uint32_t
pdu_length
,
uint8_t
*
pdu_buffer
)
//------------------------------------------------------------------------------
{
ssize_t
encoded
;
NR_DL_DCCH_Message_t
dl_dcch_msg
;
memset
(
&
dl_dcch_msg
,
0
,
sizeof
(
NR_DL_DCCH_Message_t
));
dl_dcch_msg
.
message
.
present
=
NR_DL_DCCH_MessageType_PR_c1
;
dl_dcch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_DL_DCCH_MessageType__c1
));
dl_dcch_msg
.
message
.
choice
.
c1
->
present
=
NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer
;
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
dlInformationTransfer
=
CALLOC
(
1
,
sizeof
(
NR_DLInformationTransfer_t
));
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
dlInformationTransfer
->
rrc_TransactionIdentifier
=
transaction_id
;
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
dlInformationTransfer
->
criticalExtensions
.
present
=
NR_DLInformationTransfer__criticalExtensions_PR_dlInformationTransfer
;
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
dlInformationTransfer
->
criticalExtensions
.
choice
.
dlInformationTransfer
=
CALLOC
(
1
,
sizeof
(
NR_DLInformationTransfer_IEs_t
));
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
dlInformationTransfer
->
criticalExtensions
.
choice
.
dlInformationTransfer
->
dedicatedNAS_Message
=
CALLOC
(
1
,
sizeof
(
NR_DedicatedNAS_Message_t
));
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
dlInformationTransfer
->
criticalExtensions
.
choice
.
dlInformationTransfer
->
dedicatedNAS_Message
->
buf
=
pdu_buffer
;
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
dlInformationTransfer
->
criticalExtensions
.
choice
.
dlInformationTransfer
->
dedicatedNAS_Message
->
size
=
pdu_length
;
encoded
=
uper_encode_to_new_buffer
(
&
asn_DEF_NR_DL_DCCH_Message
,
NULL
,
(
void
*
)
&
dl_dcch_msg
,
(
void
**
)
buffer
);
AssertFatal
(
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
"DLInformationTransfer"
,
encoded
);
LOG_D
(
NR_RRC
,
"DLInformationTransfer Encoded %zd bytes
\n
"
,
encoded
);
return
encoded
;
}
uint8_t
do_NR_ULInformationTransfer
(
uint8_t
**
buffer
,
uint32_t
pdu_length
,
uint8_t
*
pdu_buffer
)
{
ssize_t
encoded
;
NR_UL_DCCH_Message_t
ul_dcch_msg
;
memset
(
&
ul_dcch_msg
,
0
,
sizeof
(
NR_UL_DCCH_Message_t
));
ul_dcch_msg
.
message
.
present
=
NR_UL_DCCH_MessageType_PR_c1
;
ul_dcch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_UL_DCCH_MessageType__c1
));
ul_dcch_msg
.
message
.
choice
.
c1
->
present
=
NR_UL_DCCH_MessageType__c1_PR_ulInformationTransfer
;
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
ulInformationTransfer
=
CALLOC
(
1
,
sizeof
(
struct
NR_ULInformationTransfer
));
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
ulInformationTransfer
->
criticalExtensions
.
present
=
NR_ULInformationTransfer__criticalExtensions_PR_ulInformationTransfer
;
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
ulInformationTransfer
->
criticalExtensions
.
choice
.
ulInformationTransfer
=
CALLOC
(
1
,
sizeof
(
struct
NR_ULInformationTransfer_IEs
));
struct
NR_ULInformationTransfer_IEs
*
ulInformationTransfer
=
ul_dcch_msg
.
message
.
choice
.
c1
->
choice
.
ulInformationTransfer
->
criticalExtensions
.
choice
.
ulInformationTransfer
;
ulInformationTransfer
->
dedicatedNAS_Message
=
CALLOC
(
1
,
sizeof
(
NR_DedicatedNAS_Message_t
));
ulInformationTransfer
->
dedicatedNAS_Message
->
buf
=
pdu_buffer
;
ulInformationTransfer
->
dedicatedNAS_Message
->
size
=
pdu_length
;
ulInformationTransfer
->
lateNonCriticalExtension
=
NULL
;
encoded
=
uper_encode_to_new_buffer
(
&
asn_DEF_NR_UL_DCCH_Message
,
NULL
,
(
void
*
)
&
ul_dcch_msg
,
(
void
**
)
buffer
);
AssertFatal
(
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
"ULInformationTransfer"
,
encoded
);
LOG_D
(
NR_RRC
,
"ULInformationTransfer Encoded %zd bytes
\n
"
,
encoded
);
return
encoded
;
}
openair2/RRC/NR/rrc_gNB.c
View file @
70a43df6
...
@@ -402,6 +402,16 @@ rrc_gNB_generate_RRCSetup(
...
@@ -402,6 +402,16 @@ rrc_gNB_generate_RRCSetup(
ue_context_pP
->
ue_context
.
ue_release_timer_thres
=
1000
;
ue_context_pP
->
ue_context
.
ue_release_timer_thres
=
1000
;
/* init timers */
/* init timers */
// ue_context_pP->ue_context.ue_rrc_inactivity_timer = 0;
// ue_context_pP->ue_context.ue_rrc_inactivity_timer = 0;
log_dump
(
NR_RRC
,
ue_p
->
Srb0
.
Tx_buffer
.
Payload
,
16
,
LOG_DUMP_CHAR
,
"RRCSetup size: "
);
nr_rrc_data_req
(
ctxt_pP
,
DCCH
,
rrc_gNB_mui
++
,
SDU_CONFIRM_NO
,
ue_p
->
Srb0
.
Tx_buffer
.
payload_size
,
ue_p
->
Srb0
.
Tx_buffer
.
Payload
,
PDCP_TRANSMISSION_MODE_CONTROL
);
#ifdef ITTI_SIM
#ifdef ITTI_SIM
MessageDef
*
message_p
;
MessageDef
*
message_p
;
uint8_t
*
message_buffer
;
uint8_t
*
message_buffer
;
...
@@ -946,7 +956,7 @@ rrc_gNB_decode_dcch(
...
@@ -946,7 +956,7 @@ rrc_gNB_decode_dcch(
sdu_sizeP
,
sdu_sizeP
,
0
,
0
,
0
);
0
);
// xer_fprint(stdout, &asn_DEF_NR_UL_DCCH_Message, (void *)&
ul_dcch_msg);
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
*
)
ul_dcch_msg
);
{
{
for
(
i
=
0
;
i
<
sdu_sizeP
;
i
++
)
{
for
(
i
=
0
;
i
<
sdu_sizeP
;
i
++
)
{
...
@@ -1298,13 +1308,14 @@ void *rrc_gnb_task(void *args_p) {
...
@@ -1298,13 +1308,14 @@ void *rrc_gnb_task(void *args_p) {
/* Messages from MAC */
/* Messages from MAC */
case
NR_RRC_MAC_CCCH_DATA_IND
:
case
NR_RRC_MAC_CCCH_DATA_IND
:
// PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
// NR_RRC_MAC_CCCH_DATA_IND(msg_p).gnb_index,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
gnb_index
,
// GNB_FLAG_YES,
GNB_FLAG_YES
,
// NR_RRC_MAC_CCCH_DATA_IND(msg_p).rnti,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
rnti
,
// msg_p->ittiMsgHeader.lte_time.frame,
msg_p
->
ittiMsgHeader
.
lte_time
.
frame
,
// msg_p->ittiMsgHeader.lte_time.slot);
msg_p
->
ittiMsgHeader
.
lte_time
.
slot
);
LOG_I
(
NR_RRC
,
"Decoding CCCH : inst %d, CC_id %d, ctxt %p, sib_info_p->Rx_buffer.payload_size %d
\n
"
,
LOG_I
(
NR_RRC
,
"Decoding CCCH : ue %d, inst %d, CC_id %d, ctxt %p, size %d
\n
"
,
ctxt
.
rnti
,
instance
,
instance
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
CC_id
,
NR_RRC_MAC_CCCH_DATA_IND
(
msg_p
).
CC_id
,
&
ctxt
,
&
ctxt
,
...
@@ -1324,12 +1335,17 @@ void *rrc_gnb_task(void *args_p) {
...
@@ -1324,12 +1335,17 @@ void *rrc_gnb_task(void *args_p) {
/* Messages from PDCP */
/* Messages from PDCP */
case
NR_RRC_DCCH_DATA_IND
:
case
NR_RRC_DCCH_DATA_IND
:
// PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
PROTOCOL_CTXT_SET_BY_INSTANCE
(
&
ctxt
,
// instance,
instance
,
// ENB_FLAG_YES,
ENB_FLAG_YES
,
// RRC_DCCH_DATA_IND(msg_p).rnti,
RRC_DCCH_DATA_IND
(
msg_p
).
rnti
,
// msg_p->ittiMsgHeader.lte_time.frame,
msg_p
->
ittiMsgHeader
.
lte_time
.
frame
,
// msg_p->ittiMsgHeader.lte_time.slot);
msg_p
->
ittiMsgHeader
.
lte_time
.
slot
);
LOG_I
(
NR_RRC
,
"Decoding DCCH : ue %d, inst %d, ctxt %p, size %d
\n
"
,
ctxt
.
rnti
,
instance
,
&
ctxt
,
NR_RRC_DCCH_DATA_IND
(
msg_p
).
sdu_size
);
LOG_D
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" Received on DCCH %d %s
\n
"
,
LOG_D
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" Received on DCCH %d %s
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
&
ctxt
),
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
&
ctxt
),
NR_RRC_DCCH_DATA_IND
(
msg_p
).
dcch_index
,
NR_RRC_DCCH_DATA_IND
(
msg_p
).
dcch_index
,
...
...
openair2/RRC/NR/rrc_gNB_reconfig.c
View file @
70a43df6
...
@@ -129,7 +129,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
...
@@ -129,7 +129,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
*
secondaryCellGroup
->
spCellConfig
->
servCellIndex
=
servCellIndex
;
*
secondaryCellGroup
->
spCellConfig
->
servCellIndex
=
servCellIndex
;
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
=
calloc
(
1
,
sizeof
(
*
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
));
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
=
calloc
(
1
,
sizeof
(
*
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
));
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
spCellConfigCommon
=
servingcellconfigcommon
;
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
spCellConfigCommon
=
servingcellconfigcommon
;
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
newUE_Identity
=
(
get_softmodem_params
()
->
phy_test
==
1
)
?
0x1234
:
(
taus
()
&
0xffff
);
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
newUE_Identity
=
0x1234
;
//
(get_softmodem_params()->phy_test==1) ? 0x1234 : (taus()&0xffff);
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
t304
=
NR_ReconfigurationWithSync__t304_ms2000
;
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
t304
=
NR_ReconfigurationWithSync__t304_ms2000
;
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
rach_ConfigDedicated
=
NULL
;
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
rach_ConfigDedicated
=
NULL
;
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
ext1
=
NULL
;
secondaryCellGroup
->
spCellConfig
->
reconfigurationWithSync
->
ext1
=
NULL
;
...
...
openair2/RRC/NR_UE/L2_interface_ue.c
View file @
70a43df6
...
@@ -84,11 +84,11 @@ rrc_data_req_ue(
...
@@ -84,11 +84,11 @@ rrc_data_req_ue(
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
uint8_t
*
message_buffer
;
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
message_buffer
=
itti_malloc
(
ctxt_pP
->
enb_flag
?
TASK_RRC_ENB
:
TASK_RRC_UE
,
TASK_RRC_UE
,
ctxt_pP
->
enb_flag
?
TASK_PDCP_ENB
:
TASK_PDCP_UE
,
TASK_PDCP_UE
,
sdu_sizeP
);
sdu_sizeP
);
memcpy
(
message_buffer
,
buffer_pP
,
sdu_sizeP
);
memcpy
(
message_buffer
,
buffer_pP
,
sdu_sizeP
);
message_p
=
itti_alloc_new_message
(
ctxt_pP
->
enb_flag
?
TASK_RRC_ENB
:
TASK_RRC_UE
,
RRC_DCCH_DATA_REQ
);
message_p
=
itti_alloc_new_message
(
TASK_RRC_UE
,
RRC_DCCH_DATA_REQ
);
RRC_DCCH_DATA_REQ
(
message_p
).
frame
=
ctxt_pP
->
frame
;
RRC_DCCH_DATA_REQ
(
message_p
).
frame
=
ctxt_pP
->
frame
;
RRC_DCCH_DATA_REQ
(
message_p
).
enb_flag
=
ctxt_pP
->
enb_flag
;
RRC_DCCH_DATA_REQ
(
message_p
).
enb_flag
=
ctxt_pP
->
enb_flag
;
RRC_DCCH_DATA_REQ
(
message_p
).
rb_id
=
rb_idP
;
RRC_DCCH_DATA_REQ
(
message_p
).
rb_id
=
rb_idP
;
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
70a43df6
This diff is collapsed.
Click to expand it.
targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpb210.gtp-itti.conf
0 → 100644
View file @
70a43df6
This diff is collapsed.
Click to expand it.
targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp-itti.conf
0 → 100644
View file @
70a43df6
This diff is collapsed.
Click to expand it.
targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.gtp.conf
0 → 100644
View file @
70a43df6
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