Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
sneltved
openairinterface5G
Commits
753c2f44
Commit
753c2f44
authored
Mar 10, 2019
by
frtabu
Browse files
apply astyle, fix compilation warnings in raw aeth transport and kernel modules
parent
49f4bdc2
Changes
23
Expand all
Hide whitespace changes
Inline
Side-by-side
openair1/PHY/INIT/lte_param_init.c
View file @
753c2f44
...
...
@@ -37,27 +37,25 @@
extern
PHY_VARS_eNB
*
eNB
;
extern
PHY_VARS_UE
*
UE
;
extern
RU_t
*
ru
;
extern
void
phy_init_RU
(
RU_t
*
);
extern
void
phy_init_RU
(
RU_t
*
);
void
lte_param_init
(
PHY_VARS_eNB
**
eNBp
,
PHY_VARS_UE
**
UEp
,
RU_t
**
rup
,
unsigned
char
N_tx_port_eNB
,
PHY_VARS_UE
**
UEp
,
RU_t
**
rup
,
unsigned
char
N_tx_port_eNB
,
unsigned
char
N_tx_phy
,
unsigned
char
N_rx_ru
,
unsigned
char
N_rx_ru
,
unsigned
char
N_rx_ue
,
unsigned
char
transmission_mode
,
uint8_t
extended_prefix_flag
,
frame_t
frame_type
,
uint16_t
Nid_cell
,
uint8_t
tdd_config
,
uint8_t
N_RB_DL
,
uint8_t
pa
,
uint8_t
threequarter_fs
,
unsigned
char
transmission_mode
,
uint8_t
extended_prefix_flag
,
frame_t
frame_type
,
uint16_t
Nid_cell
,
uint8_t
tdd_config
,
uint8_t
N_RB_DL
,
uint8_t
pa
,
uint8_t
threequarter_fs
,
uint8_t
osf
,
uint32_t
perfect_ce
)
{
uint32_t
perfect_ce
)
{
LTE_DL_FRAME_PARMS
*
frame_parms
;
int
i
;
PHY_VARS_eNB
*
eNB
;
...
...
@@ -71,23 +69,16 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
UE
=
*
UEp
;
ru
=
*
rup
;
printf
(
"eNB %p, UE %p, ru %p
\n
"
,
eNB
,
UE
,
ru
);
memset
((
void
*
)
eNB
,
0
,
sizeof
(
PHY_VARS_eNB
));
memset
((
void
*
)
UE
,
0
,
sizeof
(
PHY_VARS_UE
));
memset
((
void
*
)
ru
,
0
,
sizeof
(
RU_t
));
memset
((
void
*
)
eNB
,
0
,
sizeof
(
PHY_VARS_eNB
));
memset
((
void
*
)
UE
,
0
,
sizeof
(
PHY_VARS_UE
));
memset
((
void
*
)
ru
,
0
,
sizeof
(
RU_t
));
ru
->
eNB_list
[
0
]
=
eNB
;
eNB
->
RU_list
[
0
]
=
ru
;
ru
->
num_eNB
=
1
;
srand
(
0
);
randominit
(
0
);
set_taus_seed
(
0
);
frame_parms
=
&
(
eNB
->
frame_parms
);
frame_parms
->
N_RB_DL
=
N_RB_DL
;
//50 for 10MHz and 25 for 5 MHz
frame_parms
->
N_RB_UL
=
N_RB_DL
;
frame_parms
->
threequarter_fs
=
threequarter_fs
;
...
...
@@ -106,13 +97,9 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
// frame_parms->Bsrs = 0;
// frame_parms->kTC = 0;44
// frame_parms->n_RRC = 0;
init_frame_parms
(
frame_parms
,
osf
);
//copy_lte_parms_to_phy_framing(frame_parms, &(PHY_config->PHY_framing));
// phy_init_top(frame_parms); //allocation
UE
->
is_secondary_ue
=
0
;
UE
->
frame_parms
=
*
frame_parms
;
UE
->
frame_parms
.
nb_antennas_rx
=
N_rx_ue
;
...
...
@@ -121,14 +108,10 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
ru
->
nb_tx
=
N_tx_phy
;
ru
->
nb_rx
=
N_rx_ru
;
ru
->
if_south
=
LOCAL_RF
;
eNB
->
configured
=
1
;
eNB
->
transmission_mode
[
0
]
=
transmission_mode
;
UE
->
transmission_mode
[
0
]
=
transmission_mode
;
dump_frame_parms
(
frame_parms
);
UE
->
measurements
.
n_adj_cells
=
0
;
UE
->
measurements
.
adj_cell_id
[
0
]
=
Nid_cell
+
1
;
UE
->
measurements
.
adj_cell_id
[
1
]
=
Nid_cell
+
2
;
...
...
@@ -144,7 +127,6 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
phy_init_RU
(
ru
);
generate_pcfich_reg_mapping
(
&
UE
->
frame_parms
);
generate_phich_reg_mapping
(
&
UE
->
frame_parms
);
// DL power control init
//if (transmission_mode == 1) {
UE
->
pdsch_config_dedicated
->
p_a
=
pa
;
...
...
@@ -166,17 +148,13 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
if
(
eNB
->
frame_parms
.
N_RB_DL
==
100
)
ru
->
N_TA_offset
=
624
;
else
if
(
eNB
->
frame_parms
.
N_RB_DL
==
50
)
ru
->
N_TA_offset
=
624
/
2
;
else
if
(
eNB
->
frame_parms
.
N_RB_DL
==
25
)
ru
->
N_TA_offset
=
624
/
4
;
}
else
ru
->
N_TA_offset
=
0
;
}
else
ru
->
N_TA_offset
=
0
;
if
(
IS_SOFTMODEM_BASICSIM
)
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
if
(
IS_SOFTMODEM_BASICSIM
)
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
UE
->
N_TA_offset
=
0
;
printf
(
"Done lte_param_init
\n
"
);
}
openair1/PHY/LTE_TRANSPORT/dci.c
View file @
753c2f44
This diff is collapsed.
Click to expand it.
openair1/PHY/LTE_TRANSPORT/pss.c
View file @
753c2f44
...
...
@@ -44,66 +44,59 @@ int generate_pss(int32_t **txdataF,
short
amp
,
LTE_DL_FRAME_PARMS
*
frame_parms
,
unsigned
short
symbol
,
unsigned
short
slot_offset
)
{
unsigned
short
slot_offset
)
{
unsigned
int
Nsymb
;
unsigned
short
k
,
m
,
aa
,
a
;
uint8_t
Nid2
;
short
*
primary_sync
;
Nid2
=
frame_parms
->
Nid_cell
%
3
;
switch
(
Nid2
)
{
case
0
:
primary_sync
=
primary_synch0
;
break
;
case
0
:
primary_sync
=
primary_synch0
;
break
;
case
1
:
primary_sync
=
primary_synch1
;
break
;
case
1
:
primary_sync
=
primary_synch1
;
break
;
case
2
:
primary_sync
=
primary_synch2
;
break
;
case
2
:
primary_sync
=
primary_synch2
;
break
;
default:
LOG_E
(
PHY
,
"[PSS] eNb_id has to be 0,1,2
\n
"
);
return
(
-
1
);
default:
LOG_E
(
PHY
,
"[PSS] eNb_id has to be 0,1,2
\n
"
);
return
(
-
1
);
}
a
=
(
frame_parms
->
nb_antenna_ports_eNB
==
1
)
?
amp
:
(
amp
*
ONE_OVER_SQRT2_Q15
)
>>
15
;
//printf("[PSS] amp=%d, a=%d\n",amp,a);
if
(
IS_SOFTMODEM_BASICSIM
)
/* a hack to remove at some point (the UE doesn't synch with 100 RBs) */
/* a hack to remove at some point (the UE doesn't synch with 100 RBs) */
a
=
(
frame_parms
->
nb_antenna_ports_eNB
==
1
)
?
4
*
amp
:
(
amp
*
ONE_OVER_SQRT2_Q15
)
>>
15
;
Nsymb
=
(
frame_parms
->
Ncp
==
NORMAL
)
?
14
:
12
;
for
(
aa
=
0
;
aa
<
frame_parms
->
nb_antenna_ports_eNB
;
aa
++
)
{
// aa = 0;
// The PSS occupies the inner 6 RBs, which start at
k
=
frame_parms
->
ofdm_symbol_size
-
3
*
12
+
5
;
//printf("[PSS] k = %d\n",k);
for
(
m
=
5
;
m
<
67
;
m
++
)
{
((
short
*
)
txdataF
[
aa
])[
2
*
(
slot_offset
*
Nsymb
/
2
*
frame_parms
->
ofdm_symbol_size
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
k
)]
=
(
a
*
primary_sync
[
2
*
m
])
>>
15
;
((
short
*
)
txdataF
[
aa
])[
2
*
(
slot_offset
*
Nsymb
/
2
*
frame_parms
->
ofdm_symbol_size
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
k
)
+
1
]
=
(
a
*
primary_sync
[
2
*
m
+
1
])
>>
15
;
((
short
*
)
txdataF
[
aa
])[
2
*
(
slot_offset
*
Nsymb
/
2
*
frame_parms
->
ofdm_symbol_size
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
k
)]
=
(
a
*
primary_sync
[
2
*
m
])
>>
15
;
((
short
*
)
txdataF
[
aa
])[
2
*
(
slot_offset
*
Nsymb
/
2
*
frame_parms
->
ofdm_symbol_size
+
symbol
*
frame_parms
->
ofdm_symbol_size
+
k
)
+
1
]
=
(
a
*
primary_sync
[
2
*
m
+
1
])
>>
15
;
k
+=
1
;
if
(
k
>=
frame_parms
->
ofdm_symbol_size
)
{
k
++
;
//skip DC
k
-=
frame_parms
->
ofdm_symbol_size
;
}
}
}
...
...
openair1/SIMULATION/ETH_TRANSPORT/netlink_init.c
View file @
753c2f44
...
...
@@ -63,7 +63,6 @@ struct msghdr nas_msg_rx;
#define GRAAL_NETLINK_ID 31
static
int
tun_alloc
(
char
*
dev
)
{
struct
ifreq
ifr
;
int
fd
,
err
;
...
...
openair1/SIMULATION/LTE_PHY/dlsim.c
View file @
753c2f44
...
...
@@ -782,13 +782,15 @@ int main(int argc, char **argv) {
break
;
case
'u'
:
dual_stream_UE
=
1
;
if
(
UE
!=
NULL
)
UE
->
use_ia_receiver
=
1
;
dual_stream_UE
=
1
;
if
(
UE
!=
NULL
)
UE
->
use_ia_receiver
=
1
;
else
{
printf
(
"UE is NULL
\n
"
);
exit
(
-
1
);
}
exit
(
-
1
);
}
if
((
n_tx_port
!=
2
)
||
(
transmission_mode
!=
5
))
{
printf
(
"IA receiver only supported for TM5!"
);
exit
(
-
1
);
...
...
@@ -951,8 +953,8 @@ int main(int argc, char **argv) {
fl_set_object_label
(
form_ue
->
button_0
,
"IA Receiver ON"
);
fl_set_object_color
(
form_ue
->
button_0
,
FL_GREEN
,
FL_GREEN
);
}
else
{
printf
(
"UE is NULL
\n
"
);
exit
(
-
1
);
printf
(
"UE is NULL
\n
"
);
exit
(
-
1
);
}
}
}
...
...
openair1/SIMULATION/LTE_PHY/ulsim.c
View file @
753c2f44
...
...
@@ -1211,9 +1211,7 @@ int main(int argc, char **argv) {
}
dump_ulsch
(
eNB
,
eNB
->
proc
.
frame_rx
,
subframe
,
0
,
round
);
round
=
5
;
}
if
(
n_frames
==
1
)
printf
(
"round %d errors %u/%u
\n
"
,
round
,
errs
[
round
],
trials
);
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp.c
View file @
753c2f44
...
...
@@ -440,7 +440,6 @@ pdcp_data_ind(
uint32_t
rx_hfn_for_count
;
int
pdcp_sn_for_count
;
int
security_ok
;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_IND
,
VCD_FUNCTION_IN
);
LOG_DUMPMSG
(
PDCP
,
DEBUG_PDCP
,(
char
*
)
sdu_buffer_pP
->
data
,
sdu_buffer_sizeP
,
"[MSG] PDCP UL %s PDU on rb_id %d
\n
"
,
(
srb_flagP
)
?
"CONTROL"
:
"DATA"
,
rb_idP
);
...
...
@@ -567,6 +566,7 @@ pdcp_data_ind(
}
#if 0
/* Removed by Cedric */
if (pdcp_is_rx_seq_number_valid(sequence_number, pdcp_p, srb_flagP) == TRUE) {
LOG_T(PDCP, "Incoming PDU has a sequence number (%d) in accordance with RX window\n", sequence_number);
...
...
@@ -588,6 +588,7 @@ pdcp_data_ind(
free_mem_block(sdu_buffer_pP, __func__);
return FALSE;
}
#endif
// SRB1/2: control-plane data
...
...
@@ -678,158 +679,156 @@ pdcp_data_ind(
payload_offset
=
pdcp_header_len
;
// PDCP_USER_PLANE_DATA_PDU_LONG_SN_HEADER_SIZE;
switch
(
pdcp_p
->
rlc_mode
)
{
case
RLC_MODE_AM
:
{
/* process as described in 36.323 5.1.2.1.2 */
int
reordering_window
;
if
(
pdcp_p
->
seq_num_size
==
7
)
reordering_window
=
REORDERING_WINDOW_SN_7BIT
;
else
reordering_window
=
REORDERING_WINDOW_SN_12BIT
;
if
(
sequence_number
-
pdcp_p
->
last_submitted_pdcp_rx_sn
>
reordering_window
||
(
pdcp_p
->
last_submitted_pdcp_rx_sn
-
sequence_number
>=
0
&&
pdcp_p
->
last_submitted_pdcp_rx_sn
-
sequence_number
<
reordering_window
))
{
/* TODO: specs say to decipher and do header decompression */
LOG_W
(
PDCP
,
PROTOCOL_PDCP_CTXT_FMT
"discard PDU, out of
\n
"
,
PROTOCOL_PDCP_CTXT_ARGS
(
ctxt_pP
,
pdcp_p
));
LOG_W
(
PDCP
,
"Ignoring PDU...
\n
"
);
free_mem_block
(
sdu_buffer_pP
,
__func__
);
/* TODO: indicate integrity verification failure to upper layer */
return
FALSE
;
}
else
if
(
pdcp_p
->
next_pdcp_rx_sn
-
sequence_number
>
reordering_window
)
{
pdcp_p
->
rx_hfn
++
;
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
;
pdcp_sn_for_count
=
sequence_number
;
pdcp_p
->
next_pdcp_rx_sn
=
sequence_number
+
1
;
case
RLC_MODE_AM
:
{
/* process as described in 36.323 5.1.2.1.2 */
int
reordering_window
;
}
else
if
(
sequence_number
-
pdcp_p
->
next_pdcp_rx_sn
>=
reordering_window
)
{
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
-
1
;
pdcp_sn_for_count
=
sequence_number
;
}
else
if
(
sequence_number
>=
pdcp_p
->
next_pdcp_rx_sn
)
{
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
;
pdcp_sn_for_count
=
sequence_number
;
pdcp_p
->
next_pdcp_rx_sn
=
sequence_number
+
1
;
if
(
pdcp_p
->
next_pdcp_rx_sn
>
pdcp_p
->
maximum_pdcp_rx_sn
)
{
pdcp_p
->
next_pdcp_rx_sn
=
0
;
if
(
pdcp_p
->
seq_num_size
==
7
)
reordering_window
=
REORDERING_WINDOW_SN_7BIT
;
else
reordering_window
=
REORDERING_WINDOW_SN_12BIT
;
if
(
sequence_number
-
pdcp_p
->
last_submitted_pdcp_rx_sn
>
reordering_window
||
(
pdcp_p
->
last_submitted_pdcp_rx_sn
-
sequence_number
>=
0
&&
pdcp_p
->
last_submitted_pdcp_rx_sn
-
sequence_number
<
reordering_window
))
{
/* TODO: specs say to decipher and do header decompression */
LOG_W
(
PDCP
,
PROTOCOL_PDCP_CTXT_FMT
"discard PDU, out of
\n
"
,
PROTOCOL_PDCP_CTXT_ARGS
(
ctxt_pP
,
pdcp_p
));
LOG_W
(
PDCP
,
"Ignoring PDU...
\n
"
);
free_mem_block
(
sdu_buffer_pP
,
__func__
);
/* TODO: indicate integrity verification failure to upper layer */
return
FALSE
;
}
else
if
(
pdcp_p
->
next_pdcp_rx_sn
-
sequence_number
>
reordering_window
)
{
pdcp_p
->
rx_hfn
++
;
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
;
pdcp_sn_for_count
=
sequence_number
;
pdcp_p
->
next_pdcp_rx_sn
=
sequence_number
+
1
;
}
else
if
(
sequence_number
-
pdcp_p
->
next_pdcp_rx_sn
>=
reordering_window
)
{
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
-
1
;
pdcp_sn_for_count
=
sequence_number
;
}
else
if
(
sequence_number
>=
pdcp_p
->
next_pdcp_rx_sn
)
{
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
;
pdcp_sn_for_count
=
sequence_number
;
pdcp_p
->
next_pdcp_rx_sn
=
sequence_number
+
1
;
if
(
pdcp_p
->
next_pdcp_rx_sn
>
pdcp_p
->
maximum_pdcp_rx_sn
)
{
pdcp_p
->
next_pdcp_rx_sn
=
0
;
pdcp_p
->
rx_hfn
++
;
}
}
else
{
/* sequence_number < pdcp_p->next_pdcp_rx_sn */
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
;
pdcp_sn_for_count
=
sequence_number
;
}
}
else
{
/* sequence_number < pdcp_p->next_pdcp_rx_sn */
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
;
pdcp_sn_for_count
=
sequence_number
;
}
if
(
pdcp_p
->
security_activated
==
1
)
{
if
(
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
start_meas
(
&
eNB_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
else
{
start_meas
(
&
UE_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
if
(
pdcp_p
->
security_activated
==
1
)
{
if
(
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
start_meas
(
&
eNB_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
else
{
start_meas
(
&
UE_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
security_ok
=
pdcp_validate_security
(
ctxt_pP
,
pdcp_p
,
srb_flagP
,
rb_idP
,
pdcp_header_len
,
rx_hfn_for_count
,
pdcp_sn_for_count
,
sdu_buffer_pP
->
data
,
sdu_buffer_sizeP
-
pdcp_tailer_len
)
==
0
;
security_ok
=
pdcp_validate_security
(
ctxt_pP
,
pdcp_p
,
srb_flagP
,
rb_idP
,
pdcp_header_len
,
rx_hfn_for_count
,
pdcp_sn_for_count
,
sdu_buffer_pP
->
data
,
sdu_buffer_sizeP
-
pdcp_tailer_len
)
==
0
;
if
(
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
stop_meas
(
&
eNB_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
if
(
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
stop_meas
(
&
eNB_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
else
{
stop_meas
(
&
UE_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
}
else
{
s
top_meas
(
&
UE_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
)
;
s
ecurity_ok
=
1
;
}
}
else
{
security_ok
=
1
;
}
if
(
security_ok
==
0
)
{
LOG_W
(
PDCP
,
PROTOCOL_PDCP_CTXT_FMT
"security not validated for incoming PDPC DRB RLC/AM PDU
\n
"
,
PROTOCOL_PDCP_CTXT_ARGS
(
ctxt_pP
,
pdcp_p
));
LOG_W
(
PDCP
,
"Ignoring PDU...
\n
"
);
free_mem_block
(
sdu_buffer_pP
,
__func__
);
/* TODO: indicate integrity verification failure to upper layer */
return
FALSE
;
}
if
(
security_ok
==
0
)
{
LOG_W
(
PDCP
,
PROTOCOL_PDCP_CTXT_FMT
"security not validated for incoming PDPC DRB RLC/AM PDU
\n
"
,
PROTOCOL_PDCP_CTXT_ARGS
(
ctxt_pP
,
pdcp_p
));
LOG_W
(
PDCP
,
"Ignoring PDU...
\n
"
);
free_mem_block
(
sdu_buffer_pP
,
__func__
);
/* TODO: indicate integrity verification failure to upper layer */
return
FALSE
;
}
/* TODO: specs say we have to store this PDU in a list and then deliver
* stored packets to upper layers according to a well defined
* procedure. The code below that deals with delivery is today
* too complex to do this properly, so we only send the current
* received packet. This is not correct and has to be fixed
* some day.
* In the meantime, let's pretend the last submitted PDCP SDU
* is the current one.
* TODO: we also have to deal with re-establishment PDU (control PDUs)
* that contain no SDU.
*/
/* TODO: specs say we have to store this PDU in a list and then deliver
* stored packets to upper layers according to a well defined
* procedure. The code below that deals with delivery is today
* too complex to do this properly, so we only send the current
* received packet. This is not correct and has to be fixed
* some day.
* In the meantime, let's pretend the last submitted PDCP SDU
* is the current one.
* TODO: we also have to deal with re-establishment PDU (control PDUs)
* that contain no SDU.
*/
pdcp_p
->
last_submitted_pdcp_rx_sn
=
sequence_number
;
break
;
}
/* case RLC_MODE_AM */
pdcp_p
->
last_submitted_pdcp_rx_sn
=
sequence_number
;
case
RLC_MODE_UM
:
break
;
}
/* case RLC_MODE_AM */
/* process as described in 36.323 5.1.2.1.3 */
if
(
sequence_number
<
pdcp_p
->
next_pdcp_rx_sn
)
{
pdcp_p
->
rx_hfn
++
;
}
case
RLC_MODE_UM
:
/* process as described in 36.323 5.1.2.1.3 */
if
(
sequence_number
<
pdcp_p
->
next_pdcp_rx_sn
)
{
pdcp_p
->
rx_hfn
++
;
}
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
;
pdcp_sn_for_count
=
sequence_number
;
pdcp_p
->
next_pdcp_rx_sn
=
sequence_number
+
1
;
if
(
pdcp_p
->
next_pdcp_rx_sn
>
pdcp_p
->
maximum_pdcp_rx_sn
)
{
pdcp_p
->
next_pdcp_rx_sn
=
0
;
pdcp_p
->
rx_hfn
++
;
}
rx_hfn_for_count
=
pdcp_p
->
rx_hfn
;
pdcp_sn_for_count
=
sequence_number
;
pdcp_p
->
next_pdcp_rx_sn
=
sequence_number
+
1
;
if
(
pdcp_p
->
security_activated
==
1
)
{
if
(
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
start_meas
(
&
eNB_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
else
{
start_meas
(
&
UE_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
if
(
pdcp_p
->
next_pdcp_rx_sn
>
pdcp_p
->
maximum_pdcp_rx_sn
)
{
pdcp_p
->
next_pdcp_rx_sn
=
0
;
pdcp_p
->
rx_hfn
++
;
}
security_ok
=
pdcp_validate_security
(
ctxt_pP
,
pdcp_p
,
srb_flagP
,
rb_idP
,
pdcp_header_len
,
rx_hfn_for_count
,
pdcp_sn_for_count
,
sdu_buffer_pP
->
data
,
sdu_buffer_sizeP
-
pdcp_tailer_len
)
==
0
;
if
(
pdcp_p
->
security_activated
==
1
)
{
if
(
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
start_meas
(
&
eNB_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
else
{
start_meas
(
&
UE_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
if
(
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
stop_meas
(
&
eNB_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
security_ok
=
pdcp_validate_security
(
ctxt_pP
,
pdcp_p
,
srb_flagP
,
rb_idP
,
pdcp_header_len
,
rx_hfn_for_count
,
pdcp_sn_for_count
,
sdu_buffer_pP
->
data
,
sdu_buffer_sizeP
-
pdcp_tailer_len
)
==
0
;
if
(
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
stop_meas
(
&
eNB_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
else
{
stop_meas
(
&
UE_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
);
}
}
else
{
s
top_meas
(
&
UE_pdcp_stats
[
ctxt_pP
->
module_id
].
validate_security
)
;
s
ecurity_ok
=
1
;
}
}
else
{
security_ok
=
1
;
}
if
(
security_ok
==
0
)
{
LOG_W
(
PDCP
,
PROTOCOL_PDCP_CTXT_FMT
"security not validated for incoming PDPC DRB RLC/UM PDU
\n
"
,
PROTOCOL_PDCP_CTXT_ARGS
(
ctxt_pP
,
pdcp_p
));
LOG_W
(
PDCP
,
"Ignoring PDU...
\n
"
);
free_mem_block
(
sdu_buffer_pP
,
__func__
);
/* TODO: indicate integrity verification failure to upper layer */
return
FALSE
;
}
if
(
security_ok
==
0
)
{
LOG_W
(
PDCP
,
PROTOCOL_PDCP_CTXT_FMT
"security not validated for incoming PDPC DRB RLC/UM PDU
\n
"
,
PROTOCOL_PDCP_CTXT_ARGS
(
ctxt_pP
,
pdcp_p
));
LOG_W
(
PDCP
,
"Ignoring PDU...
\n
"
);
free_mem_block
(
sdu_buffer_pP
,
__func__
);
/* TODO: indicate integrity verification failure to upper layer */
return
FALSE
;
}
break
;
break
;
default:
LOG_E
(
PDCP
,
"bad RLC mode, cannot happen.
\n
"
);
exit
(
1
);
default:
LOG_E
(
PDCP
,
"bad RLC mode, cannot happen.
\n
"
);
exit
(
1
);
}
/* switch (pdcp_p->rlc_mode) */
}
else
{
/* MBMS_flagP == 0 */
payload_offset
=
0
;
...
...
@@ -1145,10 +1144,10 @@ pdcp_run (
}
while
(
msg_p
!=
NULL
);
// IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer
// if (LINK_ENB_PDCP_TO_GTPV1U && ctxt_pP->enb_flag == ENB_FLAG_NO) {
if
(
!
EPC_MODE_ENABLED
||
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
pdcp_fifo_read_input_sdus
(
ctxt_pP
);
}
// if (LINK_ENB_PDCP_TO_GTPV1U && ctxt_pP->enb_flag == ENB_FLAG_NO) {
if
(
!
EPC_MODE_ENABLED
||
ctxt_pP
->
enb_flag
==
ENB_FLAG_NO
)
{
pdcp_fifo_read_input_sdus
(
ctxt_pP
);
}
// PDCP -> NAS/IP traffic: RX
if
(
ctxt_pP
->
enb_flag
)
{
...
...
@@ -2042,6 +2041,8 @@ uint64_t pdcp_module_init( uint64_t pdcp_optmask ) {
((
PDCP_USE_NETLINK
)
?
"usenetlink"
:
""
));
if
(
PDCP_USE_NETLINK
)
{
nas_getparams
();
if
(
UE_NAS_USE_TUN
)
{
netlink_init_tun
(
"ue"
);
LOG_I
(
PDCP
,
"UE pdcp will use tun interface
\n
"
);
...
...
openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c