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
0a4ffade
Commit
0a4ffade
authored
Oct 18, 2018
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't malloc() context_t in F1U, stack is sufficient
parent
86fcea8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
31 deletions
+23
-31
openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
+23
-31
No files found.
openair2/LAYER2/PROTO_AGENT/proto_agent_common.c
View file @
0a4ffade
...
@@ -392,7 +392,7 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
...
@@ -392,7 +392,7 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
rlc_data
=
data_req
->
pdcp_data
;
rlc_data
=
data_req
->
pdcp_data
;
ctxt
=
rlc_data
->
fsp_ctxt
;
ctxt
=
rlc_data
->
fsp_ctxt
;
protocol_ctxt_t
*
ctxt_pP
;
protocol_ctxt_t
ctxt_pP
;
srb_flag_t
srb_flagP
=
0
;
srb_flag_t
srb_flagP
=
0
;
rb_id_t
rb_idP
=
0
;
rb_id_t
rb_idP
=
0
;
mui_t
muiP
=
0
;
mui_t
muiP
=
0
;
...
@@ -402,15 +402,13 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
...
@@ -402,15 +402,13 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
mem_block_t
*
pdcp_pdu_p
=
NULL
;
mem_block_t
*
pdcp_pdu_p
=
NULL
;
// Create a new protocol context for handling the packet
// Create a new protocol context for handling the packet
ctxt_pP
=
malloc
(
sizeof
(
protocol_ctxt_t
));
ctxt_pP
.
module_id
=
ctxt
->
fsp_mod_id
;
if
(
!
ctxt_pP
)
goto
error
;
ctxt_pP
.
enb_flag
=
ctxt
->
fsp_enb_flag
;
ctxt_pP
->
module_id
=
ctxt
->
fsp_mod_id
;
ctxt_pP
.
instance
=
ctxt
->
fsp_instance
;
ctxt_pP
->
enb_flag
=
ctxt
->
fsp_enb_flag
;
ctxt_pP
.
rnti
=
ctxt
->
fsp_rnti
;
ctxt_pP
->
instance
=
ctxt
->
fsp_instance
;
ctxt_pP
.
frame
=
ctxt
->
fsp_frame
;
ctxt_pP
->
rnti
=
ctxt
->
fsp_rnti
;
ctxt_pP
.
subframe
=
ctxt
->
fsp_subframe
;
ctxt_pP
->
frame
=
ctxt
->
fsp_frame
;
ctxt_pP
.
eNB_index
=
ctxt
->
fsp_enb_index
;
ctxt_pP
->
subframe
=
ctxt
->
fsp_subframe
;
ctxt_pP
->
eNB_index
=
ctxt
->
fsp_enb_index
;
srb_flagP
=
rlc_data
->
fsp_srb_flag
;
srb_flagP
=
rlc_data
->
fsp_srb_flag
;
flag_MBMS
=
rlc_data
->
fsp_mbms_flag
;
flag_MBMS
=
rlc_data
->
fsp_mbms_flag
;
...
@@ -422,11 +420,11 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
...
@@ -422,11 +420,11 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
if
(
!
pdcp_pdu_p
)
goto
error
;
if
(
!
pdcp_pdu_p
)
goto
error
;
memcpy
(
pdcp_pdu_p
->
data
,
rlc_data
->
fsp_pdu
->
fsp_pdu_data
.
data
,
pdcp_pdu_size
);
memcpy
(
pdcp_pdu_p
->
data
,
rlc_data
->
fsp_pdu
->
fsp_pdu_data
.
data
,
pdcp_pdu_size
);
result
=
rlc_data_req
(
(
const
protocol_ctxt_t
*
)
ctxt_pP
result
=
rlc_data_req
(
&
ctxt_pP
,
(
const
srb_flag_t
)
srb_flagP
,
srb_flagP
,
(
const
MBMS_flag_t
)
flag_MBMS
,
flag_MBMS
,
(
const
rb_id_t
)
rb_idP
,
rb_idP
,
(
const
mui_t
)
muiP
,
muiP
,
confirmP
,
confirmP
,
pdcp_pdu_size
,
pdcp_pdu_size
,
pdcp_pdu_p
,
pdcp_pdu_p
...
@@ -439,8 +437,6 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
...
@@ -439,8 +437,6 @@ int proto_agent_pdcp_data_req_process(mod_id_t mod_id, const void *params, Proto
return
result
;
return
result
;
error:
error:
if
(
ctxt_pP
)
free
(
ctxt_pP
);
if
(
pdcp_pdu_p
)
if
(
pdcp_pdu_p
)
free_mem_block
(
pdcp_pdu_p
,
__func__
);
free_mem_block
(
pdcp_pdu_p
,
__func__
);
LOG_E
(
PROTO_AGENT
,
"%s: an error occured
\n
"
,
__FUNCTION__
);
LOG_E
(
PROTO_AGENT
,
"%s: an error occured
\n
"
,
__FUNCTION__
);
...
@@ -589,7 +585,7 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
...
@@ -589,7 +585,7 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
rlc_data
=
data_ind
->
rlc_data
;
rlc_data
=
data_ind
->
rlc_data
;
ctxt
=
rlc_data
->
fsp_ctxt
;
ctxt
=
rlc_data
->
fsp_ctxt
;
protocol_ctxt_t
*
ctxt_pP
;
protocol_ctxt_t
ctxt_pP
;
srb_flag_t
srb_flagP
=
0
;
srb_flag_t
srb_flagP
=
0
;
rb_id_t
rb_idP
=
0
;
rb_id_t
rb_idP
=
0
;
sdu_size_t
pdcp_pdu_size
=
0
;
sdu_size_t
pdcp_pdu_size
=
0
;
...
@@ -597,15 +593,13 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
...
@@ -597,15 +593,13 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
mem_block_t
*
pdcp_pdu_p
=
NULL
;
mem_block_t
*
pdcp_pdu_p
=
NULL
;
// Create a new protocol context for handling the packet
// Create a new protocol context for handling the packet
ctxt_pP
=
malloc
(
sizeof
(
protocol_ctxt_t
));
ctxt_pP
.
module_id
=
ctxt
->
fsp_mod_id
;
if
(
!
ctxt_pP
)
goto
error
;
ctxt_pP
.
enb_flag
=
ctxt
->
fsp_enb_flag
;
ctxt_pP
->
module_id
=
ctxt
->
fsp_mod_id
;
ctxt_pP
.
instance
=
ctxt
->
fsp_instance
;
ctxt_pP
->
enb_flag
=
ctxt
->
fsp_enb_flag
;
ctxt_pP
.
rnti
=
ctxt
->
fsp_rnti
;
ctxt_pP
->
instance
=
ctxt
->
fsp_instance
;
ctxt_pP
.
frame
=
ctxt
->
fsp_frame
;
ctxt_pP
->
rnti
=
ctxt
->
fsp_rnti
;
ctxt_pP
.
subframe
=
ctxt
->
fsp_subframe
;
ctxt_pP
->
frame
=
ctxt
->
fsp_frame
;
ctxt_pP
.
eNB_index
=
ctxt
->
fsp_enb_index
;
ctxt_pP
->
subframe
=
ctxt
->
fsp_subframe
;
ctxt_pP
->
eNB_index
=
ctxt
->
fsp_enb_index
;
srb_flagP
=
rlc_data
->
fsp_srb_flag
;
srb_flagP
=
rlc_data
->
fsp_srb_flag
;
flag_MBMS
=
rlc_data
->
fsp_mbms_flag
;
flag_MBMS
=
rlc_data
->
fsp_mbms_flag
;
...
@@ -619,8 +613,8 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
...
@@ -619,8 +613,8 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
// if (xid == 1)
// if (xid == 1)
// pdcp_data_ind_wifi((const protocol_ctxt_t*) ctxt_pP, (const srb_flag_t) srb_flagP, (const MBMS_flag_t) flag_MBMS, (const rb_id_t) rb_idP, pdcp_pdu_size, pdcp_pdu_p);
// pdcp_data_ind_wifi((const protocol_ctxt_t*) ctxt_pP, (const srb_flag_t) srb_flagP, (const MBMS_flag_t) flag_MBMS, (const rb_id_t) rb_idP, pdcp_pdu_size, pdcp_pdu_p);
// else if (xid == 0) // FIXME: USE a preprocessed definition
// else if (xid == 0) // FIXME: USE a preprocessed definition
LOG_D
(
PROTO_AGENT
,
"[inst %d] Received PDCP PDU with size %d for UE RNTI %x RB %d, Calling pdcp_data_ind
\n
"
,
ctxt_pP
->
instance
,
pdcp_pdu_size
,
ctxt_pP
->
rnti
,
rb_idP
);
LOG_D
(
PROTO_AGENT
,
"[inst %d] Received PDCP PDU with size %d for UE RNTI %x RB %d, Calling pdcp_data_ind
\n
"
,
ctxt_pP
.
instance
,
pdcp_pdu_size
,
ctxt_pP
.
rnti
,
rb_idP
);
result
=
pdcp_data_ind
(
ctxt_pP
,
result
=
pdcp_data_ind
(
&
ctxt_pP
,
srb_flagP
,
srb_flagP
,
flag_MBMS
,
flag_MBMS
,
rb_idP
,
rb_idP
,
...
@@ -630,8 +624,6 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
...
@@ -630,8 +624,6 @@ int proto_agent_pdcp_data_ind_process(mod_id_t mod_id, const void *params, Proto
return
result
;
return
result
;
error:
error:
if
(
ctxt_pP
)
free
(
ctxt_pP
);
if
(
pdcp_pdu_p
)
if
(
pdcp_pdu_p
)
free_mem_block
(
pdcp_pdu_p
,
__func__
);
free_mem_block
(
pdcp_pdu_p
,
__func__
);
LOG_E
(
MAC
,
"%s: an error occured
\n
"
,
__FUNCTION__
);
LOG_E
(
MAC
,
"%s: an error occured
\n
"
,
__FUNCTION__
);
...
...
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