Commit 936e030d authored by Chenyu's avatar Chenyu

yihz_srb

parent a9f7c3f8
This diff is collapsed.
......@@ -511,14 +511,15 @@ rb_found:
#endif
}
static void add_srb(int rnti, struct LTE_SRB_ToAddMod *s)
static void add_srb(int rnti, struct NR_SRB_ToAddMod *s, NR_RLC_BearerConfig_t *rlc_BearerConfig)
{
nr_rlc_entity_t *nr_rlc_am;
nr_rlc_ue_t *ue;
struct LTE_SRB_ToAddMod__rlc_Config *r = s->rlc_Config;
struct LTE_SRB_ToAddMod__logicalChannelConfig *l = s->logicalChannelConfig;
struct NR_RLC_Config *r = rlc_BearerConfig->rlc_Config;
struct NR_LogicalChannelConfig *l = rlc_BearerConfig->mac_LogicalChannelConfig;
int srb_id = s->srb_Identity;
int channel_id = rlc_BearerConfig->logicalChannelIdentity;
int logical_channel_group;
int t_status_prohibit;
......@@ -534,50 +535,38 @@ static void add_srb(int rnti, struct LTE_SRB_ToAddMod *s)
__FILE__, __LINE__, __FUNCTION__, srb_id);
exit(1);
}
switch (l->present) {
case LTE_SRB_ToAddMod__logicalChannelConfig_PR_explicitValue:
logical_channel_group = *l->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup;
break;
case LTE_SRB_ToAddMod__logicalChannelConfig_PR_defaultValue:
/* default value from 36.331 9.2.1 */
logical_channel_group = 0;
break;
default:
LOG_E(RLC, "%s:%d:%s: fatal error\n", __FILE__, __LINE__, __FUNCTION__);
if (channel_id != srb_id + 3) {
LOG_E(RLC, "%s:%d:%s: todo, remove this limitation\n",
__FILE__, __LINE__, __FUNCTION__);
exit(1);
}
logical_channel_group = *l->ul_SpecificParameters->logicalChannelGroup;
/* TODO: accept other values? */
if (logical_channel_group != 0) {
if (logical_channel_group != 1) {
LOG_E(RLC, "%s:%d:%s: fatal error\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
}
switch (r->present) {
case LTE_SRB_ToAddMod__rlc_Config_PR_explicitValue: {
struct LTE_RLC_Config__am *am;
if (r->choice.explicitValue.present != LTE_RLC_Config_PR_am) {
LOG_E(RLC, "%s:%d:%s: fatal error, must be RLC AM\n",
__FILE__, __LINE__, __FUNCTION__);
exit(1);
}
am = &r->choice.explicitValue.choice.am;
case NR_RLC_Config_PR_am: {
struct NR_RLC_Config__am *am;
am = r->choice.am;
t_reassembly = decode_t_reassembly(am->dl_AM_RLC.t_Reassembly);
t_status_prohibit = decode_t_status_prohibit(am->dl_AM_RLC.t_StatusProhibit);
t_poll_retransmit = decode_t_poll_retransmit(am->ul_AM_RLC.t_PollRetransmit);
poll_pdu = decode_poll_pdu(am->ul_AM_RLC.pollPDU);
poll_byte = decode_poll_byte(am->ul_AM_RLC.pollByte);
max_retx_threshold = decode_max_retx_threshold(am->ul_AM_RLC.maxRetxThreshold);
if (*am->dl_AM_RLC.sn_FieldLength != *am->ul_AM_RLC.sn_FieldLength) {
LOG_E(RLC, "%s:%d:%s: fatal\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
}
sn_field_length = decode_sn_field_length_am(*am->dl_AM_RLC.sn_FieldLength);
break;
}
case LTE_SRB_ToAddMod__rlc_Config_PR_defaultValue:
/* default values from 36.331 9.2.1 */
t_status_prohibit = 0;
t_poll_retransmit = 45;
poll_pdu = -1;
poll_byte = -1;
max_retx_threshold = 4;
break;
default:
LOG_E(RLC, "%s:%d:%s: fatal error\n", __FILE__, __LINE__, __FUNCTION__);
exit(1);
......@@ -606,7 +595,7 @@ static void add_srb(int rnti, struct LTE_SRB_ToAddMod *s)
t_reassembly, t_status_prohibit,
poll_pdu, poll_byte, max_retx_threshold,
sn_field_length);
nr_rlc_ue_add_srb_rlc_entity(ue, srb_id, nr_rlc_am);
nr_rlc_ue_add_srb_rlc_entity(ue, srb_id, nr_rlc_am);;
LOG_D(RLC, "%s:%d:%s: added srb %d to ue %d\n",
__FILE__, __LINE__, __FUNCTION__, srb_id, rnti);
......@@ -797,14 +786,14 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP
}
rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
const LTE_SRB_ToAddModList_t * const srb2add_listP,
const NR_SRB_ToAddModList_t * const srb2add_listP,
const NR_DRB_ToAddModList_t * const drb2add_listP,
const NR_DRB_ToReleaseList_t * const drb2release_listP,
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list)
{
int rnti = ctxt_pP->rnti;
int i;
int i, j;
if (/*ctxt_pP->enb_flag != 1 ||*/ ctxt_pP->module_id != 0 /*||
ctxt_pP->instance != 0 || ctxt_pP->eNB_index != 0 ||
......@@ -827,13 +816,29 @@ rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt
if (srb2add_listP != NULL) {
for (i = 0; i < srb2add_listP->list.count; i++) {
add_srb(rnti, srb2add_listP->list.array[i]);
for(j = 0; j < rlc_bearer2add_list->list.count; j++){
if(rlc_bearer2add_list->list.array[j]->servedRadioBearer->present != NULL){
if(rlc_bearer2add_list->list.array[j]->servedRadioBearer->present == NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity){ //BearerConfig中关于srb的部分
if(srb2add_listP->list.array[i]->srb_Identity == rlc_bearer2add_list->list.array[j]->servedRadioBearer->choice.srb_Identity){ //两个id相等才能取出来
add_srb(rnti, srb2add_listP->list.array[i], rlc_bearer2add_list->list.array[j]);
}
}
}
}
}
}
if (drb2add_listP != NULL) {
for (i = 0; i < drb2add_listP->list.count; i++) {
add_drb(rnti, drb2add_listP->list.array[i], rlc_bearer2add_list->list.array[i]);
for(j = 0; j < rlc_bearer2add_list->list.count; j++){
if(rlc_bearer2add_list->list.array[j]->servedRadioBearer->present != NULL){
if(rlc_bearer2add_list->list.array[j]->servedRadioBearer->present == NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity){ //BearerConfig中关于drb的部分
if(drb2add_listP->list.array[i]->drb_Identity == rlc_bearer2add_list->list.array[j]->servedRadioBearer->choice.drb_Identity){ //两个id相等才能取出来
add_drb(rnti, drb2add_listP->list.array[i], rlc_bearer2add_list->list.array[j]);
}
}
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment