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
spbro
OpenXG-RAN
Commits
270c540c
Commit
270c540c
authored
May 11, 2022
by
luis_pereira87
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor clean up in function mac_rrc_nr_data_req
parent
3c4ba502
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
49 deletions
+46
-49
openair2/RRC/NR/L2_nr_interface.c
openair2/RRC/NR/L2_nr_interface.c
+46
-49
No files found.
openair2/RRC/NR/L2_nr_interface.c
View file @
270c540c
...
...
@@ -219,78 +219,75 @@ uint16_t mac_rrc_nr_data_req(const module_id_t Mod_idP,
LOG_D
(
RRC
,
"[eNB %d] mac_rrc_data_req to SRB ID=%ld
\n
"
,
Mod_idP
,
Srb_id
);
#endif
// MIBCH
if
((
Srb_id
&
RAB_OFFSET
)
==
MIBCH
)
{
asn_enc_rval_t
enc_rval
;
uint8_t
sfn_msb
=
(
uint8_t
)((
frameP
>>
4
)
&
0x3f
);
rrc_gNB_carrier_data_t
*
carrier
=
&
RC
.
nrrrc
[
Mod_idP
]
->
carrier
;
NR_BCCH_BCH_Message_t
*
mib
=
&
carrier
->
mib
;
// Currently we are getting the pdcch_ConfigSIB1 from the configuration file.
// Uncomment this function for a dynamic pdcch_ConfigSIB1.
//channel_bandwidth_t min_channel_bw = bw_10MHz; // Must be obtained based on TS 38.101-1 Table 5.3.5-1
//generate_pdcch_ConfigSIB1(carrier->pdcch_ConfigSIB1,
// *carrier->servingcellconfigcommon->ssbSubcarrierSpacing,
// carrier->mib.message.choice.mib->subCarrierSpacingCommon,
// min_channel_bw);
mib
->
message
.
choice
.
mib
->
pdcch_ConfigSIB1
.
controlResourceSetZero
=
carrier
->
pdcch_ConfigSIB1
->
controlResourceSetZero
;
mib
->
message
.
choice
.
mib
->
pdcch_ConfigSIB1
.
searchSpaceZero
=
carrier
->
pdcch_ConfigSIB1
->
searchSpaceZero
;
mib
->
message
.
choice
.
mib
->
systemFrameNumber
.
buf
[
0
]
=
sfn_msb
<<
2
;
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_BCCH_BCH_Message
,
NULL
,
(
void
*
)
mib
,
carrier
->
MIB
,
24
);
LOG_D
(
NR_RRC
,
"Encoded MIB for frame %d sfn_msb %d (%p), bits %lu
\n
"
,
frameP
,
sfn_msb
,
carrier
->
MIB
,
enc_rval
.
encoded
);
buffer_pP
[
0
]
=
carrier
->
MIB
[
0
];
buffer_pP
[
1
]
=
carrier
->
MIB
[
1
];
buffer_pP
[
2
]
=
carrier
->
MIB
[
2
];
LOG_D
(
NR_RRC
,
"MIB PDU buffer_pP[0]=%x , buffer_pP[1]=%x, buffer_pP[2]=%x
\n
"
,
buffer_pP
[
0
],
buffer_pP
[
1
],
buffer_pP
[
2
]);
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
return
(
3
)
;
}
// MIBCH
if
((
Srb_id
&
RAB_OFFSET
)
==
MIBCH
)
{
asn_enc_rval_t
enc_rval
;
uint8_t
sfn_msb
=
(
uint8_t
)((
frameP
>>
4
)
&
0x3f
);
rrc_gNB_carrier_data_t
*
carrier
=
&
RC
.
nrrrc
[
Mod_idP
]
->
carrier
;
NR_BCCH_BCH_Message_t
*
mib
=
&
carrier
->
mib
;
// Currently we are getting the pdcch_ConfigSIB1 from the configuration file.
// Uncomment this function for a dynamic pdcch_ConfigSIB1.
//channel_bandwidth_t min_channel_bw = bw_10MHz; // Must be obtained based on TS 38.101-1 Table 5.3.5-1
//generate_pdcch_ConfigSIB1(carrier->pdcch_ConfigSIB1,
// *carrier->servingcellconfigcommon->ssbSubcarrierSpacing,
// carrier->mib.message.choice.mib->subCarrierSpacingCommon,
// min_channel_bw);
mib
->
message
.
choice
.
mib
->
pdcch_ConfigSIB1
.
controlResourceSetZero
=
carrier
->
pdcch_ConfigSIB1
->
controlResourceSetZero
;
mib
->
message
.
choice
.
mib
->
pdcch_ConfigSIB1
.
searchSpaceZero
=
carrier
->
pdcch_ConfigSIB1
->
searchSpaceZero
;
mib
->
message
.
choice
.
mib
->
systemFrameNumber
.
buf
[
0
]
=
sfn_msb
<<
2
;
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_BCCH_BCH_Message
,
NULL
,
(
void
*
)
mib
,
carrier
->
MIB
,
24
);
LOG_D
(
NR_RRC
,
"Encoded MIB for frame %d sfn_msb %d (%p), bits %lu
\n
"
,
frameP
,
sfn_msb
,
carrier
->
MIB
,
enc_rval
.
encoded
);
buffer_pP
[
0
]
=
carrier
->
MIB
[
0
];
buffer_pP
[
1
]
=
carrier
->
MIB
[
1
];
buffer_pP
[
2
]
=
carrier
->
MIB
[
2
];
LOG_D
(
NR_RRC
,
"MIB PDU buffer_pP[0]=%x , buffer_pP[1]=%x, buffer_pP[2]=%x
\n
"
,
buffer_pP
[
0
],
buffer_pP
[
1
],
buffer_pP
[
2
]);
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
return
3
;
}
// TODO BCCH SIB1 SIBs
if
((
Srb_id
&
RAB_OFFSET
)
==
BCCH
)
{
memcpy
(
&
buffer_pP
[
0
],
RC
.
nrrrc
[
Mod_idP
]
->
carrier
.
SIB1
,
RC
.
nrrrc
[
Mod_idP
]
->
carrier
.
sizeof_SIB1
);
if
((
Srb_id
&
RAB_OFFSET
)
==
BCCH
)
{
memcpy
(
&
buffer_pP
[
0
],
RC
.
nrrrc
[
Mod_idP
]
->
carrier
.
SIB1
,
RC
.
nrrrc
[
Mod_idP
]
->
carrier
.
sizeof_SIB1
);
return
RC
.
nrrrc
[
Mod_idP
]
->
carrier
.
sizeof_SIB1
;
}
// CCCH
if
(
(
Srb_id
&
RAB_OFFSET
)
==
CCCH
)
{
if
((
Srb_id
&
RAB_OFFSET
)
==
CCCH
)
{
LOG_D
(
NR_RRC
,
"[gNB %d] Frame %d CCCH request (Srb_id %ld)
\n
"
,
Mod_idP
,
frameP
,
Srb_id
);
char
*
payload_pP
;
uint16_t
Sdu_size
=
0
;
struct
rrc_gNB_ue_context_s
*
ue_context_p
=
rrc_gNB_get_ue_context
(
RC
.
nrrrc
[
Mod_idP
],
rnti
);
LOG_D
(
NR_RRC
,
"[gNB %d] Frame %d CCCH request (Srb_id %ld)
\n
"
,
Mod_idP
,
frameP
,
Srb_id
);
if
(
ue_context_p
==
NULL
)
{
LOG_E
(
NR_RRC
,
"[gNB %d] Frame %d CCCH request but no ue_context
\n
"
,
Mod_idP
,
frameP
);
return
0
;
}
AssertFatal
(
ue_context_p
!=
NULL
,
"failed to get ue_context, rnti %x
\n
"
,
rnti
);
uint16_t
payload_size
=
ue_context_p
->
ue_context
.
Srb0
.
Tx_buffer
.
payload_size
;
// check if data is there for MAC
if
(
payload_size
>
0
)
{
payload_pP
=
ue_context_p
->
ue_context
.
Srb0
.
Tx_buffer
.
Payload
;
LOG_D
(
NR_RRC
,
"[gNB %d] CCCH has %d bytes (dest: %p, src %p)
\n
"
,
Mod_idP
,
payload_size
,
buffer_pP
,
payload_pP
);
// Fill buffer
memcpy
((
void
*
)
buffer_pP
,
(
void
*
)
payload_pP
,
payload_size
);
Sdu_size
=
payload_size
;
ue_context_p
->
ue_context
.
Srb0
.
Tx_buffer
.
payload_size
=
0
;
}
return
Sdu
_size
;
return
payload
_size
;
}
return
(
0
);
return
0
;
}
int8_t
nr_mac_rrc_bwp_switch_req
(
const
module_id_t
module_idP
,
...
...
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