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
dad42400
Commit
dad42400
authored
Oct 09, 2023
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merged pdcp/rlc components to current L1/L2
parent
2cda03b0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
294 additions
and
14 deletions
+294
-14
openair1/PHY/INIT/nr_parms.c
openair1/PHY/INIT/nr_parms.c
+1
-1
openair2/LAYER2/NR_MAC_UE/config_ue_sl.c
openair2/LAYER2/NR_MAC_UE/config_ue_sl.c
+3
-2
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+2
-1
openair2/LAYER2/nr_pdcp/asn1_utils.c
openair2/LAYER2/nr_pdcp/asn1_utils.c
+31
-0
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+50
-2
openair2/LAYER2/nr_rlc/asn1_utils.c
openair2/LAYER2/nr_rlc/asn1_utils.c
+1
-0
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+126
-1
openair2/RRC/NR_UE/rrc_sl_preconfig.c
openair2/RRC/NR_UE/rrc_sl_preconfig.c
+65
-5
openair2/RRC/NR_UE/sl_preconfig_paramvalues.h
openair2/RRC/NR_UE/sl_preconfig_paramvalues.h
+15
-2
No files found.
openair1/PHY/INIT/nr_parms.c
View file @
dad42400
...
...
@@ -424,7 +424,7 @@ int nr_init_frame_parms_ue_sl(NR_DL_FRAME_PARMS *fp,
fp
->
ofdm_offset_divisor
=
ofdm_offset_divisor
;
fp
->
threequarter_fs
=
threequarter_fs
;
fp
->
nr_band
=
get_band
(
config
->
sl_carrier_config
.
sl_frequency
,
0
);
fp
->
nr_band
=
get_band
(
config
->
sl_carrier_config
.
sl_frequency
*
1000
,
0
);
fp
->
att_rx
=
config
->
sl_carrier_config
.
sl_num_rx_ant
;
fp
->
att_tx
=
config
->
sl_carrier_config
.
sl_num_tx_ant
;
...
...
openair2/LAYER2/NR_MAC_UE/config_ue_sl.c
View file @
dad42400
...
...
@@ -195,7 +195,7 @@ static void sl_prepare_phy_config(int module_id,
phycfg
->
sl_carrier_config
.
sl_bandwidth
=
get_supported_bw_mhz
(
FR1
,
bw_index
);
phycfg
->
sl_carrier_config
.
sl_frequency
=
from_nrarfcn
(
sl_band
,
carriercfg
->
subcarrierSpacing
,
pointA_ARFCN
);
// freq in kHz
from_nrarfcn
(
sl_band
,
carriercfg
->
subcarrierSpacing
,
pointA_ARFCN
)
/
1000
;
// freq in kHz
phycfg
->
sl_carrier_config
.
sl_grid_size
=
carriercfg
->
carrierBandwidth
;
//For sidelink offset to carrier is 0. hence not used
...
...
@@ -326,7 +326,8 @@ static void sl_prepare_phy_config(int module_id,
// RRC calls this API when RRC is configured with Sidelink PRE-configuration I.E
int
nr_rrc_mac_config_req_sl_preconfig
(
module_id_t
module_id
,
NR_SL_PreconfigurationNR_r16_t
*
sl_preconfiguration
,
uint8_t
sync_source
)
uint8_t
sync_source
,
int
src_id
)
{
LOG_I
(
NR_MAC
,
"[UE%d] SL RRC->MAC CONFIG RECEIVED. Syncsource:%d
\n
"
,
...
...
openair2/LAYER2/NR_MAC_UE/mac_proto.h
View file @
dad42400
...
...
@@ -438,7 +438,8 @@ int nr_config_pusch_pdu(NR_UE_MAC_INST_t *mac,
int
nr_rrc_mac_config_req_sl_preconfig
(
module_id_t
module_id
,
NR_SL_PreconfigurationNR_r16_t
*
sl_preconfiguration
,
uint8_t
sync_source
);
uint8_t
sync_source
,
int
srcid
);
void
nr_rrc_mac_transmit_slss_req
(
module_id_t
module_id
,
uint8_t
*
sl_mib_payload
,
...
...
openair2/LAYER2/nr_pdcp/asn1_utils.c
View file @
dad42400
...
...
@@ -78,3 +78,34 @@ int decode_discard_timer(long v)
return
tab
[
v
];
}
int
decode_discard_timer_sl
(
long
v
)
{
static
const
int
tab
[
18
]
=
{
3
,
10
,
20
,
25
,
30
,
40
,
50
,
60
,
75
,
100
,
150
,
200
,
250
,
300
,
500
,
750
,
1500
,
-
1
,
};
if
(
v
<
0
||
v
>
17
)
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
return
tab
[
v
];
}
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
View file @
dad42400
...
...
@@ -467,7 +467,7 @@ static void *ue_tun_read_thread(void *_)
exit
(
1
);
}
LOG_
D
(
PDCP
,
"%s(): nas_sock_fd read returns len %d
\n
"
,
__func__
,
len
);
LOG_
I
(
PDCP
,
"%s(): nas_sock_fd read returns len %d
\n
"
,
__func__
,
len
);
nr_pdcp_manager_lock
(
nr_pdcp_ue_manager
);
has_ue
=
nr_pdcp_get_first_ue_id
(
nr_pdcp_ue_manager
,
&
rntiMaybeUEid
);
...
...
@@ -884,6 +884,54 @@ void add_drb_am(int is_gnb, ue_id_t rntiMaybeUEid, ue_id_t reestablish_ue_id, st
nr_pdcp_manager_unlock
(
nr_pdcp_ue_manager
);
}
void
add_drb_sl
(
ue_id_t
srcid
,
NR_SL_RadioBearerConfig_r16_t
*
s
,
int
ciphering_algorithm
,
int
integrity_algorithm
,
unsigned
char
*
ciphering_key
,
unsigned
char
*
integrity_key
)
{
nr_pdcp_entity_t
*
pdcp_drb
;
nr_pdcp_ue_t
*
ue
;
AssertFatal
(
s
->
sl_PDCP_Config_r16
!=
NULL
,
"SL PDCP config is not there!
\n
"
);
int
slrb_id
=
s
->
slrb_Uu_ConfigIndex_r16
;
int
sn_size
=
decode_sn_size_ul
(
*
s
->
sl_PDCP_Config_r16
->
sl_PDCP_SN_Size_r16
);
int
discard_timer
=
decode_discard_timer_sl
(
*
s
->
sl_PDCP_Config_r16
->
sl_DiscardTimer_r16
);
// these 3 are configured differently in Sidelink
int
has_integrity
=
0
;
int
has_ciphering
=
0
;
int
has_rohc
=
0
;
int
t_reordering
=
20
;
bool
has_sdap
=
false
;
bool
is_sdap_DefaultDRB
=
false
;
has_sdap
=
s
->
sl_SDAP_Config_r16
&&
s
->
sl_SDAP_Config_r16
->
sl_SDAP_Header_r16
==
NR_SL_SDAP_Config_r16__sl_SDAP_Header_r16_present
;
int
is_sdap_DefaultRB
=
s
->
sl_SDAP_Config_r16
&&
s
->
sl_SDAP_Config_r16
->
sl_DefaultRB_r16
==
true
?
1
:
0
;
/* TODO(?): accept different UL and DL SN sizes? */
nr_pdcp_manager_lock
(
nr_pdcp_ue_manager
);
ue
=
nr_pdcp_manager_get_ue
(
nr_pdcp_ue_manager
,
srcid
);
if
(
ue
->
drb
[
slrb_id
-
1
]
!=
NULL
)
{
LOG_W
(
PDCP
,
"%s:%d:%s: warning DRB %d already exist for UE ID/RNTI %ld, do nothing
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
slrb_id
,
srcid
);
}
else
{
pdcp_drb
=
new_nr_pdcp_entity
(
NR_PDCP_DRB_AM
,
0
,
slrb_id
,
0
,
has_sdap
,
has_sdap
,
deliver_sdu_drb
,
ue
,
deliver_pdu_drb
,
ue
,
sn_size
,
t_reordering
,
discard_timer
,
has_ciphering
?
ciphering_algorithm
:
0
,
has_integrity
?
integrity_algorithm
:
0
,
has_ciphering
?
ciphering_key
:
NULL
,
has_integrity
?
integrity_key
:
NULL
);
nr_pdcp_ue_add_drb_pdcp_entity
(
ue
,
slrb_id
,
pdcp_drb
);
LOG_I
(
PDCP
,
"%s:%d:%s: added slrb %d to UE ID %ld
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
slrb_id
,
srcid
);
new_nr_sdap_entity
(
0
,
has_sdap
,
has_sdap
,
srcid
,
0
,
is_sdap_DefaultRB
,
slrb_id
,
0
,
0
);
}
nr_pdcp_manager_unlock
(
nr_pdcp_ue_manager
);
}
static
void
add_drb
(
int
is_gnb
,
ue_id_t
rntiMaybeUEid
,
ue_id_t
reestablish_ue_id
,
...
...
@@ -1078,7 +1126,7 @@ bool nr_pdcp_data_req_drb(protocol_ctxt_t *ctxt_pP,
{
DevAssert
(
srb_flagP
==
SRB_FLAG_NO
);
LOG_
D
(
PDCP
,
"%s() called, size %d
\n
"
,
__func__
,
sdu_buffer_size
);
LOG_
I
(
PDCP
,
"%s() called, size %d
\n
"
,
__func__
,
sdu_buffer_size
);
nr_pdcp_ue_t
*
ue
;
nr_pdcp_entity_t
*
rb
;
ue_id_t
ue_id
=
ctxt_pP
->
rntiMaybeUEid
;
...
...
openair2/LAYER2/nr_rlc/asn1_utils.c
View file @
dad42400
...
...
@@ -150,6 +150,7 @@ int decode_max_retx_threshold(int v)
return
tab
[
v
];
}
int
decode_sn_field_length_um
(
int
v
)
{
static
const
int
tab
[
2
]
=
{
6
,
12
};
...
...
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
View file @
dad42400
...
...
@@ -287,7 +287,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
nr_rlc_ue_t
*
ue
;
nr_rlc_entity_t
*
rb
;
LOG_
D
(
RLC
,
"%s rnti %d srb_flag %d rb_id %ld mui %d confirm %d sdu_size %d MBMS_flag %d
\n
"
,
LOG_
I
(
RLC
,
"%s rnti %d srb_flag %d rb_id %ld mui %d confirm %d sdu_size %d MBMS_flag %d
\n
"
,
__FUNCTION__
,
rnti
,
srb_flagP
,
rb_idP
,
muiP
,
confirmP
,
sdu_sizeP
,
MBMS_flagP
);
...
...
@@ -776,6 +776,67 @@ static void add_drb_am(int rnti, int drb_id, const NR_RLC_BearerConfig_t *rlc_Be
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
static
void
add_drb_am_sl
(
int
src_id
,
int
drb_id
,
const
NR_SL_RLC_BearerConfig_r16_t
*
rlc_BearerConfig
)
{
nr_rlc_entity_t
*
nr_rlc_am
;
nr_rlc_ue_t
*
ue
;
struct
NR_SL_RLC_Config_r16
*
r
=
rlc_BearerConfig
->
sl_RLC_Config_r16
;
struct
NR_SL_LogicalChannelConfig_r16
*
l
=
rlc_BearerConfig
->
sl_MAC_LogicalChannelConfig_r16
;
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
;
if
(
!
(
drb_id
>=
1
&&
drb_id
<=
MAX_DRBS_PER_UE
))
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal, bad srb id %d
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
drb_id
);
exit
(
1
);
}
logical_channel_group
=
*
l
->
sl_LogicalChannelGroup_r16
;
/* TODO: accept other values? */
if
(
logical_channel_group
!=
1
)
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal error
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
//exit(1);
}
struct
NR_SL_RLC_Config_r16__sl_AM_RLC_r16
*
am
;
am
=
r
->
choice
.
sl_AM_RLC_r16
;
t_reassembly
=
35
;
t_status_prohibit
=
35
;
t_poll_retransmit
=
decode_t_poll_retransmit
(
am
->
sl_T_PollRetransmit_r16
);
poll_pdu
=
decode_poll_pdu
(
am
->
sl_PollPDU_r16
);
poll_byte
=
decode_poll_byte
(
am
->
sl_PollByte_r16
);
max_retx_threshold
=
decode_max_retx_threshold
(
am
->
sl_MaxRetxThreshold_r16
);
sn_field_length
=
decode_sn_field_length_am
(
*
am
->
sl_SN_FieldLengthAM_r16
);
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
src_id
);
if
(
ue
->
drb
[
drb_id
-
1
]
!=
NULL
)
{
LOG_W
(
RLC
,
"%s:%d:%s: DRB %d already exists for SL UE with src_id %04x, do nothing
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
drb_id
,
src_id
);
}
else
{
nr_rlc_am
=
new_nr_rlc_entity_am
(
RLC_RX_MAXSIZE
,
RLC_TX_MAXSIZE
,
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
,
drb_id
,
nr_rlc_am
);
LOG_I
(
RLC
,
"%s:%d:%s: added drb %d to UE with SRCID 0x%x
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
drb_id
,
src_id
);
}
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
static
void
add_drb_um
(
int
rnti
,
int
drb_id
,
const
NR_RLC_BearerConfig_t
*
rlc_BearerConfig
)
{
nr_rlc_entity_t
*
nr_rlc_um
;
...
...
@@ -843,6 +904,54 @@ static void add_drb_um(int rnti, int drb_id, const NR_RLC_BearerConfig_t *rlc_Be
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
static
void
add_drb_um_sl
(
int
src_id
,
int
drb_id
,
const
NR_SL_RLC_BearerConfig_r16_t
*
rlc_BearerConfig
)
{
nr_rlc_entity_t
*
nr_rlc_um
;
nr_rlc_ue_t
*
ue
;
struct
NR_SL_RLC_Config_r16
*
r
=
rlc_BearerConfig
->
sl_RLC_Config_r16
;
struct
NR_SL_LogicalChannelConfig_r16
*
l
=
rlc_BearerConfig
->
sl_MAC_LogicalChannelConfig_r16
;
int
logical_channel_group
;
int
sn_field_length
;
int
t_reassembly
;
if
(
!
(
drb_id
>=
1
&&
drb_id
<=
MAX_DRBS_PER_UE
))
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal, bad srb id %d
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
drb_id
);
exit
(
1
);
}
logical_channel_group
=
*
l
->
sl_LogicalChannelGroup_r16
;
/* TODO: accept other values? */
if
(
logical_channel_group
!=
4
)
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal error
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
struct
NR_SL_RLC_Config_r16__sl_UM_RLC_r16
*
um
;
um
=
r
->
choice
.
sl_UM_RLC_r16
;
t_reassembly
=
35
;
// up to UE implementation, choose 35ms
sn_field_length
=
decode_sn_field_length_um
(
*
um
->
sl_SN_FieldLengthUM_r16
);
nr_rlc_manager_lock
(
nr_rlc_ue_manager
);
ue
=
nr_rlc_manager_get_ue
(
nr_rlc_ue_manager
,
src_id
);
if
(
ue
->
drb
[
drb_id
-
1
]
!=
NULL
)
{
LOG_W
(
RLC
,
"DEBUG add_drb_um %s:%d:%s: warning DRB %d already exist for SL ue %d, do nothing
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
drb_id
,
src_id
);
}
else
{
nr_rlc_um
=
new_nr_rlc_entity_um
(
RLC_RX_MAXSIZE
,
RLC_TX_MAXSIZE
,
deliver_sdu
,
ue
,
t_reassembly
,
sn_field_length
);
nr_rlc_ue_add_drb_rlc_entity
(
ue
,
drb_id
,
nr_rlc_um
);
LOG_D
(
RLC
,
"%s:%d:%s: added drb %d to UE with SRCID 0x%x
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
drb_id
,
src_id
);
}
nr_rlc_manager_unlock
(
nr_rlc_ue_manager
);
}
void
nr_rlc_add_drb
(
int
rnti
,
int
drb_id
,
const
NR_RLC_BearerConfig_t
*
rlc_BearerConfig
)
{
switch
(
rlc_BearerConfig
->
rlc_Config
->
present
)
{
...
...
@@ -860,6 +969,22 @@ void nr_rlc_add_drb(int rnti, int drb_id, const NR_RLC_BearerConfig_t *rlc_Beare
LOG_I
(
RLC
,
"%s:%s:%d: added DRB to UE with RNTI 0x%x
\n
"
,
__FILE__
,
__FUNCTION__
,
__LINE__
,
rnti
);
}
void
nr_rlc_add_drb_sl
(
int
srcid
,
int
drb_id
,
const
NR_SL_RLC_BearerConfig_r16_t
*
rlc_BearerConfig
)
{
switch
(
rlc_BearerConfig
->
sl_RLC_Config_r16
->
present
)
{
case
NR_SL_RLC_Config_r16_PR_sl_AM_RLC_r16
:
add_drb_am_sl
(
srcid
,
drb_id
,
rlc_BearerConfig
);
break
;
case
NR_SL_RLC_Config_r16_PR_sl_UM_RLC_r16
:
add_drb_um_sl
(
srcid
,
drb_id
,
rlc_BearerConfig
);
break
;
default:
LOG_E
(
RLC
,
"%s:%d:%s: fatal: unhandled DRB type
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
);
exit
(
1
);
}
LOG_I
(
RLC
,
"%s:%s:%d: added SL_DRB to UE with SRCID 0x%x
\n
"
,
__FILE__
,
__FUNCTION__
,
__LINE__
,
srcid
);
}
/* Dummy function due to dependency from LTE libraries */
rlc_op_status_t
rrc_rlc_config_asn1_req
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
LTE_SRB_ToAddModList_t
*
const
srb2add_listP
,
...
...
openair2/RRC/NR_UE/rrc_sl_preconfig.c
View file @
dad42400
...
...
@@ -373,11 +373,47 @@ NR_SL_PreconfigurationNR_r16_t *prepare_NR_SL_PRECONFIGURATION(uint16_t num_tx_p
sl_preconfig
->
sl_PreconfigEUTRA_AnchorCarrierFreqList_r16
=
NULL
;
// NR sidelink radio bearer(s) configuration(s)
sl_preconfig
->
sl_RadioBearerPreConfigList_r16
=
NULL
;
// fill later
sl_preconfig
->
sl_RadioBearerPreConfigList_r16
=
calloc
(
1
,
sizeof
(
*
sl_preconfig
->
sl_RadioBearerPreConfigList_r16
));
// fill later
struct
NR_SL_RadioBearerConfig_r16
*
sl_RadioBearerConfig_r16
=
calloc
(
1
,
sizeof
(
*
sl_RadioBearerConfig_r16
));
sl_RadioBearerConfig_r16
->
slrb_Uu_ConfigIndex_r16
=
1
;
sl_RadioBearerConfig_r16
->
sl_SDAP_Config_r16
=
NULL
;
sl_RadioBearerConfig_r16
->
sl_TransRange_r16
=
NULL
;
sl_RadioBearerConfig_r16
->
sl_PDCP_Config_r16
=
calloc
(
1
,
sizeof
(
*
sl_RadioBearerConfig_r16
));
sl_RadioBearerConfig_r16
->
sl_PDCP_Config_r16
->
sl_DiscardTimer_r16
=
calloc
(
1
,
sizeof
(
*
sl_RadioBearerConfig_r16
->
sl_PDCP_Config_r16
->
sl_DiscardTimer_r16
));
*
sl_RadioBearerConfig_r16
->
sl_PDCP_Config_r16
->
sl_DiscardTimer_r16
=
NR_SL_PDCP_Config_r16__sl_DiscardTimer_r16_infinity
;
sl_RadioBearerConfig_r16
->
sl_PDCP_Config_r16
->
sl_PDCP_SN_Size_r16
=
calloc
(
1
,
sizeof
(
*
sl_RadioBearerConfig_r16
->
sl_PDCP_Config_r16
->
sl_PDCP_SN_Size_r16
));
*
sl_RadioBearerConfig_r16
->
sl_PDCP_Config_r16
->
sl_PDCP_SN_Size_r16
=
NR_SL_PDCP_Config_r16__sl_PDCP_SN_Size_r16_len12bits
;
sl_RadioBearerConfig_r16
->
sl_PDCP_Config_r16
->
sl_OutOfOrderDelivery
=
NULL
;
ASN_SEQUENCE_ADD
(
&
sl_preconfig
->
sl_RadioBearerPreConfigList_r16
->
list
,
sl_RadioBearerConfig_r16
);
// NR sidelink RLC bearer(s) configuration(s)
sl_preconfig
->
sl_RLC_BearerPreConfigList_r16
=
NULL
;
// fill later
sl_preconfig
->
sl_RLC_BearerPreConfigList_r16
=
calloc
(
1
,
sizeof
(
*
sl_preconfig
->
sl_RLC_BearerPreConfigList_r16
));
struct
NR_SL_RLC_BearerConfig_r16
*
sl_RLC_BearerConfig_r16
=
calloc
(
1
,
sizeof
(
*
sl_RLC_BearerConfig_r16
));
// initialize with UM for now
sl_RLC_BearerConfig_r16
->
sl_RLC_BearerConfigIndex_r16
=
0
;
sl_RLC_BearerConfig_r16
->
sl_ServedRadioBearer_r16
=
NULL
;
sl_RLC_BearerConfig_r16
->
sl_RLC_Config_r16
=
calloc
(
1
,
sizeof
(
*
sl_RLC_BearerConfig_r16
->
sl_RLC_Config_r16
));
sl_RLC_BearerConfig_r16
->
sl_RLC_Config_r16
->
present
=
NR_SL_RLC_Config_r16_PR_sl_UM_RLC_r16
;
sl_RLC_BearerConfig_r16
->
sl_RLC_Config_r16
->
choice
.
sl_UM_RLC_r16
=
calloc
(
1
,
sizeof
(
*
sl_RLC_BearerConfig_r16
->
sl_RLC_Config_r16
->
choice
.
sl_UM_RLC_r16
));
sl_RLC_BearerConfig_r16
->
sl_RLC_Config_r16
->
choice
.
sl_UM_RLC_r16
->
sl_SN_FieldLengthUM_r16
=
calloc
(
1
,
sizeof
(
*
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
));
*
sl_RLC_BearerConfig_r16
->
sl_RLC_Config_r16
->
choice
.
sl_UM_RLC_r16
->
sl_SN_FieldLengthUM_r16
=
NR_SN_FieldLengthUM_size6
;
// Logical Channel Config for default link
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
=
calloc
(
1
,
sizeof
(
*
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
));
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_Priority_r16
=
1
;
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_PrioritisedBitRate_r16
=
NR_SL_LogicalChannelConfig_r16__sl_PrioritisedBitRate_r16_infinity
;
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_BucketSizeDuration_r16
=
NR_SL_LogicalChannelConfig_r16__sl_BucketSizeDuration_r16_ms5
;
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_ConfiguredGrantType1Allowed_r16
=
NULL
;
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_HARQ_FeedbackEnabled_r16
=
calloc
(
1
,
sizeof
(
*
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_HARQ_FeedbackEnabled_r16
));
*
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_HARQ_FeedbackEnabled_r16
=
NR_SL_LogicalChannelConfig_r16__sl_HARQ_FeedbackEnabled_r16_enabled
;
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_AllowedCG_List_r16
=
NULL
;
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_AllowedSCS_List_r16
=
NULL
;
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_LogicalChannelGroup_r16
=
calloc
(
1
,
sizeof
(
*
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_LogicalChannelGroup_r16
));
*
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_LogicalChannelGroup_r16
=
4
;
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_SchedulingRequestId_r16
=
NULL
;
sl_RLC_BearerConfig_r16
->
sl_MAC_LogicalChannelConfig_r16
->
sl_LogicalChannelSR_DelayTimerApplied_r16
=
NULL
;
ASN_SEQUENCE_ADD
(
&
sl_preconfig
->
sl_RLC_BearerPreConfigList_r16
->
list
,
sl_RLC_BearerConfig_r16
);
//Measurement and reporting configuration
sl_preconfig
->
sl_MeasPreConfig_r16
=
NULL
;
...
...
@@ -482,8 +518,32 @@ void nr_UE_configure_Sidelink(uint8_t id, uint8_t is_sync_source) {
:
SL_SYNC_SOURCE_LOCAL_TIMING
;
}
nr_rrc_mac_config_req_sl_preconfig
(
id
,
sl_preconfig
,
sync_source
);
struct
{
int
srcid
;
int
thirdOctet
;
int
fourthOctet
;
}
ueinfo
;
char
aprefix
[
MAX_OPTNAME_SIZE
*
2
+
8
];
paramdef_t
SL_UEINFO
[]
=
SL_UEINFO_DESC
(
ueinfo
);
paramlist_def_t
SL_UEINFOList
=
{
SL_CONFIG_STRING_UEINFO
,
NULL
,
0
};
sprintf
(
aprefix
,
"%s.[%d]"
,
SL_CONFIG_STRING_SL_PRECONFIGURATION
,
0
);
config_getlist
(
&
SL_UEINFOList
,
NULL
,
0
,
aprefix
);
sprintf
(
aprefix
,
"%s.[%i].%s.[%i]"
,
SL_CONFIG_STRING_SL_PRECONFIGURATION
,
0
,
SL_CONFIG_STRING_UEINFO
,
0
);
config_get
(
SL_UEINFO
,
sizeof
(
SL_UEINFO
)
/
sizeof
(
paramdef_t
),
aprefix
);
LOG_I
(
NR_RRC
,
"SL L2 SRCid %x, SL ipv4 addr X.X.%d.%d
\n
"
,
ueinfo
.
srcid
,
ueinfo
.
thirdOctet
,
ueinfo
.
fourthOctet
);
nas_config
(
1
,
ueinfo
.
thirdOctet
,
ueinfo
.
fourthOctet
,
"oai_sl_tun"
);
nr_rrc_mac_config_req_sl_preconfig
(
id
,
sl_preconfig
,
sync_source
,
ueinfo
.
srcid
);
// SL RadioBearers
for
(
int
i
=
0
;
i
<
sl_preconfig
->
sidelinkPreconfigNR_r16
.
sl_RadioBearerPreConfigList_r16
->
list
.
count
;
i
++
)
{
add_drb_sl
(
ueinfo
.
srcid
,(
NR_SL_RadioBearerConfig_r16_t
*
)
sl_preconfig
->
sidelinkPreconfigNR_r16
.
sl_RadioBearerPreConfigList_r16
->
list
.
array
[
i
],
0
,
0
,
NULL
,
NULL
);
}
// configure RLC
for
(
int
i
=
0
;
i
<
sl_preconfig
->
sidelinkPreconfigNR_r16
.
sl_RLC_BearerPreConfigList_r16
->
list
.
count
;
i
++
)
{
nr_rlc_add_drb_sl
(
ueinfo
.
srcid
,
1
,(
NR_SL_RLC_BearerConfig_r16_t
*
)
sl_preconfig
->
sidelinkPreconfigNR_r16
.
sl_RLC_BearerPreConfigList_r16
->
list
.
array
[
i
]);
}
//TBD.. These should be chosen by RRC according to 3GPP 38.331 RRC specification.
//Currently hardcoding the values to these
uint16_t
slss_id
=
671
,
ssb_ta_index
=
1
;
...
...
openair2/RRC/NR_UE/sl_preconfig_paramvalues.h
View file @
dad42400
...
...
@@ -76,7 +76,10 @@
#define SL_CONFIG_STRING_RESPOOL_NUM_SUBCHS "sl_NumSubchannel"
#define SL_CONFIG_STRING_UEINFO "sl_UEINFO"
#define SL_CONFIG_STRING_UEINFO_SRCID "srcid"
#define SL_CONFIG_STRING_UEINFO_IPV4ADDR_THIRD_OCTET "thirdOctet"
#define SL_CONFIG_STRING_UEINFO_IPV4ADDR_FOURTH_OCTET "fourthOctet"
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Sidelink Frequency common Cell Config parameters */
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
...
...
@@ -154,5 +157,15 @@
{SL_CONFIG_STRING_RESPOOL_NUM_RBS,NULL,0,.i64ptr=sl_res_pool->sl_RB_Number_r16,.defint64val=106,TYPE_INT64,0},\
{SL_CONFIG_STRING_RESPOOL_NUM_SUBCHS,NULL,0,.i64ptr=sl_res_pool->sl_NumSubchannel_r16,.defint64val=10,TYPE_INT64,0}}
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* Sidelink Top-Level UE Info */
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*
sl_srcid - 16-bit source ID used for LCID information and indexing in L2 stack
sl_ipv4addr - string containing ipv4 address for default SLRB
*/
#define SL_UEINFO_DESC(sl_ueinfo) { \
{SL_CONFIG_STRING_UEINFO_SRCID,NULL,0,.iptr=&ueinfo.srcid,.defintval=1,TYPE_INT,0}, \
{SL_CONFIG_STRING_UEINFO_IPV4ADDR_THIRD_OCTET,NULL,0,.iptr=&ueinfo.thirdOctet,.defintval=0,TYPE_INT,0}, \
{SL_CONFIG_STRING_UEINFO_IPV4ADDR_FOURTH_OCTET,NULL,0,.iptr=&ueinfo.fourthOctet,.defintval=1,TYPE_INT,0}}
#endif
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