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
canghaiwuhen
OpenXG-RAN
Commits
45e5ddc8
Commit
45e5ddc8
authored
Nov 19, 2020
by
Chenyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
messg3\4\5 is ok
parent
9c6f7122
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
65 additions
and
36 deletions
+65
-36
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+18
-0
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
+2
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
+1
-1
openair2/LAYER2/NR_MAC_gNB/main.c
openair2/LAYER2/NR_MAC_gNB/main.c
+1
-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_oai_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+35
-27
No files found.
executables/nr-uesoftmodem.c
View file @
45e5ddc8
...
...
@@ -224,7 +224,21 @@ struct timespec clock_difftime(struct timespec start, struct timespec end) {
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
);
}
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
)
{
int
CC_id
;
...
...
@@ -781,6 +795,10 @@ int main( int argc, char **argv ) {
ctxt_pP
.
enb_flag
=
ENB_FLAG_NO
;
ctxt_pP
.
rnti
=
0x1234
;
rrc_ue_generate_RRCSetupRequest
(
&
ctxt_pP
,
0
);
if
(
create_tasks_nrue
(
1
)
<
0
)
{
printf
(
"cannot create ITTI tasks
\n
"
);
exit
(
-
1
);
// need a softer mode
}
while
(
true
)
sleep
(
3600
);
...
...
openair2/LAYER2/NR_MAC_UE/main_ue_nr.c
View file @
45e5ddc8
...
...
@@ -55,7 +55,8 @@ NR_UE_MAC_INST_t * nr_l2_init_ue(NR_UE_RRC_INST_t* rrc_inst)
if
(
rrc_inst
)
{
nr_rrc_mac_config_req_ue
(
0
,
0
,
0
,
NULL
,
rrc_inst
->
cell_group_config
);
if
(
IS_SOFTMODEM_NOS1
){
// if (IS_SOFTMODEM_NOS1){
if
(
1
)
{
if
(
rlc_module_init
(
0
)
!=
0
)
{
LOG_I
(
RLC
,
"Problem at RLC initiation
\n
"
);
}
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
View file @
45e5ddc8
...
...
@@ -761,7 +761,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
TBS
);
sdu_lengths
[
num_sdus
]
=
mac_rlc_data_req
(
module_id
,
rnti
,
0x1234
,
module_id
,
frame
,
ENB_FLAG_YES
,
...
...
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
View file @
45e5ddc8
...
...
@@ -232,7 +232,7 @@ void nr_process_mac_pdu(
}
else
{
mac_rlc_data_ind
(
module_idP
,
rnti
,
0x1234
,
module_idP
,
frameP
,
ENB_FLAG_YES
,
...
...
openair2/LAYER2/NR_MAC_gNB/main.c
View file @
45e5ddc8
...
...
@@ -94,7 +94,7 @@ void mac_top_init_gNB(void)
// These should be out of here later
pdcp_layer_init
();
if
(
IS_SOFTMODEM_NOS1
)
//
if(IS_SOFTMODEM_NOS1)
nr_DRB_preconfiguration
();
rrc_init_nr_global_param
();
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity.h
View file @
45e5ddc8
...
...
@@ -21,17 +21,18 @@
#ifndef _NR_PDCP_ENTITY_H_
#define _NR_PDCP_ENTITY_H_
#include "platform_types.h"
typedef
struct
nr_pdcp_entity_t
{
/* 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
,
int
sdu_id
);
void
(
*
delete
)(
struct
nr_pdcp_entity_t
*
entity
);
void
(
*
set_integrity_key
)(
struct
nr_pdcp_entity_t
*
entity
,
char
*
key
);
/* 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
);
void
*
deliver_sdu_data
;
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 @
45e5ddc8
...
...
@@ -25,13 +25,13 @@
#include <stdlib.h>
#include <string.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
;
if
(
size
<
3
)
abort
();
if
(
!
(
buffer
[
0
]
&
0x80
))
{
printf
(
"%s:%d:%s: fatal
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
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
);
}
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_entity_drb_am.h
View file @
45e5ddc8
...
...
@@ -23,13 +23,14 @@
#define _NR_PDCP_ENTITY_DRB_AM_H_
#include "nr_pdcp_entity.h"
#include "platform_types.h"
typedef
struct
{
nr_pdcp_entity_t
common
;
int
rb_id
;
}
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
,
int
sdu_id
);
void
nr_pdcp_entity_drb_am_set_integrity_key
(
nr_pdcp_entity_t
*
entity
,
char
*
key
);
...
...
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
View file @
45e5ddc8
...
...
@@ -109,17 +109,17 @@ nr_rrc_data_ind(
MessageDef
*
message_p
;
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
uint8_t
*
message_buffer
;
message_buffer
=
itti_malloc
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_
UE
,
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_
UE
,
sdu_sizeP
);
message_buffer
=
itti_malloc
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_
NRUE
,
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_NR
UE
,
sdu_sizeP
);
memcpy
(
message_buffer
,
buffer_pP
,
sdu_sizeP
);
message_p
=
itti_alloc_new_message
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_
UE
,
RRC_DCCH_DATA_IND
);
RRC_DCCH_DATA_IND
(
message_p
).
frame
=
ctxt_pP
->
frame
;
RRC_DCCH_DATA_IND
(
message_p
).
dcch_index
=
DCCH_index
;
RRC_DCCH_DATA_IND
(
message_p
).
sdu_size
=
sdu_sizeP
;
RRC_DCCH_DATA_IND
(
message_p
).
sdu_p
=
message_buffer
;
RRC_DCCH_DATA_IND
(
message_p
).
rnti
=
ctxt_pP
->
rnti
;
RRC_DCCH_DATA_IND
(
message_p
).
module_id
=
ctxt_pP
->
module_id
;
RRC_DCCH_DATA_IND
(
message_p
).
e
NB_index
=
ctxt_pP
->
eNB_index
;
itti_send_msg_to_task
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_UE
,
ctxt_pP
->
instance
,
message_p
);
message_p
=
itti_alloc_new_message
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_
NRUE
,
NR_
RRC_DCCH_DATA_IND
);
NR_
RRC_DCCH_DATA_IND
(
message_p
).
frame
=
ctxt_pP
->
frame
;
NR_
RRC_DCCH_DATA_IND
(
message_p
).
dcch_index
=
DCCH_index
;
NR_
RRC_DCCH_DATA_IND
(
message_p
).
sdu_size
=
sdu_sizeP
;
NR_
RRC_DCCH_DATA_IND
(
message_p
).
sdu_p
=
message_buffer
;
NR_
RRC_DCCH_DATA_IND
(
message_p
).
rnti
=
ctxt_pP
->
rnti
;
NR_
RRC_DCCH_DATA_IND
(
message_p
).
module_id
=
ctxt_pP
->
module_id
;
NR_RRC_DCCH_DATA_IND
(
message_p
).
g
NB_index
=
ctxt_pP
->
eNB_index
;
itti_send_msg_to_task
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_
NR
UE
,
ctxt_pP
->
instance
,
message_p
);
}
}
...
...
@@ -139,14 +139,15 @@ nr_rrc_data_ind_ccch(
{
MessageDef
*
message_p
;
// Uses a new buffer to avoid issue with PDCP buffer content that could be changed by PDCP (asynchronous message handling).
message_p
=
itti_alloc_new_message
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_UE
,
NR_RRC_MAC_CCCH_DATA_IND
);
message_p
=
itti_alloc_new_message
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_
NR
UE
,
NR_RRC_MAC_CCCH_DATA_IND
);
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
frame
=
ctxt_pP
->
frame
;
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
sub_frame
=
0
;
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu_size
=
sdu_sizeP
;
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
gnb_index
=
0
;
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
CC_id
=
0
;
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
rnti
=
0x1234
;
memcpy
(
NR_RRC_MAC_CCCH_DATA_IND
(
message_p
).
sdu
,
buffer_pP
,
sdu_sizeP
);
itti_send_msg_to_task
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_UE
,
ctxt_pP
->
instance
,
message_p
);
itti_send_msg_to_task
(
ctxt_pP
->
enb_flag
?
TASK_RRC_GNB
:
TASK_RRC_
NR
UE
,
ctxt_pP
->
instance
,
message_p
);
}
}
...
...
@@ -294,9 +295,9 @@ printf("\n\n\n########## nas_sock_fd read returns len %d\n", len);
ctxt
.
rnti
=
rnti
;
pdcp_data_req
(
&
ctxt
,
SRB_FLAG_NO
,
rb_id
,
RLC_MUI_UNDEFINED
,
RLC_SDU_CONFIRM_NO
,
len
,
(
unsigned
char
*
)
rx_buf
,
PDCP_TRANSMISSION_MODE_DATA
,
NULL
,
NULL
);
//
pdcp_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
//
RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
//
PDCP_TRANSMISSION_MODE_DATA, NULL, NULL);
}
return
NULL
;
...
...
@@ -338,9 +339,9 @@ printf("\n\n\n########## nas_sock_fd read returns len %d\n", len);
ctxt
.
rnti
=
rnti
;
pdcp_data_req
(
&
ctxt
,
SRB_FLAG_NO
,
rb_id
,
RLC_MUI_UNDEFINED
,
RLC_SDU_CONFIRM_NO
,
len
,
(
unsigned
char
*
)
rx_buf
,
PDCP_TRANSMISSION_MODE_DATA
,
NULL
,
NULL
);
//
pdcp_data_req(&ctxt, SRB_FLAG_NO, rb_id, RLC_MUI_UNDEFINED,
//
RLC_SDU_CONFIRM_NO, len, (unsigned char *)rx_buf,
//
PDCP_TRANSMISSION_MODE_DATA, NULL, NULL);
}
return
NULL
;
...
...
@@ -452,8 +453,8 @@ uint64_t pdcp_module_init(uint64_t _pdcp_optmask)
}
return
pdcp_optmask
;
}
static
void
deliver_sdu_drb
(
void
*
_ue
,
nr_pdcp_entity_t
*
entity
,
static
int
liuyu
=
0
;
static
void
deliver_sdu_drb
(
protocol_ctxt_t
*
ctxt_pP
,
void
*
_ue
,
nr_pdcp_entity_t
*
entity
,
char
*
buf
,
int
size
)
{
extern
int
nas_sock_fd
[];
...
...
@@ -464,19 +465,26 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
int
rb_id
;
int
i
;
if
(
IS_SOFTMODEM_NOS1
){
if
(
1
)
{
//
(IS_SOFTMODEM_NOS1){
#if 1
log_dump
(
PDCP
,
buf
,
size
,
LOG_DUMP_CHAR
,
" PDCP Received SDU:
\n
"
);
if
(
size
>
47
)
if
(
size
>
47
00
)
{
LOG_I
(
PDCP
,
"maybe ip data
\n
"
);
}
else
{
LOG_I
(
PDCP
,
"send to gNB RRC
\n
"
);
protocol_ctxt_t
ctxt_pP
=
{
0
};
ctxt_pP
.
enb_flag
=
ENB_FLAG_YES
;
nr_rrc_data_ind_ccch
(
&
ctxt_pP
,
1
,
size
,
buf
);
if
(
liuyu
==
2
)
liuyu
=
1
;
if
(
liuyu
==
0
)
nr_rrc_data_ind_ccch
(
ctxt_pP
,
1
,
size
,
buf
);
if
(
liuyu
==
1
)
nr_rrc_data_ind
(
ctxt_pP
,
1
,
size
,
buf
);
liuyu
++
;
}
#else
len
=
write
(
nas_sock_fd
[
0
],
buf
,
size
);
...
...
@@ -601,7 +609,7 @@ boolean_t pdcp_data_ind(
}
if
(
rb
!=
NULL
)
{
rb
->
recv_pdu
(
rb
,
(
char
*
)
sdu_buffer
->
data
,
sdu_buffer_size
);
rb
->
recv_pdu
(
ctxt_pP
,
rb
,
(
char
*
)
sdu_buffer
->
data
,
sdu_buffer_size
);
}
else
{
LOG_E
(
PDCP
,
"%s:%d:%s: fatal: no RB found (rb_id %ld, srb_flag %d)
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
rb_id
,
srb_flagP
);
...
...
@@ -1043,7 +1051,7 @@ boolean_t pdcp_data_req(
#endif
)
{
if
(
srb_flagP
)
{
TODO
;
}
//
if (srb_flagP) { TODO; }
return
pdcp_data_req_drb
(
ctxt_pP
,
rb_id
,
muiP
,
confirmP
,
sdu_buffer_size
,
sdu_buffer
);
}
...
...
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