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
zzha zzha
OpenXG-RAN
Commits
18db5f68
Commit
18db5f68
authored
Aug 23, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put PLMN/TAC/CellID into SIB1, correct CellIdentity encoding
parent
c9305639
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
18 deletions
+24
-18
openair2/LAYER2/NR_MAC_gNB/config.c
openair2/LAYER2/NR_MAC_gNB/config.c
+12
-0
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
+2
-0
openair2/LAYER2/NR_MAC_gNB/main.c
openair2/LAYER2/NR_MAC_gNB/main.c
+0
-6
openair2/RRC/NR/nr_rrc_config.c
openair2/RRC/NR/nr_rrc_config.c
+9
-11
openair2/RRC/NR/nr_rrc_config.h
openair2/RRC/NR/nr_rrc_config.h
+1
-1
No files found.
openair2/LAYER2/NR_MAC_gNB/config.c
View file @
18db5f68
...
...
@@ -557,6 +557,18 @@ void nr_mac_config_scc(gNB_MAC_INST *nrmac, NR_ServingCellConfigCommon_t *scc, c
//NR_SCHED_UNLOCK(&nrmac->sched_lock);
}
void
nr_mac_configure_sib1
(
gNB_MAC_INST
*
nrmac
,
const
f1ap_plmn_t
*
plmn
,
uint64_t
cellID
,
int
tac
)
{
AssertFatal
(
get_softmodem_params
()
->
sa
>
0
,
"error: SIB1 only applicable for SA
\n
"
);
NR_COMMON_channels_t
*
cc
=
&
nrmac
->
common_channels
[
0
];
NR_ServingCellConfigCommon_t
*
scc
=
cc
->
ServingCellConfigCommon
;
NR_BCCH_DL_SCH_Message_t
*
sib1
=
get_SIB1_NR
(
scc
,
plmn
,
cellID
,
tac
);
cc
->
sib1
=
sib1
;
cc
->
sib1_bcch_length
=
encode_SIB1_NR
(
sib1
,
cc
->
sib1_bcch_pdu
,
sizeof
(
cc
->
sib1_bcch_pdu
));
AssertFatal
(
cc
->
sib1_bcch_length
>
0
,
"could not encode SIB1
\n
"
);
}
bool
nr_mac_add_test_ue
(
gNB_MAC_INST
*
nrmac
,
uint32_t
rnti
,
NR_CellGroupConfig_t
*
CellGroup
)
{
DevAssert
(
nrmac
!=
NULL
);
...
...
openair2/LAYER2/NR_MAC_gNB/mac_proto.h
View file @
18db5f68
...
...
@@ -50,6 +50,8 @@ int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP,
uint32_t
rrc_reconfiguration_delay
);
void
nr_mac_config_scc
(
gNB_MAC_INST
*
nrmac
,
NR_ServingCellConfigCommon_t
*
scc
,
const
nr_mac_config_t
*
mac_config
);
void
nr_mac_configure_sib1
(
gNB_MAC_INST
*
nrmac
,
const
f1ap_plmn_t
*
plmn
,
uint64_t
cellID
,
int
tac
);
bool
nr_mac_add_test_ue
(
gNB_MAC_INST
*
nrmac
,
uint32_t
rnti
,
NR_CellGroupConfig_t
*
CellGroup
);
bool
nr_mac_prepare_ra_ue
(
gNB_MAC_INST
*
nrmac
,
uint32_t
rnti
,
NR_CellGroupConfig_t
*
CellGroup
);
bool
nr_mac_update_cellgroup
(
gNB_MAC_INST
*
nrmac
,
uint32_t
rnti
,
NR_CellGroupConfig_t
*
CellGroup
);
...
...
openair2/LAYER2/NR_MAC_gNB/main.c
View file @
18db5f68
...
...
@@ -255,12 +255,6 @@ void mac_top_init_gNB(ngran_node_t node_type,
RC
.
nrmac
[
i
]
->
cset0_bwp_start
=
0
;
RC
.
nrmac
[
i
]
->
cset0_bwp_size
=
0
;
NR_BCCH_DL_SCH_Message_t
*
sib1
=
get_SIB1_NR
(
config
,
scc
);
NR_COMMON_channels_t
*
cc
=
&
RC
.
nrmac
[
i
]
->
common_channels
[
0
];
cc
->
sib1
=
sib1
;
cc
->
sib1_bcch_length
=
encode_SIB1_NR
(
sib1
,
cc
->
sib1_bcch_pdu
,
sizeof
(
cc
->
sib1_bcch_pdu
));
AssertFatal
(
cc
->
sib1_bcch_length
>
0
,
"could not encode SIB1
\n
"
);
pthread_mutex_init
(
&
RC
.
nrmac
[
i
]
->
sched_lock
,
NULL
);
pthread_mutex_init
(
&
RC
.
nrmac
[
i
]
->
UE_info
.
mutex
,
NULL
);
...
...
openair2/RRC/NR/nr_rrc_config.c
View file @
18db5f68
...
...
@@ -28,6 +28,7 @@
* \email: raymond.knopp@eurecom.fr, kroempa@gmail.com
*/
#include "openair3/UTILS/conversions.h"
#include "nr_rrc_config.h"
#include "common/utils/nr/nr_common.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
...
...
@@ -1713,8 +1714,10 @@ int encode_MIB_NR(NR_BCCH_BCH_Message_t *mib, int frame, uint8_t *buf, int buf_s
return
(
enc_rval
.
encoded
+
7
)
/
8
;
}
NR_BCCH_DL_SCH_Message_t
*
get_SIB1_NR
(
const
nr_mac_config_t
*
configuration
,
const
NR_ServingCellConfigCommon_t
*
sc
c
)
NR_BCCH_DL_SCH_Message_t
*
get_SIB1_NR
(
const
NR_ServingCellConfigCommon_t
*
scc
,
const
f1ap_plmn_t
*
plmn
,
uint64_t
cellID
,
int
ta
c
)
{
AssertFatal
(
cellID
<
(
1l
<<
36
),
"cellID must fit within 36 bits, but is %ld
\n
"
,
cellID
);
NR_BCCH_DL_SCH_Message_t
*
sib1_message
=
CALLOC
(
1
,
sizeof
(
NR_BCCH_DL_SCH_Message_t
));
AssertFatal
(
sib1_message
!=
NULL
,
"out of memory
\n
"
);
sib1_message
->
message
.
present
=
NR_BCCH_DL_SCH_MessageType_PR_c1
;
...
...
@@ -1741,15 +1744,15 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const nr_mac_config_t *configuration, cons
for
(
int
i
=
0
;
i
<
num_plmn
;
++
i
)
{
asn1cSequenceAdd
(
nr_plmn_info
->
plmn_IdentityList
.
list
,
struct
NR_PLMN_Identity
,
nr_plmn
);
asn1cCalloc
(
nr_plmn
->
mcc
,
mcc
);
int
confMcc
=
0
;
int
confMcc
=
plmn
->
mcc
;
asn1cSequenceAdd
(
mcc
->
list
,
NR_MCC_MNC_Digit_t
,
mcc0
);
*
mcc0
=
(
confMcc
/
100
)
%
10
;
asn1cSequenceAdd
(
mcc
->
list
,
NR_MCC_MNC_Digit_t
,
mcc1
);
*
mcc1
=
(
confMcc
/
10
)
%
10
;
asn1cSequenceAdd
(
mcc
->
list
,
NR_MCC_MNC_Digit_t
,
mcc2
);
*
mcc2
=
confMcc
%
10
;
int
mnc
=
0
;
if
(
0
==
3
)
{
int
mnc
=
plmn
->
mnc
;
if
(
plmn
->
mnc_digit_length
==
3
)
{
asn1cSequenceAdd
(
nr_plmn
->
mnc
.
list
,
NR_MCC_MNC_Digit_t
,
mnc0
);
*
mnc0
=
(
0
/
100
)
%
10
;
}
...
...
@@ -1759,17 +1762,12 @@ NR_BCCH_DL_SCH_Message_t *get_SIB1_NR(const nr_mac_config_t *configuration, cons
*
mnc2
=
(
mnc
)
%
10
;
}
nr_plmn_info
->
cellIdentity
.
buf
=
CALLOC
(
1
,
5
);
AssertFatal
(
nr_plmn_info
->
cellIdentity
.
buf
!=
NULL
,
"out of memory
\n
"
);
nr_plmn_info
->
cellIdentity
.
size
=
5
;
nr_plmn_info
->
cellIdentity
.
bits_unused
=
4
;
uint64_t
tmp
=
htobe64
(
0
)
<<
4
;
memcpy
(
nr_plmn_info
->
cellIdentity
.
buf
,
((
char
*
)
&
tmp
)
+
3
,
5
);
NR_CELL_ID_TO_BIT_STRING
(
cellID
,
&
nr_plmn_info
->
cellIdentity
);
nr_plmn_info
->
cellReservedForOperatorUse
=
NR_PLMN_IdentityInfo__cellReservedForOperatorUse_notReserved
;
nr_plmn_info
->
trackingAreaCode
=
CALLOC
(
1
,
sizeof
(
NR_TrackingAreaCode_t
));
AssertFatal
(
nr_plmn_info
->
trackingAreaCode
!=
NULL
,
"out of memory
\n
"
);
uint32_t
tmp2
=
htobe32
(
0
);
uint32_t
tmp2
=
htobe32
(
tac
);
nr_plmn_info
->
trackingAreaCode
->
buf
=
CALLOC
(
1
,
3
);
AssertFatal
(
nr_plmn_info
->
trackingAreaCode
->
buf
!=
NULL
,
"out of memory
\n
"
);
memcpy
(
nr_plmn_info
->
trackingAreaCode
->
buf
,
((
char
*
)
&
tmp2
)
+
1
,
3
);
...
...
openair2/RRC/NR/nr_rrc_config.h
View file @
18db5f68
...
...
@@ -57,7 +57,7 @@ int encode_MIB_NR(NR_BCCH_BCH_Message_t *mib, int frame, uint8_t *buf, int buf_s
#define NR_MAX_SIB_LENGTH 2976 // 3GPP TS 38.331 section 5.2.1
NR_BCCH_DL_SCH_Message_t
*
get_SIB1_NR
(
const
nr_mac_config_t
*
configuration
,
const
NR_ServingCellConfigCommon_t
*
sc
c
);
NR_BCCH_DL_SCH_Message_t
*
get_SIB1_NR
(
const
NR_ServingCellConfigCommon_t
*
scc
,
const
f1ap_plmn_t
*
plmn
,
uint64_t
cellID
,
int
ta
c
);
void
free_SIB1_NR
(
NR_BCCH_DL_SCH_Message_t
*
sib1
);
int
encode_SIB1_NR
(
NR_BCCH_DL_SCH_Message_t
*
sib1
,
uint8_t
*
buffer
,
int
max_buffer_size
);
...
...
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