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
f65ce8c4
Commit
f65ce8c4
authored
Jul 10, 2023
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle BCH indication
parent
1cbd6c71
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
52 additions
and
68 deletions
+52
-68
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+1
-0
openair2/COMMON/mac_messages_types.h
openair2/COMMON/mac_messages_types.h
+1
-0
openair2/LAYER2/NR_MAC_UE/config_ue.c
openair2/LAYER2/NR_MAC_UE/config_ue.c
+3
-0
openair2/LAYER2/NR_MAC_UE/mac_defs.h
openair2/LAYER2/NR_MAC_UE/mac_defs.h
+2
-0
openair2/LAYER2/NR_MAC_UE/mac_proto.h
openair2/LAYER2/NR_MAC_UE/mac_proto.h
+1
-11
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
+18
-34
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
+12
-13
openair2/RRC/NR_UE/L2_interface_ue.c
openair2/RRC/NR_UE/L2_interface_ue.c
+1
-3
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+13
-7
No files found.
executables/nr-uesoftmodem.c
View file @
f65ce8c4
...
...
@@ -515,6 +515,7 @@ int main( int argc, char **argv ) {
if
(
get_softmodem_params
()
->
sa
)
{
// set frame config to initial values from command line and assume that the SSB is centered on the grid
uint16_t
nr_band
=
get_softmodem_params
()
->
band
;
mac
->
nr_band
=
nr_band
;
mac
->
ssb_start_subcarrier
=
UE
[
CC_id
]
->
frame_parms
.
ssb_start_subcarrier
;
nr_init_frame_parms_ue_sa
(
&
UE
[
CC_id
]
->
frame_parms
,
downlink_frequency
[
CC_id
][
0
],
uplink_frequency_offset
[
CC_id
][
0
],
...
...
openair2/COMMON/mac_messages_types.h
View file @
f65ce8c4
...
...
@@ -109,6 +109,7 @@ typedef struct NRRrcMacBcchDataInd_s {
uint32_t
sdu_size
;
uint8_t
sdu
[
BCCH_SDU_SIZE
];
uint8_t
gnb_index
;
bool
is_bch
;
uint8_t
rsrq
;
uint8_t
rsrp
;
}
NRRrcMacBcchDataInd
;
...
...
openair2/LAYER2/NR_MAC_UE/config_ue.c
View file @
f65ce8c4
...
...
@@ -713,6 +713,9 @@ void nr_rrc_mac_config_req_mib(module_id_t module_id,
mac
->
get_sib1
=
true
;
else
if
(
sched_sib
==
2
)
mac
->
get_otherSI
=
true
;
nr_ue_decode_mib
(
module_id
,
cc_idP
,
NULL
);
}
void
nr_rrc_mac_config_req_sib1
(
module_id_t
module_id
,
...
...
openair2/LAYER2/NR_MAC_UE/mac_defs.h
View file @
f65ce8c4
...
...
@@ -477,6 +477,7 @@ typedef struct {
RA_config_t
ra
;
/// SSB index from MIB decoding
uint8_t
mib_ssb
;
uint32_t
mib_additional_bits
;
nr_csi_report_t
csi_report_template
[
MAX_CSI_REPORTCONFIG
];
...
...
@@ -510,6 +511,7 @@ typedef struct {
frequency_range_t
frequency_range
;
uint16_t
nr_band
;
uint8_t
ssb_subcarrier_offset
;
int
ssb_start_subcarrier
;
NR_SSB_meas_t
ssb_measurements
;
...
...
openair2/LAYER2/NR_MAC_UE/mac_proto.h
View file @
f65ce8c4
...
...
@@ -57,17 +57,7 @@ void nr_ue_mac_default_configs(NR_UE_MAC_INST_t *mac);
\param pduP pointer to pdu
\param pdu_length length of pdu
\param cell_id cell id */
int8_t
nr_ue_decode_mib
(
module_id_t
module_id
,
int
cc_id
,
uint8_t
gNB_index
,
void
*
phy_data
,
uint8_t
extra_bits
,
uint32_t
ssb_length
,
uint32_t
ssb_index
,
void
*
pduP
,
uint16_t
ssb_start_subcarrier
,
uint16_t
cell_id
);
int8_t
nr_ue_decode_mib
(
module_id_t
module_id
,
int
cc_id
,
void
*
phy_data
);
/**\brief decode SIB1 and other SIs pdus in NR_UE, from if_module dl_ind
\param module_id module id
...
...
openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c
View file @
f65ce8c4
...
...
@@ -247,48 +247,34 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti)
int8_t
nr_ue_decode_mib
(
module_id_t
module_id
,
int
cc_id
,
uint8_t
gNB_index
,
void
*
phy_data
,
uint8_t
extra_bits
,
// 8bits 38.212 c7.1.1
uint32_t
ssb_length
,
uint32_t
ssb_index
,
void
*
pduP
,
uint16_t
ssb_start_subcarrier
,
uint16_t
cell_id
)
void
*
phy_data
)
{
LOG_D
(
MAC
,
"[L2][MAC] decode mib
\n
"
);
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_id
);
mac
->
physCellId
=
cell_id
;
nr_mac_rrc_data_ind_ue
(
module_id
,
cc_id
,
gNB_index
,
0
,
0
,
0
,
NR_BCCH_BCH
,
(
uint8_t
*
)
pduP
,
3
);
// fixed 3 bytes MIB PDU
AssertFatal
(
mac
->
mib
!=
NULL
,
"nr_ue_decode_mib() mac->mib == NULL
\n
"
);
uint16_t
frame
=
(
mac
->
mib
->
systemFrameNumber
.
buf
[
0
]
>>
mac
->
mib
->
systemFrameNumber
.
bits_unused
);
uint16_t
frame_number_4lsb
=
0
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
frame_number_4lsb
|=
((
extra_bits
>>
i
)
&
1
)
<<
(
3
-
i
);
int
extra_bits
=
mac
->
mib_additional_bits
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
frame_number_4lsb
|=
((
extra_bits
>>
i
)
&
1
)
<<
(
3
-
i
);
uint8_t
ssb_subcarrier_offset_msb
=
(
extra_bits
>>
5
)
&
0x1
;
// extra bits[5]
uint8_t
ssb_subcarrier_offset_msb
=
(
extra_bits
>>
5
)
&
0x1
;
// extra bits[5]
uint8_t
ssb_subcarrier_offset
=
(
uint8_t
)
mac
->
mib
->
ssb_SubcarrierOffset
;
frame
=
frame
<<
4
;
frame
=
frame
|
frame_number_4lsb
;
if
(
ssb_length
==
64
){
mac
->
frequency_range
=
FR2
;
for
(
int
i
=
0
;
i
<
3
;
i
++
)
ssb_index
+=
(((
extra_bits
>>
(
7
-
i
))
&
0x01
)
<<
(
3
+
i
));
}
else
{
mac
->
frequency_range
=
FR1
;
if
(
ssb_subcarrier_offset_msb
){
if
(
mac
->
frequency_range
==
FR2
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
mac
->
mib_ssb
+=
(((
extra_bits
>>
(
7
-
i
))
&
0x01
)
<<
(
3
+
i
));
}
else
{
if
(
ssb_subcarrier_offset_msb
)
ssb_subcarrier_offset
=
ssb_subcarrier_offset
|
0x10
;
}
}
#ifdef DEBUG_MIB
uint8_t
half_frame_bit
=
(
extra_bits
>>
4
)
&
0x1
;
// extra bits[4]
uint8_t
half_frame_bit
=
(
extra_bits
>>
4
)
&
0x1
;
// extra bits[4]
LOG_I
(
MAC
,
"system frame number(6 MSB bits): %d
\n
"
,
mac
->
mib
->
systemFrameNumber
.
buf
[
0
]);
LOG_I
(
MAC
,
"system frame number(with LSB): %d
\n
"
,
(
int
)
frame
);
LOG_I
(
MAC
,
"subcarrier spacing (0=15or60, 1=30or120): %d
\n
"
,
(
int
)
mac
->
mib
->
subCarrierSpacingCommon
);
...
...
@@ -299,11 +285,9 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
LOG_I
(
MAC
,
"cell barred (0=barred,1=notBarred): %d
\n
"
,
(
int
)
mac
->
mib
->
cellBarred
);
LOG_I
(
MAC
,
"intra frequency reselection (0=allowed,1=notAllowed): %d
\n
"
,
(
int
)
mac
->
mib
->
intraFreqReselection
);
LOG_I
(
MAC
,
"half frame bit(extra bits): %d
\n
"
,
(
int
)
half_frame_bit
);
LOG_I
(
MAC
,
"ssb index(extra bits): %d
\n
"
,
(
int
)
ssb_index
);
LOG_I
(
MAC
,
"ssb index(extra bits): %d
\n
"
,
(
int
)
mac
->
mib_ssb
);
#endif
//storing ssb index in the mac structure
mac
->
mib_ssb
=
ssb_index
;
mac
->
ssb_subcarrier_offset
=
ssb_subcarrier_offset
;
uint8_t
scs_ssb
;
...
...
@@ -314,10 +298,10 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
scs_ssb
=
get_softmodem_params
()
->
numerology
;
band
=
mac
->
nr_band
;
ssb_start_symbol
=
get_ssb_start_symbol
(
band
,
scs_ssb
,
ssb_index
);
ssb_start_symbol
=
get_ssb_start_symbol
(
band
,
scs_ssb
,
mac
->
mib_ssb
);
int
ssb_sc_offset_norm
;
if
(
ssb_subcarrier_offset
<
24
&&
mac
->
frequency_range
==
FR1
)
ssb_sc_offset_norm
=
ssb_subcarrier_offset
>>
scs_ssb
;
if
(
ssb_subcarrier_offset
<
24
&&
mac
->
frequency_range
==
FR1
)
ssb_sc_offset_norm
=
ssb_subcarrier_offset
>>
scs_ssb
;
else
ssb_sc_offset_norm
=
ssb_subcarrier_offset
;
...
...
@@ -327,8 +311,8 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
ssb_start_symbol
,
frame
,
ssb_sc_offset_norm
,
ssb_index
,
ssb_start_subcarrier
,
mac
->
mib_ssb
,
mac
->
ssb_start_subcarrier
,
mac
->
frequency_range
,
phy_data
);
mac
->
first_sync_frame
=
frame
;
...
...
@@ -338,7 +322,7 @@ int8_t nr_ue_decode_mib(module_id_t module_id,
NR_ServingCellConfigCommon_t
*
scc
=
mac
->
scc
;
scs_ssb
=
*
scc
->
ssbSubcarrierSpacing
;
band
=
*
scc
->
downlinkConfigCommon
->
frequencyInfoDL
->
frequencyBandList
.
list
.
array
[
0
];
ssb_start_symbol
=
get_ssb_start_symbol
(
band
,
scs_ssb
,
ssb_index
);
ssb_start_symbol
=
get_ssb_start_symbol
(
band
,
scs_ssb
,
mac
->
mib_ssb
);
if
(
mac
->
first_sync_frame
==
-
1
)
mac
->
first_sync_frame
=
frame
;
}
...
...
openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c
View file @
f65ce8c4
...
...
@@ -1037,19 +1037,18 @@ int handle_bcch_bch(module_id_t module_id, int cc_id,
unsigned
int
gNB_index
,
void
*
phy_data
,
uint8_t
*
pduP
,
unsigned
int
additional_bits
,
uint32_t
ssb_index
,
uint32_t
ssb_length
,
uint16_t
ssb_start_subcarrier
,
uint16_t
cell_id
){
return
nr_ue_decode_mib
(
module_id
,
cc_id
,
gNB_index
,
phy_data
,
additional_bits
,
ssb_length
,
// Lssb = 64 is not support
ssb_index
,
pduP
,
ssb_start_subcarrier
,
cell_id
);
uint16_t
ssb_start_subcarrier
,
uint16_t
cell_id
)
{
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_id
);
mac
->
mib_ssb
=
ssb_index
;
mac
->
physCellId
=
cell_id
;
mac
->
mib_additional_bits
=
additional_bits
;
if
(
ssb_length
==
64
)
mac
->
frequency_range
=
FR2
;
else
mac
->
frequency_range
=
FR1
;
nr_mac_rrc_data_ind_ue
(
module_id
,
cc_id
,
gNB_index
,
0
,
0
,
0
,
NR_BCCH_BCH
,
(
uint8_t
*
)
pduP
,
3
);
// fixed 3 bytes MIB PDU
return
0
;
}
// L2 Abstraction Layer
...
...
openair2/RRC/NR_UE/L2_interface_ue.c
View file @
f65ce8c4
...
...
@@ -63,9 +63,6 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
switch
(
channel
){
case
NR_BCCH_BCH
:
AssertFatal
(
nr_rrc_ue_decode_NR_BCCH_BCH_Message
(
module_id
,
gNB_index
,
(
uint8_t
*
)
pduP
,
pdu_len
)
==
0
,
"UE decode BCCH-BCH error!
\n
"
);
break
;
case
NR_BCCH_DL_SCH
:
if
(
pdu_len
>
0
)
{
LOG_T
(
NR_RRC
,
"[UE %d] Received SDU for NR-BCCH-DL-SCH on SRB %u from gNB %d
\n
"
,
module_id
,
channel
&
RAB_OFFSET
,
...
...
@@ -88,6 +85,7 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
NR_RRC_MAC_BCCH_DATA_IND
(
message_p
).
slot
=
slot
;
NR_RRC_MAC_BCCH_DATA_IND
(
message_p
).
sdu_size
=
sdu_size
;
NR_RRC_MAC_BCCH_DATA_IND
(
message_p
).
gnb_index
=
gNB_index
;
NR_RRC_MAC_BCCH_DATA_IND
(
message_p
).
is_bch
=
(
channel
==
NR_BCCH_BCH
);
itti_send_msg_to_task
(
TASK_RRC_NRUE
,
GNB_MODULE_ID_TO_INSTANCE
(
module_id
),
message_p
);
}
break
;
...
...
openair2/RRC/NR_UE/rrc_UE.c
View file @
f65ce8c4
...
...
@@ -1961,10 +1961,16 @@ void *rrc_nrue_task(void *args_p)
break
;
case
NR_RRC_MAC_BCCH_DATA_IND
:
LOG_
D
(
NR_RRC
,
"[UE %d] Received %s: frameP %d, gNB %d
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
),
LOG_
I
(
NR_RRC
,
"[UE %d] Received %s: frameP %d, gNB %d
\n
"
,
ue_mod_id
,
ITTI_MSG_NAME
(
msg_p
),
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
frame
,
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
gnb_index
);
PROTOCOL_CTXT_SET_BY_MODULE_ID
(
&
ctxt
,
ue_mod_id
,
GNB_FLAG_NO
,
NOT_A_RNTI
,
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
frame
,
0
,
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
gnb_index
);
nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message
(
ctxt
.
module_id
,
if
(
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
is_bch
)
nr_rrc_ue_decode_NR_BCCH_BCH_Message
(
ue_mod_id
,
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
gnb_index
,
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
sdu
,
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
sdu_size
);
else
nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message
(
ctxt
.
module_id
,
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
gnb_index
,
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
sdu
,
NR_RRC_MAC_BCCH_DATA_IND
(
msg_p
).
sdu_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