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
9e6f582f
Commit
9e6f582f
authored
Oct 09, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Activate DRB before
parent
6fc1150b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
72 deletions
+51
-72
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
+2
-1
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+49
-71
No files found.
openair2/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
View file @
9e6f582f
...
@@ -892,7 +892,7 @@ void add_drb(int is_gnb,
...
@@ -892,7 +892,7 @@ void add_drb(int is_gnb,
has_integrity
?
integrity_key
:
NULL
);
has_integrity
?
integrity_key
:
NULL
);
nr_pdcp_ue_add_drb_pdcp_entity
(
ue
,
drb_id
,
pdcp_drb
);
nr_pdcp_ue_add_drb_pdcp_entity
(
ue
,
drb_id
,
pdcp_drb
);
LOG_
D
(
PDCP
,
"%s:%d:%s: added drb %d to UE ID/RNTI %ld
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
drb_id
,
rntiMaybeUEid
);
LOG_
I
(
PDCP
,
"%s:%d:%s: added drb %d to UE ID/RNTI %ld
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
drb_id
,
rntiMaybeUEid
);
new_nr_sdap_entity
(
is_gnb
,
has_sdap_rx
,
has_sdap_tx
,
rntiMaybeUEid
,
pdusession_id
,
is_sdap_DefaultDRB
,
drb_id
,
mappedQFIs2Add
,
mappedQFIs2AddCount
);
new_nr_sdap_entity
(
is_gnb
,
has_sdap_rx
,
has_sdap_tx
,
rntiMaybeUEid
,
pdusession_id
,
is_sdap_DefaultDRB
,
drb_id
,
mappedQFIs2Add
,
mappedQFIs2AddCount
);
}
}
...
@@ -1100,6 +1100,7 @@ void nr_pdcp_release_drb(ue_id_t ue_id, int drb_id)
...
@@ -1100,6 +1100,7 @@ void nr_pdcp_release_drb(ue_id_t ue_id, int drb_id)
nr_pdcp_ue_t
*
ue
=
nr_pdcp_manager_get_ue
(
nr_pdcp_ue_manager
,
ue_id
);
nr_pdcp_ue_t
*
ue
=
nr_pdcp_manager_get_ue
(
nr_pdcp_ue_manager
,
ue_id
);
nr_pdcp_entity_t
*
drb
=
ue
->
drb
[
drb_id
-
1
];
nr_pdcp_entity_t
*
drb
=
ue
->
drb
[
drb_id
-
1
];
if
(
drb
)
{
if
(
drb
)
{
LOG_I
(
PDCP
,
"release bearer %d of UE %ld
\n
"
,
drb_id
,
ue_id
);
drb
->
release_entity
(
drb
);
drb
->
release_entity
(
drb
);
drb
->
delete_entity
(
drb
);
drb
->
delete_entity
(
drb
);
ue
->
drb
[
drb_id
-
1
]
=
NULL
;
ue
->
drb
[
drb_id
-
1
]
=
NULL
;
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
9e6f582f
...
@@ -922,89 +922,21 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
...
@@ -922,89 +922,21 @@ rrc_gNB_generate_dedicatedRRCReconfiguration_release(
static
void
rrc_gNB_process_RRCReconfigurationComplete
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
ue_context_pP
,
const
uint8_t
xid
)
static
void
rrc_gNB_process_RRCReconfigurationComplete
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
ue_context_pP
,
const
uint8_t
xid
)
{
{
int
drb_id
;
int
drb_id
;
uint8_t
kRRCenc
[
16
]
=
{
0
};
uint8_t
kRRCint
[
16
]
=
{
0
};
uint8_t
kUPenc
[
16
]
=
{
0
};
uint8_t
kUPint
[
16
]
=
{
0
};
gNB_RRC_UE_t
*
ue_p
=
&
ue_context_pP
->
ue_context
;
gNB_RRC_UE_t
*
ue_p
=
&
ue_context_pP
->
ue_context
;
NR_DRB_ToAddModList_t
*
DRB_configList
=
createDRBlist
(
ue_p
,
false
);
NR_DRB_ToAddModList_t
*
DRB_configList
=
createDRBlist
(
ue_p
,
false
);
/* Derive the keys from kgnb */
if
(
DRB_configList
!=
NULL
)
{
nr_derive_key
(
UP_ENC_ALG
,
ue_p
->
ciphering_algorithm
,
ue_p
->
kgnb
,
kUPenc
);
nr_derive_key
(
UP_INT_ALG
,
ue_p
->
integrity_algorithm
,
ue_p
->
kgnb
,
kUPint
);
}
nr_derive_key
(
RRC_ENC_ALG
,
ue_p
->
ciphering_algorithm
,
ue_p
->
kgnb
,
kRRCenc
);
nr_derive_key
(
RRC_INT_ALG
,
ue_p
->
integrity_algorithm
,
ue_p
->
kgnb
,
kRRCint
);
/* Refresh SRBs/DRBs */
/* Refresh SRBs/DRBs */
LOG_D
(
NR_RRC
,
"Configuring PDCP DRBs/SRBs for UE %04x
\n
"
,
ue_p
->
rnti
);
LOG_D
(
NR_RRC
,
"Configuring PDCP DRBs/SRBs for UE %04x
\n
"
,
ue_p
->
rnti
);
ue_context_pP
->
ue_context
.
ue_reconfiguration_after_reestablishment_counter
++
;
ue_context_pP
->
ue_context
.
ue_reconfiguration_after_reestablishment_counter
++
;
NR_SRB_ToAddModList_t
*
SRBs
=
createSRBlist
(
ue_p
,
false
);
nr_pdcp_add_srbs
(
ctxt_pP
->
enb_flag
,
ue_p
->
rrc_ue_id
,
SRBs
,
(
ue_p
->
integrity_algorithm
<<
4
)
|
ue_p
->
ciphering_algorithm
,
kRRCenc
,
kRRCint
);
freeSRBlist
(
SRBs
);
nr_pdcp_add_drbs
(
ctxt_pP
->
enb_flag
,
ue_p
->
rrc_ue_id
,
DRB_configList
,
(
ue_p
->
integrity_algorithm
<<
4
)
|
ue_p
->
ciphering_algorithm
,
kUPenc
,
kUPint
);
/* Loop through DRBs and establish if necessary */
/* Loop through DRBs and establish if necessary */
if
(
DRB_configList
!=
NULL
)
{
if
(
DRB_configList
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
DRB_configList
->
list
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
DRB_configList
->
list
.
count
;
i
++
)
{
if
(
DRB_configList
->
list
.
array
[
i
])
{
if
(
DRB_configList
->
list
.
array
[
i
])
{
drb_id
=
(
int
)
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
;
drb_id
=
(
int
)
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
;
LOG_A
(
NR_RRC
,
"[gNB %d] Frame %d : Logical Channel UL-DCCH, Received NR_RRCReconfigurationComplete from UE rnti %lx, reconfiguring DRB %d
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
ctxt_pP
->
rntiMaybeUEid
,
(
int
)
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
);
//(int)*DRB_configList->list.array[i]->pdcp_Config->moreThanOneRLC->primaryPath.logicalChannel);
if
(
ue_p
->
DRB_active
[
drb_id
-
1
]
==
0
)
{
if
(
ue_p
->
DRB_active
[
drb_id
-
1
]
==
0
)
{
ue_p
->
DRB_active
[
drb_id
-
1
]
=
DRB_ACTIVE
;
ue_p
->
DRB_active
[
drb_id
-
1
]
=
DRB_ACTIVE
;
LOG_D
(
NR_RRC
,
"[gNB %d] Frame %d: Establish RLC UM Bidirectional, DRB %d Active
\n
"
,
}
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
(
int
)
DRB_configList
->
list
.
array
[
i
]
->
drb_Identity
);
LOG_D
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" RRC_gNB --- MAC_CONFIG_REQ (DRB) ---> MAC_gNB
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
));
//if (DRB_configList->list.array[i]->pdcp_Config->moreThanOneRLC->primaryPath.logicalChannel) {
// nr_DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->pdcp_Config->moreThanOneRLC->primaryPath.logicalChannel;
//}
// rrc_mac_config_req_eNB
}
else
{
// remove LCHAN from MAC/PHY
if
(
ue_p
->
DRB_active
[
drb_id
]
==
1
)
{
/* TODO : It may be needed if gNB goes into full stack working. */
// DRB has just been removed so remove RLC + PDCP for DRB
/* rrc_pdcp_config_req (ctxt_pP->module_id, frameP, 1, CONFIG_ACTION_REMOVE,
(ue_mod_idP * NB_RB_MAX) + DRB2LCHAN[i],UNDEF_SECURITY_MODE);
*/
/*rrc_rlc_config_req(ctxt_pP,
SRB_FLAG_NO,
MBMS_FLAG_NO,
CONFIG_ACTION_REMOVE,
nr_DRB2LCHAN[i]);*/
}
// ue_p->DRB_active[drb_id] = 0;
LOG_D
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" RRC_eNB --- MAC_CONFIG_REQ (DRB) ---> MAC_eNB
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
));
// rrc_mac_config_req_eNB
}
// end else of if (ue_p->DRB_active[drb_id] == 0)
}
// end if (DRB_configList->list.array[i])
}
// end if (DRB_configList->list.array[i])
}
// end for (int i = 0; i < DRB_configList->list.count; i++)
}
// end for (int i = 0; i < DRB_configList->list.count; i++)
...
@@ -2387,6 +2319,50 @@ int rrc_gNB_process_e1_setup_req(e1ap_setup_req_t *req, instance_t instance) {
...
@@ -2387,6 +2319,50 @@ int rrc_gNB_process_e1_setup_req(e1ap_setup_req_t *req, instance_t instance) {
return
0
;
return
0
;
}
}
static
void
activate_srb
(
gNB_RRC_UE_t
*
UE
,
int
srb_id
)
{
LOG_I
(
RRC
,
"activate SRB %d of UE %d
\n
"
,
srb_id
,
UE
->
rrc_ue_id
);
uint8_t
kRRCenc
[
16
]
=
{
0
};
uint8_t
kRRCint
[
16
]
=
{
0
};
nr_derive_key
(
RRC_ENC_ALG
,
UE
->
ciphering_algorithm
,
UE
->
kgnb
,
kRRCenc
);
nr_derive_key
(
RRC_INT_ALG
,
UE
->
integrity_algorithm
,
UE
->
kgnb
,
kRRCint
);
NR_SRB_ToAddModList_t
*
list
=
CALLOC
(
sizeof
(
*
list
),
1
);
asn1cSequenceAdd
(
list
->
list
,
NR_SRB_ToAddMod_t
,
srb
);
srb
->
srb_Identity
=
srb_id
;
nr_pdcp_add_srbs
(
true
,
UE
->
rrc_ue_id
,
list
,
(
UE
->
integrity_algorithm
<<
4
)
|
UE
->
ciphering_algorithm
,
kRRCenc
,
kRRCint
);
freeSRBlist
(
list
);
}
static
void
activate_drb
(
gNB_RRC_UE_t
*
UE
,
int
drb_id
)
{
LOG_I
(
RRC
,
"activate DRB %d of UE %d
\n
"
,
drb_id
,
UE
->
rrc_ue_id
);
/* Derive the keys from kgnb */
uint8_t
kUPenc
[
16
]
=
{
0
};
uint8_t
kUPint
[
16
]
=
{
0
};
nr_derive_key
(
UP_ENC_ALG
,
UE
->
ciphering_algorithm
,
UE
->
kgnb
,
kUPenc
);
nr_derive_key
(
UP_INT_ALG
,
UE
->
integrity_algorithm
,
UE
->
kgnb
,
kUPint
);
NR_DRB_ToAddModList_t
*
DRB_configList
=
CALLOC
(
sizeof
(
*
DRB_configList
),
1
);
//AssertFatal(UE->established_drbs[drb_id - 1].status == DRB_ACTIVE, "logic bug: DRB %d inactive\n", drb_id);
NR_DRB_ToAddMod_t
*
DRB_config
=
generateDRB_ASN1
(
&
UE
->
established_drbs
[
drb_id
-
1
]);
asn1cSeqAdd
(
&
DRB_configList
->
list
,
DRB_config
);
nr_pdcp_add_drbs
(
true
,
UE
->
rrc_ue_id
,
DRB_configList
,
(
UE
->
integrity_algorithm
<<
4
)
|
UE
->
ciphering_algorithm
,
kUPenc
,
kUPint
);
}
void
prepare_and_send_ue_context_modification_f1
(
rrc_gNB_ue_context_t
*
ue_context_p
,
e1ap_bearer_setup_resp_t
*
e1ap_resp
)
void
prepare_and_send_ue_context_modification_f1
(
rrc_gNB_ue_context_t
*
ue_context_p
,
e1ap_bearer_setup_resp_t
*
e1ap_resp
)
{
{
/* Generate a UE context modification request message towards the DU to
/* Generate a UE context modification request message towards the DU to
...
@@ -2406,6 +2382,7 @@ void prepare_and_send_ue_context_modification_f1(rrc_gNB_ue_context_t *ue_contex
...
@@ -2406,6 +2382,7 @@ void prepare_and_send_ue_context_modification_f1(rrc_gNB_ue_context_t *ue_contex
drbs
[
i
].
up_ul_tnl
[
0
].
port
=
rrc
->
eth_params_s
.
my_portd
;
drbs
[
i
].
up_ul_tnl
[
0
].
port
=
rrc
->
eth_params_s
.
my_portd
;
drbs
[
i
].
up_ul_tnl
[
0
].
teid
=
e1ap_resp
->
pduSession
[
0
].
DRBnGRanList
[
i
].
UpParamList
[
0
].
teId
;
drbs
[
i
].
up_ul_tnl
[
0
].
teid
=
e1ap_resp
->
pduSession
[
0
].
DRBnGRanList
[
i
].
UpParamList
[
0
].
teId
;
drbs
[
i
].
up_ul_tnl_length
=
1
;
drbs
[
i
].
up_ul_tnl_length
=
1
;
activate_drb
(
UE
,
drbs
[
i
].
drb_id
);
}
}
if
(
!
UE
->
as_security_active
)
{
if
(
!
UE
->
as_security_active
)
{
...
@@ -2420,6 +2397,8 @@ void prepare_and_send_ue_context_modification_f1(rrc_gNB_ue_context_t *ue_contex
...
@@ -2420,6 +2397,8 @@ void prepare_and_send_ue_context_modification_f1(rrc_gNB_ue_context_t *ue_contex
int
nb_srb
=
0
;
int
nb_srb
=
0
;
f1ap_srb_to_be_setup_t
srbs
[
1
]
=
{
0
};
f1ap_srb_to_be_setup_t
srbs
[
1
]
=
{
0
};
if
(
UE
->
Srb
[
2
].
Active
==
0
)
{
if
(
UE
->
Srb
[
2
].
Active
==
0
)
{
/* hack: we activate SRB2 here */
activate_srb
(
UE
,
2
);
UE
->
Srb
[
2
].
Active
=
1
;
UE
->
Srb
[
2
].
Active
=
1
;
nb_srb
=
1
;
nb_srb
=
1
;
srbs
[
0
].
srb_id
=
2
;
srbs
[
0
].
srb_id
=
2
;
...
@@ -2814,6 +2793,7 @@ rrc_gNB_generate_SecurityModeCommand(
...
@@ -2814,6 +2793,7 @@ rrc_gNB_generate_SecurityModeCommand(
if
(
n_drbs
>
0
)
{
if
(
n_drbs
>
0
)
{
AssertFatal
(
drbs
!=
NULL
,
"logic bug: n_drbs %d drbs %p
\n
"
,
n_drbs
,
drbs
);
AssertFatal
(
drbs
!=
NULL
,
"logic bug: n_drbs %d drbs %p
\n
"
,
n_drbs
,
drbs
);
AssertFatal
(
ue_p
->
Srb
[
2
].
Active
==
0
,
"logic bug: security command, but SRB2 already active
\n
"
);
AssertFatal
(
ue_p
->
Srb
[
2
].
Active
==
0
,
"logic bug: security command, but SRB2 already active
\n
"
);
activate_srb
(
UE
,
2
);
ue_p
->
Srb
[
2
].
Active
=
1
;
ue_p
->
Srb
[
2
].
Active
=
1
;
nb_srb
=
1
;
nb_srb
=
1
;
srbs
[
0
].
srb_id
=
2
;
srbs
[
0
].
srb_id
=
2
;
...
@@ -2971,8 +2951,6 @@ void rrc_gNB_trigger_new_bearer(int rnti)
...
@@ -2971,8 +2951,6 @@ void rrc_gNB_trigger_new_bearer(int rnti)
}
}
int
xid
=
rrc_gNB_get_next_transaction_identifier
(
0
);
int
xid
=
rrc_gNB_get_next_transaction_identifier
(
0
);
/* generate a new bearer, it will be put into internal RRC state and picked
* up later */
generateDRB
(
ue
,
generateDRB
(
ue
,
drb_id
,
drb_id
,
&
ue
->
pduSession
[
0
],
&
ue
->
pduSession
[
0
],
...
...
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